best-unit 0.0.6 → 0.0.8

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,31 +1,31 @@
1
- function $e() {
1
+ function tt() {
2
2
  console.log("npm package test!!!");
3
3
  }
4
- function Le() {
4
+ function nt() {
5
5
  console.log("Current time:", (/* @__PURE__ */ new Date()).toISOString());
6
6
  }
7
- var D, d, te, x, Q, ne, _e, re, z, R, B, M = {}, oe = [], de = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, H = Array.isArray;
8
- function k(t, e) {
7
+ var D, h, ve, w, oe, ge, ye, be, X, G, J, A = {}, ke = [], De = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, W = Array.isArray;
8
+ function E(t, e) {
9
9
  for (var n in e) t[n] = e[n];
10
10
  return t;
11
11
  }
12
- function G(t) {
12
+ function Z(t) {
13
13
  t && t.parentNode && t.parentNode.removeChild(t);
14
14
  }
15
- function C(t, e, n) {
16
- var o, l, _, i = {};
17
- for (_ in e) _ == "key" ? o = e[_] : _ == "ref" ? l = e[_] : i[_] = e[_];
18
- if (arguments.length > 2 && (i.children = arguments.length > 3 ? D.call(arguments, 2) : n), typeof t == "function" && t.defaultProps != null) for (_ in t.defaultProps) i[_] === void 0 && (i[_] = t.defaultProps[_]);
19
- return L(t, i, o, l, null);
15
+ function $(t, e, n) {
16
+ var o, _, r, l = {};
17
+ for (r in e) r == "key" ? o = e[r] : r == "ref" ? _ = e[r] : l[r] = e[r];
18
+ if (arguments.length > 2 && (l.children = arguments.length > 3 ? D.call(arguments, 2) : n), typeof t == "function" && t.defaultProps != null) for (r in t.defaultProps) l[r] === void 0 && (l[r] = t.defaultProps[r]);
19
+ return F(t, l, o, _, null);
20
20
  }
21
- function L(t, e, n, o, l) {
22
- var _ = { type: t, props: e, key: n, ref: o, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: l ?? ++te, __i: -1, __u: 0 };
23
- return l == null && d.vnode != null && d.vnode(_), _;
21
+ function F(t, e, n, o, _) {
22
+ var r = { type: t, props: e, key: n, ref: o, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: _ ?? ++ve, __i: -1, __u: 0 };
23
+ return _ == null && h.vnode != null && h.vnode(r), r;
24
24
  }
25
- function F(t) {
25
+ function I(t) {
26
26
  return t.children;
27
27
  }
28
- function j(t, e) {
28
+ function L(t, e) {
29
29
  this.props = t, this.context = e;
30
30
  }
31
31
  function P(t, e) {
@@ -33,38 +33,38 @@ function P(t, e) {
33
33
  for (var n; e < t.__k.length; e++) if ((n = t.__k[e]) != null && n.__e != null) return n.__e;
34
34
  return typeof t.type == "function" ? P(t) : null;
35
35
  }
36
- function le(t) {
36
+ function Ce(t) {
37
37
  var e, n;
38
38
  if ((t = t.__) != null && t.__c != null) {
39
39
  for (t.__e = t.__c.base = null, e = 0; e < t.__k.length; e++) if ((n = t.__k[e]) != null && n.__e != null) {
40
40
  t.__e = t.__c.base = n.__e;
41
41
  break;
42
42
  }
43
- return le(t);
43
+ return Ce(t);
44
44
  }
45
45
  }
46
- function X(t) {
47
- (!t.__d && (t.__d = !0) && x.push(t) && !N.__r++ || Q != d.debounceRendering) && ((Q = d.debounceRendering) || ne)(N);
46
+ function _e(t) {
47
+ (!t.__d && (t.__d = !0) && w.push(t) && !j.__r++ || oe != h.debounceRendering) && ((oe = h.debounceRendering) || ge)(j);
48
48
  }
49
- function N() {
50
- for (var t, e, n, o, l, _, i, s = 1; x.length; ) x.length > s && x.sort(_e), t = x.shift(), s = x.length, t.__d && (n = void 0, l = (o = (e = t).__v).__e, _ = [], i = [], e.__P && ((n = k({}, o)).__v = o.__v + 1, d.vnode && d.vnode(n), V(e.__P, n, o, e.__n, e.__P.namespaceURI, 32 & o.__u ? [l] : null, _, l ?? P(o), !!(32 & o.__u), i), n.__v = o.__v, n.__.__k[n.__i] = n, ue(_, n, i), n.__e != l && le(n)));
51
- N.__r = 0;
49
+ function j() {
50
+ for (var t, e, n, o, _, r, l, a = 1; w.length; ) w.length > a && w.sort(ye), t = w.shift(), a = w.length, t.__d && (n = void 0, _ = (o = (e = t).__v).__e, r = [], l = [], e.__P && ((n = E({}, o)).__v = o.__v + 1, h.vnode && h.vnode(n), ee(e.__P, n, o, e.__n, e.__P.namespaceURI, 32 & o.__u ? [_] : null, r, _ ?? P(o), !!(32 & o.__u), l), n.__v = o.__v, n.__.__k[n.__i] = n, Se(r, n, l), n.__e != _ && Ce(n)));
51
+ j.__r = 0;
52
52
  }
53
- function ie(t, e, n, o, l, _, i, s, c, u, a) {
54
- var r, v, p, m, g, y, f = o && o.__k || oe, h = e.length;
55
- for (c = ve(n, e, f, c, h), r = 0; r < h; r++) (p = n.__k[r]) != null && (v = p.__i == -1 ? M : f[p.__i] || M, p.__i = r, y = V(t, p, v, l, _, i, s, c, u, a), m = p.__e, p.ref && v.ref != p.ref && (v.ref && q(v.ref, null, p), a.push(p.ref, p.__c || m, p)), g == null && m != null && (g = m), 4 & p.__u || v.__k === p.__k ? c = se(p, c, t) : typeof p.type == "function" && y !== void 0 ? c = y : m && (c = m.nextSibling), p.__u &= -7);
56
- return n.__e = g, c;
53
+ function xe(t, e, n, o, _, r, l, a, u, c, s) {
54
+ var i, p, f, b, C, k, m = o && o.__k || ke, v = e.length;
55
+ for (u = Me(n, e, m, u, v), i = 0; i < v; i++) (f = n.__k[i]) != null && (p = f.__i == -1 ? A : m[f.__i] || A, f.__i = i, k = ee(t, f, p, _, r, l, a, u, c, s), b = f.__e, f.ref && p.ref != f.ref && (p.ref && te(p.ref, null, f), s.push(f.ref, f.__c || b, f)), C == null && b != null && (C = b), 4 & f.__u || p.__k === f.__k ? u = Ee(f, u, t) : typeof f.type == "function" && k !== void 0 ? u = k : b && (u = b.nextSibling), f.__u &= -7);
56
+ return n.__e = C, u;
57
57
  }
58
- function ve(t, e, n, o, l) {
59
- var _, i, s, c, u, a = n.length, r = a, v = 0;
60
- for (t.__k = new Array(l), _ = 0; _ < l; _++) (i = e[_]) != null && typeof i != "boolean" && typeof i != "function" ? (c = _ + v, (i = t.__k[_] = typeof i == "string" || typeof i == "number" || typeof i == "bigint" || i.constructor == String ? L(null, i, null, null, null) : H(i) ? L(F, { children: i }, null, null, null) : i.constructor == null && i.__b > 0 ? L(i.type, i.props, i.key, i.ref ? i.ref : null, i.__v) : i).__ = t, i.__b = t.__b + 1, s = null, (u = i.__i = me(i, n, c, r)) != -1 && (r--, (s = n[u]) && (s.__u |= 2)), s == null || s.__v == null ? (u == -1 && (l > a ? v-- : l < a && v++), typeof i.type != "function" && (i.__u |= 4)) : u != c && (u == c - 1 ? v-- : u == c + 1 ? v++ : (u > c ? v-- : v++, i.__u |= 4))) : t.__k[_] = null;
61
- if (r) for (_ = 0; _ < a; _++) (s = n[_]) != null && (2 & s.__u) == 0 && (s.__e == o && (o = P(s)), pe(s, s));
58
+ function Me(t, e, n, o, _) {
59
+ var r, l, a, u, c, s = n.length, i = s, p = 0;
60
+ for (t.__k = new Array(_), r = 0; r < _; r++) (l = e[r]) != null && typeof l != "boolean" && typeof l != "function" ? (u = r + p, (l = t.__k[r] = typeof l == "string" || typeof l == "number" || typeof l == "bigint" || l.constructor == String ? F(null, l, null, null, null) : W(l) ? F(I, { children: l }, null, null, null) : l.constructor == null && l.__b > 0 ? F(l.type, l.props, l.key, l.ref ? l.ref : null, l.__v) : l).__ = t, l.__b = t.__b + 1, a = null, (c = l.__i = ze(l, n, u, i)) != -1 && (i--, (a = n[c]) && (a.__u |= 2)), a == null || a.__v == null ? (c == -1 && (_ > s ? p-- : _ < s && p++), typeof l.type != "function" && (l.__u |= 4)) : c != u && (c == u - 1 ? p-- : c == u + 1 ? p++ : (c > u ? p-- : p++, l.__u |= 4))) : t.__k[r] = null;
61
+ if (i) for (r = 0; r < s; r++) (a = n[r]) != null && (2 & a.__u) == 0 && (a.__e == o && (o = P(a)), $e(a, a));
62
62
  return o;
63
63
  }
64
- function se(t, e, n) {
65
- var o, l;
64
+ function Ee(t, e, n) {
65
+ var o, _;
66
66
  if (typeof t.type == "function") {
67
- for (o = t.__k, l = 0; o && l < o.length; l++) o[l] && (o[l].__ = t, e = se(o[l], e, n));
67
+ for (o = t.__k, _ = 0; o && _ < o.length; _++) o[_] && (o[_].__ = t, e = Ee(o[_], e, n));
68
68
  return e;
69
69
  }
70
70
  t.__e != e && (e && t.type && !n.contains(e) && (e = P(t)), n.insertBefore(t.__e, e || null), e = t.__e);
@@ -73,34 +73,34 @@ function se(t, e, n) {
73
73
  while (e != null && e.nodeType == 8);
74
74
  return e;
75
75
  }
76
- function me(t, e, n, o) {
77
- var l, _, i = t.key, s = t.type, c = e[n];
78
- if (c === null && t.key == null || c && i == c.key && s == c.type && (2 & c.__u) == 0) return n;
79
- if (o > (c != null && (2 & c.__u) == 0 ? 1 : 0)) for (l = n - 1, _ = n + 1; l >= 0 || _ < e.length; ) {
80
- if (l >= 0) {
81
- if ((c = e[l]) && (2 & c.__u) == 0 && i == c.key && s == c.type) return l;
82
- l--;
76
+ function ze(t, e, n, o) {
77
+ var _, r, l = t.key, a = t.type, u = e[n];
78
+ if (u === null && t.key == null || u && l == u.key && a == u.type && (2 & u.__u) == 0) return n;
79
+ if (o > (u != null && (2 & u.__u) == 0 ? 1 : 0)) for (_ = n - 1, r = n + 1; _ >= 0 || r < e.length; ) {
80
+ if (_ >= 0) {
81
+ if ((u = e[_]) && (2 & u.__u) == 0 && l == u.key && a == u.type) return _;
82
+ _--;
83
83
  }
84
- if (_ < e.length) {
85
- if ((c = e[_]) && (2 & c.__u) == 0 && i == c.key && s == c.type) return _;
86
- _++;
84
+ if (r < e.length) {
85
+ if ((u = e[r]) && (2 & u.__u) == 0 && l == u.key && a == u.type) return r;
86
+ r++;
87
87
  }
88
88
  }
89
89
  return -1;
90
90
  }
91
- function Y(t, e, n) {
92
- e[0] == "-" ? t.setProperty(e, n ?? "") : t[e] = n == null ? "" : typeof n != "number" || de.test(e) ? n : n + "px";
91
+ function ie(t, e, n) {
92
+ e[0] == "-" ? t.setProperty(e, n ?? "") : t[e] = n == null ? "" : typeof n != "number" || De.test(e) ? n : n + "px";
93
93
  }
94
- function A(t, e, n, o, l) {
95
- var _, i;
94
+ function B(t, e, n, o, _) {
95
+ var r, l;
96
96
  e: if (e == "style") if (typeof n == "string") t.style.cssText = n;
97
97
  else {
98
- if (typeof o == "string" && (t.style.cssText = o = ""), o) for (e in o) n && e in n || Y(t.style, e, "");
99
- if (n) for (e in n) o && n[e] == o[e] || Y(t.style, e, n[e]);
98
+ if (typeof o == "string" && (t.style.cssText = o = ""), o) for (e in o) n && e in n || ie(t.style, e, "");
99
+ if (n) for (e in n) o && n[e] == o[e] || ie(t.style, e, n[e]);
100
100
  }
101
- else if (e[0] == "o" && e[1] == "n") _ = e != (e = e.replace(re, "$1")), i = e.toLowerCase(), e = i in t || e == "onFocusOut" || e == "onFocusIn" ? i.slice(2) : e.slice(2), t.l || (t.l = {}), t.l[e + _] = n, n ? o ? n.u = o.u : (n.u = z, t.addEventListener(e, _ ? B : R, _)) : t.removeEventListener(e, _ ? B : R, _);
101
+ else if (e[0] == "o" && e[1] == "n") r = e != (e = e.replace(be, "$1")), l = e.toLowerCase(), e = l in t || e == "onFocusOut" || e == "onFocusIn" ? l.slice(2) : e.slice(2), t.l || (t.l = {}), t.l[e + r] = n, n ? o ? n.u = o.u : (n.u = X, t.addEventListener(e, r ? J : G, r)) : t.removeEventListener(e, r ? J : G, r);
102
102
  else {
103
- if (l == "http://www.w3.org/2000/svg") e = e.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
103
+ if (_ == "http://www.w3.org/2000/svg") e = e.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
104
104
  else if (e != "width" && e != "height" && e != "href" && e != "list" && e != "form" && e != "tabIndex" && e != "download" && e != "rowSpan" && e != "colSpan" && e != "role" && e != "popover" && e in t) try {
105
105
  t[e] = n ?? "";
106
106
  break e;
@@ -109,159 +109,505 @@ function A(t, e, n, o, l) {
109
109
  typeof n == "function" || (n == null || n === !1 && e[4] != "-" ? t.removeAttribute(e) : t.setAttribute(e, e == "popover" && n == 1 ? "" : n));
110
110
  }
111
111
  }
112
- function Z(t) {
112
+ function le(t) {
113
113
  return function(e) {
114
114
  if (this.l) {
115
115
  var n = this.l[e.type + t];
116
- if (e.t == null) e.t = z++;
116
+ if (e.t == null) e.t = X++;
117
117
  else if (e.t < n.u) return;
118
- return n(d.event ? d.event(e) : e);
118
+ return n(h.event ? h.event(e) : e);
119
119
  }
120
120
  };
121
121
  }
122
- function V(t, e, n, o, l, _, i, s, c, u) {
123
- var a, r, v, p, m, g, y, f, h, S, w, O, T, K, U, E, I, b = e.type;
122
+ function ee(t, e, n, o, _, r, l, a, u, c) {
123
+ var s, i, p, f, b, C, k, m, v, H, S, M, T, re, z, U, V, x = e.type;
124
124
  if (e.constructor != null) return null;
125
- 128 & n.__u && (c = !!(32 & n.__u), _ = [s = e.__e = n.__e]), (a = d.__b) && a(e);
126
- e: if (typeof b == "function") try {
127
- if (f = e.props, h = "prototype" in b && b.prototype.render, S = (a = b.contextType) && o[a.__c], w = a ? S ? S.props.value : a.__ : o, n.__c ? y = (r = e.__c = n.__c).__ = r.__E : (h ? e.__c = r = new b(f, w) : (e.__c = r = new j(f, w), r.constructor = b, r.render = ge), S && S.sub(r), r.props = f, r.state || (r.state = {}), r.context = w, r.__n = o, v = r.__d = !0, r.__h = [], r._sb = []), h && r.__s == null && (r.__s = r.state), h && b.getDerivedStateFromProps != null && (r.__s == r.state && (r.__s = k({}, r.__s)), k(r.__s, b.getDerivedStateFromProps(f, r.__s))), p = r.props, m = r.state, r.__v = e, v) h && b.getDerivedStateFromProps == null && r.componentWillMount != null && r.componentWillMount(), h && r.componentDidMount != null && r.__h.push(r.componentDidMount);
125
+ 128 & n.__u && (u = !!(32 & n.__u), r = [a = e.__e = n.__e]), (s = h.__b) && s(e);
126
+ e: if (typeof x == "function") try {
127
+ if (m = e.props, v = "prototype" in x && x.prototype.render, H = (s = x.contextType) && o[s.__c], S = s ? H ? H.props.value : s.__ : o, n.__c ? k = (i = e.__c = n.__c).__ = i.__E : (v ? e.__c = i = new x(m, S) : (e.__c = i = new L(m, S), i.constructor = x, i.render = Le), H && H.sub(i), i.props = m, i.state || (i.state = {}), i.context = S, i.__n = o, p = i.__d = !0, i.__h = [], i._sb = []), v && i.__s == null && (i.__s = i.state), v && x.getDerivedStateFromProps != null && (i.__s == i.state && (i.__s = E({}, i.__s)), E(i.__s, x.getDerivedStateFromProps(m, i.__s))), f = i.props, b = i.state, i.__v = e, p) v && x.getDerivedStateFromProps == null && i.componentWillMount != null && i.componentWillMount(), v && i.componentDidMount != null && i.__h.push(i.componentDidMount);
128
128
  else {
129
- if (h && b.getDerivedStateFromProps == null && f !== p && r.componentWillReceiveProps != null && r.componentWillReceiveProps(f, w), !r.__e && r.shouldComponentUpdate != null && r.shouldComponentUpdate(f, r.__s, w) === !1 || e.__v == n.__v) {
130
- for (e.__v != n.__v && (r.props = f, r.state = r.__s, r.__d = !1), e.__e = n.__e, e.__k = n.__k, e.__k.some(function($) {
131
- $ && ($.__ = e);
132
- }), O = 0; O < r._sb.length; O++) r.__h.push(r._sb[O]);
133
- r._sb = [], r.__h.length && i.push(r);
129
+ if (v && x.getDerivedStateFromProps == null && m !== f && i.componentWillReceiveProps != null && i.componentWillReceiveProps(m, S), !i.__e && i.shouldComponentUpdate != null && i.shouldComponentUpdate(m, i.__s, S) === !1 || e.__v == n.__v) {
130
+ for (e.__v != n.__v && (i.props = m, i.state = i.__s, i.__d = !1), e.__e = n.__e, e.__k = n.__k, e.__k.some(function(N) {
131
+ N && (N.__ = e);
132
+ }), M = 0; M < i._sb.length; M++) i.__h.push(i._sb[M]);
133
+ i._sb = [], i.__h.length && l.push(i);
134
134
  break e;
135
135
  }
136
- r.componentWillUpdate != null && r.componentWillUpdate(f, r.__s, w), h && r.componentDidUpdate != null && r.__h.push(function() {
137
- r.componentDidUpdate(p, m, g);
136
+ i.componentWillUpdate != null && i.componentWillUpdate(m, i.__s, S), v && i.componentDidUpdate != null && i.__h.push(function() {
137
+ i.componentDidUpdate(f, b, C);
138
138
  });
139
139
  }
140
- if (r.context = w, r.props = f, r.__P = t, r.__e = !1, T = d.__r, K = 0, h) {
141
- for (r.state = r.__s, r.__d = !1, T && T(e), a = r.render(r.props, r.state, r.context), U = 0; U < r._sb.length; U++) r.__h.push(r._sb[U]);
142
- r._sb = [];
140
+ if (i.context = S, i.props = m, i.__P = t, i.__e = !1, T = h.__r, re = 0, v) {
141
+ for (i.state = i.__s, i.__d = !1, T && T(e), s = i.render(i.props, i.state, i.context), z = 0; z < i._sb.length; z++) i.__h.push(i._sb[z]);
142
+ i._sb = [];
143
143
  } else do
144
- r.__d = !1, T && T(e), a = r.render(r.props, r.state, r.context), r.state = r.__s;
145
- while (r.__d && ++K < 25);
146
- r.state = r.__s, r.getChildContext != null && (o = k(k({}, o), r.getChildContext())), h && !v && r.getSnapshotBeforeUpdate != null && (g = r.getSnapshotBeforeUpdate(p, m)), E = a, a != null && a.type === F && a.key == null && (E = ce(a.props.children)), s = ie(t, H(E) ? E : [E], e, n, o, l, _, i, s, c, u), r.base = e.__e, e.__u &= -161, r.__h.length && i.push(r), y && (r.__E = r.__ = null);
147
- } catch ($) {
148
- if (e.__v = null, c || _ != null) if ($.then) {
149
- for (e.__u |= c ? 160 : 128; s && s.nodeType == 8 && s.nextSibling; ) s = s.nextSibling;
150
- _[_.indexOf(s)] = null, e.__e = s;
151
- } else for (I = _.length; I--; ) G(_[I]);
144
+ i.__d = !1, T && T(e), s = 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 && (o = E(E({}, o), i.getChildContext())), v && !p && i.getSnapshotBeforeUpdate != null && (C = i.getSnapshotBeforeUpdate(f, b)), U = s, s != null && s.type === I && s.key == null && (U = we(s.props.children)), a = xe(t, W(U) ? U : [U], e, n, o, _, r, l, a, u, c), i.base = e.__e, e.__u &= -161, i.__h.length && l.push(i), k && (i.__E = i.__ = null);
147
+ } catch (N) {
148
+ if (e.__v = null, u || r != null) if (N.then) {
149
+ for (e.__u |= u ? 160 : 128; a && a.nodeType == 8 && a.nextSibling; ) a = a.nextSibling;
150
+ r[r.indexOf(a)] = null, e.__e = a;
151
+ } else for (V = r.length; V--; ) Z(r[V]);
152
152
  else e.__e = n.__e, e.__k = n.__k;
153
- d.__e($, e, n);
153
+ h.__e(N, e, n);
154
154
  }
155
- else _ == null && e.__v == n.__v ? (e.__k = n.__k, e.__e = n.__e) : s = e.__e = ye(n.__e, e, n, o, l, _, i, c, u);
156
- return (a = d.diffed) && a(e), 128 & e.__u ? void 0 : s;
155
+ else r == null && e.__v == n.__v ? (e.__k = n.__k, e.__e = n.__e) : a = e.__e = Be(n.__e, e, n, o, _, r, l, u, c);
156
+ return (s = h.diffed) && s(e), 128 & e.__u ? void 0 : a;
157
157
  }
158
- function ue(t, e, n) {
159
- for (var o = 0; o < n.length; o++) q(n[o], n[++o], n[++o]);
160
- d.__c && d.__c(e, t), t.some(function(l) {
158
+ function Se(t, e, n) {
159
+ for (var o = 0; o < n.length; o++) te(n[o], n[++o], n[++o]);
160
+ h.__c && h.__c(e, t), t.some(function(_) {
161
161
  try {
162
- t = l.__h, l.__h = [], t.some(function(_) {
163
- _.call(l);
162
+ t = _.__h, _.__h = [], t.some(function(r) {
163
+ r.call(_);
164
164
  });
165
- } catch (_) {
166
- d.__e(_, l.__v);
165
+ } catch (r) {
166
+ h.__e(r, _.__v);
167
167
  }
168
168
  });
169
169
  }
170
- function ce(t) {
171
- return typeof t != "object" || t == null || t.__b && t.__b > 0 ? t : H(t) ? t.map(ce) : k({}, t);
170
+ function we(t) {
171
+ return typeof t != "object" || t == null || t.__b && t.__b > 0 ? t : W(t) ? t.map(we) : E({}, t);
172
172
  }
173
- function ye(t, e, n, o, l, _, i, s, c) {
174
- var u, a, r, v, p, m, g, y = n.props, f = e.props, h = e.type;
175
- if (h == "svg" ? l = "http://www.w3.org/2000/svg" : h == "math" ? l = "http://www.w3.org/1998/Math/MathML" : l || (l = "http://www.w3.org/1999/xhtml"), _ != null) {
176
- for (u = 0; u < _.length; u++) if ((p = _[u]) && "setAttribute" in p == !!h && (h ? p.localName == h : p.nodeType == 3)) {
177
- t = p, _[u] = null;
173
+ function Be(t, e, n, o, _, r, l, a, u) {
174
+ var c, s, i, p, f, b, C, k = n.props, m = e.props, v = e.type;
175
+ if (v == "svg" ? _ = "http://www.w3.org/2000/svg" : v == "math" ? _ = "http://www.w3.org/1998/Math/MathML" : _ || (_ = "http://www.w3.org/1999/xhtml"), r != null) {
176
+ for (c = 0; c < r.length; c++) if ((f = r[c]) && "setAttribute" in f == !!v && (v ? f.localName == v : f.nodeType == 3)) {
177
+ t = f, r[c] = null;
178
178
  break;
179
179
  }
180
180
  }
181
181
  if (t == null) {
182
- if (h == null) return document.createTextNode(f);
183
- t = document.createElementNS(l, h, f.is && f), s && (d.__m && d.__m(e, _), s = !1), _ = null;
182
+ if (v == null) return document.createTextNode(m);
183
+ t = document.createElementNS(_, v, m.is && m), a && (h.__m && h.__m(e, r), a = !1), r = null;
184
184
  }
185
- if (h == null) y === f || s && t.data == f || (t.data = f);
185
+ if (v == null) k === m || a && t.data == m || (t.data = m);
186
186
  else {
187
- if (_ = _ && D.call(t.childNodes), y = n.props || M, !s && _ != null) for (y = {}, u = 0; u < t.attributes.length; u++) y[(p = t.attributes[u]).name] = p.value;
188
- for (u in y) if (p = y[u], u != "children") {
189
- if (u == "dangerouslySetInnerHTML") r = p;
190
- else if (!(u in f)) {
191
- if (u == "value" && "defaultValue" in f || u == "checked" && "defaultChecked" in f) continue;
192
- A(t, u, null, p, l);
187
+ if (r = r && D.call(t.childNodes), k = n.props || A, !a && r != null) for (k = {}, c = 0; c < t.attributes.length; c++) k[(f = t.attributes[c]).name] = f.value;
188
+ for (c in k) if (f = k[c], c != "children") {
189
+ if (c == "dangerouslySetInnerHTML") i = f;
190
+ else if (!(c in m)) {
191
+ if (c == "value" && "defaultValue" in m || c == "checked" && "defaultChecked" in m) continue;
192
+ B(t, c, null, f, _);
193
193
  }
194
194
  }
195
- for (u in f) p = f[u], u == "children" ? v = p : u == "dangerouslySetInnerHTML" ? a = p : u == "value" ? m = p : u == "checked" ? g = p : s && typeof p != "function" || y[u] === p || A(t, u, p, y[u], l);
196
- if (a) s || r && (a.__html == r.__html || a.__html == t.innerHTML) || (t.innerHTML = a.__html), e.__k = [];
197
- else if (r && (t.innerHTML = ""), ie(e.type == "template" ? t.content : t, H(v) ? v : [v], e, n, o, h == "foreignObject" ? "http://www.w3.org/1999/xhtml" : l, _, i, _ ? _[0] : n.__k && P(n, 0), s, c), _ != null) for (u = _.length; u--; ) G(_[u]);
198
- s || (u = "value", h == "progress" && m == null ? t.removeAttribute("value") : m != null && (m !== t[u] || h == "progress" && !m || h == "option" && m != y[u]) && A(t, u, m, y[u], l), u = "checked", g != null && g != t[u] && A(t, u, g, y[u], l));
195
+ for (c in m) f = m[c], c == "children" ? p = f : c == "dangerouslySetInnerHTML" ? s = f : c == "value" ? b = f : c == "checked" ? C = f : a && typeof f != "function" || k[c] === f || B(t, c, f, k[c], _);
196
+ if (s) a || i && (s.__html == i.__html || s.__html == t.innerHTML) || (t.innerHTML = s.__html), e.__k = [];
197
+ else if (i && (t.innerHTML = ""), xe(e.type == "template" ? t.content : t, W(p) ? p : [p], e, n, o, v == "foreignObject" ? "http://www.w3.org/1999/xhtml" : _, r, l, r ? r[0] : n.__k && P(n, 0), a, u), r != null) for (c = r.length; c--; ) Z(r[c]);
198
+ a || (c = "value", v == "progress" && b == null ? t.removeAttribute("value") : b != null && (b !== t[c] || v == "progress" && !b || v == "option" && b != k[c]) && B(t, c, b, k[c], _), c = "checked", C != null && C != t[c] && B(t, c, C, k[c], _));
199
199
  }
200
200
  return t;
201
201
  }
202
- function q(t, e, n) {
202
+ function te(t, e, n) {
203
203
  try {
204
204
  if (typeof t == "function") {
205
205
  var o = typeof t.__u == "function";
206
206
  o && t.__u(), o && e == null || (t.__u = t(e));
207
207
  } else t.current = e;
208
- } catch (l) {
209
- d.__e(l, n);
208
+ } catch (_) {
209
+ h.__e(_, n);
210
210
  }
211
211
  }
212
- function pe(t, e, n) {
213
- var o, l;
214
- if (d.unmount && d.unmount(t), (o = t.ref) && (o.current && o.current != t.__e || q(o, null, e)), (o = t.__c) != null) {
212
+ function $e(t, e, n) {
213
+ var o, _;
214
+ if (h.unmount && h.unmount(t), (o = t.ref) && (o.current && o.current != t.__e || te(o, null, e)), (o = t.__c) != null) {
215
215
  if (o.componentWillUnmount) try {
216
216
  o.componentWillUnmount();
217
- } catch (_) {
218
- d.__e(_, e);
217
+ } catch (r) {
218
+ h.__e(r, e);
219
219
  }
220
220
  o.base = o.__P = null;
221
221
  }
222
- if (o = t.__k) for (l = 0; l < o.length; l++) o[l] && pe(o[l], e, n || typeof t.type != "function");
223
- n || G(t.__e), t.__c = t.__ = t.__e = void 0;
222
+ if (o = t.__k) for (_ = 0; _ < o.length; _++) o[_] && $e(o[_], e, n || typeof t.type != "function");
223
+ n || Z(t.__e), t.__c = t.__ = t.__e = void 0;
224
224
  }
225
- function ge(t, e, n) {
225
+ function Le(t, e, n) {
226
226
  return this.constructor(t, n);
227
227
  }
228
- function W(t, e, n) {
229
- var o, l, _, i;
230
- e == document && (e = document.documentElement), d.__ && d.__(t, e), l = (o = typeof n == "function") ? null : n && n.__k || e.__k, _ = [], i = [], V(e, t = (!o && n || e).__k = C(F, null, [t]), l || M, M, e.namespaceURI, !o && n ? [n] : l ? null : e.firstChild ? D.call(e.childNodes) : null, _, !o && n ? n : l ? l.__e : e.firstChild, o, i), ue(_, t, i);
231
- }
232
- function ae(t, e) {
233
- W(t, e, ae);
234
- }
235
- function fe(t, e, n) {
236
- var o, l, _, i, s = k({}, t.props);
237
- for (_ in t.type && t.type.defaultProps && (i = t.type.defaultProps), e) _ == "key" ? o = e[_] : _ == "ref" ? l = e[_] : s[_] = e[_] === void 0 && i != null ? i[_] : e[_];
238
- return arguments.length > 2 && (s.children = arguments.length > 3 ? D.call(arguments, 2) : n), L(t.type, s, o || t.key, l || t.ref, null);
239
- }
240
- D = oe.slice, d = { __e: function(t, e, n, o) {
241
- for (var l, _, i; e = e.__; ) if ((l = e.__c) && !l.__) try {
242
- if ((_ = l.constructor) && _.getDerivedStateFromError != null && (l.setState(_.getDerivedStateFromError(t)), i = l.__d), l.componentDidCatch != null && (l.componentDidCatch(t, o || {}), i = l.__d), i) return l.__E = l;
243
- } catch (s) {
244
- t = s;
228
+ function q(t, e, n) {
229
+ var o, _, r, l;
230
+ e == document && (e = document.documentElement), h.__ && h.__(t, e), _ = (o = typeof n == "function") ? null : n && n.__k || e.__k, r = [], l = [], ee(e, t = (!o && n || e).__k = $(I, null, [t]), _ || A, A, e.namespaceURI, !o && n ? [n] : _ ? null : e.firstChild ? D.call(e.childNodes) : null, r, !o && n ? n : _ ? _.__e : e.firstChild, o, l), Se(r, t, l);
231
+ }
232
+ function Pe(t, e) {
233
+ q(t, e, Pe);
234
+ }
235
+ function He(t, e, n) {
236
+ var o, _, r, l, a = E({}, t.props);
237
+ for (r in t.type && t.type.defaultProps && (l = t.type.defaultProps), e) r == "key" ? o = e[r] : r == "ref" ? _ = e[r] : a[r] = e[r] === void 0 && l != null ? l[r] : e[r];
238
+ return arguments.length > 2 && (a.children = arguments.length > 3 ? D.call(arguments, 2) : n), F(t.type, a, o || t.key, _ || t.ref, null);
239
+ }
240
+ D = ke.slice, h = { __e: function(t, e, n, o) {
241
+ for (var _, r, l; e = e.__; ) if ((_ = e.__c) && !_.__) try {
242
+ if ((r = _.constructor) && r.getDerivedStateFromError != null && (_.setState(r.getDerivedStateFromError(t)), l = _.__d), _.componentDidCatch != null && (_.componentDidCatch(t, o || {}), l = _.__d), l) return _.__E = _;
243
+ } catch (a) {
244
+ t = a;
245
245
  }
246
246
  throw t;
247
- } }, te = 0, j.prototype.setState = function(t, e) {
247
+ } }, ve = 0, L.prototype.setState = function(t, e) {
248
248
  var n;
249
- n = this.__s != null && this.__s != this.state ? this.__s : this.__s = k({}, this.state), typeof t == "function" && (t = t(k({}, n), this.props)), t && k(n, t), t != null && this.__v && (e && this._sb.push(e), X(this));
250
- }, j.prototype.forceUpdate = function(t) {
251
- this.__v && (this.__e = !0, t && this.__h.push(t), X(this));
252
- }, j.prototype.render = F, x = [], ne = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, _e = function(t, e) {
249
+ n = this.__s != null && this.__s != this.state ? this.__s : this.__s = E({}, this.state), typeof t == "function" && (t = t(E({}, n), this.props)), t && E(n, t), t != null && this.__v && (e && this._sb.push(e), _e(this));
250
+ }, L.prototype.forceUpdate = function(t) {
251
+ this.__v && (this.__e = !0, t && this.__h.push(t), _e(this));
252
+ }, L.prototype.render = I, w = [], ge = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, ye = function(t, e) {
253
253
  return t.__v.__b - e.__v.__b;
254
- }, N.__r = 0, re = /(PointerCapture)$|Capture$/i, z = 0, R = Z(!1), B = Z(!0);
255
- var be = 0;
256
- function ke(t, e, n, o, l, _) {
254
+ }, j.__r = 0, be = /(PointerCapture)$|Capture$/i, X = 0, G = le(!1), J = le(!0);
255
+ var Re = 0;
256
+ function d(t, e, n, o, _, r) {
257
257
  e || (e = {});
258
- var i, s, c = e;
259
- if ("ref" in c) for (s in c = {}, e) s == "ref" ? i = e[s] : c[s] = e[s];
260
- var u = { type: t, props: c, key: n, ref: i, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --be, __i: -1, __u: 0, __source: l, __self: _ };
261
- return d.vnode && d.vnode(u), u;
258
+ var l, a, u = e;
259
+ if ("ref" in u) for (a in u = {}, e) a == "ref" ? l = e[a] : u[a] = e[a];
260
+ var c = { type: t, props: u, key: n, ref: l, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --Re, __i: -1, __u: 0, __source: _, __self: r };
261
+ if (typeof t == "function" && (l = t.defaultProps)) for (a in l) u[a] === void 0 && (u[a] = l[a]);
262
+ return h.vnode && h.vnode(c), c;
263
+ }
264
+ var O, g, Y, ae, K = 0, Te = [], y = h, ce = y.__b, ue = y.__r, se = y.diffed, fe = y.__c, pe = y.unmount, de = y.__;
265
+ function Ue(t, e) {
266
+ y.__h && y.__h(g, t, K || e), K = 0;
267
+ var n = g.__H || (g.__H = { __: [], __h: [] });
268
+ return t >= n.__.length && n.__.push({}), n.__[t];
269
+ }
270
+ function Ne(t) {
271
+ return K = 1, je(Fe, t);
272
+ }
273
+ function je(t, e, n) {
274
+ var o = Ue(O++, 2);
275
+ if (o.t = t, !o.__c && (o.__ = [Fe(void 0, e), function(a) {
276
+ var u = o.__N ? o.__N[0] : o.__[0], c = o.t(u, a);
277
+ u !== c && (o.__N = [c, o.__[1]], o.__c.setState({}));
278
+ }], o.__c = g, !g.__f)) {
279
+ var _ = function(a, u, c) {
280
+ if (!o.__c.__H) return !0;
281
+ var s = o.__c.__H.__.filter(function(p) {
282
+ return !!p.__c;
283
+ });
284
+ if (s.every(function(p) {
285
+ return !p.__N;
286
+ })) return !r || r.call(this, a, u, c);
287
+ var i = o.__c.props !== a;
288
+ return s.forEach(function(p) {
289
+ if (p.__N) {
290
+ var f = p.__[0];
291
+ p.__ = p.__N, p.__N = void 0, f !== p.__[0] && (i = !0);
292
+ }
293
+ }), r && r.call(this, a, u, c) || i;
294
+ };
295
+ g.__f = !0;
296
+ var r = g.shouldComponentUpdate, l = g.componentWillUpdate;
297
+ g.componentWillUpdate = function(a, u, c) {
298
+ if (this.__e) {
299
+ var s = r;
300
+ r = void 0, _(a, u, c), r = s;
301
+ }
302
+ l && l.call(this, a, u, c);
303
+ }, g.shouldComponentUpdate = _;
304
+ }
305
+ return o.__N || o.__;
306
+ }
307
+ function Oe(t, e) {
308
+ var n = Ue(O++, 3);
309
+ !y.__s && qe(n.__H, e) && (n.__ = t, n.u = e, g.__H.__h.push(n));
310
+ }
311
+ function We() {
312
+ for (var t; t = Te.shift(); ) if (t.__P && t.__H) try {
313
+ t.__H.__h.forEach(R), t.__H.__h.forEach(Q), t.__H.__h = [];
314
+ } catch (e) {
315
+ t.__H.__h = [], y.__e(e, t.__v);
316
+ }
317
+ }
318
+ y.__b = function(t) {
319
+ g = null, ce && ce(t);
320
+ }, y.__ = function(t, e) {
321
+ t && e.__k && e.__k.__m && (t.__m = e.__k.__m), de && de(t, e);
322
+ }, y.__r = function(t) {
323
+ ue && ue(t), O = 0;
324
+ var e = (g = t.__c).__H;
325
+ e && (Y === g ? (e.__h = [], g.__h = [], e.__.forEach(function(n) {
326
+ n.__N && (n.__ = n.__N), n.u = n.__N = void 0;
327
+ })) : (e.__h.forEach(R), e.__h.forEach(Q), e.__h = [], O = 0)), Y = g;
328
+ }, y.diffed = function(t) {
329
+ se && se(t);
330
+ var e = t.__c;
331
+ e && e.__H && (e.__H.__h.length && (Te.push(e) !== 1 && ae === y.requestAnimationFrame || ((ae = y.requestAnimationFrame) || Ie)(We)), e.__H.__.forEach(function(n) {
332
+ n.u && (n.__H = n.u), n.u = void 0;
333
+ })), Y = g = null;
334
+ }, y.__c = function(t, e) {
335
+ e.some(function(n) {
336
+ try {
337
+ n.__h.forEach(R), n.__h = n.__h.filter(function(o) {
338
+ return !o.__ || Q(o);
339
+ });
340
+ } catch (o) {
341
+ e.some(function(_) {
342
+ _.__h && (_.__h = []);
343
+ }), e = [], y.__e(o, n.__v);
344
+ }
345
+ }), fe && fe(t, e);
346
+ }, y.unmount = function(t) {
347
+ pe && pe(t);
348
+ var e, n = t.__c;
349
+ n && n.__H && (n.__H.__.forEach(function(o) {
350
+ try {
351
+ R(o);
352
+ } catch (_) {
353
+ e = _;
354
+ }
355
+ }), n.__H = void 0, e && y.__e(e, n.__v));
356
+ };
357
+ var he = typeof requestAnimationFrame == "function";
358
+ function Ie(t) {
359
+ var e, n = function() {
360
+ clearTimeout(o), he && cancelAnimationFrame(e), setTimeout(t);
361
+ }, o = setTimeout(n, 35);
362
+ he && (e = requestAnimationFrame(n));
363
+ }
364
+ function R(t) {
365
+ var e = g, n = t.__c;
366
+ typeof n == "function" && (t.__c = void 0, n()), g = e;
367
+ }
368
+ function Q(t) {
369
+ var e = g;
370
+ t.__c = t.__(), g = e;
371
+ }
372
+ function qe(t, e) {
373
+ return !t || t.length !== e.length || e.some(function(n, o) {
374
+ return n !== t[o];
375
+ });
376
+ }
377
+ function Fe(t, e) {
378
+ return typeof e == "function" ? e(t) : e;
379
+ }
380
+ function Ve({ onClick: t, color: e, children: n }) {
381
+ return /* @__PURE__ */ d(
382
+ "button",
383
+ {
384
+ style: {
385
+ background: e || "#1890ff",
386
+ color: "#fff",
387
+ border: "none",
388
+ borderRadius: 4,
389
+ padding: "8px 16px",
390
+ cursor: "pointer",
391
+ fontSize: 16
392
+ },
393
+ onClick: t,
394
+ children: n
395
+ }
396
+ );
397
+ }
398
+ function Ye({ visible: t, onClose: e, onSubmit: n, color: o }) {
399
+ const [_, r] = Ne({
400
+ amount: "",
401
+ rechargeChannel: "paypal",
402
+ currency: "USD",
403
+ loading: !1,
404
+ error: "",
405
+ amountError: "",
406
+ rechargeChannelError: "",
407
+ currencyError: ""
408
+ });
409
+ return Oe(() => {
410
+ t || r({
411
+ amount: "",
412
+ rechargeChannel: "paypal",
413
+ currency: "USD",
414
+ loading: !1,
415
+ error: "",
416
+ amountError: "",
417
+ rechargeChannelError: "",
418
+ currencyError: ""
419
+ });
420
+ }, [t]), t ? /* @__PURE__ */ d(
421
+ "div",
422
+ {
423
+ style: {
424
+ position: "fixed",
425
+ top: 0,
426
+ left: 0,
427
+ right: 0,
428
+ bottom: 0,
429
+ background: "rgba(0,0,0,0.7)",
430
+ display: "flex",
431
+ alignItems: "center",
432
+ justifyContent: "center",
433
+ zIndex: 9999
434
+ },
435
+ onClick: (u) => {
436
+ u.target === u.currentTarget && e();
437
+ },
438
+ children: /* @__PURE__ */ d(
439
+ "form",
440
+ {
441
+ onSubmit: async (u) => {
442
+ u.preventDefault();
443
+ let c = !0;
444
+ if (r((s) => ({ ...s, amountError: "", rechargeChannelError: "" })), _.amount.trim() || (r((s) => ({ ...s, amountError: "请输入充值金额" })), c = !1), _.rechargeChannel || (r((s) => ({ ...s, rechargeChannelError: "请选择支付平台" })), c = !1), !!c) {
445
+ r((s) => ({ ...s, loading: !0, error: "" }));
446
+ try {
447
+ await n({ amount: _.amount, rechargeChannel: _.rechargeChannel, currency: _.currency }), e();
448
+ } catch {
449
+ r((s) => ({ ...s, error: "提交失败,请重试" }));
450
+ } finally {
451
+ r((s) => ({ ...s, loading: !1 }));
452
+ }
453
+ }
454
+ },
455
+ style: {
456
+ background: "#181A20",
457
+ padding: 32,
458
+ borderRadius: 12,
459
+ minWidth: 360,
460
+ color: o || "#fff",
461
+ boxShadow: "0 4px 24px rgba(0,0,0,0.5)",
462
+ position: "relative"
463
+ },
464
+ onClick: (u) => u.stopPropagation(),
465
+ children: [
466
+ /* @__PURE__ */ d(
467
+ "button",
468
+ {
469
+ type: "button",
470
+ onClick: e,
471
+ style: {
472
+ position: "absolute",
473
+ right: 16,
474
+ top: 16,
475
+ background: "none",
476
+ border: "none",
477
+ color: "#fff",
478
+ fontSize: 22,
479
+ cursor: "pointer",
480
+ lineHeight: 1
481
+ },
482
+ "aria-label": "关闭",
483
+ children: "×"
484
+ }
485
+ ),
486
+ /* @__PURE__ */ d("div", { style: { fontWeight: 600, fontSize: 18, marginBottom: 24, textAlign: "left" }, children: "在线充值" }),
487
+ /* @__PURE__ */ d("div", { style: { marginBottom: 18 }, children: [
488
+ /* @__PURE__ */ d("div", { style: { marginBottom: 8, fontSize: 14 }, children: [
489
+ /* @__PURE__ */ d("span", { style: { color: "#00E8C6" }, children: "*" }),
490
+ " 充值金额"
491
+ ] }),
492
+ /* @__PURE__ */ d(
493
+ "input",
494
+ {
495
+ type: "text",
496
+ placeholder: "请输入充值金额",
497
+ value: _.amount,
498
+ onInput: (u) => {
499
+ const c = u.target.value;
500
+ r((s) => ({
501
+ ...s,
502
+ amount: c,
503
+ amountError: c.trim() ? "" : s.amountError
504
+ }));
505
+ },
506
+ style: {
507
+ width: "100%",
508
+ padding: "10px 12px",
509
+ borderRadius: 6,
510
+ boxSizing: "border-box",
511
+ border: _.amountError ? "1px solid #ff4d4f" : "1px solid #23262F",
512
+ background: "#23262F",
513
+ color: "#fff",
514
+ fontSize: 15,
515
+ outline: "none",
516
+ marginBottom: 0
517
+ }
518
+ }
519
+ ),
520
+ _.amountError && /* @__PURE__ */ d("div", { style: { color: "#ff4d4f", fontSize: 13, marginTop: 4 }, children: _.amountError })
521
+ ] }),
522
+ /* @__PURE__ */ d("div", { style: { marginBottom: 18 }, children: [
523
+ /* @__PURE__ */ d("div", { style: { marginBottom: 8, fontSize: 14 }, children: [
524
+ /* @__PURE__ */ d("span", { style: { color: "#00E8C6" }, children: "*" }),
525
+ " 支付平台"
526
+ ] }),
527
+ /* @__PURE__ */ d(
528
+ "select",
529
+ {
530
+ style: {
531
+ width: "100%",
532
+ padding: "10px 12px",
533
+ borderRadius: 6,
534
+ border: _.rechargeChannelError ? "1px solid #ff4d4f" : "1px solid #23262F",
535
+ background: "#23262F",
536
+ color: "#fff",
537
+ fontSize: 15,
538
+ outline: "none"
539
+ },
540
+ value: _.rechargeChannel,
541
+ onInput: (u) => {
542
+ const c = u.target.value;
543
+ r((s) => ({
544
+ ...s,
545
+ rechargeChannel: c,
546
+ rechargeChannelError: c ? "" : s.rechargeChannelError
547
+ }));
548
+ },
549
+ children: [
550
+ /* @__PURE__ */ d("option", { value: "alipay", children: "支付宝" }),
551
+ /* @__PURE__ */ d("option", { value: "wechat", children: "微信" }),
552
+ /* @__PURE__ */ d("option", { value: "paypal", children: "PayPal" })
553
+ ]
554
+ }
555
+ ),
556
+ _.rechargeChannelError && /* @__PURE__ */ d("div", { style: { color: "#ff4d4f", fontSize: 13, marginTop: 4 }, children: _.rechargeChannelError })
557
+ ] }),
558
+ /* @__PURE__ */ d("div", { style: { marginBottom: 24 }, children: [
559
+ /* @__PURE__ */ d("div", { style: { marginBottom: 8, fontSize: 14 }, children: "币种" }),
560
+ /* @__PURE__ */ d(
561
+ "select",
562
+ {
563
+ style: {
564
+ width: "100%",
565
+ padding: "10px 12px",
566
+ borderRadius: 6,
567
+ border: "1px solid #23262F",
568
+ background: "#23262F",
569
+ color: "#fff",
570
+ fontSize: 15,
571
+ outline: "none"
572
+ },
573
+ value: _.currency,
574
+ children: [
575
+ /* @__PURE__ */ d("option", { value: "USD", children: "USD" }),
576
+ /* @__PURE__ */ d("option", { value: "CNY", children: "CNY" }),
577
+ /* @__PURE__ */ d("option", { value: "EUR", children: "EUR" })
578
+ ]
579
+ }
580
+ )
581
+ ] }),
582
+ _.error && /* @__PURE__ */ d("div", { style: { color: "#ff4d4f", marginBottom: 12 }, children: _.error }),
583
+ /* @__PURE__ */ d("div", { style: { display: "flex", justifyContent: "flex-end", gap: 12 }, children: [
584
+ /* @__PURE__ */ d(
585
+ "button",
586
+ {
587
+ type: "button",
588
+ onClick: e,
589
+ style: { background: "#23262F", color: "#fff", border: "none", borderRadius: 6, padding: "8px 24px", fontSize: 15, cursor: "pointer" },
590
+ children: "取消"
591
+ }
592
+ ),
593
+ /* @__PURE__ */ d(
594
+ "button",
595
+ {
596
+ type: "submit",
597
+ disabled: _.loading,
598
+ style: { background: "#00E8C6", color: "#fff", border: "none", borderRadius: 6, padding: "8px 24px", fontSize: 15, cursor: "pointer", fontWeight: 600 },
599
+ children: _.loading ? "提交中..." : "去支付"
600
+ }
601
+ )
602
+ ] })
603
+ ]
604
+ }
605
+ )
606
+ }
607
+ ) : null;
262
608
  }
263
- function J() {
264
- return (J = Object.assign ? Object.assign.bind() : function(t) {
609
+ function ne() {
610
+ return (ne = Object.assign ? Object.assign.bind() : function(t) {
265
611
  for (var e = 1; e < arguments.length; e++) {
266
612
  var n = arguments[e];
267
613
  for (var o in n) Object.prototype.hasOwnProperty.call(n, o) && (t[o] = n[o]);
@@ -269,80 +615,92 @@ function J() {
269
615
  return t;
270
616
  }).apply(this, arguments);
271
617
  }
272
- var we = ["context", "children"];
273
- function xe(t) {
618
+ var Ge = ["context", "children"];
619
+ function Je(t) {
274
620
  this.getChildContext = function() {
275
621
  return t.context;
276
622
  };
277
- var e = t.children, n = function(o, l) {
623
+ var e = t.children, n = function(o, _) {
278
624
  if (o == null) return {};
279
- var _, i, s = {}, c = Object.keys(o);
280
- for (i = 0; i < c.length; i++) l.indexOf(_ = c[i]) >= 0 || (s[_] = o[_]);
281
- return s;
282
- }(t, we);
283
- return fe(e, n);
625
+ var r, l, a = {}, u = Object.keys(o);
626
+ for (l = 0; l < u.length; l++) _.indexOf(r = u[l]) >= 0 || (a[r] = o[r]);
627
+ return a;
628
+ }(t, Ge);
629
+ return He(e, n);
284
630
  }
285
- function Ce() {
631
+ function Ke() {
286
632
  var t = new CustomEvent("_preact", { detail: {}, bubbles: !0, cancelable: !0 });
287
- this.dispatchEvent(t), this._vdom = C(xe, J({}, this._props, { context: t.detail.context }), function e(n, o) {
633
+ this.dispatchEvent(t), this._vdom = $(Je, ne({}, this._props, { context: t.detail.context }), function e(n, o) {
288
634
  if (n.nodeType === 3) return n.data;
289
635
  if (n.nodeType !== 1) return null;
290
- var l = [], _ = {}, i = 0, s = n.attributes, c = n.childNodes;
291
- for (i = s.length; i--; ) s[i].name !== "slot" && (_[s[i].name] = s[i].value, _[he(s[i].name)] = s[i].value);
292
- for (i = c.length; i--; ) {
293
- var u = e(c[i], null), a = c[i].slot;
294
- a ? _[a] = C(ee, { name: a }, u) : l[i] = u;
636
+ var _ = [], r = {}, l = 0, a = n.attributes, u = n.childNodes;
637
+ for (l = a.length; l--; ) a[l].name !== "slot" && (r[a[l].name] = a[l].value, r[Ae(a[l].name)] = a[l].value);
638
+ for (l = u.length; l--; ) {
639
+ var c = e(u[l], null), s = u[l].slot;
640
+ s ? r[s] = $(me, { name: s }, c) : _[l] = c;
295
641
  }
296
- var r = o ? C(ee, null, l) : l;
297
- return C(o || n.nodeName.toLowerCase(), _, r);
298
- }(this, this._vdomComponent)), (this.hasAttribute("hydrate") ? ae : W)(this._vdom, this._root);
642
+ var i = o ? $(me, null, _) : _;
643
+ return $(o || n.nodeName.toLowerCase(), r, i);
644
+ }(this, this._vdomComponent)), (this.hasAttribute("hydrate") ? Pe : q)(this._vdom, this._root);
299
645
  }
300
- function he(t) {
646
+ function Ae(t) {
301
647
  return t.replace(/-(\w)/g, function(e, n) {
302
648
  return n ? n.toUpperCase() : "";
303
649
  });
304
650
  }
305
- function Pe(t, e, n) {
651
+ function Qe(t, e, n) {
306
652
  if (this._vdom) {
307
653
  var o = {};
308
- o[t] = n = n ?? void 0, o[he(t)] = n, this._vdom = fe(this._vdom, o), W(this._vdom, this._root);
654
+ o[t] = n = n ?? void 0, o[Ae(t)] = n, this._vdom = He(this._vdom, o), q(this._vdom, this._root);
309
655
  }
310
656
  }
311
- function Se() {
312
- W(this._vdom = null, this._root);
657
+ function Xe() {
658
+ q(this._vdom = null, this._root);
313
659
  }
314
- function ee(t, e) {
660
+ function me(t, e) {
315
661
  var n = this;
316
- return C("slot", J({}, t, { ref: function(o) {
317
- o ? (n.ref = o, n._listener || (n._listener = function(l) {
318
- l.stopPropagation(), l.detail.context = e;
662
+ return $("slot", ne({}, t, { ref: function(o) {
663
+ o ? (n.ref = o, n._listener || (n._listener = function(_) {
664
+ _.stopPropagation(), _.detail.context = e;
319
665
  }, o.addEventListener("_preact", n._listener))) : n.ref.removeEventListener("_preact", n._listener);
320
666
  } }));
321
667
  }
322
- function Te(t, e, n, o) {
323
- function l() {
324
- var _ = Reflect.construct(HTMLElement, [], l);
325
- return _._vdomComponent = t, _._root = _, _;
668
+ function Ze(t, e, n, o) {
669
+ function _() {
670
+ var r = Reflect.construct(HTMLElement, [], _);
671
+ return r._vdomComponent = t, r._root = r, r;
326
672
  }
327
- return (l.prototype = Object.create(HTMLElement.prototype)).constructor = l, l.prototype.connectedCallback = Ce, l.prototype.attributeChangedCallback = Pe, l.prototype.disconnectedCallback = Se, n = n || t.observedAttributes || Object.keys(t.propTypes || {}), l.observedAttributes = n, n.forEach(function(_) {
328
- Object.defineProperty(l.prototype, _, { get: function() {
329
- return this._vdom.props[_];
330
- }, set: function(i) {
331
- this._vdom ? this.attributeChangedCallback(_, null, i) : (this._props || (this._props = {}), this._props[_] = i, this.connectedCallback());
332
- var s = typeof i;
333
- i != null && s !== "string" && s !== "boolean" && s !== "number" || this.setAttribute(_, i);
673
+ return (_.prototype = Object.create(HTMLElement.prototype)).constructor = _, _.prototype.connectedCallback = Ke, _.prototype.attributeChangedCallback = Qe, _.prototype.disconnectedCallback = Xe, n = n || t.observedAttributes || Object.keys(t.propTypes || {}), _.observedAttributes = n, n.forEach(function(r) {
674
+ Object.defineProperty(_.prototype, r, { get: function() {
675
+ return this._vdom.props[r];
676
+ }, set: function(l) {
677
+ this._vdom ? this.attributeChangedCallback(r, null, l) : (this._props || (this._props = {}), this._props[r] = l, this.connectedCallback());
678
+ var a = typeof l;
679
+ l != null && a !== "string" && a !== "boolean" && a !== "number" || this.setAttribute(r, l);
334
680
  } });
335
- }), customElements.define(e, l);
336
- }
337
- const Ee = ({ name: t = "World" }) => /* @__PURE__ */ ke("p", { children: [
338
- "Hello, ",
339
- t,
340
- "!"
341
- ] });
342
- Te(Ee, "x-greeting", ["name"]);
343
- const Me = ["x-greeting"];
681
+ }), customElements.define(e, _);
682
+ }
683
+ function et(t) {
684
+ const [e, n] = Ne(!1), o = t.theme?.primaryColor;
685
+ return /* @__PURE__ */ d("div", { children: [
686
+ /* @__PURE__ */ d(Ve, { color: o, onClick: () => n(!0), children: "打开表单" }),
687
+ /* @__PURE__ */ d(
688
+ Ye,
689
+ {
690
+ visible: e,
691
+ onClose: () => n(!1),
692
+ onSubmit: async (r) => {
693
+ console.log("submit", r);
694
+ },
695
+ color: o
696
+ }
697
+ )
698
+ ] });
699
+ }
700
+ Ze(et, "x-best-modal-form", ["theme"]);
701
+ const rt = ["x-greeting", "x-best-modal-form"];
344
702
  export {
345
- Me as components,
346
- $e as npmTest,
347
- Le as printCurrentTime
703
+ rt as components,
704
+ tt as npmTest,
705
+ nt as printCurrentTime
348
706
  };