@sprig-technologies/sprig-bundled 2.40.2 → 2.40.3
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-ui-oskPaA1b.js → conversational-ui-BXidfSdu.js} +60 -60
- package/dist/{conversational-ui-DUgGocRX.cjs → conversational-ui-DUGOWcXj.cjs} +2 -2
- package/dist/{getAttributedUrl-Dau8Mte7.js → getAttributedUrl-B28r1ayG.js} +2 -2
- package/dist/{getAttributedUrl-B6G-AN3n.cjs → getAttributedUrl-C_nBQU9-.cjs} +1 -1
- package/dist/{index-DvlRB1H9.js → index-B-1ZVEfz.js} +3 -3
- package/dist/{index-psiaNxU5.cjs → index-B0SmBCWR.cjs} +2 -2
- package/dist/{index-CgSXZvlF.js → index-BM-ZKnlM.js} +3 -3
- package/dist/{index-Bqy7-zt9.cjs → index-DuLz6-LB.cjs} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{view-xk7U3_Is.js → view-CwyS6VJ8.js} +3 -3
- package/dist/{view-CdZUxdsw.cjs → view-IVflCEcd.cjs} +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { u as z, a as e, h as G, c as A, g as K, b as
|
|
2
|
-
import { v as En, E as Ie, h as qe, A as Ue, j as jn, i as nn } from "./index-
|
|
3
|
-
import { B as
|
|
1
|
+
import { u as z, a as e, h as G, c as A, g as K, b as re, d as Me, p as ue, F as fe, _ as se, T as be, A as yn, e as Be, f as Cn, i as xn, j as kn, w as en, k as wn } from "./view-CwyS6VJ8.js";
|
|
2
|
+
import { v as En, E as Ie, h as qe, A as Ue, j as jn, i as nn } from "./index-B-1ZVEfz.js";
|
|
3
|
+
import { B as oe, M as ie, Q as le, O as Oe, a as de, b as Ce, S as In, L as Tn, u as _n, H as ye, c as Ae, g as Dn, P as Sn } from "./getAttributedUrl-B28r1ayG.js";
|
|
4
4
|
const pe = "https://cdn.sprig.com", I = { document: void 0, videojs: void 0 }, He = (n) => n + "-loading-spiner", W = "hidden", ze = ".m3u8", Te = "questionId", _e = "ul-video-recorder-camera-off-button", De = "ul-recording-in-session", Pn = [{ 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` }], tn = [{ 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;
|
|
@@ -660,13 +660,13 @@ span.ul-button-text {
|
|
|
660
660
|
}
|
|
661
661
|
` }], rn = "-video-player", Ge = "-secondary-video-player", Ze = "-video-recorder";
|
|
662
662
|
let ne, Qe;
|
|
663
|
-
const
|
|
663
|
+
const ce = async ({ event: n, apiBase: o, headers: t, visitorId: r, envId: i, metadata: a }) => {
|
|
664
664
|
const d = I.document.documentElement;
|
|
665
665
|
if (!r || !i) return;
|
|
666
666
|
const u = { event: `SDK - ${n}`, visitorId: r, environmentId: i, metadata: { ...a || {}, 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
|
-
},
|
|
669
|
-
|
|
668
|
+
}, ae = async (n, o, t, r, i, a) => {
|
|
669
|
+
ce({ event: `Video Error ${o}`, apiBase: t, headers: r, visitorId: i, envId: a, metadata: { errorMessage: n.message } });
|
|
670
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 }, s = { action: o, err: { message: n.message, stack: n.stack }, meta: u, vid: i, envId: a };
|
|
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(s) })).ok || console.warn("[Sprig] (ERR-444) Failed to report error to API", n);
|
|
672
672
|
}, on = (n, o) => {
|
|
@@ -743,7 +743,7 @@ const de = async ({ event: n, apiBase: o, headers: t, visitorId: r, envId: i, me
|
|
|
743
743
|
S.enabled = !0;
|
|
744
744
|
}), s.children()[0].classList.remove("vjs-hidden"), s.record().getDevice(), f.removeClass(j), f.addClass(h), O.innerHTML = X.TurnOffCamera, s.audioPlayerPlaceholder.addClass("vjs-hidden"));
|
|
745
745
|
}, g = new (I.videojs.getComponent("Button"))(s, { clickHandler: () => {
|
|
746
|
-
g.hasClass(W) || (
|
|
746
|
+
g.hasClass(W) || (ce({ event: "Video Delete Button Clicked", apiBase: r, headers: d, visitorId: v, envId: x, metadata: { questionId: b, responseGroupUid: c, surveyId: p } }), m(s.cameraOff), i(L.DELETE, {}), f.removeClass(W), g.addClass(W));
|
|
747
747
|
} });
|
|
748
748
|
g.addClass("ul-video-recorder-delete-button"), g.el_.appendChild(xe(X.DeleteButton, "ul-delete-button"));
|
|
749
749
|
const _ = I.document.getElementById(o), M = () => {
|
|
@@ -751,7 +751,7 @@ const de = async ({ event: n, apiBase: o, headers: t, visitorId: r, envId: i, me
|
|
|
751
751
|
};
|
|
752
752
|
M();
|
|
753
753
|
const f = new (I.videojs.getComponent("Button"))(s, { clickHandler: () => {
|
|
754
|
-
s.record().isRecording() || (s.cameraOff = !s.cameraOff,
|
|
754
|
+
s.record().isRecording() || (s.cameraOff = !s.cameraOff, ce({ event: "Video Camera Button Clicked", apiBase: r, headers: d, visitorId: t.visitorId, envId: t.envId, metadata: { questionId: b, responseGroupUid: c, surveyId: p, cameraOff: s.cameraOff } }), m(s.cameraOff), !g.hasClass(W) && g.addClass(W), i(L.DELETE, {}), M());
|
|
755
755
|
} });
|
|
756
756
|
f.addClass(_e), f.el_.appendChild(xe(X.TurnOffCamera, "ul-camera-button"));
|
|
757
757
|
const y = new (I.videojs.getComponent("Button"))(s, { clickHandler: () => {
|
|
@@ -780,21 +780,21 @@ const de = async ({ event: n, apiBase: o, headers: t, visitorId: r, envId: i, me
|
|
|
780
780
|
}), ((l, h, j, O, S) => {
|
|
781
781
|
const { surveyId: q, responseGroupUid: Q, visitorId: H, envId: U } = 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"), j && j(L.ERROR, { type: L.PERMISSION_DENIED }),
|
|
783
|
+
console.warn("device error: ", l.deviceErrorCode), l.deviceErrorCode.message === "Permission denied" ? (l.deviceButton.addClass("permission-denied"), j && j(L.ERROR, { type: L.PERMISSION_DENIED }), ce({ event: "Video Permission Denied", apiBase: h, headers: S, visitorId: H, envId: U, metadata: { questionId: Se(l, Te), responseGroupUid: Q, surveyId: q } })) : (j && j(L.ERROR, { type: L.OTHER }), ae(new Error(l.deviceErrorCode.message), "recorderDeviceError", h, S, H, U));
|
|
784
784
|
}), l.on("error", function(Z, Y) {
|
|
785
|
-
|
|
785
|
+
ae(Y || l.error(), "recorderError", h, S, H, U);
|
|
786
786
|
}), l.on("startRecord", function(Z, Y) {
|
|
787
|
-
O(l.uploadProgressLabel, "none"),
|
|
787
|
+
O(l.uploadProgressLabel, "none"), ce({ event: "Video Record Start", apiBase: h, headers: S, visitorId: H, envId: U, metadata: { questionId: Se(l, Te), responseGroupUid: Q, surveyId: q } });
|
|
788
788
|
}), l.on("finishRecord", async function() {
|
|
789
789
|
O(l.uploadProgressLabel, "start", 0);
|
|
790
790
|
const Z = Se(l, Te);
|
|
791
791
|
if (!q) {
|
|
792
792
|
const P = "internal error: missing fields in payload";
|
|
793
|
-
return j && j(L.ERROR, { type: L.OTHER }),
|
|
793
|
+
return j && j(L.ERROR, { type: L.OTHER }), ae(new Error(P), "finishRecord", h, S, H, U), null;
|
|
794
794
|
}
|
|
795
795
|
l.record().stopDevice();
|
|
796
796
|
const Y = l.cameraOff ? L.MEDIA_TYPE_AUDIO : L.MEDIA_TYPE_VIDEO, ee = En();
|
|
797
|
-
|
|
797
|
+
ce({ event: "Video Record Finish", apiBase: h, headers: S, visitorId: H, envId: U, metadata: { mediaRecordingUid: ee, questionId: Z, responseGroupUid: Q, surveyId: q, mediaType: Y } });
|
|
798
798
|
const me = { surveyId: q, updatedAt: (/* @__PURE__ */ new Date()).toISOString(), mediaType: Y, mediaRecordingUid: ee };
|
|
799
799
|
Z && (me.questionId = Z), Q && (me.responseGroupUid = Q), H && (me.visitorId = H);
|
|
800
800
|
const E = await (async () => {
|
|
@@ -803,14 +803,14 @@ const de = async ({ event: n, apiBase: o, headers: t, visitorId: r, envId: i, me
|
|
|
803
803
|
const B = await P.json();
|
|
804
804
|
return j && j(L.UPLOAD_STARTED, { [L.UPLOAD_ID]: B.upload.id, [L.MEDIA_TYPE]: Y, [L.MEDIA_RECORDING_UID]: ee }), B.upload.url;
|
|
805
805
|
}
|
|
806
|
-
return j && j(L.ERROR, { type: L.OTHER, response: P }),
|
|
806
|
+
return j && j(L.ERROR, { type: L.OTHER, response: P }), ae(new Error("failed to get upload response with url"), "finishRecord", h, S, H, U), 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(),
|
|
809
|
-
O(l.uploadProgressLabel, "none"), j && j(L.UPLOAD_FINISHED, { [L.MEDIA_RECORDING_UID]: ee }),
|
|
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(), ce({ event: "Video Upload Start", apiBase: h, headers: S, visitorId: H, envId: U, metadata: { mediaRecordingUid: ee, questionId: Z, responseGroupUid: Q, surveyId: q, mediaType: Y, url: E } }), ne.on("error", (P) => {
|
|
809
|
+
O(l.uploadProgressLabel, "none"), j && j(L.UPLOAD_FINISHED, { [L.MEDIA_RECORDING_UID]: ee }), ae(P, "finishRecord", h, S, H, U);
|
|
810
810
|
}), ne.on("progress", (P) => {
|
|
811
811
|
j && j(L.UPLOAD_PROGRESS, { [L.MEDIA_RECORDING_UID]: ee, [L.UPLOAD_PROGRESS_PCT]: P.detail }), O(l.uploadProgressLabel, "progress", P.detail);
|
|
812
812
|
}), ne.on("success", () => {
|
|
813
|
-
O(l.uploadProgressLabel, "success"), j && j(L.UPLOAD_FINISHED, { [L.MEDIA_RECORDING_UID]: ee }),
|
|
813
|
+
O(l.uploadProgressLabel, "success"), j && j(L.UPLOAD_FINISHED, { [L.MEDIA_RECORDING_UID]: ee }), ce({ event: "Video Upload Success", apiBase: h, headers: S, visitorId: H, envId: U, metadata: { mediaRecordingUid: ee, questionId: Z, responseGroupUid: Q, surveyId: q, mediaType: Y, url: E, elapsedMs: ne.startTime && Date.now() - ne.startTime } });
|
|
814
814
|
}));
|
|
815
815
|
});
|
|
816
816
|
})(s, r, i, Ye, d);
|
|
@@ -849,7 +849,7 @@ const de = async ({ event: n, apiBase: o, headers: t, visitorId: r, envId: i, me
|
|
|
849
849
|
I.document = a;
|
|
850
850
|
const s = n + rn, p = dn(s);
|
|
851
851
|
return I.document.addEventListener("securitypolicyviolation", (b) => {
|
|
852
|
-
|
|
852
|
+
ae(new Error(`Voice & Video feature violates ${b.violatedDirective} web page CSP policies for the question player.`), "playerDeviceError", i, {});
|
|
853
853
|
}), on(tn, () => {
|
|
854
854
|
I.document.getElementById(He(s)).remove(), Pe(s, p);
|
|
855
855
|
const b = { playsinline: !0, playbackRates: [0.5, 1, 1.5, 2], fill: !0 };
|
|
@@ -866,7 +866,7 @@ const de = async ({ event: n, apiBase: o, headers: t, visitorId: r, envId: i, me
|
|
|
866
866
|
const C = sn(v, ["PlaybackRateMenuButton", "PlayToggle", "FullscreenToggle"]), m = C.children().find((g) => g.name_ === "FullscreenToggle");
|
|
867
867
|
m.hasClass("vjs-disabled") && m.hide(), an(v, C, o, t, r, x);
|
|
868
868
|
} catch (c) {
|
|
869
|
-
return void
|
|
869
|
+
return void ae(new Error(`Error when creating video player object ${c}`), "playerDeviceError", i, {});
|
|
870
870
|
}
|
|
871
871
|
}), p;
|
|
872
872
|
}, Bn = (n) => {
|
|
@@ -882,7 +882,7 @@ const de = async ({ event: n, apiBase: o, headers: t, visitorId: r, envId: i, me
|
|
|
882
882
|
d.appendChild(u);
|
|
883
883
|
}
|
|
884
884
|
} });
|
|
885
|
-
}, ve = ({ isDisabled: n, onClick: o, children: t }) => e(
|
|
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"] }), Un = ({ className: n, next: o, properties: t, questionId: r, type: i }) => {
|
|
886
886
|
const { useMobileStyling: a, border: d } = z((y) => ({ useMobileStyling: y.useMobileStyling, border: y.border })), [u, s] = G(!1), [p, b] = G(""), [c, v] = G(!1), x = t == null ? void 0 : t.collectName, C = (t == null ? void 0 : t.nameLabelText) || "Full Name", m = (t == null ? void 0 : t.consentText) || "I agree to the stated conditions", g = (t == null ? void 0 : t.submitButtonText) || "Submit", _ = !!p.trim(), M = u && (!x || _), f = (y, R = !1) => {
|
|
887
887
|
y.preventDefault(), y.stopPropagation();
|
|
888
888
|
let D = null;
|
|
@@ -892,7 +892,7 @@ const de = async ({ event: n, apiBase: o, headers: t, visitorId: r, envId: i, me
|
|
|
892
892
|
}
|
|
893
893
|
o({ value: D, questionId: r, type: i }, !!R || M);
|
|
894
894
|
};
|
|
895
|
-
return e("div", { className: A(n, "ul-card__consent-legal", "fade-in-transition"), children: e(
|
|
895
|
+
return e("div", { className: A(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: m, onUserInputChanged: ({ selected: y }) => {
|
|
896
896
|
y !== u && s(!u);
|
|
897
897
|
}, useMobileStyling: a }), x && e("input", { "aria-label": C, "aria-placeholder": C, className: A(K("ul-consent-legal__name-input", a)), "data-gramm": "false", maxLength: 250, name: "name", onBlur: (y) => {
|
|
898
898
|
y.currentTarget.style.borderColor = c && !_ ? Ie : qe;
|
|
@@ -900,10 +900,10 @@ const de = async ({ event: n, apiBase: o, headers: t, visitorId: r, envId: i, me
|
|
|
900
900
|
y.currentTarget.style.borderColor = c && !_ ? Ie : d;
|
|
901
901
|
}, onInput: (y) => {
|
|
902
902
|
y.preventDefault(), y.stopPropagation(), b(y.currentTarget.value);
|
|
903
|
-
}, placeholder: C, style: c && !_ ? { borderColor: Ie } : {}, tabIndex: 0, value: p })] }), e("div", { className: "ul-card__button-wrapper ul-card-vertical__button-wrapper", children: [e(ve, { isDisabled: !M, onClick: (y) => f(new SubmitEvent(y.type)), children:
|
|
903
|
+
}, placeholder: C, style: c && !_ ? { borderColor: Ie } : {}, tabIndex: 0, value: p })] }), e("div", { className: "ul-card__button-wrapper ul-card-vertical__button-wrapper", children: [e(ve, { isDisabled: !M, onClick: (y) => f(new SubmitEvent(y.type)), children: re({ buttonText: g }) }), t.required === !1 && e("button", { className: "ul-card-skip__button", onClick: (y) => f(new SubmitEvent(y.type), !0), children: Me(t) })] })] }) }) }, r);
|
|
904
904
|
}, On = () => {
|
|
905
905
|
const { destroy: n, forceBrandedLogo: o } = z((t) => ({ destroy: t.destroy, forceBrandedLogo: t.forceBrandedLogo }));
|
|
906
|
-
return
|
|
906
|
+
return ue(() => {
|
|
907
907
|
setTimeout(() => {
|
|
908
908
|
n(Ue);
|
|
909
909
|
}, o ? 4e3 : 2e3);
|
|
@@ -956,12 +956,12 @@ const de = async ({ event: n, apiBase: o, headers: t, visitorId: r, envId: i, me
|
|
|
956
956
|
return String(w + 1);
|
|
957
957
|
}
|
|
958
958
|
};
|
|
959
|
-
return e("form", { className: A(n, "ul-card--likert", "fade-in-transition"), children: e(
|
|
959
|
+
return e("form", { className: A(n, "ul-card--likert", "fade-in-transition"), children: e(ie, { properties: r, children: [e(de, { children: [e("div", { "aria-label": `Rating (1 - ${D})`, className: "ul-card--likert__numbers", role: "radiogroup", children: [...Array(D)].map((w, T) => {
|
|
960
960
|
const l = T + 1;
|
|
961
961
|
return e(An, { activeValue: b, border: d, enableCspTrustedTypes: p, icon: k(T), isPressed: v, range: D, scaleLabelType: y, selectedValue: C, setActiveValue: c, setIsPressed: x, setSelectedValue: m, useMobileStyling: u, value: l, viewDocument: s }, T);
|
|
962
|
-
}) }), e("div", { className: "ul-card--likert__labels", children: [e("span", { children: g }), e("span", { children: _ })] })] }), e(
|
|
962
|
+
}) }), e("div", { className: "ul-card--likert__labels", children: [e("span", { children: g }), e("span", { children: _ })] })] }), e(le, { children: e(ve, { isDisabled: C === null && r.required, onClick: () => t({ value: C, questionId: i, type: a }, !0), children: re(r) }) })] }) }, i);
|
|
963
963
|
}, $n = ({ columns: n, onSelect: o, options: t, selectedOptions: r }) => {
|
|
964
|
-
const i =
|
|
964
|
+
const i = se([]), { border: a, useMobileStyling: d } = z((v) => ({ border: v.border, useMobileStyling: v.useMobileStyling })), u = t.findIndex((v) => r[v.id] === null), [s, p] = G(u), b = be((v, x) => {
|
|
965
965
|
o(v, x);
|
|
966
966
|
const C = s + 1, m = t[C];
|
|
967
967
|
m && r[m.id] === null && p(C);
|
|
@@ -979,9 +979,9 @@ const de = async ({ event: n, apiBase: o, headers: t, visitorId: r, envId: i, me
|
|
|
979
979
|
const u = r.matrixColumn, s = r.required, p = (C) => {
|
|
980
980
|
C.preventDefault(), C.stopPropagation(), o({ value: c, questionId: i, type: a }, !0), d && d();
|
|
981
981
|
}, b = t.reduce((C, m) => (C[m.id] = null, C), {}), [c, v] = G(b);
|
|
982
|
-
return e("form", { className: A(n, "ul-card__matrix", "fade-in-transition"), id: "text-form", onSubmit: p, children: e(
|
|
982
|
+
return e("form", { className: A(n, "ul-card__matrix", "fade-in-transition"), id: "text-form", onSubmit: p, children: e(ie, { properties: r, children: [e(de, { children: e($n, { columns: u, onSelect: (C, m) => {
|
|
983
983
|
v((g) => ({ ...g, [C]: m }));
|
|
984
|
-
}, options: t, selectedOptions: c }) }), e(
|
|
984
|
+
}, options: t, selectedOptions: c }) }), e(le, { children: e(ve, { isDisabled: (x = c, s && Object.values(x).every((C) => C == null)), onClick: () => p(new SubmitEvent("submit")), children: re(r) }) })] }) }, i);
|
|
985
985
|
var x;
|
|
986
986
|
}, cn = ({ className: n, onSubmit: o, options: t = [], properties: r, questionId: i, type: a, showIndividualSubmit: d = !1, onSubmitButtonClick: u }) => {
|
|
987
987
|
const { border: s, useMobileStyling: p } = z((l) => ({ border: l.border, useMobileStyling: l.useMobileStyling })), b = t.reduce((l, h) => (l[h.id] = { isSelected: !1 }, l), {}), [c, v] = G(b), x = a === "multiplechoice", C = r.required, m = t.find((l) => {
|
|
@@ -1017,7 +1017,7 @@ const de = async ({ event: n, apiBase: o, headers: t, visitorId: r, envId: i, me
|
|
|
1017
1017
|
else m && !O && c[m.id].isSelected && (S[m.id].isSelected = !1);
|
|
1018
1018
|
S[l] = { isSelected: h, userText: j }, v(S);
|
|
1019
1019
|
};
|
|
1020
|
-
return e("form", { className: A(n, "ul-card--multiple", "fade-in-transition"), id: "text-form", onSubmit: w, children: e(
|
|
1020
|
+
return e("form", { className: A(n, "ul-card--multiple", "fade-in-transition"), id: "text-form", onSubmit: w, children: e(ie, { properties: r, children: [e(de, { children: [r.isDropdown ? e(In, { disabledOptions: t.filter((l) => k(l.id)), dropdownFooter: M ? e("div", { className: "ul-card__min-select-counter", style: { marginLeft: "16px" }, children: [_(c), "/", r.minSelect] }) : void 0, isMultiSelect: !x, multiselectText: r.dropdownMultiselectedText ?? "choices selected", onChange: (l) => {
|
|
1021
1021
|
const h = { ...c };
|
|
1022
1022
|
for (const j of t) l.includes(j) ? h[j.id].isSelected = !0 : h[j.id].isSelected = !1;
|
|
1023
1023
|
v(h);
|
|
@@ -1026,7 +1026,7 @@ const de = async ({ event: n, apiBase: o, headers: t, visitorId: r, envId: i, me
|
|
|
1026
1026
|
const S = `${l}`, { allowsTextEntry: q, noneOfTheAbove: Q } = { allowsTextEntry: !1, noneOfTheAbove: !1, ...O };
|
|
1027
1027
|
return e(Oe, { allowTextEntry: q, border: s, disabled: k(S), error: (H = c, g(H)), id: S, isRadio: x, isSelected: !!((U = c[S]) != null && U.isSelected), label: h, noneOfTheAbove: Q, onUserInputChanged: D, promptText: "Please specify", text: (Z = c[l]) == null ? void 0 : Z.userText, useMobileStyling: p, value: j }, S);
|
|
1028
1028
|
var H;
|
|
1029
|
-
}), !!M && e("div", { className: "ul-card__min-select-counter", children: [_(c), "/", r.minSelect] })] }), R && e(Tn, { handleSubmit: w, isSubmitDisabled: f(c) })] }), e(
|
|
1029
|
+
}), !!M && e("div", { className: "ul-card__min-select-counter", children: [_(c), "/", r.minSelect] })] }), R && e(Tn, { handleSubmit: w, isSubmitDisabled: f(c) })] }), e(le, { children: e(ve, { isDisabled: f(c), onClick: w, children: re(r) }) })] }) }, i);
|
|
1030
1030
|
}, Fn = (n) => {
|
|
1031
1031
|
const { questionId: o, type: t, next: r, options: i } = n;
|
|
1032
1032
|
return e(cn, { ...n, onSubmit: (a, d) => {
|
|
@@ -1045,7 +1045,7 @@ const de = async ({ event: n, apiBase: o, headers: t, visitorId: r, envId: i, me
|
|
|
1045
1045
|
} });
|
|
1046
1046
|
}, Gn = ({ className: n, labels: o, properties: t, next: r, questionId: i, type: a }) => {
|
|
1047
1047
|
const [d, u] = G(null), { border: s, useMobileStyling: p, viewDocument: b } = z((x) => ({ border: x.border, useMobileStyling: x.useMobileStyling, viewDocument: x.viewDocument })), c = o && o.left, v = o && o.right;
|
|
1048
|
-
return e("form", { className: A(n, "ul-card--nps", "fade-in-transition"), children: e(
|
|
1048
|
+
return e("form", { className: A(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((x, C) => e("button", { className: A(K("nps-number", p), K(`nps-number-${C}`, p)), id: `option-${C}`, onClick: (m) => {
|
|
1049
1049
|
m.preventDefault(), m.stopPropagation(), u(C);
|
|
1050
1050
|
}, onKeyDown: (m) => {
|
|
1051
1051
|
var _, M;
|
|
@@ -1055,23 +1055,23 @@ const de = async ({ event: n, apiBase: o, headers: t, visitorId: r, envId: i, me
|
|
|
1055
1055
|
m.currentTarget.style.zIndex = "2", m.currentTarget.style.borderColor = s;
|
|
1056
1056
|
}, onPointerLeave: (m) => {
|
|
1057
1057
|
m.currentTarget.style.zIndex = "auto", m.currentTarget.style.borderColor = qe;
|
|
1058
|
-
}, style: d === C ? { backgroundColor: s, color: "#fff" } : void 0, tabIndex: 0, children: C }, C)) }), e("div", { className: "ul-card--nps__labels", children: [e("span", { children: c }), e("span", { children: v })] })] }), e(
|
|
1058
|
+
}, style: d === C ? { backgroundColor: s, color: "#fff" } : void 0, tabIndex: 0, children: C }, C)) }), e("div", { className: "ul-card--nps__labels", children: [e("span", { children: c }), e("span", { children: v })] })] }), e(le, { children: e(ve, { isDisabled: d === null && t.required, onClick: () => r({ value: d, questionId: i, type: a }, !0), children: re(t) }) })] }) }, i);
|
|
1059
1059
|
}, Zn = ({ className: n, next: o, properties: t, questionId: r, type: i, onSubmitButtonClick: a }) => {
|
|
1060
|
-
const { border: d, useMobileStyling: u, update: s } = z((g) => ({ border: g.border, useMobileStyling: g.useMobileStyling, update: g.update })), [p, b] = G(""), c =
|
|
1061
|
-
return e("form", { className: A(n, "ul-card-text", "fade-in-transition"), id: "text-form", children: e(
|
|
1060
|
+
const { border: d, useMobileStyling: u, update: s } = z((g) => ({ border: g.border, useMobileStyling: g.useMobileStyling, update: g.update })), [p, b] = G(""), c = se(null), v = p.trim(), x = t.required === !0 && !v, C = _n(c, () => s()), m = t && t.openTextPlaceholder ? t.openTextPlaceholder : "";
|
|
1061
|
+
return e("form", { className: A(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": m, className: A(K("ul-card-text__input", u)), "data-gramm": "false", maxLength: 5e3, name: "text", onBlur: (g) => {
|
|
1062
1062
|
g.currentTarget.style.borderColor = qe;
|
|
1063
1063
|
}, onChange: (g) => {
|
|
1064
1064
|
const { value: _ } = g.currentTarget;
|
|
1065
1065
|
C(), g.preventDefault(), g.stopPropagation(), b(_);
|
|
1066
1066
|
}, onFocus: (g) => {
|
|
1067
1067
|
g.currentTarget.style.borderColor = d;
|
|
1068
|
-
}, placeholder: m, ref: c, role: "textbox", tabIndex: 0 }) }), t.footerHtml && e(ye, { className: "footer", html: t.footerHtml })] }), e(
|
|
1068
|
+
}, placeholder: m, ref: c, role: "textbox", tabIndex: 0 }) }), t.footerHtml && e(ye, { className: "footer", html: t.footerHtml })] }), e(le, { children: e(ve, { isDisabled: x, onClick: (g) => {
|
|
1069
1069
|
g.preventDefault(), g.stopPropagation();
|
|
1070
1070
|
const _ = t.required !== !0 || v.length > 0;
|
|
1071
1071
|
o({ value: p, questionId: r, type: i }, _), a && a();
|
|
1072
|
-
}, children:
|
|
1072
|
+
}, children: re(t) }) })] }) }) }, r);
|
|
1073
1073
|
}, Qn = ({ className: n, labels: o, next: t, properties: r, questionId: i, type: a, onSubmitButtonClick: d, options: u }) => {
|
|
1074
|
-
const s =
|
|
1074
|
+
const s = se(null), p = se(0), b = se(0), c = se(null), v = se(!1), x = se([]), [C, m] = G(() => (r == null ? void 0 : r.required) === !0), [g, _] = G(() => u.map((E) => ({ ...E, rank: null }))), M = fe(() => Array.from({ length: u.length }, (E, P) => P + 1), [u.length]), { useMobileStyling: f, isPreview: y, headers: R } = z((E) => ({ useMobileStyling: E.useMobileStyling, isPreview: E.isPreview, headers: E.headers })), D = (R == null ? void 0 : R["userleap-platform"]) === "android", k = f && !y && !D, w = !k && !D, T = (E, P) => {
|
|
1075
1075
|
_((B) => {
|
|
1076
1076
|
const N = parseInt(P), V = B.map(($) => ({ ...$ }));
|
|
1077
1077
|
V.some(($) => $.rank == null) && V.forEach(($, he) => $.rank = he + 1);
|
|
@@ -1138,7 +1138,7 @@ const de = async ({ event: n, apiBase: o, headers: t, visitorId: r, envId: i, me
|
|
|
1138
1138
|
};
|
|
1139
1139
|
return e("form", { className: A(n, "ul-card-rank", "fade-in-transition"), onSubmit: (E) => {
|
|
1140
1140
|
E.preventDefault(), q(g), d && d();
|
|
1141
|
-
}, children: e(
|
|
1141
|
+
}, children: e(ie, { properties: r, children: e(Be, D ? { 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 - ", H] }) }), e("ol", { className: "ul-card-rank__list", children: g.map(({ id: E, label: P, rank: B }) => e("li", { className: "ul-card-rank__option", children: [e("select", { "aria-label": `Rank for ${P}`, className: A("ul-card-rank__select", B == null && "ul-card-rank__select--placeholder"), name: `rank[${E}]`, onChange: (N) => T(E, N.currentTarget.value), value: B ?? "", children: [B == null && e("option", { className: "ul-card-rank__select-option", disabled: !0, value: "", children: "-" }), M.map((N) => e("option", { className: "ul-card-rank__select-option", value: N, children: N }, `${N}-${i}`))] }), e("span", { children: P })] }, E)) }), e("div", { className: "ul-card-rank__labels", children: e("span", { children: [Z, " - ", U] }) })] }) }), 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 - ", H] }) }), e("ol", { className: "ul-card-rank__list", onDragOver: D ? void 0 : (E) => {
|
|
1142
1142
|
E.preventDefault(), E.dataTransfer && (E.dataTransfer.dropEffect = "move");
|
|
1143
1143
|
}, children: g.map(({ id: E, label: P, rank: B }, N) => {
|
|
1144
1144
|
return e("li", { className: "ul-card-rank__option", draggable: !!w || void 0, onDragEnd: w ? me : void 0, onDragEnter: w ? Y : void 0, onDragLeave: w ? ee : void 0, onDragStart: w ? (J = N, (F) => {
|
|
@@ -1150,7 +1150,7 @@ const de = async ({ event: n, apiBase: o, headers: t, visitorId: r, envId: i, me
|
|
|
1150
1150
|
s.current = null, (Fe = (he = F.currentTarget.closest(".ul-card-rank__list")) == null ? void 0 : he.querySelector(".is-dragging")) == null || Fe.classList.remove("is-dragging"), $ != null && $ !== V && S($, V);
|
|
1151
1151
|
}) : void 0, ref: (F) => x.current[N] = F, children: [e("select", { "aria-label": `Rank for ${P}`, className: A("ul-card-rank__select", B == null && "ul-card-rank__select--placeholder"), name: `rank[${E}]`, onChange: (F) => T(E, F.currentTarget.value), value: B ?? "", children: [B == null && e("option", { className: "ul-card-rank__select-option", disabled: !0, value: "", children: "-" }), M.map((F) => e("option", { className: "ul-card-rank__select-option", value: F, children: F }, F))] }), e("span", { children: P }), !D && e("button", { "aria-label": `Drag ${P} to reorder`, className: "ul-card-rank__drag-btn", onTouchEnd: k ? O : void 0, onTouchMove: k ? j : void 0, onTouchStart: k ? h(N) : 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
1152
|
var V, J;
|
|
1153
|
-
}) }), e("div", { className: "ul-card-rank__labels", children: e("span", { children: [Z, " - ", U] }) })] }) }), e(
|
|
1153
|
+
}) }), e("div", { className: "ul-card-rank__labels", children: e("span", { children: [Z, " - ", U] }) })] }) }), e(le, { children: e("div", { className: "ul-card__button-wrapper", children: e(oe, { disabled: C, children: re(r) }) }) })] }) }) }, i);
|
|
1154
1154
|
}, Re = 1, un = 2, pn = 3, we = (n) => n.type === "av_permission", We = (n) => n.type === "screen_permission", vn = (n, o) => n === void 0 ? Re : n ? ((t, r) => !(we(r) ? r.permissionDescriptors : []).includes("camera") || t.getVideoTracks().length > 0)(n, o) ? pn : Re : un, Ke = { avStream: null, currentPage: null, mediaRecordingUids: null, nextQuestion: () => {
|
|
1155
1155
|
}, passthroughData: void 0, recordingMediaTypes: void 0, screenPermissionRequested: !1, type: void 0 }, te = Cn((n) => ({ ...Ke, reset: () => {
|
|
1156
1156
|
n(Ke);
|
|
@@ -1205,9 +1205,9 @@ function $e({ pages: n, setIsRequestingPermission: o }) {
|
|
|
1205
1205
|
return;
|
|
1206
1206
|
}
|
|
1207
1207
|
}
|
|
1208
|
-
const mn = "ul-permission-graphics-container", hn = "ul-permission-body", gn = A(mn, "ul_recorded-task-inset-spacing"), Ee = A("ul-horizontal-button-container", "ul-horizontal-button-container-left"), bn = ({ richTextBody: n }) => e(ye, { className: "ul-rich-text-body", html: n, id: "ul-task-detail-container" }), je = ({ required: n, skipButtonText: o, bottom: t = !1 }) => n ? null : e(
|
|
1208
|
+
const mn = "ul-permission-graphics-container", hn = "ul-permission-body", gn = A(mn, "ul_recorded-task-inset-spacing"), Ee = A("ul-horizontal-button-container", "ul-horizontal-button-container-left"), bn = ({ richTextBody: n }) => e(ye, { className: "ul-rich-text-body", html: n, id: "ul-task-detail-container" }), je = ({ required: n, skipButtonText: o, bottom: t = !1 }) => n ? null : e(oe, { className: A(t && "ul-skip-button-below", "ul-button-inactive"), onClick: Le.bind(null, { status: "abandoned" }), children: o || "Skip" }), Ve = (n) => {
|
|
1209
1209
|
const { avStream: o, captureStream: t, recordingMediaTypes: r, updatePage: i } = te.getState(), a = (r == null ? void 0 : r.includes("audio")) || (r == null ? void 0 : r.includes("video"));
|
|
1210
|
-
|
|
1210
|
+
ue(() => {
|
|
1211
1211
|
const d = setInterval(() => {
|
|
1212
1212
|
a && o && !o.active ? i({ avStream: null, currentPage: n[0] }) : t && t.active || i({ captureStream: void 0, currentPage: n[a ? 1 : 0] });
|
|
1213
1213
|
}, 1e3);
|
|
@@ -1215,26 +1215,26 @@ const mn = "ul-permission-graphics-container", hn = "ul-permission-body", gn = A
|
|
|
1215
1215
|
}, [o, t, a, n, r, i]);
|
|
1216
1216
|
}, Yn = ({ content: n, pages: o, required: t }) => {
|
|
1217
1217
|
const { buttonText: r, skipButtonText: i, taskDetail: a } = n;
|
|
1218
|
-
return Ve(o), e("div", { className: "ul-task-page", children: [a && e(bn, { richTextBody: a }), e("div", { className: Ee, children: [e(
|
|
1218
|
+
return Ve(o), e("div", { className: "ul-task-page", children: [a && e(bn, { richTextBody: a }), e("div", { className: Ee, children: [e(oe, { onClick: $e.bind(null, { pages: o }), children: r }), e(je, { required: t, skipButtonText: i })] })] }, "start-task");
|
|
1219
1219
|
}, Wn = ({ 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(bn, { richTextBody: n.taskDetail }), e(
|
|
1221
|
+
return Ve(o), e("div", { className: "ul-task-page", children: [n.taskDetail && e(bn, { richTextBody: n.taskDetail }), e(ie, { properties: t, children: e("div", { className: Ee, children: [e(oe, { className: "ul-complete-task-button", onClick: Le.bind(null, { status: "completed" }), children: r }), e(oe, { className: A("ul-button-inactive"), onClick: Le.bind(null, { status: "given.up" }), children: i })] }) })] }, "complete-task");
|
|
1222
1222
|
}, Kn = ({ content: n, pages: o, required: t }) => {
|
|
1223
1223
|
const { buttonText: r, skipButtonText: i } = n, [a] = z((s) => [s.tabTitle]), [d, u] = G(!1);
|
|
1224
|
-
return e("div", { children: [e("div", { className: gn, children: [e("p", { style: { marginTop: "auto" }, children: n.selectTabText }), e("div", { className: "ul-select-tab-container", children: e("p", { className: hn, children: a }) })] }), e("div", { className: t ? "" : Ee, children: [e(
|
|
1224
|
+
return e("div", { children: [e("div", { className: gn, children: [e("p", { style: { marginTop: "auto" }, children: n.selectTabText }), e("div", { className: "ul-select-tab-container", children: e("p", { className: hn, children: a }) })] }), e("div", { className: t ? "" : Ee, children: [e(oe, { disabled: d, onClick: $e.bind(null, { pages: o, setIsRequestingPermission: u }), children: r }), e(je, { required: t, skipButtonText: i })] })] });
|
|
1225
1225
|
}, Jn = ({ content: n }) => e(ye, { className: A(mn, "ul_permission_svg_container", "ul_recorded-task-inset-spacing", "ul-center-horizontally"), html: n.svg }, "ul-permission-request-graphic"), Xn = ({ content: n, pages: o, required: t }) => {
|
|
1226
1226
|
const { permissionDeniedHeadline: r, permissionDeniedBody: i, skipButtonText: a, tryAgainButtonText: d } = n, u = we(o[0]) ? o[0] : null;
|
|
1227
|
-
return
|
|
1227
|
+
return ue(() => {
|
|
1228
1228
|
const s = setInterval(() => {
|
|
1229
1229
|
u !== null && Ne({ currentPage: u, pages: o });
|
|
1230
1230
|
}, 1e3);
|
|
1231
1231
|
return () => clearInterval(s);
|
|
1232
|
-
}, [u, o]), u ? e("div", { children: [e("div", { className: gn, children: e("p", { className: "ul-av-permission-denied-paragraph", children: [e("span", { className: "ul-av-permission-denied-headline", children: r }), e("span", { className: hn, children: i })] }) }), e("div", { className: Ee, children: [e(
|
|
1232
|
+
}, [u, o]), u ? e("div", { children: [e("div", { className: gn, children: e("p", { className: "ul-av-permission-denied-paragraph", children: [e("span", { className: "ul-av-permission-denied-headline", children: r }), e("span", { className: hn, children: i })] }) }), e("div", { className: Ee, children: [e(oe, { onClick: Ne.bind(null, { currentPage: u, pages: o }), children: d }), e(je, { required: t, skipButtonText: a })] })] }) : null;
|
|
1233
1233
|
}, et = ({ stream: n }) => e("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 = n || null);
|
|
1235
1235
|
} }), nt = ({ content: n, pages: o, required: t }) => {
|
|
1236
1236
|
const { skipButtonText: r } = n, { avStream: i } = te.getState();
|
|
1237
|
-
return Ve(o), e("div", { children: [e(et, { stream: i }), e("div", { className: "ul-vertical-button-container-center", children: [e(
|
|
1237
|
+
return Ve(o), e("div", { children: [e(et, { stream: i }), e("div", { className: "ul-vertical-button-container-center", children: [e(oe, { onClick: $e.bind(null, { pages: o }), children: n.buttonText }), e(je, { bottom: !0, required: t, skipButtonText: r })] })] });
|
|
1238
1238
|
}, tt = ({ properties: n }) => {
|
|
1239
1239
|
const { pages: o, required: t } = n, { avStream: r, currentPage: i } = te.getState();
|
|
1240
1240
|
if (i === void 0) return null;
|
|
@@ -1273,17 +1273,17 @@ const mn = "ul-permission-graphics-container", hn = "ul-permission-body", gn = A
|
|
|
1273
1273
|
}, pages: o.pages, responseGroupUid: d, userId: u }));
|
|
1274
1274
|
let v = c.headline, x = c.captionText;
|
|
1275
1275
|
const C = vn(b, c);
|
|
1276
|
-
return We(c) && p && (v = c.permissionDeniedHeadline, x = c.permissionDeniedCaptionText), we(c) && C === pn && (v = c.permissionGrantedHeadline, x = c.permissionGrantedCaptionText), e("div", { className: A(n, "ul-center-horizontally", "fade-in-transition"), children: [e(Ae, { isRequired: o == null ? void 0 : o.required, message: v, properties: { captionText: x } }), e(
|
|
1276
|
+
return We(c) && p && (v = c.permissionDeniedHeadline, x = c.permissionDeniedCaptionText), we(c) && C === pn && (v = c.permissionGrantedHeadline, x = c.permissionGrantedCaptionText), e("div", { className: A(n, "ul-center-horizontally", "fade-in-transition"), children: [e(Ae, { isRequired: o == null ? void 0 : o.required, message: v, properties: { captionText: x } }), e(de, { children: e(tt, { properties: o }) })] });
|
|
1277
1277
|
}, ot = ({ className: n, next: o, properties: t, questionId: r, type: i }) => {
|
|
1278
1278
|
const { visitorAttributes: a, isLongFormSurvey: d } = z((b) => ({ visitorAttributes: b.visitorAttributes, isLongFormSurvey: nn(b.studyType) })), u = (b, c = !1) => {
|
|
1279
1279
|
o({ value: c ? { skipped: !0 } : void 0, questionId: r, type: i }, !0);
|
|
1280
1280
|
}, s = Dn(t && t.buttonUrl, a), p = d && t.promptActionType === Sn.NO_BUTTON;
|
|
1281
|
-
return e("div", { className: A(n, "ul-card__text-url-prompt", "fade-in-transition"), children: e(
|
|
1281
|
+
return e("div", { className: A(n, "ul-card__text-url-prompt", "fade-in-transition"), children: e(ie, { properties: t, children: !p && 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: s, id: "ul-card-text__button", onClick: u, onKeyPress: (b) => {
|
|
1282
1282
|
b.key !== "Enter" && b.key !== " " || o({ value: void 0, questionId: r, type: i }, !0);
|
|
1283
|
-
}, rel: "noreferrer", role: s ? "link" : "button", tabIndex: 0, target: "_blank", children:
|
|
1283
|
+
}, rel: "noreferrer", role: s ? "link" : "button", tabIndex: 0, target: "_blank", children: re(t) }), t.required === !1 && e("button", { className: "ul-card-skip__button", onClick: (b) => u(0, !0), children: Me(t) })] }) }) }) }, r);
|
|
1284
1284
|
}, it = ({ className: n, questionId: o }) => {
|
|
1285
1285
|
const { border: t, destroy: r, endCard: i, forceBrandedLogo: a } = z((s) => ({ border: s.border, destroy: s.destroy, endCard: s.endCard, forceBrandedLogo: s.forceBrandedLogo }));
|
|
1286
|
-
|
|
1286
|
+
ue(() => {
|
|
1287
1287
|
setTimeout(() => {
|
|
1288
1288
|
r(Ue);
|
|
1289
1289
|
}, a ? 4e3 : 2e3);
|
|
@@ -1312,7 +1312,7 @@ const mn = "ul-permission-graphics-container", hn = "ul-permission-body", gn = A
|
|
|
1312
1312
|
}
|
|
1313
1313
|
})(a), g && M ? (s({ mediaRecordingUid: M, isSubmitted: !0 }), o({ value: { mediaRecordingUid: M }, questionId: r, type: i }, !0)) : o({ value: null, questionId: r, type: i }, !0);
|
|
1314
1314
|
};
|
|
1315
|
-
return e("form", { className: A(n, "ul-card--video", "fade-in-transition"), id: "ul-video-interview-form", children: [e(
|
|
1315
|
+
return e("form", { className: A(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: y === Je ? "" : "none" }, children: e(ie, { properties: t, children: e("button", { className: "ul-video-btn ul-record-response-btn", onClick: (w) => {
|
|
1316
1316
|
w.preventDefault(), w.stopPropagation(), document.getElementById(a) && ((T) => {
|
|
1317
1317
|
const l = ke(T + rn);
|
|
1318
1318
|
l == null || l.pause();
|
|
@@ -1323,19 +1323,19 @@ const mn = "ul-permission-graphics-container", hn = "ul-permission-body", gn = A
|
|
|
1323
1323
|
I.document = H;
|
|
1324
1324
|
const U = l + Ze, Z = dn(U);
|
|
1325
1325
|
return I.document.addEventListener("securitypolicyviolation", (Y) => {
|
|
1326
|
-
|
|
1326
|
+
ae(new Error(`Voice & Video feature violates ${Y.violatedDirective} web page CSP policies for the recorder player.`), "recorderDeviceError", j, q, h.visitorId, h.envId);
|
|
1327
1327
|
}), on(tn.concat(Pn), () => {
|
|
1328
1328
|
Pe(U, Z), I.document.getElementById(He(U)).remove();
|
|
1329
1329
|
try {
|
|
1330
1330
|
Nn(Z, U, h, j, O, S, q, Q);
|
|
1331
1331
|
} catch (Y) {
|
|
1332
|
-
return void
|
|
1332
|
+
return void ae(new Error(`Error when creating video recorder player object ${Y}`), "recorderDeviceError", j, q, h.visitorId, h.envId);
|
|
1333
1333
|
}
|
|
1334
1334
|
}), Z;
|
|
1335
1335
|
})(a, { surveyId: c, responseGroupUid: b, questionId: r, visitorId: x, envId: u }, d, D, void 0, { ...p, "x-ul-video-recorder-origin": "sdk" }, t.mediaType === L.MEDIA_TYPE_AUDIO, v);
|
|
1336
1336
|
w.appendChild(T);
|
|
1337
1337
|
}
|
|
1338
|
-
} }) })] }), e(
|
|
1338
|
+
} }) })] }), e(le, { children: [e(ve, { isDisabled: !!t.required && !C, onClick: k, children: re(t) }), e("button", { className: "ul-card-text__button ul-button-inactive ul-card-skip__button", id: "ul-card-video__skip_button", onClick: k, style: { ...t.required ? { display: "none" } : {}, ...C ? { display: "none" } : {} }, children: Me(t) })] })] });
|
|
1339
1339
|
}, fn = (n) => n.type === "thanks" || n.type === "uploading", dt = ({ card: n, avatars: o, isThinking: t, isCurrentQuestion: r, currentQuestionBubbleRef: i }) => {
|
|
1340
1340
|
const a = ((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
1341
|
return e(ge, { avatars: o, isLeft: !0, message: { id: `question-${n.name}`, type: "question", content: a.content }, ref: r ? i : null, children: t ? e(st, {}) : e(Be, { children: [a.isHtml ? e(ye, { className: "chat-message-text", html: a.content }) : e("div", { className: "chat-message-text", children: a.content }), n.type === "videovoice" && e(qn, { properties: n.props, questionId: n.name, surveyVideoUrl: n.props.properties.videoUrl })] }) });
|
|
@@ -1419,7 +1419,7 @@ const mt = () => {
|
|
|
1419
1419
|
y((k) => new Map(k).set(R, D));
|
|
1420
1420
|
}, []) };
|
|
1421
1421
|
})(), { index: a, isLongFormSurvey: d, avatars: u, startingQuestionIdx: s, viewDocument: p, update: b } = z((f) => ({ index: f.index, isLongFormSurvey: nn(f.studyType), avatars: f.avatars, startingQuestionIdx: f.startingQuestionIdx, viewDocument: f.viewDocument, update: f.update })), { currentQuestionBubbleRef: c, scrollToCurrentQuestion: v } = (({ viewDocument: f }) => {
|
|
1422
|
-
const y =
|
|
1422
|
+
const y = se(null), R = be(() => {
|
|
1423
1423
|
const D = f.querySelector(".ul-card-main-content");
|
|
1424
1424
|
if (y.current && D && D instanceof HTMLElement) {
|
|
1425
1425
|
const k = y.current.offsetTop - D.offsetTop - 16;
|
|
@@ -1429,7 +1429,7 @@ const mt = () => {
|
|
|
1429
1429
|
return { currentQuestionBubbleRef: y, scrollToCurrentQuestion: R };
|
|
1430
1430
|
})({ viewDocument: p }), x = ((f, y, R) => {
|
|
1431
1431
|
const [D, k] = G(/* @__PURE__ */ new Map());
|
|
1432
|
-
return
|
|
1432
|
+
return ue(() => {
|
|
1433
1433
|
if (f.length > 0 && y < f.length) {
|
|
1434
1434
|
const w = f[y], T = `${w.name}`;
|
|
1435
1435
|
if (y <= (R ?? 0) || fn(w)) return void k((h) => new Map(h).set(T, !1));
|
|
@@ -1442,9 +1442,9 @@ const mt = () => {
|
|
|
1442
1442
|
}, [y, f, R]), D;
|
|
1443
1443
|
})(n, a, s), C = ((f, y) => {
|
|
1444
1444
|
const [R, D] = G(/* @__PURE__ */ new Set([0]));
|
|
1445
|
-
return
|
|
1445
|
+
return ue(() => {
|
|
1446
1446
|
D((k) => new Set(k).add(f));
|
|
1447
|
-
}, [f]),
|
|
1447
|
+
}, [f]), ue(() => {
|
|
1448
1448
|
const k = y ?? 0;
|
|
1449
1449
|
k > 0 && D((w) => {
|
|
1450
1450
|
const T = new Set(w);
|
|
@@ -1456,7 +1456,7 @@ const mt = () => {
|
|
|
1456
1456
|
var R, D;
|
|
1457
1457
|
return { ...f, value: y < a ? ((R = r.get(`${f.name}`)) == null ? void 0 : R.value) ?? null : null, secondaryValue: y < a ? ((D = r.get(`${f.name}`)) == null ? void 0 : D.secondaryValue) ?? null : null };
|
|
1458
1458
|
})) }), [t, r, n, a]), g = kn(n, m);
|
|
1459
|
-
|
|
1459
|
+
ue(() => {
|
|
1460
1460
|
requestAnimationFrame(() => {
|
|
1461
1461
|
v();
|
|
1462
1462
|
}), b();
|