interview-widget 1.0.5 → 1.0.6

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/widget.es.js CHANGED
@@ -1,9 +1,9 @@
1
- var qe = Object.defineProperty;
2
- var Be = (i, r, t) => r in i ? qe(i, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[r] = t;
3
- var F = (i, r, t) => Be(i, typeof r != "symbol" ? r + "" : r, t);
4
- import ge, { createContext as Te, useContext as ne, useSyncExternalStore as Ce, useRef as E, useCallback as T, useMemo as ee, useState as k, useEffect as C, forwardRef as We, useImperativeHandle as Ge } from "react";
5
- import { createPortal as Ve } from "react-dom";
6
- var Se = { exports: {} }, ae = {};
1
+ var Be = Object.defineProperty;
2
+ var We = (i, r, t) => r in i ? Be(i, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[r] = t;
3
+ var F = (i, r, t) => We(i, typeof r != "symbol" ? r + "" : r, t);
4
+ import fe, { createContext as Ce, useContext as ne, useSyncExternalStore as Se, useRef as E, useCallback as T, useMemo as ee, useState as k, useEffect as C, forwardRef as Ge, useImperativeHandle as Ve } from "react";
5
+ import { createPortal as ze } from "react-dom";
6
+ var Ie = { exports: {} }, ae = {};
7
7
  /**
8
8
  * @license React
9
9
  * react-jsx-runtime.production.js
@@ -13,8 +13,8 @@ var Se = { exports: {} }, ae = {};
13
13
  * This source code is licensed under the MIT license found in the
14
14
  * LICENSE file in the root directory of this source tree.
15
15
  */
16
- var ze = Symbol.for("react.transitional.element"), He = Symbol.for("react.fragment");
17
- function Ie(i, r, t) {
16
+ var He = Symbol.for("react.transitional.element"), Ye = Symbol.for("react.fragment");
17
+ function Re(i, r, t) {
18
18
  var s = null;
19
19
  if (t !== void 0 && (s = "" + t), r.key !== void 0 && (s = "" + r.key), "key" in r) {
20
20
  t = {};
@@ -22,19 +22,19 @@ function Ie(i, r, t) {
22
22
  n !== "key" && (t[n] = r[n]);
23
23
  } else t = r;
24
24
  return r = t.ref, {
25
- $$typeof: ze,
25
+ $$typeof: He,
26
26
  type: i,
27
27
  key: s,
28
28
  ref: r !== void 0 ? r : null,
29
29
  props: t
30
30
  };
31
31
  }
32
- ae.Fragment = He;
33
- ae.jsx = Ie;
34
- ae.jsxs = Ie;
35
- Se.exports = ae;
36
- var e = Se.exports;
37
- const $ = {
32
+ ae.Fragment = Ye;
33
+ ae.jsx = Re;
34
+ ae.jsxs = Re;
35
+ Ie.exports = ae;
36
+ var e = Ie.exports;
37
+ const he = {}, $ = {
38
38
  api: {
39
39
  baseUrl: "/api",
40
40
  retryConfig: {
@@ -65,25 +65,26 @@ const $ = {
65
65
  enabled: !0
66
66
  }
67
67
  }
68
- }, xe = "iw-storage";
69
- function Ye() {
70
- return typeof import.meta < "u" ? "your-secure-encryption-seed-here" : typeof process < "u" && process.env.NEXT_PUBLIC_IW_SECRET ? process.env.NEXT_PUBLIC_IW_SECRET : typeof window < "u" && window.__IW_SECRET__ ? window.__IW_SECRET__ : "proctoring-data-seed";
68
+ }, pe = "iw-storage";
69
+ function Qe() {
70
+ if (!(typeof import.meta < "u" && (he != null && he.VITE_IW_SECRET)))
71
+ return typeof process < "u" && process.env.NEXT_PUBLIC_IW_SECRET ? process.env.NEXT_PUBLIC_IW_SECRET : typeof window < "u" && window.__IW_SECRET__ ? window.__IW_SECRET__ : "proctoring-data-seed";
71
72
  }
72
- const Re = Ye(), pe = "AES-GCM", fe = 12;
73
- async function Ae(i) {
73
+ const Ae = Qe(), be = "AES-GCM", xe = 12;
74
+ async function Me(i) {
74
75
  const t = new TextEncoder().encode(i), s = await crypto.subtle.digest("SHA-256", t);
75
- return crypto.subtle.importKey("raw", s, pe, !1, [
76
+ return crypto.subtle.importKey("raw", s, be, !1, [
76
77
  "encrypt",
77
78
  "decrypt"
78
79
  ]);
79
80
  }
80
- function Qe() {
81
- return crypto.getRandomValues(new Uint8Array(fe));
81
+ function Ke() {
82
+ return crypto.getRandomValues(new Uint8Array(xe));
82
83
  }
83
- async function Ke(i, r = "default-seed") {
84
+ async function Je(i, r = "default-seed") {
84
85
  try {
85
- const t = typeof i == "string" ? i : JSON.stringify(i), n = new TextEncoder().encode(t), o = await Ae(r), a = Qe(), l = await crypto.subtle.encrypt(
86
- { name: pe, iv: a },
86
+ const t = typeof i == "string" ? i : JSON.stringify(i), n = new TextEncoder().encode(t), o = await Me(r), a = Ke(), l = await crypto.subtle.encrypt(
87
+ { name: be, iv: a },
87
88
  o,
88
89
  n
89
90
  ), w = new Uint8Array(a.length + l.byteLength);
@@ -92,13 +93,13 @@ async function Ke(i, r = "default-seed") {
92
93
  throw console.error("Encryption failed:", t), new Error("Failed to encrypt data");
93
94
  }
94
95
  }
95
- async function Je(i, r = "default-seed") {
96
+ async function Xe(i, r = "default-seed") {
96
97
  try {
97
98
  const t = atob(i), s = new Uint8Array(t.length);
98
99
  for (let d = 0; d < t.length; d++)
99
100
  s[d] = t.charCodeAt(d);
100
- const n = s.slice(0, fe), o = s.slice(fe), a = await Ae(r), l = await crypto.subtle.decrypt(
101
- { name: pe, iv: n },
101
+ const n = s.slice(0, xe), o = s.slice(xe), a = await Me(r), l = await crypto.subtle.decrypt(
102
+ { name: be, iv: n },
102
103
  a,
103
104
  o
104
105
  );
@@ -107,23 +108,23 @@ async function Je(i, r = "default-seed") {
107
108
  throw console.error("Decryption failed:", t), new Error("Failed to decrypt data");
108
109
  }
109
110
  }
110
- async function Xe(i, r = "default-seed") {
111
- return Ke(i, r);
112
- }
113
111
  async function Ze(i, r = "default-seed") {
114
- const t = await Je(i, r);
112
+ return Je(i, r);
113
+ }
114
+ async function et(i, r = "default-seed") {
115
+ const t = await Xe(i, r);
115
116
  try {
116
117
  return JSON.parse(t);
117
118
  } catch {
118
119
  return t;
119
120
  }
120
121
  }
121
- const oe = Te(null), et = async () => {
122
+ const oe = Ce(null), tt = async () => {
122
123
  var i, r;
123
124
  try {
124
- const t = sessionStorage.getItem(xe);
125
+ const t = sessionStorage.getItem(pe);
125
126
  if (t) {
126
- const s = await Ze(t, Re);
127
+ const s = await et(t, Ae);
127
128
  return {
128
129
  logViolations: ((i = s.state) == null ? void 0 : i.logViolations) || [],
129
130
  totalViolations: ((r = s.state) == null ? void 0 : r.totalViolations) || 0
@@ -136,28 +137,28 @@ const oe = Te(null), et = async () => {
136
137
  );
137
138
  }
138
139
  return { logViolations: [], totalViolations: 0 };
139
- }, je = async (i) => {
140
+ }, Ne = async (i) => {
140
141
  try {
141
- const r = await Xe(
142
+ const r = await Ze(
142
143
  {
143
144
  state: i,
144
145
  version: 0
145
146
  },
146
- Re
147
+ Ae
147
148
  );
148
- sessionStorage.setItem(xe, r);
149
+ sessionStorage.setItem(pe, r);
149
150
  } catch (r) {
150
151
  console.error("Failed to save proctoring data to session storage:", r);
151
152
  }
152
- }, tt = ({
153
+ }, it = ({
153
154
  children: i
154
155
  }) => {
155
156
  const r = E({
156
157
  logViolations: [],
157
158
  totalViolations: 0
158
159
  }), t = E(/* @__PURE__ */ new Set());
159
- ge.useEffect(() => {
160
- et().then((d) => {
160
+ fe.useEffect(() => {
161
+ tt().then((d) => {
161
162
  r.current = d, s();
162
163
  });
163
164
  }, []);
@@ -170,14 +171,14 @@ const oe = Te(null), et = async () => {
170
171
  r.current = {
171
172
  logViolations: [...r.current.logViolations, d],
172
173
  totalViolations: r.current.totalViolations + 1
173
- }, je(r.current), s();
174
+ }, Ne(r.current), s();
174
175
  },
175
176
  [s]
176
177
  ), l = T(() => {
177
178
  r.current = {
178
179
  logViolations: [],
179
180
  totalViolations: 0
180
- }, je(r.current), s();
181
+ }, Ne(r.current), s();
181
182
  }, [s]), w = ee(
182
183
  () => ({
183
184
  getState: o,
@@ -188,27 +189,27 @@ const oe = Te(null), et = async () => {
188
189
  [o, a, l, n]
189
190
  );
190
191
  return /* @__PURE__ */ e.jsx(oe.Provider, { value: w, children: i });
191
- }, it = () => {
192
+ }, rt = () => {
192
193
  const i = ne(oe);
193
194
  if (!i)
194
195
  throw new Error("useViolations must be used within a ProctoringProvider");
195
- return Ce(
196
+ return Se(
196
197
  i.subscribe,
197
198
  () => i.getState().logViolations,
198
199
  () => i.getState().logViolations
199
200
  );
200
- }, rt = () => {
201
+ }, st = () => {
201
202
  const i = ne(oe);
202
203
  if (!i)
203
204
  throw new Error(
204
205
  "useTotalViolations must be used within a ProctoringProvider"
205
206
  );
206
- return Ce(
207
+ return Se(
207
208
  i.subscribe,
208
209
  () => i.getState().totalViolations,
209
210
  () => i.getState().totalViolations
210
211
  );
211
- }, st = () => {
212
+ }, nt = () => {
212
213
  const i = ne(oe);
213
214
  if (!i)
214
215
  throw new Error(
@@ -218,10 +219,10 @@ const oe = Te(null), et = async () => {
218
219
  addViolation: i.addViolation,
219
220
  clearViolations: i.clearViolations
220
221
  };
221
- }, Me = Te(
222
+ }, De = Ce(
222
223
  null
223
224
  );
224
- function nt({
225
+ function at({
225
226
  config: i = {},
226
227
  children: r
227
228
  }) {
@@ -256,23 +257,23 @@ function nt({
256
257
  }
257
258
  }
258
259
  };
259
- return /* @__PURE__ */ e.jsx(Me.Provider, { value: t, children: /* @__PURE__ */ e.jsx(tt, { children: r }) });
260
+ return /* @__PURE__ */ e.jsx(De.Provider, { value: t, children: /* @__PURE__ */ e.jsx(it, { children: r }) });
260
261
  }
261
262
  function le() {
262
- const i = ne(Me);
263
+ const i = ne(De);
263
264
  if (!i)
264
265
  throw new Error(
265
266
  "useInterviewConfig must be used within an InterviewWidgetProvider. Wrap your component tree with <InterviewWidgetProvider config={...}>"
266
267
  );
267
268
  return i;
268
269
  }
269
- function De() {
270
+ function Pe() {
270
271
  return le().api || $.api;
271
272
  }
272
273
  function te() {
273
274
  return le().ui || $.ui;
274
275
  }
275
- function at() {
276
+ function ot() {
276
277
  return le().interview || $.interview;
277
278
  }
278
279
  const _e = ({
@@ -304,7 +305,7 @@ const _e = ({
304
305
  /* @__PURE__ */ e.jsx("path", { d: "M7.75 7.75l-2.15 -2.15" })
305
306
  ]
306
307
  }
307
- ) }), Pe = ({
308
+ ) }), Fe = ({
308
309
  children: i,
309
310
  variant: r = "primary",
310
311
  size: t = "md",
@@ -338,7 +339,7 @@ const _e = ({
338
339
  }
339
340
  );
340
341
  };
341
- function ot(i) {
342
+ function lt(i) {
342
343
  const r = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(i);
343
344
  return r ? {
344
345
  r: parseInt(r[1], 16),
@@ -346,32 +347,32 @@ function ot(i) {
346
347
  b: parseInt(r[3], 16)
347
348
  } : null;
348
349
  }
349
- function lt(i, r, t) {
350
+ function ct(i, r, t) {
350
351
  return "#" + [i, r, t].map((s) => {
351
352
  const n = Math.round(s).toString(16);
352
353
  return n.length === 1 ? "0" + n : n;
353
354
  }).join("");
354
355
  }
355
- function Fe(i, r) {
356
- const t = ot(i);
356
+ function Le(i, r) {
357
+ const t = lt(i);
357
358
  if (!t) return i;
358
359
  const s = t.r + (255 - t.r) * r, n = t.g + (255 - t.g) * r, o = t.b + (255 - t.b) * r;
359
- return lt(s, n, o);
360
+ return ct(s, n, o);
360
361
  }
361
- function ct(i, r = 0.8) {
362
+ function dt(i, r = 0.8) {
362
363
  return {
363
- background: `linear-gradient(to bottom, ${Fe(i, r)}, #ffffff)`,
364
+ background: `linear-gradient(to bottom, ${Le(i, r)}, #ffffff)`,
364
365
  color: "#1f2937"
365
366
  };
366
367
  }
367
- function dt(i) {
368
+ function wt(i) {
368
369
  return new Promise((r) => setTimeout(r, i));
369
370
  }
370
- function Le(i) {
371
- return `linear-gradient(to left, ${Fe(i, 0.4)}, ${i})`;
371
+ function $e(i) {
372
+ return `linear-gradient(to left, ${Le(i, 0.4)}, ${i})`;
372
373
  }
373
- const wt = () => Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
374
- function ut(i) {
374
+ const ut = () => Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
375
+ function ht(i) {
375
376
  try {
376
377
  const r = i.split(".");
377
378
  if (r.length !== 3 || !r[1])
@@ -385,7 +386,7 @@ function ut(i) {
385
386
  return console.error("Error decoding JWT:", r), null;
386
387
  }
387
388
  }
388
- const $e = (i) => /* @__PURE__ */ e.jsxs(
389
+ const Oe = (i) => /* @__PURE__ */ e.jsxs(
389
390
  "svg",
390
391
  {
391
392
  xmlns: "http://www.w3.org/2000/svg",
@@ -403,7 +404,7 @@ const $e = (i) => /* @__PURE__ */ e.jsxs(
403
404
  /* @__PURE__ */ e.jsx("path", { d: "m9 12 2 2 4-4" })
404
405
  ]
405
406
  }
406
- ), Oe = (i) => /* @__PURE__ */ e.jsxs(
407
+ ), Ue = (i) => /* @__PURE__ */ e.jsxs(
407
408
  "svg",
408
409
  {
409
410
  xmlns: "http://www.w3.org/2000/svg",
@@ -422,7 +423,7 @@ const $e = (i) => /* @__PURE__ */ e.jsxs(
422
423
  /* @__PURE__ */ e.jsx("line", { x1: "12", x2: "12", y1: "17", y2: "21" })
423
424
  ]
424
425
  }
425
- ), ht = (i) => /* @__PURE__ */ e.jsxs(
426
+ ), mt = (i) => /* @__PURE__ */ e.jsxs(
426
427
  "svg",
427
428
  {
428
429
  xmlns: "http://www.w3.org/2000/svg",
@@ -444,29 +445,29 @@ const $e = (i) => /* @__PURE__ */ e.jsxs(
444
445
  ), V = (i) => {
445
446
  const { baseColor: r, borderRadius: t } = te(), { loading: s, children: n, ...o } = i;
446
447
  return /* @__PURE__ */ e.jsx(
447
- Pe,
448
+ Fe,
448
449
  {
449
450
  style: {
450
- background: Le(r),
451
+ background: $e(r),
451
452
  borderRadius: t
452
453
  },
453
454
  ...o,
454
455
  children: s ? /* @__PURE__ */ e.jsx(_e, {}) : n
455
456
  }
456
457
  );
457
- }, mt = [
458
+ }, gt = [
458
459
  "Do not refresh or reload the page during your assessment",
459
460
  "Refrain from switching tabs or opening other applications while the session is in progress",
460
461
  "Ensure your face remains clearly visible on camera at all times",
461
462
  "Avoid frequent distractions or leaving your seat during the session",
462
463
  "Do not disable or interfere with audio/video monitoring"
463
- ], gt = ({
464
+ ], ft = ({
464
465
  isOpen: i,
465
466
  onStart: r,
466
467
  onClose: t
467
468
  }) => {
468
469
  var A;
469
- const s = E(null), n = E(null), { baseColor: o, borderRadius: a } = te(), [l, w] = k(!1), [d, u] = k(null), [h, m] = k(!1), c = o ?? "#2563eb", x = Le(c), b = a ?? 18, j = (f, M) => f.startsWith("#") && f.length === 7 ? `${f}${M}` : f, g = [
470
+ const s = E(null), n = E(null), { baseColor: o, borderRadius: a } = te(), [l, w] = k(!1), [d, u] = k(null), [h, m] = k(!1), c = o ?? "#2563eb", x = $e(c), b = a ?? 18, j = (f, M) => f.startsWith("#") && f.length === 7 ? `${f}${M}` : f, g = [
470
471
  `radial-gradient(120% 85% at 50% 125%, ${j(
471
472
  c,
472
473
  "34"
@@ -519,16 +520,16 @@ const $e = (i) => /* @__PURE__ */ e.jsxs(
519
520
  description: S.cameraCopy,
520
521
  status: S.badge,
521
522
  toneClass: S.toneClass,
522
- Icon: Oe
523
+ Icon: Ue
523
524
  },
524
525
  {
525
526
  label: "Microphone input",
526
527
  description: S.micCopy,
527
528
  status: S.badge,
528
529
  toneClass: S.toneClass,
529
- Icon: ht
530
+ Icon: mt
530
531
  }
531
- ], _ = () => {
532
+ ], P = () => {
532
533
  n.current && (n.current.getTracks().forEach((f) => f.stop()), n.current = null);
533
534
  }, y = async () => {
534
535
  m(!0), u(null);
@@ -548,15 +549,15 @@ const $e = (i) => /* @__PURE__ */ e.jsxs(
548
549
  };
549
550
  if (C(() => {
550
551
  if (!i) {
551
- _();
552
+ P();
552
553
  return;
553
554
  }
554
555
  return y(), () => {
555
- _();
556
+ P();
556
557
  };
557
558
  }, [i]), !i) return null;
558
559
  const R = () => {
559
- r(), _();
560
+ r(), P();
560
561
  };
561
562
  return /* @__PURE__ */ e.jsx("div", { className: "iw-fixed iw-inset-0 iw-z-50 iw-flex iw-items-center iw-justify-center iw-bg-gray-900/25 iw-backdrop-blur-md iw-p-4", children: /* @__PURE__ */ e.jsxs("div", { className: " iw-w-full iw-max-w-[920px] iw-max-h-[96vh] iw-overflow-auto iw-rounded-3xl iw-bg-white iw-shadow-[0_40px_80px_-28px_rgba(15,23,42,0.25)]", children: [
562
563
  /* @__PURE__ */ e.jsxs(
@@ -597,7 +598,7 @@ const $e = (i) => /* @__PURE__ */ e.jsxs(
597
598
  ),
598
599
  /* @__PURE__ */ e.jsxs("div", { className: "iw-relative iw-grid md:iw-grid-cols-[minmax(0,1fr)_auto] iw-items-start iw-gap-6 iw-px-6 iw-py-7", children: [
599
600
  /* @__PURE__ */ e.jsx("div", { className: "iw-flex iw-flex-col iw-gap-4 iw-text-white", children: /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-start iw-gap-4", children: [
600
- /* @__PURE__ */ e.jsx("div", { className: "iw-flex iw-h-12 iw-w-12 iw-items-center iw-justify-center iw-rounded-2xl iw-bg-white/15 iw-shadow-inner", children: /* @__PURE__ */ e.jsx($e, { className: "iw-h-6 iw-w-6" }) }),
601
+ /* @__PURE__ */ e.jsx("div", { className: "iw-flex iw-h-12 iw-w-12 iw-items-center iw-justify-center iw-rounded-2xl iw-bg-white/15 iw-shadow-inner", children: /* @__PURE__ */ e.jsx(Oe, { className: "iw-h-6 iw-w-6" }) }),
601
602
  /* @__PURE__ */ e.jsxs("div", { children: [
602
603
  /* @__PURE__ */ e.jsx("p", { className: "iw-text-[11px] iw-font-medium iw-uppercase iw-tracking-wide iw-text-white/70", children: "Pre-interview checklist" }),
603
604
  /* @__PURE__ */ e.jsx("h2", { className: "iw-mt-1 iw-text-xl iw-font-semibold iw-leading-tight", children: "Final checks before you go live" }),
@@ -625,7 +626,7 @@ const $e = (i) => /* @__PURE__ */ e.jsxs(
625
626
  "aria-label": "Close",
626
627
  className: "iw-absolute iw-top-5 iw-right-5 iw-text-white/70 transition-colors hover:iw-text-white",
627
628
  onClick: () => {
628
- _(), t == null || t();
629
+ P(), t == null || t();
629
630
  },
630
631
  children: "✕"
631
632
  }
@@ -641,7 +642,7 @@ const $e = (i) => /* @__PURE__ */ e.jsxs(
641
642
  /* @__PURE__ */ e.jsx("h3", { className: "iw-text-sm iw-font-semibold iw-text-slate-900", children: "Proctoring guidelines" }),
642
643
  /* @__PURE__ */ e.jsx("span", { className: "iw-text-[11px] iw-font-medium iw-uppercase iw-tracking-wide iw-text-slate-400", children: "Required" })
643
644
  ] }),
644
- /* @__PURE__ */ e.jsx("ul", { className: "iw-mt-5 iw-flex iw-flex-col iw-gap-4", children: mt.map((f, M) => /* @__PURE__ */ e.jsx(
645
+ /* @__PURE__ */ e.jsx("ul", { className: "iw-mt-5 iw-flex iw-flex-col iw-gap-4", children: gt.map((f, M) => /* @__PURE__ */ e.jsx(
645
646
  "li",
646
647
  {
647
648
  className: "iw-group iw-overflow-hidden iw-rounded-xl iw-border iw-border-slate-100 iw-bg-slate-50/60 iw-p-4 iw-transition-all hover:iw-border-slate-200 hover:iw-bg-white",
@@ -683,7 +684,7 @@ const $e = (i) => /* @__PURE__ */ e.jsxs(
683
684
  ) }),
684
685
  /* @__PURE__ */ e.jsxs("div", { className: "iw-relative iw-grid iw-grid-cols-2 iw-gap-4 iw-px-1", children: [
685
686
  /* @__PURE__ */ e.jsx(
686
- Pe,
687
+ Fe,
687
688
  {
688
689
  onClick: y,
689
690
  disabled: h,
@@ -765,11 +766,11 @@ const $e = (i) => /* @__PURE__ */ e.jsxs(
765
766
  ] }) });
766
767
  };
767
768
  var D = /* @__PURE__ */ ((i) => (i.IDLE = "idle", i.FETCHING_QUESTION = "fetching_question", i.READING_QUESTION = "reading_question", i.THINKING = "thinking", i.ANSWERING = "answering", i.TRANSCRIBING = "transcribing", i.EDITING = "editing", i.SUBMITTING = "submitting", i.COMPLETED = "completed", i))(D || {});
768
- const ft = {
769
+ const xt = {
769
770
  thinkingDuration: 30,
770
771
  answeringDuration: 120,
771
772
  editingDuration: 30
772
- }, xt = {
773
+ }, pt = {
773
774
  idle: {
774
775
  next: "fetching_question"
775
776
  /* FETCHING_QUESTION */
@@ -798,14 +799,14 @@ const ft = {
798
799
  /* COMPLETED */
799
800
  }
800
801
  };
801
- class pt {
802
+ class bt {
802
803
  constructor(r = {}, t = {}) {
803
804
  F(this, "config");
804
805
  F(this, "state");
805
806
  F(this, "phaseIntervalId", null);
806
807
  F(this, "globalIntervalId", null);
807
808
  F(this, "callbacks");
808
- this.config = { ...ft, ...r }, this.callbacks = t, this.state = {
809
+ this.config = { ...xt, ...r }, this.callbacks = t, this.state = {
809
810
  phase: "idle",
810
811
  currentPhaseTimeRemaining: 0,
811
812
  totalTimeElapsed: 0,
@@ -828,7 +829,7 @@ class pt {
828
829
  * Move to next phase
829
830
  */
830
831
  nextPhase() {
831
- const r = this.state.phase, t = xt[r];
832
+ const r = this.state.phase, t = pt[r];
832
833
  if (!t) return;
833
834
  this.stopPhaseTimer(), this.state.phase = t.next;
834
835
  const s = this.getDurationForPhase(t.next);
@@ -899,9 +900,9 @@ class pt {
899
900
  (t = (r = this.callbacks).onPhaseChange) == null || t.call(r, this.state.phase, this.getState());
900
901
  }
901
902
  }
902
- function bt(i = {}) {
903
+ function yt(i = {}) {
903
904
  const { config: r = {}, callbacks: t = {} } = i, s = E(null);
904
- s.current || (s.current = new pt(r, {}));
905
+ s.current || (s.current = new bt(r, {}));
905
906
  const n = s.current, [o, a] = k(n.getState()), l = T(() => {
906
907
  a(n.getState());
907
908
  }, [n]);
@@ -939,7 +940,7 @@ function bt(i = {}) {
939
940
  timerService: n
940
941
  };
941
942
  }
942
- function yt(i, r = {}) {
943
+ function vt(i, r = {}) {
943
944
  const [t, s] = k({
944
945
  data: null,
945
946
  loading: !1,
@@ -978,7 +979,7 @@ function yt(i, r = {}) {
978
979
  execute: n
979
980
  };
980
981
  }
981
- const vt = (i) => {
982
+ const jt = (i) => {
982
983
  const [r, t] = k(null), [s, n] = k(!1), o = document, a = () => !!(o.fullscreenEnabled || o.webkitFullscreenEnabled || o.mozFullScreenEnabled || o.msFullscreenEnabled), l = () => o.fullscreenElement || o.webkitFullscreenElement || o.mozFullScreenElement || o.msFullscreenElement, w = async (c) => {
983
984
  var x;
984
985
  try {
@@ -1038,7 +1039,7 @@ const vt = (i) => {
1038
1039
  error: r
1039
1040
  };
1040
1041
  };
1041
- function jt(i) {
1042
+ function Nt(i) {
1042
1043
  var r;
1043
1044
  if (!navigator.onLine)
1044
1045
  return {
@@ -1097,7 +1098,7 @@ function jt(i) {
1097
1098
  originalError: i
1098
1099
  };
1099
1100
  }
1100
- async function be(i, r = {}, t = {
1101
+ async function ye(i, r = {}, t = {
1101
1102
  attempts: 3,
1102
1103
  backoff: "exponential",
1103
1104
  baseDelay: 1e3,
@@ -1118,10 +1119,10 @@ async function be(i, r = {}, t = {
1118
1119
  return l;
1119
1120
  } catch (o) {
1120
1121
  s = o;
1121
- const a = jt(o);
1122
+ const a = Nt(o);
1122
1123
  if (!a.retryable || n === t.attempts)
1123
1124
  throw a;
1124
- const l = Nt(n, t);
1125
+ const l = kt(n, t);
1125
1126
  console.warn(
1126
1127
  `API request failed (attempt ${n}/${t.attempts}), retrying in ${l}ms:`,
1127
1128
  a.message
@@ -1129,11 +1130,11 @@ async function be(i, r = {}, t = {
1129
1130
  }
1130
1131
  throw s;
1131
1132
  }
1132
- function Nt(i, r) {
1133
+ function kt(i, r) {
1133
1134
  let t;
1134
1135
  return r.backoff === "exponential" ? t = r.baseDelay * Math.pow(2, i - 1) : t = r.baseDelay, t = Math.min(t, r.maxDelay), r.jitter && (t = t * (0.5 + Math.random() * 0.5)), Math.round(t);
1135
1136
  }
1136
- class kt {
1137
+ class Et {
1137
1138
  constructor(r = {}) {
1138
1139
  F(this, "config");
1139
1140
  this.config = r;
@@ -1172,7 +1173,7 @@ class kt {
1172
1173
  answer: o,
1173
1174
  answerDuration: a
1174
1175
  }) {
1175
- const l = await be(
1176
+ const l = await ye(
1176
1177
  `${this.getBaseUrl()}/questions/next`,
1177
1178
  {
1178
1179
  method: "POST",
@@ -1193,14 +1194,14 @@ class kt {
1193
1194
  return await l.json();
1194
1195
  }
1195
1196
  }
1196
- function Et() {
1197
+ function Tt() {
1197
1198
  const i = le();
1198
1199
  return ee(() => {
1199
1200
  const t = i.api || {};
1200
- return new kt(t);
1201
+ return new Et(t);
1201
1202
  }, [i.api]);
1202
1203
  }
1203
- const Tt = (i) => {
1204
+ const Ct = (i) => {
1204
1205
  C(() => {
1205
1206
  const r = (s) => {
1206
1207
  (s.ctrlKey || s.metaKey) && ["c", "v", "a", "t", "n", "w", "r", "s", "p"].includes(s.key.toLowerCase()) && (s.preventDefault(), i({
@@ -1245,7 +1246,7 @@ class I extends Error {
1245
1246
  super(r), this.code = t, this.recoverable = s, this.name = "STTError";
1246
1247
  }
1247
1248
  }
1248
- class Ct {
1249
+ class St {
1249
1250
  constructor(r = {}) {
1250
1251
  F(this, "config");
1251
1252
  F(this, "mediaRecorder", null);
@@ -1393,7 +1394,7 @@ class Ct {
1393
1394
  type: t.type || "audio/wav"
1394
1395
  });
1395
1396
  l.append("file", w), l.append("model", s || "whisper-large-v3-turbo"), l.append("language", n || "en"), l.append("include_timestamps", String(o || !1)), l.append("temperature", String(a || 0));
1396
- const d = await be(
1397
+ const d = await ye(
1397
1398
  `${this.config.baseUrl}/speech/transcribe`,
1398
1399
  {
1399
1400
  method: "POST",
@@ -1475,7 +1476,7 @@ class Ct {
1475
1476
  this.recordingStream && (this.recordingStream.getTracks().forEach((r) => r.stop()), this.recordingStream = null), this.mediaRecorder = null, this.audioChunks = [], this.autoStopTimeoutId && (clearTimeout(this.autoStopTimeoutId), this.autoStopTimeoutId = null);
1476
1477
  }
1477
1478
  }
1478
- const Z = new Ct(), St = (i = {}) => {
1479
+ const Z = new St(), It = (i = {}) => {
1479
1480
  const [r, t] = k(!1), [s, n] = k(!1), [o, a] = k(null), [l, w] = k(null), [d, u] = k(null);
1480
1481
  i.config && Z.updateConfig(i.config);
1481
1482
  const h = T(async (b) => {
@@ -1551,7 +1552,7 @@ const Z = new Ct(), St = (i = {}) => {
1551
1552
  error: l,
1552
1553
  audioBlob: d
1553
1554
  };
1554
- }, It = (i) => {
1555
+ }, Rt = (i) => {
1555
1556
  const r = E(null), t = E(!1);
1556
1557
  C(() => {
1557
1558
  const s = () => {
@@ -1581,7 +1582,7 @@ const Z = new Ct(), St = (i = {}) => {
1581
1582
  document.removeEventListener("visibilitychange", s), window.removeEventListener("blur", n), r.current && clearTimeout(r.current);
1582
1583
  };
1583
1584
  }, [i]);
1584
- }, Rt = () => {
1585
+ }, At = () => {
1585
1586
  C(() => {
1586
1587
  const i = document.createElement("style");
1587
1588
  return i.textContent = `
@@ -1602,7 +1603,7 @@ const Z = new Ct(), St = (i = {}) => {
1602
1603
  };
1603
1604
  }, []);
1604
1605
  };
1605
- class At {
1606
+ class Mt {
1606
1607
  constructor(r = {}) {
1607
1608
  F(this, "config");
1608
1609
  F(this, "currentAudio", null);
@@ -1630,7 +1631,7 @@ class At {
1630
1631
  speed: n = this.config.speed
1631
1632
  } = r, o = new URLSearchParams();
1632
1633
  o.append("text", t), o.append("voice", s || "string"), o.append("speed", (n == null ? void 0 : n.toString()) || "1");
1633
- const a = await be(
1634
+ const a = await ye(
1634
1635
  `${this.config.baseUrl}/speech/synthesize`,
1635
1636
  {
1636
1637
  method: "POST",
@@ -1713,9 +1714,9 @@ class At {
1713
1714
  return this.currentAudio !== null && !this.currentAudio.paused;
1714
1715
  }
1715
1716
  }
1716
- const he = new At(), Mt = (i = {}) => {
1717
+ const me = new Mt(), Dt = (i = {}) => {
1717
1718
  const [r, t] = k(!1), [s, n] = k(!1), [o, a] = k(null);
1718
- i.config && he.updateConfig(i.config);
1719
+ i.config && me.updateConfig(i.config);
1719
1720
  const l = T(
1720
1721
  async (d, u = {}) => {
1721
1722
  var h;
@@ -1725,7 +1726,7 @@ const he = new At(), Mt = (i = {}) => {
1725
1726
  text: d,
1726
1727
  ...u
1727
1728
  };
1728
- await he.speak(m, {
1729
+ await me.speak(m, {
1729
1730
  onStart: () => {
1730
1731
  var c;
1731
1732
  n(!1), t(!0), (c = i.onStart) == null || c.call(i);
@@ -1746,7 +1747,7 @@ const he = new At(), Mt = (i = {}) => {
1746
1747
  },
1747
1748
  [i]
1748
1749
  ), w = T(() => {
1749
- he.stop(), t(!1), n(!1);
1750
+ me.stop(), t(!1), n(!1);
1750
1751
  }, []);
1751
1752
  return {
1752
1753
  speak: l,
@@ -1755,12 +1756,12 @@ const he = new At(), Mt = (i = {}) => {
1755
1756
  isLoading: s,
1756
1757
  error: o
1757
1758
  };
1758
- }, Dt = ({
1759
+ }, Pt = ({
1759
1760
  onViolation: i,
1760
1761
  onEnd: r,
1761
1762
  maxViolations: t = 5
1762
1763
  }) => {
1763
- const { addViolation: s } = st(), n = it(), o = rt(), a = E(o);
1764
+ const { addViolation: s } = nt(), n = rt(), o = st(), a = E(o);
1764
1765
  C(() => {
1765
1766
  a.current = o;
1766
1767
  }, [o]);
@@ -1774,7 +1775,7 @@ const he = new At(), Mt = (i = {}) => {
1774
1775
  logViolation: T(
1775
1776
  ({ type: d, severity: u, details: h }) => {
1776
1777
  const m = {
1777
- id: wt(),
1778
+ id: ut(),
1778
1779
  type: d,
1779
1780
  severity: u,
1780
1781
  details: h,
@@ -1872,7 +1873,7 @@ const he = new At(), Mt = (i = {}) => {
1872
1873
  clearInterval(s), document.removeEventListener("keydown", n), document.removeEventListener("contextmenu", o), delete window.showStats, delete window.interviewTips;
1873
1874
  };
1874
1875
  }, []);
1875
- }, ye = (i) => /* @__PURE__ */ e.jsxs(
1876
+ }, ve = (i) => /* @__PURE__ */ e.jsxs(
1876
1877
  "svg",
1877
1878
  {
1878
1879
  xmlns: "http://www.w3.org/2000/svg",
@@ -1894,10 +1895,10 @@ const he = new At(), Mt = (i = {}) => {
1894
1895
  /* @__PURE__ */ e.jsx("path", { d: "M8.644 21.42a10 10 0 0 0 7.631-.38" })
1895
1896
  ]
1896
1897
  }
1897
- ), Pt = (i, r, t) => Math.max(r, Math.min(t, i)), Ne = (i) => {
1898
+ ), Ft = (i, r, t) => Math.max(r, Math.min(t, i)), ke = (i) => {
1898
1899
  const r = Math.max(0, Math.floor(i)), t = Math.floor(r / 60).toString().padStart(2, "0"), s = (r % 60).toString().padStart(2, "0");
1899
1900
  return `${t}:${s}`;
1900
- }, ve = ({
1901
+ }, je = ({
1901
1902
  total: i,
1902
1903
  remaining: r,
1903
1904
  size: t = 64,
@@ -1905,7 +1906,7 @@ const he = new At(), Mt = (i = {}) => {
1905
1906
  className: n = "",
1906
1907
  showLabel: o = !0
1907
1908
  }) => {
1908
- const a = Math.max(1, i || 1), l = Pt(r / a, 0, 1), { radius: w, circumference: d, dashOffset: u, center: h } = ee(() => {
1909
+ const a = Math.max(1, i || 1), l = Ft(r / a, 0, 1), { radius: w, circumference: d, dashOffset: u, center: h } = ee(() => {
1909
1910
  const x = (t - s) / 2, b = 2 * Math.PI * x, j = b * (1 - l), g = Math.round(s) % 2 === 1, v = t / 2 + (g ? 0.5 : 0);
1910
1911
  return { radius: x, circumference: b, dashOffset: j, center: v };
1911
1912
  }, [t, s, l]), m = ee(() => l <= 0.25 ? "iw-stroke-red-500" : l <= 0.5 ? "iw-stroke-yellow-500" : "iw-stroke-green-500", [l]), c = l <= 0.25 ? "iw-animate-pulse" : "";
@@ -1914,7 +1915,7 @@ const he = new At(), Mt = (i = {}) => {
1914
1915
  {
1915
1916
  className: `iw-relative iw-inline-flex iw-items-center iw-justify-center iw-rounded-full iw-bg-white ${n}`,
1916
1917
  style: { width: t, height: t },
1917
- "aria-label": `Time remaining ${Ne(r)}`,
1918
+ "aria-label": `Time remaining ${ke(r)}`,
1918
1919
  role: "timer",
1919
1920
  "aria-live": "polite",
1920
1921
  children: [
@@ -1965,13 +1966,13 @@ const he = new At(), Mt = (i = {}) => {
1965
1966
  "span",
1966
1967
  {
1967
1968
  className: `iw-text-[11px] iw-font-semibold iw-tabular-nums ${l <= 0.25 ? "iw-text-red-600" : l <= 0.5 ? "iw-text-yellow-600" : "iw-text-green-600"}`,
1968
- children: Ne(r)
1969
+ children: ke(r)
1969
1970
  }
1970
1971
  ) })
1971
1972
  ]
1972
1973
  }
1973
1974
  );
1974
- }, Ft = ({
1975
+ }, Lt = ({
1975
1976
  label: i,
1976
1977
  error: r,
1977
1978
  fullWidth: t = !1,
@@ -2006,7 +2007,7 @@ const he = new At(), Mt = (i = {}) => {
2006
2007
  ]
2007
2008
  }
2008
2009
  );
2009
- }, Lt = ({
2010
+ }, $t = ({
2010
2011
  value: i,
2011
2012
  onChange: r,
2012
2013
  onSubmit: t,
@@ -2022,11 +2023,11 @@ const he = new At(), Mt = (i = {}) => {
2022
2023
  /* @__PURE__ */ e.jsx("h3", { className: "iw-text-lg iw-font-semibold iw-text-gray-900 iw-mb-1", children: "Your Answer" }),
2023
2024
  /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-justify-center iw-gap-2", children: [
2024
2025
  /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-gap-1", children: [
2025
- /* @__PURE__ */ e.jsx(ye, { className: "iw-size-4 iw-text-orange-600" }),
2026
+ /* @__PURE__ */ e.jsx(ve, { className: "iw-size-4 iw-text-orange-600" }),
2026
2027
  /* @__PURE__ */ e.jsx("p", { className: "iw-text-gray-700 iw-text-sm", children: "Time to edit: " })
2027
2028
  ] }),
2028
2029
  /* @__PURE__ */ e.jsx(
2029
- ve,
2030
+ je,
2030
2031
  {
2031
2032
  total: o,
2032
2033
  remaining: n.currentPhaseTimeRemaining,
@@ -2038,7 +2039,7 @@ const he = new At(), Mt = (i = {}) => {
2038
2039
  ] }),
2039
2040
  /* @__PURE__ */ e.jsxs("div", { className: " iw-overflow-hidden iw-flex iw-flex-col iw-h-full iw-mt-2", children: [
2040
2041
  /* @__PURE__ */ e.jsx(
2041
- Ft,
2042
+ Lt,
2042
2043
  {
2043
2044
  value: i,
2044
2045
  onChange: r,
@@ -2055,9 +2056,9 @@ const he = new At(), Mt = (i = {}) => {
2055
2056
  /* @__PURE__ */ e.jsx("div", { className: "iw-w-full iw-grid iw-grid-cols-1 iw-mt-4", children: /* @__PURE__ */ e.jsx(V, { onClick: t, disabled: s, children: "Submit Answer" }) })
2056
2057
  ] })
2057
2058
  ] });
2058
- }, $t = ({ className: i = "" }) => {
2059
+ }, Ot = ({ className: i = "" }) => {
2059
2060
  var n;
2060
- const { authToken: r } = De(), t = r ? ut(r) : null, s = E(null);
2061
+ const { authToken: r } = Pe(), t = r ? ht(r) : null, s = E(null);
2061
2062
  return C(() => {
2062
2063
  let o = null;
2063
2064
  return (async () => {
@@ -2092,7 +2093,7 @@ const he = new At(), Mt = (i = {}) => {
2092
2093
  ] }),
2093
2094
  ((n = t == null ? void 0 : t.data) == null ? void 0 : n.user_name) && /* @__PURE__ */ e.jsx("div", { className: "iw-absolute iw-bottom-4 iw-right-4 iw-inline-flex iw-items-center iw-gap-2 iw-rounded-lg iw-border iw-border-white/10 iw-bg-black/40 iw-px-4 iw-py-2 iw-backdrop-blur-md", children: /* @__PURE__ */ e.jsx("span", { className: "iw-font-medium iw-text-white", children: t.data.user_name }) })
2094
2095
  ] });
2095
- }, Ot = ({
2096
+ }, Ut = ({
2096
2097
  question: i,
2097
2098
  isLoading: r = !1
2098
2099
  }) => {
@@ -2101,7 +2102,7 @@ const he = new At(), Mt = (i = {}) => {
2101
2102
  "div",
2102
2103
  {
2103
2104
  className: "iw-rounded-xl iw-mb-4 message-animation iw-text-gray-800 iw-p-6 ",
2104
- style: ct(t, 0.85),
2105
+ style: dt(t, 0.85),
2105
2106
  children: /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-gap-8", children: [
2106
2107
  /* @__PURE__ */ e.jsx("div", { className: "iw-flex iw-flex-col iw-items-center iw-relative iw-h-32 iw-w-32 iw-shrink-0 iw-shadow iw-rounded-lg iw-bg-white", children: /* @__PURE__ */ e.jsx("div", { className: "iw-mt-2", children: /* @__PURE__ */ e.jsx(
2107
2108
  "img",
@@ -2118,7 +2119,7 @@ const he = new At(), Mt = (i = {}) => {
2118
2119
  ] })
2119
2120
  }
2120
2121
  );
2121
- }, ke = ({
2122
+ }, Ee = ({
2122
2123
  currentQuestion: i,
2123
2124
  phase: r,
2124
2125
  className: t = "",
@@ -2129,19 +2130,19 @@ const he = new At(), Mt = (i = {}) => {
2129
2130
  className: `iw-p-4 iw-space-y-4 iw-pb-6 ${t} iw-min-h-[calc(100vh_-_3.8rem)] iw-flex iw-flex-col iw-justify-between`,
2130
2131
  children: [
2131
2132
  /* @__PURE__ */ e.jsx("div", { className: "iw-flex iw-items-start iw-justify-between iw-gap-3", children: /* @__PURE__ */ e.jsx("div", { className: "iw-flex-1", children: /* @__PURE__ */ e.jsx(
2132
- Ot,
2133
+ Ut,
2133
2134
  {
2134
2135
  question: i,
2135
2136
  isLoading: r === D.FETCHING_QUESTION || r === D.IDLE
2136
2137
  }
2137
2138
  ) }) }),
2138
2139
  /* @__PURE__ */ e.jsxs("div", { className: "iw iw-bg-[#F6F6F6] iw-grid iw-grid-cols-2 iw-rounded-[14px] iw-p-6", children: [
2139
- /* @__PURE__ */ e.jsx("div", { className: "iw-min-h-[400px] iw-max-h-[600px]", children: /* @__PURE__ */ e.jsx($t, {}) }),
2140
+ /* @__PURE__ */ e.jsx("div", { className: "iw-min-h-[400px] iw-max-h-[600px]", children: /* @__PURE__ */ e.jsx(Ot, {}) }),
2140
2141
  /* @__PURE__ */ e.jsx("div", { className: "iw-bg-white iw-rounded-r-xl iw-shadow iw-p-6", children: s })
2141
2142
  ] })
2142
2143
  ]
2143
2144
  }
2144
- ), Ue = ({
2145
+ ), qe = ({
2145
2146
  isOpen: i,
2146
2147
  onClose: r,
2147
2148
  children: t,
@@ -2219,13 +2220,13 @@ const he = new At(), Mt = (i = {}) => {
2219
2220
  }
2220
2221
  )
2221
2222
  ] });
2222
- return Ve(d, document.body);
2223
- }, Ut = ({
2223
+ return ze(d, document.body);
2224
+ }, qt = ({
2224
2225
  confirmExitInterview: i,
2225
2226
  isOpen: r,
2226
2227
  onClose: t
2227
2228
  }) => /* @__PURE__ */ e.jsx(
2228
- Ue,
2229
+ qe,
2229
2230
  {
2230
2231
  isOpen: r,
2231
2232
  onClose: t,
@@ -2263,7 +2264,7 @@ const he = new At(), Mt = (i = {}) => {
2263
2264
  ] })
2264
2265
  ] })
2265
2266
  }
2266
- ), Ee = ({ title: i, onExit: r }) => {
2267
+ ), Te = ({ title: i, onExit: r }) => {
2267
2268
  const { baseColor: t } = te(), [s, n] = k(!1);
2268
2269
  return /* @__PURE__ */ e.jsxs("header", { className: "iw-w-full iw-text-gray-900", children: [
2269
2270
  /* @__PURE__ */ e.jsxs("div", { className: "iw-mx-auto iw-flex iw-items-center iw-justify-between iw-px-4 iw-pb-4 iw-pt-2", children: [
@@ -2293,7 +2294,7 @@ const he = new At(), Mt = (i = {}) => {
2293
2294
  ] }),
2294
2295
  /* @__PURE__ */ e.jsx("div", { className: "iw-h-px iw-bg-gray-200" }),
2295
2296
  /* @__PURE__ */ e.jsx(
2296
- Ut,
2297
+ qt,
2297
2298
  {
2298
2299
  isOpen: s,
2299
2300
  confirmExitInterview: () => {
@@ -2303,7 +2304,7 @@ const he = new At(), Mt = (i = {}) => {
2303
2304
  }
2304
2305
  )
2305
2306
  ] });
2306
- }, qt = ({
2307
+ }, Bt = ({
2307
2308
  className: i = "",
2308
2309
  width: r,
2309
2310
  height: t = 56,
@@ -2317,13 +2318,13 @@ const he = new At(), Mt = (i = {}) => {
2317
2318
  const { baseColor: d } = te(), u = E(null), h = E(null), m = E(null), c = E(null), x = E(null), b = E(null), j = E(!1), [g, v] = k(null);
2318
2319
  C(() => {
2319
2320
  if (r || !h.current) return;
2320
- const N = h.current, _ = () => {
2321
+ const N = h.current, P = () => {
2321
2322
  const R = u.current;
2322
2323
  if (!R) return;
2323
2324
  const A = N.clientWidth, f = t;
2324
2325
  R.width = Math.max(1, Math.floor(A * window.devicePixelRatio || 1)), R.height = Math.max(1, Math.floor(f * window.devicePixelRatio || 1));
2325
- }, y = new ResizeObserver(_);
2326
- return y.observe(N), _(), () => y.disconnect();
2326
+ }, y = new ResizeObserver(P);
2327
+ return y.observe(N), P(), () => y.disconnect();
2327
2328
  }, [r, t]), C(() => {
2328
2329
  if (!r) return;
2329
2330
  const N = u.current;
@@ -2371,18 +2372,18 @@ const he = new At(), Mt = (i = {}) => {
2371
2372
  };
2372
2373
  }, [l, o, a, w]);
2373
2374
  const S = () => {
2374
- const N = u.current, _ = c.current;
2375
- if (!N || !_) return;
2375
+ const N = u.current, P = c.current;
2376
+ if (!N || !P) return;
2376
2377
  const y = N.getContext("2d");
2377
2378
  if (!y) return;
2378
- const R = window.devicePixelRatio || 1, A = N.width, f = N.height, M = _.frequencyBinCount, L = new Uint8Array(M), O = () => {
2379
- b.current = requestAnimationFrame(O), _.getByteTimeDomainData(L), y.clearRect(0, 0, A, f), y.fillStyle = "rgba(0,0,0,0)", y.fillRect(0, 0, A, f);
2379
+ const R = window.devicePixelRatio || 1, A = N.width, f = N.height, M = P.frequencyBinCount, L = new Uint8Array(M), O = () => {
2380
+ b.current = requestAnimationFrame(O), P.getByteTimeDomainData(L), y.clearRect(0, 0, A, f), y.fillStyle = "rgba(0,0,0,0)", y.fillRect(0, 0, A, f);
2380
2381
  const q = Math.max(1, Math.floor(s * R)), z = Math.max(1, Math.floor(n * R)), H = q + z, Y = Math.max(8, Math.floor((A + z) / H)), B = Math.floor(L.length / Y);
2381
2382
  for (let U = 0; U < Y; U++) {
2382
- const P = Math.min(L.length - 1, U * B), Q = L[P] / 128 - 1, W = Math.abs(Q), ce = Math.pow(W, 0.6), K = Math.max(f * 0.06, ce * (f * 0.9)), de = U * H, we = (f - K) / 2, ue = 140 - Math.min(140, 140 * W), J = 85, ie = 48 + Math.floor(12 * (1 - W));
2383
+ const _ = Math.min(L.length - 1, U * B), Q = L[_] / 128 - 1, W = Math.abs(Q), ce = Math.pow(W, 0.6), K = Math.max(f * 0.06, ce * (f * 0.9)), de = U * H, we = (f - K) / 2, ue = 140 - Math.min(140, 140 * W), J = 85, ie = 48 + Math.floor(12 * (1 - W));
2383
2384
  y.fillStyle = `${d}`, y.shadowColor = `hsla(${ue}, ${J}%, ${ie}%, ${0.25 * W})`, y.shadowBlur = 8 * W;
2384
2385
  const p = Math.min(q / 2, K / 2);
2385
- Bt(y, de, we, q, K, p), y.fill();
2386
+ Wt(y, de, we, q, K, p), y.fill();
2386
2387
  }
2387
2388
  };
2388
2389
  O();
@@ -2400,11 +2401,11 @@ const he = new At(), Mt = (i = {}) => {
2400
2401
  }
2401
2402
  );
2402
2403
  };
2403
- function Bt(i, r, t, s, n, o) {
2404
+ function Wt(i, r, t, s, n, o) {
2404
2405
  const a = Math.min(o, s / 2, n / 2);
2405
2406
  i.beginPath(), i.moveTo(r + a, t), i.lineTo(r + s - a, t), i.quadraticCurveTo(r + s, t, r + s, t + a), i.lineTo(r + s, t + n - a), i.quadraticCurveTo(r + s, t + n, r + s - a, t + n), i.lineTo(r + a, t + n), i.quadraticCurveTo(r, t + n, r, t + n - a), i.lineTo(r, t + a), i.quadraticCurveTo(r, t, r + a, t), i.closePath();
2406
2407
  }
2407
- const Wt = ({
2408
+ const Gt = ({
2408
2409
  state: i,
2409
2410
  answeringTime: r,
2410
2411
  nextPhase: t,
@@ -2415,11 +2416,11 @@ const Wt = ({
2415
2416
  /* @__PURE__ */ e.jsx("h3", { className: "iw-text-lg iw-font-semibold iw-text-gray-900 iw-mb-1", children: "You may start speaking now. We're listening...." }),
2416
2417
  /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-justify-center iw-gap-2", children: [
2417
2418
  /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-gap-1", children: [
2418
- /* @__PURE__ */ e.jsx(ye, { className: "iw-size-4 iw-text-orange-600" }),
2419
+ /* @__PURE__ */ e.jsx(ve, { className: "iw-size-4 iw-text-orange-600" }),
2419
2420
  /* @__PURE__ */ e.jsx("p", { className: "iw-text-gray-700 iw-text-sm", children: "Time to talk: " })
2420
2421
  ] }),
2421
2422
  /* @__PURE__ */ e.jsx(
2422
- ve,
2423
+ je,
2423
2424
  {
2424
2425
  total: r,
2425
2426
  remaining: i.currentPhaseTimeRemaining,
@@ -2432,7 +2433,7 @@ const Wt = ({
2432
2433
  /* @__PURE__ */ e.jsx("p", { className: "iw-max-w-lg iw-text-gray-500 iw-text-xs iw-leading-[21px]", children: "Done talking? Click the button to review your answer." })
2433
2434
  ] }),
2434
2435
  /* @__PURE__ */ e.jsxs("div", { children: [
2435
- /* @__PURE__ */ e.jsx(qt, {}),
2436
+ /* @__PURE__ */ e.jsx(Bt, {}),
2436
2437
  s && /* @__PURE__ */ e.jsxs("div", { className: "iw-mt-2 iw-text-xs iw-text-red-600", children: [
2437
2438
  "Recording error: ",
2438
2439
  s.message
@@ -2448,7 +2449,7 @@ const Wt = ({
2448
2449
  }
2449
2450
  ) })
2450
2451
  ] });
2451
- function Gt() {
2452
+ function Vt() {
2452
2453
  const [i, r] = k(!0), t = ee(
2453
2454
  () => [0, 1, 2].map((s) => ({ id: s })),
2454
2455
  []
@@ -2486,7 +2487,7 @@ function Gt() {
2486
2487
  /* @__PURE__ */ e.jsx("div", { className: "iw-text-center", children: /* @__PURE__ */ e.jsx("p", { className: "iw-text-gray-500 iw-font-medium", children: "Preparing your question..." }) })
2487
2488
  ] });
2488
2489
  }
2489
- const Vt = ({
2490
+ const zt = ({
2490
2491
  size: i = "192px",
2491
2492
  className: r,
2492
2493
  colors: t,
@@ -2628,9 +2629,9 @@ const Vt = ({
2628
2629
  }
2629
2630
  );
2630
2631
  };
2631
- function zt({ ttsError: i }) {
2632
+ function Ht({ ttsError: i }) {
2632
2633
  return /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-flex-col iw-items-center iw-justify-center iw-gap-8 iw-w-full iw-h-full", children: [
2633
- /* @__PURE__ */ e.jsx(Vt, { size: "80px" }),
2634
+ /* @__PURE__ */ e.jsx(zt, { size: "80px" }),
2634
2635
  i && /* @__PURE__ */ e.jsxs("div", { className: "iw-mt-2 iw-text-xs iw-text-red-600", children: [
2635
2636
  "Audio playback failed: ",
2636
2637
  i.message
@@ -2638,18 +2639,18 @@ function zt({ ttsError: i }) {
2638
2639
  /* @__PURE__ */ e.jsx("p", { className: "iw-text- iw-text-gray-700", children: "Your AI interviewer is speaking..." })
2639
2640
  ] });
2640
2641
  }
2641
- const Ht = ({ state: i, thinkingTime: r, nextPhase: t }) => /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-flex-col iw-gap-6 iw-items-center iw-justify-center iw-text-center iw-h-full ", children: [
2642
+ const Yt = ({ state: i, thinkingTime: r, nextPhase: t }) => /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-flex-col iw-gap-6 iw-items-center iw-justify-center iw-text-center iw-h-full ", children: [
2642
2643
  /* @__PURE__ */ e.jsxs("div", { children: [
2643
2644
  /* @__PURE__ */ e.jsx("h3", { className: "iw-text-lg iw-font-semibold iw-text-gray-900 iw-mb-1", children: "Get Ready to Answer" }),
2644
2645
  /* @__PURE__ */ e.jsx("p", { className: "iw-max-w-lg iw-text-gray-500 iw-text-xs iw-leading-[21px]", children: "After 30-seconds thinking time, recording will start automatically, or you can begin recording early by clicking the button below." })
2645
2646
  ] }),
2646
2647
  /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-justify-center iw-gap-2", children: [
2647
2648
  /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-gap-1", children: [
2648
- /* @__PURE__ */ e.jsx(ye, { className: "iw-size-4 iw-text-orange-600" }),
2649
+ /* @__PURE__ */ e.jsx(ve, { className: "iw-size-4 iw-text-orange-600" }),
2649
2650
  /* @__PURE__ */ e.jsx("p", { className: "iw-text-gray-700 iw-text-sm", children: "Time to think: " })
2650
2651
  ] }),
2651
2652
  /* @__PURE__ */ e.jsx(
2652
- ve,
2653
+ je,
2653
2654
  {
2654
2655
  total: r,
2655
2656
  remaining: i.currentPhaseTimeRemaining,
@@ -2667,7 +2668,7 @@ const Ht = ({ state: i, thinkingTime: r, nextPhase: t }) => /* @__PURE__ */ e.js
2667
2668
  children: "Start Answering"
2668
2669
  }
2669
2670
  ) })
2670
- ] }), Yt = ({ sttError: i }) => /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-flex-col iw-items-center iw-justify-center iw-h-full", children: [
2671
+ ] }), Qt = ({ sttError: i }) => /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-flex-col iw-items-center iw-justify-center iw-h-full", children: [
2671
2672
  /* @__PURE__ */ e.jsxs("svg", { width: "48", height: "48", viewBox: "0 0 60 60", fill: "none", children: [
2672
2673
  /* @__PURE__ */ e.jsx(
2673
2674
  "rect",
@@ -2727,7 +2728,7 @@ const Ht = ({ state: i, thinkingTime: r, nextPhase: t }) => /* @__PURE__ */ e.js
2727
2728
  /* @__PURE__ */ e.jsx("path", { d: "M12 17h.01" })
2728
2729
  ]
2729
2730
  }
2730
- ), Qt = (i) => /* @__PURE__ */ e.jsxs(
2731
+ ), Kt = (i) => /* @__PURE__ */ e.jsxs(
2731
2732
  "svg",
2732
2733
  {
2733
2734
  xmlns: "http://www.w3.org/2000/svg",
@@ -2745,7 +2746,7 @@ const Ht = ({ state: i, thinkingTime: r, nextPhase: t }) => /* @__PURE__ */ e.js
2745
2746
  /* @__PURE__ */ e.jsx("circle", { cx: "12", cy: "12", r: "10" })
2746
2747
  ]
2747
2748
  }
2748
- ), Kt = (i) => /* @__PURE__ */ e.jsxs(
2749
+ ), Jt = (i) => /* @__PURE__ */ e.jsxs(
2749
2750
  "svg",
2750
2751
  {
2751
2752
  xmlns: "http://www.w3.org/2000/svg",
@@ -2763,7 +2764,7 @@ const Ht = ({ state: i, thinkingTime: r, nextPhase: t }) => /* @__PURE__ */ e.js
2763
2764
  /* @__PURE__ */ e.jsx("circle", { cx: "12", cy: "12", r: "3" })
2764
2765
  ]
2765
2766
  }
2766
- ), Jt = (i) => /* @__PURE__ */ e.jsxs(
2767
+ ), Xt = (i) => /* @__PURE__ */ e.jsxs(
2767
2768
  "svg",
2768
2769
  {
2769
2770
  xmlns: "http://www.w3.org/2000/svg",
@@ -2784,7 +2785,7 @@ const Ht = ({ state: i, thinkingTime: r, nextPhase: t }) => /* @__PURE__ */ e.js
2784
2785
  /* @__PURE__ */ e.jsx("path", { d: "M7 21H5a2 2 0 0 1-2-2v-2" })
2785
2786
  ]
2786
2787
  }
2787
- ), me = (i) => /* @__PURE__ */ e.jsxs(
2788
+ ), ge = (i) => /* @__PURE__ */ e.jsxs(
2788
2789
  "svg",
2789
2790
  {
2790
2791
  xmlns: "http://www.w3.org/2000/svg",
@@ -2805,7 +2806,7 @@ const Ht = ({ state: i, thinkingTime: r, nextPhase: t }) => /* @__PURE__ */ e.js
2805
2806
  /* @__PURE__ */ e.jsx("path", { d: "M7 21H5a2 2 0 0 1-2-2v-2" })
2806
2807
  ]
2807
2808
  }
2808
- ), Xt = (i) => /* @__PURE__ */ e.jsxs(
2809
+ ), Zt = (i) => /* @__PURE__ */ e.jsxs(
2809
2810
  "svg",
2810
2811
  {
2811
2812
  xmlns: "http://www.w3.org/2000/svg",
@@ -2827,7 +2828,7 @@ const Ht = ({ state: i, thinkingTime: r, nextPhase: t }) => /* @__PURE__ */ e.js
2827
2828
  ]
2828
2829
  }
2829
2830
  ), re = 5;
2830
- function Zt({
2831
+ function ei({
2831
2832
  isOpen: i,
2832
2833
  onClose: r,
2833
2834
  warningCount: t,
@@ -2854,43 +2855,43 @@ function Zt({
2854
2855
  return {
2855
2856
  title: "Tab Switch Detected",
2856
2857
  description: "You attempted to switch to another tab or reload application.",
2857
- icon: /* @__PURE__ */ e.jsx(Kt, { className: "iw-h-5 iw-w-5" })
2858
+ icon: /* @__PURE__ */ e.jsx(Jt, { className: "iw-h-5 iw-w-5" })
2858
2859
  };
2859
2860
  case "fullscreen_exit":
2860
2861
  return {
2861
2862
  title: "Full Screen Exit Detected",
2862
2863
  description: "You attempted to exit full screen mode.",
2863
- icon: /* @__PURE__ */ e.jsx(Oe, { className: "iw-h-5 iw-w-5" })
2864
+ icon: /* @__PURE__ */ e.jsx(Ue, { className: "iw-h-5 iw-w-5" })
2864
2865
  };
2865
2866
  case "focus_loss":
2866
2867
  return {
2867
2868
  title: "Focus Loss Detected",
2868
2869
  description: "You lost focus from the interview window.",
2869
- icon: /* @__PURE__ */ e.jsx(Jt, { className: "iw-h-5 iw-w-5" })
2870
+ icon: /* @__PURE__ */ e.jsx(Xt, { className: "iw-h-5 iw-w-5" })
2870
2871
  };
2871
2872
  case "blocked_shortcut":
2872
2873
  return {
2873
2874
  title: "Keyboard Shortcut Blocked",
2874
2875
  description: "You attempted to use a blocked keyboard shortcut.",
2875
- icon: /* @__PURE__ */ e.jsx(me, { className: "iw-h-5 iw-w-5" })
2876
+ icon: /* @__PURE__ */ e.jsx(ge, { className: "iw-h-5 iw-w-5" })
2876
2877
  };
2877
2878
  case "right_click_attempt":
2878
2879
  return {
2879
2880
  title: "Right Click Attempted",
2880
2881
  description: "You attempted to use the right click.",
2881
- icon: /* @__PURE__ */ e.jsx(Xt, { className: "iw-h-5 iw-w-5" })
2882
+ icon: /* @__PURE__ */ e.jsx(Zt, { className: "iw-h-5 iw-w-5" })
2882
2883
  };
2883
2884
  case "alt_tab_attempt":
2884
2885
  return {
2885
2886
  title: "Alt + Tab Attempted",
2886
2887
  description: "You attempted to use the Alt + Tab shortcut.",
2887
- icon: /* @__PURE__ */ e.jsx(me, { className: "iw-h-5 iw-w-5" })
2888
+ icon: /* @__PURE__ */ e.jsx(ge, { className: "iw-h-5 iw-w-5" })
2888
2889
  };
2889
2890
  case "blocked_function_key":
2890
2891
  return {
2891
2892
  title: "Function Key Blocked",
2892
2893
  description: "You attempted to use a blocked function key.",
2893
- icon: /* @__PURE__ */ e.jsx(me, { className: "iw-h-5 iw-w-5" })
2894
+ icon: /* @__PURE__ */ e.jsx(ge, { className: "iw-h-5 iw-w-5" })
2894
2895
  };
2895
2896
  default:
2896
2897
  return {
@@ -2941,7 +2942,7 @@ function Zt({
2941
2942
  /* @__PURE__ */ e.jsx("h3", { className: "iw-mb-2 iw-font-semibold iw-text-gray-900", children: d.title }),
2942
2943
  /* @__PURE__ */ e.jsx("p", { className: "iw-text-sm iw-leading-relaxed iw-text-gray-700", children: d.description }),
2943
2944
  /* @__PURE__ */ e.jsxs("div", { className: "iw-mt-3 iw-flex iw-items-center iw-gap-2 iw-text-xs iw-text-red-600", children: [
2944
- /* @__PURE__ */ e.jsx($e, { className: "iw-h-3 iw-w-3" }),
2945
+ /* @__PURE__ */ e.jsx(Oe, { className: "iw-h-3 iw-w-3" }),
2945
2946
  /* @__PURE__ */ e.jsx("span", { children: "This action is monitored for interview integrity" })
2946
2947
  ] })
2947
2948
  ] })
@@ -2955,7 +2956,7 @@ function Zt({
2955
2956
  ] }) }),
2956
2957
  /* @__PURE__ */ e.jsx("div", { className: "iw-border-primary-100 iw-bg-primary-50 iw-rounded-xl iw-border iw-p-4", children: /* @__PURE__ */ e.jsxs("div", { className: "iw-text-center", children: [
2957
2958
  /* @__PURE__ */ e.jsxs("div", { className: "iw-mb-1 iw-flex iw-items-center iw-justify-center iw-gap-1.5", children: [
2958
- /* @__PURE__ */ e.jsx(Qt, { className: "iw-text-primary-600 iw-h-4 iw-w-4" }),
2959
+ /* @__PURE__ */ e.jsx(Kt, { className: "iw-text-primary-600 iw-h-4 iw-w-4" }),
2959
2960
  /* @__PURE__ */ e.jsx("span", { className: "iw-text-primary-600 iw-text-2xl iw-font-bold", children: o })
2960
2961
  ] }),
2961
2962
  /* @__PURE__ */ e.jsx("div", { className: "iw-text-primary-700 iw-text-xs iw-font-medium", children: "Auto Close" })
@@ -2991,7 +2992,7 @@ function Zt({
2991
2992
  ] })
2992
2993
  ] }) });
2993
2994
  }
2994
- const ei = (i) => /* @__PURE__ */ e.jsxs(
2995
+ const ti = (i) => /* @__PURE__ */ e.jsxs(
2995
2996
  "svg",
2996
2997
  {
2997
2998
  xmlns: "http://www.w3.org/2000/svg",
@@ -3009,7 +3010,7 @@ const ei = (i) => /* @__PURE__ */ e.jsxs(
3009
3010
  /* @__PURE__ */ e.jsx("circle", { cx: "12", cy: "12", r: "10" })
3010
3011
  ]
3011
3012
  }
3012
- ), ti = ({
3013
+ ), ii = ({
3013
3014
  showHardReloadWarning: i,
3014
3015
  onContinue: r
3015
3016
  }) => {
@@ -3017,7 +3018,7 @@ const ei = (i) => /* @__PURE__ */ e.jsxs(
3017
3018
  r();
3018
3019
  };
3019
3020
  return /* @__PURE__ */ e.jsxs(
3020
- Ue,
3021
+ qe,
3021
3022
  {
3022
3023
  isOpen: i,
3023
3024
  onClose: t,
@@ -3038,7 +3039,7 @@ const ei = (i) => /* @__PURE__ */ e.jsxs(
3038
3039
  onClick: t,
3039
3040
  className: "iw-w-full iw-flex iw-items-center iw-justify-center iw-gap-2 iw-px-4 iw-py-3 iw-bg-gray-100 iw-text-gray-600 iw-rounded-md iw-font-medium iw-transition-colors hover:iw-bg-gray-200 focus:iw-outline-none focus:iw-ring-2 focus:iw-ring-gray-400 focus:iw-ring-offset-2",
3040
3041
  children: [
3041
- /* @__PURE__ */ e.jsx(ei, { className: "iw-size-4" }),
3042
+ /* @__PURE__ */ e.jsx(ti, { className: "iw-size-4" }),
3042
3043
  "Continue Session"
3043
3044
  ]
3044
3045
  }
@@ -3046,14 +3047,14 @@ const ei = (i) => /* @__PURE__ */ e.jsxs(
3046
3047
  ]
3047
3048
  }
3048
3049
  );
3049
- }, ii = We(
3050
+ }, ri = Ge(
3050
3051
  ({ children: i, onDisqualify: r }, t) => {
3051
- const [s, n] = k(!1), [o, a] = k(!1), [l, w] = k(!1), [d, u] = k("fullscreen_exit"), { logViolation: h, violationCount: m } = Dt({
3052
+ const [s, n] = k(!1), [o, a] = k(!1), [l, w] = k(!1), [d, u] = k("fullscreen_exit"), { logViolation: h, violationCount: m } = Pt({
3052
3053
  maxViolations: 5,
3053
3054
  onViolation: (g) => {
3054
3055
  o || (n(!0), u(g.type));
3055
3056
  }
3056
- }), { enterFullScreen: c, isFullScreen: x, exitFullScreen: b } = vt({
3057
+ }), { enterFullScreen: c, isFullScreen: x, exitFullScreen: b } = jt({
3057
3058
  onFullScreenChange(g) {
3058
3059
  !g && !o && !l && (n(!0), h({
3059
3060
  type: "fullscreen_exit",
@@ -3067,7 +3068,7 @@ const ei = (i) => /* @__PURE__ */ e.jsxs(
3067
3068
  });
3068
3069
  C(() => {
3069
3070
  c();
3070
- }, []), Ge(
3071
+ }, []), Ve(
3071
3072
  t,
3072
3073
  () => ({
3073
3074
  exitFullScreenIntentionally: async () => {
@@ -3080,14 +3081,14 @@ const ei = (i) => /* @__PURE__ */ e.jsxs(
3080
3081
  }
3081
3082
  }),
3082
3083
  []
3083
- ), It(h), Tt(h), Rt(), _t();
3084
+ ), Rt(h), Ct(h), At(), _t();
3084
3085
  const j = () => {
3085
3086
  a(!0), b(), n(!1), r == null || r();
3086
3087
  };
3087
3088
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
3088
3089
  /* @__PURE__ */ e.jsx("div", { className: "iw-relative iw-h-full iw-w-full", children: i }),
3089
3090
  /* @__PURE__ */ e.jsx(
3090
- Zt,
3091
+ ei,
3091
3092
  {
3092
3093
  warningCount: m,
3093
3094
  isOpen: s,
@@ -3098,8 +3099,8 @@ const ei = (i) => /* @__PURE__ */ e.jsxs(
3098
3099
  onDisqualify: j
3099
3100
  }
3100
3101
  ),
3101
- !s && m > 0 && !o && /* @__PURE__ */ e.jsx(
3102
- ti,
3102
+ !s && m > 0 && !o && !l && /* @__PURE__ */ e.jsx(
3103
+ ii,
3103
3104
  {
3104
3105
  showHardReloadWarning: !x,
3105
3106
  logViolation: h,
@@ -3108,18 +3109,18 @@ const ei = (i) => /* @__PURE__ */ e.jsxs(
3108
3109
  )
3109
3110
  ] });
3110
3111
  }
3111
- ), ri = ({
3112
+ ), si = ({
3112
3113
  interviewTitle: i,
3113
3114
  interviewId: r,
3114
3115
  onComplete: t,
3115
3116
  onDisqualify: s,
3116
3117
  className: n = ""
3117
3118
  }) => {
3118
- const o = Et(), { baseUrl: a, authToken: l } = De(), { timers: w, stt: d, tts: u, proctoring: h } = at(), m = E(null), [c, x] = k(null), [b, j] = k(""), g = E(""), v = E(null), S = {
3119
+ const o = Tt(), { baseUrl: a, authToken: l } = Pe(), { timers: w, stt: d, tts: u, proctoring: h } = ot(), m = E(null), [c, x] = k(null), [b, j] = k(""), g = E(""), v = E(null), S = {
3119
3120
  thinkingTime: (w == null ? void 0 : w.thinkingDuration) || 30,
3120
3121
  answeringTime: (w == null ? void 0 : w.answeringDuration) || 120,
3121
3122
  editingTime: (w == null ? void 0 : w.editingDuration) || 30
3122
- }, { thinkingTime: N, answeringTime: _, editingTime: y } = S;
3123
+ }, { thinkingTime: N, answeringTime: P, editingTime: y } = S;
3123
3124
  C(() => {
3124
3125
  g.current = b;
3125
3126
  }, [b]);
@@ -3127,24 +3128,24 @@ const ei = (i) => /* @__PURE__ */ e.jsxs(
3127
3128
  speak: A,
3128
3129
  stop: f,
3129
3130
  error: M
3130
- } = Mt({
3131
+ } = Dt({
3131
3132
  config: {
3132
3133
  baseUrl: a,
3133
3134
  provider: u == null ? void 0 : u.provider,
3134
3135
  authToken: l
3135
3136
  },
3136
3137
  onEnd: () => {
3137
- R.current = !1, P();
3138
+ R.current = !1, _();
3138
3139
  },
3139
3140
  onError: () => {
3140
- R.current || (R.current = !0, P());
3141
+ R.current || (R.current = !0, _());
3141
3142
  }
3142
3143
  }), L = E(!1), O = E(!1), {
3143
3144
  startRecording: q,
3144
3145
  stopRecording: z,
3145
3146
  transcribe: H,
3146
3147
  error: Y
3147
- } = St({
3148
+ } = It({
3148
3149
  config: {
3149
3150
  baseUrl: a,
3150
3151
  provider: d == null ? void 0 : d.provider,
@@ -3158,15 +3159,15 @@ const ei = (i) => /* @__PURE__ */ e.jsxs(
3158
3159
  onStop: () => {
3159
3160
  },
3160
3161
  onTranscriptionComplete: (p) => {
3161
- j(p.transcript), O.current || (O.current = !0, P());
3162
+ j(p.transcript), O.current || (O.current = !0, _());
3162
3163
  },
3163
3164
  onError: (p) => {
3164
- console.error("STT Error:", p), L.current || (L.current = !0, P());
3165
+ console.error("STT Error:", p), L.current || (L.current = !0, _());
3165
3166
  }
3166
- }), { state: B, startQuestion: U, nextPhase: P, completeInterview: Q } = bt({
3167
+ }), { state: B, startQuestion: U, nextPhase: _, completeInterview: Q } = yt({
3167
3168
  config: {
3168
3169
  thinkingDuration: N,
3169
- answeringDuration: _,
3170
+ answeringDuration: P,
3170
3171
  editingDuration: y
3171
3172
  },
3172
3173
  callbacks: {
@@ -3197,7 +3198,7 @@ const ei = (i) => /* @__PURE__ */ e.jsxs(
3197
3198
  C(() => {
3198
3199
  U();
3199
3200
  }, []);
3200
- const { execute: W, loading: ce } = yt(
3201
+ const { execute: W, loading: ce } = vt(
3201
3202
  async () => {
3202
3203
  var G, X;
3203
3204
  const p = await o.generateQuestion({
@@ -3210,7 +3211,7 @@ const ei = (i) => /* @__PURE__ */ e.jsxs(
3210
3211
  },
3211
3212
  {
3212
3213
  onSuccess: async (p) => {
3213
- p && p.data && (j(""), x(p.data), P());
3214
+ p && p.data && (j(""), x(p.data), _());
3214
3215
  },
3215
3216
  onError: (p) => {
3216
3217
  console.error("Failed to fetch questions:", p);
@@ -3222,32 +3223,32 @@ const ei = (i) => /* @__PURE__ */ e.jsxs(
3222
3223
  var p;
3223
3224
  if ((p = v.current) != null && p.question)
3224
3225
  try {
3225
- R.current = !1, await A(v.current.question), v.current.is_interview_done && (await dt(2e3), Q());
3226
+ R.current = !1, await A(v.current.question), v.current.is_interview_done && (await wt(2e3), Q());
3226
3227
  } catch (G) {
3227
3228
  console.error("Failed to speak question:", G);
3228
3229
  }
3229
3230
  else
3230
- P();
3231
- }, [A, P, Q]), we = T(async () => {
3231
+ _();
3232
+ }, [A, _, Q]), we = T(async () => {
3232
3233
  try {
3233
- await q(_);
3234
+ await q(P);
3234
3235
  } catch (p) {
3235
- console.error("Failed to start recording:", p), P();
3236
+ console.error("Failed to start recording:", p), _();
3236
3237
  }
3237
- }, [q, P]), ue = T(async () => {
3238
+ }, [q, _]), ue = T(async () => {
3238
3239
  try {
3239
3240
  const p = await z();
3240
3241
  await H(p);
3241
3242
  } catch (p) {
3242
- console.error("STT processing failed:", p), !L.current && !O.current && (L.current = !0, P());
3243
+ console.error("STT processing failed:", p), !L.current && !O.current && (L.current = !0, _());
3243
3244
  }
3244
- }, [z, H, P]), J = T(
3245
+ }, [z, H, _]), J = T(
3245
3246
  async (p) => {
3246
3247
  var X;
3247
3248
  f(), await ((X = m.current) == null ? void 0 : X.exitFullScreenIntentionally()), (await o.generateQuestion({
3248
3249
  interviewId: r,
3249
3250
  isInterviewDone: !0
3250
- })).success && (p == null || p(), Q(), sessionStorage.removeItem(xe));
3251
+ })).success && (p == null || p(), Q(), sessionStorage.removeItem(pe));
3251
3252
  },
3252
3253
  [r, f, o]
3253
3254
  ), ie = () => {
@@ -3260,38 +3261,38 @@ const ei = (i) => /* @__PURE__ */ e.jsxs(
3260
3261
  /* @__PURE__ */ e.jsx(V, { onClick: U, className: "iw-mt-2 iw-w-40", children: "Start Interview" })
3261
3262
  ] });
3262
3263
  case D.FETCHING_QUESTION:
3263
- return /* @__PURE__ */ e.jsx(Gt, {});
3264
+ return /* @__PURE__ */ e.jsx(Vt, {});
3264
3265
  case D.READING_QUESTION:
3265
- return /* @__PURE__ */ e.jsx(zt, { ttsError: M });
3266
+ return /* @__PURE__ */ e.jsx(Ht, { ttsError: M });
3266
3267
  case D.THINKING:
3267
3268
  return /* @__PURE__ */ e.jsx(
3268
- Ht,
3269
+ Yt,
3269
3270
  {
3270
3271
  state: B,
3271
3272
  thinkingTime: N,
3272
- nextPhase: P
3273
+ nextPhase: _
3273
3274
  }
3274
3275
  );
3275
3276
  case D.ANSWERING:
3276
3277
  return /* @__PURE__ */ e.jsx(
3277
- Wt,
3278
+ Gt,
3278
3279
  {
3279
3280
  state: B,
3280
- answeringTime: _,
3281
- nextPhase: P,
3281
+ answeringTime: P,
3282
+ nextPhase: _,
3282
3283
  sttError: Y
3283
3284
  }
3284
3285
  );
3285
3286
  case D.TRANSCRIBING:
3286
- return /* @__PURE__ */ e.jsx(Yt, { sttError: Y });
3287
+ return /* @__PURE__ */ e.jsx(Qt, { sttError: Y });
3287
3288
  case D.EDITING:
3288
3289
  case D.SUBMITTING:
3289
3290
  return /* @__PURE__ */ e.jsx("div", { className: "iw-space-y-4 iw-h-full", children: /* @__PURE__ */ e.jsx(
3290
- Lt,
3291
+ $t,
3291
3292
  {
3292
3293
  value: b,
3293
3294
  onChange: (G) => j(G.target.value),
3294
- onSubmit: () => P(),
3295
+ onSubmit: () => _(),
3295
3296
  isSubmitDisabled: !b.trim() || ce,
3296
3297
  state: B,
3297
3298
  editingTime: y
@@ -3304,20 +3305,20 @@ const ei = (i) => /* @__PURE__ */ e.jsxs(
3304
3305
  }
3305
3306
  };
3306
3307
  return /* @__PURE__ */ e.jsx(e.Fragment, { children: h != null && h.enabled ? /* @__PURE__ */ e.jsxs(
3307
- ii,
3308
+ ri,
3308
3309
  {
3309
3310
  ref: m,
3310
3311
  onDisqualify: () => J(s),
3311
3312
  children: [
3312
3313
  /* @__PURE__ */ e.jsx(
3313
- Ee,
3314
+ Te,
3314
3315
  {
3315
3316
  title: i,
3316
3317
  onExit: () => J()
3317
3318
  }
3318
3319
  ),
3319
3320
  /* @__PURE__ */ e.jsx(
3320
- ke,
3321
+ Ee,
3321
3322
  {
3322
3323
  currentQuestion: c,
3323
3324
  phase: B.phase,
@@ -3329,14 +3330,14 @@ const ei = (i) => /* @__PURE__ */ e.jsxs(
3329
3330
  }
3330
3331
  ) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
3331
3332
  /* @__PURE__ */ e.jsx(
3332
- Ee,
3333
+ Te,
3333
3334
  {
3334
3335
  title: i,
3335
3336
  onExit: () => J()
3336
3337
  }
3337
3338
  ),
3338
3339
  /* @__PURE__ */ e.jsx(
3339
- ke,
3340
+ Ee,
3340
3341
  {
3341
3342
  currentQuestion: c,
3342
3343
  phase: B.phase,
@@ -3345,21 +3346,21 @@ const ei = (i) => /* @__PURE__ */ e.jsxs(
3345
3346
  }
3346
3347
  )
3347
3348
  ] }) });
3348
- }, si = ({
3349
+ }, ni = ({
3349
3350
  title: i,
3350
3351
  interviewId: r,
3351
3352
  onInterviewEnd: t,
3352
3353
  onInterviewDisqualify: s,
3353
3354
  className: n = ""
3354
3355
  }) => {
3355
- const [o, a] = ge.useState(!1), [l, w] = ge.useState(!0), d = E(null);
3356
+ const [o, a] = fe.useState(!1), [l, w] = fe.useState(!0), d = E(null);
3356
3357
  return o ? /* @__PURE__ */ e.jsx("div", { className: "interview-widget-container", children: /* @__PURE__ */ e.jsx(
3357
3358
  "div",
3358
3359
  {
3359
3360
  ref: d,
3360
3361
  className: `iw-flex iw-flex-col iw-rounded-xl iw-shadow-lg iw-overflow-hidden iw-h-[calc(100vh-1rem)] ${n}`,
3361
3362
  children: /* @__PURE__ */ e.jsx("div", { className: " iw-h-full iw-flex iw-flex-col", children: /* @__PURE__ */ e.jsx(
3362
- ri,
3363
+ si,
3363
3364
  {
3364
3365
  interviewTitle: i ?? "Interview",
3365
3366
  interviewId: r,
@@ -3371,7 +3372,7 @@ const ei = (i) => /* @__PURE__ */ e.jsxs(
3371
3372
  ) })
3372
3373
  }
3373
3374
  ) }) : /* @__PURE__ */ e.jsx("div", { className: "interview-widget-container", children: /* @__PURE__ */ e.jsx(
3374
- gt,
3375
+ ft,
3375
3376
  {
3376
3377
  isOpen: l,
3377
3378
  onStart: () => {
@@ -3381,11 +3382,11 @@ const ei = (i) => /* @__PURE__ */ e.jsxs(
3381
3382
  ) });
3382
3383
  };
3383
3384
  typeof window < "u" && (window.InterviewWidget = {
3384
- InterviewWidget: si,
3385
- InterviewWidgetProvider: nt
3385
+ InterviewWidget: ni,
3386
+ InterviewWidgetProvider: at
3386
3387
  });
3387
3388
  export {
3388
- si as InterviewWidget,
3389
- nt as InterviewWidgetProvider,
3390
- si as default
3389
+ ni as InterviewWidget,
3390
+ at as InterviewWidgetProvider,
3391
+ ni as default
3391
3392
  };