@myinterview/chatbot 0.1.61-experimental-78d62d2 → 0.1.62-experimental-629fc40

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/index.js CHANGED
@@ -104828,7 +104828,7 @@ const tst = {
104828
104828
  }, mH = () => {
104829
104829
  let e, t;
104830
104830
  try {
104831
- e ?? (e = "prod"), t ?? (t = "1.1.47");
104831
+ e ?? (e = "prod"), t ?? (t = "1.1.49");
104832
104832
  } catch {
104833
104833
  console.error("sentry configGenerator error");
104834
104834
  }
@@ -111856,16 +111856,18 @@ const Mlt = (e) => {
111856
111856
  "/",
111857
111857
  " ",
111858
111858
  t
111859
- ), Flt = ({ onAnswer: e, maxChars: t = $st }) => {
111860
- const { t: r } = Jn(), [n, i] = St(""), o = (a) => {
111861
- const s = a.target.value, c = t && s.length > t ? s.substring(0, t) : s;
111862
- i(c), e(c);
111859
+ ), Flt = ({ onAnswer: e, maxChars: t = $st, antiCheat: r = !1 }) => {
111860
+ const { t: n } = Jn(), [i, o] = St(""), a = (c) => {
111861
+ r && c.preventDefault();
111862
+ }, s = (c) => {
111863
+ const u = c.target.value, l = t && u.length > t ? u.substring(0, t) : u;
111864
+ o(l), e(l);
111863
111865
  };
111864
111866
  return M.createElement(
111865
111867
  "div",
111866
111868
  { className: "myinterview-widget-assessment__free-text" },
111867
- M.createElement("textarea", { className: "myinterview-widget-assessment__input myinterview-widget-scroll-indicator", value: n, placeholder: r("assessment.free_text.input_placeholder"), onChange: o }),
111868
- !!t && M.createElement(Ult, { currentLength: n.length, maxLength: t })
111869
+ M.createElement("textarea", { className: "myinterview-widget-assessment__input myinterview-widget-scroll-indicator", value: i, placeholder: n("assessment.free_text.input_placeholder"), onPaste: a, onDrop: a, onChange: s }),
111870
+ !!t && M.createElement(Ult, { currentLength: i.length, maxLength: t })
111869
111871
  );
111870
111872
  }, Blt = ({ answerOptions: e, onAnswer: t }) => {
111871
111873
  const [r, n] = St(e.map((o) => Object.assign(Object.assign({}, o), { selected: !1 }))), i = (o) => {
@@ -111908,29 +111910,29 @@ const Mlt = (e) => {
111908
111910
  [an.TEXT]: Flt,
111909
111911
  [an.SINGLE]: zlt,
111910
111912
  [an.MULTIPLE]: Blt
111911
- }, Hlt = ({ currentQuestionObj: e, timer: t, currentQuestion: r, numberOfQuestions: n, onSubmitAssessment: i }) => {
111912
- var o, a;
111913
- const { t: s } = Jn(), c = dt(e.answerType !== an.TEXT ? [] : ""), u = ji(() => Vlt[e.answerType], [e.answerType]), [l, d] = St(!1), f = e.answerType !== an.TEXT ? ((o = e.config) === null || o === void 0 ? void 0 : o.answers) || [] : [], p = (y) => {
111914
- i(c.current, y);
111915
- }, h = ji(() => {
111913
+ }, Hlt = ({ currentQuestionObj: e, timer: t, currentQuestion: r, numberOfQuestions: n, antiCheat: i, onSubmitAssessment: o }) => {
111914
+ var a, s, c;
111915
+ const { t: u } = Jn(), l = dt(e.answerType !== an.TEXT ? [] : ""), d = ji(() => Vlt[e.answerType], [e.answerType]), [f, p] = St(!1), h = e.answerType !== an.TEXT ? ((a = e.config) === null || a === void 0 ? void 0 : a.answers) || [] : [], m = (b) => {
111916
+ o(l.current, b);
111917
+ }, y = ji(() => {
111916
111918
  switch (e.answerType) {
111917
111919
  case an.TEXT:
111918
111920
  return () => {
111919
- var y;
111920
- return c.current.length >= (((y = e.config) === null || y === void 0 ? void 0 : y.minChars) || 1);
111921
+ var b;
111922
+ return l.current.length >= (((b = e.config) === null || b === void 0 ? void 0 : b.minChars) || 1);
111921
111923
  };
111922
111924
  case an.SINGLE:
111923
111925
  case an.MULTIPLE:
111924
- return () => c.current.some((y) => y.selected);
111926
+ return () => l.current.some((b) => b.selected);
111925
111927
  default:
111926
111928
  return () => !0;
111927
111929
  }
111928
111930
  }, [e.answerType]);
111929
111931
  At(() => {
111930
- e.partDuration && !t && p(!0);
111932
+ e.partDuration && !t && m(!0);
111931
111933
  }, [t]);
111932
- const m = (y) => {
111933
- c.current = y || "", d(h);
111934
+ const g = (b) => {
111935
+ l.current = b || "", p(y);
111934
111936
  };
111935
111937
  return M.createElement(
111936
111938
  "div",
@@ -111943,8 +111945,8 @@ const Mlt = (e) => {
111943
111945
  ),
111944
111946
  M.createElement(JR, { questionObj: e }),
111945
111947
  M.createElement(Llt, { currentQuestionObj: e }),
111946
- M.createElement(u, Object.assign({ answerOptions: f, onAnswer: m }, e.answerType === an.TEXT && { maxChars: (a = e.config) === null || a === void 0 ? void 0 : a.maxChars })),
111947
- M.createElement(jo, { disabled: !l, className: "myinterview-widget-assessment__submit-button", onClick: () => p(!1) }, s("buttons.SUBMIT"))
111948
+ M.createElement(d, Object.assign({ answerOptions: h, onAnswer: g }, e.answerType === an.TEXT && { maxChars: (s = e.config) === null || s === void 0 ? void 0 : s.maxChars, antiCheat: i || ((c = e.config) === null || c === void 0 ? void 0 : c.antiCheat) })),
111949
+ M.createElement(jo, { disabled: !f, className: "myinterview-widget-assessment__submit-button", onClick: () => m(!1) }, u("buttons.SUBMIT"))
111948
111950
  );
111949
111951
  }, Wlt = ({ onContinue: e }) => {
111950
111952
  const { t } = Jn();
@@ -112023,7 +112025,7 @@ const Mlt = (e) => {
112023
112025
  { className: nt },
112024
112026
  x && M.createElement(qQe, { isVideoQuestion: !!(L != null && L.videoQuestion), isAssessment: ie, timeLimit: ie ? L.partDuration : L.thinkingTime, answerType: L.answerType || an.VIDEO, duration: L.partDuration, takes: L.numOfRetakes }),
112025
112027
  M.createElement(Ast, { recordWithoutVideo: I, myinterviewRef: u, ref: l, microphoneRef: Q, isCameraDisplayed: fe, isPracticeModeDisplayed: !le && Re, errorType: ot, isPermissionStepsOpen: n, onDisplayPermissionSteps: o, onReInitRecorder: c, onClosePermissionSteps: a, onRecorderRetry: ce ? s : c, isRecorderCanChangeSettings: zt, videoDevices: F, audioDevices: re, selectedVideoDevice: J, selectedAudioDevice: G, handleDeviceChange: Ht, canStartRecording: De, currentQuestion: E, numberOfQuestions: T.length, currentQuestionObj: L, isRecording: Re, durations: N, recordingTime: C, isCountDown: _e, countdown: P, isQuestionDisplayed: Vt, isAssessment: ie }),
112026
- pe && !!(L != null && L.answerType) && (L == null ? void 0 : L.answerType) !== an.VIDEO && M.createElement(Hlt, { currentQuestionObj: L, timer: k, currentQuestion: E, numberOfQuestions: T.length, onSubmitAssessment: Qn }),
112028
+ pe && !!(L != null && L.answerType) && (L == null ? void 0 : L.answerType) !== an.VIDEO && M.createElement(Hlt, { currentQuestionObj: L, timer: k, currentQuestion: E, numberOfQuestions: T.length, onSubmitAssessment: Qn, antiCheat: !!O.config.antiCheat }),
112027
112029
  ue && M.createElement(Wlt, { onContinue: Je }),
112028
112030
  (xe || x && !!(L != null && L.videoQuestion)) && M.createElement(bse, { src: (L == null ? void 0 : L.videoQuestion) || "", isThinkingTime: U, onVideoEnds: Fr, isWidgetMinimized: i, hidden: x, onVideoStateChanged: mi }),
112029
112031
  b && $e && M.createElement(gst, { myinterviewRef: u, previewRef: b, onNextQuestion: qn, onNextRetake: et, onQuestionMode: Be, isRetakeAvailable: at, totalRetakes: he, isQuestionMode: le, isLastQuestion: Ve, isConnected: w, currentQuestion: E, numberOfQuestions: T.length }),
@@ -119734,7 +119736,7 @@ const Umt = ({ messageType: e }) => {
119734
119736
  var { children: r } = e, n = $Ke(e, ["children"]);
119735
119737
  return M.createElement("div", Object.assign({ ref: t }, n), r);
119736
119738
  }), zmt = IT(({ candidate: e, job: t, video: r, config: n, disabled: i = !1, buttonText: o = "START INTERVIEW", buttonStyle: a = {}, children: s, styleUrls: c = [], fontsUrls: u = [] }, l) => {
119737
- const d = "1.1.47", [f, p] = St(!1), [h, m] = St(!1), [y, g] = St(!1), b = dt(null), T = dt(null), E = dt(null), [S, _] = St(!1), [w, v] = St(!1), { setSitekey: O, shutdown: $ } = Fmt();
119739
+ const d = "1.1.49", [f, p] = St(!1), [h, m] = St(!1), [y, g] = St(!1), b = dt(null), T = dt(null), E = dt(null), [S, _] = St(!1), [w, v] = St(!1), { setSitekey: O, shutdown: $ } = Fmt();
119738
119740
  At(() => (oZe && PXe().then((L) => {
119739
119741
  g(L.browserName === "Chrome" && L.isPrivate && Fn);
119740
119742
  }), b.current && b.current.shadowRoot && (v(typeof s == "object" && s.type === "style"), (Array.isArray(u) ? u : [u]).concat(Ost).forEach((L) => {
@@ -119837,51 +119839,52 @@ const Umt = ({ messageType: e }) => {
119837
119839
  )
119838
119840
  )
119839
119841
  );
119840
- }), Vmt = ({ completed: e }) => {
119841
- const t = qr((y) => y.chatbotConfig.auth), r = qr((y) => y.chatbotConfig.env), n = qr((y) => y.main.selectedConversationId), [i, o] = St(), a = dt(null), s = dt(null), [c, u] = St({ width: "0px", height: "0px", top: "0px", left: "0px" }), [l, d] = St("Start Interview");
119842
+ }), Vmt = ({ completed: e, data: t }) => {
119843
+ const r = qr((g) => g.chatbotConfig.auth), n = qr((g) => g.chatbotConfig.env), i = qr((g) => g.main.selectedConversationId), [o, a] = St(), s = dt(null), c = dt(null), [u, l] = St({ width: "0px", height: "0px", top: "0px", left: "0px" }), [d, f] = St("Start Interview");
119842
119844
  At(() => {
119843
- var g;
119844
- const y = (g = Ac.get(n)) == null ? void 0 : g.attributes;
119845
- o({
119846
- video_id: y.video_id,
119847
- candidate_id: y.candidate_id,
119848
- username: y.username,
119849
- email: y.email
119845
+ var b;
119846
+ const g = (b = Ac.get(i)) == null ? void 0 : b.attributes;
119847
+ a({
119848
+ video_id: g.video_id,
119849
+ candidate_id: g.candidate_id,
119850
+ username: g.username,
119851
+ email: g.email
119850
119852
  });
119851
119853
  }, []);
119852
- const f = () => {
119853
- if (!s.current)
119854
+ const p = () => {
119855
+ if (!c.current)
119854
119856
  return;
119855
- const { width: y, height: g, top: b, left: T } = s.current.getBoundingClientRect();
119856
- u({
119857
- width: `${y}px`,
119858
- height: `${g}px`,
119859
- top: `${b}px`,
119860
- left: `${T}px`
119857
+ const { width: g, height: b, top: T, left: E } = c.current.getBoundingClientRect();
119858
+ l({
119859
+ width: `${g}px`,
119860
+ height: `${b}px`,
119861
+ top: `${T}px`,
119862
+ left: `${E}px`
119861
119863
  });
119862
- }, p = () => {
119863
- var y;
119864
- qse(f), (y = a.current) == null || y.open();
119865
- }, h = () => d("Resume Interview"), m = () => {
119866
- d("Interview Completed");
119864
+ }, h = () => {
119865
+ var g;
119866
+ qse(p), (g = s.current) == null || g.open();
119867
+ }, m = () => f("Resume Interview"), y = () => {
119868
+ f("Interview Completed");
119867
119869
  };
119868
- return At(f, [l]), kt("div", { className: "myinterview-chatbot-widget", children: [Se(Wc, { ref: s, size: "small", onClick: p, disabled: e, children: l }), Mb(Se(zmt, { disabled: e, ref: a, buttonStyle: {
119870
+ return At(p, [d]), kt("div", { className: "myinterview-chatbot-widget", children: [Se(Wc, { ref: c, size: "small", onClick: h, disabled: e, children: d }), Mb(Se(zmt, { disabled: e, ref: s, buttonStyle: {
119869
119871
  position: "fixed",
119870
119872
  visibility: "hidden",
119871
119873
  pointerEvents: "none",
119872
- ...c
119874
+ ...u
119873
119875
  }, config: {
119874
- auth: t,
119875
- env: r,
119876
+ auth: r,
119877
+ env: n,
119876
119878
  minimizable: !0,
119877
119879
  useLightDom: !0,
119878
- onWidgetClicked: h,
119879
- onFinish: m
119880
+ antiCheat: t.antiCheat,
119881
+ onWidgetClicked: m,
119882
+ onFinish: y
119880
119883
  }, candidate: {
119881
- candidate_id: i == null ? void 0 : i.candidate_id,
119882
- username: (i == null ? void 0 : i.username) ?? "",
119883
- email: (i == null ? void 0 : i.email) ?? ""
119884
- }, job: {}, video: { video_id: i == null ? void 0 : i.video_id } }), document.body)] });
119884
+ candidate_id: o == null ? void 0 : o.candidate_id,
119885
+ username: (o == null ? void 0 : o.username) ?? "",
119886
+ email: (o == null ? void 0 : o.email) ?? ""
119887
+ }, job: {}, video: { video_id: o == null ? void 0 : o.video_id } }), document.body)] });
119885
119888
  }, Hmt = (e) => {
119886
119889
  const t = /* @__PURE__ */ new Map();
119887
119890
  return e.available_slots.forEach(({ start: r }) => {
@@ -120426,7 +120429,7 @@ const kT = {
120426
120429
  pde() && fde(), r2e({
120427
120430
  dsn: gm.SENTRY_DSN,
120428
120431
  environment: "production",
120429
- release: "0.1.61",
120432
+ release: "0.1.62",
120430
120433
  integrations: [
120431
120434
  Cye(),
120432
120435
  gye()