@sprig-technologies/sprig-bundled 2.44.1 → 2.45.0

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.
@@ -1,7 +1,7 @@
1
- import { u as G, a as n, h as Z, c as A, b as K, e as re, g as Oe, p as ae, F as ye, _ as se, T as be, A as wn, M as xe, d as je, f as En, P as jn, m as In, n as Ze, o as Tn, S as _n, D as Ne, w as on, v as Dn } from "./view-Bu60Bbor.js";
2
- import { v as Sn, E as _e, h as Ae, A as $e, j as Pn, i as sn } from "./index-Rlf7G5CR.js";
3
- import { B as oe, M as ie, b as de, O as He, Q as ce, S as Rn, L as Ln, u as Nn, a as Ce, H as Ve, g as Mn, c as Bn } from "./getAttributedUrl-BAasxYeK.js";
4
- const pe = "https://cdn.sprig.com", I = { document: void 0, videojs: void 0 }, Fe = (e) => e + "-loading-spiner", W = "hidden", Ye = ".m3u8", De = "questionId", Se = "ul-video-recorder-camera-off-button", Pe = "ul-recording-in-session", qn = [{ type: "link", content: `${pe}/dependencies/videojs-record-4.5.0.min.css` }, { type: "script", content: `${pe}/dependencies/RecordRTC-5.6.2.js` }, { type: "script", content: `${pe}/dependencies/adapter.8.0.0.min.js` }, { type: "script", content: `${pe}/dependencies/videojs-record-4.5.0.min.js` }, { type: "script", content: `${pe}/userleap-web-upchunk-v2.2.2.js` }], an = [{ type: "link", content: `${pe}/dependencies/video-js-7.18.0.min.css` }, { type: "script", content: `${pe}/dependencies/video-js-7.18.0.min.js` }, { type: "style", content: `/* progress control styles */
1
+ import { u as G, a as n, h as Z, c as A, b as K, e as re, g as Oe, p as ae, F as ye, _ as se, T as be, A as kn, M as xe, d as je, f as wn, P as En, m as jn, n as In, o as Tn, S as _n, D as Re, x as rn, w as Dn, v as Sn } from "./view-Cu4weTLz.js";
2
+ import { v as Pn, E as _e, h as Ae, A as $e, j as Ln, i as on } from "./index-Czvv7meW.js";
3
+ import { B as oe, M as ie, b as de, O as He, Q as ce, S as Nn, L as Rn, u as Mn, a as Ce, H as Ve, g as Bn, c as qn } from "./getAttributedUrl-Dq1b-gQL.js";
4
+ const pe = "https://cdn.sprig.com", I = { document: void 0, videojs: void 0 }, Fe = (e) => e + "-loading-spiner", W = "hidden", Ze = ".m3u8", De = "questionId", Se = "ul-video-recorder-camera-off-button", Pe = "ul-recording-in-session", Un = [{ type: "link", content: `${pe}/dependencies/videojs-record-4.5.0.min.css` }, { type: "script", content: `${pe}/dependencies/RecordRTC-5.6.2.js` }, { type: "script", content: `${pe}/dependencies/adapter.8.0.0.min.js` }, { type: "script", content: `${pe}/dependencies/videojs-record-4.5.0.min.js` }, { type: "script", content: `${pe}/userleap-web-upchunk-v2.2.2.js` }], sn = [{ type: "link", content: `${pe}/dependencies/video-js-7.18.0.min.css` }, { type: "script", content: `${pe}/dependencies/video-js-7.18.0.min.js` }, { type: "style", content: `/* progress control styles */
5
5
  .video-js .vjs-control {
6
6
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
7
7
  }
@@ -658,23 +658,23 @@ span.ul-button-text {
658
658
  .vjs-poster {
659
659
  background-size: cover;
660
660
  }
661
- ` }], ln = "-video-player", We = "-secondary-video-player", Ke = "-video-recorder";
662
- let ne, Je;
661
+ ` }], an = "-video-player", Ye = "-secondary-video-player", We = "-video-recorder";
662
+ let ne, Ke;
663
663
  const ue = async ({ event: e, apiBase: o, headers: t, visitorId: r, envId: i, metadata: s }) => {
664
664
  const d = I.document.documentElement;
665
665
  if (!r || !i) return;
666
- const p = { event: `SDK - ${e}`, visitorId: r, environmentId: i, metadata: { ...s || {}, screenWidth: window.screen.width, screenHeight: window.screen.height, clientWidth: d.clientWidth, clientHeight: d.clientHeight, location: window.location.href, language: navigator.language } };
667
- (await fetch(`${o}/sdk/1/visitors/${r}/analytics`, { method: "POST", cache: "no-cache", headers: t, body: JSON.stringify(p) })).ok || console.warn("[Sprig] (ERR-444) Failed to track analytics", e);
666
+ const u = { event: `SDK - ${e}`, visitorId: r, environmentId: i, metadata: { ...s || {}, screenWidth: window.screen.width, screenHeight: window.screen.height, clientWidth: d.clientWidth, clientHeight: d.clientHeight, location: window.location.href, language: navigator.language } };
667
+ (await fetch(`${o}/sdk/1/visitors/${r}/analytics`, { method: "POST", cache: "no-cache", headers: t, body: JSON.stringify(u) })).ok || console.warn("[Sprig] (ERR-444) Failed to track analytics", e);
668
668
  }, le = async (e, o, t, r, i, s) => {
669
669
  ue({ event: `Video Error ${o}`, apiBase: t, headers: r, visitorId: i, envId: s, metadata: { errorMessage: e.message } });
670
- const d = I.document.documentElement, p = { screenWidth: window.screen.width, screenHeight: window.screen.height, clientWidth: d.clientWidth, clientHeight: d.clientHeight, location: window.location.href, language: navigator.language }, a = { action: o, err: { message: e.message, stack: e.stack }, meta: p, vid: i, envId: s };
670
+ const d = I.document.documentElement, u = { screenWidth: window.screen.width, screenHeight: window.screen.height, clientWidth: d.clientWidth, clientHeight: d.clientHeight, location: window.location.href, language: navigator.language }, a = { action: o, err: { message: e.message, stack: e.stack }, meta: u, vid: i, envId: s };
671
671
  (await fetch(`${t}/sdk/1/errors`, { method: "POST", cache: "no-cache", headers: { ...r, "userleap-platform": "video_recorder", "x-ul-error": window.btoa(`userleap-${Date.now()}-error`) }, body: JSON.stringify(a) })).ok || console.warn("[Sprig] (ERR-444) Failed to report error to API", e);
672
- }, dn = (e, o) => {
672
+ }, ln = (e, o) => {
673
673
  if (e.length === 0) return o && o();
674
- Promise.all(e.reduce((t, r) => (t.push(((i, { type: s, content: d }) => new Promise(function(p, a) {
674
+ Promise.all(e.reduce((t, r) => (t.push(((i, { type: s, content: d }) => new Promise(function(u, a) {
675
675
  let v;
676
676
  s === "script" ? (v = I.document.createElement("script"), v.src = d) : s === "link" ? (v = I.document.createElement("link"), v.rel = "stylesheet", v.href = d, v.type = "text/css") : (v = I.document.createElement("style"), v.innerHTML = d), v.onload = function() {
677
- p(d);
677
+ u(d);
678
678
  }, v.onerror = function() {
679
679
  a(d);
680
680
  }, v.async = !1, v.id = btoa(d), i.appendChild(v);
@@ -683,22 +683,22 @@ const ue = async ({ event: e, apiBase: o, headers: t, visitorId: r, envId: i, me
683
683
  }).catch(function(t) {
684
684
  console.log(t + " failed to load");
685
685
  });
686
- }, Xe = (e, o, t) => {
686
+ }, Je = (e, o, t) => {
687
687
  if (o === "start" && (e.style.visibility = "visible"), o === "none") e.style.visibility = W;
688
688
  else if (o === "success") e.style.visibility = W, e.innerHTML = "Upload succeeded!";
689
689
  else {
690
690
  const r = Math.round(parseFloat(t));
691
691
  e.innerHTML = `Uploading <span class="ul-upload-progress-label__time">${r}%</span>`, e.style.background = `linear-gradient(to right, #E0E0EB 0%, #E0E0EB ${r}%, #FCFCFD ${r}%, #FCFCFD 100%)`;
692
692
  }
693
- }, Re = (e, o) => {
693
+ }, Le = (e, o) => {
694
694
  const t = I.videojs(e.id());
695
695
  return t == null ? void 0 : t.payload[o];
696
- }, cn = (e, o) => {
696
+ }, dn = (e, o) => {
697
697
  const t = new (I.videojs.getComponent("Component"))(e);
698
698
  return t.addClass("ul-buttons-panel"), o.map((r) => {
699
699
  t.addChild(r);
700
- }), Un(t), t;
701
- }, Un = (e) => {
700
+ }), On(t), t;
701
+ }, On = (e) => {
702
702
  e.children().forEach((o) => {
703
703
  if (X[o.name_]) {
704
704
  const t = ke(X[o.name_], `ul-${X[o.name_]}`);
@@ -708,13 +708,13 @@ const ue = async ({ event: e, apiBase: o, headers: t, visitorId: r, envId: i, me
708
708
  }, ke = (e, o = "") => {
709
709
  const t = I.document.createElement("span");
710
710
  return t.className = "ul-button-text", t.innerHTML = e, t.id = o, t;
711
- }, un = (e, o, t, r, i = !1, s) => {
711
+ }, cn = (e, o, t, r, i = !1, s) => {
712
712
  e.addClass("ul-video-player");
713
713
  const d = new (I.videojs.getComponent("Component"))(e);
714
714
  d.addClass("ul-control-panel"), e.progressBar = d.addChild("ProgressControl"), t && e.src(t), e.audioPlayerPlaceholder = new (I.videojs.getComponent("Component"))(e), e.audioPlayerPlaceholder.addClass("ul-audio-recorder-placeholder");
715
- const p = t && t.src ? Hn(t.src) : null;
716
- !t || !i && p ? (e.audioPlayerPlaceholder.hide(), I.document.getElementById(`${e.id()}_html5_api`).style.height = "100%", p && e.poster(p)) : (e.children()[0].classList.add("vjs-hidden"), I.document.getElementById(`${e.id()}_html5_api`).style.height = "0px"), e.on("play", () => {
717
- i || !t || p || An(e), s == null || s.play();
715
+ const u = t && t.src ? Vn(t.src) : null;
716
+ !t || !i && u ? (e.audioPlayerPlaceholder.hide(), I.document.getElementById(`${e.id()}_html5_api`).style.height = "100%", u && e.poster(u)) : (e.children()[0].classList.add("vjs-hidden"), I.document.getElementById(`${e.id()}_html5_api`).style.height = "0px"), e.on("play", () => {
717
+ i || !t || u || $n(e), s == null || s.play();
718
718
  }), e.on("pause", () => {
719
719
  s == null || s.pause();
720
720
  }), e.on("seeked", () => {
@@ -722,112 +722,112 @@ const ue = async ({ event: e, apiBase: o, headers: t, visitorId: r, envId: i, me
722
722
  }), e.on("ratechange", () => {
723
723
  s == null || s.playbackRate(e.playbackRate());
724
724
  }), e.addChild(e.audioPlayerPlaceholder, {}, 1), d.addChild(o), e.addChild(d), r && r(e);
725
- }, On = (e, o, t, r, i, s, d, p = !1) => {
726
- Je = Date.now();
725
+ }, An = (e, o, t, r, i, s, d, u = !1) => {
726
+ Ke = Date.now();
727
727
  const a = we(o, { controls: !1, bigPlayButton: !1, fluid: !1, width: 1280, height: 720, playsinline: !0, plugins: { record: { audio: !0, video: { mandatory: { minWidth: 1280, minHeight: 720 } }, frameWidth: 1280, frameHeight: 720, maxLength: 600, autoMuteDevice: !0 } } });
728
728
  if (!a) return;
729
729
  a.payload = t;
730
730
  const { surveyId: v, questionId: y, responseGroupUid: c, visitorId: g, envId: w } = t;
731
- let x;
731
+ let C;
732
732
  const b = (l) => {
733
- const u = Se, C = Se + "-audio-only";
734
- Xe(a.uploadProgressLabel, "none"), ne && ne.startTime >= Je && ne.abort();
735
- const D = I.document.getElementById("ul-camera-button");
736
- l ? (a.children()[0].classList.add("vjs-hidden"), L.removeClass(u), L.addClass(C), D.innerHTML = X.TurnOnCamera, a.audioPlayerPlaceholder.removeClass("vjs-hidden"), x == null || x.getTracks().forEach((j) => {
733
+ const p = Se, x = Se + "-audio-only";
734
+ Je(a.uploadProgressLabel, "none"), ne && ne.startTime >= Ke && ne.abort();
735
+ const S = I.document.getElementById("ul-camera-button");
736
+ l ? (a.children()[0].classList.add("vjs-hidden"), N.removeClass(p), N.addClass(x), S.innerHTML = X.TurnOnCamera, a.audioPlayerPlaceholder.removeClass("vjs-hidden"), C == null || C.getTracks().forEach((j) => {
737
737
  j.stop();
738
738
  }), window.navigator.mediaDevices.getUserMedia({ video: !0, audio: !0 }).then((j) => {
739
- x = j, j.getVideoTracks().forEach((M) => {
739
+ C = j, j.getVideoTracks().forEach((M) => {
740
740
  M.enabled = !1;
741
741
  }), a.record().onDeviceReady(j);
742
- }).catch(a.record().onDeviceError.bind(a.record()))) : (x == null || x.getVideoTracks().forEach((j) => {
742
+ }).catch(a.record().onDeviceError.bind(a.record()))) : (C == null || C.getVideoTracks().forEach((j) => {
743
743
  j.enabled = !0;
744
- }), a.children()[0].classList.remove("vjs-hidden"), a.record().getDevice(), L.removeClass(C), L.addClass(u), D.innerHTML = X.TurnOffCamera, a.audioPlayerPlaceholder.addClass("vjs-hidden"));
744
+ }), a.children()[0].classList.remove("vjs-hidden"), a.record().getDevice(), N.removeClass(x), N.addClass(p), S.innerHTML = X.TurnOffCamera, a.audioPlayerPlaceholder.addClass("vjs-hidden"));
745
745
  }, f = new (I.videojs.getComponent("Button"))(a, { clickHandler: () => {
746
- f.hasClass(W) || (ue({ event: "Video Delete Button Clicked", apiBase: r, headers: d, visitorId: g, envId: w, metadata: { questionId: y, responseGroupUid: c, surveyId: v } }), b(a.cameraOff), i(R.DELETE, {}), L.removeClass(W), f.addClass(W));
746
+ f.hasClass(W) || (ue({ event: "Video Delete Button Clicked", apiBase: r, headers: d, visitorId: g, envId: w, metadata: { questionId: y, responseGroupUid: c, surveyId: v } }), b(a.cameraOff), i(L.DELETE, {}), N.removeClass(W), f.addClass(W));
747
747
  } });
748
748
  f.addClass("ul-video-recorder-delete-button"), f.el_.appendChild(ke(X.DeleteButton, "ul-delete-button"));
749
- const _ = I.document.getElementById(o), N = () => {
749
+ const _ = I.document.getElementById(o), R = () => {
750
750
  _.classList.contains("vjs-fullscreen") && a.cameraOff ? _.style.display = "table" : _.style.display = "flex";
751
751
  };
752
- N();
753
- const L = new (I.videojs.getComponent("Button"))(a, { clickHandler: () => {
754
- a.record().isRecording() || (a.cameraOff = !a.cameraOff, ue({ event: "Video Camera Button Clicked", apiBase: r, headers: d, visitorId: t.visitorId, envId: t.envId, metadata: { questionId: y, responseGroupUid: c, surveyId: v, cameraOff: a.cameraOff } }), b(a.cameraOff), !f.hasClass(W) && f.addClass(W), i(R.DELETE, {}), N());
752
+ R();
753
+ const N = new (I.videojs.getComponent("Button"))(a, { clickHandler: () => {
754
+ a.record().isRecording() || (a.cameraOff = !a.cameraOff, ue({ event: "Video Camera Button Clicked", apiBase: r, headers: d, visitorId: t.visitorId, envId: t.envId, metadata: { questionId: y, responseGroupUid: c, surveyId: v, cameraOff: a.cameraOff } }), b(a.cameraOff), !f.hasClass(W) && f.addClass(W), i(L.DELETE, {}), R());
755
755
  } });
756
- L.addClass(Se), L.el_.appendChild(ke(X.TurnOffCamera, "ul-camera-button"));
756
+ N.addClass(Se), N.el_.appendChild(ke(X.TurnOffCamera, "ul-camera-button"));
757
757
  const T = new (I.videojs.getComponent("Button"))(a, { clickHandler: () => {
758
758
  const l = I.document.getElementById("ul-recorder-toggle");
759
759
  if (a.record().isRecording()) a.record().stop(), l && (l.innerHTML = X.RecordButton), T.removeClass(Pe), f.removeClass(W);
760
760
  else {
761
- const u = I.document.getElementById("ul-recording-countdown-screen");
762
- if (u) u.remove(), l && (l.innerHTML = X.RecordButton), b(a.cameraOff), i(R.DELETE, {}), L.removeClass(W), f.addClass(W), T.removeClass(Pe), m.show();
761
+ const p = I.document.getElementById("ul-recording-countdown-screen");
762
+ if (p) p.remove(), l && (l.innerHTML = X.RecordButton), b(a.cameraOff), i(L.DELETE, {}), N.removeClass(W), f.addClass(W), T.removeClass(Pe), m.show();
763
763
  else {
764
- T.addClass(Pe), m.hide(), L.addClass(W), f.addClass(W), l && (l.innerHTML = X.StopButton);
765
- const C = I.document.createElement("div");
766
- C.id = "ul-recording-countdown-screen", _.insertBefore(C, _.children[1]), C.style.height = `${_.offsetHeight}px`, pn(a, 3);
764
+ T.addClass(Pe), m.hide(), N.addClass(W), f.addClass(W), l && (l.innerHTML = X.StopButton);
765
+ const x = I.document.createElement("div");
766
+ x.id = "ul-recording-countdown-screen", _.insertBefore(x, _.children[1]), x.style.height = `${_.offsetHeight}px`, un(a, 3);
767
767
  }
768
768
  }
769
769
  } });
770
770
  T.addClass("ul-video-recorder-toggle-button"), T.el_.appendChild(ke(X.RecordButton, "ul-recorder-toggle"));
771
771
  const H = I.document.createElement("p");
772
772
  H.style.visibility = "hidden", H.className = "ul-upload-progress-label", e.appendChild(H), a.uploadProgressLabel = H;
773
- const $ = cn(a, [f, L, "PlayToggle", T, "FullscreenToggle"]), m = $.children().find((l) => l.name_ === "FullscreenToggle");
773
+ const $ = dn(a, [f, N, "PlayToggle", T, "FullscreenToggle"]), m = $.children().find((l) => l.name_ === "FullscreenToggle");
774
774
  m.hasClass("vjs-disabled") && m.hide();
775
775
  const h = $.children().find((l) => l.name_ === "PlayToggle");
776
- h.hide(), f.addClass(W), un(a, $, s, !1, p), a.on("stopRecord", () => {
776
+ h.hide(), f.addClass(W), cn(a, $, s, !1, u), a.on("stopRecord", () => {
777
777
  T.hide(), h.show(), m.show(), f.removeClass(W);
778
778
  }), a.on("deviceReady", () => {
779
779
  T.show(), h.hide(), f.addClass(W);
780
- }), ((l, u, C, D, j) => {
780
+ }), ((l, p, x, S, j) => {
781
781
  const { surveyId: M, responseGroupUid: O, visitorId: B, envId: q } = l.payload;
782
782
  l.on("deviceError", function() {
783
- console.warn("device error: ", l.deviceErrorCode), l.deviceErrorCode.message === "Permission denied" ? (l.deviceButton.addClass("permission-denied"), C && C(R.ERROR, { type: R.PERMISSION_DENIED }), ue({ event: "Video Permission Denied", apiBase: u, headers: j, visitorId: B, envId: q, metadata: { questionId: Re(l, De), responseGroupUid: O, surveyId: M } })) : (C && C(R.ERROR, { type: R.OTHER }), le(new Error(l.deviceErrorCode.message), "recorderDeviceError", u, j, B, q));
783
+ console.warn("device error: ", l.deviceErrorCode), l.deviceErrorCode.message === "Permission denied" ? (l.deviceButton.addClass("permission-denied"), x && x(L.ERROR, { type: L.PERMISSION_DENIED }), ue({ event: "Video Permission Denied", apiBase: p, headers: j, visitorId: B, envId: q, metadata: { questionId: Le(l, De), responseGroupUid: O, surveyId: M } })) : (x && x(L.ERROR, { type: L.OTHER }), le(new Error(l.deviceErrorCode.message), "recorderDeviceError", p, j, B, q));
784
784
  }), l.on("error", function(Q, Y) {
785
- le(Y || l.error(), "recorderError", u, j, B, q);
785
+ le(Y || l.error(), "recorderError", p, j, B, q);
786
786
  }), l.on("startRecord", function(Q, Y) {
787
- D(l.uploadProgressLabel, "none"), ue({ event: "Video Record Start", apiBase: u, headers: j, visitorId: B, envId: q, metadata: { questionId: Re(l, De), responseGroupUid: O, surveyId: M } });
787
+ S(l.uploadProgressLabel, "none"), ue({ event: "Video Record Start", apiBase: p, headers: j, visitorId: B, envId: q, metadata: { questionId: Le(l, De), responseGroupUid: O, surveyId: M } });
788
788
  }), l.on("finishRecord", async function() {
789
- D(l.uploadProgressLabel, "start", 0);
790
- const Q = Re(l, De);
789
+ S(l.uploadProgressLabel, "start", 0);
790
+ const Q = Le(l, De);
791
791
  if (!M) {
792
- const S = "internal error: missing fields in payload";
793
- return C && C(R.ERROR, { type: R.OTHER }), le(new Error(S), "finishRecord", u, j, B, q), null;
792
+ const D = "internal error: missing fields in payload";
793
+ return x && x(L.ERROR, { type: L.OTHER }), le(new Error(D), "finishRecord", p, j, B, q), null;
794
794
  }
795
795
  l.record().stopDevice();
796
- const Y = l.cameraOff ? R.MEDIA_TYPE_AUDIO : R.MEDIA_TYPE_VIDEO, ee = Sn();
797
- ue({ event: "Video Record Finish", apiBase: u, headers: j, visitorId: B, envId: q, metadata: { mediaRecordingUid: ee, questionId: Q, responseGroupUid: O, surveyId: M, mediaType: Y } });
796
+ const Y = l.cameraOff ? L.MEDIA_TYPE_AUDIO : L.MEDIA_TYPE_VIDEO, ee = Pn();
797
+ ue({ event: "Video Record Finish", apiBase: p, headers: j, visitorId: B, envId: q, metadata: { mediaRecordingUid: ee, questionId: Q, responseGroupUid: O, surveyId: M, mediaType: Y } });
798
798
  const ve = { surveyId: M, updatedAt: (/* @__PURE__ */ new Date()).toISOString(), mediaType: Y, mediaRecordingUid: ee };
799
799
  Q && (ve.questionId = Q), O && (ve.responseGroupUid = O), B && (ve.visitorId = B);
800
800
  const E = await (async () => {
801
- const S = await fetch(`${u}/2/environments/integrations/upload`, { method: "POST", cache: "no-cache", headers: { "Content-Type": "application/json" }, body: JSON.stringify(ve) });
802
- if (S.ok) {
803
- const U = await S.json();
804
- return C && C(R.UPLOAD_STARTED, { [R.UPLOAD_ID]: U.upload.id, [R.MEDIA_TYPE]: Y, [R.MEDIA_RECORDING_UID]: ee }), U.upload.url;
801
+ const D = await fetch(`${p}/2/environments/integrations/upload`, { method: "POST", cache: "no-cache", headers: { "Content-Type": "application/json" }, body: JSON.stringify(ve) });
802
+ if (D.ok) {
803
+ const U = await D.json();
804
+ return x && x(L.UPLOAD_STARTED, { [L.UPLOAD_ID]: U.upload.id, [L.MEDIA_TYPE]: Y, [L.MEDIA_RECORDING_UID]: ee }), U.upload.url;
805
805
  }
806
- return C && C(R.ERROR, { type: R.OTHER, response: S }), le(new Error("failed to get upload response with url"), "finishRecord", u, j, B, q), null;
806
+ return x && x(L.ERROR, { type: L.OTHER, response: D }), le(new Error("failed to get upload response with url"), "finishRecord", p, j, B, q), null;
807
807
  })();
808
- E && (ne = I.document.defaultView.UpChunk.createUpload({ endpoint: E, file: new I.document.defaultView.File([l.recordedData], `recording ${Y} ${Date.now()}`), chunkSize: 5120 }), ne.startTime = Date.now(), ue({ event: "Video Upload Start", apiBase: u, headers: j, visitorId: B, envId: q, metadata: { mediaRecordingUid: ee, questionId: Q, responseGroupUid: O, surveyId: M, mediaType: Y, url: E } }), ne.on("error", (S) => {
809
- D(l.uploadProgressLabel, "none"), C && C(R.UPLOAD_FINISHED, { [R.MEDIA_RECORDING_UID]: ee }), le(S, "finishRecord", u, j, B, q);
810
- }), ne.on("progress", (S) => {
811
- C && C(R.UPLOAD_PROGRESS, { [R.MEDIA_RECORDING_UID]: ee, [R.UPLOAD_PROGRESS_PCT]: S.detail }), D(l.uploadProgressLabel, "progress", S.detail);
808
+ E && (ne = I.document.defaultView.UpChunk.createUpload({ endpoint: E, file: new I.document.defaultView.File([l.recordedData], `recording ${Y} ${Date.now()}`), chunkSize: 5120 }), ne.startTime = Date.now(), ue({ event: "Video Upload Start", apiBase: p, headers: j, visitorId: B, envId: q, metadata: { mediaRecordingUid: ee, questionId: Q, responseGroupUid: O, surveyId: M, mediaType: Y, url: E } }), ne.on("error", (D) => {
809
+ S(l.uploadProgressLabel, "none"), x && x(L.UPLOAD_FINISHED, { [L.MEDIA_RECORDING_UID]: ee }), le(D, "finishRecord", p, j, B, q);
810
+ }), ne.on("progress", (D) => {
811
+ x && x(L.UPLOAD_PROGRESS, { [L.MEDIA_RECORDING_UID]: ee, [L.UPLOAD_PROGRESS_PCT]: D.detail }), S(l.uploadProgressLabel, "progress", D.detail);
812
812
  }), ne.on("success", () => {
813
- D(l.uploadProgressLabel, "success"), C && C(R.UPLOAD_FINISHED, { [R.MEDIA_RECORDING_UID]: ee }), ue({ event: "Video Upload Success", apiBase: u, headers: j, visitorId: B, envId: q, metadata: { mediaRecordingUid: ee, questionId: Q, responseGroupUid: O, surveyId: M, mediaType: Y, url: E, elapsedMs: ne.startTime && Date.now() - ne.startTime } });
813
+ S(l.uploadProgressLabel, "success"), x && x(L.UPLOAD_FINISHED, { [L.MEDIA_RECORDING_UID]: ee }), ue({ event: "Video Upload Success", apiBase: p, headers: j, visitorId: B, envId: q, metadata: { mediaRecordingUid: ee, questionId: Q, responseGroupUid: O, surveyId: M, mediaType: Y, url: E, elapsedMs: ne.startTime && Date.now() - ne.startTime } });
814
814
  }));
815
815
  });
816
- })(a, r, i, Xe, d);
816
+ })(a, r, i, Je, d);
817
817
  const k = [{ name: "microphone" }];
818
818
  !a.cameraOff && k.push({ name: "camera" }), Promise.all(k.map((l) => {
819
- var u;
820
- return (u = navigator == null ? void 0 : navigator.permissions) == null ? void 0 : u.query(l);
819
+ var p;
820
+ return (p = navigator == null ? void 0 : navigator.permissions) == null ? void 0 : p.query(l);
821
821
  })).then((l) => {
822
- l.reduce((u, C) => u & C.state === "granted", !0) && a && (a.deviceButton && a.deviceButton.hide(), a.record().getDevice());
822
+ l.reduce((p, x) => p & x.state === "granted", !0) && a && (a.deviceButton && a.deviceButton.hide(), a.record().getDevice());
823
823
  }).catch((l) => {
824
824
  });
825
- }, pn = (e, o = 3) => {
825
+ }, un = (e, o = 3) => {
826
826
  const t = I.document.getElementById("ul-recording-countdown-screen");
827
827
  t && o === 0 ? (t.remove(), e.record().start()) : t && (t.innerHTML = `<span class='ul-countdown-text'>Recording in... ${o}</span>`, setTimeout(() => {
828
- pn(e, o - 1);
828
+ un(e, o - 1);
829
829
  }, 1e3));
830
- }, mn = (e) => {
830
+ }, pn = (e) => {
831
831
  const o = I.document.createElement("div");
832
832
  return o.className = "ul-video-container", o.appendChild(((t) => {
833
833
  const r = I.document.createElement("div");
@@ -843,85 +843,85 @@ const ue = async ({ event: e, apiBase: o, headers: t, visitorId: r, envId: i, me
843
843
  r.className = "vjs-no-js", r.innerHTML = "To view this video please enable JavaScript, and consider upgrading to a web browser that";
844
844
  const i = I.document.createElement("a");
845
845
  return i.href = "https://videojs.com/html5-video-support/", i.target = "_blank", i.innerHTML = "supports HTML5 video", r.appendChild(i), t.appendChild(r), o.appendChild(t), o;
846
- }, An = (e, o) => {
846
+ }, $n = (e, o) => {
847
847
  e.children()[0].classList.remove("vjs-hidden"), e.audioPlayerPlaceholder.hide(), I.document.getElementById(`${e.id()}_html5_api`).style.height = "100%";
848
- }, we = (e, o) => I.document.getElementById(e) ? o ? I.videojs(e, o) : I.videojs(e) : (console.error(`Error in finding player element with ID, ${e}`), null), $n = (e, o, t, r = !1, i = "https://api.sprig.com", s = document, d = null, p = null) => {
848
+ }, we = (e, o) => I.document.getElementById(e) ? o ? I.videojs(e, o) : I.videojs(e) : (console.error(`Error in finding player element with ID, ${e}`), null), Hn = (e, o, t, r = !1, i = "https://api.sprig.com", s = document, d = null, u = null) => {
849
849
  I.document = s;
850
- const a = e + ln, v = mn(a);
850
+ const a = e + an, v = pn(a);
851
851
  return I.document.addEventListener("securitypolicyviolation", (y) => {
852
852
  le(new Error(`Voice & Video feature violates ${y.violatedDirective} web page CSP policies for the question player.`), "playerDeviceError", i, {});
853
- }), dn(an, () => {
853
+ }), ln(sn, () => {
854
854
  I.document.getElementById(Fe(a)).remove(), Me(a, v);
855
855
  const y = { playsinline: !0, playbackRates: [0.5, 1, 1.5, 2], fill: !0 };
856
856
  try {
857
- const c = e + We;
857
+ const c = e + Ye;
858
858
  Me(c, v);
859
859
  const g = we(a, y), w = we(c, { muted: !0, ...y });
860
860
  if (!g || !w) return;
861
- ((f, _, N) => {
862
- f.addClass(`ul${We}`);
863
- const L = new (I.videojs.getComponent("Component"))(f);
864
- _ && f.src(_), f.addChild(L), N && N(f);
865
- })(w, d, p), d || w.addClass(W);
866
- const x = cn(g, ["PlaybackRateMenuButton", "PlayToggle", "FullscreenToggle"]), b = x.children().find((f) => f.name_ === "FullscreenToggle");
867
- b.hasClass("vjs-disabled") && b.hide(), un(g, x, o, t, r, w);
861
+ ((f, _, R) => {
862
+ f.addClass(`ul${Ye}`);
863
+ const N = new (I.videojs.getComponent("Component"))(f);
864
+ _ && f.src(_), f.addChild(N), R && R(f);
865
+ })(w, d, u), d || w.addClass(W);
866
+ const C = dn(g, ["PlaybackRateMenuButton", "PlayToggle", "FullscreenToggle"]), b = C.children().find((f) => f.name_ === "FullscreenToggle");
867
+ b.hasClass("vjs-disabled") && b.hide(), cn(g, C, o, t, r, w);
868
868
  } catch (c) {
869
869
  return void le(new Error(`Error when creating video player object ${c}`), "playerDeviceError", i, {});
870
870
  }
871
871
  }), v;
872
- }, Hn = (e) => {
872
+ }, Vn = (e) => {
873
873
  if (!e) return null;
874
874
  const o = e.match(/https:\/\/stream.mux.com\/(.*)/);
875
875
  let t = o ? o[1] : null;
876
- return t.includes(Ye) && (t = t.replace(Ye, "")), t ? `https://image.mux.com/${t}/thumbnail.jpg?time=0` : null;
877
- }, R = { UPLOAD_STARTED: "upload.started", UPLOAD_PROGRESS: "upload.progress", UPLOAD_FINISHED: "upload.finished", DELETE: "delete", ERROR: "error", MEDIA_TYPE: "media.type", PERMISSION_DENIED: "permission_denied", OTHER: "other", UPLOAD_ID: "upload.id", UPLOAD_PROGRESS_PCT: "upload.progress.pct", MEDIA_RECORDING_UID: "media.recording.uid", MEDIA_TYPE_VIDEO: "video", MEDIA_TYPE_AUDIO: "audio" }, X = { PlaybackRateMenuButton: "Speed", PlayToggle: "Play", FullscreenToggle: "Expand", TurnOnCamera: "Turn on", TurnOffCamera: "Turn off", DeleteButton: "Delete", RecordButton: "Record", StopButton: "Stop", PauseButton: "Pause" }, Vn = ({ properties: e, surveyVideoUrl: o, questionId: t }) => {
876
+ return t.includes(Ze) && (t = t.replace(Ze, "")), t ? `https://image.mux.com/${t}/thumbnail.jpg?time=0` : null;
877
+ }, L = { UPLOAD_STARTED: "upload.started", UPLOAD_PROGRESS: "upload.progress", UPLOAD_FINISHED: "upload.finished", DELETE: "delete", ERROR: "error", MEDIA_TYPE: "media.type", PERMISSION_DENIED: "permission_denied", OTHER: "other", UPLOAD_ID: "upload.id", UPLOAD_PROGRESS_PCT: "upload.progress.pct", MEDIA_RECORDING_UID: "media.recording.uid", MEDIA_TYPE_VIDEO: "video", MEDIA_TYPE_AUDIO: "audio" }, X = { PlaybackRateMenuButton: "Speed", PlayToggle: "Play", FullscreenToggle: "Expand", TurnOnCamera: "Turn on", TurnOffCamera: "Turn off", DeleteButton: "Delete", RecordButton: "Record", StopButton: "Stop", PauseButton: "Pause" }, Fn = ({ properties: e, surveyVideoUrl: o, questionId: t }) => {
878
878
  const r = `ul-card-video__question_player-q${t}`, { apiURL: i, viewDocument: s } = G((d) => ({ apiURL: d.apiURL, viewDocument: d.viewDocument }));
879
879
  return n("div", { id: r, ref: (d) => {
880
880
  if (d && d.children.length === 0 && !e.properties.hideRecordedPrompt) {
881
- const p = $n(r, { src: o, type: "application/x-mpegURL" }, void 0, e.properties.mediaType === R.MEDIA_TYPE_AUDIO, i, s);
882
- d.appendChild(p);
881
+ const u = Hn(r, { src: o, type: "application/x-mpegURL" }, void 0, e.properties.mediaType === L.MEDIA_TYPE_AUDIO, i, s);
882
+ d.appendChild(u);
883
883
  }
884
884
  } });
885
- }, me = ({ isDisabled: e, onClick: o, children: t }) => n(oe, { className: "ul-card__button-checkmark", disabled: e, onClick: o, type: "button", children: [n("svg", { fill: "none", height: "10", viewBox: "0 0 13 10", width: "13", xmlns: "http://www.w3.org/2000/svg", children: n("path", { d: "M11.5 1.5L4.5 8.5L1 5", stroke: "#ffffff", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1.5" }) }), t || "Ok"] }), Fn = ({ className: e, next: o, properties: t, questionId: r, type: i }) => {
886
- const { useMobileStyling: s, border: d } = G((T) => ({ useMobileStyling: T.useMobileStyling, border: T.border })), [p, a] = Z(!1), [v, y] = Z(""), [c, g] = Z(!1), w = t == null ? void 0 : t.collectName, x = (t == null ? void 0 : t.nameLabelText) || "Full Name", b = (t == null ? void 0 : t.consentText) || "I agree to the stated conditions", f = (t == null ? void 0 : t.submitButtonText) || "Submit", _ = !!v.trim(), N = p && (!w || _), L = (T, H = !1) => {
885
+ }, me = ({ isDisabled: e, onClick: o, children: t }) => n(oe, { className: "ul-card__button-checkmark", disabled: e, onClick: o, type: "button", children: [n("svg", { fill: "none", height: "10", viewBox: "0 0 13 10", width: "13", xmlns: "http://www.w3.org/2000/svg", children: n("path", { d: "M11.5 1.5L4.5 8.5L1 5", stroke: "#ffffff", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1.5" }) }), t || "Ok"] }), zn = ({ className: e, next: o, properties: t, questionId: r, type: i }) => {
886
+ const { useMobileStyling: s, border: d } = G((T) => ({ useMobileStyling: T.useMobileStyling, border: T.border })), [u, a] = Z(!1), [v, y] = Z(""), [c, g] = Z(!1), w = t == null ? void 0 : t.collectName, C = (t == null ? void 0 : t.nameLabelText) || "Full Name", b = (t == null ? void 0 : t.consentText) || "I agree to the stated conditions", f = (t == null ? void 0 : t.submitButtonText) || "Submit", _ = !!v.trim(), R = u && (!w || _), N = (T, H = !1) => {
887
887
  T.preventDefault(), T.stopPropagation();
888
888
  let $ = null;
889
889
  if (!H) {
890
- if (!N) return void g(!0);
890
+ if (!R) return void g(!0);
891
891
  $ = { submitted: !0 }, w && ($.name = v);
892
892
  }
893
- o({ value: $, questionId: r, type: i }, !!H || N);
893
+ o({ value: $, questionId: r, type: i }, !!H || R);
894
894
  };
895
- return n("div", { className: A(e, "ul-card__consent-legal", "fade-in-transition"), children: n(ie, { embeddedType: "pdf", properties: t, children: n(de, { children: [n("div", { className: "sprig-stretch", children: [n(He, { allowTextEntry: !1, border: d, error: c && !p, id: "consent", isRadio: !1, isSelected: p, label: b, onUserInputChanged: ({ selected: T }) => {
896
- T !== p && a(!p);
897
- }, useMobileStyling: s }), w && n("input", { "aria-label": x, "aria-placeholder": x, className: A(K("ul-consent-legal__name-input", s)), "data-gramm": "false", maxLength: 250, name: "name", onBlur: (T) => {
895
+ return n("div", { className: A(e, "ul-card__consent-legal", "fade-in-transition"), children: n(ie, { embeddedType: "pdf", properties: t, children: n(de, { children: [n("div", { className: "sprig-stretch", children: [n(He, { allowTextEntry: !1, border: d, error: c && !u, id: "consent", isRadio: !1, isSelected: u, label: b, onUserInputChanged: ({ selected: T }) => {
896
+ T !== u && a(!u);
897
+ }, useMobileStyling: s }), w && n("input", { "aria-label": C, "aria-placeholder": C, className: A(K("ul-consent-legal__name-input", s)), "data-gramm": "false", maxLength: 250, name: "name", onBlur: (T) => {
898
898
  T.currentTarget.style.borderColor = c && !_ ? _e : Ae;
899
899
  }, onFocus: (T) => {
900
900
  T.currentTarget.style.borderColor = c && !_ ? _e : d;
901
901
  }, onInput: (T) => {
902
902
  T.preventDefault(), T.stopPropagation(), y(T.currentTarget.value);
903
- }, placeholder: x, style: c && !_ ? { borderColor: _e } : {}, tabIndex: 0, value: v })] }), n("div", { className: "ul-card__button-wrapper ul-card-vertical__button-wrapper", children: [n(me, { isDisabled: !N, onClick: (T) => L(new SubmitEvent(T.type)), children: re({ buttonText: f }) }), t.required === !1 && n("button", { className: "ul-card-skip__button", onClick: (T) => L(new SubmitEvent(T.type), !0), children: Oe(t) })] })] }) }) }, r);
904
- }, zn = () => {
903
+ }, placeholder: C, style: c && !_ ? { borderColor: _e } : {}, tabIndex: 0, value: v })] }), n("div", { className: "ul-card__button-wrapper ul-card-vertical__button-wrapper", children: [n(me, { isDisabled: !R, onClick: (T) => N(new SubmitEvent(T.type)), children: re({ buttonText: f }) }), t.required === !1 && n("button", { className: "ul-card-skip__button", onClick: (T) => N(new SubmitEvent(T.type), !0), children: Oe(t) })] })] }) }) }, r);
904
+ }, Gn = () => {
905
905
  const { destroy: e, forceBrandedLogo: o } = G((t) => ({ destroy: t.destroy, forceBrandedLogo: t.forceBrandedLogo }));
906
906
  return ae(() => {
907
907
  setTimeout(() => {
908
908
  e($e);
909
909
  }, o ? 4e3 : 2e3);
910
910
  }, [e, o]), n("div", { className: "end-of-survey-text", children: "End of survey" });
911
- }, Gn = ({ activeValue: e, border: o, icon: t, enableCspTrustedTypes: r, isPressed: i, range: s, scaleLabelType: d, selectedValue: p, setSelectedValue: a, setActiveValue: v, setIsPressed: y, useMobileStyling: c, value: g, viewDocument: w }) => {
912
- const x = `option-${g}`, b = d === "number", f = d === "star", _ = d === "smiley", N = b && g === e || g === p, [L, T] = (() => {
913
- const m = f && p !== null && g <= p;
914
- return f && g <= e || _ && g === e || m || g === e || g === p ? [o, i || m || g === p ? 1 : 0.3] : ["", 1];
911
+ }, Qn = ({ activeValue: e, border: o, icon: t, enableCspTrustedTypes: r, isPressed: i, range: s, scaleLabelType: d, selectedValue: u, setSelectedValue: a, setActiveValue: v, setIsPressed: y, useMobileStyling: c, value: g, viewDocument: w }) => {
912
+ const C = `option-${g}`, b = d === "number", f = d === "star", _ = d === "smiley", R = b && g === e || g === u, [N, T] = (() => {
913
+ const m = f && u !== null && g <= u;
914
+ return f && g <= e || _ && g === e || m || g === e || g === u ? [o, i || m || g === u ? 1 : 0.3] : ["", 1];
915
915
  })(), H = ye(() => {
916
- const m = { borderColor: N ? L : "", fillOpacity: N ? "" : T, zIndex: N ? 3 : "auto", color: p === g ? "#fff" : "" };
917
- return b ? { ...m, backgroundColor: p === g ? L : "" } : { ...m, color: f || _ || p === g ? L : "" };
918
- }, [N, L, T, p, g, b, f, _]), $ = ye(() => Pn((({ icon: m, scaleLabelType: h, value: k, selectedValue: l }) => {
916
+ const m = { borderColor: R ? N : "", fillOpacity: R ? "" : T, zIndex: R ? 3 : "auto", color: u === g ? "#fff" : "" };
917
+ return b ? { ...m, backgroundColor: u === g ? N : "" } : { ...m, color: f || _ || u === g ? N : "" };
918
+ }, [R, N, T, u, g, b, f, _]), $ = ye(() => Ln((({ icon: m, scaleLabelType: h, value: k, selectedValue: l }) => {
919
919
  if (h === "smiley" && k === l) {
920
- let u = 0;
921
- return m.replace(/black/g, () => ++u == 1 ? "black" : "white");
920
+ let p = 0;
921
+ return m.replace(/black/g, () => ++p == 1 ? "black" : "white");
922
922
  }
923
923
  return m;
924
- })({ icon: t, scaleLabelType: d, value: g, selectedValue: p }), r), [r, t, d, p, g]);
924
+ })({ icon: t, scaleLabelType: d, value: g, selectedValue: u }), r), [r, t, d, u, g]);
925
925
  return n("button", { "aria-label": b ? void 0 : String(g), className: (() => {
926
926
  switch (d) {
927
927
  case "star":
@@ -931,21 +931,21 @@ const ue = async ({ event: e, apiBase: o, headers: t, visitorId: r, envId: i, me
931
931
  default:
932
932
  return g === s ? A(K("likert-number", c), K(`likert-number-${g}`, c), K("likert-last-option", c)) : A(K("likert-number", c), K(`likert-number-${g}`, c));
933
933
  }
934
- })(), dangerouslySetInnerHTML: { __html: $ }, id: x, onClick: (m) => {
934
+ })(), dangerouslySetInnerHTML: { __html: $ }, id: C, onClick: (m) => {
935
935
  m.preventDefault(), m.stopPropagation(), a(g);
936
936
  }, onKeyDown: (m) => {
937
- var l, u;
937
+ var l, p;
938
938
  const h = w.querySelectorAll(`.likert-${d ?? "number"}`), k = g - 1;
939
- m.key === "ArrowRight" ? (l = h[k + 1]) == null || l.focus() : m.key === "ArrowLeft" ? (u = h[k - 1]) == null || u.focus() : m.key !== "Enter" && m.key !== " " || (m.preventDefault(), m.stopPropagation(), a(g));
939
+ m.key === "ArrowRight" ? (l = h[k + 1]) == null || l.focus() : m.key === "ArrowLeft" ? (p = h[k - 1]) == null || p.focus() : m.key !== "Enter" && m.key !== " " || (m.preventDefault(), m.stopPropagation(), a(g));
940
940
  }, onPointerDown: () => y(!0), onPointerEnter: () => v(g), onPointerLeave: () => {
941
941
  v(-1), y(!1);
942
942
  }, style: H, tabIndex: 0 });
943
- }, Qn = ({ className: e, labels: o, next: t, properties: r, questionId: i, type: s }) => {
944
- const { border: d, useMobileStyling: p, viewDocument: a, enableCspTrustedTypes: v } = G((h) => ({ border: h.border, useMobileStyling: h.useMobileStyling, viewDocument: h.viewDocument, enableCspTrustedTypes: h.enableCspTrustedTypes })), [y, c] = Z(-1), [g, w] = Z(!1), [x, b] = Z(null), f = o && o.left, _ = o && o.right;
945
- let N;
946
- const { range: L, scaleLabelType: T, ratingIcons: H } = r;
947
- L && (N = Number(L));
948
- const $ = N || 5, m = (h) => {
943
+ }, Zn = ({ className: e, labels: o, next: t, properties: r, questionId: i, type: s }) => {
944
+ const { border: d, useMobileStyling: u, viewDocument: a, enableCspTrustedTypes: v } = G((h) => ({ border: h.border, useMobileStyling: h.useMobileStyling, viewDocument: h.viewDocument, enableCspTrustedTypes: h.enableCspTrustedTypes })), [y, c] = Z(-1), [g, w] = Z(!1), [C, b] = Z(null), f = o && o.left, _ = o && o.right;
945
+ let R;
946
+ const { range: N, scaleLabelType: T, ratingIcons: H } = r;
947
+ N && (R = Number(N));
948
+ const $ = R || 5, m = (h) => {
949
949
  var k, l;
950
950
  switch (T) {
951
951
  case "star":
@@ -958,111 +958,111 @@ const ue = async ({ event: e, apiBase: o, headers: t, visitorId: r, envId: i, me
958
958
  };
959
959
  return n("form", { className: A(e, "ul-card--likert", "fade-in-transition"), children: n(ie, { properties: r, children: [n(ce, { children: [n("div", { "aria-label": `Rating (1 - ${$})`, className: "ul-card--likert__numbers", role: "radiogroup", children: [...Array($)].map((h, k) => {
960
960
  const l = k + 1;
961
- return n(Gn, { activeValue: y, border: d, enableCspTrustedTypes: v, icon: m(k), isPressed: g, range: $, scaleLabelType: T, selectedValue: x, setActiveValue: c, setIsPressed: w, setSelectedValue: b, useMobileStyling: p, value: l, viewDocument: a }, k);
962
- }) }), n("div", { className: "ul-card--likert__labels", children: [n("span", { children: f }), n("span", { children: _ })] })] }), n(de, { children: n(me, { isDisabled: x === null && r.required, onClick: () => t({ value: x, questionId: i, type: s }, !0), children: re(r) }) })] }) }, i);
963
- }, Zn = ({ columns: e, onSelect: o, options: t, selectedOptions: r }) => {
964
- const i = se([]), { border: s, useMobileStyling: d } = G((g) => ({ border: g.border, useMobileStyling: g.useMobileStyling })), p = t.findIndex((g) => r[g.id] === null), [a, v] = Z(p), y = be((g, w) => {
961
+ return n(Qn, { activeValue: y, border: d, enableCspTrustedTypes: v, icon: m(k), isPressed: g, range: $, scaleLabelType: T, selectedValue: C, setActiveValue: c, setIsPressed: w, setSelectedValue: b, useMobileStyling: u, value: l, viewDocument: a }, k);
962
+ }) }), n("div", { className: "ul-card--likert__labels", children: [n("span", { children: f }), n("span", { children: _ })] })] }), n(de, { children: n(me, { isDisabled: C === null && r.required, onClick: () => t({ value: C, questionId: i, type: s }, !0), children: re(r) }) })] }) }, i);
963
+ }, Yn = ({ columns: e, onSelect: o, options: t, selectedOptions: r }) => {
964
+ const i = se([]), { border: s, useMobileStyling: d } = G((g) => ({ border: g.border, useMobileStyling: g.useMobileStyling })), u = t.findIndex((g) => r[g.id] === null), [a, v] = Z(u), y = be((g, w) => {
965
965
  o(g, w);
966
- const x = a + 1, b = t[x];
967
- b && r[b.id] === null && v(x);
966
+ const C = a + 1, b = t[C];
967
+ b && r[b.id] === null && v(C);
968
968
  }, [o, t, r, a]), c = be((g, w) => {
969
- const x = a === g;
970
- return n(wn, { animate: !0, header: w.label, isOpen: x, onClick: () => {
969
+ const C = a === g;
970
+ return n(kn, { animate: !0, header: w.label, isOpen: C, onClick: () => {
971
971
  var b;
972
- return v(x && !((b = window.UserLeap) != null && b.isMobileSDK) ? -1 : g);
972
+ return v(C && !((b = window.UserLeap) != null && b.isMobileSDK) ? -1 : g);
973
973
  }, ref: (b) => {
974
974
  b && (i.current[g] = b);
975
975
  }, showHeaderCheck: r[w.id] !== null, children: n("div", { style: { paddingTop: "12px" }, children: e.map((b) => n(He, { allowTextEntry: !1, ariaLabel: `${w.label}-${b.label}`, border: s, error: !1, id: `${w.id}-${b.value}`, isRadio: !0, isSelected: r[w.id] === b.value, label: b.label, onUserInputChanged: () => y(w.id, b.value), useMobileStyling: d }, b.label)) }) }, w.id);
976
976
  }, [s, e, a, y, r, d]);
977
977
  return n("div", { children: t.map((g, w) => c(w, g)) });
978
- }, Yn = ({ className: e, next: o, options: t, properties: r, questionId: i, type: s, onSubmitButtonClick: d }) => {
979
- const p = r.matrixColumn, a = r.required, v = (x) => {
980
- x.preventDefault(), x.stopPropagation(), o({ value: c, questionId: i, type: s }, !0), d && d();
981
- }, y = t.reduce((x, b) => (x[b.id] = null, x), {}), [c, g] = Z(y);
982
- return n("form", { className: A(e, "ul-card__matrix", "fade-in-transition"), id: "text-form", onSubmit: v, children: n(ie, { properties: r, children: [n(ce, { children: n(Zn, { columns: p, onSelect: (x, b) => {
983
- g((f) => ({ ...f, [x]: b }));
984
- }, options: t, selectedOptions: c }) }), n(de, { children: n(me, { isDisabled: (w = c, a && Object.values(w).every((x) => x == null)), onClick: () => v(new SubmitEvent("submit")), children: re(r) }) })] }) }, i);
978
+ }, Wn = ({ className: e, next: o, options: t, properties: r, questionId: i, type: s, onSubmitButtonClick: d }) => {
979
+ const u = r.matrixColumn, a = r.required, v = (C) => {
980
+ C.preventDefault(), C.stopPropagation(), o({ value: c, questionId: i, type: s }, !0), d && d();
981
+ }, y = t.reduce((C, b) => (C[b.id] = null, C), {}), [c, g] = Z(y);
982
+ return n("form", { className: A(e, "ul-card__matrix", "fade-in-transition"), id: "text-form", onSubmit: v, children: n(ie, { properties: r, children: [n(ce, { children: n(Yn, { columns: u, onSelect: (C, b) => {
983
+ g((f) => ({ ...f, [C]: b }));
984
+ }, options: t, selectedOptions: c }) }), n(de, { children: n(me, { isDisabled: (w = c, a && Object.values(w).every((C) => C == null)), onClick: () => v(new SubmitEvent("submit")), children: re(r) }) })] }) }, i);
985
985
  var w;
986
- }, vn = ({ className: e, onSubmit: o, options: t = [], properties: r, questionId: i, type: s, showIndividualSubmit: d = !1, onSubmitButtonClick: p }) => {
987
- const { border: a, useMobileStyling: v } = G((l) => ({ border: l.border, useMobileStyling: l.useMobileStyling })), y = t.reduce((l, u) => (l[u.id] = { isSelected: !1 }, l), {}), [c, g] = Z(y), w = s === "multiplechoice", x = r.required, b = t.find((l) => {
988
- var u;
989
- return (u = l.optionProperties) == null ? void 0 : u.noneOfTheAbove;
990
- }), f = (l) => Object.entries(l).some(([u, C]) => {
986
+ }, mn = ({ className: e, onSubmit: o, options: t = [], properties: r, questionId: i, type: s, showIndividualSubmit: d = !1, onSubmitButtonClick: u }) => {
987
+ const { border: a, useMobileStyling: v } = G((l) => ({ border: l.border, useMobileStyling: l.useMobileStyling })), y = t.reduce((l, p) => (l[p.id] = { isSelected: !1 }, l), {}), [c, g] = Z(y), w = s === "multiplechoice", C = r.required, b = t.find((l) => {
988
+ var p;
989
+ return (p = l.optionProperties) == null ? void 0 : p.noneOfTheAbove;
990
+ }), f = (l) => Object.entries(l).some(([p, x]) => {
991
991
  var M;
992
- const D = t.find((O) => `${O.id}` === u), j = C.userText === void 0 || C.userText.trim() === "";
993
- return ((M = D == null ? void 0 : D.optionProperties) == null ? void 0 : M.allowsTextEntry) && j && C.isSelected;
994
- }), _ = (l) => Object.values(l).filter((u) => u.isSelected).length, N = r.minSelect && r.minSelect > 0 && r.maxSelectMode === xe.Range && _(c) < r.minSelect && (x || _(c) > 0), L = (l) => f(l) || x && !_(l) || !((u) => {
995
- const { minSelect: C = 0, maxSelect: D = 1 / 0, maxSelectMode: j } = r, M = _(u);
992
+ const S = t.find((O) => `${O.id}` === p), j = x.userText === void 0 || x.userText.trim() === "";
993
+ return ((M = S == null ? void 0 : S.optionProperties) == null ? void 0 : M.allowsTextEntry) && j && x.isSelected;
994
+ }), _ = (l) => Object.values(l).filter((p) => p.isSelected).length, R = r.minSelect && r.minSelect > 0 && r.maxSelectMode === xe.Range && _(c) < r.minSelect && (C || _(c) > 0), N = (l) => f(l) || C && !_(l) || !((p) => {
995
+ const { minSelect: x = 0, maxSelect: S = 1 / 0, maxSelectMode: j } = r, M = _(p);
996
996
  switch (j) {
997
997
  case xe.Maximum:
998
- return M <= D;
998
+ return M <= S;
999
999
  case xe.Range:
1000
- return M === 0 || M >= C;
1000
+ return M === 0 || M >= x;
1001
1001
  default:
1002
1002
  return !0;
1003
1003
  }
1004
- })(l), T = Object.entries(c).some(([l, u]) => {
1005
- var C, D;
1006
- return u.isSelected && ((D = (C = t.find((j) => `${j.id}` === l)) == null ? void 0 : C.optionProperties) == null ? void 0 : D.allowsTextEntry);
1004
+ })(l), T = Object.entries(c).some(([l, p]) => {
1005
+ var x, S;
1006
+ return p.isSelected && ((S = (x = t.find((j) => `${j.id}` === l)) == null ? void 0 : x.optionProperties) == null ? void 0 : S.allowsTextEntry);
1007
1007
  }), H = d && (!w || T), $ = (l) => {
1008
1008
  k(l.id, l.selected, l.userText, l.noneOfTheAbove);
1009
1009
  }, m = (l) => {
1010
- var u;
1011
- return (r == null ? void 0 : r.maxSelectMode) !== xe.Unlimited && _(c) === (r == null ? void 0 : r.maxSelect) && !((u = c[l]) != null && u.isSelected);
1010
+ var p;
1011
+ return (r == null ? void 0 : r.maxSelectMode) !== xe.Unlimited && _(c) === (r == null ? void 0 : r.maxSelect) && !((p = c[l]) != null && p.isSelected);
1012
1012
  }, h = () => {
1013
- o(c, !0), p && p();
1014
- }, k = (l, u, C, D) => {
1013
+ o(c, !0), u && u();
1014
+ }, k = (l, p, x, S) => {
1015
1015
  const j = Object.assign({}, c);
1016
- if ((w || D) && u) for (const M of Object.values(j)) M.isSelected = !1, delete M.userText;
1017
- else b && !D && c[b.id].isSelected && (j[b.id].isSelected = !1);
1018
- j[l] = { isSelected: u, userText: C }, g(j);
1016
+ if ((w || S) && p) for (const M of Object.values(j)) M.isSelected = !1, delete M.userText;
1017
+ else b && !S && c[b.id].isSelected && (j[b.id].isSelected = !1);
1018
+ j[l] = { isSelected: p, userText: x }, g(j);
1019
1019
  };
1020
- return n("form", { className: A(e, "ul-card--multiple", "fade-in-transition"), id: "text-form", onSubmit: h, children: n(ie, { properties: r, children: [n(ce, { children: [r.isDropdown ? n(Rn, { disabledOptions: t.filter((l) => m(l.id)), dropdownFooter: N ? n("div", { className: "ul-card__min-select-counter", style: { marginLeft: "16px" }, children: [_(c), "/", r.minSelect] }) : void 0, isMultiSelect: !w, multiselectText: r.dropdownMultiselectedText ?? "choices selected", onChange: (l) => {
1021
- const u = { ...c };
1022
- for (const C of t) l.includes(C) ? u[C.id].isSelected = !0 : u[C.id].isSelected = !1;
1023
- g(u);
1024
- }, options: t, placeholderText: r.dropdownPlaceholderText ?? (w ? "Select choice" : "Select choice(s)"), value: t.filter((l) => c[l.id].isSelected) }) : n("div", { className: A(K("ul-card__choices", v)), role: w ? "radiogroup" : "group", children: [t.map(({ id: l, label: u, value: C, optionProperties: D }) => {
1020
+ return n("form", { className: A(e, "ul-card--multiple", "fade-in-transition"), id: "text-form", onSubmit: h, children: n(ie, { properties: r, children: [n(ce, { children: [r.isDropdown ? n(Nn, { disabledOptions: t.filter((l) => m(l.id)), dropdownFooter: R ? n("div", { className: "ul-card__min-select-counter", style: { marginLeft: "16px" }, children: [_(c), "/", r.minSelect] }) : void 0, isMultiSelect: !w, multiselectText: r.dropdownMultiselectedText ?? "choices selected", onChange: (l) => {
1021
+ const p = { ...c };
1022
+ for (const x of t) l.includes(x) ? p[x.id].isSelected = !0 : p[x.id].isSelected = !1;
1023
+ g(p);
1024
+ }, options: t, placeholderText: r.dropdownPlaceholderText ?? (w ? "Select choice" : "Select choice(s)"), value: t.filter((l) => c[l.id].isSelected) }) : n("div", { className: A(K("ul-card__choices", v)), role: w ? "radiogroup" : "group", children: [t.map(({ id: l, label: p, value: x, optionProperties: S }) => {
1025
1025
  var q, Q;
1026
- const j = `${l}`, { allowsTextEntry: M, noneOfTheAbove: O } = { allowsTextEntry: !1, noneOfTheAbove: !1, ...D };
1027
- return n(He, { allowTextEntry: M, border: a, disabled: m(j), error: (B = c, f(B)), id: j, isRadio: w, isSelected: !!((q = c[j]) != null && q.isSelected), label: u, noneOfTheAbove: O, onUserInputChanged: $, promptText: (D == null ? void 0 : D.otherOptionPlaceholder) || "Please specify", text: (Q = c[l]) == null ? void 0 : Q.userText, useMobileStyling: v, value: C }, j);
1026
+ const j = `${l}`, { allowsTextEntry: M, noneOfTheAbove: O } = { allowsTextEntry: !1, noneOfTheAbove: !1, ...S };
1027
+ return n(He, { allowTextEntry: M, border: a, disabled: m(j), error: (B = c, f(B)), id: j, isRadio: w, isSelected: !!((q = c[j]) != null && q.isSelected), label: p, noneOfTheAbove: O, onUserInputChanged: $, promptText: (S == null ? void 0 : S.otherOptionPlaceholder) || "Please specify", text: (Q = c[l]) == null ? void 0 : Q.userText, useMobileStyling: v, value: x }, j);
1028
1028
  var B;
1029
- }), !!N && n("div", { className: "ul-card__min-select-counter", children: [_(c), "/", r.minSelect] })] }), H && n(Ln, { handleSubmit: h, isSubmitDisabled: L(c) })] }), n(de, { children: n(me, { isDisabled: L(c), onClick: h, children: re(r) }) })] }) }, i);
1030
- }, Wn = (e) => {
1029
+ }), !!R && n("div", { className: "ul-card__min-select-counter", children: [_(c), "/", r.minSelect] })] }), H && n(Rn, { handleSubmit: h, isSubmitDisabled: N(c) })] }), n(de, { children: n(me, { isDisabled: N(c), onClick: h, children: re(r) }) })] }) }, i);
1030
+ }, Kn = (e) => {
1031
1031
  const { questionId: o, type: t, next: r, options: i } = e;
1032
- return n(vn, { ...e, onSubmit: (s, d) => {
1033
- const p = Object.entries(s).find(([, g]) => g.isSelected) || [void 0, void 0], [a, v] = p, y = i.find((g) => `${g.id}` === a), c = v != null && v.userText ? { [a]: { userText: v.userText } } : null;
1032
+ return n(mn, { ...e, onSubmit: (s, d) => {
1033
+ const u = Object.entries(s).find(([, g]) => g.isSelected) || [void 0, void 0], [a, v] = u, y = i.find((g) => `${g.id}` === a), c = v != null && v.userText ? { [a]: { userText: v.userText } } : null;
1034
1034
  r({ value: y && a ? { [a]: y.value } : {}, secondaryValue: c, questionId: o, type: t }, d);
1035
1035
  } });
1036
- }, Kn = (e) => {
1036
+ }, Jn = (e) => {
1037
1037
  const { questionId: o, type: t, next: r } = e;
1038
- return n(vn, { ...e, onSubmit: (i, s) => {
1039
- const d = Object.entries(i).reduce((a, [v, y]) => (a[v] = y.isSelected, a), {}), p = Object.entries(i).reduce((a, [v, y]) => {
1038
+ return n(mn, { ...e, onSubmit: (i, s) => {
1039
+ const d = Object.entries(i).reduce((a, [v, y]) => (a[v] = y.isSelected, a), {}), u = Object.entries(i).reduce((a, [v, y]) => {
1040
1040
  if (!y.userText) return a;
1041
1041
  const c = a || {};
1042
1042
  return c[v] = { userText: y.userText }, c;
1043
1043
  }, null);
1044
- r({ value: d, secondaryValue: p, questionId: o, type: t }, s);
1044
+ r({ value: d, secondaryValue: u, questionId: o, type: t }, s);
1045
1045
  } });
1046
- }, Jn = ({ className: e, labels: o, properties: t, next: r, questionId: i, type: s }) => {
1047
- const [d, p] = Z(null), { border: a, useMobileStyling: v, viewDocument: y } = G((w) => ({ border: w.border, useMobileStyling: w.useMobileStyling, viewDocument: w.viewDocument })), c = o && o.left, g = o && o.right;
1048
- return n("form", { className: A(e, "ul-card--nps", "fade-in-transition"), children: n(ie, { properties: t, children: [n(ce, { children: [n("div", { className: "ul-card--nps__numbers", children: [...Array(11)].map((w, x) => n("button", { className: A(K("nps-number", v), K(`nps-number-${x}`, v)), id: `option-${x}`, onClick: (b) => {
1049
- b.preventDefault(), b.stopPropagation(), p(x);
1046
+ }, Xn = ({ className: e, labels: o, properties: t, next: r, questionId: i, type: s }) => {
1047
+ const [d, u] = Z(null), { border: a, useMobileStyling: v, viewDocument: y } = G((w) => ({ border: w.border, useMobileStyling: w.useMobileStyling, viewDocument: w.viewDocument })), c = o && o.left, g = o && o.right;
1048
+ return n("form", { className: A(e, "ul-card--nps", "fade-in-transition"), children: n(ie, { properties: t, children: [n(ce, { children: [n("div", { className: "ul-card--nps__numbers", children: [...Array(11)].map((w, C) => n("button", { className: A(K("nps-number", v), K(`nps-number-${C}`, v)), id: `option-${C}`, onClick: (b) => {
1049
+ b.preventDefault(), b.stopPropagation(), u(C);
1050
1050
  }, onKeyDown: (b) => {
1051
- var _, N;
1051
+ var _, R;
1052
1052
  const f = y.querySelectorAll("button.nps-number");
1053
- b.key === "ArrowRight" ? (_ = f[x + 1]) == null || _.focus() : b.key === "ArrowLeft" ? (N = f[x - 1]) == null || N.focus() : b.key !== "Enter" && b.key !== " " || (b.preventDefault(), b.stopPropagation(), p(x));
1053
+ b.key === "ArrowRight" ? (_ = f[C + 1]) == null || _.focus() : b.key === "ArrowLeft" ? (R = f[C - 1]) == null || R.focus() : b.key !== "Enter" && b.key !== " " || (b.preventDefault(), b.stopPropagation(), u(C));
1054
1054
  }, onPointerDown: (b) => {
1055
1055
  b.currentTarget.style.zIndex = "2", b.currentTarget.style.borderColor = a;
1056
1056
  }, onPointerLeave: (b) => {
1057
1057
  b.currentTarget.style.zIndex = "auto", b.currentTarget.style.borderColor = Ae;
1058
- }, style: d === x ? { backgroundColor: a, color: "#fff" } : void 0, tabIndex: 0, children: x }, x)) }), n("div", { className: "ul-card--nps__labels", children: [n("span", { children: c }), n("span", { children: g })] })] }), n(de, { children: n(me, { isDisabled: d === null && t.required, onClick: () => r({ value: d, questionId: i, type: s }, !0), children: re(t) }) })] }) }, i);
1059
- }, Xn = ({ className: e, next: o, properties: t, questionId: r, type: i, onSubmitButtonClick: s }) => {
1060
- const { border: d, useMobileStyling: p, update: a } = G((f) => ({ border: f.border, useMobileStyling: f.useMobileStyling, update: f.update })), [v, y] = Z(""), c = se(null), g = v.trim(), w = t.required === !0 && !g, x = Nn(c, () => a()), b = t && t.openTextPlaceholder ? t.openTextPlaceholder : "";
1061
- return n("form", { className: A(e, "ul-card-text", "fade-in-transition"), id: "text-form", children: n(ie, { properties: t, children: n("div", { className: "ul-card-text", children: [n(ce, { children: [n("div", { className: "ul-card-text__container", children: n("textarea", { "aria-describedby": "ul-caption", "aria-labelledby": "ul-question", "aria-multiline": "true", "aria-placeholder": b, className: A(K("ul-card-text__input", p)), "data-gramm": "false", maxLength: 5e3, name: "text", onBlur: (f) => {
1058
+ }, style: d === C ? { backgroundColor: a, color: "#fff" } : void 0, tabIndex: 0, children: C }, C)) }), n("div", { className: "ul-card--nps__labels", children: [n("span", { children: c }), n("span", { children: g })] })] }), n(de, { children: n(me, { isDisabled: d === null && t.required, onClick: () => r({ value: d, questionId: i, type: s }, !0), children: re(t) }) })] }) }, i);
1059
+ }, et = ({ className: e, next: o, properties: t, questionId: r, type: i, onSubmitButtonClick: s }) => {
1060
+ const { border: d, useMobileStyling: u, update: a } = G((f) => ({ border: f.border, useMobileStyling: f.useMobileStyling, update: f.update })), [v, y] = Z(""), c = se(null), g = v.trim(), w = t.required === !0 && !g, C = Mn(c, () => a()), b = t && t.openTextPlaceholder ? t.openTextPlaceholder : "";
1061
+ return n("form", { className: A(e, "ul-card-text", "fade-in-transition"), id: "text-form", children: n(ie, { properties: t, children: n("div", { className: "ul-card-text", children: [n(ce, { children: [n("div", { className: "ul-card-text__container", children: n("textarea", { "aria-describedby": "ul-caption", "aria-labelledby": "ul-question", "aria-multiline": "true", "aria-placeholder": b, className: A(K("ul-card-text__input", u)), "data-gramm": "false", maxLength: 5e3, name: "text", onBlur: (f) => {
1062
1062
  f.currentTarget.style.borderColor = Ae;
1063
1063
  }, onChange: (f) => {
1064
1064
  const { value: _ } = f.currentTarget;
1065
- x(), f.preventDefault(), f.stopPropagation(), y(_);
1065
+ C(), f.preventDefault(), f.stopPropagation(), y(_);
1066
1066
  }, onFocus: (f) => {
1067
1067
  f.currentTarget.style.borderColor = d;
1068
1068
  }, placeholder: b, ref: c, role: "textbox", tabIndex: 0 }) }), t.footerHtml && n(Ce, { className: "footer", html: t.footerHtml })] }), n(de, { children: n(me, { isDisabled: w, onClick: (f) => {
@@ -1070,10 +1070,10 @@ const ue = async ({ event: e, apiBase: o, headers: t, visitorId: r, envId: i, me
1070
1070
  const _ = t.required !== !0 || g.length > 0;
1071
1071
  o({ value: v, questionId: r, type: i }, _), s && s();
1072
1072
  }, children: re(t) }) })] }) }) }, r);
1073
- }, et = ({ className: e, labels: o, next: t, properties: r, questionId: i, type: s, onSubmitButtonClick: d, options: p }) => {
1074
- const a = se(null), v = se(0), y = se(0), c = se(null), g = se(!1), w = se([]), [x, b] = Z(() => (r == null ? void 0 : r.required) === !0), [f, _] = Z(() => p.map((E) => ({ ...E, rank: null }))), N = ye(() => Array.from({ length: p.length }, (E, S) => S + 1), [p.length]), { useMobileStyling: L, isPreview: T, headers: H } = G((E) => ({ useMobileStyling: E.useMobileStyling, isPreview: E.isPreview, headers: E.headers })), $ = (H == null ? void 0 : H["userleap-platform"]) === "android", m = L && !T && !$, h = !m && !$, k = (E, S) => {
1073
+ }, nt = ({ className: e, labels: o, next: t, properties: r, questionId: i, type: s, onSubmitButtonClick: d, options: u }) => {
1074
+ const a = se(null), v = se(0), y = se(0), c = se(null), g = se(!1), w = se([]), [C, b] = Z(() => (r == null ? void 0 : r.required) === !0), [f, _] = Z(() => u.map((E) => ({ ...E, rank: null }))), R = ye(() => Array.from({ length: u.length }, (E, D) => D + 1), [u.length]), { useMobileStyling: N, isPreview: T, headers: H } = G((E) => ({ useMobileStyling: E.useMobileStyling, isPreview: E.isPreview, headers: E.headers })), $ = (H == null ? void 0 : H["userleap-platform"]) === "android", m = N && !T && !$, h = !m && !$, k = (E, D) => {
1075
1075
  _((U) => {
1076
- const P = parseInt(S), F = U.map((V) => ({ ...V }));
1076
+ const P = parseInt(D), F = U.map((V) => ({ ...V }));
1077
1077
  F.some((V) => V.rank == null) && F.forEach((V, he) => V.rank = he + 1);
1078
1078
  const J = F.findIndex((V) => V.id === E);
1079
1079
  if (J === -1) return U;
@@ -1084,52 +1084,52 @@ const ue = async ({ event: e, apiBase: o, headers: t, visitorId: r, envId: i, me
1084
1084
  V.id !== E && V.rank > z && V.rank <= P && (V.rank = V.rank - 1);
1085
1085
  }), F[J].rank = P, F.sort((V, he) => V.rank - he.rank), O(), F;
1086
1086
  });
1087
- }, l = (E, S) => {
1087
+ }, l = (E, D) => {
1088
1088
  for (let U = 0; U < w.current.length; U++) {
1089
1089
  const P = w.current[U];
1090
1090
  if (!P || P === c.current) continue;
1091
1091
  const F = P.getBoundingClientRect();
1092
- if (E >= F.left && E <= F.right && S >= F.top && S <= F.bottom) return { element: P, index: U };
1092
+ if (E >= F.left && E <= F.right && D >= F.top && D <= F.bottom) return { element: P, index: U };
1093
1093
  }
1094
1094
  return null;
1095
- }, u = (E) => (S) => {
1095
+ }, p = (E) => (D) => {
1096
1096
  if (!m) return;
1097
- S.preventDefault(), S.stopPropagation(), g.current = !0, a.current = E;
1098
- const U = S.touches[0];
1097
+ D.preventDefault(), D.stopPropagation(), g.current = !0, a.current = E;
1098
+ const U = D.touches[0];
1099
1099
  v.current = U.clientY, y.current = U.clientY;
1100
- const P = S.currentTarget.closest(".ul-card-rank__option");
1100
+ const P = D.currentTarget.closest(".ul-card-rank__option");
1101
1101
  P && (c.current = P, P.classList.add("is-dragging"));
1102
- }, C = (E) => {
1102
+ }, x = (E) => {
1103
1103
  if (!m || !g.current || a.current === null) return;
1104
1104
  E.preventDefault(), E.stopPropagation();
1105
- const S = E.touches[0];
1106
- y.current = S.clientY;
1105
+ const D = E.touches[0];
1106
+ y.current = D.clientY;
1107
1107
  const U = y.current - v.current;
1108
1108
  c.current && (c.current.style.transform = `translateY(${U}px)`, c.current.style.zIndex = "1000"), w.current.forEach((F) => {
1109
1109
  F && F !== c.current && F.classList.remove("is-drop-target");
1110
1110
  });
1111
- const P = l(S.clientX, S.clientY);
1111
+ const P = l(D.clientX, D.clientY);
1112
1112
  P && P.element.classList.add("is-drop-target");
1113
- }, D = (E) => {
1113
+ }, S = (E) => {
1114
1114
  if (!m || !g.current || a.current === null) return;
1115
1115
  E.preventDefault(), E.stopPropagation();
1116
- const S = E.changedTouches[0], U = l(S.clientX, S.clientY);
1116
+ const D = E.changedTouches[0], U = l(D.clientX, D.clientY);
1117
1117
  c.current && (c.current.style.transform = "", c.current.style.zIndex = "", c.current.classList.remove("is-dragging")), w.current.forEach((P) => {
1118
1118
  P && P.classList.remove("is-drop-target");
1119
1119
  }), U && U.index !== a.current && j(a.current, U.index), a.current = null, c.current = null, g.current = !1;
1120
- }, j = (E, S) => {
1120
+ }, j = (E, D) => {
1121
1121
  _((U) => {
1122
1122
  const P = U.map((J) => ({ ...J })), [F] = P.splice(E, 1);
1123
- return P.splice(S, 0, F), P.forEach((J, z) => {
1123
+ return P.splice(D, 0, F), P.forEach((J, z) => {
1124
1124
  J.rank = z + 1;
1125
1125
  }), O(), P;
1126
1126
  });
1127
1127
  }, M = (E) => {
1128
- const S = {};
1129
- E.reduce((U, P) => (U[P.id] = P.rank, U), S), t({ value: S, questionId: i, type: s }, !0);
1128
+ const D = {};
1129
+ E.reduce((U, P) => (U[P.id] = P.rank, U), D), t({ value: D, questionId: i, type: s }, !0);
1130
1130
  }, O = () => {
1131
1131
  b(!1);
1132
- }, { left: B, right: q } = o, Q = p.length, Y = (E) => {
1132
+ }, { left: B, right: q } = o, Q = u.length, Y = (E) => {
1133
1133
  E.preventDefault(), E.currentTarget.classList.add("is-drop-target");
1134
1134
  }, ee = (E) => {
1135
1135
  E.currentTarget.classList.remove("is-drop-target");
@@ -1138,9 +1138,9 @@ const ue = async ({ event: e, apiBase: o, headers: t, visitorId: r, envId: i, me
1138
1138
  };
1139
1139
  return n("form", { className: A(e, "ul-card-rank", "fade-in-transition"), onSubmit: (E) => {
1140
1140
  E.preventDefault(), M(f), d && d();
1141
- }, children: n(ie, { properties: r, children: n(je, $ ? { children: [n(ce, { children: n("div", { className: "ul-card--rank__question-inner-container", children: [n("div", { className: "ul-card-rank__labels", children: n("span", { children: ["1 - ", B] }) }), n("ol", { className: "ul-card-rank__list", children: f.map(({ id: E, label: S, rank: U }) => n("li", { className: "ul-card-rank__option", children: [n("select", { "aria-label": `Rank for ${S}`, className: A("ul-card-rank__select", U == null && "ul-card-rank__select--placeholder"), name: `rank[${E}]`, onChange: (P) => k(E, P.currentTarget.value), value: U ?? "", children: [U == null && n("option", { className: "ul-card-rank__select-option", disabled: !0, value: "", children: "-" }), N.map((P) => n("option", { className: "ul-card-rank__select-option", value: P, children: P }, `${P}-${i}`))] }), n("span", { children: S })] }, E)) }), n("div", { className: "ul-card-rank__labels", children: n("span", { children: [Q, " - ", q] }) })] }) }), n(de, { children: n("div", { className: "ul-card__button-wrapper", children: n(oe, { disabled: x, children: re(r) }) }) })] } : { children: [n(ce, { children: n("div", { className: "ul-card--rank__question-inner-container", children: [n("div", { className: "ul-card-rank__labels", children: n("span", { children: ["1 - ", B] }) }), n("ol", { className: "ul-card-rank__list", onDragOver: $ ? void 0 : (E) => {
1141
+ }, children: n(ie, { properties: r, children: n(je, $ ? { children: [n(ce, { children: n("div", { className: "ul-card--rank__question-inner-container", children: [n("div", { className: "ul-card-rank__labels", children: n("span", { children: ["1 - ", B] }) }), n("ol", { className: "ul-card-rank__list", children: f.map(({ id: E, label: D, rank: U }) => n("li", { className: "ul-card-rank__option", children: [n("select", { "aria-label": `Rank for ${D}`, className: A("ul-card-rank__select", U == null && "ul-card-rank__select--placeholder"), name: `rank[${E}]`, onChange: (P) => k(E, P.currentTarget.value), value: U ?? "", children: [U == null && n("option", { className: "ul-card-rank__select-option", disabled: !0, value: "", children: "-" }), R.map((P) => n("option", { className: "ul-card-rank__select-option", value: P, children: P }, `${P}-${i}`))] }), n("span", { children: D })] }, E)) }), n("div", { className: "ul-card-rank__labels", children: n("span", { children: [Q, " - ", q] }) })] }) }), n(de, { children: n("div", { className: "ul-card__button-wrapper", children: n(oe, { disabled: C, children: re(r) }) }) })] } : { children: [n(ce, { children: n("div", { className: "ul-card--rank__question-inner-container", children: [n("div", { className: "ul-card-rank__labels", children: n("span", { children: ["1 - ", B] }) }), n("ol", { className: "ul-card-rank__list", onDragOver: $ ? void 0 : (E) => {
1142
1142
  E.preventDefault(), E.dataTransfer && (E.dataTransfer.dropEffect = "move");
1143
- }, children: f.map(({ id: E, label: S, rank: U }, P) => {
1143
+ }, children: f.map(({ id: E, label: D, rank: U }, P) => {
1144
1144
  return n("li", { className: "ul-card-rank__option", draggable: !!h || void 0, onDragEnd: h ? ve : void 0, onDragEnter: h ? Y : void 0, onDragLeave: h ? ee : void 0, onDragStart: h ? (J = P, (z) => {
1145
1145
  a.current = J, z.dataTransfer && (z.dataTransfer.effectAllowed = "move", z.dataTransfer.setData("text/plain", String(J)), z.currentTarget.classList.add("is-dragging"));
1146
1146
  }) : void 0, onDrop: h ? (F = P, (z) => {
@@ -1148,47 +1148,47 @@ const ue = async ({ event: e, apiBase: o, headers: t, visitorId: r, envId: i, me
1148
1148
  z.preventDefault(), z.currentTarget.classList.remove("is-drop-target");
1149
1149
  const V = a.current;
1150
1150
  a.current = null, (Qe = (he = z.currentTarget.closest(".ul-card-rank__list")) == null ? void 0 : he.querySelector(".is-dragging")) == null || Qe.classList.remove("is-dragging"), V != null && V !== F && j(V, F);
1151
- }) : void 0, ref: (z) => w.current[P] = z, children: [n("select", { "aria-label": `Rank for ${S}`, className: A("ul-card-rank__select", U == null && "ul-card-rank__select--placeholder"), name: `rank[${E}]`, onChange: (z) => k(E, z.currentTarget.value), value: U ?? "", children: [U == null && n("option", { className: "ul-card-rank__select-option", disabled: !0, value: "", children: "-" }), N.map((z) => n("option", { className: "ul-card-rank__select-option", value: z, children: z }, z))] }), n("span", { children: S }), !$ && n("button", { "aria-label": `Drag ${S} to reorder`, className: "ul-card-rank__drag-btn", onTouchEnd: m ? D : void 0, onTouchMove: m ? C : void 0, onTouchStart: m ? u(P) : void 0, title: "Drag to reorder", type: "button", children: n("svg", { fill: "none", height: "17", viewBox: "0 0 16 17", width: "16", xmlns: "http://www.w3.org/2000/svg", children: n("path", { d: "M5.75 11.625C6.37132 11.625 6.875 12.1287 6.875 12.75C6.875 13.3713 6.37132 13.875 5.75 13.875C5.12868 13.875 4.625 13.3713 4.625 12.75C4.625 12.1287 5.12868 11.625 5.75 11.625ZM10.25 11.625C10.8713 11.625 11.375 12.1287 11.375 12.75C11.375 13.3713 10.8713 13.875 10.25 13.875C9.62868 13.875 9.125 13.3713 9.125 12.75C9.125 12.1287 9.62868 11.625 10.25 11.625ZM5.75 7.375C6.37132 7.375 6.875 7.87868 6.875 8.5C6.875 9.12132 6.37132 9.625 5.75 9.625C5.12868 9.625 4.625 9.12132 4.625 8.5C4.625 7.87868 5.12868 7.375 5.75 7.375ZM10.25 7.375C10.8713 7.375 11.375 7.87868 11.375 8.5C11.375 9.12132 10.8713 9.625 10.25 9.625C9.62868 9.625 9.125 9.12132 9.125 8.5C9.125 7.87868 9.62868 7.375 10.25 7.375ZM5.75 3.125C6.37132 3.125 6.875 3.62868 6.875 4.25C6.875 4.87132 6.37132 5.375 5.75 5.375C5.12868 5.375 4.625 4.87132 4.625 4.25C4.625 3.62868 5.12868 3.125 5.75 3.125ZM10.25 3.125C10.8713 3.125 11.375 3.62868 11.375 4.25C11.375 4.87132 10.8713 5.375 10.25 5.375C9.62868 5.375 9.125 4.87132 9.125 4.25C9.125 3.62868 9.62868 3.125 10.25 3.125Z", fill: "currentColor" }) }) })] }, E);
1151
+ }) : void 0, ref: (z) => w.current[P] = z, children: [n("select", { "aria-label": `Rank for ${D}`, className: A("ul-card-rank__select", U == null && "ul-card-rank__select--placeholder"), name: `rank[${E}]`, onChange: (z) => k(E, z.currentTarget.value), value: U ?? "", children: [U == null && n("option", { className: "ul-card-rank__select-option", disabled: !0, value: "", children: "-" }), R.map((z) => n("option", { className: "ul-card-rank__select-option", value: z, children: z }, z))] }), n("span", { children: D }), !$ && n("button", { "aria-label": `Drag ${D} to reorder`, className: "ul-card-rank__drag-btn", onTouchEnd: m ? S : void 0, onTouchMove: m ? x : void 0, onTouchStart: m ? p(P) : void 0, title: "Drag to reorder", type: "button", children: n("svg", { fill: "none", height: "17", viewBox: "0 0 16 17", width: "16", xmlns: "http://www.w3.org/2000/svg", children: n("path", { d: "M5.75 11.625C6.37132 11.625 6.875 12.1287 6.875 12.75C6.875 13.3713 6.37132 13.875 5.75 13.875C5.12868 13.875 4.625 13.3713 4.625 12.75C4.625 12.1287 5.12868 11.625 5.75 11.625ZM10.25 11.625C10.8713 11.625 11.375 12.1287 11.375 12.75C11.375 13.3713 10.8713 13.875 10.25 13.875C9.62868 13.875 9.125 13.3713 9.125 12.75C9.125 12.1287 9.62868 11.625 10.25 11.625ZM5.75 7.375C6.37132 7.375 6.875 7.87868 6.875 8.5C6.875 9.12132 6.37132 9.625 5.75 9.625C5.12868 9.625 4.625 9.12132 4.625 8.5C4.625 7.87868 5.12868 7.375 5.75 7.375ZM10.25 7.375C10.8713 7.375 11.375 7.87868 11.375 8.5C11.375 9.12132 10.8713 9.625 10.25 9.625C9.62868 9.625 9.125 9.12132 9.125 8.5C9.125 7.87868 9.62868 7.375 10.25 7.375ZM5.75 3.125C6.37132 3.125 6.875 3.62868 6.875 4.25C6.875 4.87132 6.37132 5.375 5.75 5.375C5.12868 5.375 4.625 4.87132 4.625 4.25C4.625 3.62868 5.12868 3.125 5.75 3.125ZM10.25 3.125C10.8713 3.125 11.375 3.62868 11.375 4.25C11.375 4.87132 10.8713 5.375 10.25 5.375C9.62868 5.375 9.125 4.87132 9.125 4.25C9.125 3.62868 9.62868 3.125 10.25 3.125Z", fill: "currentColor" }) }) })] }, E);
1152
1152
  var F, J;
1153
- }) }), n("div", { className: "ul-card-rank__labels", children: n("span", { children: [Q, " - ", q] }) })] }) }), n(de, { children: n("div", { className: "ul-card__button-wrapper", children: n(oe, { disabled: x, children: re(r) }) }) })] }) }) }, i);
1154
- }, Be = 1, hn = 2, gn = 3, Ee = (e) => e.type === "av_permission", en = (e) => e.type === "screen_permission", bn = (e, o) => e === void 0 ? Be : e ? ((t, r) => !(Ee(r) ? r.permissionDescriptors : []).includes("camera") || t.getVideoTracks().length > 0)(e, o) ? gn : Be : hn, nn = { avStream: null, currentPage: null, mediaRecordingUids: null, nextQuestion: () => {
1155
- }, passthroughData: void 0, recordingMediaTypes: void 0, screenPermissionRequested: !1, type: void 0 }, te = En((e) => ({ ...nn, reset: () => {
1156
- e(nn);
1153
+ }) }), n("div", { className: "ul-card-rank__labels", children: n("span", { children: [Q, " - ", q] }) })] }) }), n(de, { children: n("div", { className: "ul-card__button-wrapper", children: n(oe, { disabled: C, children: re(r) }) }) })] }) }) }, i);
1154
+ }, Be = 1, vn = 2, hn = 3, Ee = (e) => e.type === "av_permission", Xe = (e) => e.type === "screen_permission", gn = (e, o) => e === void 0 ? Be : e ? ((t, r) => !(Ee(r) ? r.permissionDescriptors : []).includes("camera") || t.getVideoTracks().length > 0)(e, o) ? hn : Be : vn, en = { avStream: null, currentPage: null, mediaRecordingUids: null, nextQuestion: () => {
1155
+ }, passthroughData: void 0, recordingMediaTypes: void 0, screenPermissionRequested: !1, type: void 0 }, te = wn((e) => ({ ...en, reset: () => {
1156
+ e(en);
1157
1157
  }, updatePage: (o) => {
1158
1158
  e(o);
1159
1159
  } }));
1160
1160
  function qe({ currentPage: e, pages: o }) {
1161
1161
  const { avStream: t, recordingMediaTypes: r, updatePage: i } = te.getState(), { recorderEventEmitter: s } = G.getState();
1162
- s.emit("av.permission", { "permission.descriptors": e.permissionDescriptors, "stream.ready": (d, p) => {
1162
+ s.emit("av.permission", { "permission.descriptors": e.permissionDescriptors, "stream.ready": (d, u) => {
1163
1163
  if (t === d) return;
1164
1164
  let a = e;
1165
1165
  if (d && !e.permissionDescriptors.includes("camera")) {
1166
- const v = o.indexOf(e), y = p != null && p.active ? v + 2 : v + 1;
1167
- p != null && p.active && r && s.emit("begin.recording", { "recording.media.types": r, "start.recording.callback": (c) => i({ mediaRecordingUids: c }) }), a = o[y];
1166
+ const v = o.indexOf(e), y = u != null && u.active ? v + 2 : v + 1;
1167
+ u != null && u.active && r && s.emit("begin.recording", { "recording.media.types": r, "start.recording.callback": (c) => i({ mediaRecordingUids: c }) }), a = o[y];
1168
1168
  }
1169
1169
  i({ currentPage: a, avStream: d });
1170
1170
  } });
1171
1171
  }
1172
1172
  function Ue({ status: e }) {
1173
- const { nextQuestion: o, passthroughData: t, mediaRecordingUids: r, reset: i } = te.getState(), { recorderEventEmitter: s, handleUploadUpdate: d, index: p } = G.getState(), a = { value: { taskStatus: e }, type: "recordedtask", questionId: (t == null ? void 0 : t.questionId) || 1 };
1173
+ const { nextQuestion: o, passthroughData: t, mediaRecordingUids: r, reset: i } = te.getState(), { recorderEventEmitter: s, handleUploadUpdate: d, index: u } = G.getState(), a = { value: { taskStatus: e }, type: "recordedtask", questionId: (t == null ? void 0 : t.questionId) || 1 };
1174
1174
  t && s.emit("finish.task", { "begin.callback": (v) => {
1175
1175
  d({ mediaRecordingUid: v, isSubmitted: !0, progressPct: 0, isComplete: !1 });
1176
1176
  }, "progress.callback": (v, y) => {
1177
1177
  d({ mediaRecordingUid: v, progressPct: y.detail, isSubmitted: !1, isComplete: !1 });
1178
1178
  }, "upload.callback": (v) => {
1179
1179
  v && d({ mediaRecordingUid: v, isComplete: !0, isSubmitted: !0, progressPct: 100 });
1180
- }, "passthrough.data": t, "current.index": p, "task.response": a, "task.complete.callback": (v) => {
1180
+ }, "passthrough.data": t, "current.index": u, "task.response": a, "task.complete.callback": (v) => {
1181
1181
  a.value.taskDurationMillisecond = v, r && (a.value.mediaRecordingUids = r), i(), o(a);
1182
1182
  } });
1183
1183
  }
1184
1184
  function ze({ pages: e, setIsRequestingPermission: o }) {
1185
- const { recorderEventEmitter: t, eventEmitFn: r } = G.getState(), { updatePage: i, currentPage: s, recordingMediaTypes: d, screenPermissionRequested: p } = te.getState();
1185
+ const { recorderEventEmitter: t, eventEmitFn: r } = G.getState(), { updatePage: i, currentPage: s, recordingMediaTypes: d, screenPermissionRequested: u } = te.getState();
1186
1186
  if (!s) return;
1187
1187
  const a = e.indexOf(s);
1188
1188
  switch (s.type) {
1189
1189
  case "av_permission": {
1190
- const v = p ? a + 2 : a + 1;
1191
- return p && d && t.emit("begin.recording", { "recording.media.types": d, "start.recording.callback": (y) => {
1190
+ const v = u ? a + 2 : a + 1;
1191
+ return u && d && t.emit("begin.recording", { "recording.media.types": d, "start.recording.callback": (y) => {
1192
1192
  i({ mediaRecordingUids: y });
1193
1193
  } }), void i({ currentPage: e[v] });
1194
1194
  }
@@ -1205,7 +1205,7 @@ function ze({ pages: e, setIsRequestingPermission: o }) {
1205
1205
  return;
1206
1206
  }
1207
1207
  }
1208
- const fn = "ul-permission-graphics-container", yn = "ul-permission-body", Cn = A(fn, "ul_recorded-task-inset-spacing"), Ie = A("ul-horizontal-button-container", "ul-horizontal-button-container-left"), xn = ({ richTextBody: e }) => n(Ce, { className: "ul-rich-text-body", html: e, id: "ul-task-detail-container" }), Te = ({ required: e, skipButtonText: o, bottom: t = !1 }) => e ? null : n(oe, { className: A(t && "ul-skip-button-below", "ul-button-inactive"), onClick: Ue.bind(null, { status: "abandoned" }), children: o || "Skip" }), Ge = (e) => {
1208
+ const bn = "ul-permission-graphics-container", fn = "ul-permission-body", yn = A(bn, "ul_recorded-task-inset-spacing"), Ie = A("ul-horizontal-button-container", "ul-horizontal-button-container-left"), Cn = ({ richTextBody: e }) => n(Ce, { className: "ul-rich-text-body", html: e, id: "ul-task-detail-container" }), Te = ({ required: e, skipButtonText: o, bottom: t = !1 }) => e ? null : n(oe, { className: A(t && "ul-skip-button-below", "ul-button-inactive"), onClick: Ue.bind(null, { status: "abandoned" }), children: o || "Skip" }), Ge = (e) => {
1209
1209
  const { avStream: o, captureStream: t, recordingMediaTypes: r, updatePage: i } = te.getState(), s = (r == null ? void 0 : r.includes("audio")) || (r == null ? void 0 : r.includes("video"));
1210
1210
  ae(() => {
1211
1211
  const d = setInterval(() => {
@@ -1213,95 +1213,95 @@ const fn = "ul-permission-graphics-container", yn = "ul-permission-body", Cn = A
1213
1213
  }, 1e3);
1214
1214
  return () => clearInterval(d);
1215
1215
  }, [o, t, s, e, r, i]);
1216
- }, nt = ({ content: e, pages: o, required: t }) => {
1216
+ }, tt = ({ content: e, pages: o, required: t }) => {
1217
1217
  const { buttonText: r, skipButtonText: i, taskDetail: s } = e;
1218
- return Ge(o), n("div", { className: "ul-task-page", children: [s && n(xn, { richTextBody: s }), n("div", { className: Ie, children: [n(oe, { onClick: ze.bind(null, { pages: o }), children: r }), n(Te, { required: t, skipButtonText: i })] })] }, "start-task");
1219
- }, tt = ({ content: e, pages: o, properties: t }) => {
1218
+ return Ge(o), n("div", { className: "ul-task-page", children: [s && n(Cn, { richTextBody: s }), n("div", { className: Ie, children: [n(oe, { onClick: ze.bind(null, { pages: o }), children: r }), n(Te, { required: t, skipButtonText: i })] })] }, "start-task");
1219
+ }, rt = ({ content: e, pages: o, properties: t }) => {
1220
1220
  const { buttonText: r, skipButtonText: i } = e;
1221
- return Ge(o), n("div", { className: "ul-task-page", children: [e.taskDetail && n(xn, { richTextBody: e.taskDetail }), n(ie, { properties: t, children: n("div", { className: Ie, children: [n(oe, { className: "ul-complete-task-button", onClick: Ue.bind(null, { status: "completed" }), children: r }), n(oe, { className: A("ul-button-inactive"), onClick: Ue.bind(null, { status: "given.up" }), children: i })] }) })] }, "complete-task");
1222
- }, rt = ({ content: e, pages: o, required: t }) => {
1223
- const { buttonText: r, skipButtonText: i } = e, [s] = G((a) => [a.tabTitle]), [d, p] = Z(!1);
1224
- return n("div", { children: [n("div", { className: Cn, children: [n("p", { style: { marginTop: "auto" }, children: e.selectTabText }), n("div", { className: "ul-select-tab-container", children: n("p", { className: yn, children: s }) })] }), n("div", { className: t ? "" : Ie, children: [n(oe, { disabled: d, onClick: ze.bind(null, { pages: o, setIsRequestingPermission: p }), children: r }), n(Te, { required: t, skipButtonText: i })] })] });
1225
- }, ot = ({ content: e }) => n(Ce, { className: A(fn, "ul_permission_svg_container", "ul_recorded-task-inset-spacing", "ul-center-horizontally"), html: e.svg }, "ul-permission-request-graphic"), it = ({ content: e, pages: o, required: t }) => {
1226
- const { permissionDeniedHeadline: r, permissionDeniedBody: i, skipButtonText: s, tryAgainButtonText: d } = e, p = Ee(o[0]) ? o[0] : null;
1221
+ return Ge(o), n("div", { className: "ul-task-page", children: [e.taskDetail && n(Cn, { richTextBody: e.taskDetail }), n(ie, { properties: t, children: n("div", { className: Ie, children: [n(oe, { className: "ul-complete-task-button", onClick: Ue.bind(null, { status: "completed" }), children: r }), n(oe, { className: A("ul-button-inactive"), onClick: Ue.bind(null, { status: "given.up" }), children: i })] }) })] }, "complete-task");
1222
+ }, ot = ({ content: e, pages: o, required: t }) => {
1223
+ const { buttonText: r, skipButtonText: i } = e, [s] = G((a) => [a.tabTitle]), [d, u] = Z(!1);
1224
+ return n("div", { children: [n("div", { className: yn, children: [n("p", { style: { marginTop: "auto" }, children: e.selectTabText }), n("div", { className: "ul-select-tab-container", children: n("p", { className: fn, children: s }) })] }), n("div", { className: t ? "" : Ie, children: [n(oe, { disabled: d, onClick: ze.bind(null, { pages: o, setIsRequestingPermission: u }), children: r }), n(Te, { required: t, skipButtonText: i })] })] });
1225
+ }, it = ({ content: e }) => n(Ce, { className: A(bn, "ul_permission_svg_container", "ul_recorded-task-inset-spacing", "ul-center-horizontally"), html: e.svg }, "ul-permission-request-graphic"), st = ({ content: e, pages: o, required: t }) => {
1226
+ const { permissionDeniedHeadline: r, permissionDeniedBody: i, skipButtonText: s, tryAgainButtonText: d } = e, u = Ee(o[0]) ? o[0] : null;
1227
1227
  return ae(() => {
1228
1228
  const a = setInterval(() => {
1229
- p !== null && qe({ currentPage: p, pages: o });
1229
+ u !== null && qe({ currentPage: u, pages: o });
1230
1230
  }, 1e3);
1231
1231
  return () => clearInterval(a);
1232
- }, [p, o]), p ? n("div", { children: [n("div", { className: Cn, children: n("p", { className: "ul-av-permission-denied-paragraph", children: [n("span", { className: "ul-av-permission-denied-headline", children: r }), n("span", { className: yn, children: i })] }) }), n("div", { className: Ie, children: [n(oe, { onClick: qe.bind(null, { currentPage: p, pages: o }), children: d }), n(Te, { required: t, skipButtonText: s })] })] }) : null;
1233
- }, st = ({ stream: e }) => n("video", { autoPlay: !0, className: A("ul_recorded-task-inset-spacing"), id: "ul-record-task-video-preview", muted: !0, ref: (o) => {
1232
+ }, [u, o]), u ? n("div", { children: [n("div", { className: yn, children: n("p", { className: "ul-av-permission-denied-paragraph", children: [n("span", { className: "ul-av-permission-denied-headline", children: r }), n("span", { className: fn, children: i })] }) }), n("div", { className: Ie, children: [n(oe, { onClick: qe.bind(null, { currentPage: u, pages: o }), children: d }), n(Te, { required: t, skipButtonText: s })] })] }) : null;
1233
+ }, at = ({ stream: e }) => n("video", { autoPlay: !0, className: A("ul_recorded-task-inset-spacing"), id: "ul-record-task-video-preview", muted: !0, ref: (o) => {
1234
1234
  o && (o.srcObject = e || null);
1235
- } }), at = ({ content: e, pages: o, required: t }) => {
1235
+ } }), lt = ({ content: e, pages: o, required: t }) => {
1236
1236
  const { skipButtonText: r } = e, { avStream: i } = te.getState();
1237
- return Ge(o), n("div", { children: [n(st, { stream: i }), n("div", { className: "ul-vertical-button-container-center", children: [n(oe, { onClick: ze.bind(null, { pages: o }), children: e.buttonText }), n(Te, { bottom: !0, required: t, skipButtonText: r })] })] });
1238
- }, lt = ({ properties: e }) => {
1237
+ return Ge(o), n("div", { children: [n(at, { stream: i }), n("div", { className: "ul-vertical-button-container-center", children: [n(oe, { onClick: ze.bind(null, { pages: o }), children: e.buttonText }), n(Te, { bottom: !0, required: t, skipButtonText: r })] })] });
1238
+ }, dt = ({ properties: e }) => {
1239
1239
  const { pages: o, required: t } = e, { avStream: r, currentPage: i } = te.getState();
1240
1240
  if (i === void 0) return null;
1241
1241
  switch (i == null ? void 0 : i.type) {
1242
1242
  case "av_permission": {
1243
- const s = bn(r, i);
1244
- return s === Be ? n(ot, { content: i }) : n(s === hn ? it : at, { content: i, pages: o, required: t });
1243
+ const s = gn(r, i);
1244
+ return s === Be ? n(it, { content: i }) : n(s === vn ? st : lt, { content: i, pages: o, required: t });
1245
1245
  }
1246
1246
  case "screen_permission":
1247
- return n(rt, { content: i, pages: o, required: t });
1247
+ return n(ot, { content: i, pages: o, required: t });
1248
1248
  case "start_task":
1249
- return n(nt, { content: i, pages: o, required: t });
1249
+ return n(tt, { content: i, pages: o, required: t });
1250
1250
  case "complete_task":
1251
- return n(tt, { content: i, pages: o, properties: e });
1251
+ return n(rt, { content: i, pages: o, properties: e });
1252
1252
  default:
1253
1253
  return null;
1254
1254
  }
1255
- }, dt = ({ className: e, properties: o, next: t, questionId: r }) => {
1256
- const i = G(), { surveyId: s, responseGroupUid: d, userId: p } = i, a = te(), { screenPermissionRequested: v } = a, y = te((b) => b.avStream);
1255
+ }, ct = ({ className: e, properties: o, next: t, questionId: r }) => {
1256
+ const i = G(), { surveyId: s, responseGroupUid: d, userId: u } = i, a = te(), { screenPermissionRequested: v } = a, y = te((b) => b.avStream);
1257
1257
  let c = te((b) => b.currentPage);
1258
- c || (c = function({ pages: b, userId: f, responseGroupUid: _, surveyId: N, questionId: L, next: T }) {
1259
- const { updatePage: H } = te.getState(), { eventEmitFn: $, recorderEventEmitter: m } = G.getState(), h = { questionId: L, surveyId: N, visitorId: f, responseGroupUid: _ };
1258
+ c || (c = function({ pages: b, userId: f, responseGroupUid: _, surveyId: R, questionId: N, next: T }) {
1259
+ const { updatePage: H } = te.getState(), { eventEmitFn: $, recorderEventEmitter: m } = G.getState(), h = { questionId: N, surveyId: R, visitorId: f, responseGroupUid: _ };
1260
1260
  let k = 0;
1261
- m.emit("recorded.task.permission.screen"), $("recorded.task.permission.screen"), m.emit("permission.status", { "permission.status.callback": (u, C, D, j) => {
1261
+ m.emit("recorded.task.permission.screen"), $("recorded.task.permission.screen"), m.emit("permission.status", { "permission.status.callback": (p, x, S, j) => {
1262
1262
  const M = b[k], { type: O } = M, B = ["screen"];
1263
1263
  if (Ee(M)) {
1264
1264
  const { permissionDescriptors: q } = M, Q = q == null ? void 0 : q.includes("microphone"), Y = q == null ? void 0 : q.includes("camera");
1265
- Q && B.push("audio"), Y && B.push("video"), (u != null && u.active && !Y || u != null && u.active && C) && k++;
1265
+ Q && B.push("audio"), Y && B.push("video"), (p != null && p.active && !Y || p != null && p.active && x) && k++;
1266
1266
  }
1267
- en(b[k]) && D && (k++, m.emit("begin.recording", { "recording.media.types": B, "start.recording.callback": (q) => H({ mediaRecordingUids: q }) })), H({ currentPage: b[k], avStream: u, screenPermissionRequested: D, nextQuestion: T, type: O, passthroughData: h, recordingMediaTypes: B, captureStream: j });
1267
+ Xe(b[k]) && S && (k++, m.emit("begin.recording", { "recording.media.types": B, "start.recording.callback": (q) => H({ mediaRecordingUids: q }) })), H({ currentPage: b[k], avStream: p, screenPermissionRequested: S, nextQuestion: T, type: O, passthroughData: h, recordingMediaTypes: B, captureStream: j });
1268
1268
  } });
1269
1269
  const l = b[k];
1270
1270
  return l.type === "av_permission" && qe({ currentPage: l, pages: b }), l;
1271
1271
  }({ questionId: r, surveyId: s, next: (b) => {
1272
1272
  t(b, !0);
1273
- }, pages: o.pages, responseGroupUid: d, userId: p }));
1273
+ }, pages: o.pages, responseGroupUid: d, userId: u }));
1274
1274
  let g = c.headline, w = c.captionText;
1275
- const x = bn(y, c);
1276
- return en(c) && v && (g = c.permissionDeniedHeadline, w = c.permissionDeniedCaptionText), Ee(c) && x === gn && (g = c.permissionGrantedHeadline, w = c.permissionGrantedCaptionText), n("div", { className: A(e, "ul-center-horizontally", "fade-in-transition"), children: [n(Ve, { isRequired: o == null ? void 0 : o.required, message: g, properties: { captionText: w } }), n(ce, { children: n(lt, { properties: o }) })] });
1277
- }, ct = ({ className: e, next: o, properties: t, questionId: r, type: i }) => {
1278
- const { visitorAttributes: s, isLongFormSurvey: d } = G((y) => ({ visitorAttributes: y.visitorAttributes, isLongFormSurvey: sn(y.studyType) })), p = (y, c = !1) => {
1275
+ const C = gn(y, c);
1276
+ return Xe(c) && v && (g = c.permissionDeniedHeadline, w = c.permissionDeniedCaptionText), Ee(c) && C === hn && (g = c.permissionGrantedHeadline, w = c.permissionGrantedCaptionText), n("div", { className: A(e, "ul-center-horizontally", "fade-in-transition"), children: [n(Ve, { isRequired: o == null ? void 0 : o.required, message: g, properties: { captionText: w } }), n(ce, { children: n(dt, { properties: o }) })] });
1277
+ }, ut = ({ className: e, next: o, properties: t, questionId: r, type: i }) => {
1278
+ const { visitorAttributes: s, isLongFormSurvey: d } = G((y) => ({ visitorAttributes: y.visitorAttributes, isLongFormSurvey: on(y.studyType) })), u = (y, c = !1) => {
1279
1279
  o({ value: c ? { skipped: !0 } : void 0, questionId: r, type: i }, !0);
1280
- }, a = Mn(t && t.buttonUrl, s), v = d && t.promptActionType === jn.NO_BUTTON;
1281
- return n("div", { className: A(e, "ul-card__text-url-prompt", "fade-in-transition"), children: n(ie, { properties: t, children: !v && n("div", { children: n("div", { className: "ul-card-button-group", children: [n("a", { className: "ul-card-text__button ul-card__text-url-prompt-button", href: a, id: "ul-card-text__button", onClick: p, onKeyPress: (y) => {
1280
+ }, a = Bn(t && t.buttonUrl, s), v = d && t.promptActionType === En.NO_BUTTON;
1281
+ return n("div", { className: A(e, "ul-card__text-url-prompt", "fade-in-transition"), children: n(ie, { properties: t, children: !v && n("div", { children: n("div", { className: "ul-card-button-group", children: [n("a", { className: "ul-card-text__button ul-card__text-url-prompt-button", href: a, id: "ul-card-text__button", onClick: u, onKeyPress: (y) => {
1282
1282
  y.key !== "Enter" && y.key !== " " || o({ value: void 0, questionId: r, type: i }, !0);
1283
- }, rel: "noreferrer", role: a ? "link" : "button", tabIndex: 0, target: "_blank", children: re(t) }), t.required === !1 && n("button", { className: "ul-card-skip__button", onClick: (y) => p(0, !0), children: Oe(t) })] }) }) }) }, r);
1284
- }, ut = ({ className: e, questionId: o }) => {
1283
+ }, rel: "noreferrer", role: a ? "link" : "button", tabIndex: 0, target: "_blank", children: re(t) }), t.required === !1 && n("button", { className: "ul-card-skip__button", onClick: (y) => u(0, !0), children: Oe(t) })] }) }) }) }, r);
1284
+ }, pt = ({ className: e, questionId: o }) => {
1285
1285
  const { border: t, destroy: r, endCard: i, forceBrandedLogo: s } = G((a) => ({ border: a.border, destroy: a.destroy, endCard: a.endCard, forceBrandedLogo: a.forceBrandedLogo }));
1286
1286
  ae(() => {
1287
1287
  setTimeout(() => {
1288
1288
  r($e);
1289
1289
  }, s ? 4e3 : 2e3);
1290
1290
  }, [r, s]);
1291
- const d = i && i.subheader ? n("p", { className: "ul-caption", children: i.subheader }) : null, p = i && i.headline ? i.headline : "";
1292
- return n("div", { className: A(e, "ul-card--thanks", "fade-in-transition"), children: n("div", { children: n("div", { className: "ul-card--thanks-content", children: [n("div", { className: "ul-thanks-check", children: n("svg", { "aria-labelledby": "title", fill: "none", height: "99", viewBox: "0 0 81 99", width: "81", xmlns: "http://www.w3.org/2000/svg", children: [n("path", { clipRule: "evenodd", d: "M40.5 77C60.9345 77 77.5 60.4345 77.5 40C77.5 19.5655 60.9345 3 40.5 3C20.0655 3 3.5 19.5655 3.5 40C3.5 60.4345 20.0655 77 40.5 77ZM80.5 40C80.5 62.0914 62.5914 80 40.5 80C18.4086 80 0.5 62.0914 0.5 40C0.5 17.9086 18.4086 0 40.5 0C62.5914 0 80.5 17.9086 80.5 40Z", fill: t, fillRule: "evenodd" }), n("path", { clipRule: "evenodd", d: "M55.025 22.9046C55.6299 23.4705 55.6616 24.4198 55.0956 25.0247C54.8724 25.2634 54.6109 25.5285 54.3157 25.8277C52.2547 27.9168 48.5549 31.667 44.8135 39.6658C43.2818 42.9406 42.0864 45.8386 41.0823 48.2729C40.6539 49.3116 40.2603 50.2659 39.8902 51.129C39.287 52.5359 38.7248 53.7508 38.1744 54.625C37.8997 55.0613 37.5806 55.4905 37.2017 55.8245C36.8201 56.1607 36.2613 56.5 35.5457 56.5C34.6742 56.5 34.0892 55.9692 33.7774 55.6083C33.4502 55.2296 33.1752 54.7511 32.9396 54.301C32.7305 53.9013 32.5088 53.4367 32.2797 52.9565C32.2429 52.8794 32.2059 52.8019 32.1688 52.7243C31.8942 52.1499 31.5959 51.534 31.2537 50.8868C29.8886 48.305 27.8539 45.2878 24.2343 43.1382C23.522 42.7152 23.2875 41.7949 23.7105 41.0826C24.1335 40.3703 25.0539 40.1358 25.7662 40.5588C30.0556 43.1062 32.4149 46.6647 33.9058 49.4845C34.2776 50.1876 34.5973 50.8487 34.8753 51.4302C34.9147 51.5124 34.9529 51.5926 34.9902 51.6707C35.2222 52.1567 35.4164 52.5637 35.5978 52.9102C35.6151 52.9434 35.6321 52.9754 35.6485 53.0061C36.0565 52.3531 36.5341 51.3434 37.133 49.9468C37.4781 49.1418 37.8572 48.2229 38.2761 47.2074C39.2886 44.7532 40.5339 41.7347 42.0961 38.3948C46.0591 29.9221 50.0641 25.8648 52.1535 23.7482C52.4423 23.4556 52.6944 23.2002 52.9048 22.9753C53.4708 22.3703 54.42 22.3387 55.025 22.9046ZM35.1994 53.5892C35.1994 53.5892 35.2 53.5888 35.2012 53.5879C35.2 53.5889 35.1994 53.5893 35.1994 53.5892ZM36.0666 53.6682C36.0732 53.674 36.0765 53.6775 36.0765 53.6777C36.0765 53.678 36.0732 53.6751 36.0666 53.6682Z", fill: t, fillRule: "evenodd" }), n("path", { d: "M69.5 97C69.5 98.1046 56.2924 99 40 99C23.7076 99 10.5 98.1046 10.5 97C10.5 95.8954 23.7076 95 40 95C56.2924 95 69.5 95.8954 69.5 97Z", fill: "black", fillOpacity: "0.2" })] }) }), n(Ve, { message: p }), d] }) }) }, o);
1293
- }, pt = () => n("div", { className: "thinking-dots-container", children: n("div", { className: "thinking-dot" }) }), mt = ({ className: e }) => {
1291
+ const d = i && i.subheader ? n("p", { className: "ul-caption", children: i.subheader }) : null, u = i && i.headline ? i.headline : "";
1292
+ return n("div", { className: A(e, "ul-card--thanks", "fade-in-transition"), children: n("div", { children: n("div", { className: "ul-card--thanks-content", children: [n("div", { className: "ul-thanks-check", children: n("svg", { "aria-labelledby": "title", fill: "none", height: "99", viewBox: "0 0 81 99", width: "81", xmlns: "http://www.w3.org/2000/svg", children: [n("path", { clipRule: "evenodd", d: "M40.5 77C60.9345 77 77.5 60.4345 77.5 40C77.5 19.5655 60.9345 3 40.5 3C20.0655 3 3.5 19.5655 3.5 40C3.5 60.4345 20.0655 77 40.5 77ZM80.5 40C80.5 62.0914 62.5914 80 40.5 80C18.4086 80 0.5 62.0914 0.5 40C0.5 17.9086 18.4086 0 40.5 0C62.5914 0 80.5 17.9086 80.5 40Z", fill: t, fillRule: "evenodd" }), n("path", { clipRule: "evenodd", d: "M55.025 22.9046C55.6299 23.4705 55.6616 24.4198 55.0956 25.0247C54.8724 25.2634 54.6109 25.5285 54.3157 25.8277C52.2547 27.9168 48.5549 31.667 44.8135 39.6658C43.2818 42.9406 42.0864 45.8386 41.0823 48.2729C40.6539 49.3116 40.2603 50.2659 39.8902 51.129C39.287 52.5359 38.7248 53.7508 38.1744 54.625C37.8997 55.0613 37.5806 55.4905 37.2017 55.8245C36.8201 56.1607 36.2613 56.5 35.5457 56.5C34.6742 56.5 34.0892 55.9692 33.7774 55.6083C33.4502 55.2296 33.1752 54.7511 32.9396 54.301C32.7305 53.9013 32.5088 53.4367 32.2797 52.9565C32.2429 52.8794 32.2059 52.8019 32.1688 52.7243C31.8942 52.1499 31.5959 51.534 31.2537 50.8868C29.8886 48.305 27.8539 45.2878 24.2343 43.1382C23.522 42.7152 23.2875 41.7949 23.7105 41.0826C24.1335 40.3703 25.0539 40.1358 25.7662 40.5588C30.0556 43.1062 32.4149 46.6647 33.9058 49.4845C34.2776 50.1876 34.5973 50.8487 34.8753 51.4302C34.9147 51.5124 34.9529 51.5926 34.9902 51.6707C35.2222 52.1567 35.4164 52.5637 35.5978 52.9102C35.6151 52.9434 35.6321 52.9754 35.6485 53.0061C36.0565 52.3531 36.5341 51.3434 37.133 49.9468C37.4781 49.1418 37.8572 48.2229 38.2761 47.2074C39.2886 44.7532 40.5339 41.7347 42.0961 38.3948C46.0591 29.9221 50.0641 25.8648 52.1535 23.7482C52.4423 23.4556 52.6944 23.2002 52.9048 22.9753C53.4708 22.3703 54.42 22.3387 55.025 22.9046ZM35.1994 53.5892C35.1994 53.5892 35.2 53.5888 35.2012 53.5879C35.2 53.5889 35.1994 53.5893 35.1994 53.5892ZM36.0666 53.6682C36.0732 53.674 36.0765 53.6775 36.0765 53.6777C36.0765 53.678 36.0732 53.6751 36.0666 53.6682Z", fill: t, fillRule: "evenodd" }), n("path", { d: "M69.5 97C69.5 98.1046 56.2924 99 40 99C23.7076 99 10.5 98.1046 10.5 97C10.5 95.8954 23.7076 95 40 95C56.2924 95 69.5 95.8954 69.5 97Z", fill: "black", fillOpacity: "0.2" })] }) }), n(Ve, { message: u }), d] }) }) }, o);
1293
+ }, mt = () => n("div", { className: "thinking-dots-container", children: n("div", { className: "thinking-dot" }) }), vt = ({ className: e }) => {
1294
1294
  const { uploadProgress: o } = G((s) => ({ uploadProgress: s.uploadProgress }));
1295
1295
  let t, r;
1296
1296
  Object.values(o).filter((s) => s.isSubmitted).length > 1 ? (t = "Your responses are processing", r = "Please keep this tab open until your responses are fully processed.") : (t = "Your response is processing", r = "Please keep this tab open until your response is fully processed.");
1297
1297
  const i = Math.round(Math.min(99, ...Object.values(o).filter((s) => s.isSubmitted).map((s) => s.progressPct || 0)));
1298
1298
  return n("div", { className: A(e, "ul-card--uploading", "fade-in-transition"), children: [n("div", { "aria-busy": "true", "aria-label": "Processing...", "aria-live": "polite", className: "ul-loading-spinner-container", role: "progressbar", children: n("div", { className: "ul-loading-spinner", children: [n("div", { className: "first" }), n("div", { className: "second" }), n("div", { className: "third" }), n("div", { className: "fourth" })] }) }), n(Ve, { message: `${t} (${i}% complete)` }), n("p", { className: "ul-caption", children: r })] });
1299
- }, tn = 0, rn = 1, vt = ({ className: e, next: o, properties: t, questionId: r, type: i }) => {
1300
- const s = `ul-card-video__player_recorder-q${r}`, { apiURL: d, envId: p, handleUploadUpdate: a, headers: v, responseGroupUid: y, surveyId: c, viewDocument: g, visitorId: w } = G((h) => ({ apiURL: h.apiURL, envId: h.envId, handleUploadUpdate: h.handleUploadUpdate, headers: h.headers, responseGroupUid: h.responseGroupUid, surveyId: h.surveyId, viewDocument: h.viewDocument, visitorId: h.userId })), [x, b] = Z(!1), [f, _] = Z(null), [N, L] = Z(null), [T, H] = Z(tn), $ = (h, k) => {
1301
- h === R.UPLOAD_STARTED ? (_(k[R.UPLOAD_ID]), L(k[R.MEDIA_RECORDING_UID]), b(!0)) : h === R.DELETE ? (_(null), L(null), b(!1)) : h === R.UPLOAD_PROGRESS ? isNaN(k[R.UPLOAD_PROGRESS_PCT]) ? a({ mediaRecordingUid: k[R.MEDIA_RECORDING_UID], isComplete: !0 }) : a({ mediaRecordingUid: k[R.MEDIA_RECORDING_UID], progressPct: k[R.UPLOAD_PROGRESS_PCT] }) : h === R.UPLOAD_FINISHED && a({ mediaRecordingUid: k[R.MEDIA_RECORDING_UID], isComplete: !0 });
1299
+ }, nn = 0, tn = 1, ht = ({ className: e, next: o, properties: t, questionId: r, type: i }) => {
1300
+ const s = `ul-card-video__player_recorder-q${r}`, { apiURL: d, envId: u, handleUploadUpdate: a, headers: v, responseGroupUid: y, surveyId: c, viewDocument: g, visitorId: w } = G((h) => ({ apiURL: h.apiURL, envId: h.envId, handleUploadUpdate: h.handleUploadUpdate, headers: h.headers, responseGroupUid: h.responseGroupUid, surveyId: h.surveyId, viewDocument: h.viewDocument, visitorId: h.userId })), [C, b] = Z(!1), [f, _] = Z(null), [R, N] = Z(null), [T, H] = Z(nn), $ = (h, k) => {
1301
+ h === L.UPLOAD_STARTED ? (_(k[L.UPLOAD_ID]), N(k[L.MEDIA_RECORDING_UID]), b(!0)) : h === L.DELETE ? (_(null), N(null), b(!1)) : h === L.UPLOAD_PROGRESS ? isNaN(k[L.UPLOAD_PROGRESS_PCT]) ? a({ mediaRecordingUid: k[L.MEDIA_RECORDING_UID], isComplete: !0 }) : a({ mediaRecordingUid: k[L.MEDIA_RECORDING_UID], progressPct: k[L.UPLOAD_PROGRESS_PCT] }) : h === L.UPLOAD_FINISHED && a({ mediaRecordingUid: k[L.MEDIA_RECORDING_UID], isComplete: !0 });
1302
1302
  }, m = (h) => {
1303
1303
  h.preventDefault(), h.stopPropagation(), document.getElementById(s) && ((k) => {
1304
- const l = k + Ke;
1304
+ const l = k + We;
1305
1305
  if (I.document.getElementById(l) && I.videojs) {
1306
1306
  try {
1307
1307
  if (!I.videojs(l).record().stream) return;
@@ -1310,153 +1310,153 @@ const fn = "ul-permission-graphics-container", yn = "ul-permission-body", Cn = A
1310
1310
  }
1311
1311
  I.videojs(l).record().stop(), I.videojs(l).record().stopDevice();
1312
1312
  }
1313
- })(s), f && N ? (a({ mediaRecordingUid: N, isSubmitted: !0 }), o({ value: { mediaRecordingUid: N }, questionId: r, type: i }, !0)) : o({ value: null, questionId: r, type: i }, !0);
1313
+ })(s), f && R ? (a({ mediaRecordingUid: R, isSubmitted: !0 }), o({ value: { mediaRecordingUid: R }, questionId: r, type: i }, !0)) : o({ value: null, questionId: r, type: i }, !0);
1314
1314
  };
1315
- return n("form", { className: A(e, "ul-card--video", "fade-in-transition"), id: "ul-video-interview-form", children: [n(ce, { children: [n("div", { id: "ul-question-player-container", style: { display: T === tn ? "" : "none" }, children: n(ie, { properties: t, children: n("button", { className: "ul-video-btn ul-record-response-btn", onClick: (h) => {
1315
+ return n("form", { className: A(e, "ul-card--video", "fade-in-transition"), id: "ul-video-interview-form", children: [n(ce, { children: [n("div", { id: "ul-question-player-container", style: { display: T === nn ? "" : "none" }, children: n(ie, { properties: t, children: n("button", { className: "ul-video-btn ul-record-response-btn", onClick: (h) => {
1316
1316
  h.preventDefault(), h.stopPropagation(), document.getElementById(s) && ((k) => {
1317
- const l = we(k + ln);
1317
+ const l = we(k + an);
1318
1318
  l == null || l.pause();
1319
- })(s), H(rn);
1320
- } }) }) }), n("div", { style: { display: T === rn ? "block" : "none" }, children: n("div", { id: "ul-recorder-player-container", ref: (h) => {
1319
+ })(s), H(tn);
1320
+ } }) }) }), n("div", { style: { display: T === tn ? "block" : "none" }, children: n("div", { id: "ul-recorder-player-container", ref: (h) => {
1321
1321
  if (h && h.children.length === 0) {
1322
- const k = ((l, u = {}, C = "https://api.userleap.com", D, j, M, O = !1, B = document) => {
1322
+ const k = ((l, p = {}, x = "https://api.userleap.com", S, j, M, O = !1, B = document) => {
1323
1323
  I.document = B;
1324
- const q = l + Ke, Q = mn(q);
1324
+ const q = l + We, Q = pn(q);
1325
1325
  return I.document.addEventListener("securitypolicyviolation", (Y) => {
1326
- le(new Error(`Voice & Video feature violates ${Y.violatedDirective} web page CSP policies for the recorder player.`), "recorderDeviceError", C, M, u.visitorId, u.envId);
1327
- }), dn(an.concat(qn), () => {
1326
+ le(new Error(`Voice & Video feature violates ${Y.violatedDirective} web page CSP policies for the recorder player.`), "recorderDeviceError", x, M, p.visitorId, p.envId);
1327
+ }), ln(sn.concat(Un), () => {
1328
1328
  Me(q, Q), I.document.getElementById(Fe(q)).remove();
1329
1329
  try {
1330
- On(Q, q, u, C, D, j, M, O);
1330
+ An(Q, q, p, x, S, j, M, O);
1331
1331
  } catch (Y) {
1332
- return void le(new Error(`Error when creating video recorder player object ${Y}`), "recorderDeviceError", C, M, u.visitorId, u.envId);
1332
+ return void le(new Error(`Error when creating video recorder player object ${Y}`), "recorderDeviceError", x, M, p.visitorId, p.envId);
1333
1333
  }
1334
1334
  }), Q;
1335
- })(s, { surveyId: c, responseGroupUid: y, questionId: r, visitorId: w, envId: p }, d, $, void 0, { ...v, "x-ul-video-recorder-origin": "sdk" }, t.mediaType === R.MEDIA_TYPE_AUDIO, g);
1335
+ })(s, { surveyId: c, responseGroupUid: y, questionId: r, visitorId: w, envId: u }, d, $, void 0, { ...v, "x-ul-video-recorder-origin": "sdk" }, t.mediaType === L.MEDIA_TYPE_AUDIO, g);
1336
1336
  h.appendChild(k);
1337
1337
  }
1338
- } }) })] }), n(de, { children: [n(me, { isDisabled: !!t.required && !x, onClick: m, children: re(t) }), n("button", { className: "ul-card-text__button ul-button-inactive ul-card-skip__button", id: "ul-card-video__skip_button", onClick: m, style: { ...t.required ? { display: "none" } : {}, ...x ? { display: "none" } : {} }, children: Oe(t) })] })] });
1339
- }, fe = (e) => e.type === "aidynamicfollowup" || e.type === "aidynamicstandalone", Le = (e) => {
1338
+ } }) })] }), n(de, { children: [n(me, { isDisabled: !!t.required && !C, onClick: m, children: re(t) }), n("button", { className: "ul-card-text__button ul-button-inactive ul-card-skip__button", id: "ul-card-video__skip_button", onClick: m, style: { ...t.required ? { display: "none" } : {}, ...C ? { display: "none" } : {} }, children: Oe(t) })] })] });
1339
+ }, fe = (e) => e.type === "aidynamicfollowup" || e.type === "aidynamicstandalone", Ne = (e) => {
1340
1340
  var o;
1341
- return fe(e) && ((o = e.props) == null ? void 0 : o.loading) === Ne.inFlight;
1342
- }, kn = (e) => e.type === "thanks" || e.type === "uploading", ht = ({ card: e, avatars: o, isThinking: t, isCurrentQuestion: r, currentQuestionBubbleRef: i }) => {
1341
+ return fe(e) && ((o = e.props) == null ? void 0 : o.loading) === Re.inFlight;
1342
+ }, xn = (e) => e.type === "thanks" || e.type === "uploading", gt = ({ card: e, avatars: o, isThinking: t, isCurrentQuestion: r, currentQuestionBubbleRef: i }) => {
1343
1343
  const s = ((d) => "properties" in d.props && d.props.properties && "questionHtml" in d.props.properties && d.props.properties.questionHtml ? { content: d.props.properties.questionHtml, isHtml: !0 } : "message" in d.props ? { content: d.props.message, isHtml: !1 } : { content: "Question", isHtml: !1 })(e);
1344
- return n(ge, { avatars: o, isLeft: !0, message: { id: `question-${e.name}`, type: "question", content: s.content }, ref: r ? i : null, children: t ? n(pt, {}) : n(je, { children: [s.isHtml ? n(Ce, { className: "chat-message-text", html: s.content }) : n("div", { className: "chat-message-text", children: s.content }), e.type === "videovoice" && n(Vn, { properties: e.props, questionId: e.name, surveyVideoUrl: e.props.properties.videoUrl })] }) });
1345
- }, gt = ({ card: e, avatars: o }) => {
1344
+ return n(ge, { avatars: o, isLeft: !0, message: { id: `question-${e.name}`, type: "question", content: s.content }, ref: r ? i : null, children: t ? n(mt, {}) : n(je, { children: [s.isHtml ? n(Ce, { className: "chat-message-text", html: s.content }) : n("div", { className: "chat-message-text", children: s.content }), e.type === "videovoice" && n(Fn, { properties: e.props, questionId: e.name, surveyVideoUrl: e.props.properties.videoUrl })] }) });
1345
+ }, bt = ({ card: e, avatars: o }) => {
1346
1346
  const t = ((r) => {
1347
1347
  if (!("properties" in r.props) || !r.props.properties || typeof r.props.properties != "object") return null;
1348
1348
  const i = r.props.properties, s = [{ key: "captionHtml", isHtml: !0 }, { key: "captionText", isHtml: !1 }, { key: "richTextBody", isHtml: !0 }, { key: "body", isHtml: !1 }];
1349
- for (const { key: d, isHtml: p } of s) {
1349
+ for (const { key: d, isHtml: u } of s) {
1350
1350
  const a = i[d];
1351
1351
  if (typeof a != "string") continue;
1352
1352
  const v = a.trim();
1353
1353
  if (v) {
1354
- if (p && !v.replaceAll(/<[^>]*>/g, "").trim()) continue;
1355
- return { content: v, isHtml: p };
1354
+ if (u && !v.replaceAll(/<[^>]*>/g, "").trim()) continue;
1355
+ return { content: v, isHtml: u };
1356
1356
  }
1357
1357
  }
1358
1358
  return null;
1359
1359
  })(e);
1360
1360
  return t ? n(ge, { avatars: o, hideAvatar: !0, isLeft: !0, message: { id: `caption-${e.name}`, type: "question", content: t.content }, children: t.isHtml ? n(Ce, { className: "chat-message-text", html: t.content }) : n("div", { className: "chat-message-text", children: t.content }) }) : null;
1361
- }, bt = ({ card: e, userResponse: o, avatars: t }) => {
1361
+ }, ft = ({ card: e, userResponse: o, avatars: t }) => {
1362
1362
  const r = ((i, s) => {
1363
- if (i.type === "open" && s && typeof s == "object" && "value" in s) return s.value;
1363
+ if ((i.type === "open" || i.type === "aidynamicfollowup" || i.type === "aidynamicstandalone") && s && typeof s == "object" && "value" in s) return s.value;
1364
1364
  })(e, o);
1365
1365
  return n("div", { className: "chat-bubble-container chat-right", children: [n("div", { className: "chat-bubble chat-bubble-right chat-bubble-text-only", children: n("div", { className: "chat-message-text", children: r || n("div", { className: "chat-message-no-response", children: "No response" }) }) }), n("img", { alt: "User Avatar", className: "chat-avatar chat-avatar-right", srcSet: `${t.respondentAvatar["1x"]} 1x, ${t.respondentAvatar["2x"]} 2x` })] });
1366
- }, ft = ({ card: e, avatars: o, isCurrentQuestion: t, currentQuestionBubbleRef: r }) => {
1366
+ }, yt = ({ card: e, avatars: o, isCurrentQuestion: t, currentQuestionBubbleRef: r }) => {
1367
1367
  const { endCard: i } = G((s) => ({ endCard: s.endCard }));
1368
- return n(je, { children: [n(ge, { avatars: o, isLeft: !0, message: { id: `thanks-${e.name}`, type: "question", content: (i == null ? void 0 : i.headline) ?? "Great! Thank you for your participation." }, ref: t ? r : null }), (i == null ? void 0 : i.subheader) && n(ge, { avatars: o, hideAvatar: !0, isLeft: !0, message: { id: `caption-${e.name}`, type: "question", content: i.subheader } }), n(zn, {})] });
1369
- }, yt = ({ card: e, cardIndex: o, index: t, avatars: r, cardResponses: i, questionThinkingStates: s, startingQuestionIdx: d, currentQuestionBubbleRef: p, handleCardResponse: a }) => {
1370
- const v = o === t, y = o < t, c = kn(e);
1371
- if (c) return n(ft, { avatars: r, card: e, currentQuestionBubbleRef: p, isCurrentQuestion: v });
1372
- const g = `${e.name}`, w = i.get(g), x = e.type === "open" || e.type === "aidynamicfollowup" || e.type === "aidynamicstandalone", b = s.get(g);
1373
- if (e.type === "aidynamicfollowup" && (e.props.loading === Ne.failure || e.props.loading === void 0) || e.type === "aidynamicstandalone" && e.props.loading === Ne.failure) return n(je, {});
1368
+ return n(je, { children: [n(ge, { avatars: o, isLeft: !0, message: { id: `thanks-${e.name}`, type: "question", content: (i == null ? void 0 : i.headline) ?? "Great! Thank you for your participation." }, ref: t ? r : null }), (i == null ? void 0 : i.subheader) && n(ge, { avatars: o, hideAvatar: !0, isLeft: !0, message: { id: `caption-${e.name}`, type: "question", content: i.subheader } }), n(Gn, {})] });
1369
+ }, Ct = ({ card: e, cardIndex: o, index: t, avatars: r, cardResponses: i, questionThinkingStates: s, startingQuestionIdx: d, currentQuestionBubbleRef: u, handleCardResponse: a }) => {
1370
+ const v = o === t, y = o < t, c = xn(e);
1371
+ if (c) return n(yt, { avatars: r, card: e, currentQuestionBubbleRef: u, isCurrentQuestion: v });
1372
+ const g = `${e.name}`, w = i.get(g), C = e.type === "open" || e.type === "aidynamicfollowup" || e.type === "aidynamicstandalone", b = s.get(g);
1373
+ if (e.type === "aidynamicfollowup" && (e.props.loading === Re.failure || e.props.loading === void 0) || e.type === "aidynamicstandalone" && e.props.loading === Re.failure) return n(je, {});
1374
1374
  const f = (o > (d ?? 0) || fe(e)) && e.type !== "thanks" && e.type !== "uploading" && (b === !0 || b === void 0);
1375
- return n(on.Fragment, { children: [n(ht, { avatars: r, card: e, currentQuestionBubbleRef: p, isCurrentQuestion: v, isThinking: f }), !f && n(gt, { avatars: r, card: e }), y && x ? n(bt, { avatars: r, card: e, userResponse: w }) : (!y || !x) && !f && n(ge, { avatars: r, isLeft: !1, message: { id: `card-${e.name}`, type: "card", content: "" }, children: n("div", { className: "chat-card-container", children: n(xt, { card: e, className: c ? "chat-thanks-card" : "chat-card", isAnswered: y, next: v ? a : () => {
1375
+ return n(rn.Fragment, { children: [n(gt, { avatars: r, card: e, currentQuestionBubbleRef: u, isCurrentQuestion: v, isThinking: f }), !f && n(bt, { avatars: r, card: e }), y && C ? n(ft, { avatars: r, card: e, userResponse: w }) : (!y || !C) && !f && n(ge, { avatars: r, isLeft: !1, message: { id: `card-${e.name}`, type: "card", content: "" }, children: n("div", { className: "chat-card-container", children: n(kt, { card: e, className: c ? "chat-thanks-card" : "chat-card", isAnswered: y, next: v ? a : () => {
1376
1376
  } }) }) })] }, `question-card-${e.name}`);
1377
- }, ge = on.forwardRef(({ message: e, isLeft: o = !1, children: t, avatars: r, hideAvatar: i = !1 }, s) => {
1377
+ }, ge = rn.forwardRef(({ message: e, isLeft: o = !1, children: t, avatars: r, hideAvatar: i = !1 }, s) => {
1378
1378
  const d = o ? "chat-bubble-left" : "chat-bubble-right";
1379
1379
  return n("div", { className: `chat-bubble-container ${o ? "chat-left" : "chat-right"}${o && i ? " chat-no-avatar" : ""}`, ref: s, children: [o && !i && n("img", { alt: "AI Avatar", className: "chat-avatar chat-avatar-left", srcSet: `${r.agentAvatar["1x"]} 1x, ${r.agentAvatar["2x"]} 2x` }), n("div", { className: `chat-bubble ${d}`, children: t || n("div", { className: "chat-message-text", children: e.content }) }), !o && !i && n("img", { alt: "User Avatar", className: "chat-avatar chat-avatar-right", srcSet: `${r.respondentAvatar["1x"]} 1x, ${r.respondentAvatar["2x"]} 2x` })] });
1380
1380
  });
1381
1381
  ge.displayName = "ChatBubble";
1382
- const Ct = () => {
1382
+ const xt = () => {
1383
1383
  const e = G((t) => t.close), o = ye(() => () => e($e), [e]);
1384
1384
  return n("div", { "aria-label": "Close button", className: "conversational-close-btn", onClick: o, onKeyPress: (t) => {
1385
1385
  t.key === "Enter" && o();
1386
1386
  }, role: "button", tabIndex: 0, children: n("svg", { fill: "none", height: "16px", viewBox: "0 0 13 13", width: "16px", xmlns: "http://www.w3.org/2000/svg", children: n("path", { d: "M2.54964 1.78369L1.78369 2.54964L5.73405 6.5L1.78369 10.4504L2.54964 11.2163L6.5 7.26595L10.4504 11.2163L11.2163 10.4504L7.26595 6.5L11.2163 2.54964L10.4504 1.78369L6.5 5.73405L2.54964 1.78369Z", fill: "#262136" }) }) });
1387
- }, xt = ({ card: e, next: o, className: t = "", isAnswered: r = !1 }) => {
1387
+ }, kt = ({ card: e, next: o, className: t = "", isAnswered: r = !1 }) => {
1388
1388
  const i = { className: r ? `${t} answered-card` : t, next: r ? () => {
1389
1389
  } : o, questionId: e.name, type: e.type, isAnswered: r };
1390
1390
  switch (e.type) {
1391
1391
  case "consentlegal":
1392
- return n(Fn, { ...i, ...e.props });
1392
+ return n(zn, { ...i, ...e.props });
1393
1393
  case "likert":
1394
- return n(Qn, { ...i, ...e.props });
1394
+ return n(Zn, { ...i, ...e.props });
1395
1395
  case "matrix":
1396
- return n(Yn, { ...i, ...e.props });
1397
- case "multiplechoice":
1398
1396
  return n(Wn, { ...i, ...e.props });
1399
- case "multipleselect":
1397
+ case "multiplechoice":
1400
1398
  return n(Kn, { ...i, ...e.props });
1401
- case "nps":
1399
+ case "multipleselect":
1402
1400
  return n(Jn, { ...i, ...e.props });
1401
+ case "nps":
1402
+ return n(Xn, { ...i, ...e.props });
1403
1403
  case "aidynamicstandalone":
1404
1404
  case "aidynamicfollowup":
1405
1405
  case "open":
1406
- return n(Xn, { ...i, type: e.type, ...e.props });
1406
+ return n(et, { ...i, type: e.type, ...e.props });
1407
1407
  case "rankorder":
1408
- return n(et, { ...i, ...e.props });
1408
+ return n(nt, { ...i, ...e.props });
1409
1409
  case "recordedtask":
1410
- return n(dt, { ...i, ...e.props });
1411
- case "texturlprompt":
1412
1410
  return n(ct, { ...i, ...e.props });
1413
- case "thanks":
1411
+ case "texturlprompt":
1414
1412
  return n(ut, { ...i, ...e.props });
1413
+ case "thanks":
1414
+ return n(pt, { ...i, ...e.props });
1415
1415
  case "uploading":
1416
- return n(mt, { ...i, ...e.props });
1417
- case "videovoice":
1418
1416
  return n(vt, { ...i, ...e.props });
1417
+ case "videovoice":
1418
+ return n(ht, { ...i, ...e.props });
1419
1419
  default:
1420
1420
  return null;
1421
1421
  }
1422
- }, jt = ({ cards: e, next: o, previousResponses: t }) => {
1422
+ }, It = ({ cards: e, next: o, previousResponses: t }) => {
1423
1423
  const { cardResponses: r, setCardResponse: i } = (() => {
1424
1424
  const [m, h] = Z(/* @__PURE__ */ new Map());
1425
1425
  return { cardResponses: m, setCardResponse: be((k, l) => {
1426
- h((u) => new Map(u).set(k, l));
1426
+ h((p) => new Map(p).set(k, l));
1427
1427
  }, []) };
1428
- })(), { index: s, isLongFormSurvey: d, avatars: p, showSurveyBrand: a, forceBrandedLogo: v, marketingUrlLink: y, startingQuestionIdx: c, viewDocument: g, createDynamicFollowupQuestion: w, update: x } = G((m) => ({ index: m.index, isLongFormSurvey: sn(m.studyType), avatars: m.avatars, forceBrandedLogo: m.forceBrandedLogo, startingQuestionIdx: m.startingQuestionIdx, showSurveyBrand: m.showSurveyBrand, marketingUrlLink: In({ marketingUrl: m.marketingUrl, slugName: m.slugName, surveyId: m.surveyId, forceBrandedLogo: m.forceBrandedLogo }), viewDocument: m.viewDocument, createDynamicFollowupQuestion: m.createDynamicFollowupQuestion, update: m.update })), { currentQuestionBubbleRef: b, scrollToCurrentQuestion: f } = (({ viewDocument: m }) => {
1428
+ })(), { index: s, isLongFormSurvey: d, avatars: u, showSurveyBrand: a, forceBrandedLogo: v, marketingUrlLink: y, startingQuestionIdx: c, viewDocument: g, createDynamicFollowupQuestion: w, update: C } = G((m) => ({ index: m.index, isLongFormSurvey: on(m.studyType), avatars: m.avatars, forceBrandedLogo: m.forceBrandedLogo, startingQuestionIdx: m.startingQuestionIdx, showSurveyBrand: m.showSurveyBrand, marketingUrlLink: jn({ marketingUrl: m.marketingUrl, slugName: m.slugName, surveyId: m.surveyId, forceBrandedLogo: m.forceBrandedLogo }), viewDocument: m.viewDocument, createDynamicFollowupQuestion: m.createDynamicFollowupQuestion, update: m.update })), { currentQuestionBubbleRef: b, scrollToCurrentQuestion: f } = (({ viewDocument: m }) => {
1429
1429
  const h = se(null), k = be(() => {
1430
1430
  const l = m.querySelector(".ul-card-main-content");
1431
1431
  if (h.current && l && l instanceof HTMLElement) {
1432
- const u = h.current.offsetTop - l.offsetTop - 16;
1433
- l.scrollTo({ top: Math.max(0, u), behavior: "smooth" });
1432
+ const p = h.current.offsetTop - l.offsetTop - 16;
1433
+ l.scrollTo({ top: Math.max(0, p), behavior: "smooth" });
1434
1434
  }
1435
1435
  }, []);
1436
1436
  return { currentQuestionBubbleRef: h, scrollToCurrentQuestion: k };
1437
1437
  })({ viewDocument: g }), _ = ((m, h, k) => {
1438
- const [l, u] = Z(/* @__PURE__ */ new Map());
1438
+ const [l, p] = Z(/* @__PURE__ */ new Map());
1439
1439
  return ae(() => {
1440
1440
  if (m.length > 0 && h < m.length) {
1441
- const C = m[h], D = `${C.name}`, j = (O) => {
1441
+ const x = m[h], S = `${x.name}`, j = (O) => {
1442
1442
  if (h > 0) {
1443
1443
  const B = m[h - 1];
1444
1444
  if (fe(B)) {
1445
- const q = `${B.name}`, Q = Le(B);
1445
+ const q = `${B.name}`, Q = Ne(B);
1446
1446
  if (O.get(q) !== Q) return new Map(O).set(q, Q);
1447
1447
  }
1448
1448
  }
1449
1449
  return O;
1450
1450
  };
1451
- if ((h <= (k ?? 0) || kn(C)) && (C == null ? void 0 : C.type) !== "aidynamicstandalone") return u((O) => j(new Map(O).set(D, !1)));
1452
- u((O) => {
1453
- const B = !fe(C) || Le(C);
1454
- return j(new Map(O).set(D, B));
1451
+ if ((h <= (k ?? 0) || xn(x)) && (x == null ? void 0 : x.type) !== "aidynamicstandalone") return p((O) => j(new Map(O).set(S, !1)));
1452
+ p((O) => {
1453
+ const B = !fe(x) || Ne(x);
1454
+ return j(new Map(O).set(S, B));
1455
1455
  });
1456
1456
  const M = setTimeout(() => {
1457
- u((O) => {
1458
- const B = !!fe(C) && Le(C);
1459
- return j(new Map(O).set(D, B));
1457
+ p((O) => {
1458
+ const B = !!fe(x) && Ne(x);
1459
+ return j(new Map(O).set(S, B));
1460
1460
  });
1461
1461
  }, 1e3);
1462
1462
  return () => clearTimeout(M);
@@ -1464,49 +1464,45 @@ const Ct = () => {
1464
1464
  }, [h, m, k]), l;
1465
1465
  })(e, s, c);
1466
1466
  ((m, h) => {
1467
- const { createDynamicStandaloneQuestion: k } = G((C) => ({ createDynamicStandaloneQuestion: C.createDynamicStandaloneQuestion })), l = m[h], u = (l == null ? void 0 : l.type) === "aidynamicstandalone" && l.props.loading === void 0 ? l.name : null;
1467
+ const { createDynamicStandaloneQuestion: k } = G((x) => ({ createDynamicStandaloneQuestion: x.createDynamicStandaloneQuestion })), l = m[h], p = (l == null ? void 0 : l.type) === "aidynamicstandalone" && l.props.loading === void 0 ? l.name : null;
1468
1468
  ae(() => {
1469
- u !== null && k({ questionId: u });
1470
- }, [u, k]);
1469
+ p !== null && k({ questionId: p });
1470
+ }, [p, k]);
1471
1471
  })(e, s);
1472
- const N = ((m, h) => {
1472
+ const R = ((m, h) => {
1473
1473
  const [k, l] = Z(() => /* @__PURE__ */ new Set([m]));
1474
1474
  return ae(() => {
1475
- l((u) => new Set(u).add(m));
1475
+ l((p) => new Set(p).add(m));
1476
1476
  }, [m]), ae(() => {
1477
- const u = h ?? 0;
1478
- u > 0 && l((C) => {
1479
- const D = new Set(C);
1480
- for (let j = 0; j <= u; j++) D.add(j);
1481
- return D;
1477
+ const p = h ?? 0;
1478
+ p > 0 && l((x) => {
1479
+ const S = new Set(x);
1480
+ for (let j = 0; j <= p; j++) S.add(j);
1481
+ return S;
1482
1482
  });
1483
1483
  }, [h]), k;
1484
- })(s, c), L = ye(() => ({ ...t, ...Ze(e.map((m, h) => {
1484
+ })(s, c), N = ye(() => ({ ...t, ...In(e.map((m, h) => {
1485
1485
  var k, l;
1486
1486
  return { ...m, value: h < s ? ((k = r.get(`${m.name}`)) == null ? void 0 : k.value) ?? null : null, secondaryValue: h < s ? ((l = r.get(`${m.name}`)) == null ? void 0 : l.secondaryValue) ?? null : null };
1487
1487
  })) }), [t, r, e, s]);
1488
- Bn(L);
1489
- const T = Tn(e, L);
1488
+ qn(N);
1489
+ const T = Tn(e, N);
1490
1490
  ae(() => {
1491
1491
  requestAnimationFrame(() => {
1492
1492
  f();
1493
- }), x();
1494
- }, [s, f, _, x]);
1493
+ }), C();
1494
+ }, [s, f, _, C]);
1495
1495
  const H = be((m, h) => {
1496
1496
  if (!h) return;
1497
1497
  const k = T[s];
1498
1498
  if (!k) return;
1499
1499
  const l = `${k.name}`;
1500
1500
  i(l, m);
1501
- const u = { ...m, questionText: Dn(k) };
1502
- if (k.childId && (u == null ? void 0 : u.value) != null) {
1503
- const C = Ze([k].map((D) => ({ ...D, value: (u == null ? void 0 : u.value) ?? null, secondaryValue: (u == null ? void 0 : u.secondaryValue) ?? null })));
1504
- w({ parentQuestionId: k.name, parentResponseConfig: C });
1505
- }
1506
- o([u]);
1507
- }, [T, s, o, i]), $ = T.map((m, h) => ({ card: m, cardIndex: h })).filter(({ cardIndex: m }) => N.has(m));
1508
- return n("div", { className: "conversational-ui ul-conversational-ui", "data-testid": "ui-container", children: [!d && n(Ct, {}), n("div", { className: "chat-container", children: n("div", { className: "chat-messages", children: $.map(({ card: m, cardIndex: h }) => n(yt, { avatars: p, card: m, cardIndex: h, cardResponses: r, currentQuestionBubbleRef: b, handleCardResponse: H, index: s, questionThinkingStates: _, startingQuestionIdx: c }, `question-card-${m.name}`)) }) }), d && n("div", { className: "long-form-question-footer-container-logo", children: a && n(_n, { forceBrandedLogo: v, marketingUrlLink: y }) })] });
1501
+ const p = { ...m, questionText: Dn(k) };
1502
+ k.childId && (p == null ? void 0 : p.value) != null && Sn({ displayCard: k, response: p, createDynamicFollowupQuestion: w }), o([p]);
1503
+ }, [T, s, o, i]), $ = T.map((m, h) => ({ card: m, cardIndex: h })).filter(({ cardIndex: m }) => R.has(m));
1504
+ return n("div", { className: "conversational-ui ul-conversational-ui", "data-testid": "ui-container", children: [!d && n(xt, {}), n("div", { className: "chat-container", children: n("div", { className: "chat-messages", children: $.map(({ card: m, cardIndex: h }) => n(Ct, { avatars: u, card: m, cardIndex: h, cardResponses: r, currentQuestionBubbleRef: b, handleCardResponse: H, index: s, questionThinkingStates: _, startingQuestionIdx: c }, `question-card-${m.name}`)) }) }), d && n("div", { className: "long-form-question-footer-container-logo", children: a && n(_n, { forceBrandedLogo: v, marketingUrlLink: y }) })] });
1509
1505
  };
1510
1506
  export {
1511
- jt as default
1507
+ It as default
1512
1508
  };