interview-widget 0.1.5 → 0.1.7

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
1
  var ve = Object.defineProperty;
2
- var je = (i, r, e) => r in i ? ve(i, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[r] = e;
3
- var D = (i, r, e) => je(i, typeof r != "symbol" ? r + "" : r, e);
4
- import ce, { createContext as Ne, useContext as Te, useRef as S, useState as T, useEffect as P, useCallback as A, useMemo as V } from "react";
2
+ var je = (r, i, e) => i in r ? ve(r, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[i] = e;
3
+ var D = (r, i, e) => je(r, typeof i != "symbol" ? i + "" : i, e);
4
+ import de, { createContext as Ne, useContext as Te, useRef as S, useState as k, useEffect as P, useCallback as A, useMemo as X } from "react";
5
5
  import { createPortal as ke } from "react-dom";
6
- var de = { exports: {} }, J = {};
6
+ var ue = { exports: {} }, Z = {};
7
7
  /**
8
8
  * @license React
9
9
  * react-jsx-runtime.production.js
@@ -14,27 +14,27 @@ var de = { exports: {} }, J = {};
14
14
  * LICENSE file in the root directory of this source tree.
15
15
  */
16
16
  var Ie = Symbol.for("react.transitional.element"), Ee = Symbol.for("react.fragment");
17
- function we(i, r, e) {
18
- var o = null;
19
- if (e !== void 0 && (o = "" + e), r.key !== void 0 && (o = "" + r.key), "key" in r) {
17
+ function he(r, i, e) {
18
+ var a = null;
19
+ if (e !== void 0 && (a = "" + e), i.key !== void 0 && (a = "" + i.key), "key" in i) {
20
20
  e = {};
21
- for (var s in r)
22
- s !== "key" && (e[s] = r[s]);
23
- } else e = r;
24
- return r = e.ref, {
21
+ for (var s in i)
22
+ s !== "key" && (e[s] = i[s]);
23
+ } else e = i;
24
+ return i = e.ref, {
25
25
  $$typeof: Ie,
26
- type: i,
27
- key: o,
28
- ref: r !== void 0 ? r : null,
26
+ type: r,
27
+ key: a,
28
+ ref: i !== void 0 ? i : null,
29
29
  props: e
30
30
  };
31
31
  }
32
- J.Fragment = Ee;
33
- J.jsx = we;
34
- J.jsxs = we;
35
- de.exports = J;
36
- var t = de.exports;
37
- const $ = {
32
+ Z.Fragment = Ee;
33
+ Z.jsx = he;
34
+ Z.jsxs = he;
35
+ ue.exports = Z;
36
+ var t = ue.exports;
37
+ const _ = {
38
38
  api: {
39
39
  baseUrl: "/api",
40
40
  retryConfig: {
@@ -62,66 +62,66 @@ const $ = {
62
62
  provider: "piper"
63
63
  }
64
64
  }
65
- }, ue = Ne(
65
+ }, me = Ne(
66
66
  null
67
67
  );
68
68
  function Re({
69
- config: i = {},
70
- children: r
69
+ config: r = {},
70
+ children: i
71
71
  }) {
72
- var o, s, c, a;
72
+ var a, s, c, o;
73
73
  const e = {
74
74
  api: {
75
- ...$.api,
76
- ...i.api,
75
+ ..._.api,
76
+ ...r.api,
77
77
  retryConfig: {
78
- ...$.api.retryConfig,
79
- ...(o = i.api) == null ? void 0 : o.retryConfig
78
+ ..._.api.retryConfig,
79
+ ...(a = r.api) == null ? void 0 : a.retryConfig
80
80
  }
81
81
  },
82
82
  ui: {
83
- ...$.ui,
84
- ...i.ui
83
+ ..._.ui,
84
+ ...r.ui
85
85
  },
86
86
  interview: {
87
- ...$.interview,
88
- ...i.interview,
87
+ ..._.interview,
88
+ ...r.interview,
89
89
  timers: {
90
- ...$.interview.timers,
91
- ...(s = i.interview) == null ? void 0 : s.timers
90
+ ..._.interview.timers,
91
+ ...(s = r.interview) == null ? void 0 : s.timers
92
92
  },
93
93
  stt: {
94
- ...$.interview.stt,
95
- ...(c = i.interview) == null ? void 0 : c.stt
94
+ ..._.interview.stt,
95
+ ...(c = r.interview) == null ? void 0 : c.stt
96
96
  },
97
97
  tts: {
98
- ...$.interview.tts,
99
- ...(a = i.interview) == null ? void 0 : a.tts
98
+ ..._.interview.tts,
99
+ ...(o = r.interview) == null ? void 0 : o.tts
100
100
  }
101
101
  }
102
102
  };
103
- return /* @__PURE__ */ t.jsx(ue.Provider, { value: e, children: r });
103
+ return /* @__PURE__ */ t.jsx(me.Provider, { value: e, children: i });
104
104
  }
105
- function X() {
106
- const i = Te(ue);
107
- if (!i)
105
+ function K() {
106
+ const r = Te(me);
107
+ if (!r)
108
108
  throw new Error(
109
109
  "useInterviewConfig must be used within an InterviewWidgetProvider. Wrap your component tree with <InterviewWidgetProvider config={...}>"
110
110
  );
111
- return i;
111
+ return r;
112
112
  }
113
113
  function Se() {
114
- return X().api || $.api;
114
+ return K().api || _.api;
115
115
  }
116
- function W() {
117
- return X().ui || $.ui;
116
+ function V() {
117
+ return K().ui || _.ui;
118
118
  }
119
119
  function Ce() {
120
- return X().interview || $.interview;
120
+ return K().interview || _.interview;
121
121
  }
122
- const he = ({
123
- className: i,
124
- ...r
122
+ const ge = ({
123
+ className: r,
124
+ ...i
125
125
  }) => /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsxs(
126
126
  "svg",
127
127
  {
@@ -134,8 +134,8 @@ const he = ({
134
134
  strokeWidth: "2",
135
135
  strokeLinecap: "round",
136
136
  strokeLinejoin: "round",
137
- className: `iw-animate-spin ${i}`,
138
- ...r,
137
+ className: `iw-animate-spin ${r}`,
138
+ ...i,
139
139
  children: [
140
140
  /* @__PURE__ */ t.jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
141
141
  /* @__PURE__ */ t.jsx("path", { d: "M12 6l0 -3" }),
@@ -148,73 +148,73 @@ const he = ({
148
148
  /* @__PURE__ */ t.jsx("path", { d: "M7.75 7.75l-2.15 -2.15" })
149
149
  ]
150
150
  }
151
- ) }), se = ({
152
- children: i,
153
- variant: r = "primary",
151
+ ) }), ne = ({
152
+ children: r,
153
+ variant: i = "primary",
154
154
  size: e = "md",
155
- fullWidth: o = !1,
155
+ fullWidth: a = !1,
156
156
  isLoading: s = !1,
157
157
  disabled: c,
158
- className: a = "",
158
+ className: o = "",
159
159
  ...n
160
160
  }) => {
161
- const w = "iw-inline-flex iw-items-center iw-justify-center iw-rounded-md iw-font-medium iw-transition-colors iw-focus:outline-none iw-focus:ring-2 iw-focus:ring-primary-500 iw-focus:ring-offset-2", m = {
161
+ const l = "iw-inline-flex iw-items-center iw-justify-center iw-rounded-md iw-font-medium iw-transition-colors iw-focus:outline-none iw-focus:ring-2 iw-focus:ring-primary-500 iw-focus:ring-offset-2", m = {
162
162
  primary: "iw-bg-primary-600 iw-text-white iw-hover:bg-primary-700 iw-border iw-border-transparent",
163
163
  secondary: "iw-bg-primary-100 iw-text-primary-700 iw-hover:bg-primary-200 iw-border iw-border-transparent",
164
164
  outline: "iw-bg-transparent iw-text-primary-700 iw-border iw-border-primary-500 iw-hover:bg-primary-50",
165
165
  text: "iw-bg-transparent iw-text-primary-600 iw-hover:bg-primary-50 iw-border iw-border-transparent",
166
166
  gradient: "iw-text-white iw-border iw-border-transparent iw-bg-gradient-to-r iw-from-purple-500 iw-to-indigo-500 hover:iw-from-purple-600 hover:iw-to-indigo-600"
167
- }, d = {
167
+ }, w = {
168
168
  sm: "iw-px-3 iw-py-1.5 iw-text-sm",
169
169
  md: "iw-px-4 iw-py-2.5 iw-text-sm",
170
170
  lg: "iw-px-5 iw-py-3 iw-text-base"
171
- }, h = "iw-disabled:opacity-50 iw-disabled:cursor-not-allowed iw-disabled:pointer-events-none", u = o ? "iw-w-full" : "";
171
+ }, h = "iw-disabled:opacity-50 iw-disabled:cursor-not-allowed iw-disabled:pointer-events-none", u = a ? "iw-w-full" : "";
172
172
  return /* @__PURE__ */ t.jsxs(
173
173
  "button",
174
174
  {
175
- className: `${w} ${m[r]} ${d[e]} ${u} ${h} ${a}`,
175
+ className: `${l} ${m[i]} ${w[e]} ${u} ${h} ${o}`,
176
176
  disabled: c || s,
177
177
  ...n,
178
178
  children: [
179
- s && /* @__PURE__ */ t.jsx(he, { height: 16, width: 16, style: { marginRight: "3px" } }),
180
- i
179
+ s && /* @__PURE__ */ t.jsx(ge, { height: 16, width: 16, style: { marginRight: "3px" } }),
180
+ r
181
181
  ]
182
182
  }
183
183
  );
184
184
  };
185
- function Me(i) {
186
- const r = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(i);
187
- return r ? {
188
- r: parseInt(r[1], 16),
189
- g: parseInt(r[2], 16),
190
- b: parseInt(r[3], 16)
185
+ function Me(r) {
186
+ const i = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r);
187
+ return i ? {
188
+ r: parseInt(i[1], 16),
189
+ g: parseInt(i[2], 16),
190
+ b: parseInt(i[3], 16)
191
191
  } : null;
192
192
  }
193
- function Ae(i, r, e) {
194
- return "#" + [i, r, e].map((o) => {
195
- const s = Math.round(o).toString(16);
193
+ function Ae(r, i, e) {
194
+ return "#" + [r, i, e].map((a) => {
195
+ const s = Math.round(a).toString(16);
196
196
  return s.length === 1 ? "0" + s : s;
197
197
  }).join("");
198
198
  }
199
- function me(i, r) {
200
- const e = Me(i);
201
- if (!e) return i;
202
- const o = e.r + (255 - e.r) * r, s = e.g + (255 - e.g) * r, c = e.b + (255 - e.b) * r;
203
- return Ae(o, s, c);
199
+ function fe(r, i) {
200
+ const e = Me(r);
201
+ if (!e) return r;
202
+ const a = e.r + (255 - e.r) * i, s = e.g + (255 - e.g) * i, c = e.b + (255 - e.b) * i;
203
+ return Ae(a, s, c);
204
204
  }
205
- function De(i, r = 0.8) {
205
+ function De(r, i = 0.8) {
206
206
  return {
207
- background: `linear-gradient(to bottom, ${me(i, r)}, #ffffff)`,
207
+ background: `linear-gradient(to bottom, ${fe(r, i)}, #ffffff)`,
208
208
  color: "#1f2937"
209
209
  };
210
210
  }
211
- function Pe(i) {
212
- return new Promise((r) => setTimeout(r, i));
211
+ function Pe(r) {
212
+ return new Promise((i) => setTimeout(i, r));
213
213
  }
214
- function ge(i) {
215
- return `linear-gradient(to left, ${me(i, 0.4)}, ${i})`;
214
+ function xe(r) {
215
+ return `linear-gradient(to left, ${fe(r, 0.4)}, ${r})`;
216
216
  }
217
- const $e = (i) => /* @__PURE__ */ t.jsxs(
217
+ const $e = (r) => /* @__PURE__ */ t.jsxs(
218
218
  "svg",
219
219
  {
220
220
  xmlns: "http://www.w3.org/2000/svg",
@@ -226,7 +226,7 @@ const $e = (i) => /* @__PURE__ */ t.jsxs(
226
226
  strokeWidth: "2",
227
227
  strokeLinecap: "round",
228
228
  strokeLinejoin: "round",
229
- ...i,
229
+ ...r,
230
230
  children: [
231
231
  /* @__PURE__ */ t.jsx("path", { d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z" }),
232
232
  /* @__PURE__ */ t.jsx("path", { d: "m9 12 2 2 4-4" })
@@ -240,40 +240,40 @@ const $e = (i) => /* @__PURE__ */ t.jsxs(
240
240
  "Do not disable or interfere with audio/video monitoring",
241
241
  "All activities are being recorded, and any violations may result in penalties, including disqualification"
242
242
  ], Le = ({
243
- isOpen: i,
244
- onStart: r,
243
+ isOpen: r,
244
+ onStart: i,
245
245
  onClose: e
246
246
  }) => {
247
- var j;
248
- const o = S(null), s = S(null), { baseColor: c, borderRadius: a } = W(), [n, w] = T(!1), [m, d] = T(null), [h, u] = T(!1), g = () => {
249
- s.current && (s.current.getTracks().forEach((l) => l.stop()), s.current = null);
250
- }, y = async () => {
251
- u(!0), d(null);
247
+ var I;
248
+ const a = S(null), s = S(null), { baseColor: c, borderRadius: o } = V(), [n, l] = k(!1), [m, w] = k(null), [h, u] = k(!1), g = () => {
249
+ s.current && (s.current.getTracks().forEach((d) => d.stop()), s.current = null);
250
+ }, j = async () => {
251
+ u(!0), w(null);
252
252
  try {
253
- const l = await navigator.mediaDevices.getUserMedia({
253
+ const d = await navigator.mediaDevices.getUserMedia({
254
254
  video: { width: { ideal: 1280 }, height: { ideal: 720 } },
255
255
  audio: !0
256
256
  });
257
- s.current = l, o.current && (o.current.srcObject = l), w(!0);
258
- } catch (l) {
259
- console.error("Media permission error:", l);
260
- let p = "Unable to access camera or microphone.";
261
- (l == null ? void 0 : l.name) === "NotAllowedError" ? p = "Permissions denied. Please allow access to camera and microphone." : (l == null ? void 0 : l.name) === "NotFoundError" ? p = "No camera/microphone found. Please connect a device and retry." : l != null && l.message && (p = l.message), w(!1), d(p);
257
+ s.current = d, a.current && (a.current.srcObject = d), l(!0);
258
+ } catch (d) {
259
+ console.error("Media permission error:", d);
260
+ let x = "Unable to access camera or microphone.";
261
+ (d == null ? void 0 : d.name) === "NotAllowedError" ? x = "Permissions denied. Please allow access to camera and microphone." : (d == null ? void 0 : d.name) === "NotFoundError" ? x = "No camera/microphone found. Please connect a device and retry." : d != null && d.message && (x = d.message), l(!1), w(x);
262
262
  } finally {
263
263
  u(!1);
264
264
  }
265
265
  };
266
266
  if (P(() => {
267
- if (!i) {
267
+ if (!r) {
268
268
  g();
269
269
  return;
270
270
  }
271
- return y(), () => {
271
+ return j(), () => {
272
272
  g();
273
273
  };
274
- }, [i]), !i) return null;
275
- const k = () => {
276
- r(), g();
274
+ }, [r]), !r) return null;
275
+ const y = () => {
276
+ i(), g();
277
277
  };
278
278
  return /* @__PURE__ */ t.jsx("div", { className: "iw-fixed iw-inset-0 iw-z-50 iw-flex iw-items-center iw-justify-center iw-bg-black/50 iw-backdrop-blur-sm", children: /* @__PURE__ */ t.jsxs("div", { className: "iw-bg-white iw-rounded-xl iw-shadow-2xl iw-w-full iw-max-w-[800px] iw-mx-4", children: [
279
279
  /* @__PURE__ */ t.jsxs("div", { className: "iw-px-5 iw-py-4 iw-border-b iw-border-gray-200 iw-flex iw-items-center iw-justify-between", children: [
@@ -295,7 +295,7 @@ const $e = (i) => /* @__PURE__ */ t.jsxs(
295
295
  /* @__PURE__ */ t.jsx("div", { className: "iw-border iw-border-gray-200 iw-rounded-lg iw-overflow-hidden iw-bg-gray-900", children: /* @__PURE__ */ t.jsx(
296
296
  "video",
297
297
  {
298
- ref: o,
298
+ ref: a,
299
299
  autoPlay: !0,
300
300
  playsInline: !0,
301
301
  muted: !0,
@@ -307,29 +307,29 @@ const $e = (i) => /* @__PURE__ */ t.jsxs(
307
307
  ) }),
308
308
  /* @__PURE__ */ t.jsxs("div", { className: "iw-grid iw-grid-cols-2 iw-gap-2 iw-mt-3", children: [
309
309
  /* @__PURE__ */ t.jsx(
310
- se,
310
+ ne,
311
311
  {
312
- onClick: y,
312
+ onClick: j,
313
313
  disabled: h,
314
314
  variant: "outline",
315
315
  size: "sm",
316
316
  style: {
317
317
  borderColor: c,
318
- borderRadius: a,
318
+ borderRadius: o,
319
319
  color: c
320
320
  },
321
321
  children: n ? "Recheck Permissions" : "Enable Camera & Mic"
322
322
  }
323
323
  ),
324
324
  /* @__PURE__ */ t.jsx(
325
- se,
325
+ ne,
326
326
  {
327
- onClick: k,
327
+ onClick: y,
328
328
  disabled: !n,
329
329
  size: "sm",
330
330
  style: {
331
- background: ge(c),
332
- borderRadius: a
331
+ background: xe(c),
332
+ borderRadius: o
333
333
  },
334
334
  children: "Start Interview"
335
335
  }
@@ -341,14 +341,14 @@ const $e = (i) => /* @__PURE__ */ t.jsxs(
341
341
  /* @__PURE__ */ t.jsx($e, {}),
342
342
  /* @__PURE__ */ t.jsx("h3", { children: "Interview Guidelines" })
343
343
  ] }),
344
- !((j = navigator.mediaDevices) != null && j.getUserMedia) && /* @__PURE__ */ t.jsx("div", { className: "iw-text-xs iw-text-red-600", children: "Your browser does not support media devices. Please use a modern browser like Chrome, Edge, or Firefox." }),
344
+ !((I = navigator.mediaDevices) != null && I.getUserMedia) && /* @__PURE__ */ t.jsx("div", { className: "iw-text-xs iw-text-red-600", children: "Your browser does not support media devices. Please use a modern browser like Chrome, Edge, or Firefox." }),
345
345
  m && /* @__PURE__ */ t.jsx("div", { className: "iw-text-xs iw-text-red-600", children: m }),
346
- /* @__PURE__ */ t.jsx("ul", { className: "iw-mt-1 iw-text-sm iw-text-gray-500 iw-list-disc iw-pl-4 iw-space-y-1.5", children: _e.map((l, p) => /* @__PURE__ */ t.jsx("li", { children: l }, p)) })
346
+ /* @__PURE__ */ t.jsx("ul", { className: "iw-mt-1 iw-text-sm iw-text-gray-500 iw-list-disc iw-pl-4 iw-space-y-1.5", children: _e.map((d, x) => /* @__PURE__ */ t.jsx("li", { children: d }, x)) })
347
347
  ] })
348
348
  ] })
349
349
  ] }) });
350
350
  };
351
- var R = /* @__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))(R || {});
351
+ var R = /* @__PURE__ */ ((r) => (r.IDLE = "idle", r.FETCHING_QUESTION = "fetching_question", r.READING_QUESTION = "reading_question", r.THINKING = "thinking", r.ANSWERING = "answering", r.TRANSCRIBING = "transcribing", r.EDITING = "editing", r.SUBMITTING = "submitting", r.COMPLETED = "completed", r))(R || {});
352
352
  const Oe = {
353
353
  thinkingDuration: 30,
354
354
  answeringDuration: 120,
@@ -383,13 +383,13 @@ const Oe = {
383
383
  }
384
384
  };
385
385
  class Ue {
386
- constructor(r = {}, e = {}) {
386
+ constructor(i = {}, e = {}) {
387
387
  D(this, "config");
388
388
  D(this, "state");
389
389
  D(this, "phaseIntervalId", null);
390
390
  D(this, "globalIntervalId", null);
391
391
  D(this, "callbacks");
392
- this.config = { ...Oe, ...r }, this.callbacks = e, this.state = {
392
+ this.config = { ...Oe, ...i }, this.callbacks = e, this.state = {
393
393
  phase: "idle",
394
394
  currentPhaseTimeRemaining: 0,
395
395
  totalTimeElapsed: 0,
@@ -412,18 +412,18 @@ class Ue {
412
412
  * Move to next phase
413
413
  */
414
414
  nextPhase() {
415
- const r = this.state.phase, e = Fe[r];
415
+ const i = this.state.phase, e = Fe[i];
416
416
  if (!e) return;
417
417
  this.stopPhaseTimer(), this.state.phase = e.next;
418
- const o = this.getDurationForPhase(e.next);
419
- o > 0 ? (this.state.currentPhaseTimeRemaining = o, this.startPhaseTimer()) : this.state.currentPhaseTimeRemaining = 0, this.notifyChange();
418
+ const a = this.getDurationForPhase(e.next);
419
+ a > 0 ? (this.state.currentPhaseTimeRemaining = a, this.startPhaseTimer()) : this.state.currentPhaseTimeRemaining = 0, this.notifyChange();
420
420
  }
421
421
  /**
422
422
  * Manually complete the interview
423
423
  */
424
424
  completeInterview() {
425
- var r, e;
426
- this.stopGlobalTimer(), this.stopPhaseTimer(), this.state.phase = "completed", (e = (r = this.callbacks).onInterviewEnd) == null || e.call(r), this.notifyChange();
425
+ var i, e, a, s;
426
+ (e = (i = this.callbacks).onComplete) == null || e.call(i), this.stopGlobalTimer(), this.stopPhaseTimer(), this.state.phase = "completed", (s = (a = this.callbacks).onInterviewEnd) == null || s.call(a), this.notifyChange();
427
427
  }
428
428
  /**
429
429
  * Cleanup
@@ -434,8 +434,8 @@ class Ue {
434
434
  /**
435
435
  * Get duration for a phase
436
436
  */
437
- getDurationForPhase(r) {
438
- switch (r) {
437
+ getDurationForPhase(i) {
438
+ switch (i) {
439
439
  case "thinking":
440
440
  return this.config.thinkingDuration;
441
441
  case "answering":
@@ -451,8 +451,8 @@ class Ue {
451
451
  */
452
452
  startGlobalTimer() {
453
453
  this.globalIntervalId = setInterval(() => {
454
- var r, e;
455
- this.state.totalTimeElapsed++, (e = (r = this.callbacks).onTick) == null || e.call(r, this.getState());
454
+ var i, e;
455
+ this.state.totalTimeElapsed++, (e = (i = this.callbacks).onTick) == null || e.call(i, this.getState());
456
456
  }, 1e3);
457
457
  }
458
458
  /**
@@ -479,21 +479,21 @@ class Ue {
479
479
  * Notify phase change
480
480
  */
481
481
  notifyChange() {
482
- var r, e;
483
- (e = (r = this.callbacks).onPhaseChange) == null || e.call(r, this.state.phase, this.getState());
482
+ var i, e;
483
+ (e = (i = this.callbacks).onPhaseChange) == null || e.call(i, this.state.phase, this.getState());
484
484
  }
485
485
  }
486
- function Ge(i = {}) {
487
- const { config: r = {}, callbacks: e = {} } = i, o = S(null);
488
- o.current || (o.current = new Ue(r, {}));
489
- const s = o.current, [c, a] = T(s.getState()), n = A(() => {
490
- a(s.getState());
486
+ function Ge(r = {}) {
487
+ const { config: i = {}, callbacks: e = {} } = r, a = S(null);
488
+ a.current || (a.current = new Ue(i, {}));
489
+ const s = a.current, [c, o] = k(s.getState()), n = A(() => {
490
+ o(s.getState());
491
491
  }, [s]);
492
492
  P(() => {
493
493
  const h = {
494
494
  onPhaseChange: (u, g) => {
495
- var y;
496
- n(), (y = e.onPhaseChange) == null || y.call(e, u, g);
495
+ var j;
496
+ n(), (j = e.onPhaseChange) == null || j.call(e, u, g);
497
497
  },
498
498
  onTick: (u) => {
499
499
  var g;
@@ -508,62 +508,62 @@ function Ge(i = {}) {
508
508
  }, [s, e, n]), P(() => () => {
509
509
  s.destroy();
510
510
  }, [s]);
511
- const w = A(() => {
511
+ const l = A(() => {
512
512
  s.startQuestion(), n();
513
513
  }, [s, n]), m = A(() => {
514
514
  s.nextPhase(), n();
515
- }, [s, n]), d = A(() => {
515
+ }, [s, n]), w = A(() => {
516
516
  s.completeInterview(), n();
517
517
  }, [s, n]);
518
518
  return {
519
519
  state: c,
520
- startQuestion: w,
520
+ startQuestion: l,
521
521
  nextPhase: m,
522
- completeInterview: d,
522
+ completeInterview: w,
523
523
  timerService: s
524
524
  };
525
525
  }
526
- function qe(i, r = {}) {
527
- const [e, o] = T({
526
+ function qe(r, i = {}) {
527
+ const [e, a] = k({
528
528
  data: null,
529
529
  loading: !1,
530
530
  error: null
531
531
  }), s = A(
532
532
  async (...c) => {
533
- var a, n, w, m;
534
- o((d) => ({ ...d, loading: !0, error: null }));
533
+ var o, n, l, m;
534
+ a((w) => ({ ...w, loading: !0, error: null }));
535
535
  try {
536
- const d = await i(...c);
537
- o((h) => ({
536
+ const w = await r(...c);
537
+ a((h) => ({
538
538
  ...h,
539
- data: d,
539
+ data: w,
540
540
  loading: !1,
541
541
  error: null
542
- })), (a = r.onSuccess) == null || a.call(r, d), (n = r.onSettled) == null || n.call(r, d, null);
543
- } catch (d) {
544
- const h = d.type ? d : {
542
+ })), (o = i.onSuccess) == null || o.call(i, w), (n = i.onSettled) == null || n.call(i, w, null);
543
+ } catch (w) {
544
+ const h = w.type ? w : {
545
545
  type: "unknown",
546
- message: d.message || "Unknown error",
546
+ message: w.message || "Unknown error",
547
547
  retryable: !0,
548
548
  userMessage: "Something went wrong. Please try again.",
549
- originalError: d
549
+ originalError: w
550
550
  };
551
- o((u) => ({
551
+ a((u) => ({
552
552
  ...u,
553
553
  loading: !1,
554
554
  error: h
555
- })), (w = r.onError) == null || w.call(r, h), (m = r.onSettled) == null || m.call(r, null, h);
555
+ })), (l = i.onError) == null || l.call(i, h), (m = i.onSettled) == null || m.call(i, null, h);
556
556
  }
557
557
  },
558
- [i, r]
558
+ [r, i]
559
559
  );
560
560
  return {
561
561
  ...e,
562
562
  execute: s
563
563
  };
564
564
  }
565
- function Be(i) {
566
- var r;
565
+ function Be(r) {
566
+ var i;
567
567
  if (!navigator.onLine)
568
568
  return {
569
569
  type: "network",
@@ -571,15 +571,15 @@ function Be(i) {
571
571
  retryable: !0,
572
572
  userMessage: "Please check your internet connection and try again."
573
573
  };
574
- if (i.name === "AbortError" || (r = i.message) != null && r.includes("timeout"))
574
+ if (r.name === "AbortError" || (i = r.message) != null && i.includes("timeout"))
575
575
  return {
576
576
  type: "timeout",
577
577
  message: "Request timed out",
578
578
  retryable: !0,
579
579
  userMessage: "The request is taking longer than expected. Please try again."
580
580
  };
581
- if (i.status) {
582
- const { status: e } = i;
581
+ if (r.status) {
582
+ const { status: e } = r;
583
583
  if (e === 401 || e === 403)
584
584
  return {
585
585
  type: "auth",
@@ -615,101 +615,101 @@ function Be(i) {
615
615
  }
616
616
  return {
617
617
  type: "unknown",
618
- message: i.message || "Unknown error occurred",
618
+ message: r.message || "Unknown error occurred",
619
619
  retryable: !0,
620
620
  userMessage: "Something unexpected happened. Please try again.",
621
- originalError: i
621
+ originalError: r
622
622
  };
623
623
  }
624
- async function ae(i, r = {}, e = {
624
+ async function oe(r, i = {}, e = {
625
625
  attempts: 3,
626
626
  backoff: "exponential",
627
627
  baseDelay: 1e3,
628
628
  maxDelay: 1e4,
629
629
  jitter: !0
630
630
  }) {
631
- let o;
631
+ let a;
632
632
  for (let s = 1; s <= e.attempts; s++)
633
633
  try {
634
- const c = new AbortController(), a = setTimeout(() => c.abort(), 6e4), n = await fetch(i, {
635
- ...r,
634
+ const c = new AbortController(), o = setTimeout(() => c.abort(), 6e4), n = await fetch(r, {
635
+ ...i,
636
636
  signal: c.signal
637
637
  });
638
- if (clearTimeout(a), n.status >= 400 && n.status < 500 && n.status !== 429)
638
+ if (clearTimeout(o), n.status >= 400 && n.status < 500 && n.status !== 429)
639
639
  return n;
640
640
  if (!n.ok)
641
641
  throw new Error(`HTTP ${n.status}: ${n.statusText}`);
642
642
  return n;
643
643
  } catch (c) {
644
- o = c;
645
- const a = Be(c);
646
- if (!a.retryable || s === e.attempts)
647
- throw a;
644
+ a = c;
645
+ const o = Be(c);
646
+ if (!o.retryable || s === e.attempts)
647
+ throw o;
648
648
  const n = ze(s, e);
649
649
  console.warn(
650
650
  `API request failed (attempt ${s}/${e.attempts}), retrying in ${n}ms:`,
651
- a.message
652
- ), await new Promise((w) => setTimeout(w, n));
651
+ o.message
652
+ ), await new Promise((l) => setTimeout(l, n));
653
653
  }
654
- throw o;
654
+ throw a;
655
655
  }
656
- function ze(i, r) {
656
+ function ze(r, i) {
657
657
  let e;
658
- return r.backoff === "exponential" ? e = r.baseDelay * Math.pow(2, i - 1) : e = r.baseDelay, e = Math.min(e, r.maxDelay), r.jitter && (e = e * (0.5 + Math.random() * 0.5)), Math.round(e);
658
+ return i.backoff === "exponential" ? e = i.baseDelay * Math.pow(2, r - 1) : e = i.baseDelay, e = Math.min(e, i.maxDelay), i.jitter && (e = e * (0.5 + Math.random() * 0.5)), Math.round(e);
659
659
  }
660
660
  class Qe {
661
- constructor(r = {}) {
661
+ constructor(i = {}) {
662
662
  D(this, "config");
663
- this.config = r;
663
+ this.config = i;
664
664
  }
665
665
  /**
666
666
  * Update configuration
667
667
  */
668
- updateConfig(r) {
669
- this.config = { ...this.config, ...r };
668
+ updateConfig(i) {
669
+ this.config = { ...this.config, ...i };
670
670
  }
671
671
  /**
672
672
  * Get default headers for API requests
673
673
  */
674
674
  getHeaders() {
675
675
  var e;
676
- const r = {
676
+ const i = {
677
677
  "Content-Type": "application/json",
678
678
  "X-Auth-Token": "appkey"
679
679
  };
680
- return (e = this.config) != null && e.authToken && (r.Authorization = `Bearer ${this.config.authToken}`), r;
680
+ return (e = this.config) != null && e.authToken && (i.Authorization = `Bearer ${this.config.authToken}`), i;
681
681
  }
682
682
  /**
683
683
  * Get base URL from config with fallback
684
684
  */
685
685
  getBaseUrl() {
686
- var r;
687
- return ((r = this.config) == null ? void 0 : r.baseUrl) || "/api";
686
+ var i;
687
+ return ((i = this.config) == null ? void 0 : i.baseUrl) || "/api";
688
688
  }
689
689
  /**
690
690
  * Get questions for an interview
691
691
  */
692
692
  async generateQuestion({
693
- interviewId: r,
693
+ interviewId: i,
694
694
  isInterviewDone: e = !1,
695
- qnaId: o,
695
+ qnaId: a,
696
696
  question: s,
697
697
  answer: c,
698
- answerDuration: a
698
+ answerDuration: o
699
699
  }) {
700
- const n = await ae(
700
+ const n = await oe(
701
701
  `${this.getBaseUrl()}/questions/next`,
702
702
  {
703
703
  method: "POST",
704
704
  headers: this.getHeaders(),
705
705
  body: JSON.stringify({
706
- interview_id: r,
706
+ interview_id: i,
707
707
  is_interview_done: e,
708
- qna_id: o,
708
+ qna_id: a,
709
709
  question: s,
710
710
  answer: c,
711
711
  // TODO: Hardcoded for now, will be dynamic later
712
- answer_duration: a ?? "00:00:30"
712
+ answer_duration: o ?? "00:00:30"
713
713
  })
714
714
  }
715
715
  );
@@ -719,19 +719,19 @@ class Qe {
719
719
  }
720
720
  }
721
721
  function We() {
722
- const i = X();
723
- return V(() => {
724
- const e = i.api || {};
722
+ const r = K();
723
+ return X(() => {
724
+ const e = r.api || {};
725
725
  return new Qe(e);
726
- }, [i.api]);
726
+ }, [r.api]);
727
727
  }
728
728
  class v extends Error {
729
- constructor(r, e, o = !1) {
730
- super(r), this.code = e, this.recoverable = o, this.name = "STTError";
729
+ constructor(i, e, a = !1) {
730
+ super(i), this.code = e, this.recoverable = a, this.name = "STTError";
731
731
  }
732
732
  }
733
733
  class He {
734
- constructor(r = {}) {
734
+ constructor(i = {}) {
735
735
  D(this, "config");
736
736
  D(this, "mediaRecorder", null);
737
737
  D(this, "audioChunks", []);
@@ -744,14 +744,14 @@ class He {
744
744
  language: "en",
745
745
  includeTimestamps: !1,
746
746
  temperature: 0,
747
- ...r
747
+ ...i
748
748
  };
749
749
  }
750
750
  /**
751
751
  * Update STT configuration
752
752
  */
753
- updateConfig(r) {
754
- this.config = { ...this.config, ...r };
753
+ updateConfig(i) {
754
+ this.config = { ...this.config, ...i };
755
755
  }
756
756
  /**
757
757
  * Check if browser supports audio recording
@@ -762,8 +762,8 @@ class He {
762
762
  /**
763
763
  * Start recording audio from user's microphone
764
764
  */
765
- async startRecording(r, e) {
766
- var o;
765
+ async startRecording(i, e) {
766
+ var a;
767
767
  if (!this.isRecordingSupported())
768
768
  throw new v(
769
769
  "Audio recording is not supported in this browser",
@@ -788,22 +788,22 @@ class He {
788
788
  this.mediaRecorder = new MediaRecorder(this.recordingStream, {
789
789
  mimeType: s
790
790
  }), this.mediaRecorder.ondataavailable = (c) => {
791
- var a;
792
- c.data.size > 0 && (this.audioChunks.push(c.data), (a = e == null ? void 0 : e.onDataAvailable) == null || a.call(e, c.data));
791
+ var o;
792
+ c.data.size > 0 && (this.audioChunks.push(c.data), (o = e == null ? void 0 : e.onDataAvailable) == null || o.call(e, c.data));
793
793
  }, this.mediaRecorder.onstop = () => {
794
794
  var c;
795
795
  (c = e == null ? void 0 : e.onStop) == null || c.call(e);
796
796
  }, this.mediaRecorder.onerror = (c) => {
797
797
  var n;
798
- const a = new v(
798
+ const o = new v(
799
799
  `Recording failed: ${c.error}`,
800
800
  "RECORDING_ERROR",
801
801
  !0
802
802
  );
803
- (n = e == null ? void 0 : e.onError) == null || n.call(e, a), this.cleanup();
804
- }, this.mediaRecorder.start(100), (o = e == null ? void 0 : e.onStart) == null || o.call(e), r && r > 0 && (this.autoStopTimeoutId = setTimeout(() => {
803
+ (n = e == null ? void 0 : e.onError) == null || n.call(e, o), this.cleanup();
804
+ }, this.mediaRecorder.start(100), (a = e == null ? void 0 : e.onStart) == null || a.call(e), i && i > 0 && (this.autoStopTimeoutId = setTimeout(() => {
805
805
  this.isRecording() && this.stopRecording();
806
- }, r * 1e3));
806
+ }, i * 1e3));
807
807
  } catch (s) {
808
808
  if (this.cleanup(), s instanceof Error) {
809
809
  if (s.name === "NotAllowedError" || s.name === "PermissionDeniedError")
@@ -832,17 +832,17 @@ class He {
832
832
  "NO_ACTIVE_RECORDING",
833
833
  !1
834
834
  );
835
- return new Promise((r, e) => {
835
+ return new Promise((i, e) => {
836
836
  if (!this.mediaRecorder) {
837
837
  e(
838
838
  new v("MediaRecorder is null", "MEDIARECORDER_NULL", !1)
839
839
  );
840
840
  return;
841
841
  }
842
- const o = this.mediaRecorder, s = () => {
842
+ const a = this.mediaRecorder, s = () => {
843
843
  try {
844
- const c = o.mimeType || "audio/webm", a = new Blob(this.audioChunks, { type: c });
845
- this.cleanup(), r(a);
844
+ const c = a.mimeType || "audio/webm", o = new Blob(this.audioChunks, { type: c });
845
+ this.cleanup(), i(o);
846
846
  } catch (c) {
847
847
  e(
848
848
  new v(
@@ -853,20 +853,20 @@ class He {
853
853
  );
854
854
  }
855
855
  };
856
- o.addEventListener("stop", s, { once: !0 }), o.stop();
856
+ a.addEventListener("stop", s, { once: !0 }), a.stop();
857
857
  });
858
858
  }
859
859
  /**
860
860
  * Transcribe audio blob using the STT API
861
861
  */
862
- async transcribe(r) {
862
+ async transcribe(i) {
863
863
  const {
864
864
  audioBlob: e,
865
- model: o = this.config.model,
865
+ model: a = this.config.model,
866
866
  language: s = this.config.language,
867
867
  includeTimestamps: c = this.config.includeTimestamps,
868
- temperature: a = this.config.temperature
869
- } = r;
868
+ temperature: o = this.config.temperature
869
+ } = i;
870
870
  if (!e || e.size === 0)
871
871
  throw new v(
872
872
  "Audio blob is empty or invalid",
@@ -874,11 +874,11 @@ class He {
874
874
  !1
875
875
  );
876
876
  try {
877
- const n = new FormData(), w = new File([e], "recording.wav", {
877
+ const n = new FormData(), l = new File([e], "recording.wav", {
878
878
  type: e.type || "audio/wav"
879
879
  });
880
- n.append("file", w), n.append("model", o || "whisper-large-v3-turbo"), n.append("language", s || "en"), n.append("include_timestamps", String(c || !1)), n.append("temperature", String(a || 0));
881
- const m = await ae(
880
+ n.append("file", l), n.append("model", a || "whisper-large-v3-turbo"), n.append("language", s || "en"), n.append("include_timestamps", String(c || !1)), n.append("temperature", String(o || 0));
881
+ const m = await oe(
882
882
  `${this.config.baseUrl}/speech/transcribe`,
883
883
  {
884
884
  method: "POST",
@@ -941,14 +941,14 @@ class He {
941
941
  * Get supported MIME type for recording
942
942
  */
943
943
  getSupportedMimeType() {
944
- const r = [
944
+ const i = [
945
945
  "audio/webm",
946
946
  "audio/webm;codecs=opus",
947
947
  "audio/ogg;codecs=opus",
948
948
  "audio/mp4",
949
949
  "audio/wav"
950
950
  ];
951
- for (const e of r)
951
+ for (const e of i)
952
952
  if (MediaRecorder.isTypeSupported(e))
953
953
  return e;
954
954
  return "audio/webm";
@@ -957,88 +957,88 @@ class He {
957
957
  * Clean up recording resources
958
958
  */
959
959
  cleanup() {
960
- 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);
960
+ this.recordingStream && (this.recordingStream.getTracks().forEach((i) => i.stop()), this.recordingStream = null), this.mediaRecorder = null, this.audioChunks = [], this.autoStopTimeoutId && (clearTimeout(this.autoStopTimeoutId), this.autoStopTimeoutId = null);
961
961
  }
962
962
  }
963
- const Q = new He(), Ye = (i = {}) => {
964
- const [r, e] = T(!1), [o, s] = T(!1), [c, a] = T(null), [n, w] = T(null), [m, d] = T(null);
965
- i.config && Q.updateConfig(i.config);
966
- const h = A(async (k) => {
967
- var j;
963
+ const Y = new He(), Ye = (r = {}) => {
964
+ const [i, e] = k(!1), [a, s] = k(!1), [c, o] = k(null), [n, l] = k(null), [m, w] = k(null);
965
+ r.config && Y.updateConfig(r.config);
966
+ const h = A(async (y) => {
967
+ var I;
968
968
  try {
969
- w(null), a(null), d(null), await Q.startRecording(k, {
969
+ l(null), o(null), w(null), await Y.startRecording(y, {
970
970
  onStart: () => {
971
- var l;
972
- e(!0), (l = i.onStart) == null || l.call(i);
971
+ var d;
972
+ e(!0), (d = r.onStart) == null || d.call(r);
973
973
  },
974
974
  onStop: () => {
975
- var l;
976
- e(!1), (l = i.onStop) == null || l.call(i);
975
+ var d;
976
+ e(!1), (d = r.onStop) == null || d.call(r);
977
977
  },
978
- onError: (l) => {
979
- var I;
980
- const p = l instanceof v ? l : new v(l.message, "RECORDING_ERROR", !0);
981
- w(p), e(!1), (I = i.onError) == null || I.call(i, p);
978
+ onError: (d) => {
979
+ var C;
980
+ const x = d instanceof v ? d : new v(d.message, "RECORDING_ERROR", !0);
981
+ l(x), e(!1), (C = r.onError) == null || C.call(r, x);
982
982
  }
983
983
  });
984
- } catch (l) {
985
- const p = l instanceof v ? l : new v(
986
- l instanceof Error ? l.message : String(l),
984
+ } catch (d) {
985
+ const x = d instanceof v ? d : new v(
986
+ d instanceof Error ? d.message : String(d),
987
987
  "START_FAILED",
988
988
  !1
989
989
  );
990
- throw w(p), e(!1), (j = i.onError) == null || j.call(i, p), p;
990
+ throw l(x), e(!1), (I = r.onError) == null || I.call(r, x), x;
991
991
  }
992
992
  }, []), u = A(async () => {
993
- var k, j;
993
+ var y, I;
994
994
  try {
995
- const l = await Q.stopRecording();
996
- return d(l), e(!1), (k = i.onStop) == null || k.call(i), l;
997
- } catch (l) {
998
- const p = l instanceof v ? l : new v(
999
- l instanceof Error ? l.message : String(l),
995
+ const d = await Y.stopRecording();
996
+ return w(d), e(!1), (y = r.onStop) == null || y.call(r), d;
997
+ } catch (d) {
998
+ const x = d instanceof v ? d : new v(
999
+ d instanceof Error ? d.message : String(d),
1000
1000
  "STOP_FAILED",
1001
1001
  !1
1002
1002
  );
1003
- throw w(p), e(!1), (j = i.onError) == null || j.call(i, p), p;
1003
+ throw l(x), e(!1), (I = r.onError) == null || I.call(r, x), x;
1004
1004
  }
1005
1005
  }, []), g = A(
1006
- async (k, j = {}) => {
1007
- var l, p;
1006
+ async (y, I = {}) => {
1007
+ var d, x;
1008
1008
  try {
1009
- w(null), s(!0);
1010
- const I = {
1011
- audioBlob: k,
1012
- ...j
1013
- }, b = await Q.transcribe(I);
1014
- return a(b.transcript), s(!1), (l = i.onTranscriptionComplete) == null || l.call(i, b), b;
1015
- } catch (I) {
1016
- const b = I instanceof v ? I : new v(
1017
- I instanceof Error ? I.message : String(I),
1009
+ l(null), s(!0);
1010
+ const C = {
1011
+ audioBlob: y,
1012
+ ...I
1013
+ }, p = await Y.transcribe(C);
1014
+ return o(p.transcript), s(!1), (d = r.onTranscriptionComplete) == null || d.call(r, p), p;
1015
+ } catch (C) {
1016
+ const p = C instanceof v ? C : new v(
1017
+ C instanceof Error ? C.message : String(C),
1018
1018
  "TRANSCRIPTION_FAILED",
1019
1019
  !0
1020
1020
  );
1021
- throw w(b), s(!1), (p = i.onError) == null || p.call(i, b), b;
1021
+ throw l(p), s(!1), (x = r.onError) == null || x.call(r, p), p;
1022
1022
  }
1023
1023
  },
1024
1024
  []
1025
- ), y = A(() => {
1026
- Q.cancelRecording(), e(!1), d(null);
1025
+ ), j = A(() => {
1026
+ Y.cancelRecording(), e(!1), w(null);
1027
1027
  }, []);
1028
1028
  return {
1029
1029
  startRecording: h,
1030
1030
  stopRecording: u,
1031
1031
  transcribe: g,
1032
- cancelRecording: y,
1033
- isRecording: r,
1034
- isTranscribing: o,
1032
+ cancelRecording: j,
1033
+ isRecording: i,
1034
+ isTranscribing: a,
1035
1035
  transcript: c,
1036
1036
  error: n,
1037
1037
  audioBlob: m
1038
1038
  };
1039
1039
  };
1040
1040
  class Ve {
1041
- constructor(r = {}) {
1041
+ constructor(i = {}) {
1042
1042
  D(this, "config");
1043
1043
  D(this, "currentAudio", null);
1044
1044
  this.config = {
@@ -1046,26 +1046,26 @@ class Ve {
1046
1046
  provider: "piper",
1047
1047
  voice: "string",
1048
1048
  speed: 1,
1049
- ...r
1049
+ ...i
1050
1050
  };
1051
1051
  }
1052
1052
  /**
1053
1053
  * Update TTS configuration
1054
1054
  */
1055
- updateConfig(r) {
1056
- this.config = { ...this.config, ...r };
1055
+ updateConfig(i) {
1056
+ this.config = { ...this.config, ...i };
1057
1057
  }
1058
1058
  /**
1059
1059
  * Get TTS audio from the API and return as blob
1060
1060
  */
1061
- async synthesizeSpeech(r) {
1061
+ async synthesizeSpeech(i) {
1062
1062
  const {
1063
1063
  text: e,
1064
- voice: o = this.config.voice,
1064
+ voice: a = this.config.voice,
1065
1065
  speed: s = this.config.speed
1066
- } = r, c = new URLSearchParams();
1067
- c.append("text", e), c.append("voice", o || "string"), c.append("speed", (s == null ? void 0 : s.toString()) || "1");
1068
- const a = await ae(
1066
+ } = i, c = new URLSearchParams();
1067
+ c.append("text", e), c.append("voice", a || "string"), c.append("speed", (s == null ? void 0 : s.toString()) || "1");
1068
+ const o = await oe(
1069
1069
  `${this.config.baseUrl}/speech/synthesize`,
1070
1070
  {
1071
1071
  method: "POST",
@@ -1087,16 +1087,16 @@ class Ve {
1087
1087
  jitter: !1
1088
1088
  }
1089
1089
  );
1090
- if (!a.ok)
1090
+ if (!o.ok)
1091
1091
  throw new Error(
1092
- `TTS request failed: ${a.status} ${a.statusText}`
1092
+ `TTS request failed: ${o.status} ${o.statusText}`
1093
1093
  );
1094
- const n = a.headers.get("content-type");
1094
+ const n = o.headers.get("content-type");
1095
1095
  if (n && n.includes("audio/"))
1096
- return a.blob();
1096
+ return o.blob();
1097
1097
  try {
1098
- const w = await a.json();
1099
- throw new Error(`TTS Error: ${JSON.stringify(w)}`);
1098
+ const l = await o.json();
1099
+ throw new Error(`TTS Error: ${JSON.stringify(l)}`);
1100
1100
  } catch {
1101
1101
  throw new Error("TTS request failed with unknown error");
1102
1102
  }
@@ -1104,35 +1104,35 @@ class Ve {
1104
1104
  /**
1105
1105
  * Speak text and return a promise that resolves when playback completes
1106
1106
  */
1107
- async speak(r, e) {
1108
- var o, s;
1107
+ async speak(i, e) {
1108
+ var a, s;
1109
1109
  try {
1110
- this.stop(), (o = e == null ? void 0 : e.onStart) == null || o.call(e);
1111
- const c = await this.synthesizeSpeech(r), a = URL.createObjectURL(c);
1112
- return this.currentAudio = new Audio(a), new Promise((n, w) => {
1110
+ this.stop(), (a = e == null ? void 0 : e.onStart) == null || a.call(e);
1111
+ const c = await this.synthesizeSpeech(i), o = URL.createObjectURL(c);
1112
+ return this.currentAudio = new Audio(o), new Promise((n, l) => {
1113
1113
  if (!this.currentAudio) {
1114
- w(new Error("Audio element not created"));
1114
+ l(new Error("Audio element not created"));
1115
1115
  return;
1116
1116
  }
1117
1117
  const m = this.currentAudio;
1118
1118
  m.onended = () => {
1119
- var d;
1120
- URL.revokeObjectURL(a), this.currentAudio = null, (d = e == null ? void 0 : e.onEnd) == null || d.call(e), n();
1121
- }, m.onerror = (d) => {
1119
+ var w;
1120
+ URL.revokeObjectURL(o), this.currentAudio = null, (w = e == null ? void 0 : e.onEnd) == null || w.call(e), n();
1121
+ }, m.onerror = (w) => {
1122
1122
  var u;
1123
- URL.revokeObjectURL(a), this.currentAudio = null;
1124
- const h = new Error(`Audio playback failed: ${d}`);
1125
- (u = e == null ? void 0 : e.onError) == null || u.call(e, h), w(h);
1126
- }, m.play().catch((d) => {
1123
+ URL.revokeObjectURL(o), this.currentAudio = null;
1124
+ const h = new Error(`Audio playback failed: ${w}`);
1125
+ (u = e == null ? void 0 : e.onError) == null || u.call(e, h), l(h);
1126
+ }, m.play().catch((w) => {
1127
1127
  var u;
1128
- URL.revokeObjectURL(a), this.currentAudio = null;
1129
- const h = new Error(`Failed to play audio: ${d.message}`);
1130
- (u = e == null ? void 0 : e.onError) == null || u.call(e, h), w(h);
1128
+ URL.revokeObjectURL(o), this.currentAudio = null;
1129
+ const h = new Error(`Failed to play audio: ${w.message}`);
1130
+ (u = e == null ? void 0 : e.onError) == null || u.call(e, h), l(h);
1131
1131
  });
1132
1132
  });
1133
1133
  } catch (c) {
1134
- const a = c instanceof Error ? c : new Error(`TTS Error: ${String(c)}`);
1135
- throw (s = e == null ? void 0 : e.onError) == null || s.call(e, a), a;
1134
+ const o = c instanceof Error ? c : new Error(`TTS Error: ${String(c)}`);
1135
+ throw (s = e == null ? void 0 : e.onError) == null || s.call(e, o), o;
1136
1136
  }
1137
1137
  }
1138
1138
  /**
@@ -1148,50 +1148,50 @@ class Ve {
1148
1148
  return this.currentAudio !== null && !this.currentAudio.paused;
1149
1149
  }
1150
1150
  }
1151
- const ie = new Ve(), Je = (i = {}) => {
1152
- const [r, e] = T(!1), [o, s] = T(!1), [c, a] = T(null);
1153
- i.config && ie.updateConfig(i.config);
1151
+ const ae = new Ve(), Je = (r = {}) => {
1152
+ const [i, e] = k(!1), [a, s] = k(!1), [c, o] = k(null);
1153
+ r.config && ae.updateConfig(r.config);
1154
1154
  const n = A(
1155
- async (m, d = {}) => {
1155
+ async (m, w = {}) => {
1156
1156
  var h;
1157
1157
  try {
1158
- a(null), s(!0);
1158
+ o(null), s(!0);
1159
1159
  const u = {
1160
1160
  text: m,
1161
- ...d
1161
+ ...w
1162
1162
  };
1163
- await ie.speak(u, {
1163
+ await ae.speak(u, {
1164
1164
  onStart: () => {
1165
1165
  var g;
1166
- s(!1), e(!0), (g = i.onStart) == null || g.call(i);
1166
+ s(!1), e(!0), (g = r.onStart) == null || g.call(r);
1167
1167
  },
1168
1168
  onEnd: () => {
1169
1169
  var g;
1170
- e(!1), (g = i.onEnd) == null || g.call(i);
1170
+ e(!1), (g = r.onEnd) == null || g.call(r);
1171
1171
  },
1172
1172
  onError: (g) => {
1173
- var y;
1174
- e(!1), s(!1), a(g), (y = i.onError) == null || y.call(i, g);
1173
+ var j;
1174
+ e(!1), s(!1), o(g), (j = r.onError) == null || j.call(r, g);
1175
1175
  }
1176
1176
  });
1177
1177
  } catch (u) {
1178
1178
  const g = u instanceof Error ? u : new Error(String(u));
1179
- throw a(g), e(!1), s(!1), (h = i.onError) == null || h.call(i, g), g;
1179
+ throw o(g), e(!1), s(!1), (h = r.onError) == null || h.call(r, g), g;
1180
1180
  }
1181
1181
  },
1182
- [i]
1183
- ), w = A(() => {
1184
- ie.stop(), e(!1), s(!1);
1182
+ [r]
1183
+ ), l = A(() => {
1184
+ ae.stop(), e(!1), s(!1);
1185
1185
  }, []);
1186
1186
  return {
1187
1187
  speak: n,
1188
- stop: w,
1189
- isPlaying: r,
1190
- isLoading: o,
1188
+ stop: l,
1189
+ isPlaying: i,
1190
+ isLoading: a,
1191
1191
  error: c
1192
1192
  };
1193
- }, Xe = ({ className: i = "" }) => {
1194
- const r = S(null);
1193
+ }, Xe = ({ className: r = "" }) => {
1194
+ const i = S(null);
1195
1195
  return P(() => {
1196
1196
  let e = null;
1197
1197
  return (async () => {
@@ -1199,17 +1199,17 @@ const ie = new Ve(), Je = (i = {}) => {
1199
1199
  e = await navigator.mediaDevices.getUserMedia({
1200
1200
  video: !0,
1201
1201
  audio: !1
1202
- }), r.current && (r.current.srcObject = e);
1202
+ }), i.current && (i.current.srcObject = e);
1203
1203
  } catch (s) {
1204
1204
  console.error("Error accessing camera:", s);
1205
1205
  }
1206
1206
  })(), () => {
1207
1207
  e && e.getTracks().forEach((s) => s.stop());
1208
1208
  };
1209
- }, []), /* @__PURE__ */ t.jsx("div", { className: `iw-relative ${i}`, children: /* @__PURE__ */ t.jsx(
1209
+ }, []), /* @__PURE__ */ t.jsx("div", { className: `iw-relative ${r}`, children: /* @__PURE__ */ t.jsx(
1210
1210
  "video",
1211
1211
  {
1212
- ref: r,
1212
+ ref: i,
1213
1213
  autoPlay: !0,
1214
1214
  playsInline: !0,
1215
1215
  muted: !0,
@@ -1219,20 +1219,20 @@ const ie = new Ve(), Je = (i = {}) => {
1219
1219
  }
1220
1220
  }
1221
1221
  ) });
1222
- }, Z = (i) => {
1223
- const { baseColor: r, borderRadius: e } = W(), { loading: o, children: s, ...c } = i;
1222
+ }, ee = (r) => {
1223
+ const { baseColor: i, borderRadius: e } = V(), { loading: a, children: s, ...c } = r;
1224
1224
  return /* @__PURE__ */ t.jsx(
1225
- se,
1225
+ ne,
1226
1226
  {
1227
1227
  style: {
1228
- background: ge(r),
1228
+ background: xe(i),
1229
1229
  borderRadius: e
1230
1230
  },
1231
1231
  ...c,
1232
- children: o ? /* @__PURE__ */ t.jsx(he, {}) : s
1232
+ children: a ? /* @__PURE__ */ t.jsx(ge, {}) : s
1233
1233
  }
1234
1234
  );
1235
- }, ne = (i) => /* @__PURE__ */ t.jsxs(
1235
+ }, ce = (r) => /* @__PURE__ */ t.jsxs(
1236
1236
  "svg",
1237
1237
  {
1238
1238
  xmlns: "http://www.w3.org/2000/svg",
@@ -1244,7 +1244,7 @@ const ie = new Ve(), Je = (i = {}) => {
1244
1244
  strokeWidth: "2",
1245
1245
  strokeLinecap: "round",
1246
1246
  strokeLinejoin: "round",
1247
- ...i,
1247
+ ...r,
1248
1248
  children: [
1249
1249
  /* @__PURE__ */ t.jsx("path", { d: "M12 2a10 10 0 0 1 7.38 16.75" }),
1250
1250
  /* @__PURE__ */ t.jsx("path", { d: "M12 6v6l4 2" }),
@@ -1254,27 +1254,27 @@ const ie = new Ve(), Je = (i = {}) => {
1254
1254
  /* @__PURE__ */ t.jsx("path", { d: "M8.644 21.42a10 10 0 0 0 7.631-.38" })
1255
1255
  ]
1256
1256
  }
1257
- ), Ze = (i, r, e) => Math.max(r, Math.min(e, i)), le = (i) => {
1258
- const r = Math.max(0, Math.floor(i)), e = Math.floor(r / 60).toString().padStart(2, "0"), o = (r % 60).toString().padStart(2, "0");
1259
- return `${e}:${o}`;
1260
- }, oe = ({
1261
- total: i,
1262
- remaining: r,
1257
+ ), Ze = (r, i, e) => Math.max(i, Math.min(e, r)), we = (r) => {
1258
+ const i = Math.max(0, Math.floor(r)), e = Math.floor(i / 60).toString().padStart(2, "0"), a = (i % 60).toString().padStart(2, "0");
1259
+ return `${e}:${a}`;
1260
+ }, le = ({
1261
+ total: r,
1262
+ remaining: i,
1263
1263
  size: e = 64,
1264
- strokeWidth: o = 6,
1264
+ strokeWidth: a = 6,
1265
1265
  className: s = "",
1266
1266
  showLabel: c = !0
1267
1267
  }) => {
1268
- const a = Math.max(1, i || 1), n = Ze(r / a, 0, 1), { radius: w, circumference: m, dashOffset: d, center: h } = V(() => {
1269
- const y = (e - o) / 2, k = 2 * Math.PI * y, j = k * (1 - n), l = Math.round(o) % 2 === 1, p = e / 2 + (l ? 0.5 : 0);
1270
- return { radius: y, circumference: k, dashOffset: j, center: p };
1271
- }, [e, o, n]), u = V(() => n <= 0.25 ? "iw-stroke-red-500" : n <= 0.5 ? "iw-stroke-yellow-500" : "iw-stroke-green-500", [n]), g = n <= 0.25 ? "iw-animate-pulse" : "";
1268
+ const o = Math.max(1, r || 1), n = Ze(i / o, 0, 1), { radius: l, circumference: m, dashOffset: w, center: h } = X(() => {
1269
+ const j = (e - a) / 2, y = 2 * Math.PI * j, I = y * (1 - n), d = Math.round(a) % 2 === 1, x = e / 2 + (d ? 0.5 : 0);
1270
+ return { radius: j, circumference: y, dashOffset: I, center: x };
1271
+ }, [e, a, n]), u = X(() => n <= 0.25 ? "iw-stroke-red-500" : n <= 0.5 ? "iw-stroke-yellow-500" : "iw-stroke-green-500", [n]), g = n <= 0.25 ? "iw-animate-pulse" : "";
1272
1272
  return /* @__PURE__ */ t.jsxs(
1273
1273
  "div",
1274
1274
  {
1275
1275
  className: `iw-relative iw-inline-flex iw-items-center iw-justify-center iw-rounded-full iw-bg-white ${s}`,
1276
1276
  style: { width: e, height: e },
1277
- "aria-label": `Time remaining ${le(r)}`,
1277
+ "aria-label": `Time remaining ${we(i)}`,
1278
1278
  role: "timer",
1279
1279
  "aria-live": "polite",
1280
1280
  children: [
@@ -1291,9 +1291,9 @@ const ie = new Ve(), Je = (i = {}) => {
1291
1291
  {
1292
1292
  cx: h,
1293
1293
  cy: h,
1294
- r: w,
1294
+ r: l,
1295
1295
  className: "iw-stroke-gray-200",
1296
- strokeWidth: o,
1296
+ strokeWidth: a,
1297
1297
  fill: "none",
1298
1298
  shapeRendering: "geometricPrecision",
1299
1299
  vectorEffect: "non-scaling-stroke"
@@ -1304,13 +1304,13 @@ const ie = new Ve(), Je = (i = {}) => {
1304
1304
  {
1305
1305
  cx: h,
1306
1306
  cy: h,
1307
- r: w,
1307
+ r: l,
1308
1308
  className: `${u} ${g}`,
1309
- strokeWidth: o,
1309
+ strokeWidth: a,
1310
1310
  strokeLinecap: "round",
1311
1311
  fill: "none",
1312
1312
  strokeDasharray: m,
1313
- strokeDashoffset: d,
1313
+ strokeDashoffset: w,
1314
1314
  shapeRendering: "geometricPrecision",
1315
1315
  vectorEffect: "non-scaling-stroke",
1316
1316
  style: {
@@ -1325,68 +1325,68 @@ const ie = new Ve(), Je = (i = {}) => {
1325
1325
  "span",
1326
1326
  {
1327
1327
  className: `iw-text-[11px] iw-font-semibold iw-tabular-nums ${n <= 0.25 ? "iw-text-red-600" : n <= 0.5 ? "iw-text-yellow-600" : "iw-text-green-600"}`,
1328
- children: le(r)
1328
+ children: we(i)
1329
1329
  }
1330
1330
  ) })
1331
1331
  ]
1332
1332
  }
1333
1333
  );
1334
1334
  }, Ke = ({
1335
- label: i,
1336
- error: r,
1335
+ label: r,
1336
+ error: i,
1337
1337
  fullWidth: e = !1,
1338
- className: o = "",
1338
+ className: a = "",
1339
1339
  id: s,
1340
1340
  ...c
1341
1341
  }) => {
1342
- const a = s || `textarea-${Math.random().toString(36).substring(2, 9)}`, n = "iw-block iw-rounded-md iw-border iw-border-gray-300 iw-shadow-sm iw-px-4 iw-py-2 iw-text-sm iw-transition-all", w = r ? "iw-border-red-500 iw-focus:border-red-500 iw-focus:ring-red-500" : "", m = e ? "iw-w-full" : "", d = o.includes("iw-h-full") || e ? "iw-h-full" : "";
1342
+ const o = s || `textarea-${Math.random().toString(36).substring(2, 9)}`, n = "iw-block iw-rounded-md iw-border iw-border-gray-300 iw-shadow-sm iw-px-4 iw-py-2 iw-text-sm iw-transition-all", l = i ? "iw-border-red-500 iw-focus:border-red-500 iw-focus:ring-red-500" : "", m = e ? "iw-w-full" : "", w = a.includes("iw-h-full") || e ? "iw-h-full" : "";
1343
1343
  return /* @__PURE__ */ t.jsxs(
1344
1344
  "div",
1345
1345
  {
1346
1346
  className: `iw-h-full iw-flex iw-flex-col ${e ? "iw-w-full" : ""}`,
1347
1347
  children: [
1348
- i && /* @__PURE__ */ t.jsx(
1348
+ r && /* @__PURE__ */ t.jsx(
1349
1349
  "label",
1350
1350
  {
1351
- htmlFor: a,
1351
+ htmlFor: o,
1352
1352
  className: "iw-block iw-text-sm iw-font-medium iw-text-gray-700 iw-mb-1",
1353
- children: i
1353
+ children: r
1354
1354
  }
1355
1355
  ),
1356
1356
  /* @__PURE__ */ t.jsx(
1357
1357
  "textarea",
1358
1358
  {
1359
- id: a,
1360
- className: `${n} ${w} ${m} ${d} ${o}`,
1361
- "aria-invalid": r ? "true" : "false",
1359
+ id: o,
1360
+ className: `${n} ${l} ${m} ${w} ${a}`,
1361
+ "aria-invalid": i ? "true" : "false",
1362
1362
  ...c
1363
1363
  }
1364
1364
  ),
1365
- r && /* @__PURE__ */ t.jsx("p", { className: "iw-mt-1 iw-text-sm iw-text-red-600", children: r })
1365
+ i && /* @__PURE__ */ t.jsx("p", { className: "iw-mt-1 iw-text-sm iw-text-red-600", children: i })
1366
1366
  ]
1367
1367
  }
1368
1368
  );
1369
1369
  }, et = ({
1370
- value: i,
1371
- onChange: r,
1370
+ value: r,
1371
+ onChange: i,
1372
1372
  onSubmit: e,
1373
- isSubmitDisabled: o,
1373
+ isSubmitDisabled: a,
1374
1374
  state: s,
1375
1375
  editingTime: c
1376
1376
  }) => {
1377
- const a = (n) => {
1378
- n.key === "Enter" && (n.ctrlKey || n.metaKey) && !o && (n.preventDefault(), e());
1377
+ const o = (n) => {
1378
+ n.key === "Enter" && (n.ctrlKey || n.metaKey) && !a && (n.preventDefault(), e());
1379
1379
  };
1380
1380
  return /* @__PURE__ */ t.jsxs("div", { className: "iw-flex iw-flex-col iw-h-full ", children: [
1381
1381
  /* @__PURE__ */ t.jsxs("div", { className: "iw-flex iw-items-center iw-justify-between", children: [
1382
1382
  /* @__PURE__ */ t.jsx("h3", { className: "iw-text-lg iw-font-semibold iw-text-gray-900 iw-mb-1", children: "Your Answer" }),
1383
1383
  /* @__PURE__ */ t.jsxs("div", { className: "iw-flex iw-items-center iw-justify-center iw-gap-2", children: [
1384
1384
  /* @__PURE__ */ t.jsxs("div", { className: "iw-flex iw-items-center iw-gap-1", children: [
1385
- /* @__PURE__ */ t.jsx(ne, { className: "iw-size-4 iw-text-orange-600" }),
1385
+ /* @__PURE__ */ t.jsx(ce, { className: "iw-size-4 iw-text-orange-600" }),
1386
1386
  /* @__PURE__ */ t.jsx("p", { className: "iw-text-gray-700 iw-text-sm", children: "Time to edit: " })
1387
1387
  ] }),
1388
1388
  /* @__PURE__ */ t.jsx(
1389
- oe,
1389
+ le,
1390
1390
  {
1391
1391
  total: c,
1392
1392
  remaining: s.currentPhaseTimeRemaining,
@@ -1400,9 +1400,9 @@ const ie = new Ve(), Je = (i = {}) => {
1400
1400
  /* @__PURE__ */ t.jsx(
1401
1401
  Ke,
1402
1402
  {
1403
- value: i,
1404
- onChange: r,
1405
- onKeyDown: a,
1403
+ value: r,
1404
+ onChange: i,
1405
+ onKeyDown: o,
1406
1406
  placeholder: "Type your answer here...",
1407
1407
  className: " iw-w-full iw-h-full iw-flex-1 iw-resize-none !iw-p-4 iw-bg-transparent iw-min-h-full focus-visible:iw-outline-0",
1408
1408
  onPaste: (n) => n.preventDefault(),
@@ -1412,129 +1412,129 @@ const ie = new Ve(), Je = (i = {}) => {
1412
1412
  onDragOver: (n) => n.preventDefault()
1413
1413
  }
1414
1414
  ),
1415
- /* @__PURE__ */ t.jsx("div", { className: "iw-w-full iw-grid iw-grid-cols-1 iw-mt-4", children: /* @__PURE__ */ t.jsx(Z, { onClick: e, disabled: o, children: "Submit Answer" }) })
1415
+ /* @__PURE__ */ t.jsx("div", { className: "iw-w-full iw-grid iw-grid-cols-1 iw-mt-4", children: /* @__PURE__ */ t.jsx(ee, { onClick: e, disabled: a, children: "Submit Answer" }) })
1416
1416
  ] })
1417
1417
  ] });
1418
1418
  }, tt = ({
1419
- className: i = "",
1420
- width: r,
1419
+ className: r = "",
1420
+ width: i,
1421
1421
  height: e = 56,
1422
- barWidth: o = 3,
1422
+ barWidth: a = 3,
1423
1423
  gap: s = 2,
1424
1424
  fftSize: c = 1024,
1425
- smoothingTimeConstant: a = 0.8,
1425
+ smoothingTimeConstant: o = 0.8,
1426
1426
  mediaStream: n,
1427
- startOnMount: w = !0
1427
+ startOnMount: l = !0
1428
1428
  }) => {
1429
- const { baseColor: m } = W(), d = S(null), h = S(null), u = S(null), g = S(null), y = S(null), k = S(null), j = S(!1), [l, p] = T(null);
1429
+ const { baseColor: m } = V(), w = S(null), h = S(null), u = S(null), g = S(null), j = S(null), y = S(null), I = S(!1), [d, x] = k(null);
1430
1430
  P(() => {
1431
- if (r || !h.current) return;
1432
- const b = h.current, _ = () => {
1433
- const N = d.current;
1434
- if (!N) return;
1435
- const C = b.clientWidth, M = e;
1436
- N.width = Math.max(1, Math.floor(C * window.devicePixelRatio || 1)), N.height = Math.max(1, Math.floor(M * window.devicePixelRatio || 1));
1437
- }, x = new ResizeObserver(_);
1438
- return x.observe(b), _(), () => x.disconnect();
1439
- }, [r, e]), P(() => {
1440
- if (!r) return;
1441
- const b = d.current;
1442
- b && (b.width = Math.max(
1431
+ if (i || !h.current) return;
1432
+ const p = h.current, $ = () => {
1433
+ const M = w.current;
1434
+ if (!M) return;
1435
+ const N = p.clientWidth, T = e;
1436
+ M.width = Math.max(1, Math.floor(N * window.devicePixelRatio || 1)), M.height = Math.max(1, Math.floor(T * window.devicePixelRatio || 1));
1437
+ }, b = new ResizeObserver($);
1438
+ return b.observe(p), $(), () => b.disconnect();
1439
+ }, [i, e]), P(() => {
1440
+ if (!i) return;
1441
+ const p = w.current;
1442
+ p && (p.width = Math.max(
1443
1443
  1,
1444
- Math.floor(r * (window.devicePixelRatio || 1))
1445
- ), b.height = Math.max(
1444
+ Math.floor(i * (window.devicePixelRatio || 1))
1445
+ ), p.height = Math.max(
1446
1446
  1,
1447
1447
  Math.floor(e * (window.devicePixelRatio || 1))
1448
1448
  ));
1449
- }, [r, e]), P(() => {
1450
- let b = !1;
1449
+ }, [i, e]), P(() => {
1450
+ let p = !1;
1451
1451
  return (async () => {
1452
1452
  try {
1453
- const x = new (window.AudioContext || window.webkitAudioContext)();
1454
- u.current = x;
1455
- let N = n;
1456
- if (!N) {
1457
- if (!w) return;
1458
- N = await navigator.mediaDevices.getUserMedia({
1453
+ const b = new (window.AudioContext || window.webkitAudioContext)();
1454
+ u.current = b;
1455
+ let M = n;
1456
+ if (!M) {
1457
+ if (!l) return;
1458
+ M = await navigator.mediaDevices.getUserMedia({
1459
1459
  audio: !0,
1460
1460
  video: !1
1461
- }), j.current = !0;
1461
+ }), I.current = !0;
1462
1462
  }
1463
- if (b) return;
1464
- const C = x.createAnalyser();
1465
- C.fftSize = c, C.smoothingTimeConstant = a, g.current = C;
1466
- const M = x.createMediaStreamSource(N);
1467
- y.current = M, M.connect(C), I();
1468
- } catch (x) {
1469
- p((x == null ? void 0 : x.message) || "Failed to initialize microphone");
1463
+ if (p) return;
1464
+ const N = b.createAnalyser();
1465
+ N.fftSize = c, N.smoothingTimeConstant = o, g.current = N;
1466
+ const T = b.createMediaStreamSource(M);
1467
+ j.current = T, T.connect(N), C();
1468
+ } catch (b) {
1469
+ x((b == null ? void 0 : b.message) || "Failed to initialize microphone");
1470
1470
  }
1471
1471
  })(), () => {
1472
- var x, N, C, M;
1473
- b = !0, k.current && cancelAnimationFrame(k.current);
1472
+ var b, M, N, T;
1473
+ p = !0, y.current && cancelAnimationFrame(y.current);
1474
1474
  try {
1475
- (x = y.current) == null || x.disconnect();
1475
+ (b = j.current) == null || b.disconnect();
1476
1476
  } catch {
1477
1477
  }
1478
1478
  try {
1479
- (N = g.current) == null || N.disconnect();
1479
+ (M = g.current) == null || M.disconnect();
1480
1480
  } catch {
1481
1481
  }
1482
- j.current && ((M = ((C = y.current) == null ? void 0 : C.mediaStream) || void 0) == null || M.getTracks().forEach((q) => q.stop())), u.current && u.current.state !== "closed" && u.current.close();
1482
+ I.current && ((T = ((N = j.current) == null ? void 0 : N.mediaStream) || void 0) == null || T.getTracks().forEach((q) => q.stop())), u.current && u.current.state !== "closed" && u.current.close();
1483
1483
  };
1484
- }, [n, c, a, w]);
1485
- const I = () => {
1486
- const b = d.current, _ = g.current;
1487
- if (!b || !_) return;
1488
- const x = b.getContext("2d");
1489
- if (!x) return;
1490
- const N = window.devicePixelRatio || 1, C = b.width, M = b.height, q = _.frequencyBinCount, U = new Uint8Array(q), L = () => {
1491
- k.current = requestAnimationFrame(L), _.getByteTimeDomainData(U), x.clearRect(0, 0, C, M), x.fillStyle = "rgba(0,0,0,0)", x.fillRect(0, 0, C, M);
1492
- const O = Math.max(1, Math.floor(o * N)), E = Math.max(1, Math.floor(s * N)), B = O + E, H = Math.max(8, Math.floor((C + E) / B)), K = Math.floor(U.length / H);
1493
- for (let z = 0; z < H; z++) {
1494
- const ee = Math.min(U.length - 1, z * K), te = U[ee] / 128 - 1, G = Math.abs(te), re = Math.pow(G, 0.6), f = Math.max(M * 0.06, re * (M * 0.9)), F = z * B, Y = (M - f) / 2, xe = 140 - Math.min(140, 140 * G), pe = 85, be = 48 + Math.floor(12 * (1 - G));
1495
- x.fillStyle = `${m}`, x.shadowColor = `hsla(${xe}, ${pe}%, ${be}%, ${0.25 * G})`, x.shadowBlur = 8 * G;
1496
- const ye = Math.min(O / 2, f / 2);
1497
- rt(x, F, Y, O, f, ye), x.fill();
1484
+ }, [n, c, o, l]);
1485
+ const C = () => {
1486
+ const p = w.current, $ = g.current;
1487
+ if (!p || !$) return;
1488
+ const b = p.getContext("2d");
1489
+ if (!b) return;
1490
+ const M = window.devicePixelRatio || 1, N = p.width, T = p.height, q = $.frequencyBinCount, F = new Uint8Array(q), Q = () => {
1491
+ y.current = requestAnimationFrame(Q), $.getByteTimeDomainData(F), b.clearRect(0, 0, N, T), b.fillStyle = "rgba(0,0,0,0)", b.fillRect(0, 0, N, T);
1492
+ const B = Math.max(1, Math.floor(a * M)), L = Math.max(1, Math.floor(s * M)), U = B + L, E = Math.max(8, Math.floor((N + L) / U)), W = Math.floor(F.length / E);
1493
+ for (let z = 0; z < E; z++) {
1494
+ const te = Math.min(F.length - 1, z * W), re = F[te] / 128 - 1, G = Math.abs(re), ie = Math.pow(G, 0.6), H = Math.max(T * 0.06, ie * (T * 0.9)), se = z * U, f = (T - H) / 2, O = 140 - Math.min(140, 140 * G), J = 85, be = 48 + Math.floor(12 * (1 - G));
1495
+ b.fillStyle = `${m}`, b.shadowColor = `hsla(${O}, ${J}%, ${be}%, ${0.25 * G})`, b.shadowBlur = 8 * G;
1496
+ const ye = Math.min(B / 2, H / 2);
1497
+ rt(b, se, f, B, H, ye), b.fill();
1498
1498
  }
1499
1499
  };
1500
- L();
1500
+ Q();
1501
1501
  };
1502
1502
  return /* @__PURE__ */ t.jsxs(
1503
1503
  "div",
1504
1504
  {
1505
1505
  ref: h,
1506
- className: `iw-relative iw-w-full iw-overflow-hidden iw-rounded-md iw-bg-gray-50 ${i}`,
1506
+ className: `iw-relative iw-w-full iw-overflow-hidden iw-rounded-md iw-bg-gray-50 ${r}`,
1507
1507
  style: { height: e },
1508
1508
  children: [
1509
- /* @__PURE__ */ t.jsx("canvas", { ref: d, className: "iw-w-full iw-h-full" }),
1510
- l && /* @__PURE__ */ t.jsx("div", { className: "iw-absolute iw-inset-0 iw-flex iw-items-center iw-justify-center", children: /* @__PURE__ */ t.jsx("span", { className: "iw-text-xs iw-text-red-600 iw-bg-red-50 iw-border iw-border-red-200 iw-px-2 iw-py-1 iw-rounded", children: l }) })
1509
+ /* @__PURE__ */ t.jsx("canvas", { ref: w, className: "iw-w-full iw-h-full" }),
1510
+ d && /* @__PURE__ */ t.jsx("div", { className: "iw-absolute iw-inset-0 iw-flex iw-items-center iw-justify-center", children: /* @__PURE__ */ t.jsx("span", { className: "iw-text-xs iw-text-red-600 iw-bg-red-50 iw-border iw-border-red-200 iw-px-2 iw-py-1 iw-rounded", children: d }) })
1511
1511
  ]
1512
1512
  }
1513
1513
  );
1514
1514
  };
1515
- function rt(i, r, e, o, s, c) {
1516
- const a = Math.min(c, o / 2, s / 2);
1517
- i.beginPath(), i.moveTo(r + a, e), i.lineTo(r + o - a, e), i.quadraticCurveTo(r + o, e, r + o, e + a), i.lineTo(r + o, e + s - a), i.quadraticCurveTo(r + o, e + s, r + o - a, e + s), i.lineTo(r + a, e + s), i.quadraticCurveTo(r, e + s, r, e + s - a), i.lineTo(r, e + a), i.quadraticCurveTo(r, e, r + a, e), i.closePath();
1515
+ function rt(r, i, e, a, s, c) {
1516
+ const o = Math.min(c, a / 2, s / 2);
1517
+ r.beginPath(), r.moveTo(i + o, e), r.lineTo(i + a - o, e), r.quadraticCurveTo(i + a, e, i + a, e + o), r.lineTo(i + a, e + s - o), r.quadraticCurveTo(i + a, e + s, i + a - o, e + s), r.lineTo(i + o, e + s), r.quadraticCurveTo(i, e + s, i, e + s - o), r.lineTo(i, e + o), r.quadraticCurveTo(i, e, i + o, e), r.closePath();
1518
1518
  }
1519
1519
  const it = ({
1520
- state: i,
1521
- answeringTime: r,
1520
+ state: r,
1521
+ answeringTime: i,
1522
1522
  nextPhase: e,
1523
- sttError: o
1523
+ sttError: a
1524
1524
  }) => /* @__PURE__ */ t.jsxs("div", { className: "iw-flex iw-flex-col iw-justify-between iw-h-full ", children: [
1525
1525
  /* @__PURE__ */ t.jsxs("div", { children: [
1526
1526
  /* @__PURE__ */ t.jsxs("div", { className: "iw-flex iw-items-center iw-justify-between", children: [
1527
1527
  /* @__PURE__ */ t.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...." }),
1528
1528
  /* @__PURE__ */ t.jsxs("div", { className: "iw-flex iw-items-center iw-justify-center iw-gap-2", children: [
1529
1529
  /* @__PURE__ */ t.jsxs("div", { className: "iw-flex iw-items-center iw-gap-1", children: [
1530
- /* @__PURE__ */ t.jsx(ne, { className: "iw-size-4 iw-text-orange-600" }),
1530
+ /* @__PURE__ */ t.jsx(ce, { className: "iw-size-4 iw-text-orange-600" }),
1531
1531
  /* @__PURE__ */ t.jsx("p", { className: "iw-text-gray-700 iw-text-sm", children: "Time to talk: " })
1532
1532
  ] }),
1533
1533
  /* @__PURE__ */ t.jsx(
1534
- oe,
1534
+ le,
1535
1535
  {
1536
- total: r,
1537
- remaining: i.currentPhaseTimeRemaining,
1536
+ total: i,
1537
+ remaining: r.currentPhaseTimeRemaining,
1538
1538
  size: 50,
1539
1539
  strokeWidth: 4
1540
1540
  }
@@ -1545,13 +1545,13 @@ const it = ({
1545
1545
  ] }),
1546
1546
  /* @__PURE__ */ t.jsxs("div", { children: [
1547
1547
  /* @__PURE__ */ t.jsx(tt, {}),
1548
- o && /* @__PURE__ */ t.jsxs("div", { className: "iw-mt-2 iw-text-xs iw-text-red-600", children: [
1548
+ a && /* @__PURE__ */ t.jsxs("div", { className: "iw-mt-2 iw-text-xs iw-text-red-600", children: [
1549
1549
  "Recording error: ",
1550
- o.message
1550
+ a.message
1551
1551
  ] })
1552
1552
  ] }),
1553
1553
  /* @__PURE__ */ t.jsx("div", { className: "iw-w-full iw-grid iw-grid-cols-1", children: /* @__PURE__ */ t.jsx(
1554
- Z,
1554
+ ee,
1555
1555
  {
1556
1556
  onClick: () => {
1557
1557
  e();
@@ -1561,18 +1561,18 @@ const it = ({
1561
1561
  ) })
1562
1562
  ] });
1563
1563
  function st() {
1564
- const [i, r] = T(!0), e = V(
1565
- () => [0, 1, 2].map((o) => ({ id: o })),
1564
+ const [r, i] = k(!0), e = X(
1565
+ () => [0, 1, 2].map((a) => ({ id: a })),
1566
1566
  []
1567
1567
  );
1568
1568
  return P(() => {
1569
- const o = setInterval(() => {
1570
- r((s) => !s);
1569
+ const a = setInterval(() => {
1570
+ i((s) => !s);
1571
1571
  }, 1500);
1572
- return () => clearInterval(o);
1572
+ return () => clearInterval(a);
1573
1573
  }, []), /* @__PURE__ */ t.jsxs("div", { className: "iw-flex iw-flex-col iw-items-center iw-justify-center iw-gap-8 iw-h-full", children: [
1574
- /* @__PURE__ */ t.jsx("div", { className: "iw-relative iw-w-80 iw-h-48 ", "aria-hidden": !0, children: e.map((o, s) => {
1575
- const c = s * 50, a = i ? c : c + 12, n = i ? 1 : 0.08, w = s * 140;
1574
+ /* @__PURE__ */ t.jsx("div", { className: "iw-relative iw-w-80 iw-h-48 ", "aria-hidden": !0, children: e.map((a, s) => {
1575
+ const c = s * 50, o = r ? c : c + 12, n = r ? 1 : 0.08, l = s * 140;
1576
1576
  return /* @__PURE__ */ t.jsx(
1577
1577
  "div",
1578
1578
  {
@@ -1580,9 +1580,9 @@ function st() {
1580
1580
  className: "iw-absolute iw-w-full iw-rounded-lg iw-p-4 iw-shadow-md iw-bg-gradient-to-b iw-from-gray-50 iw-to-gray-100 iw-overflow-hidden",
1581
1581
  style: {
1582
1582
  top: 0,
1583
- transform: `translateY(${a}px)`,
1583
+ transform: `translateY(${o}px)`,
1584
1584
  opacity: n,
1585
- transition: `transform 600ms cubic-bezier(.2,.9,.3,1) ${w}ms, opacity 400ms ease ${w}ms`
1585
+ transition: `transform 600ms cubic-bezier(.2,.9,.3,1) ${l}ms, opacity 400ms ease ${l}ms`
1586
1586
  },
1587
1587
  children: /* @__PURE__ */ t.jsxs("div", { className: "iw-flex iw-gap-3 iw-items-center", children: [
1588
1588
  /* @__PURE__ */ t.jsx("div", { className: "iw-w-10 iw-h-10 iw-bg-gray-300 iw-rounded iw-flex-shrink-0" }),
@@ -1592,39 +1592,39 @@ function st() {
1592
1592
  ] })
1593
1593
  ] })
1594
1594
  },
1595
- o.id
1595
+ a.id
1596
1596
  );
1597
1597
  }) }),
1598
1598
  /* @__PURE__ */ t.jsx("div", { className: "iw-text-center", children: /* @__PURE__ */ t.jsx("p", { className: "iw-text-gray-500 iw-font-medium", children: "Preparing your question..." }) })
1599
1599
  ] });
1600
1600
  }
1601
- const fe = ({
1602
- isOpen: i,
1603
- onClose: r,
1601
+ const pe = ({
1602
+ isOpen: r,
1603
+ onClose: i,
1604
1604
  children: e,
1605
- title: o,
1605
+ title: a,
1606
1606
  showCloseButton: s = !0,
1607
1607
  closeOnOverlayClick: c = !0,
1608
- closeOnEscape: a = !0,
1608
+ closeOnEscape: o = !0,
1609
1609
  className: n = ""
1610
1610
  }) => {
1611
1611
  if (P(() => {
1612
- if (!i || !a) return;
1613
- const d = (h) => {
1614
- h.key === "Escape" && r();
1612
+ if (!r || !o) return;
1613
+ const w = (h) => {
1614
+ h.key === "Escape" && i();
1615
1615
  };
1616
- return document.addEventListener("keydown", d), () => document.removeEventListener("keydown", d);
1617
- }, [i, a, r]), P(() => (i ? (document.body.style.overflow = "hidden", document.body.classList.add("interview-widget-container")) : (document.body.style.overflow = "unset", document.body.classList.remove("interview-widget-container")), () => {
1616
+ return document.addEventListener("keydown", w), () => document.removeEventListener("keydown", w);
1617
+ }, [r, o, i]), P(() => (r ? (document.body.style.overflow = "hidden", document.body.classList.add("interview-widget-container")) : (document.body.style.overflow = "unset", document.body.classList.remove("interview-widget-container")), () => {
1618
1618
  document.body.style.overflow = "unset", document.body.classList.remove("interview-widget-container");
1619
- }), [i]), !i) return null;
1620
- const w = (d) => {
1621
- c && d.target === d.currentTarget && r();
1619
+ }), [r]), !r) return null;
1620
+ const l = (w) => {
1621
+ c && w.target === w.currentTarget && i();
1622
1622
  }, m = /* @__PURE__ */ t.jsxs("div", { className: "iw-fixed iw-inset-0 iw-z-50 iw-flex iw-items-center iw-justify-center", children: [
1623
1623
  /* @__PURE__ */ t.jsx(
1624
1624
  "div",
1625
1625
  {
1626
1626
  className: "iw-fixed iw-inset-0 iw-bg-black iw-bg-opacity-50 iw-transition-opacity",
1627
- onClick: w
1627
+ onClick: l
1628
1628
  }
1629
1629
  ),
1630
1630
  /* @__PURE__ */ t.jsxs(
@@ -1633,21 +1633,21 @@ const fe = ({
1633
1633
  className: `iw-relative iw-bg-white iw-rounded-lg iw-shadow-xl iw-max-w-md iw-w-full iw-mx-4 iw-max-h-[90vh] iw-overflow-hidden ${n}`,
1634
1634
  role: "dialog",
1635
1635
  "aria-modal": "true",
1636
- "aria-labelledby": o ? "dialog-title" : void 0,
1636
+ "aria-labelledby": a ? "dialog-title" : void 0,
1637
1637
  children: [
1638
- (o || s) && /* @__PURE__ */ t.jsxs("div", { className: "iw-flex iw-items-center iw-justify-between iw-p-4 iw-border-b iw-border-gray-200", children: [
1639
- o && /* @__PURE__ */ t.jsx(
1638
+ (a || s) && /* @__PURE__ */ t.jsxs("div", { className: "iw-flex iw-items-center iw-justify-between iw-p-4 iw-border-b iw-border-gray-200", children: [
1639
+ a && /* @__PURE__ */ t.jsx(
1640
1640
  "h2",
1641
1641
  {
1642
1642
  id: "dialog-title",
1643
1643
  className: "iw-text-lg iw-font-semibold iw-text-gray-900",
1644
- children: o
1644
+ children: a
1645
1645
  }
1646
1646
  ),
1647
1647
  s && /* @__PURE__ */ t.jsx(
1648
1648
  "button",
1649
1649
  {
1650
- onClick: r,
1650
+ onClick: i,
1651
1651
  className: "iw-p-1 iw-text-gray-400 iw-hover:text-gray-600 iw-transition-colors iw-rounded iw-hover:bg-gray-100",
1652
1652
  "aria-label": "Close dialog",
1653
1653
  children: /* @__PURE__ */ t.jsx(
@@ -1678,13 +1678,13 @@ const fe = ({
1678
1678
  ] });
1679
1679
  return ke(m, document.body);
1680
1680
  }, at = ({
1681
- open: i,
1682
- onClose: r
1681
+ open: r,
1682
+ onClose: i
1683
1683
  }) => /* @__PURE__ */ t.jsx(
1684
- fe,
1684
+ pe,
1685
1685
  {
1686
- isOpen: i,
1687
- onClose: r || (() => {
1686
+ isOpen: r,
1687
+ onClose: i || (() => {
1688
1688
  }),
1689
1689
  title: "Interview Complete!",
1690
1690
  className: "",
@@ -1711,10 +1711,10 @@ const fe = ({
1711
1711
  ] })
1712
1712
  }
1713
1713
  ), nt = ({
1714
- size: i = "192px",
1715
- className: r,
1714
+ size: r = "192px",
1715
+ className: i,
1716
1716
  colors: e,
1717
- animationDuration: o = 20
1717
+ animationDuration: a = 20
1718
1718
  }) => {
1719
1719
  const c = { ...{
1720
1720
  bg: "oklch(95% 0.02 264.695)",
@@ -1724,23 +1724,23 @@ const fe = ({
1724
1724
  // Pastel blue
1725
1725
  c3: "oklch(78% 0.14 280)"
1726
1726
  // Pastel purple/lavender
1727
- }, ...e }, a = parseInt(i.replace("px", ""), 10), n = a < 50 ? Math.max(a * 8e-3, 1) : Math.max(a * 0.015, 4), w = a < 50 ? Math.max(a * 4e-3, 1.2) : Math.max(a * 8e-3, 1.5), m = a < 50 ? Math.max(a * 4e-3, 0.05) : Math.max(a * 8e-3, 0.1), d = a < 50 ? Math.max(a * 4e-3, 0.5) : Math.max(a * 8e-3, 2), h = a < 30 ? "0%" : a < 50 ? "5%" : a < 100 ? "15%" : "25%", u = a < 30 ? 1.1 : a < 50 ? Math.max(w * 1.2, 1.3) : w;
1727
+ }, ...e }, o = parseInt(r.replace("px", ""), 10), n = o < 50 ? Math.max(o * 8e-3, 1) : Math.max(o * 0.015, 4), l = o < 50 ? Math.max(o * 4e-3, 1.2) : Math.max(o * 8e-3, 1.5), m = o < 50 ? Math.max(o * 4e-3, 0.05) : Math.max(o * 8e-3, 0.1), w = o < 50 ? Math.max(o * 4e-3, 0.5) : Math.max(o * 8e-3, 2), h = o < 30 ? "0%" : o < 50 ? "5%" : o < 100 ? "15%" : "25%", u = o < 30 ? 1.1 : o < 50 ? Math.max(l * 1.2, 1.3) : l;
1728
1728
  return /* @__PURE__ */ t.jsx(
1729
1729
  "div",
1730
1730
  {
1731
- className: `siri-orb ${r}`,
1731
+ className: `siri-orb ${i}`,
1732
1732
  style: {
1733
- width: i,
1734
- height: i,
1733
+ width: r,
1734
+ height: r,
1735
1735
  "--bg": c.bg,
1736
1736
  "--c1": c.c1,
1737
1737
  "--c2": c.c2,
1738
1738
  "--c3": c.c3,
1739
- "--animation-duration": `${o}s`,
1739
+ "--animation-duration": `${a}s`,
1740
1740
  "--blur-amount": `${n}px`,
1741
1741
  "--contrast-amount": u,
1742
1742
  "--dot-size": `${m}px`,
1743
- "--shadow-spread": `${d}px`,
1743
+ "--shadow-spread": `${w}px`,
1744
1744
  "--mask-radius": h
1745
1745
  },
1746
1746
  children: /* @__PURE__ */ t.jsx("style", { children: `
@@ -1852,38 +1852,38 @@ const fe = ({
1852
1852
  }
1853
1853
  );
1854
1854
  };
1855
- function ot({ ttsError: i }) {
1855
+ function ot({ ttsError: r }) {
1856
1856
  return /* @__PURE__ */ t.jsxs("div", { className: "iw-flex iw-flex-col iw-items-center iw-justify-center iw-gap-8 iw-w-full iw-h-full", children: [
1857
1857
  /* @__PURE__ */ t.jsx(nt, { size: "80px" }),
1858
- i && /* @__PURE__ */ t.jsxs("div", { className: "iw-mt-2 iw-text-xs iw-text-red-600", children: [
1858
+ r && /* @__PURE__ */ t.jsxs("div", { className: "iw-mt-2 iw-text-xs iw-text-red-600", children: [
1859
1859
  "Audio playback failed: ",
1860
- i.message
1860
+ r.message
1861
1861
  ] }),
1862
1862
  /* @__PURE__ */ t.jsx("p", { className: "iw-text- iw-text-gray-700", children: "Your AI interviewer is speaking..." })
1863
1863
  ] });
1864
1864
  }
1865
- const ct = ({ state: i, thinkingTime: r, nextPhase: e }) => /* @__PURE__ */ t.jsxs("div", { className: "iw-flex iw-flex-col iw-gap-6 iw-items-center iw-justify-center iw-text-center iw-h-full ", children: [
1865
+ const ct = ({ state: r, thinkingTime: i, nextPhase: e }) => /* @__PURE__ */ t.jsxs("div", { className: "iw-flex iw-flex-col iw-gap-6 iw-items-center iw-justify-center iw-text-center iw-h-full ", children: [
1866
1866
  /* @__PURE__ */ t.jsxs("div", { children: [
1867
1867
  /* @__PURE__ */ t.jsx("h3", { className: "iw-text-lg iw-font-semibold iw-text-gray-900 iw-mb-1", children: "Get Ready to Answer" }),
1868
1868
  /* @__PURE__ */ t.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." })
1869
1869
  ] }),
1870
1870
  /* @__PURE__ */ t.jsxs("div", { className: "iw-flex iw-items-center iw-justify-center iw-gap-2", children: [
1871
1871
  /* @__PURE__ */ t.jsxs("div", { className: "iw-flex iw-items-center iw-gap-1", children: [
1872
- /* @__PURE__ */ t.jsx(ne, { className: "iw-size-4 iw-text-orange-600" }),
1872
+ /* @__PURE__ */ t.jsx(ce, { className: "iw-size-4 iw-text-orange-600" }),
1873
1873
  /* @__PURE__ */ t.jsx("p", { className: "iw-text-gray-700 iw-text-sm", children: "Time to think: " })
1874
1874
  ] }),
1875
1875
  /* @__PURE__ */ t.jsx(
1876
- oe,
1876
+ le,
1877
1877
  {
1878
- total: r,
1879
- remaining: i.currentPhaseTimeRemaining,
1878
+ total: i,
1879
+ remaining: r.currentPhaseTimeRemaining,
1880
1880
  size: 50,
1881
1881
  strokeWidth: 4
1882
1882
  }
1883
1883
  )
1884
1884
  ] }),
1885
1885
  /* @__PURE__ */ t.jsx("div", { className: "iw-w-full iw-grid iw-grid-cols-1", children: /* @__PURE__ */ t.jsx(
1886
- Z,
1886
+ ee,
1887
1887
  {
1888
1888
  onClick: () => {
1889
1889
  e();
@@ -1891,7 +1891,7 @@ const ct = ({ state: i, thinkingTime: r, nextPhase: e }) => /* @__PURE__ */ t.js
1891
1891
  children: "Start Answering"
1892
1892
  }
1893
1893
  ) })
1894
- ] }), lt = ({ sttError: i }) => /* @__PURE__ */ t.jsxs("div", { className: "iw-flex iw-flex-col iw-items-center iw-justify-center iw-h-full", children: [
1894
+ ] }), lt = ({ sttError: r }) => /* @__PURE__ */ t.jsxs("div", { className: "iw-flex iw-flex-col iw-items-center iw-justify-center iw-h-full", children: [
1895
1895
  /* @__PURE__ */ t.jsxs("svg", { width: "48", height: "48", viewBox: "0 0 60 60", fill: "none", children: [
1896
1896
  /* @__PURE__ */ t.jsx(
1897
1897
  "rect",
@@ -1927,12 +1927,12 @@ const ct = ({ state: i, thinkingTime: r, nextPhase: e }) => /* @__PURE__ */ t.js
1927
1927
  ] }),
1928
1928
  /* @__PURE__ */ t.jsx("h3", { className: "iw-text-lg iw-font-semibold iw-text-gray-900 iw-mb-1 iw-mt-3", children: "Just a moment... We're analyzing your response" }),
1929
1929
  /* @__PURE__ */ t.jsx("p", { className: "iw-max-w-lg iw-text-gray-500 iw-text-xs iw-leading-[21px]", children: "After transcription, you'll have 45 sec to review your answer." }),
1930
- i && /* @__PURE__ */ t.jsxs("div", { className: "iw-mt-2 iw-text-xs iw-text-red-600", children: [
1930
+ r && /* @__PURE__ */ t.jsxs("div", { className: "iw-mt-2 iw-text-xs iw-text-red-600", children: [
1931
1931
  "Transcription error: ",
1932
- i.message,
1933
- i.recoverable && " (attempting to continue)"
1932
+ r.message,
1933
+ r.recoverable && " (attempting to continue)"
1934
1934
  ] })
1935
- ] }), dt = (i) => /* @__PURE__ */ t.jsxs(
1935
+ ] }), dt = (r) => /* @__PURE__ */ t.jsxs(
1936
1936
  "svg",
1937
1937
  {
1938
1938
  xmlns: "http://www.w3.org/2000/svg",
@@ -1944,7 +1944,7 @@ const ct = ({ state: i, thinkingTime: r, nextPhase: e }) => /* @__PURE__ */ t.js
1944
1944
  strokeWidth: "2",
1945
1945
  strokeLinecap: "round",
1946
1946
  strokeLinejoin: "round",
1947
- ...i,
1947
+ ...r,
1948
1948
  children: [
1949
1949
  /* @__PURE__ */ t.jsx("path", { d: "M12 8V4H8" }),
1950
1950
  /* @__PURE__ */ t.jsx("rect", { width: "16", height: "12", x: "4", y: "8", rx: "2" }),
@@ -1955,10 +1955,10 @@ const ct = ({ state: i, thinkingTime: r, nextPhase: e }) => /* @__PURE__ */ t.js
1955
1955
  ]
1956
1956
  }
1957
1957
  ), wt = ({
1958
- question: i,
1959
- isLoading: r = !1
1958
+ question: r,
1959
+ isLoading: i = !1
1960
1960
  }) => {
1961
- const { baseColor: e } = W();
1961
+ const { baseColor: e } = V();
1962
1962
  return /* @__PURE__ */ t.jsx(
1963
1963
  "div",
1964
1964
  {
@@ -1975,18 +1975,18 @@ const ct = ({ state: i, thinkingTime: r, nextPhase: e }) => /* @__PURE__ */ t.js
1975
1975
  ) }),
1976
1976
  /* @__PURE__ */ t.jsx("div", { className: "iw-absolute iw-bottom-2 iw-translate-x-1/2 iw-flex iw-mt-2", children: /* @__PURE__ */ t.jsx("div", { className: "iw-text-sm", children: "Novara" }) })
1977
1977
  ] }),
1978
- r ? /* @__PURE__ */ t.jsxs("div", { className: "iw-animate-pulse iw-w-full iw-space-y-3 iw-mr-10", children: [
1978
+ i ? /* @__PURE__ */ t.jsxs("div", { className: "iw-animate-pulse iw-w-full iw-space-y-3 iw-mr-10", children: [
1979
1979
  /* @__PURE__ */ t.jsx("div", { className: "iw-h-5 iw-bg-gray-200 iw-rounded iw-w-full" }),
1980
1980
  /* @__PURE__ */ t.jsx("div", { className: "iw-h-5 iw-bg-gray-200 iw-rounded iw-w-3/4" })
1981
- ] }) : /* @__PURE__ */ t.jsx("p", { className: "iw-text-lg iw-leading-8", children: i == null ? void 0 : i.question })
1981
+ ] }) : /* @__PURE__ */ t.jsx("p", { className: "iw-text-lg iw-leading-8", children: r == null ? void 0 : r.question })
1982
1982
  ] })
1983
1983
  }
1984
1984
  );
1985
1985
  }, ut = ({
1986
- confirmExitInterview: i,
1987
- isOpen: r,
1986
+ confirmExitInterview: r,
1987
+ isOpen: i,
1988
1988
  onClose: e
1989
- }) => /* @__PURE__ */ t.jsx(fe, { isOpen: r, onClose: e, title: "Exit Interview", children: /* @__PURE__ */ t.jsxs("div", { className: "iw-space-y-4", children: [
1989
+ }) => /* @__PURE__ */ t.jsx(pe, { isOpen: i, onClose: e, title: "Exit Interview", children: /* @__PURE__ */ t.jsxs("div", { className: "iw-space-y-4", children: [
1990
1990
  /* @__PURE__ */ t.jsx("p", { className: "iw-text-base iw-text-gray-700", children: "Are you sure you want to exit the interview? All progress will be lost and you will not be able to resume." }),
1991
1991
  /* @__PURE__ */ t.jsxs("div", { className: "iw-flex iw-justify-end iw-space-x-2", children: [
1992
1992
  /* @__PURE__ */ t.jsx(
@@ -2001,13 +2001,13 @@ const ct = ({ state: i, thinkingTime: r, nextPhase: e }) => /* @__PURE__ */ t.js
2001
2001
  "button",
2002
2002
  {
2003
2003
  className: "iw-px-4 iw-py-2 iw-bg-red-600 iw-text-white iw-rounded iw-font-medium",
2004
- onClick: i,
2004
+ onClick: r,
2005
2005
  children: "Confirm Exit"
2006
2006
  }
2007
2007
  )
2008
2008
  ] })
2009
- ] }) }), ht = ({ title: i, onExit: r }) => {
2010
- const { baseColor: e } = W(), [o, s] = T(!1);
2009
+ ] }) }), ht = ({ title: r, onExit: i }) => {
2010
+ const { baseColor: e } = V(), [a, s] = k(!1);
2011
2011
  return /* @__PURE__ */ t.jsxs("header", { className: "iw-w-full iw-text-gray-900", children: [
2012
2012
  /* @__PURE__ */ t.jsxs("div", { className: "iw-mx-auto iw-flex iw-items-center iw-justify-between iw-px-4 iw-py-3", children: [
2013
2013
  /* @__PURE__ */ t.jsxs("div", { className: "iw-flex iw-items-center iw-space-x-2", children: [
@@ -2021,7 +2021,7 @@ const ct = ({ state: i, thinkingTime: r, nextPhase: e }) => /* @__PURE__ */ t.js
2021
2021
  ),
2022
2022
  /* @__PURE__ */ t.jsx("p", { className: "iw-text-sm iw-font-medium", children: "Novara" })
2023
2023
  ] }),
2024
- /* @__PURE__ */ t.jsx("h1", { className: "iw-text-base iw-font-bold", children: i }),
2024
+ /* @__PURE__ */ t.jsx("h1", { className: "iw-text-base iw-font-bold", children: r }),
2025
2025
  /* @__PURE__ */ t.jsx(
2026
2026
  "button",
2027
2027
  {
@@ -2035,160 +2035,165 @@ const ct = ({ state: i, thinkingTime: r, nextPhase: e }) => /* @__PURE__ */ t.js
2035
2035
  /* @__PURE__ */ t.jsx(
2036
2036
  ut,
2037
2037
  {
2038
- isOpen: o,
2038
+ isOpen: a,
2039
2039
  confirmExitInterview: () => {
2040
- r(), s(!1);
2040
+ i(), s(!1);
2041
2041
  },
2042
2042
  onClose: () => s(!1)
2043
2043
  }
2044
2044
  )
2045
2045
  ] });
2046
2046
  }, mt = ({
2047
+ interviewTitle: r,
2047
2048
  interviewId: i,
2048
- onComplete: r,
2049
- className: e = ""
2049
+ onComplete: e,
2050
+ className: a = ""
2050
2051
  }) => {
2051
- const o = We(), { baseUrl: s, authToken: c } = Se(), { timers: a, stt: n, tts: w } = Ce(), [m, d] = T(null), [h, u] = T(""), g = S(""), y = S(null), k = {
2052
- thinkingTime: (a == null ? void 0 : a.thinkingDuration) || 30,
2053
- answeringTime: (a == null ? void 0 : a.answeringDuration) || 120,
2054
- editingTime: (a == null ? void 0 : a.editingDuration) || 30
2055
- }, { thinkingTime: j, answeringTime: l, editingTime: p } = k;
2052
+ const s = We(), { baseUrl: c, authToken: o } = Se(), { timers: n, stt: l, tts: m } = Ce(), [w, h] = k(null), [u, g] = k(""), j = S(""), y = S(null), I = {
2053
+ thinkingTime: (n == null ? void 0 : n.thinkingDuration) || 30,
2054
+ answeringTime: (n == null ? void 0 : n.answeringDuration) || 120,
2055
+ editingTime: (n == null ? void 0 : n.editingDuration) || 30
2056
+ }, { thinkingTime: d, answeringTime: x, editingTime: C } = I;
2056
2057
  P(() => {
2057
- g.current = h;
2058
- }, [h]);
2059
- const I = S(!1), { speak: b, error: _ } = Je({
2058
+ j.current = u;
2059
+ }, [u]);
2060
+ const p = S(!1), {
2061
+ speak: $,
2062
+ stop: b,
2063
+ error: M
2064
+ } = Je({
2060
2065
  config: {
2061
- baseUrl: s,
2062
- provider: w == null ? void 0 : w.provider,
2063
- authToken: c
2066
+ baseUrl: c,
2067
+ provider: m == null ? void 0 : m.provider,
2068
+ authToken: o
2064
2069
  },
2065
2070
  onEnd: () => {
2066
- I.current = !1, E();
2071
+ p.current = !1, E();
2067
2072
  },
2068
2073
  onError: () => {
2069
- I.current || (I.current = !0, E());
2074
+ p.current || (p.current = !0, E());
2070
2075
  }
2071
- }), x = S(!1), N = S(!1), {
2072
- startRecording: C,
2073
- stopRecording: M,
2074
- transcribe: q,
2075
- error: U
2076
+ }), N = S(!1), T = S(!1), {
2077
+ startRecording: q,
2078
+ stopRecording: F,
2079
+ transcribe: Q,
2080
+ error: B
2076
2081
  } = Ye({
2077
2082
  config: {
2078
- baseUrl: s,
2079
- provider: n == null ? void 0 : n.provider,
2080
- model: n == null ? void 0 : n.model,
2081
- language: n == null ? void 0 : n.language,
2082
- authToken: c
2083
+ baseUrl: c,
2084
+ provider: l == null ? void 0 : l.provider,
2085
+ model: l == null ? void 0 : l.model,
2086
+ language: l == null ? void 0 : l.language,
2087
+ authToken: o
2083
2088
  },
2084
2089
  onStart: () => {
2085
- x.current = !1, N.current = !1;
2090
+ N.current = !1, T.current = !1;
2086
2091
  },
2087
2092
  onStop: () => {
2088
2093
  },
2089
2094
  onTranscriptionComplete: (f) => {
2090
- u(f.transcript), N.current || (N.current = !0, E());
2095
+ g(f.transcript), T.current || (T.current = !0, E());
2091
2096
  },
2092
2097
  onError: (f) => {
2093
- console.error("STT Error:", f), x.current || (x.current = !0, E());
2098
+ console.error("STT Error:", f), N.current || (N.current = !0, E());
2094
2099
  }
2095
- }), { state: L, startQuestion: O, nextPhase: E, completeInterview: B } = Ge({
2100
+ }), { state: L, startQuestion: U, nextPhase: E, completeInterview: W } = Ge({
2096
2101
  config: {
2097
- thinkingDuration: j,
2098
- answeringDuration: l,
2099
- editingDuration: p
2102
+ thinkingDuration: d,
2103
+ answeringDuration: x,
2104
+ editingDuration: C
2100
2105
  },
2101
2106
  callbacks: {
2102
2107
  onPhaseChange: (f) => {
2103
2108
  switch (f) {
2104
2109
  case R.FETCHING_QUESTION:
2105
- H();
2110
+ z();
2106
2111
  break;
2107
2112
  case R.READING_QUESTION:
2108
- ee();
2113
+ G();
2109
2114
  break;
2110
2115
  case R.ANSWERING:
2111
- te();
2116
+ ie();
2112
2117
  break;
2113
2118
  case R.TRANSCRIBING:
2114
- G();
2119
+ H();
2115
2120
  break;
2116
2121
  case R.SUBMITTING:
2117
- z();
2122
+ re();
2118
2123
  break;
2119
2124
  }
2120
2125
  },
2121
2126
  onInterviewEnd: () => {
2122
- r == null || r();
2127
+ e == null || e();
2123
2128
  }
2124
2129
  }
2125
2130
  });
2126
2131
  P(() => {
2127
- O();
2132
+ U();
2128
2133
  }, []);
2129
- const { execute: H, loading: K } = qe(
2134
+ const { execute: z, loading: te } = qe(
2130
2135
  async () => {
2131
- var F, Y;
2132
- const f = await o.generateQuestion({
2136
+ var O, J;
2137
+ const f = await s.generateQuestion({
2133
2138
  interviewId: i,
2134
- question: ((F = y.current) == null ? void 0 : F.question) || "",
2135
- qnaId: ((Y = y.current) == null ? void 0 : Y.qna_id) || "",
2136
- answer: g.current
2139
+ question: ((O = y.current) == null ? void 0 : O.question) || "",
2140
+ qnaId: ((J = y.current) == null ? void 0 : J.qna_id) || "",
2141
+ answer: j.current
2137
2142
  });
2138
2143
  return y.current = f.data, f;
2139
2144
  },
2140
2145
  {
2141
2146
  onSuccess: async (f) => {
2142
- f && f.data && (u(""), d(f.data), E());
2147
+ f && f.data && (g(""), h(f.data), E());
2143
2148
  },
2144
2149
  onError: (f) => {
2145
2150
  console.error("Failed to fetch questions:", f);
2146
2151
  }
2147
2152
  }
2148
- ), z = A(async () => {
2149
- O();
2150
- }, [O]), ee = A(async () => {
2153
+ ), re = A(async () => {
2154
+ U();
2155
+ }, [U]), G = A(async () => {
2151
2156
  var f;
2152
2157
  if ((f = y.current) != null && f.question)
2153
2158
  try {
2154
- I.current = !1, await b(y.current.question), y.current.is_interview_done && (await Pe(2e3), B());
2155
- } catch (F) {
2156
- console.error("Failed to speak question:", F);
2159
+ p.current = !1, await $(y.current.question), y.current.is_interview_done && (await Pe(2e3), W());
2160
+ } catch (O) {
2161
+ console.error("Failed to speak question:", O);
2157
2162
  }
2158
2163
  else
2159
2164
  E();
2160
- }, [b, E, B]), te = A(async () => {
2165
+ }, [$, E, W]), ie = A(async () => {
2161
2166
  try {
2162
- await C(l);
2167
+ await q(x);
2163
2168
  } catch (f) {
2164
2169
  console.error("Failed to start recording:", f), E();
2165
2170
  }
2166
- }, [C, E]), G = A(async () => {
2171
+ }, [q, E]), H = A(async () => {
2167
2172
  try {
2168
- const f = await M();
2169
- await q(f);
2173
+ const f = await F();
2174
+ await Q(f);
2170
2175
  } catch (f) {
2171
- console.error("STT processing failed:", f), !x.current && !N.current && (x.current = !0, E());
2176
+ console.error("STT processing failed:", f), !N.current && !T.current && (N.current = !0, E());
2172
2177
  }
2173
- }, [M, q, E]), re = () => {
2178
+ }, [F, Q, E]), se = () => {
2174
2179
  const { phase: f } = L;
2175
2180
  switch (f) {
2176
2181
  case R.IDLE:
2177
2182
  return /* @__PURE__ */ t.jsxs("div", { className: "iw-text-center iw-flex iw-flex-col iw-items-center iw-justify-center iw-gap-2 iw-h-full", children: [
2178
2183
  /* @__PURE__ */ t.jsx("h3", { className: "iw-text-lg iw-font-semibold iw-text-gray-900 iw-mb-1", children: "Ready to start the Interview?" }),
2179
2184
  /* @__PURE__ */ t.jsx("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.` }),
2180
- /* @__PURE__ */ t.jsx(Z, { onClick: O, className: "iw-mt-2 iw-w-40", children: "Start Interview" })
2185
+ /* @__PURE__ */ t.jsx(ee, { onClick: U, className: "iw-mt-2 iw-w-40", children: "Start Interview" })
2181
2186
  ] });
2182
2187
  case R.FETCHING_QUESTION:
2183
2188
  return /* @__PURE__ */ t.jsx(st, {});
2184
2189
  case R.READING_QUESTION:
2185
- return /* @__PURE__ */ t.jsx(ot, { ttsError: _ });
2190
+ return /* @__PURE__ */ t.jsx(ot, { ttsError: M });
2186
2191
  case R.THINKING:
2187
2192
  return /* @__PURE__ */ t.jsx(
2188
2193
  ct,
2189
2194
  {
2190
2195
  state: L,
2191
- thinkingTime: j,
2196
+ thinkingTime: d,
2192
2197
  nextPhase: E
2193
2198
  }
2194
2199
  );
@@ -2197,24 +2202,24 @@ const ct = ({ state: i, thinkingTime: r, nextPhase: e }) => /* @__PURE__ */ t.js
2197
2202
  it,
2198
2203
  {
2199
2204
  state: L,
2200
- answeringTime: l,
2205
+ answeringTime: x,
2201
2206
  nextPhase: E,
2202
- sttError: U
2207
+ sttError: B
2203
2208
  }
2204
2209
  );
2205
2210
  case R.TRANSCRIBING:
2206
- return /* @__PURE__ */ t.jsx(lt, { sttError: U });
2211
+ return /* @__PURE__ */ t.jsx(lt, { sttError: B });
2207
2212
  case R.EDITING:
2208
2213
  case R.SUBMITTING:
2209
2214
  return /* @__PURE__ */ t.jsx("div", { className: "iw-space-y-4 iw-h-full", children: /* @__PURE__ */ t.jsx(
2210
2215
  et,
2211
2216
  {
2212
- value: h,
2213
- onChange: (F) => u(F.target.value),
2217
+ value: u,
2218
+ onChange: (O) => g(O.target.value),
2214
2219
  onSubmit: () => E(),
2215
- isSubmitDisabled: !h.trim() || K,
2220
+ isSubmitDisabled: !u.trim() || te,
2216
2221
  state: L,
2217
- editingTime: p
2222
+ editingTime: C
2218
2223
  }
2219
2224
  ) });
2220
2225
  case R.COMPLETED:
@@ -2222,7 +2227,7 @@ const ct = ({ state: i, thinkingTime: r, nextPhase: e }) => /* @__PURE__ */ t.js
2222
2227
  at,
2223
2228
  {
2224
2229
  open: !0,
2225
- onClose: r || (() => {
2230
+ onClose: e || (() => {
2226
2231
  })
2227
2232
  }
2228
2233
  ) });
@@ -2234,47 +2239,54 @@ const ct = ({ state: i, thinkingTime: r, nextPhase: e }) => /* @__PURE__ */ t.js
2234
2239
  /* @__PURE__ */ t.jsx(
2235
2240
  ht,
2236
2241
  {
2237
- title: "Interview for Python Developer",
2238
- onExit: B
2242
+ title: r,
2243
+ onExit: async () => {
2244
+ b(), (await s.generateQuestion({
2245
+ interviewId: i,
2246
+ isInterviewDone: !0
2247
+ })).success && W();
2248
+ }
2239
2249
  }
2240
2250
  ),
2241
2251
  /* @__PURE__ */ t.jsxs(
2242
2252
  "div",
2243
2253
  {
2244
- className: `iw-p-4 iw-space-y-4 iw-pb-6 ${e} iw-min-h-[calc(100vh_-_3.8rem)] iw-flex iw-flex-col iw-justify-between`,
2254
+ className: `iw-p-4 iw-space-y-4 iw-pb-6 ${a} iw-min-h-[calc(100vh_-_3.8rem)] iw-flex iw-flex-col iw-justify-between`,
2245
2255
  children: [
2246
2256
  /* @__PURE__ */ t.jsx("div", { className: "iw-flex iw-items-start iw-justify-between iw-gap-3", children: /* @__PURE__ */ t.jsx("div", { className: "iw-flex-1", children: /* @__PURE__ */ t.jsx(
2247
2257
  wt,
2248
2258
  {
2249
- question: m,
2259
+ question: w,
2250
2260
  isLoading: L.phase === R.FETCHING_QUESTION || L.phase === R.IDLE
2251
2261
  }
2252
2262
  ) }) }),
2253
2263
  /* @__PURE__ */ t.jsxs("div", { className: "iw iw-bg-[#F6F6F6] iw-grid iw-grid-cols-2 iw-rounded-xl iw-p-4", children: [
2254
2264
  /* @__PURE__ */ t.jsx("div", { className: "iw-min-h-[400px] iw-max-h-[600px]", children: /* @__PURE__ */ t.jsx(Xe, {}) }),
2255
- /* @__PURE__ */ t.jsx("div", { className: "iw-bg-white iw-rounded-lg iw-shadow iw-p-6", children: re() })
2265
+ /* @__PURE__ */ t.jsx("div", { className: "iw-bg-white iw-rounded-lg iw-shadow iw-p-6", children: se() })
2256
2266
  ] })
2257
2267
  ]
2258
2268
  }
2259
2269
  )
2260
2270
  ] });
2261
2271
  }, gt = ({
2272
+ title: r,
2262
2273
  interviewId: i,
2263
- onInterviewEnd: r,
2264
- className: e = ""
2274
+ onInterviewEnd: e,
2275
+ className: a = ""
2265
2276
  }) => {
2266
- const [o, s] = ce.useState(!1), [c, a] = ce.useState(!0), n = S(null);
2267
- return o ? /* @__PURE__ */ t.jsx("div", { className: "interview-widget-container", children: /* @__PURE__ */ t.jsx(
2277
+ const [s, c] = de.useState(!1), [o, n] = de.useState(!0), l = S(null);
2278
+ return s ? /* @__PURE__ */ t.jsx("div", { className: "interview-widget-container", children: /* @__PURE__ */ t.jsx(
2268
2279
  "div",
2269
2280
  {
2270
- ref: n,
2271
- className: `iw-flex iw-flex-col iw-rounded-xl iw-shadow-lg iw-overflow-hidden iw-h-[calc(100vh-1rem)] ${e}`,
2281
+ ref: l,
2282
+ className: `iw-flex iw-flex-col iw-rounded-xl iw-shadow-lg iw-overflow-hidden iw-h-[calc(100vh-1rem)] ${a}`,
2272
2283
  children: /* @__PURE__ */ t.jsx("div", { className: " iw-h-full iw-flex iw-flex-col", children: /* @__PURE__ */ t.jsx(
2273
2284
  mt,
2274
2285
  {
2286
+ interviewTitle: r ?? "Interview",
2275
2287
  interviewId: i,
2276
- className: e,
2277
- onComplete: r || (() => {
2288
+ className: a,
2289
+ onComplete: e || (() => {
2278
2290
  })
2279
2291
  }
2280
2292
  ) })
@@ -2282,9 +2294,9 @@ const ct = ({ state: i, thinkingTime: r, nextPhase: e }) => /* @__PURE__ */ t.js
2282
2294
  ) }) : /* @__PURE__ */ t.jsx("div", { className: "interview-widget-container", children: /* @__PURE__ */ t.jsx(
2283
2295
  Le,
2284
2296
  {
2285
- isOpen: c,
2297
+ isOpen: o,
2286
2298
  onStart: () => {
2287
- console.log("Permissions granted, starting interview"), s(!0), a(!1);
2299
+ console.log("Permissions granted, starting interview"), c(!0), n(!1);
2288
2300
  }
2289
2301
  }
2290
2302
  ) });