vela-h5-sdk 0.0.14 → 0.0.16
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/vela-login-sdk.es.js +124 -170
- package/dist/vela-login-sdk.umd.js +11 -11
- package/package.json +1 -1
|
@@ -273,34 +273,34 @@ var P = class extends HTMLElement {
|
|
|
273
273
|
P.elementStyles = [], P.shadowRootOptions = { mode: "open" }, P[A("elementProperties")] = /* @__PURE__ */ new Map(), P[A("finalized")] = /* @__PURE__ */ new Map(), k?.({ ReactiveElement: P }), (E.reactiveElementVersions ??= []).push("2.1.2");
|
|
274
274
|
//#endregion
|
|
275
275
|
//#region node_modules/lit-html/lit-html.js
|
|
276
|
-
var ee = globalThis, te = (e) => e, F = ee.trustedTypes, I = F ? F.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, L = "$lit$", R = `lit$${Math.random().toFixed(9).slice(2)}$`, ne = "?" + R, re = `<${ne}>`, z = document, ie = () => z.createComment(""), B = (e) => e === null || typeof e != "object" && typeof e != "function",
|
|
276
|
+
var ee = globalThis, te = (e) => e, F = ee.trustedTypes, I = F ? F.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, L = "$lit$", R = `lit$${Math.random().toFixed(9).slice(2)}$`, ne = "?" + R, re = `<${ne}>`, z = document, ie = () => z.createComment(""), B = (e) => e === null || typeof e != "object" && typeof e != "function", V = Array.isArray, ae = (e) => V(e) || typeof e?.[Symbol.iterator] == "function", oe = "[ \n\f\r]", se = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, ce = /-->/g, le = />/g, ue = RegExp(`>|${oe}(?:([^\\s"'>=/]+)(${oe}*=${oe}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`, "g"), de = /'/g, fe = /"/g, pe = /^(?:script|style|textarea|title)$/i, me = ((e) => (t, ...n) => ({
|
|
277
277
|
_$litType$: e,
|
|
278
278
|
strings: t,
|
|
279
279
|
values: n
|
|
280
|
-
}))(1),
|
|
281
|
-
function
|
|
282
|
-
if (!
|
|
280
|
+
}))(1), he = Symbol.for("lit-noChange"), H = Symbol.for("lit-nothing"), ge = /* @__PURE__ */ new WeakMap(), _e = z.createTreeWalker(z, 129);
|
|
281
|
+
function ve(e, t) {
|
|
282
|
+
if (!V(e) || !e.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
283
283
|
return I === void 0 ? t : I.createHTML(t);
|
|
284
284
|
}
|
|
285
|
-
var
|
|
286
|
-
let n = e.length - 1, r = [], i, a = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o =
|
|
285
|
+
var ye = (e, t) => {
|
|
286
|
+
let n = e.length - 1, r = [], i, a = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o = se;
|
|
287
287
|
for (let t = 0; t < n; t++) {
|
|
288
288
|
let n = e[t], s, c, l = -1, u = 0;
|
|
289
|
-
for (; u < n.length && (o.lastIndex = u, c = o.exec(n), c !== null);) u = o.lastIndex, o ===
|
|
290
|
-
let d = o ===
|
|
291
|
-
a += o ===
|
|
289
|
+
for (; u < n.length && (o.lastIndex = u, c = o.exec(n), c !== null);) u = o.lastIndex, o === se ? c[1] === "!--" ? o = ce : c[1] === void 0 ? c[2] === void 0 ? c[3] !== void 0 && (o = ue) : (pe.test(c[2]) && (i = RegExp("</" + c[2], "g")), o = ue) : o = le : o === ue ? c[0] === ">" ? (o = i ?? se, l = -1) : c[1] === void 0 ? l = -2 : (l = o.lastIndex - c[2].length, s = c[1], o = c[3] === void 0 ? ue : c[3] === "\"" ? fe : de) : o === fe || o === de ? o = ue : o === ce || o === le ? o = se : (o = ue, i = void 0);
|
|
290
|
+
let d = o === ue && e[t + 1].startsWith("/>") ? " " : "";
|
|
291
|
+
a += o === se ? n + re : l >= 0 ? (r.push(s), n.slice(0, l) + L + n.slice(l) + R + d) : n + R + (l === -2 ? t : d);
|
|
292
292
|
}
|
|
293
|
-
return [
|
|
294
|
-
},
|
|
293
|
+
return [ve(e, a + (e[n] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), r];
|
|
294
|
+
}, be = class e {
|
|
295
295
|
constructor({ strings: t, _$litType$: n }, r) {
|
|
296
296
|
let i;
|
|
297
297
|
this.parts = [];
|
|
298
|
-
let a = 0, o = 0, s = t.length - 1, c = this.parts, [l, u] =
|
|
299
|
-
if (this.el = e.createElement(l, r),
|
|
298
|
+
let a = 0, o = 0, s = t.length - 1, c = this.parts, [l, u] = ye(t, n);
|
|
299
|
+
if (this.el = e.createElement(l, r), _e.currentNode = this.el.content, n === 2 || n === 3) {
|
|
300
300
|
let e = this.el.content.firstChild;
|
|
301
301
|
e.replaceWith(...e.childNodes);
|
|
302
302
|
}
|
|
303
|
-
for (; (i =
|
|
303
|
+
for (; (i = _e.nextNode()) !== null && c.length < s;) {
|
|
304
304
|
if (i.nodeType === 1) {
|
|
305
305
|
if (i.hasAttributes()) for (let e of i.getAttributeNames()) if (e.endsWith(L)) {
|
|
306
306
|
let t = u[o++], n = i.getAttribute(e).split(R), r = /([.?@])?(.*)/.exec(t);
|
|
@@ -309,17 +309,17 @@ var be = (e, t) => {
|
|
|
309
309
|
index: a,
|
|
310
310
|
name: r[2],
|
|
311
311
|
strings: n,
|
|
312
|
-
ctor: r[1] === "." ?
|
|
312
|
+
ctor: r[1] === "." ? Te : r[1] === "?" ? Ee : r[1] === "@" ? De : we
|
|
313
313
|
}), i.removeAttribute(e);
|
|
314
314
|
} else e.startsWith(R) && (c.push({
|
|
315
315
|
type: 6,
|
|
316
316
|
index: a
|
|
317
317
|
}), i.removeAttribute(e));
|
|
318
|
-
if (
|
|
318
|
+
if (pe.test(i.tagName)) {
|
|
319
319
|
let e = i.textContent.split(R), t = e.length - 1;
|
|
320
320
|
if (t > 0) {
|
|
321
321
|
i.textContent = F ? F.emptyScript : "";
|
|
322
|
-
for (let n = 0; n < t; n++) i.append(e[n], ie()),
|
|
322
|
+
for (let n = 0; n < t; n++) i.append(e[n], ie()), _e.nextNode(), c.push({
|
|
323
323
|
type: 2,
|
|
324
324
|
index: ++a
|
|
325
325
|
});
|
|
@@ -347,12 +347,12 @@ var be = (e, t) => {
|
|
|
347
347
|
return n.innerHTML = e, n;
|
|
348
348
|
}
|
|
349
349
|
};
|
|
350
|
-
function
|
|
351
|
-
if (t ===
|
|
350
|
+
function xe(e, t, n = e, r) {
|
|
351
|
+
if (t === he) return t;
|
|
352
352
|
let i = r === void 0 ? n._$Cl : n._$Co?.[r], a = B(t) ? void 0 : t._$litDirective$;
|
|
353
|
-
return i?.constructor !== a && (i?._$AO?.(!1), a === void 0 ? i = void 0 : (i = new a(e), i._$AT(e, n, r)), r === void 0 ? n._$Cl = i : (n._$Co ??= [])[r] = i), i !== void 0 && (t =
|
|
353
|
+
return i?.constructor !== a && (i?._$AO?.(!1), a === void 0 ? i = void 0 : (i = new a(e), i._$AT(e, n, r)), r === void 0 ? n._$Cl = i : (n._$Co ??= [])[r] = i), i !== void 0 && (t = xe(e, i._$AS(e, t.values), i, r)), t;
|
|
354
354
|
}
|
|
355
|
-
var
|
|
355
|
+
var Se = class {
|
|
356
356
|
constructor(e, t) {
|
|
357
357
|
this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = t;
|
|
358
358
|
}
|
|
@@ -364,27 +364,27 @@ var Ce = class {
|
|
|
364
364
|
}
|
|
365
365
|
u(e) {
|
|
366
366
|
let { el: { content: t }, parts: n } = this._$AD, r = (e?.creationScope ?? z).importNode(t, !0);
|
|
367
|
-
|
|
368
|
-
let i =
|
|
367
|
+
_e.currentNode = r;
|
|
368
|
+
let i = _e.nextNode(), a = 0, o = 0, s = n[0];
|
|
369
369
|
for (; s !== void 0;) {
|
|
370
370
|
if (a === s.index) {
|
|
371
371
|
let t;
|
|
372
|
-
s.type === 2 ? t = new
|
|
372
|
+
s.type === 2 ? t = new Ce(i, i.nextSibling, this, e) : s.type === 1 ? t = new s.ctor(i, s.name, s.strings, this, e) : s.type === 6 && (t = new Oe(i, this, e)), this._$AV.push(t), s = n[++o];
|
|
373
373
|
}
|
|
374
|
-
a !== s?.index && (i =
|
|
374
|
+
a !== s?.index && (i = _e.nextNode(), a++);
|
|
375
375
|
}
|
|
376
|
-
return
|
|
376
|
+
return _e.currentNode = z, r;
|
|
377
377
|
}
|
|
378
378
|
p(e) {
|
|
379
379
|
let t = 0;
|
|
380
380
|
for (let n of this._$AV) n !== void 0 && (n.strings === void 0 ? n._$AI(e[t]) : (n._$AI(e, n, t), t += n.strings.length - 2)), t++;
|
|
381
381
|
}
|
|
382
|
-
},
|
|
382
|
+
}, Ce = class e {
|
|
383
383
|
get _$AU() {
|
|
384
384
|
return this._$AM?._$AU ?? this._$Cv;
|
|
385
385
|
}
|
|
386
386
|
constructor(e, t, n, r) {
|
|
387
|
-
this.type = 2, this._$AH =
|
|
387
|
+
this.type = 2, this._$AH = H, this._$AN = void 0, this._$AA = e, this._$AB = t, this._$AM = n, this.options = r, this._$Cv = r?.isConnected ?? !0;
|
|
388
388
|
}
|
|
389
389
|
get parentNode() {
|
|
390
390
|
let e = this._$AA.parentNode, t = this._$AM;
|
|
@@ -397,7 +397,7 @@ var Ce = class {
|
|
|
397
397
|
return this._$AB;
|
|
398
398
|
}
|
|
399
399
|
_$AI(e, t = this) {
|
|
400
|
-
e =
|
|
400
|
+
e = xe(this, e, t), B(e) ? e === H || e == null || e === "" ? (this._$AH !== H && this._$AR(), this._$AH = H) : e !== this._$AH && e !== he && this._(e) : e._$litType$ === void 0 ? e.nodeType === void 0 ? ae(e) ? this.k(e) : this._(e) : this.T(e) : this.$(e);
|
|
401
401
|
}
|
|
402
402
|
O(e) {
|
|
403
403
|
return this._$AA.parentNode.insertBefore(e, this._$AB);
|
|
@@ -406,22 +406,22 @@ var Ce = class {
|
|
|
406
406
|
this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
|
|
407
407
|
}
|
|
408
408
|
_(e) {
|
|
409
|
-
this._$AH !==
|
|
409
|
+
this._$AH !== H && B(this._$AH) ? this._$AA.nextSibling.data = e : this.T(z.createTextNode(e)), this._$AH = e;
|
|
410
410
|
}
|
|
411
411
|
$(e) {
|
|
412
|
-
let { values: t, _$litType$: n } = e, r = typeof n == "number" ? this._$AC(e) : (n.el === void 0 && (n.el =
|
|
412
|
+
let { values: t, _$litType$: n } = e, r = typeof n == "number" ? this._$AC(e) : (n.el === void 0 && (n.el = be.createElement(ve(n.h, n.h[0]), this.options)), n);
|
|
413
413
|
if (this._$AH?._$AD === r) this._$AH.p(t);
|
|
414
414
|
else {
|
|
415
|
-
let e = new
|
|
415
|
+
let e = new Se(r, this), n = e.u(this.options);
|
|
416
416
|
e.p(t), this.T(n), this._$AH = e;
|
|
417
417
|
}
|
|
418
418
|
}
|
|
419
419
|
_$AC(e) {
|
|
420
|
-
let t =
|
|
421
|
-
return t === void 0 &&
|
|
420
|
+
let t = ge.get(e.strings);
|
|
421
|
+
return t === void 0 && ge.set(e.strings, t = new be(e)), t;
|
|
422
422
|
}
|
|
423
423
|
k(t) {
|
|
424
|
-
|
|
424
|
+
V(this._$AH) || (this._$AH = [], this._$AR());
|
|
425
425
|
let n = this._$AH, r, i = 0;
|
|
426
426
|
for (let a of t) i === n.length ? n.push(r = new e(this.O(ie()), this.O(ie()), this, this.options)) : r = n[i], r._$AI(a), i++;
|
|
427
427
|
i < n.length && (this._$AR(r && r._$AB.nextSibling, i), n.length = i);
|
|
@@ -435,7 +435,7 @@ var Ce = class {
|
|
|
435
435
|
setConnected(e) {
|
|
436
436
|
this._$AM === void 0 && (this._$Cv = e, this._$AP?.(e));
|
|
437
437
|
}
|
|
438
|
-
},
|
|
438
|
+
}, we = class {
|
|
439
439
|
get tagName() {
|
|
440
440
|
return this.element.tagName;
|
|
441
441
|
}
|
|
@@ -443,47 +443,47 @@ var Ce = class {
|
|
|
443
443
|
return this._$AM._$AU;
|
|
444
444
|
}
|
|
445
445
|
constructor(e, t, n, r, i) {
|
|
446
|
-
this.type = 1, this._$AH =
|
|
446
|
+
this.type = 1, this._$AH = H, this._$AN = void 0, this.element = e, this.name = t, this._$AM = r, this.options = i, n.length > 2 || n[0] !== "" || n[1] !== "" ? (this._$AH = Array(n.length - 1).fill(/* @__PURE__ */ new String()), this.strings = n) : this._$AH = H;
|
|
447
447
|
}
|
|
448
448
|
_$AI(e, t = this, n, r) {
|
|
449
449
|
let i = this.strings, a = !1;
|
|
450
|
-
if (i === void 0) e =
|
|
450
|
+
if (i === void 0) e = xe(this, e, t, 0), a = !B(e) || e !== this._$AH && e !== he, a && (this._$AH = e);
|
|
451
451
|
else {
|
|
452
452
|
let r = e, o, s;
|
|
453
|
-
for (e = i[0], o = 0; o < i.length - 1; o++) s =
|
|
453
|
+
for (e = i[0], o = 0; o < i.length - 1; o++) s = xe(this, r[n + o], t, o), s === he && (s = this._$AH[o]), a ||= !B(s) || s !== this._$AH[o], s === H ? e = H : e !== H && (e += (s ?? "") + i[o + 1]), this._$AH[o] = s;
|
|
454
454
|
}
|
|
455
455
|
a && !r && this.j(e);
|
|
456
456
|
}
|
|
457
457
|
j(e) {
|
|
458
|
-
e ===
|
|
458
|
+
e === H ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
|
|
459
459
|
}
|
|
460
|
-
},
|
|
460
|
+
}, Te = class extends we {
|
|
461
461
|
constructor() {
|
|
462
462
|
super(...arguments), this.type = 3;
|
|
463
463
|
}
|
|
464
464
|
j(e) {
|
|
465
|
-
this.element[this.name] = e ===
|
|
465
|
+
this.element[this.name] = e === H ? void 0 : e;
|
|
466
466
|
}
|
|
467
|
-
},
|
|
467
|
+
}, Ee = class extends we {
|
|
468
468
|
constructor() {
|
|
469
469
|
super(...arguments), this.type = 4;
|
|
470
470
|
}
|
|
471
471
|
j(e) {
|
|
472
|
-
this.element.toggleAttribute(this.name, !!e && e !==
|
|
472
|
+
this.element.toggleAttribute(this.name, !!e && e !== H);
|
|
473
473
|
}
|
|
474
|
-
},
|
|
474
|
+
}, De = class extends we {
|
|
475
475
|
constructor(e, t, n, r, i) {
|
|
476
476
|
super(e, t, n, r, i), this.type = 5;
|
|
477
477
|
}
|
|
478
478
|
_$AI(e, t = this) {
|
|
479
|
-
if ((e =
|
|
480
|
-
let n = this._$AH, r = e ===
|
|
479
|
+
if ((e = xe(this, e, t, 0) ?? H) === he) return;
|
|
480
|
+
let n = this._$AH, r = e === H && n !== H || e.capture !== n.capture || e.once !== n.once || e.passive !== n.passive, i = e !== H && (n === H || r);
|
|
481
481
|
r && this.element.removeEventListener(this.name, this, n), i && this.element.addEventListener(this.name, this, e), this._$AH = e;
|
|
482
482
|
}
|
|
483
483
|
handleEvent(e) {
|
|
484
484
|
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, e) : this._$AH.handleEvent(e);
|
|
485
485
|
}
|
|
486
|
-
},
|
|
486
|
+
}, Oe = class {
|
|
487
487
|
constructor(e, t, n) {
|
|
488
488
|
this.element = e, this.type = 6, this._$AN = void 0, this._$AM = t, this.options = n;
|
|
489
489
|
}
|
|
@@ -491,18 +491,18 @@ var Ce = class {
|
|
|
491
491
|
return this._$AM._$AU;
|
|
492
492
|
}
|
|
493
493
|
_$AI(e) {
|
|
494
|
-
|
|
494
|
+
xe(this, e);
|
|
495
495
|
}
|
|
496
|
-
},
|
|
497
|
-
|
|
498
|
-
var
|
|
496
|
+
}, ke = ee.litHtmlPolyfillSupport;
|
|
497
|
+
ke?.(be, Ce), (ee.litHtmlVersions ??= []).push("3.3.3");
|
|
498
|
+
var Ae = (e, t, n) => {
|
|
499
499
|
let r = n?.renderBefore ?? t, i = r._$litPart$;
|
|
500
500
|
if (i === void 0) {
|
|
501
501
|
let e = n?.renderBefore ?? null;
|
|
502
|
-
r._$litPart$ = i = new
|
|
502
|
+
r._$litPart$ = i = new Ce(t.insertBefore(ie(), e), e, void 0, n ?? {});
|
|
503
503
|
}
|
|
504
504
|
return i._$AI(e), i;
|
|
505
|
-
},
|
|
505
|
+
}, je = globalThis, Me = class extends P {
|
|
506
506
|
constructor() {
|
|
507
507
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
508
508
|
}
|
|
@@ -512,7 +512,7 @@ var je = (e, t, n) => {
|
|
|
512
512
|
}
|
|
513
513
|
update(e) {
|
|
514
514
|
let t = this.render();
|
|
515
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do =
|
|
515
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = Ae(t, this.renderRoot, this.renderOptions);
|
|
516
516
|
}
|
|
517
517
|
connectedCallback() {
|
|
518
518
|
super.connectedCallback(), this._$Do?.setConnected(!0);
|
|
@@ -521,25 +521,25 @@ var je = (e, t, n) => {
|
|
|
521
521
|
super.disconnectedCallback(), this._$Do?.setConnected(!1);
|
|
522
522
|
}
|
|
523
523
|
render() {
|
|
524
|
-
return
|
|
524
|
+
return he;
|
|
525
525
|
}
|
|
526
526
|
};
|
|
527
|
-
|
|
528
|
-
var
|
|
529
|
-
|
|
527
|
+
Me._$litElement$ = !0, Me.finalized = !0, je.litElementHydrateSupport?.({ LitElement: Me });
|
|
528
|
+
var Ne = je.litElementPolyfillSupport;
|
|
529
|
+
Ne?.({ LitElement: Me }), (je.litElementVersions ??= []).push("4.2.2");
|
|
530
530
|
//#endregion
|
|
531
531
|
//#region node_modules/@lit/reactive-element/decorators/custom-element.js
|
|
532
|
-
var
|
|
532
|
+
var Pe = (e) => (t, n) => {
|
|
533
533
|
n === void 0 ? customElements.define(e, t) : n.addInitializer(() => {
|
|
534
534
|
customElements.define(e, t);
|
|
535
535
|
});
|
|
536
|
-
},
|
|
536
|
+
}, Fe = {
|
|
537
537
|
attribute: !0,
|
|
538
538
|
type: String,
|
|
539
539
|
converter: j,
|
|
540
540
|
reflect: !1,
|
|
541
541
|
hasChanged: M
|
|
542
|
-
},
|
|
542
|
+
}, Ie = (e = Fe, t, n) => {
|
|
543
543
|
let { kind: r, metadata: i } = n, a = globalThis.litPropertyMetadata.get(i);
|
|
544
544
|
if (a === void 0 && globalThis.litPropertyMetadata.set(i, a = /* @__PURE__ */ new Map()), r === "setter" && ((e = Object.create(e)).wrapped = !0), a.set(n.name, e), r === "accessor") {
|
|
545
545
|
let { name: r } = n;
|
|
@@ -562,8 +562,8 @@ var Fe = (e) => (t, n) => {
|
|
|
562
562
|
}
|
|
563
563
|
throw Error("Unsupported decorator location: " + r);
|
|
564
564
|
};
|
|
565
|
-
function
|
|
566
|
-
return (t, n) => typeof n == "object" ?
|
|
565
|
+
function Le(e) {
|
|
566
|
+
return (t, n) => typeof n == "object" ? Ie(e, t, n) : ((e, t, n) => {
|
|
567
567
|
let r = t.hasOwnProperty(n);
|
|
568
568
|
return t.constructor.createProperty(n, e), r ? Object.getOwnPropertyDescriptor(t, n) : void 0;
|
|
569
569
|
})(e, t, n);
|
|
@@ -571,7 +571,7 @@ function H(e) {
|
|
|
571
571
|
//#endregion
|
|
572
572
|
//#region node_modules/@lit/reactive-element/decorators/state.js
|
|
573
573
|
function Re(e) {
|
|
574
|
-
return
|
|
574
|
+
return Le({
|
|
575
575
|
...e,
|
|
576
576
|
state: !0,
|
|
577
577
|
attribute: !1
|
|
@@ -1182,14 +1182,14 @@ var ze = /* @__PURE__ */ o(((e, t) => {
|
|
|
1182
1182
|
},
|
|
1183
1183
|
_doProcessBlock: function(e, t) {
|
|
1184
1184
|
for (var n = this._hash.words, r = n[0], i = n[1], a = n[2], o = n[3], s = n[4], u = n[5], d = n[6], f = n[7], p = r.high, m = r.low, h = i.high, g = i.low, _ = a.high, v = a.low, y = o.high, b = o.low, x = s.high, S = s.low, C = u.high, w = u.low, T = d.high, E = d.low, D = f.high, O = f.low, k = p, A = m, j = h, M = g, N = _, P = v, ee = y, te = b, F = x, I = S, L = C, R = w, ne = T, re = E, z = D, ie = O, B = 0; B < 80; B++) {
|
|
1185
|
-
var ae, oe
|
|
1186
|
-
if (B < 16)
|
|
1185
|
+
var V, ae, oe = l[B];
|
|
1186
|
+
if (B < 16) ae = oe.high = e[t + B * 2] | 0, V = oe.low = e[t + B * 2 + 1] | 0;
|
|
1187
1187
|
else {
|
|
1188
|
-
var
|
|
1189
|
-
|
|
1188
|
+
var se = l[B - 15], ce = se.high, le = se.low, ue = (ce >>> 1 | le << 31) ^ (ce >>> 8 | le << 24) ^ ce >>> 7, de = (le >>> 1 | ce << 31) ^ (le >>> 8 | ce << 24) ^ (le >>> 7 | ce << 25), fe = l[B - 2], pe = fe.high, me = fe.low, he = (pe >>> 19 | me << 13) ^ (pe << 3 | me >>> 29) ^ pe >>> 6, H = (me >>> 19 | pe << 13) ^ (me << 3 | pe >>> 29) ^ (me >>> 6 | pe << 26), ge = l[B - 7], _e = ge.high, ve = ge.low, ye = l[B - 16], be = ye.high, xe = ye.low;
|
|
1189
|
+
V = de + ve, ae = ue + _e + +(V >>> 0 < de >>> 0), V += H, ae = ae + he + +(V >>> 0 < H >>> 0), V += xe, ae = ae + be + +(V >>> 0 < xe >>> 0), oe.high = ae, oe.low = V;
|
|
1190
1190
|
}
|
|
1191
|
-
var
|
|
1192
|
-
z = ne, ie = re, ne = L, re = R, L = F, R = I, I = te +
|
|
1191
|
+
var Se = F & L ^ ~F & ne, Ce = I & R ^ ~I & re, we = k & j ^ k & N ^ j & N, Te = A & M ^ A & P ^ M & P, Ee = (k >>> 28 | A << 4) ^ (k << 30 | A >>> 2) ^ (k << 25 | A >>> 7), De = (A >>> 28 | k << 4) ^ (A << 30 | k >>> 2) ^ (A << 25 | k >>> 7), Oe = (F >>> 14 | I << 18) ^ (F >>> 18 | I << 14) ^ (F << 23 | I >>> 9), ke = (I >>> 14 | F << 18) ^ (I >>> 18 | F << 14) ^ (I << 23 | F >>> 9), Ae = c[B], je = Ae.high, Me = Ae.low, Ne = ie + ke, Pe = z + Oe + +(Ne >>> 0 < ie >>> 0), Ne = Ne + Ce, Pe = Pe + Se + +(Ne >>> 0 < Ce >>> 0), Ne = Ne + Me, Pe = Pe + je + +(Ne >>> 0 < Me >>> 0), Ne = Ne + V, Pe = Pe + ae + +(Ne >>> 0 < V >>> 0), Fe = De + Te, Ie = Ee + we + +(Fe >>> 0 < De >>> 0);
|
|
1192
|
+
z = ne, ie = re, ne = L, re = R, L = F, R = I, I = te + Ne | 0, F = ee + Pe + +(I >>> 0 < te >>> 0) | 0, ee = N, te = P, N = j, P = M, j = k, M = A, A = Ne + Fe | 0, k = Pe + Ie + +(A >>> 0 < Ne >>> 0) | 0;
|
|
1193
1193
|
}
|
|
1194
1194
|
m = r.low = m + A, r.high = p + k + +(m >>> 0 < A >>> 0), g = i.low = g + M, i.high = h + j + +(g >>> 0 < M >>> 0), v = a.low = v + P, a.high = _ + N + +(v >>> 0 < P >>> 0), b = o.low = b + te, o.high = y + ee + +(b >>> 0 < te >>> 0), S = s.low = S + I, s.high = x + F + +(S >>> 0 < I >>> 0), w = u.low = w + R, u.high = C + L + +(w >>> 0 < R >>> 0), E = d.low = E + re, d.high = T + ne + +(E >>> 0 < re >>> 0), O = f.low = O + ie, f.high = D + z + +(O >>> 0 < ie >>> 0);
|
|
1195
1195
|
},
|
|
@@ -6339,7 +6339,9 @@ Z.Axios = aa, Z.CanceledError = Yr, Z.CancelToken = oa, Z.isCancel = Jr, Z.VERSI
|
|
|
6339
6339
|
}, Z.spread = sa, Z.isAxiosError = ca, Z.mergeConfig = gi, Z.AxiosHeaders = q, Z.formToJSON = (e) => Hr(K.isHTMLForm(e) ? new FormData(e) : e), Z.getAdapter = Qi.getAdapter, Z.HttpStatusCode = la, Z.default = Z;
|
|
6340
6340
|
//#endregion
|
|
6341
6341
|
//#region src/utils/http.ts
|
|
6342
|
-
var da = /* @__PURE__ */ l(yt(), 1)
|
|
6342
|
+
var da = /* @__PURE__ */ l(yt(), 1);
|
|
6343
|
+
Z.defaults.xsrfCookieName = "XSRF-TOKEN", Z.defaults.xsrfHeaderName = "X-CSRF-TOKEN", Z.defaults.withCredentials = !0;
|
|
6344
|
+
var fa = "https://cc.velalive.net.vn", pa = {
|
|
6343
6345
|
url_web_account_login: fa + "/web/account_login/v2",
|
|
6344
6346
|
url_web_reset_password: fa + "/web/reset_password/v2",
|
|
6345
6347
|
url_web_third_login: fa + "/web/third_login/v2",
|
|
@@ -6353,16 +6355,20 @@ var da = /* @__PURE__ */ l(yt(), 1), fa = "https://cc.velalive.net.vn", pa = {
|
|
|
6353
6355
|
"X-Requested-With": "XMLHttpRequest"
|
|
6354
6356
|
}
|
|
6355
6357
|
});
|
|
6356
|
-
ma.interceptors.request.use((e) => {
|
|
6357
|
-
let t =
|
|
6358
|
-
return t ? e.headers["X-CSRF-TOKEN"] = t.content : console.error("CSRF token not found in meta tag!"), e;
|
|
6359
|
-
}, (e) => Promise.reject(e)), ma.interceptors.response.use((e) => e.data, (e) => {
|
|
6358
|
+
ma.interceptors.request.use((e) => e, (e) => Promise.reject(e)), ma.interceptors.response.use((e) => e.data, async (e) => {
|
|
6359
|
+
let t = e.config;
|
|
6360
6360
|
if (e.response) switch (e.response.status) {
|
|
6361
6361
|
case 401:
|
|
6362
|
-
alert("登录状态已失效,请重新登录!");
|
|
6362
|
+
alert("登录状态已失效,请重新登录!"), window.location.reload();
|
|
6363
6363
|
break;
|
|
6364
6364
|
case 419:
|
|
6365
|
-
|
|
6365
|
+
t._retry = !0;
|
|
6366
|
+
try {
|
|
6367
|
+
let e = (await Z.get("/refresh-csrf")).data.token, n = document.querySelector("meta[name=\"csrf-token\"]");
|
|
6368
|
+
return n && n.setAttribute("content", e), t.headers["X-CSRF-TOKEN"] = e, Z(t);
|
|
6369
|
+
} catch {
|
|
6370
|
+
alert("页面已过期,请刷新网页重试!"), window.location.reload();
|
|
6371
|
+
}
|
|
6366
6372
|
break;
|
|
6367
6373
|
default: alert(e.response.data.message || "网络请求错误");
|
|
6368
6374
|
}
|
|
@@ -6382,9 +6388,9 @@ function Q(e, t, n, r) {
|
|
|
6382
6388
|
}
|
|
6383
6389
|
//#endregion
|
|
6384
6390
|
//#region src/VelaLogin.ts
|
|
6385
|
-
var $ = class extends
|
|
6391
|
+
var $ = class extends Me {
|
|
6386
6392
|
constructor(...e) {
|
|
6387
|
-
super(...e), this.visible = !0, this.appId = "", this.channelId = "", this.uid = "", this.
|
|
6393
|
+
super(...e), this.visible = !0, this.appId = "", this.channelId = "", this.uid = "", this.appleClientId = "", this.appleScope = "", this.appleState = "", this.appleNonce = "", this.appleUsePopup = !1, this.appleRedirectURI = "", this.facebookAppId = "", this.currentView = "login", this._isLoading = !1, this.accountName = "", this.passcode = "", this.confirmPasscode = "", this.reset_password = "", this.reset_new_password = "", this.reset_new_confirm_password = "", this.quickLoginResolve = null;
|
|
6388
6394
|
}
|
|
6389
6395
|
static {
|
|
6390
6396
|
this.styles = _`
|
|
@@ -6763,69 +6769,7 @@ var $ = class extends Ne {
|
|
|
6763
6769
|
`;
|
|
6764
6770
|
}
|
|
6765
6771
|
connectedCallback() {
|
|
6766
|
-
super.connectedCallback(), this.
|
|
6767
|
-
}
|
|
6768
|
-
initUserInfoFromStorage() {
|
|
6769
|
-
try {
|
|
6770
|
-
let e = localStorage.getItem(this.STORAGE_KEY);
|
|
6771
|
-
e && (this.userInfo = JSON.parse(e), console.log("VelaSDK: 成功从本地恢复玩家凭证:", this.userInfo));
|
|
6772
|
-
} catch (e) {
|
|
6773
|
-
console.error("VelaSDK: 读取本地缓存失败", e);
|
|
6774
|
-
}
|
|
6775
|
-
}
|
|
6776
|
-
saveUserInfo(e) {
|
|
6777
|
-
this.userInfo = e;
|
|
6778
|
-
try {
|
|
6779
|
-
localStorage.setItem(this.STORAGE_KEY, JSON.stringify(e));
|
|
6780
|
-
} catch (e) {
|
|
6781
|
-
console.error("VelaSDK: 写入本地缓存失败", e);
|
|
6782
|
-
}
|
|
6783
|
-
}
|
|
6784
|
-
clearUserInfo() {
|
|
6785
|
-
this.userInfo = null;
|
|
6786
|
-
try {
|
|
6787
|
-
localStorage.removeItem(this.STORAGE_KEY);
|
|
6788
|
-
} catch (e) {
|
|
6789
|
-
console.error("VelaSDK: 擦除本地缓存失败", e);
|
|
6790
|
-
}
|
|
6791
|
-
}
|
|
6792
|
-
async quickLogin() {
|
|
6793
|
-
if (this.quickLoginResolve) return {
|
|
6794
|
-
success: !1,
|
|
6795
|
-
reason: "ALREADY_PENDING"
|
|
6796
|
-
};
|
|
6797
|
-
let e = this.userInfo;
|
|
6798
|
-
if (!e || !e.uid || !e.token) return console.warn("VelaSDK: 本地无缓存凭证,直接拉起 UI 登录..."), this.suspendAndOpenUI("login");
|
|
6799
|
-
try {
|
|
6800
|
-
console.log("VelaSDK: 正在使用本地凭证尝试静默登录...", e);
|
|
6801
|
-
let t = {
|
|
6802
|
-
code: 200,
|
|
6803
|
-
data: {
|
|
6804
|
-
uid: e.uid,
|
|
6805
|
-
token: "renewed_token_" + Date.now()
|
|
6806
|
-
}
|
|
6807
|
-
};
|
|
6808
|
-
if (t.code === 200) return this.saveUserInfo(t.data), this.visible = !1, {
|
|
6809
|
-
success: !0,
|
|
6810
|
-
data: t.data
|
|
6811
|
-
};
|
|
6812
|
-
throw Error("TOKEN_INVALID");
|
|
6813
|
-
} catch {
|
|
6814
|
-
return console.warn("VelaSDK: 本地凭证失效/快登失败,清除旧缓存并拉起 UI..."), this.clearUserInfo(), this.suspendAndOpenUI("login");
|
|
6815
|
-
}
|
|
6816
|
-
}
|
|
6817
|
-
async userCenter() {
|
|
6818
|
-
if (this.quickLoginResolve) return {
|
|
6819
|
-
success: !1,
|
|
6820
|
-
reason: "ALREADY_PENDING"
|
|
6821
|
-
};
|
|
6822
|
-
let e = this.userInfo;
|
|
6823
|
-
return (!e || !e.uid || !e.token) && console.warn("VelaSDK: 本地无缓存凭证,直接拉起 UI 登录..."), this.suspendAndOpenUI("userCenter");
|
|
6824
|
-
}
|
|
6825
|
-
suspendAndOpenUI(e) {
|
|
6826
|
-
return this.open(e), new Promise((e) => {
|
|
6827
|
-
this.quickLoginResolve = e;
|
|
6828
|
-
});
|
|
6772
|
+
super.connectedCallback(), this.loadAppleSDK(), this.loadGoogleSDK(), this.loadFacebookSDK();
|
|
6829
6773
|
}
|
|
6830
6774
|
open(e = "login") {
|
|
6831
6775
|
this.visible = !0, this.currentView = e;
|
|
@@ -6871,7 +6815,7 @@ var $ = class extends Ne {
|
|
|
6871
6815
|
return this.currentView === "register" ? this.switchToLogin() : this.currentView.startsWith("userCenter-") ? this.switchToUserCenter() : this.currentView.startsWith("binding-") ? this.switchToUserBinding() : this.close();
|
|
6872
6816
|
}
|
|
6873
6817
|
render() {
|
|
6874
|
-
return this.visible ?
|
|
6818
|
+
return this.visible ? me`
|
|
6875
6819
|
<div class="dialog-box active"> <!-- active 控制显示 -->
|
|
6876
6820
|
<div class="dialog-wrap">
|
|
6877
6821
|
<div class="dialog-conmain">
|
|
@@ -6886,15 +6830,15 @@ var $ = class extends Ne {
|
|
|
6886
6830
|
</div>
|
|
6887
6831
|
</div>
|
|
6888
6832
|
</div>
|
|
6889
|
-
${this._isLoading ?
|
|
6833
|
+
${this._isLoading ? me`
|
|
6890
6834
|
<div class="loading-overlay">
|
|
6891
6835
|
<div class="spinner"></div>
|
|
6892
6836
|
</div>
|
|
6893
6837
|
` : ""}
|
|
6894
|
-
` :
|
|
6838
|
+
` : me``;
|
|
6895
6839
|
}
|
|
6896
6840
|
renderLoginForm() {
|
|
6897
|
-
return
|
|
6841
|
+
return me`
|
|
6898
6842
|
<form @submit="${this.handleAccountLoginSubmit}">
|
|
6899
6843
|
<div class="field-group">
|
|
6900
6844
|
<label class="input-label" for="account-name">Account:</label>
|
|
@@ -6960,7 +6904,7 @@ var $ = class extends Ne {
|
|
|
6960
6904
|
`;
|
|
6961
6905
|
}
|
|
6962
6906
|
renderRegisterForm() {
|
|
6963
|
-
return
|
|
6907
|
+
return me`
|
|
6964
6908
|
<form @submit="${this.handleAccountRegisterSubmit}">
|
|
6965
6909
|
<div class="field-group">
|
|
6966
6910
|
<label class="input-label" for="reg-name">Account:</label>
|
|
@@ -6992,7 +6936,7 @@ var $ = class extends Ne {
|
|
|
6992
6936
|
`;
|
|
6993
6937
|
}
|
|
6994
6938
|
renderCenterForm() {
|
|
6995
|
-
return
|
|
6939
|
+
return me`
|
|
6996
6940
|
<div class="center-btn-list">
|
|
6997
6941
|
<div>
|
|
6998
6942
|
<div class="center-title">账号中心</div>
|
|
@@ -7021,7 +6965,7 @@ var $ = class extends Ne {
|
|
|
7021
6965
|
`;
|
|
7022
6966
|
}
|
|
7023
6967
|
renderResetPasswordForm() {
|
|
7024
|
-
return
|
|
6968
|
+
return me`
|
|
7025
6969
|
<form @submit="${this.handleResetPasswordSubmit}">
|
|
7026
6970
|
<div class="field-group">
|
|
7027
6971
|
<label class="input-label" for="reg-passcode">Old Password:</label>
|
|
@@ -7053,7 +6997,7 @@ var $ = class extends Ne {
|
|
|
7053
6997
|
`;
|
|
7054
6998
|
}
|
|
7055
6999
|
renderBindingForm() {
|
|
7056
|
-
return
|
|
7000
|
+
return me`
|
|
7057
7001
|
<div class="binding-content">
|
|
7058
7002
|
<div class="center-title">账户绑定</div>
|
|
7059
7003
|
<div class="center-id">aa_123</div>
|
|
@@ -7152,11 +7096,15 @@ var $ = class extends Ne {
|
|
|
7152
7096
|
handleLoginOutResult(e) {
|
|
7153
7097
|
console.log("SDK接收到的数据类型是:", typeof e, e), e.code === 0 ? (this.dispatchEvent(new CustomEvent("vela-login-out", { detail: e.data })), this.uid = "", this.switchToLogin()) : alert(e.msg);
|
|
7154
7098
|
}
|
|
7099
|
+
handleResetPasswordResult(e) {
|
|
7100
|
+
console.log("SDK接收到的数据类型是:", typeof e, e), e.code === 0 || alert(e.msg);
|
|
7101
|
+
}
|
|
7155
7102
|
async handleAccountLoginSubmit(e) {
|
|
7156
7103
|
if (e.preventDefault(), !this.accountName || !this.passcode) {
|
|
7157
7104
|
alert("账号和密码不能为空!");
|
|
7158
7105
|
return;
|
|
7159
7106
|
}
|
|
7107
|
+
this._isLoading = !0;
|
|
7160
7108
|
let t = da.default.MD5(this.accountName).toString(), n = da.default.MD5(this.passcode).toString();
|
|
7161
7109
|
console.log("执行登录...", this.accountName, this.passcode);
|
|
7162
7110
|
try {
|
|
@@ -7173,6 +7121,7 @@ var $ = class extends Ne {
|
|
|
7173
7121
|
} catch (e) {
|
|
7174
7122
|
console.error(e);
|
|
7175
7123
|
}
|
|
7124
|
+
this._isLoading = !1;
|
|
7176
7125
|
}
|
|
7177
7126
|
async handleAccountRegisterSubmit(e) {
|
|
7178
7127
|
if (e.preventDefault(), this.passcode !== this.confirmPasscode) {
|
|
@@ -7183,6 +7132,7 @@ var $ = class extends Ne {
|
|
|
7183
7132
|
alert("账号和密码不能为空!");
|
|
7184
7133
|
return;
|
|
7185
7134
|
}
|
|
7135
|
+
this._isLoading = !0;
|
|
7186
7136
|
let t = da.default.MD5(this.accountName).toString(), n = da.default.MD5(this.passcode).toString();
|
|
7187
7137
|
console.log("执行注册...", this.accountName, this.passcode);
|
|
7188
7138
|
try {
|
|
@@ -7199,29 +7149,36 @@ var $ = class extends Ne {
|
|
|
7199
7149
|
} catch (e) {
|
|
7200
7150
|
console.error(e);
|
|
7201
7151
|
}
|
|
7152
|
+
this._isLoading = !1;
|
|
7202
7153
|
}
|
|
7203
7154
|
async handleLogoutClick(e) {
|
|
7204
|
-
e.preventDefault(), console.log("执行退出登录...");
|
|
7155
|
+
e.preventDefault(), this._isLoading = !0, console.log("执行退出登录...");
|
|
7205
7156
|
try {
|
|
7206
7157
|
let e = await ha.request.post(ha.urls.url_web_login_out, {});
|
|
7207
7158
|
this.handleLoginOutResult(e);
|
|
7208
7159
|
} catch (e) {
|
|
7209
7160
|
console.error(e);
|
|
7210
7161
|
}
|
|
7211
|
-
console.log("退出登录");
|
|
7162
|
+
this._isLoading = !1, console.log("退出登录");
|
|
7212
7163
|
}
|
|
7213
7164
|
async handleResetPasswordSubmit(e) {
|
|
7214
7165
|
if (e.preventDefault(), this.passcode !== this.confirmPasscode) {
|
|
7215
7166
|
alert("รหัสผ่านไม่ตรงกัน (两次输入的密码不一致)");
|
|
7216
7167
|
return;
|
|
7217
7168
|
}
|
|
7218
|
-
|
|
7169
|
+
if (!this.accountName || !this.passcode) {
|
|
7170
|
+
alert("密码不能为空!");
|
|
7171
|
+
return;
|
|
7172
|
+
}
|
|
7173
|
+
this._isLoading = !0;
|
|
7174
|
+
let t = da.default.MD5(this.accountName).toString(), n = da.default.MD5(this.passcode).toString();
|
|
7175
|
+
console.log("执行重置密码...", this.accountName, this.passcode);
|
|
7219
7176
|
try {
|
|
7220
7177
|
let e = await ha.request.post(ha.urls.url_web_reset_password, {
|
|
7221
|
-
|
|
7222
|
-
|
|
7178
|
+
old_password: t,
|
|
7179
|
+
password: n
|
|
7223
7180
|
});
|
|
7224
|
-
|
|
7181
|
+
this.handleResetPasswordResult(e);
|
|
7225
7182
|
} catch (e) {
|
|
7226
7183
|
console.error(e);
|
|
7227
7184
|
}
|
|
@@ -7250,36 +7207,33 @@ var $ = class extends Ne {
|
|
|
7250
7207
|
}
|
|
7251
7208
|
}
|
|
7252
7209
|
};
|
|
7253
|
-
Q([
|
|
7210
|
+
Q([Le({
|
|
7254
7211
|
type: Boolean,
|
|
7255
7212
|
reflect: !0
|
|
7256
|
-
})], $.prototype, "visible", void 0), Q([
|
|
7257
|
-
type: String,
|
|
7258
|
-
attribute: "csrf-token"
|
|
7259
|
-
})], $.prototype, "csrfToken", void 0), Q([H({
|
|
7213
|
+
})], $.prototype, "visible", void 0), Q([Le({ type: String })], $.prototype, "appId", void 0), Q([Le({ type: String })], $.prototype, "channelId", void 0), Q([Le({ type: String })], $.prototype, "uid", void 0), Q([Le({
|
|
7260
7214
|
type: String,
|
|
7261
7215
|
attribute: "apple-client-id"
|
|
7262
|
-
})], $.prototype, "appleClientId", void 0), Q([
|
|
7216
|
+
})], $.prototype, "appleClientId", void 0), Q([Le({
|
|
7263
7217
|
type: String,
|
|
7264
7218
|
attribute: "apple-scope"
|
|
7265
|
-
})], $.prototype, "appleScope", void 0), Q([
|
|
7219
|
+
})], $.prototype, "appleScope", void 0), Q([Le({
|
|
7266
7220
|
type: String,
|
|
7267
7221
|
attribute: "apple-state"
|
|
7268
|
-
})], $.prototype, "appleState", void 0), Q([
|
|
7222
|
+
})], $.prototype, "appleState", void 0), Q([Le({
|
|
7269
7223
|
type: String,
|
|
7270
7224
|
attribute: "apple-nonce"
|
|
7271
|
-
})], $.prototype, "appleNonce", void 0), Q([
|
|
7225
|
+
})], $.prototype, "appleNonce", void 0), Q([Le({
|
|
7272
7226
|
type: Boolean,
|
|
7273
7227
|
attribute: "apple-use-popup"
|
|
7274
|
-
})], $.prototype, "appleUsePopup", void 0), Q([
|
|
7228
|
+
})], $.prototype, "appleUsePopup", void 0), Q([Le({
|
|
7275
7229
|
type: String,
|
|
7276
7230
|
attribute: "apple-redirect-uri"
|
|
7277
|
-
})], $.prototype, "appleRedirectURI", void 0), Q([
|
|
7231
|
+
})], $.prototype, "appleRedirectURI", void 0), Q([Le({
|
|
7278
7232
|
type: String,
|
|
7279
7233
|
attribute: "facebook-app-id"
|
|
7280
|
-
})], $.prototype, "facebookAppId", void 0), Q([
|
|
7234
|
+
})], $.prototype, "facebookAppId", void 0), Q([Le({
|
|
7281
7235
|
type: String,
|
|
7282
7236
|
attribute: "view-mode"
|
|
7283
|
-
})], $.prototype, "currentView", void 0), Q([Re()], $.prototype, "
|
|
7237
|
+
})], $.prototype, "currentView", void 0), Q([Re()], $.prototype, "_isLoading", void 0), Q([Re()], $.prototype, "accountName", void 0), Q([Re()], $.prototype, "passcode", void 0), Q([Re()], $.prototype, "confirmPasscode", void 0), Q([Re()], $.prototype, "reset_password", void 0), Q([Re()], $.prototype, "reset_new_password", void 0), Q([Re()], $.prototype, "reset_new_confirm_password", void 0), $ = Q([Pe("vela-login")], $);
|
|
7284
7238
|
//#endregion
|
|
7285
7239
|
export { $ as VelaLogin };
|