@10yun/open-sdk 0.3.143 → 0.3.145

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,2748 +0,0 @@
1
- import { C as X, E as j, T as e3, _ as t3, h as a3, l as i3, m as o3, v as s3, y as r3 } from "./opensdk-v3-DrrVeO3S.js";
2
- import "./helper-_fZwiZH9.js";
3
- import { t as Q } from "./_plugin-vue_export-helper-Be64z-LZ.js";
4
- import { createBlock as z, createCommentVNode as B, createElementBlock as E, createElementVNode as f, createTextVNode as N, createVNode as b, openBlock as A, resolveComponent as $, toDisplayString as C, withCtx as I, withKeys as n3 } from "vue";
5
- var l3 = {}, h3 = {
6
- xmlns: "http://www.w3.org/2000/svg",
7
- viewBox: "0 0 1024 1024"
8
- };
9
- function c3(l, s) {
10
- return A(), E("svg", h3, [...s[0] || (s[0] = [f("path", {
11
- d: "M384 554.666667a85.333333 85.333333 0 0 1 85.333333 85.333333v234.666667a85.333333 85.333333 0 0 1-85.333333 85.333333H149.333333a85.333333 85.333333 0 0 1-85.333333-85.333333V640a85.333333 85.333333 0 0 1 85.333333-85.333333h234.666667z m226.133333 277.333333c4.693333 0 8.533333 3.84 8.533334 8.533333V896h183.466666c4.693333 0 8.533333 3.84 8.533334 8.533333v46.933334a8.533333 8.533333 0 0 1-8.533334 8.533333H563.2a8.533333 8.533333 0 0 1-8.533333-8.533333v-110.933334c0-4.693333 3.84-8.533333 8.533333-8.533333h46.933333z m341.333334 0c4.693333 0 8.533333 3.84 8.533333 8.533333v110.933334a8.533333 8.533333 0 0 1-8.533333 8.533333h-46.933334a8.533333 8.533333 0 0 1-8.533333-8.533333v-110.933334c0-4.693333 3.84-8.533333 8.533333-8.533333h46.933334zM384 618.666667H149.333333a21.333333 21.333333 0 0 0-21.184 18.837333L128 640v234.666667a21.333333 21.333333 0 0 0 18.837333 21.184L149.333333 896h234.666667a21.333333 21.333333 0 0 0 21.184-18.837333L405.333333 874.666667V640a21.333333 21.333333 0 0 0-18.837333-21.184L384 618.666667z m418.133333 149.333333c4.693333 0 8.533333 3.84 8.533334 8.533333v46.933334a8.533333 8.533333 0 0 1-8.533334 8.533333h-46.933333a8.533333 8.533333 0 0 1-8.533333-8.533333v-46.933334c0-4.693333 3.84-8.533333 8.533333-8.533333h46.933333zM298.666667 704a21.333333 21.333333 0 0 1 21.333333 21.333333v64a21.333333 21.333333 0 0 1-21.333333 21.333334h-64a21.333333 21.333333 0 0 1-21.333334-21.333334v-64a21.333333 21.333333 0 0 1 21.333334-21.333333h64z m503.466666-149.333333c4.693333 0 8.533333 3.84 8.533334 8.533333v46.933333a8.533333 8.533333 0 0 1-8.533334 8.533334H618.666667v64h119.466666c4.693333 0 8.533333 3.84 8.533334 8.533333v46.933333a8.533333 8.533333 0 0 1-8.533334 8.533334h-174.933333a8.533333 8.533333 0 0 1-8.533333-8.533334v-174.933333c0-4.693333 3.84-8.533333 8.533333-8.533333h238.933333z m149.333334 128c4.693333 0 8.533333 3.84 8.533333 8.533333v46.933333a8.533333 8.533333 0 0 1-8.533333 8.533334h-132.266667a8.533333 8.533333 0 0 1-8.533333-8.533334v-46.933333c0-4.693333 3.84-8.533333 8.533333-8.533333h132.266667z m0-128c4.693333 0 8.533333 3.84 8.533333 8.533333v46.933333a8.533333 8.533333 0 0 1-8.533333 8.533334h-46.933334a8.533333 8.533333 0 0 1-8.533333-8.533334v-46.933333c0-4.693333 3.84-8.533333 8.533333-8.533333h46.933334zM384 64a85.333333 85.333333 0 0 1 85.333333 85.333333v234.666667a85.333333 85.333333 0 0 1-85.333333 85.333333H149.333333a85.333333 85.333333 0 0 1-85.333333-85.333333V149.333333a85.333333 85.333333 0 0 1 85.333333-85.333333h234.666667z m490.666667 0a85.333333 85.333333 0 0 1 85.333333 85.333333v234.666667a85.333333 85.333333 0 0 1-85.333333 85.333333H640a85.333333 85.333333 0 0 1-85.333333-85.333333V149.333333a85.333333 85.333333 0 0 1 85.333333-85.333333h234.666667zM384 128H149.333333a21.333333 21.333333 0 0 0-21.184 18.837333L128 149.333333v234.666667a21.333333 21.333333 0 0 0 18.837333 21.184L149.333333 405.333333h234.666667a21.333333 21.333333 0 0 0 21.184-18.837333L405.333333 384V149.333333a21.333333 21.333333 0 0 0-18.837333-21.184L384 128z m490.666667 0H640a21.333333 21.333333 0 0 0-21.184 18.837333L618.666667 149.333333v234.666667a21.333333 21.333333 0 0 0 18.837333 21.184L640 405.333333h234.666667a21.333333 21.333333 0 0 0 21.184-18.837333L896 384V149.333333a21.333333 21.333333 0 0 0-18.837333-21.184L874.666667 128z m-576 85.333333a21.333333 21.333333 0 0 1 21.333333 21.333334v64a21.333333 21.333333 0 0 1-21.333333 21.333333h-64a21.333333 21.333333 0 0 1-21.333334-21.333333v-64a21.333333 21.333333 0 0 1 21.333334-21.333334h64z m490.666666 0a21.333333 21.333333 0 0 1 21.333334 21.333334v64a21.333333 21.333333 0 0 1-21.333334 21.333333h-64a21.333333 21.333333 0 0 1-21.333333-21.333333v-64a21.333333 21.333333 0 0 1 21.333333-21.333334h64z",
12
- fill: "currentColor",
13
- "p-id": "27545"
14
- }, null, -1)])]);
15
- }
16
- var u3 = /* @__PURE__ */ Q(l3, [["render", c3]]), d3 = {}, g3 = {
17
- xmlns: "http://www.w3.org/2000/svg",
18
- viewBox: "0 0 24 24"
19
- };
20
- function f3(l, s) {
21
- return A(), E("svg", g3, [...s[0] || (s[0] = [f("path", {
22
- d: "M23 16a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h18a2 2 0 0 1 2 2v12ZM21 4H3v9h18V4ZM3 15v1h18v-1H3Zm3 6a1 1 0 0 1 1-1h10a1 1 0 1 1 0 2H7a1 1 0 0 1-1-1Z",
23
- fill: "currentColor"
24
- }, null, -1)])]);
25
- }
26
- var v3 = /* @__PURE__ */ Q(d3, [["render", f3]]), m3 = {}, p3 = {
27
- xmlns: "http://www.w3.org/2000/svg",
28
- viewBox: "0 0 1024 1024"
29
- };
30
- function _3(l, s) {
31
- return A(), E("svg", p3, [...s[0] || (s[0] = [f("path", {
32
- d: "M128 669.866667v154.133333a72 72 0 0 0 67.776 71.893333l4.224 0.106667H354.133333c4.693333 0 8.533333 3.84 8.533334 8.533333v46.933334a8.533333 8.533333 0 0 1-8.533334 8.533333H205.482667A141.482667 141.482667 0 0 1 64 818.517333V669.866667c0-4.693333 3.84-8.533333 8.533333-8.533334h46.933334c4.693333 0 8.533333 3.84 8.533333 8.533334z m832 0v148.650666A141.482667 141.482667 0 0 1 818.517333 960H669.866667a8.533333 8.533333 0 0 1-8.533334-8.533333v-46.933334c0-4.693333 3.84-8.533333 8.533334-8.533333h154.133333a72 72 0 0 0 71.893333-67.776l0.106667-4.224V669.866667c0-4.693333 3.84-8.533333 8.533333-8.533334h46.933334c4.693333 0 8.533333 3.84 8.533333 8.533334z m0-170.666667v46.933333a8.533333 8.533333 0 0 1-8.533333 8.533334H72.533333a8.533333 8.533333 0 0 1-8.533333-8.533334v-46.933333c0-4.693333 3.84-8.533333 8.533333-8.533333h878.933334c4.693333 0 8.533333 3.84 8.533333 8.533333z m-597.333333-426.666667v46.933334a8.533333 8.533333 0 0 1-8.533334 8.533333H200a72 72 0 0 0-71.893333 67.776L128 200V354.133333a8.533333 8.533333 0 0 1-8.533333 8.533334H72.533333a8.533333 8.533333 0 0 1-8.533333-8.533334V205.482667A141.482667 141.482667 0 0 1 205.482667 64H354.133333c4.693333 0 8.533333 3.84 8.533334 8.533333zM818.517333 64A141.482667 141.482667 0 0 1 960 205.482667V354.133333a8.533333 8.533333 0 0 1-8.533333 8.533334h-46.933334a8.533333 8.533333 0 0 1-8.533333-8.533334V200a72 72 0 0 0-67.776-71.893333L824 128H669.866667a8.533333 8.533333 0 0 1-8.533334-8.533333V72.533333c0-4.693333 3.84-8.533333 8.533334-8.533333h148.650666z",
33
- fill: "currentColor"
34
- }, null, -1)])]);
35
- }
36
- var w3 = /* @__PURE__ */ Q(m3, [["render", _3]]), L3 = /* @__PURE__ */ e3(((l, s) => {
37
- var h;
38
- (function(p, _) {
39
- typeof l == "object" ? s.exports = _() : typeof define == "function" && define.amd ? define(_) : p.QRCode = _();
40
- })(l, function() {
41
- function p(e) {
42
- this.mode = w.MODE_8BIT_BYTE, this.data = e, this.parsedData = [];
43
- for (var t = 0, a = this.data.length; t < a; t++) {
44
- var i = [], o = this.data.charCodeAt(t);
45
- o > 65536 ? (i[0] = 240 | (o & 1835008) >>> 18, i[1] = 128 | (o & 258048) >>> 12, i[2] = 128 | (o & 4032) >>> 6, i[3] = 128 | o & 63) : o > 2048 ? (i[0] = 224 | (o & 61440) >>> 12, i[1] = 128 | (o & 4032) >>> 6, i[2] = 128 | o & 63) : o > 128 ? (i[0] = 192 | (o & 1984) >>> 6, i[1] = 128 | o & 63) : i[0] = o, this.parsedData.push(i);
46
- }
47
- this.parsedData = Array.prototype.concat.apply([], this.parsedData), this.parsedData.length != this.data.length && (this.parsedData.unshift(191), this.parsedData.unshift(187), this.parsedData.unshift(239));
48
- }
49
- p.prototype = {
50
- getLength: function(e) {
51
- return this.parsedData.length;
52
- },
53
- write: function(e) {
54
- for (var t = 0, a = this.parsedData.length; t < a; t++) e.put(this.parsedData[t], 8);
55
- }
56
- };
57
- function _(e, t) {
58
- this.typeNumber = e, this.errorCorrectLevel = t, this.modules = null, this.moduleCount = 0, this.dataCache = null, this.dataList = [];
59
- }
60
- _.prototype = {
61
- addData: function(e) {
62
- var t = new p(e);
63
- this.dataList.push(t), this.dataCache = null;
64
- },
65
- isDark: function(e, t) {
66
- if (e < 0 || this.moduleCount <= e || t < 0 || this.moduleCount <= t) throw new Error(e + "," + t);
67
- return this.modules[e][t];
68
- },
69
- getModuleCount: function() {
70
- return this.moduleCount;
71
- },
72
- make: function() {
73
- this.makeImpl(!1, this.getBestMaskPattern());
74
- },
75
- makeImpl: function(e, t) {
76
- this.moduleCount = this.typeNumber * 4 + 17, this.modules = new Array(this.moduleCount);
77
- for (var a = 0; a < this.moduleCount; a++) {
78
- this.modules[a] = new Array(this.moduleCount);
79
- for (var i = 0; i < this.moduleCount; i++) this.modules[a][i] = null;
80
- }
81
- this.setupPositionProbePattern(0, 0), this.setupPositionProbePattern(this.moduleCount - 7, 0), this.setupPositionProbePattern(0, this.moduleCount - 7), this.setupPositionAdjustPattern(), this.setupTimingPattern(), this.setupTypeInfo(e, t), this.typeNumber >= 7 && this.setupTypeNumber(e), this.dataCache == null && (this.dataCache = _.createData(this.typeNumber, this.errorCorrectLevel, this.dataList)), this.mapData(this.dataCache, t);
82
- },
83
- setupPositionProbePattern: function(e, t) {
84
- for (var a = -1; a <= 7; a++)
85
- if (!(e + a <= -1 || this.moduleCount <= e + a))
86
- for (var i = -1; i <= 7; i++)
87
- t + i <= -1 || this.moduleCount <= t + i || (0 <= a && a <= 6 && (i == 0 || i == 6) || 0 <= i && i <= 6 && (a == 0 || a == 6) || 2 <= a && a <= 4 && 2 <= i && i <= 4 ? this.modules[e + a][t + i] = !0 : this.modules[e + a][t + i] = !1);
88
- },
89
- getBestMaskPattern: function() {
90
- for (var e = 0, t = 0, a = 0; a < 8; a++) {
91
- this.makeImpl(!0, a);
92
- var i = m.getLostPoint(this);
93
- (a == 0 || e > i) && (e = i, t = a);
94
- }
95
- return t;
96
- },
97
- createMovieClip: function(e, t, a) {
98
- var i = e.createEmptyMovieClip(t, a), o = 1;
99
- this.make();
100
- for (var n = 0; n < this.modules.length; n++)
101
- for (var c = n * o, r = 0; r < this.modules[n].length; r++) {
102
- var u = r * o;
103
- this.modules[n][r] && (i.beginFill(0, 100), i.moveTo(u, c), i.lineTo(u + o, c), i.lineTo(u + o, c + o), i.lineTo(u, c + o), i.endFill());
104
- }
105
- return i;
106
- },
107
- setupTimingPattern: function() {
108
- for (var e = 8; e < this.moduleCount - 8; e++)
109
- this.modules[e][6] == null && (this.modules[e][6] = e % 2 == 0);
110
- for (var t = 8; t < this.moduleCount - 8; t++)
111
- this.modules[6][t] == null && (this.modules[6][t] = t % 2 == 0);
112
- },
113
- setupPositionAdjustPattern: function() {
114
- for (var e = m.getPatternPosition(this.typeNumber), t = 0; t < e.length; t++) for (var a = 0; a < e.length; a++) {
115
- var i = e[t], o = e[a];
116
- if (this.modules[i][o] == null)
117
- for (var n = -2; n <= 2; n++) for (var c = -2; c <= 2; c++) n == -2 || n == 2 || c == -2 || c == 2 || n == 0 && c == 0 ? this.modules[i + n][o + c] = !0 : this.modules[i + n][o + c] = !1;
118
- }
119
- },
120
- setupTypeNumber: function(e) {
121
- for (var t = m.getBCHTypeNumber(this.typeNumber), a = 0; a < 18; a++) {
122
- var i = !e && (t >> a & 1) == 1;
123
- this.modules[Math.floor(a / 3)][a % 3 + this.moduleCount - 8 - 3] = i;
124
- }
125
- for (var a = 0; a < 18; a++) {
126
- var i = !e && (t >> a & 1) == 1;
127
- this.modules[a % 3 + this.moduleCount - 8 - 3][Math.floor(a / 3)] = i;
128
- }
129
- },
130
- setupTypeInfo: function(e, t) {
131
- for (var a = this.errorCorrectLevel << 3 | t, i = m.getBCHTypeInfo(a), o = 0; o < 15; o++) {
132
- var n = !e && (i >> o & 1) == 1;
133
- o < 6 ? this.modules[o][8] = n : o < 8 ? this.modules[o + 1][8] = n : this.modules[this.moduleCount - 15 + o][8] = n;
134
- }
135
- for (var o = 0; o < 15; o++) {
136
- var n = !e && (i >> o & 1) == 1;
137
- o < 8 ? this.modules[8][this.moduleCount - o - 1] = n : o < 9 ? this.modules[8][15 - o - 1 + 1] = n : this.modules[8][15 - o - 1] = n;
138
- }
139
- this.modules[this.moduleCount - 8][8] = !e;
140
- },
141
- mapData: function(e, t) {
142
- for (var a = -1, i = this.moduleCount - 1, o = 7, n = 0, c = this.moduleCount - 1; c > 0; c -= 2)
143
- for (c == 6 && c--; ; ) {
144
- for (var r = 0; r < 2; r++) if (this.modules[i][c - r] == null) {
145
- var u = !1;
146
- n < e.length && (u = (e[n] >>> o & 1) == 1), m.getMask(t, i, c - r) && (u = !u), this.modules[i][c - r] = u, o--, o == -1 && (n++, o = 7);
147
- }
148
- if (i += a, i < 0 || this.moduleCount <= i) {
149
- i -= a, a = -a;
150
- break;
151
- }
152
- }
153
- }
154
- }, _.PAD0 = 236, _.PAD1 = 17, _.createData = function(e, t, a) {
155
- for (var i = M.getRSBlocks(e, t), o = new G(), n = 0; n < a.length; n++) {
156
- var c = a[n];
157
- o.put(c.mode, 4), o.put(c.getLength(), m.getLengthInBits(c.mode, e)), c.write(o);
158
- }
159
- for (var r = 0, n = 0; n < i.length; n++) r += i[n].dataCount;
160
- if (o.getLengthInBits() > r * 8) throw new Error("code length overflow. (" + o.getLengthInBits() + ">" + r * 8 + ")");
161
- for (o.getLengthInBits() + 4 <= r * 8 && o.put(0, 4); o.getLengthInBits() % 8 != 0; ) o.putBit(!1);
162
- for (; !(o.getLengthInBits() >= r * 8 || (o.put(_.PAD0, 8), o.getLengthInBits() >= r * 8)); )
163
- o.put(_.PAD1, 8);
164
- return _.createBytes(o, i);
165
- }, _.createBytes = function(e, t) {
166
- for (var a = 0, i = 0, o = 0, n = new Array(t.length), c = new Array(t.length), r = 0; r < t.length; r++) {
167
- var u = t[r].dataCount, v = t[r].totalCount - u;
168
- i = Math.max(i, u), o = Math.max(o, v), n[r] = new Array(u);
169
- for (var g = 0; g < n[r].length; g++) n[r][g] = 255 & e.buffer[g + a];
170
- a += u;
171
- var T = m.getErrorCorrectPolynomial(v), y = new O(n[r], T.getLength() - 1).mod(T);
172
- c[r] = new Array(T.getLength() - 1);
173
- for (var g = 0; g < c[r].length; g++) {
174
- var P = g + y.getLength() - c[r].length;
175
- c[r][g] = P >= 0 ? y.get(P) : 0;
176
- }
177
- }
178
- for (var k = 0, g = 0; g < t.length; g++) k += t[g].totalCount;
179
- for (var R = new Array(k), H = 0, g = 0; g < i; g++) for (var r = 0; r < t.length; r++) g < n[r].length && (R[H++] = n[r][g]);
180
- for (var g = 0; g < o; g++) for (var r = 0; r < t.length; r++) g < c[r].length && (R[H++] = c[r][g]);
181
- return R;
182
- };
183
- for (var w = {
184
- MODE_NUMBER: 1,
185
- MODE_ALPHA_NUM: 2,
186
- MODE_8BIT_BYTE: 4,
187
- MODE_KANJI: 8
188
- }, S = {
189
- L: 1,
190
- M: 0,
191
- Q: 3,
192
- H: 2
193
- }, D = {
194
- PATTERN000: 0,
195
- PATTERN001: 1,
196
- PATTERN010: 2,
197
- PATTERN011: 3,
198
- PATTERN100: 4,
199
- PATTERN101: 5,
200
- PATTERN110: 6,
201
- PATTERN111: 7
202
- }, m = {
203
- PATTERN_POSITION_TABLE: [
204
- [],
205
- [6, 18],
206
- [6, 22],
207
- [6, 26],
208
- [6, 30],
209
- [6, 34],
210
- [
211
- 6,
212
- 22,
213
- 38
214
- ],
215
- [
216
- 6,
217
- 24,
218
- 42
219
- ],
220
- [
221
- 6,
222
- 26,
223
- 46
224
- ],
225
- [
226
- 6,
227
- 28,
228
- 50
229
- ],
230
- [
231
- 6,
232
- 30,
233
- 54
234
- ],
235
- [
236
- 6,
237
- 32,
238
- 58
239
- ],
240
- [
241
- 6,
242
- 34,
243
- 62
244
- ],
245
- [
246
- 6,
247
- 26,
248
- 46,
249
- 66
250
- ],
251
- [
252
- 6,
253
- 26,
254
- 48,
255
- 70
256
- ],
257
- [
258
- 6,
259
- 26,
260
- 50,
261
- 74
262
- ],
263
- [
264
- 6,
265
- 30,
266
- 54,
267
- 78
268
- ],
269
- [
270
- 6,
271
- 30,
272
- 56,
273
- 82
274
- ],
275
- [
276
- 6,
277
- 30,
278
- 58,
279
- 86
280
- ],
281
- [
282
- 6,
283
- 34,
284
- 62,
285
- 90
286
- ],
287
- [
288
- 6,
289
- 28,
290
- 50,
291
- 72,
292
- 94
293
- ],
294
- [
295
- 6,
296
- 26,
297
- 50,
298
- 74,
299
- 98
300
- ],
301
- [
302
- 6,
303
- 30,
304
- 54,
305
- 78,
306
- 102
307
- ],
308
- [
309
- 6,
310
- 28,
311
- 54,
312
- 80,
313
- 106
314
- ],
315
- [
316
- 6,
317
- 32,
318
- 58,
319
- 84,
320
- 110
321
- ],
322
- [
323
- 6,
324
- 30,
325
- 58,
326
- 86,
327
- 114
328
- ],
329
- [
330
- 6,
331
- 34,
332
- 62,
333
- 90,
334
- 118
335
- ],
336
- [
337
- 6,
338
- 26,
339
- 50,
340
- 74,
341
- 98,
342
- 122
343
- ],
344
- [
345
- 6,
346
- 30,
347
- 54,
348
- 78,
349
- 102,
350
- 126
351
- ],
352
- [
353
- 6,
354
- 26,
355
- 52,
356
- 78,
357
- 104,
358
- 130
359
- ],
360
- [
361
- 6,
362
- 30,
363
- 56,
364
- 82,
365
- 108,
366
- 134
367
- ],
368
- [
369
- 6,
370
- 34,
371
- 60,
372
- 86,
373
- 112,
374
- 138
375
- ],
376
- [
377
- 6,
378
- 30,
379
- 58,
380
- 86,
381
- 114,
382
- 142
383
- ],
384
- [
385
- 6,
386
- 34,
387
- 62,
388
- 90,
389
- 118,
390
- 146
391
- ],
392
- [
393
- 6,
394
- 30,
395
- 54,
396
- 78,
397
- 102,
398
- 126,
399
- 150
400
- ],
401
- [
402
- 6,
403
- 24,
404
- 50,
405
- 76,
406
- 102,
407
- 128,
408
- 154
409
- ],
410
- [
411
- 6,
412
- 28,
413
- 54,
414
- 80,
415
- 106,
416
- 132,
417
- 158
418
- ],
419
- [
420
- 6,
421
- 32,
422
- 58,
423
- 84,
424
- 110,
425
- 136,
426
- 162
427
- ],
428
- [
429
- 6,
430
- 26,
431
- 54,
432
- 82,
433
- 110,
434
- 138,
435
- 166
436
- ],
437
- [
438
- 6,
439
- 30,
440
- 58,
441
- 86,
442
- 114,
443
- 142,
444
- 170
445
- ]
446
- ],
447
- G15: 1335,
448
- G18: 7973,
449
- G15_MASK: 21522,
450
- getBCHTypeInfo: function(e) {
451
- for (var t = e << 10; m.getBCHDigit(t) - m.getBCHDigit(m.G15) >= 0; ) t ^= m.G15 << m.getBCHDigit(t) - m.getBCHDigit(m.G15);
452
- return (e << 10 | t) ^ m.G15_MASK;
453
- },
454
- getBCHTypeNumber: function(e) {
455
- for (var t = e << 12; m.getBCHDigit(t) - m.getBCHDigit(m.G18) >= 0; ) t ^= m.G18 << m.getBCHDigit(t) - m.getBCHDigit(m.G18);
456
- return e << 12 | t;
457
- },
458
- getBCHDigit: function(e) {
459
- for (var t = 0; e != 0; )
460
- t++, e >>>= 1;
461
- return t;
462
- },
463
- getPatternPosition: function(e) {
464
- return m.PATTERN_POSITION_TABLE[e - 1];
465
- },
466
- getMask: function(e, t, a) {
467
- switch (e) {
468
- case D.PATTERN000:
469
- return (t + a) % 2 == 0;
470
- case D.PATTERN001:
471
- return t % 2 == 0;
472
- case D.PATTERN010:
473
- return a % 3 == 0;
474
- case D.PATTERN011:
475
- return (t + a) % 3 == 0;
476
- case D.PATTERN100:
477
- return (Math.floor(t / 2) + Math.floor(a / 3)) % 2 == 0;
478
- case D.PATTERN101:
479
- return t * a % 2 + t * a % 3 == 0;
480
- case D.PATTERN110:
481
- return (t * a % 2 + t * a % 3) % 2 == 0;
482
- case D.PATTERN111:
483
- return (t * a % 3 + (t + a) % 2) % 2 == 0;
484
- default:
485
- throw new Error("bad maskPattern:" + e);
486
- }
487
- },
488
- getErrorCorrectPolynomial: function(e) {
489
- for (var t = new O([1], 0), a = 0; a < e; a++) t = t.multiply(new O([1, L.gexp(a)], 0));
490
- return t;
491
- },
492
- getLengthInBits: function(e, t) {
493
- if (1 <= t && t < 10) switch (e) {
494
- case w.MODE_NUMBER:
495
- return 10;
496
- case w.MODE_ALPHA_NUM:
497
- return 9;
498
- case w.MODE_8BIT_BYTE:
499
- return 8;
500
- case w.MODE_KANJI:
501
- return 8;
502
- default:
503
- throw new Error("mode:" + e);
504
- }
505
- else if (t < 27) switch (e) {
506
- case w.MODE_NUMBER:
507
- return 12;
508
- case w.MODE_ALPHA_NUM:
509
- return 11;
510
- case w.MODE_8BIT_BYTE:
511
- return 16;
512
- case w.MODE_KANJI:
513
- return 10;
514
- default:
515
- throw new Error("mode:" + e);
516
- }
517
- else if (t < 41) switch (e) {
518
- case w.MODE_NUMBER:
519
- return 14;
520
- case w.MODE_ALPHA_NUM:
521
- return 13;
522
- case w.MODE_8BIT_BYTE:
523
- return 16;
524
- case w.MODE_KANJI:
525
- return 12;
526
- default:
527
- throw new Error("mode:" + e);
528
- }
529
- else throw new Error("type:" + t);
530
- },
531
- getLostPoint: function(e) {
532
- for (var t = e.getModuleCount(), a = 0, i = 0; i < t; i++) for (var o = 0; o < t; o++) {
533
- for (var n = 0, c = e.isDark(i, o), r = -1; r <= 1; r++)
534
- if (!(i + r < 0 || t <= i + r))
535
- for (var u = -1; u <= 1; u++)
536
- o + u < 0 || t <= o + u || r == 0 && u == 0 || c == e.isDark(i + r, o + u) && n++;
537
- n > 5 && (a += 3 + n - 5);
538
- }
539
- for (var i = 0; i < t - 1; i++) for (var o = 0; o < t - 1; o++) {
540
- var v = 0;
541
- e.isDark(i, o) && v++, e.isDark(i + 1, o) && v++, e.isDark(i, o + 1) && v++, e.isDark(i + 1, o + 1) && v++, (v == 0 || v == 4) && (a += 3);
542
- }
543
- for (var i = 0; i < t; i++) for (var o = 0; o < t - 6; o++) e.isDark(i, o) && !e.isDark(i, o + 1) && e.isDark(i, o + 2) && e.isDark(i, o + 3) && e.isDark(i, o + 4) && !e.isDark(i, o + 5) && e.isDark(i, o + 6) && (a += 40);
544
- for (var o = 0; o < t; o++) for (var i = 0; i < t - 6; i++) e.isDark(i, o) && !e.isDark(i + 1, o) && e.isDark(i + 2, o) && e.isDark(i + 3, o) && e.isDark(i + 4, o) && !e.isDark(i + 5, o) && e.isDark(i + 6, o) && (a += 40);
545
- for (var g = 0, o = 0; o < t; o++) for (var i = 0; i < t; i++) e.isDark(i, o) && g++;
546
- var T = Math.abs(100 * g / t / t - 50) / 5;
547
- return a += T * 10, a;
548
- }
549
- }, L = {
550
- glog: function(e) {
551
- if (e < 1) throw new Error("glog(" + e + ")");
552
- return L.LOG_TABLE[e];
553
- },
554
- gexp: function(e) {
555
- for (; e < 0; ) e += 255;
556
- for (; e >= 256; ) e -= 255;
557
- return L.EXP_TABLE[e];
558
- },
559
- EXP_TABLE: new Array(256),
560
- LOG_TABLE: new Array(256)
561
- }, d = 0; d < 8; d++) L.EXP_TABLE[d] = 1 << d;
562
- for (var d = 8; d < 256; d++) L.EXP_TABLE[d] = L.EXP_TABLE[d - 4] ^ L.EXP_TABLE[d - 5] ^ L.EXP_TABLE[d - 6] ^ L.EXP_TABLE[d - 8];
563
- for (var d = 0; d < 255; d++) L.LOG_TABLE[L.EXP_TABLE[d]] = d;
564
- function O(e, t) {
565
- if (e.length == null) throw new Error(e.length + "/" + t);
566
- for (var a = 0; a < e.length && e[a] == 0; ) a++;
567
- this.num = new Array(e.length - a + t);
568
- for (var i = 0; i < e.length - a; i++) this.num[i] = e[i + a];
569
- }
570
- O.prototype = {
571
- get: function(e) {
572
- return this.num[e];
573
- },
574
- getLength: function() {
575
- return this.num.length;
576
- },
577
- multiply: function(e) {
578
- for (var t = new Array(this.getLength() + e.getLength() - 1), a = 0; a < this.getLength(); a++) for (var i = 0; i < e.getLength(); i++) t[a + i] ^= L.gexp(L.glog(this.get(a)) + L.glog(e.get(i)));
579
- return new O(t, 0);
580
- },
581
- mod: function(e) {
582
- if (this.getLength() - e.getLength() < 0) return this;
583
- for (var t = L.glog(this.get(0)) - L.glog(e.get(0)), a = new Array(this.getLength()), i = 0; i < this.getLength(); i++) a[i] = this.get(i);
584
- for (var i = 0; i < e.getLength(); i++) a[i] ^= L.gexp(L.glog(e.get(i)) + t);
585
- return new O(a, 0).mod(e);
586
- }
587
- };
588
- function M(e, t) {
589
- this.totalCount = e, this.dataCount = t;
590
- }
591
- M.RS_BLOCK_TABLE = [
592
- [
593
- 1,
594
- 26,
595
- 19
596
- ],
597
- [
598
- 1,
599
- 26,
600
- 16
601
- ],
602
- [
603
- 1,
604
- 26,
605
- 13
606
- ],
607
- [
608
- 1,
609
- 26,
610
- 9
611
- ],
612
- [
613
- 1,
614
- 44,
615
- 34
616
- ],
617
- [
618
- 1,
619
- 44,
620
- 28
621
- ],
622
- [
623
- 1,
624
- 44,
625
- 22
626
- ],
627
- [
628
- 1,
629
- 44,
630
- 16
631
- ],
632
- [
633
- 1,
634
- 70,
635
- 55
636
- ],
637
- [
638
- 1,
639
- 70,
640
- 44
641
- ],
642
- [
643
- 2,
644
- 35,
645
- 17
646
- ],
647
- [
648
- 2,
649
- 35,
650
- 13
651
- ],
652
- [
653
- 1,
654
- 100,
655
- 80
656
- ],
657
- [
658
- 2,
659
- 50,
660
- 32
661
- ],
662
- [
663
- 2,
664
- 50,
665
- 24
666
- ],
667
- [
668
- 4,
669
- 25,
670
- 9
671
- ],
672
- [
673
- 1,
674
- 134,
675
- 108
676
- ],
677
- [
678
- 2,
679
- 67,
680
- 43
681
- ],
682
- [
683
- 2,
684
- 33,
685
- 15,
686
- 2,
687
- 34,
688
- 16
689
- ],
690
- [
691
- 2,
692
- 33,
693
- 11,
694
- 2,
695
- 34,
696
- 12
697
- ],
698
- [
699
- 2,
700
- 86,
701
- 68
702
- ],
703
- [
704
- 4,
705
- 43,
706
- 27
707
- ],
708
- [
709
- 4,
710
- 43,
711
- 19
712
- ],
713
- [
714
- 4,
715
- 43,
716
- 15
717
- ],
718
- [
719
- 2,
720
- 98,
721
- 78
722
- ],
723
- [
724
- 4,
725
- 49,
726
- 31
727
- ],
728
- [
729
- 2,
730
- 32,
731
- 14,
732
- 4,
733
- 33,
734
- 15
735
- ],
736
- [
737
- 4,
738
- 39,
739
- 13,
740
- 1,
741
- 40,
742
- 14
743
- ],
744
- [
745
- 2,
746
- 121,
747
- 97
748
- ],
749
- [
750
- 2,
751
- 60,
752
- 38,
753
- 2,
754
- 61,
755
- 39
756
- ],
757
- [
758
- 4,
759
- 40,
760
- 18,
761
- 2,
762
- 41,
763
- 19
764
- ],
765
- [
766
- 4,
767
- 40,
768
- 14,
769
- 2,
770
- 41,
771
- 15
772
- ],
773
- [
774
- 2,
775
- 146,
776
- 116
777
- ],
778
- [
779
- 3,
780
- 58,
781
- 36,
782
- 2,
783
- 59,
784
- 37
785
- ],
786
- [
787
- 4,
788
- 36,
789
- 16,
790
- 4,
791
- 37,
792
- 17
793
- ],
794
- [
795
- 4,
796
- 36,
797
- 12,
798
- 4,
799
- 37,
800
- 13
801
- ],
802
- [
803
- 2,
804
- 86,
805
- 68,
806
- 2,
807
- 87,
808
- 69
809
- ],
810
- [
811
- 4,
812
- 69,
813
- 43,
814
- 1,
815
- 70,
816
- 44
817
- ],
818
- [
819
- 6,
820
- 43,
821
- 19,
822
- 2,
823
- 44,
824
- 20
825
- ],
826
- [
827
- 6,
828
- 43,
829
- 15,
830
- 2,
831
- 44,
832
- 16
833
- ],
834
- [
835
- 4,
836
- 101,
837
- 81
838
- ],
839
- [
840
- 1,
841
- 80,
842
- 50,
843
- 4,
844
- 81,
845
- 51
846
- ],
847
- [
848
- 4,
849
- 50,
850
- 22,
851
- 4,
852
- 51,
853
- 23
854
- ],
855
- [
856
- 3,
857
- 36,
858
- 12,
859
- 8,
860
- 37,
861
- 13
862
- ],
863
- [
864
- 2,
865
- 116,
866
- 92,
867
- 2,
868
- 117,
869
- 93
870
- ],
871
- [
872
- 6,
873
- 58,
874
- 36,
875
- 2,
876
- 59,
877
- 37
878
- ],
879
- [
880
- 4,
881
- 46,
882
- 20,
883
- 6,
884
- 47,
885
- 21
886
- ],
887
- [
888
- 7,
889
- 42,
890
- 14,
891
- 4,
892
- 43,
893
- 15
894
- ],
895
- [
896
- 4,
897
- 133,
898
- 107
899
- ],
900
- [
901
- 8,
902
- 59,
903
- 37,
904
- 1,
905
- 60,
906
- 38
907
- ],
908
- [
909
- 8,
910
- 44,
911
- 20,
912
- 4,
913
- 45,
914
- 21
915
- ],
916
- [
917
- 12,
918
- 33,
919
- 11,
920
- 4,
921
- 34,
922
- 12
923
- ],
924
- [
925
- 3,
926
- 145,
927
- 115,
928
- 1,
929
- 146,
930
- 116
931
- ],
932
- [
933
- 4,
934
- 64,
935
- 40,
936
- 5,
937
- 65,
938
- 41
939
- ],
940
- [
941
- 11,
942
- 36,
943
- 16,
944
- 5,
945
- 37,
946
- 17
947
- ],
948
- [
949
- 11,
950
- 36,
951
- 12,
952
- 5,
953
- 37,
954
- 13
955
- ],
956
- [
957
- 5,
958
- 109,
959
- 87,
960
- 1,
961
- 110,
962
- 88
963
- ],
964
- [
965
- 5,
966
- 65,
967
- 41,
968
- 5,
969
- 66,
970
- 42
971
- ],
972
- [
973
- 5,
974
- 54,
975
- 24,
976
- 7,
977
- 55,
978
- 25
979
- ],
980
- [
981
- 11,
982
- 36,
983
- 12
984
- ],
985
- [
986
- 5,
987
- 122,
988
- 98,
989
- 1,
990
- 123,
991
- 99
992
- ],
993
- [
994
- 7,
995
- 73,
996
- 45,
997
- 3,
998
- 74,
999
- 46
1000
- ],
1001
- [
1002
- 15,
1003
- 43,
1004
- 19,
1005
- 2,
1006
- 44,
1007
- 20
1008
- ],
1009
- [
1010
- 3,
1011
- 45,
1012
- 15,
1013
- 13,
1014
- 46,
1015
- 16
1016
- ],
1017
- [
1018
- 1,
1019
- 135,
1020
- 107,
1021
- 5,
1022
- 136,
1023
- 108
1024
- ],
1025
- [
1026
- 10,
1027
- 74,
1028
- 46,
1029
- 1,
1030
- 75,
1031
- 47
1032
- ],
1033
- [
1034
- 1,
1035
- 50,
1036
- 22,
1037
- 15,
1038
- 51,
1039
- 23
1040
- ],
1041
- [
1042
- 2,
1043
- 42,
1044
- 14,
1045
- 17,
1046
- 43,
1047
- 15
1048
- ],
1049
- [
1050
- 5,
1051
- 150,
1052
- 120,
1053
- 1,
1054
- 151,
1055
- 121
1056
- ],
1057
- [
1058
- 9,
1059
- 69,
1060
- 43,
1061
- 4,
1062
- 70,
1063
- 44
1064
- ],
1065
- [
1066
- 17,
1067
- 50,
1068
- 22,
1069
- 1,
1070
- 51,
1071
- 23
1072
- ],
1073
- [
1074
- 2,
1075
- 42,
1076
- 14,
1077
- 19,
1078
- 43,
1079
- 15
1080
- ],
1081
- [
1082
- 3,
1083
- 141,
1084
- 113,
1085
- 4,
1086
- 142,
1087
- 114
1088
- ],
1089
- [
1090
- 3,
1091
- 70,
1092
- 44,
1093
- 11,
1094
- 71,
1095
- 45
1096
- ],
1097
- [
1098
- 17,
1099
- 47,
1100
- 21,
1101
- 4,
1102
- 48,
1103
- 22
1104
- ],
1105
- [
1106
- 9,
1107
- 39,
1108
- 13,
1109
- 16,
1110
- 40,
1111
- 14
1112
- ],
1113
- [
1114
- 3,
1115
- 135,
1116
- 107,
1117
- 5,
1118
- 136,
1119
- 108
1120
- ],
1121
- [
1122
- 3,
1123
- 67,
1124
- 41,
1125
- 13,
1126
- 68,
1127
- 42
1128
- ],
1129
- [
1130
- 15,
1131
- 54,
1132
- 24,
1133
- 5,
1134
- 55,
1135
- 25
1136
- ],
1137
- [
1138
- 15,
1139
- 43,
1140
- 15,
1141
- 10,
1142
- 44,
1143
- 16
1144
- ],
1145
- [
1146
- 4,
1147
- 144,
1148
- 116,
1149
- 4,
1150
- 145,
1151
- 117
1152
- ],
1153
- [
1154
- 17,
1155
- 68,
1156
- 42
1157
- ],
1158
- [
1159
- 17,
1160
- 50,
1161
- 22,
1162
- 6,
1163
- 51,
1164
- 23
1165
- ],
1166
- [
1167
- 19,
1168
- 46,
1169
- 16,
1170
- 6,
1171
- 47,
1172
- 17
1173
- ],
1174
- [
1175
- 2,
1176
- 139,
1177
- 111,
1178
- 7,
1179
- 140,
1180
- 112
1181
- ],
1182
- [
1183
- 17,
1184
- 74,
1185
- 46
1186
- ],
1187
- [
1188
- 7,
1189
- 54,
1190
- 24,
1191
- 16,
1192
- 55,
1193
- 25
1194
- ],
1195
- [
1196
- 34,
1197
- 37,
1198
- 13
1199
- ],
1200
- [
1201
- 4,
1202
- 151,
1203
- 121,
1204
- 5,
1205
- 152,
1206
- 122
1207
- ],
1208
- [
1209
- 4,
1210
- 75,
1211
- 47,
1212
- 14,
1213
- 76,
1214
- 48
1215
- ],
1216
- [
1217
- 11,
1218
- 54,
1219
- 24,
1220
- 14,
1221
- 55,
1222
- 25
1223
- ],
1224
- [
1225
- 16,
1226
- 45,
1227
- 15,
1228
- 14,
1229
- 46,
1230
- 16
1231
- ],
1232
- [
1233
- 6,
1234
- 147,
1235
- 117,
1236
- 4,
1237
- 148,
1238
- 118
1239
- ],
1240
- [
1241
- 6,
1242
- 73,
1243
- 45,
1244
- 14,
1245
- 74,
1246
- 46
1247
- ],
1248
- [
1249
- 11,
1250
- 54,
1251
- 24,
1252
- 16,
1253
- 55,
1254
- 25
1255
- ],
1256
- [
1257
- 30,
1258
- 46,
1259
- 16,
1260
- 2,
1261
- 47,
1262
- 17
1263
- ],
1264
- [
1265
- 8,
1266
- 132,
1267
- 106,
1268
- 4,
1269
- 133,
1270
- 107
1271
- ],
1272
- [
1273
- 8,
1274
- 75,
1275
- 47,
1276
- 13,
1277
- 76,
1278
- 48
1279
- ],
1280
- [
1281
- 7,
1282
- 54,
1283
- 24,
1284
- 22,
1285
- 55,
1286
- 25
1287
- ],
1288
- [
1289
- 22,
1290
- 45,
1291
- 15,
1292
- 13,
1293
- 46,
1294
- 16
1295
- ],
1296
- [
1297
- 10,
1298
- 142,
1299
- 114,
1300
- 2,
1301
- 143,
1302
- 115
1303
- ],
1304
- [
1305
- 19,
1306
- 74,
1307
- 46,
1308
- 4,
1309
- 75,
1310
- 47
1311
- ],
1312
- [
1313
- 28,
1314
- 50,
1315
- 22,
1316
- 6,
1317
- 51,
1318
- 23
1319
- ],
1320
- [
1321
- 33,
1322
- 46,
1323
- 16,
1324
- 4,
1325
- 47,
1326
- 17
1327
- ],
1328
- [
1329
- 8,
1330
- 152,
1331
- 122,
1332
- 4,
1333
- 153,
1334
- 123
1335
- ],
1336
- [
1337
- 22,
1338
- 73,
1339
- 45,
1340
- 3,
1341
- 74,
1342
- 46
1343
- ],
1344
- [
1345
- 8,
1346
- 53,
1347
- 23,
1348
- 26,
1349
- 54,
1350
- 24
1351
- ],
1352
- [
1353
- 12,
1354
- 45,
1355
- 15,
1356
- 28,
1357
- 46,
1358
- 16
1359
- ],
1360
- [
1361
- 3,
1362
- 147,
1363
- 117,
1364
- 10,
1365
- 148,
1366
- 118
1367
- ],
1368
- [
1369
- 3,
1370
- 73,
1371
- 45,
1372
- 23,
1373
- 74,
1374
- 46
1375
- ],
1376
- [
1377
- 4,
1378
- 54,
1379
- 24,
1380
- 31,
1381
- 55,
1382
- 25
1383
- ],
1384
- [
1385
- 11,
1386
- 45,
1387
- 15,
1388
- 31,
1389
- 46,
1390
- 16
1391
- ],
1392
- [
1393
- 7,
1394
- 146,
1395
- 116,
1396
- 7,
1397
- 147,
1398
- 117
1399
- ],
1400
- [
1401
- 21,
1402
- 73,
1403
- 45,
1404
- 7,
1405
- 74,
1406
- 46
1407
- ],
1408
- [
1409
- 1,
1410
- 53,
1411
- 23,
1412
- 37,
1413
- 54,
1414
- 24
1415
- ],
1416
- [
1417
- 19,
1418
- 45,
1419
- 15,
1420
- 26,
1421
- 46,
1422
- 16
1423
- ],
1424
- [
1425
- 5,
1426
- 145,
1427
- 115,
1428
- 10,
1429
- 146,
1430
- 116
1431
- ],
1432
- [
1433
- 19,
1434
- 75,
1435
- 47,
1436
- 10,
1437
- 76,
1438
- 48
1439
- ],
1440
- [
1441
- 15,
1442
- 54,
1443
- 24,
1444
- 25,
1445
- 55,
1446
- 25
1447
- ],
1448
- [
1449
- 23,
1450
- 45,
1451
- 15,
1452
- 25,
1453
- 46,
1454
- 16
1455
- ],
1456
- [
1457
- 13,
1458
- 145,
1459
- 115,
1460
- 3,
1461
- 146,
1462
- 116
1463
- ],
1464
- [
1465
- 2,
1466
- 74,
1467
- 46,
1468
- 29,
1469
- 75,
1470
- 47
1471
- ],
1472
- [
1473
- 42,
1474
- 54,
1475
- 24,
1476
- 1,
1477
- 55,
1478
- 25
1479
- ],
1480
- [
1481
- 23,
1482
- 45,
1483
- 15,
1484
- 28,
1485
- 46,
1486
- 16
1487
- ],
1488
- [
1489
- 17,
1490
- 145,
1491
- 115
1492
- ],
1493
- [
1494
- 10,
1495
- 74,
1496
- 46,
1497
- 23,
1498
- 75,
1499
- 47
1500
- ],
1501
- [
1502
- 10,
1503
- 54,
1504
- 24,
1505
- 35,
1506
- 55,
1507
- 25
1508
- ],
1509
- [
1510
- 19,
1511
- 45,
1512
- 15,
1513
- 35,
1514
- 46,
1515
- 16
1516
- ],
1517
- [
1518
- 17,
1519
- 145,
1520
- 115,
1521
- 1,
1522
- 146,
1523
- 116
1524
- ],
1525
- [
1526
- 14,
1527
- 74,
1528
- 46,
1529
- 21,
1530
- 75,
1531
- 47
1532
- ],
1533
- [
1534
- 29,
1535
- 54,
1536
- 24,
1537
- 19,
1538
- 55,
1539
- 25
1540
- ],
1541
- [
1542
- 11,
1543
- 45,
1544
- 15,
1545
- 46,
1546
- 46,
1547
- 16
1548
- ],
1549
- [
1550
- 13,
1551
- 145,
1552
- 115,
1553
- 6,
1554
- 146,
1555
- 116
1556
- ],
1557
- [
1558
- 14,
1559
- 74,
1560
- 46,
1561
- 23,
1562
- 75,
1563
- 47
1564
- ],
1565
- [
1566
- 44,
1567
- 54,
1568
- 24,
1569
- 7,
1570
- 55,
1571
- 25
1572
- ],
1573
- [
1574
- 59,
1575
- 46,
1576
- 16,
1577
- 1,
1578
- 47,
1579
- 17
1580
- ],
1581
- [
1582
- 12,
1583
- 151,
1584
- 121,
1585
- 7,
1586
- 152,
1587
- 122
1588
- ],
1589
- [
1590
- 12,
1591
- 75,
1592
- 47,
1593
- 26,
1594
- 76,
1595
- 48
1596
- ],
1597
- [
1598
- 39,
1599
- 54,
1600
- 24,
1601
- 14,
1602
- 55,
1603
- 25
1604
- ],
1605
- [
1606
- 22,
1607
- 45,
1608
- 15,
1609
- 41,
1610
- 46,
1611
- 16
1612
- ],
1613
- [
1614
- 6,
1615
- 151,
1616
- 121,
1617
- 14,
1618
- 152,
1619
- 122
1620
- ],
1621
- [
1622
- 6,
1623
- 75,
1624
- 47,
1625
- 34,
1626
- 76,
1627
- 48
1628
- ],
1629
- [
1630
- 46,
1631
- 54,
1632
- 24,
1633
- 10,
1634
- 55,
1635
- 25
1636
- ],
1637
- [
1638
- 2,
1639
- 45,
1640
- 15,
1641
- 64,
1642
- 46,
1643
- 16
1644
- ],
1645
- [
1646
- 17,
1647
- 152,
1648
- 122,
1649
- 4,
1650
- 153,
1651
- 123
1652
- ],
1653
- [
1654
- 29,
1655
- 74,
1656
- 46,
1657
- 14,
1658
- 75,
1659
- 47
1660
- ],
1661
- [
1662
- 49,
1663
- 54,
1664
- 24,
1665
- 10,
1666
- 55,
1667
- 25
1668
- ],
1669
- [
1670
- 24,
1671
- 45,
1672
- 15,
1673
- 46,
1674
- 46,
1675
- 16
1676
- ],
1677
- [
1678
- 4,
1679
- 152,
1680
- 122,
1681
- 18,
1682
- 153,
1683
- 123
1684
- ],
1685
- [
1686
- 13,
1687
- 74,
1688
- 46,
1689
- 32,
1690
- 75,
1691
- 47
1692
- ],
1693
- [
1694
- 48,
1695
- 54,
1696
- 24,
1697
- 14,
1698
- 55,
1699
- 25
1700
- ],
1701
- [
1702
- 42,
1703
- 45,
1704
- 15,
1705
- 32,
1706
- 46,
1707
- 16
1708
- ],
1709
- [
1710
- 20,
1711
- 147,
1712
- 117,
1713
- 4,
1714
- 148,
1715
- 118
1716
- ],
1717
- [
1718
- 40,
1719
- 75,
1720
- 47,
1721
- 7,
1722
- 76,
1723
- 48
1724
- ],
1725
- [
1726
- 43,
1727
- 54,
1728
- 24,
1729
- 22,
1730
- 55,
1731
- 25
1732
- ],
1733
- [
1734
- 10,
1735
- 45,
1736
- 15,
1737
- 67,
1738
- 46,
1739
- 16
1740
- ],
1741
- [
1742
- 19,
1743
- 148,
1744
- 118,
1745
- 6,
1746
- 149,
1747
- 119
1748
- ],
1749
- [
1750
- 18,
1751
- 75,
1752
- 47,
1753
- 31,
1754
- 76,
1755
- 48
1756
- ],
1757
- [
1758
- 34,
1759
- 54,
1760
- 24,
1761
- 34,
1762
- 55,
1763
- 25
1764
- ],
1765
- [
1766
- 20,
1767
- 45,
1768
- 15,
1769
- 61,
1770
- 46,
1771
- 16
1772
- ]
1773
- ], M.getRSBlocks = function(e, t) {
1774
- var a = M.getRsBlockTable(e, t);
1775
- if (a == null) throw new Error("bad rs block @ typeNumber:" + e + "/errorCorrectLevel:" + t);
1776
- for (var i = a.length / 3, o = [], n = 0; n < i; n++)
1777
- for (var c = a[n * 3 + 0], r = a[n * 3 + 1], u = a[n * 3 + 2], v = 0; v < c; v++) o.push(new M(r, u));
1778
- return o;
1779
- }, M.getRsBlockTable = function(e, t) {
1780
- switch (t) {
1781
- case S.L:
1782
- return M.RS_BLOCK_TABLE[(e - 1) * 4 + 0];
1783
- case S.M:
1784
- return M.RS_BLOCK_TABLE[(e - 1) * 4 + 1];
1785
- case S.Q:
1786
- return M.RS_BLOCK_TABLE[(e - 1) * 4 + 2];
1787
- case S.H:
1788
- return M.RS_BLOCK_TABLE[(e - 1) * 4 + 3];
1789
- default:
1790
- return;
1791
- }
1792
- };
1793
- function G() {
1794
- this.buffer = [], this.length = 0;
1795
- }
1796
- G.prototype = {
1797
- get: function(e) {
1798
- var t = Math.floor(e / 8);
1799
- return (this.buffer[t] >>> 7 - e % 8 & 1) == 1;
1800
- },
1801
- put: function(e, t) {
1802
- for (var a = 0; a < t; a++) this.putBit((e >>> t - a - 1 & 1) == 1);
1803
- },
1804
- getLengthInBits: function() {
1805
- return this.length;
1806
- },
1807
- putBit: function(e) {
1808
- var t = Math.floor(this.length / 8);
1809
- this.buffer.length <= t && this.buffer.push(0), e && (this.buffer[t] |= 128 >>> this.length % 8), this.length++;
1810
- }
1811
- };
1812
- var U = [
1813
- [
1814
- 17,
1815
- 14,
1816
- 11,
1817
- 7
1818
- ],
1819
- [
1820
- 32,
1821
- 26,
1822
- 20,
1823
- 14
1824
- ],
1825
- [
1826
- 53,
1827
- 42,
1828
- 32,
1829
- 24
1830
- ],
1831
- [
1832
- 78,
1833
- 62,
1834
- 46,
1835
- 34
1836
- ],
1837
- [
1838
- 106,
1839
- 84,
1840
- 60,
1841
- 44
1842
- ],
1843
- [
1844
- 134,
1845
- 106,
1846
- 74,
1847
- 58
1848
- ],
1849
- [
1850
- 154,
1851
- 122,
1852
- 86,
1853
- 64
1854
- ],
1855
- [
1856
- 192,
1857
- 152,
1858
- 108,
1859
- 84
1860
- ],
1861
- [
1862
- 230,
1863
- 180,
1864
- 130,
1865
- 98
1866
- ],
1867
- [
1868
- 271,
1869
- 213,
1870
- 151,
1871
- 119
1872
- ],
1873
- [
1874
- 321,
1875
- 251,
1876
- 177,
1877
- 137
1878
- ],
1879
- [
1880
- 367,
1881
- 287,
1882
- 203,
1883
- 155
1884
- ],
1885
- [
1886
- 425,
1887
- 331,
1888
- 241,
1889
- 177
1890
- ],
1891
- [
1892
- 458,
1893
- 362,
1894
- 258,
1895
- 194
1896
- ],
1897
- [
1898
- 520,
1899
- 412,
1900
- 292,
1901
- 220
1902
- ],
1903
- [
1904
- 586,
1905
- 450,
1906
- 322,
1907
- 250
1908
- ],
1909
- [
1910
- 644,
1911
- 504,
1912
- 364,
1913
- 280
1914
- ],
1915
- [
1916
- 718,
1917
- 560,
1918
- 394,
1919
- 310
1920
- ],
1921
- [
1922
- 792,
1923
- 624,
1924
- 442,
1925
- 338
1926
- ],
1927
- [
1928
- 858,
1929
- 666,
1930
- 482,
1931
- 382
1932
- ],
1933
- [
1934
- 929,
1935
- 711,
1936
- 509,
1937
- 403
1938
- ],
1939
- [
1940
- 1003,
1941
- 779,
1942
- 565,
1943
- 439
1944
- ],
1945
- [
1946
- 1091,
1947
- 857,
1948
- 611,
1949
- 461
1950
- ],
1951
- [
1952
- 1171,
1953
- 911,
1954
- 661,
1955
- 511
1956
- ],
1957
- [
1958
- 1273,
1959
- 997,
1960
- 715,
1961
- 535
1962
- ],
1963
- [
1964
- 1367,
1965
- 1059,
1966
- 751,
1967
- 593
1968
- ],
1969
- [
1970
- 1465,
1971
- 1125,
1972
- 805,
1973
- 625
1974
- ],
1975
- [
1976
- 1528,
1977
- 1190,
1978
- 868,
1979
- 658
1980
- ],
1981
- [
1982
- 1628,
1983
- 1264,
1984
- 908,
1985
- 698
1986
- ],
1987
- [
1988
- 1732,
1989
- 1370,
1990
- 982,
1991
- 742
1992
- ],
1993
- [
1994
- 1840,
1995
- 1452,
1996
- 1030,
1997
- 790
1998
- ],
1999
- [
2000
- 1952,
2001
- 1538,
2002
- 1112,
2003
- 842
2004
- ],
2005
- [
2006
- 2068,
2007
- 1628,
2008
- 1168,
2009
- 898
2010
- ],
2011
- [
2012
- 2188,
2013
- 1722,
2014
- 1228,
2015
- 958
2016
- ],
2017
- [
2018
- 2303,
2019
- 1809,
2020
- 1283,
2021
- 983
2022
- ],
2023
- [
2024
- 2431,
2025
- 1911,
2026
- 1351,
2027
- 1051
2028
- ],
2029
- [
2030
- 2563,
2031
- 1989,
2032
- 1423,
2033
- 1093
2034
- ],
2035
- [
2036
- 2699,
2037
- 2099,
2038
- 1499,
2039
- 1139
2040
- ],
2041
- [
2042
- 2809,
2043
- 2213,
2044
- 1579,
2045
- 1219
2046
- ],
2047
- [
2048
- 2953,
2049
- 2331,
2050
- 1663,
2051
- 1273
2052
- ]
2053
- ];
2054
- function W() {
2055
- return typeof CanvasRenderingContext2D < "u";
2056
- }
2057
- function q() {
2058
- var e = !1, t = navigator.userAgent;
2059
- if (/android/i.test(t)) {
2060
- e = !0;
2061
- var a = t.toString().match(/android ([0-9]\.[0-9])/i);
2062
- a && a[1] && (e = parseFloat(a[1]));
2063
- }
2064
- return e;
2065
- }
2066
- var K = (function() {
2067
- var e = function(t, a) {
2068
- this._el = t, this._htOption = a;
2069
- };
2070
- return e.prototype.draw = function(t) {
2071
- var a = this._htOption, i = this._el, o = t.getModuleCount();
2072
- Math.floor(a.width / o), Math.floor(a.height / o), this.clear();
2073
- function n(g, T) {
2074
- var y = document.createElementNS("http://www.w3.org/2000/svg", g);
2075
- for (var P in T) T.hasOwnProperty(P) && y.setAttribute(P, T[P]);
2076
- return y;
2077
- }
2078
- var c = n("svg", {
2079
- viewBox: "0 0 " + String(o) + " " + String(o),
2080
- width: "100%",
2081
- height: "100%",
2082
- fill: a.colorLight
2083
- });
2084
- c.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:xlink", "http://www.w3.org/1999/xlink"), i.appendChild(c), c.appendChild(n("rect", {
2085
- fill: a.colorLight,
2086
- width: "100%",
2087
- height: "100%"
2088
- })), c.appendChild(n("rect", {
2089
- fill: a.colorDark,
2090
- width: "1",
2091
- height: "1",
2092
- id: "template"
2093
- }));
2094
- for (var r = 0; r < o; r++) for (var u = 0; u < o; u++) if (t.isDark(r, u)) {
2095
- var v = n("use", {
2096
- x: String(u),
2097
- y: String(r)
2098
- });
2099
- v.setAttributeNS("http://www.w3.org/1999/xlink", "href", "#template"), c.appendChild(v);
2100
- }
2101
- }, e.prototype.clear = function() {
2102
- for (; this._el.hasChildNodes(); ) this._el.removeChild(this._el.lastChild);
2103
- }, e;
2104
- })(), J = document.documentElement.tagName.toLowerCase() === "svg" ? K : W() ? (function() {
2105
- function e() {
2106
- this._elImage.src = this._elCanvas.toDataURL("image/png"), this._elImage.style.display = "block", this._elCanvas.style.display = "none";
2107
- }
2108
- if (this && this._android && this._android <= 2.1) {
2109
- var t = 1 / window.devicePixelRatio, a = CanvasRenderingContext2D.prototype.drawImage;
2110
- CanvasRenderingContext2D.prototype.drawImage = function(n, c, r, u, v, g, T, y, P) {
2111
- if ("nodeName" in n && /img/i.test(n.nodeName)) for (var k = arguments.length - 1; k >= 1; k--) arguments[k] = arguments[k] * t;
2112
- else typeof y > "u" && (arguments[1] *= t, arguments[2] *= t, arguments[3] *= t, arguments[4] *= t);
2113
- a.apply(this, arguments);
2114
- };
2115
- }
2116
- function i(n, c) {
2117
- var r = this;
2118
- if (r._fFail = c, r._fSuccess = n, r._bSupportDataURI === null) {
2119
- var u = document.createElement("img"), v = function() {
2120
- r._bSupportDataURI = !1, r._fFail && r._fFail.call(r);
2121
- }, g = function() {
2122
- r._bSupportDataURI = !0, r._fSuccess && r._fSuccess.call(r);
2123
- };
2124
- u.onabort = v, u.onerror = v, u.onload = g, u.src = "data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==";
2125
- return;
2126
- } else r._bSupportDataURI === !0 && r._fSuccess ? r._fSuccess.call(r) : r._bSupportDataURI === !1 && r._fFail && r._fFail.call(r);
2127
- }
2128
- var o = function(n, c) {
2129
- this._bIsPainted = !1, this._android = q(), this._htOption = c, this._elCanvas = document.createElement("canvas"), this._elCanvas.width = c.width, this._elCanvas.height = c.height, n.appendChild(this._elCanvas), this._el = n, this._oContext = this._elCanvas.getContext("2d"), this._bIsPainted = !1, this._elImage = document.createElement("img"), this._elImage.alt = "Scan me!", this._elImage.style.display = "none", this._el.appendChild(this._elImage), this._bSupportDataURI = null;
2130
- };
2131
- return o.prototype.draw = function(n) {
2132
- var c = this._elImage, r = this._oContext, u = this._htOption, v = n.getModuleCount(), g = u.width / v, T = u.height / v, y = Math.round(g), P = Math.round(T);
2133
- c.style.display = "none", this.clear();
2134
- for (var k = 0; k < v; k++) for (var R = 0; R < v; R++) {
2135
- var H = n.isDark(k, R), V = R * g, F = k * T;
2136
- r.strokeStyle = H ? u.colorDark : u.colorLight, r.lineWidth = 1, r.fillStyle = H ? u.colorDark : u.colorLight, r.fillRect(V, F, g, T), r.strokeRect(Math.floor(V) + 0.5, Math.floor(F) + 0.5, y, P), r.strokeRect(Math.ceil(V) - 0.5, Math.ceil(F) - 0.5, y, P);
2137
- }
2138
- this._bIsPainted = !0;
2139
- }, o.prototype.makeImage = function() {
2140
- this._bIsPainted && i.call(this, e);
2141
- }, o.prototype.isPainted = function() {
2142
- return this._bIsPainted;
2143
- }, o.prototype.clear = function() {
2144
- this._oContext.clearRect(0, 0, this._elCanvas.width, this._elCanvas.height), this._bIsPainted = !1;
2145
- }, o.prototype.round = function(n) {
2146
- return n && Math.floor(n * 1e3) / 1e3;
2147
- }, o;
2148
- })() : (function() {
2149
- var e = function(t, a) {
2150
- this._el = t, this._htOption = a;
2151
- };
2152
- return e.prototype.draw = function(t) {
2153
- for (var a = this._htOption, i = this._el, o = t.getModuleCount(), n = Math.floor(a.width / o), c = Math.floor(a.height / o), r = ['<table style="border:0;border-collapse:collapse;">'], u = 0; u < o; u++) {
2154
- r.push("<tr>");
2155
- for (var v = 0; v < o; v++) r.push('<td style="border:0;border-collapse:collapse;padding:0;margin:0;width:' + n + "px;height:" + c + "px;background-color:" + (t.isDark(u, v) ? a.colorDark : a.colorLight) + ';"></td>');
2156
- r.push("</tr>");
2157
- }
2158
- r.push("</table>"), i.innerHTML = r.join("");
2159
- var g = i.childNodes[0], T = (a.width - g.offsetWidth) / 2, y = (a.height - g.offsetHeight) / 2;
2160
- T > 0 && y > 0 && (g.style.margin = y + "px " + T + "px");
2161
- }, e.prototype.clear = function() {
2162
- this._el.innerHTML = "";
2163
- }, e;
2164
- })();
2165
- function x(e, t) {
2166
- for (var a = 1, i = Z(e), o = 0, n = U.length; o <= n; o++) {
2167
- var c = 0;
2168
- switch (t) {
2169
- case S.L:
2170
- c = U[o][0];
2171
- break;
2172
- case S.M:
2173
- c = U[o][1];
2174
- break;
2175
- case S.Q:
2176
- c = U[o][2];
2177
- break;
2178
- case S.H:
2179
- c = U[o][3];
2180
- break;
2181
- }
2182
- if (i <= c) break;
2183
- a++;
2184
- }
2185
- if (a > U.length) throw new Error("Too long data");
2186
- return a;
2187
- }
2188
- function Z(e) {
2189
- var t = encodeURI(e).toString().replace(/\%[0-9a-fA-F]{2}/g, "a");
2190
- return t.length + (t.length != e ? 3 : 0);
2191
- }
2192
- return h = function(e, t) {
2193
- if (this._htOption = {
2194
- width: 256,
2195
- height: 256,
2196
- typeNumber: 4,
2197
- colorDark: "#000000",
2198
- colorLight: "#ffffff",
2199
- correctLevel: S.H
2200
- }, typeof t == "string" && (t = { text: t }), t) for (var a in t) this._htOption[a] = t[a];
2201
- typeof e == "string" && (e = document.getElementById(e)), this._htOption.useSVG && (J = K), this._android = q(), this._el = e, this._oQRCode = null, this._oDrawing = new J(this._el, this._htOption), this._htOption.text && this.makeCode(this._htOption.text);
2202
- }, h.prototype.makeCode = function(e) {
2203
- this._oQRCode = new _(x(e, this._htOption.correctLevel), this._htOption.correctLevel), this._oQRCode.addData(e), this._oQRCode.make(), this._el.title = e, this._oDrawing.draw(this._oQRCode), this.makeImage();
2204
- }, h.prototype.makeImage = function() {
2205
- typeof this._oDrawing.makeImage == "function" && (!this._android || this._android >= 3) && this._oDrawing.makeImage();
2206
- }, h.prototype.clear = function() {
2207
- this._oDrawing.clear();
2208
- }, h.CorrectLevel = S, h;
2209
- });
2210
- })), Y = /* @__PURE__ */ j(L3()), C3 = { class: "cloud-login-wrap" }, T3 = {
2211
- key: 0,
2212
- class: "cloud-login-main"
2213
- }, A3 = { class: "cloud-login-logo no-dark-content can-click" }, b3 = ["src"], E3 = {
2214
- key: 0,
2215
- class: "cloud-login-box"
2216
- }, S3 = { class: "login-title" }, y3 = { class: "login-subtitle" }, k3 = { class: "cloud-login-mode-access" }, I3 = { class: "login-switch" }, D3 = {
2217
- key: 1,
2218
- class: "cloud-login-box"
2219
- }, M3 = { class: "login-mode-switch" }, P3 = { class: "login-mode-switch-box" }, B3 = { class: "login-title" }, R3 = { class: "login-subtitle" }, N3 = { class: "cloud-login-mode-access" }, $3 = {
2220
- key: 0,
2221
- class: "code-load"
2222
- }, O3 = {
2223
- key: 1,
2224
- class: "code-error"
2225
- }, U3 = ["src"], H3 = { class: "cloud-login-other" }, V3 = { class: "cloud-login-other" }, F3 = {
2226
- key: 0,
2227
- class: "login-switch"
2228
- }, z3 = {
2229
- key: 1,
2230
- class: "page-login-oauth"
2231
- }, Q3 = {
2232
- key: 2,
2233
- class: "cloud-login-box"
2234
- }, G3 = { class: "login-mode-switch" }, q3 = { class: "login-mode-switch-box" }, K3 = { class: "login-title" }, J3 = { class: "login-subtitle" }, X3 = {
2235
- id: "qrcode",
2236
- ref: "qrCodeUrl"
2237
- }, Y3 = {
2238
- key: 3,
2239
- class: "cloud-login-box"
2240
- }, W3 = { class: "login-title" }, x3 = { class: "login-subtitle" }, Z3 = { class: "cloud-login-mode-access" }, j3 = { class: "page-login-oauth" }, oe = /* @__PURE__ */ Object.assign({
2241
- data() {
2242
- return {
2243
- loadOngoing: !1,
2244
- loginMode: "access",
2245
- loginJump: !1,
2246
- cache_remember: "off",
2247
- cache_privacy: "off",
2248
- account_mobile: "",
2249
- account_password: "",
2250
- account_password2: "",
2251
- captcha_code: "",
2252
- sms_code: "",
2253
- account_business_id: 0,
2254
- reg_invite: "",
2255
- regInviteNeed: !1,
2256
- codeNeed: !1,
2257
- codeLoad: 0,
2258
- codeKey: "",
2259
- codeUrl: "",
2260
- chainShowFlag: !1,
2261
- chainAccountList: [],
2262
- chainTempToken: "",
2263
- qrcodeExpiredShow: !1,
2264
- qrcodeTimer: null,
2265
- qrcodeLoad: !1,
2266
- qrcodeScanVernum: 15,
2267
- qrcodeScanVererr: 0,
2268
- copyright_info: ""
2269
- };
2270
- },
2271
- watch: {
2272
- $route({ query: l }) {
2273
- l.type == "reg" && this.$nextTick(() => {
2274
- this.loginMode = "reg";
2275
- });
2276
- },
2277
- account_mobile(l) {
2278
- this.$nextTick(() => {
2279
- let s = this.$refs.account_mobile?.$el?.querySelector("input");
2280
- if (s) {
2281
- const h = getComputedStyle(s).background.match(/rgb\((\d+,\s*\d+,\s*\d+)\)/);
2282
- h && h[0] === "rgb(232, 240, 254)" && this.onBlur();
2283
- }
2284
- });
2285
- },
2286
- loginMode(l) {
2287
- l == "reg" && (this.regInviteNeed = !!this.cacheInstConfig.reg_invite_need);
2288
- }
2289
- },
2290
- computed: { currentLanguage() {
2291
- return this.languageList[this.languageName] || "Language";
2292
- } },
2293
- created() {
2294
- this.cache_remember = localStorage.getItem("cacheLoginRemember") || "off", this.cache_privacy = localStorage.getItem("cacheLoginPrivacy") || "off", this.account_mobile = localStorage.getItem("cacheLoginMobile") || "";
2295
- },
2296
- async mounted() {
2297
- this.loginMode = this.$route.query.type === "reg" ? "reg" : "access", this.$Electron && (this.$Electron.sendMessage("webTabDestroyAll"), this.$Electron.sendMessage("childWindowDestroyAll")), t3().$subscribe((l, s) => {
2298
- l.events.key == "useSSOLogin" && s.useSSOLogin == !0 && this.inputServerUrl();
2299
- });
2300
- },
2301
- beforeDestroy() {
2302
- clearInterval(this.qrcodeTimer), this.loginJump = !1, this.account_password = "", this.account_password2 = "", this.captcha_code = "", this.reg_invite = "";
2303
- },
2304
- methods: {
2305
- handleRemember(l) {
2306
- l == "on" ? localStorage.setItem("cacheLoginRemember", l) : localStorage.removeItem("cacheLoginRemember");
2307
- },
2308
- handleRrivacy(l) {
2309
- l == "on" ? (localStorage.setItem("cacheLoginPrivacy", l), this.chackServerUrl().catch((s) => {
2310
- })) : localStorage.removeItem("cacheLoginPrivacy"), this.cache_privacy = l;
2311
- },
2312
- handleForgot() {
2313
- this.$message.warning("请联系管理员!");
2314
- },
2315
- chackServerUrl(l) {
2316
- return new Promise((s, h) => {
2317
- s();
2318
- });
2319
- },
2320
- switchLoginMode(l) {
2321
- this.chackServerUrl(!0).then(() => {
2322
- clearInterval(this.qrcodeTimer), l === "qrcode" ? (this.loginMode = "qrcode", this.scanQrcodeRefresh()) : l === "access" ? this.loginMode = "access" : l === "smsLogin" ? (this.loginMode = "smsLogin", this.refreshCode()) : this.loginMode = l;
2323
- });
2324
- },
2325
- refreshCode() {
2326
- this.captcha_code = "", !(this.codeLoad > 0) && (setTimeout((l) => {
2327
- this.codeLoad++;
2328
- }, 600), this.$request.flagGet("BASE_PASSPORT_CODE_DATA", { account_mobile: this.account_mobile }).then(({ data: l }) => {
2329
- this.codeKey = l.key, this.codeUrl = l.img, this.$refs.captcha_code?.focus();
2330
- }).catch((l) => {
2331
- this.codeUrl = "error";
2332
- }).finally((l) => {
2333
- this.codeLoad--;
2334
- }));
2335
- },
2336
- onBlur() {
2337
- if (!this.account_mobile) {
2338
- this.codeNeed = !1;
2339
- return;
2340
- }
2341
- this.loadOngoing = !0, this.$request.flagGet("BASE_PASSPORT_CODE_NEED", { account_mobile: this.account_mobile }).then((l) => {
2342
- this.loadOngoing = !1, l.data == "need" ? (this.refreshCode(), this.codeNeed = !0) : this.codeNeed = !1;
2343
- }).catch((l) => {
2344
- this.loadOngoing = !1;
2345
- }).finally((l) => {
2346
- this.loadOngoing = !1;
2347
- });
2348
- },
2349
- accessLoginFunc() {
2350
- if (this.loadOngoing)
2351
- return this.$message({
2352
- type: "warning",
2353
- message: "正在登录中,请勿重新确认~"
2354
- }), !1;
2355
- this.chackServerUrl(!0).then(() => {
2356
- if (this.account_mobile = cvUtils.strTrimAll(this.account_mobile), this.account_password = cvUtils.strTrimAll(this.account_password), this.account_password2 = cvUtils.strTrimAll(this.account_password2), this.captcha_code = cvUtils.strTrimAll(this.captcha_code), this.reg_invite = cvUtils.strTrimAll(this.reg_invite), this.cache_privacy != "on") {
2357
- this.$message.warning("请同意协议");
2358
- return;
2359
- }
2360
- if (!cvUtils.isMobile(this.account_mobile)) {
2361
- this.$message.warning("请输入正确的手机号码"), this.$refs.account_mobile.focus();
2362
- return;
2363
- }
2364
- if (!this.account_password) {
2365
- this.$message.warning("请输入密码"), this.$refs.account_password.focus();
2366
- return;
2367
- }
2368
- if (this.loginMode == "reg" && this.account_password != this.account_password2) {
2369
- this.$message.warning("确认密码输入不一致"), this.$refs.account_password2.focus();
2370
- return;
2371
- }
2372
- if (this.codeNeed && !this.captcha_code) {
2373
- this.$message.warning("请输入验证码"), this.$refs.captcha_code.focus();
2374
- return;
2375
- }
2376
- let l = {};
2377
- this.loginMode == "access" ? l = {
2378
- handleType: "MobilePwdLogin",
2379
- account_mobile: this.account_mobile,
2380
- business_id: this.account_business_id,
2381
- account_password: this.account_password,
2382
- captcha_code: this.captcha_code,
2383
- captcha_key: this.codeKey
2384
- } : this.loginMode == "reg" && (l = {
2385
- handleType: "MobilePwdLogin",
2386
- account_mobile: this.account_mobile,
2387
- business_id: this.account_business_id,
2388
- account_password: this.account_password,
2389
- captcha_code: this.captcha_code,
2390
- captcha_key: this.codeKey,
2391
- reg_invite: this.reg_invite
2392
- }), this.commonLoginIng(l);
2393
- });
2394
- },
2395
- chainBusinessCheck(l) {
2396
- this.account_mobile = l.account_mobile_show, this.account_business_id = l.business_id, (l.acc_rules_type == "sy-org-admin" || l.acc_rules_type == "sy-org-staff") && this.commonLoginIng({
2397
- handleType: "OrgTokenLogin",
2398
- account_mobile: this.account_mobile,
2399
- business_id: this.account_business_id,
2400
- temp_token: this.chainTempToken || ""
2401
- });
2402
- },
2403
- commonLoginIng(l) {
2404
- let s = this.$message({
2405
- iconClass: "ElIconLoading",
2406
- message: "正在登录...",
2407
- duration: 0
2408
- });
2409
- this.loadOngoing = !0, localStorage.setItem("cacheLoginMobile", this.account_mobile);
2410
- try {
2411
- this.$request.setOptions({ timeout: 1e4 }).flagPost("BASE_PASSPORT_PASSPORT", { ...l }).then((h) => {
2412
- s.close(), this.loadOngoing = !1, h.status == 200 ? this.commonLoginSucc(h) : h.status == 400130 ? (this.$message.error("验证码有误!"), this.refreshCode(), this.codeNeed = !0) : (this.$message.error(h.msg), this.refreshCode());
2413
- }).catch((h) => {
2414
- this.loadOngoing = !1, this.chainShowFlag = !1, s.close(), this.refreshCode(), this.codeNeed = !0;
2415
- });
2416
- } catch {
2417
- this.$message.error("登录异常"), s.close(), this.loadOngoing = !1, this.refreshCode();
2418
- }
2419
- },
2420
- async commonLoginSucc(l) {
2421
- let s = l.data || {};
2422
- if (s.result_type == "chain")
2423
- this.chainAccountList = s.result_data || [], this.chainShowFlag = !0, this.chainTempToken = s.result_token || "";
2424
- else {
2425
- const h = s.result_data || {};
2426
- await s3().SA_ACCOUNT_SIGNIN(h), this.codeNeed = !1, this.$message({
2427
- type: "success",
2428
- message: "登录成功...",
2429
- duration: 800,
2430
- onClose: () => {
2431
- this.goNext();
2432
- }
2433
- });
2434
- }
2435
- },
2436
- chainReselection() {
2437
- this.refreshCode(), this.chainShowFlag = !1;
2438
- },
2439
- scanCreate(l) {
2440
- new Y.default(this.$refs.qrCodeUrl, {
2441
- text: l,
2442
- width: 180,
2443
- height: 180,
2444
- margin: 2,
2445
- colorDark: "#000000",
2446
- colorLight: "#ffffff",
2447
- correctLevel: Y.default.CorrectLevel.L
2448
- });
2449
- },
2450
- scanQrcodeRefresh() {
2451
- if (this.loginMode != "qrcode" || this.qrcodeLoad) return !1;
2452
- this.qrcodeExpiredShow = !1, this.qrcodeScanVererr = 0, this.$nextTick(() => {
2453
- document.getElementById("qrcode").innerHTML = "", clearInterval(this.qrcodeTimer), this.qrcodeLoad = !0, this.$request.flagGet("BASE_PASSPORT_SCAN_QRCODE", {
2454
- name: "app",
2455
- fun: "scanQrcode"
2456
- }).then((l) => {
2457
- l.status == 200 ? (this.scanCreate(l?.data?.checkLogin), this.qrcodeTimer = window.setInterval(() => {
2458
- this.scanCheckFunc(l?.data?.scanCode);
2459
- }, 3e3)) : result.status == 404;
2460
- }).catch((l) => {
2461
- }).finally((l) => {
2462
- this.qrcodeLoad = !1;
2463
- });
2464
- });
2465
- },
2466
- scanCheckFunc(l) {
2467
- if (this.qrcodeScanVererr++, this.qrcodeScanVererr > this.qrcodeScanVernum)
2468
- return clearInterval(this.qrcodeTimer), this.qrcodeExpiredShow = !0, !1;
2469
- this.$request.flagPost("BASE_PASSPORT_SCAN_CHECK", {
2470
- name: "app",
2471
- fun: "scanCheck",
2472
- scanCode: l || ""
2473
- }).then((s) => {
2474
- s.status == 200 ? (s.msg && s?.data?.scanCVal || "") != "" && (clearInterval(this.qrcodeTimer), this.scanLoginFunc(l, s?.data?.scanCVal)) : s.status == 405 && (clearInterval(this.qrcodeTimer), this.qrcodeExpiredShow = !0);
2475
- }).catch(() => {
2476
- });
2477
- },
2478
- scanLoginFunc(l, s) {
2479
- this.$message({
2480
- type: "success",
2481
- message: "扫码成功,请稍后...",
2482
- duration: 1500
2483
- }), this.$request.flagPost("BASE_PASSPORT_SCAN_LOGIN", {
2484
- name: "app",
2485
- fun: "scanLogin",
2486
- scanCode: l,
2487
- scanCVal: s
2488
- }).then((h) => {
2489
- if (h.status == 200) {
2490
- let p = this.$message({
2491
- iconClass: "ElIconLoading",
2492
- message: "正在安全登录中,请稍后...",
2493
- duration: 0
2494
- });
2495
- setTimeout(() => {
2496
- p.close(), this.$message({
2497
- message: h.msg,
2498
- type: h.status == 200 ? "success" : "error"
2499
- });
2500
- }, 2e3);
2501
- }
2502
- }).catch(() => {
2503
- });
2504
- },
2505
- goNext() {
2506
- this.loginJump = !0;
2507
- let l = cvUtils.cc_url_get_params(null, this.$route.query);
2508
- const s = decodeURIComponent(l.from || "");
2509
- s ? X.idbSetItem("clearCache", "login").then((h) => {
2510
- window.location.replace(s);
2511
- }) : this.$router.push({ path: "/" });
2512
- },
2513
- setTheme(l) {
2514
- o3().SA_THEMES_SET(l);
2515
- },
2516
- setLanguage(l) {
2517
- a3().SA_LANGUAGE_SET(l);
2518
- },
2519
- inputServerUrl() {
2520
- },
2521
- inputServerChack(l) {
2522
- return new Promise((s, h) => {
2523
- let p = l;
2524
- /\/api\/$/.test(p) || (p = p + (cvUtils.strRightExists(p, "/") ? "api/" : "/api/")), /^https*:\/\//i.test(p) || (p = `https://${p}`), r3.setOptions({ checkNetwork: !1 }).flagGet("SYS_SETT_ALL", {}).then(async ({ data: _ }) => {
2525
- typeof _.server_version > "u" && typeof _.all_group_mute > "u" ? h(`服务器(${cvUtils.cc_url_get_domain(l)})版本过低`) : (p != this.sysServerUrl && (await X.idbSetItem("sysServerUrl", p), window.location.reload()), s());
2526
- }).catch(({ ret: _, msg: w }) => {
2527
- if (_ === -1001) {
2528
- if (!/^https*:\/\//i.test(l)) {
2529
- this.inputServerChack(`http://${l}`).then(s).catch(h);
2530
- return;
2531
- }
2532
- w = "服务器地址无效";
2533
- }
2534
- h(w);
2535
- });
2536
- });
2537
- }
2538
- }
2539
- }, {
2540
- __name: "login",
2541
- setup(l) {
2542
- return (s, h) => {
2543
- const p = $("el-input"), _ = $("el-button"), w = $("el-icon"), S = $("el-tooltip"), D = $("cv-icons"), m = $("ElIconLoading"), L = $("el-checkbox");
2544
- return A(), E("div", C3, [s.chainShowFlag ? B("", !0) : (A(), E("div", T3, [
2545
- f("div", A3, [f("img", {
2546
- src: s.cacheInstInfo.LAST_IP_LOGO,
2547
- alt: ""
2548
- }, null, 8, b3)]),
2549
- s.loginMode == "reg" ? (A(), E("div", E3, [
2550
- f("div", S3, C(s.cacheInstInfo.LAST_IP_TITLE), 1),
2551
- f("div", y3, C(s.$t("输入您的信息以创建帐户。")), 1),
2552
- f("div", k3, [
2553
- f("form", null, [b(p, {
2554
- modelValue: s.account_password2,
2555
- "onUpdate:modelValue": h[0] || (h[0] = (d) => s.account_password2 = d),
2556
- ref: "account_password2",
2557
- "prefix-icon": "ElIconLock",
2558
- placeholder: s.$t("输入确认密码"),
2559
- type: "password",
2560
- size: "large",
2561
- clearable: ""
2562
- }, null, 8, ["modelValue", "placeholder"]), s.regInviteNeed ? (A(), z(p, {
2563
- key: 0,
2564
- modelValue: s.reg_invite,
2565
- "onUpdate:modelValue": h[1] || (h[1] = (d) => s.reg_invite = d),
2566
- ref: "reg_invite",
2567
- class: "login-code",
2568
- placeholder: s.$t("请输入注册邀请码"),
2569
- type: "text",
2570
- size: "large",
2571
- clearable: ""
2572
- }, {
2573
- prepend: I(() => [N(" " + C(s.$t("邀请码")) + " ", 1)]),
2574
- _: 1
2575
- }, 8, ["modelValue", "placeholder"])) : B("", !0)]),
2576
- b(_, null, {
2577
- default: I(() => [N(C(s.loginJump ? "注册成功" : "注册"), 1)]),
2578
- _: 1
2579
- }),
2580
- f("div", I3, [N(C(s.$t("已经有帐号?")) + " ", 1), f("a", {
2581
- href: "javascript:void(0)",
2582
- onClick: h[2] || (h[2] = (d) => s.switchLoginMode("access"))
2583
- }, C(s.$t("登录帐号")), 1)])
2584
- ])
2585
- ])) : B("", !0),
2586
- s.loginMode == "access" ? (A(), E("div", D3, [
2587
- f("div", M3, [f("div", P3, [b(S, {
2588
- content: "扫码登录",
2589
- placement: "left"
2590
- }, {
2591
- default: I(() => [f("span", {
2592
- class: "login-mode-switch-icon",
2593
- onClick: h[3] || (h[3] = (d) => s.switchLoginMode("qrcode"))
2594
- }, [b(w, { size: "45" }, {
2595
- default: I(() => [b(u3)]),
2596
- _: 1
2597
- })])]),
2598
- _: 1
2599
- })])]),
2600
- f("div", B3, C(s.cacheInstInfo.LAST_IP_TITLE), 1),
2601
- f("div", R3, C(s.$t("输入您的凭证以访问您的帐户。")), 1),
2602
- f("div", N3, [
2603
- f("form", null, [
2604
- b(p, {
2605
- modelValue: s.account_mobile,
2606
- "onUpdate:modelValue": h[4] || (h[4] = (d) => s.account_mobile = d),
2607
- ref: "account_mobile",
2608
- "prefix-icon": "ElIconUser",
2609
- placeholder: s.$t("输入您的手机账号"),
2610
- type: "text",
2611
- size: "large",
2612
- maxlength: "11",
2613
- onBlur: s.onBlur,
2614
- clearable: ""
2615
- }, null, 8, [
2616
- "modelValue",
2617
- "placeholder",
2618
- "onBlur"
2619
- ]),
2620
- b(p, {
2621
- modelValue: s.account_password,
2622
- "onUpdate:modelValue": h[5] || (h[5] = (d) => s.account_password = d),
2623
- ref: "account_password",
2624
- "prefix-icon": "ElIconLock",
2625
- placeholder: s.$t("输入您的密码"),
2626
- type: "password",
2627
- size: "large",
2628
- clearable: "",
2629
- onKeydown: n3(s.accessLoginFunc, ["enter"])
2630
- }, null, 8, [
2631
- "modelValue",
2632
- "placeholder",
2633
- "onKeydown"
2634
- ]),
2635
- s.codeNeed ? (A(), z(p, {
2636
- key: 0,
2637
- modelValue: s.captcha_code,
2638
- "onUpdate:modelValue": h[7] || (h[7] = (d) => s.captcha_code = d),
2639
- ref: "captcha_code",
2640
- class: "login-code",
2641
- placeholder: s.$t("输入图形验证码"),
2642
- type: "text",
2643
- size: "large",
2644
- clearable: "",
2645
- maxlength: "6"
2646
- }, {
2647
- prefix: I(() => [b(D, { type: "ElIconCircleCheck" })]),
2648
- append: I(() => [f("div", {
2649
- class: "login-code-end",
2650
- onClick: h[6] || (h[6] = (...d) => s.refreshCode && s.refreshCode(...d))
2651
- }, [s.codeLoad > 0 ? (A(), E("div", $3, [b(m)])) : s.codeUrl === "error" ? (A(), E("span", O3, C(s.$t("加载失败")), 1)) : (A(), E("img", {
2652
- key: 2,
2653
- src: s.codeUrl
2654
- }, null, 8, U3))])]),
2655
- _: 1
2656
- }, 8, ["modelValue", "placeholder"])) : B("", !0)
2657
- ]),
2658
- b(_, {
2659
- type: "primary",
2660
- loading: s.loadOngoing || s.loginJump,
2661
- size: "large",
2662
- style: {
2663
- width: "100%",
2664
- "margin-bottom": "15px"
2665
- },
2666
- onClick: s.accessLoginFunc
2667
- }, {
2668
- default: I(() => [N(C(s.loginJump ? "登录成功" : "登录"), 1)]),
2669
- _: 1
2670
- }, 8, ["loading", "onClick"]),
2671
- f("div", H3, [b(L, {
2672
- modelValue: s.cache_privacy,
2673
- "onUpdate:modelValue": h[9] || (h[9] = (d) => s.cache_privacy = d),
2674
- "true-value": "on",
2675
- "false-value": "off",
2676
- onChange: s.handleRrivacy
2677
- }, {
2678
- default: I(() => [h[17] || (h[17] = N(" 同意 ", -1)), f("a", {
2679
- onClick: h[8] || (h[8] = (d) => s.jumpsXieyi("privacy")),
2680
- target: "_blank"
2681
- }, "《隐私条款》")]),
2682
- _: 1
2683
- }, 8, ["modelValue", "onChange"]), f("a", {
2684
- href: "javascript:void(0)",
2685
- onClick: h[10] || (h[10] = (...d) => s.handleForgot && s.handleForgot(...d))
2686
- }, C(s.$t("忘记密码了?")), 1)]),
2687
- f("div", V3, [s.cacheInstConfig.open_business_reg == "on" ? (A(), E("div", F3, [N(C(s.$t("还没有帐号?")) + " ", 1), f("a", {
2688
- href: "javascript:void(0)",
2689
- onClick: h[11] || (h[11] = (d) => s.switchLoginMode("reg"))
2690
- }, C(s.$t("注册帐号")), 1)])) : B("", !0), s.cacheInstConfig.open_business_oauth2 == "on" ? (A(), E("div", z3, [f("a", {
2691
- href: "javascript:void(0)",
2692
- onClick: h[12] || (h[12] = (d) => s.switchLoginMode("oauth2"))
2693
- }, C(s.$t("OAuth2授权登陆")), 1)])) : B("", !0)])
2694
- ])
2695
- ])) : B("", !0),
2696
- s.loginMode == "qrcode" ? (A(), E("div", Q3, [
2697
- f("div", G3, [f("div", q3, [b(S, {
2698
- content: "帐号登录",
2699
- placement: "left"
2700
- }, {
2701
- default: I(() => [f("span", {
2702
- class: "login-mode-switch-icon",
2703
- onClick: h[13] || (h[13] = (d) => s.switchLoginMode("access"))
2704
- }, [b(w, { size: "45" }, {
2705
- default: I(() => [b(v3)]),
2706
- _: 1
2707
- })])]),
2708
- _: 1
2709
- })])]),
2710
- f("div", K3, C(s.$t("扫码登录")), 1),
2711
- f("div", J3, [b(w, {
2712
- size: "20",
2713
- style: { "margin-right": "10px" }
2714
- }, {
2715
- default: I(() => [b(w3)]),
2716
- _: 1
2717
- }), N(" " + C(s.$t(`请使用【${s.cacheInstInfo.LAST_IP_BRAND}】移动端扫描二维码`)), 1)]),
2718
- f("div", {
2719
- class: "login-qrcode",
2720
- onClick: h[14] || (h[14] = (...d) => s.scanQrcodeRefresh && s.scanQrcodeRefresh(...d))
2721
- }, [f("div", X3, null, 512)])
2722
- ])) : B("", !0),
2723
- s.loginMode == "oauth2" ? (A(), E("div", Y3, [
2724
- f("div", W3, C(s.cacheInstInfo.LAST_IP_TITLE), 1),
2725
- f("div", x3, C(s.$t("输入您的信息以创建帐户。")), 1),
2726
- f("div", Z3, [f("div", j3, [f("a", {
2727
- href: "javascript:void(0)",
2728
- onClick: h[15] || (h[15] = (d) => s.switchLoginMode("access"))
2729
- }, C(s.$t("帐号登录")), 1)])])
2730
- ])) : B("", !0)
2731
- ])), s.chainShowFlag ? (A(), z(i3, {
2732
- key: 1,
2733
- modelValue: s.chainAccountList,
2734
- "onUpdate:modelValue": h[16] || (h[16] = (d) => s.chainAccountList = d),
2735
- reselectTitle: "重新登录",
2736
- onReselectFunc: s.chainReselection,
2737
- onSelectFunc: s.chainBusinessCheck
2738
- }, null, 8, [
2739
- "modelValue",
2740
- "onReselectFunc",
2741
- "onSelectFunc"
2742
- ])) : B("", !0)]);
2743
- };
2744
- }
2745
- });
2746
- export {
2747
- oe as default
2748
- };