@sprig-technologies/sprig-bundled 2.41.0 → 2.41.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/conversational-styles-41oiRRxR.cjs +1 -0
- package/dist/conversational-styles-Cw5d-ccF.js +4 -0
- package/dist/{conversational-ui-BMaVlQM7.js → conversational-ui-B9H7uNQs.js} +277 -266
- package/dist/conversational-ui-IgSB2b9B.cjs +658 -0
- package/dist/{getAttributedUrl-CuAx8r1V.cjs → getAttributedUrl-DPVLIzlh.cjs} +1 -1
- package/dist/{getAttributedUrl-BI712lA1.js → getAttributedUrl-DxNZ8ZsR.js} +2 -2
- package/dist/{index-YBebm7NT.js → index-BiIngDfi.js} +373 -373
- package/dist/index-CL3rX0v3.js +706 -0
- package/dist/{index-DZZhe9UA.cjs → index-DEIb7Tgo.cjs} +15 -15
- package/dist/index-QboanN7x.cjs +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/view-DunMtls8.cjs +1 -0
- package/dist/{view-BHOd3THT.js → view-E1bmiI1s.js} +302 -300
- package/package.json +1 -1
- package/dist/conversational-styles-BiL7hMhj.js +0 -4
- package/dist/conversational-styles-DlhTFTL6.cjs +0 -1
- package/dist/conversational-ui-Dfwwfe2B.cjs +0 -658
- package/dist/index-CEpl_fRY.cjs +0 -1
- package/dist/index-cT-GmgDY.js +0 -712
- package/dist/view-Btk1gSAI.cjs +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { u as G, a as e, h as
|
|
2
|
-
import { v as Tn, E as
|
|
3
|
-
import { B as oe, M as ie, Q as le, O as Oe, a as de, b as Ce, S as Dn, L as Sn, u as Pn, H as ye, c as Ae, g as Ln, P as Rn } from "./getAttributedUrl-
|
|
4
|
-
const pe = "https://cdn.sprig.com",
|
|
1
|
+
import { u as G, a as e, h as Q, c as O, g as K, b as re, d as Be, p as ue, F as fe, _ as se, T as be, A as Cn, e as Ee, f as xn, i as kn, j as ze, k as wn, l as En, S as jn, w as nn, m as In } from "./view-E1bmiI1s.js";
|
|
2
|
+
import { v as Tn, E as Te, h as qe, A as Ue, j as _n, i as tn } from "./index-BiIngDfi.js";
|
|
3
|
+
import { B as oe, M as ie, Q as le, O as Oe, a as de, b as Ce, S as Dn, L as Sn, u as Pn, H as ye, c as Ae, g as Ln, P as Rn } from "./getAttributedUrl-DxNZ8ZsR.js";
|
|
4
|
+
const pe = "https://cdn.sprig.com", I = { document: void 0, videojs: void 0 }, $e = (n) => n + "-loading-spiner", W = "hidden", Ge = ".m3u8", _e = "questionId", De = "ul-video-recorder-camera-off-button", Se = "ul-recording-in-session", Nn = [{ 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` }], rn = [{ 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
|
}
|
|
@@ -661,25 +661,25 @@ span.ul-button-text {
|
|
|
661
661
|
` }], on = "-video-player", Ze = "-secondary-video-player", Qe = "-video-recorder";
|
|
662
662
|
let ne, Ye;
|
|
663
663
|
const ce = async ({ event: n, apiBase: o, headers: t, visitorId: r, envId: i, metadata: s }) => {
|
|
664
|
-
const d =
|
|
664
|
+
const d = I.document.documentElement;
|
|
665
665
|
if (!r || !i) return;
|
|
666
666
|
const u = { event: `SDK - ${n}`, 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
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", n);
|
|
668
668
|
}, ae = async (n, o, t, r, i, s) => {
|
|
669
669
|
ce({ event: `Video Error ${o}`, apiBase: t, headers: r, visitorId: i, envId: s, metadata: { errorMessage: n.message } });
|
|
670
|
-
const d =
|
|
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: n.message, stack: n.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", n);
|
|
672
672
|
}, sn = (n, o) => {
|
|
673
673
|
if (n.length === 0) return o && o();
|
|
674
674
|
Promise.all(n.reduce((t, r) => (t.push(((i, { type: s, content: d }) => new Promise(function(u, a) {
|
|
675
675
|
let v;
|
|
676
|
-
s === "script" ? (v =
|
|
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
677
|
u(d);
|
|
678
678
|
}, v.onerror = function() {
|
|
679
679
|
a(d);
|
|
680
680
|
}, v.async = !1, v.id = btoa(d), i.appendChild(v);
|
|
681
|
-
}))(
|
|
682
|
-
|
|
681
|
+
}))(I.document.head, r)), t), [])).then(() => {
|
|
682
|
+
I.videojs = I.document.defaultView.videojs, o && o();
|
|
683
683
|
}).catch(function(t) {
|
|
684
684
|
console.log(t + " failed to load");
|
|
685
685
|
});
|
|
@@ -690,30 +690,30 @@ const ce = async ({ event: n, apiBase: o, headers: t, visitorId: r, envId: i, me
|
|
|
690
690
|
const r = Math.round(parseFloat(t));
|
|
691
691
|
n.innerHTML = `Uploading <span class="ul-upload-progress-label__time">${r}%</span>`, n.style.background = `linear-gradient(to right, #E0E0EB 0%, #E0E0EB ${r}%, #FCFCFD ${r}%, #FCFCFD 100%)`;
|
|
692
692
|
}
|
|
693
|
-
},
|
|
694
|
-
const t =
|
|
693
|
+
}, Pe = (n, o) => {
|
|
694
|
+
const t = I.videojs(n.id());
|
|
695
695
|
return t == null ? void 0 : t.payload[o];
|
|
696
696
|
}, an = (n, o) => {
|
|
697
|
-
const t = new (
|
|
697
|
+
const t = new (I.videojs.getComponent("Component"))(n);
|
|
698
698
|
return t.addClass("ul-buttons-panel"), o.map((r) => {
|
|
699
699
|
t.addChild(r);
|
|
700
700
|
}), Mn(t), t;
|
|
701
701
|
}, Mn = (n) => {
|
|
702
702
|
n.children().forEach((o) => {
|
|
703
|
-
if (
|
|
704
|
-
const t = xe(
|
|
703
|
+
if (ee[o.name_]) {
|
|
704
|
+
const t = xe(ee[o.name_], `ul-${ee[o.name_]}`);
|
|
705
705
|
o.el_.appendChild(t);
|
|
706
706
|
}
|
|
707
707
|
});
|
|
708
708
|
}, xe = (n, o = "") => {
|
|
709
|
-
const t =
|
|
709
|
+
const t = I.document.createElement("span");
|
|
710
710
|
return t.className = "ul-button-text", t.innerHTML = n, t.id = o, t;
|
|
711
711
|
}, ln = (n, o, t, r, i = !1, s) => {
|
|
712
712
|
n.addClass("ul-video-player");
|
|
713
|
-
const d = new (
|
|
714
|
-
d.addClass("ul-control-panel"), n.progressBar = d.addChild("ProgressControl"), t && n.src(t), n.audioPlayerPlaceholder = new (
|
|
713
|
+
const d = new (I.videojs.getComponent("Component"))(n);
|
|
714
|
+
d.addClass("ul-control-panel"), n.progressBar = d.addChild("ProgressControl"), t && n.src(t), n.audioPlayerPlaceholder = new (I.videojs.getComponent("Component"))(n), n.audioPlayerPlaceholder.addClass("ul-audio-recorder-placeholder");
|
|
715
715
|
const u = t && t.src ? On(t.src) : null;
|
|
716
|
-
!t || !i && u ? (n.audioPlayerPlaceholder.hide(),
|
|
716
|
+
!t || !i && u ? (n.audioPlayerPlaceholder.hide(), I.document.getElementById(`${n.id()}_html5_api`).style.height = "100%", u && n.poster(u)) : (n.children()[0].classList.add("vjs-hidden"), I.document.getElementById(`${n.id()}_html5_api`).style.height = "0px"), n.on("play", () => {
|
|
717
717
|
i || !t || u || qn(n), s == null || s.play();
|
|
718
718
|
}), n.on("pause", () => {
|
|
719
719
|
s == null || s.pause();
|
|
@@ -730,87 +730,87 @@ const ce = async ({ event: n, apiBase: o, headers: t, visitorId: r, envId: i, me
|
|
|
730
730
|
const { surveyId: v, questionId: y, responseGroupUid: c, visitorId: h, envId: k } = t;
|
|
731
731
|
let C;
|
|
732
732
|
const g = (l) => {
|
|
733
|
-
const p =
|
|
733
|
+
const p = De, x = De + "-audio-only";
|
|
734
734
|
We(a.uploadProgressLabel, "none"), ne && ne.startTime >= Ye && ne.abort();
|
|
735
|
-
const
|
|
736
|
-
l ? (a.children()[0].classList.add("vjs-hidden"),
|
|
737
|
-
|
|
738
|
-
}), window.navigator.mediaDevices.getUserMedia({ video: !0, audio: !0 }).then((
|
|
739
|
-
C =
|
|
740
|
-
|
|
741
|
-
}), a.record().onDeviceReady(
|
|
742
|
-
}).catch(a.record().onDeviceError.bind(a.record()))) : (C == null || C.getVideoTracks().forEach((
|
|
743
|
-
|
|
744
|
-
}), a.children()[0].classList.remove("vjs-hidden"), a.record().getDevice(),
|
|
745
|
-
}, f = new (
|
|
746
|
-
f.hasClass(W) || (ce({ event: "Video Delete Button Clicked", apiBase: r, headers: d, visitorId: h, envId: k, metadata: { questionId: y, responseGroupUid: c, surveyId: v } }), g(a.cameraOff), i(
|
|
735
|
+
const D = I.document.getElementById("ul-camera-button");
|
|
736
|
+
l ? (a.children()[0].classList.add("vjs-hidden"), M.removeClass(p), M.addClass(x), D.innerHTML = ee.TurnOnCamera, a.audioPlayerPlaceholder.removeClass("vjs-hidden"), C == null || C.getTracks().forEach((j) => {
|
|
737
|
+
j.stop();
|
|
738
|
+
}), window.navigator.mediaDevices.getUserMedia({ video: !0, audio: !0 }).then((j) => {
|
|
739
|
+
C = j, j.getVideoTracks().forEach((B) => {
|
|
740
|
+
B.enabled = !1;
|
|
741
|
+
}), a.record().onDeviceReady(j);
|
|
742
|
+
}).catch(a.record().onDeviceError.bind(a.record()))) : (C == null || C.getVideoTracks().forEach((j) => {
|
|
743
|
+
j.enabled = !0;
|
|
744
|
+
}), a.children()[0].classList.remove("vjs-hidden"), a.record().getDevice(), M.removeClass(x), M.addClass(p), D.innerHTML = ee.TurnOffCamera, a.audioPlayerPlaceholder.addClass("vjs-hidden"));
|
|
745
|
+
}, f = new (I.videojs.getComponent("Button"))(a, { clickHandler: () => {
|
|
746
|
+
f.hasClass(W) || (ce({ event: "Video Delete Button Clicked", apiBase: r, headers: d, visitorId: h, envId: k, metadata: { questionId: y, responseGroupUid: c, surveyId: v } }), g(a.cameraOff), i(N.DELETE, {}), M.removeClass(W), f.addClass(W));
|
|
747
747
|
} });
|
|
748
|
-
f.addClass("ul-video-recorder-delete-button"), f.el_.appendChild(xe(
|
|
749
|
-
const _ =
|
|
748
|
+
f.addClass("ul-video-recorder-delete-button"), f.el_.appendChild(xe(ee.DeleteButton, "ul-delete-button"));
|
|
749
|
+
const _ = I.document.getElementById(o), q = () => {
|
|
750
750
|
_.classList.contains("vjs-fullscreen") && a.cameraOff ? _.style.display = "table" : _.style.display = "flex";
|
|
751
751
|
};
|
|
752
|
-
|
|
753
|
-
const
|
|
754
|
-
a.record().isRecording() || (a.cameraOff = !a.cameraOff, ce({ 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 } }), g(a.cameraOff), !f.hasClass(W) && f.addClass(W), i(
|
|
752
|
+
q();
|
|
753
|
+
const M = new (I.videojs.getComponent("Button"))(a, { clickHandler: () => {
|
|
754
|
+
a.record().isRecording() || (a.cameraOff = !a.cameraOff, ce({ 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 } }), g(a.cameraOff), !f.hasClass(W) && f.addClass(W), i(N.DELETE, {}), q());
|
|
755
755
|
} });
|
|
756
|
-
|
|
757
|
-
const T = new (
|
|
758
|
-
const l =
|
|
759
|
-
if (a.record().isRecording()) a.record().stop(), l && (l.innerHTML =
|
|
756
|
+
M.addClass(De), M.el_.appendChild(xe(ee.TurnOffCamera, "ul-camera-button"));
|
|
757
|
+
const T = new (I.videojs.getComponent("Button"))(a, { clickHandler: () => {
|
|
758
|
+
const l = I.document.getElementById("ul-recorder-toggle");
|
|
759
|
+
if (a.record().isRecording()) a.record().stop(), l && (l.innerHTML = ee.RecordButton), T.removeClass(Se), f.removeClass(W);
|
|
760
760
|
else {
|
|
761
|
-
const p =
|
|
762
|
-
if (p) p.remove(), l && (l.innerHTML =
|
|
761
|
+
const p = I.document.getElementById("ul-recording-countdown-screen");
|
|
762
|
+
if (p) p.remove(), l && (l.innerHTML = ee.RecordButton), g(a.cameraOff), i(N.DELETE, {}), M.removeClass(W), f.addClass(W), T.removeClass(Se), m.show();
|
|
763
763
|
else {
|
|
764
|
-
T.addClass(
|
|
765
|
-
const x =
|
|
764
|
+
T.addClass(Se), m.hide(), M.addClass(W), f.addClass(W), l && (l.innerHTML = ee.StopButton);
|
|
765
|
+
const x = I.document.createElement("div");
|
|
766
766
|
x.id = "ul-recording-countdown-screen", _.insertBefore(x, _.children[1]), x.style.height = `${_.offsetHeight}px`, dn(a, 3);
|
|
767
767
|
}
|
|
768
768
|
}
|
|
769
769
|
} });
|
|
770
|
-
T.addClass("ul-video-recorder-toggle-button"), T.el_.appendChild(xe(
|
|
771
|
-
const $ =
|
|
770
|
+
T.addClass("ul-video-recorder-toggle-button"), T.el_.appendChild(xe(ee.RecordButton, "ul-recorder-toggle"));
|
|
771
|
+
const $ = I.document.createElement("p");
|
|
772
772
|
$.style.visibility = "hidden", $.className = "ul-upload-progress-label", n.appendChild($), a.uploadProgressLabel = $;
|
|
773
|
-
const A = an(a, [f,
|
|
773
|
+
const A = an(a, [f, M, "PlayToggle", T, "FullscreenToggle"]), m = A.children().find((l) => l.name_ === "FullscreenToggle");
|
|
774
774
|
m.hasClass("vjs-disabled") && m.hide();
|
|
775
775
|
const b = A.children().find((l) => l.name_ === "PlayToggle");
|
|
776
776
|
b.hide(), f.addClass(W), ln(a, A, s, !1, u), a.on("stopRecord", () => {
|
|
777
777
|
T.hide(), b.show(), m.show(), f.removeClass(W);
|
|
778
778
|
}), a.on("deviceReady", () => {
|
|
779
779
|
T.show(), b.hide(), f.addClass(W);
|
|
780
|
-
}), ((l, p, x,
|
|
781
|
-
const { surveyId:
|
|
780
|
+
}), ((l, p, x, D, j) => {
|
|
781
|
+
const { surveyId: B, responseGroupUid: Y, visitorId: L, envId: R } = 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"), x && x(
|
|
784
|
-
}), l.on("error", function(
|
|
785
|
-
ae(
|
|
786
|
-
}), l.on("startRecord", function(
|
|
787
|
-
|
|
783
|
+
console.warn("device error: ", l.deviceErrorCode), l.deviceErrorCode.message === "Permission denied" ? (l.deviceButton.addClass("permission-denied"), x && x(N.ERROR, { type: N.PERMISSION_DENIED }), ce({ event: "Video Permission Denied", apiBase: p, headers: j, visitorId: L, envId: R, metadata: { questionId: Pe(l, _e), responseGroupUid: Y, surveyId: B } })) : (x && x(N.ERROR, { type: N.OTHER }), ae(new Error(l.deviceErrorCode.message), "recorderDeviceError", p, j, L, R));
|
|
784
|
+
}), l.on("error", function(F, Z) {
|
|
785
|
+
ae(Z || l.error(), "recorderError", p, j, L, R);
|
|
786
|
+
}), l.on("startRecord", function(F, Z) {
|
|
787
|
+
D(l.uploadProgressLabel, "none"), ce({ event: "Video Record Start", apiBase: p, headers: j, visitorId: L, envId: R, metadata: { questionId: Pe(l, _e), responseGroupUid: Y, surveyId: B } });
|
|
788
788
|
}), l.on("finishRecord", async function() {
|
|
789
|
-
|
|
790
|
-
const
|
|
791
|
-
if (!
|
|
792
|
-
const
|
|
793
|
-
return x && x(
|
|
789
|
+
D(l.uploadProgressLabel, "start", 0);
|
|
790
|
+
const F = Pe(l, _e);
|
|
791
|
+
if (!B) {
|
|
792
|
+
const S = "internal error: missing fields in payload";
|
|
793
|
+
return x && x(N.ERROR, { type: N.OTHER }), ae(new Error(S), "finishRecord", p, j, L, R), null;
|
|
794
794
|
}
|
|
795
795
|
l.record().stopDevice();
|
|
796
|
-
const
|
|
797
|
-
ce({ event: "Video Record Finish", apiBase: p, headers:
|
|
798
|
-
const me = { surveyId:
|
|
799
|
-
|
|
796
|
+
const Z = l.cameraOff ? N.MEDIA_TYPE_AUDIO : N.MEDIA_TYPE_VIDEO, J = Tn();
|
|
797
|
+
ce({ event: "Video Record Finish", apiBase: p, headers: j, visitorId: L, envId: R, metadata: { mediaRecordingUid: J, questionId: F, responseGroupUid: Y, surveyId: B, mediaType: Z } });
|
|
798
|
+
const me = { surveyId: B, updatedAt: (/* @__PURE__ */ new Date()).toISOString(), mediaType: Z, mediaRecordingUid: J };
|
|
799
|
+
F && (me.questionId = F), Y && (me.responseGroupUid = Y), L && (me.visitorId = L);
|
|
800
800
|
const E = await (async () => {
|
|
801
|
-
const
|
|
802
|
-
if (
|
|
803
|
-
const
|
|
804
|
-
return x && x(
|
|
801
|
+
const S = await fetch(`${p}/2/environments/integrations/upload`, { method: "POST", cache: "no-cache", headers: { "Content-Type": "application/json" }, body: JSON.stringify(me) });
|
|
802
|
+
if (S.ok) {
|
|
803
|
+
const U = await S.json();
|
|
804
|
+
return x && x(N.UPLOAD_STARTED, { [N.UPLOAD_ID]: U.upload.id, [N.MEDIA_TYPE]: Z, [N.MEDIA_RECORDING_UID]: J }), U.upload.url;
|
|
805
805
|
}
|
|
806
|
-
return x && x(
|
|
806
|
+
return x && x(N.ERROR, { type: N.OTHER, response: S }), ae(new Error("failed to get upload response with url"), "finishRecord", p, j, L, R), null;
|
|
807
807
|
})();
|
|
808
|
-
E && (ne =
|
|
809
|
-
|
|
810
|
-
}), ne.on("progress", (
|
|
811
|
-
x && x(
|
|
808
|
+
E && (ne = I.document.defaultView.UpChunk.createUpload({ endpoint: E, file: new I.document.defaultView.File([l.recordedData], `recording ${Z} ${Date.now()}`), chunkSize: 5120 }), ne.startTime = Date.now(), ce({ event: "Video Upload Start", apiBase: p, headers: j, visitorId: L, envId: R, metadata: { mediaRecordingUid: J, questionId: F, responseGroupUid: Y, surveyId: B, mediaType: Z, url: E } }), ne.on("error", (S) => {
|
|
809
|
+
D(l.uploadProgressLabel, "none"), x && x(N.UPLOAD_FINISHED, { [N.MEDIA_RECORDING_UID]: J }), ae(S, "finishRecord", p, j, L, R);
|
|
810
|
+
}), ne.on("progress", (S) => {
|
|
811
|
+
x && x(N.UPLOAD_PROGRESS, { [N.MEDIA_RECORDING_UID]: J, [N.UPLOAD_PROGRESS_PCT]: S.detail }), D(l.uploadProgressLabel, "progress", S.detail);
|
|
812
812
|
}), ne.on("success", () => {
|
|
813
|
-
|
|
813
|
+
D(l.uploadProgressLabel, "success"), x && x(N.UPLOAD_FINISHED, { [N.MEDIA_RECORDING_UID]: J }), ce({ event: "Video Upload Success", apiBase: p, headers: j, visitorId: L, envId: R, metadata: { mediaRecordingUid: J, questionId: F, responseGroupUid: Y, surveyId: B, mediaType: Z, url: E, elapsedMs: ne.startTime && Date.now() - ne.startTime } });
|
|
814
814
|
}));
|
|
815
815
|
});
|
|
816
816
|
})(a, r, i, We, d);
|
|
@@ -823,45 +823,45 @@ const ce = async ({ event: n, apiBase: o, headers: t, visitorId: r, envId: i, me
|
|
|
823
823
|
}).catch((l) => {
|
|
824
824
|
});
|
|
825
825
|
}, dn = (n, o = 3) => {
|
|
826
|
-
const t =
|
|
826
|
+
const t = I.document.getElementById("ul-recording-countdown-screen");
|
|
827
827
|
t && o === 0 ? (t.remove(), n.record().start()) : t && (t.innerHTML = `<span class='ul-countdown-text'>Recording in... ${o}</span>`, setTimeout(() => {
|
|
828
828
|
dn(n, o - 1);
|
|
829
829
|
}, 1e3));
|
|
830
830
|
}, cn = (n) => {
|
|
831
|
-
const o =
|
|
831
|
+
const o = I.document.createElement("div");
|
|
832
832
|
return o.className = "ul-video-container", o.appendChild(((t) => {
|
|
833
|
-
const r =
|
|
834
|
-
return r.className = "ul-video-player-loading", r.id =
|
|
835
|
-
const s =
|
|
833
|
+
const r = I.document.createElement("div");
|
|
834
|
+
return r.className = "ul-video-player-loading", r.id = $e(t), ["first", "second", "third", "fourth"].map((i) => {
|
|
835
|
+
const s = I.document.createElement("div");
|
|
836
836
|
s.className = i, r.appendChild(s);
|
|
837
837
|
}), r;
|
|
838
838
|
})(n)), o;
|
|
839
|
-
},
|
|
840
|
-
const t =
|
|
839
|
+
}, Le = (n, o) => {
|
|
840
|
+
const t = I.document.createElement("video");
|
|
841
841
|
t.id = n, t.className = "video-js vjs-default-skin ul-video-player-video";
|
|
842
|
-
const r =
|
|
842
|
+
const r = I.document.createElement("p");
|
|
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
|
-
const i =
|
|
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
846
|
}, qn = (n, o) => {
|
|
847
|
-
n.children()[0].classList.remove("vjs-hidden"), n.audioPlayerPlaceholder.hide(),
|
|
848
|
-
}, ke = (n, o) =>
|
|
849
|
-
|
|
847
|
+
n.children()[0].classList.remove("vjs-hidden"), n.audioPlayerPlaceholder.hide(), I.document.getElementById(`${n.id()}_html5_api`).style.height = "100%";
|
|
848
|
+
}, ke = (n, o) => I.document.getElementById(n) ? o ? I.videojs(n, o) : I.videojs(n) : (console.error(`Error in finding player element with ID, ${n}`), null), Un = (n, o, t, r = !1, i = "https://api.sprig.com", s = document, d = null, u = null) => {
|
|
849
|
+
I.document = s;
|
|
850
850
|
const a = n + on, v = cn(a);
|
|
851
|
-
return
|
|
851
|
+
return I.document.addEventListener("securitypolicyviolation", (y) => {
|
|
852
852
|
ae(new Error(`Voice & Video feature violates ${y.violatedDirective} web page CSP policies for the question player.`), "playerDeviceError", i, {});
|
|
853
853
|
}), sn(rn, () => {
|
|
854
|
-
|
|
854
|
+
I.document.getElementById($e(a)).remove(), Le(a, v);
|
|
855
855
|
const y = { playsinline: !0, playbackRates: [0.5, 1, 1.5, 2], fill: !0 };
|
|
856
856
|
try {
|
|
857
857
|
const c = n + Ze;
|
|
858
|
-
|
|
858
|
+
Le(c, v);
|
|
859
859
|
const h = ke(a, y), k = ke(c, { muted: !0, ...y });
|
|
860
860
|
if (!h || !k) return;
|
|
861
|
-
((f, _,
|
|
861
|
+
((f, _, q) => {
|
|
862
862
|
f.addClass(`ul${Ze}`);
|
|
863
|
-
const
|
|
864
|
-
_ && f.src(_), f.addChild(
|
|
863
|
+
const M = new (I.videojs.getComponent("Component"))(f);
|
|
864
|
+
_ && f.src(_), f.addChild(M), q && q(f);
|
|
865
865
|
})(k, d, u), d || k.addClass(W);
|
|
866
866
|
const C = an(h, ["PlaybackRateMenuButton", "PlayToggle", "FullscreenToggle"]), g = C.children().find((f) => f.name_ === "FullscreenToggle");
|
|
867
867
|
g.hasClass("vjs-disabled") && g.hide(), ln(h, C, o, t, r, k);
|
|
@@ -874,34 +874,34 @@ const ce = async ({ event: n, apiBase: o, headers: t, visitorId: r, envId: i, me
|
|
|
874
874
|
const o = n.match(/https:\/\/stream.mux.com\/(.*)/);
|
|
875
875
|
let t = o ? o[1] : null;
|
|
876
876
|
return t.includes(Ge) && (t = t.replace(Ge, "")), t ? `https://image.mux.com/${t}/thumbnail.jpg?time=0` : null;
|
|
877
|
-
},
|
|
877
|
+
}, N = { 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" }, ee = { PlaybackRateMenuButton: "Speed", PlayToggle: "Play", FullscreenToggle: "Expand", TurnOnCamera: "Turn on", TurnOffCamera: "Turn off", DeleteButton: "Delete", RecordButton: "Record", StopButton: "Stop", PauseButton: "Pause" }, An = ({ properties: n, 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 e("div", { id: r, ref: (d) => {
|
|
880
880
|
if (d && d.children.length === 0 && !n.properties.hideRecordedPrompt) {
|
|
881
|
-
const u = Un(r, { src: o, type: "application/x-mpegURL" }, void 0, n.properties.mediaType ===
|
|
881
|
+
const u = Un(r, { src: o, type: "application/x-mpegURL" }, void 0, n.properties.mediaType === N.MEDIA_TYPE_AUDIO, i, s);
|
|
882
882
|
d.appendChild(u);
|
|
883
883
|
}
|
|
884
884
|
} });
|
|
885
|
-
}, ve = ({ isDisabled: n, onClick: o, children: t }) => e(oe, { className: "ul-card__button-checkmark", disabled: n, onClick: o, type: "button", children: [e("svg", { fill: "none", height: "10", viewBox: "0 0 13 10", width: "13", xmlns: "http://www.w3.org/2000/svg", children: e("path", { d: "M11.5 1.5L4.5 8.5L1 5", stroke: "#ffffff", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1.5" }) }), t || "Ok"] }),
|
|
886
|
-
const { useMobileStyling: s, border: d } = G((T) => ({ useMobileStyling: T.useMobileStyling, border: T.border })), [u, a] =
|
|
885
|
+
}, ve = ({ isDisabled: n, onClick: o, children: t }) => e(oe, { className: "ul-card__button-checkmark", disabled: n, onClick: o, type: "button", children: [e("svg", { fill: "none", height: "10", viewBox: "0 0 13 10", width: "13", xmlns: "http://www.w3.org/2000/svg", children: e("path", { d: "M11.5 1.5L4.5 8.5L1 5", stroke: "#ffffff", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1.5" }) }), t || "Ok"] }), $n = ({ className: n, next: o, properties: t, questionId: r, type: i }) => {
|
|
886
|
+
const { useMobileStyling: s, border: d } = G((T) => ({ useMobileStyling: T.useMobileStyling, border: T.border })), [u, a] = Q(!1), [v, y] = Q(""), [c, h] = Q(!1), k = t == null ? void 0 : t.collectName, C = (t == null ? void 0 : t.nameLabelText) || "Full Name", g = (t == null ? void 0 : t.consentText) || "I agree to the stated conditions", f = (t == null ? void 0 : t.submitButtonText) || "Submit", _ = !!v.trim(), q = u && (!k || _), M = (T, $ = !1) => {
|
|
887
887
|
T.preventDefault(), T.stopPropagation();
|
|
888
888
|
let A = null;
|
|
889
889
|
if (!$) {
|
|
890
|
-
if (!
|
|
890
|
+
if (!q) return void h(!0);
|
|
891
891
|
A = { submitted: !0 }, k && (A.name = v);
|
|
892
892
|
}
|
|
893
|
-
o({ value: A, questionId: r, type: i }, !!$ ||
|
|
893
|
+
o({ value: A, questionId: r, type: i }, !!$ || q);
|
|
894
894
|
};
|
|
895
895
|
return e("div", { className: O(n, "ul-card__consent-legal", "fade-in-transition"), children: e(ie, { embeddedType: "pdf", properties: t, children: e(le, { children: [e("div", { className: "sprig-stretch", children: [e(Oe, { allowTextEntry: !1, border: d, error: c && !u, id: "consent", isRadio: !1, isSelected: u, label: g, onUserInputChanged: ({ selected: T }) => {
|
|
896
896
|
T !== u && a(!u);
|
|
897
897
|
}, useMobileStyling: s }), k && e("input", { "aria-label": C, "aria-placeholder": C, className: O(K("ul-consent-legal__name-input", s)), "data-gramm": "false", maxLength: 250, name: "name", onBlur: (T) => {
|
|
898
|
-
T.currentTarget.style.borderColor = c && !_ ?
|
|
898
|
+
T.currentTarget.style.borderColor = c && !_ ? Te : qe;
|
|
899
899
|
}, onFocus: (T) => {
|
|
900
|
-
T.currentTarget.style.borderColor = c && !_ ?
|
|
900
|
+
T.currentTarget.style.borderColor = c && !_ ? Te : d;
|
|
901
901
|
}, onInput: (T) => {
|
|
902
902
|
T.preventDefault(), T.stopPropagation(), y(T.currentTarget.value);
|
|
903
|
-
}, placeholder: C, style: c && !_ ? { borderColor:
|
|
904
|
-
},
|
|
903
|
+
}, placeholder: C, style: c && !_ ? { borderColor: Te } : {}, tabIndex: 0, value: v })] }), e("div", { className: "ul-card__button-wrapper ul-card-vertical__button-wrapper", children: [e(ve, { isDisabled: !q, onClick: (T) => M(new SubmitEvent(T.type)), children: re({ buttonText: f }) }), t.required === !1 && e("button", { className: "ul-card-skip__button", onClick: (T) => M(new SubmitEvent(T.type), !0), children: Be(t) })] })] }) }) }, r);
|
|
904
|
+
}, Hn = () => {
|
|
905
905
|
const { destroy: n, forceBrandedLogo: o } = G((t) => ({ destroy: t.destroy, forceBrandedLogo: t.forceBrandedLogo }));
|
|
906
906
|
return ue(() => {
|
|
907
907
|
setTimeout(() => {
|
|
@@ -909,13 +909,13 @@ const ce = async ({ event: n, apiBase: o, headers: t, visitorId: r, envId: i, me
|
|
|
909
909
|
}, o ? 4e3 : 2e3);
|
|
910
910
|
}, [n, o]), e("div", { className: "end-of-survey-text", children: "End of survey" });
|
|
911
911
|
}, Vn = ({ activeValue: n, border: o, icon: t, enableCspTrustedTypes: r, isPressed: i, range: s, scaleLabelType: d, selectedValue: u, setSelectedValue: a, setActiveValue: v, setIsPressed: y, useMobileStyling: c, value: h, viewDocument: k }) => {
|
|
912
|
-
const C = `option-${h}`, g = d === "number", f = d === "star", _ = d === "smiley",
|
|
912
|
+
const C = `option-${h}`, g = d === "number", f = d === "star", _ = d === "smiley", q = g && h === n || h === u, [M, T] = (() => {
|
|
913
913
|
const m = f && u !== null && h <= u;
|
|
914
914
|
return f && h <= n || _ && h === n || m || h === n || h === u ? [o, i || m || h === u ? 1 : 0.3] : ["", 1];
|
|
915
915
|
})(), $ = fe(() => {
|
|
916
|
-
const m = { borderColor:
|
|
917
|
-
return g ? { ...m, backgroundColor: u === h ?
|
|
918
|
-
}, [
|
|
916
|
+
const m = { borderColor: q ? M : "", fillOpacity: q ? "" : T, zIndex: q ? 3 : "auto", color: u === h ? "#fff" : "" };
|
|
917
|
+
return g ? { ...m, backgroundColor: u === h ? M : "" } : { ...m, color: f || _ || u === h ? M : "" };
|
|
918
|
+
}, [q, M, T, u, h, g, f, _]), A = fe(() => _n((({ icon: m, scaleLabelType: b, value: w, selectedValue: l }) => {
|
|
919
919
|
if (b === "smiley" && w === l) {
|
|
920
920
|
let p = 0;
|
|
921
921
|
return m.replace(/black/g, () => ++p == 1 ? "black" : "white");
|
|
@@ -941,11 +941,11 @@ const ce = async ({ event: n, apiBase: o, headers: t, visitorId: r, envId: i, me
|
|
|
941
941
|
v(-1), y(!1);
|
|
942
942
|
}, style: $, tabIndex: 0 });
|
|
943
943
|
}, Fn = ({ className: n, labels: o, next: t, properties: r, questionId: i, type: s }) => {
|
|
944
|
-
const { border: d, useMobileStyling: u, viewDocument: a, enableCspTrustedTypes: v } = G((b) => ({ border: b.border, useMobileStyling: b.useMobileStyling, viewDocument: b.viewDocument, enableCspTrustedTypes: b.enableCspTrustedTypes })), [y, c] =
|
|
945
|
-
let
|
|
946
|
-
const { range:
|
|
947
|
-
|
|
948
|
-
const A =
|
|
944
|
+
const { border: d, useMobileStyling: u, viewDocument: a, enableCspTrustedTypes: v } = G((b) => ({ border: b.border, useMobileStyling: b.useMobileStyling, viewDocument: b.viewDocument, enableCspTrustedTypes: b.enableCspTrustedTypes })), [y, c] = Q(-1), [h, k] = Q(!1), [C, g] = Q(null), f = o && o.left, _ = o && o.right;
|
|
945
|
+
let q;
|
|
946
|
+
const { range: M, scaleLabelType: T, ratingIcons: $ } = r;
|
|
947
|
+
M && (q = Number(M));
|
|
948
|
+
const A = q || 5, m = (b) => {
|
|
949
949
|
var w, l;
|
|
950
950
|
switch (T) {
|
|
951
951
|
case "star":
|
|
@@ -961,7 +961,7 @@ const ce = async ({ event: n, apiBase: o, headers: t, visitorId: r, envId: i, me
|
|
|
961
961
|
return e(Vn, { activeValue: y, border: d, enableCspTrustedTypes: v, icon: m(w), isPressed: h, range: A, scaleLabelType: T, selectedValue: C, setActiveValue: c, setIsPressed: k, setSelectedValue: g, useMobileStyling: u, value: l, viewDocument: a }, w);
|
|
962
962
|
}) }), e("div", { className: "ul-card--likert__labels", children: [e("span", { children: f }), e("span", { children: _ })] })] }), e(le, { children: e(ve, { isDisabled: C === null && r.required, onClick: () => t({ value: C, questionId: i, type: s }, !0), children: re(r) }) })] }) }, i);
|
|
963
963
|
}, zn = ({ columns: n, onSelect: o, options: t, selectedOptions: r }) => {
|
|
964
|
-
const i = se([]), { border: s, useMobileStyling: d } = G((h) => ({ border: h.border, useMobileStyling: h.useMobileStyling })), u = t.findIndex((h) => r[h.id] === null), [a, v] =
|
|
964
|
+
const i = se([]), { border: s, useMobileStyling: d } = G((h) => ({ border: h.border, useMobileStyling: h.useMobileStyling })), u = t.findIndex((h) => r[h.id] === null), [a, v] = Q(u), y = be((h, k) => {
|
|
965
965
|
o(h, k);
|
|
966
966
|
const C = a + 1, g = t[C];
|
|
967
967
|
g && r[g.id] === null && v(C);
|
|
@@ -978,32 +978,32 @@ const ce = async ({ event: n, apiBase: o, headers: t, visitorId: r, envId: i, me
|
|
|
978
978
|
}, Gn = ({ className: n, next: o, options: t, properties: r, questionId: i, type: s, onSubmitButtonClick: d }) => {
|
|
979
979
|
const u = r.matrixColumn, a = r.required, v = (C) => {
|
|
980
980
|
C.preventDefault(), C.stopPropagation(), o({ value: c, questionId: i, type: s }, !0), d && d();
|
|
981
|
-
}, y = t.reduce((C, g) => (C[g.id] = null, C), {}), [c, h] =
|
|
981
|
+
}, y = t.reduce((C, g) => (C[g.id] = null, C), {}), [c, h] = Q(y);
|
|
982
982
|
return e("form", { className: O(n, "ul-card__matrix", "fade-in-transition"), id: "text-form", onSubmit: v, children: e(ie, { properties: r, children: [e(de, { children: e(zn, { columns: u, onSelect: (C, g) => {
|
|
983
983
|
h((f) => ({ ...f, [C]: g }));
|
|
984
984
|
}, options: t, selectedOptions: c }) }), e(le, { children: e(ve, { isDisabled: (k = c, a && Object.values(k).every((C) => C == null)), onClick: () => v(new SubmitEvent("submit")), children: re(r) }) })] }) }, i);
|
|
985
985
|
var k;
|
|
986
986
|
}, un = ({ className: n, 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, h] =
|
|
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, h] = Q(y), k = s === "multiplechoice", C = r.required, g = t.find((l) => {
|
|
988
988
|
var p;
|
|
989
989
|
return (p = l.optionProperties) == null ? void 0 : p.noneOfTheAbove;
|
|
990
990
|
}), f = (l) => Object.entries(l).some(([p, x]) => {
|
|
991
|
-
var
|
|
992
|
-
const
|
|
993
|
-
return ((
|
|
994
|
-
}), _ = (l) => Object.values(l).filter((p) => p.isSelected).length,
|
|
995
|
-
const { minSelect: x = 0, maxSelect:
|
|
996
|
-
switch (
|
|
991
|
+
var B;
|
|
992
|
+
const D = t.find((Y) => `${Y.id}` === p), j = x.userText === void 0 || x.userText.trim() === "";
|
|
993
|
+
return ((B = D == null ? void 0 : D.optionProperties) == null ? void 0 : B.allowsTextEntry) && j && x.isSelected;
|
|
994
|
+
}), _ = (l) => Object.values(l).filter((p) => p.isSelected).length, q = r.minSelect && r.minSelect > 0 && r.maxSelectMode === Ce.Range && _(c) < r.minSelect && (C || _(c) > 0), M = (l) => f(l) || C && !_(l) || !((p) => {
|
|
995
|
+
const { minSelect: x = 0, maxSelect: D = 1 / 0, maxSelectMode: j } = r, B = _(p);
|
|
996
|
+
switch (j) {
|
|
997
997
|
case Ce.Maximum:
|
|
998
|
-
return
|
|
998
|
+
return B <= D;
|
|
999
999
|
case Ce.Range:
|
|
1000
|
-
return
|
|
1000
|
+
return B === 0 || B >= x;
|
|
1001
1001
|
default:
|
|
1002
1002
|
return !0;
|
|
1003
1003
|
}
|
|
1004
1004
|
})(l), T = Object.entries(c).some(([l, p]) => {
|
|
1005
|
-
var x,
|
|
1006
|
-
return p.isSelected && ((
|
|
1005
|
+
var x, D;
|
|
1006
|
+
return p.isSelected && ((D = (x = t.find((j) => `${j.id}` === l)) == null ? void 0 : x.optionProperties) == null ? void 0 : D.allowsTextEntry);
|
|
1007
1007
|
}), $ = d && (!k || T), A = (l) => {
|
|
1008
1008
|
w(l.id, l.selected, l.userText, l.noneOfTheAbove);
|
|
1009
1009
|
}, m = (l) => {
|
|
@@ -1011,22 +1011,22 @@ const ce = async ({ event: n, apiBase: o, headers: t, visitorId: r, envId: i, me
|
|
|
1011
1011
|
return (r == null ? void 0 : r.maxSelectMode) !== Ce.Unlimited && _(c) === (r == null ? void 0 : r.maxSelect) && !((p = c[l]) != null && p.isSelected);
|
|
1012
1012
|
}, b = () => {
|
|
1013
1013
|
o(c, !0), u && u();
|
|
1014
|
-
}, w = (l, p, x,
|
|
1015
|
-
const
|
|
1016
|
-
if ((k ||
|
|
1017
|
-
else g && !
|
|
1018
|
-
|
|
1014
|
+
}, w = (l, p, x, D) => {
|
|
1015
|
+
const j = Object.assign({}, c);
|
|
1016
|
+
if ((k || D) && p) for (const B of Object.values(j)) B.isSelected = !1, delete B.userText;
|
|
1017
|
+
else g && !D && c[g.id].isSelected && (j[g.id].isSelected = !1);
|
|
1018
|
+
j[l] = { isSelected: p, userText: x }, h(j);
|
|
1019
1019
|
};
|
|
1020
|
-
return e("form", { className: O(n, "ul-card--multiple", "fade-in-transition"), id: "text-form", onSubmit: b, children: e(ie, { properties: r, children: [e(de, { children: [r.isDropdown ? e(Dn, { disabledOptions: t.filter((l) => m(l.id)), dropdownFooter:
|
|
1020
|
+
return e("form", { className: O(n, "ul-card--multiple", "fade-in-transition"), id: "text-form", onSubmit: b, children: e(ie, { properties: r, children: [e(de, { children: [r.isDropdown ? e(Dn, { disabledOptions: t.filter((l) => m(l.id)), dropdownFooter: q ? e("div", { className: "ul-card__min-select-counter", style: { marginLeft: "16px" }, children: [_(c), "/", r.minSelect] }) : void 0, isMultiSelect: !k, multiselectText: r.dropdownMultiselectedText ?? "choices selected", onChange: (l) => {
|
|
1021
1021
|
const p = { ...c };
|
|
1022
1022
|
for (const x of t) l.includes(x) ? p[x.id].isSelected = !0 : p[x.id].isSelected = !1;
|
|
1023
1023
|
h(p);
|
|
1024
|
-
}, options: t, placeholderText: r.dropdownPlaceholderText ?? (k ? "Select choice" : "Select choice(s)"), value: t.filter((l) => c[l.id].isSelected) }) : e("div", { className: O(K("ul-card__choices", v)), role: k ? "radiogroup" : "group", children: [t.map(({ id: l, label: p, value: x, optionProperties:
|
|
1025
|
-
var
|
|
1026
|
-
const
|
|
1027
|
-
return e(Oe, { allowTextEntry:
|
|
1028
|
-
var
|
|
1029
|
-
}), !!
|
|
1024
|
+
}, options: t, placeholderText: r.dropdownPlaceholderText ?? (k ? "Select choice" : "Select choice(s)"), value: t.filter((l) => c[l.id].isSelected) }) : e("div", { className: O(K("ul-card__choices", v)), role: k ? "radiogroup" : "group", children: [t.map(({ id: l, label: p, value: x, optionProperties: D }) => {
|
|
1025
|
+
var R, F;
|
|
1026
|
+
const j = `${l}`, { allowsTextEntry: B, noneOfTheAbove: Y } = { allowsTextEntry: !1, noneOfTheAbove: !1, ...D };
|
|
1027
|
+
return e(Oe, { allowTextEntry: B, border: a, disabled: m(j), error: (L = c, f(L)), id: j, isRadio: k, isSelected: !!((R = c[j]) != null && R.isSelected), label: p, noneOfTheAbove: Y, onUserInputChanged: A, promptText: (D == null ? void 0 : D.otherOptionPlaceholder) || "Please specify", text: (F = c[l]) == null ? void 0 : F.userText, useMobileStyling: v, value: x }, j);
|
|
1028
|
+
var L;
|
|
1029
|
+
}), !!q && e("div", { className: "ul-card__min-select-counter", children: [_(c), "/", r.minSelect] })] }), $ && e(Sn, { handleSubmit: b, isSubmitDisabled: M(c) })] }), e(le, { children: e(ve, { isDisabled: M(c), onClick: b, children: re(r) }) })] }) }, i);
|
|
1030
1030
|
}, Zn = (n) => {
|
|
1031
1031
|
const { questionId: o, type: t, next: r, options: i } = n;
|
|
1032
1032
|
return e(un, { ...n, onSubmit: (s, d) => {
|
|
@@ -1044,20 +1044,20 @@ const ce = async ({ event: n, apiBase: o, headers: t, visitorId: r, envId: i, me
|
|
|
1044
1044
|
r({ value: d, secondaryValue: u, questionId: o, type: t }, s);
|
|
1045
1045
|
} });
|
|
1046
1046
|
}, Yn = ({ className: n, labels: o, properties: t, next: r, questionId: i, type: s }) => {
|
|
1047
|
-
const [d, u] =
|
|
1047
|
+
const [d, u] = Q(null), { border: a, useMobileStyling: v, viewDocument: y } = G((k) => ({ border: k.border, useMobileStyling: k.useMobileStyling, viewDocument: k.viewDocument })), c = o && o.left, h = o && o.right;
|
|
1048
1048
|
return e("form", { className: O(n, "ul-card--nps", "fade-in-transition"), children: e(ie, { properties: t, children: [e(de, { children: [e("div", { className: "ul-card--nps__numbers", children: [...Array(11)].map((k, C) => e("button", { className: O(K("nps-number", v), K(`nps-number-${C}`, v)), id: `option-${C}`, onClick: (g) => {
|
|
1049
1049
|
g.preventDefault(), g.stopPropagation(), u(C);
|
|
1050
1050
|
}, onKeyDown: (g) => {
|
|
1051
|
-
var _,
|
|
1051
|
+
var _, q;
|
|
1052
1052
|
const f = y.querySelectorAll("button.nps-number");
|
|
1053
|
-
g.key === "ArrowRight" ? (_ = f[C + 1]) == null || _.focus() : g.key === "ArrowLeft" ? (
|
|
1053
|
+
g.key === "ArrowRight" ? (_ = f[C + 1]) == null || _.focus() : g.key === "ArrowLeft" ? (q = f[C - 1]) == null || q.focus() : g.key !== "Enter" && g.key !== " " || (g.preventDefault(), g.stopPropagation(), u(C));
|
|
1054
1054
|
}, onPointerDown: (g) => {
|
|
1055
1055
|
g.currentTarget.style.zIndex = "2", g.currentTarget.style.borderColor = a;
|
|
1056
1056
|
}, onPointerLeave: (g) => {
|
|
1057
1057
|
g.currentTarget.style.zIndex = "auto", g.currentTarget.style.borderColor = qe;
|
|
1058
1058
|
}, style: d === C ? { backgroundColor: a, color: "#fff" } : void 0, tabIndex: 0, children: C }, C)) }), e("div", { className: "ul-card--nps__labels", children: [e("span", { children: c }), e("span", { children: h })] })] }), e(le, { children: e(ve, { isDisabled: d === null && t.required, onClick: () => r({ value: d, questionId: i, type: s }, !0), children: re(t) }) })] }) }, i);
|
|
1059
1059
|
}, Wn = ({ className: n, 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] =
|
|
1060
|
+
const { border: d, useMobileStyling: u, update: a } = G((f) => ({ border: f.border, useMobileStyling: f.useMobileStyling, update: f.update })), [v, y] = Q(""), c = se(null), h = v.trim(), k = t.required === !0 && !h, C = Pn(c, () => a()), g = t && t.openTextPlaceholder ? t.openTextPlaceholder : "";
|
|
1061
1061
|
return e("form", { className: O(n, "ul-card-text", "fade-in-transition"), id: "text-form", children: e(ie, { properties: t, children: e("div", { className: "ul-card-text", children: [e(de, { children: [e("div", { className: "ul-card-text__container", children: e("textarea", { "aria-describedby": "ul-caption", "aria-labelledby": "ul-question", "aria-multiline": "true", "aria-placeholder": g, className: O(K("ul-card-text__input", u)), "data-gramm": "false", maxLength: 5e3, name: "text", onBlur: (f) => {
|
|
1062
1062
|
f.currentTarget.style.borderColor = qe;
|
|
1063
1063
|
}, onChange: (f) => {
|
|
@@ -1071,93 +1071,93 @@ const ce = async ({ event: n, apiBase: o, headers: t, visitorId: r, envId: i, me
|
|
|
1071
1071
|
o({ value: v, questionId: r, type: i }, _), s && s();
|
|
1072
1072
|
}, children: re(t) }) })] }) }) }, r);
|
|
1073
1073
|
}, Kn = ({ className: n, 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), h = se(!1), k = se([]), [C, g] =
|
|
1075
|
-
_((
|
|
1076
|
-
const
|
|
1077
|
-
|
|
1078
|
-
const
|
|
1079
|
-
if (
|
|
1080
|
-
const z =
|
|
1081
|
-
return
|
|
1082
|
-
|
|
1083
|
-
}) :
|
|
1084
|
-
|
|
1085
|
-
}),
|
|
1074
|
+
const a = se(null), v = se(0), y = se(0), c = se(null), h = se(!1), k = se([]), [C, g] = Q(() => (r == null ? void 0 : r.required) === !0), [f, _] = Q(() => u.map((E) => ({ ...E, rank: null }))), q = fe(() => Array.from({ length: u.length }, (E, S) => S + 1), [u.length]), { useMobileStyling: M, isPreview: T, headers: $ } = G((E) => ({ useMobileStyling: E.useMobileStyling, isPreview: E.isPreview, headers: E.headers })), A = ($ == null ? void 0 : $["userleap-platform"]) === "android", m = M && !T && !A, b = !m && !A, w = (E, S) => {
|
|
1075
|
+
_((U) => {
|
|
1076
|
+
const P = parseInt(S), V = U.map((H) => ({ ...H }));
|
|
1077
|
+
V.some((H) => H.rank == null) && V.forEach((H, he) => H.rank = he + 1);
|
|
1078
|
+
const X = V.findIndex((H) => H.id === E);
|
|
1079
|
+
if (X === -1) return U;
|
|
1080
|
+
const z = V[X].rank;
|
|
1081
|
+
return P < z ? V.forEach((H) => {
|
|
1082
|
+
H.id !== E && H.rank >= P && H.rank < z && (H.rank = H.rank + 1);
|
|
1083
|
+
}) : P > z && V.forEach((H) => {
|
|
1084
|
+
H.id !== E && H.rank > z && H.rank <= P && (H.rank = H.rank - 1);
|
|
1085
|
+
}), V[X].rank = P, V.sort((H, he) => H.rank - he.rank), Y(), V;
|
|
1086
1086
|
});
|
|
1087
|
-
}, l = (E,
|
|
1088
|
-
for (let
|
|
1089
|
-
const
|
|
1090
|
-
if (!
|
|
1091
|
-
const
|
|
1092
|
-
if (E >=
|
|
1087
|
+
}, l = (E, S) => {
|
|
1088
|
+
for (let U = 0; U < k.current.length; U++) {
|
|
1089
|
+
const P = k.current[U];
|
|
1090
|
+
if (!P || P === c.current) continue;
|
|
1091
|
+
const V = P.getBoundingClientRect();
|
|
1092
|
+
if (E >= V.left && E <= V.right && S >= V.top && S <= V.bottom) return { element: P, index: U };
|
|
1093
1093
|
}
|
|
1094
1094
|
return null;
|
|
1095
|
-
}, p = (E) => (
|
|
1095
|
+
}, p = (E) => (S) => {
|
|
1096
1096
|
if (!m) return;
|
|
1097
|
-
|
|
1098
|
-
const
|
|
1099
|
-
v.current =
|
|
1100
|
-
const
|
|
1101
|
-
|
|
1097
|
+
S.preventDefault(), S.stopPropagation(), h.current = !0, a.current = E;
|
|
1098
|
+
const U = S.touches[0];
|
|
1099
|
+
v.current = U.clientY, y.current = U.clientY;
|
|
1100
|
+
const P = S.currentTarget.closest(".ul-card-rank__option");
|
|
1101
|
+
P && (c.current = P, P.classList.add("is-dragging"));
|
|
1102
1102
|
}, x = (E) => {
|
|
1103
1103
|
if (!m || !h.current || a.current === null) return;
|
|
1104
1104
|
E.preventDefault(), E.stopPropagation();
|
|
1105
|
-
const
|
|
1106
|
-
y.current =
|
|
1107
|
-
const
|
|
1108
|
-
c.current && (c.current.style.transform = `translateY(${
|
|
1109
|
-
|
|
1105
|
+
const S = E.touches[0];
|
|
1106
|
+
y.current = S.clientY;
|
|
1107
|
+
const U = y.current - v.current;
|
|
1108
|
+
c.current && (c.current.style.transform = `translateY(${U}px)`, c.current.style.zIndex = "1000"), k.current.forEach((V) => {
|
|
1109
|
+
V && V !== c.current && V.classList.remove("is-drop-target");
|
|
1110
1110
|
});
|
|
1111
|
-
const
|
|
1112
|
-
|
|
1113
|
-
},
|
|
1111
|
+
const P = l(S.clientX, S.clientY);
|
|
1112
|
+
P && P.element.classList.add("is-drop-target");
|
|
1113
|
+
}, D = (E) => {
|
|
1114
1114
|
if (!m || !h.current || a.current === null) return;
|
|
1115
1115
|
E.preventDefault(), E.stopPropagation();
|
|
1116
|
-
const
|
|
1117
|
-
c.current && (c.current.style.transform = "", c.current.style.zIndex = "", c.current.classList.remove("is-dragging")), k.current.forEach((
|
|
1118
|
-
|
|
1119
|
-
}),
|
|
1120
|
-
},
|
|
1121
|
-
_((
|
|
1122
|
-
const
|
|
1123
|
-
return
|
|
1124
|
-
|
|
1125
|
-
}),
|
|
1116
|
+
const S = E.changedTouches[0], U = l(S.clientX, S.clientY);
|
|
1117
|
+
c.current && (c.current.style.transform = "", c.current.style.zIndex = "", c.current.classList.remove("is-dragging")), k.current.forEach((P) => {
|
|
1118
|
+
P && P.classList.remove("is-drop-target");
|
|
1119
|
+
}), U && U.index !== a.current && j(a.current, U.index), a.current = null, c.current = null, h.current = !1;
|
|
1120
|
+
}, j = (E, S) => {
|
|
1121
|
+
_((U) => {
|
|
1122
|
+
const P = U.map((X) => ({ ...X })), [V] = P.splice(E, 1);
|
|
1123
|
+
return P.splice(S, 0, V), P.forEach((X, z) => {
|
|
1124
|
+
X.rank = z + 1;
|
|
1125
|
+
}), Y(), P;
|
|
1126
1126
|
});
|
|
1127
|
-
},
|
|
1128
|
-
const
|
|
1129
|
-
E.reduce((
|
|
1130
|
-
},
|
|
1127
|
+
}, B = (E) => {
|
|
1128
|
+
const S = {};
|
|
1129
|
+
E.reduce((U, P) => (U[P.id] = P.rank, U), S), t({ value: S, questionId: i, type: s }, !0);
|
|
1130
|
+
}, Y = () => {
|
|
1131
1131
|
g(!1);
|
|
1132
|
-
}, { left:
|
|
1132
|
+
}, { left: L, right: R } = o, F = u.length, Z = (E) => {
|
|
1133
1133
|
E.preventDefault(), E.currentTarget.classList.add("is-drop-target");
|
|
1134
|
-
},
|
|
1134
|
+
}, J = (E) => {
|
|
1135
1135
|
E.currentTarget.classList.remove("is-drop-target");
|
|
1136
1136
|
}, me = (E) => {
|
|
1137
1137
|
a.current = null, E.currentTarget.classList.remove("is-dragging");
|
|
1138
1138
|
};
|
|
1139
1139
|
return e("form", { className: O(n, "ul-card-rank", "fade-in-transition"), onSubmit: (E) => {
|
|
1140
|
-
E.preventDefault(),
|
|
1141
|
-
}, children: e(ie, { properties: r, children: e(
|
|
1140
|
+
E.preventDefault(), B(f), d && d();
|
|
1141
|
+
}, children: e(ie, { properties: r, children: e(Ee, A ? { children: [e(de, { children: e("div", { className: "ul-card--rank__question-inner-container", children: [e("div", { className: "ul-card-rank__labels", children: e("span", { children: ["1 - ", L] }) }), e("ol", { className: "ul-card-rank__list", children: f.map(({ id: E, label: S, rank: U }) => e("li", { className: "ul-card-rank__option", children: [e("select", { "aria-label": `Rank for ${S}`, className: O("ul-card-rank__select", U == null && "ul-card-rank__select--placeholder"), name: `rank[${E}]`, onChange: (P) => w(E, P.currentTarget.value), value: U ?? "", children: [U == null && e("option", { className: "ul-card-rank__select-option", disabled: !0, value: "", children: "-" }), q.map((P) => e("option", { className: "ul-card-rank__select-option", value: P, children: P }, `${P}-${i}`))] }), e("span", { children: S })] }, E)) }), e("div", { className: "ul-card-rank__labels", children: e("span", { children: [F, " - ", R] }) })] }) }), e(le, { children: e("div", { className: "ul-card__button-wrapper", children: e(oe, { disabled: C, children: re(r) }) }) })] } : { children: [e(de, { children: e("div", { className: "ul-card--rank__question-inner-container", children: [e("div", { className: "ul-card-rank__labels", children: e("span", { children: ["1 - ", L] }) }), e("ol", { className: "ul-card-rank__list", onDragOver: A ? void 0 : (E) => {
|
|
1142
1142
|
E.preventDefault(), E.dataTransfer && (E.dataTransfer.dropEffect = "move");
|
|
1143
|
-
}, children: f.map(({ id: E, label:
|
|
1144
|
-
return e("li", { className: "ul-card-rank__option", draggable: !!b || void 0, onDragEnd: b ? me : void 0, onDragEnter: b ?
|
|
1145
|
-
a.current =
|
|
1146
|
-
}) : void 0, onDrop: b ? (
|
|
1143
|
+
}, children: f.map(({ id: E, label: S, rank: U }, P) => {
|
|
1144
|
+
return e("li", { className: "ul-card-rank__option", draggable: !!b || void 0, onDragEnd: b ? me : void 0, onDragEnter: b ? Z : void 0, onDragLeave: b ? J : void 0, onDragStart: b ? (X = P, (z) => {
|
|
1145
|
+
a.current = X, z.dataTransfer && (z.dataTransfer.effectAllowed = "move", z.dataTransfer.setData("text/plain", String(X)), z.currentTarget.classList.add("is-dragging"));
|
|
1146
|
+
}) : void 0, onDrop: b ? (V = P, (z) => {
|
|
1147
1147
|
var he, Fe;
|
|
1148
1148
|
z.preventDefault(), z.currentTarget.classList.remove("is-drop-target");
|
|
1149
|
-
const
|
|
1150
|
-
a.current = null, (Fe = (he = z.currentTarget.closest(".ul-card-rank__list")) == null ? void 0 : he.querySelector(".is-dragging")) == null || Fe.classList.remove("is-dragging"),
|
|
1151
|
-
}) : void 0, ref: (z) => k.current[
|
|
1152
|
-
var
|
|
1153
|
-
}) }), e("div", { className: "ul-card-rank__labels", children: e("span", { children: [
|
|
1154
|
-
},
|
|
1149
|
+
const H = a.current;
|
|
1150
|
+
a.current = null, (Fe = (he = z.currentTarget.closest(".ul-card-rank__list")) == null ? void 0 : he.querySelector(".is-dragging")) == null || Fe.classList.remove("is-dragging"), H != null && H !== V && j(H, V);
|
|
1151
|
+
}) : void 0, ref: (z) => k.current[P] = z, children: [e("select", { "aria-label": `Rank for ${S}`, className: O("ul-card-rank__select", U == null && "ul-card-rank__select--placeholder"), name: `rank[${E}]`, onChange: (z) => w(E, z.currentTarget.value), value: U ?? "", children: [U == null && e("option", { className: "ul-card-rank__select-option", disabled: !0, value: "", children: "-" }), q.map((z) => e("option", { className: "ul-card-rank__select-option", value: z, children: z }, z))] }), e("span", { children: S }), !A && e("button", { "aria-label": `Drag ${S} to reorder`, className: "ul-card-rank__drag-btn", onTouchEnd: m ? D : void 0, onTouchMove: m ? x : void 0, onTouchStart: m ? p(P) : void 0, title: "Drag to reorder", type: "button", children: e("svg", { fill: "none", height: "17", viewBox: "0 0 16 17", width: "16", xmlns: "http://www.w3.org/2000/svg", children: e("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
|
+
var V, X;
|
|
1153
|
+
}) }), e("div", { className: "ul-card-rank__labels", children: e("span", { children: [F, " - ", R] }) })] }) }), e(le, { children: e("div", { className: "ul-card__button-wrapper", children: e(oe, { disabled: C, children: re(r) }) }) })] }) }) }, i);
|
|
1154
|
+
}, Re = 1, pn = 2, vn = 3, we = (n) => n.type === "av_permission", Ke = (n) => n.type === "screen_permission", mn = (n, o) => n === void 0 ? Re : n ? ((t, r) => !(we(r) ? r.permissionDescriptors : []).includes("camera") || t.getVideoTracks().length > 0)(n, o) ? vn : Re : pn, Je = { avStream: null, currentPage: null, mediaRecordingUids: null, nextQuestion: () => {
|
|
1155
1155
|
}, passthroughData: void 0, recordingMediaTypes: void 0, screenPermissionRequested: !1, type: void 0 }, te = xn((n) => ({ ...Je, reset: () => {
|
|
1156
1156
|
n(Je);
|
|
1157
1157
|
}, updatePage: (o) => {
|
|
1158
1158
|
n(o);
|
|
1159
1159
|
} }));
|
|
1160
|
-
function
|
|
1160
|
+
function Ne({ currentPage: n, pages: o }) {
|
|
1161
1161
|
const { avStream: t, recordingMediaTypes: r, updatePage: i } = te.getState(), { recorderEventEmitter: s } = G.getState();
|
|
1162
1162
|
s.emit("av.permission", { "permission.descriptors": n.permissionDescriptors, "stream.ready": (d, u) => {
|
|
1163
1163
|
if (t === d) return;
|
|
@@ -1169,7 +1169,7 @@ function Re({ currentPage: n, pages: o }) {
|
|
|
1169
1169
|
i({ currentPage: a, avStream: d });
|
|
1170
1170
|
} });
|
|
1171
1171
|
}
|
|
1172
|
-
function
|
|
1172
|
+
function Me({ status: n }) {
|
|
1173
1173
|
const { nextQuestion: o, passthroughData: t, mediaRecordingUids: r, reset: i } = te.getState(), { recorderEventEmitter: s, handleUploadUpdate: d, index: u } = G.getState(), a = { value: { taskStatus: n }, 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 });
|
|
@@ -1181,7 +1181,7 @@ function Ne({ status: n }) {
|
|
|
1181
1181
|
a.value.taskDurationMillisecond = v, r && (a.value.mediaRecordingUids = r), i(), o(a);
|
|
1182
1182
|
} });
|
|
1183
1183
|
}
|
|
1184
|
-
function
|
|
1184
|
+
function He({ pages: n, setIsRequestingPermission: o }) {
|
|
1185
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 = n.indexOf(s);
|
|
@@ -1205,7 +1205,7 @@ function $e({ pages: n, setIsRequestingPermission: o }) {
|
|
|
1205
1205
|
return;
|
|
1206
1206
|
}
|
|
1207
1207
|
}
|
|
1208
|
-
const hn = "ul-permission-graphics-container", gn = "ul-permission-body", bn = O(hn, "ul_recorded-task-inset-spacing"),
|
|
1208
|
+
const hn = "ul-permission-graphics-container", gn = "ul-permission-body", bn = O(hn, "ul_recorded-task-inset-spacing"), je = O("ul-horizontal-button-container", "ul-horizontal-button-container-left"), fn = ({ richTextBody: n }) => e(ye, { className: "ul-rich-text-body", html: n, id: "ul-task-detail-container" }), Ie = ({ required: n, skipButtonText: o, bottom: t = !1 }) => n ? null : e(oe, { className: O(t && "ul-skip-button-below", "ul-button-inactive"), onClick: Me.bind(null, { status: "abandoned" }), children: o || "Skip" }), Ve = (n) => {
|
|
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
|
ue(() => {
|
|
1211
1211
|
const d = setInterval(() => {
|
|
@@ -1215,33 +1215,33 @@ const hn = "ul-permission-graphics-container", gn = "ul-permission-body", bn = O
|
|
|
1215
1215
|
}, [o, t, s, n, r, i]);
|
|
1216
1216
|
}, Jn = ({ content: n, pages: o, required: t }) => {
|
|
1217
1217
|
const { buttonText: r, skipButtonText: i, taskDetail: s } = n;
|
|
1218
|
-
return Ve(o), e("div", { className: "ul-task-page", children: [s && e(fn, { richTextBody: s }), e("div", { className:
|
|
1218
|
+
return Ve(o), e("div", { className: "ul-task-page", children: [s && e(fn, { richTextBody: s }), e("div", { className: je, children: [e(oe, { onClick: He.bind(null, { pages: o }), children: r }), e(Ie, { required: t, skipButtonText: i })] })] }, "start-task");
|
|
1219
1219
|
}, Xn = ({ content: n, pages: o, properties: t }) => {
|
|
1220
1220
|
const { buttonText: r, skipButtonText: i } = n;
|
|
1221
|
-
return Ve(o), e("div", { className: "ul-task-page", children: [n.taskDetail && e(fn, { richTextBody: n.taskDetail }), e(ie, { properties: t, children: e("div", { className:
|
|
1221
|
+
return Ve(o), e("div", { className: "ul-task-page", children: [n.taskDetail && e(fn, { richTextBody: n.taskDetail }), e(ie, { properties: t, children: e("div", { className: je, children: [e(oe, { className: "ul-complete-task-button", onClick: Me.bind(null, { status: "completed" }), children: r }), e(oe, { className: O("ul-button-inactive"), onClick: Me.bind(null, { status: "given.up" }), children: i })] }) })] }, "complete-task");
|
|
1222
1222
|
}, et = ({ content: n, pages: o, required: t }) => {
|
|
1223
|
-
const { buttonText: r, skipButtonText: i } = n, [s] = G((a) => [a.tabTitle]), [d, u] =
|
|
1224
|
-
return e("div", { children: [e("div", { className: bn, children: [e("p", { style: { marginTop: "auto" }, children: n.selectTabText }), e("div", { className: "ul-select-tab-container", children: e("p", { className: gn, children: s }) })] }), e("div", { className: t ? "" :
|
|
1223
|
+
const { buttonText: r, skipButtonText: i } = n, [s] = G((a) => [a.tabTitle]), [d, u] = Q(!1);
|
|
1224
|
+
return e("div", { children: [e("div", { className: bn, children: [e("p", { style: { marginTop: "auto" }, children: n.selectTabText }), e("div", { className: "ul-select-tab-container", children: e("p", { className: gn, children: s }) })] }), e("div", { className: t ? "" : je, children: [e(oe, { disabled: d, onClick: He.bind(null, { pages: o, setIsRequestingPermission: u }), children: r }), e(Ie, { required: t, skipButtonText: i })] })] });
|
|
1225
1225
|
}, nt = ({ content: n }) => e(ye, { className: O(hn, "ul_permission_svg_container", "ul_recorded-task-inset-spacing", "ul-center-horizontally"), html: n.svg }, "ul-permission-request-graphic"), tt = ({ content: n, pages: o, required: t }) => {
|
|
1226
1226
|
const { permissionDeniedHeadline: r, permissionDeniedBody: i, skipButtonText: s, tryAgainButtonText: d } = n, u = we(o[0]) ? o[0] : null;
|
|
1227
1227
|
return ue(() => {
|
|
1228
1228
|
const a = setInterval(() => {
|
|
1229
|
-
u !== null &&
|
|
1229
|
+
u !== null && Ne({ currentPage: u, pages: o });
|
|
1230
1230
|
}, 1e3);
|
|
1231
1231
|
return () => clearInterval(a);
|
|
1232
|
-
}, [u, o]), u ? e("div", { children: [e("div", { className: bn, children: e("p", { className: "ul-av-permission-denied-paragraph", children: [e("span", { className: "ul-av-permission-denied-headline", children: r }), e("span", { className: gn, children: i })] }) }), e("div", { className:
|
|
1232
|
+
}, [u, o]), u ? e("div", { children: [e("div", { className: bn, children: e("p", { className: "ul-av-permission-denied-paragraph", children: [e("span", { className: "ul-av-permission-denied-headline", children: r }), e("span", { className: gn, children: i })] }) }), e("div", { className: je, children: [e(oe, { onClick: Ne.bind(null, { currentPage: u, pages: o }), children: d }), e(Ie, { required: t, skipButtonText: s })] })] }) : null;
|
|
1233
1233
|
}, rt = ({ stream: n }) => e("video", { autoPlay: !0, className: O("ul_recorded-task-inset-spacing"), id: "ul-record-task-video-preview", muted: !0, ref: (o) => {
|
|
1234
1234
|
o && (o.srcObject = n || null);
|
|
1235
1235
|
} }), ot = ({ content: n, pages: o, required: t }) => {
|
|
1236
1236
|
const { skipButtonText: r } = n, { avStream: i } = te.getState();
|
|
1237
|
-
return Ve(o), e("div", { children: [e(rt, { stream: i }), e("div", { className: "ul-vertical-button-container-center", children: [e(oe, { onClick:
|
|
1237
|
+
return Ve(o), e("div", { children: [e(rt, { stream: i }), e("div", { className: "ul-vertical-button-container-center", children: [e(oe, { onClick: He.bind(null, { pages: o }), children: n.buttonText }), e(Ie, { bottom: !0, required: t, skipButtonText: r })] })] });
|
|
1238
1238
|
}, it = ({ properties: n }) => {
|
|
1239
1239
|
const { pages: o, required: t } = n, { 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
1243
|
const s = mn(r, i);
|
|
1244
|
-
return s ===
|
|
1244
|
+
return s === Re ? e(nt, { content: i }) : e(s === pn ? tt : ot, { content: i, pages: o, required: t });
|
|
1245
1245
|
}
|
|
1246
1246
|
case "screen_permission":
|
|
1247
1247
|
return e(et, { content: i, pages: o, required: t });
|
|
@@ -1255,19 +1255,19 @@ const hn = "ul-permission-graphics-container", gn = "ul-permission-body", bn = O
|
|
|
1255
1255
|
}, st = ({ className: n, properties: o, next: t, questionId: r }) => {
|
|
1256
1256
|
const i = G(), { surveyId: s, responseGroupUid: d, userId: u } = i, a = te(), { screenPermissionRequested: v } = a, y = te((g) => g.avStream);
|
|
1257
1257
|
let c = te((g) => g.currentPage);
|
|
1258
|
-
c || (c = function({ pages: g, userId: f, responseGroupUid: _, surveyId:
|
|
1259
|
-
const { updatePage: $ } = te.getState(), { eventEmitFn: A, recorderEventEmitter: m } = G.getState(), b = { questionId:
|
|
1258
|
+
c || (c = function({ pages: g, userId: f, responseGroupUid: _, surveyId: q, questionId: M, next: T }) {
|
|
1259
|
+
const { updatePage: $ } = te.getState(), { eventEmitFn: A, recorderEventEmitter: m } = G.getState(), b = { questionId: M, surveyId: q, visitorId: f, responseGroupUid: _ };
|
|
1260
1260
|
let w = 0;
|
|
1261
|
-
m.emit("recorded.task.permission.screen"), A("recorded.task.permission.screen"), m.emit("permission.status", { "permission.status.callback": (p, x,
|
|
1262
|
-
const
|
|
1263
|
-
if (we(
|
|
1264
|
-
const { permissionDescriptors:
|
|
1265
|
-
|
|
1261
|
+
m.emit("recorded.task.permission.screen"), A("recorded.task.permission.screen"), m.emit("permission.status", { "permission.status.callback": (p, x, D, j) => {
|
|
1262
|
+
const B = g[w], { type: Y } = B, L = ["screen"];
|
|
1263
|
+
if (we(B)) {
|
|
1264
|
+
const { permissionDescriptors: R } = B, F = R == null ? void 0 : R.includes("microphone"), Z = R == null ? void 0 : R.includes("camera");
|
|
1265
|
+
F && L.push("audio"), Z && L.push("video"), (p != null && p.active && !Z || p != null && p.active && x) && w++;
|
|
1266
1266
|
}
|
|
1267
|
-
Ke(g[w]) &&
|
|
1267
|
+
Ke(g[w]) && D && (w++, m.emit("begin.recording", { "recording.media.types": L, "start.recording.callback": (R) => $({ mediaRecordingUids: R }) })), $({ currentPage: g[w], avStream: p, screenPermissionRequested: D, nextQuestion: T, type: Y, passthroughData: b, recordingMediaTypes: L, captureStream: j });
|
|
1268
1268
|
} });
|
|
1269
1269
|
const l = g[w];
|
|
1270
|
-
return l.type === "av_permission" &&
|
|
1270
|
+
return l.type === "av_permission" && Ne({ currentPage: l, pages: g }), l;
|
|
1271
1271
|
}({ questionId: r, surveyId: s, next: (g) => {
|
|
1272
1272
|
t(g, !0);
|
|
1273
1273
|
}, pages: o.pages, responseGroupUid: d, userId: u }));
|
|
@@ -1280,7 +1280,7 @@ const hn = "ul-permission-graphics-container", gn = "ul-permission-body", bn = O
|
|
|
1280
1280
|
}, a = Ln(t && t.buttonUrl, s), v = d && t.promptActionType === Rn.NO_BUTTON;
|
|
1281
1281
|
return e("div", { className: O(n, "ul-card__text-url-prompt", "fade-in-transition"), children: e(ie, { properties: t, children: !v && e("div", { children: e("div", { className: "ul-card-button-group", children: [e("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 && e("button", { className: "ul-card-skip__button", onClick: (y) => u(0, !0), children:
|
|
1283
|
+
}, rel: "noreferrer", role: a ? "link" : "button", tabIndex: 0, target: "_blank", children: re(t) }), t.required === !1 && e("button", { className: "ul-card-skip__button", onClick: (y) => u(0, !0), children: Be(t) })] }) }) }) }, r);
|
|
1284
1284
|
}, lt = ({ className: n, 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
|
ue(() => {
|
|
@@ -1297,20 +1297,20 @@ const hn = "ul-permission-graphics-container", gn = "ul-permission-body", bn = O
|
|
|
1297
1297
|
const i = Math.round(Math.min(99, ...Object.values(o).filter((s) => s.isSubmitted).map((s) => s.progressPct || 0)));
|
|
1298
1298
|
return e("div", { className: O(n, "ul-card--uploading", "fade-in-transition"), children: [e("div", { "aria-busy": "true", "aria-label": "Processing...", "aria-live": "polite", className: "ul-loading-spinner-container", role: "progressbar", children: e("div", { className: "ul-loading-spinner", children: [e("div", { className: "first" }), e("div", { className: "second" }), e("div", { className: "third" }), e("div", { className: "fourth" })] }) }), e(Ae, { message: `${t} (${i}% complete)` }), e("p", { className: "ul-caption", children: r })] });
|
|
1299
1299
|
}, Xe = 0, en = 1, ut = ({ className: n, 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: h, visitorId: k } = G((b) => ({ apiURL: b.apiURL, envId: b.envId, handleUploadUpdate: b.handleUploadUpdate, headers: b.headers, responseGroupUid: b.responseGroupUid, surveyId: b.surveyId, viewDocument: b.viewDocument, visitorId: b.userId })), [C, g] =
|
|
1301
|
-
b ===
|
|
1300
|
+
const s = `ul-card-video__player_recorder-q${r}`, { apiURL: d, envId: u, handleUploadUpdate: a, headers: v, responseGroupUid: y, surveyId: c, viewDocument: h, visitorId: k } = G((b) => ({ apiURL: b.apiURL, envId: b.envId, handleUploadUpdate: b.handleUploadUpdate, headers: b.headers, responseGroupUid: b.responseGroupUid, surveyId: b.surveyId, viewDocument: b.viewDocument, visitorId: b.userId })), [C, g] = Q(!1), [f, _] = Q(null), [q, M] = Q(null), [T, $] = Q(Xe), A = (b, w) => {
|
|
1301
|
+
b === N.UPLOAD_STARTED ? (_(w[N.UPLOAD_ID]), M(w[N.MEDIA_RECORDING_UID]), g(!0)) : b === N.DELETE ? (_(null), M(null), g(!1)) : b === N.UPLOAD_PROGRESS ? isNaN(w[N.UPLOAD_PROGRESS_PCT]) ? a({ mediaRecordingUid: w[N.MEDIA_RECORDING_UID], isComplete: !0 }) : a({ mediaRecordingUid: w[N.MEDIA_RECORDING_UID], progressPct: w[N.UPLOAD_PROGRESS_PCT] }) : b === N.UPLOAD_FINISHED && a({ mediaRecordingUid: w[N.MEDIA_RECORDING_UID], isComplete: !0 });
|
|
1302
1302
|
}, m = (b) => {
|
|
1303
1303
|
b.preventDefault(), b.stopPropagation(), document.getElementById(s) && ((w) => {
|
|
1304
1304
|
const l = w + Qe;
|
|
1305
|
-
if (
|
|
1305
|
+
if (I.document.getElementById(l) && I.videojs) {
|
|
1306
1306
|
try {
|
|
1307
|
-
if (!
|
|
1307
|
+
if (!I.videojs(l).record().stream) return;
|
|
1308
1308
|
} catch {
|
|
1309
1309
|
return;
|
|
1310
1310
|
}
|
|
1311
|
-
|
|
1311
|
+
I.videojs(l).record().stop(), I.videojs(l).record().stopDevice();
|
|
1312
1312
|
}
|
|
1313
|
-
})(s), f &&
|
|
1313
|
+
})(s), f && q ? (a({ mediaRecordingUid: q, isSubmitted: !0 }), o({ value: { mediaRecordingUid: q }, questionId: r, type: i }, !0)) : o({ value: null, questionId: r, type: i }, !0);
|
|
1314
1314
|
};
|
|
1315
1315
|
return e("form", { className: O(n, "ul-card--video", "fade-in-transition"), id: "ul-video-interview-form", children: [e(de, { children: [e("div", { id: "ul-question-player-container", style: { display: T === Xe ? "" : "none" }, children: e(ie, { properties: t, children: e("button", { className: "ul-video-btn ul-record-response-btn", onClick: (b) => {
|
|
1316
1316
|
b.preventDefault(), b.stopPropagation(), document.getElementById(s) && ((w) => {
|
|
@@ -1319,26 +1319,26 @@ const hn = "ul-permission-graphics-container", gn = "ul-permission-body", bn = O
|
|
|
1319
1319
|
})(s), $(en);
|
|
1320
1320
|
} }) }) }), e("div", { style: { display: T === en ? "block" : "none" }, children: e("div", { id: "ul-recorder-player-container", ref: (b) => {
|
|
1321
1321
|
if (b && b.children.length === 0) {
|
|
1322
|
-
const w = ((l, p = {}, x = "https://api.userleap.com",
|
|
1323
|
-
|
|
1324
|
-
const
|
|
1325
|
-
return
|
|
1326
|
-
ae(new Error(`Voice & Video feature violates ${
|
|
1322
|
+
const w = ((l, p = {}, x = "https://api.userleap.com", D, j, B, Y = !1, L = document) => {
|
|
1323
|
+
I.document = L;
|
|
1324
|
+
const R = l + Qe, F = cn(R);
|
|
1325
|
+
return I.document.addEventListener("securitypolicyviolation", (Z) => {
|
|
1326
|
+
ae(new Error(`Voice & Video feature violates ${Z.violatedDirective} web page CSP policies for the recorder player.`), "recorderDeviceError", x, B, p.visitorId, p.envId);
|
|
1327
1327
|
}), sn(rn.concat(Nn), () => {
|
|
1328
|
-
|
|
1328
|
+
Le(R, F), I.document.getElementById($e(R)).remove();
|
|
1329
1329
|
try {
|
|
1330
|
-
Bn(
|
|
1331
|
-
} catch (
|
|
1332
|
-
return void ae(new Error(`Error when creating video recorder player object ${
|
|
1330
|
+
Bn(F, R, p, x, D, j, B, Y);
|
|
1331
|
+
} catch (Z) {
|
|
1332
|
+
return void ae(new Error(`Error when creating video recorder player object ${Z}`), "recorderDeviceError", x, B, p.visitorId, p.envId);
|
|
1333
1333
|
}
|
|
1334
|
-
}),
|
|
1335
|
-
})(s, { surveyId: c, responseGroupUid: y, questionId: r, visitorId: k, envId: u }, d, A, void 0, { ...v, "x-ul-video-recorder-origin": "sdk" }, t.mediaType ===
|
|
1334
|
+
}), F;
|
|
1335
|
+
})(s, { surveyId: c, responseGroupUid: y, questionId: r, visitorId: k, envId: u }, d, A, void 0, { ...v, "x-ul-video-recorder-origin": "sdk" }, t.mediaType === N.MEDIA_TYPE_AUDIO, h);
|
|
1336
1336
|
b.appendChild(w);
|
|
1337
1337
|
}
|
|
1338
|
-
} }) })] }), e(le, { children: [e(ve, { isDisabled: !!t.required && !C, onClick: m, children: re(t) }), e("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:
|
|
1338
|
+
} }) })] }), e(le, { children: [e(ve, { isDisabled: !!t.required && !C, onClick: m, children: re(t) }), e("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: Be(t) })] })] });
|
|
1339
1339
|
}, yn = (n) => n.type === "thanks" || n.type === "uploading", pt = ({ card: n, avatars: o, isThinking: t, isCurrentQuestion: r, currentQuestionBubbleRef: i }) => {
|
|
1340
1340
|
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 })(n);
|
|
1341
|
-
return e(ge, { avatars: o, isLeft: !0, message: { id: `question-${n.name}`, type: "question", content: s.content }, ref: r ? i : null, children: t ? e(dt, {}) : e(
|
|
1341
|
+
return e(ge, { avatars: o, isLeft: !0, message: { id: `question-${n.name}`, type: "question", content: s.content }, ref: r ? i : null, children: t ? e(dt, {}) : e(Ee, { children: [s.isHtml ? e(ye, { className: "chat-message-text", html: s.content }) : e("div", { className: "chat-message-text", children: s.content }), n.type === "videovoice" && e(An, { properties: n.props, questionId: n.name, surveyVideoUrl: n.props.properties.videoUrl })] }) });
|
|
1342
1342
|
}, vt = ({ card: n, avatars: o }) => {
|
|
1343
1343
|
const t = ((r) => {
|
|
1344
1344
|
if (!("properties" in r.props) || !r.props.properties || typeof r.props.properties != "object") return null;
|
|
@@ -1362,11 +1362,13 @@ const hn = "ul-permission-graphics-container", gn = "ul-permission-body", bn = O
|
|
|
1362
1362
|
return e("div", { className: "chat-bubble-container chat-right", children: [e("div", { className: "chat-bubble chat-bubble-right chat-bubble-text-only", children: e("div", { className: "chat-message-text", children: r || e("div", { className: "chat-message-no-response", children: "No response" }) }) }), e("img", { alt: "User Avatar", className: "chat-avatar chat-avatar-right", srcSet: `${t.respondentAvatar["1x"]} 1x, ${t.respondentAvatar["2x"]} 2x` })] });
|
|
1363
1363
|
}, ht = ({ card: n, avatars: o, isCurrentQuestion: t, currentQuestionBubbleRef: r }) => {
|
|
1364
1364
|
const { endCard: i } = G((s) => ({ endCard: s.endCard }));
|
|
1365
|
-
return e(
|
|
1365
|
+
return e(Ee, { children: [e(ge, { avatars: o, isLeft: !0, message: { id: `thanks-${n.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) && e(ge, { avatars: o, hideAvatar: !0, isLeft: !0, message: { id: `caption-${n.name}`, type: "question", content: i.subheader } }), e(Hn, {})] });
|
|
1366
1366
|
}, gt = ({ card: n, cardIndex: o, index: t, avatars: r, cardResponses: i, questionThinkingStates: s, startingQuestionIdx: d, currentQuestionBubbleRef: u, handleCardResponse: a }) => {
|
|
1367
1367
|
const v = o === t, y = o < t, c = yn(n);
|
|
1368
1368
|
if (c) return e(ht, { avatars: r, card: n, currentQuestionBubbleRef: u, isCurrentQuestion: v });
|
|
1369
|
-
const h = `${n.name}`, k = i.get(h), C = n.type === "open", g = s.get(h)
|
|
1369
|
+
const h = `${n.name}`, k = i.get(h), C = n.type === "open", g = s.get(h);
|
|
1370
|
+
if (n.type === "aidynamicfollowup" && (n.props.loading === null || n.props.loading === void 0)) return e(Ee, {});
|
|
1371
|
+
const f = o > (d ?? 0) && n.type !== "thanks" && n.type !== "uploading" && (g === !0 || g === void 0);
|
|
1370
1372
|
return e(nn.Fragment, { children: [e(pt, { avatars: r, card: n, currentQuestionBubbleRef: u, isCurrentQuestion: v, isThinking: f }), !f && e(vt, { avatars: r, card: n }), y && C ? e(mt, { avatars: r, card: n, userResponse: k }) : (!y || !C) && !f && e(ge, { avatars: r, isLeft: !1, message: { id: `card-${n.name}`, type: "card", content: "" }, children: e("div", { className: "chat-card-container", children: e(ft, { card: n, className: c ? "chat-thanks-card" : "chat-card", isAnswered: y, next: v ? a : () => {
|
|
1371
1373
|
} }) }) })] }, `question-card-${n.name}`);
|
|
1372
1374
|
}, ge = nn.forwardRef(({ message: n, isLeft: o = !1, children: t, avatars: r, hideAvatar: i = !1 }, s) => {
|
|
@@ -1384,7 +1386,7 @@ const bt = () => {
|
|
|
1384
1386
|
} : o, questionId: n.name, type: n.type, isAnswered: r };
|
|
1385
1387
|
switch (n.type) {
|
|
1386
1388
|
case "consentlegal":
|
|
1387
|
-
return e(
|
|
1389
|
+
return e($n, { ...i, ...n.props });
|
|
1388
1390
|
case "likert":
|
|
1389
1391
|
return e(Fn, { ...i, ...n.props });
|
|
1390
1392
|
case "matrix":
|
|
@@ -1415,7 +1417,7 @@ const bt = () => {
|
|
|
1415
1417
|
}
|
|
1416
1418
|
}, kt = ({ cards: n, next: o, previousResponses: t }) => {
|
|
1417
1419
|
const { cardResponses: r, setCardResponse: i } = (() => {
|
|
1418
|
-
const [m, b] =
|
|
1420
|
+
const [m, b] = Q(/* @__PURE__ */ new Map());
|
|
1419
1421
|
return { cardResponses: m, setCardResponse: be((w, l) => {
|
|
1420
1422
|
b((p) => new Map(p).set(w, l));
|
|
1421
1423
|
}, []) };
|
|
@@ -1429,43 +1431,52 @@ const bt = () => {
|
|
|
1429
1431
|
}, []);
|
|
1430
1432
|
return { currentQuestionBubbleRef: b, scrollToCurrentQuestion: w };
|
|
1431
1433
|
})({ viewDocument: h }), _ = ((m, b, w) => {
|
|
1432
|
-
const [l, p] =
|
|
1434
|
+
const [l, p] = Q(/* @__PURE__ */ new Map());
|
|
1433
1435
|
return ue(() => {
|
|
1434
1436
|
if (m.length > 0 && b < m.length) {
|
|
1435
|
-
const x = m[b],
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1437
|
+
const x = m[b], D = `${x.name}`, j = (L) => L.type === "aidynamicfollowup", B = (L) => {
|
|
1438
|
+
var R;
|
|
1439
|
+
if (b > 0) {
|
|
1440
|
+
const F = m[b - 1];
|
|
1441
|
+
if (j(F)) {
|
|
1442
|
+
const Z = `${F.name}`, J = !!((R = F.props) != null && R.loading);
|
|
1443
|
+
if (L.get(Z) !== J) return new Map(L).set(Z, J);
|
|
1444
|
+
}
|
|
1445
|
+
}
|
|
1446
|
+
return L;
|
|
1447
|
+
};
|
|
1448
|
+
if (b <= (w ?? 0) || yn(x)) return p((L) => B(new Map(L).set(D, !1)));
|
|
1449
|
+
p((L) => {
|
|
1450
|
+
const R = !j(x) || !!x.props.loading;
|
|
1451
|
+
return B(new Map(L).set(D, R));
|
|
1441
1452
|
});
|
|
1442
|
-
const
|
|
1443
|
-
p((
|
|
1444
|
-
const
|
|
1445
|
-
return new Map(
|
|
1453
|
+
const Y = setTimeout(() => {
|
|
1454
|
+
p((L) => {
|
|
1455
|
+
const R = !!j(x) && !!x.props.loading;
|
|
1456
|
+
return B(new Map(L).set(D, R));
|
|
1446
1457
|
});
|
|
1447
1458
|
}, 1e3);
|
|
1448
|
-
return () => clearTimeout(
|
|
1459
|
+
return () => clearTimeout(Y);
|
|
1449
1460
|
}
|
|
1450
1461
|
}, [b, m, w]), l;
|
|
1451
|
-
})(n, s, c),
|
|
1452
|
-
const [w, l] =
|
|
1462
|
+
})(n, s, c), q = ((m, b) => {
|
|
1463
|
+
const [w, l] = Q(() => /* @__PURE__ */ new Set([m]));
|
|
1453
1464
|
return ue(() => {
|
|
1454
1465
|
l((p) => new Set(p).add(m));
|
|
1455
1466
|
}, [m]), ue(() => {
|
|
1456
1467
|
const p = b ?? 0;
|
|
1457
1468
|
p > 0 && l((x) => {
|
|
1458
|
-
const
|
|
1459
|
-
for (let
|
|
1460
|
-
return
|
|
1469
|
+
const D = new Set(x);
|
|
1470
|
+
for (let j = 0; j <= p; j++) D.add(j);
|
|
1471
|
+
return D;
|
|
1461
1472
|
});
|
|
1462
1473
|
}, [b]), w;
|
|
1463
|
-
})(s, c),
|
|
1474
|
+
})(s, c), M = fe(() => ({ ...t, ...ze(n.map((m, b) => {
|
|
1464
1475
|
var w, l;
|
|
1465
1476
|
return { ...m, value: b < s ? ((w = r.get(`${m.name}`)) == null ? void 0 : w.value) ?? null : null, secondaryValue: b < s ? ((l = r.get(`${m.name}`)) == null ? void 0 : l.secondaryValue) ?? null : null };
|
|
1466
1477
|
})) }), [t, r, n, s]);
|
|
1467
|
-
wn(
|
|
1468
|
-
const T = En(n,
|
|
1478
|
+
wn(M);
|
|
1479
|
+
const T = En(n, M);
|
|
1469
1480
|
ue(() => {
|
|
1470
1481
|
requestAnimationFrame(() => {
|
|
1471
1482
|
f();
|
|
@@ -1479,11 +1490,11 @@ const bt = () => {
|
|
|
1479
1490
|
i(l, m);
|
|
1480
1491
|
const p = { ...m, questionText: In(w) };
|
|
1481
1492
|
if (w.childId && (p == null ? void 0 : p.value) != null) {
|
|
1482
|
-
const x = ze([w].map((
|
|
1493
|
+
const x = ze([w].map((D) => ({ ...D, value: (p == null ? void 0 : p.value) ?? null, secondaryValue: (p == null ? void 0 : p.secondaryValue) ?? null })));
|
|
1483
1494
|
k({ parentQuestionId: w.name, parentResponseConfig: x });
|
|
1484
1495
|
}
|
|
1485
1496
|
o([p]);
|
|
1486
|
-
}, [T, s, o, i]), A = T.map((m, b) => ({ card: m, cardIndex: b })).filter(({ cardIndex: m }) =>
|
|
1497
|
+
}, [T, s, o, i]), A = T.map((m, b) => ({ card: m, cardIndex: b })).filter(({ cardIndex: m }) => q.has(m));
|
|
1487
1498
|
return e("div", { className: "conversational-ui ul-conversational-ui", "data-testid": "ui-container", children: [!d && e(bt, {}), e("div", { className: "chat-container", children: e("div", { className: "chat-messages", children: A.map(({ card: m, cardIndex: b }) => e(gt, { avatars: u, card: m, cardIndex: b, cardResponses: r, currentQuestionBubbleRef: g, handleCardResponse: $, index: s, questionThinkingStates: _, startingQuestionIdx: c }, `question-card-${m.name}`)) }) }), d && e("div", { className: "long-form-question-footer-container-logo", children: a && e(jn, { forceBrandedLogo: v, marketingUrlLink: y }) })] });
|
|
1488
1499
|
};
|
|
1489
1500
|
export {
|