twd-js 1.5.1 → 1.5.2

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,7 +1,7 @@
1
1
  var Ze = Object.defineProperty;
2
2
  var Qe = (e, t, r) => t in e ? Ze(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
- var ge = (e, t, r) => Qe(e, typeof t != "symbol" ? t + "" : t, r);
4
- var K, w, We, C, me, He, ze, Ne, le, ne, oe, z = {}, Be = [], et = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, Z = Array.isArray;
3
+ var me = (e, t, r) => Qe(e, typeof t != "symbol" ? t + "" : t, r);
4
+ var K, w, He, C, ve, ze, Ne, Be, le, ne, oe, z = {}, De = [], et = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, Z = Array.isArray;
5
5
  function T(e, t) {
6
6
  for (var r in t) e[r] = t[r];
7
7
  return e;
@@ -16,7 +16,7 @@ function tt(e, t, r) {
16
16
  return U(e, l, n, s, null);
17
17
  }
18
18
  function U(e, t, r, n, s) {
19
- var o = { type: e, props: t, key: r, ref: n, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: s ?? ++We, __i: -1, __u: 0 };
19
+ var o = { type: e, props: t, key: r, ref: n, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: s ?? ++He, __i: -1, __u: 0 };
20
20
  return s == null && w.vnode != null && w.vnode(o), o;
21
21
  }
22
22
  function D(e) {
@@ -30,38 +30,38 @@ function I(e, t) {
30
30
  for (var r; t < e.__k.length; t++) if ((r = e.__k[t]) != null && r.__e != null) return r.__e;
31
31
  return typeof e.type == "function" ? I(e) : null;
32
32
  }
33
- function De(e) {
33
+ function Pe(e) {
34
34
  var t, r;
35
35
  if ((e = e.__) != null && e.__c != null) {
36
36
  for (e.__e = e.__c.base = null, t = 0; t < e.__k.length; t++) if ((r = e.__k[t]) != null && r.__e != null) {
37
37
  e.__e = e.__c.base = r.__e;
38
38
  break;
39
39
  }
40
- return De(e);
40
+ return Pe(e);
41
41
  }
42
42
  }
43
- function ve(e) {
44
- (!e.__d && (e.__d = !0) && C.push(e) && !G.__r++ || me != w.debounceRendering) && ((me = w.debounceRendering) || He)(G);
43
+ function we(e) {
44
+ (!e.__d && (e.__d = !0) && C.push(e) && !G.__r++ || ve != w.debounceRendering) && ((ve = w.debounceRendering) || ze)(G);
45
45
  }
46
46
  function G() {
47
- for (var e, t, r, n, s, o, l, c = 1; C.length; ) C.length > c && C.sort(ze), e = C.shift(), c = C.length, e.__d && (r = void 0, n = void 0, s = (n = (t = e).__v).__e, o = [], l = [], t.__P && ((r = T({}, n)).__v = n.__v + 1, w.vnode && w.vnode(r), de(t.__P, r, n, t.__n, t.__P.namespaceURI, 32 & n.__u ? [s] : null, o, s ?? I(n), !!(32 & n.__u), l), r.__v = n.__v, r.__.__k[r.__i] = r, Oe(o, r, l), n.__e = n.__ = null, r.__e != s && De(r)));
47
+ for (var e, t, r, n, s, o, l, c = 1; C.length; ) C.length > c && C.sort(Ne), e = C.shift(), c = C.length, e.__d && (r = void 0, n = void 0, s = (n = (t = e).__v).__e, o = [], l = [], t.__P && ((r = T({}, n)).__v = n.__v + 1, w.vnode && w.vnode(r), de(t.__P, r, n, t.__n, t.__P.namespaceURI, 32 & n.__u ? [s] : null, o, s ?? I(n), !!(32 & n.__u), l), r.__v = n.__v, r.__.__k[r.__i] = r, je(o, r, l), n.__e = n.__ = null, r.__e != s && Pe(r)));
48
48
  G.__r = 0;
49
49
  }
50
- function Pe(e, t, r, n, s, o, l, c, f, a, h) {
51
- var i, u, p, _, g, v, m, y = n && n.__k || Be, E = t.length;
52
- for (f = rt(r, t, y, f, E), i = 0; i < E; i++) (p = r.__k[i]) != null && (u = p.__i == -1 ? z : y[p.__i] || z, p.__i = i, v = de(e, p, u, s, o, l, c, f, a, h), _ = p.__e, p.ref && u.ref != p.ref && (u.ref && _e(u.ref, null, p), h.push(p.ref, p.__c || _, p)), g == null && _ != null && (g = _), (m = !!(4 & p.__u)) || u.__k === p.__k ? f = Fe(p, f, e, m) : typeof p.type == "function" && v !== void 0 ? f = v : _ && (f = _.nextSibling), p.__u &= -7);
50
+ function Fe(e, t, r, n, s, o, l, c, f, a, h) {
51
+ var i, u, p, _, g, v, m, y = n && n.__k || De, E = t.length;
52
+ for (f = rt(r, t, y, f, E), i = 0; i < E; i++) (p = r.__k[i]) != null && (u = p.__i == -1 ? z : y[p.__i] || z, p.__i = i, v = de(e, p, u, s, o, l, c, f, a, h), _ = p.__e, p.ref && u.ref != p.ref && (u.ref && _e(u.ref, null, p), h.push(p.ref, p.__c || _, p)), g == null && _ != null && (g = _), (m = !!(4 & p.__u)) || u.__k === p.__k ? f = Oe(p, f, e, m) : typeof p.type == "function" && v !== void 0 ? f = v : _ && (f = _.nextSibling), p.__u &= -7);
53
53
  return r.__e = g, f;
54
54
  }
55
55
  function rt(e, t, r, n, s) {
56
56
  var o, l, c, f, a, h = r.length, i = h, u = 0;
57
57
  for (e.__k = new Array(s), o = 0; o < s; o++) (l = t[o]) != null && typeof l != "boolean" && typeof l != "function" ? (typeof l == "string" || typeof l == "number" || typeof l == "bigint" || l.constructor == String ? l = e.__k[o] = U(null, l, null, null, null) : Z(l) ? l = e.__k[o] = U(D, { children: l }, null, null, null) : l.constructor === void 0 && l.__b > 0 ? l = e.__k[o] = U(l.type, l.props, l.key, l.ref ? l.ref : null, l.__v) : e.__k[o] = l, f = o + u, l.__ = e, l.__b = e.__b + 1, c = null, (a = l.__i = nt(l, r, f, i)) != -1 && (i--, (c = r[a]) && (c.__u |= 2)), c == null || c.__v == null ? (a == -1 && (s > h ? u-- : s < h && u++), typeof l.type != "function" && (l.__u |= 4)) : a != f && (a == f - 1 ? u-- : a == f + 1 ? u++ : (a > f ? u-- : u++, l.__u |= 4))) : e.__k[o] = null;
58
- if (i) for (o = 0; o < h; o++) (c = r[o]) != null && (2 & c.__u) == 0 && (c.__e == n && (n = I(c)), Ue(c, c));
58
+ if (i) for (o = 0; o < h; o++) (c = r[o]) != null && (2 & c.__u) == 0 && (c.__e == n && (n = I(c)), qe(c, c));
59
59
  return n;
60
60
  }
61
- function Fe(e, t, r, n) {
61
+ function Oe(e, t, r, n) {
62
62
  var s, o;
63
63
  if (typeof e.type == "function") {
64
- for (s = e.__k, o = 0; s && o < s.length; o++) s[o] && (s[o].__ = e, t = Fe(s[o], t, r, n));
64
+ for (s = e.__k, o = 0; s && o < s.length; o++) s[o] && (s[o].__ = e, t = Oe(s[o], t, r, n));
65
65
  return t;
66
66
  }
67
67
  e.__e != t && (n && (t && e.type && !t.parentNode && (t = I(e)), r.insertBefore(e.__e, t || null)), t = e.__e);
@@ -78,17 +78,17 @@ function nt(e, t, r, n) {
78
78
  }
79
79
  return -1;
80
80
  }
81
- function we(e, t, r) {
81
+ function ye(e, t, r) {
82
82
  t[0] == "-" ? e.setProperty(t, r ?? "") : e[t] = r == null ? "" : typeof r != "number" || et.test(t) ? r : r + "px";
83
83
  }
84
84
  function O(e, t, r, n, s) {
85
85
  var o, l;
86
86
  e: if (t == "style") if (typeof r == "string") e.style.cssText = r;
87
87
  else {
88
- if (typeof n == "string" && (e.style.cssText = n = ""), n) for (t in n) r && t in r || we(e.style, t, "");
89
- if (r) for (t in r) n && r[t] == n[t] || we(e.style, t, r[t]);
88
+ if (typeof n == "string" && (e.style.cssText = n = ""), n) for (t in n) r && t in r || ye(e.style, t, "");
89
+ if (r) for (t in r) n && r[t] == n[t] || ye(e.style, t, r[t]);
90
90
  }
91
- else if (t[0] == "o" && t[1] == "n") o = t != (t = t.replace(Ne, "$1")), l = t.toLowerCase(), t = l in e || t == "onFocusOut" || t == "onFocusIn" ? l.slice(2) : t.slice(2), e.l || (e.l = {}), e.l[t + o] = r, r ? n ? r.u = n.u : (r.u = le, e.addEventListener(t, o ? oe : ne, o)) : e.removeEventListener(t, o ? oe : ne, o);
91
+ else if (t[0] == "o" && t[1] == "n") o = t != (t = t.replace(Be, "$1")), l = t.toLowerCase(), t = l in e || t == "onFocusOut" || t == "onFocusIn" ? l.slice(2) : t.slice(2), e.l || (e.l = {}), e.l[t + o] = r, r ? n ? r.u = n.u : (r.u = le, e.addEventListener(t, o ? oe : ne, o)) : e.removeEventListener(t, o ? oe : ne, o);
92
92
  else {
93
93
  if (s == "http://www.w3.org/2000/svg") t = t.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
94
94
  else if (t != "width" && t != "height" && t != "href" && t != "list" && t != "form" && t != "tabIndex" && t != "download" && t != "rowSpan" && t != "colSpan" && t != "role" && t != "popover" && t in e) try {
@@ -99,7 +99,7 @@ function O(e, t, r, n, s) {
99
99
  typeof r == "function" || (r == null || r === !1 && t[4] != "-" ? e.removeAttribute(t) : e.setAttribute(t, t == "popover" && r == 1 ? "" : r));
100
100
  }
101
101
  }
102
- function ye(e) {
102
+ function be(e) {
103
103
  return function(t) {
104
104
  if (this.l) {
105
105
  var r = this.l[t.type + e];
@@ -110,7 +110,7 @@ function ye(e) {
110
110
  };
111
111
  }
112
112
  function de(e, t, r, n, s, o, l, c, f, a) {
113
- var h, i, u, p, _, g, v, m, y, E, $, P, L, he, F, M, te, x = t.type;
113
+ var h, i, u, p, _, g, v, m, y, E, $, P, L, ge, F, M, te, x = t.type;
114
114
  if (t.constructor !== void 0) return null;
115
115
  128 & r.__u && (f = !!(32 & r.__u), o = [c = t.__e = r.__e]), (h = w.__b) && h(t);
116
116
  e: if (typeof x == "function") try {
@@ -127,13 +127,13 @@ function de(e, t, r, n, s, o, l, c, f, a) {
127
127
  i.componentDidUpdate(p, _, g);
128
128
  });
129
129
  }
130
- if (i.context = $, i.props = m, i.__P = e, i.__e = !1, L = w.__r, he = 0, y) {
130
+ if (i.context = $, i.props = m, i.__P = e, i.__e = !1, L = w.__r, ge = 0, y) {
131
131
  for (i.state = i.__s, i.__d = !1, L && L(t), h = i.render(i.props, i.state, i.context), F = 0; F < i._sb.length; F++) i.__h.push(i._sb[F]);
132
132
  i._sb = [];
133
133
  } else do
134
134
  i.__d = !1, L && L(t), h = i.render(i.props, i.state, i.context), i.state = i.__s;
135
- while (i.__d && ++he < 25);
136
- i.state = i.__s, i.getChildContext != null && (n = T(T({}, n), i.getChildContext())), y && !u && i.getSnapshotBeforeUpdate != null && (g = i.getSnapshotBeforeUpdate(p, _)), M = h, h != null && h.type === D && h.key == null && (M = je(h.props.children)), c = Pe(e, Z(M) ? M : [M], t, r, n, s, o, l, c, f, a), i.base = t.__e, t.__u &= -161, i.__h.length && l.push(i), v && (i.__E = i.__ = null);
135
+ while (i.__d && ++ge < 25);
136
+ i.state = i.__s, i.getChildContext != null && (n = T(T({}, n), i.getChildContext())), y && !u && i.getSnapshotBeforeUpdate != null && (g = i.getSnapshotBeforeUpdate(p, _)), M = h, h != null && h.type === D && h.key == null && (M = Ue(h.props.children)), c = Fe(e, Z(M) ? M : [M], t, r, n, s, o, l, c, f, a), i.base = t.__e, t.__u &= -161, i.__h.length && l.push(i), v && (i.__E = i.__ = null);
137
137
  } catch (A) {
138
138
  if (t.__v = null, f || o != null) if (A.then) {
139
139
  for (t.__u |= f ? 160 : 128; c && c.nodeType == 8 && c.nextSibling; ) c = c.nextSibling;
@@ -151,7 +151,7 @@ function de(e, t, r, n, s, o, l, c, f, a) {
151
151
  function se(e) {
152
152
  e && e.__c && (e.__c.__e = !0), e && e.__k && e.__k.forEach(se);
153
153
  }
154
- function Oe(e, t, r) {
154
+ function je(e, t, r) {
155
155
  for (var n = 0; n < r.length; n++) _e(r[n], r[++n], r[++n]);
156
156
  w.__c && w.__c(t, e), e.some(function(s) {
157
157
  try {
@@ -163,8 +163,8 @@ function Oe(e, t, r) {
163
163
  }
164
164
  });
165
165
  }
166
- function je(e) {
167
- return typeof e != "object" || e == null || e.__b && e.__b > 0 ? e : Z(e) ? e.map(je) : T({}, e);
166
+ function Ue(e) {
167
+ return typeof e != "object" || e == null || e.__b && e.__b > 0 ? e : Z(e) ? e.map(Ue) : T({}, e);
168
168
  }
169
169
  function ot(e, t, r, n, s, o, l, c, f) {
170
170
  var a, h, i, u, p, _, g, v = r.props || z, m = t.props, y = t.type;
@@ -190,7 +190,7 @@ function ot(e, t, r, n, s, o, l, c, f) {
190
190
  }
191
191
  for (a in m) p = m[a], a == "children" ? u = p : a == "dangerouslySetInnerHTML" ? h = p : a == "value" ? _ = p : a == "checked" ? g = p : c && typeof p != "function" || v[a] === p || O(e, a, p, v[a], s);
192
192
  if (h) c || i && (h.__html == i.__html || h.__html == e.innerHTML) || (e.innerHTML = h.__html), t.__k = [];
193
- else if (i && (e.innerHTML = ""), Pe(t.type == "template" ? e.content : e, Z(u) ? u : [u], t, r, n, y == "foreignObject" ? "http://www.w3.org/1999/xhtml" : s, o, l, o ? o[0] : r.__k && I(r, 0), c, f), o != null) for (a = o.length; a--; ) ce(o[a]);
193
+ else if (i && (e.innerHTML = ""), Fe(t.type == "template" ? e.content : e, Z(u) ? u : [u], t, r, n, y == "foreignObject" ? "http://www.w3.org/1999/xhtml" : s, o, l, o ? o[0] : r.__k && I(r, 0), c, f), o != null) for (a = o.length; a--; ) ce(o[a]);
194
194
  c || (a = "value", y == "progress" && _ == null ? e.removeAttribute("value") : _ != null && (_ !== e[a] || y == "progress" && !_ || y == "option" && _ != v[a]) && O(e, a, _, v[a], s), a = "checked", g != null && g != e[a] && O(e, a, g, v[a], s));
195
195
  }
196
196
  return e;
@@ -205,7 +205,7 @@ function _e(e, t, r) {
205
205
  w.__e(s, r);
206
206
  }
207
207
  }
208
- function Ue(e, t, r) {
208
+ function qe(e, t, r) {
209
209
  var n, s;
210
210
  if (w.unmount && w.unmount(e), (n = e.ref) && (n.current && n.current != e.__e || _e(n, null, t)), (n = e.__c) != null) {
211
211
  if (n.componentWillUnmount) try {
@@ -215,7 +215,7 @@ function Ue(e, t, r) {
215
215
  }
216
216
  n.base = n.__P = null;
217
217
  }
218
- if (n = e.__k) for (s = 0; s < n.length; s++) n[s] && Ue(n[s], t, r || typeof e.type != "function");
218
+ if (n = e.__k) for (s = 0; s < n.length; s++) n[s] && qe(n[s], t, r || typeof e.type != "function");
219
219
  r || ce(e.__e), e.__c = e.__ = e.__e = void 0;
220
220
  }
221
221
  function st(e, t, r) {
@@ -223,23 +223,23 @@ function st(e, t, r) {
223
223
  }
224
224
  function it(e, t, r) {
225
225
  var n, s, o, l;
226
- t == document && (t = document.documentElement), w.__ && w.__(e, t), s = (n = !1) ? null : t.__k, o = [], l = [], de(t, e = t.__k = tt(D, null, [e]), s || z, z, t.namespaceURI, s ? null : t.firstChild ? K.call(t.childNodes) : null, o, s ? s.__e : t.firstChild, n, l), Oe(o, e, l);
226
+ t == document && (t = document.documentElement), w.__ && w.__(e, t), s = (n = !1) ? null : t.__k, o = [], l = [], de(t, e = t.__k = tt(D, null, [e]), s || z, z, t.namespaceURI, s ? null : t.firstChild ? K.call(t.childNodes) : null, o, s ? s.__e : t.firstChild, n, l), je(o, e, l);
227
227
  }
228
- K = Be.slice, w = { __e: function(e, t, r, n) {
228
+ K = De.slice, w = { __e: function(e, t, r, n) {
229
229
  for (var s, o, l; t = t.__; ) if ((s = t.__c) && !s.__) try {
230
230
  if ((o = s.constructor) && o.getDerivedStateFromError != null && (s.setState(o.getDerivedStateFromError(e)), l = s.__d), s.componentDidCatch != null && (s.componentDidCatch(e, n || {}), l = s.__d), l) return s.__E = s;
231
231
  } catch (c) {
232
232
  e = c;
233
233
  }
234
234
  throw e;
235
- } }, We = 0, q.prototype.setState = function(e, t) {
235
+ } }, He = 0, q.prototype.setState = function(e, t) {
236
236
  var r;
237
- r = this.__s != null && this.__s != this.state ? this.__s : this.__s = T({}, this.state), typeof e == "function" && (e = e(T({}, r), this.props)), e && T(r, e), e != null && this.__v && (t && this._sb.push(t), ve(this));
237
+ r = this.__s != null && this.__s != this.state ? this.__s : this.__s = T({}, this.state), typeof e == "function" && (e = e(T({}, r), this.props)), e && T(r, e), e != null && this.__v && (t && this._sb.push(t), we(this));
238
238
  }, q.prototype.forceUpdate = function(e) {
239
- this.__v && (this.__e = !0, e && this.__h.push(e), ve(this));
240
- }, q.prototype.render = D, C = [], He = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, ze = function(e, t) {
239
+ this.__v && (this.__e = !0, e && this.__h.push(e), we(this));
240
+ }, q.prototype.render = D, C = [], ze = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, Ne = function(e, t) {
241
241
  return e.__v.__b - t.__v.__b;
242
- }, G.__r = 0, Ne = /(PointerCapture)$|Capture$/i, le = 0, ne = ye(!1), oe = ye(!0);
242
+ }, G.__r = 0, Be = /(PointerCapture)$|Capture$/i, le = 0, ne = be(!1), oe = be(!0);
243
243
  var at = 0;
244
244
  function d(e, t, r, n, s, o) {
245
245
  t || (t = {});
@@ -337,18 +337,18 @@ const _t = (e) => {
337
337
  for (const s in e) await e[s]();
338
338
  _t({ Component: t, createRoot: r, theme: n });
339
339
  };
340
- var N, b, re, be, Y = 0, qe = [], k = w, ke = k.__b, Se = k.__r, xe = k.diffed, Te = k.__c, Ee = k.unmount, Re = k.__;
340
+ var N, b, re, ke, Y = 0, Ve = [], k = w, Se = k.__b, xe = k.__r, Te = k.diffed, Ee = k.__c, Re = k.unmount, $e = k.__;
341
341
  function ue(e, t) {
342
342
  k.__h && k.__h(b, e, Y || t), Y = 0;
343
343
  var r = b.__H || (b.__H = { __: [], __h: [] });
344
344
  return e >= r.__.length && r.__.push({}), r.__[e];
345
345
  }
346
346
  function V(e) {
347
- return Y = 1, pt(Je, e);
347
+ return Y = 1, pt(Xe, e);
348
348
  }
349
349
  function pt(e, t, r) {
350
350
  var n = ue(N++, 2);
351
- if (n.t = e, !n.__c && (n.__ = [Je(void 0, t), function(c) {
351
+ if (n.t = e, !n.__c && (n.__ = [Xe(void 0, t), function(c) {
352
352
  var f = n.__N ? n.__N[0] : n.__[0], a = n.t(f, c);
353
353
  f !== a && (n.__N = [a, n.__[1]], n.__c.setState({}));
354
354
  }], n.__c = b, !b.__f)) {
@@ -382,7 +382,7 @@ function pt(e, t, r) {
382
382
  }
383
383
  function Q(e, t) {
384
384
  var r = ue(N++, 3);
385
- !k.__s && Ve(r.__H, t) && (r.__ = e, r.u = t, b.__H.__h.push(r));
385
+ !k.__s && Je(r.__H, t) && (r.__ = e, r.u = t, b.__H.__h.push(r));
386
386
  }
387
387
  function H(e) {
388
388
  return Y = 5, J(function() {
@@ -391,29 +391,29 @@ function H(e) {
391
391
  }
392
392
  function J(e, t) {
393
393
  var r = ue(N++, 7);
394
- return Ve(r.__H, t) && (r.__ = e(), r.__H = t, r.__h = e), r.__;
394
+ return Je(r.__H, t) && (r.__ = e(), r.__H = t, r.__h = e), r.__;
395
395
  }
396
396
  function ft() {
397
- for (var e; e = qe.shift(); ) if (e.__P && e.__H) try {
397
+ for (var e; e = Ve.shift(); ) if (e.__P && e.__H) try {
398
398
  e.__H.__h.forEach(X), e.__H.__h.forEach(ie), e.__H.__h = [];
399
399
  } catch (t) {
400
400
  e.__H.__h = [], k.__e(t, e.__v);
401
401
  }
402
402
  }
403
403
  k.__b = function(e) {
404
- b = null, ke && ke(e);
404
+ b = null, Se && Se(e);
405
405
  }, k.__ = function(e, t) {
406
- e && t.__k && t.__k.__m && (e.__m = t.__k.__m), Re && Re(e, t);
406
+ e && t.__k && t.__k.__m && (e.__m = t.__k.__m), $e && $e(e, t);
407
407
  }, k.__r = function(e) {
408
- Se && Se(e), N = 0;
408
+ xe && xe(e), N = 0;
409
409
  var t = (b = e.__c).__H;
410
410
  t && (re === b ? (t.__h = [], b.__h = [], t.__.forEach(function(r) {
411
411
  r.__N && (r.__ = r.__N), r.u = r.__N = void 0;
412
412
  })) : (t.__h.forEach(X), t.__h.forEach(ie), t.__h = [], N = 0)), re = b;
413
413
  }, k.diffed = function(e) {
414
- xe && xe(e);
414
+ Te && Te(e);
415
415
  var t = e.__c;
416
- t && t.__H && (t.__H.__h.length && (qe.push(t) !== 1 && be === k.requestAnimationFrame || ((be = k.requestAnimationFrame) || ht)(ft)), t.__H.__.forEach(function(r) {
416
+ t && t.__H && (t.__H.__h.length && (Ve.push(t) !== 1 && ke === k.requestAnimationFrame || ((ke = k.requestAnimationFrame) || ht)(ft)), t.__H.__.forEach(function(r) {
417
417
  r.u && (r.__H = r.u), r.u = void 0;
418
418
  })), re = b = null;
419
419
  }, k.__c = function(e, t) {
@@ -427,9 +427,9 @@ k.__b = function(e) {
427
427
  s.__h && (s.__h = []);
428
428
  }), t = [], k.__e(n, r.__v);
429
429
  }
430
- }), Te && Te(e, t);
430
+ }), Ee && Ee(e, t);
431
431
  }, k.unmount = function(e) {
432
- Ee && Ee(e);
432
+ Re && Re(e);
433
433
  var t, r = e.__c;
434
434
  r && r.__H && (r.__H.__.forEach(function(n) {
435
435
  try {
@@ -439,12 +439,12 @@ k.__b = function(e) {
439
439
  }
440
440
  }), r.__H = void 0, t && k.__e(t, r.__v));
441
441
  };
442
- var $e = typeof requestAnimationFrame == "function";
442
+ var Ce = typeof requestAnimationFrame == "function";
443
443
  function ht(e) {
444
444
  var t, r = function() {
445
- clearTimeout(n), $e && cancelAnimationFrame(t), setTimeout(e);
445
+ clearTimeout(n), Ce && cancelAnimationFrame(t), setTimeout(e);
446
446
  }, n = setTimeout(r, 35);
447
- $e && (t = requestAnimationFrame(r));
447
+ Ce && (t = requestAnimationFrame(r));
448
448
  }
449
449
  function X(e) {
450
450
  var t = b, r = e.__c;
@@ -454,12 +454,12 @@ function ie(e) {
454
454
  var t = b;
455
455
  e.__c = e.__(), b = t;
456
456
  }
457
- function Ve(e, t) {
457
+ function Je(e, t) {
458
458
  return !e || e.length !== t.length || t.some(function(r, n) {
459
459
  return r !== e[n];
460
460
  });
461
461
  }
462
- function Je(e, t) {
462
+ function Xe(e, t) {
463
463
  return typeof t == "function" ? t(e) : t;
464
464
  }
465
465
  const gt = (e) => {
@@ -510,7 +510,7 @@ const ee = ({ className: e, children: t, dataTestId: r }) => /* @__PURE__ */ d(
510
510
  "data-testid": r,
511
511
  children: t
512
512
  }
513
- ), wt = () => /* @__PURE__ */ d(ee, { className: "lucide-play-icon lucide-play", dataTestId: "play-icon", children: /* @__PURE__ */ d("path", { d: "M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z" }) }), Xe = ({ id: e, name: t, skip: r, only: n }) => /* @__PURE__ */ d(D, { children: [
513
+ ), wt = () => /* @__PURE__ */ d(ee, { className: "lucide-play-icon lucide-play", dataTestId: "play-icon", children: /* @__PURE__ */ d("path", { d: "M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z" }) }), Ge = ({ id: e, name: t, skip: r, only: n }) => /* @__PURE__ */ d(D, { children: [
514
514
  t,
515
515
  " ",
516
516
  n && /* @__PURE__ */ d(
@@ -545,7 +545,7 @@ const yt = (e) => {
545
545
  } catch {
546
546
  }
547
547
  return null;
548
- }, Ce = (e) => {
548
+ }, Ae = (e) => {
549
549
  if (e === null) return "null";
550
550
  if (e === void 0) return "undefined";
551
551
  if (typeof e == "string") return e;
@@ -593,7 +593,7 @@ const yt = (e) => {
593
593
  overflowX: "auto",
594
594
  whiteSpace: "pre-wrap",
595
595
  wordBreak: "break-word"
596
- }, children: Ce(r.expected) })
596
+ }, children: Ae(r.expected) })
597
597
  ] }),
598
598
  /* @__PURE__ */ d("div", { style: {
599
599
  marginTop: "var(--twd-spacing-xs)",
@@ -614,7 +614,7 @@ const yt = (e) => {
614
614
  overflowX: "auto",
615
615
  whiteSpace: "pre-wrap",
616
616
  wordBreak: "break-word"
617
- }, children: Ce(r.actual) })
617
+ }, children: Ae(r.actual) })
618
618
  ] })
619
619
  ]
620
620
  },
@@ -771,7 +771,7 @@ const yt = (e) => {
771
771
  children: [
772
772
  /* @__PURE__ */ d("div", { style: h, children: [
773
773
  /* @__PURE__ */ d("span", { style: W.nameSpan, children: /* @__PURE__ */ d(
774
- Xe,
774
+ Ge,
775
775
  {
776
776
  id: r,
777
777
  name: e.name,
@@ -865,7 +865,7 @@ const yt = (e) => {
865
865
  "aria-label": `${i ? "Expand" : "Collapse"} test suite ${a.name}`,
866
866
  onClick: () => l(a.id),
867
867
  children: [
868
- /* @__PURE__ */ d(Xe, { id: a.id, name: a.name, skip: a.skip, only: a.only }),
868
+ /* @__PURE__ */ d(Ge, { id: a.id, name: a.name, skip: a.skip, only: a.only }),
869
869
  i ? /* @__PURE__ */ d($t, {}) : /* @__PURE__ */ d(Rt, {})
870
870
  ]
871
871
  }
@@ -935,11 +935,11 @@ const yt = (e) => {
935
935
  beforeEachHooks: /* @__PURE__ */ new Map(),
936
936
  afterEachHooks: /* @__PURE__ */ new Map(),
937
937
  stack: []
938
- }, pe = Mt(), S = pe.handlers, Ae = pe.beforeEachHooks, Ie = pe.afterEachHooks, Wt = (e) => {
938
+ }, pe = Mt(), S = pe.handlers, Ie = pe.beforeEachHooks, Le = pe.afterEachHooks, Wt = (e) => {
939
939
  const t = [], r = [];
940
940
  let n = e;
941
941
  for (; n; )
942
- Ae.has(n) && t.unshift(...Ae.get(n)), Ie.has(n) && r.push(...Ie.get(n)), n = S.get(n)?.parent;
942
+ Ie.has(n) && t.unshift(...Ie.get(n)), Le.has(n) && r.push(...Le.get(n)), n = S.get(n)?.parent;
943
943
  return { before: t, after: r };
944
944
  }, ae = (e) => {
945
945
  const t = S.get(e);
@@ -952,7 +952,7 @@ const yt = (e) => {
952
952
  t = r;
953
953
  }
954
954
  return !1;
955
- }, Le = (e) => {
955
+ }, Me = (e) => {
956
956
  let t = S.get(e);
957
957
  for (; t; ) {
958
958
  if (t.skip) return !0;
@@ -961,9 +961,9 @@ const yt = (e) => {
961
961
  }
962
962
  return !1;
963
963
  };
964
- class Ge {
964
+ class Ye {
965
965
  constructor(t) {
966
- ge(this, "events");
966
+ me(this, "events");
967
967
  this.events = t;
968
968
  }
969
969
  async runAll() {
@@ -980,7 +980,7 @@ class Ge {
980
980
  await this.runTest(r, !1);
981
981
  }
982
982
  async runSuite(t, r) {
983
- if (Le(t.id) && !ae(t.id)) {
983
+ if (Me(t.id) && !ae(t.id)) {
984
984
  this.events.onSkip?.(t);
985
985
  return;
986
986
  }
@@ -992,7 +992,7 @@ class Ge {
992
992
  this.events.onSuiteEnd?.(t);
993
993
  }
994
994
  async runTest(t, r) {
995
- if ((Le(t.id) || t.skip) && !t.only) {
995
+ if ((Me(t.id) || t.skip) && !t.only) {
996
996
  this.events.onSkip(t);
997
997
  return;
998
998
  }
@@ -1013,37 +1013,37 @@ class Ge {
1013
1013
  }
1014
1014
  }
1015
1015
  }
1016
- window.__testRunner = Ge;
1017
- const Ye = "1.5.1", zt = () => typeof window < "u" ? (window.__TWD_MOCK_STATE__ || (window.__TWD_MOCK_STATE__ = {
1016
+ window.__testRunner = Ye;
1017
+ const fe = "1.5.2", zt = () => typeof window < "u" ? (window.__TWD_MOCK_STATE__ || (window.__TWD_MOCK_STATE__ = {
1018
1018
  rules: [],
1019
1019
  counts: {}
1020
1020
  }), window.__TWD_MOCK_STATE__) : {
1021
1021
  rules: [],
1022
1022
  counts: {}
1023
- }, B = zt(), fe = B.rules;
1024
- let Me = !1;
1023
+ }, B = zt(), he = B.rules;
1024
+ let We = !1;
1025
1025
  const Nt = async (e) => {
1026
- if (Me) {
1026
+ if (We) {
1027
1027
  console.warn("[TWD] Request mocking already initialized");
1028
1028
  return;
1029
1029
  }
1030
1030
  if ("serviceWorker" in navigator) {
1031
- Me = !0;
1031
+ We = !0;
1032
1032
  const t = e ?? "/mock-sw.js";
1033
- await navigator.serviceWorker.register(`${t}?v=${Ye}`), navigator.serviceWorker.controller || await new Promise((r) => {
1033
+ await navigator.serviceWorker.register(`${t}?v=${fe}`), navigator.serviceWorker.controller || await new Promise((r) => {
1034
1034
  navigator.serviceWorker.addEventListener("controllerchange", r, { once: !0 });
1035
1035
  }), navigator.serviceWorker.addEventListener("message", (r) => {
1036
1036
  if (r.data?.type === "EXECUTED") {
1037
- const { alias: n, request: s, hitCount: o } = r.data, l = fe.find((c) => c.alias === n);
1037
+ const { alias: n, request: s, hitCount: o } = r.data, l = he.find((c) => c.alias === n);
1038
1038
  l && (l.executed = !0, l.request = s, l.hitCount = o), B.counts[n] = o ?? (B.counts[n] ?? 0) + 1;
1039
1039
  }
1040
1040
  });
1041
1041
  }
1042
- }, Bt = () => fe, Dt = () => {
1042
+ }, Bt = () => he, Dt = () => {
1043
1043
  navigator.serviceWorker.controller?.postMessage({
1044
1044
  type: "CLEAR_RULES",
1045
- version: Ye
1046
- }), fe.length = 0;
1045
+ version: fe
1046
+ }), he.length = 0;
1047
1047
  for (const e in B.counts)
1048
1048
  delete B.counts[e];
1049
1049
  }, Pt = () => /* @__PURE__ */ d(ee, { className: "lucide-wifi-pen-icon lucide-wifi-pen", dataTestId: "wifi-pen-icon", children: [
@@ -1143,7 +1143,7 @@ const Ut = (e) => e instanceof Error && "actual" in e && "expected" in e, Ke = (
1143
1143
  const _ = () => n((g) => g + 1);
1144
1144
  return window.addEventListener("twd:state-change", _), () => window.removeEventListener("twd:state-change", _);
1145
1145
  }, []);
1146
- const f = new Ge({
1146
+ const f = new Ye({
1147
1147
  onStart: (_) => {
1148
1148
  _.status = "running", n((g) => g + 1);
1149
1149
  },
@@ -1259,7 +1259,15 @@ const Ut = (e) => e instanceof Error && "actual" in e && "expected" in e, Ke = (
1259
1259
  },
1260
1260
  children: "Clear mocks"
1261
1261
  }
1262
- )
1262
+ ),
1263
+ /* @__PURE__ */ d("span", { style: {
1264
+ color: "var(--twd-text-secondary)",
1265
+ fontSize: "var(--twd-font-size-sm)",
1266
+ alignSelf: "center"
1267
+ }, children: [
1268
+ "v",
1269
+ fe
1270
+ ] })
1263
1271
  ] }),
1264
1272
  /* @__PURE__ */ d(
1265
1273
  "button",
package/dist/cli.js CHANGED
@@ -29,7 +29,7 @@ if (save) {
29
29
  console.log("💡 Remember to register it in your app:");
30
30
  console.log(`
31
31
  if ("serviceWorker" in navigator) {
32
- navigator.serviceWorker.register("/mock-sw.js?v=1");
32
+ navigator.serviceWorker.register("/mock-sw.js");
33
33
  }
34
34
  `);
35
35
  }