@polyv/answer-card-sdk 2.5.0-rc-20251113.1 → 2.5.0-rc-20251204.2
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/index.cjs.js +3 -3
- package/index.es.d.ts +5 -1
- package/index.es.js +24 -24
- package/index.umd.js +3 -3
- package/package.json +1 -1
package/index.es.d.ts
CHANGED
|
@@ -67,7 +67,11 @@ declare enum AnswerCardEvent {
|
|
|
67
67
|
/**
|
|
68
68
|
* 答题卡结果
|
|
69
69
|
*/
|
|
70
|
-
AnswerCardResult = "AnswerCardResult"
|
|
70
|
+
AnswerCardResult = "AnswerCardResult",
|
|
71
|
+
/**
|
|
72
|
+
* 提交答题卡
|
|
73
|
+
*/
|
|
74
|
+
SubmitAnswerCard = "SubmitAnswerCard"
|
|
71
75
|
}
|
|
72
76
|
|
|
73
77
|
declare type AnswerCardEventRelations = {
|
package/index.es.js
CHANGED
|
@@ -130,11 +130,11 @@ const dn = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
|
|
|
130
130
|
for (let n = 0; n < d.length; )
|
|
131
131
|
F = De[d.charAt(n++)] << 18 | De[d.charAt(n++)] << 12 | (e = De[d.charAt(n++)]) << 6 | (t = De[d.charAt(n++)]), e === 64 ? r.push(pe(F >> 16 & 255)) : t === 64 ? r.push(pe(F >> 16 & 255, F >> 8 & 255)) : r.push(pe(F >> 16 & 255, F >> 8 & 255, F & 255));
|
|
132
132
|
return r.join("");
|
|
133
|
-
}, Fr = typeof atob == "function" ? (d) => atob(Cr(d)) : mt ? (d) => Buffer.from(d, "base64").toString("binary") : yn, gn = mt ? (d) => Rt(Buffer.from(d, "base64")) : (d) => Rt(Fr(d).split("").map((F) => F.charCodeAt(0))), mn = mt ? (d) => Buffer.from(d, "base64").toString("utf8") : Tt ? (d) => Tt.decode(gn(d)) : (d) => bn(Fr(d)), En = (d) => Cr(d.replace(/[-_]/g, (F) => F == "-" ? "+" : "/")),
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
133
|
+
}, Fr = typeof atob == "function" ? (d) => atob(Cr(d)) : mt ? (d) => Buffer.from(d, "base64").toString("binary") : yn, gn = mt ? (d) => Rt(Buffer.from(d, "base64")) : (d) => Rt(Fr(d).split("").map((F) => F.charCodeAt(0))), mn = mt ? (d) => Buffer.from(d, "base64").toString("utf8") : Tt ? (d) => Tt.decode(gn(d)) : (d) => bn(Fr(d)), En = (d) => Cr(d.replace(/[-_]/g, (F) => F == "-" ? "+" : "/")), Be = (d) => mn(En(d));
|
|
134
|
+
Be("S0xmTzdabmZRQzhqSXZFWA==");
|
|
135
|
+
Be("VlRSZTdTbWRsbFJzSjdDYg==");
|
|
136
|
+
Be("UG9seXZBcGlSZXNwb25zZQ==");
|
|
137
|
+
Be("UG9seXZMaXZlRW5jcnlwdA==");
|
|
138
138
|
var S0 = typeof globalThis != "undefined" ? globalThis : typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : {};
|
|
139
139
|
function Bn(d) {
|
|
140
140
|
if (d.__esModule) return d;
|
|
@@ -6084,7 +6084,7 @@ var Sr = { exports: {} };
|
|
|
6084
6084
|
this[O] -= this.DV, ++O >= this.t && (this[this.t++] = 0), ++this[O];
|
|
6085
6085
|
}
|
|
6086
6086
|
}
|
|
6087
|
-
function
|
|
6087
|
+
function Ae() {
|
|
6088
6088
|
}
|
|
6089
6089
|
function wt(T) {
|
|
6090
6090
|
return T;
|
|
@@ -6095,9 +6095,9 @@ var Sr = { exports: {} };
|
|
|
6095
6095
|
function Lr(T, O) {
|
|
6096
6096
|
T.squareTo(O);
|
|
6097
6097
|
}
|
|
6098
|
-
|
|
6098
|
+
Ae.prototype.convert = wt, Ae.prototype.revert = wt, Ae.prototype.mulTo = qr, Ae.prototype.sqrTo = Lr;
|
|
6099
6099
|
function zr(T) {
|
|
6100
|
-
return this.exp(T, new
|
|
6100
|
+
return this.exp(T, new Ae());
|
|
6101
6101
|
}
|
|
6102
6102
|
function jr(T, O, P) {
|
|
6103
6103
|
var W = Math.min(this.t + T.t, O);
|
|
@@ -6494,9 +6494,9 @@ let ni = class {
|
|
|
6494
6494
|
var ii = {
|
|
6495
6495
|
ECCurveFp: ni
|
|
6496
6496
|
};
|
|
6497
|
-
const { BigInteger: fe, SecureRandom: oi } = Re, { ECCurveFp: ai } = ii, xi = new oi(), { curve:
|
|
6497
|
+
const { BigInteger: fe, SecureRandom: oi } = Re, { ECCurveFp: ai } = ii, xi = new oi(), { curve: Ee, G: fi, n: mr } = Tr();
|
|
6498
6498
|
function si() {
|
|
6499
|
-
return
|
|
6499
|
+
return Ee;
|
|
6500
6500
|
}
|
|
6501
6501
|
function Tr() {
|
|
6502
6502
|
const d = new fe("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF", 16), F = new fe("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC", 16), e = new fe("28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93", 16), t = new ai(d, F, e), c = t.decodePointHex("04" + "32C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7" + "BC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0"), v = new fe("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123", 16);
|
|
@@ -6555,15 +6555,15 @@ function pi(d) {
|
|
|
6555
6555
|
return F;
|
|
6556
6556
|
}
|
|
6557
6557
|
function vi(d) {
|
|
6558
|
-
const F =
|
|
6558
|
+
const F = Ee.decodePointHex(d);
|
|
6559
6559
|
if (!F) return !1;
|
|
6560
6560
|
const e = F.getX();
|
|
6561
|
-
return F.getY().square().equals(e.multiply(e.square()).add(e.multiply(
|
|
6561
|
+
return F.getY().square().equals(e.multiply(e.square()).add(e.multiply(Ee.a)).add(Ee.b));
|
|
6562
6562
|
}
|
|
6563
6563
|
function bi(d, F) {
|
|
6564
|
-
const e =
|
|
6564
|
+
const e = Ee.decodePointHex(d);
|
|
6565
6565
|
if (!e) return !1;
|
|
6566
|
-
const t =
|
|
6566
|
+
const t = Ee.decodePointHex(F);
|
|
6567
6567
|
return t ? e.equals(t) : !1;
|
|
6568
6568
|
}
|
|
6569
6569
|
var yi = {
|
|
@@ -6584,8 +6584,8 @@ for (let d = 0; d < At; d++)
|
|
|
6584
6584
|
gi[d] = 54, mi[d] = 92;
|
|
6585
6585
|
const { BigInteger: _i } = Re, Ei = yi;
|
|
6586
6586
|
Ei.generateEcparam();
|
|
6587
|
-
|
|
6588
|
-
|
|
6587
|
+
Be("MDQ1QjgxNTVFOTc0N0MyODNBQ0Y4NDI4OTVEMzA0OEU2Q0E5NDNDQzQ1NEFGQTZBOUE0NTJCNTkwM0NDMzBGQ0UyNzhBNkY4OEY2MDJFREY4MDNEQUI0MEJENDVFMzVGNjYwNjc2QkY2OEZEN0NDQkUwRjZBRDMyMzg4MTM2Q0QwRA==");
|
|
6588
|
+
Be("MDBCMzE5NjE4QjRCMUJBRUI4Q0M2NzY1RDg5MDNDMDVBMEIxNkQ5RDlGQ0QxNjMyNzFCQjZGMUI4OEY2NTdBMjhF");
|
|
6589
6589
|
var Er;
|
|
6590
6590
|
(function(d) {
|
|
6591
6591
|
d[d.C1C3C2 = 1] = "C1C3C2", d[d.C1C2C3 = 0] = "C1C2C3";
|
|
@@ -11454,7 +11454,7 @@ class Bi {
|
|
|
11454
11454
|
this.interactionCore = F, this.__iarCore = F, this.iarCore = F;
|
|
11455
11455
|
}
|
|
11456
11456
|
}
|
|
11457
|
-
var Se = /* @__PURE__ */ ((d) => (d.Quick = "quick", d.Question = "question", d))(Se || {}), ge = /* @__PURE__ */ ((d) => (d.SubmitSuccess = "SubmitSuccess", d.AnswerCardEnd = "AnswerCardEnd", d.AnswerSubmitted = "AnswerSubmitted", d.SubmitFailed = "SubmitFailed", d))(ge || {}),
|
|
11457
|
+
var Se = /* @__PURE__ */ ((d) => (d.Quick = "quick", d.Question = "question", d))(Se || {}), ge = /* @__PURE__ */ ((d) => (d.SubmitSuccess = "SubmitSuccess", d.AnswerCardEnd = "AnswerCardEnd", d.AnswerSubmitted = "AnswerSubmitted", d.SubmitFailed = "SubmitFailed", d))(ge || {}), me = /* @__PURE__ */ ((d) => (d.StartAnswerCard = "StartAnswerCard", d.StopAnswerCard = "StopAnswerCard", d.AnswerCardResult = "AnswerCardResult", d.SubmitAnswerCard = "SubmitAnswerCard", d))(me || {});
|
|
11458
11458
|
function wr(d) {
|
|
11459
11459
|
const F = {
|
|
11460
11460
|
answerCardType: d.itemType === 0 ? Se.Question : Se.Quick,
|
|
@@ -11489,7 +11489,7 @@ class Di extends Bi {
|
|
|
11489
11489
|
constructor(e) {
|
|
11490
11490
|
super(e);
|
|
11491
11491
|
ne(this, "AnswerCardType", Se);
|
|
11492
|
-
ne(this, "AnswerCardEvent",
|
|
11492
|
+
ne(this, "AnswerCardEvent", me);
|
|
11493
11493
|
ne(this, "AnswerCardSubmitResult", ge);
|
|
11494
11494
|
ne(this, "eventEmitter", new sn());
|
|
11495
11495
|
ne(this, "__currentAnswerCard");
|
|
@@ -11514,12 +11514,12 @@ class Di extends Bi {
|
|
|
11514
11514
|
const n = yield this.__getDuration();
|
|
11515
11515
|
t.duration = n, this.__startPollingDuration();
|
|
11516
11516
|
}
|
|
11517
|
-
this.__currentAnswerCard = t, this.eventEmitter.emit(
|
|
11517
|
+
this.__currentAnswerCard = t, this.eventEmitter.emit(me.StartAnswerCard, {
|
|
11518
11518
|
answerCardData: t
|
|
11519
11519
|
});
|
|
11520
11520
|
}));
|
|
11521
11521
|
ne(this, "__onStopAnswerCard", (e) => ue(this, null, function* () {
|
|
11522
|
-
this.__currentAnswerCard = void 0, this.eventEmitter.emit(
|
|
11522
|
+
this.__currentAnswerCard = void 0, this.eventEmitter.emit(me.StopAnswerCard, {
|
|
11523
11523
|
questionId: e.questionId
|
|
11524
11524
|
});
|
|
11525
11525
|
}));
|
|
@@ -11538,7 +11538,7 @@ class Di extends Bi {
|
|
|
11538
11538
|
isRight: r === e.result.answer,
|
|
11539
11539
|
isSubmitted: !!r
|
|
11540
11540
|
}, o = n ? parseFloat((v / n).toFixed(4)) : 0;
|
|
11541
|
-
c && (g.averageScore = o), this.eventEmitter.emit(
|
|
11541
|
+
c && (g.averageScore = o), this.eventEmitter.emit(me.AnswerCardResult, {
|
|
11542
11542
|
answerCardResult: g
|
|
11543
11543
|
});
|
|
11544
11544
|
}));
|
|
@@ -11627,15 +11627,15 @@ class Di extends Bi {
|
|
|
11627
11627
|
g = ge.AnswerSubmitted;
|
|
11628
11628
|
break;
|
|
11629
11629
|
}
|
|
11630
|
-
return g;
|
|
11630
|
+
return this.__currentAnswerCard = void 0, this.eventEmitter.emit(me.SubmitAnswerCard, {}), g;
|
|
11631
11631
|
});
|
|
11632
11632
|
}
|
|
11633
11633
|
}
|
|
11634
11634
|
console.log(
|
|
11635
11635
|
"%c@polyv/answer-card-sdk",
|
|
11636
11636
|
"background:#67C23A;padding: 2px 6px;border-radius: 3px;color: #fff",
|
|
11637
|
-
"[version: 2.5.0-rc-
|
|
11638
|
-
"[buildTime: 2025-
|
|
11637
|
+
"[version: 2.5.0-rc-20251204.2]",
|
|
11638
|
+
"[buildTime: 2025-12-04 07:46:19]"
|
|
11639
11639
|
);
|
|
11640
11640
|
export {
|
|
11641
11641
|
Di as AnswerCard,
|