gws-client 1.1.2 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,91 +1,99 @@
1
- var xe = Object.defineProperty, Pe = Object.defineProperties;
2
- var $e = Object.getOwnPropertyDescriptors;
1
+ var be = Object.defineProperty, xe = Object.defineProperties;
2
+ var Ne = Object.getOwnPropertyDescriptors;
3
3
  var re = Object.getOwnPropertySymbols;
4
- var Ne = Object.prototype.hasOwnProperty, Le = Object.prototype.propertyIsEnumerable;
5
- var K = (s, e, t) => e in s ? xe(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, S = (s, e) => {
4
+ var $e = Object.prototype.hasOwnProperty, Te = Object.prototype.propertyIsEnumerable;
5
+ var Y = (s, e, t) => e in s ? be(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, m = (s, e) => {
6
6
  for (var t in e || (e = {}))
7
- Ne.call(e, t) && K(s, t, e[t]);
7
+ $e.call(e, t) && Y(s, t, e[t]);
8
8
  if (re)
9
9
  for (var t of re(e))
10
- Le.call(e, t) && K(s, t, e[t]);
10
+ Te.call(e, t) && Y(s, t, e[t]);
11
11
  return s;
12
- }, E = (s, e) => Pe(s, $e(e));
13
- var o = (s, e, t) => K(s, typeof e != "symbol" ? e + "" : e, t);
14
- var l = (s, e, t) => new Promise((n, r) => {
15
- var a = (d) => {
12
+ }, _ = (s, e) => xe(s, Ne(e));
13
+ var a = (s, e, t) => Y(s, typeof e != "symbol" ? e + "" : e, t);
14
+ var c = (s, e, t) => new Promise((n, i) => {
15
+ var r = (d) => {
16
16
  try {
17
- c(t.next(d));
17
+ l(t.next(d));
18
18
  } catch (u) {
19
- r(u);
19
+ i(u);
20
20
  }
21
- }, i = (d) => {
21
+ }, o = (d) => {
22
22
  try {
23
- c(t.throw(d));
23
+ l(t.throw(d));
24
24
  } catch (u) {
25
- r(u);
25
+ i(u);
26
26
  }
27
- }, c = (d) => d.done ? n(d.value) : Promise.resolve(d.value).then(a, i);
28
- c((t = t.apply(s, e)).next());
27
+ }, l = (d) => d.done ? n(d.value) : Promise.resolve(d.value).then(r, o);
28
+ l((t = t.apply(s, e)).next());
29
29
  });
30
- const Te = window.location.href.includes("https") ? "wss://localhost:19528" : "ws://localhost:9527", ae = "1", ie = "2";
30
+ const Me = window.location.href.includes("https") ? "wss://localhost:19528" : "ws://localhost:9527", ae = "1", oe = "2";
31
31
  var Se = /* @__PURE__ */ ((s) => (s.MIN = "0", s.LOW = "1", s.MIDDLE = "2", s.HIGH = "3", s))(Se || {});
32
- const Me = "00000001", Y = "NO_SEAL_AVAILABLE", Fe = "CERTIFICATE_NOT_FOUND", Ge = "CLIENT_CONNECTION_FAILED";
33
- function Oe(s) {
32
+ const I = {
33
+ LEVEL_1: 1,
34
+ LEVEL_2: 2,
35
+ LEVEL_3: 4
36
+ }, Fe = {
37
+ OPEN: I.LEVEL_1,
38
+ INTERNAL: I.LEVEL_2 | I.LEVEL_1,
39
+ OMP: I.LEVEL_3 | I.LEVEL_2 | I.LEVEL_1
40
+ }, Ge = "00000001", q = "NO_SEAL_AVAILABLE", Oe = "CERTIFICATE_NOT_FOUND", Ve = "CLIENT_CONNECTION_FAILED", Ze = "ACCESS_DENIED";
41
+ function He(s) {
34
42
  return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, "default") ? s.default : s;
35
43
  }
36
- var M = {}, oe;
37
- function He() {
38
- if (oe) return M;
39
- oe = 1, M.byteLength = c, M.toByteArray = u, M.fromByteArray = m;
40
- for (var s = [], e = [], t = typeof Uint8Array != "undefined" ? Uint8Array : Array, n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", r = 0, a = n.length; r < a; ++r)
41
- s[r] = n[r], e[n.charCodeAt(r)] = r;
44
+ var F = {}, ce;
45
+ function Ue() {
46
+ if (ce) return F;
47
+ ce = 1, F.byteLength = l, F.toByteArray = u, F.fromByteArray = w;
48
+ for (var s = [], e = [], t = typeof Uint8Array != "undefined" ? Uint8Array : Array, n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", i = 0, r = n.length; i < r; ++i)
49
+ s[i] = n[i], e[n.charCodeAt(i)] = i;
42
50
  e[45] = 62, e[95] = 63;
43
- function i(h) {
51
+ function o(h) {
44
52
  var f = h.length;
45
53
  if (f % 4 > 0)
46
54
  throw new Error("Invalid string. Length must be a multiple of 4");
47
- var w = h.indexOf("=");
48
- w === -1 && (w = f);
49
- var y = w === f ? 0 : 4 - w % 4;
50
- return [w, y];
55
+ var E = h.indexOf("=");
56
+ E === -1 && (E = f);
57
+ var y = E === f ? 0 : 4 - E % 4;
58
+ return [E, y];
51
59
  }
52
- function c(h) {
53
- var f = i(h), w = f[0], y = f[1];
54
- return (w + y) * 3 / 4 - y;
60
+ function l(h) {
61
+ var f = o(h), E = f[0], y = f[1];
62
+ return (E + y) * 3 / 4 - y;
55
63
  }
56
- function d(h, f, w) {
57
- return (f + w) * 3 / 4 - w;
64
+ function d(h, f, E) {
65
+ return (f + E) * 3 / 4 - E;
58
66
  }
59
67
  function u(h) {
60
- var f, w = i(h), y = w[0], p = w[1], v = new t(d(h, y, p)), I = 0, b = p > 0 ? y - 4 : y, k;
61
- for (k = 0; k < b; k += 4)
62
- f = e[h.charCodeAt(k)] << 18 | e[h.charCodeAt(k + 1)] << 12 | e[h.charCodeAt(k + 2)] << 6 | e[h.charCodeAt(k + 3)], v[I++] = f >> 16 & 255, v[I++] = f >> 8 & 255, v[I++] = f & 255;
63
- return p === 2 && (f = e[h.charCodeAt(k)] << 2 | e[h.charCodeAt(k + 1)] >> 4, v[I++] = f & 255), p === 1 && (f = e[h.charCodeAt(k)] << 10 | e[h.charCodeAt(k + 1)] << 4 | e[h.charCodeAt(k + 2)] >> 2, v[I++] = f >> 8 & 255, v[I++] = f & 255), v;
68
+ var f, E = o(h), y = E[0], S = E[1], k = new t(d(h, y, S)), p = 0, D = S > 0 ? y - 4 : y, v;
69
+ for (v = 0; v < D; v += 4)
70
+ f = e[h.charCodeAt(v)] << 18 | e[h.charCodeAt(v + 1)] << 12 | e[h.charCodeAt(v + 2)] << 6 | e[h.charCodeAt(v + 3)], k[p++] = f >> 16 & 255, k[p++] = f >> 8 & 255, k[p++] = f & 255;
71
+ return S === 2 && (f = e[h.charCodeAt(v)] << 2 | e[h.charCodeAt(v + 1)] >> 4, k[p++] = f & 255), S === 1 && (f = e[h.charCodeAt(v)] << 10 | e[h.charCodeAt(v + 1)] << 4 | e[h.charCodeAt(v + 2)] >> 2, k[p++] = f >> 8 & 255, k[p++] = f & 255), k;
64
72
  }
65
73
  function C(h) {
66
74
  return s[h >> 18 & 63] + s[h >> 12 & 63] + s[h >> 6 & 63] + s[h & 63];
67
75
  }
68
- function g(h, f, w) {
69
- for (var y, p = [], v = f; v < w; v += 3)
70
- y = (h[v] << 16 & 16711680) + (h[v + 1] << 8 & 65280) + (h[v + 2] & 255), p.push(C(y));
71
- return p.join("");
76
+ function g(h, f, E) {
77
+ for (var y, S = [], k = f; k < E; k += 3)
78
+ y = (h[k] << 16 & 16711680) + (h[k + 1] << 8 & 65280) + (h[k + 2] & 255), S.push(C(y));
79
+ return S.join("");
72
80
  }
73
- function m(h) {
74
- for (var f, w = h.length, y = w % 3, p = [], v = 16383, I = 0, b = w - y; I < b; I += v)
75
- p.push(g(h, I, I + v > b ? b : I + v));
76
- return y === 1 ? (f = h[w - 1], p.push(
81
+ function w(h) {
82
+ for (var f, E = h.length, y = E % 3, S = [], k = 16383, p = 0, D = E - y; p < D; p += k)
83
+ S.push(g(h, p, p + k > D ? D : p + k));
84
+ return y === 1 ? (f = h[E - 1], S.push(
77
85
  s[f >> 2] + s[f << 4 & 63] + "=="
78
- )) : y === 2 && (f = (h[w - 2] << 8) + h[w - 1], p.push(
86
+ )) : y === 2 && (f = (h[E - 2] << 8) + h[E - 1], S.push(
79
87
  s[f >> 10] + s[f >> 4 & 63] + s[f << 2 & 63] + "="
80
- )), p.join("");
88
+ )), S.join("");
81
89
  }
82
- return M;
90
+ return F;
83
91
  }
84
- var Ze = He();
85
- const ce = /* @__PURE__ */ Oe(Ze);
86
- class Ve {
92
+ var je = Ue();
93
+ const le = /* @__PURE__ */ He(je);
94
+ class Ke {
87
95
  constructor() {
88
- o(this, "deps", /* @__PURE__ */ new Map());
96
+ a(this, "deps", /* @__PURE__ */ new Map());
89
97
  }
90
98
  on(e, t) {
91
99
  this.deps.set(e, t);
@@ -103,26 +111,26 @@ class Ve {
103
111
  console.error("vite-plugin-css-injected-by-js", e);
104
112
  }
105
113
  })();
106
- var je = Object.defineProperty, Ue = (s, e, t) => e in s ? je(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, le = (s, e, t) => Ue(s, typeof e != "symbol" ? e + "" : e, t);
107
- function X() {
114
+ var ze = Object.defineProperty, Qe = (s, e, t) => e in s ? ze(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, ue = (s, e, t) => Qe(s, typeof e != "symbol" ? e + "" : e, t);
115
+ function ee() {
108
116
  }
109
- function ze(s, e) {
117
+ function We(s, e) {
110
118
  for (const t in e) s[t] = e[t];
111
119
  return (
112
120
  /** @type {T & S} */
113
121
  s
114
122
  );
115
123
  }
116
- function pe(s) {
124
+ function ve(s) {
117
125
  return s();
118
126
  }
119
- function ue() {
127
+ function de() {
120
128
  return /* @__PURE__ */ Object.create(null);
121
129
  }
122
- function Z(s) {
123
- s.forEach(pe);
130
+ function U(s) {
131
+ s.forEach(ve);
124
132
  }
125
- function G(s) {
133
+ function V(s) {
126
134
  return typeof s == "function";
127
135
  }
128
136
  function ke(s, e) {
@@ -131,37 +139,37 @@ function ke(s, e) {
131
139
  function Je(s) {
132
140
  return Object.keys(s).length === 0;
133
141
  }
134
- function Qe(s, e, t, n) {
142
+ function Re(s, e, t, n) {
135
143
  if (s) {
136
- const r = ve(s, e, t, n);
137
- return s[0](r);
144
+ const i = Ie(s, e, t, n);
145
+ return s[0](i);
138
146
  }
139
147
  }
140
- function ve(s, e, t, n) {
141
- return s[1] && n ? ze(t.ctx.slice(), s[1](n(e))) : t.ctx;
148
+ function Ie(s, e, t, n) {
149
+ return s[1] && n ? We(t.ctx.slice(), s[1](n(e))) : t.ctx;
142
150
  }
143
- function We(s, e, t, n) {
151
+ function Ye(s, e, t, n) {
144
152
  if (s[2] && n) {
145
- const r = s[2](n(t));
153
+ const i = s[2](n(t));
146
154
  if (e.dirty === void 0)
155
+ return i;
156
+ if (typeof i == "object") {
157
+ const r = [], o = Math.max(e.dirty.length, i.length);
158
+ for (let l = 0; l < o; l += 1)
159
+ r[l] = e.dirty[l] | i[l];
147
160
  return r;
148
- if (typeof r == "object") {
149
- const a = [], i = Math.max(e.dirty.length, r.length);
150
- for (let c = 0; c < i; c += 1)
151
- a[c] = e.dirty[c] | r[c];
152
- return a;
153
161
  }
154
- return e.dirty | r;
162
+ return e.dirty | i;
155
163
  }
156
164
  return e.dirty;
157
165
  }
158
- function qe(s, e, t, n, r, a) {
159
- if (r) {
160
- const i = ve(e, t, n, a);
161
- s.p(i, r);
166
+ function qe(s, e, t, n, i, r) {
167
+ if (i) {
168
+ const o = Ie(e, t, n, r);
169
+ s.p(o, i);
162
170
  }
163
171
  }
164
- function Ke(s) {
172
+ function Xe(s) {
165
173
  if (s.ctx.length > 32) {
166
174
  const e = [], t = s.ctx.length / 32;
167
175
  for (let n = 0; n < t; n++)
@@ -170,145 +178,145 @@ function Ke(s) {
170
178
  }
171
179
  return -1;
172
180
  }
173
- function de(s) {
181
+ function he(s) {
174
182
  return s == null ? "" : s;
175
183
  }
176
- function B(s, e) {
184
+ function L(s, e) {
177
185
  s.appendChild(e);
178
186
  }
179
- function q(s, e, t) {
187
+ function R(s, e, t) {
180
188
  s.insertBefore(e, t || null);
181
189
  }
182
- function V(s) {
190
+ function j(s) {
183
191
  s.parentNode && s.parentNode.removeChild(s);
184
192
  }
185
- function Ie(s, e) {
193
+ function pe(s, e) {
186
194
  for (let t = 0; t < s.length; t += 1)
187
195
  s[t] && s[t].d(e);
188
196
  }
189
- function _(s) {
197
+ function P(s) {
190
198
  return document.createElement(s);
191
199
  }
192
- function L(s) {
200
+ function T(s) {
193
201
  return document.createTextNode(s);
194
202
  }
195
- function j() {
196
- return L(" ");
203
+ function K() {
204
+ return T(" ");
197
205
  }
198
- function Ye() {
199
- return L("");
206
+ function et() {
207
+ return T("");
200
208
  }
201
- function F(s, e, t, n) {
209
+ function G(s, e, t, n) {
202
210
  return s.addEventListener(e, t, n), () => s.removeEventListener(e, t, n);
203
211
  }
204
- function D(s, e, t) {
212
+ function B(s, e, t) {
205
213
  t == null ? s.removeAttribute(e) : s.getAttribute(e) !== t && s.setAttribute(e, t);
206
214
  }
207
- function Re(s) {
215
+ function tt(s) {
208
216
  return Array.from(s.childNodes);
209
217
  }
210
- function U(s, e) {
218
+ function z(s, e) {
211
219
  e = "" + e, s.data !== e && (s.data = /** @type {string} */
212
220
  e);
213
221
  }
214
- function Q(s, e, t, n) {
222
+ function W(s, e, t, n) {
215
223
  t == null ? s.style.removeProperty(e) : s.style.setProperty(e, t, "");
216
224
  }
217
- let ne;
218
- function O(s) {
219
- ne = s;
225
+ let se;
226
+ function Z(s) {
227
+ se = s;
220
228
  }
221
- const $ = [], he = [];
222
- let T = [];
223
- const ge = [], Xe = /* @__PURE__ */ Promise.resolve();
224
- let ee = !1;
225
- function et() {
226
- ee || (ee = !0, Xe.then(Ee));
229
+ const N = [], ge = [];
230
+ let M = [];
231
+ const ye = [], nt = /* @__PURE__ */ Promise.resolve();
232
+ let te = !1;
233
+ function st() {
234
+ te || (te = !0, nt.then(_e));
227
235
  }
228
- function te(s) {
229
- T.push(s);
236
+ function ne(s) {
237
+ M.push(s);
230
238
  }
231
- const R = /* @__PURE__ */ new Set();
232
- let P = 0;
233
- function Ee() {
234
- if (P !== 0)
239
+ const X = /* @__PURE__ */ new Set();
240
+ let x = 0;
241
+ function _e() {
242
+ if (x !== 0)
235
243
  return;
236
- const s = ne;
244
+ const s = se;
237
245
  do {
238
246
  try {
239
- for (; P < $.length; ) {
240
- const e = $[P];
241
- P++, O(e), tt(e.$$);
247
+ for (; x < N.length; ) {
248
+ const e = N[x];
249
+ x++, Z(e), it(e.$$);
242
250
  }
243
251
  } catch (e) {
244
- throw $.length = 0, P = 0, e;
252
+ throw N.length = 0, x = 0, e;
245
253
  }
246
- for (O(null), $.length = 0, P = 0; he.length; ) he.pop()();
247
- for (let e = 0; e < T.length; e += 1) {
248
- const t = T[e];
249
- R.has(t) || (R.add(t), t());
254
+ for (Z(null), N.length = 0, x = 0; ge.length; ) ge.pop()();
255
+ for (let e = 0; e < M.length; e += 1) {
256
+ const t = M[e];
257
+ X.has(t) || (X.add(t), t());
250
258
  }
251
- T.length = 0;
252
- } while ($.length);
253
- for (; ge.length; )
254
- ge.pop()();
255
- ee = !1, R.clear(), O(s);
259
+ M.length = 0;
260
+ } while (N.length);
261
+ for (; ye.length; )
262
+ ye.pop()();
263
+ te = !1, X.clear(), Z(s);
256
264
  }
257
- function tt(s) {
265
+ function it(s) {
258
266
  if (s.fragment !== null) {
259
- s.update(), Z(s.before_update);
267
+ s.update(), U(s.before_update);
260
268
  const e = s.dirty;
261
- s.dirty = [-1], s.fragment && s.fragment.p(s.ctx, e), s.after_update.forEach(te);
269
+ s.dirty = [-1], s.fragment && s.fragment.p(s.ctx, e), s.after_update.forEach(ne);
262
270
  }
263
271
  }
264
- function nt(s) {
272
+ function rt(s) {
265
273
  const e = [], t = [];
266
- T.forEach((n) => s.indexOf(n) === -1 ? e.push(n) : t.push(n)), t.forEach((n) => n()), T = e;
274
+ M.forEach((n) => s.indexOf(n) === -1 ? e.push(n) : t.push(n)), t.forEach((n) => n()), M = e;
267
275
  }
268
- const z = /* @__PURE__ */ new Set();
269
- let st;
270
- function se(s, e) {
271
- s && s.i && (z.delete(s), s.i(e));
276
+ const Q = /* @__PURE__ */ new Set();
277
+ let at;
278
+ function ie(s, e) {
279
+ s && s.i && (Q.delete(s), s.i(e));
272
280
  }
273
- function Be(s, e, t, n) {
281
+ function Le(s, e, t, n) {
274
282
  if (s && s.o) {
275
- if (z.has(s)) return;
276
- z.add(s), st.c.push(() => {
277
- z.delete(s);
283
+ if (Q.has(s)) return;
284
+ Q.add(s), at.c.push(() => {
285
+ Q.delete(s);
278
286
  }), s.o(e);
279
287
  }
280
288
  }
281
- function W(s) {
289
+ function J(s) {
282
290
  return (s == null ? void 0 : s.length) !== void 0 ? s : Array.from(s);
283
291
  }
284
- function rt(s) {
292
+ function ot(s) {
285
293
  s && s.c();
286
294
  }
287
295
  function Ae(s, e, t) {
288
- const { fragment: n, after_update: r } = s.$$;
289
- n && n.m(e, t), te(() => {
290
- const a = s.$$.on_mount.map(pe).filter(G);
291
- s.$$.on_destroy ? s.$$.on_destroy.push(...a) : Z(a), s.$$.on_mount = [];
292
- }), r.forEach(te);
296
+ const { fragment: n, after_update: i } = s.$$;
297
+ n && n.m(e, t), ne(() => {
298
+ const r = s.$$.on_mount.map(ve).filter(V);
299
+ s.$$.on_destroy ? s.$$.on_destroy.push(...r) : U(r), s.$$.on_mount = [];
300
+ }), i.forEach(ne);
293
301
  }
294
- function De(s, e) {
302
+ function Be(s, e) {
295
303
  const t = s.$$;
296
- t.fragment !== null && (nt(t.after_update), Z(t.on_destroy), t.fragment && t.fragment.d(e), t.on_destroy = t.fragment = null, t.ctx = []);
304
+ t.fragment !== null && (rt(t.after_update), U(t.on_destroy), t.fragment && t.fragment.d(e), t.on_destroy = t.fragment = null, t.ctx = []);
297
305
  }
298
- function at(s, e) {
299
- s.$$.dirty[0] === -1 && ($.push(s), et(), s.$$.dirty.fill(0)), s.$$.dirty[e / 31 | 0] |= 1 << e % 31;
306
+ function ct(s, e) {
307
+ s.$$.dirty[0] === -1 && (N.push(s), st(), s.$$.dirty.fill(0)), s.$$.dirty[e / 31 | 0] |= 1 << e % 31;
300
308
  }
301
- function be(s, e, t, n, r, a, i = null, c = [-1]) {
302
- const d = ne;
303
- O(s);
309
+ function De(s, e, t, n, i, r, o = null, l = [-1]) {
310
+ const d = se;
311
+ Z(s);
304
312
  const u = s.$$ = {
305
313
  fragment: null,
306
314
  ctx: [],
307
315
  // state
308
- props: a,
309
- update: X,
310
- not_equal: r,
311
- bound: ue(),
316
+ props: r,
317
+ update: ee,
318
+ not_equal: i,
319
+ bound: de(),
312
320
  // lifecycle
313
321
  on_mount: [],
314
322
  on_destroy: [],
@@ -317,33 +325,33 @@ function be(s, e, t, n, r, a, i = null, c = [-1]) {
317
325
  after_update: [],
318
326
  context: new Map(e.context || (d ? d.$$.context : [])),
319
327
  // everything else
320
- callbacks: ue(),
321
- dirty: c,
328
+ callbacks: de(),
329
+ dirty: l,
322
330
  skip_bound: !1,
323
331
  root: e.target || d.$$.root
324
332
  };
325
- i && i(u.root);
333
+ o && o(u.root);
326
334
  let C = !1;
327
- if (u.ctx = t ? t(s, e.props || {}, (g, m, ...h) => {
328
- const f = h.length ? h[0] : m;
329
- return u.ctx && r(u.ctx[g], u.ctx[g] = f) && (!u.skip_bound && u.bound[g] && u.bound[g](f), C && at(s, g)), m;
330
- }) : [], u.update(), C = !0, Z(u.before_update), u.fragment = n ? n(u.ctx) : !1, e.target) {
335
+ if (u.ctx = t ? t(s, e.props || {}, (g, w, ...h) => {
336
+ const f = h.length ? h[0] : w;
337
+ return u.ctx && i(u.ctx[g], u.ctx[g] = f) && (!u.skip_bound && u.bound[g] && u.bound[g](f), C && ct(s, g)), w;
338
+ }) : [], u.update(), C = !0, U(u.before_update), u.fragment = n ? n(u.ctx) : !1, e.target) {
331
339
  if (e.hydrate) {
332
- const g = Re(e.target);
333
- u.fragment && u.fragment.l(g), g.forEach(V);
340
+ const g = tt(e.target);
341
+ u.fragment && u.fragment.l(g), g.forEach(j);
334
342
  } else
335
343
  u.fragment && u.fragment.c();
336
- e.intro && se(s.$$.fragment), Ae(s, e.target, e.anchor), Ee();
344
+ e.intro && ie(s.$$.fragment), Ae(s, e.target, e.anchor), _e();
337
345
  }
338
- O(d);
346
+ Z(d);
339
347
  }
340
- class _e {
348
+ class Pe {
341
349
  constructor() {
342
- le(this, "$$"), le(this, "$$set");
350
+ ue(this, "$$"), ue(this, "$$set");
343
351
  }
344
352
  /** @returns {void} */
345
353
  $destroy() {
346
- De(this, 1), this.$destroy = X;
354
+ Be(this, 1), this.$destroy = ee;
347
355
  }
348
356
  /**
349
357
  * @template {Extract<keyof Events, string>} K
@@ -352,12 +360,12 @@ class _e {
352
360
  * @returns {() => void}
353
361
  */
354
362
  $on(e, t) {
355
- if (!G(t))
356
- return X;
363
+ if (!V(t))
364
+ return ee;
357
365
  const n = this.$$.callbacks[e] || (this.$$.callbacks[e] = []);
358
366
  return n.push(t), () => {
359
- const r = n.indexOf(t);
360
- r !== -1 && n.splice(r, 1);
367
+ const i = n.indexOf(t);
368
+ i !== -1 && n.splice(i, 1);
361
369
  };
362
370
  }
363
371
  /**
@@ -368,24 +376,24 @@ class _e {
368
376
  this.$$set && !Je(e) && (this.$$.skip_bound = !0, this.$$set(e), this.$$.skip_bound = !1);
369
377
  }
370
378
  }
371
- const it = "4";
372
- typeof window != "undefined" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(it);
373
- function ot(s) {
374
- let e, t, n, r = (
379
+ const lt = "4";
380
+ typeof window != "undefined" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(lt);
381
+ function ut(s) {
382
+ let e, t, n, i = (
375
383
  /*title*/
376
384
  (s[1] || "标题") + ""
377
- ), a, i, c, d, u, C, g = (
385
+ ), r, o, l, d, u, C, g = (
378
386
  /*cancelText*/
379
387
  (s[4] || "取消") + ""
380
- ), m, h, f, w = (
388
+ ), w, h, f, E = (
381
389
  /*okText*/
382
390
  (s[5] || "确认") + ""
383
- ), y, p, v, I;
384
- const b = (
391
+ ), y, S, k, p;
392
+ const D = (
385
393
  /*#slots*/
386
394
  s[8].default
387
- ), k = Qe(
388
- b,
395
+ ), v = Re(
396
+ D,
389
397
  s,
390
398
  /*$$scope*/
391
399
  s[7],
@@ -393,63 +401,63 @@ function ot(s) {
393
401
  );
394
402
  return {
395
403
  c() {
396
- e = _("div"), t = _("div"), n = _("div"), a = L(r), i = j(), c = _("div"), k && k.c(), d = j(), u = _("div"), C = _("button"), m = L(g), h = j(), f = _("button"), y = L(w), D(n, "class", "model-title svelte-16iv9d0"), D(c, "class", "slot svelte-16iv9d0"), D(C, "class", "modal-btn svelte-16iv9d0"), D(f, "class", "modal-btn success svelte-16iv9d0"), Q(
404
+ e = P("div"), t = P("div"), n = P("div"), r = T(i), o = K(), l = P("div"), v && v.c(), d = K(), u = P("div"), C = P("button"), w = T(g), h = K(), f = P("button"), y = T(E), B(n, "class", "model-title svelte-16iv9d0"), B(l, "class", "slot svelte-16iv9d0"), B(C, "class", "modal-btn svelte-16iv9d0"), B(f, "class", "modal-btn success svelte-16iv9d0"), W(
397
405
  f,
398
406
  "background-color",
399
407
  /*theme*/
400
408
  s[6]
401
- ), D(u, "class", "modal-footer svelte-16iv9d0"), D(t, "class", "modal-content svelte-16iv9d0"), D(e, "class", "modal-background modal-visible svelte-16iv9d0");
409
+ ), B(u, "class", "modal-footer svelte-16iv9d0"), B(t, "class", "modal-content svelte-16iv9d0"), B(e, "class", "modal-background modal-visible svelte-16iv9d0");
402
410
  },
403
- m(A, x) {
404
- q(A, e, x), B(e, t), B(t, n), B(n, a), B(t, i), B(t, c), k && k.m(c, null), B(t, d), B(t, u), B(u, C), B(C, m), B(u, h), B(u, f), B(f, y), p = !0, v || (I = [
405
- F(C, "click", function() {
406
- G(
411
+ m(A, b) {
412
+ R(A, e, b), L(e, t), L(t, n), L(n, r), L(t, o), L(t, l), v && v.m(l, null), L(t, d), L(t, u), L(u, C), L(C, w), L(u, h), L(u, f), L(f, y), S = !0, k || (p = [
413
+ G(C, "click", function() {
414
+ V(
407
415
  /*onCancel*/
408
416
  s[0]
409
417
  ) && s[0].apply(this, arguments);
410
418
  }),
411
- F(f, "click", function() {
412
- G(
419
+ G(f, "click", function() {
420
+ V(
413
421
  /*onOk*/
414
422
  s[2]
415
423
  ) && s[2].apply(this, arguments);
416
424
  }),
417
- F(t, "click", ct),
418
- F(e, "click", function() {
419
- G(
425
+ G(t, "click", dt),
426
+ G(e, "click", function() {
427
+ V(
420
428
  /*onClose*/
421
429
  s[3]
422
430
  ) && s[3].apply(this, arguments);
423
431
  })
424
- ], v = !0);
432
+ ], k = !0);
425
433
  },
426
- p(A, [x]) {
427
- s = A, (!p || x & /*title*/
428
- 2) && r !== (r = /*title*/
429
- (s[1] || "标题") + "") && U(a, r), k && k.p && (!p || x & /*$$scope*/
434
+ p(A, [b]) {
435
+ s = A, (!S || b & /*title*/
436
+ 2) && i !== (i = /*title*/
437
+ (s[1] || "标题") + "") && z(r, i), v && v.p && (!S || b & /*$$scope*/
430
438
  128) && qe(
431
- k,
432
- b,
439
+ v,
440
+ D,
433
441
  s,
434
442
  /*$$scope*/
435
443
  s[7],
436
- p ? We(
437
- b,
444
+ S ? Ye(
445
+ D,
438
446
  /*$$scope*/
439
447
  s[7],
440
- x,
448
+ b,
441
449
  null
442
- ) : Ke(
450
+ ) : Xe(
443
451
  /*$$scope*/
444
452
  s[7]
445
453
  ),
446
454
  null
447
- ), (!p || x & /*cancelText*/
455
+ ), (!S || b & /*cancelText*/
448
456
  16) && g !== (g = /*cancelText*/
449
- (s[4] || "取消") + "") && U(m, g), (!p || x & /*okText*/
450
- 32) && w !== (w = /*okText*/
451
- (s[5] || "确认") + "") && U(y, w), (!p || x & /*theme*/
452
- 64) && Q(
457
+ (s[4] || "取消") + "") && z(w, g), (!S || b & /*okText*/
458
+ 32) && E !== (E = /*okText*/
459
+ (s[5] || "确认") + "") && z(y, E), (!S || b & /*theme*/
460
+ 64) && W(
453
461
  f,
454
462
  "background-color",
455
463
  /*theme*/
@@ -457,26 +465,26 @@ function ot(s) {
457
465
  );
458
466
  },
459
467
  i(A) {
460
- p || (se(k, A), p = !0);
468
+ S || (ie(v, A), S = !0);
461
469
  },
462
470
  o(A) {
463
- Be(k, A), p = !1;
471
+ Le(v, A), S = !1;
464
472
  },
465
473
  d(A) {
466
- A && V(e), k && k.d(A), v = !1, Z(I);
474
+ A && j(e), v && v.d(A), k = !1, U(p);
467
475
  }
468
476
  };
469
477
  }
470
- const ct = (s) => s.stopPropagation();
471
- function lt(s, e, t) {
472
- let { $$slots: n = {}, $$scope: r } = e, { onCancel: a } = e, { title: i } = e, { onOk: c } = e, { onClose: d } = e, { cancelText: u } = e, { okText: C } = e, { theme: g } = e;
473
- return s.$$set = (m) => {
474
- "onCancel" in m && t(0, a = m.onCancel), "title" in m && t(1, i = m.title), "onOk" in m && t(2, c = m.onOk), "onClose" in m && t(3, d = m.onClose), "cancelText" in m && t(4, u = m.cancelText), "okText" in m && t(5, C = m.okText), "theme" in m && t(6, g = m.theme), "$$scope" in m && t(7, r = m.$$scope);
475
- }, [a, i, c, d, u, C, g, r, n];
478
+ const dt = (s) => s.stopPropagation();
479
+ function ht(s, e, t) {
480
+ let { $$slots: n = {}, $$scope: i } = e, { onCancel: r } = e, { title: o } = e, { onOk: l } = e, { onClose: d } = e, { cancelText: u } = e, { okText: C } = e, { theme: g } = e;
481
+ return s.$$set = (w) => {
482
+ "onCancel" in w && t(0, r = w.onCancel), "title" in w && t(1, o = w.title), "onOk" in w && t(2, l = w.onOk), "onClose" in w && t(3, d = w.onClose), "cancelText" in w && t(4, u = w.cancelText), "okText" in w && t(5, C = w.okText), "theme" in w && t(6, g = w.theme), "$$scope" in w && t(7, i = w.$$scope);
483
+ }, [r, o, l, d, u, C, g, i, n];
476
484
  }
477
- class ut extends _e {
485
+ class gt extends Pe {
478
486
  constructor(e) {
479
- super(), be(this, e, lt, ot, ke, {
487
+ super(), De(this, e, ht, ut, ke, {
480
488
  onCancel: 0,
481
489
  title: 1,
482
490
  onOk: 2,
@@ -487,15 +495,15 @@ class ut extends _e {
487
495
  });
488
496
  }
489
497
  }
490
- function ye(s, e, t) {
498
+ function fe(s, e, t) {
491
499
  const n = s.slice();
492
500
  return n[13] = e[t], n[15] = t, n;
493
501
  }
494
- function fe(s, e, t) {
502
+ function Ce(s, e, t) {
495
503
  const n = s.slice();
496
504
  return n[16] = e[t], n;
497
505
  }
498
- function Ce(s) {
506
+ function we(s) {
499
507
  let e, t = (
500
508
  /*col*/
501
509
  (s[16].format ? (
@@ -514,43 +522,43 @@ function Ce(s) {
514
522
  ), n;
515
523
  return {
516
524
  c() {
517
- e = _("div"), n = L(t), D(e, "class", "svelte-1kh75ag"), Q(e, "width", `${100 / /*columns*/
525
+ e = P("div"), n = T(t), B(e, "class", "svelte-1kh75ag"), W(e, "width", `${100 / /*columns*/
518
526
  s[1].length}%`);
519
527
  },
520
- m(r, a) {
521
- q(r, e, a), B(e, n);
528
+ m(i, r) {
529
+ R(i, e, r), L(e, n);
522
530
  },
523
- p(r, a) {
524
- a & /*columns, data*/
531
+ p(i, r) {
532
+ r & /*columns, data*/
525
533
  3 && t !== (t = /*col*/
526
- (r[16].format ? (
534
+ (i[16].format ? (
527
535
  /*col*/
528
- r[16].format(
536
+ i[16].format(
529
537
  /*row*/
530
- r[13]
538
+ i[13]
531
539
  )
532
540
  ) : (
533
541
  /*row*/
534
- r[13][
542
+ i[13][
535
543
  /*col*/
536
- r[16].key
544
+ i[16].key
537
545
  ]
538
- )) + "") && U(n, t), a & /*columns*/
539
- 2 && Q(e, "width", `${100 / /*columns*/
540
- r[1].length}%`);
546
+ )) + "") && z(n, t), r & /*columns*/
547
+ 2 && W(e, "width", `${100 / /*columns*/
548
+ i[1].length}%`);
541
549
  },
542
- d(r) {
543
- r && V(e);
550
+ d(i) {
551
+ i && j(e);
544
552
  }
545
553
  };
546
554
  }
547
555
  function me(s) {
548
- let e, t, n, r, a, i = W(
556
+ let e, t, n, i, r, o = J(
549
557
  /*columns*/
550
558
  s[1]
551
- ), c = [];
552
- for (let u = 0; u < i.length; u += 1)
553
- c[u] = Ce(fe(s, i, u));
559
+ ), l = [];
560
+ for (let u = 0; u < o.length; u += 1)
561
+ l[u] = we(Ce(s, o, u));
554
562
  function d() {
555
563
  return (
556
564
  /*click_handler*/
@@ -562,90 +570,90 @@ function me(s) {
562
570
  }
563
571
  return {
564
572
  c() {
565
- e = _("div");
566
- for (let u = 0; u < c.length; u += 1)
567
- c[u].c();
568
- t = j(), D(e, "class", n = de(`cert-item ${/*index*/
573
+ e = P("div");
574
+ for (let u = 0; u < l.length; u += 1)
575
+ l[u].c();
576
+ t = K(), B(e, "class", n = he(`cert-item ${/*index*/
569
577
  s[15] === 0 ? "cert-item-first" : ""} ${/*index*/
570
578
  s[15] === /*selectedIndex*/
571
579
  s[7] ? "cert-item-selected" : ""}`) + " svelte-1kh75ag");
572
580
  },
573
581
  m(u, C) {
574
- q(u, e, C);
575
- for (let g = 0; g < c.length; g += 1)
576
- c[g] && c[g].m(e, null);
577
- B(e, t), r || (a = F(e, "click", d), r = !0);
582
+ R(u, e, C);
583
+ for (let g = 0; g < l.length; g += 1)
584
+ l[g] && l[g].m(e, null);
585
+ L(e, t), i || (r = G(e, "click", d), i = !0);
578
586
  },
579
587
  p(u, C) {
580
588
  if (s = u, C & /*columns, data*/
581
589
  3) {
582
- i = W(
590
+ o = J(
583
591
  /*columns*/
584
592
  s[1]
585
593
  );
586
594
  let g;
587
- for (g = 0; g < i.length; g += 1) {
588
- const m = fe(s, i, g);
589
- c[g] ? c[g].p(m, C) : (c[g] = Ce(m), c[g].c(), c[g].m(e, t));
595
+ for (g = 0; g < o.length; g += 1) {
596
+ const w = Ce(s, o, g);
597
+ l[g] ? l[g].p(w, C) : (l[g] = we(w), l[g].c(), l[g].m(e, t));
590
598
  }
591
- for (; g < c.length; g += 1)
592
- c[g].d(1);
593
- c.length = i.length;
599
+ for (; g < l.length; g += 1)
600
+ l[g].d(1);
601
+ l.length = o.length;
594
602
  }
595
603
  C & /*selectedIndex*/
596
- 128 && n !== (n = de(`cert-item ${/*index*/
604
+ 128 && n !== (n = he(`cert-item ${/*index*/
597
605
  s[15] === 0 ? "cert-item-first" : ""} ${/*index*/
598
606
  s[15] === /*selectedIndex*/
599
- s[7] ? "cert-item-selected" : ""}`) + " svelte-1kh75ag") && D(e, "class", n);
607
+ s[7] ? "cert-item-selected" : ""}`) + " svelte-1kh75ag") && B(e, "class", n);
600
608
  },
601
609
  d(u) {
602
- u && V(e), Ie(c, u), r = !1, a();
610
+ u && j(e), pe(l, u), i = !1, r();
603
611
  }
604
612
  };
605
613
  }
606
- function dt(s) {
607
- let e, t = W(
614
+ function yt(s) {
615
+ let e, t = J(
608
616
  /*data*/
609
617
  s[0]
610
618
  ), n = [];
611
- for (let r = 0; r < t.length; r += 1)
612
- n[r] = me(ye(s, t, r));
619
+ for (let i = 0; i < t.length; i += 1)
620
+ n[i] = me(fe(s, t, i));
613
621
  return {
614
622
  c() {
615
- for (let r = 0; r < n.length; r += 1)
616
- n[r].c();
617
- e = Ye();
618
- },
619
- m(r, a) {
620
623
  for (let i = 0; i < n.length; i += 1)
621
- n[i] && n[i].m(r, a);
622
- q(r, e, a);
624
+ n[i].c();
625
+ e = et();
623
626
  },
624
- p(r, a) {
625
- if (a & /*selectedIndex, columns, data*/
627
+ m(i, r) {
628
+ for (let o = 0; o < n.length; o += 1)
629
+ n[o] && n[o].m(i, r);
630
+ R(i, e, r);
631
+ },
632
+ p(i, r) {
633
+ if (r & /*selectedIndex, columns, data*/
626
634
  131) {
627
- t = W(
635
+ t = J(
628
636
  /*data*/
629
- r[0]
637
+ i[0]
630
638
  );
631
- let i;
632
- for (i = 0; i < t.length; i += 1) {
633
- const c = ye(r, t, i);
634
- n[i] ? n[i].p(c, a) : (n[i] = me(c), n[i].c(), n[i].m(e.parentNode, e));
639
+ let o;
640
+ for (o = 0; o < t.length; o += 1) {
641
+ const l = fe(i, t, o);
642
+ n[o] ? n[o].p(l, r) : (n[o] = me(l), n[o].c(), n[o].m(e.parentNode, e));
635
643
  }
636
- for (; i < n.length; i += 1)
637
- n[i].d(1);
644
+ for (; o < n.length; o += 1)
645
+ n[o].d(1);
638
646
  n.length = t.length;
639
647
  }
640
648
  },
641
- d(r) {
642
- r && V(e), Ie(n, r);
649
+ d(i) {
650
+ i && j(e), pe(n, i);
643
651
  }
644
652
  };
645
653
  }
646
- function ht(s) {
654
+ function ft(s) {
647
655
  let e, t;
648
- return e = new ut({
656
+ return e = new gt({
649
657
  props: {
650
658
  onOk: (
651
659
  /*handleOk*/
@@ -675,70 +683,70 @@ function ht(s) {
675
683
  /*theme*/
676
684
  s[5]
677
685
  ),
678
- $$slots: { default: [dt] },
686
+ $$slots: { default: [yt] },
679
687
  $$scope: { ctx: s }
680
688
  }
681
689
  }), {
682
690
  c() {
683
- rt(e.$$.fragment);
691
+ ot(e.$$.fragment);
684
692
  },
685
- m(n, r) {
686
- Ae(e, n, r), t = !0;
693
+ m(n, i) {
694
+ Ae(e, n, i), t = !0;
687
695
  },
688
- p(n, [r]) {
689
- const a = {};
690
- r & /*onClose*/
691
- 4 && (a.onClose = /*onClose*/
692
- n[2]), r & /*cancelText*/
693
- 8 && (a.cancelText = /*cancelText*/
694
- n[3]), r & /*okText*/
695
- 16 && (a.okText = /*okText*/
696
- n[4]), r & /*title*/
697
- 64 && (a.title = /*title*/
698
- n[6]), r & /*theme*/
699
- 32 && (a.theme = /*theme*/
700
- n[5]), r & /*$$scope, data, selectedIndex, columns*/
701
- 524419 && (a.$$scope = { dirty: r, ctx: n }), e.$set(a);
696
+ p(n, [i]) {
697
+ const r = {};
698
+ i & /*onClose*/
699
+ 4 && (r.onClose = /*onClose*/
700
+ n[2]), i & /*cancelText*/
701
+ 8 && (r.cancelText = /*cancelText*/
702
+ n[3]), i & /*okText*/
703
+ 16 && (r.okText = /*okText*/
704
+ n[4]), i & /*title*/
705
+ 64 && (r.title = /*title*/
706
+ n[6]), i & /*theme*/
707
+ 32 && (r.theme = /*theme*/
708
+ n[5]), i & /*$$scope, data, selectedIndex, columns*/
709
+ 524419 && (r.$$scope = { dirty: i, ctx: n }), e.$set(r);
702
710
  },
703
711
  i(n) {
704
- t || (se(e.$$.fragment, n), t = !0);
712
+ t || (ie(e.$$.fragment, n), t = !0);
705
713
  },
706
714
  o(n) {
707
- Be(e.$$.fragment, n), t = !1;
715
+ Le(e.$$.fragment, n), t = !1;
708
716
  },
709
717
  d(n) {
710
- De(e, n);
718
+ Be(e, n);
711
719
  }
712
720
  };
713
721
  }
714
- function gt(s, e, t) {
715
- let { data: n = [] } = e, { columns: r = [] } = e, { onCancel: a } = e, { onOk: i } = e, { onClose: c } = e, { cancelText: d = "" } = e, { okText: u = "" } = e, { theme: C = "#409eff" } = e, { title: g = "" } = e, m = 0;
722
+ function Ct(s, e, t) {
723
+ let { data: n = [] } = e, { columns: i = [] } = e, { onCancel: r } = e, { onOk: o } = e, { onClose: l } = e, { cancelText: d = "" } = e, { okText: u = "" } = e, { theme: C = "#409eff" } = e, { title: g = "" } = e, w = 0;
716
724
  const h = () => {
717
- a(`${g}失败`), c == null || c();
725
+ r(`${g}失败`), l == null || l();
718
726
  }, f = () => {
719
- i == null || i(n[m]), c == null || c();
720
- }, w = (y) => t(7, m = y);
727
+ o == null || o(n[w]), l == null || l();
728
+ }, E = (y) => t(7, w = y);
721
729
  return s.$$set = (y) => {
722
- "data" in y && t(0, n = y.data), "columns" in y && t(1, r = y.columns), "onCancel" in y && t(10, a = y.onCancel), "onOk" in y && t(11, i = y.onOk), "onClose" in y && t(2, c = y.onClose), "cancelText" in y && t(3, d = y.cancelText), "okText" in y && t(4, u = y.okText), "theme" in y && t(5, C = y.theme), "title" in y && t(6, g = y.title);
730
+ "data" in y && t(0, n = y.data), "columns" in y && t(1, i = y.columns), "onCancel" in y && t(10, r = y.onCancel), "onOk" in y && t(11, o = y.onOk), "onClose" in y && t(2, l = y.onClose), "cancelText" in y && t(3, d = y.cancelText), "okText" in y && t(4, u = y.okText), "theme" in y && t(5, C = y.theme), "title" in y && t(6, g = y.title);
723
731
  }, [
724
732
  n,
725
- r,
726
- c,
733
+ i,
734
+ l,
727
735
  d,
728
736
  u,
729
737
  C,
730
738
  g,
731
- m,
739
+ w,
732
740
  h,
733
741
  f,
734
- a,
735
- i,
736
- w
742
+ r,
743
+ o,
744
+ E
737
745
  ];
738
746
  }
739
- class yt extends _e {
747
+ class wt extends Pe {
740
748
  constructor(e) {
741
- super(), be(this, e, gt, ht, ke, {
749
+ super(), De(this, e, Ct, ft, ke, {
742
750
  data: 0,
743
751
  columns: 1,
744
752
  onCancel: 10,
@@ -751,21 +759,21 @@ class yt extends _e {
751
759
  });
752
760
  }
753
761
  }
754
- class ft {
762
+ class mt {
755
763
  constructor() {
756
- o(this, "modalInstance", { current: null });
757
- o(this, "open", (e) => new Promise((t, n) => {
758
- this.modalInstance.current = new yt({
764
+ a(this, "modalInstance", { current: null });
765
+ a(this, "open", (e) => new Promise((t, n) => {
766
+ this.modalInstance.current = new wt({
759
767
  target: document.body,
760
- props: E(S({}, e), {
761
- onCancel: (r) => {
768
+ props: _(m({}, e), {
769
+ onCancel: (i) => {
762
770
  n({
763
771
  code: -1,
764
- msg: r
772
+ msg: i
765
773
  });
766
774
  },
767
- onOk: (r) => {
768
- t(r);
775
+ onOk: (i) => {
776
+ t(i);
769
777
  },
770
778
  onClose: () => {
771
779
  this.close();
@@ -773,7 +781,7 @@ class ft {
773
781
  })
774
782
  });
775
783
  }));
776
- o(this, "close", () => {
784
+ a(this, "close", () => {
777
785
  setTimeout(() => {
778
786
  var e;
779
787
  (e = this.modalInstance.current) == null || e.$destroy();
@@ -781,27 +789,27 @@ class ft {
781
789
  });
782
790
  }
783
791
  }
784
- const J = new ft();
785
- function Ct(s = 32, e = !0, t = 0) {
786
- const n = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""), r = [];
792
+ const O = new mt();
793
+ function Et(s = 32, e = !0, t = 0) {
794
+ const n = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""), i = [];
787
795
  if (t = t || n.length, s)
788
- for (let a = 0; a < s; a++) r[a] = n[0 | Math.random() * t];
796
+ for (let r = 0; r < s; r++) i[r] = n[0 | Math.random() * t];
789
797
  else {
790
- let a;
791
- r[8] = r[13] = r[18] = r[23] = "-", r[14] = "4";
792
- for (let i = 0; i < 36; i++)
793
- r[i] || (a = 0 | Math.random() * 16, r[i] = n[i === 19 ? a & 3 | 8 : a]);
798
+ let r;
799
+ i[8] = i[13] = i[18] = i[23] = "-", i[14] = "4";
800
+ for (let o = 0; o < 36; o++)
801
+ i[o] || (r = 0 | Math.random() * 16, i[o] = n[o === 19 ? r & 3 | 8 : r]);
794
802
  }
795
- return e ? (r.shift(), `u${r.join("")}`) : r.join("");
803
+ return e ? (i.shift(), `u${i.join("")}`) : i.join("");
796
804
  }
797
- const mt = [
805
+ const St = [
798
806
  {
799
807
  key: "CN"
800
808
  },
801
809
  {
802
810
  format: (s) => `${s.DevClass}(${s.sn})`
803
811
  }
804
- ], wt = [
812
+ ], vt = [
805
813
  {
806
814
  key: "SealId"
807
815
  },
@@ -811,102 +819,119 @@ const mt = [
811
819
  {
812
820
  format: (s) => `${s.FileName}(${s.FileSize}B)`
813
821
  }
814
- ], we = [
822
+ ], Ee = [
815
823
  {
816
824
  key: "SealId"
817
825
  }
826
+ ], kt = [
827
+ {
828
+ key: "manu"
829
+ },
830
+ {
831
+ key: "sn"
832
+ }
818
833
  ];
819
- class St {
834
+ class It {
820
835
  constructor(e) {
821
- o(this, "socketInstance", null);
822
- o(this, "eventBus", new Ve());
823
- o(this, "isRememberPin", !1);
824
- o(this, "pinPolicy");
825
- o(this, "socketConfig", null);
826
- o(this, "isConnecting", !1);
827
- o(this, "messageQueue", []);
828
- o(this, "getSocketReadyState", () => {
836
+ a(this, "socketInstance", null);
837
+ a(this, "eventBus", new Ke());
838
+ a(this, "scene");
839
+ a(this, "isRememberPin", !1);
840
+ a(this, "pinPolicy");
841
+ a(this, "socketConfig", null);
842
+ a(this, "isConnecting", !1);
843
+ a(this, "messageQueue", []);
844
+ a(this, "getSocketReadyState", () => {
829
845
  var e;
830
846
  return (e = this.socketInstance) == null ? void 0 : e.readyState;
831
847
  });
832
- o(this, "destroy", () => {
848
+ a(this, "destroy", () => {
833
849
  var e;
834
850
  (e = this.socketInstance) == null || e.close();
835
851
  });
836
- o(this, "sendMessage", (e, t) => new Promise((n, r) => {
837
- var i;
838
- const a = () => {
839
- var C, g;
840
- if (((C = this.socketInstance) == null ? void 0 : C.readyState) !== WebSocket.OPEN) {
852
+ a(this, "sendMessage", (e, t, n) => new Promise((i, r) => {
853
+ var l;
854
+ const o = () => {
855
+ var g, w;
856
+ if (((g = this.socketInstance) == null ? void 0 : g.readyState) !== WebSocket.OPEN) {
841
857
  r({
842
- errCode: Ge,
858
+ errCode: Ve,
843
859
  msg: "数字证书客户端连接失败"
844
860
  });
845
861
  return;
846
862
  }
847
- const c = Ct(), d = (m) => {
848
- m.success ? n(m.data) : r(m);
849
- }, u = {
863
+ const d = Et(), u = (h) => {
864
+ h.success ? i(h.data) : r(h);
865
+ }, C = {
850
866
  function: e,
851
- args: [t != null ? t : {}],
852
- msgid: c
867
+ args: t ? [t] : [],
868
+ msgid: d
853
869
  };
854
- (g = this.socketInstance) == null || g.send(JSON.stringify(u)), this.eventBus.on(e, d), this.eventBus.on(c, d);
870
+ (w = this.socketInstance) == null || w.send(JSON.stringify(C)), this.eventBus.on(e, u), this.eventBus.on(d, u);
855
871
  };
856
- if (((i = this.socketInstance) == null ? void 0 : i.readyState) === WebSocket.OPEN) {
857
- a();
872
+ if (n && (this.scene & n) !== n) {
873
+ r({
874
+ errCode: Ze,
875
+ msg: "无权限执行此操作"
876
+ });
858
877
  return;
859
878
  }
860
- this.messageQueue.push(a), this.isConnecting || this.initSocket(this.socketConfig);
879
+ if (((l = this.socketInstance) == null ? void 0 : l.readyState) === WebSocket.OPEN) {
880
+ o();
881
+ return;
882
+ }
883
+ this.messageQueue.push(o), this.isConnecting || this.initSocket(this.socketConfig);
861
884
  }));
862
- o(this, "flushMsgQueue", () => {
885
+ a(this, "flushMsgQueue", () => {
863
886
  var e;
864
887
  (e = this.messageQueue) == null || e.forEach((t) => t()), this.messageQueue = [];
865
888
  });
866
- o(this, "handleEventData", (e) => l(this, null, function* () {
867
- var t, n, r, a, i, c, d, u;
889
+ a(this, "handleEventData", (e) => c(this, null, function* () {
890
+ var t, n, i, r, o, l, d, u;
868
891
  if (e.data instanceof Blob) {
869
- const C = yield e.data.arrayBuffer(), m = new TextDecoder("gbk").decode(C), h = JSON.parse(m), f = {
892
+ const C = yield e.data.arrayBuffer(), w = new TextDecoder(
893
+ navigator.userAgent.includes("Windows") ? "gbk" : "utf-8"
894
+ ).decode(C), h = JSON.parse(w), f = {
870
895
  success: (t = h.result) == null ? void 0 : t.success,
871
896
  msg: (n = h.result) == null ? void 0 : n.msg,
872
- errCode: (r = h.result) == null ? void 0 : r.errCode,
897
+ errCode: (i = h.result) == null ? void 0 : i.errCode,
873
898
  data: h.data,
874
- type: (a = h.result) == null ? void 0 : a.event
875
- }, w = (i = h.result) == null ? void 0 : i.function, y = (c = h.result) == null ? void 0 : c.msgid;
876
- y ? this.eventBus.emit(y, f) : this.eventBus.emit(w, f), (u = (d = this.socketConfig) == null ? void 0 : d.onMessage) == null || u.call(d, f);
899
+ type: (r = h.result) == null ? void 0 : r.event
900
+ }, E = (o = h.result) == null ? void 0 : o.function, y = (l = h.result) == null ? void 0 : l.msgid;
901
+ y ? this.eventBus.emit(y, f) : this.eventBus.emit(E, f), (u = (d = this.socketConfig) == null ? void 0 : d.onMessage) == null || u.call(d, f);
877
902
  }
878
903
  }));
879
- o(this, "base64Encode", (e) => {
904
+ a(this, "base64Encode", (e) => {
880
905
  const t = new TextEncoder().encode(e);
881
- return ce.fromByteArray(t);
906
+ return le.fromByteArray(t);
882
907
  });
883
- o(this, "base64Decode", (e) => {
884
- const t = ce.toByteArray(e);
908
+ a(this, "base64Decode", (e) => {
909
+ const t = le.toByteArray(e);
885
910
  return new TextDecoder().decode(t);
886
911
  });
887
- o(this, "changeIsRememberPin", (e) => l(this, null, function* () {
912
+ a(this, "changeIsRememberPin", (e) => c(this, null, function* () {
888
913
  this.isRememberPin = e;
889
914
  }));
890
- o(this, "changePinPolicy", (e) => l(this, null, function* () {
915
+ a(this, "changePinPolicy", (e) => c(this, null, function* () {
891
916
  this.pinPolicy = e;
892
917
  }));
893
- o(this, "checkCertIsLogin", (e) => l(this, null, function* () {
918
+ a(this, "checkCertIsLogin", (e) => c(this, null, function* () {
894
919
  return yield this.sendMessage("GZCA_IsLogin", e);
895
920
  }));
896
- o(this, "addUkeyEvents", () => l(this, null, function* () {
921
+ a(this, "addUkeyEvents", () => c(this, null, function* () {
897
922
  this.sendMessage("GZCA_WaitForDevEvent", {
898
- Type: Me
923
+ Type: Ge
899
924
  }), this.eventBus.on(
900
925
  "GZCA_OnDeviceChange",
901
926
  (e) => {
902
- var t, n, r;
903
- (r = (t = this.socketConfig) == null ? void 0 : t.onUkeyChange) == null || r.call(t, E(S({}, e), {
927
+ var t, n, i;
928
+ (i = (t = this.socketConfig) == null ? void 0 : t.onUkeyChange) == null || i.call(t, _(m({}, e), {
904
929
  data: (n = e.data) == null ? void 0 : n[0]
905
930
  }));
906
931
  }
907
932
  );
908
933
  }));
909
- o(this, "certLogin", (e) => l(this, null, function* () {
934
+ a(this, "certLogin", (e) => c(this, null, function* () {
910
935
  const t = yield this.checkCertIsLogin({
911
936
  ContainerName: e
912
937
  });
@@ -917,330 +942,413 @@ class St {
917
942
  PinPolicy: this.pinPolicy
918
943
  }));
919
944
  }));
920
- o(this, "getCert", (e, t, n) => l(this, null, function* () {
921
- const r = t != null ? t : yield this.chooseCert(e);
922
- return this.isRememberPin && n && (yield this.certLogin(r.ContainerName)), r;
945
+ a(this, "verifyPin", (e) => c(this, null, function* () {
946
+ var t;
947
+ yield this.sendMessage("GZCA_Login", {
948
+ ContainerName: e.ContainerName,
949
+ IsLogin: e.UserPin ? "Y" : "N",
950
+ UserPin: (t = e.UserPin) != null ? t : "123456",
951
+ PinPolicy: this.pinPolicy
952
+ });
923
953
  }));
924
- o(this, "chooseCert", (e) => l(this, null, function* () {
925
- var r;
954
+ a(this, "getCert", (e, t, n) => c(this, null, function* () {
955
+ const i = t != null ? t : yield this.chooseCert(e);
956
+ return this.isRememberPin && n && (yield this.certLogin(i.ContainerName)), i;
957
+ }));
958
+ a(this, "chooseCert", (e) => c(this, null, function* () {
959
+ var i;
926
960
  const t = yield this.getCertList(e);
927
- return t != null && t.length ? (t == null ? void 0 : t.length) === 1 ? t[0] : yield J.open({
961
+ return t != null && t.length ? (t == null ? void 0 : t.length) === 1 ? t[0] : yield O.open({
928
962
  title: "选择证书",
929
963
  data: t,
930
- columns: mt,
931
- theme: (r = this.socketConfig) == null ? void 0 : r.theme
964
+ columns: St,
965
+ theme: (i = this.socketConfig) == null ? void 0 : i.theme
932
966
  }) : Promise.reject({
933
- errCode: Fe,
967
+ errCode: Oe,
934
968
  msg: "暂无证书"
935
969
  });
936
970
  }));
937
- o(this, "getCertList", (e) => l(this, null, function* () {
971
+ a(this, "getCertList", (e) => c(this, null, function* () {
938
972
  return yield this.sendMessage(
939
973
  "GZCA_GetCertList",
940
974
  e
941
975
  );
942
976
  }));
943
- o(this, "pkcs1Sign", (e) => l(this, null, function* () {
944
- return yield this.sendMessage("GZCA_Pkcs1SignData", S({
977
+ a(this, "pkcs1Sign", (e) => c(this, null, function* () {
978
+ return yield this.sendMessage("GZCA_Pkcs1SignData", m({
945
979
  IsLogin: this.getIsLogin(),
946
980
  PinPolicy: this.pinPolicy
947
981
  }, e != null ? e : {}));
948
982
  }));
949
- o(this, "pkcs1Base64Sign", (e) => l(this, null, function* () {
950
- return yield this.sendMessage("GZCA_Pkcs1SignDataEx", S({
983
+ a(this, "pkcs1Base64Sign", (e) => c(this, null, function* () {
984
+ return yield this.sendMessage("GZCA_Pkcs1SignDataEx", m({
951
985
  IsLogin: this.getIsLogin(),
952
986
  PinPolicy: this.pinPolicy
953
987
  }, e != null ? e : {}));
954
988
  }));
955
- o(this, "batchPkcs1Base64Sign", (e) => l(this, null, function* () {
956
- return yield this.sendMessage("GZCA_BatchPkcs1SignDataEx", S({
989
+ a(this, "batchPkcs1Base64Sign", (e) => c(this, null, function* () {
990
+ return yield this.sendMessage("GZCA_BatchPkcs1SignDataEx", m({
957
991
  IsLogin: this.getIsLogin(),
958
992
  PinPolicy: this.pinPolicy
959
993
  }, e != null ? e : {}));
960
994
  }));
961
- o(this, "pkcs1VerifySignature", (e) => l(this, null, function* () {
995
+ a(this, "pkcs1VerifySignature", (e) => c(this, null, function* () {
962
996
  return yield this.sendMessage("GZCA_Pkcs1VerifySign", e);
963
997
  }));
964
- o(this, "pkcs1Base64VerifySignature", (e) => l(this, null, function* () {
998
+ a(this, "pkcs1Base64VerifySignature", (e) => c(this, null, function* () {
965
999
  return yield this.sendMessage("GZCA_Pkcs1VerifySignEx", e);
966
1000
  }));
967
- o(this, "getSealList", (e) => l(this, null, function* () {
968
- return yield this.sendMessage("GZCA_EnumSeals", S({
969
- IsLogin: this.getIsLogin()
970
- }, e != null ? e : {}));
1001
+ a(this, "getSealList", (e) => c(this, null, function* () {
1002
+ return yield this.sendMessage(
1003
+ "GZCA_EnumSeals",
1004
+ m({
1005
+ IsLogin: this.getIsLogin()
1006
+ }, e != null ? e : {}),
1007
+ I.LEVEL_2
1008
+ );
971
1009
  }));
972
- o(this, "writeSeal", (e) => l(this, null, function* () {
973
- return yield this.sendMessage("GZCA_WriteSeal", S({
974
- IsLogin: this.getIsLogin()
975
- }, e != null ? e : {}));
1010
+ a(this, "writeSeal", (e) => c(this, null, function* () {
1011
+ return yield this.sendMessage(
1012
+ "GZCA_WriteSeal",
1013
+ m({
1014
+ IsLogin: this.getIsLogin()
1015
+ }, e != null ? e : {}),
1016
+ I.LEVEL_2
1017
+ );
976
1018
  }));
977
- o(this, "deleteSeal", (e) => l(this, null, function* () {
978
- return yield this.sendMessage("GZCA_DeleteSeal", S({
979
- IsLogin: this.getIsLogin()
980
- }, e != null ? e : {}));
1019
+ a(this, "deleteSeal", (e) => c(this, null, function* () {
1020
+ return yield this.sendMessage(
1021
+ "GZCA_DeleteSeal",
1022
+ m({
1023
+ IsLogin: this.getIsLogin()
1024
+ }, e != null ? e : {}),
1025
+ I.LEVEL_2
1026
+ );
981
1027
  }));
982
- o(this, "getSealInfo", (e) => l(this, null, function* () {
983
- return yield this.sendMessage("GZCA_ReadSeal", S({
984
- IsLogin: this.getIsLogin()
985
- }, e != null ? e : {}));
1028
+ a(this, "getSealInfo", (e) => c(this, null, function* () {
1029
+ return yield this.sendMessage(
1030
+ "GZCA_ReadSeal",
1031
+ m({
1032
+ IsLogin: this.getIsLogin()
1033
+ }, e != null ? e : {}),
1034
+ I.LEVEL_2
1035
+ );
986
1036
  }));
987
- o(this, "getTPSealList", (e) => l(this, null, function* () {
988
- return yield this.sendMessage("GZCA_GetSealPicList", S({
989
- IsLogin: this.getIsLogin()
990
- }, e != null ? e : {}));
1037
+ a(this, "getTPSealList", (e) => c(this, null, function* () {
1038
+ return yield this.sendMessage(
1039
+ "GZCA_GetSealPicList",
1040
+ m({
1041
+ IsLogin: this.getIsLogin()
1042
+ }, e != null ? e : {}),
1043
+ I.LEVEL_2
1044
+ );
991
1045
  }));
992
- o(this, "getTPSealPic", (e) => l(this, null, function* () {
1046
+ a(this, "getTPSealPic", (e) => c(this, null, function* () {
993
1047
  var n;
994
- return yield this.sendMessage("GZCA_GetSealPicData", S({
995
- IsLogin: (n = e.IsLogin) != null ? n : this.getIsLogin()
996
- }, e != null ? e : {}));
1048
+ return yield this.sendMessage(
1049
+ "GZCA_GetSealPicData",
1050
+ m({
1051
+ IsLogin: (n = e.IsLogin) != null ? n : this.getIsLogin()
1052
+ }, e != null ? e : {}),
1053
+ I.LEVEL_2
1054
+ );
997
1055
  }));
998
- o(this, "sm2SignPreprocess1", (e) => l(this, null, function* () {
1056
+ a(this, "sm2SignPreprocess1", (e) => c(this, null, function* () {
999
1057
  return yield this.sendMessage("GZCA_PrepareSm2SignStep1", e);
1000
1058
  }));
1001
- o(this, "sm2SignPreprocess2", (e) => l(this, null, function* () {
1059
+ a(this, "sm2SignPreprocess2", (e) => c(this, null, function* () {
1002
1060
  return yield this.sendMessage("GZCA_PrepareSm2SignStep2", e);
1003
1061
  }));
1004
- o(this, "pkcs1HashSign", (e) => l(this, null, function* () {
1005
- return yield this.sendMessage("GZCA_Pkcs1SignDataForHash", S({
1062
+ a(this, "pkcs1HashSign", (e) => c(this, null, function* () {
1063
+ return yield this.sendMessage("GZCA_Pkcs1SignDataForHash", m({
1006
1064
  IsLogin: this.getIsLogin(),
1007
1065
  PinPolicy: this.pinPolicy
1008
1066
  }, e != null ? e : {}));
1009
1067
  }));
1010
- o(this, "pkcs1HashVerifySignature", (e) => l(this, null, function* () {
1068
+ a(this, "pkcs1HashVerifySignature", (e) => c(this, null, function* () {
1011
1069
  return yield this.sendMessage("GZCA_Pkcs1VerifySignForHash", e);
1012
1070
  }));
1013
- o(this, "pkcs7Sign", (e) => l(this, null, function* () {
1014
- return yield this.sendMessage("GZCA_Pkcs7SignData", S({
1071
+ a(this, "pkcs7Sign", (e) => c(this, null, function* () {
1072
+ return yield this.sendMessage("GZCA_Pkcs7SignData", m({
1015
1073
  IsLogin: this.getIsLogin(),
1016
1074
  IsAuthAttr: "Y",
1017
1075
  PinPolicy: this.pinPolicy
1018
1076
  }, e != null ? e : {}));
1019
1077
  }));
1020
- o(this, "pkcs7VerifySignature", (e) => l(this, null, function* () {
1078
+ a(this, "pkcs7VerifySignature", (e) => c(this, null, function* () {
1021
1079
  return yield this.sendMessage("GZCA_Pkcs7VerifySign", e);
1022
1080
  }));
1023
- o(this, "sm3Hash", (e) => l(this, null, function* () {
1081
+ a(this, "sm3Hash", (e) => c(this, null, function* () {
1024
1082
  return yield this.sendMessage("GZCA_HashData", e);
1025
1083
  }));
1026
- o(this, "sm3HexHash", (e) => l(this, null, function* () {
1084
+ a(this, "sm3HexHash", (e) => c(this, null, function* () {
1027
1085
  return yield this.sendMessage("GZCA_HashDataEx", e);
1028
1086
  }));
1029
- o(this, "sm3FileHash", (e) => l(this, null, function* () {
1087
+ a(this, "sm3FileHash", (e) => c(this, null, function* () {
1030
1088
  return yield this.sendMessage("GZCA_HashFile", e);
1031
1089
  }));
1032
- o(this, "sm3HashEncryption", (e) => l(this, null, function* () {
1090
+ a(this, "sm3HashEncryption", (e) => c(this, null, function* () {
1033
1091
  return yield this.sendMessage("GZCA_HMac", e);
1034
1092
  }));
1035
- o(this, "pkcs7Encryption", (e) => l(this, null, function* () {
1093
+ a(this, "pkcs7Encryption", (e) => c(this, null, function* () {
1036
1094
  return yield this.sendMessage("GZCA_Pkcs7EncryptData", e);
1037
1095
  }));
1038
- o(this, "pkcs7Decryption", (e) => l(this, null, function* () {
1039
- return yield this.sendMessage("GZCA_Pkcs7DecryptData", S({
1096
+ a(this, "pkcs7Decryption", (e) => c(this, null, function* () {
1097
+ return yield this.sendMessage("GZCA_Pkcs7DecryptData", m({
1040
1098
  IsLogin: this.getIsLogin()
1041
1099
  }, e != null ? e : {}));
1042
1100
  }));
1043
- o(this, "pkcs7FileEncryption", (e) => l(this, null, function* () {
1101
+ a(this, "pkcs7FileEncryption", (e) => c(this, null, function* () {
1044
1102
  return yield this.sendMessage("GZCA_EnvelopeSealFileEx_qyzc", e);
1045
1103
  }));
1046
- o(this, "pkcs7FileDecryption", (e) => l(this, null, function* () {
1047
- return yield this.sendMessage("GZCA_EnvelopeOpenFileEx_qyzc", S({
1104
+ a(this, "pkcs7FileDecryption", (e) => c(this, null, function* () {
1105
+ return yield this.sendMessage("GZCA_EnvelopeOpenFileEx_qyzc", m({
1048
1106
  IsLogin: this.getIsLogin()
1049
1107
  }, e != null ? e : {}));
1050
1108
  }));
1051
- o(this, "asymmetricEncryption", (e) => l(this, null, function* () {
1109
+ a(this, "asymmetricEncryption", (e) => c(this, null, function* () {
1052
1110
  return yield this.sendMessage("GZCA_AsymEncryptData", e);
1053
1111
  }));
1054
- o(this, "asymmetricDecryption", (e) => l(this, null, function* () {
1055
- return yield this.sendMessage("GZCA_AsymDecryptData", S({
1112
+ a(this, "asymmetricDecryption", (e) => c(this, null, function* () {
1113
+ return yield this.sendMessage("GZCA_AsymDecryptData", m({
1056
1114
  IsLogin: this.getIsLogin()
1057
1115
  }, e != null ? e : {}));
1058
1116
  }));
1059
- o(this, "sm4Encryption", (e) => l(this, null, function* () {
1117
+ a(this, "sm4Encryption", (e) => c(this, null, function* () {
1060
1118
  return yield this.sendMessage("GZCA_EncryptDataEx", e);
1061
1119
  }));
1062
- o(this, "sm4Decryption", (e) => l(this, null, function* () {
1120
+ a(this, "sm4Decryption", (e) => c(this, null, function* () {
1063
1121
  return yield this.sendMessage("GZCA_DecryptDataEx", e);
1064
1122
  }));
1065
- o(this, "getCertInfo", (e) => l(this, null, function* () {
1123
+ a(this, "getCertInfo", (e) => c(this, null, function* () {
1066
1124
  return yield this.sendMessage("GZCA_GetCertInfo", e);
1067
1125
  }));
1068
- o(this, "getCertInfoByOid", (e) => l(this, null, function* () {
1126
+ a(this, "getCertInfoByOid", (e) => c(this, null, function* () {
1069
1127
  return yield this.sendMessage("GZCA_GetCertInfoByOid", e);
1070
1128
  }));
1071
- o(this, "getSealVendor", (e) => l(this, null, function* () {
1072
- return yield this.sendMessage("GZCA_GetSealIssuer", e);
1129
+ a(this, "getSealVendor", (e) => c(this, null, function* () {
1130
+ return yield this.sendMessage(
1131
+ "GZCA_GetSealIssuer",
1132
+ e,
1133
+ I.LEVEL_2
1134
+ );
1073
1135
  }));
1074
- o(this, "deleteAllSealByVendor", (e) => l(this, null, function* () {
1075
- return yield this.sendMessage("GZCA_ClearSeal", S({
1076
- IsLogin: this.getIsLogin()
1077
- }, e != null ? e : {}));
1136
+ a(this, "deleteAllSealByVendor", (e) => c(this, null, function* () {
1137
+ return yield this.sendMessage(
1138
+ "GZCA_ClearSeal",
1139
+ m({
1140
+ IsLogin: this.getIsLogin()
1141
+ }, e != null ? e : {}),
1142
+ I.LEVEL_2
1143
+ );
1078
1144
  }));
1079
- var t, n;
1080
- this.socketConfig = e, this.initSocket(e), this.isRememberPin = (t = e.isRememberPin) != null ? t : !1, this.pinPolicy = (n = e.pinPolicy) != null ? n : Se.MIN;
1145
+ a(this, "applyCert", (e) => c(this, null, function* () {
1146
+ return yield this.sendMessage(
1147
+ "GZCA_ApplyCert",
1148
+ {
1149
+ manu: e.manu,
1150
+ sn: e.sn,
1151
+ keyid: e.ContainerName,
1152
+ type: e.type,
1153
+ url: e.url
1154
+ },
1155
+ I.LEVEL_3
1156
+ );
1157
+ }));
1158
+ a(this, "resetPin", (e) => c(this, null, function* () {
1159
+ return yield this.sendMessage(
1160
+ "GZCA_UnblockUserPin",
1161
+ m({}, e != null ? e : {}),
1162
+ I.LEVEL_3
1163
+ );
1164
+ }));
1165
+ a(this, "getUKeyList", () => c(this, null, function* () {
1166
+ return yield this.sendMessage(
1167
+ "GetUKeyList",
1168
+ void 0,
1169
+ I.LEVEL_3
1170
+ );
1171
+ }));
1172
+ a(this, "getUKeyInfo", (e) => c(this, null, function* () {
1173
+ return yield this.sendMessage(
1174
+ "GetUKeyID",
1175
+ e != null ? e : {},
1176
+ I.LEVEL_3
1177
+ );
1178
+ }));
1179
+ var t, n, i;
1180
+ this.socketConfig = e, this.initSocket(e), this.isRememberPin = (t = e.isRememberPin) != null ? t : !1, this.scene = (n = e.scene) != null ? n : Fe.OPEN, this.pinPolicy = (i = e.pinPolicy) != null ? i : Se.MIN;
1081
1181
  }
1082
1182
  initSocket(e) {
1083
1183
  this.isConnecting = !0;
1084
1184
  const t = new WebSocket(e.url);
1085
- return t.onerror = (n) => {
1086
- var r;
1087
- this.isConnecting = !1, (r = e.onError) == null || r.call(e, n), this.flushMsgQueue();
1185
+ t.onerror = (n) => {
1186
+ var i;
1187
+ this.isConnecting = !1, (i = e.onError) == null || i.call(e, n), this.flushMsgQueue();
1088
1188
  }, t.onopen = (n) => {
1089
- var r;
1090
- this.isConnecting = !1, (r = e.onOpen) == null || r.call(e, n), e.onUkeyChange && this.addUkeyEvents(), this.flushMsgQueue();
1189
+ var i;
1190
+ this.isConnecting = !1, (i = e.onOpen) == null || i.call(e, n), e.onUkeyChange && this.addUkeyEvents(), this.flushMsgQueue();
1091
1191
  }, t.onmessage = (n) => {
1092
1192
  this.handleEventData(n);
1093
1193
  }, t.onclose = (n) => {
1094
- var r;
1095
- this.isConnecting = !1, (r = e.onClose) == null || r.call(e, n);
1096
- }, this.socketInstance = t, t;
1194
+ var i;
1195
+ this.isConnecting = !1, (i = e.onClose) == null || i.call(e, n);
1196
+ }, this.socketInstance = t;
1097
1197
  }
1098
1198
  getIsLogin() {
1099
1199
  return this.isRememberPin ? "Y" : "N";
1100
1200
  }
1101
1201
  }
1102
- const N = class N {
1202
+ const $ = class $ {
1103
1203
  constructor(e) {
1104
- o(this, "coreInstance", null);
1105
- o(this, "gwsConfig", {});
1106
- o(this, "createGwsCore", (e) => {
1107
- this.gwsConfig = e != null ? e : {}, this.coreInstance = new St(E(S({}, e != null ? e : {}), {
1108
- url: Te
1204
+ a(this, "coreInstance", null);
1205
+ a(this, "gwsConfig", {});
1206
+ a(this, "createGwsCore", (e) => {
1207
+ this.gwsConfig = e != null ? e : {}, this.coreInstance = new It(_(m({}, e != null ? e : {}), {
1208
+ url: Me
1109
1209
  }));
1110
1210
  });
1111
- o(this, "appendCertBase64", (e, t = !0) => l(this, null, function* () {
1211
+ a(this, "appendCertBase64", (e, t = !0) => c(this, null, function* () {
1112
1212
  if (e.CertB64) return e;
1113
1213
  const n = t ? yield this.getSignatureCert() : yield this.getEncryptionCert();
1114
- return E(S({}, e != null ? e : {}), { CertB64: n == null ? void 0 : n.CertB64 });
1214
+ return _(m({}, e != null ? e : {}), { CertB64: n == null ? void 0 : n.CertB64 });
1115
1215
  }));
1116
- o(this, "destroy", () => {
1216
+ a(this, "destroy", () => {
1117
1217
  var e;
1118
1218
  (e = this.coreInstance) == null || e.destroy(), this.coreInstance = null;
1119
1219
  });
1120
- o(this, "restart", (e) => {
1220
+ a(this, "restart", (e) => {
1121
1221
  this.coreInstance && this.destroy(), this.gwsConfig = e != null ? e : this.gwsConfig, this.createGwsCore(e);
1122
1222
  });
1123
- o(this, "getSocketReadyState", () => {
1223
+ a(this, "getSocketReadyState", () => {
1124
1224
  var e;
1125
1225
  return (e = this.coreInstance) == null ? void 0 : e.getSocketReadyState();
1126
1226
  });
1127
- o(this, "getSignatureCert", (e, t = !0) => l(this, null, function* () {
1128
- var r;
1129
- return yield (r = this.coreInstance) == null ? void 0 : r.getCert(
1227
+ a(this, "verifyPin", (e, t) => c(this, null, function* () {
1228
+ var i, r;
1229
+ const n = yield this.getSignatureCert(t);
1230
+ return (r = this.coreInstance) == null ? void 0 : r.verifyPin({
1231
+ ContainerName: (i = n == null ? void 0 : n.ContainerName) != null ? i : "",
1232
+ UserPin: e == null ? void 0 : e.UserPin
1233
+ });
1234
+ }));
1235
+ a(this, "getSignatureCert", (e, t = !0) => c(this, null, function* () {
1236
+ var i;
1237
+ return yield (i = this.coreInstance) == null ? void 0 : i.getCert(
1130
1238
  { CertType: ae },
1131
1239
  e,
1132
1240
  t
1133
1241
  );
1134
1242
  }));
1135
- o(this, "getSignatureCertList", () => l(this, null, function* () {
1243
+ a(this, "getSignatureCertList", () => c(this, null, function* () {
1136
1244
  var t;
1137
1245
  return yield (t = this.coreInstance) == null ? void 0 : t.getCertList({
1138
1246
  CertType: ae
1139
1247
  });
1140
1248
  }));
1141
- o(this, "getEncryptionCert", (e, t = !0) => l(this, null, function* () {
1142
- var r;
1143
- return yield (r = this.coreInstance) == null ? void 0 : r.getCert(
1144
- { CertType: ie },
1249
+ a(this, "getEncryptionCert", (e, t = !0) => c(this, null, function* () {
1250
+ var i;
1251
+ return yield (i = this.coreInstance) == null ? void 0 : i.getCert(
1252
+ { CertType: oe },
1145
1253
  e,
1146
1254
  t
1147
1255
  );
1148
1256
  }));
1149
- o(this, "getEncryptionCertList", () => l(this, null, function* () {
1257
+ a(this, "getEncryptionCertList", () => c(this, null, function* () {
1150
1258
  var t;
1151
1259
  return yield (t = this.coreInstance) == null ? void 0 : t.getCertList({
1152
- CertType: ie
1260
+ CertType: oe
1153
1261
  });
1154
1262
  }));
1155
- o(this, "base64Encode", (e) => {
1263
+ a(this, "base64Encode", (e) => {
1156
1264
  var t;
1157
1265
  return (t = this.coreInstance) == null ? void 0 : t.base64Encode(e.Data);
1158
1266
  });
1159
- o(this, "base64Decode", (e) => {
1267
+ a(this, "base64Decode", (e) => {
1160
1268
  var t;
1161
1269
  return (t = this.coreInstance) == null ? void 0 : t.base64Decode(e.DataB64);
1162
1270
  });
1163
- o(this, "changeIsRememberPin", (e) => {
1271
+ a(this, "changeIsRememberPin", (e) => {
1164
1272
  var t;
1165
1273
  (t = this.coreInstance) == null || t.changeIsRememberPin(e);
1166
1274
  });
1167
- o(this, "changePinPolicy", (e) => {
1275
+ a(this, "changePinPolicy", (e) => {
1168
1276
  var t;
1169
1277
  (t = this.coreInstance) == null || t.changePinPolicy(e);
1170
1278
  });
1171
- o(this, "pkcs1Sign", (e, t) => l(this, null, function* () {
1172
- var a, i, c;
1173
- const n = yield this.getSignatureCert(t), r = yield (i = this.coreInstance) == null ? void 0 : i.pkcs1Sign(E(S({}, e != null ? e : {}), {
1174
- ContainerName: (a = n == null ? void 0 : n.ContainerName) != null ? a : ""
1279
+ a(this, "pkcs1Sign", (e, t) => c(this, null, function* () {
1280
+ var r, o, l;
1281
+ const n = yield this.getSignatureCert(t), i = yield (o = this.coreInstance) == null ? void 0 : o.pkcs1Sign(_(m({}, e != null ? e : {}), {
1282
+ ContainerName: (r = n == null ? void 0 : n.ContainerName) != null ? r : ""
1175
1283
  }));
1176
- return (c = r == null ? void 0 : r[0]) == null ? void 0 : c.SignData;
1284
+ return (l = i == null ? void 0 : i[0]) == null ? void 0 : l.SignData;
1177
1285
  }));
1178
- o(this, "pkcs1VerifySignature", (e) => l(this, null, function* () {
1179
- var r;
1180
- const t = yield this.appendCertBase64(e), n = yield (r = this.coreInstance) == null ? void 0 : r.pkcs1VerifySignature(t);
1286
+ a(this, "pkcs1VerifySignature", (e) => c(this, null, function* () {
1287
+ var i;
1288
+ const t = yield this.appendCertBase64(e), n = yield (i = this.coreInstance) == null ? void 0 : i.pkcs1VerifySignature(t);
1181
1289
  return Array.isArray(n);
1182
1290
  }));
1183
- o(this, "pkcs1Base64Sign", (e, t) => l(this, null, function* () {
1184
- var i, c, d, u, C;
1185
- const n = yield this.getSignatureCert(t), r = (c = e.DataB64) != null ? c : this.base64Encode({ Data: (i = e.Data) != null ? i : "" }), a = yield (u = this.coreInstance) == null ? void 0 : u.pkcs1Base64Sign(E(S({}, e != null ? e : {}), {
1291
+ a(this, "pkcs1Base64Sign", (e, t) => c(this, null, function* () {
1292
+ var o, l, d, u, C;
1293
+ const n = yield this.getSignatureCert(t), i = (l = e.DataB64) != null ? l : this.base64Encode({ Data: (o = e.Data) != null ? o : "" }), r = yield (u = this.coreInstance) == null ? void 0 : u.pkcs1Base64Sign(_(m({}, e != null ? e : {}), {
1186
1294
  ContainerName: (d = n == null ? void 0 : n.ContainerName) != null ? d : "",
1187
- DataB64: r
1188
- }));
1189
- return (C = a == null ? void 0 : a[0]) == null ? void 0 : C.SignData;
1190
- }));
1191
- o(this, "batchPkcs1Base64Sign", (e, t) => l(this, null, function* () {
1192
- var C, g, m, h, f, w;
1193
- const n = "|", r = (g = e.DataB64) != null ? g : (C = e.Data) == null ? void 0 : C.map((y) => this.base64Encode({ Data: y })), a = yield this.getSignatureCert(t);
1194
- let i = "";
1195
- i = Array.isArray(r) ? r == null ? void 0 : r.map((y, p) => `${p}:${y}`).join(n) : "";
1196
- const c = yield (h = this.coreInstance) == null ? void 0 : h.batchPkcs1Base64Sign({
1197
- ContainerName: (m = a == null ? void 0 : a.ContainerName) != null ? m : "",
1198
1295
  DataB64: i
1199
- }), d = (w = (f = c == null ? void 0 : c[0]) == null ? void 0 : f.SignData) == null ? void 0 : w.split(n), u = [];
1296
+ }));
1297
+ return (C = r == null ? void 0 : r[0]) == null ? void 0 : C.SignData;
1298
+ }));
1299
+ a(this, "batchPkcs1Base64Sign", (e, t) => c(this, null, function* () {
1300
+ var C, g, w, h, f, E;
1301
+ const n = "|", i = (g = e.DataB64) != null ? g : (C = e.Data) == null ? void 0 : C.map((y) => this.base64Encode({ Data: y })), r = yield this.getSignatureCert(t);
1302
+ let o = "";
1303
+ o = Array.isArray(i) ? i == null ? void 0 : i.map((y, S) => `${S}:${y}`).join(n) : "";
1304
+ const l = yield (h = this.coreInstance) == null ? void 0 : h.batchPkcs1Base64Sign({
1305
+ ContainerName: (w = r == null ? void 0 : r.ContainerName) != null ? w : "",
1306
+ DataB64: o
1307
+ }), d = (E = (f = l == null ? void 0 : l[0]) == null ? void 0 : f.SignData) == null ? void 0 : E.split(n), u = [];
1200
1308
  return d.forEach((y) => {
1201
- const p = y.split(":"), v = Number(p[0]), I = p[1];
1202
- u[v] = I;
1309
+ const S = y.split(":"), k = Number(S[0]), p = S[1];
1310
+ u[k] = p;
1203
1311
  }), u;
1204
1312
  }));
1205
- o(this, "pkcs1Base64VerifySignature", (e) => l(this, null, function* () {
1206
- var a, i, c;
1207
- const t = (i = e.DataB64) != null ? i : this.base64Encode({ Data: (a = e.Data) != null ? a : "" }), n = yield this.appendCertBase64(e);
1208
- return !!(yield (c = this.coreInstance) == null ? void 0 : c.pkcs1Base64VerifySignature({
1313
+ a(this, "pkcs1Base64VerifySignature", (e) => c(this, null, function* () {
1314
+ var r, o, l;
1315
+ const t = (o = e.DataB64) != null ? o : this.base64Encode({ Data: (r = e.Data) != null ? r : "" }), n = yield this.appendCertBase64(e);
1316
+ return !!(yield (l = this.coreInstance) == null ? void 0 : l.pkcs1Base64VerifySignature({
1209
1317
  CertB64: n.CertB64,
1210
1318
  DataB64: t,
1211
1319
  SignData: n.SignData
1212
1320
  }));
1213
1321
  }));
1214
- o(this, "writeSeal", (e, t) => l(this, null, function* () {
1215
- var a, i;
1322
+ a(this, "writeSeal", (e, t) => c(this, null, function* () {
1323
+ var r, o;
1216
1324
  const n = yield this.getSignatureCert(t);
1217
- return !!(yield (i = this.coreInstance) == null ? void 0 : i.writeSeal(E(S({}, e != null ? e : {}), {
1218
- ContainerName: (a = n == null ? void 0 : n.ContainerName) != null ? a : ""
1325
+ return !!(yield (o = this.coreInstance) == null ? void 0 : o.writeSeal(_(m({}, e != null ? e : {}), {
1326
+ ContainerName: (r = n == null ? void 0 : n.ContainerName) != null ? r : ""
1219
1327
  })));
1220
1328
  }));
1221
- o(this, "deleteSeal", (e) => l(this, null, function* () {
1222
- var a, i, c, d, u;
1329
+ a(this, "deleteSeal", (e) => c(this, null, function* () {
1330
+ var r, o, l, d, u;
1223
1331
  const t = yield this.getSealList(e);
1224
- if (!((a = t == null ? void 0 : t.data) != null && a.length))
1332
+ if (!((r = t == null ? void 0 : t.data) != null && r.length))
1225
1333
  return Promise.reject({
1226
- errCode: Y,
1334
+ errCode: q,
1227
1335
  msg: "暂无印章"
1228
1336
  });
1229
- const n = yield J.open({
1337
+ const n = yield O.open({
1230
1338
  title: "删除印章",
1231
1339
  data: t == null ? void 0 : t.data,
1232
- columns: we,
1340
+ columns: Ee,
1233
1341
  okText: "删除"
1234
1342
  });
1235
1343
  return !!(yield (u = this.coreInstance) == null ? void 0 : u.deleteSeal({
1236
- ContainerName: (c = (i = t == null ? void 0 : t.cert) == null ? void 0 : i.ContainerName) != null ? c : "",
1344
+ ContainerName: (l = (o = t == null ? void 0 : t.cert) == null ? void 0 : o.ContainerName) != null ? l : "",
1237
1345
  SealId: (d = n == null ? void 0 : n.SealId) != null ? d : ""
1238
1346
  }));
1239
1347
  }));
1240
- o(this, "getSealList", (e) => l(this, null, function* () {
1241
- var r, a;
1242
- const t = yield this.getSignatureCert(e), n = yield (a = this.coreInstance) == null ? void 0 : a.getSealList({
1243
- ContainerName: (r = t == null ? void 0 : t.ContainerName) != null ? r : "",
1348
+ a(this, "getSealList", (e) => c(this, null, function* () {
1349
+ var i, r;
1350
+ const t = yield this.getSignatureCert(e), n = yield (r = this.coreInstance) == null ? void 0 : r.getSealList({
1351
+ ContainerName: (i = t == null ? void 0 : t.ContainerName) != null ? i : "",
1244
1352
  IsLogin: "Y"
1245
1353
  });
1246
1354
  return {
@@ -1248,230 +1356,266 @@ const N = class N {
1248
1356
  data: n
1249
1357
  };
1250
1358
  }));
1251
- o(this, "getSealInfo", (e) => l(this, null, function* () {
1252
- var a, i, c, d, u, C, g;
1359
+ a(this, "getSealInfo", (e) => c(this, null, function* () {
1360
+ var r, o, l, d, u, C, g;
1253
1361
  const t = yield this.getSealList(e);
1254
- if (!((a = t == null ? void 0 : t.data) != null && a.length))
1362
+ if (!((r = t == null ? void 0 : t.data) != null && r.length))
1255
1363
  return Promise.reject({
1256
- errCode: Y,
1364
+ errCode: q,
1257
1365
  msg: "暂无印章"
1258
1366
  });
1259
- const n = ((i = t == null ? void 0 : t.data) == null ? void 0 : i.length) > 1 ? yield J.open({
1367
+ const n = ((o = t == null ? void 0 : t.data) == null ? void 0 : o.length) > 1 ? yield O.open({
1260
1368
  title: "选择印章",
1261
1369
  data: t == null ? void 0 : t.data,
1262
- columns: we,
1263
- theme: (c = this.gwsConfig) == null ? void 0 : c.theme
1264
- }) : t == null ? void 0 : t.data[0], r = yield (g = this.coreInstance) == null ? void 0 : g.getSealInfo({
1370
+ columns: Ee,
1371
+ theme: (l = this.gwsConfig) == null ? void 0 : l.theme
1372
+ }) : t == null ? void 0 : t.data[0], i = yield (g = this.coreInstance) == null ? void 0 : g.getSealInfo({
1265
1373
  ContainerName: (u = (d = t == null ? void 0 : t.cert) == null ? void 0 : d.ContainerName) != null ? u : "",
1266
1374
  SealId: (C = n == null ? void 0 : n.SealId) != null ? C : ""
1267
1375
  });
1268
- return r == null ? void 0 : r[0];
1376
+ return i == null ? void 0 : i[0];
1269
1377
  }));
1270
- o(this, "getTPSealList", (e, t) => l(this, null, function* () {
1271
- var a, i;
1272
- const n = yield this.getSignatureCert(t), r = yield (i = this.coreInstance) == null ? void 0 : i.getTPSealList({
1273
- ContainerName: (a = n == null ? void 0 : n.ContainerName) != null ? a : "",
1378
+ a(this, "getTPSealList", (e, t) => c(this, null, function* () {
1379
+ var r, o;
1380
+ const n = yield this.getSignatureCert(t), i = yield (o = this.coreInstance) == null ? void 0 : o.getTPSealList({
1381
+ ContainerName: (r = n == null ? void 0 : n.ContainerName) != null ? r : "",
1274
1382
  Vid: e == null ? void 0 : e.Vid
1275
1383
  });
1276
1384
  return {
1277
1385
  cert: n,
1278
- data: r
1386
+ data: i
1279
1387
  };
1280
1388
  }));
1281
- o(this, "getTPSeal", (e, t) => l(this, null, function* () {
1282
- var a, i, c;
1389
+ a(this, "getTPSeal", (e, t) => c(this, null, function* () {
1390
+ var r, o, l;
1283
1391
  const n = yield this.getTPSealList(e, t);
1284
- if (!((a = n == null ? void 0 : n.data) != null && a.length))
1392
+ if (!((r = n == null ? void 0 : n.data) != null && r.length))
1285
1393
  return Promise.reject({
1286
- errCode: Y,
1394
+ errCode: q,
1287
1395
  msg: "暂无印章"
1288
1396
  });
1289
- const r = ((i = n == null ? void 0 : n.data) == null ? void 0 : i.length) === 1 ? n == null ? void 0 : n.data[0] : yield J.open({
1397
+ const i = ((o = n == null ? void 0 : n.data) == null ? void 0 : o.length) === 1 ? n == null ? void 0 : n.data[0] : yield O.open({
1290
1398
  title: "选择印章",
1291
1399
  data: n == null ? void 0 : n.data,
1292
- columns: wt,
1293
- theme: (c = this.gwsConfig) == null ? void 0 : c.theme
1400
+ columns: vt,
1401
+ theme: (l = this.gwsConfig) == null ? void 0 : l.theme
1294
1402
  });
1295
1403
  return {
1296
1404
  cert: n == null ? void 0 : n.cert,
1297
- data: r
1405
+ data: i
1298
1406
  };
1299
1407
  }));
1300
- o(this, "getTPSealPic", (e, t) => l(this, null, function* () {
1301
- var a, i, c, d, u;
1302
- const n = yield this.getTPSeal(e, t), r = yield (u = this.coreInstance) == null ? void 0 : u.getTPSealPic(E(S({
1303
- ContainerName: (i = (a = n == null ? void 0 : n.cert) == null ? void 0 : a.ContainerName) != null ? i : ""
1304
- }, (c = n == null ? void 0 : n.data) != null ? c : {}), {
1408
+ a(this, "getTPSealPic", (e, t) => c(this, null, function* () {
1409
+ var r, o, l, d, u;
1410
+ const n = yield this.getTPSeal(e, t), i = yield (u = this.coreInstance) == null ? void 0 : u.getTPSealPic(_(m({
1411
+ ContainerName: (o = (r = n == null ? void 0 : n.cert) == null ? void 0 : r.ContainerName) != null ? o : ""
1412
+ }, (l = n == null ? void 0 : n.data) != null ? l : {}), {
1305
1413
  FileSize: String((d = n == null ? void 0 : n.data) == null ? void 0 : d.FileSize)
1306
1414
  }));
1307
- return r == null ? void 0 : r[0];
1415
+ return i == null ? void 0 : i[0];
1308
1416
  }));
1309
- o(this, "sm2SignPreprocess1", (e) => l(this, null, function* () {
1310
- var r, a;
1311
- const t = yield this.appendCertBase64(e), n = yield (r = this.coreInstance) == null ? void 0 : r.sm2SignPreprocess1(t);
1312
- return (a = n == null ? void 0 : n[0]) == null ? void 0 : a.Z;
1417
+ a(this, "sm2SignPreprocess1", (e) => c(this, null, function* () {
1418
+ var i, r;
1419
+ const t = yield this.appendCertBase64(e), n = yield (i = this.coreInstance) == null ? void 0 : i.sm2SignPreprocess1(t);
1420
+ return (r = n == null ? void 0 : n[0]) == null ? void 0 : r.Z;
1313
1421
  }));
1314
- o(this, "sm2SignPreprocess2", (e) => l(this, null, function* () {
1315
- var a, i;
1316
- const t = this.base64Encode({ Data: (a = e.Data) != null ? a : "" }), n = yield this.appendCertBase64(e), r = yield (i = this.coreInstance) == null ? void 0 : i.sm2SignPreprocess2({
1422
+ a(this, "sm2SignPreprocess2", (e) => c(this, null, function* () {
1423
+ var r, o;
1424
+ const t = this.base64Encode({ Data: (r = e.Data) != null ? r : "" }), n = yield this.appendCertBase64(e), i = yield (o = this.coreInstance) == null ? void 0 : o.sm2SignPreprocess2({
1317
1425
  CertB64: n.CertB64,
1318
1426
  DataB64: t
1319
1427
  });
1320
- return r == null ? void 0 : r[0].H;
1428
+ return i == null ? void 0 : i[0].H;
1321
1429
  }));
1322
- o(this, "pkcs1HashSign", (e, t) => l(this, null, function* () {
1323
- var a, i, c, d;
1324
- const n = yield this.getSignatureCert(t), r = yield (c = this.coreInstance) == null ? void 0 : c.pkcs1HashSign({
1325
- ContainerName: (a = n == null ? void 0 : n.ContainerName) != null ? a : "",
1430
+ a(this, "pkcs1HashSign", (e, t) => c(this, null, function* () {
1431
+ var r, o, l, d;
1432
+ const n = yield this.getSignatureCert(t), i = yield (l = this.coreInstance) == null ? void 0 : l.pkcs1HashSign({
1433
+ ContainerName: (r = n == null ? void 0 : n.ContainerName) != null ? r : "",
1326
1434
  DataB64: e.DataB64,
1327
- HashAlg: (i = e.HashAlg) != null ? i : "sm3"
1435
+ HashAlg: (o = e.HashAlg) != null ? o : "sm3"
1328
1436
  });
1329
- return (d = r == null ? void 0 : r[0]) == null ? void 0 : d.SignData;
1437
+ return (d = i == null ? void 0 : i[0]) == null ? void 0 : d.SignData;
1330
1438
  }));
1331
- o(this, "pkcs1HashVerifySignature", (e) => l(this, null, function* () {
1332
- var r, a;
1439
+ a(this, "pkcs1HashVerifySignature", (e) => c(this, null, function* () {
1440
+ var i, r;
1333
1441
  const t = yield this.appendCertBase64(e);
1334
- return !!(yield (a = this.coreInstance) == null ? void 0 : a.pkcs1HashVerifySignature(E(S({}, t), {
1335
- HashAlg: (r = t.HashAlg) != null ? r : "sm3"
1442
+ return !!(yield (r = this.coreInstance) == null ? void 0 : r.pkcs1HashVerifySignature(_(m({}, t), {
1443
+ HashAlg: (i = t.HashAlg) != null ? i : "sm3"
1336
1444
  })));
1337
1445
  }));
1338
- o(this, "pkcs7Sign", (e, t) => l(this, null, function* () {
1339
- var i, c, d, u, C;
1340
- const n = (c = e.DataB64) != null ? c : this.base64Encode({ Data: (i = e.Data) != null ? i : "" }), r = yield this.getSignatureCert(t), a = yield (u = this.coreInstance) == null ? void 0 : u.pkcs7Sign(E(S({}, e != null ? e : {}), {
1341
- ContainerName: (d = r == null ? void 0 : r.ContainerName) != null ? d : "",
1446
+ a(this, "pkcs7Sign", (e, t) => c(this, null, function* () {
1447
+ var o, l, d, u, C;
1448
+ const n = (l = e.DataB64) != null ? l : this.base64Encode({ Data: (o = e.Data) != null ? o : "" }), i = yield this.getSignatureCert(t), r = yield (u = this.coreInstance) == null ? void 0 : u.pkcs7Sign(_(m({}, e != null ? e : {}), {
1449
+ ContainerName: (d = i == null ? void 0 : i.ContainerName) != null ? d : "",
1342
1450
  DataB64: n
1343
1451
  }));
1344
- return (C = a == null ? void 0 : a[0]) == null ? void 0 : C.SignData;
1452
+ return (C = r == null ? void 0 : r[0]) == null ? void 0 : C.SignData;
1345
1453
  }));
1346
- o(this, "pkcs7VerifySignature", (e) => l(this, null, function* () {
1347
- var r, a, i;
1348
- const t = (a = e.DataB64) != null ? a : this.base64Encode({ Data: (r = e.Data) != null ? r : "" });
1349
- return !!(yield (i = this.coreInstance) == null ? void 0 : i.pkcs7VerifySignature({
1454
+ a(this, "pkcs7VerifySignature", (e) => c(this, null, function* () {
1455
+ var i, r, o;
1456
+ const t = (r = e.DataB64) != null ? r : this.base64Encode({ Data: (i = e.Data) != null ? i : "" });
1457
+ return !!(yield (o = this.coreInstance) == null ? void 0 : o.pkcs7VerifySignature({
1350
1458
  DataB64: t,
1351
1459
  SignData: e.SignData
1352
1460
  }));
1353
1461
  }));
1354
- o(this, "sm3Hash", (e) => l(this, null, function* () {
1355
- var n, r;
1462
+ a(this, "sm3Hash", (e) => c(this, null, function* () {
1463
+ var n, i;
1356
1464
  const t = yield (n = this.coreInstance) == null ? void 0 : n.sm3Hash(e);
1357
- return (r = t == null ? void 0 : t[0]) == null ? void 0 : r.HashB64;
1465
+ return (i = t == null ? void 0 : t[0]) == null ? void 0 : i.HashB64;
1358
1466
  }));
1359
- o(this, "sm3HexHash", (e) => l(this, null, function* () {
1360
- var n, r;
1467
+ a(this, "sm3HexHash", (e) => c(this, null, function* () {
1468
+ var n, i;
1361
1469
  const t = yield (n = this.coreInstance) == null ? void 0 : n.sm3HexHash(e);
1362
- return (r = t == null ? void 0 : t[0]) == null ? void 0 : r.HashB64;
1470
+ return (i = t == null ? void 0 : t[0]) == null ? void 0 : i.HashB64;
1363
1471
  }));
1364
- o(this, "sm3FileHash", (e) => l(this, null, function* () {
1365
- var n, r;
1472
+ a(this, "sm3FileHash", (e) => c(this, null, function* () {
1473
+ var n, i;
1366
1474
  const t = yield (n = this.coreInstance) == null ? void 0 : n.sm3FileHash(e);
1367
- return (r = t == null ? void 0 : t[0]) == null ? void 0 : r.HashB64;
1475
+ return (i = t == null ? void 0 : t[0]) == null ? void 0 : i.HashB64;
1368
1476
  }));
1369
- o(this, "sm3HashEncryption", (e) => l(this, null, function* () {
1370
- var a, i, c, d, u, C;
1371
- const t = (i = e.DataB64) != null ? i : this.base64Encode({ Data: (a = e.Data) != null ? a : "" }), n = (d = e.KeyB64) != null ? d : this.base64Encode({ Data: (c = e.Key) != null ? c : "" }), r = yield (u = this.coreInstance) == null ? void 0 : u.sm3HashEncryption({
1477
+ a(this, "sm3HashEncryption", (e) => c(this, null, function* () {
1478
+ var r, o, l, d, u, C;
1479
+ const t = (o = e.DataB64) != null ? o : this.base64Encode({ Data: (r = e.Data) != null ? r : "" }), n = (d = e.KeyB64) != null ? d : this.base64Encode({ Data: (l = e.Key) != null ? l : "" }), i = yield (u = this.coreInstance) == null ? void 0 : u.sm3HashEncryption({
1372
1480
  dataB64: t,
1373
1481
  keyB64: n,
1374
1482
  alg: "sm3"
1375
1483
  });
1376
- return (C = r == null ? void 0 : r[0]) == null ? void 0 : C.DataB64;
1484
+ return (C = i == null ? void 0 : i[0]) == null ? void 0 : C.DataB64;
1377
1485
  }));
1378
- o(this, "pkcs7Encryption", (e) => l(this, null, function* () {
1379
- var r, a, i, c;
1486
+ a(this, "pkcs7Encryption", (e) => c(this, null, function* () {
1487
+ var i, r, o, l;
1380
1488
  if (!e.CertB64List) {
1381
1489
  const d = yield this.getEncryptionCert();
1382
1490
  e.CertB64List = d == null ? void 0 : d.CertB64;
1383
1491
  }
1384
- const t = (a = e.DataB64) != null ? a : this.base64Encode({ Data: (r = e.Data) != null ? r : "" }), n = yield (i = this.coreInstance) == null ? void 0 : i.pkcs7Encryption({
1492
+ const t = (r = e.DataB64) != null ? r : this.base64Encode({ Data: (i = e.Data) != null ? i : "" }), n = yield (o = this.coreInstance) == null ? void 0 : o.pkcs7Encryption({
1385
1493
  DataB64: t,
1386
1494
  CertB64List: e.CertB64List
1387
1495
  });
1388
- return (c = n == null ? void 0 : n[0]) == null ? void 0 : c.DataB64;
1496
+ return (l = n == null ? void 0 : n[0]) == null ? void 0 : l.DataB64;
1389
1497
  }));
1390
- o(this, "pkcs7Decryption", (e) => l(this, null, function* () {
1391
- var a, i;
1392
- const t = yield this.getEncryptionCert(), n = yield (a = this.coreInstance) == null ? void 0 : a.pkcs7Decryption(E(S({}, e != null ? e : {}), {
1498
+ a(this, "pkcs7Decryption", (e) => c(this, null, function* () {
1499
+ var r, o;
1500
+ const t = yield this.getEncryptionCert(), n = yield (r = this.coreInstance) == null ? void 0 : r.pkcs7Decryption(_(m({}, e != null ? e : {}), {
1393
1501
  ContainerName: t == null ? void 0 : t.ContainerName
1394
- })), r = (i = n == null ? void 0 : n[0]) == null ? void 0 : i.DataB64;
1395
- return e.shouldDecodeBase64 ? this.base64Decode({ DataB64: r }) : r;
1502
+ })), i = (o = n == null ? void 0 : n[0]) == null ? void 0 : o.DataB64;
1503
+ return e.shouldDecodeBase64 ? this.base64Decode({ DataB64: i }) : i;
1396
1504
  }));
1397
- o(this, "pkcs7FileEncryption", (e) => l(this, null, function* () {
1398
- var r, a;
1399
- const t = yield this.appendCertBase64(e, !1), n = yield (r = this.coreInstance) == null ? void 0 : r.pkcs7FileEncryption(t);
1400
- return (a = n == null ? void 0 : n[0]) == null ? void 0 : a.DataB64;
1505
+ a(this, "pkcs7FileEncryption", (e) => c(this, null, function* () {
1506
+ var i, r;
1507
+ const t = yield this.appendCertBase64(e, !1), n = yield (i = this.coreInstance) == null ? void 0 : i.pkcs7FileEncryption(t);
1508
+ return (r = n == null ? void 0 : n[0]) == null ? void 0 : r.DataB64;
1401
1509
  }));
1402
- o(this, "pkcs7FileDecryption", (e) => l(this, null, function* () {
1403
- var r, a, i;
1404
- const t = yield this.getEncryptionCert(), n = yield (a = this.coreInstance) == null ? void 0 : a.pkcs7FileDecryption({
1510
+ a(this, "pkcs7FileDecryption", (e) => c(this, null, function* () {
1511
+ var i, r, o;
1512
+ const t = yield this.getEncryptionCert(), n = yield (r = this.coreInstance) == null ? void 0 : r.pkcs7FileDecryption({
1405
1513
  SrcFile: e.SrcFile,
1406
- DstFile: (r = e.DstFile) != null ? r : e.SrcFile.slice(0, -4),
1514
+ DstFile: (i = e.DstFile) != null ? i : e.SrcFile.slice(0, -4),
1407
1515
  ContainerName: t == null ? void 0 : t.ContainerName
1408
1516
  });
1409
- return (i = n == null ? void 0 : n[0]) == null ? void 0 : i.DataB64;
1517
+ return (o = n == null ? void 0 : n[0]) == null ? void 0 : o.DataB64;
1410
1518
  }));
1411
- o(this, "asymmetricEncryption", (e) => l(this, null, function* () {
1412
- var r, a;
1413
- const t = yield this.appendCertBase64(e, !1), n = yield (r = this.coreInstance) == null ? void 0 : r.asymmetricEncryption(t);
1414
- return (a = n == null ? void 0 : n[0]) == null ? void 0 : a.Data;
1519
+ a(this, "asymmetricEncryption", (e) => c(this, null, function* () {
1520
+ var i, r;
1521
+ const t = yield this.appendCertBase64(e, !1), n = yield (i = this.coreInstance) == null ? void 0 : i.asymmetricEncryption(t);
1522
+ return (r = n == null ? void 0 : n[0]) == null ? void 0 : r.Data;
1415
1523
  }));
1416
- o(this, "asymmetricDecryption", (e, t) => l(this, null, function* () {
1417
- var a, i;
1418
- const n = yield this.getEncryptionCert(t), r = yield (a = this.coreInstance) == null ? void 0 : a.asymmetricDecryption(E(S({}, e != null ? e : {}), {
1524
+ a(this, "asymmetricDecryption", (e, t) => c(this, null, function* () {
1525
+ var r, o;
1526
+ const n = yield this.getEncryptionCert(t), i = yield (r = this.coreInstance) == null ? void 0 : r.asymmetricDecryption(_(m({}, e != null ? e : {}), {
1419
1527
  ContainerName: n == null ? void 0 : n.ContainerName
1420
1528
  }));
1421
- return (i = r == null ? void 0 : r[0]) == null ? void 0 : i.Data;
1529
+ return (o = i == null ? void 0 : i[0]) == null ? void 0 : o.Data;
1422
1530
  }));
1423
- o(this, "sm4Encryption", (e) => l(this, null, function* () {
1531
+ a(this, "sm4Encryption", (e) => c(this, null, function* () {
1424
1532
  var n;
1425
1533
  const t = yield (n = this.coreInstance) == null ? void 0 : n.sm4Encryption(e);
1426
1534
  return t == null ? void 0 : t[0];
1427
1535
  }));
1428
- o(this, "sm4Decryption", (e) => l(this, null, function* () {
1429
- var n, r;
1536
+ a(this, "sm4Decryption", (e) => c(this, null, function* () {
1537
+ var n, i;
1430
1538
  const t = yield (n = this.coreInstance) == null ? void 0 : n.sm4Decryption(e);
1431
- return (r = t == null ? void 0 : t[0]) == null ? void 0 : r.Data;
1539
+ return (i = t == null ? void 0 : t[0]) == null ? void 0 : i.Data;
1432
1540
  }));
1433
- o(this, "getCertInfo", (e) => l(this, null, function* () {
1434
- var n, r;
1541
+ a(this, "getCertInfo", (e) => c(this, null, function* () {
1542
+ var n, i;
1435
1543
  const t = yield (n = this.coreInstance) == null ? void 0 : n.getCertInfo(e);
1436
- return S({}, (r = t == null ? void 0 : t[0]) != null ? r : {});
1544
+ return m({}, (i = t == null ? void 0 : t[0]) != null ? i : {});
1437
1545
  }));
1438
- o(this, "getCertInfoByOid", (e) => l(this, null, function* () {
1439
- var n, r;
1440
- const t = yield (n = this.coreInstance) == null ? void 0 : n.getCertInfoByOid(S({}, e != null ? e : {}));
1441
- return (r = t == null ? void 0 : t[0]) == null ? void 0 : r.OidValue;
1546
+ a(this, "getCertInfoByOid", (e) => c(this, null, function* () {
1547
+ var n, i;
1548
+ const t = yield (n = this.coreInstance) == null ? void 0 : n.getCertInfoByOid(m({}, e != null ? e : {}));
1549
+ return (i = t == null ? void 0 : t[0]) == null ? void 0 : i.OidValue;
1442
1550
  }));
1443
- o(this, "getSealVendor", (e) => l(this, null, function* () {
1444
- var r;
1445
- const t = yield this.getSignatureCert(e), n = yield (r = this.coreInstance) == null ? void 0 : r.getSealVendor({
1551
+ a(this, "getSealVendor", (e) => c(this, null, function* () {
1552
+ var i;
1553
+ const t = yield this.getSignatureCert(e), n = yield (i = this.coreInstance) == null ? void 0 : i.getSealVendor({
1446
1554
  ContainerName: t == null ? void 0 : t.ContainerName
1447
1555
  });
1448
1556
  return n == null ? void 0 : n[0];
1449
1557
  }));
1450
- o(this, "deleteAllSealByVendor", (e, t) => l(this, null, function* () {
1451
- var a;
1452
- const n = yield this.getSignatureCert(t), r = yield (a = this.coreInstance) == null ? void 0 : a.deleteAllSealByVendor(E(S({}, e != null ? e : {}), {
1558
+ a(this, "deleteAllSealByVendor", (e, t) => c(this, null, function* () {
1559
+ var r;
1560
+ const n = yield this.getSignatureCert(t), i = yield (r = this.coreInstance) == null ? void 0 : r.deleteAllSealByVendor(_(m({}, e != null ? e : {}), {
1561
+ ContainerName: n == null ? void 0 : n.ContainerName
1562
+ }));
1563
+ return i == null ? void 0 : i[0];
1564
+ }));
1565
+ a(this, "getUKeyList", (e) => c(this, null, function* () {
1566
+ var i;
1567
+ if (e) return e;
1568
+ const t = yield (i = this.coreInstance) == null ? void 0 : i.getUKeyList();
1569
+ return yield O.open({
1570
+ title: "选择介质",
1571
+ data: t,
1572
+ columns: kt
1573
+ });
1574
+ }));
1575
+ a(this, "getUKeyInfo", (e) => c(this, null, function* () {
1576
+ var i;
1577
+ const t = yield this.getUKeyList(e), n = yield (i = this.coreInstance) == null ? void 0 : i.getUKeyInfo({
1578
+ manu: t == null ? void 0 : t.manu,
1579
+ sn: t == null ? void 0 : t.sn
1580
+ });
1581
+ return n == null ? void 0 : n[0];
1582
+ }));
1583
+ a(this, "applyCert", (e, t) => c(this, null, function* () {
1584
+ var o;
1585
+ const n = yield this.getUKeyList(t), i = yield this.getUKeyInfo(n);
1586
+ return yield (o = this.coreInstance) == null ? void 0 : o.applyCert(_(m({}, e != null ? e : {}), {
1587
+ manu: i == null ? void 0 : i.manu,
1588
+ sn: i == null ? void 0 : i.sn,
1589
+ ContainerName: i == null ? void 0 : i.keyid
1590
+ }));
1591
+ }));
1592
+ a(this, "resetPin", (e, t) => c(this, null, function* () {
1593
+ var r;
1594
+ const n = yield this.getSignatureCert(t);
1595
+ return yield (r = this.coreInstance) == null ? void 0 : r.resetPin(_(m({}, e != null ? e : {}), {
1596
+ manu: n == null ? void 0 : n.manu,
1597
+ sn: n == null ? void 0 : n.sn,
1453
1598
  ContainerName: n == null ? void 0 : n.ContainerName
1454
1599
  }));
1455
- return r == null ? void 0 : r[0];
1456
1600
  }));
1457
- return N.instance && !(e != null && e.isCreateNew) ? N.instance : (this.createGwsCore(e), N.instance = this, this);
1601
+ return $.instance && !(e != null && e.isCreateNew) ? $.instance : (this.createGwsCore(e), $.instance = this, this);
1458
1602
  }
1459
1603
  };
1460
- o(N, "instance", null);
1461
- let H = N;
1462
- function kt(s) {
1604
+ a($, "instance", null);
1605
+ let H = $;
1606
+ function _t(s) {
1463
1607
  return new Promise((e, t) => {
1464
1608
  if (H.instance && !(s != null && s.isCreateNew))
1465
1609
  e(H.instance);
1466
1610
  else {
1467
- const n = new H(E(S({}, s != null ? s : {}), {
1468
- onOpen(r) {
1469
- var a;
1470
- e(n), (a = s == null ? void 0 : s.onOpen) == null || a.call(s, r);
1611
+ const n = new H(_(m({}, s != null ? s : {}), {
1612
+ onOpen(i) {
1613
+ var r;
1614
+ e(n), (r = s == null ? void 0 : s.onOpen) == null || r.call(s, i);
1471
1615
  },
1472
- onClose(r) {
1473
- var a;
1474
- t(r), (a = s == null ? void 0 : s.onClose) == null || a.call(s, r);
1616
+ onClose(i) {
1617
+ var r;
1618
+ t(i), (r = s == null ? void 0 : s.onClose) == null || r.call(s, i);
1475
1619
  }
1476
1620
  }));
1477
1621
  }
@@ -1479,5 +1623,5 @@ function kt(s) {
1479
1623
  }
1480
1624
  export {
1481
1625
  H as GwsService,
1482
- kt as createService
1626
+ _t as createService
1483
1627
  };