interview-widget 3.2.19 → 3.2.20
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.
|
@@ -422,10 +422,10 @@ const du = (e) => {
|
|
|
422
422
|
}, hu = (e) => {
|
|
423
423
|
const t = P(null), i = P(null), [r, n] = N(!1), [o, s] = N(!1), [a, l] = N(null), [d, u] = N([]), [h, w] = N([]), [f, g] = N(""), [y, b] = N(""), [p, v] = N(!1), k = D(() => {
|
|
424
424
|
i.current && (i.current.getTracks().forEach((C) => C.stop()), i.current = null, l(null));
|
|
425
|
-
}, []),
|
|
425
|
+
}, []), _ = D(async () => {
|
|
426
426
|
var C, x, M, j;
|
|
427
427
|
try {
|
|
428
|
-
const
|
|
428
|
+
const $ = await navigator.mediaDevices.enumerateDevices(), X = $.filter((U) => U.kind === "audioinput"), O = $.filter((U) => U.kind === "videoinput");
|
|
429
429
|
if (u(X), w(O), !f && X.length > 0) {
|
|
430
430
|
const U = (C = i.current) == null ? void 0 : C.getAudioTracks()[0], ee = U == null ? void 0 : U.getSettings().deviceId;
|
|
431
431
|
g(ee || ((x = X[0]) == null ? void 0 : x.deviceId) || "");
|
|
@@ -434,8 +434,8 @@ const du = (e) => {
|
|
|
434
434
|
const U = (M = i.current) == null ? void 0 : M.getVideoTracks()[0], ee = U == null ? void 0 : U.getSettings().deviceId;
|
|
435
435
|
b(ee || ((j = O[0]) == null ? void 0 : j.deviceId) || "");
|
|
436
436
|
}
|
|
437
|
-
} catch (
|
|
438
|
-
console.error("Error enumerating devices:",
|
|
437
|
+
} catch ($) {
|
|
438
|
+
console.error("Error enumerating devices:", $);
|
|
439
439
|
}
|
|
440
440
|
}, [f, y]), A = D(async (C, x) => {
|
|
441
441
|
const M = {
|
|
@@ -450,9 +450,9 @@ const du = (e) => {
|
|
|
450
450
|
channelCount: { ideal: 1 },
|
|
451
451
|
...C ? { deviceId: { exact: C } } : {}
|
|
452
452
|
};
|
|
453
|
-
let
|
|
453
|
+
let $ = null;
|
|
454
454
|
try {
|
|
455
|
-
|
|
455
|
+
$ = await navigator.mediaDevices.getUserMedia({
|
|
456
456
|
video: M,
|
|
457
457
|
audio: j
|
|
458
458
|
}), n(!0), s(!0);
|
|
@@ -460,19 +460,19 @@ const du = (e) => {
|
|
|
460
460
|
console.warn("Combined media request failed, trying individual.", X);
|
|
461
461
|
try {
|
|
462
462
|
const O = await navigator.mediaDevices.getUserMedia({ audio: j });
|
|
463
|
-
n(!0),
|
|
463
|
+
n(!0), $ = O;
|
|
464
464
|
} catch (O) {
|
|
465
465
|
console.error("Audio permission denied", O), n(!1);
|
|
466
466
|
}
|
|
467
467
|
try {
|
|
468
468
|
const O = await navigator.mediaDevices.getUserMedia({ video: M });
|
|
469
|
-
s(!0),
|
|
469
|
+
s(!0), $ ? O.getTracks().forEach((U) => $.addTrack(U)) : $ = O;
|
|
470
470
|
} catch (O) {
|
|
471
471
|
console.error("Video permission denied", O), s(!1);
|
|
472
472
|
}
|
|
473
473
|
}
|
|
474
|
-
|
|
475
|
-
}, [
|
|
474
|
+
$ ? (i.current = $, l($), t.current && (t.current.srcObject = $, await t.current.play().catch((X) => console.error("Error playing video element", X)))) : (i.current = null, l(null)), await _();
|
|
475
|
+
}, [_]), E = async (C) => {
|
|
476
476
|
C !== f && (v(!0), g(C), k(), await A(C, y), v(!1));
|
|
477
477
|
}, G = async (C) => {
|
|
478
478
|
C !== y && (v(!0), b(C), k(), await A(f, C), v(!1));
|
|
@@ -493,7 +493,7 @@ const du = (e) => {
|
|
|
493
493
|
selectedVideoDeviceId: y,
|
|
494
494
|
isDeviceLoading: p,
|
|
495
495
|
currentStream: a,
|
|
496
|
-
handleAudioChange:
|
|
496
|
+
handleAudioChange: E,
|
|
497
497
|
handleVideoChange: G,
|
|
498
498
|
stopStream: k
|
|
499
499
|
};
|
|
@@ -4624,8 +4624,8 @@ const Lr = "https://storage.googleapis.com/mediapipe-models/face_landmarker/face
|
|
|
4624
4624
|
const { done: v, value: k } = await y.read();
|
|
4625
4625
|
if (v) break;
|
|
4626
4626
|
if (p.push(k), b += k.length, g) {
|
|
4627
|
-
const
|
|
4628
|
-
s(
|
|
4627
|
+
const _ = Math.round(b / g * 100);
|
|
4628
|
+
s(_), n(`Downloading model... ${_}%`);
|
|
4629
4629
|
}
|
|
4630
4630
|
}
|
|
4631
4631
|
return "caches" in window && await (await caches.open("mediapipe-models-v1")).put(
|
|
@@ -4732,8 +4732,8 @@ const Lr = "https://storage.googleapis.com/mediapipe-models/face_landmarker/face
|
|
|
4732
4732
|
const w = (d.x + u.x) * 0.5, f = (d.y + u.y) * 0.5, g = w - a.x, y = f - a.y, b = Math.sqrt(g * g + y * y), p = Math.abs(h.y - a.noseY) * 100, v = Math.abs(h.x - a.noseX) * 100, k = Math.max(
|
|
4733
4733
|
0,
|
|
4734
4734
|
100 - (b * 200 + p + v)
|
|
4735
|
-
),
|
|
4736
|
-
return A - n.current > 100 && (t(k), r(
|
|
4735
|
+
), _ = k < fh, A = performance.now();
|
|
4736
|
+
return A - n.current > 100 && (t(k), r(_), n.current = A), { engagement: k, isLookingAway: _ };
|
|
4737
4737
|
},
|
|
4738
4738
|
[]
|
|
4739
4739
|
);
|
|
@@ -4774,11 +4774,11 @@ const Lr = "https://storage.googleapis.com/mediapipe-models/face_landmarker/face
|
|
|
4774
4774
|
);
|
|
4775
4775
|
if (b === 0 || p === 0) return 0;
|
|
4776
4776
|
for (const k of d) {
|
|
4777
|
-
const
|
|
4778
|
-
if (
|
|
4779
|
-
const
|
|
4780
|
-
u += n(
|
|
4781
|
-
x:
|
|
4777
|
+
const _ = l[k], A = a[k];
|
|
4778
|
+
if (_ && A) {
|
|
4779
|
+
const E = w.x + (A.x - g.x) * b / p, G = w.y + (A.y - g.y) * b / p;
|
|
4780
|
+
u += n(_, {
|
|
4781
|
+
x: E,
|
|
4782
4782
|
y: G
|
|
4783
4783
|
}), h++;
|
|
4784
4784
|
}
|
|
@@ -5362,26 +5362,26 @@ const Sl = new Si(), _h = (e, t, i, r) => {
|
|
|
5362
5362
|
}
|
|
5363
5363
|
r();
|
|
5364
5364
|
try {
|
|
5365
|
-
const
|
|
5365
|
+
const _ = performance.now(), A = k.detectForVideo(
|
|
5366
5366
|
p,
|
|
5367
|
-
|
|
5368
|
-
),
|
|
5367
|
+
_
|
|
5368
|
+
), E = n(
|
|
5369
5369
|
A,
|
|
5370
5370
|
l,
|
|
5371
5371
|
d.current,
|
|
5372
5372
|
f
|
|
5373
5373
|
);
|
|
5374
|
-
|
|
5374
|
+
E ? (o(
|
|
5375
5375
|
v,
|
|
5376
5376
|
p,
|
|
5377
|
-
|
|
5377
|
+
E,
|
|
5378
5378
|
u,
|
|
5379
5379
|
h,
|
|
5380
5380
|
w,
|
|
5381
5381
|
l
|
|
5382
|
-
), l && w && a(
|
|
5383
|
-
} catch (
|
|
5384
|
-
console.error("Face detection error:",
|
|
5382
|
+
), l && w && a(E, d.current, w)) : s(v, p);
|
|
5383
|
+
} catch (_) {
|
|
5384
|
+
console.error("Face detection error:", _);
|
|
5385
5385
|
}
|
|
5386
5386
|
y.current = requestAnimationFrame(b);
|
|
5387
5387
|
}, [
|
|
@@ -5826,7 +5826,7 @@ const Fh = (e) => {
|
|
|
5826
5826
|
};
|
|
5827
5827
|
}, []);
|
|
5828
5828
|
const f = D(async (p) => {
|
|
5829
|
-
var k,
|
|
5829
|
+
var k, _;
|
|
5830
5830
|
const v = w.current;
|
|
5831
5831
|
if (!v || v.isDisposed())
|
|
5832
5832
|
throw new Q(
|
|
@@ -5837,28 +5837,28 @@ const Fh = (e) => {
|
|
|
5837
5837
|
try {
|
|
5838
5838
|
l(null), s(null), u(null), await v.startRecording(p, {
|
|
5839
5839
|
onStart: () => {
|
|
5840
|
-
var A,
|
|
5841
|
-
i(!0), (
|
|
5840
|
+
var A, E;
|
|
5841
|
+
i(!0), (E = (A = h.current).onStart) == null || E.call(A);
|
|
5842
5842
|
},
|
|
5843
5843
|
// ---- FIX: onStop is the SINGLE source of truth for stop events.
|
|
5844
5844
|
// stopRecording() no longer calls onStop separately, preventing double-fire.
|
|
5845
5845
|
onStop: () => {
|
|
5846
|
-
var A,
|
|
5847
|
-
i(!1), (
|
|
5846
|
+
var A, E;
|
|
5847
|
+
i(!1), (E = (A = h.current).onStop) == null || E.call(A);
|
|
5848
5848
|
},
|
|
5849
5849
|
onError: (A) => {
|
|
5850
5850
|
var G, C;
|
|
5851
|
-
const
|
|
5852
|
-
l(
|
|
5851
|
+
const E = A instanceof Q ? A : new Q(A.message, "RECORDING_ERROR", !0);
|
|
5852
|
+
l(E), i(!1), (C = (G = h.current).onError) == null || C.call(G, E);
|
|
5853
5853
|
}
|
|
5854
5854
|
});
|
|
5855
5855
|
} catch (A) {
|
|
5856
|
-
const
|
|
5856
|
+
const E = A instanceof Q ? A : new Q(
|
|
5857
5857
|
A instanceof Error ? A.message : String(A),
|
|
5858
5858
|
"START_FAILED",
|
|
5859
5859
|
!1
|
|
5860
5860
|
);
|
|
5861
|
-
throw l(
|
|
5861
|
+
throw l(E), i(!1), (_ = (k = h.current).onError) == null || _.call(k, E), E;
|
|
5862
5862
|
}
|
|
5863
5863
|
}, []), g = D(async () => {
|
|
5864
5864
|
var v, k;
|
|
@@ -5870,11 +5870,11 @@ const Fh = (e) => {
|
|
|
5870
5870
|
!1
|
|
5871
5871
|
);
|
|
5872
5872
|
try {
|
|
5873
|
-
const
|
|
5874
|
-
return u(
|
|
5875
|
-
} catch (
|
|
5876
|
-
const A =
|
|
5877
|
-
|
|
5873
|
+
const _ = await p.stopRecording();
|
|
5874
|
+
return u(_), _;
|
|
5875
|
+
} catch (_) {
|
|
5876
|
+
const A = _ instanceof Q ? _ : new Q(
|
|
5877
|
+
_ instanceof Error ? _.message : String(_),
|
|
5878
5878
|
"STOP_FAILED",
|
|
5879
5879
|
!1
|
|
5880
5880
|
);
|
|
@@ -5882,7 +5882,7 @@ const Fh = (e) => {
|
|
|
5882
5882
|
}
|
|
5883
5883
|
}, []), y = D(
|
|
5884
5884
|
async (p, v = {}) => {
|
|
5885
|
-
var
|
|
5885
|
+
var _, A, E, G, C, x;
|
|
5886
5886
|
const k = w.current;
|
|
5887
5887
|
if (!k || k.isDisposed())
|
|
5888
5888
|
throw new Q(
|
|
@@ -5893,14 +5893,14 @@ const Fh = (e) => {
|
|
|
5893
5893
|
try {
|
|
5894
5894
|
if (l(null), n(!0), !p || p.size === 0) {
|
|
5895
5895
|
console.warn("Skipping transcription — blob is empty");
|
|
5896
|
-
const
|
|
5897
|
-
return s(
|
|
5896
|
+
const $ = { transcript: "" };
|
|
5897
|
+
return s($.transcript), n(!1), (A = (_ = h.current).onTranscriptionComplete) == null || A.call(_, $), $;
|
|
5898
5898
|
}
|
|
5899
5899
|
const M = {
|
|
5900
5900
|
audioBlob: p,
|
|
5901
5901
|
...v
|
|
5902
5902
|
}, j = await k.transcribe(M);
|
|
5903
|
-
return s(j.transcript), n(!1), (G = (
|
|
5903
|
+
return s(j.transcript), n(!1), (G = (E = h.current).onTranscriptionComplete) == null || G.call(E, j), j;
|
|
5904
5904
|
} catch (M) {
|
|
5905
5905
|
const j = M instanceof Q ? M : new Q(
|
|
5906
5906
|
M instanceof Error ? M.message : String(M),
|
|
@@ -5977,7 +5977,7 @@ const Fh = (e) => {
|
|
|
5977
5977
|
};
|
|
5978
5978
|
}, []);
|
|
5979
5979
|
};
|
|
5980
|
-
var
|
|
5980
|
+
var z = /* @__PURE__ */ ((e) => (e.IDLE = "idle", e.FETCHING_QUESTION = "fetching_question", e.READING_QUESTION = "reading_question", e.THINKING = "thinking", e.ANSWERING = "answering", e.TRANSCRIBING = "transcribing", e.EDITING = "editing", e.SUBMITTING = "submitting", e.COMPLETED = "completed", e))(z || {});
|
|
5981
5981
|
const Il = {
|
|
5982
5982
|
thinkingDuration: 0,
|
|
5983
5983
|
answeringDuration: 120,
|
|
@@ -6395,13 +6395,13 @@ const to = new Oh(), Bh = (e = {}) => {
|
|
|
6395
6395
|
videoAllowed: u = !0
|
|
6396
6396
|
}, h) => {
|
|
6397
6397
|
var as;
|
|
6398
|
-
const { authToken: w } = Aa(), f = os(), g = w ? uu(w) : null, { borderRadius: y } = Fi(), b = y ?? 18, { proctoring: p, capture_screenshots: v } = gr(), k = !!(p != null && p.gazeAnalysisEnabled), [
|
|
6398
|
+
const { authToken: w } = Aa(), f = os(), g = w ? uu(w) : null, { borderRadius: y } = Fi(), b = y ?? 18, { proctoring: p, capture_screenshots: v } = gr(), k = !!(p != null && p.gazeAnalysisEnabled), [_, A] = N(!1), [E, G] = N(
|
|
6399
6399
|
(p == null ? void 0 : p.showLandmarks) ?? !1
|
|
6400
6400
|
), [C, x] = N(
|
|
6401
6401
|
r && ((p == null ? void 0 : p.showEngagementBar) ?? !0)
|
|
6402
6402
|
), [M, j] = N(
|
|
6403
6403
|
k
|
|
6404
|
-
), [
|
|
6404
|
+
), [$, X] = N(!1), O = P(null), U = P(null), ee = P(null), be = P(null), Me = D(
|
|
6405
6405
|
async (Ae) => {
|
|
6406
6406
|
var Cr;
|
|
6407
6407
|
const Ji = O.current, Ne = ee.current;
|
|
@@ -6511,7 +6511,7 @@ const to = new Oh(), Bh = (e = {}) => {
|
|
|
6511
6511
|
zi,
|
|
6512
6512
|
qi,
|
|
6513
6513
|
Ki,
|
|
6514
|
-
|
|
6514
|
+
E,
|
|
6515
6515
|
C,
|
|
6516
6516
|
k,
|
|
6517
6517
|
ct,
|
|
@@ -6593,7 +6593,7 @@ const to = new Oh(), Bh = (e = {}) => {
|
|
|
6593
6593
|
] }) : /* @__PURE__ */ c("div", { className: "iw-flex iw-w-full iw-h-full iw-justify-start iw-items-start", children: /* @__PURE__ */ m(
|
|
6594
6594
|
"div",
|
|
6595
6595
|
{
|
|
6596
|
-
className: `iw-relative iw-max-w-full iw-max-h-full iw-aspect-video iw-rounded-2xl iw-overflow-hidden iw-bg-black ${
|
|
6596
|
+
className: `iw-relative iw-max-w-full iw-max-h-full iw-aspect-video iw-rounded-2xl iw-overflow-hidden iw-bg-black ${$ ? "iw-animate-answer-start" : ""} ${o ? "iw-border-4 iw-border-[#6296FB]" : ""}`,
|
|
6597
6597
|
style: { width: "100%", height: "auto", minHeight: "0" },
|
|
6598
6598
|
children: [
|
|
6599
6599
|
/* @__PURE__ */ c(
|
|
@@ -6638,14 +6638,14 @@ const to = new Oh(), Bh = (e = {}) => {
|
|
|
6638
6638
|
_u,
|
|
6639
6639
|
{
|
|
6640
6640
|
showControls: (p == null ? void 0 : p.showControls) ?? !1,
|
|
6641
|
-
isBubbleOpen:
|
|
6641
|
+
isBubbleOpen: _,
|
|
6642
6642
|
setIsBubbleOpen: A,
|
|
6643
6643
|
setReference: Yi,
|
|
6644
6644
|
clearCache: oi,
|
|
6645
6645
|
isModelLoaded: De,
|
|
6646
6646
|
gazeAnalysisEnabled: M && k,
|
|
6647
6647
|
referenceSet: qi,
|
|
6648
|
-
showLandmarks:
|
|
6648
|
+
showLandmarks: E,
|
|
6649
6649
|
setShowLandmarks: G,
|
|
6650
6650
|
showEngagementBar: C,
|
|
6651
6651
|
setShowEngagementBar: x,
|
|
@@ -6772,12 +6772,12 @@ const to = new Oh(), Bh = (e = {}) => {
|
|
|
6772
6772
|
w.getByteFrequencyData(p);
|
|
6773
6773
|
const v = g.width, k = g.height;
|
|
6774
6774
|
y.clearRect(0, 0, v, k);
|
|
6775
|
-
let
|
|
6775
|
+
let _ = 0;
|
|
6776
6776
|
for (let O = 0; O < b; O++) {
|
|
6777
6777
|
const U = p[O] ?? 0;
|
|
6778
|
-
|
|
6778
|
+
_ += U * U;
|
|
6779
6779
|
}
|
|
6780
|
-
const A = Math.sqrt(
|
|
6780
|
+
const A = Math.sqrt(_ / b), E = Math.min(1, A / 128), G = new Float32Array(w.fftSize);
|
|
6781
6781
|
w.getFloatTimeDomainData(G);
|
|
6782
6782
|
let C = 0;
|
|
6783
6783
|
for (let O = 0; O < G.length; O++) {
|
|
@@ -6791,9 +6791,9 @@ const to = new Oh(), Bh = (e = {}) => {
|
|
|
6791
6791
|
O - s.current > 200 && (s.current = O, r(j, M));
|
|
6792
6792
|
}
|
|
6793
6793
|
y.clearRect(0, 0, v, k);
|
|
6794
|
-
const
|
|
6795
|
-
for (let O = 0; O <
|
|
6796
|
-
const U = O * (v /
|
|
6794
|
+
const $ = i, X = Math.floor(E * $);
|
|
6795
|
+
for (let O = 0; O < $; O++) {
|
|
6796
|
+
const U = O * (v / $), ee = v / $ - 1.8;
|
|
6797
6797
|
O < X ? y.fillStyle = "#0EB00E" : y.fillStyle = "#D9D9D9", y.fillRect(U, 0, ee, k);
|
|
6798
6798
|
}
|
|
6799
6799
|
o.current = requestAnimationFrame(f);
|
|
@@ -7040,11 +7040,11 @@ const to = new Oh(), Bh = (e = {}) => {
|
|
|
7040
7040
|
audioStream: y = null,
|
|
7041
7041
|
isDeviceLoading: b = !1
|
|
7042
7042
|
}) => {
|
|
7043
|
-
const { baseColor: p } = Fi(), [v, k] = N("problem"), [
|
|
7043
|
+
const { baseColor: p } = Fi(), [v, k] = N("problem"), [_, A] = N(!1);
|
|
7044
7044
|
Ht.useEffect(() => {
|
|
7045
7045
|
k("problem"), A(!1);
|
|
7046
7046
|
}, [h]);
|
|
7047
|
-
const
|
|
7047
|
+
const E = l || !n || a && (!e || !t || !_) || b;
|
|
7048
7048
|
return /* @__PURE__ */ m("div", { className: "iw-flex iw-flex-col iw-gap-1 iw-w-full", children: [
|
|
7049
7049
|
/* @__PURE__ */ m("div", { className: "iw-flex iw-justify-center iw-items-center iw-gap-2 iw-flex-wrap iw-max-w-[700px] iw-mx-auto", children: [
|
|
7050
7050
|
a && /* @__PURE__ */ m("div", { className: "iw-flex sm:iw-flex-row iw-flex-col iw-gap-4 iw-w-full", children: [
|
|
@@ -7058,7 +7058,7 @@ const to = new Oh(), Bh = (e = {}) => {
|
|
|
7058
7058
|
label: "Choose mic",
|
|
7059
7059
|
showVisualizer: !0,
|
|
7060
7060
|
showMicHint: !0,
|
|
7061
|
-
micTested:
|
|
7061
|
+
micTested: _,
|
|
7062
7062
|
audioStatus: v,
|
|
7063
7063
|
stream: y,
|
|
7064
7064
|
hasPermission: e,
|
|
@@ -7066,7 +7066,7 @@ const to = new Oh(), Bh = (e = {}) => {
|
|
|
7066
7066
|
const x = { good: 3, acceptable: 2, poor: 1, problem: 0 };
|
|
7067
7067
|
k(
|
|
7068
7068
|
(M) => x[C] > x[M] ? C : M
|
|
7069
|
-
), !
|
|
7069
|
+
), !_ && (C === "good" || C === "acceptable") && A(!0);
|
|
7070
7070
|
}
|
|
7071
7071
|
}
|
|
7072
7072
|
),
|
|
@@ -7108,8 +7108,8 @@ const to = new Oh(), Bh = (e = {}) => {
|
|
|
7108
7108
|
zr,
|
|
7109
7109
|
{
|
|
7110
7110
|
onClick: r,
|
|
7111
|
-
disabled:
|
|
7112
|
-
className: `iw-h-12 iw-w-full iw-shadow-lg !iw-bg-[#F1F5FE] !iw-text-[#062260] !iw-font-bold !iw-border-[#E7EAF1] iw-rounded-lg ${
|
|
7111
|
+
disabled: E,
|
|
7112
|
+
className: `iw-h-12 iw-w-full iw-shadow-lg !iw-bg-[#F1F5FE] !iw-text-[#062260] !iw-font-bold !iw-border-[#E7EAF1] iw-rounded-lg ${E ? "iw-opacity-50" : "hover:iw-opacity-75"}`,
|
|
7113
7113
|
children: b ? "Device Loading..." : i
|
|
7114
7114
|
}
|
|
7115
7115
|
),
|
|
@@ -7181,13 +7181,13 @@ const to = new Oh(), Bh = (e = {}) => {
|
|
|
7181
7181
|
handleAudioChange: y,
|
|
7182
7182
|
handleVideoChange: b,
|
|
7183
7183
|
stopStream: p
|
|
7184
|
-
} = hu(e), [v, k] = N(!1), [
|
|
7184
|
+
} = hu(e), [v, k] = N(!1), [_, A] = N(0), [E, G] = N(!1), C = P(null), x = P(null), M = (U) => {
|
|
7185
7185
|
C.current = U, r && (typeof r == "function" ? r(U) : r.current = U);
|
|
7186
7186
|
};
|
|
7187
7187
|
if (B(() => () => {
|
|
7188
7188
|
x.current && (clearInterval(x.current), x.current = null);
|
|
7189
7189
|
}, []), !e) return null;
|
|
7190
|
-
const [j,
|
|
7190
|
+
const [j, $] = N(Se.MODEL_LOADING), X = async () => {
|
|
7191
7191
|
var ee;
|
|
7192
7192
|
k(!0), (ee = C.current) == null || ee.resetReference();
|
|
7193
7193
|
const U = () => {
|
|
@@ -7204,9 +7204,9 @@ const to = new Oh(), Bh = (e = {}) => {
|
|
|
7204
7204
|
/* @__PURE__ */ c(zh, { steps: [
|
|
7205
7205
|
{ label: i ? "Calibrate your camera" : "Camera & Mic permission" },
|
|
7206
7206
|
{ label: "Basic guidelines" }
|
|
7207
|
-
], currentStepIndex:
|
|
7207
|
+
], currentStepIndex: _ })
|
|
7208
7208
|
] }),
|
|
7209
|
-
/* @__PURE__ */ c("div", { className: "iw-px-12 iw-pb-3 iw-flex iw-flex-col iw-items-center", children:
|
|
7209
|
+
/* @__PURE__ */ c("div", { className: "iw-px-12 iw-pb-3 iw-flex iw-flex-col iw-items-center", children: _ === 0 ? /* @__PURE__ */ m("div", { className: "iw-w-full iw-flex iw-flex-col iw-items-center iw-gap-4", children: [
|
|
7210
7210
|
/* @__PURE__ */ c("div", { className: "iw-w-full iw-max-w-[600px] iw-aspect-video iw-bg-slate-100 iw-rounded-2xl iw-overflow-hidden iw-relative iw-border iw-border-slate-200", children: i ? /* @__PURE__ */ c(
|
|
7211
7211
|
Fl,
|
|
7212
7212
|
{
|
|
@@ -7217,7 +7217,7 @@ const to = new Oh(), Bh = (e = {}) => {
|
|
|
7217
7217
|
showStatusOverlay: !f && a,
|
|
7218
7218
|
isDeviceLoading: f,
|
|
7219
7219
|
videoAllowed: a,
|
|
7220
|
-
onProctoringStatusChange:
|
|
7220
|
+
onProctoringStatusChange: $,
|
|
7221
7221
|
onSetReference: () => {
|
|
7222
7222
|
x.current && (clearInterval(x.current), x.current = null), k(!1), A(1);
|
|
7223
7223
|
}
|
|
@@ -7242,8 +7242,8 @@ const to = new Oh(), Bh = (e = {}) => {
|
|
|
7242
7242
|
onButtonClick: () => {
|
|
7243
7243
|
i ? X() : A(1);
|
|
7244
7244
|
},
|
|
7245
|
-
disabled: !
|
|
7246
|
-
isAgreed:
|
|
7245
|
+
disabled: !E || i && j !== "face_detected" || !i && (!s || !a),
|
|
7246
|
+
isAgreed: E,
|
|
7247
7247
|
onAgreedToggle: G,
|
|
7248
7248
|
audioDevices: d,
|
|
7249
7249
|
videoDevices: u,
|
|
@@ -7267,7 +7267,7 @@ const to = new Oh(), Bh = (e = {}) => {
|
|
|
7267
7267
|
onButtonClick: () => {
|
|
7268
7268
|
t(), p();
|
|
7269
7269
|
},
|
|
7270
|
-
isAgreed:
|
|
7270
|
+
isAgreed: E,
|
|
7271
7271
|
onAgreedToggle: G,
|
|
7272
7272
|
showMediaIcons: !1
|
|
7273
7273
|
}
|
|
@@ -7301,7 +7301,7 @@ const to = new Oh(), Bh = (e = {}) => {
|
|
|
7301
7301
|
/* @__PURE__ */ c(
|
|
7302
7302
|
"div",
|
|
7303
7303
|
{
|
|
7304
|
-
className: `iw-flex iw-flex-col iw-items-center iw-justify-center iw-relative iw-h-16 iw-w-16 iw-shrink-0 iw-shadow iw-rounded-full iw-border-[#E8EEFE] iw-border-4 ${i ===
|
|
7304
|
+
className: `iw-flex iw-flex-col iw-items-center iw-justify-center iw-relative iw-h-16 iw-w-16 iw-shrink-0 iw-shadow iw-rounded-full iw-border-[#E8EEFE] iw-border-4 ${i === z.READING_QUESTION ? "iw-animate-speaking" : ""}`,
|
|
7305
7305
|
children: /* @__PURE__ */ c(
|
|
7306
7306
|
"div",
|
|
7307
7307
|
{
|
|
@@ -7327,7 +7327,7 @@ const to = new Oh(), Bh = (e = {}) => {
|
|
|
7327
7327
|
}
|
|
7328
7328
|
), Kh = ({ phase: e, question: t, isLoading: i, brandName: r }) => {
|
|
7329
7329
|
const n = r || "We", o = r ? "is" : "are";
|
|
7330
|
-
if (i || e ===
|
|
7330
|
+
if (i || e === z.FETCHING_QUESTION || e === z.IDLE)
|
|
7331
7331
|
return /* @__PURE__ */ m("div", { className: "iw-animate-pulse iw-w-full iw-space-y-3 iw-mr-10", children: [
|
|
7332
7332
|
/* @__PURE__ */ c("div", { className: "iw-h-5 iw-bg-gray-200 iw-rounded iw-w-full" }),
|
|
7333
7333
|
/* @__PURE__ */ c("div", { className: "iw-h-5 iw-bg-gray-200 iw-rounded iw-w-3/4" })
|
|
@@ -7338,12 +7338,12 @@ const to = new Oh(), Bh = (e = {}) => {
|
|
|
7338
7338
|
/* @__PURE__ */ c("span", { children: "." })
|
|
7339
7339
|
] });
|
|
7340
7340
|
switch (e) {
|
|
7341
|
-
case
|
|
7341
|
+
case z.ANSWERING:
|
|
7342
7342
|
return /* @__PURE__ */ c("div", { className: "iw-flex iw-items-center iw-justify-between iw-w-full", children: /* @__PURE__ */ m("p", { className: "iw-text-lg iw-leading-7 iw-font-medium iw-text-gray-600", children: [
|
|
7343
7343
|
"Listening",
|
|
7344
7344
|
/* @__PURE__ */ c(s, {})
|
|
7345
7345
|
] }) });
|
|
7346
|
-
case
|
|
7346
|
+
case z.TRANSCRIBING:
|
|
7347
7347
|
return /* @__PURE__ */ m("p", { className: "iw-text-lg iw-leading-7 iw-font-medium iw-text-gray-600", children: [
|
|
7348
7348
|
n,
|
|
7349
7349
|
" ",
|
|
@@ -7351,7 +7351,7 @@ const to = new Oh(), Bh = (e = {}) => {
|
|
|
7351
7351
|
" analyzing your answer",
|
|
7352
7352
|
/* @__PURE__ */ c(s, {})
|
|
7353
7353
|
] });
|
|
7354
|
-
case (
|
|
7354
|
+
case (z.EDITING || z.SUBMITTING):
|
|
7355
7355
|
return /* @__PURE__ */ m("p", { className: "iw-text-lg iw-leading-7 iw-font-medium iw-text-gray-600", children: [
|
|
7356
7356
|
n,
|
|
7357
7357
|
" ",
|
|
@@ -7486,7 +7486,7 @@ const to = new Oh(), Bh = (e = {}) => {
|
|
|
7486
7486
|
onChange: t,
|
|
7487
7487
|
placeholder: "Type your answer here...",
|
|
7488
7488
|
className: "iw-w-full iw-h-64 iw-resize-none iw-bg-transparent iw-border-none iw-text-[#062260] iw-text-base iw-leading-relaxed focus-visible:iw-outline-0 iw-p-0",
|
|
7489
|
-
disabled: i.phase ===
|
|
7489
|
+
disabled: i.phase === z.SUBMITTING
|
|
7490
7490
|
}
|
|
7491
7491
|
) }),
|
|
7492
7492
|
/* @__PURE__ */ m("div", { className: "iw-bg-[#F1F5FE] iw-px-2 iw-py-2 iw-flex iw-items-center iw-justify-between iw-border-t iw-border-[#E8EEFE]", children: [
|
|
@@ -7580,19 +7580,19 @@ const to = new Oh(), Bh = (e = {}) => {
|
|
|
7580
7580
|
const M = f[x] || 0, j = w[x] || 0;
|
|
7581
7581
|
f[x] = M * g + j * (1 - g);
|
|
7582
7582
|
}
|
|
7583
|
-
const v = 3, k = 2,
|
|
7583
|
+
const v = 3, k = 2, _ = Math.floor(b / (v + k)), A = _ > 0 ? _ % 2 === 0 ? _ - 1 : _ : 0;
|
|
7584
7584
|
if (A <= 0) {
|
|
7585
7585
|
a = requestAnimationFrame(y);
|
|
7586
7586
|
return;
|
|
7587
7587
|
}
|
|
7588
|
-
const
|
|
7588
|
+
const E = (b - A * (v + k)) / 2, G = Math.floor(A / 2);
|
|
7589
7589
|
r.fillStyle = "#27ba71";
|
|
7590
7590
|
const C = 38;
|
|
7591
7591
|
for (let x = 0; x < A; x++) {
|
|
7592
|
-
const M = Math.abs(x - G), j = G > 0 ? M / G : 0,
|
|
7593
|
-
let X = f[Math.min(
|
|
7592
|
+
const M = Math.abs(x - G), j = G > 0 ? M / G : 0, $ = 2 + Math.floor(Math.pow(j, 1.5) * C);
|
|
7593
|
+
let X = f[Math.min($, h - 1)] || 0;
|
|
7594
7594
|
X = X / 255, X = Math.pow(X, 2.2);
|
|
7595
|
-
const O = 1 - j * 0.8, U = 1.5, ee = X > 0.05 ? Math.sin(Date.now() / 300 + x) * 0.5 * O : 0, be = X * (p - 8) * O, Me = Math.max(U, be + ee), at =
|
|
7595
|
+
const O = 1 - j * 0.8, U = 1.5, ee = X > 0.05 ? Math.sin(Date.now() / 300 + x) * 0.5 * O : 0, be = X * (p - 8) * O, Me = Math.max(U, be + ee), at = E + x * (v + k), De = (p - Me) / 2;
|
|
7596
7596
|
r.beginPath(), r.roundRect(at, De, v, Me, v / 2), r.fill();
|
|
7597
7597
|
}
|
|
7598
7598
|
a = requestAnimationFrame(y);
|
|
@@ -7631,12 +7631,12 @@ const to = new Oh(), Bh = (e = {}) => {
|
|
|
7631
7631
|
}, i2 = ({ phase: e, questionNumber: t, timerState: i }) => {
|
|
7632
7632
|
const { timers: r } = gr();
|
|
7633
7633
|
switch (e) {
|
|
7634
|
-
case
|
|
7634
|
+
case z.FETCHING_QUESTION:
|
|
7635
7635
|
return /* @__PURE__ */ m(ya, { children: [
|
|
7636
7636
|
/* @__PURE__ */ c(Jh, { questionNumber: t + 1 }),
|
|
7637
7637
|
/* @__PURE__ */ c(Zh, {})
|
|
7638
7638
|
] });
|
|
7639
|
-
case
|
|
7639
|
+
case z.ANSWERING:
|
|
7640
7640
|
return /* @__PURE__ */ m("div", { className: "iw-flex iw-flex-col iw-items-end iw-w-full", children: [
|
|
7641
7641
|
/* @__PURE__ */ c(t2, {}),
|
|
7642
7642
|
/* @__PURE__ */ c("div", { className: "iw-mt-2 iw-w-full", children: /* @__PURE__ */ c(
|
|
@@ -7647,7 +7647,7 @@ const to = new Oh(), Bh = (e = {}) => {
|
|
|
7647
7647
|
}
|
|
7648
7648
|
) })
|
|
7649
7649
|
] });
|
|
7650
|
-
case
|
|
7650
|
+
case z.TRANSCRIBING:
|
|
7651
7651
|
return /* @__PURE__ */ c(ya, { children: /* @__PURE__ */ m("div", { className: "iw-flex iw-items-center iw-px-1 iw-py-1.5 iw-rounded-lg iw-mb-2 iw-text-sm iw-bg-[#F2E8FE]", children: [
|
|
7652
7652
|
/* @__PURE__ */ c("div", { className: "iw-h-8 iw-w-12 iw-transcribing-icon" }),
|
|
7653
7653
|
/* @__PURE__ */ c("span", { className: "iw-text-sm iw-text-[#062260]", children: "Analyzing answer…" })
|
|
@@ -8178,33 +8178,41 @@ const c2 = (e) => /* @__PURE__ */ m(
|
|
|
8178
8178
|
}),
|
|
8179
8179
|
[]
|
|
8180
8180
|
), Lh(y), Fh(y), Mh(), Vh();
|
|
8181
|
-
const { proctoring:
|
|
8181
|
+
const { proctoring: _ } = gr(), A = (_ == null ? void 0 : _.prevent_unintended_exit) ?? !1, E = D(() => {
|
|
8182
8182
|
var x, M;
|
|
8183
8183
|
to.stop(), Sl.dispose(), (M = (x = Si.activeStream) == null ? void 0 : x.getTracks()) == null || M.forEach((j) => j.stop());
|
|
8184
8184
|
}, []);
|
|
8185
8185
|
B(() => {
|
|
8186
8186
|
const x = () => {
|
|
8187
|
-
A && (d || h || r || (console.log("User attempted to use browser back navigation"), l(!0), window.history.pushState(null, "", window.location.href)));
|
|
8188
|
-
}, M = (j) => {
|
|
8189
8187
|
if (!(d || h || r)) {
|
|
8190
|
-
if (
|
|
8191
|
-
|
|
8192
|
-
|
|
8188
|
+
if (A)
|
|
8189
|
+
l(!0);
|
|
8190
|
+
else if (window.confirm("Leave site? Changes you made may not be saved.")) {
|
|
8191
|
+
E();
|
|
8192
|
+
return;
|
|
8193
|
+
}
|
|
8194
|
+
window.history.pushState(null, "", window.location.href);
|
|
8193
8195
|
}
|
|
8196
|
+
}, M = ($) => {
|
|
8197
|
+
if (!(d || h || r))
|
|
8198
|
+
return console.log("User attempted to reload or close the tab"), A && l(!0), $.preventDefault(), $.returnValue = "", "";
|
|
8199
|
+
}, j = () => {
|
|
8200
|
+
h || E();
|
|
8194
8201
|
};
|
|
8195
|
-
return
|
|
8196
|
-
window.removeEventListener("popstate", x), window.removeEventListener("beforeunload", M);
|
|
8202
|
+
return window.history.pushState(null, "", window.location.href), window.addEventListener("popstate", x), window.addEventListener("beforeunload", M), window.addEventListener("unload", j), () => {
|
|
8203
|
+
window.removeEventListener("popstate", x), window.removeEventListener("beforeunload", M), window.removeEventListener("unload", j);
|
|
8197
8204
|
};
|
|
8198
8205
|
}, [
|
|
8199
8206
|
d,
|
|
8200
8207
|
h,
|
|
8201
8208
|
r,
|
|
8202
|
-
A
|
|
8209
|
+
A,
|
|
8210
|
+
E
|
|
8203
8211
|
]);
|
|
8204
8212
|
const G = () => {
|
|
8205
|
-
|
|
8213
|
+
E(), u(!0), k(), s(!1), l(!1), t == null || t();
|
|
8206
8214
|
}, C = () => {
|
|
8207
|
-
|
|
8215
|
+
E(), l(!1), i == null || i();
|
|
8208
8216
|
};
|
|
8209
8217
|
return /* @__PURE__ */ m(
|
|
8210
8218
|
Dl.Provider,
|
|
@@ -8314,7 +8322,7 @@ const c2 = (e) => /* @__PURE__ */ m(
|
|
|
8314
8322
|
qh,
|
|
8315
8323
|
{
|
|
8316
8324
|
question: i,
|
|
8317
|
-
isLoading: n ===
|
|
8325
|
+
isLoading: n === z.FETCHING_QUESTION || n === z.IDLE,
|
|
8318
8326
|
phase: n,
|
|
8319
8327
|
brandName: e,
|
|
8320
8328
|
brandLogo: t
|
|
@@ -8327,7 +8335,7 @@ const c2 = (e) => /* @__PURE__ */ m(
|
|
|
8327
8335
|
ref: l,
|
|
8328
8336
|
interviewId: s,
|
|
8329
8337
|
interview_duration: a,
|
|
8330
|
-
isAnswering: n ===
|
|
8338
|
+
isAnswering: n === z.ANSWERING,
|
|
8331
8339
|
cheatingWarningVisible: y
|
|
8332
8340
|
}
|
|
8333
8341
|
),
|
|
@@ -8349,20 +8357,20 @@ const c2 = (e) => /* @__PURE__ */ m(
|
|
|
8349
8357
|
interviewId: s,
|
|
8350
8358
|
currentQuestion: i,
|
|
8351
8359
|
lastSubmittedAnswer: d,
|
|
8352
|
-
isEditing: n ===
|
|
8360
|
+
isEditing: n === z.EDITING,
|
|
8353
8361
|
answerText: h,
|
|
8354
8362
|
onAnswerChange: w,
|
|
8355
8363
|
timerState: r,
|
|
8356
8364
|
editingTime: f
|
|
8357
8365
|
}
|
|
8358
8366
|
) }),
|
|
8359
|
-
u && (n ===
|
|
8367
|
+
u && (n === z.ANSWERING || n === z.EDITING) && /* @__PURE__ */ c(
|
|
8360
8368
|
h2,
|
|
8361
8369
|
{
|
|
8362
8370
|
onClick: u,
|
|
8363
8371
|
disabled: g,
|
|
8364
8372
|
isFirstQuestion: (r == null ? void 0 : r.currentQuestionNumber) === 1,
|
|
8365
|
-
text: n ===
|
|
8373
|
+
text: n === z.ANSWERING ? "Submit Response" : "Submit Final Response"
|
|
8366
8374
|
}
|
|
8367
8375
|
)
|
|
8368
8376
|
]
|
|
@@ -8439,29 +8447,29 @@ const c2 = (e) => /* @__PURE__ */ m(
|
|
|
8439
8447
|
const { baseColor: d } = Fi(), u = P(null), h = P(null), w = P(null), f = P(null), g = P(null), y = P(null), b = P(!1), [p, v] = N(null);
|
|
8440
8448
|
B(() => {
|
|
8441
8449
|
if (t || !h.current) return;
|
|
8442
|
-
const
|
|
8450
|
+
const _ = h.current, A = () => {
|
|
8443
8451
|
const G = u.current;
|
|
8444
8452
|
if (!G) return;
|
|
8445
|
-
const C =
|
|
8453
|
+
const C = _.clientWidth, x = i;
|
|
8446
8454
|
G.width = Math.max(1, Math.floor(C * window.devicePixelRatio || 1)), G.height = Math.max(1, Math.floor(x * window.devicePixelRatio || 1));
|
|
8447
|
-
},
|
|
8448
|
-
return
|
|
8455
|
+
}, E = new ResizeObserver(A);
|
|
8456
|
+
return E.observe(_), A(), () => E.disconnect();
|
|
8449
8457
|
}, [t, i]), B(() => {
|
|
8450
8458
|
if (!t) return;
|
|
8451
|
-
const
|
|
8452
|
-
|
|
8459
|
+
const _ = u.current;
|
|
8460
|
+
_ && (_.width = Math.max(
|
|
8453
8461
|
1,
|
|
8454
8462
|
Math.floor(t * (window.devicePixelRatio || 1))
|
|
8455
|
-
),
|
|
8463
|
+
), _.height = Math.max(
|
|
8456
8464
|
1,
|
|
8457
8465
|
Math.floor(i * (window.devicePixelRatio || 1))
|
|
8458
8466
|
));
|
|
8459
8467
|
}, [t, i]), B(() => {
|
|
8460
|
-
let
|
|
8468
|
+
let _ = !1;
|
|
8461
8469
|
return (async () => {
|
|
8462
8470
|
try {
|
|
8463
|
-
const
|
|
8464
|
-
w.current =
|
|
8471
|
+
const E = new (window.AudioContext || window.webkitAudioContext)();
|
|
8472
|
+
w.current = E;
|
|
8465
8473
|
let G = a;
|
|
8466
8474
|
if (!G) {
|
|
8467
8475
|
if (!l) return;
|
|
@@ -8470,19 +8478,19 @@ const c2 = (e) => /* @__PURE__ */ m(
|
|
|
8470
8478
|
video: !1
|
|
8471
8479
|
}), b.current = !0;
|
|
8472
8480
|
}
|
|
8473
|
-
if (
|
|
8474
|
-
const C =
|
|
8481
|
+
if (_) return;
|
|
8482
|
+
const C = E.createAnalyser();
|
|
8475
8483
|
C.fftSize = o, C.smoothingTimeConstant = s, f.current = C;
|
|
8476
|
-
const x =
|
|
8484
|
+
const x = E.createMediaStreamSource(G);
|
|
8477
8485
|
g.current = x, x.connect(C), k();
|
|
8478
|
-
} catch (
|
|
8479
|
-
v((
|
|
8486
|
+
} catch (E) {
|
|
8487
|
+
v((E == null ? void 0 : E.message) || "Failed to initialize microphone");
|
|
8480
8488
|
}
|
|
8481
8489
|
})(), () => {
|
|
8482
|
-
var
|
|
8483
|
-
|
|
8490
|
+
var E, G, C, x;
|
|
8491
|
+
_ = !0, y.current && cancelAnimationFrame(y.current);
|
|
8484
8492
|
try {
|
|
8485
|
-
(
|
|
8493
|
+
(E = g.current) == null || E.disconnect();
|
|
8486
8494
|
} catch {
|
|
8487
8495
|
}
|
|
8488
8496
|
try {
|
|
@@ -8493,21 +8501,21 @@ const c2 = (e) => /* @__PURE__ */ m(
|
|
|
8493
8501
|
};
|
|
8494
8502
|
}, [a, o, s, l]);
|
|
8495
8503
|
const k = () => {
|
|
8496
|
-
const
|
|
8497
|
-
if (!
|
|
8498
|
-
const
|
|
8499
|
-
if (!
|
|
8500
|
-
const G = window.devicePixelRatio || 1, C =
|
|
8501
|
-
y.current = requestAnimationFrame(
|
|
8504
|
+
const _ = u.current, A = f.current;
|
|
8505
|
+
if (!_ || !A) return;
|
|
8506
|
+
const E = _.getContext("2d");
|
|
8507
|
+
if (!E) return;
|
|
8508
|
+
const G = window.devicePixelRatio || 1, C = _.width, x = _.height, M = A.frequencyBinCount, j = new Uint8Array(M), $ = () => {
|
|
8509
|
+
y.current = requestAnimationFrame($), A.getByteTimeDomainData(j), E.clearRect(0, 0, C, x), E.fillStyle = "rgba(0,0,0,0)", E.fillRect(0, 0, C, x);
|
|
8502
8510
|
const X = Math.max(1, Math.floor(r * G)), O = Math.max(1, Math.floor(n * G)), U = X + O, ee = Math.max(8, Math.floor((C + O) / U)), be = Math.floor(j.length / ee);
|
|
8503
8511
|
for (let Me = 0; Me < ee; Me++) {
|
|
8504
8512
|
const at = Math.min(j.length - 1, Me * be), De = j[at] / 128 - 1, Pe = Math.abs(De), ct = Math.pow(Pe, 0.6), At = Math.max(x * 0.06, ct * (x * 0.9)), ni = Me * U, oi = (x - At) / 2, si = 140 - Math.min(140, 140 * Pe), ai = 85, ci = 48 + Math.floor(12 * (1 - Pe));
|
|
8505
|
-
|
|
8513
|
+
E.fillStyle = `${d}`, E.shadowColor = `hsla(${si}, ${ai}%, ${ci}%, ${0.25 * Pe})`, E.shadowBlur = 8 * Pe;
|
|
8506
8514
|
const Ut = Math.min(X / 2, At / 2);
|
|
8507
|
-
g2(
|
|
8515
|
+
g2(E, ni, oi, X, At, Ut), E.fill();
|
|
8508
8516
|
}
|
|
8509
8517
|
};
|
|
8510
|
-
|
|
8518
|
+
$();
|
|
8511
8519
|
};
|
|
8512
8520
|
return /* @__PURE__ */ m(
|
|
8513
8521
|
"div",
|
|
@@ -8850,7 +8858,7 @@ const x2 = ({ state: e, thinkingTime: t, nextPhase: i }) => /* @__PURE__ */ m("d
|
|
|
8850
8858
|
videoFeedRef: a
|
|
8851
8859
|
}) => {
|
|
8852
8860
|
var Qi, Tr;
|
|
8853
|
-
const l = os(), { baseUrl: d, authToken: u } = Aa(), { timers: h, stt: w, proctoring: f } = gr(), g = P(null), [y, b] = N(null), [p, v] = N(""), [k,
|
|
8861
|
+
const l = os(), { baseUrl: d, authToken: u } = Aa(), { timers: h, stt: w, proctoring: f } = gr(), g = P(null), [y, b] = N(null), [p, v] = N(""), [k, _] = N(null), [A, E] = N(
|
|
8854
8862
|
Hr
|
|
8855
8863
|
), [G, C] = N(!0), x = P(""), M = P(null), j = {
|
|
8856
8864
|
thinkingTime: (h == null ? void 0 : h.thinkingDuration) || 0,
|
|
@@ -8861,7 +8869,7 @@ const x2 = ({ state: e, thinkingTime: t, nextPhase: i }) => /* @__PURE__ */ m("d
|
|
|
8861
8869
|
// 120,
|
|
8862
8870
|
answeringTime: (h == null ? void 0 : h.answeringDuration) || 120,
|
|
8863
8871
|
editingTime: G ? (h == null ? void 0 : h.editingDuration) || 30 : 0
|
|
8864
|
-
}, { thinkingTime:
|
|
8872
|
+
}, { thinkingTime: $, answeringTime: X, editingTime: O } = j;
|
|
8865
8873
|
B(() => {
|
|
8866
8874
|
x.current = p;
|
|
8867
8875
|
}, [p]);
|
|
@@ -8915,19 +8923,19 @@ const x2 = ({ state: e, thinkingTime: t, nextPhase: i }) => /* @__PURE__ */ m("d
|
|
|
8915
8923
|
callbacks: {
|
|
8916
8924
|
onPhaseChange: (V) => {
|
|
8917
8925
|
switch (V) {
|
|
8918
|
-
case
|
|
8926
|
+
case z.FETCHING_QUESTION:
|
|
8919
8927
|
Vt();
|
|
8920
8928
|
break;
|
|
8921
|
-
case
|
|
8929
|
+
case z.READING_QUESTION:
|
|
8922
8930
|
xn();
|
|
8923
8931
|
break;
|
|
8924
|
-
case
|
|
8932
|
+
case z.ANSWERING:
|
|
8925
8933
|
Ar();
|
|
8926
8934
|
break;
|
|
8927
|
-
case
|
|
8935
|
+
case z.TRANSCRIBING:
|
|
8928
8936
|
Hi();
|
|
8929
8937
|
break;
|
|
8930
|
-
case
|
|
8938
|
+
case z.SUBMITTING:
|
|
8931
8939
|
Wi();
|
|
8932
8940
|
break;
|
|
8933
8941
|
}
|
|
@@ -8943,7 +8951,7 @@ const x2 = ({ state: e, thinkingTime: t, nextPhase: i }) => /* @__PURE__ */ m("d
|
|
|
8943
8951
|
(async () => {
|
|
8944
8952
|
try {
|
|
8945
8953
|
const W = await l.getInterviewConfig(r);
|
|
8946
|
-
if (W != null && W.data && (W.data.duration_in_minutes &&
|
|
8954
|
+
if (W != null && W.data && (W.data.duration_in_minutes && E(W.data.duration_in_minutes), typeof W.data.allow_answer_editing == "boolean" && C(W.data.allow_answer_editing), typeof W.data.elapsed_time_in_minutes == "number")) {
|
|
8947
8955
|
const Ye = Math.floor(
|
|
8948
8956
|
W.data.elapsed_time_in_minutes * 60
|
|
8949
8957
|
);
|
|
@@ -8980,7 +8988,7 @@ const x2 = ({ state: e, thinkingTime: t, nextPhase: i }) => /* @__PURE__ */ m("d
|
|
|
8980
8988
|
interviewId: r,
|
|
8981
8989
|
qnaId: Ye,
|
|
8982
8990
|
answer: W
|
|
8983
|
-
}),
|
|
8991
|
+
}), _({
|
|
8984
8992
|
qnaId: Ye,
|
|
8985
8993
|
answer: W
|
|
8986
8994
|
});
|
|
@@ -9058,13 +9066,13 @@ const x2 = ({ state: e, thinkingTime: t, nextPhase: i }) => /* @__PURE__ */ m("d
|
|
|
9058
9066
|
), Yi = () => {
|
|
9059
9067
|
const { phase: V } = Fe;
|
|
9060
9068
|
switch (V) {
|
|
9061
|
-
case
|
|
9069
|
+
case z.IDLE:
|
|
9062
9070
|
return /* @__PURE__ */ m("div", { className: "iw-text-center iw-flex iw-flex-col iw-items-center iw-justify-center iw-gap-2 iw-h-full", children: [
|
|
9063
9071
|
/* @__PURE__ */ c("h3", { className: "iw-text-lg iw-font-semibold iw-text-gray-900 iw-mb-1", children: "Ready to start the Interview?" }),
|
|
9064
9072
|
/* @__PURE__ */ c("p", { className: "iw-max-w-xl iw-text-gray-500 iw-text-xs iw-leading-[21px]", children: `You will be asked a series of behavioral and technical questions. For each one you'll get a short thinking period, then a timed recording window. We'll transcribe your response so you can review and edit it before submitting. Click "Start Interview" when you're ready.` }),
|
|
9065
9073
|
/* @__PURE__ */ c(Wr, { onClick: Tt, className: "iw-mt-2 iw-w-40", children: "Start Interview" })
|
|
9066
9074
|
] });
|
|
9067
|
-
case
|
|
9075
|
+
case z.FETCHING_QUESTION:
|
|
9068
9076
|
return ui ? /* @__PURE__ */ m("div", { className: "iw-text-center iw-flex iw-flex-col iw-items-center iw-justify-center iw-gap-2 iw-h-full", children: [
|
|
9069
9077
|
/* @__PURE__ */ c("h3", { className: "iw-text-lg iw-font-semibold iw-text-red-600 iw-mb-1", children: "Failed to load the next question" }),
|
|
9070
9078
|
/* @__PURE__ */ c("p", { className: "iw-max-w-md iw-text-gray-500 iw-text-sm iw-leading-[21px]", children: ui.message || "Please check your network connection and try again." }),
|
|
@@ -9077,18 +9085,18 @@ const x2 = ({ state: e, thinkingTime: t, nextPhase: i }) => /* @__PURE__ */ m("d
|
|
|
9077
9085
|
}
|
|
9078
9086
|
)
|
|
9079
9087
|
] }) : /* @__PURE__ */ c(y2, {});
|
|
9080
|
-
case
|
|
9088
|
+
case z.READING_QUESTION:
|
|
9081
9089
|
return /* @__PURE__ */ c(v2, { ttsError: De });
|
|
9082
|
-
case
|
|
9090
|
+
case z.THINKING:
|
|
9083
9091
|
return /* @__PURE__ */ c(
|
|
9084
9092
|
x2,
|
|
9085
9093
|
{
|
|
9086
9094
|
state: Fe,
|
|
9087
|
-
thinkingTime:
|
|
9095
|
+
thinkingTime: $,
|
|
9088
9096
|
nextPhase: ae
|
|
9089
9097
|
}
|
|
9090
9098
|
);
|
|
9091
|
-
case
|
|
9099
|
+
case z.ANSWERING:
|
|
9092
9100
|
return /* @__PURE__ */ c(
|
|
9093
9101
|
p2,
|
|
9094
9102
|
{
|
|
@@ -9099,7 +9107,7 @@ const x2 = ({ state: e, thinkingTime: t, nextPhase: i }) => /* @__PURE__ */ m("d
|
|
|
9099
9107
|
disableStopButton: U
|
|
9100
9108
|
}
|
|
9101
9109
|
);
|
|
9102
|
-
case
|
|
9110
|
+
case z.TRANSCRIBING:
|
|
9103
9111
|
return /* @__PURE__ */ c(
|
|
9104
9112
|
E2,
|
|
9105
9113
|
{
|
|
@@ -9107,10 +9115,10 @@ const x2 = ({ state: e, thinkingTime: t, nextPhase: i }) => /* @__PURE__ */ m("d
|
|
|
9107
9115
|
editingDuration: O
|
|
9108
9116
|
}
|
|
9109
9117
|
);
|
|
9110
|
-
case
|
|
9111
|
-
case
|
|
9118
|
+
case z.EDITING:
|
|
9119
|
+
case z.SUBMITTING:
|
|
9112
9120
|
return null;
|
|
9113
|
-
case
|
|
9121
|
+
case z.COMPLETED:
|
|
9114
9122
|
return null;
|
|
9115
9123
|
default:
|
|
9116
9124
|
return null;
|
|
@@ -9143,14 +9151,14 @@ const x2 = ({ state: e, thinkingTime: t, nextPhase: i }) => /* @__PURE__ */ m("d
|
|
|
9143
9151
|
interview_duration: A,
|
|
9144
9152
|
videoFeedRef: a,
|
|
9145
9153
|
lastSubmittedAnswer: k,
|
|
9146
|
-
onNextPhase: Fe.phase ===
|
|
9154
|
+
onNextPhase: Fe.phase === z.ANSWERING ? qi : ae,
|
|
9147
9155
|
answerText: p,
|
|
9148
9156
|
onAnswerChange: (V) => {
|
|
9149
9157
|
const W = V.target.value;
|
|
9150
9158
|
v(W), x.current = W;
|
|
9151
9159
|
},
|
|
9152
9160
|
editingTime: O,
|
|
9153
|
-
disableSubmitButton: Fe.phase ===
|
|
9161
|
+
disableSubmitButton: Fe.phase === z.ANSWERING && U,
|
|
9154
9162
|
children: Yi()
|
|
9155
9163
|
}
|
|
9156
9164
|
)
|