best-unit 0.0.7 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/best-unit.js CHANGED
@@ -1,459 +1,397 @@
1
- function et() {
1
+ function ln() {
2
2
  console.log("npm package test!!!");
3
3
  }
4
- function tt() {
4
+ function _n() {
5
5
  console.log("Current time:", (/* @__PURE__ */ new Date()).toISOString());
6
6
  }
7
- var D, d, ye, S, oe, ge, be, ke, Z, J, K, M = {}, we = [], Me = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, B = Array.isArray;
8
- function C(e, t) {
9
- for (var _ in t) e[_] = t[_];
7
+ var H, g, me, w, le, be, xe, Ee, Z, K, Q, R = {}, ke = [], He = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, G = Array.isArray;
8
+ function C(e, n) {
9
+ for (var r in n) e[r] = n[r];
10
10
  return e;
11
11
  }
12
12
  function ee(e) {
13
13
  e && e.parentNode && e.parentNode.removeChild(e);
14
14
  }
15
- function E(e, t, _) {
16
- var n, o, r, l = {};
17
- for (r in t) r == "key" ? n = t[r] : r == "ref" ? o = t[r] : l[r] = t[r];
18
- if (arguments.length > 2 && (l.children = arguments.length > 3 ? D.call(arguments, 2) : _), typeof e == "function" && e.defaultProps != null) for (r in e.defaultProps) l[r] === void 0 && (l[r] = e.defaultProps[r]);
19
- return L(e, l, n, o, null);
15
+ function S(e, n, r) {
16
+ var t, l, o, _ = {};
17
+ for (o in n) o == "key" ? t = n[o] : o == "ref" ? l = n[o] : _[o] = n[o];
18
+ if (arguments.length > 2 && (_.children = arguments.length > 3 ? H.call(arguments, 2) : r), typeof e == "function" && e.defaultProps != null) for (o in e.defaultProps) _[o] === void 0 && (_[o] = e.defaultProps[o]);
19
+ return D(e, _, t, l, null);
20
20
  }
21
- function L(e, t, _, n, o) {
22
- var r = { type: e, props: t, key: _, ref: n, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: o ?? ++ye, __i: -1, __u: 0 };
23
- return o == null && d.vnode != null && d.vnode(r), r;
21
+ function D(e, n, r, t, l) {
22
+ var o = { type: e, props: n, key: r, ref: t, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: l ?? ++me, __i: -1, __u: 0 };
23
+ return l == null && g.vnode != null && g.vnode(o), o;
24
24
  }
25
- function q(e) {
25
+ function A(e) {
26
26
  return e.children;
27
27
  }
28
- function I(e, t) {
29
- this.props = e, this.context = t;
28
+ function O(e, n) {
29
+ this.props = e, this.context = n;
30
30
  }
31
- function P(e, t) {
32
- if (t == null) return e.__ ? P(e.__, e.__i + 1) : null;
33
- for (var _; t < e.__k.length; t++) if ((_ = e.__k[t]) != null && _.__e != null) return _.__e;
34
- return typeof e.type == "function" ? P(e) : null;
31
+ function B(e, n) {
32
+ if (n == null) return e.__ ? B(e.__, e.__i + 1) : null;
33
+ for (var r; n < e.__k.length; n++) if ((r = e.__k[n]) != null && r.__e != null) return r.__e;
34
+ return typeof e.type == "function" ? B(e) : null;
35
35
  }
36
- function xe(e) {
37
- var t, _;
36
+ function Ce(e) {
37
+ var n, r;
38
38
  if ((e = e.__) != null && e.__c != null) {
39
- for (e.__e = e.__c.base = null, t = 0; t < e.__k.length; t++) if ((_ = e.__k[t]) != null && _.__e != null) {
40
- e.__e = e.__c.base = _.__e;
39
+ for (e.__e = e.__c.base = null, n = 0; n < e.__k.length; n++) if ((r = e.__k[n]) != null && r.__e != null) {
40
+ e.__e = e.__c.base = r.__e;
41
41
  break;
42
42
  }
43
- return xe(e);
43
+ return Ce(e);
44
44
  }
45
45
  }
46
- function ie(e) {
47
- (!e.__d && (e.__d = !0) && S.push(e) && !R.__r++ || oe != d.debounceRendering) && ((oe = d.debounceRendering) || ge)(R);
46
+ function _e(e) {
47
+ (!e.__d && (e.__d = !0) && w.push(e) && !W.__r++ || le != g.debounceRendering) && ((le = g.debounceRendering) || be)(W);
48
48
  }
49
- function R() {
50
- for (var e, t, _, n, o, r, l, u = 1; S.length; ) S.length > u && S.sort(be), e = S.shift(), u = S.length, e.__d && (_ = void 0, o = (n = (t = e).__v).__e, r = [], l = [], t.__P && ((_ = C({}, n)).__v = n.__v + 1, d.vnode && d.vnode(_), te(t.__P, _, n, t.__n, t.__P.namespaceURI, 32 & n.__u ? [o] : null, r, o ?? P(n), !!(32 & n.__u), l), _.__v = n.__v, _.__.__k[_.__i] = _, Se(r, _, l), _.__e != o && xe(_)));
51
- R.__r = 0;
49
+ function W() {
50
+ for (var e, n, r, t, l, o, _, a = 1; w.length; ) w.length > a && w.sort(xe), e = w.shift(), a = w.length, e.__d && (r = void 0, l = (t = (n = e).__v).__e, o = [], _ = [], n.__P && ((r = C({}, t)).__v = t.__v + 1, g.vnode && g.vnode(r), ne(n.__P, r, t, n.__n, n.__P.namespaceURI, 32 & t.__u ? [l] : null, o, l ?? B(t), !!(32 & t.__u), _), r.__v = t.__v, r.__.__k[r.__i] = r, Se(o, r, _), r.__e != l && Ce(r)));
51
+ W.__r = 0;
52
52
  }
53
- function Ce(e, t, _, n, o, r, l, u, c, s, f) {
54
- var i, p, a, g, w, b, h = n && n.__k || we, m = t.length;
55
- for (c = De(_, t, h, c, m), i = 0; i < m; i++) (a = _.__k[i]) != null && (p = a.__i == -1 ? M : h[a.__i] || M, a.__i = i, b = te(e, a, p, o, r, l, u, c, s, f), g = a.__e, a.ref && p.ref != a.ref && (p.ref && _e(p.ref, null, a), f.push(a.ref, a.__c || g, a)), w == null && g != null && (w = g), 4 & a.__u || p.__k === a.__k ? c = $e(a, c, e) : typeof a.type == "function" && b !== void 0 ? c = b : g && (c = g.nextSibling), a.__u &= -7);
56
- return _.__e = w, c;
53
+ function Fe(e, n, r, t, l, o, _, a, f, s, p) {
54
+ var i, d, c, h, E, x, v = t && t.__k || ke, y = n.length;
55
+ for (f = Ae(r, n, v, f, y), i = 0; i < y; i++) (c = r.__k[i]) != null && (d = c.__i == -1 ? R : v[c.__i] || R, c.__i = i, x = ne(e, c, d, l, o, _, a, f, s, p), h = c.__e, c.ref && d.ref != c.ref && (d.ref && re(d.ref, null, c), p.push(c.ref, c.__c || h, c)), E == null && h != null && (E = h), 4 & c.__u || d.__k === c.__k ? f = we(c, f, e) : typeof c.type == "function" && x !== void 0 ? f = x : h && (f = h.nextSibling), c.__u &= -7);
56
+ return r.__e = E, f;
57
57
  }
58
- function De(e, t, _, n, o) {
59
- var r, l, u, c, s, f = _.length, i = f, p = 0;
60
- for (e.__k = new Array(o), r = 0; r < o; r++) (l = t[r]) != null && typeof l != "boolean" && typeof l != "function" ? (c = r + p, (l = e.__k[r] = typeof l == "string" || typeof l == "number" || typeof l == "bigint" || l.constructor == String ? L(null, l, null, null, null) : B(l) ? L(q, { children: l }, null, null, null) : l.constructor == null && l.__b > 0 ? L(l.type, l.props, l.key, l.ref ? l.ref : null, l.__v) : l).__ = e, l.__b = e.__b + 1, u = null, (s = l.__i = Fe(l, _, c, i)) != -1 && (i--, (u = _[s]) && (u.__u |= 2)), u == null || u.__v == null ? (s == -1 && (o > f ? p-- : o < f && p++), typeof l.type != "function" && (l.__u |= 4)) : s != c && (s == c - 1 ? p-- : s == c + 1 ? p++ : (s > c ? p-- : p++, l.__u |= 4))) : e.__k[r] = null;
61
- if (i) for (r = 0; r < f; r++) (u = _[r]) != null && (2 & u.__u) == 0 && (u.__e == n && (n = P(u)), Pe(u, u));
62
- return n;
58
+ function Ae(e, n, r, t, l) {
59
+ var o, _, a, f, s, p = r.length, i = p, d = 0;
60
+ for (e.__k = new Array(l), o = 0; o < l; o++) (_ = n[o]) != null && typeof _ != "boolean" && typeof _ != "function" ? (f = o + d, (_ = e.__k[o] = typeof _ == "string" || typeof _ == "number" || typeof _ == "bigint" || _.constructor == String ? D(null, _, null, null, null) : G(_) ? D(A, { children: _ }, null, null, null) : _.constructor == null && _.__b > 0 ? D(_.type, _.props, _.key, _.ref ? _.ref : null, _.__v) : _).__ = e, _.__b = e.__b + 1, a = null, (s = _.__i = Ne(_, r, f, i)) != -1 && (i--, (a = r[s]) && (a.__u |= 2)), a == null || a.__v == null ? (s == -1 && (l > p ? d-- : l < p && d++), typeof _.type != "function" && (_.__u |= 4)) : s != f && (s == f - 1 ? d-- : s == f + 1 ? d++ : (s > f ? d-- : d++, _.__u |= 4))) : e.__k[o] = null;
61
+ if (i) for (o = 0; o < p; o++) (a = r[o]) != null && (2 & a.__u) == 0 && (a.__e == t && (t = B(a)), $e(a, a));
62
+ return t;
63
63
  }
64
- function $e(e, t, _) {
65
- var n, o;
64
+ function we(e, n, r) {
65
+ var t, l;
66
66
  if (typeof e.type == "function") {
67
- for (n = e.__k, o = 0; n && o < n.length; o++) n[o] && (n[o].__ = e, t = $e(n[o], t, _));
68
- return t;
67
+ for (t = e.__k, l = 0; t && l < t.length; l++) t[l] && (t[l].__ = e, n = we(t[l], n, r));
68
+ return n;
69
69
  }
70
- e.__e != t && (t && e.type && !_.contains(t) && (t = P(e)), _.insertBefore(e.__e, t || null), t = e.__e);
70
+ e.__e != n && (n && e.type && !r.contains(n) && (n = B(e)), r.insertBefore(e.__e, n || null), n = e.__e);
71
71
  do
72
- t = t && t.nextSibling;
73
- while (t != null && t.nodeType == 8);
74
- return t;
72
+ n = n && n.nextSibling;
73
+ while (n != null && n.nodeType == 8);
74
+ return n;
75
75
  }
76
- function Fe(e, t, _, n) {
77
- var o, r, l = e.key, u = e.type, c = t[_];
78
- if (c === null && e.key == null || c && l == c.key && u == c.type && (2 & c.__u) == 0) return _;
79
- if (n > (c != null && (2 & c.__u) == 0 ? 1 : 0)) for (o = _ - 1, r = _ + 1; o >= 0 || r < t.length; ) {
80
- if (o >= 0) {
81
- if ((c = t[o]) && (2 & c.__u) == 0 && l == c.key && u == c.type) return o;
82
- o--;
76
+ function Ne(e, n, r, t) {
77
+ var l, o, _ = e.key, a = e.type, f = n[r];
78
+ if (f === null && e.key == null || f && _ == f.key && a == f.type && (2 & f.__u) == 0) return r;
79
+ if (t > (f != null && (2 & f.__u) == 0 ? 1 : 0)) for (l = r - 1, o = r + 1; l >= 0 || o < n.length; ) {
80
+ if (l >= 0) {
81
+ if ((f = n[l]) && (2 & f.__u) == 0 && _ == f.key && a == f.type) return l;
82
+ l--;
83
83
  }
84
- if (r < t.length) {
85
- if ((c = t[r]) && (2 & c.__u) == 0 && l == c.key && u == c.type) return r;
86
- r++;
84
+ if (o < n.length) {
85
+ if ((f = n[o]) && (2 & f.__u) == 0 && _ == f.key && a == f.type) return o;
86
+ o++;
87
87
  }
88
88
  }
89
89
  return -1;
90
90
  }
91
- function le(e, t, _) {
92
- t[0] == "-" ? e.setProperty(t, _ ?? "") : e[t] = _ == null ? "" : typeof _ != "number" || Me.test(t) ? _ : _ + "px";
91
+ function ae(e, n, r) {
92
+ n[0] == "-" ? e.setProperty(n, r ?? "") : e[n] = r == null ? "" : typeof r != "number" || He.test(n) ? r : r + "px";
93
93
  }
94
- function j(e, t, _, n, o) {
95
- var r, l;
96
- e: if (t == "style") if (typeof _ == "string") e.style.cssText = _;
94
+ function M(e, n, r, t, l) {
95
+ var o, _;
96
+ e: if (n == "style") if (typeof r == "string") e.style.cssText = r;
97
97
  else {
98
- if (typeof n == "string" && (e.style.cssText = n = ""), n) for (t in n) _ && t in _ || le(e.style, t, "");
99
- if (_) for (t in _) n && _[t] == n[t] || le(e.style, t, _[t]);
98
+ if (typeof t == "string" && (e.style.cssText = t = ""), t) for (n in t) r && n in r || ae(e.style, n, "");
99
+ if (r) for (n in r) t && r[n] == t[n] || ae(e.style, n, r[n]);
100
100
  }
101
- else if (t[0] == "o" && t[1] == "n") r = t != (t = t.replace(ke, "$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 + r] = _, _ ? n ? _.u = n.u : (_.u = Z, e.addEventListener(t, r ? K : J, r)) : e.removeEventListener(t, r ? K : J, r);
101
+ else if (n[0] == "o" && n[1] == "n") o = n != (n = n.replace(Ee, "$1")), _ = n.toLowerCase(), n = _ in e || n == "onFocusOut" || n == "onFocusIn" ? _.slice(2) : n.slice(2), e.l || (e.l = {}), e.l[n + o] = r, r ? t ? r.u = t.u : (r.u = Z, e.addEventListener(n, o ? Q : K, o)) : e.removeEventListener(n, o ? Q : K, o);
102
102
  else {
103
- if (o == "http://www.w3.org/2000/svg") t = t.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
104
- 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 {
105
- e[t] = _ ?? "";
103
+ if (l == "http://www.w3.org/2000/svg") n = n.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
104
+ else if (n != "width" && n != "height" && n != "href" && n != "list" && n != "form" && n != "tabIndex" && n != "download" && n != "rowSpan" && n != "colSpan" && n != "role" && n != "popover" && n in e) try {
105
+ e[n] = r ?? "";
106
106
  break e;
107
107
  } catch {
108
108
  }
109
- typeof _ == "function" || (_ == null || _ === !1 && t[4] != "-" ? e.removeAttribute(t) : e.setAttribute(t, t == "popover" && _ == 1 ? "" : _));
109
+ typeof r == "function" || (r == null || r === !1 && n[4] != "-" ? e.removeAttribute(n) : e.setAttribute(n, n == "popover" && r == 1 ? "" : r));
110
110
  }
111
111
  }
112
- function ue(e) {
113
- return function(t) {
112
+ function ce(e) {
113
+ return function(n) {
114
114
  if (this.l) {
115
- var _ = this.l[t.type + e];
116
- if (t.t == null) t.t = Z++;
117
- else if (t.t < _.u) return;
118
- return _(d.event ? d.event(t) : t);
115
+ var r = this.l[n.type + e];
116
+ if (n.t == null) n.t = Z++;
117
+ else if (n.t < r.u) return;
118
+ return r(g.event ? g.event(n) : n);
119
119
  }
120
120
  };
121
121
  }
122
- function te(e, t, _, n, o, r, l, u, c, s) {
123
- var f, i, p, a, g, w, b, h, m, H, $, F, T, re, O, N, V, x = t.type;
124
- if (t.constructor != null) return null;
125
- 128 & _.__u && (c = !!(32 & _.__u), r = [u = t.__e = _.__e]), (f = d.__b) && f(t);
126
- e: if (typeof x == "function") try {
127
- if (h = t.props, m = "prototype" in x && x.prototype.render, H = (f = x.contextType) && n[f.__c], $ = f ? H ? H.props.value : f.__ : n, _.__c ? b = (i = t.__c = _.__c).__ = i.__E : (m ? t.__c = i = new x(h, $) : (t.__c = i = new I(h, $), i.constructor = x, i.render = je), H && H.sub(i), i.props = h, i.state || (i.state = {}), i.context = $, i.__n = n, p = i.__d = !0, i.__h = [], i._sb = []), m && i.__s == null && (i.__s = i.state), m && x.getDerivedStateFromProps != null && (i.__s == i.state && (i.__s = C({}, i.__s)), C(i.__s, x.getDerivedStateFromProps(h, i.__s))), a = i.props, g = i.state, i.__v = t, p) m && x.getDerivedStateFromProps == null && i.componentWillMount != null && i.componentWillMount(), m && i.componentDidMount != null && i.__h.push(i.componentDidMount);
122
+ function ne(e, n, r, t, l, o, _, a, f, s) {
123
+ var p, i, d, c, h, E, x, v, y, $, F, N, z, ie, U, P, J, k = n.type;
124
+ if (n.constructor != null) return null;
125
+ 128 & r.__u && (f = !!(32 & r.__u), o = [a = n.__e = r.__e]), (p = g.__b) && p(n);
126
+ e: if (typeof k == "function") try {
127
+ if (v = n.props, y = "prototype" in k && k.prototype.render, $ = (p = k.contextType) && t[p.__c], F = p ? $ ? $.props.value : p.__ : t, r.__c ? x = (i = n.__c = r.__c).__ = i.__E : (y ? n.__c = i = new k(v, F) : (n.__c = i = new O(v, F), i.constructor = k, i.render = Me), $ && $.sub(i), i.props = v, i.state || (i.state = {}), i.context = F, i.__n = t, d = i.__d = !0, i.__h = [], i._sb = []), y && i.__s == null && (i.__s = i.state), y && k.getDerivedStateFromProps != null && (i.__s == i.state && (i.__s = C({}, i.__s)), C(i.__s, k.getDerivedStateFromProps(v, i.__s))), c = i.props, h = i.state, i.__v = n, d) y && k.getDerivedStateFromProps == null && i.componentWillMount != null && i.componentWillMount(), y && i.componentDidMount != null && i.__h.push(i.componentDidMount);
128
128
  else {
129
- if (m && x.getDerivedStateFromProps == null && h !== a && i.componentWillReceiveProps != null && i.componentWillReceiveProps(h, $), !i.__e && i.shouldComponentUpdate != null && i.shouldComponentUpdate(h, i.__s, $) === !1 || t.__v == _.__v) {
130
- for (t.__v != _.__v && (i.props = h, i.state = i.__s, i.__d = !1), t.__e = _.__e, t.__k = _.__k, t.__k.some(function(U) {
131
- U && (U.__ = t);
132
- }), F = 0; F < i._sb.length; F++) i.__h.push(i._sb[F]);
133
- i._sb = [], i.__h.length && l.push(i);
129
+ if (y && k.getDerivedStateFromProps == null && v !== c && i.componentWillReceiveProps != null && i.componentWillReceiveProps(v, F), !i.__e && i.shouldComponentUpdate != null && i.shouldComponentUpdate(v, i.__s, F) === !1 || n.__v == r.__v) {
130
+ for (n.__v != r.__v && (i.props = v, i.state = i.__s, i.__d = !1), n.__e = r.__e, n.__k = r.__k, n.__k.some(function(I) {
131
+ I && (I.__ = n);
132
+ }), N = 0; N < i._sb.length; N++) i.__h.push(i._sb[N]);
133
+ i._sb = [], i.__h.length && _.push(i);
134
134
  break e;
135
135
  }
136
- i.componentWillUpdate != null && i.componentWillUpdate(h, i.__s, $), m && i.componentDidUpdate != null && i.__h.push(function() {
137
- i.componentDidUpdate(a, g, w);
136
+ i.componentWillUpdate != null && i.componentWillUpdate(v, i.__s, F), y && i.componentDidUpdate != null && i.__h.push(function() {
137
+ i.componentDidUpdate(c, h, E);
138
138
  });
139
139
  }
140
- if (i.context = $, i.props = h, i.__P = e, i.__e = !1, T = d.__r, re = 0, m) {
141
- for (i.state = i.__s, i.__d = !1, T && T(t), f = i.render(i.props, i.state, i.context), O = 0; O < i._sb.length; O++) i.__h.push(i._sb[O]);
140
+ if (i.context = F, i.props = v, i.__P = e, i.__e = !1, z = g.__r, ie = 0, y) {
141
+ for (i.state = i.__s, i.__d = !1, z && z(n), p = i.render(i.props, i.state, i.context), U = 0; U < i._sb.length; U++) i.__h.push(i._sb[U]);
142
142
  i._sb = [];
143
143
  } else do
144
- i.__d = !1, T && T(t), f = i.render(i.props, i.state, i.context), i.state = i.__s;
145
- while (i.__d && ++re < 25);
146
- i.state = i.__s, i.getChildContext != null && (n = C(C({}, n), i.getChildContext())), m && !p && i.getSnapshotBeforeUpdate != null && (w = i.getSnapshotBeforeUpdate(a, g)), N = f, f != null && f.type === q && f.key == null && (N = Ee(f.props.children)), u = Ce(e, B(N) ? N : [N], t, _, n, o, r, l, u, c, s), i.base = t.__e, t.__u &= -161, i.__h.length && l.push(i), b && (i.__E = i.__ = null);
147
- } catch (U) {
148
- if (t.__v = null, c || r != null) if (U.then) {
149
- for (t.__u |= c ? 160 : 128; u && u.nodeType == 8 && u.nextSibling; ) u = u.nextSibling;
150
- r[r.indexOf(u)] = null, t.__e = u;
151
- } else for (V = r.length; V--; ) ee(r[V]);
152
- else t.__e = _.__e, t.__k = _.__k;
153
- d.__e(U, t, _);
144
+ i.__d = !1, z && z(n), p = i.render(i.props, i.state, i.context), i.state = i.__s;
145
+ while (i.__d && ++ie < 25);
146
+ i.state = i.__s, i.getChildContext != null && (t = C(C({}, t), i.getChildContext())), y && !d && i.getSnapshotBeforeUpdate != null && (E = i.getSnapshotBeforeUpdate(c, h)), P = p, p != null && p.type === A && p.key == null && (P = Be(p.props.children)), a = Fe(e, G(P) ? P : [P], n, r, t, l, o, _, a, f, s), i.base = n.__e, n.__u &= -161, i.__h.length && _.push(i), x && (i.__E = i.__ = null);
147
+ } catch (I) {
148
+ if (n.__v = null, f || o != null) if (I.then) {
149
+ for (n.__u |= f ? 160 : 128; a && a.nodeType == 8 && a.nextSibling; ) a = a.nextSibling;
150
+ o[o.indexOf(a)] = null, n.__e = a;
151
+ } else for (J = o.length; J--; ) ee(o[J]);
152
+ else n.__e = r.__e, n.__k = r.__k;
153
+ g.__e(I, n, r);
154
154
  }
155
- else r == null && t.__v == _.__v ? (t.__k = _.__k, t.__e = _.__e) : u = t.__e = Oe(_.__e, t, _, n, o, r, l, c, s);
156
- return (f = d.diffed) && f(t), 128 & t.__u ? void 0 : u;
155
+ else o == null && n.__v == r.__v ? (n.__k = r.__k, n.__e = r.__e) : a = n.__e = Ue(r.__e, n, r, t, l, o, _, f, s);
156
+ return (p = g.diffed) && p(n), 128 & n.__u ? void 0 : a;
157
157
  }
158
- function Se(e, t, _) {
159
- for (var n = 0; n < _.length; n++) _e(_[n], _[++n], _[++n]);
160
- d.__c && d.__c(t, e), e.some(function(o) {
158
+ function Se(e, n, r) {
159
+ for (var t = 0; t < r.length; t++) re(r[t], r[++t], r[++t]);
160
+ g.__c && g.__c(n, e), e.some(function(l) {
161
161
  try {
162
- e = o.__h, o.__h = [], e.some(function(r) {
163
- r.call(o);
162
+ e = l.__h, l.__h = [], e.some(function(o) {
163
+ o.call(l);
164
164
  });
165
- } catch (r) {
166
- d.__e(r, o.__v);
165
+ } catch (o) {
166
+ g.__e(o, l.__v);
167
167
  }
168
168
  });
169
169
  }
170
- function Ee(e) {
171
- return typeof e != "object" || e == null || e.__b && e.__b > 0 ? e : B(e) ? e.map(Ee) : C({}, e);
170
+ function Be(e) {
171
+ return typeof e != "object" || e == null || e.__b && e.__b > 0 ? e : G(e) ? e.map(Be) : C({}, e);
172
172
  }
173
- function Oe(e, t, _, n, o, r, l, u, c) {
174
- var s, f, i, p, a, g, w, b = _.props, h = t.props, m = t.type;
175
- if (m == "svg" ? o = "http://www.w3.org/2000/svg" : m == "math" ? o = "http://www.w3.org/1998/Math/MathML" : o || (o = "http://www.w3.org/1999/xhtml"), r != null) {
176
- for (s = 0; s < r.length; s++) if ((a = r[s]) && "setAttribute" in a == !!m && (m ? a.localName == m : a.nodeType == 3)) {
177
- e = a, r[s] = null;
173
+ function Ue(e, n, r, t, l, o, _, a, f) {
174
+ var s, p, i, d, c, h, E, x = r.props, v = n.props, y = n.type;
175
+ if (y == "svg" ? l = "http://www.w3.org/2000/svg" : y == "math" ? l = "http://www.w3.org/1998/Math/MathML" : l || (l = "http://www.w3.org/1999/xhtml"), o != null) {
176
+ for (s = 0; s < o.length; s++) if ((c = o[s]) && "setAttribute" in c == !!y && (y ? c.localName == y : c.nodeType == 3)) {
177
+ e = c, o[s] = null;
178
178
  break;
179
179
  }
180
180
  }
181
181
  if (e == null) {
182
- if (m == null) return document.createTextNode(h);
183
- e = document.createElementNS(o, m, h.is && h), u && (d.__m && d.__m(t, r), u = !1), r = null;
182
+ if (y == null) return document.createTextNode(v);
183
+ e = document.createElementNS(l, y, v.is && v), a && (g.__m && g.__m(n, o), a = !1), o = null;
184
184
  }
185
- if (m == null) b === h || u && e.data == h || (e.data = h);
185
+ if (y == null) x === v || a && e.data == v || (e.data = v);
186
186
  else {
187
- if (r = r && D.call(e.childNodes), b = _.props || M, !u && r != null) for (b = {}, s = 0; s < e.attributes.length; s++) b[(a = e.attributes[s]).name] = a.value;
188
- for (s in b) if (a = b[s], s != "children") {
189
- if (s == "dangerouslySetInnerHTML") i = a;
190
- else if (!(s in h)) {
191
- if (s == "value" && "defaultValue" in h || s == "checked" && "defaultChecked" in h) continue;
192
- j(e, s, null, a, o);
187
+ if (o = o && H.call(e.childNodes), x = r.props || R, !a && o != null) for (x = {}, s = 0; s < e.attributes.length; s++) x[(c = e.attributes[s]).name] = c.value;
188
+ for (s in x) if (c = x[s], s != "children") {
189
+ if (s == "dangerouslySetInnerHTML") i = c;
190
+ else if (!(s in v)) {
191
+ if (s == "value" && "defaultValue" in v || s == "checked" && "defaultChecked" in v) continue;
192
+ M(e, s, null, c, l);
193
193
  }
194
194
  }
195
- for (s in h) a = h[s], s == "children" ? p = a : s == "dangerouslySetInnerHTML" ? f = a : s == "value" ? g = a : s == "checked" ? w = a : u && typeof a != "function" || b[s] === a || j(e, s, a, b[s], o);
196
- if (f) u || i && (f.__html == i.__html || f.__html == e.innerHTML) || (e.innerHTML = f.__html), t.__k = [];
197
- else if (i && (e.innerHTML = ""), Ce(t.type == "template" ? e.content : e, B(p) ? p : [p], t, _, n, m == "foreignObject" ? "http://www.w3.org/1999/xhtml" : o, r, l, r ? r[0] : _.__k && P(_, 0), u, c), r != null) for (s = r.length; s--; ) ee(r[s]);
198
- u || (s = "value", m == "progress" && g == null ? e.removeAttribute("value") : g != null && (g !== e[s] || m == "progress" && !g || m == "option" && g != b[s]) && j(e, s, g, b[s], o), s = "checked", w != null && w != e[s] && j(e, s, w, b[s], o));
195
+ for (s in v) c = v[s], s == "children" ? d = c : s == "dangerouslySetInnerHTML" ? p = c : s == "value" ? h = c : s == "checked" ? E = c : a && typeof c != "function" || x[s] === c || M(e, s, c, x[s], l);
196
+ if (p) a || i && (p.__html == i.__html || p.__html == e.innerHTML) || (e.innerHTML = p.__html), n.__k = [];
197
+ else if (i && (e.innerHTML = ""), Fe(n.type == "template" ? e.content : e, G(d) ? d : [d], n, r, t, y == "foreignObject" ? "http://www.w3.org/1999/xhtml" : l, o, _, o ? o[0] : r.__k && B(r, 0), a, f), o != null) for (s = o.length; s--; ) ee(o[s]);
198
+ a || (s = "value", y == "progress" && h == null ? e.removeAttribute("value") : h != null && (h !== e[s] || y == "progress" && !h || y == "option" && h != x[s]) && M(e, s, h, x[s], l), s = "checked", E != null && E != e[s] && M(e, s, E, x[s], l));
199
199
  }
200
200
  return e;
201
201
  }
202
- function _e(e, t, _) {
202
+ function re(e, n, r) {
203
203
  try {
204
204
  if (typeof e == "function") {
205
- var n = typeof e.__u == "function";
206
- n && e.__u(), n && t == null || (e.__u = e(t));
207
- } else e.current = t;
208
- } catch (o) {
209
- d.__e(o, _);
205
+ var t = typeof e.__u == "function";
206
+ t && e.__u(), t && n == null || (e.__u = e(n));
207
+ } else e.current = n;
208
+ } catch (l) {
209
+ g.__e(l, r);
210
210
  }
211
211
  }
212
- function Pe(e, t, _) {
213
- var n, o;
214
- if (d.unmount && d.unmount(e), (n = e.ref) && (n.current && n.current != e.__e || _e(n, null, t)), (n = e.__c) != null) {
215
- if (n.componentWillUnmount) try {
216
- n.componentWillUnmount();
217
- } catch (r) {
218
- d.__e(r, t);
212
+ function $e(e, n, r) {
213
+ var t, l;
214
+ if (g.unmount && g.unmount(e), (t = e.ref) && (t.current && t.current != e.__e || re(t, null, n)), (t = e.__c) != null) {
215
+ if (t.componentWillUnmount) try {
216
+ t.componentWillUnmount();
217
+ } catch (o) {
218
+ g.__e(o, n);
219
219
  }
220
- n.base = n.__P = null;
220
+ t.base = t.__P = null;
221
221
  }
222
- if (n = e.__k) for (o = 0; o < n.length; o++) n[o] && Pe(n[o], t, _ || typeof e.type != "function");
223
- _ || ee(e.__e), e.__c = e.__ = e.__e = void 0;
222
+ if (t = e.__k) for (l = 0; l < t.length; l++) t[l] && $e(t[l], n, r || typeof e.type != "function");
223
+ r || ee(e.__e), e.__c = e.__ = e.__e = void 0;
224
224
  }
225
- function je(e, t, _) {
226
- return this.constructor(e, _);
225
+ function Me(e, n, r) {
226
+ return this.constructor(e, r);
227
227
  }
228
- function z(e, t, _) {
229
- var n, o, r, l;
230
- t == document && (t = document.documentElement), d.__ && d.__(e, t), o = (n = typeof _ == "function") ? null : _ && _.__k || t.__k, r = [], l = [], te(t, e = (!n && _ || t).__k = E(q, null, [e]), o || M, M, t.namespaceURI, !n && _ ? [_] : o ? null : t.firstChild ? D.call(t.childNodes) : null, r, !n && _ ? _ : o ? o.__e : t.firstChild, n, l), Se(r, e, l);
228
+ function V(e, n, r) {
229
+ var t, l, o, _;
230
+ n == document && (n = document.documentElement), g.__ && g.__(e, n), l = (t = typeof r == "function") ? null : r && r.__k || n.__k, o = [], _ = [], ne(n, e = (!t && r || n).__k = S(A, null, [e]), l || R, R, n.namespaceURI, !t && r ? [r] : l ? null : n.firstChild ? H.call(n.childNodes) : null, o, !t && r ? r : l ? l.__e : n.firstChild, t, _), Se(o, e, _);
231
231
  }
232
- function He(e, t) {
233
- z(e, t, He);
232
+ function ze(e, n) {
233
+ V(e, n, ze);
234
234
  }
235
- function Te(e, t, _) {
236
- var n, o, r, l, u = C({}, e.props);
237
- for (r in e.type && e.type.defaultProps && (l = e.type.defaultProps), t) r == "key" ? n = t[r] : r == "ref" ? o = t[r] : u[r] = t[r] === void 0 && l != null ? l[r] : t[r];
238
- return arguments.length > 2 && (u.children = arguments.length > 3 ? D.call(arguments, 2) : _), L(e.type, u, n || e.key, o || e.ref, null);
235
+ function Pe(e, n, r) {
236
+ var t, l, o, _, a = C({}, e.props);
237
+ for (o in e.type && e.type.defaultProps && (_ = e.type.defaultProps), n) o == "key" ? t = n[o] : o == "ref" ? l = n[o] : a[o] = n[o] === void 0 && _ != null ? _[o] : n[o];
238
+ return arguments.length > 2 && (a.children = arguments.length > 3 ? H.call(arguments, 2) : r), D(e.type, a, t || e.key, l || e.ref, null);
239
239
  }
240
- D = we.slice, d = { __e: function(e, t, _, n) {
241
- for (var o, r, l; t = t.__; ) if ((o = t.__c) && !o.__) try {
242
- if ((r = o.constructor) && r.getDerivedStateFromError != null && (o.setState(r.getDerivedStateFromError(e)), l = o.__d), o.componentDidCatch != null && (o.componentDidCatch(e, n || {}), l = o.__d), l) return o.__E = o;
243
- } catch (u) {
244
- e = u;
240
+ H = ke.slice, g = { __e: function(e, n, r, t) {
241
+ for (var l, o, _; n = n.__; ) if ((l = n.__c) && !l.__) try {
242
+ if ((o = l.constructor) && o.getDerivedStateFromError != null && (l.setState(o.getDerivedStateFromError(e)), _ = l.__d), l.componentDidCatch != null && (l.componentDidCatch(e, t || {}), _ = l.__d), _) return l.__E = l;
243
+ } catch (a) {
244
+ e = a;
245
245
  }
246
246
  throw e;
247
- } }, ye = 0, I.prototype.setState = function(e, t) {
248
- var _;
249
- _ = this.__s != null && this.__s != this.state ? this.__s : this.__s = C({}, this.state), typeof e == "function" && (e = e(C({}, _), this.props)), e && C(_, e), e != null && this.__v && (t && this._sb.push(t), ie(this));
250
- }, I.prototype.forceUpdate = function(e) {
251
- this.__v && (this.__e = !0, e && this.__h.push(e), ie(this));
252
- }, I.prototype.render = q, S = [], ge = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, be = function(e, t) {
253
- return e.__v.__b - t.__v.__b;
254
- }, R.__r = 0, ke = /(PointerCapture)$|Capture$/i, Z = 0, J = ue(!1), K = ue(!0);
255
- var Ie = 0;
256
- function k(e, t, _, n, o, r) {
257
- t || (t = {});
258
- var l, u, c = t;
259
- if ("ref" in c) for (u in c = {}, t) u == "ref" ? l = t[u] : c[u] = t[u];
260
- var s = { type: e, props: c, key: _, ref: l, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --Ie, __i: -1, __u: 0, __source: o, __self: r };
261
- if (typeof e == "function" && (l = e.defaultProps)) for (u in l) c[u] === void 0 && (c[u] = l[u]);
262
- return d.vnode && d.vnode(s), s;
263
- }
264
- function ne() {
265
- return (ne = Object.assign ? Object.assign.bind() : function(e) {
266
- for (var t = 1; t < arguments.length; t++) {
267
- var _ = arguments[t];
268
- for (var n in _) Object.prototype.hasOwnProperty.call(_, n) && (e[n] = _[n]);
269
- }
270
- return e;
271
- }).apply(this, arguments);
272
- }
273
- var We = ["context", "children"];
274
- function Re(e) {
275
- this.getChildContext = function() {
276
- return e.context;
277
- };
278
- var t = e.children, _ = function(n, o) {
279
- if (n == null) return {};
280
- var r, l, u = {}, c = Object.keys(n);
281
- for (l = 0; l < c.length; l++) o.indexOf(r = c[l]) >= 0 || (u[r] = n[r]);
282
- return u;
283
- }(e, We);
284
- return Te(t, _);
285
- }
286
- function Be() {
287
- var e = new CustomEvent("_preact", { detail: {}, bubbles: !0, cancelable: !0 });
288
- this.dispatchEvent(e), this._vdom = E(Re, ne({}, this._props, { context: e.detail.context }), function t(_, n) {
289
- if (_.nodeType === 3) return _.data;
290
- if (_.nodeType !== 1) return null;
291
- var o = [], r = {}, l = 0, u = _.attributes, c = _.childNodes;
292
- for (l = u.length; l--; ) u[l].name !== "slot" && (r[u[l].name] = u[l].value, r[Ne(u[l].name)] = u[l].value);
293
- for (l = c.length; l--; ) {
294
- var s = t(c[l], null), f = c[l].slot;
295
- f ? r[f] = E(se, { name: f }, s) : o[l] = s;
296
- }
297
- var i = n ? E(se, null, o) : o;
298
- return E(n || _.nodeName.toLowerCase(), r, i);
299
- }(this, this._vdomComponent)), (this.hasAttribute("hydrate") ? He : z)(this._vdom, this._root);
300
- }
301
- function Ne(e) {
302
- return e.replace(/-(\w)/g, function(t, _) {
303
- return _ ? _.toUpperCase() : "";
304
- });
305
- }
306
- function qe(e, t, _) {
307
- if (this._vdom) {
308
- var n = {};
309
- n[e] = _ = _ ?? void 0, n[Ne(e)] = _, this._vdom = Te(this._vdom, n), z(this._vdom, this._root);
310
- }
247
+ } }, me = 0, O.prototype.setState = function(e, n) {
248
+ var r;
249
+ r = this.__s != null && this.__s != this.state ? this.__s : this.__s = C({}, this.state), typeof e == "function" && (e = e(C({}, r), this.props)), e && C(r, e), e != null && this.__v && (n && this._sb.push(n), _e(this));
250
+ }, O.prototype.forceUpdate = function(e) {
251
+ this.__v && (this.__e = !0, e && this.__h.push(e), _e(this));
252
+ }, O.prototype.render = A, w = [], be = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, xe = function(e, n) {
253
+ return e.__v.__b - n.__v.__b;
254
+ }, W.__r = 0, Ee = /(PointerCapture)$|Capture$/i, Z = 0, K = ce(!1), Q = ce(!0);
255
+ var Oe = 0;
256
+ function u(e, n, r, t, l, o) {
257
+ n || (n = {});
258
+ var _, a, f = n;
259
+ if ("ref" in f) for (a in f = {}, n) a == "ref" ? _ = n[a] : f[a] = n[a];
260
+ var s = { type: e, props: f, key: r, ref: _, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --Oe, __i: -1, __u: 0, __source: l, __self: o };
261
+ if (typeof e == "function" && (_ = e.defaultProps)) for (a in _) f[a] === void 0 && (f[a] = _[a]);
262
+ return g.vnode && g.vnode(s), s;
311
263
  }
312
- function ze() {
313
- z(this._vdom = null, this._root);
264
+ var T, m, Y, se, q = 0, Ie = [], b = g, ue = b.__b, fe = b.__r, de = b.diffed, pe = b.__c, he = b.unmount, ge = b.__;
265
+ function te(e, n) {
266
+ b.__h && b.__h(m, e, q || n), q = 0;
267
+ var r = m.__H || (m.__H = { __: [], __h: [] });
268
+ return e >= r.__.length && r.__.push({}), r.__[e];
314
269
  }
315
- function se(e, t) {
316
- var _ = this;
317
- return E("slot", ne({}, e, { ref: function(n) {
318
- n ? (_.ref = n, _._listener || (_._listener = function(o) {
319
- o.stopPropagation(), o.detail.context = t;
320
- }, n.addEventListener("_preact", _._listener))) : _.ref.removeEventListener("_preact", _._listener);
321
- } }));
322
- }
323
- function Ue(e, t, _, n) {
324
- function o() {
325
- var r = Reflect.construct(HTMLElement, [], o);
326
- return r._vdomComponent = e, r._root = n && n.shadow ? r.attachShadow({ mode: n.mode || "open" }) : r, r;
327
- }
328
- return (o.prototype = Object.create(HTMLElement.prototype)).constructor = o, o.prototype.connectedCallback = Be, o.prototype.attributeChangedCallback = qe, o.prototype.disconnectedCallback = ze, _ = _ || e.observedAttributes || Object.keys(e.propTypes || {}), o.observedAttributes = _, _.forEach(function(r) {
329
- Object.defineProperty(o.prototype, r, { get: function() {
330
- return this._vdom.props[r];
331
- }, set: function(l) {
332
- this._vdom ? this.attributeChangedCallback(r, null, l) : (this._props || (this._props = {}), this._props[r] = l, this.connectedCallback());
333
- var u = typeof l;
334
- l != null && u !== "string" && u !== "boolean" && u !== "number" || this.setAttribute(r, l);
335
- } });
336
- }), customElements.define(t || e.tagName || e.displayName || e.name, o);
337
- }
338
- const Ve = ({ name: e = "World" }) => /* @__PURE__ */ k("p", { children: [
339
- "Hello, ",
340
- e,
341
- "!"
342
- ] });
343
- Ue(Ve, "x-greeting", ["name"], { shadow: !1 });
344
- var Q, v, G, ce, X = 0, Ae = [], y = d, ae = y.__b, fe = y.__r, pe = y.diffed, de = y.__c, he = y.unmount, me = y.__;
345
- function Ge(e, t) {
346
- y.__h && y.__h(v, e, X || t), X = 0;
347
- var _ = v.__H || (v.__H = { __: [], __h: [] });
348
- return e >= _.__.length && _.__.push({}), _.__[e];
270
+ function j(e) {
271
+ return q = 1, je(Re, e);
349
272
  }
350
- function A(e) {
351
- return X = 1, Je(Le, e);
352
- }
353
- function Je(e, t, _) {
354
- var n = Ge(Q++, 2);
355
- if (n.t = e, !n.__c && (n.__ = [Le(void 0, t), function(u) {
356
- var c = n.__N ? n.__N[0] : n.__[0], s = n.t(c, u);
357
- c !== s && (n.__N = [s, n.__[1]], n.__c.setState({}));
358
- }], n.__c = v, !v.__f)) {
359
- var o = function(u, c, s) {
360
- if (!n.__c.__H) return !0;
361
- var f = n.__c.__H.__.filter(function(p) {
362
- return !!p.__c;
273
+ function je(e, n, r) {
274
+ var t = te(T++, 2);
275
+ if (t.t = e, !t.__c && (t.__ = [Re(void 0, n), function(a) {
276
+ var f = t.__N ? t.__N[0] : t.__[0], s = t.t(f, a);
277
+ f !== s && (t.__N = [s, t.__[1]], t.__c.setState({}));
278
+ }], t.__c = m, !m.__f)) {
279
+ var l = function(a, f, s) {
280
+ if (!t.__c.__H) return !0;
281
+ var p = t.__c.__H.__.filter(function(d) {
282
+ return !!d.__c;
363
283
  });
364
- if (f.every(function(p) {
365
- return !p.__N;
366
- })) return !r || r.call(this, u, c, s);
367
- var i = n.__c.props !== u;
368
- return f.forEach(function(p) {
369
- if (p.__N) {
370
- var a = p.__[0];
371
- p.__ = p.__N, p.__N = void 0, a !== p.__[0] && (i = !0);
284
+ if (p.every(function(d) {
285
+ return !d.__N;
286
+ })) return !o || o.call(this, a, f, s);
287
+ var i = t.__c.props !== a;
288
+ return p.forEach(function(d) {
289
+ if (d.__N) {
290
+ var c = d.__[0];
291
+ d.__ = d.__N, d.__N = void 0, c !== d.__[0] && (i = !0);
372
292
  }
373
- }), r && r.call(this, u, c, s) || i;
293
+ }), o && o.call(this, a, f, s) || i;
374
294
  };
375
- v.__f = !0;
376
- var r = v.shouldComponentUpdate, l = v.componentWillUpdate;
377
- v.componentWillUpdate = function(u, c, s) {
295
+ m.__f = !0;
296
+ var o = m.shouldComponentUpdate, _ = m.componentWillUpdate;
297
+ m.componentWillUpdate = function(a, f, s) {
378
298
  if (this.__e) {
379
- var f = r;
380
- r = void 0, o(u, c, s), r = f;
299
+ var p = o;
300
+ o = void 0, l(a, f, s), o = p;
381
301
  }
382
- l && l.call(this, u, c, s);
383
- }, v.shouldComponentUpdate = o;
302
+ _ && _.call(this, a, f, s);
303
+ }, m.shouldComponentUpdate = l;
384
304
  }
385
- return n.__N || n.__;
305
+ return t.__N || t.__;
306
+ }
307
+ function Le(e, n) {
308
+ var r = te(T++, 3);
309
+ !b.__s && De(r.__H, n) && (r.__ = e, r.u = n, m.__H.__h.push(r));
310
+ }
311
+ function We(e) {
312
+ return q = 5, qe(function() {
313
+ return { current: e };
314
+ }, []);
315
+ }
316
+ function qe(e, n) {
317
+ var r = te(T++, 7);
318
+ return De(r.__H, n) && (r.__ = e(), r.__H = n, r.__h = e), r.__;
386
319
  }
387
- function Ke() {
388
- for (var e; e = Ae.shift(); ) if (e.__P && e.__H) try {
389
- e.__H.__h.forEach(W), e.__H.__h.forEach(Y), e.__H.__h = [];
390
- } catch (t) {
391
- e.__H.__h = [], y.__e(t, e.__v);
320
+ function Ge() {
321
+ for (var e; e = Ie.shift(); ) if (e.__P && e.__H) try {
322
+ e.__H.__h.forEach(L), e.__H.__h.forEach(X), e.__H.__h = [];
323
+ } catch (n) {
324
+ e.__H.__h = [], b.__e(n, e.__v);
392
325
  }
393
326
  }
394
- y.__b = function(e) {
395
- v = null, ae && ae(e);
396
- }, y.__ = function(e, t) {
397
- e && t.__k && t.__k.__m && (e.__m = t.__k.__m), me && me(e, t);
398
- }, y.__r = function(e) {
399
- fe && fe(e), Q = 0;
400
- var t = (v = e.__c).__H;
401
- t && (G === v ? (t.__h = [], v.__h = [], t.__.forEach(function(_) {
402
- _.__N && (_.__ = _.__N), _.u = _.__N = void 0;
403
- })) : (t.__h.forEach(W), t.__h.forEach(Y), t.__h = [], Q = 0)), G = v;
404
- }, y.diffed = function(e) {
405
- pe && pe(e);
406
- var t = e.__c;
407
- t && t.__H && (t.__H.__h.length && (Ae.push(t) !== 1 && ce === y.requestAnimationFrame || ((ce = y.requestAnimationFrame) || Qe)(Ke)), t.__H.__.forEach(function(_) {
408
- _.u && (_.__H = _.u), _.u = void 0;
409
- })), G = v = null;
410
- }, y.__c = function(e, t) {
411
- t.some(function(_) {
327
+ b.__b = function(e) {
328
+ m = null, ue && ue(e);
329
+ }, b.__ = function(e, n) {
330
+ e && n.__k && n.__k.__m && (e.__m = n.__k.__m), ge && ge(e, n);
331
+ }, b.__r = function(e) {
332
+ fe && fe(e), T = 0;
333
+ var n = (m = e.__c).__H;
334
+ n && (Y === m ? (n.__h = [], m.__h = [], n.__.forEach(function(r) {
335
+ r.__N && (r.__ = r.__N), r.u = r.__N = void 0;
336
+ })) : (n.__h.forEach(L), n.__h.forEach(X), n.__h = [], T = 0)), Y = m;
337
+ }, b.diffed = function(e) {
338
+ de && de(e);
339
+ var n = e.__c;
340
+ n && n.__H && (n.__H.__h.length && (Ie.push(n) !== 1 && se === b.requestAnimationFrame || ((se = b.requestAnimationFrame) || Ve)(Ge)), n.__H.__.forEach(function(r) {
341
+ r.u && (r.__H = r.u), r.u = void 0;
342
+ })), Y = m = null;
343
+ }, b.__c = function(e, n) {
344
+ n.some(function(r) {
412
345
  try {
413
- _.__h.forEach(W), _.__h = _.__h.filter(function(n) {
414
- return !n.__ || Y(n);
346
+ r.__h.forEach(L), r.__h = r.__h.filter(function(t) {
347
+ return !t.__ || X(t);
415
348
  });
416
- } catch (n) {
417
- t.some(function(o) {
418
- o.__h && (o.__h = []);
419
- }), t = [], y.__e(n, _.__v);
349
+ } catch (t) {
350
+ n.some(function(l) {
351
+ l.__h && (l.__h = []);
352
+ }), n = [], b.__e(t, r.__v);
420
353
  }
421
- }), de && de(e, t);
422
- }, y.unmount = function(e) {
354
+ }), pe && pe(e, n);
355
+ }, b.unmount = function(e) {
423
356
  he && he(e);
424
- var t, _ = e.__c;
425
- _ && _.__H && (_.__H.__.forEach(function(n) {
357
+ var n, r = e.__c;
358
+ r && r.__H && (r.__H.__.forEach(function(t) {
426
359
  try {
427
- W(n);
428
- } catch (o) {
429
- t = o;
360
+ L(t);
361
+ } catch (l) {
362
+ n = l;
430
363
  }
431
- }), _.__H = void 0, t && y.__e(t, _.__v));
364
+ }), r.__H = void 0, n && b.__e(n, r.__v));
432
365
  };
433
366
  var ve = typeof requestAnimationFrame == "function";
434
- function Qe(e) {
435
- var t, _ = function() {
436
- clearTimeout(n), ve && cancelAnimationFrame(t), setTimeout(e);
437
- }, n = setTimeout(_, 35);
438
- ve && (t = requestAnimationFrame(_));
367
+ function Ve(e) {
368
+ var n, r = function() {
369
+ clearTimeout(t), ve && cancelAnimationFrame(n), setTimeout(e);
370
+ }, t = setTimeout(r, 35);
371
+ ve && (n = requestAnimationFrame(r));
372
+ }
373
+ function L(e) {
374
+ var n = m, r = e.__c;
375
+ typeof r == "function" && (e.__c = void 0, r()), m = n;
439
376
  }
440
- function W(e) {
441
- var t = v, _ = e.__c;
442
- typeof _ == "function" && (e.__c = void 0, _()), v = t;
377
+ function X(e) {
378
+ var n = m;
379
+ e.__c = e.__(), m = n;
443
380
  }
444
- function Y(e) {
445
- var t = v;
446
- e.__c = e.__(), v = t;
381
+ function De(e, n) {
382
+ return !e || e.length !== n.length || n.some(function(r, t) {
383
+ return r !== e[t];
384
+ });
447
385
  }
448
- function Le(e, t) {
449
- return typeof t == "function" ? t(e) : t;
386
+ function Re(e, n) {
387
+ return typeof n == "function" ? n(e) : n;
450
388
  }
451
- function Xe({ onClick: e, color: t, children: _ }) {
452
- return /* @__PURE__ */ k(
389
+ function Je({ onClick: e, color: n, children: r }) {
390
+ return /* @__PURE__ */ u(
453
391
  "button",
454
392
  {
455
393
  style: {
456
- background: t || "#1890ff",
394
+ background: n || "#1890ff",
457
395
  color: "#fff",
458
396
  border: "none",
459
397
  borderRadius: 4,
@@ -462,115 +400,738 @@ function Xe({ onClick: e, color: t, children: _ }) {
462
400
  fontSize: 16
463
401
  },
464
402
  onClick: e,
465
- children: _
403
+ children: r
466
404
  }
467
405
  );
468
406
  }
469
- function Ye({ visible: e, onClose: t, onSubmit: _, color: n }) {
470
- const [o, r] = A(""), [l, u] = A(""), [c, s] = A(!1), [f, i] = A("");
471
- return e ? /* @__PURE__ */ k("div", { style: {
472
- position: "fixed",
473
- top: 0,
474
- left: 0,
475
- right: 0,
476
- bottom: 0,
477
- background: "rgba(0,0,0,0.3)",
478
- display: "flex",
479
- alignItems: "center",
480
- justifyContent: "center",
481
- zIndex: 9999
482
- }, children: /* @__PURE__ */ k(
483
- "form",
484
- {
485
- onSubmit: async (a) => {
486
- a.preventDefault(), s(!0), i("");
487
- try {
488
- await _({ name: o, email: l }), t();
489
- } catch {
490
- i("提交失败,请重试");
491
- } finally {
492
- s(!1);
407
+ const Ye = ({ formState: e, setFormState: n, onClose: r, loading: t, whiteTheme: l = !1 }) => {
408
+ const o = l ? {
409
+ width: "100%",
410
+ padding: "10px 12px",
411
+ borderRadius: 6,
412
+ boxSizing: "border-box",
413
+ border: e.amountError ? "1px solid #ff4d4f" : "1px solid #E5E6EB",
414
+ background: "#fff",
415
+ color: "#222",
416
+ fontSize: 15,
417
+ outline: "none",
418
+ marginBottom: 0
419
+ } : {
420
+ width: "100%",
421
+ padding: "10px 12px",
422
+ borderRadius: 6,
423
+ boxSizing: "border-box",
424
+ border: e.amountError ? "1px solid #ff4d4f" : "1px solid #23262F",
425
+ background: "#23262F",
426
+ color: "#fff",
427
+ fontSize: 15,
428
+ outline: "none",
429
+ marginBottom: 0
430
+ }, _ = l ? {
431
+ width: "100%",
432
+ padding: "10px 12px",
433
+ borderRadius: 6,
434
+ border: e.rechargeChannelError ? "1px solid #ff4d4f" : "1px solid #E5E6EB",
435
+ background: "#fff",
436
+ color: "#222",
437
+ fontSize: 15,
438
+ outline: "none"
439
+ } : {
440
+ width: "100%",
441
+ padding: "10px 12px",
442
+ borderRadius: 6,
443
+ border: e.rechargeChannelError ? "1px solid #ff4d4f" : "1px solid #23262F",
444
+ background: "#23262F",
445
+ color: "#fff",
446
+ fontSize: 15,
447
+ outline: "none"
448
+ }, a = l ? {
449
+ width: "100%",
450
+ padding: "10px 12px",
451
+ borderRadius: 6,
452
+ border: "1px solid #E5E6EB",
453
+ background: "#fff",
454
+ color: "#222",
455
+ fontSize: 15,
456
+ outline: "none"
457
+ } : {
458
+ width: "100%",
459
+ padding: "10px 12px",
460
+ borderRadius: 6,
461
+ border: "1px solid #23262F",
462
+ background: "#23262F",
463
+ color: "#fff",
464
+ fontSize: 15,
465
+ outline: "none"
466
+ }, f = l ? { marginBottom: 8, fontSize: 14, color: "#222" } : { marginBottom: 8, fontSize: 14 }, s = { color: "#ff4d4f", fontSize: 13, marginTop: 4 }, p = l ? {
467
+ background: "#fff",
468
+ color: "#222",
469
+ border: "1px solid #E5E6EB",
470
+ borderRadius: 6,
471
+ padding: "8px 24px",
472
+ fontSize: 15,
473
+ cursor: "pointer"
474
+ } : {
475
+ background: "#23262F",
476
+ color: "#fff",
477
+ border: "none",
478
+ borderRadius: 6,
479
+ padding: "8px 24px",
480
+ fontSize: 15,
481
+ cursor: "pointer"
482
+ }, i = l ? {
483
+ background: "#155EEF",
484
+ color: "#fff",
485
+ border: "none",
486
+ borderRadius: 6,
487
+ padding: "8px 24px",
488
+ fontSize: 15,
489
+ cursor: "pointer",
490
+ fontWeight: 600
491
+ } : {
492
+ background: "#00E8C6",
493
+ color: "#fff",
494
+ border: "none",
495
+ borderRadius: 6,
496
+ padding: "8px 24px",
497
+ fontSize: 15,
498
+ cursor: "pointer",
499
+ fontWeight: 600
500
+ };
501
+ return /* @__PURE__ */ u(A, { children: [
502
+ /* @__PURE__ */ u("div", { style: { marginBottom: 18 }, children: [
503
+ /* @__PURE__ */ u("div", { style: f, children: [
504
+ /* @__PURE__ */ u("span", { style: { color: "#F53F3F" }, children: "*" }),
505
+ " 充值币种"
506
+ ] }),
507
+ /* @__PURE__ */ u(
508
+ "select",
509
+ {
510
+ style: a,
511
+ value: e.currency,
512
+ onInput: (d) => {
513
+ const c = d.target.value;
514
+ n((h) => ({
515
+ ...h,
516
+ currency: c
517
+ }));
518
+ },
519
+ children: [
520
+ /* @__PURE__ */ u("option", { value: "USD", children: "USD - 美元" }),
521
+ /* @__PURE__ */ u("option", { value: "CNY", children: "CNY - 人民币" }),
522
+ /* @__PURE__ */ u("option", { value: "EUR", children: "EUR - 欧元" })
523
+ ]
524
+ }
525
+ )
526
+ ] }),
527
+ /* @__PURE__ */ u("div", { style: { marginBottom: 18 }, children: [
528
+ /* @__PURE__ */ u("div", { style: f, children: [
529
+ /* @__PURE__ */ u("span", { style: { color: "#F53F3F" }, children: "*" }),
530
+ " 充值金额"
531
+ ] }),
532
+ /* @__PURE__ */ u(
533
+ "input",
534
+ {
535
+ type: "text",
536
+ placeholder: "请输入充值金额",
537
+ value: e.amount,
538
+ onInput: (d) => {
539
+ const c = d.target.value;
540
+ n((h) => ({
541
+ ...h,
542
+ amount: c,
543
+ amountError: c.trim() ? "" : h.amountError
544
+ }));
545
+ },
546
+ style: o
547
+ }
548
+ ),
549
+ e.amountError && /* @__PURE__ */ u("div", { style: s, children: e.amountError })
550
+ ] }),
551
+ /* @__PURE__ */ u("div", { style: { marginBottom: 24 }, children: [
552
+ /* @__PURE__ */ u("div", { style: f, children: [
553
+ /* @__PURE__ */ u("span", { style: { color: "#F53F3F" }, children: "*" }),
554
+ " 支付平台"
555
+ ] }),
556
+ /* @__PURE__ */ u(
557
+ "select",
558
+ {
559
+ style: _,
560
+ value: e.rechargeChannel,
561
+ onInput: (d) => {
562
+ const c = d.target.value;
563
+ n((h) => ({
564
+ ...h,
565
+ rechargeChannel: c,
566
+ rechargeChannelError: c ? "" : h.rechargeChannelError
567
+ }));
568
+ },
569
+ children: [
570
+ /* @__PURE__ */ u("option", { value: "alipay", children: "支付宝" }),
571
+ /* @__PURE__ */ u("option", { value: "wechat", children: "微信" }),
572
+ /* @__PURE__ */ u("option", { value: "paypal", children: "PayPal" })
573
+ ]
574
+ }
575
+ ),
576
+ e.rechargeChannelError && /* @__PURE__ */ u("div", { style: s, children: e.rechargeChannelError })
577
+ ] }),
578
+ e.error && /* @__PURE__ */ u("div", { style: { color: "#ff4d4f", marginBottom: 12 }, children: e.error }),
579
+ /* @__PURE__ */ u("div", { style: { display: "flex", justifyContent: "flex-end", gap: 12 }, children: [
580
+ /* @__PURE__ */ u("button", { type: "button", onClick: r, style: p, children: "取消" }),
581
+ /* @__PURE__ */ u("button", { type: "submit", disabled: t, style: i, children: t ? "提交中..." : "去支付" })
582
+ ] })
583
+ ] });
584
+ }, Ke = ({ formState: e, setFormState: n, onClose: r, loading: t }) => {
585
+ const l = We(null), o = (i) => {
586
+ const d = Array.from(i.target.files).slice(0, 10);
587
+ n((c) => ({ ...c, files: d, filesError: "" }));
588
+ }, _ = (i) => {
589
+ i.preventDefault();
590
+ const d = Array.from(i.dataTransfer.files).slice(0, 10);
591
+ n((c) => ({ ...c, files: d, filesError: "" }));
592
+ }, a = (i) => {
593
+ i.preventDefault();
594
+ }, f = (i) => {
595
+ n((d) => ({
596
+ ...d,
597
+ files: d.files.filter((c, h) => h !== i)
598
+ }));
599
+ }, s = (i) => {
600
+ i.preventDefault();
601
+ let d = !0;
602
+ n((c) => ({
603
+ ...c,
604
+ platformError: "",
605
+ transactionIdError: "",
606
+ filesError: ""
607
+ })), e.platform || (n((c) => ({
608
+ ...c,
609
+ platformError: "请选择支付平台"
610
+ })), d = !1), e.transactionId.trim() || (n((c) => ({
611
+ ...c,
612
+ transactionIdError: "请输入转账交易ID"
613
+ })), d = !1), (!e.files || e.files.length === 0) && (n((c) => ({
614
+ ...c,
615
+ filesError: "请上传转账凭证"
616
+ })), d = !1), d && console.log("OfflineTransferForm values:", e);
617
+ }, p = (i) => i > 1024 * 1024 ? (i / 1024 / 1024).toFixed(2) + " MB" : i > 1024 ? (i / 1024).toFixed(2) + " KB" : i + " B";
618
+ return /* @__PURE__ */ u("form", { onSubmit: s, children: [
619
+ /* @__PURE__ */ u("div", { style: { marginBottom: 18 }, children: [
620
+ /* @__PURE__ */ u("div", { style: { marginBottom: 8, fontSize: 14, color: "#222" }, children: [
621
+ /* @__PURE__ */ u("span", { style: { color: "#F53F3F" }, children: "*" }),
622
+ " 第三方支付平台"
623
+ ] }),
624
+ /* @__PURE__ */ u(
625
+ "select",
626
+ {
627
+ style: {
628
+ width: "100%",
629
+ padding: "10px 12px",
630
+ borderRadius: 6,
631
+ border: e.platformError ? "1px solid #ff4d4f" : "1px solid #E5E6EB",
632
+ background: "#fff",
633
+ color: "#222",
634
+ fontSize: 15,
635
+ outline: "none"
636
+ },
637
+ value: e.platform,
638
+ onInput: (i) => {
639
+ const d = i.target.value;
640
+ n((c) => ({
641
+ ...c,
642
+ platform: d,
643
+ platformError: d ? "" : c.platformError
644
+ }));
645
+ },
646
+ children: [
647
+ /* @__PURE__ */ u("option", { value: "paypal", children: "PayPal" }),
648
+ /* @__PURE__ */ u("option", { value: "alipay", children: "支付宝" }),
649
+ /* @__PURE__ */ u("option", { value: "wechat", children: "微信" })
650
+ ]
493
651
  }
652
+ ),
653
+ e.platformError && /* @__PURE__ */ u("div", { style: { color: "#ff4d4f", fontSize: 13, marginTop: 4 }, children: e.platformError })
654
+ ] }),
655
+ /* @__PURE__ */ u("div", { style: { marginBottom: 18 }, children: [
656
+ /* @__PURE__ */ u("div", { style: { marginBottom: 8, fontSize: 14, color: "#222" }, children: [
657
+ /* @__PURE__ */ u("span", { style: { color: "#F53F3F" }, children: "*" }),
658
+ " 交易ID"
659
+ ] }),
660
+ /* @__PURE__ */ u(
661
+ "input",
662
+ {
663
+ type: "text",
664
+ placeholder: "请输入转账交易ID",
665
+ value: e.transactionId,
666
+ onInput: (i) => {
667
+ const d = i.target.value;
668
+ n((c) => ({
669
+ ...c,
670
+ transactionId: d,
671
+ transactionIdError: d ? "" : c.transactionIdError
672
+ }));
673
+ },
674
+ style: {
675
+ width: "100%",
676
+ padding: "10px 12px",
677
+ borderRadius: 6,
678
+ boxSizing: "border-box",
679
+ border: e.transactionIdError ? "1px solid #ff4d4f" : "1px solid #E5E6EB",
680
+ background: "#fff",
681
+ color: "#222",
682
+ fontSize: 15,
683
+ outline: "none",
684
+ marginBottom: 0
685
+ }
686
+ }
687
+ ),
688
+ e.transactionIdError && /* @__PURE__ */ u("div", { style: { color: "#ff4d4f", fontSize: 13, marginTop: 4 }, children: e.transactionIdError })
689
+ ] }),
690
+ /* @__PURE__ */ u("div", { style: { marginBottom: 24 }, children: [
691
+ /* @__PURE__ */ u("div", { style: { marginBottom: 8, fontSize: 14, color: "#222" }, children: [
692
+ /* @__PURE__ */ u("span", { style: { color: "#F53F3F" }, children: "*" }),
693
+ " 上传文件"
694
+ ] }),
695
+ /* @__PURE__ */ u(
696
+ "div",
697
+ {
698
+ style: {
699
+ border: e.filesError ? "1px dashed #ff4d4f" : "1px dashed #E5E6EB",
700
+ borderRadius: 8,
701
+ background: "#FCFCFD",
702
+ padding: 24,
703
+ textAlign: "center",
704
+ cursor: "pointer",
705
+ minHeight: 120,
706
+ display: "flex",
707
+ flexDirection: "column",
708
+ alignItems: "center",
709
+ justifyContent: "center",
710
+ color: "#999",
711
+ fontSize: 15
712
+ },
713
+ onClick: () => l.current?.click(),
714
+ onDrop: _,
715
+ onDragOver: a,
716
+ children: [
717
+ /* @__PURE__ */ u("div", { style: { fontSize: 48, marginBottom: 12 }, children: /* @__PURE__ */ u("svg", { width: "64", height: "64", viewBox: "0 0 64 64", fill: "none", children: [
718
+ /* @__PURE__ */ u("rect", { x: "8", y: "8", width: "48", height: "48", rx: "12", fill: "#F4F6FA" }),
719
+ /* @__PURE__ */ u("rect", { x: "28", y: "20", width: "8", height: "24", rx: "4", fill: "#E5E6EB" })
720
+ ] }) }),
721
+ /* @__PURE__ */ u("div", { style: { color: "#222", fontSize: 15, marginBottom: 4 }, children: "点击或拖拽文件到此处上传" }),
722
+ /* @__PURE__ */ u("div", { style: { color: "#999", fontSize: 13 }, children: "支持 JPG、PNG、PDF 格式,单个文件不超过 20MB,最多上传 10 个文件" }),
723
+ /* @__PURE__ */ u(
724
+ "input",
725
+ {
726
+ ref: l,
727
+ type: "file",
728
+ multiple: !0,
729
+ accept: ".jpg,.jpeg,.png,.pdf",
730
+ style: { display: "none" },
731
+ onChange: o
732
+ }
733
+ )
734
+ ]
735
+ }
736
+ ),
737
+ e.files && e.files.length > 0 && /* @__PURE__ */ u("div", { style: { marginTop: 12 }, children: e.files.map((i, d) => /* @__PURE__ */ u(
738
+ "div",
739
+ {
740
+ style: {
741
+ display: "flex",
742
+ alignItems: "center",
743
+ background: "#F7F8FA",
744
+ borderRadius: 8,
745
+ padding: "12px 16px",
746
+ marginBottom: 8,
747
+ fontSize: 15,
748
+ color: "#222",
749
+ justifyContent: "space-between"
750
+ },
751
+ children: [
752
+ /* @__PURE__ */ u("div", { style: { display: "flex", alignItems: "center", flex: 1 }, children: [
753
+ /* @__PURE__ */ u("span", { style: { fontWeight: 500 }, children: i.name }),
754
+ /* @__PURE__ */ u(
755
+ "span",
756
+ {
757
+ style: { color: "#8C8F93", fontSize: 13, marginLeft: 8 },
758
+ children: [
759
+ "(",
760
+ p(i.size),
761
+ ")"
762
+ ]
763
+ }
764
+ )
765
+ ] }),
766
+ /* @__PURE__ */ u(
767
+ "button",
768
+ {
769
+ type: "button",
770
+ onClick: (c) => {
771
+ c.stopPropagation(), f(d);
772
+ },
773
+ style: {
774
+ background: "#FF4D4F",
775
+ color: "#fff",
776
+ border: "none",
777
+ borderRadius: 6,
778
+ padding: "4px 14px",
779
+ fontSize: 15,
780
+ marginLeft: 16,
781
+ cursor: "pointer"
782
+ },
783
+ children: "移除"
784
+ }
785
+ )
786
+ ]
787
+ },
788
+ d
789
+ )) }),
790
+ e.filesError && /* @__PURE__ */ u("div", { style: { color: "#ff4d4f", fontSize: 13, marginTop: 4 }, children: e.filesError })
791
+ ] }),
792
+ /* @__PURE__ */ u("div", { style: { display: "flex", justifyContent: "flex-end", gap: 12 }, children: [
793
+ /* @__PURE__ */ u(
794
+ "button",
795
+ {
796
+ type: "button",
797
+ onClick: r,
798
+ style: {
799
+ background: "#fff",
800
+ color: "#222",
801
+ border: "1px solid #E5E6EB",
802
+ borderRadius: 6,
803
+ padding: "8px 24px",
804
+ fontSize: 15,
805
+ cursor: "pointer"
806
+ },
807
+ children: "取消"
808
+ }
809
+ ),
810
+ /* @__PURE__ */ u(
811
+ "button",
812
+ {
813
+ type: "submit",
814
+ disabled: t,
815
+ style: {
816
+ background: "#155EEF",
817
+ color: "#fff",
818
+ border: "none",
819
+ borderRadius: 6,
820
+ padding: "8px 24px",
821
+ fontSize: 15,
822
+ cursor: "pointer",
823
+ fontWeight: 600
824
+ },
825
+ children: "去支付"
826
+ }
827
+ )
828
+ ] })
829
+ ] });
830
+ };
831
+ function Qe({
832
+ visible: e,
833
+ onClose: n,
834
+ onSubmit: r,
835
+ color: t
836
+ }) {
837
+ console.log(1111);
838
+ const [l, o] = j({
839
+ amount: "",
840
+ rechargeChannel: "paypal",
841
+ currency: "USD",
842
+ loading: !1,
843
+ error: "",
844
+ amountError: "",
845
+ rechargeChannelError: "",
846
+ currencyError: ""
847
+ }), [_, a] = j("online"), [f, s] = j({
848
+ platform: "paypal",
849
+ transactionId: "",
850
+ files: [],
851
+ platformError: "",
852
+ transactionIdError: "",
853
+ filesError: "",
854
+ loading: !1
855
+ });
856
+ return Le(() => {
857
+ e || (a("online"), o({
858
+ amount: "",
859
+ rechargeChannel: "paypal",
860
+ currency: "USD",
861
+ loading: !1,
862
+ error: "",
863
+ amountError: "",
864
+ rechargeChannelError: "",
865
+ currencyError: ""
866
+ }), s({
867
+ platform: "paypal",
868
+ transactionId: "",
869
+ files: [],
870
+ platformError: "",
871
+ transactionIdError: "",
872
+ filesError: "",
873
+ loading: !1
874
+ }));
875
+ }, [e]), e ? /* @__PURE__ */ u(
876
+ "div",
877
+ {
878
+ style: {
879
+ position: "fixed",
880
+ top: 0,
881
+ left: 0,
882
+ right: 0,
883
+ bottom: 0,
884
+ background: "rgba(0,0,0,0.3)",
885
+ // 更浅的遮罩
886
+ display: "flex",
887
+ alignItems: "center",
888
+ justifyContent: "center",
889
+ zIndex: 9999
494
890
  },
495
- style: { background: "#fff", padding: 24, borderRadius: 8, minWidth: 320 },
496
- children: [
497
- /* @__PURE__ */ k("h2", { style: { color: n || "#1890ff" }, children: "表单" }),
498
- /* @__PURE__ */ k("div", { style: { marginBottom: 12 }, children: [
499
- /* @__PURE__ */ k(
500
- "input",
501
- {
502
- type: "text",
503
- placeholder: "姓名",
504
- value: o,
505
- onInput: (a) => r(a.target.value),
506
- required: !0,
507
- style: { width: "100%", padding: 8, marginBottom: 8 }
508
- }
509
- ),
510
- /* @__PURE__ */ k(
511
- "input",
512
- {
513
- type: "email",
514
- placeholder: "邮箱",
515
- value: l,
516
- onInput: (a) => u(a.target.value),
517
- required: !0,
518
- style: { width: "100%", padding: 8 }
891
+ onClick: (d) => {
892
+ d.target === d.currentTarget && n();
893
+ },
894
+ children: /* @__PURE__ */ u(
895
+ "form",
896
+ {
897
+ onSubmit: async (d) => {
898
+ d.preventDefault();
899
+ let c = !0;
900
+ if (o((h) => ({
901
+ ...h,
902
+ amountError: "",
903
+ rechargeChannelError: ""
904
+ })), l.amount.trim() || (o((h) => ({ ...h, amountError: "请输入充值金额" })), c = !1), l.rechargeChannel || (o((h) => ({
905
+ ...h,
906
+ rechargeChannelError: "请选择支付平台"
907
+ })), c = !1), !!c) {
908
+ o((h) => ({ ...h, loading: !0, error: "" }));
909
+ try {
910
+ await r({
911
+ amount: l.amount,
912
+ rechargeChannel: l.rechargeChannel,
913
+ currency: l.currency
914
+ }), n();
915
+ } catch {
916
+ o((h) => ({ ...h, error: "提交失败,请重试" }));
917
+ } finally {
918
+ o((h) => ({ ...h, loading: !1 }));
919
+ }
519
920
  }
520
- )
521
- ] }),
522
- f && /* @__PURE__ */ k("div", { style: { color: "red", marginBottom: 8 }, children: f }),
523
- /* @__PURE__ */ k(
524
- "button",
525
- {
526
- type: "submit",
527
- disabled: c,
528
- style: {
529
- background: n || "#1890ff",
530
- color: "#fff",
531
- border: "none",
532
- borderRadius: 4,
533
- padding: "8px 16px",
534
- cursor: "pointer",
535
- fontSize: 16
536
- },
537
- children: c ? "提交中..." : "提交"
538
- }
539
- ),
540
- /* @__PURE__ */ k(
541
- "button",
542
- {
543
- type: "button",
544
- onClick: t,
545
- style: { marginLeft: 12, background: "#eee", color: "#333", border: "none", borderRadius: 4, padding: "8px 16px", cursor: "pointer", fontSize: 16 },
546
- children: "取消"
547
- }
548
- )
549
- ]
921
+ },
922
+ style: {
923
+ background: "#fff",
924
+ // 白色弹窗
925
+ padding: 32,
926
+ borderRadius: 12,
927
+ minWidth: 400,
928
+ color: t || "#222",
929
+ // 深色字体
930
+ boxShadow: "0 4px 24px rgba(0,0,0,0.08)",
931
+ position: "relative"
932
+ },
933
+ onClick: (d) => d.stopPropagation(),
934
+ children: [
935
+ /* @__PURE__ */ u(
936
+ "button",
937
+ {
938
+ type: "button",
939
+ onClick: n,
940
+ style: {
941
+ position: "absolute",
942
+ right: 16,
943
+ top: 16,
944
+ background: "none",
945
+ border: "none",
946
+ color: "#222",
947
+ fontSize: 22,
948
+ cursor: "pointer",
949
+ lineHeight: 1
950
+ },
951
+ "aria-label": "关闭",
952
+ children: "×"
953
+ }
954
+ ),
955
+ /* @__PURE__ */ u(
956
+ "div",
957
+ {
958
+ style: {
959
+ fontWeight: 600,
960
+ fontSize: 20,
961
+ marginBottom: 24,
962
+ textAlign: "left",
963
+ color: "#222"
964
+ },
965
+ children: "充值 / 转账"
966
+ }
967
+ ),
968
+ /* @__PURE__ */ u("div", { style: { display: "flex", marginBottom: 28 }, children: [
969
+ /* @__PURE__ */ u(
970
+ "button",
971
+ {
972
+ type: "button",
973
+ onClick: () => a("online"),
974
+ style: {
975
+ flex: 1,
976
+ background: _ === "online" ? "#fff" : "#F7F8FA",
977
+ color: _ === "online" ? "#155EEF" : "#222",
978
+ border: "none",
979
+ borderRadius: "8px 0 0 8px",
980
+ fontWeight: _ === "online" ? 600 : 400,
981
+ fontSize: 16,
982
+ height: 48,
983
+ boxShadow: _ === "online" ? "0 2px 8px 0 rgba(20,20,20,0.04)" : "none",
984
+ outline: "none",
985
+ cursor: "pointer",
986
+ borderRight: "1px solid #F0F1F3",
987
+ transition: "all 0.2s"
988
+ },
989
+ children: "在线充值"
990
+ }
991
+ ),
992
+ /* @__PURE__ */ u(
993
+ "button",
994
+ {
995
+ type: "button",
996
+ onClick: () => a("offline"),
997
+ style: {
998
+ flex: 1,
999
+ background: _ === "offline" ? "#fff" : "#F7F8FA",
1000
+ color: _ === "offline" ? "#155EEF" : "#222",
1001
+ border: "none",
1002
+ borderRadius: "0 8px 8px 0",
1003
+ fontWeight: _ === "offline" ? 600 : 400,
1004
+ fontSize: 16,
1005
+ height: 48,
1006
+ boxShadow: _ === "offline" ? "0 2px 8px 0 rgba(20,20,20,0.04)" : "none",
1007
+ outline: "none",
1008
+ cursor: "pointer",
1009
+ borderLeft: "1px solid #F0F1F3",
1010
+ transition: "all 0.2s"
1011
+ },
1012
+ children: "线下转账"
1013
+ }
1014
+ )
1015
+ ] }),
1016
+ _ === "online" ? /* @__PURE__ */ u(
1017
+ Ye,
1018
+ {
1019
+ formState: l,
1020
+ setFormState: o,
1021
+ onClose: n,
1022
+ loading: l.loading,
1023
+ whiteTheme: !0
1024
+ }
1025
+ ) : /* @__PURE__ */ u(
1026
+ Ke,
1027
+ {
1028
+ formState: f,
1029
+ setFormState: s,
1030
+ onClose: n,
1031
+ loading: f.loading
1032
+ }
1033
+ )
1034
+ ]
1035
+ }
1036
+ )
1037
+ }
1038
+ ) : null;
1039
+ }
1040
+ function oe() {
1041
+ return (oe = Object.assign ? Object.assign.bind() : function(e) {
1042
+ for (var n = 1; n < arguments.length; n++) {
1043
+ var r = arguments[n];
1044
+ for (var t in r) Object.prototype.hasOwnProperty.call(r, t) && (e[t] = r[t]);
550
1045
  }
551
- ) }) : null;
1046
+ return e;
1047
+ }).apply(this, arguments);
552
1048
  }
1049
+ var Xe = ["context", "children"];
553
1050
  function Ze(e) {
554
- const [t, _] = A(!1), n = e.theme?.primaryColor;
555
- return /* @__PURE__ */ k("div", { children: [
556
- /* @__PURE__ */ k(Xe, { color: n, onClick: () => _(!0), children: "打开表单" }),
557
- /* @__PURE__ */ k(
558
- Ye,
1051
+ this.getChildContext = function() {
1052
+ return e.context;
1053
+ };
1054
+ var n = e.children, r = function(t, l) {
1055
+ if (t == null) return {};
1056
+ var o, _, a = {}, f = Object.keys(t);
1057
+ for (_ = 0; _ < f.length; _++) l.indexOf(o = f[_]) >= 0 || (a[o] = t[o]);
1058
+ return a;
1059
+ }(e, Xe);
1060
+ return Pe(n, r);
1061
+ }
1062
+ function en() {
1063
+ var e = new CustomEvent("_preact", { detail: {}, bubbles: !0, cancelable: !0 });
1064
+ this.dispatchEvent(e), this._vdom = S(Ze, oe({}, this._props, { context: e.detail.context }), function n(r, t) {
1065
+ if (r.nodeType === 3) return r.data;
1066
+ if (r.nodeType !== 1) return null;
1067
+ var l = [], o = {}, _ = 0, a = r.attributes, f = r.childNodes;
1068
+ for (_ = a.length; _--; ) a[_].name !== "slot" && (o[a[_].name] = a[_].value, o[Te(a[_].name)] = a[_].value);
1069
+ for (_ = f.length; _--; ) {
1070
+ var s = n(f[_], null), p = f[_].slot;
1071
+ p ? o[p] = S(ye, { name: p }, s) : l[_] = s;
1072
+ }
1073
+ var i = t ? S(ye, null, l) : l;
1074
+ return S(t || r.nodeName.toLowerCase(), o, i);
1075
+ }(this, this._vdomComponent)), (this.hasAttribute("hydrate") ? ze : V)(this._vdom, this._root);
1076
+ }
1077
+ function Te(e) {
1078
+ return e.replace(/-(\w)/g, function(n, r) {
1079
+ return r ? r.toUpperCase() : "";
1080
+ });
1081
+ }
1082
+ function nn(e, n, r) {
1083
+ if (this._vdom) {
1084
+ var t = {};
1085
+ t[e] = r = r ?? void 0, t[Te(e)] = r, this._vdom = Pe(this._vdom, t), V(this._vdom, this._root);
1086
+ }
1087
+ }
1088
+ function rn() {
1089
+ V(this._vdom = null, this._root);
1090
+ }
1091
+ function ye(e, n) {
1092
+ var r = this;
1093
+ return S("slot", oe({}, e, { ref: function(t) {
1094
+ t ? (r.ref = t, r._listener || (r._listener = function(l) {
1095
+ l.stopPropagation(), l.detail.context = n;
1096
+ }, t.addEventListener("_preact", r._listener))) : r.ref.removeEventListener("_preact", r._listener);
1097
+ } }));
1098
+ }
1099
+ function tn(e, n, r, t) {
1100
+ function l() {
1101
+ var o = Reflect.construct(HTMLElement, [], l);
1102
+ return o._vdomComponent = e, o._root = o, o;
1103
+ }
1104
+ return (l.prototype = Object.create(HTMLElement.prototype)).constructor = l, l.prototype.connectedCallback = en, l.prototype.attributeChangedCallback = nn, l.prototype.disconnectedCallback = rn, r = r || e.observedAttributes || Object.keys(e.propTypes || {}), l.observedAttributes = r, r.forEach(function(o) {
1105
+ Object.defineProperty(l.prototype, o, { get: function() {
1106
+ return this._vdom.props[o];
1107
+ }, set: function(_) {
1108
+ this._vdom ? this.attributeChangedCallback(o, null, _) : (this._props || (this._props = {}), this._props[o] = _, this.connectedCallback());
1109
+ var a = typeof _;
1110
+ _ != null && a !== "string" && a !== "boolean" && a !== "number" || this.setAttribute(o, _);
1111
+ } });
1112
+ }), customElements.define(n, l);
1113
+ }
1114
+ function on(e) {
1115
+ const [n, r] = j(!1), t = e.theme?.primaryColor;
1116
+ return /* @__PURE__ */ u("div", { children: [
1117
+ /* @__PURE__ */ u(Je, { color: t, onClick: () => r(!0), children: "打开表单" }),
1118
+ /* @__PURE__ */ u(
1119
+ Qe,
559
1120
  {
560
- visible: t,
561
- onClose: () => _(!1),
562
- onSubmit: async (r) => {
563
- console.log("submit", r);
1121
+ visible: n,
1122
+ onClose: () => r(!1),
1123
+ onSubmit: async (o) => {
1124
+ console.log("submit", o);
564
1125
  },
565
- color: n
1126
+ color: t
566
1127
  }
567
1128
  )
568
1129
  ] });
569
1130
  }
570
- Ue(Ze, "x-best-modal-form", ["theme"], { shadow: !1 });
571
- const _t = ["x-greeting", "x-best-modal-form"];
1131
+ tn(on, "x-best-modal-form", ["theme"]);
1132
+ const an = ["x-greeting", "x-best-modal-form"];
572
1133
  export {
573
- _t as components,
574
- et as npmTest,
575
- tt as printCurrentTime
1134
+ an as components,
1135
+ ln as npmTest,
1136
+ _n as printCurrentTime
576
1137
  };