@kevisual/kv-login 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,68 +1,68 @@
1
- const He = globalThis, ce = He.trustedTypes, Ke = ce ? ce.createPolicy("lit-html", { createHTML: (t) => t }) : void 0, Lt = "$lit$", F = `lit$${Math.random().toFixed(9).slice(2)}$`, xt = "?" + F, en = `<${xt}>`, W = document, te = () => W.createComment(""), ne = (t) => t === null || typeof t != "object" && typeof t != "function", ze = Array.isArray, tn = (t) => ze(t) || typeof t?.[Symbol.iterator] == "function", me = `[
2
- \f\r]`, Z = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Ge = /-->/g, Qe = />/g, H = RegExp(`>|${me}(?:([^\\s"'>=/]+)(${me}*=${me}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`, "g"), Ye = /'/g, Xe = /"/g, Pt = /^(?:script|style|textarea|title)$/i, nn = (t) => (e, ...n) => ({ _$litType$: t, strings: e, values: n }), D = nn(1), re = Symbol.for("lit-noChange"), I = Symbol.for("lit-nothing"), Ze = /* @__PURE__ */ new WeakMap(), z = W.createTreeWalker(W, 129);
4
- function $t(t, e) {
5
- if (!ze(t) || !t.hasOwnProperty("raw")) throw Error("invalid template strings array");
6
- return Ke !== void 0 ? Ke.createHTML(e) : e;
7
- }
8
- const rn = (t, e) => {
9
- const n = t.length - 1, r = [];
10
- let o, s = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", i = Z;
11
- for (let c = 0; c < n; c++) {
1
+ const je = globalThis, le = je.trustedTypes, Ge = le ? le.createPolicy("lit-html", { createHTML: (t) => t }) : void 0, Pt = "$lit$", H = `lit$${Math.random().toFixed(9).slice(2)}$`, qt = "?" + H, rn = `<${qt}>`, W = document, ne = () => W.createComment(""), re = (t) => t === null || typeof t != "object" && typeof t != "function", Ve = Array.isArray, on = (t) => Ve(t) || typeof t?.[Symbol.iterator] == "function", pe = `[
2
+ \f\r]`, ee = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Ye = /-->/g, Xe = />/g, j = RegExp(`>|${pe}(?:([^\\s"'>=/]+)(${pe}*=${pe}*(?:[^
3
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), Ze = /'/g, et = /"/g, Dt = /^(?:script|style|textarea|title)$/i, sn = (t) => (e, ...r) => ({ _$litType$: t, strings: e, values: r }), L = sn(1), Y = Symbol.for("lit-noChange"), M = Symbol.for("lit-nothing"), tt = /* @__PURE__ */ new WeakMap(), V = W.createTreeWalker(W, 129);
4
+ function Nt(t, e) {
5
+ if (!Ve(t) || !t.hasOwnProperty("raw")) throw Error("invalid template strings array");
6
+ return Ge !== void 0 ? Ge.createHTML(e) : e;
7
+ }
8
+ const an = (t, e) => {
9
+ const r = t.length - 1, n = [];
10
+ let o, s = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", i = ee;
11
+ for (let c = 0; c < r; c++) {
12
12
  const a = t[c];
13
- let u, l, h = -1, f = 0;
14
- for (; f < a.length && (i.lastIndex = f, l = i.exec(a), l !== null); ) f = i.lastIndex, i === Z ? l[1] === "!--" ? i = Ge : l[1] !== void 0 ? i = Qe : l[2] !== void 0 ? (Pt.test(l[2]) && (o = RegExp("</" + l[2], "g")), i = H) : l[3] !== void 0 && (i = H) : i === H ? l[0] === ">" ? (i = o ?? Z, h = -1) : l[1] === void 0 ? h = -2 : (h = i.lastIndex - l[2].length, u = l[1], i = l[3] === void 0 ? H : l[3] === '"' ? Xe : Ye) : i === Xe || i === Ye ? i = H : i === Ge || i === Qe ? i = Z : (i = H, o = void 0);
15
- const d = i === H && t[c + 1].startsWith("/>") ? " " : "";
16
- s += i === Z ? a + en : h >= 0 ? (r.push(u), a.slice(0, h) + Lt + a.slice(h) + F + d) : a + F + (h === -2 ? c : d);
13
+ let l, u, h = -1, f = 0;
14
+ for (; f < a.length && (i.lastIndex = f, u = i.exec(a), u !== null); ) f = i.lastIndex, i === ee ? u[1] === "!--" ? i = Ye : u[1] !== void 0 ? i = Xe : u[2] !== void 0 ? (Dt.test(u[2]) && (o = RegExp("</" + u[2], "g")), i = j) : u[3] !== void 0 && (i = j) : i === j ? u[0] === ">" ? (i = o ?? ee, h = -1) : u[1] === void 0 ? h = -2 : (h = i.lastIndex - u[2].length, l = u[1], i = u[3] === void 0 ? j : u[3] === '"' ? et : Ze) : i === et || i === Ze ? i = j : i === Ye || i === Xe ? i = ee : (i = j, o = void 0);
15
+ const d = i === j && t[c + 1].startsWith("/>") ? " " : "";
16
+ s += i === ee ? a + rn : h >= 0 ? (n.push(l), a.slice(0, h) + Pt + a.slice(h) + H + d) : a + H + (h === -2 ? c : d);
17
17
  }
18
- return [$t(t, s + (t[n] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), r];
18
+ return [Nt(t, s + (t[r] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), n];
19
19
  };
20
20
  class oe {
21
- constructor({ strings: e, _$litType$: n }, r) {
21
+ constructor({ strings: e, _$litType$: r }, n) {
22
22
  let o;
23
23
  this.parts = [];
24
24
  let s = 0, i = 0;
25
- const c = e.length - 1, a = this.parts, [u, l] = rn(e, n);
26
- if (this.el = oe.createElement(u, r), z.currentNode = this.el.content, n === 2 || n === 3) {
25
+ const c = e.length - 1, a = this.parts, [l, u] = an(e, r);
26
+ if (this.el = oe.createElement(l, n), V.currentNode = this.el.content, r === 2 || r === 3) {
27
27
  const h = this.el.content.firstChild;
28
28
  h.replaceWith(...h.childNodes);
29
29
  }
30
- for (; (o = z.nextNode()) !== null && a.length < c; ) {
30
+ for (; (o = V.nextNode()) !== null && a.length < c; ) {
31
31
  if (o.nodeType === 1) {
32
- if (o.hasAttributes()) for (const h of o.getAttributeNames()) if (h.endsWith(Lt)) {
33
- const f = l[i++], d = o.getAttribute(h).split(F), w = /([.?@])?(.*)/.exec(f);
34
- a.push({ type: 1, index: s, name: w[2], strings: d, ctor: w[1] === "." ? sn : w[1] === "?" ? an : w[1] === "@" ? cn : le }), o.removeAttribute(h);
35
- } else h.startsWith(F) && (a.push({ type: 6, index: s }), o.removeAttribute(h));
36
- if (Pt.test(o.tagName)) {
37
- const h = o.textContent.split(F), f = h.length - 1;
32
+ if (o.hasAttributes()) for (const h of o.getAttributeNames()) if (h.endsWith(Pt)) {
33
+ const f = u[i++], d = o.getAttribute(h).split(H), w = /([.?@])?(.*)/.exec(f);
34
+ a.push({ type: 1, index: s, name: w[2], strings: d, ctor: w[1] === "." ? ln : w[1] === "?" ? un : w[1] === "@" ? hn : ue }), o.removeAttribute(h);
35
+ } else h.startsWith(H) && (a.push({ type: 6, index: s }), o.removeAttribute(h));
36
+ if (Dt.test(o.tagName)) {
37
+ const h = o.textContent.split(H), f = h.length - 1;
38
38
  if (f > 0) {
39
- o.textContent = ce ? ce.emptyScript : "";
40
- for (let d = 0; d < f; d++) o.append(h[d], te()), z.nextNode(), a.push({ type: 2, index: ++s });
41
- o.append(h[f], te());
39
+ o.textContent = le ? le.emptyScript : "";
40
+ for (let d = 0; d < f; d++) o.append(h[d], ne()), V.nextNode(), a.push({ type: 2, index: ++s });
41
+ o.append(h[f], ne());
42
42
  }
43
43
  }
44
- } else if (o.nodeType === 8) if (o.data === xt) a.push({ type: 2, index: s });
44
+ } else if (o.nodeType === 8) if (o.data === qt) a.push({ type: 2, index: s });
45
45
  else {
46
46
  let h = -1;
47
- for (; (h = o.data.indexOf(F, h + 1)) !== -1; ) a.push({ type: 7, index: s }), h += F.length - 1;
47
+ for (; (h = o.data.indexOf(H, h + 1)) !== -1; ) a.push({ type: 7, index: s }), h += H.length - 1;
48
48
  }
49
49
  s++;
50
50
  }
51
51
  }
52
- static createElement(e, n) {
53
- const r = W.createElement("template");
54
- return r.innerHTML = e, r;
52
+ static createElement(e, r) {
53
+ const n = W.createElement("template");
54
+ return n.innerHTML = e, n;
55
55
  }
56
56
  }
57
- function Y(t, e, n = t, r) {
58
- if (e === re) return e;
59
- let o = r !== void 0 ? n._$Co?.[r] : n._$Cl;
60
- const s = ne(e) ? void 0 : e._$litDirective$;
61
- return o?.constructor !== s && (o?._$AO?.(!1), s === void 0 ? o = void 0 : (o = new s(t), o._$AT(t, n, r)), r !== void 0 ? (n._$Co ??= [])[r] = o : n._$Cl = o), o !== void 0 && (e = Y(t, o._$AS(t, e.values), o, r)), e;
57
+ function X(t, e, r = t, n) {
58
+ if (e === Y) return e;
59
+ let o = n !== void 0 ? r._$Co?.[n] : r._$Cl;
60
+ const s = re(e) ? void 0 : e._$litDirective$;
61
+ return o?.constructor !== s && (o?._$AO?.(!1), s === void 0 ? o = void 0 : (o = new s(t), o._$AT(t, r, n)), n !== void 0 ? (r._$Co ??= [])[n] = o : r._$Cl = o), o !== void 0 && (e = X(t, o._$AS(t, e.values), o, n)), e;
62
62
  }
63
- class on {
64
- constructor(e, n) {
65
- this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = n;
63
+ class cn {
64
+ constructor(e, r) {
65
+ this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = r;
66
66
  }
67
67
  get parentNode() {
68
68
  return this._$AM.parentNode;
@@ -71,34 +71,34 @@ class on {
71
71
  return this._$AM._$AU;
72
72
  }
73
73
  u(e) {
74
- const { el: { content: n }, parts: r } = this._$AD, o = (e?.creationScope ?? W).importNode(n, !0);
75
- z.currentNode = o;
76
- let s = z.nextNode(), i = 0, c = 0, a = r[0];
74
+ const { el: { content: r }, parts: n } = this._$AD, o = (e?.creationScope ?? W).importNode(r, !0);
75
+ V.currentNode = o;
76
+ let s = V.nextNode(), i = 0, c = 0, a = n[0];
77
77
  for (; a !== void 0; ) {
78
78
  if (i === a.index) {
79
- let u;
80
- a.type === 2 ? u = new se(s, s.nextSibling, this, e) : a.type === 1 ? u = new a.ctor(s, a.name, a.strings, this, e) : a.type === 6 && (u = new un(s, this, e)), this._$AV.push(u), a = r[++c];
79
+ let l;
80
+ a.type === 2 ? l = new ie(s, s.nextSibling, this, e) : a.type === 1 ? l = new a.ctor(s, a.name, a.strings, this, e) : a.type === 6 && (l = new dn(s, this, e)), this._$AV.push(l), a = n[++c];
81
81
  }
82
- i !== a?.index && (s = z.nextNode(), i++);
82
+ i !== a?.index && (s = V.nextNode(), i++);
83
83
  }
84
- return z.currentNode = W, o;
84
+ return V.currentNode = W, o;
85
85
  }
86
86
  p(e) {
87
- let n = 0;
88
- for (const r of this._$AV) r !== void 0 && (r.strings !== void 0 ? (r._$AI(e, r, n), n += r.strings.length - 2) : r._$AI(e[n])), n++;
87
+ let r = 0;
88
+ for (const n of this._$AV) n !== void 0 && (n.strings !== void 0 ? (n._$AI(e, n, r), r += n.strings.length - 2) : n._$AI(e[r])), r++;
89
89
  }
90
90
  }
91
- class se {
91
+ class ie {
92
92
  get _$AU() {
93
93
  return this._$AM?._$AU ?? this._$Cv;
94
94
  }
95
- constructor(e, n, r, o) {
96
- this.type = 2, this._$AH = I, this._$AN = void 0, this._$AA = e, this._$AB = n, this._$AM = r, this.options = o, this._$Cv = o?.isConnected ?? !0;
95
+ constructor(e, r, n, o) {
96
+ this.type = 2, this._$AH = M, this._$AN = void 0, this._$AA = e, this._$AB = r, this._$AM = n, this.options = o, this._$Cv = o?.isConnected ?? !0;
97
97
  }
98
98
  get parentNode() {
99
99
  let e = this._$AA.parentNode;
100
- const n = this._$AM;
101
- return n !== void 0 && e?.nodeType === 11 && (e = n.parentNode), e;
100
+ const r = this._$AM;
101
+ return r !== void 0 && e?.nodeType === 11 && (e = r.parentNode), e;
102
102
  }
103
103
  get startNode() {
104
104
  return this._$AA;
@@ -106,8 +106,8 @@ class se {
106
106
  get endNode() {
107
107
  return this._$AB;
108
108
  }
109
- _$AI(e, n = this) {
110
- e = Y(this, e, n), ne(e) ? e === I || e == null || e === "" ? (this._$AH !== I && this._$AR(), this._$AH = I) : e !== this._$AH && e !== re && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : tn(e) ? this.k(e) : this._(e);
109
+ _$AI(e, r = this) {
110
+ e = X(this, e, r), re(e) ? e === M || e == null || e === "" ? (this._$AH !== M && this._$AR(), this._$AH = M) : e !== this._$AH && e !== Y && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : on(e) ? this.k(e) : this._(e);
111
111
  }
112
112
  O(e) {
113
113
  return this._$AA.parentNode.insertBefore(e, this._$AB);
@@ -116,150 +116,183 @@ class se {
116
116
  this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
117
117
  }
118
118
  _(e) {
119
- this._$AH !== I && ne(this._$AH) ? this._$AA.nextSibling.data = e : this.T(W.createTextNode(e)), this._$AH = e;
119
+ this._$AH !== M && re(this._$AH) ? this._$AA.nextSibling.data = e : this.T(W.createTextNode(e)), this._$AH = e;
120
120
  }
121
121
  $(e) {
122
- const { values: n, _$litType$: r } = e, o = typeof r == "number" ? this._$AC(e) : (r.el === void 0 && (r.el = oe.createElement($t(r.h, r.h[0]), this.options)), r);
123
- if (this._$AH?._$AD === o) this._$AH.p(n);
122
+ const { values: r, _$litType$: n } = e, o = typeof n == "number" ? this._$AC(e) : (n.el === void 0 && (n.el = oe.createElement(Nt(n.h, n.h[0]), this.options)), n);
123
+ if (this._$AH?._$AD === o) this._$AH.p(r);
124
124
  else {
125
- const s = new on(o, this), i = s.u(this.options);
126
- s.p(n), this.T(i), this._$AH = s;
125
+ const s = new cn(o, this), i = s.u(this.options);
126
+ s.p(r), this.T(i), this._$AH = s;
127
127
  }
128
128
  }
129
129
  _$AC(e) {
130
- let n = Ze.get(e.strings);
131
- return n === void 0 && Ze.set(e.strings, n = new oe(e)), n;
130
+ let r = tt.get(e.strings);
131
+ return r === void 0 && tt.set(e.strings, r = new oe(e)), r;
132
132
  }
133
133
  k(e) {
134
- ze(this._$AH) || (this._$AH = [], this._$AR());
135
- const n = this._$AH;
136
- let r, o = 0;
137
- for (const s of e) o === n.length ? n.push(r = new se(this.O(te()), this.O(te()), this, this.options)) : r = n[o], r._$AI(s), o++;
138
- o < n.length && (this._$AR(r && r._$AB.nextSibling, o), n.length = o);
139
- }
140
- _$AR(e = this._$AA.nextSibling, n) {
141
- for (this._$AP?.(!1, !0, n); e !== this._$AB; ) {
142
- const r = e.nextSibling;
143
- e.remove(), e = r;
134
+ Ve(this._$AH) || (this._$AH = [], this._$AR());
135
+ const r = this._$AH;
136
+ let n, o = 0;
137
+ for (const s of e) o === r.length ? r.push(n = new ie(this.O(ne()), this.O(ne()), this, this.options)) : n = r[o], n._$AI(s), o++;
138
+ o < r.length && (this._$AR(n && n._$AB.nextSibling, o), r.length = o);
139
+ }
140
+ _$AR(e = this._$AA.nextSibling, r) {
141
+ for (this._$AP?.(!1, !0, r); e !== this._$AB; ) {
142
+ const n = e.nextSibling;
143
+ e.remove(), e = n;
144
144
  }
145
145
  }
146
146
  setConnected(e) {
147
147
  this._$AM === void 0 && (this._$Cv = e, this._$AP?.(e));
148
148
  }
149
149
  }
150
- class le {
150
+ class ue {
151
151
  get tagName() {
152
152
  return this.element.tagName;
153
153
  }
154
154
  get _$AU() {
155
155
  return this._$AM._$AU;
156
156
  }
157
- constructor(e, n, r, o, s) {
158
- this.type = 1, this._$AH = I, this._$AN = void 0, this.element = e, this.name = n, this._$AM = o, this.options = s, r.length > 2 || r[0] !== "" || r[1] !== "" ? (this._$AH = Array(r.length - 1).fill(new String()), this.strings = r) : this._$AH = I;
157
+ constructor(e, r, n, o, s) {
158
+ this.type = 1, this._$AH = M, this._$AN = void 0, this.element = e, this.name = r, this._$AM = o, this.options = s, n.length > 2 || n[0] !== "" || n[1] !== "" ? (this._$AH = Array(n.length - 1).fill(new String()), this.strings = n) : this._$AH = M;
159
159
  }
160
- _$AI(e, n = this, r, o) {
160
+ _$AI(e, r = this, n, o) {
161
161
  const s = this.strings;
162
162
  let i = !1;
163
- if (s === void 0) e = Y(this, e, n, 0), i = !ne(e) || e !== this._$AH && e !== re, i && (this._$AH = e);
163
+ if (s === void 0) e = X(this, e, r, 0), i = !re(e) || e !== this._$AH && e !== Y, i && (this._$AH = e);
164
164
  else {
165
165
  const c = e;
166
- let a, u;
167
- for (e = s[0], a = 0; a < s.length - 1; a++) u = Y(this, c[r + a], n, a), u === re && (u = this._$AH[a]), i ||= !ne(u) || u !== this._$AH[a], u === I ? e = I : e !== I && (e += (u ?? "") + s[a + 1]), this._$AH[a] = u;
166
+ let a, l;
167
+ for (e = s[0], a = 0; a < s.length - 1; a++) l = X(this, c[n + a], r, a), l === Y && (l = this._$AH[a]), i ||= !re(l) || l !== this._$AH[a], l === M ? e = M : e !== M && (e += (l ?? "") + s[a + 1]), this._$AH[a] = l;
168
168
  }
169
169
  i && !o && this.j(e);
170
170
  }
171
171
  j(e) {
172
- e === I ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
172
+ e === M ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
173
173
  }
174
174
  }
175
- class sn extends le {
175
+ class ln extends ue {
176
176
  constructor() {
177
177
  super(...arguments), this.type = 3;
178
178
  }
179
179
  j(e) {
180
- this.element[this.name] = e === I ? void 0 : e;
180
+ this.element[this.name] = e === M ? void 0 : e;
181
181
  }
182
182
  }
183
- class an extends le {
183
+ class un extends ue {
184
184
  constructor() {
185
185
  super(...arguments), this.type = 4;
186
186
  }
187
187
  j(e) {
188
- this.element.toggleAttribute(this.name, !!e && e !== I);
188
+ this.element.toggleAttribute(this.name, !!e && e !== M);
189
189
  }
190
190
  }
191
- class cn extends le {
192
- constructor(e, n, r, o, s) {
193
- super(e, n, r, o, s), this.type = 5;
191
+ class hn extends ue {
192
+ constructor(e, r, n, o, s) {
193
+ super(e, r, n, o, s), this.type = 5;
194
194
  }
195
- _$AI(e, n = this) {
196
- if ((e = Y(this, e, n, 0) ?? I) === re) return;
197
- const r = this._$AH, o = e === I && r !== I || e.capture !== r.capture || e.once !== r.once || e.passive !== r.passive, s = e !== I && (r === I || o);
198
- o && this.element.removeEventListener(this.name, this, r), s && this.element.addEventListener(this.name, this, e), this._$AH = e;
195
+ _$AI(e, r = this) {
196
+ if ((e = X(this, e, r, 0) ?? M) === Y) return;
197
+ const n = this._$AH, o = e === M && n !== M || e.capture !== n.capture || e.once !== n.once || e.passive !== n.passive, s = e !== M && (n === M || o);
198
+ o && this.element.removeEventListener(this.name, this, n), s && this.element.addEventListener(this.name, this, e), this._$AH = e;
199
199
  }
200
200
  handleEvent(e) {
201
201
  typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, e) : this._$AH.handleEvent(e);
202
202
  }
203
203
  }
204
- class un {
205
- constructor(e, n, r) {
206
- this.element = e, this.type = 6, this._$AN = void 0, this._$AM = n, this.options = r;
204
+ class dn {
205
+ constructor(e, r, n) {
206
+ this.element = e, this.type = 6, this._$AN = void 0, this._$AM = r, this.options = n;
207
207
  }
208
208
  get _$AU() {
209
209
  return this._$AM._$AU;
210
210
  }
211
211
  _$AI(e) {
212
- Y(this, e);
213
- }
214
- }
215
- const ln = He.litHtmlPolyfillSupport;
216
- ln?.(oe, se), (He.litHtmlVersions ??= []).push("3.3.1");
217
- const qt = (t, e, n) => {
218
- const r = e;
219
- let o = r._$litPart$;
220
- return o === void 0 && (r._$litPart$ = o = new se(e.insertBefore(te(), null), null, void 0, {})), o._$AI(t), o;
221
- }, hn = (t) => t ? ["text/", "xml", "html", "javascript", "css", "csv", "plain", "x-www-form-urlencoded"].some((n) => t.includes(n)) : !1, et = async (t = {}, e) => {
222
- const n = new AbortController(), r = n.signal, o = t.isBlob || !1, s = t.isText || !1, i = t.isPostFile || !1, c = t.timeout || 6e4 * 3, a = setTimeout(() => {
223
- n.abort();
212
+ X(this, e);
213
+ }
214
+ }
215
+ const fn = je.litHtmlPolyfillSupport;
216
+ fn?.(oe, ie), (je.litHtmlVersions ??= []).push("3.3.1");
217
+ const Ut = (t, e, r) => {
218
+ const n = e;
219
+ let o = n._$litPart$;
220
+ return o === void 0 && (n._$litPart$ = o = new ie(e.insertBefore(ne(), null), null, void 0, {})), o._$AI(t), o;
221
+ };
222
+ const gn = { CHILD: 2 }, pn = (t) => (...e) => ({ _$litDirective$: t, values: e });
223
+ class mn {
224
+ constructor(e) {
225
+ }
226
+ get _$AU() {
227
+ return this._$AM._$AU;
228
+ }
229
+ _$AT(e, r, n) {
230
+ this._$Ct = e, this._$AM = r, this._$Ci = n;
231
+ }
232
+ _$AS(e, r) {
233
+ return this.update(e, r);
234
+ }
235
+ update(e, r) {
236
+ return this.render(...r);
237
+ }
238
+ }
239
+ class He extends mn {
240
+ constructor(e) {
241
+ if (super(e), this.it = M, e.type !== gn.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
242
+ }
243
+ render(e) {
244
+ if (e === M || e == null) return this._t = void 0, this.it = e;
245
+ if (e === Y) return e;
246
+ if (typeof e != "string") throw Error(this.constructor.directiveName + "() called with a non-string value");
247
+ if (e === this.it) return this._t;
248
+ this.it = e;
249
+ const r = [e];
250
+ return r.raw = r, this._t = { _$litType$: this.constructor.resultType, strings: r, values: [] };
251
+ }
252
+ }
253
+ He.directiveName = "unsafeHTML", He.resultType = 1;
254
+ const nt = pn(He), wn = (t) => t ? ["text/", "xml", "html", "javascript", "css", "csv", "plain", "x-www-form-urlencoded"].some((r) => t.includes(r)) : !1, rt = async (t = {}, e) => {
255
+ const r = new AbortController(), n = r.signal, o = t.isBlob || !1, s = t.isText || !1, i = t.isPostFile || !1, c = t.timeout || 6e4 * 3, a = setTimeout(() => {
256
+ r.abort();
224
257
  }, c);
225
- let u = e?.method || t?.method || "POST", l = { ...t?.headers, ...e?.headers }, h = "", f;
258
+ let l = e?.method || t?.method || "POST", u = { ...t?.headers, ...e?.headers }, h = "", f;
226
259
  t?.url?.startsWith("http") ? f = new URL(t.url) : (h = window?.location?.origin || "http://localhost:51015", f = new URL(t.url, h));
227
- const d = u === "GET";
260
+ const d = l === "GET";
228
261
  d && (f.search = new URLSearchParams(t.body).toString());
229
262
  let w;
230
- return d ? w = void 0 : i ? w = t.body : (l = {
263
+ return d ? w = void 0 : i ? w = t.body : (u = {
231
264
  "Content-Type": "application/json",
232
- ...l
265
+ ...u
233
266
  }, w = JSON.stringify(t.body)), fetch(f, {
234
- method: u.toUpperCase(),
235
- signal: r,
267
+ method: l.toUpperCase(),
268
+ signal: n,
236
269
  body: w,
237
270
  ...e,
238
- headers: l
239
- }).then(async (m) => {
240
- const S = m.headers.get("Content-Type");
241
- return o ? await m.blob() : S && S.includes("application/json") && !s ? await m.json() : hn(S) ? {
271
+ headers: u
272
+ }).then(async (p) => {
273
+ const B = p.headers.get("Content-Type");
274
+ return o ? await p.blob() : B && B.includes("application/json") && !s ? await p.json() : wn(B) ? {
242
275
  code: 200,
243
- status: m.status,
244
- data: await m.text()
276
+ status: p.status,
277
+ data: await p.text()
245
278
  // 直接返回文本内容
246
- } : m;
247
- }).catch((m) => (m.name === "AbortError" && console.log("Request timed out and was aborted"), console.error(m), {
279
+ } : p;
280
+ }).catch((p) => (p.name === "AbortError" && console.log("Request timed out and was aborted"), console.error(p), {
248
281
  code: 500
249
282
  })).finally(() => {
250
283
  clearTimeout(a);
251
284
  });
252
- }, tt = (t) => (t.success = t.code === 200, t.showError = (e) => {
285
+ }, ot = (t) => (t.success = t.code === 200, t.showError = (e) => {
253
286
  !t.success && !t.noMsg && e?.();
254
- }, t), pe = ({ code: t, message: e }) => ({
287
+ }, t), me = ({ code: t, message: e }) => ({
255
288
  code: t || 500,
256
289
  success: !1,
257
290
  message: e || "api request error",
258
- showError: (r) => {
291
+ showError: (n) => {
259
292
  },
260
293
  noMsg: !0
261
294
  });
262
- class Dt {
295
+ class Ft {
263
296
  adapter;
264
297
  url;
265
298
  beforeRequest;
@@ -273,7 +306,7 @@ class Dt {
273
306
  // 默认不使用ws
274
307
  qws;
275
308
  constructor(e) {
276
- this.adapter = e?.adapter || et, this.url = e?.url || "/api/router", this.headers = e?.headers || {
309
+ this.adapter = e?.adapter || rt, this.url = e?.url || "/api/router", this.headers = e?.headers || {
277
310
  "Content-Type": "application/json"
278
311
  }, this.timeout = e?.timeout || 6e4 * 3;
279
312
  }
@@ -294,8 +327,8 @@ class Dt {
294
327
  * @param options 请求配置
295
328
  * @returns 请求结果
296
329
  */
297
- async get(e, n) {
298
- return this.post(e, n);
330
+ async get(e, r) {
331
+ return this.post(e, r);
299
332
  }
300
333
  /**
301
334
  * 发送 post 请求
@@ -305,46 +338,46 @@ class Dt {
305
338
  * @param options 请求配置
306
339
  * @returns 请求结果
307
340
  */
308
- async post(e, n) {
309
- const r = n?.url || this.url, { headers: o, adapter: s, beforeRequest: i, afterResponse: c, timeout: a, ...u } = n || {}, l = { ...this.headers, ...o }, h = s || this.adapter, f = i || this.beforeRequest, d = c || this.afterResponse, w = a || this.timeout, m = {
310
- url: r,
311
- headers: l,
341
+ async post(e, r) {
342
+ const n = r?.url || this.url, { headers: o, adapter: s, beforeRequest: i, afterResponse: c, timeout: a, ...l } = r || {}, u = { ...this.headers, ...o }, h = s || this.adapter, f = i || this.beforeRequest, d = c || this.afterResponse, w = a || this.timeout, p = {
343
+ url: n,
344
+ headers: u,
312
345
  body: e,
313
346
  timeout: w,
314
- ...u
347
+ ...l
315
348
  };
316
349
  try {
317
- if (f && await f(m) === !1)
318
- return pe({
350
+ if (f && await f(p) === !1)
351
+ return me({
319
352
  code: 500,
320
353
  message: "request is cancel",
321
354
  // @ts-ignore
322
- req: m
355
+ req: p
323
356
  });
324
- } catch (S) {
325
- return console.error("request beforeFn error", S, m), pe({
357
+ } catch (B) {
358
+ return console.error("request beforeFn error", B, p), me({
326
359
  code: 500,
327
360
  message: "api request beforeFn error"
328
361
  });
329
362
  }
330
- if (this.stop && !n?.noStop) {
331
- const S = this;
332
- await new Promise((C) => {
333
- let B = 0;
363
+ if (this.stop && !r?.noStop) {
364
+ const B = this;
365
+ await new Promise((A) => {
366
+ let S = 0;
334
367
  const k = setInterval(() => {
335
- S.stop || (clearInterval(k), C(!0)), B++, B > 30 && console.error("request stop: timeout", m.url, B);
368
+ B.stop || (clearInterval(k), A(!0)), S++, S > 30 && console.error("request stop: timeout", p.url, S);
336
369
  }, 1e3);
337
370
  });
338
371
  }
339
- return h(m).then(async (S) => {
372
+ return h(p).then(async (B) => {
340
373
  try {
341
- return tt(S), d ? await d(S, {
342
- req: m,
343
- res: S,
374
+ return ot(B), d ? await d(B, {
375
+ req: p,
376
+ res: B,
344
377
  fetch: s
345
- }) : S;
346
- } catch (C) {
347
- return console.error("request afterFn error", C, m), pe({
378
+ }) : B;
379
+ } catch (A) {
380
+ return console.error("request afterFn error", A, p), me({
348
381
  code: 500,
349
382
  message: "api request afterFn error"
350
383
  });
@@ -365,21 +398,21 @@ class Dt {
365
398
  after(e) {
366
399
  this.afterResponse = e;
367
400
  }
368
- async fetchText(e, n) {
369
- let r = { ...n };
370
- typeof e == "string" && !r.url && (r.url = e), typeof e == "object" && (r = { ...e, ...r });
371
- const o = await et({
401
+ async fetchText(e, r) {
402
+ let n = { ...r };
403
+ typeof e == "string" && !n.url && (n.url = e), typeof e == "object" && (n = { ...e, ...n });
404
+ const o = await rt({
372
405
  method: "GET",
373
- ...r,
406
+ ...n,
374
407
  headers: {
375
408
  ...this.headers,
376
- ...r?.headers || {}
409
+ ...n?.headers || {}
377
410
  }
378
411
  });
379
- return tt(o);
412
+ return ot(o);
380
413
  }
381
414
  }
382
- class dn {
415
+ class yn {
383
416
  query;
384
417
  queryDefine;
385
418
  constructor(e) {
@@ -388,52 +421,52 @@ class dn {
388
421
  get chain() {
389
422
  return this.queryDefine.queryChain;
390
423
  }
391
- post(e, n) {
392
- return this.query.post(e, n);
424
+ post(e, r) {
425
+ return this.query.post(e, r);
393
426
  }
394
- get(e, n) {
395
- return this.query.get(e, n);
427
+ get(e, r) {
428
+ return this.query.get(e, r);
396
429
  }
397
430
  }
398
- const nt = (t) => (t.success = t.code === 200, t.showError = (e) => {
431
+ const st = (t) => (t.success = t.code === 200, t.showError = (e) => {
399
432
  !t.success && !t.noMsg && e?.();
400
433
  }, t);
401
- function L(t) {
402
- return new Promise((e, n) => {
403
- t.oncomplete = t.onsuccess = () => e(t.result), t.onabort = t.onerror = () => n(t.error);
434
+ function $(t) {
435
+ return new Promise((e, r) => {
436
+ t.oncomplete = t.onsuccess = () => e(t.result), t.onabort = t.onerror = () => r(t.error);
404
437
  });
405
438
  }
406
- function Nt(t, e) {
407
- const n = indexedDB.open(t);
408
- n.onupgradeneeded = () => n.result.createObjectStore(e);
409
- const r = L(n);
410
- return (o, s) => r.then((i) => s(i.transaction(e, o).objectStore(e)));
439
+ function zt(t, e) {
440
+ const r = indexedDB.open(t);
441
+ r.onupgradeneeded = () => r.result.createObjectStore(e);
442
+ const n = $(r);
443
+ return (o, s) => n.then((i) => s(i.transaction(e, o).objectStore(e)));
411
444
  }
412
445
  let we;
413
- function x() {
414
- return we || (we = Nt("keyval-store", "keyval")), we;
446
+ function I() {
447
+ return we || (we = zt("keyval-store", "keyval")), we;
415
448
  }
416
- function Ut(t, e = x()) {
417
- return e("readonly", (n) => L(n.get(t)));
449
+ function Ht(t, e = I()) {
450
+ return e("readonly", (r) => $(r.get(t)));
418
451
  }
419
- function Ft(t, e, n = x()) {
420
- return n("readwrite", (r) => (r.put(e, t), L(r.transaction)));
452
+ function jt(t, e, r = I()) {
453
+ return r("readwrite", (n) => (n.put(e, t), $(n.transaction)));
421
454
  }
422
- function fn(t, e = x()) {
423
- return e("readwrite", (n) => (t.forEach((r) => n.put(r[1], r[0])), L(n.transaction)));
455
+ function bn(t, e = I()) {
456
+ return e("readwrite", (r) => (t.forEach((n) => r.put(n[1], n[0])), $(r.transaction)));
424
457
  }
425
- function gn(t, e = x()) {
426
- return e("readonly", (n) => Promise.all(t.map((r) => L(n.get(r)))));
458
+ function vn(t, e = I()) {
459
+ return e("readonly", (r) => Promise.all(t.map((n) => $(r.get(n)))));
427
460
  }
428
- function mn(t, e, n = x()) {
429
- return n("readwrite", (r) => (
461
+ function An(t, e, r = I()) {
462
+ return r("readwrite", (n) => (
430
463
  // Need to create the promise manually.
431
464
  // If I try to chain promises, the transaction closes in browsers
432
465
  // that use a promise polyfill (IE10/11).
433
466
  new Promise((o, s) => {
434
- r.get(t).onsuccess = function() {
467
+ n.get(t).onsuccess = function() {
435
468
  try {
436
- r.put(e(this.result), t), o(L(r.transaction));
469
+ n.put(e(this.result), t), o($(n.transaction));
437
470
  } catch (i) {
438
471
  s(i);
439
472
  }
@@ -441,87 +474,87 @@ function mn(t, e, n = x()) {
441
474
  })
442
475
  ));
443
476
  }
444
- function Ht(t, e = x()) {
445
- return e("readwrite", (n) => (n.delete(t), L(n.transaction)));
477
+ function Vt(t, e = I()) {
478
+ return e("readwrite", (r) => (r.delete(t), $(r.transaction)));
446
479
  }
447
- function pn(t, e = x()) {
448
- return e("readwrite", (n) => (t.forEach((r) => n.delete(r)), L(n.transaction)));
480
+ function Cn(t, e = I()) {
481
+ return e("readwrite", (r) => (t.forEach((n) => r.delete(n)), $(r.transaction)));
449
482
  }
450
- function zt(t = x()) {
451
- return t("readwrite", (e) => (e.clear(), L(e.transaction)));
483
+ function Wt(t = I()) {
484
+ return t("readwrite", (e) => (e.clear(), $(e.transaction)));
452
485
  }
453
- function Ve(t, e) {
486
+ function We(t, e) {
454
487
  return t.openCursor().onsuccess = function() {
455
488
  this.result && (e(this.result), this.result.continue());
456
- }, L(t.transaction);
489
+ }, $(t.transaction);
457
490
  }
458
- function wn(t = x()) {
491
+ function Tn(t = I()) {
459
492
  return t("readonly", (e) => {
460
493
  if (e.getAllKeys)
461
- return L(e.getAllKeys());
462
- const n = [];
463
- return Ve(e, (r) => n.push(r.key)).then(() => n);
494
+ return $(e.getAllKeys());
495
+ const r = [];
496
+ return We(e, (n) => r.push(n.key)).then(() => r);
464
497
  });
465
498
  }
466
- function yn(t = x()) {
499
+ function kn(t = I()) {
467
500
  return t("readonly", (e) => {
468
501
  if (e.getAll)
469
- return L(e.getAll());
470
- const n = [];
471
- return Ve(e, (r) => n.push(r.value)).then(() => n);
502
+ return $(e.getAll());
503
+ const r = [];
504
+ return We(e, (n) => r.push(n.value)).then(() => r);
472
505
  });
473
506
  }
474
- function bn(t = x()) {
507
+ function En(t = I()) {
475
508
  return t("readonly", (e) => {
476
509
  if (e.getAll && e.getAllKeys)
477
510
  return Promise.all([
478
- L(e.getAllKeys()),
479
- L(e.getAll())
480
- ]).then(([r, o]) => r.map((s, i) => [s, o[i]]));
481
- const n = [];
482
- return t("readonly", (r) => Ve(r, (o) => n.push([o.key, o.value])).then(() => n));
511
+ $(e.getAllKeys()),
512
+ $(e.getAll())
513
+ ]).then(([n, o]) => n.map((s, i) => [s, o[i]]));
514
+ const r = [];
515
+ return t("readonly", (n) => We(n, (o) => r.push([o.key, o.value])).then(() => r));
483
516
  });
484
517
  }
485
- var An = /* @__PURE__ */ Object.freeze({
518
+ var _n = /* @__PURE__ */ Object.freeze({
486
519
  __proto__: null,
487
- clear: zt,
488
- createStore: Nt,
489
- del: Ht,
490
- delMany: pn,
491
- entries: bn,
492
- get: Ut,
493
- getMany: gn,
494
- keys: wn,
495
- promisifyRequest: L,
496
- set: Ft,
497
- setMany: fn,
498
- update: mn,
499
- values: yn
520
+ clear: Wt,
521
+ createStore: zt,
522
+ del: Vt,
523
+ delMany: Cn,
524
+ entries: En,
525
+ get: Ht,
526
+ getMany: vn,
527
+ keys: Tn,
528
+ promisifyRequest: $,
529
+ set: jt,
530
+ setMany: bn,
531
+ update: An,
532
+ values: kn
500
533
  });
501
- class Cn {
534
+ class Rn {
502
535
  storage;
503
536
  data = null;
504
537
  constructor() {
505
- this.storage = An;
538
+ this.storage = _n;
506
539
  }
507
540
  async get(e) {
508
- const n = await Ut(e);
509
- return this.data = n, n;
541
+ const r = await Ht(e);
542
+ return this.data = r, r;
510
543
  }
511
- async set(e, n) {
512
- this.data = n, await Ft(e, n);
544
+ async set(e, r) {
545
+ this.data = r, await jt(e, r);
513
546
  }
514
547
  async del(e) {
515
- this.data = null, await Ht(e);
548
+ this.data = null, await Vt(e);
516
549
  }
517
550
  /**
518
551
  * Clear all values in the store.
519
552
  */
520
553
  async clear() {
521
- await zt();
554
+ await Wt();
522
555
  }
523
556
  }
524
- class Tn extends Cn {
557
+ class Sn extends Rn {
525
558
  name;
526
559
  updatedAt;
527
560
  constructor(e) {
@@ -536,10 +569,10 @@ class Tn extends Cn {
536
569
  * @param data
537
570
  * @param opts
538
571
  */
539
- async setData(e, n) {
540
- const o = Date.now() + (n?.expireTime || 1e3 * 60 * 60 * 24 * 10), s = {
572
+ async setData(e, r) {
573
+ const o = Date.now() + (r?.expireTime || 1e3 * 60 * 60 * 24 * 10), s = {
541
574
  data: e,
542
- updatedAt: n?.updatedAt || Date.now(),
575
+ updatedAt: r?.updatedAt || Date.now(),
543
576
  expireTime: o
544
577
  };
545
578
  await super.set(this.name, s), this.updatedAt = s.updatedAt;
@@ -548,7 +581,7 @@ class Tn extends Cn {
548
581
  await super.del(this.name);
549
582
  }
550
583
  }
551
- var vn = class {
584
+ var Bn = class {
552
585
  cache;
553
586
  name;
554
587
  cacheData;
@@ -607,7 +640,7 @@ var vn = class {
607
640
  * @param user
608
641
  */
609
642
  async setLoginUser(t) {
610
- this.cacheData.loginUsers.find((n) => n.id === t.id) && (this.cacheData.loginUsers = this.cacheData?.loginUsers?.filter((n) => n?.id && n.id !== t.id)), this.cacheData.loginUsers.push(t), this.cacheData.user = t.user, this.cacheData.id = t.id, this.cacheData.accessToken = t.accessToken, this.cacheData.refreshToken = t.refreshToken, await this.setValue(this.cacheData);
643
+ this.cacheData.loginUsers.find((r) => r.id === t.id) && (this.cacheData.loginUsers = this.cacheData?.loginUsers?.filter((r) => r?.id && r.id !== t.id)), this.cacheData.loginUsers.push(t), this.cacheData.user = t.user, this.cacheData.id = t.id, this.cacheData.accessToken = t.accessToken, this.cacheData.refreshToken = t.refreshToken, await this.setValue(this.cacheData);
611
644
  }
612
645
  getCurrentUser() {
613
646
  const t = this.cacheData;
@@ -626,12 +659,12 @@ var vn = class {
626
659
  }
627
660
  async clearCurrentUser() {
628
661
  const t = await this.getCurrentUser();
629
- this.cacheData.loginUsers.find((n) => n.id === t.id) && (this.cacheData.loginUsers = this.cacheData?.loginUsers?.filter((n) => n?.id && n.id !== t.id)), this.cacheData.user = void 0, this.cacheData.id = void 0, this.cacheData.accessToken = void 0, this.cacheData.refreshToken = void 0, await this.setValue(this.cacheData);
662
+ this.cacheData.loginUsers.find((r) => r.id === t.id) && (this.cacheData.loginUsers = this.cacheData?.loginUsers?.filter((r) => r?.id && r.id !== t.id)), this.cacheData.user = void 0, this.cacheData.id = void 0, this.cacheData.accessToken = void 0, this.cacheData.refreshToken = void 0, await this.setValue(this.cacheData);
630
663
  }
631
664
  async clearAll() {
632
665
  this.cacheData.loginUsers = [], this.cacheData.user = void 0, this.cacheData.id = void 0, this.cacheData.accessToken = void 0, this.cacheData.refreshToken = void 0, await this.setValue(this.cacheData);
633
666
  }
634
- }, kn = class extends dn {
667
+ }, Mn = class extends yn {
635
668
  /**
636
669
  * query login cache, 非实际操作, 一个cache的包裹模块
637
670
  */
@@ -642,8 +675,8 @@ var vn = class {
642
675
  onLoad;
643
676
  constructor(t) {
644
677
  super({
645
- query: t?.query || new Dt()
646
- }), this.cacheStore = new vn({ name: "login", cache: t.cache }), this.isBrowser = t?.isBrowser ?? !0, this.init(), this.onLoad = t?.onLoad, this.storage = t?.storage || localStorage;
678
+ query: t?.query || new Ft()
679
+ }), this.cacheStore = new Bn({ name: "login", cache: t.cache }), this.isBrowser = t?.isBrowser ?? !0, this.init(), this.onLoad = t?.onLoad, this.storage = t?.storage || localStorage;
647
680
  }
648
681
  setQuery(t) {
649
682
  this.query = t;
@@ -654,8 +687,8 @@ var vn = class {
654
687
  async post(t, e) {
655
688
  try {
656
689
  return this.query.post({ path: "user", ...t }, e);
657
- } catch (n) {
658
- return console.log("error", n), {
690
+ } catch (r) {
691
+ return console.log("error", r), {
659
692
  code: 400
660
693
  };
661
694
  }
@@ -668,8 +701,8 @@ var vn = class {
668
701
  async login(t) {
669
702
  const e = await this.post({ key: "login", ...t });
670
703
  if (e.code === 200) {
671
- const { accessToken: n, refreshToken: r } = e?.data || {};
672
- this.storage.setItem("token", n || ""), await this.beforeSetLoginUser({ accessToken: n, refreshToken: r });
704
+ const { accessToken: r, refreshToken: n } = e?.data || {};
705
+ this.storage.setItem("token", r || ""), await this.beforeSetLoginUser({ accessToken: r, refreshToken: n });
673
706
  }
674
707
  return e;
675
708
  }
@@ -681,8 +714,8 @@ var vn = class {
681
714
  async loginByCode(t) {
682
715
  const e = await this.post({ path: "sms", key: "login", data: t });
683
716
  if (e.code === 200) {
684
- const { accessToken: n, refreshToken: r } = e?.data || {};
685
- this.storage.setItem("token", n || ""), await this.beforeSetLoginUser({ accessToken: n, refreshToken: r });
717
+ const { accessToken: r, refreshToken: n } = e?.data || {};
718
+ this.storage.setItem("token", r || ""), await this.beforeSetLoginUser({ accessToken: r, refreshToken: n });
686
719
  }
687
720
  return e;
688
721
  }
@@ -691,14 +724,14 @@ var vn = class {
691
724
  * @param token
692
725
  */
693
726
  async setLoginToken(t) {
694
- const { accessToken: e, refreshToken: n } = t;
695
- this.storage.setItem("token", e || ""), await this.beforeSetLoginUser({ accessToken: e, refreshToken: n });
727
+ const { accessToken: e, refreshToken: r } = t;
728
+ this.storage.setItem("token", e || ""), await this.beforeSetLoginUser({ accessToken: e, refreshToken: r });
696
729
  }
697
730
  async loginByWechat(t) {
698
731
  const e = await this.post({ path: "wx", key: "open-login", code: t.code });
699
732
  if (e.code === 200) {
700
- const { accessToken: n, refreshToken: r } = e?.data || {};
701
- this.storage.setItem("token", n || ""), await this.beforeSetLoginUser({ accessToken: n, refreshToken: r });
733
+ const { accessToken: r, refreshToken: n } = e?.data || {};
734
+ this.storage.setItem("token", r || ""), await this.beforeSetLoginUser({ accessToken: r, refreshToken: n });
702
735
  }
703
736
  return e;
704
737
  }
@@ -707,9 +740,9 @@ var vn = class {
707
740
  * @param param0
708
741
  */
709
742
  async checkWechat({ onSuccess: t, onError: e }) {
710
- const n = new URL(window.location.href), r = n.searchParams.get("code"), o = n.searchParams.get("state");
711
- if (r && o) {
712
- const s = await this.loginByWechat({ code: r });
743
+ const r = new URL(window.location.href), n = r.searchParams.get("code"), o = r.searchParams.get("state");
744
+ if (n && o) {
745
+ const s = await this.loginByWechat({ code: n });
713
746
  s.code === 200 ? t?.(s.data) : e?.(s);
714
747
  }
715
748
  }
@@ -717,11 +750,11 @@ var vn = class {
717
750
  * 登陆成功,需要获取用户信息进行缓存
718
751
  * @param param0
719
752
  */
720
- async beforeSetLoginUser({ accessToken: t, refreshToken: e, check401: n }) {
753
+ async beforeSetLoginUser({ accessToken: t, refreshToken: e, check401: r }) {
721
754
  if (t && e) {
722
- const r = await this.getMe(t, n);
723
- if (r.code === 200) {
724
- const o = r.data;
755
+ const n = await this.getMe(t, r);
756
+ if (n.code === 200) {
757
+ const o = n.data;
725
758
  o ? this.cacheStore.setLoginUser({
726
759
  user: o,
727
760
  id: o.id,
@@ -738,11 +771,11 @@ var vn = class {
738
771
  */
739
772
  async queryRefreshToken(t) {
740
773
  const e = t || this.cacheStore.getRefreshToken();
741
- let n = { refreshToken: e };
774
+ let r = { refreshToken: e };
742
775
  return e ? this.post(
743
- { key: "refreshToken", data: n },
776
+ { key: "refreshToken", data: r },
744
777
  {
745
- afterResponse: async (r, o) => (nt(r), r)
778
+ afterResponse: async (n, o) => (st(n), n)
746
779
  }
747
780
  ) : (await this.cacheStore.clearCurrentUser(), {
748
781
  code: 401,
@@ -758,25 +791,25 @@ var vn = class {
758
791
  * @param refetch
759
792
  * @returns
760
793
  */
761
- async afterCheck401ToRefreshToken(t, e, n) {
762
- const r = this;
794
+ async afterCheck401ToRefreshToken(t, e, r) {
795
+ const n = this;
763
796
  if (t?.code === 401) {
764
- const o = await r.cacheStore.getRefreshToken();
797
+ const o = await n.cacheStore.getRefreshToken();
765
798
  if (o) {
766
- const s = await r.queryRefreshToken(o);
799
+ const s = await n.queryRefreshToken(o);
767
800
  if (s.code === 200) {
768
801
  const { accessToken: i, refreshToken: c } = s?.data || {};
769
- if (r.storage.setItem("token", i || ""), await r.beforeSetLoginUser({ accessToken: i, refreshToken: c, check401: !1 }), n && e && e.req && e.req.url && e.fetch) {
802
+ if (n.storage.setItem("token", i || ""), await n.beforeSetLoginUser({ accessToken: i, refreshToken: c, check401: !1 }), r && e && e.req && e.req.url && e.fetch) {
770
803
  await new Promise((f) => setTimeout(f, 1500));
771
- const a = e.req?.url, u = e.req?.body, l = e.req?.headers, h = await e.fetch(a, {
804
+ const a = e.req?.url, l = e.req?.body, u = e.req?.headers, h = await e.fetch(a, {
772
805
  method: "POST",
773
- body: u,
774
- headers: { ...l, Authorization: `Bearer ${i}` }
806
+ body: l,
807
+ headers: { ...u, Authorization: `Bearer ${i}` }
775
808
  });
776
- return nt(h), h;
809
+ return st(h), h;
777
810
  }
778
811
  } else
779
- r.storage.removeItem("token"), await r.cacheStore.clearCurrentUser();
812
+ n.storage.removeItem("token"), await n.cacheStore.clearCurrentUser();
780
813
  return s;
781
814
  }
782
815
  }
@@ -791,14 +824,14 @@ var vn = class {
791
824
  * @param opts
792
825
  * @returns
793
826
  */
794
- async run401Action(t, e, n) {
795
- const r = this, o = n?.refetch ?? !1;
827
+ async run401Action(t, e, r) {
828
+ const n = this, o = r?.refetch ?? !1;
796
829
  if (t?.code === 401) {
797
- if (r.query.stop === !0)
830
+ if (n.query.stop === !0)
798
831
  return { code: 500, success: !1, message: "refresh token loading..." };
799
- r.query.stop = !0;
800
- const s = await r.afterCheck401ToRefreshToken(t, e, o);
801
- return r.query.stop = !1, n?.afterCheck?.(s), s.code === 401 && n?.afterAlso401?.(s), s;
832
+ n.query.stop = !0;
833
+ const s = await n.afterCheck401ToRefreshToken(t, e, o);
834
+ return n.query.stop = !1, r?.afterCheck?.(s), s.code === 401 && r?.afterAlso401?.(s), s;
802
835
  } else
803
836
  return t;
804
837
  }
@@ -808,12 +841,12 @@ var vn = class {
808
841
  * @returns
809
842
  */
810
843
  async getMe(t, e = !0) {
811
- const n = t || this.storage.getItem("token"), r = this;
812
- return r.post(
844
+ const r = t || this.storage.getItem("token"), n = this;
845
+ return n.post(
813
846
  { key: "me" },
814
847
  {
815
- beforeRequest: async (o) => (o.headers && (o.headers.Authorization = `Bearer ${n}`), o),
816
- afterResponse: async (o, s) => o?.code === 401 && e && !t ? await r.afterCheck401ToRefreshToken(o, s) : o
848
+ beforeRequest: async (o) => (o.headers && (o.headers.Authorization = `Bearer ${r}`), o),
849
+ afterResponse: async (o, s) => o?.code === 401 && e && !t ? await n.afterCheck401ToRefreshToken(o, s) : o
817
850
  }
818
851
  );
819
852
  }
@@ -846,23 +879,23 @@ var vn = class {
846
879
  * @returns
847
880
  */
848
881
  async switchUser(t) {
849
- const n = (await this.cacheStore.getCurrentUserList()).find((o) => o.user.username === t);
850
- if (n)
851
- return this.storage.setItem("token", n.accessToken || ""), await this.beforeSetLoginUser({ accessToken: n.accessToken, refreshToken: n.refreshToken }), {
882
+ const r = (await this.cacheStore.getCurrentUserList()).find((o) => o.user.username === t);
883
+ if (r)
884
+ return this.storage.setItem("token", r.accessToken || ""), await this.beforeSetLoginUser({ accessToken: r.accessToken, refreshToken: r.refreshToken }), {
852
885
  code: 200,
853
886
  data: {
854
- accessToken: n.accessToken,
855
- refreshToken: n.refreshToken
887
+ accessToken: r.accessToken,
888
+ refreshToken: r.refreshToken
856
889
  },
857
890
  success: !0,
858
891
  message: "切换用户成功"
859
892
  };
860
- const r = await this.postSwitchUser(t);
861
- if (r.code === 200) {
862
- const { accessToken: o, refreshToken: s } = r?.data || {};
893
+ const n = await this.postSwitchUser(t);
894
+ if (n.code === 200) {
895
+ const { accessToken: o, refreshToken: s } = n?.data || {};
863
896
  this.storage.setItem("token", o || ""), await this.beforeSetLoginUser({ accessToken: o, refreshToken: s });
864
897
  }
865
- return r;
898
+ return n;
866
899
  }
867
900
  /**
868
901
  * 退出登陆,去掉token, 并删除缓存
@@ -870,7 +903,7 @@ var vn = class {
870
903
  */
871
904
  async logout() {
872
905
  this.storage.removeItem("token");
873
- const e = (await this.cacheStore.getCurrentUserList()).map((n) => n?.accessToken).filter(Boolean);
906
+ const e = (await this.cacheStore.getCurrentUserList()).map((r) => r?.accessToken).filter(Boolean);
874
907
  return this.cacheStore.delValue(), this.post({ key: "logout", data: { tokens: e } });
875
908
  }
876
909
  /**
@@ -889,7 +922,7 @@ var vn = class {
889
922
  }
890
923
  },
891
924
  {
892
- afterResponse: async (n, r) => n?.code === 401 ? await e.afterCheck401ToRefreshToken(n, r, !0) : n
925
+ afterResponse: async (r, n) => r?.code === 401 ? await e.afterCheck401ToRefreshToken(r, n, !0) : r
893
926
  }
894
927
  );
895
928
  }
@@ -905,34 +938,34 @@ var vn = class {
905
938
  loginToken: t
906
939
  });
907
940
  if (e.code === 200) {
908
- const n = e.data?.accessToken;
909
- return this.storage.setItem("token", n || ""), await this.beforeSetLoginUser({ accessToken: n, refreshToken: e.data?.refreshToken }), e;
941
+ const r = e.data?.accessToken;
942
+ return this.storage.setItem("token", r || ""), await this.beforeSetLoginUser({ accessToken: r, refreshToken: e.data?.refreshToken }), e;
910
943
  }
911
944
  return !1;
912
945
  }
913
946
  /**
914
947
  * 使用web登录,创建url地址, 需要MD5和jsonwebtoken
915
948
  */
916
- loginWithWeb(t, { MD5: e, jsonwebtoken: n }) {
917
- const r = Math.random().toString(36).substring(2, 15), o = Date.now(), s = "xiao" + r, i = e(`${s}${o}`).toString(), c = n.sign({ randomId: r, timestamp: o, sign: i }, s, {
949
+ loginWithWeb(t, { MD5: e, jsonwebtoken: r }) {
950
+ const n = Math.random().toString(36).substring(2, 15), o = Date.now(), s = "xiao" + n, i = e(`${s}${o}`).toString(), c = r.sign({ randomId: n, timestamp: o, sign: i }, s, {
918
951
  // 10分钟过期
919
952
  expiresIn: 600
920
953
  // 10分钟
921
954
  });
922
- return { url: `${t}/api/router?path=user&key=webLogin&p&loginToken=${c}&sign=${i}&randomId=${r}`, token: c, tokenSecret: s };
955
+ return { url: `${t}/api/router?path=user&key=webLogin&p&loginToken=${c}&sign=${i}&randomId=${n}`, token: c, tokenSecret: s };
923
956
  }
924
- }, En = class extends kn {
957
+ }, xn = class extends Mn {
925
958
  constructor(t) {
926
959
  super({
927
960
  ...t,
928
- cache: new Tn("login")
961
+ cache: new Sn("login")
929
962
  });
930
963
  }
931
964
  };
932
- const _n = new Dt(), V = new En({
933
- query: _n
965
+ const $n = new Ft(), N = new xn({
966
+ query: $n
934
967
  });
935
- class Rn extends HTMLElement {
968
+ class Ln extends HTMLElement {
936
969
  options;
937
970
  timer = null;
938
971
  constructor() {
@@ -950,7 +983,7 @@ class Rn extends HTMLElement {
950
983
  this.options = { ...this.options, ...e }, this.render();
951
984
  }
952
985
  render() {
953
- const { type: e, message: n, closable: r } = this.options, s = D`
986
+ const { type: e, message: r, closable: n } = this.options, s = L`
954
987
  <style>
955
988
  :host {
956
989
  display: block;
@@ -1084,19 +1117,19 @@ class Rn extends HTMLElement {
1084
1117
  case "error":
1085
1118
  return "✕";
1086
1119
  case "loading":
1087
- return D`<div class="loading-spinner"></div>`;
1120
+ return L`<div class="loading-spinner"></div>`;
1088
1121
  default:
1089
1122
  return "";
1090
1123
  }
1091
1124
  })()}
1092
1125
  </div>
1093
- <div class="message-content">${n}</div>
1094
- ${r ? D`
1126
+ <div class="message-content">${r}</div>
1127
+ ${n ? L`
1095
1128
  <button class="message-close" @click=${() => this.remove()}>&times;</button>
1096
1129
  ` : ""}
1097
1130
  </div>
1098
1131
  `;
1099
- qt(s, this), e !== "loading" && this.options.duration && this.options.duration > 0 && this.setTimer();
1132
+ Ut(s, this), e !== "loading" && this.options.duration && this.options.duration > 0 && this.setTimer();
1100
1133
  }
1101
1134
  setTimer() {
1102
1135
  this.timer && clearTimeout(this.timer), this.timer = window.setTimeout(() => {
@@ -1112,20 +1145,20 @@ class Rn extends HTMLElement {
1112
1145
  this.timer && (clearTimeout(this.timer), this.timer = null);
1113
1146
  }
1114
1147
  }
1115
- customElements.define("kv-message", Rn);
1116
- class Q {
1148
+ customElements.define("kv-message", Ln);
1149
+ class G {
1117
1150
  static instance;
1118
1151
  container = null;
1119
1152
  defaultPosition = "center";
1120
1153
  static getInstance() {
1121
- return Q.instance || (Q.instance = new Q()), Q.instance;
1154
+ return G.instance || (G.instance = new G()), G.instance;
1122
1155
  }
1123
1156
  setDefaultPosition(e) {
1124
1157
  this.defaultPosition = e;
1125
1158
  }
1126
1159
  getContainer(e) {
1127
- const n = e || this.defaultPosition;
1128
- return this.container || (this.container = document.getElementById("messages"), this.container || (this.container = document.createElement("div"), this.container.id = "messages", n === "center" ? this.container.style.cssText = `
1160
+ const r = e || this.defaultPosition;
1161
+ return this.container || (this.container = document.getElementById("messages"), this.container || (this.container = document.createElement("div"), this.container.id = "messages", r === "center" ? this.container.style.cssText = `
1129
1162
  position: fixed;
1130
1163
  top: 20px;
1131
1164
  left: 50%;
@@ -1149,118 +1182,118 @@ class Q {
1149
1182
  `, document.body.appendChild(this.container))), this.container;
1150
1183
  }
1151
1184
  show(e) {
1152
- const n = this.getContainer(e.position), r = document.createElement("kv-message");
1153
- return r.setOptions(e), r.style.cssText = "pointer-events: auto;", n.appendChild(r), r;
1185
+ const r = this.getContainer(e.position), n = document.createElement("kv-message");
1186
+ return n.setOptions(e), n.style.cssText = "pointer-events: auto;", r.appendChild(n), n;
1154
1187
  }
1155
- success(e, n) {
1188
+ success(e, r) {
1156
1189
  return this.show({
1157
1190
  type: "success",
1158
1191
  message: e,
1159
- duration: n?.duration || 2e3,
1160
- position: n?.position,
1161
- closable: n?.closable
1192
+ duration: r?.duration || 2e3,
1193
+ position: r?.position,
1194
+ closable: r?.closable
1162
1195
  });
1163
1196
  }
1164
- error(e, n) {
1197
+ error(e, r) {
1165
1198
  return this.show({
1166
1199
  type: "error",
1167
1200
  message: e,
1168
- duration: n?.duration || 3e3,
1169
- position: n?.position,
1170
- closable: n?.closable
1201
+ duration: r?.duration || 3e3,
1202
+ position: r?.position,
1203
+ closable: r?.closable
1171
1204
  });
1172
1205
  }
1173
- loading(e, n) {
1206
+ loading(e, r) {
1174
1207
  return this.show({
1175
1208
  type: "loading",
1176
1209
  message: e,
1177
1210
  duration: 0,
1178
- position: n?.position,
1179
- closable: n?.closable
1211
+ position: r?.position,
1212
+ closable: r?.closable
1180
1213
  });
1181
1214
  }
1182
1215
  remove(e) {
1183
1216
  e.remove();
1184
1217
  }
1185
1218
  clear() {
1186
- this.getContainer().querySelectorAll("kv-message").forEach((r) => {
1187
- r.remove();
1219
+ this.getContainer().querySelectorAll("kv-message").forEach((n) => {
1220
+ n.remove();
1188
1221
  });
1189
1222
  }
1190
1223
  }
1191
- const Vt = () => Q.getInstance();
1192
- window.createMessage = Vt;
1193
- const j = Vt(), ue = () => {
1224
+ const Ot = () => G.getInstance();
1225
+ window.createMessage = Ot;
1226
+ const U = Ot(), se = () => {
1194
1227
  console.log("重定向到首页");
1195
- const t = window.location.href, n = new URL(t).searchParams.get("redirect");
1196
- if (n) {
1197
- const r = decodeURIComponent(n);
1198
- window.open(r, "_self");
1228
+ const t = window.location.href, r = new URL(t).searchParams.get("redirect");
1229
+ if (r) {
1230
+ const n = decodeURIComponent(r);
1231
+ window.open(n, "_self");
1199
1232
  } else
1200
1233
  window.open("/root/home", "_self");
1201
- }, Bn = async (t) => {
1202
- const { loginMethod: e, data: n } = t;
1234
+ }, In = async (t) => {
1235
+ const { loginMethod: e, data: r } = t;
1203
1236
  switch (e) {
1204
1237
  case "password":
1205
- await Sn(n);
1238
+ await Pn(r);
1206
1239
  break;
1207
1240
  case "phone":
1208
- await Mn(n);
1241
+ await qn(r);
1209
1242
  break;
1210
1243
  case "wechat-mp":
1211
- await Ln(n);
1244
+ await Nn(r);
1212
1245
  break;
1213
1246
  case "wechat":
1214
- await In(n);
1247
+ await Dn(r);
1215
1248
  break;
1216
1249
  default:
1217
1250
  console.warn("未知的登录方式:", e);
1218
1251
  }
1219
- }, Sn = async (t) => {
1252
+ }, Pn = async (t) => {
1220
1253
  console.log("使用用户名密码登录:", t);
1221
1254
  let e = !0;
1222
- if (await V.checkLocalToken() && (await V.checkLocalUser())?.username === t?.username && (await V.getMe()).code === 200 && (e = !1, console.log("已登录,跳过登录步骤"), j.success("已登录")), !e) {
1223
- ue();
1255
+ if (await N.checkLocalToken() && (await N.checkLocalUser())?.username === t?.username && (await N.getMe()).code === 200 && (e = !1, console.log("已登录,跳过登录步骤"), U.success("已登录")), !e) {
1256
+ se();
1224
1257
  return;
1225
1258
  }
1226
- const r = await V.login({
1259
+ const n = await N.login({
1227
1260
  username: t.username,
1228
1261
  password: t.password
1229
1262
  });
1230
- r.code === 200 ? (console.log("登录成功"), j.success("登录成功"), ue()) : j.error(`登录失败: ${r.message}`);
1231
- }, Mn = async (t) => {
1263
+ n.code === 200 ? (console.log("登录成功"), U.success("登录成功"), se()) : U.error(`登录失败: ${n.message}`);
1264
+ }, qn = async (t) => {
1232
1265
  console.log("使用手机号登录:", t);
1233
- }, In = async (t) => {
1266
+ }, Dn = async (t) => {
1234
1267
  console.log("使用微信登录:", t);
1235
- }, Ln = async (t) => {
1268
+ }, Nn = async (t) => {
1236
1269
  console.log("使用微信公众号登录:", t);
1237
- }, xn = () => {
1270
+ }, Un = () => {
1238
1271
  const t = new URL(window.location.href);
1239
1272
  t.searchParams.delete("code"), t.searchParams.delete("state"), window.history.replaceState({}, document.title, t.toString());
1240
- }, Pn = async () => {
1273
+ }, Fn = async () => {
1241
1274
  const t = new URL(window.location.href), e = t.searchParams.get("code");
1242
1275
  if (t.searchParams.get("state")?.includes?.("-") || !e)
1243
1276
  return;
1244
- const r = await V.loginByWechat({ code: e });
1245
- r.code === 200 ? (j.success("登录成功"), ue()) : (j.error(r.message || "登录失败"), xn());
1246
- }, $n = async () => {
1247
- const t = new URL(window.location.href), e = t.searchParams.get("state"), [n, r] = e ? e.split("-") : [null, null];
1248
- if (console.log("检查微信公众号登录流程:", n, r, e), n === "1")
1249
- Dn();
1250
- else if (n === "2") {
1251
- const o = t.searchParams.get("code"), s = await V.post({
1277
+ const n = await N.loginByWechat({ code: e });
1278
+ n.code === 200 ? (U.success("登录成功"), se()) : (U.error(n.message || "登录失败"), Un());
1279
+ }, zn = async () => {
1280
+ const t = new URL(window.location.href), e = t.searchParams.get("state"), [r, n] = e ? e.split("-") : [null, null];
1281
+ if (console.log("检查微信公众号登录流程:", r, n, e), r === "1")
1282
+ jn();
1283
+ else if (r === "2") {
1284
+ const o = t.searchParams.get("code"), s = await N.post({
1252
1285
  path: "wx",
1253
1286
  key: "mplogin",
1254
- state: r,
1287
+ state: n,
1255
1288
  code: o
1256
1289
  });
1257
- s.code === 200 ? j.success("登录成功") : j.error(s.message || "登录失败"), jt();
1290
+ s.code === 200 ? U.success("登录成功") : U.error(s.message || "登录失败"), Jt();
1258
1291
  }
1259
- }, qn = () => {
1292
+ }, Hn = () => {
1260
1293
  const t = navigator.userAgent.toLowerCase();
1261
1294
  return /micromessenger/i.test(t);
1262
- }, jt = (t = 2e3) => {
1263
- if (!qn()) {
1295
+ }, Jt = (t = 2e3) => {
1296
+ if (!Hn()) {
1264
1297
  setTimeout(() => {
1265
1298
  window.close();
1266
1299
  }, t);
@@ -1271,32 +1304,51 @@ const j = Vt(), ue = () => {
1271
1304
  }, t) : setTimeout(() => {
1272
1305
  window.close();
1273
1306
  }, t);
1274
- }, Dn = async () => {
1275
- const t = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=APPID&redirect_uri=REDIRECT_URI&response_type=code&scope=SCOPE&state=STATE#wechat_redirect", e = Gt, n = new URL(window.location.href), r = n.searchParams.get("state");
1276
- let [o, s] = r ? r.split("-") : [null, null];
1277
- const i = new URL(n.pathname, n.origin);
1307
+ }, jn = async () => {
1308
+ const t = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=APPID&redirect_uri=REDIRECT_URI&response_type=code&scope=SCOPE&state=STATE#wechat_redirect", e = Xt, r = new URL(window.location.href), n = r.searchParams.get("state");
1309
+ let [o, s] = n ? n.split("-") : [null, null];
1310
+ const i = new URL(r.pathname, r.origin);
1278
1311
  s = "2-" + s;
1279
1312
  const c = encodeURIComponent(i.toString());
1280
1313
  document.body.innerHTML = "<p>正在准备跳转到微信公众号授权页面...</p>";
1281
1314
  const a = "snsapi_userinfo";
1282
1315
  if (!s) {
1283
- alert("Invalid state. Please try again later."), jt();
1316
+ alert("Invalid state. Please try again later."), Jt();
1284
1317
  return;
1285
1318
  }
1286
- const u = t.replace("APPID", e).replace("REDIRECT_URI", c).replace("SCOPE", a).replace("STATE", s);
1319
+ const l = t.replace("APPID", e).replace("REDIRECT_URI", c).replace("SCOPE", a).replace("STATE", s);
1287
1320
  setTimeout(() => {
1288
- window.location.href = u;
1321
+ window.location.href = l;
1289
1322
  }, 100);
1290
1323
  };
1291
1324
  setTimeout(() => {
1292
- $n();
1325
+ zn();
1293
1326
  }, 100);
1294
- const rt = async (t) => {
1327
+ const Vn = async () => {
1328
+ const t = await N.post({
1329
+ path: "wx",
1330
+ key: "get-qrcode-ticket"
1331
+ });
1332
+ return t.code !== 200 ? (U.error("获取二维码失败"), null) : t?.data;
1333
+ }, Wn = (t) => {
1334
+ let e = !0;
1335
+ const r = async () => {
1336
+ const s = await N.post({
1337
+ path: "wx",
1338
+ key: "check-qrcode-login",
1339
+ payload: { ticket: t }
1340
+ });
1341
+ s.code === 200 ? (U.success("登录成功"), clearTimeout(n), se()) : (s.code === 401 ? console.log("等待扫码登录...") : console.log("扫码登录状态:", s), e && setTimeout(r, 2e3));
1342
+ }, n = setTimeout(r, 2e3);
1343
+ return () => {
1344
+ console.log("停止检测扫码登录状态"), clearTimeout(n), e = !1;
1345
+ };
1346
+ }, it = async (t) => {
1295
1347
  let e = t?.redirect_uri;
1296
- const { appid: n } = t || {};
1348
+ const { appid: r } = t || {};
1297
1349
  e || (e = window.location.href);
1298
- const r = new URL(e);
1299
- if (r.searchParams.delete("code"), r.searchParams.delete("state"), e = r.toString(), console.log("redirect_uri", e), !n) {
1350
+ const n = new URL(e);
1351
+ if (n.searchParams.delete("code"), n.searchParams.delete("state"), e = n.toString(), console.log("redirect_uri", e), !r) {
1300
1352
  console.error("appid is not cant be empty");
1301
1353
  return;
1302
1354
  }
@@ -1304,7 +1356,7 @@ const rt = async (t) => {
1304
1356
  self_redirect: !1,
1305
1357
  id: "weixinLogin",
1306
1358
  // 需要显示的容器id
1307
- appid: n,
1359
+ appid: r,
1308
1360
  // 微信开放平台appid wx*******
1309
1361
  scope: "snsapi_login",
1310
1362
  // 网页默认即可 snsapi_userinfo
@@ -1323,30 +1375,30 @@ const rt = async (t) => {
1323
1375
  }
1324
1376
  return o;
1325
1377
  };
1326
- function Nn(t) {
1378
+ function On(t) {
1327
1379
  const e = document.createElement("script");
1328
1380
  if (e.type = "text/javascript", e.src = "//res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js", e.id = "weixinLogin-js", document.getElementById("weixinLogin-js")) {
1329
- rt(t);
1381
+ it(t);
1330
1382
  return;
1331
1383
  }
1332
- const n = document.body.appendChild(e);
1333
- n.onload = function() {
1334
- rt(t);
1384
+ const r = document.body.appendChild(e);
1385
+ r.onload = function() {
1386
+ it(t);
1335
1387
  };
1336
1388
  }
1337
- function Un(t) {
1389
+ function Jn(t) {
1338
1390
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
1339
1391
  }
1340
- var G = {}, ye, ot;
1341
- function Fn() {
1342
- return ot || (ot = 1, ye = function() {
1392
+ var Q = {}, ye, at;
1393
+ function Kn() {
1394
+ return at || (at = 1, ye = function() {
1343
1395
  return typeof Promise == "function" && Promise.prototype && Promise.prototype.then;
1344
1396
  }), ye;
1345
1397
  }
1346
- var be = {}, U = {}, st;
1398
+ var be = {}, z = {}, ct;
1347
1399
  function O() {
1348
- if (st) return U;
1349
- st = 1;
1400
+ if (ct) return z;
1401
+ ct = 1;
1350
1402
  let t;
1351
1403
  const e = [
1352
1404
  0,
@@ -1392,35 +1444,35 @@ function O() {
1392
1444
  3532,
1393
1445
  3706
1394
1446
  ];
1395
- return U.getSymbolSize = function(r) {
1396
- if (!r) throw new Error('"version" cannot be null or undefined');
1397
- if (r < 1 || r > 40) throw new Error('"version" should be in range from 1 to 40');
1398
- return r * 4 + 17;
1399
- }, U.getSymbolTotalCodewords = function(r) {
1400
- return e[r];
1401
- }, U.getBCHDigit = function(n) {
1402
- let r = 0;
1403
- for (; n !== 0; )
1404
- r++, n >>>= 1;
1405
- return r;
1406
- }, U.setToSJISFunction = function(r) {
1407
- if (typeof r != "function")
1447
+ return z.getSymbolSize = function(n) {
1448
+ if (!n) throw new Error('"version" cannot be null or undefined');
1449
+ if (n < 1 || n > 40) throw new Error('"version" should be in range from 1 to 40');
1450
+ return n * 4 + 17;
1451
+ }, z.getSymbolTotalCodewords = function(n) {
1452
+ return e[n];
1453
+ }, z.getBCHDigit = function(r) {
1454
+ let n = 0;
1455
+ for (; r !== 0; )
1456
+ n++, r >>>= 1;
1457
+ return n;
1458
+ }, z.setToSJISFunction = function(n) {
1459
+ if (typeof n != "function")
1408
1460
  throw new Error('"toSJISFunc" is not a valid function.');
1409
- t = r;
1410
- }, U.isKanjiModeEnabled = function() {
1461
+ t = n;
1462
+ }, z.isKanjiModeEnabled = function() {
1411
1463
  return typeof t < "u";
1412
- }, U.toSJIS = function(r) {
1413
- return t(r);
1414
- }, U;
1464
+ }, z.toSJIS = function(n) {
1465
+ return t(n);
1466
+ }, z;
1415
1467
  }
1416
- var Ae = {}, it;
1417
- function je() {
1418
- return it || (it = 1, (function(t) {
1468
+ var ve = {}, lt;
1469
+ function Oe() {
1470
+ return lt || (lt = 1, (function(t) {
1419
1471
  t.L = { bit: 1 }, t.M = { bit: 0 }, t.Q = { bit: 3 }, t.H = { bit: 2 };
1420
- function e(n) {
1421
- if (typeof n != "string")
1472
+ function e(r) {
1473
+ if (typeof r != "string")
1422
1474
  throw new Error("Param is not a string");
1423
- switch (n.toLowerCase()) {
1475
+ switch (r.toLowerCase()) {
1424
1476
  case "l":
1425
1477
  case "low":
1426
1478
  return t.L;
@@ -1434,79 +1486,79 @@ function je() {
1434
1486
  case "high":
1435
1487
  return t.H;
1436
1488
  default:
1437
- throw new Error("Unknown EC Level: " + n);
1489
+ throw new Error("Unknown EC Level: " + r);
1438
1490
  }
1439
1491
  }
1440
- t.isValid = function(r) {
1441
- return r && typeof r.bit < "u" && r.bit >= 0 && r.bit < 4;
1442
- }, t.from = function(r, o) {
1443
- if (t.isValid(r))
1444
- return r;
1492
+ t.isValid = function(n) {
1493
+ return n && typeof n.bit < "u" && n.bit >= 0 && n.bit < 4;
1494
+ }, t.from = function(n, o) {
1495
+ if (t.isValid(n))
1496
+ return n;
1445
1497
  try {
1446
- return e(r);
1498
+ return e(n);
1447
1499
  } catch {
1448
1500
  return o;
1449
1501
  }
1450
1502
  };
1451
- })(Ae)), Ae;
1503
+ })(ve)), ve;
1452
1504
  }
1453
- var Ce, at;
1454
- function Hn() {
1455
- if (at) return Ce;
1456
- at = 1;
1505
+ var Ae, ut;
1506
+ function Qn() {
1507
+ if (ut) return Ae;
1508
+ ut = 1;
1457
1509
  function t() {
1458
1510
  this.buffer = [], this.length = 0;
1459
1511
  }
1460
1512
  return t.prototype = {
1461
1513
  get: function(e) {
1462
- const n = Math.floor(e / 8);
1463
- return (this.buffer[n] >>> 7 - e % 8 & 1) === 1;
1514
+ const r = Math.floor(e / 8);
1515
+ return (this.buffer[r] >>> 7 - e % 8 & 1) === 1;
1464
1516
  },
1465
- put: function(e, n) {
1466
- for (let r = 0; r < n; r++)
1467
- this.putBit((e >>> n - r - 1 & 1) === 1);
1517
+ put: function(e, r) {
1518
+ for (let n = 0; n < r; n++)
1519
+ this.putBit((e >>> r - n - 1 & 1) === 1);
1468
1520
  },
1469
1521
  getLengthInBits: function() {
1470
1522
  return this.length;
1471
1523
  },
1472
1524
  putBit: function(e) {
1473
- const n = Math.floor(this.length / 8);
1474
- this.buffer.length <= n && this.buffer.push(0), e && (this.buffer[n] |= 128 >>> this.length % 8), this.length++;
1525
+ const r = Math.floor(this.length / 8);
1526
+ this.buffer.length <= r && this.buffer.push(0), e && (this.buffer[r] |= 128 >>> this.length % 8), this.length++;
1475
1527
  }
1476
- }, Ce = t, Ce;
1528
+ }, Ae = t, Ae;
1477
1529
  }
1478
- var Te, ct;
1479
- function zn() {
1480
- if (ct) return Te;
1481
- ct = 1;
1530
+ var Ce, ht;
1531
+ function Gn() {
1532
+ if (ht) return Ce;
1533
+ ht = 1;
1482
1534
  function t(e) {
1483
1535
  if (!e || e < 1)
1484
1536
  throw new Error("BitMatrix size must be defined and greater than 0");
1485
1537
  this.size = e, this.data = new Uint8Array(e * e), this.reservedBit = new Uint8Array(e * e);
1486
1538
  }
1487
- return t.prototype.set = function(e, n, r, o) {
1488
- const s = e * this.size + n;
1489
- this.data[s] = r, o && (this.reservedBit[s] = !0);
1490
- }, t.prototype.get = function(e, n) {
1491
- return this.data[e * this.size + n];
1492
- }, t.prototype.xor = function(e, n, r) {
1493
- this.data[e * this.size + n] ^= r;
1494
- }, t.prototype.isReserved = function(e, n) {
1495
- return this.reservedBit[e * this.size + n];
1496
- }, Te = t, Te;
1497
- }
1498
- var ve = {}, ut;
1499
- function Vn() {
1500
- return ut || (ut = 1, (function(t) {
1539
+ return t.prototype.set = function(e, r, n, o) {
1540
+ const s = e * this.size + r;
1541
+ this.data[s] = n, o && (this.reservedBit[s] = !0);
1542
+ }, t.prototype.get = function(e, r) {
1543
+ return this.data[e * this.size + r];
1544
+ }, t.prototype.xor = function(e, r, n) {
1545
+ this.data[e * this.size + r] ^= n;
1546
+ }, t.prototype.isReserved = function(e, r) {
1547
+ return this.reservedBit[e * this.size + r];
1548
+ }, Ce = t, Ce;
1549
+ }
1550
+ var Te = {}, dt;
1551
+ function Yn() {
1552
+ return dt || (dt = 1, (function(t) {
1501
1553
  const e = O().getSymbolSize;
1502
- t.getRowColCoords = function(r) {
1503
- if (r === 1) return [];
1504
- const o = Math.floor(r / 7) + 2, s = e(r), i = s === 145 ? 26 : Math.ceil((s - 13) / (2 * o - 2)) * 2, c = [s - 7];
1554
+ t.getRowColCoords = function(n) {
1555
+ if (n === 1) return [];
1556
+ const o = Math.floor(n / 7) + 2, s = e(n), i = s === 145 ? 26 : Math.ceil((s - 13) / (2 * o - 2)) * 2, c = [s - 7];
1505
1557
  for (let a = 1; a < o - 1; a++)
1506
1558
  c[a] = c[a - 1] - i;
1507
1559
  return c.push(6), c.reverse();
1508
- }, t.getPositions = function(r) {
1509
- const o = [], s = t.getRowColCoords(r), i = s.length;
1560
+ }, t.getPositions = function(n) {
1561
+ const o = [], s = t.getRowColCoords(n), i = s.length;
1510
1562
  for (let c = 0; c < i; c++)
1511
1563
  for (let a = 0; a < i; a++)
1512
1564
  c === 0 && a === 0 || // top-left
@@ -1514,15 +1566,15 @@ function Vn() {
1514
1566
  c === i - 1 && a === 0 || o.push([s[c], s[a]]);
1515
1567
  return o;
1516
1568
  };
1517
- })(ve)), ve;
1569
+ })(Te)), Te;
1518
1570
  }
1519
- var ke = {}, lt;
1520
- function jn() {
1521
- if (lt) return ke;
1522
- lt = 1;
1571
+ var ke = {}, ft;
1572
+ function Xn() {
1573
+ if (ft) return ke;
1574
+ ft = 1;
1523
1575
  const t = O().getSymbolSize, e = 7;
1524
- return ke.getPositions = function(r) {
1525
- const o = t(r);
1576
+ return ke.getPositions = function(n) {
1577
+ const o = t(n);
1526
1578
  return [
1527
1579
  // top-left
1528
1580
  [0, 0],
@@ -1533,9 +1585,9 @@ function jn() {
1533
1585
  ];
1534
1586
  }, ke;
1535
1587
  }
1536
- var Ee = {}, ht;
1537
- function Wn() {
1538
- return ht || (ht = 1, (function(t) {
1588
+ var Ee = {}, gt;
1589
+ function Zn() {
1590
+ return gt || (gt = 1, (function(t) {
1539
1591
  t.Patterns = {
1540
1592
  PATTERN000: 0,
1541
1593
  PATTERN001: 1,
@@ -1558,12 +1610,12 @@ function Wn() {
1558
1610
  return t.isValid(o) ? parseInt(o, 10) : void 0;
1559
1611
  }, t.getPenaltyN1 = function(o) {
1560
1612
  const s = o.size;
1561
- let i = 0, c = 0, a = 0, u = null, l = null;
1613
+ let i = 0, c = 0, a = 0, l = null, u = null;
1562
1614
  for (let h = 0; h < s; h++) {
1563
- c = a = 0, u = l = null;
1615
+ c = a = 0, l = u = null;
1564
1616
  for (let f = 0; f < s; f++) {
1565
1617
  let d = o.get(h, f);
1566
- d === u ? c++ : (c >= 5 && (i += e.N1 + (c - 5)), u = d, c = 1), d = o.get(f, h), d === l ? a++ : (a >= 5 && (i += e.N1 + (a - 5)), l = d, a = 1);
1618
+ d === l ? c++ : (c >= 5 && (i += e.N1 + (c - 5)), l = d, c = 1), d = o.get(f, h), d === u ? a++ : (a >= 5 && (i += e.N1 + (a - 5)), u = d, a = 1);
1567
1619
  }
1568
1620
  c >= 5 && (i += e.N1 + (c - 5)), a >= 5 && (i += e.N1 + (a - 5));
1569
1621
  }
@@ -1573,17 +1625,17 @@ function Wn() {
1573
1625
  let i = 0;
1574
1626
  for (let c = 0; c < s - 1; c++)
1575
1627
  for (let a = 0; a < s - 1; a++) {
1576
- const u = o.get(c, a) + o.get(c, a + 1) + o.get(c + 1, a) + o.get(c + 1, a + 1);
1577
- (u === 4 || u === 0) && i++;
1628
+ const l = o.get(c, a) + o.get(c, a + 1) + o.get(c + 1, a) + o.get(c + 1, a + 1);
1629
+ (l === 4 || l === 0) && i++;
1578
1630
  }
1579
1631
  return i * e.N2;
1580
1632
  }, t.getPenaltyN3 = function(o) {
1581
1633
  const s = o.size;
1582
1634
  let i = 0, c = 0, a = 0;
1583
- for (let u = 0; u < s; u++) {
1635
+ for (let l = 0; l < s; l++) {
1584
1636
  c = a = 0;
1585
- for (let l = 0; l < s; l++)
1586
- c = c << 1 & 2047 | o.get(u, l), l >= 10 && (c === 1488 || c === 93) && i++, a = a << 1 & 2047 | o.get(l, u), l >= 10 && (a === 1488 || a === 93) && i++;
1637
+ for (let u = 0; u < s; u++)
1638
+ c = c << 1 & 2047 | o.get(l, u), u >= 10 && (c === 1488 || c === 93) && i++, a = a << 1 & 2047 | o.get(u, l), u >= 10 && (a === 1488 || a === 93) && i++;
1587
1639
  }
1588
1640
  return i * e.N3;
1589
1641
  }, t.getPenaltyN4 = function(o) {
@@ -1592,8 +1644,8 @@ function Wn() {
1592
1644
  for (let a = 0; a < i; a++) s += o.data[a];
1593
1645
  return Math.abs(Math.ceil(s * 100 / i / 5) - 10) * e.N4;
1594
1646
  };
1595
- function n(r, o, s) {
1596
- switch (r) {
1647
+ function r(n, o, s) {
1648
+ switch (n) {
1597
1649
  case t.Patterns.PATTERN000:
1598
1650
  return (o + s) % 2 === 0;
1599
1651
  case t.Patterns.PATTERN001:
@@ -1611,31 +1663,31 @@ function Wn() {
1611
1663
  case t.Patterns.PATTERN111:
1612
1664
  return (o * s % 3 + (o + s) % 2) % 2 === 0;
1613
1665
  default:
1614
- throw new Error("bad maskPattern:" + r);
1666
+ throw new Error("bad maskPattern:" + n);
1615
1667
  }
1616
1668
  }
1617
1669
  t.applyMask = function(o, s) {
1618
1670
  const i = s.size;
1619
1671
  for (let c = 0; c < i; c++)
1620
1672
  for (let a = 0; a < i; a++)
1621
- s.isReserved(a, c) || s.xor(a, c, n(o, a, c));
1673
+ s.isReserved(a, c) || s.xor(a, c, r(o, a, c));
1622
1674
  }, t.getBestMask = function(o, s) {
1623
1675
  const i = Object.keys(t.Patterns).length;
1624
1676
  let c = 0, a = 1 / 0;
1625
- for (let u = 0; u < i; u++) {
1626
- s(u), t.applyMask(u, o);
1627
- const l = t.getPenaltyN1(o) + t.getPenaltyN2(o) + t.getPenaltyN3(o) + t.getPenaltyN4(o);
1628
- t.applyMask(u, o), l < a && (a = l, c = u);
1677
+ for (let l = 0; l < i; l++) {
1678
+ s(l), t.applyMask(l, o);
1679
+ const u = t.getPenaltyN1(o) + t.getPenaltyN2(o) + t.getPenaltyN3(o) + t.getPenaltyN4(o);
1680
+ t.applyMask(l, o), u < a && (a = u, c = l);
1629
1681
  }
1630
1682
  return c;
1631
1683
  };
1632
1684
  })(Ee)), Ee;
1633
1685
  }
1634
- var ae = {}, dt;
1635
- function Wt() {
1636
- if (dt) return ae;
1637
- dt = 1;
1638
- const t = je(), e = [
1686
+ var ce = {}, pt;
1687
+ function Kt() {
1688
+ if (pt) return ce;
1689
+ pt = 1;
1690
+ const t = Oe(), e = [
1639
1691
  // L M Q H
1640
1692
  1,
1641
1693
  1,
@@ -1797,7 +1849,7 @@ function Wt() {
1797
1849
  49,
1798
1850
  68,
1799
1851
  81
1800
- ], n = [
1852
+ ], r = [
1801
1853
  // L M Q H
1802
1854
  7,
1803
1855
  10,
@@ -1960,7 +2012,7 @@ function Wt() {
1960
2012
  2040,
1961
2013
  2430
1962
2014
  ];
1963
- return ae.getBlocksCount = function(o, s) {
2015
+ return ce.getBlocksCount = function(o, s) {
1964
2016
  switch (s) {
1965
2017
  case t.L:
1966
2018
  return e[(o - 1) * 4 + 0];
@@ -1973,53 +2025,53 @@ function Wt() {
1973
2025
  default:
1974
2026
  return;
1975
2027
  }
1976
- }, ae.getTotalCodewordsCount = function(o, s) {
2028
+ }, ce.getTotalCodewordsCount = function(o, s) {
1977
2029
  switch (s) {
1978
2030
  case t.L:
1979
- return n[(o - 1) * 4 + 0];
2031
+ return r[(o - 1) * 4 + 0];
1980
2032
  case t.M:
1981
- return n[(o - 1) * 4 + 1];
2033
+ return r[(o - 1) * 4 + 1];
1982
2034
  case t.Q:
1983
- return n[(o - 1) * 4 + 2];
2035
+ return r[(o - 1) * 4 + 2];
1984
2036
  case t.H:
1985
- return n[(o - 1) * 4 + 3];
2037
+ return r[(o - 1) * 4 + 3];
1986
2038
  default:
1987
2039
  return;
1988
2040
  }
1989
- }, ae;
2041
+ }, ce;
1990
2042
  }
1991
- var _e = {}, ee = {}, ft;
1992
- function On() {
1993
- if (ft) return ee;
1994
- ft = 1;
2043
+ var _e = {}, te = {}, mt;
2044
+ function er() {
2045
+ if (mt) return te;
2046
+ mt = 1;
1995
2047
  const t = new Uint8Array(512), e = new Uint8Array(256);
1996
2048
  return (function() {
1997
- let r = 1;
2049
+ let n = 1;
1998
2050
  for (let o = 0; o < 255; o++)
1999
- t[o] = r, e[r] = o, r <<= 1, r & 256 && (r ^= 285);
2051
+ t[o] = n, e[n] = o, n <<= 1, n & 256 && (n ^= 285);
2000
2052
  for (let o = 255; o < 512; o++)
2001
2053
  t[o] = t[o - 255];
2002
- })(), ee.log = function(r) {
2003
- if (r < 1) throw new Error("log(" + r + ")");
2004
- return e[r];
2005
- }, ee.exp = function(r) {
2006
- return t[r];
2007
- }, ee.mul = function(r, o) {
2008
- return r === 0 || o === 0 ? 0 : t[e[r] + e[o]];
2009
- }, ee;
2010
- }
2011
- var gt;
2012
- function Jn() {
2013
- return gt || (gt = 1, (function(t) {
2014
- const e = On();
2015
- t.mul = function(r, o) {
2016
- const s = new Uint8Array(r.length + o.length - 1);
2017
- for (let i = 0; i < r.length; i++)
2054
+ })(), te.log = function(n) {
2055
+ if (n < 1) throw new Error("log(" + n + ")");
2056
+ return e[n];
2057
+ }, te.exp = function(n) {
2058
+ return t[n];
2059
+ }, te.mul = function(n, o) {
2060
+ return n === 0 || o === 0 ? 0 : t[e[n] + e[o]];
2061
+ }, te;
2062
+ }
2063
+ var wt;
2064
+ function tr() {
2065
+ return wt || (wt = 1, (function(t) {
2066
+ const e = er();
2067
+ t.mul = function(n, o) {
2068
+ const s = new Uint8Array(n.length + o.length - 1);
2069
+ for (let i = 0; i < n.length; i++)
2018
2070
  for (let c = 0; c < o.length; c++)
2019
- s[i + c] ^= e.mul(r[i], o[c]);
2071
+ s[i + c] ^= e.mul(n[i], o[c]);
2020
2072
  return s;
2021
- }, t.mod = function(r, o) {
2022
- let s = new Uint8Array(r);
2073
+ }, t.mod = function(n, o) {
2074
+ let s = new Uint8Array(n);
2023
2075
  for (; s.length - o.length >= 0; ) {
2024
2076
  const i = s[0];
2025
2077
  for (let a = 0; a < o.length; a++)
@@ -2029,29 +2081,29 @@ function Jn() {
2029
2081
  s = s.slice(c);
2030
2082
  }
2031
2083
  return s;
2032
- }, t.generateECPolynomial = function(r) {
2084
+ }, t.generateECPolynomial = function(n) {
2033
2085
  let o = new Uint8Array([1]);
2034
- for (let s = 0; s < r; s++)
2086
+ for (let s = 0; s < n; s++)
2035
2087
  o = t.mul(o, new Uint8Array([1, e.exp(s)]));
2036
2088
  return o;
2037
2089
  };
2038
2090
  })(_e)), _e;
2039
2091
  }
2040
- var Re, mt;
2041
- function Kn() {
2042
- if (mt) return Re;
2043
- mt = 1;
2044
- const t = Jn();
2045
- function e(n) {
2046
- this.genPoly = void 0, this.degree = n, this.degree && this.initialize(this.degree);
2047
- }
2048
- return e.prototype.initialize = function(r) {
2049
- this.degree = r, this.genPoly = t.generateECPolynomial(this.degree);
2050
- }, e.prototype.encode = function(r) {
2092
+ var Re, yt;
2093
+ function nr() {
2094
+ if (yt) return Re;
2095
+ yt = 1;
2096
+ const t = tr();
2097
+ function e(r) {
2098
+ this.genPoly = void 0, this.degree = r, this.degree && this.initialize(this.degree);
2099
+ }
2100
+ return e.prototype.initialize = function(n) {
2101
+ this.degree = n, this.genPoly = t.generateECPolynomial(this.degree);
2102
+ }, e.prototype.encode = function(n) {
2051
2103
  if (!this.genPoly)
2052
2104
  throw new Error("Encoder not initialized");
2053
- const o = new Uint8Array(r.length + this.degree);
2054
- o.set(r);
2105
+ const o = new Uint8Array(n.length + this.degree);
2106
+ o.set(n);
2055
2107
  const s = t.mod(o, this.genPoly), i = this.degree - s.length;
2056
2108
  if (i > 0) {
2057
2109
  const c = new Uint8Array(this.degree);
@@ -2060,23 +2112,23 @@ function Kn() {
2060
2112
  return s;
2061
2113
  }, Re = e, Re;
2062
2114
  }
2063
- var Be = {}, Se = {}, Me = {}, pt;
2064
- function Ot() {
2065
- return pt || (pt = 1, Me.isValid = function(e) {
2115
+ var Se = {}, Be = {}, Me = {}, bt;
2116
+ function Qt() {
2117
+ return bt || (bt = 1, Me.isValid = function(e) {
2066
2118
  return !isNaN(e) && e >= 1 && e <= 40;
2067
2119
  }), Me;
2068
2120
  }
2069
- var P = {}, wt;
2070
- function Jt() {
2071
- if (wt) return P;
2072
- wt = 1;
2121
+ var P = {}, vt;
2122
+ function Gt() {
2123
+ if (vt) return P;
2124
+ vt = 1;
2073
2125
  const t = "[0-9]+", e = "[A-Z $%*+\\-./:]+";
2074
- let n = "(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";
2075
- n = n.replace(/u/g, "\\u");
2076
- const r = "(?:(?![A-Z0-9 $%*+\\-./:]|" + n + `)(?:.|[\r
2126
+ let r = "(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";
2127
+ r = r.replace(/u/g, "\\u");
2128
+ const n = "(?:(?![A-Z0-9 $%*+\\-./:]|" + r + `)(?:.|[\r
2077
2129
  ]))+`;
2078
- P.KANJI = new RegExp(n, "g"), P.BYTE_KANJI = new RegExp("[^A-Z0-9 $%*+\\-./:]+", "g"), P.BYTE = new RegExp(r, "g"), P.NUMERIC = new RegExp(t, "g"), P.ALPHANUMERIC = new RegExp(e, "g");
2079
- const o = new RegExp("^" + n + "$"), s = new RegExp("^" + t + "$"), i = new RegExp("^[A-Z0-9 $%*+\\-./:]+$");
2130
+ P.KANJI = new RegExp(r, "g"), P.BYTE_KANJI = new RegExp("[^A-Z0-9 $%*+\\-./:]+", "g"), P.BYTE = new RegExp(n, "g"), P.NUMERIC = new RegExp(t, "g"), P.ALPHANUMERIC = new RegExp(e, "g");
2131
+ const o = new RegExp("^" + r + "$"), s = new RegExp("^" + t + "$"), i = new RegExp("^[A-Z0-9 $%*+\\-./:]+$");
2080
2132
  return P.testKanji = function(a) {
2081
2133
  return o.test(a);
2082
2134
  }, P.testNumeric = function(a) {
@@ -2085,10 +2137,10 @@ function Jt() {
2085
2137
  return i.test(a);
2086
2138
  }, P;
2087
2139
  }
2088
- var yt;
2140
+ var At;
2089
2141
  function J() {
2090
- return yt || (yt = 1, (function(t) {
2091
- const e = Ot(), n = Jt();
2142
+ return At || (At = 1, (function(t) {
2143
+ const e = Qt(), r = Gt();
2092
2144
  t.NUMERIC = {
2093
2145
  id: "Numeric",
2094
2146
  bit: 1,
@@ -2113,14 +2165,14 @@ function J() {
2113
2165
  throw new Error("Invalid version: " + i);
2114
2166
  return i >= 1 && i < 10 ? s.ccBits[0] : i < 27 ? s.ccBits[1] : s.ccBits[2];
2115
2167
  }, t.getBestModeForData = function(s) {
2116
- return n.testNumeric(s) ? t.NUMERIC : n.testAlphanumeric(s) ? t.ALPHANUMERIC : n.testKanji(s) ? t.KANJI : t.BYTE;
2168
+ return r.testNumeric(s) ? t.NUMERIC : r.testAlphanumeric(s) ? t.ALPHANUMERIC : r.testKanji(s) ? t.KANJI : t.BYTE;
2117
2169
  }, t.toString = function(s) {
2118
2170
  if (s && s.id) return s.id;
2119
2171
  throw new Error("Invalid mode");
2120
2172
  }, t.isValid = function(s) {
2121
2173
  return s && s.bit && s.ccBits;
2122
2174
  };
2123
- function r(o) {
2175
+ function n(o) {
2124
2176
  if (typeof o != "string")
2125
2177
  throw new Error("Param is not a string");
2126
2178
  switch (o.toLowerCase()) {
@@ -2140,47 +2192,47 @@ function J() {
2140
2192
  if (t.isValid(s))
2141
2193
  return s;
2142
2194
  try {
2143
- return r(s);
2195
+ return n(s);
2144
2196
  } catch {
2145
2197
  return i;
2146
2198
  }
2147
2199
  };
2148
- })(Se)), Se;
2200
+ })(Be)), Be;
2149
2201
  }
2150
- var bt;
2151
- function Gn() {
2152
- return bt || (bt = 1, (function(t) {
2153
- const e = O(), n = Wt(), r = je(), o = J(), s = Ot(), i = 7973, c = e.getBCHDigit(i);
2202
+ var Ct;
2203
+ function rr() {
2204
+ return Ct || (Ct = 1, (function(t) {
2205
+ const e = O(), r = Kt(), n = Oe(), o = J(), s = Qt(), i = 7973, c = e.getBCHDigit(i);
2154
2206
  function a(f, d, w) {
2155
- for (let m = 1; m <= 40; m++)
2156
- if (d <= t.getCapacity(m, w, f))
2157
- return m;
2207
+ for (let p = 1; p <= 40; p++)
2208
+ if (d <= t.getCapacity(p, w, f))
2209
+ return p;
2158
2210
  }
2159
- function u(f, d) {
2211
+ function l(f, d) {
2160
2212
  return o.getCharCountIndicator(f, d) + 4;
2161
2213
  }
2162
- function l(f, d) {
2214
+ function u(f, d) {
2163
2215
  let w = 0;
2164
- return f.forEach(function(m) {
2165
- const S = u(m.mode, d);
2166
- w += S + m.getBitsLength();
2216
+ return f.forEach(function(p) {
2217
+ const B = l(p.mode, d);
2218
+ w += B + p.getBitsLength();
2167
2219
  }), w;
2168
2220
  }
2169
2221
  function h(f, d) {
2170
2222
  for (let w = 1; w <= 40; w++)
2171
- if (l(f, w) <= t.getCapacity(w, d, o.MIXED))
2223
+ if (u(f, w) <= t.getCapacity(w, d, o.MIXED))
2172
2224
  return w;
2173
2225
  }
2174
2226
  t.from = function(d, w) {
2175
2227
  return s.isValid(d) ? parseInt(d, 10) : w;
2176
- }, t.getCapacity = function(d, w, m) {
2228
+ }, t.getCapacity = function(d, w, p) {
2177
2229
  if (!s.isValid(d))
2178
2230
  throw new Error("Invalid QR Code version");
2179
- typeof m > "u" && (m = o.BYTE);
2180
- const S = e.getSymbolTotalCodewords(d), C = n.getTotalCodewordsCount(d, w), B = (S - C) * 8;
2181
- if (m === o.MIXED) return B;
2182
- const k = B - u(m, d);
2183
- switch (m) {
2231
+ typeof p > "u" && (p = o.BYTE);
2232
+ const B = e.getSymbolTotalCodewords(d), A = r.getTotalCodewordsCount(d, w), S = (B - A) * 8;
2233
+ if (p === o.MIXED) return S;
2234
+ const k = S - l(p, d);
2235
+ switch (p) {
2184
2236
  case o.NUMERIC:
2185
2237
  return Math.floor(k / 10 * 3);
2186
2238
  case o.ALPHANUMERIC:
@@ -2192,17 +2244,17 @@ function Gn() {
2192
2244
  return Math.floor(k / 8);
2193
2245
  }
2194
2246
  }, t.getBestVersionForData = function(d, w) {
2195
- let m;
2196
- const S = r.from(w, r.M);
2247
+ let p;
2248
+ const B = n.from(w, n.M);
2197
2249
  if (Array.isArray(d)) {
2198
2250
  if (d.length > 1)
2199
- return h(d, S);
2251
+ return h(d, B);
2200
2252
  if (d.length === 0)
2201
2253
  return 1;
2202
- m = d[0];
2254
+ p = d[0];
2203
2255
  } else
2204
- m = d;
2205
- return a(m.mode, m.getLength(), S);
2256
+ p = d;
2257
+ return a(p.mode, p.getLength(), B);
2206
2258
  }, t.getEncodedBits = function(d) {
2207
2259
  if (!s.isValid(d) || d < 7)
2208
2260
  throw new Error("Invalid QR Code version");
@@ -2211,47 +2263,47 @@ function Gn() {
2211
2263
  w ^= i << e.getBCHDigit(w) - c;
2212
2264
  return d << 12 | w;
2213
2265
  };
2214
- })(Be)), Be;
2266
+ })(Se)), Se;
2215
2267
  }
2216
- var Ie = {}, At;
2217
- function Qn() {
2218
- if (At) return Ie;
2219
- At = 1;
2220
- const t = O(), e = 1335, n = 21522, r = t.getBCHDigit(e);
2221
- return Ie.getEncodedBits = function(s, i) {
2268
+ var xe = {}, Tt;
2269
+ function or() {
2270
+ if (Tt) return xe;
2271
+ Tt = 1;
2272
+ const t = O(), e = 1335, r = 21522, n = t.getBCHDigit(e);
2273
+ return xe.getEncodedBits = function(s, i) {
2222
2274
  const c = s.bit << 3 | i;
2223
2275
  let a = c << 10;
2224
- for (; t.getBCHDigit(a) - r >= 0; )
2225
- a ^= e << t.getBCHDigit(a) - r;
2226
- return (c << 10 | a) ^ n;
2227
- }, Ie;
2276
+ for (; t.getBCHDigit(a) - n >= 0; )
2277
+ a ^= e << t.getBCHDigit(a) - n;
2278
+ return (c << 10 | a) ^ r;
2279
+ }, xe;
2228
2280
  }
2229
- var Le = {}, xe, Ct;
2230
- function Yn() {
2231
- if (Ct) return xe;
2232
- Ct = 1;
2281
+ var $e = {}, Le, kt;
2282
+ function sr() {
2283
+ if (kt) return Le;
2284
+ kt = 1;
2233
2285
  const t = J();
2234
- function e(n) {
2235
- this.mode = t.NUMERIC, this.data = n.toString();
2286
+ function e(r) {
2287
+ this.mode = t.NUMERIC, this.data = r.toString();
2236
2288
  }
2237
- return e.getBitsLength = function(r) {
2238
- return 10 * Math.floor(r / 3) + (r % 3 ? r % 3 * 3 + 1 : 0);
2289
+ return e.getBitsLength = function(n) {
2290
+ return 10 * Math.floor(n / 3) + (n % 3 ? n % 3 * 3 + 1 : 0);
2239
2291
  }, e.prototype.getLength = function() {
2240
2292
  return this.data.length;
2241
2293
  }, e.prototype.getBitsLength = function() {
2242
2294
  return e.getBitsLength(this.data.length);
2243
- }, e.prototype.write = function(r) {
2295
+ }, e.prototype.write = function(n) {
2244
2296
  let o, s, i;
2245
2297
  for (o = 0; o + 3 <= this.data.length; o += 3)
2246
- s = this.data.substr(o, 3), i = parseInt(s, 10), r.put(i, 10);
2298
+ s = this.data.substr(o, 3), i = parseInt(s, 10), n.put(i, 10);
2247
2299
  const c = this.data.length - o;
2248
- c > 0 && (s = this.data.substr(o), i = parseInt(s, 10), r.put(i, c * 3 + 1));
2249
- }, xe = e, xe;
2300
+ c > 0 && (s = this.data.substr(o), i = parseInt(s, 10), n.put(i, c * 3 + 1));
2301
+ }, Le = e, Le;
2250
2302
  }
2251
- var Pe, Tt;
2252
- function Xn() {
2253
- if (Tt) return Pe;
2254
- Tt = 1;
2303
+ var Ie, Et;
2304
+ function ir() {
2305
+ if (Et) return Ie;
2306
+ Et = 1;
2255
2307
  const t = J(), e = [
2256
2308
  "0",
2257
2309
  "1",
@@ -2299,58 +2351,58 @@ function Xn() {
2299
2351
  "/",
2300
2352
  ":"
2301
2353
  ];
2302
- function n(r) {
2303
- this.mode = t.ALPHANUMERIC, this.data = r;
2354
+ function r(n) {
2355
+ this.mode = t.ALPHANUMERIC, this.data = n;
2304
2356
  }
2305
- return n.getBitsLength = function(o) {
2357
+ return r.getBitsLength = function(o) {
2306
2358
  return 11 * Math.floor(o / 2) + 6 * (o % 2);
2307
- }, n.prototype.getLength = function() {
2359
+ }, r.prototype.getLength = function() {
2308
2360
  return this.data.length;
2309
- }, n.prototype.getBitsLength = function() {
2310
- return n.getBitsLength(this.data.length);
2311
- }, n.prototype.write = function(o) {
2361
+ }, r.prototype.getBitsLength = function() {
2362
+ return r.getBitsLength(this.data.length);
2363
+ }, r.prototype.write = function(o) {
2312
2364
  let s;
2313
2365
  for (s = 0; s + 2 <= this.data.length; s += 2) {
2314
2366
  let i = e.indexOf(this.data[s]) * 45;
2315
2367
  i += e.indexOf(this.data[s + 1]), o.put(i, 11);
2316
2368
  }
2317
2369
  this.data.length % 2 && o.put(e.indexOf(this.data[s]), 6);
2318
- }, Pe = n, Pe;
2370
+ }, Ie = r, Ie;
2319
2371
  }
2320
- var $e, vt;
2321
- function Zn() {
2322
- if (vt) return $e;
2323
- vt = 1;
2372
+ var Pe, _t;
2373
+ function ar() {
2374
+ if (_t) return Pe;
2375
+ _t = 1;
2324
2376
  const t = J();
2325
- function e(n) {
2326
- this.mode = t.BYTE, typeof n == "string" ? this.data = new TextEncoder().encode(n) : this.data = new Uint8Array(n);
2377
+ function e(r) {
2378
+ this.mode = t.BYTE, typeof r == "string" ? this.data = new TextEncoder().encode(r) : this.data = new Uint8Array(r);
2327
2379
  }
2328
- return e.getBitsLength = function(r) {
2329
- return r * 8;
2380
+ return e.getBitsLength = function(n) {
2381
+ return n * 8;
2330
2382
  }, e.prototype.getLength = function() {
2331
2383
  return this.data.length;
2332
2384
  }, e.prototype.getBitsLength = function() {
2333
2385
  return e.getBitsLength(this.data.length);
2334
- }, e.prototype.write = function(n) {
2335
- for (let r = 0, o = this.data.length; r < o; r++)
2336
- n.put(this.data[r], 8);
2337
- }, $e = e, $e;
2386
+ }, e.prototype.write = function(r) {
2387
+ for (let n = 0, o = this.data.length; n < o; n++)
2388
+ r.put(this.data[n], 8);
2389
+ }, Pe = e, Pe;
2338
2390
  }
2339
- var qe, kt;
2340
- function er() {
2341
- if (kt) return qe;
2342
- kt = 1;
2391
+ var qe, Rt;
2392
+ function cr() {
2393
+ if (Rt) return qe;
2394
+ Rt = 1;
2343
2395
  const t = J(), e = O();
2344
- function n(r) {
2345
- this.mode = t.KANJI, this.data = r;
2396
+ function r(n) {
2397
+ this.mode = t.KANJI, this.data = n;
2346
2398
  }
2347
- return n.getBitsLength = function(o) {
2399
+ return r.getBitsLength = function(o) {
2348
2400
  return o * 13;
2349
- }, n.prototype.getLength = function() {
2401
+ }, r.prototype.getLength = function() {
2350
2402
  return this.data.length;
2351
- }, n.prototype.getBitsLength = function() {
2352
- return n.getBitsLength(this.data.length);
2353
- }, n.prototype.write = function(r) {
2403
+ }, r.prototype.getBitsLength = function() {
2404
+ return r.getBitsLength(this.data.length);
2405
+ }, r.prototype.write = function(n) {
2354
2406
  let o;
2355
2407
  for (o = 0; o < this.data.length; o++) {
2356
2408
  let s = e.toSJIS(this.data[o]);
@@ -2363,37 +2415,37 @@ function er() {
2363
2415
  "Invalid SJIS character: " + this.data[o] + `
2364
2416
  Make sure your charset is UTF-8`
2365
2417
  );
2366
- s = (s >>> 8 & 255) * 192 + (s & 255), r.put(s, 13);
2418
+ s = (s >>> 8 & 255) * 192 + (s & 255), n.put(s, 13);
2367
2419
  }
2368
- }, qe = n, qe;
2420
+ }, qe = r, qe;
2369
2421
  }
2370
- var De = { exports: {} }, Et;
2371
- function tr() {
2372
- return Et || (Et = 1, (function(t) {
2422
+ var De = { exports: {} }, St;
2423
+ function lr() {
2424
+ return St || (St = 1, (function(t) {
2373
2425
  var e = {
2374
- single_source_shortest_paths: function(n, r, o) {
2426
+ single_source_shortest_paths: function(r, n, o) {
2375
2427
  var s = {}, i = {};
2376
- i[r] = 0;
2428
+ i[n] = 0;
2377
2429
  var c = e.PriorityQueue.make();
2378
- c.push(r, 0);
2379
- for (var a, u, l, h, f, d, w, m, S; !c.empty(); ) {
2380
- a = c.pop(), u = a.value, h = a.cost, f = n[u] || {};
2381
- for (l in f)
2382
- f.hasOwnProperty(l) && (d = f[l], w = h + d, m = i[l], S = typeof i[l] > "u", (S || m > w) && (i[l] = w, c.push(l, w), s[l] = u));
2430
+ c.push(n, 0);
2431
+ for (var a, l, u, h, f, d, w, p, B; !c.empty(); ) {
2432
+ a = c.pop(), l = a.value, h = a.cost, f = r[l] || {};
2433
+ for (u in f)
2434
+ f.hasOwnProperty(u) && (d = f[u], w = h + d, p = i[u], B = typeof i[u] > "u", (B || p > w) && (i[u] = w, c.push(u, w), s[u] = l));
2383
2435
  }
2384
2436
  if (typeof o < "u" && typeof i[o] > "u") {
2385
- var C = ["Could not find a path from ", r, " to ", o, "."].join("");
2386
- throw new Error(C);
2437
+ var A = ["Could not find a path from ", n, " to ", o, "."].join("");
2438
+ throw new Error(A);
2387
2439
  }
2388
2440
  return s;
2389
2441
  },
2390
- extract_shortest_path_from_predecessor_list: function(n, r) {
2391
- for (var o = [], s = r; s; )
2392
- o.push(s), n[s], s = n[s];
2442
+ extract_shortest_path_from_predecessor_list: function(r, n) {
2443
+ for (var o = [], s = n; s; )
2444
+ o.push(s), r[s], s = r[s];
2393
2445
  return o.reverse(), o;
2394
2446
  },
2395
- find_path: function(n, r, o) {
2396
- var s = e.single_source_shortest_paths(n, r, o);
2447
+ find_path: function(r, n, o) {
2448
+ var s = e.single_source_shortest_paths(r, n, o);
2397
2449
  return e.extract_shortest_path_from_predecessor_list(
2398
2450
  s,
2399
2451
  o
@@ -2403,22 +2455,22 @@ function tr() {
2403
2455
  * A very naive priority queue implementation.
2404
2456
  */
2405
2457
  PriorityQueue: {
2406
- make: function(n) {
2407
- var r = e.PriorityQueue, o = {}, s;
2408
- n = n || {};
2409
- for (s in r)
2410
- r.hasOwnProperty(s) && (o[s] = r[s]);
2411
- return o.queue = [], o.sorter = n.sorter || r.default_sorter, o;
2458
+ make: function(r) {
2459
+ var n = e.PriorityQueue, o = {}, s;
2460
+ r = r || {};
2461
+ for (s in n)
2462
+ n.hasOwnProperty(s) && (o[s] = n[s]);
2463
+ return o.queue = [], o.sorter = r.sorter || n.default_sorter, o;
2412
2464
  },
2413
- default_sorter: function(n, r) {
2414
- return n.cost - r.cost;
2465
+ default_sorter: function(r, n) {
2466
+ return r.cost - n.cost;
2415
2467
  },
2416
2468
  /**
2417
2469
  * Add a new item to the queue and ensure the highest priority element
2418
2470
  * is at the front of the queue.
2419
2471
  */
2420
- push: function(n, r) {
2421
- var o = { value: n, cost: r };
2472
+ push: function(r, n) {
2473
+ var o = { value: r, cost: n };
2422
2474
  this.queue.push(o), this.queue.sort(this.sorter);
2423
2475
  },
2424
2476
  /**
@@ -2435,339 +2487,339 @@ function tr() {
2435
2487
  t.exports = e;
2436
2488
  })(De)), De.exports;
2437
2489
  }
2438
- var _t;
2439
- function nr() {
2440
- return _t || (_t = 1, (function(t) {
2441
- const e = J(), n = Yn(), r = Xn(), o = Zn(), s = er(), i = Jt(), c = O(), a = tr();
2442
- function u(C) {
2443
- return unescape(encodeURIComponent(C)).length;
2490
+ var Bt;
2491
+ function ur() {
2492
+ return Bt || (Bt = 1, (function(t) {
2493
+ const e = J(), r = sr(), n = ir(), o = ar(), s = cr(), i = Gt(), c = O(), a = lr();
2494
+ function l(A) {
2495
+ return unescape(encodeURIComponent(A)).length;
2444
2496
  }
2445
- function l(C, B, k) {
2497
+ function u(A, S, k) {
2446
2498
  const E = [];
2447
- let M;
2448
- for (; (M = C.exec(k)) !== null; )
2499
+ let x;
2500
+ for (; (x = A.exec(k)) !== null; )
2449
2501
  E.push({
2450
- data: M[0],
2451
- index: M.index,
2452
- mode: B,
2453
- length: M[0].length
2502
+ data: x[0],
2503
+ index: x.index,
2504
+ mode: S,
2505
+ length: x[0].length
2454
2506
  });
2455
2507
  return E;
2456
2508
  }
2457
- function h(C) {
2458
- const B = l(i.NUMERIC, e.NUMERIC, C), k = l(i.ALPHANUMERIC, e.ALPHANUMERIC, C);
2459
- let E, M;
2460
- return c.isKanjiModeEnabled() ? (E = l(i.BYTE, e.BYTE, C), M = l(i.KANJI, e.KANJI, C)) : (E = l(i.BYTE_KANJI, e.BYTE, C), M = []), B.concat(k, E, M).sort(function(T, A) {
2461
- return T.index - A.index;
2462
- }).map(function(T) {
2509
+ function h(A) {
2510
+ const S = u(i.NUMERIC, e.NUMERIC, A), k = u(i.ALPHANUMERIC, e.ALPHANUMERIC, A);
2511
+ let E, x;
2512
+ return c.isKanjiModeEnabled() ? (E = u(i.BYTE, e.BYTE, A), x = u(i.KANJI, e.KANJI, A)) : (E = u(i.BYTE_KANJI, e.BYTE, A), x = []), S.concat(k, E, x).sort(function(C, v) {
2513
+ return C.index - v.index;
2514
+ }).map(function(C) {
2463
2515
  return {
2464
- data: T.data,
2465
- mode: T.mode,
2466
- length: T.length
2516
+ data: C.data,
2517
+ mode: C.mode,
2518
+ length: C.length
2467
2519
  };
2468
2520
  });
2469
2521
  }
2470
- function f(C, B) {
2471
- switch (B) {
2522
+ function f(A, S) {
2523
+ switch (S) {
2472
2524
  case e.NUMERIC:
2473
- return n.getBitsLength(C);
2525
+ return r.getBitsLength(A);
2474
2526
  case e.ALPHANUMERIC:
2475
- return r.getBitsLength(C);
2527
+ return n.getBitsLength(A);
2476
2528
  case e.KANJI:
2477
- return s.getBitsLength(C);
2529
+ return s.getBitsLength(A);
2478
2530
  case e.BYTE:
2479
- return o.getBitsLength(C);
2531
+ return o.getBitsLength(A);
2480
2532
  }
2481
2533
  }
2482
- function d(C) {
2483
- return C.reduce(function(B, k) {
2484
- const E = B.length - 1 >= 0 ? B[B.length - 1] : null;
2485
- return E && E.mode === k.mode ? (B[B.length - 1].data += k.data, B) : (B.push(k), B);
2534
+ function d(A) {
2535
+ return A.reduce(function(S, k) {
2536
+ const E = S.length - 1 >= 0 ? S[S.length - 1] : null;
2537
+ return E && E.mode === k.mode ? (S[S.length - 1].data += k.data, S) : (S.push(k), S);
2486
2538
  }, []);
2487
2539
  }
2488
- function w(C) {
2489
- const B = [];
2490
- for (let k = 0; k < C.length; k++) {
2491
- const E = C[k];
2540
+ function w(A) {
2541
+ const S = [];
2542
+ for (let k = 0; k < A.length; k++) {
2543
+ const E = A[k];
2492
2544
  switch (E.mode) {
2493
2545
  case e.NUMERIC:
2494
- B.push([
2546
+ S.push([
2495
2547
  E,
2496
2548
  { data: E.data, mode: e.ALPHANUMERIC, length: E.length },
2497
2549
  { data: E.data, mode: e.BYTE, length: E.length }
2498
2550
  ]);
2499
2551
  break;
2500
2552
  case e.ALPHANUMERIC:
2501
- B.push([
2553
+ S.push([
2502
2554
  E,
2503
2555
  { data: E.data, mode: e.BYTE, length: E.length }
2504
2556
  ]);
2505
2557
  break;
2506
2558
  case e.KANJI:
2507
- B.push([
2559
+ S.push([
2508
2560
  E,
2509
- { data: E.data, mode: e.BYTE, length: u(E.data) }
2561
+ { data: E.data, mode: e.BYTE, length: l(E.data) }
2510
2562
  ]);
2511
2563
  break;
2512
2564
  case e.BYTE:
2513
- B.push([
2514
- { data: E.data, mode: e.BYTE, length: u(E.data) }
2565
+ S.push([
2566
+ { data: E.data, mode: e.BYTE, length: l(E.data) }
2515
2567
  ]);
2516
2568
  }
2517
2569
  }
2518
- return B;
2570
+ return S;
2519
2571
  }
2520
- function m(C, B) {
2572
+ function p(A, S) {
2521
2573
  const k = {}, E = { start: {} };
2522
- let M = ["start"];
2523
- for (let p = 0; p < C.length; p++) {
2524
- const T = C[p], A = [];
2525
- for (let g = 0; g < T.length; g++) {
2526
- const _ = T[g], y = "" + p + g;
2527
- A.push(y), k[y] = { node: _, lastCount: 0 }, E[y] = {};
2528
- for (let v = 0; v < M.length; v++) {
2529
- const b = M[v];
2530
- k[b] && k[b].node.mode === _.mode ? (E[b][y] = f(k[b].lastCount + _.length, _.mode) - f(k[b].lastCount, _.mode), k[b].lastCount += _.length) : (k[b] && (k[b].lastCount = _.length), E[b][y] = f(_.length, _.mode) + 4 + e.getCharCountIndicator(_.mode, B));
2574
+ let x = ["start"];
2575
+ for (let m = 0; m < A.length; m++) {
2576
+ const C = A[m], v = [];
2577
+ for (let g = 0; g < C.length; g++) {
2578
+ const _ = C[g], y = "" + m + g;
2579
+ v.push(y), k[y] = { node: _, lastCount: 0 }, E[y] = {};
2580
+ for (let T = 0; T < x.length; T++) {
2581
+ const b = x[T];
2582
+ k[b] && k[b].node.mode === _.mode ? (E[b][y] = f(k[b].lastCount + _.length, _.mode) - f(k[b].lastCount, _.mode), k[b].lastCount += _.length) : (k[b] && (k[b].lastCount = _.length), E[b][y] = f(_.length, _.mode) + 4 + e.getCharCountIndicator(_.mode, S));
2531
2583
  }
2532
2584
  }
2533
- M = A;
2585
+ x = v;
2534
2586
  }
2535
- for (let p = 0; p < M.length; p++)
2536
- E[M[p]].end = 0;
2587
+ for (let m = 0; m < x.length; m++)
2588
+ E[x[m]].end = 0;
2537
2589
  return { map: E, table: k };
2538
2590
  }
2539
- function S(C, B) {
2591
+ function B(A, S) {
2540
2592
  let k;
2541
- const E = e.getBestModeForData(C);
2542
- if (k = e.from(B, E), k !== e.BYTE && k.bit < E.bit)
2543
- throw new Error('"' + C + '" cannot be encoded with mode ' + e.toString(k) + `.
2593
+ const E = e.getBestModeForData(A);
2594
+ if (k = e.from(S, E), k !== e.BYTE && k.bit < E.bit)
2595
+ throw new Error('"' + A + '" cannot be encoded with mode ' + e.toString(k) + `.
2544
2596
  Suggested mode is: ` + e.toString(E));
2545
2597
  switch (k === e.KANJI && !c.isKanjiModeEnabled() && (k = e.BYTE), k) {
2546
2598
  case e.NUMERIC:
2547
- return new n(C);
2599
+ return new r(A);
2548
2600
  case e.ALPHANUMERIC:
2549
- return new r(C);
2601
+ return new n(A);
2550
2602
  case e.KANJI:
2551
- return new s(C);
2603
+ return new s(A);
2552
2604
  case e.BYTE:
2553
- return new o(C);
2605
+ return new o(A);
2554
2606
  }
2555
2607
  }
2556
- t.fromArray = function(B) {
2557
- return B.reduce(function(k, E) {
2558
- return typeof E == "string" ? k.push(S(E, null)) : E.data && k.push(S(E.data, E.mode)), k;
2608
+ t.fromArray = function(S) {
2609
+ return S.reduce(function(k, E) {
2610
+ return typeof E == "string" ? k.push(B(E, null)) : E.data && k.push(B(E.data, E.mode)), k;
2559
2611
  }, []);
2560
- }, t.fromString = function(B, k) {
2561
- const E = h(B, c.isKanjiModeEnabled()), M = w(E), p = m(M, k), T = a.find_path(p.map, "start", "end"), A = [];
2562
- for (let g = 1; g < T.length - 1; g++)
2563
- A.push(p.table[T[g]].node);
2564
- return t.fromArray(d(A));
2565
- }, t.rawSplit = function(B) {
2612
+ }, t.fromString = function(S, k) {
2613
+ const E = h(S, c.isKanjiModeEnabled()), x = w(E), m = p(x, k), C = a.find_path(m.map, "start", "end"), v = [];
2614
+ for (let g = 1; g < C.length - 1; g++)
2615
+ v.push(m.table[C[g]].node);
2616
+ return t.fromArray(d(v));
2617
+ }, t.rawSplit = function(S) {
2566
2618
  return t.fromArray(
2567
- h(B, c.isKanjiModeEnabled())
2619
+ h(S, c.isKanjiModeEnabled())
2568
2620
  );
2569
2621
  };
2570
- })(Le)), Le;
2622
+ })($e)), $e;
2571
2623
  }
2572
- var Rt;
2573
- function rr() {
2574
- if (Rt) return be;
2575
- Rt = 1;
2576
- const t = O(), e = je(), n = Hn(), r = zn(), o = Vn(), s = jn(), i = Wn(), c = Wt(), a = Kn(), u = Gn(), l = Qn(), h = J(), f = nr();
2577
- function d(p, T) {
2578
- const A = p.size, g = s.getPositions(T);
2624
+ var Mt;
2625
+ function hr() {
2626
+ if (Mt) return be;
2627
+ Mt = 1;
2628
+ const t = O(), e = Oe(), r = Qn(), n = Gn(), o = Yn(), s = Xn(), i = Zn(), c = Kt(), a = nr(), l = rr(), u = or(), h = J(), f = ur();
2629
+ function d(m, C) {
2630
+ const v = m.size, g = s.getPositions(C);
2579
2631
  for (let _ = 0; _ < g.length; _++) {
2580
- const y = g[_][0], v = g[_][1];
2632
+ const y = g[_][0], T = g[_][1];
2581
2633
  for (let b = -1; b <= 7; b++)
2582
- if (!(y + b <= -1 || A <= y + b))
2634
+ if (!(y + b <= -1 || v <= y + b))
2583
2635
  for (let R = -1; R <= 7; R++)
2584
- v + R <= -1 || A <= v + R || (b >= 0 && b <= 6 && (R === 0 || R === 6) || R >= 0 && R <= 6 && (b === 0 || b === 6) || b >= 2 && b <= 4 && R >= 2 && R <= 4 ? p.set(y + b, v + R, !0, !0) : p.set(y + b, v + R, !1, !0));
2636
+ T + R <= -1 || v <= T + R || (b >= 0 && b <= 6 && (R === 0 || R === 6) || R >= 0 && R <= 6 && (b === 0 || b === 6) || b >= 2 && b <= 4 && R >= 2 && R <= 4 ? m.set(y + b, T + R, !0, !0) : m.set(y + b, T + R, !1, !0));
2585
2637
  }
2586
2638
  }
2587
- function w(p) {
2588
- const T = p.size;
2589
- for (let A = 8; A < T - 8; A++) {
2590
- const g = A % 2 === 0;
2591
- p.set(A, 6, g, !0), p.set(6, A, g, !0);
2639
+ function w(m) {
2640
+ const C = m.size;
2641
+ for (let v = 8; v < C - 8; v++) {
2642
+ const g = v % 2 === 0;
2643
+ m.set(v, 6, g, !0), m.set(6, v, g, !0);
2592
2644
  }
2593
2645
  }
2594
- function m(p, T) {
2595
- const A = o.getPositions(T);
2596
- for (let g = 0; g < A.length; g++) {
2597
- const _ = A[g][0], y = A[g][1];
2598
- for (let v = -2; v <= 2; v++)
2646
+ function p(m, C) {
2647
+ const v = o.getPositions(C);
2648
+ for (let g = 0; g < v.length; g++) {
2649
+ const _ = v[g][0], y = v[g][1];
2650
+ for (let T = -2; T <= 2; T++)
2599
2651
  for (let b = -2; b <= 2; b++)
2600
- v === -2 || v === 2 || b === -2 || b === 2 || v === 0 && b === 0 ? p.set(_ + v, y + b, !0, !0) : p.set(_ + v, y + b, !1, !0);
2652
+ T === -2 || T === 2 || b === -2 || b === 2 || T === 0 && b === 0 ? m.set(_ + T, y + b, !0, !0) : m.set(_ + T, y + b, !1, !0);
2601
2653
  }
2602
2654
  }
2603
- function S(p, T) {
2604
- const A = p.size, g = u.getEncodedBits(T);
2605
- let _, y, v;
2655
+ function B(m, C) {
2656
+ const v = m.size, g = l.getEncodedBits(C);
2657
+ let _, y, T;
2606
2658
  for (let b = 0; b < 18; b++)
2607
- _ = Math.floor(b / 3), y = b % 3 + A - 8 - 3, v = (g >> b & 1) === 1, p.set(_, y, v, !0), p.set(y, _, v, !0);
2659
+ _ = Math.floor(b / 3), y = b % 3 + v - 8 - 3, T = (g >> b & 1) === 1, m.set(_, y, T, !0), m.set(y, _, T, !0);
2608
2660
  }
2609
- function C(p, T, A) {
2610
- const g = p.size, _ = l.getEncodedBits(T, A);
2611
- let y, v;
2661
+ function A(m, C, v) {
2662
+ const g = m.size, _ = u.getEncodedBits(C, v);
2663
+ let y, T;
2612
2664
  for (y = 0; y < 15; y++)
2613
- v = (_ >> y & 1) === 1, y < 6 ? p.set(y, 8, v, !0) : y < 8 ? p.set(y + 1, 8, v, !0) : p.set(g - 15 + y, 8, v, !0), y < 8 ? p.set(8, g - y - 1, v, !0) : y < 9 ? p.set(8, 15 - y - 1 + 1, v, !0) : p.set(8, 15 - y - 1, v, !0);
2614
- p.set(g - 8, 8, 1, !0);
2665
+ T = (_ >> y & 1) === 1, y < 6 ? m.set(y, 8, T, !0) : y < 8 ? m.set(y + 1, 8, T, !0) : m.set(g - 15 + y, 8, T, !0), y < 8 ? m.set(8, g - y - 1, T, !0) : y < 9 ? m.set(8, 15 - y - 1 + 1, T, !0) : m.set(8, 15 - y - 1, T, !0);
2666
+ m.set(g - 8, 8, 1, !0);
2615
2667
  }
2616
- function B(p, T) {
2617
- const A = p.size;
2618
- let g = -1, _ = A - 1, y = 7, v = 0;
2619
- for (let b = A - 1; b > 0; b -= 2)
2668
+ function S(m, C) {
2669
+ const v = m.size;
2670
+ let g = -1, _ = v - 1, y = 7, T = 0;
2671
+ for (let b = v - 1; b > 0; b -= 2)
2620
2672
  for (b === 6 && b--; ; ) {
2621
2673
  for (let R = 0; R < 2; R++)
2622
- if (!p.isReserved(_, b - R)) {
2623
- let N = !1;
2624
- v < T.length && (N = (T[v] >>> y & 1) === 1), p.set(_, b - R, N), y--, y === -1 && (v++, y = 7);
2674
+ if (!m.isReserved(_, b - R)) {
2675
+ let F = !1;
2676
+ T < C.length && (F = (C[T] >>> y & 1) === 1), m.set(_, b - R, F), y--, y === -1 && (T++, y = 7);
2625
2677
  }
2626
- if (_ += g, _ < 0 || A <= _) {
2678
+ if (_ += g, _ < 0 || v <= _) {
2627
2679
  _ -= g, g = -g;
2628
2680
  break;
2629
2681
  }
2630
2682
  }
2631
2683
  }
2632
- function k(p, T, A) {
2633
- const g = new n();
2634
- A.forEach(function(R) {
2635
- g.put(R.mode.bit, 4), g.put(R.getLength(), h.getCharCountIndicator(R.mode, p)), R.write(g);
2684
+ function k(m, C, v) {
2685
+ const g = new r();
2686
+ v.forEach(function(R) {
2687
+ g.put(R.mode.bit, 4), g.put(R.getLength(), h.getCharCountIndicator(R.mode, m)), R.write(g);
2636
2688
  });
2637
- const _ = t.getSymbolTotalCodewords(p), y = c.getTotalCodewordsCount(p, T), v = (_ - y) * 8;
2638
- for (g.getLengthInBits() + 4 <= v && g.put(0, 4); g.getLengthInBits() % 8 !== 0; )
2689
+ const _ = t.getSymbolTotalCodewords(m), y = c.getTotalCodewordsCount(m, C), T = (_ - y) * 8;
2690
+ for (g.getLengthInBits() + 4 <= T && g.put(0, 4); g.getLengthInBits() % 8 !== 0; )
2639
2691
  g.putBit(0);
2640
- const b = (v - g.getLengthInBits()) / 8;
2692
+ const b = (T - g.getLengthInBits()) / 8;
2641
2693
  for (let R = 0; R < b; R++)
2642
2694
  g.put(R % 2 ? 17 : 236, 8);
2643
- return E(g, p, T);
2695
+ return E(g, m, C);
2644
2696
  }
2645
- function E(p, T, A) {
2646
- const g = t.getSymbolTotalCodewords(T), _ = c.getTotalCodewordsCount(T, A), y = g - _, v = c.getBlocksCount(T, A), b = g % v, R = v - b, N = Math.floor(g / v), X = Math.floor(y / v), Yt = X + 1, We = N - X, Xt = new a(We);
2697
+ function E(m, C, v) {
2698
+ const g = t.getSymbolTotalCodewords(C), _ = c.getTotalCodewordsCount(C, v), y = g - _, T = c.getBlocksCount(C, v), b = g % T, R = T - b, F = Math.floor(g / T), Z = Math.floor(y / T), en = Z + 1, Je = F - Z, tn = new a(Je);
2647
2699
  let he = 0;
2648
- const ie = new Array(v), Oe = new Array(v);
2700
+ const ae = new Array(T), Ke = new Array(T);
2649
2701
  let de = 0;
2650
- const Zt = new Uint8Array(p.buffer);
2651
- for (let K = 0; K < v; K++) {
2652
- const ge = K < R ? X : Yt;
2653
- ie[K] = Zt.slice(he, he + ge), Oe[K] = Xt.encode(ie[K]), he += ge, de = Math.max(de, ge);
2702
+ const nn = new Uint8Array(m.buffer);
2703
+ for (let K = 0; K < T; K++) {
2704
+ const ge = K < R ? Z : en;
2705
+ ae[K] = nn.slice(he, he + ge), Ke[K] = tn.encode(ae[K]), he += ge, de = Math.max(de, ge);
2654
2706
  }
2655
2707
  const fe = new Uint8Array(g);
2656
- let Je = 0, $, q;
2657
- for ($ = 0; $ < de; $++)
2658
- for (q = 0; q < v; q++)
2659
- $ < ie[q].length && (fe[Je++] = ie[q][$]);
2660
- for ($ = 0; $ < We; $++)
2661
- for (q = 0; q < v; q++)
2662
- fe[Je++] = Oe[q][$];
2708
+ let Qe = 0, q, D;
2709
+ for (q = 0; q < de; q++)
2710
+ for (D = 0; D < T; D++)
2711
+ q < ae[D].length && (fe[Qe++] = ae[D][q]);
2712
+ for (q = 0; q < Je; q++)
2713
+ for (D = 0; D < T; D++)
2714
+ fe[Qe++] = Ke[D][q];
2663
2715
  return fe;
2664
2716
  }
2665
- function M(p, T, A, g) {
2717
+ function x(m, C, v, g) {
2666
2718
  let _;
2667
- if (Array.isArray(p))
2668
- _ = f.fromArray(p);
2669
- else if (typeof p == "string") {
2670
- let N = T;
2671
- if (!N) {
2672
- const X = f.rawSplit(p);
2673
- N = u.getBestVersionForData(X, A);
2719
+ if (Array.isArray(m))
2720
+ _ = f.fromArray(m);
2721
+ else if (typeof m == "string") {
2722
+ let F = C;
2723
+ if (!F) {
2724
+ const Z = f.rawSplit(m);
2725
+ F = l.getBestVersionForData(Z, v);
2674
2726
  }
2675
- _ = f.fromString(p, N || 40);
2727
+ _ = f.fromString(m, F || 40);
2676
2728
  } else
2677
2729
  throw new Error("Invalid data");
2678
- const y = u.getBestVersionForData(_, A);
2730
+ const y = l.getBestVersionForData(_, v);
2679
2731
  if (!y)
2680
2732
  throw new Error("The amount of data is too big to be stored in a QR Code");
2681
- if (!T)
2682
- T = y;
2683
- else if (T < y)
2733
+ if (!C)
2734
+ C = y;
2735
+ else if (C < y)
2684
2736
  throw new Error(
2685
2737
  `
2686
2738
  The chosen QR Code version cannot contain this amount of data.
2687
2739
  Minimum version required to store current data is: ` + y + `.
2688
2740
  `
2689
2741
  );
2690
- const v = k(T, A, _), b = t.getSymbolSize(T), R = new r(b);
2691
- return d(R, T), w(R), m(R, T), C(R, A, 0), T >= 7 && S(R, T), B(R, v), isNaN(g) && (g = i.getBestMask(
2742
+ const T = k(C, v, _), b = t.getSymbolSize(C), R = new n(b);
2743
+ return d(R, C), w(R), p(R, C), A(R, v, 0), C >= 7 && B(R, C), S(R, T), isNaN(g) && (g = i.getBestMask(
2692
2744
  R,
2693
- C.bind(null, R, A)
2694
- )), i.applyMask(g, R), C(R, A, g), {
2745
+ A.bind(null, R, v)
2746
+ )), i.applyMask(g, R), A(R, v, g), {
2695
2747
  modules: R,
2696
- version: T,
2697
- errorCorrectionLevel: A,
2748
+ version: C,
2749
+ errorCorrectionLevel: v,
2698
2750
  maskPattern: g,
2699
2751
  segments: _
2700
2752
  };
2701
2753
  }
2702
- return be.create = function(T, A) {
2703
- if (typeof T > "u" || T === "")
2754
+ return be.create = function(C, v) {
2755
+ if (typeof C > "u" || C === "")
2704
2756
  throw new Error("No input text");
2705
2757
  let g = e.M, _, y;
2706
- return typeof A < "u" && (g = e.from(A.errorCorrectionLevel, e.M), _ = u.from(A.version), y = i.from(A.maskPattern), A.toSJISFunc && t.setToSJISFunction(A.toSJISFunc)), M(T, _, g, y);
2758
+ return typeof v < "u" && (g = e.from(v.errorCorrectionLevel, e.M), _ = l.from(v.version), y = i.from(v.maskPattern), v.toSJISFunc && t.setToSJISFunction(v.toSJISFunc)), x(C, _, g, y);
2707
2759
  }, be;
2708
2760
  }
2709
- var Ne = {}, Ue = {}, Bt;
2710
- function Kt() {
2711
- return Bt || (Bt = 1, (function(t) {
2712
- function e(n) {
2713
- if (typeof n == "number" && (n = n.toString()), typeof n != "string")
2761
+ var Ne = {}, Ue = {}, xt;
2762
+ function Yt() {
2763
+ return xt || (xt = 1, (function(t) {
2764
+ function e(r) {
2765
+ if (typeof r == "number" && (r = r.toString()), typeof r != "string")
2714
2766
  throw new Error("Color should be defined as hex string");
2715
- let r = n.slice().replace("#", "").split("");
2716
- if (r.length < 3 || r.length === 5 || r.length > 8)
2717
- throw new Error("Invalid hex color: " + n);
2718
- (r.length === 3 || r.length === 4) && (r = Array.prototype.concat.apply([], r.map(function(s) {
2767
+ let n = r.slice().replace("#", "").split("");
2768
+ if (n.length < 3 || n.length === 5 || n.length > 8)
2769
+ throw new Error("Invalid hex color: " + r);
2770
+ (n.length === 3 || n.length === 4) && (n = Array.prototype.concat.apply([], n.map(function(s) {
2719
2771
  return [s, s];
2720
- }))), r.length === 6 && r.push("F", "F");
2721
- const o = parseInt(r.join(""), 16);
2772
+ }))), n.length === 6 && n.push("F", "F");
2773
+ const o = parseInt(n.join(""), 16);
2722
2774
  return {
2723
2775
  r: o >> 24 & 255,
2724
2776
  g: o >> 16 & 255,
2725
2777
  b: o >> 8 & 255,
2726
2778
  a: o & 255,
2727
- hex: "#" + r.slice(0, 6).join("")
2779
+ hex: "#" + n.slice(0, 6).join("")
2728
2780
  };
2729
2781
  }
2730
- t.getOptions = function(r) {
2731
- r || (r = {}), r.color || (r.color = {});
2732
- const o = typeof r.margin > "u" || r.margin === null || r.margin < 0 ? 4 : r.margin, s = r.width && r.width >= 21 ? r.width : void 0, i = r.scale || 4;
2782
+ t.getOptions = function(n) {
2783
+ n || (n = {}), n.color || (n.color = {});
2784
+ const o = typeof n.margin > "u" || n.margin === null || n.margin < 0 ? 4 : n.margin, s = n.width && n.width >= 21 ? n.width : void 0, i = n.scale || 4;
2733
2785
  return {
2734
2786
  width: s,
2735
2787
  scale: s ? 4 : i,
2736
2788
  margin: o,
2737
2789
  color: {
2738
- dark: e(r.color.dark || "#000000ff"),
2739
- light: e(r.color.light || "#ffffffff")
2790
+ dark: e(n.color.dark || "#000000ff"),
2791
+ light: e(n.color.light || "#ffffffff")
2740
2792
  },
2741
- type: r.type,
2742
- rendererOpts: r.rendererOpts || {}
2793
+ type: n.type,
2794
+ rendererOpts: n.rendererOpts || {}
2743
2795
  };
2744
- }, t.getScale = function(r, o) {
2745
- return o.width && o.width >= r + o.margin * 2 ? o.width / (r + o.margin * 2) : o.scale;
2746
- }, t.getImageWidth = function(r, o) {
2747
- const s = t.getScale(r, o);
2748
- return Math.floor((r + o.margin * 2) * s);
2749
- }, t.qrToImageData = function(r, o, s) {
2750
- const i = o.modules.size, c = o.modules.data, a = t.getScale(i, s), u = Math.floor((i + s.margin * 2) * a), l = s.margin * a, h = [s.color.light, s.color.dark];
2751
- for (let f = 0; f < u; f++)
2752
- for (let d = 0; d < u; d++) {
2753
- let w = (f * u + d) * 4, m = s.color.light;
2754
- if (f >= l && d >= l && f < u - l && d < u - l) {
2755
- const S = Math.floor((f - l) / a), C = Math.floor((d - l) / a);
2756
- m = h[c[S * i + C] ? 1 : 0];
2796
+ }, t.getScale = function(n, o) {
2797
+ return o.width && o.width >= n + o.margin * 2 ? o.width / (n + o.margin * 2) : o.scale;
2798
+ }, t.getImageWidth = function(n, o) {
2799
+ const s = t.getScale(n, o);
2800
+ return Math.floor((n + o.margin * 2) * s);
2801
+ }, t.qrToImageData = function(n, o, s) {
2802
+ const i = o.modules.size, c = o.modules.data, a = t.getScale(i, s), l = Math.floor((i + s.margin * 2) * a), u = s.margin * a, h = [s.color.light, s.color.dark];
2803
+ for (let f = 0; f < l; f++)
2804
+ for (let d = 0; d < l; d++) {
2805
+ let w = (f * l + d) * 4, p = s.color.light;
2806
+ if (f >= u && d >= u && f < l - u && d < l - u) {
2807
+ const B = Math.floor((f - u) / a), A = Math.floor((d - u) / a);
2808
+ p = h[c[B * i + A] ? 1 : 0];
2757
2809
  }
2758
- r[w++] = m.r, r[w++] = m.g, r[w++] = m.b, r[w] = m.a;
2810
+ n[w++] = p.r, n[w++] = p.g, n[w++] = p.b, n[w] = p.a;
2759
2811
  }
2760
2812
  };
2761
2813
  })(Ue)), Ue;
2762
2814
  }
2763
- var St;
2764
- function or() {
2765
- return St || (St = 1, (function(t) {
2766
- const e = Kt();
2767
- function n(o, s, i) {
2815
+ var $t;
2816
+ function dr() {
2817
+ return $t || ($t = 1, (function(t) {
2818
+ const e = Yt();
2819
+ function r(o, s, i) {
2768
2820
  o.clearRect(0, 0, s.width, s.height), s.style || (s.style = {}), s.height = i, s.width = i, s.style.height = i + "px", s.style.width = i + "px";
2769
2821
  }
2770
- function r() {
2822
+ function n() {
2771
2823
  try {
2772
2824
  return document.createElement("canvas");
2773
2825
  } catch {
@@ -2775,122 +2827,128 @@ function or() {
2775
2827
  }
2776
2828
  }
2777
2829
  t.render = function(s, i, c) {
2778
- let a = c, u = i;
2779
- typeof a > "u" && (!i || !i.getContext) && (a = i, i = void 0), i || (u = r()), a = e.getOptions(a);
2780
- const l = e.getImageWidth(s.modules.size, a), h = u.getContext("2d"), f = h.createImageData(l, l);
2781
- return e.qrToImageData(f.data, s, a), n(h, u, l), h.putImageData(f, 0, 0), u;
2830
+ let a = c, l = i;
2831
+ typeof a > "u" && (!i || !i.getContext) && (a = i, i = void 0), i || (l = n()), a = e.getOptions(a);
2832
+ const u = e.getImageWidth(s.modules.size, a), h = l.getContext("2d"), f = h.createImageData(u, u);
2833
+ return e.qrToImageData(f.data, s, a), r(h, l, u), h.putImageData(f, 0, 0), l;
2782
2834
  }, t.renderToDataURL = function(s, i, c) {
2783
2835
  let a = c;
2784
2836
  typeof a > "u" && (!i || !i.getContext) && (a = i, i = void 0), a || (a = {});
2785
- const u = t.render(s, i, a), l = a.type || "image/png", h = a.rendererOpts || {};
2786
- return u.toDataURL(l, h.quality);
2837
+ const l = t.render(s, i, a), u = a.type || "image/png", h = a.rendererOpts || {};
2838
+ return l.toDataURL(u, h.quality);
2787
2839
  };
2788
2840
  })(Ne)), Ne;
2789
2841
  }
2790
- var Fe = {}, Mt;
2791
- function sr() {
2792
- if (Mt) return Fe;
2793
- Mt = 1;
2794
- const t = Kt();
2842
+ var Fe = {}, Lt;
2843
+ function fr() {
2844
+ if (Lt) return Fe;
2845
+ Lt = 1;
2846
+ const t = Yt();
2795
2847
  function e(o, s) {
2796
2848
  const i = o.a / 255, c = s + '="' + o.hex + '"';
2797
2849
  return i < 1 ? c + " " + s + '-opacity="' + i.toFixed(2).slice(1) + '"' : c;
2798
2850
  }
2799
- function n(o, s, i) {
2851
+ function r(o, s, i) {
2800
2852
  let c = o + s;
2801
2853
  return typeof i < "u" && (c += " " + i), c;
2802
2854
  }
2803
- function r(o, s, i) {
2804
- let c = "", a = 0, u = !1, l = 0;
2855
+ function n(o, s, i) {
2856
+ let c = "", a = 0, l = !1, u = 0;
2805
2857
  for (let h = 0; h < o.length; h++) {
2806
2858
  const f = Math.floor(h % s), d = Math.floor(h / s);
2807
- !f && !u && (u = !0), o[h] ? (l++, h > 0 && f > 0 && o[h - 1] || (c += u ? n("M", f + i, 0.5 + d + i) : n("m", a, 0), a = 0, u = !1), f + 1 < s && o[h + 1] || (c += n("h", l), l = 0)) : a++;
2859
+ !f && !l && (l = !0), o[h] ? (u++, h > 0 && f > 0 && o[h - 1] || (c += l ? r("M", f + i, 0.5 + d + i) : r("m", a, 0), a = 0, l = !1), f + 1 < s && o[h + 1] || (c += r("h", u), u = 0)) : a++;
2808
2860
  }
2809
2861
  return c;
2810
2862
  }
2811
2863
  return Fe.render = function(s, i, c) {
2812
- const a = t.getOptions(i), u = s.modules.size, l = s.modules.data, h = u + a.margin * 2, f = a.color.light.a ? "<path " + e(a.color.light, "fill") + ' d="M0 0h' + h + "v" + h + 'H0z"/>' : "", d = "<path " + e(a.color.dark, "stroke") + ' d="' + r(l, u, a.margin) + '"/>', w = 'viewBox="0 0 ' + h + " " + h + '"', S = '<svg xmlns="http://www.w3.org/2000/svg" ' + (a.width ? 'width="' + a.width + '" height="' + a.width + '" ' : "") + w + ' shape-rendering="crispEdges">' + f + d + `</svg>
2864
+ const a = t.getOptions(i), l = s.modules.size, u = s.modules.data, h = l + a.margin * 2, f = a.color.light.a ? "<path " + e(a.color.light, "fill") + ' d="M0 0h' + h + "v" + h + 'H0z"/>' : "", d = "<path " + e(a.color.dark, "stroke") + ' d="' + n(u, l, a.margin) + '"/>', w = 'viewBox="0 0 ' + h + " " + h + '"', B = '<svg xmlns="http://www.w3.org/2000/svg" ' + (a.width ? 'width="' + a.width + '" height="' + a.width + '" ' : "") + w + ' shape-rendering="crispEdges">' + f + d + `</svg>
2813
2865
  `;
2814
- return typeof c == "function" && c(null, S), S;
2866
+ return typeof c == "function" && c(null, B), B;
2815
2867
  }, Fe;
2816
2868
  }
2817
2869
  var It;
2818
- function ir() {
2819
- if (It) return G;
2870
+ function gr() {
2871
+ if (It) return Q;
2820
2872
  It = 1;
2821
- const t = Fn(), e = rr(), n = or(), r = sr();
2822
- function o(s, i, c, a, u) {
2823
- const l = [].slice.call(arguments, 1), h = l.length, f = typeof l[h - 1] == "function";
2873
+ const t = Kn(), e = hr(), r = dr(), n = fr();
2874
+ function o(s, i, c, a, l) {
2875
+ const u = [].slice.call(arguments, 1), h = u.length, f = typeof u[h - 1] == "function";
2824
2876
  if (!f && !t())
2825
2877
  throw new Error("Callback required as last argument");
2826
2878
  if (f) {
2827
2879
  if (h < 2)
2828
2880
  throw new Error("Too few arguments provided");
2829
- h === 2 ? (u = c, c = i, i = a = void 0) : h === 3 && (i.getContext && typeof u > "u" ? (u = a, a = void 0) : (u = a, a = c, c = i, i = void 0));
2881
+ h === 2 ? (l = c, c = i, i = a = void 0) : h === 3 && (i.getContext && typeof l > "u" ? (l = a, a = void 0) : (l = a, a = c, c = i, i = void 0));
2830
2882
  } else {
2831
2883
  if (h < 1)
2832
2884
  throw new Error("Too few arguments provided");
2833
2885
  return h === 1 ? (c = i, i = a = void 0) : h === 2 && !i.getContext && (a = c, c = i, i = void 0), new Promise(function(d, w) {
2834
2886
  try {
2835
- const m = e.create(c, a);
2836
- d(s(m, i, a));
2837
- } catch (m) {
2838
- w(m);
2887
+ const p = e.create(c, a);
2888
+ d(s(p, i, a));
2889
+ } catch (p) {
2890
+ w(p);
2839
2891
  }
2840
2892
  });
2841
2893
  }
2842
2894
  try {
2843
2895
  const d = e.create(c, a);
2844
- u(null, s(d, i, a));
2896
+ l(null, s(d, i, a));
2845
2897
  } catch (d) {
2846
- u(d);
2898
+ l(d);
2847
2899
  }
2848
2900
  }
2849
- return G.create = e.create, G.toCanvas = o.bind(null, n.render), G.toDataURL = o.bind(null, n.renderToDataURL), G.toString = o.bind(null, function(s, i, c) {
2850
- return r.render(s, c);
2851
- }), G;
2901
+ return Q.create = e.create, Q.toCanvas = o.bind(null, r.render), Q.toDataURL = o.bind(null, r.renderToDataURL), Q.toString = o.bind(null, function(s, i, c) {
2902
+ return n.render(s, c);
2903
+ }), Q;
2852
2904
  }
2853
- var ar = ir();
2854
- const cr = /* @__PURE__ */ Un(ar), ur = (t) => {
2905
+ var pr = gr();
2906
+ const mr = /* @__PURE__ */ Jn(pr), wr = (t) => {
2855
2907
  var e = {
2856
2908
  errorCorrectionLevel: "H",
2857
2909
  type: "image/jpeg",
2858
2910
  margin: 1,
2859
2911
  width: 300
2860
2912
  };
2861
- let n = null;
2862
- const r = async (a) => {
2863
- const u = new URL(window.location.href), l = new URL(u.pathname, u.origin);
2864
- l.searchParams.set("state", "1-" + a), console.log("生成登录二维码链接:", l.toString());
2913
+ let r = null;
2914
+ const n = async (a) => {
2915
+ const l = new URL(window.location.href), u = new URL(l.pathname, l.origin);
2916
+ u.searchParams.set("state", "1-" + a), console.log("生成登录二维码链接:", u.toString());
2865
2917
  var h = t || document.getElementById("qrcode");
2866
- await cr.toDataURL(h, l.toString(), e);
2918
+ await mr.toDataURL(h, u.toString(), e);
2867
2919
  }, o = async (a) => {
2868
- const u = await fetch(`/api/router?path=wx&key=checkLogin&state=${a}`).then((l) => l.json());
2869
- if (u.code === 200) {
2870
- console.log(u);
2871
- const l = u.data;
2872
- l && (localStorage.setItem("token", l.accessToken), await V.setLoginToken(l)), c(), setTimeout(() => {
2873
- ue();
2920
+ const l = await fetch(`/api/router?path=wx&key=checkLogin&state=${a}`).then((u) => u.json());
2921
+ if (l.code === 200) {
2922
+ console.log(l);
2923
+ const u = l.data;
2924
+ u && (localStorage.setItem("token", u.accessToken), await N.setLoginToken(u)), c(), setTimeout(() => {
2925
+ se();
2874
2926
  }, 1e3);
2875
2927
  } else
2876
- n = setTimeout(() => {
2928
+ r = setTimeout(() => {
2877
2929
  o(a), console.log("继续检测登录状态");
2878
2930
  }, 2e3);
2879
2931
  }, s = Math.random().toString(36).substring(2, 15);
2880
- r(s), o(s);
2932
+ n(s), o(s);
2881
2933
  const i = setInterval(() => {
2882
2934
  const a = Math.random().toString(36).substring(2, 15);
2883
- clearTimeout(n), r(a), o(a), console.log("更新二维码");
2935
+ clearTimeout(r), n(a), o(a), console.log("更新二维码");
2884
2936
  }, 9e4), c = () => {
2885
- clearTimeout(n), clearInterval(i), console.log("停止检测登录状态");
2937
+ clearTimeout(r), clearInterval(i), console.log("停止检测登录状态");
2886
2938
  };
2887
- return { createQrcode: r, clear: c };
2888
- }, Gt = "wxff97d569b1db16b6", lr = [
2889
- { id: "password", name: "密码登录", icon: "🔒" },
2890
- { id: "wechat", name: "微信登录", icon: "💬", appid: "wx9378885c8390e09b" },
2891
- { id: "wechat-mp", name: "微信公众号登录", icon: "💬", appid: Gt },
2892
- { id: "phone", name: "手机号登录", icon: "📱" }
2893
- ], Qt = () => {
2939
+ return { createQrcode: n, clear: c };
2940
+ }, Xt = "wxff97d569b1db16b6", yr = '<svg t="1764510467010" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1958" width="32" height="32"><path d="M615.904 388.48c8.8 0 17.536 0.64 26.176 1.6-23.52-109.536-140.608-190.912-274.272-190.912C218.4 199.2 96 301.056 96 430.4c0 74.656 40.736 135.936 108.768 183.488l-27.2 81.792 95.04-47.648c33.984 6.72 61.28 13.632 95.2 13.632 8.544 0 16.992-0.416 25.376-1.088a202.496 202.496 0 0 1-8.384-56.96c0-118.752 101.984-215.136 231.104-215.136zM469.76 314.784c20.48 0 34.016 13.472 34.016 33.92 0 20.352-13.536 34.016-34.016 34.016-20.384 0-40.832-13.664-40.832-34.016 0-20.448 20.448-33.92 40.832-33.92zM279.52 382.72c-20.384 0-40.928-13.664-40.928-34.016 0-20.448 20.544-33.92 40.928-33.92 20.352 0 33.92 13.472 33.92 33.92 0 20.384-13.568 34.016-33.92 34.016z" fill="" p-id="1959"></path><path d="M864 600.352c0-108.672-108.736-197.28-230.88-197.28-129.344 0-231.2 88.576-231.2 197.28 0 108.864 101.856 197.248 231.2 197.248 27.072 0 54.368-6.816 81.568-13.632l74.56 40.8-20.448-67.904C823.328 715.936 864 661.664 864 600.352z m-305.856-34.016c-13.536 0-27.2-13.44-27.2-27.2 0-13.568 13.664-27.2 27.2-27.2 20.576 0 34.016 13.632 34.016 27.2 0 13.76-13.44 27.2-34.016 27.2z m149.536 0c-13.44 0-27.008-13.44-27.008-27.2 0-13.568 13.568-27.2 27.008-27.2 20.352 0 34.016 13.632 34.016 27.2 0 13.76-13.664 27.2-34.016 27.2z" fill="" p-id="1960"></path></svg>', br = '<svg t="1764511395617" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3882" width="32" height="32"><path d="M256 259.584c-29.184 0-51.2 14.848-51.2 44.032s29.184 44.032 51.2 44.032c29.184 0 44.032-14.848 44.032-44.032s-22.016-44.032-44.032-44.032zM541.184 303.616c0-29.184-14.848-44.032-44.032-44.032-29.184 0-51.2 14.848-51.2 44.032s29.184 44.032 51.2 44.032c29.696 0 44.032-22.016 44.032-44.032zM614.4 508.416c-14.848 0-36.352 14.848-36.352 36.352 0 14.848 14.848 36.352 36.352 36.352 29.184 0 44.032-14.848 44.032-36.352 0-14.336-14.848-36.352-44.032-36.352z" p-id="3883"></path><path d="M1024 625.152c0-138.752-124.416-256-285.184-270.848-29.184-153.6-189.952-263.168-373.248-263.168C160.768 91.648 0 230.4 0 406.016c0 95.232 44.032 175.616 138.752 241.152L109.568 742.4c0 7.168 0 14.848 7.168 22.016h14.848l117.248-58.368h14.848c36.352 7.168 66.048 14.848 109.568 14.848 14.848 0 44.032-7.168 44.032-7.168C460.8 822.784 578.048 896 716.8 896c36.352 0 73.216-7.168 102.4-14.848l87.552 51.2h14.848c7.168-7.168 7.168-7.168 7.168-14.848l-22.016-87.552c80.896-58.368 117.248-131.584 117.248-204.8z m-621.568 51.2h-36.352c-36.352 0-66.048-7.168-95.232-14.848l-22.016-7.168h-7.168L153.6 698.368l22.016-66.048c0-7.168 0-14.848-7.168-14.848C80.384 559.616 36.352 486.4 36.352 398.848 36.352 245.248 182.784 128 358.4 128c160.768 0 300.032 95.232 329.216 226.816-168.448 0-300.032 117.248-300.032 263.168 7.168 22.016 14.848 44.032 14.848 58.368z m467.968 132.096c-7.168 7.168-7.168 7.168-7.168 14.848l14.848 51.2L819.2 844.8h-14.848c-29.184 7.168-66.048 14.848-95.232 14.848-146.432 0-270.848-102.4-270.848-226.816 0-131.584 124.416-233.984 270.848-233.984s270.848 102.4 270.848 226.816c0 65.536-36.352 123.904-109.568 182.784z" p-id="3884"></path><path d="M804.352 508.416c-14.848 0-36.352 14.848-36.352 36.352 0 14.848 14.848 36.352 36.352 36.352 29.184 0 44.032-14.848 44.032-36.352 0-14.336-14.336-36.352-44.032-36.352z" p-id="3885"></path></svg>', vr = '<svg t="1764511425462" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5097" width="32" height="32"><path d="M820.409449 797.228346q0 25.19685-10.07874 46.866142t-27.716535 38.299213-41.322835 26.204724-50.897638 9.574803l-357.795276 0q-27.212598 0-50.897638-9.574803t-41.322835-26.204724-27.716535-38.299213-10.07874-46.866142l0-675.275591q0-25.19685 10.07874-47.370079t27.716535-38.80315 41.322835-26.204724 50.897638-9.574803l357.795276 0q27.212598 0 50.897638 9.574803t41.322835 26.204724 27.716535 38.80315 10.07874 47.370079l0 675.275591zM738.771654 170.330709l-455.559055 0 0 577.511811 455.559055 0 0-577.511811zM510.992126 776.062992q-21.165354 0-36.787402 15.11811t-15.622047 37.291339q0 21.165354 15.622047 36.787402t36.787402 15.622047q22.173228 0 37.291339-15.622047t15.11811-36.787402q0-22.173228-15.11811-37.291339t-37.291339-15.11811zM591.622047 84.661417q0-8.062992-5.03937-12.598425t-11.086614-4.535433l-128 0q-5.03937 0-10.582677 4.535433t-5.543307 12.598425 5.03937 12.598425 11.086614 4.535433l128 0q6.047244 0 11.086614-4.535433t5.03937-12.598425z" p-id="5098"></path></svg>', Ar = '<svg t="1764511500570" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10511" width="32" height="32"><path d="M768.9216 422.72768 372.06016 422.72768C378.88 365.21984 329.37984 131.42016 512.2048 125.72672c173.83424-6.59456 146.78016 213.34016 146.78016 213.34016l85.13536 0.57344c0 0 24.73984-294.4-231.91552-295.8336C232.09984 58.01984 297.82016 377.18016 289.28 422.72768c1.98656 0 4.56704 0 7.29088 0-55.88992 0-101.21216 45.34272-101.21216 101.21216l0 337.38752c0 55.88992 45.34272 101.21216 101.21216 101.21216l472.35072 0c55.88992 0 101.21216-45.34272 101.21216-101.21216L870.13376 523.93984C870.13376 468.0704 824.79104 422.72768 768.9216 422.72768zM566.4768 717.02528l0 76.84096c0 18.57536-15.1552 33.73056-33.73056 33.73056-18.57536 0-33.73056-15.1552-33.73056-33.73056l0-76.84096c-20.09088-11.69408-33.73056-33.21856-33.73056-58.12224 0-37.2736 30.208-67.4816 67.4816-67.4816 37.2736 0 67.4816 30.208 67.4816 67.4816C600.22784 683.80672 586.58816 705.3312 566.4768 717.02528z" fill="#272636" p-id="10512"></path></svg>', ze = {
2941
+ pwd: Ar,
2942
+ phone: vr,
2943
+ wxmpSvg: yr,
2944
+ wxOpenSvg: br
2945
+ }, Cr = [
2946
+ { id: "password", name: "密码登录", icon: "pwd" },
2947
+ { id: "wechat", name: "微信登录", icon: "wxmpSvg", appid: "wx9378885c8390e09b" },
2948
+ { id: "wechat-mp", name: "微信公众号", icon: "wxOpenSvg", appid: Xt },
2949
+ { id: "wechat-mp-ticket", name: "微信公众号", icon: "wxOpenSvg" },
2950
+ { id: "phone", name: "手机号登录", icon: "phone" }
2951
+ ], Zt = () => {
2894
2952
  const t = window.location.hostname;
2895
2953
  let e = [];
2896
2954
  switch (t) {
@@ -2898,18 +2956,18 @@ const cr = /* @__PURE__ */ Un(ar), ur = (t) => {
2898
2956
  e = ["password", "wechat-mp"];
2899
2957
  break;
2900
2958
  case "kevisual.cn":
2901
- e = ["password", "wechat"];
2959
+ e = ["password", "wechat", "wechat-mp-ticket"];
2902
2960
  break;
2903
2961
  default:
2904
- e = ["password", "phone", "wechat", "wechat-mp"];
2962
+ e = ["password", "phone", "wechat", "wechat-mp", "wechat-mp-ticket"];
2905
2963
  break;
2906
2964
  }
2907
- return lr.filter((n) => e.includes(n.id));
2965
+ return Cr.filter((r) => e.includes(r.id));
2908
2966
  };
2909
- console.log("可用登录方式:", Qt().map((t) => t.name).join(", "));
2910
- class hr extends HTMLElement {
2967
+ console.log("可用登录方式:", Zt().map((t) => t.name).join(", "));
2968
+ class Tr extends HTMLElement {
2911
2969
  selectedMethod = "password";
2912
- loginMethods = Qt();
2970
+ loginMethods = Zt();
2913
2971
  setLoginMethods(e) {
2914
2972
  this.loginMethods = e, this.render();
2915
2973
  }
@@ -2917,30 +2975,30 @@ class hr extends HTMLElement {
2917
2975
  super();
2918
2976
  }
2919
2977
  connectedCallback() {
2920
- this.attachShadow({ mode: "open" }), this.render(), this.bindEvents(), Pn();
2978
+ this.attachShadow({ mode: "open" }), this.render(), this.bindEvents(), Fn();
2921
2979
  }
2922
2980
  #e = null;
2923
2981
  selectLoginMethod(e) {
2924
2982
  this.selectedMethod = e, this.render(), this.#e && (this.#e(), this.#e = null);
2925
2983
  }
2926
2984
  getMethodData(e) {
2927
- return this.loginMethods.find((n) => n.id === e);
2985
+ return this.loginMethods.find((r) => r.id === e);
2928
2986
  }
2929
2987
  bindEvents() {
2930
2988
  this.shadowRoot && (this.shadowRoot.addEventListener("click", (e) => {
2931
- const r = e.target.closest(".login-method");
2932
- if (r) {
2933
- const o = r.getAttribute("data-method");
2989
+ const n = e.target.closest(".login-method");
2990
+ if (n) {
2991
+ const o = n.getAttribute("data-method");
2934
2992
  o && this.selectLoginMethod(o);
2935
2993
  }
2936
2994
  }), this.shadowRoot.addEventListener("submit", (e) => {
2937
- const n = e.target;
2938
- n && n.id === "loginForm" && (e.preventDefault(), this.handleLogin());
2995
+ const r = e.target;
2996
+ r && r.id === "loginForm" && (e.preventDefault(), this.handleLogin());
2939
2997
  }));
2940
2998
  }
2941
2999
  handleLogin() {
2942
3000
  const e = this.getFormData();
2943
- Bn({
3001
+ In({
2944
3002
  loginMethod: this.selectedMethod,
2945
3003
  data: e
2946
3004
  }), this.dispatchEvent(new CustomEvent("login", {
@@ -2955,15 +3013,15 @@ class hr extends HTMLElement {
2955
3013
  if (!this.shadowRoot) return {};
2956
3014
  switch (this.selectedMethod) {
2957
3015
  case "password":
2958
- const e = this.shadowRoot.querySelector("#username"), n = this.shadowRoot.querySelector("#password");
3016
+ const e = this.shadowRoot.querySelector("#username"), r = this.shadowRoot.querySelector("#password");
2959
3017
  return {
2960
3018
  username: e?.value || "",
2961
- password: n?.value || ""
3019
+ password: r?.value || ""
2962
3020
  };
2963
3021
  case "phone":
2964
- const r = this.shadowRoot.querySelector("#phone"), o = this.shadowRoot.querySelector("#code");
3022
+ const n = this.shadowRoot.querySelector("#phone"), o = this.shadowRoot.querySelector("#code");
2965
3023
  return {
2966
- phone: r?.value || "",
3024
+ phone: n?.value || "",
2967
3025
  code: o?.value || ""
2968
3026
  };
2969
3027
  case "wechat":
@@ -2979,7 +3037,7 @@ class hr extends HTMLElement {
2979
3037
  }
2980
3038
  }
2981
3039
  renderPasswordForm() {
2982
- return D`
3040
+ return L`
2983
3041
  <form id="loginForm" class="login-form">
2984
3042
  <div class="form-group">
2985
3043
  <input
@@ -3006,7 +3064,7 @@ class hr extends HTMLElement {
3006
3064
  `;
3007
3065
  }
3008
3066
  renderPhoneForm() {
3009
- return D`
3067
+ return L`
3010
3068
  <form id="loginForm" class="login-form">
3011
3069
  <div class="form-group">
3012
3070
  <input
@@ -3035,7 +3093,7 @@ class hr extends HTMLElement {
3035
3093
  `;
3036
3094
  }
3037
3095
  renderWechatForm() {
3038
- return D`
3096
+ return L`
3039
3097
  <div class="wechat-login">
3040
3098
  <slot></slot>
3041
3099
  </div>
@@ -3044,9 +3102,9 @@ class hr extends HTMLElement {
3044
3102
  renderWechatMpForm() {
3045
3103
  const e = this;
3046
3104
  return setTimeout(() => {
3047
- const n = e.shadowRoot.querySelector("#qrcode"), { clear: r } = ur(n);
3048
- e.#e = r;
3049
- }, 0), D`
3105
+ const r = e.shadowRoot.querySelector("#qrcode"), { clear: n } = wr(r);
3106
+ e.#e = n;
3107
+ }, 0), L`
3050
3108
  <div class="wechat-login">
3051
3109
  <div class="qr-container">
3052
3110
  <div class="qr-placeholder">
@@ -3057,6 +3115,28 @@ class hr extends HTMLElement {
3057
3115
  </div>
3058
3116
  `;
3059
3117
  }
3118
+ renderWechatMpTicketForm() {
3119
+ const e = this;
3120
+ return setTimeout(async () => {
3121
+ const r = await Vn();
3122
+ if (!r) return;
3123
+ const n = e.shadowRoot.querySelector(".qrcode");
3124
+ if (r.url) {
3125
+ n.src = r.url;
3126
+ const o = Wn(r.ticket);
3127
+ e.#e = o;
3128
+ }
3129
+ }, 0), L`
3130
+ <div class="wechat-login">
3131
+ <div class="qr-container">
3132
+ <div class="qr-placeholder">
3133
+ <img class="qrcode" width="300" height="300" data-appid="" data-size="200" data-ticket=""></img>
3134
+ <p class="qr-desc">请使用微信扫描二维码登录</p>
3135
+ </div>
3136
+ </div>
3137
+ </div>
3138
+ `;
3139
+ }
3060
3140
  sendVerificationCode() {
3061
3141
  console.log("发送验证码");
3062
3142
  }
@@ -3071,16 +3151,18 @@ class hr extends HTMLElement {
3071
3151
  case "phone":
3072
3152
  return this.renderPhoneForm();
3073
3153
  case "wechat":
3074
- return Nn({ appid: e?.appid || "" }), this.renderWechatForm();
3154
+ return On({ appid: e?.appid || "" }), this.renderWechatForm();
3075
3155
  case "wechat-mp":
3076
3156
  return this.renderWechatMpForm();
3157
+ case "wechat-mp-ticket":
3158
+ return this.renderWechatMpTicketForm();
3077
3159
  default:
3078
3160
  return this.renderPasswordForm();
3079
3161
  }
3080
3162
  }
3081
3163
  render() {
3082
3164
  if (!this.shadowRoot) return;
3083
- const e = D`
3165
+ const e = (n) => typeof n == "string" && !ze[n] ? L`<span class="method-icon-emoji">${n}</span>` : typeof n == "string" && ze[n] ? L`<span class="method-icon-svg">${nt(ze[n])}</span>` : typeof n == "string" && (n.includes("<svg") || n.includes("<?xml")) ? L`<span class="method-icon-svg">${nt(n)}</span>` : L`<span class="method-icon-emoji">${n}</span>`, r = L`
3084
3166
  <style>
3085
3167
  :host {
3086
3168
  display: block;
@@ -3122,7 +3204,7 @@ class hr extends HTMLElement {
3122
3204
 
3123
3205
  .login-method.active {
3124
3206
  background: white;
3125
- color: #007bff;
3207
+ color: #000000;
3126
3208
  }
3127
3209
 
3128
3210
  .login-method.active::after {
@@ -3132,11 +3214,33 @@ class hr extends HTMLElement {
3132
3214
  left: 0;
3133
3215
  right: 0;
3134
3216
  height: 2px;
3135
- background: #007bff;
3217
+ background: #000000;
3136
3218
  }
3137
3219
 
3138
3220
  .method-icon {
3139
3221
  font-size: 20px;
3222
+ display: flex;
3223
+ align-items: center;
3224
+ justify-content: center;
3225
+ width: 24px;
3226
+ height: 24px;
3227
+ }
3228
+
3229
+ .method-icon-emoji {
3230
+ font-size: 20px;
3231
+ line-height: 1;
3232
+ }
3233
+
3234
+ .method-icon-svg {
3235
+ display: flex;
3236
+ align-items: center;
3237
+ justify-content: center;
3238
+ }
3239
+
3240
+ .method-icon-svg svg {
3241
+ width: 32px;
3242
+ height: 32px;
3243
+ display: block;
3140
3244
  }
3141
3245
 
3142
3246
  .method-name {
@@ -3172,7 +3276,7 @@ class hr extends HTMLElement {
3172
3276
 
3173
3277
  .form-group input:focus {
3174
3278
  outline: none;
3175
- border-color: #007bff;
3279
+ border-color: #000000;
3176
3280
  }
3177
3281
 
3178
3282
  .code-group {
@@ -3202,7 +3306,7 @@ class hr extends HTMLElement {
3202
3306
 
3203
3307
  .login-button {
3204
3308
  padding: 12px;
3205
- background: #007bff;
3309
+ background: #000000;
3206
3310
  color: white;
3207
3311
  border: none;
3208
3312
  border-radius: 8px;
@@ -3213,7 +3317,7 @@ class hr extends HTMLElement {
3213
3317
  }
3214
3318
 
3215
3319
  .login-button:hover {
3216
- background: #0056b3;
3320
+ background: #333333;
3217
3321
  }
3218
3322
 
3219
3323
  .wechat-login {
@@ -3224,9 +3328,9 @@ class hr extends HTMLElement {
3224
3328
  }
3225
3329
 
3226
3330
  .qr-container {
3227
- width: 400px;
3228
- height: 400px;
3229
- border: 2px dashed #e9ecef;
3331
+ width: 340px;
3332
+ height: 340px;
3333
+ border: 2px dashed #cccccc;
3230
3334
  border-radius: 8px;
3231
3335
  display: flex;
3232
3336
  align-items: center;
@@ -3262,16 +3366,20 @@ class hr extends HTMLElement {
3262
3366
  .refresh-button:hover {
3263
3367
  background: #5a6268;
3264
3368
  }
3369
+ .method-icon svg {
3370
+ width: 24px;
3371
+ height: 24px;
3372
+ }
3265
3373
  </style>
3266
3374
 
3267
3375
  <div class="login-sidebar">
3268
3376
  <div class="login-methods">
3269
- ${this.loginMethods.map((n) => D`
3377
+ ${this.loginMethods.map((n) => L`
3270
3378
  <button
3271
3379
  class="login-method ${this.selectedMethod === n.id ? "active" : ""}"
3272
3380
  data-method="${n.id}"
3273
3381
  >
3274
- <span class="method-icon">${n.icon}</span>
3382
+ ${e(n.icon)}
3275
3383
  <span class="method-name">${n.name}</span>
3276
3384
  </button>
3277
3385
  `)}
@@ -3282,7 +3390,7 @@ class hr extends HTMLElement {
3282
3390
  </div>
3283
3391
  </div>
3284
3392
  `;
3285
- qt(e, this.shadowRoot);
3393
+ Ut(r, this.shadowRoot);
3286
3394
  }
3287
3395
  }
3288
- customElements.define("kv-login", hr);
3396
+ customElements.define("kv-login", Tr);