@sprig-technologies/sprig-bundled 2.35.0 → 2.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2039 +0,0 @@
1
- import { e as Ce, A as be, s as Oe, D as Sn, c as Tn, S as X, a as Je, C as kt, b as wt, d as In, i as Nn, E as En, f as Se, g as Y, h as lt, j as Ln, r as Pn, v as Ct, k as St } from "./index-D8ZoPLNT.js";
2
- var Ee, q, dr, pe, Tt, pr, Xe, mr, Ne = {}, hr = [], Mn = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, Fe = Array.isArray;
3
- function oe(e, t) {
4
- for (var r in t) e[r] = t[r];
5
- return e;
6
- }
7
- function fr(e) {
8
- var t = e.parentNode;
9
- t && t.removeChild(e);
10
- }
11
- function J(e, t, r) {
12
- var n, o, i, s = {};
13
- for (i in t) i == "key" ? n = t[i] : i == "ref" ? o = t[i] : s[i] = t[i];
14
- if (arguments.length > 2 && (s.children = arguments.length > 3 ? Ee.call(arguments, 2) : r), typeof e == "function" && e.defaultProps != null) for (i in e.defaultProps) s[i] === void 0 && (s[i] = e.defaultProps[i]);
15
- return Te(e, s, n, o, null);
16
- }
17
- function Te(e, t, r, n, o) {
18
- var i = { type: e, props: t, key: r, ref: n, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, constructor: void 0, __v: o ?? ++dr, __i: -1, __u: 0 };
19
- return o == null && q.vnode != null && q.vnode(i), i;
20
- }
21
- function gr() {
22
- return { current: null };
23
- }
24
- function $(e) {
25
- return e.children;
26
- }
27
- function ee(e, t) {
28
- this.props = e, this.context = t;
29
- }
30
- function ve(e, t) {
31
- if (t == null) return e.__ ? ve(e.__, e.__i + 1) : null;
32
- for (var r; t < e.__k.length; t++) if ((r = e.__k[t]) != null && r.__e != null) return r.__e;
33
- return typeof e.type == "function" ? ve(e) : null;
34
- }
35
- function _r(e) {
36
- var t, r;
37
- if ((e = e.__) != null && e.__c != null) {
38
- for (e.__e = e.__c.base = null, t = 0; t < e.__k.length; t++) if ((r = e.__k[t]) != null && r.__e != null) {
39
- e.__e = e.__c.base = r.__e;
40
- break;
41
- }
42
- return _r(e);
43
- }
44
- }
45
- function et(e) {
46
- (!e.__d && (e.__d = !0) && pe.push(e) && !He.__r++ || Tt !== q.debounceRendering) && ((Tt = q.debounceRendering) || pr)(He);
47
- }
48
- function He() {
49
- var e, t, r, n, o, i, s, l, c;
50
- for (pe.sort(Xe); e = pe.shift(); ) e.__d && (t = pe.length, n = void 0, i = (o = (r = e).__v).__e, l = [], c = [], (s = r.__P) && ((n = oe({}, o)).__v = o.__v + 1, q.vnode && q.vnode(n), ct(s, n, o, r.__n, s.ownerSVGElement !== void 0, 32 & o.__u ? [i] : null, l, i ?? ve(o), !!(32 & o.__u), c), n.__.__k[n.__i] = n, yr(l, n, c), n.__e != i && _r(n)), pe.length > t && pe.sort(Xe));
51
- He.__r = 0;
52
- }
53
- function br(e, t, r, n, o, i, s, l, c, d, m) {
54
- var u, p, g, h, _, b = n && n.__k || hr, x = t.length;
55
- for (r.__d = c, function(v, E, T) {
56
- var k, C, f, I, S, P = E.length, y = T.length, w = y, L = 0;
57
- for (v.__k = [], k = 0; k < P; k++) (C = v.__k[k] = (C = E[k]) == null || typeof C == "boolean" || typeof C == "function" ? null : typeof C == "string" || typeof C == "number" || typeof C == "bigint" || C.constructor == String ? Te(null, C, null, null, C) : Fe(C) ? Te($, { children: C }, null, null, null) : C.constructor === void 0 && C.__b > 0 ? Te(C.type, C.props, C.key, C.ref ? C.ref : null, C.__v) : C) != null ? (C.__ = v, C.__b = v.__b + 1, S = qn(C, T, I = k + L, w), C.__i = S, f = null, S !== -1 && (w--, (f = T[S]) && (f.__u |= 131072)), f == null || f.__v === null ? (S == -1 && L--, typeof C.type != "function" && (C.__u |= 65536)) : S !== I && (S === I + 1 ? L++ : S > I ? w > P - I ? L += S - I : L-- : L = S < I && S == I - 1 ? S - I : 0, S !== k + L && (C.__u |= 65536))) : (f = T[k]) && f.key == null && f.__e && (f.__e == v.__d && (v.__d = ve(f)), tt(f, f, !1), T[k] = null, w--);
58
- if (w) for (k = 0; k < y; k++) (f = T[k]) != null && !(131072 & f.__u) && (f.__e == v.__d && (v.__d = ve(f)), tt(f, f));
59
- }(r, t, b), c = r.__d, u = 0; u < x; u++) (g = r.__k[u]) != null && typeof g != "boolean" && typeof g != "function" && (p = g.__i === -1 ? Ne : b[g.__i] || Ne, g.__i = u, ct(e, g, p, o, i, s, l, c, d, m), h = g.__e, g.ref && p.ref != g.ref && (p.ref && ut(p.ref, null, g), m.push(g.ref, g.__c || h, g)), _ == null && h != null && (_ = h), 65536 & g.__u || p.__k === g.__k ? c = vr(g, c, e) : typeof g.type == "function" && g.__d !== void 0 ? c = g.__d : h && (c = h.nextSibling), g.__d = void 0, g.__u &= -196609);
60
- r.__d = c, r.__e = _;
61
- }
62
- function vr(e, t, r) {
63
- var n, o;
64
- if (typeof e.type == "function") {
65
- for (n = e.__k, o = 0; n && o < n.length; o++) n[o] && (n[o].__ = e, t = vr(n[o], t, r));
66
- return t;
67
- }
68
- return e.__e != t && (r.insertBefore(e.__e, t || null), t = e.__e), t && t.nextSibling;
69
- }
70
- function ie(e, t) {
71
- return t = t || [], e == null || typeof e == "boolean" || (Fe(e) ? e.some(function(r) {
72
- ie(r, t);
73
- }) : t.push(e)), t;
74
- }
75
- function qn(e, t, r, n) {
76
- var o = e.key, i = e.type, s = r - 1, l = r + 1, c = t[r];
77
- if (c === null || c && o == c.key && i === c.type) return r;
78
- if (n > (c == null || 131072 & c.__u ? 0 : 1)) for (; s >= 0 || l < t.length; ) {
79
- if (s >= 0) {
80
- if ((c = t[s]) && !(131072 & c.__u) && o == c.key && i === c.type) return s;
81
- s--;
82
- }
83
- if (l < t.length) {
84
- if ((c = t[l]) && !(131072 & c.__u) && o == c.key && i === c.type) return l;
85
- l++;
86
- }
87
- }
88
- return -1;
89
- }
90
- function It(e, t, r) {
91
- t[0] === "-" ? e.setProperty(t, r ?? "") : e[t] = r == null ? "" : typeof r != "number" || Mn.test(t) ? r : r + "px";
92
- }
93
- function Me(e, t, r, n, o) {
94
- var i;
95
- e: if (t === "style") if (typeof r == "string") e.style.cssText = r;
96
- else {
97
- if (typeof n == "string" && (e.style.cssText = n = ""), n) for (t in n) r && t in r || It(e.style, t, "");
98
- if (r) for (t in r) n && r[t] === n[t] || It(e.style, t, r[t]);
99
- }
100
- else if (t[0] === "o" && t[1] === "n") i = t !== (t = t.replace(/(PointerCapture)$|Capture$/, "$1")), t = t.toLowerCase() in e ? t.toLowerCase().slice(2) : t.slice(2), e.l || (e.l = {}), e.l[t + i] = r, r ? n ? r.u = n.u : (r.u = Date.now(), e.addEventListener(t, i ? Et : Nt, i)) : e.removeEventListener(t, i ? Et : Nt, i);
101
- else {
102
- if (o) t = t.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
103
- else if (t !== "width" && t !== "height" && t !== "href" && t !== "list" && t !== "form" && t !== "tabIndex" && t !== "download" && t !== "rowSpan" && t !== "colSpan" && t !== "role" && t in e) try {
104
- e[t] = r ?? "";
105
- break e;
106
- } catch {
107
- }
108
- typeof r == "function" || (r == null || r === !1 && t[4] !== "-" ? e.removeAttribute(t) : e.setAttribute(t, r));
109
- }
110
- }
111
- function Nt(e) {
112
- var t = this.l[e.type + !1];
113
- if (e.t) {
114
- if (e.t <= t.u) return;
115
- } else e.t = Date.now();
116
- return t(q.event ? q.event(e) : e);
117
- }
118
- function Et(e) {
119
- return this.l[e.type + !0](q.event ? q.event(e) : e);
120
- }
121
- function ct(e, t, r, n, o, i, s, l, c, d) {
122
- var m, u, p, g, h, _, b, x, v, E, T, k, C, f, I, S = t.type;
123
- if (t.constructor !== void 0) return null;
124
- 128 & r.__u && (c = !!(32 & r.__u), i = [l = t.__e = r.__e]), (m = q.__b) && m(t);
125
- e: if (typeof S == "function") try {
126
- if (x = t.props, v = (m = S.contextType) && n[m.__c], E = m ? v ? v.props.value : m.__ : n, r.__c ? b = (u = t.__c = r.__c).__ = u.__E : ("prototype" in S && S.prototype.render ? t.__c = u = new S(x, E) : (t.__c = u = new ee(x, E), u.constructor = S, u.render = Dn), v && v.sub(u), u.props = x, u.state || (u.state = {}), u.context = E, u.__n = n, p = u.__d = !0, u.__h = [], u._sb = []), u.__s == null && (u.__s = u.state), S.getDerivedStateFromProps != null && (u.__s == u.state && (u.__s = oe({}, u.__s)), oe(u.__s, S.getDerivedStateFromProps(x, u.__s))), g = u.props, h = u.state, u.__v = t, p) S.getDerivedStateFromProps == null && u.componentWillMount != null && u.componentWillMount(), u.componentDidMount != null && u.__h.push(u.componentDidMount);
127
- else {
128
- if (S.getDerivedStateFromProps == null && x !== g && u.componentWillReceiveProps != null && u.componentWillReceiveProps(x, E), !u.__e && (u.shouldComponentUpdate != null && u.shouldComponentUpdate(x, u.__s, E) === !1 || t.__v === r.__v)) {
129
- for (t.__v !== r.__v && (u.props = x, u.state = u.__s, u.__d = !1), t.__e = r.__e, t.__k = r.__k, t.__k.forEach(function(P) {
130
- P && (P.__ = t);
131
- }), T = 0; T < u._sb.length; T++) u.__h.push(u._sb[T]);
132
- u._sb = [], u.__h.length && s.push(u);
133
- break e;
134
- }
135
- u.componentWillUpdate != null && u.componentWillUpdate(x, u.__s, E), u.componentDidUpdate != null && u.__h.push(function() {
136
- u.componentDidUpdate(g, h, _);
137
- });
138
- }
139
- if (u.context = E, u.props = x, u.__P = e, u.__e = !1, k = q.__r, C = 0, "prototype" in S && S.prototype.render) {
140
- for (u.state = u.__s, u.__d = !1, k && k(t), m = u.render(u.props, u.state, u.context), f = 0; f < u._sb.length; f++) u.__h.push(u._sb[f]);
141
- u._sb = [];
142
- } else do
143
- u.__d = !1, k && k(t), m = u.render(u.props, u.state, u.context), u.state = u.__s;
144
- while (u.__d && ++C < 25);
145
- u.state = u.__s, u.getChildContext != null && (n = oe(oe({}, n), u.getChildContext())), p || u.getSnapshotBeforeUpdate == null || (_ = u.getSnapshotBeforeUpdate(g, h)), br(e, Fe(I = m != null && m.type === $ && m.key == null ? m.props.children : m) ? I : [I], t, r, n, o, i, s, l, c, d), u.base = t.__e, t.__u &= -161, u.__h.length && s.push(u), b && (u.__E = u.__ = null);
146
- } catch (P) {
147
- t.__v = null, c || i != null ? (t.__e = l, t.__u |= c ? 160 : 32, i[i.indexOf(l)] = null) : (t.__e = r.__e, t.__k = r.__k), q.__e(P, t, r);
148
- }
149
- else i == null && t.__v === r.__v ? (t.__k = r.__k, t.__e = r.__e) : t.__e = Rn(r.__e, t, r, n, o, i, s, c, d);
150
- (m = q.diffed) && m(t);
151
- }
152
- function yr(e, t, r) {
153
- t.__d = void 0;
154
- for (var n = 0; n < r.length; n++) ut(r[n], r[++n], r[++n]);
155
- q.__c && q.__c(t, e), e.some(function(o) {
156
- try {
157
- e = o.__h, o.__h = [], e.some(function(i) {
158
- i.call(o);
159
- });
160
- } catch (i) {
161
- q.__e(i, o.__v);
162
- }
163
- });
164
- }
165
- function Rn(e, t, r, n, o, i, s, l, c) {
166
- var d, m, u, p, g, h, _, b = r.props, x = t.props, v = t.type;
167
- if (v === "svg" && (o = !0), i != null) {
168
- for (d = 0; d < i.length; d++) if ((g = i[d]) && "setAttribute" in g == !!v && (v ? g.localName === v : g.nodeType === 3)) {
169
- e = g, i[d] = null;
170
- break;
171
- }
172
- }
173
- if (e == null) {
174
- if (v === null) return document.createTextNode(x);
175
- e = o ? document.createElementNS("http://www.w3.org/2000/svg", v) : document.createElement(v, x.is && x), i = null, l = !1;
176
- }
177
- if (v === null) b === x || l && e.data === x || (e.data = x);
178
- else {
179
- if (i = i && Ee.call(e.childNodes), b = r.props || Ne, !l && i != null) for (b = {}, d = 0; d < e.attributes.length; d++) b[(g = e.attributes[d]).name] = g.value;
180
- for (d in b) g = b[d], d == "children" || (d == "dangerouslySetInnerHTML" ? u = g : d === "key" || d in x || Me(e, d, null, g, o));
181
- for (d in x) g = x[d], d == "children" ? p = g : d == "dangerouslySetInnerHTML" ? m = g : d == "value" ? h = g : d == "checked" ? _ = g : d === "key" || l && typeof g != "function" || b[d] === g || Me(e, d, g, b[d], o);
182
- if (m) l || u && (m.__html === u.__html || m.__html === e.innerHTML) || (e.innerHTML = m.__html), t.__k = [];
183
- else if (u && (e.innerHTML = ""), br(e, Fe(p) ? p : [p], t, r, n, o && v !== "foreignObject", i, s, i ? i[0] : r.__k && ve(r, 0), l, c), i != null) for (d = i.length; d--; ) i[d] != null && fr(i[d]);
184
- l || (d = "value", h !== void 0 && (h !== e[d] || v === "progress" && !h || v === "option" && h !== b[d]) && Me(e, d, h, b[d], !1), d = "checked", _ !== void 0 && _ !== e[d] && Me(e, d, _, b[d], !1));
185
- }
186
- return e;
187
- }
188
- function ut(e, t, r) {
189
- try {
190
- typeof e == "function" ? e(t) : e.current = t;
191
- } catch (n) {
192
- q.__e(n, r);
193
- }
194
- }
195
- function tt(e, t, r) {
196
- var n, o;
197
- if (q.unmount && q.unmount(e), (n = e.ref) && (n.current && n.current !== e.__e || ut(n, null, t)), (n = e.__c) != null) {
198
- if (n.componentWillUnmount) try {
199
- n.componentWillUnmount();
200
- } catch (i) {
201
- q.__e(i, t);
202
- }
203
- n.base = n.__P = null, e.__c = void 0;
204
- }
205
- if (n = e.__k) for (o = 0; o < n.length; o++) n[o] && tt(n[o], t, r || typeof e.type != "function");
206
- r || e.__e == null || fr(e.__e), e.__ = e.__e = e.__d = void 0;
207
- }
208
- function Dn(e, t, r) {
209
- return this.constructor(e, r);
210
- }
211
- function ye(e, t, r) {
212
- var n, o, i, s;
213
- q.__ && q.__(e, t), o = (n = typeof r == "function") ? null : r && r.__k || t.__k, i = [], s = [], ct(t, e = (!n && r || t).__k = J($, null, [e]), o || Ne, Ne, t.ownerSVGElement !== void 0, !n && r ? [r] : o ? null : t.firstChild ? Ee.call(t.childNodes) : null, i, !n && r ? r : o ? o.__e : t.firstChild, n, s), yr(i, e, s);
214
- }
215
- function xr(e, t) {
216
- ye(e, t, xr);
217
- }
218
- function On(e, t, r) {
219
- var n, o, i, s, l = oe({}, e.props);
220
- for (i in e.type && e.type.defaultProps && (s = e.type.defaultProps), t) i == "key" ? n = t[i] : i == "ref" ? o = t[i] : l[i] = t[i] === void 0 && s !== void 0 ? s[i] : t[i];
221
- return arguments.length > 2 && (l.children = arguments.length > 3 ? Ee.call(arguments, 2) : r), Te(e.type, l, n || e.key, o || e.ref, null);
222
- }
223
- function kr(e, t) {
224
- var r = { __c: t = "__cC" + mr++, __: e, Consumer: function(n, o) {
225
- return n.children(o);
226
- }, Provider: function(n) {
227
- var o, i;
228
- return this.getChildContext || (o = [], (i = {})[t] = this, this.getChildContext = function() {
229
- return i;
230
- }, this.shouldComponentUpdate = function(s) {
231
- this.props.value !== s.value && o.some(function(l) {
232
- l.__e = !0, et(l);
233
- });
234
- }, this.sub = function(s) {
235
- o.push(s);
236
- var l = s.componentWillUnmount;
237
- s.componentWillUnmount = function() {
238
- o.splice(o.indexOf(s), 1), l && l.call(s);
239
- };
240
- }), n.children;
241
- } };
242
- return r.Provider.__ = r.Consumer.contextType = r;
243
- }
244
- Ee = hr.slice, q = { __e: function(e, t, r, n) {
245
- for (var o, i, s; t = t.__; ) if ((o = t.__c) && !o.__) try {
246
- if ((i = o.constructor) && i.getDerivedStateFromError != null && (o.setState(i.getDerivedStateFromError(e)), s = o.__d), o.componentDidCatch != null && (o.componentDidCatch(e, n || {}), s = o.__d), s) return o.__E = o;
247
- } catch (l) {
248
- e = l;
249
- }
250
- throw e;
251
- } }, dr = 0, ee.prototype.setState = function(e, t) {
252
- var r;
253
- r = this.__s != null && this.__s !== this.state ? this.__s : this.__s = oe({}, this.state), typeof e == "function" && (e = e(oe({}, r), this.props)), e && oe(r, e), e != null && this.__v && (t && this._sb.push(t), et(this));
254
- }, ee.prototype.forceUpdate = function(e) {
255
- this.__v && (this.__e = !0, e && this.__h.push(e), et(this));
256
- }, ee.prototype.render = $, pe = [], pr = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, Xe = function(e, t) {
257
- return e.__v.__b - t.__v.__b;
258
- }, He.__r = 0, mr = 0;
259
- var Hn = 0;
260
- function a(e, t, r, n, o, i) {
261
- var s, l, c = {};
262
- for (l in t) l == "ref" ? s = t[l] : c[l] = t[l];
263
- var d = { type: e, props: c, key: r, ref: s, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, constructor: void 0, __v: --Hn, __i: -1, __u: 0, __source: o, __self: i };
264
- if (typeof e == "function" && (s = e.defaultProps)) for (l in s) c[l] === void 0 && (c[l] = s[l]);
265
- return q.vnode && q.vnode(d), d;
266
- }
267
- var ae, A, Qe, Lt, xe = 0, wr = [], qe = [], Pt = q.__b, Mt = q.__r, qt = q.diffed, Rt = q.__c, Dt = q.unmount;
268
- function he(e, t) {
269
- q.__h && q.__h(A, e, xe || t), xe = 0;
270
- var r = A.__H || (A.__H = { __: [], __h: [] });
271
- return e >= r.__.length && r.__.push({ __V: qe }), r.__[e];
272
- }
273
- function F(e) {
274
- return xe = 1, dt(Ir, e);
275
- }
276
- function dt(e, t, r) {
277
- var n = he(ae++, 2);
278
- if (n.t = e, !n.__c && (n.__ = [r ? r(t) : Ir(void 0, t), function(l) {
279
- var c = n.__N ? n.__N[0] : n.__[0], d = n.t(c, l);
280
- c !== d && (n.__N = [d, n.__[1]], n.__c.setState({}));
281
- }], n.__c = A, !A.u)) {
282
- var o = function(l, c, d) {
283
- if (!n.__c.__H) return !0;
284
- var m = n.__c.__H.__.filter(function(p) {
285
- return p.__c;
286
- });
287
- if (m.every(function(p) {
288
- return !p.__N;
289
- })) return !i || i.call(this, l, c, d);
290
- var u = !1;
291
- return m.forEach(function(p) {
292
- if (p.__N) {
293
- var g = p.__[0];
294
- p.__ = p.__N, p.__N = void 0, g !== p.__[0] && (u = !0);
295
- }
296
- }), !(!u && n.__c.props === l) && (!i || i.call(this, l, c, d));
297
- };
298
- A.u = !0;
299
- var i = A.shouldComponentUpdate, s = A.componentWillUpdate;
300
- A.componentWillUpdate = function(l, c, d) {
301
- if (this.__e) {
302
- var m = i;
303
- i = void 0, o(l, c, d), i = m;
304
- }
305
- s && s.call(this, l, c, d);
306
- }, A.shouldComponentUpdate = o;
307
- }
308
- return n.__N || n.__;
309
- }
310
- function V(e, t) {
311
- var r = he(ae++, 3);
312
- !q.__s && mt(r.__H, t) && (r.__ = e, r.i = t, A.__H.__h.push(r));
313
- }
314
- function Le(e, t) {
315
- var r = he(ae++, 4);
316
- !q.__s && mt(r.__H, t) && (r.__ = e, r.i = t, A.__h.push(r));
317
- }
318
- function G(e) {
319
- return xe = 5, ne(function() {
320
- return { current: e };
321
- }, []);
322
- }
323
- function Cr(e, t, r) {
324
- xe = 6, Le(function() {
325
- return typeof e == "function" ? (e(t()), function() {
326
- return e(null);
327
- }) : e ? (e.current = t(), function() {
328
- return e.current = null;
329
- }) : void 0;
330
- }, r == null ? r : r.concat(e));
331
- }
332
- function ne(e, t) {
333
- var r = he(ae++, 7);
334
- return mt(r.__H, t) ? (r.__V = e(), r.i = t, r.__h = e, r.__V) : r.__;
335
- }
336
- function me(e, t) {
337
- return xe = 8, ne(function() {
338
- return e;
339
- }, t);
340
- }
341
- function Sr(e) {
342
- var t = A.context[e.__c], r = he(ae++, 9);
343
- return r.c = e, t ? (r.__ == null && (r.__ = !0, t.sub(A)), t.props.value) : e.__;
344
- }
345
- function pt(e, t) {
346
- q.useDebugValue && q.useDebugValue(t ? t(e) : e);
347
- }
348
- function Tr() {
349
- var e = he(ae++, 11);
350
- if (!e.__) {
351
- for (var t = A.__v; t !== null && !t.__m && t.__ !== null; ) t = t.__;
352
- var r = t.__m || (t.__m = [0, 0]);
353
- e.__ = "P" + r[0] + "-" + r[1]++;
354
- }
355
- return e.__;
356
- }
357
- function Un() {
358
- for (var e; e = wr.shift(); ) if (e.__P && e.__H) try {
359
- e.__H.__h.forEach(Re), e.__H.__h.forEach(rt), e.__H.__h = [];
360
- } catch (t) {
361
- e.__H.__h = [], q.__e(t, e.__v);
362
- }
363
- }
364
- q.__b = function(e) {
365
- A = null, Pt && Pt(e);
366
- }, q.__r = function(e) {
367
- Mt && Mt(e), ae = 0;
368
- var t = (A = e.__c).__H;
369
- t && (Qe === A ? (t.__h = [], A.__h = [], t.__.forEach(function(r) {
370
- r.__N && (r.__ = r.__N), r.__V = qe, r.__N = r.i = void 0;
371
- })) : (t.__h.forEach(Re), t.__h.forEach(rt), t.__h = [], ae = 0)), Qe = A;
372
- }, q.diffed = function(e) {
373
- qt && qt(e);
374
- var t = e.__c;
375
- t && t.__H && (t.__H.__h.length && (wr.push(t) !== 1 && Lt === q.requestAnimationFrame || ((Lt = q.requestAnimationFrame) || Bn)(Un)), t.__H.__.forEach(function(r) {
376
- r.i && (r.__H = r.i), r.__V !== qe && (r.__ = r.__V), r.i = void 0, r.__V = qe;
377
- })), Qe = A = null;
378
- }, q.__c = function(e, t) {
379
- t.some(function(r) {
380
- try {
381
- r.__h.forEach(Re), r.__h = r.__h.filter(function(n) {
382
- return !n.__ || rt(n);
383
- });
384
- } catch (n) {
385
- t.some(function(o) {
386
- o.__h && (o.__h = []);
387
- }), t = [], q.__e(n, r.__v);
388
- }
389
- }), Rt && Rt(e, t);
390
- }, q.unmount = function(e) {
391
- Dt && Dt(e);
392
- var t, r = e.__c;
393
- r && r.__H && (r.__H.__.forEach(function(n) {
394
- try {
395
- Re(n);
396
- } catch (o) {
397
- t = o;
398
- }
399
- }), r.__H = void 0, t && q.__e(t, r.__v));
400
- };
401
- var Ot = typeof requestAnimationFrame == "function";
402
- function Bn(e) {
403
- var t, r = function() {
404
- clearTimeout(n), Ot && cancelAnimationFrame(t), setTimeout(e);
405
- }, n = setTimeout(r, 100);
406
- Ot && (t = requestAnimationFrame(r));
407
- }
408
- function Re(e) {
409
- var t = A, r = e.__c;
410
- typeof r == "function" && (e.__c = void 0, r()), A = t;
411
- }
412
- function rt(e) {
413
- var t = A;
414
- e.__c = e.__(), A = t;
415
- }
416
- function mt(e, t) {
417
- return !e || e.length !== t.length || t.some(function(r, n) {
418
- return r !== e[n];
419
- });
420
- }
421
- function Ir(e, t) {
422
- return typeof t == "function" ? t(e) : t;
423
- }
424
- function Nr(e, t) {
425
- for (var r in t) e[r] = t[r];
426
- return e;
427
- }
428
- function nt(e, t) {
429
- for (var r in e) if (r !== "__source" && !(r in t)) return !0;
430
- for (var n in t) if (n !== "__source" && e[n] !== t[n]) return !0;
431
- return !1;
432
- }
433
- function Ue(e) {
434
- this.props = e;
435
- }
436
- function Er(e, t) {
437
- function r(o) {
438
- var i = this.props.ref, s = i == o.ref;
439
- return !s && i && (i.call ? i(null) : i.current = null), t ? !t(this.props, o) || !s : nt(this.props, o);
440
- }
441
- function n(o) {
442
- return this.shouldComponentUpdate = r, J(e, o);
443
- }
444
- return n.displayName = "Memo(" + (e.displayName || e.name) + ")", n.prototype.isReactComponent = !0, n.__f = !0, n;
445
- }
446
- (Ue.prototype = new ee()).isPureReactComponent = !0, Ue.prototype.shouldComponentUpdate = function(e, t) {
447
- return nt(this.props, e) || nt(this.state, t);
448
- };
449
- var Ht = q.__b;
450
- q.__b = function(e) {
451
- e.type && e.type.__f && e.ref && (e.props.ref = e.ref, e.ref = null), Ht && Ht(e);
452
- };
453
- var Fn = typeof Symbol < "u" && Symbol.for && Symbol.for("react.forward_ref") || 3911;
454
- function ht(e) {
455
- function t(r) {
456
- var n = Nr({}, r);
457
- return delete n.ref, e(n, r.ref || null);
458
- }
459
- return t.$$typeof = Fn, t.render = t, t.prototype.isReactComponent = t.__f = !0, t.displayName = "ForwardRef(" + (e.displayName || e.name) + ")", t;
460
- }
461
- var Ut = function(e, t) {
462
- return e == null ? null : ie(ie(e).map(t));
463
- }, Lr = { map: Ut, forEach: Ut, count: function(e) {
464
- return e ? ie(e).length : 0;
465
- }, only: function(e) {
466
- var t = ie(e);
467
- if (t.length !== 1) throw "Children.only";
468
- return t[0];
469
- }, toArray: ie }, An = q.__e;
470
- q.__e = function(e, t, r, n) {
471
- if (e.then) {
472
- for (var o, i = t; i = i.__; ) if ((o = i.__c) && o.__c) return t.__e == null && (t.__e = r.__e, t.__k = r.__k), o.__c(e, t);
473
- }
474
- An(e, t, r, n);
475
- };
476
- var Bt = q.unmount;
477
- function Pr(e, t, r) {
478
- return e && (e.__c && e.__c.__H && (e.__c.__H.__.forEach(function(n) {
479
- typeof n.__c == "function" && n.__c();
480
- }), e.__c.__H = null), (e = Nr({}, e)).__c != null && (e.__c.__P === r && (e.__c.__P = t), e.__c = null), e.__k = e.__k && e.__k.map(function(n) {
481
- return Pr(n, t, r);
482
- })), e;
483
- }
484
- function Mr(e, t, r) {
485
- return e && r && (e.__v = null, e.__k = e.__k && e.__k.map(function(n) {
486
- return Mr(n, t, r);
487
- }), e.__c && e.__c.__P === t && (e.__e && r.appendChild(e.__e), e.__c.__e = !0, e.__c.__P = r)), e;
488
- }
489
- function Ie() {
490
- this.__u = 0, this.t = null, this.__b = null;
491
- }
492
- function qr(e) {
493
- var t = e.__.__c;
494
- return t && t.__a && t.__a(e);
495
- }
496
- function Rr(e) {
497
- var t, r, n;
498
- function o(i) {
499
- if (t || (t = e()).then(function(s) {
500
- r = s.default || s;
501
- }, function(s) {
502
- n = s;
503
- }), n) throw n;
504
- if (!r) throw t;
505
- return J(r, i);
506
- }
507
- return o.displayName = "Lazy", o.__f = !0, o;
508
- }
509
- function _e() {
510
- this.u = null, this.o = null;
511
- }
512
- q.unmount = function(e) {
513
- var t = e.__c;
514
- t && t.__R && t.__R(), t && 32 & e.__u && (e.type = null), Bt && Bt(e);
515
- }, (Ie.prototype = new ee()).__c = function(e, t) {
516
- var r = t.__c, n = this;
517
- n.t == null && (n.t = []), n.t.push(r);
518
- var o = qr(n.__v), i = !1, s = function() {
519
- i || (i = !0, r.__R = null, o ? o(l) : l());
520
- };
521
- r.__R = s;
522
- var l = function() {
523
- if (!--n.__u) {
524
- if (n.state.__a) {
525
- var c = n.state.__a;
526
- n.__v.__k[0] = Mr(c, c.__c.__P, c.__c.__O);
527
- }
528
- var d;
529
- for (n.setState({ __a: n.__b = null }); d = n.t.pop(); ) d.forceUpdate();
530
- }
531
- };
532
- n.__u++ || 32 & t.__u || n.setState({ __a: n.__b = n.__v.__k[0] }), e.then(s, s);
533
- }, Ie.prototype.componentWillUnmount = function() {
534
- this.t = [];
535
- }, Ie.prototype.render = function(e, t) {
536
- if (this.__b) {
537
- if (this.__v.__k) {
538
- var r = document.createElement("div"), n = this.__v.__k[0].__c;
539
- this.__v.__k[0] = Pr(this.__b, r, n.__O = n.__P);
540
- }
541
- this.__b = null;
542
- }
543
- var o = t.__a && J($, null, e.fallback);
544
- return o && (o.__u &= -33), [J($, null, t.__a ? null : e.children), o];
545
- };
546
- var Ft = function(e, t, r) {
547
- if (++r[1] === r[0] && e.o.delete(t), e.props.revealOrder && (e.props.revealOrder[0] !== "t" || !e.o.size)) for (r = e.u; r; ) {
548
- for (; r.length > 3; ) r.pop()();
549
- if (r[1] < r[0]) break;
550
- e.u = r = r[2];
551
- }
552
- };
553
- function jn(e) {
554
- return this.getChildContext = function() {
555
- return e.context;
556
- }, e.children;
557
- }
558
- function Vn(e) {
559
- var t = this, r = e.i;
560
- t.componentWillUnmount = function() {
561
- ye(null, t.l), t.l = null, t.i = null;
562
- }, t.i && t.i !== r && t.componentWillUnmount(), t.l || (t.i = r, t.l = { nodeType: 1, parentNode: r, childNodes: [], appendChild: function(n) {
563
- this.childNodes.push(n), t.i.appendChild(n);
564
- }, insertBefore: function(n, o) {
565
- this.childNodes.push(n), t.i.appendChild(n);
566
- }, removeChild: function(n) {
567
- this.childNodes.splice(this.childNodes.indexOf(n) >>> 1, 1), t.i.removeChild(n);
568
- } }), ye(J(jn, { context: t.context }, e.__v), t.l);
569
- }
570
- function Dr(e, t) {
571
- var r = J(Vn, { __v: e, i: t });
572
- return r.containerInfo = t, r;
573
- }
574
- (_e.prototype = new ee()).__a = function(e) {
575
- var t = this, r = qr(t.__v), n = t.o.get(e);
576
- return n[0]++, function(o) {
577
- var i = function() {
578
- t.props.revealOrder ? (n.push(o), Ft(t, e, n)) : o();
579
- };
580
- r ? r(i) : i();
581
- };
582
- }, _e.prototype.render = function(e) {
583
- this.u = null, this.o = /* @__PURE__ */ new Map();
584
- var t = ie(e.children);
585
- e.revealOrder && e.revealOrder[0] === "b" && t.reverse();
586
- for (var r = t.length; r--; ) this.o.set(t[r], this.u = [1, 0, this.u]);
587
- return e.children;
588
- }, _e.prototype.componentDidUpdate = _e.prototype.componentDidMount = function() {
589
- var e = this;
590
- this.o.forEach(function(t, r) {
591
- Ft(e, r, t);
592
- });
593
- };
594
- var Or = typeof Symbol < "u" && Symbol.for && Symbol.for("react.element") || 60103, $n = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/, zn = /^on(Ani|Tra|Tou|BeforeInp|Compo)/, Qn = /[A-Z0-9]/g, Wn = typeof document < "u", Zn = function(e) {
595
- return (typeof Symbol < "u" && typeof Symbol() == "symbol" ? /fil|che|rad/ : /fil|che|ra/).test(e);
596
- };
597
- function Hr(e, t, r) {
598
- return t.__k == null && (t.textContent = ""), ye(e, t), typeof r == "function" && r(), e ? e.__c : null;
599
- }
600
- function Ur(e, t, r) {
601
- return xr(e, t), typeof r == "function" && r(), e ? e.__c : null;
602
- }
603
- ee.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(e) {
604
- Object.defineProperty(ee.prototype, e, { configurable: !0, get: function() {
605
- return this["UNSAFE_" + e];
606
- }, set: function(t) {
607
- Object.defineProperty(this, e, { configurable: !0, writable: !0, value: t });
608
- } });
609
- });
610
- var At = q.event;
611
- function Gn() {
612
- }
613
- function Kn() {
614
- return this.cancelBubble;
615
- }
616
- function Yn() {
617
- return this.defaultPrevented;
618
- }
619
- q.event = function(e) {
620
- return At && (e = At(e)), e.persist = Gn, e.isPropagationStopped = Kn, e.isDefaultPrevented = Yn, e.nativeEvent = e;
621
- };
622
- var ft, Jn = { enumerable: !1, configurable: !0, get: function() {
623
- return this.class;
624
- } }, jt = q.vnode;
625
- q.vnode = function(e) {
626
- typeof e.type == "string" && function(t) {
627
- var r = t.props, n = t.type, o = {};
628
- for (var i in r) {
629
- var s = r[i];
630
- if (!(i === "value" && "defaultValue" in r && s == null || Wn && i === "children" && n === "noscript" || i === "class" || i === "className")) {
631
- var l = i.toLowerCase();
632
- i === "defaultValue" && "value" in r && r.value == null ? i = "value" : i === "download" && s === !0 ? s = "" : l === "ondoubleclick" ? i = "ondblclick" : l !== "onchange" || n !== "input" && n !== "textarea" || Zn(r.type) ? l === "onfocus" ? i = "onfocusin" : l === "onblur" ? i = "onfocusout" : zn.test(i) ? i = l : n.indexOf("-") === -1 && $n.test(i) ? i = i.replace(Qn, "-$&").toLowerCase() : s === null && (s = void 0) : l = i = "oninput", l === "oninput" && o[i = l] && (i = "oninputCapture"), o[i] = s;
633
- }
634
- }
635
- n == "select" && o.multiple && Array.isArray(o.value) && (o.value = ie(r.children).forEach(function(c) {
636
- c.props.selected = o.value.indexOf(c.props.value) != -1;
637
- })), n == "select" && o.defaultValue != null && (o.value = ie(r.children).forEach(function(c) {
638
- c.props.selected = o.multiple ? o.defaultValue.indexOf(c.props.value) != -1 : o.defaultValue == c.props.value;
639
- })), r.class && !r.className ? (o.class = r.class, Object.defineProperty(o, "className", Jn)) : (r.className && !r.class || r.class && r.className) && (o.class = o.className = r.className), t.props = o;
640
- }(e), e.$$typeof = Or, jt && jt(e);
641
- };
642
- var Vt = q.__r;
643
- q.__r = function(e) {
644
- Vt && Vt(e), ft = e.__c;
645
- };
646
- var $t = q.diffed;
647
- q.diffed = function(e) {
648
- $t && $t(e);
649
- var t = e.props, r = e.__e;
650
- r != null && e.type === "textarea" && "value" in t && t.value !== r.value && (r.value = t.value == null ? "" : t.value), ft = null;
651
- };
652
- var Br = { ReactCurrentDispatcher: { current: { readContext: function(e) {
653
- return ft.__n[e.__c].props.value;
654
- } } } };
655
- function Fr(e) {
656
- return J.bind(null, e);
657
- }
658
- function Pe(e) {
659
- return !!e && e.$$typeof === Or;
660
- }
661
- function Ar(e) {
662
- return Pe(e) && e.type === $;
663
- }
664
- function jr(e) {
665
- return Pe(e) ? On.apply(null, arguments) : e;
666
- }
667
- function gt(e) {
668
- return !!e.__k && (ye(null, e), !0);
669
- }
670
- function Vr(e) {
671
- return e && (e.base || e.nodeType === 1 && e) || null;
672
- }
673
- var $r = function(e, t) {
674
- return e(t);
675
- }, zr = function(e, t) {
676
- return e(t);
677
- }, Qr = $;
678
- function _t(e) {
679
- e();
680
- }
681
- function Wr(e) {
682
- return e;
683
- }
684
- function Zr() {
685
- return [!1, _t];
686
- }
687
- var Gr = Le, Kr = Pe;
688
- function Yr(e, t) {
689
- var r = t(), n = F({ h: { __: r, v: t } }), o = n[0].h, i = n[1];
690
- return Le(function() {
691
- o.__ = r, o.v = t, We(o) && i({ h: o });
692
- }, [e, r, t]), V(function() {
693
- return We(o) && i({ h: o }), e(function() {
694
- We(o) && i({ h: o });
695
- });
696
- }, [e]), r;
697
- }
698
- function We(e) {
699
- var t, r, n = e.v, o = e.__;
700
- try {
701
- var i = n();
702
- return !((t = o) === (r = i) && (t !== 0 || 1 / t == 1 / r) || t != t && r != r);
703
- } catch {
704
- return !0;
705
- }
706
- }
707
- var Xn = { useState: F, useId: Tr, useReducer: dt, useEffect: V, useLayoutEffect: Le, useInsertionEffect: Gr, useTransition: Zr, useDeferredValue: Wr, useSyncExternalStore: Yr, startTransition: _t, useRef: G, useImperativeHandle: Cr, useMemo: ne, useCallback: me, useContext: Sr, useDebugValue: pt, version: "17.0.2", Children: Lr, render: Hr, hydrate: Ur, unmountComponentAtNode: gt, createPortal: Dr, createElement: J, createContext: kr, createFactory: Fr, cloneElement: jr, createRef: gr, Fragment: $, isValidElement: Pe, isElement: Kr, isFragment: Ar, findDOMNode: Vr, Component: ee, PureComponent: Ue, memo: Er, forwardRef: ht, flushSync: zr, unstable_batchedUpdates: $r, StrictMode: Qr, Suspense: Ie, SuspenseList: _e, lazy: Rr, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: Br };
708
- const eo = Object.freeze(Object.defineProperty({ __proto__: null, Children: Lr, Component: ee, Fragment: $, PureComponent: Ue, StrictMode: Qr, Suspense: Ie, SuspenseList: _e, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: Br, cloneElement: jr, createContext: kr, createElement: J, createFactory: Fr, createPortal: Dr, createRef: gr, default: Xn, findDOMNode: Vr, flushSync: zr, forwardRef: ht, hydrate: Ur, isElement: Kr, isFragment: Ar, isValidElement: Pe, lazy: Rr, memo: Er, render: Hr, startTransition: _t, unmountComponentAtNode: gt, unstable_batchedUpdates: $r, useCallback: me, useContext: Sr, useDebugValue: pt, useDeferredValue: Wr, useEffect: V, useErrorBoundary: function(e) {
709
- var t = he(ae++, 10), r = F();
710
- return t.__ = e, A.componentDidCatch || (A.componentDidCatch = function(n, o) {
711
- t.__ && t.__(n, o), r[1](n);
712
- }), [r[0], function() {
713
- r[1](void 0);
714
- }];
715
- }, useId: Tr, useImperativeHandle: Cr, useInsertionEffect: Gr, useLayoutEffect: Le, useMemo: ne, useReducer: dt, useRef: G, useState: F, useSyncExternalStore: Yr, useTransition: Zr, version: "17.0.2" }, Symbol.toStringTag, { value: "Module" })), zt = (e) => {
716
- let t;
717
- const r = /* @__PURE__ */ new Set(), n = (s, l) => {
718
- const c = typeof s == "function" ? s(t) : s;
719
- if (!Object.is(c, t)) {
720
- const d = t;
721
- t = l ?? typeof c != "object" ? c : Object.assign({}, t, c), r.forEach((m) => m(t, d));
722
- }
723
- }, o = () => t, i = { setState: n, getState: o, subscribe: (s) => (r.add(s), () => r.delete(s)), destroy: () => r.clear() };
724
- return t = e(n, o, i), i;
725
- };
726
- function to(e) {
727
- return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
728
- }
729
- function ro(e) {
730
- if (Object.prototype.hasOwnProperty.call(e, "__esModule")) return e;
731
- var t = e.default;
732
- if (typeof t == "function") {
733
- var r = function n() {
734
- return this instanceof n ? Reflect.construct(t, arguments, this.constructor) : t.apply(this, arguments);
735
- };
736
- r.prototype = t.prototype;
737
- } else r = {};
738
- return Object.defineProperty(r, "__esModule", { value: !0 }), Object.keys(e).forEach(function(n) {
739
- var o = Object.getOwnPropertyDescriptor(e, n);
740
- Object.defineProperty(r, n, o.get ? o : { enumerable: !0, get: function() {
741
- return e[n];
742
- } });
743
- }), r;
744
- }
745
- var Qt = { exports: {} }, Ze = {};
746
- const Jr = ro(eo);
747
- var Wt, Zt, Gt, Kt, Yt = { exports: {} }, Ge = {};
748
- function no() {
749
- return Zt || (Zt = 1, Yt.exports = function() {
750
- if (Wt) return Ge;
751
- Wt = 1;
752
- var e = Jr, t = typeof Object.is == "function" ? Object.is : function(c, d) {
753
- return c === d && (c !== 0 || 1 / c == 1 / d) || c != c && d != d;
754
- }, r = e.useState, n = e.useEffect, o = e.useLayoutEffect, i = e.useDebugValue;
755
- function s(c) {
756
- var d = c.getSnapshot;
757
- c = c.value;
758
- try {
759
- var m = d();
760
- return !t(c, m);
761
- } catch {
762
- return !0;
763
- }
764
- }
765
- var l = typeof window > "u" || window.document === void 0 || window.document.createElement === void 0 ? function(c, d) {
766
- return d();
767
- } : function(c, d) {
768
- var m = d(), u = r({ inst: { value: m, getSnapshot: d } }), p = u[0].inst, g = u[1];
769
- return o(function() {
770
- p.value = m, p.getSnapshot = d, s(p) && g({ inst: p });
771
- }, [c, m, d]), n(function() {
772
- return s(p) && g({ inst: p }), c(function() {
773
- s(p) && g({ inst: p });
774
- });
775
- }, [c]), i(m), m;
776
- };
777
- return Ge.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : l, Ge;
778
- }()), Yt.exports;
779
- }
780
- var oo = (Kt || (Kt = 1, Qt.exports = function() {
781
- if (Gt) return Ze;
782
- Gt = 1;
783
- var e = Jr, t = no(), r = typeof Object.is == "function" ? Object.is : function(c, d) {
784
- return c === d && (c !== 0 || 1 / c == 1 / d) || c != c && d != d;
785
- }, n = t.useSyncExternalStore, o = e.useRef, i = e.useEffect, s = e.useMemo, l = e.useDebugValue;
786
- return Ze.useSyncExternalStoreWithSelector = function(c, d, m, u, p) {
787
- var g = o(null);
788
- if (g.current === null) {
789
- var h = { hasValue: !1, value: null };
790
- g.current = h;
791
- } else h = g.current;
792
- g = s(function() {
793
- function b(k) {
794
- if (!E) {
795
- if (E = !0, x = k, k = u(k), p !== void 0 && h.hasValue) {
796
- var C = h.value;
797
- if (p(C, k)) return v = C;
798
- }
799
- return v = k;
800
- }
801
- if (C = v, r(x, k)) return C;
802
- var f = u(k);
803
- return p !== void 0 && p(C, f) ? C : (x = k, v = f);
804
- }
805
- var x, v, E = !1, T = m === void 0 ? null : m;
806
- return [function() {
807
- return b(d());
808
- }, T === null ? void 0 : function() {
809
- return b(T());
810
- }];
811
- }, [d, m, u, p]);
812
- var _ = n(c, g[0], g[1]);
813
- return i(function() {
814
- h.hasValue = !0, h.value = _;
815
- }, [_]), l(_), _;
816
- }, Ze;
817
- }()), Qt.exports);
818
- const io = to(oo), { useSyncExternalStoreWithSelector: ao } = io, Jt = (e) => {
819
- const t = typeof e == "function" ? ((n) => n ? zt(n) : zt)(e) : e, r = (n, o) => function(i, s = i.getState, l) {
820
- const c = ao(i.subscribe, i.getState, i.getServerState || i.getState, s, l);
821
- return pt(c), c;
822
- }(t, n, o);
823
- return Object.assign(r, t), r;
824
- }, Xr = (e) => e ? Jt(e) : Jt, so = 1, lo = 2, bt = { eq: (e, t) => e == t, neq(e, t) {
825
- return !this.eq(e, t);
826
- }, gt: (e, t) => e > t, gte: (e, t) => e >= t, lt: (e, t) => e < t, lte: (e, t) => e <= t, list_exact: (e, t) => !(!Array.isArray(e) || !Array.isArray(t)) && e.slice().sort().join(",") === t.slice().sort().join(","), list_all: (e, t) => !(!Array.isArray(e) || !Array.isArray(t)) && !t.some((r) => e.indexOf(r) === -1), list_alo(e, t) {
827
- if (!Array.isArray(t)) return !1;
828
- const r = Array.isArray(e) ? e : [e], n = new Set(r);
829
- return t.some((o) => n.has(o));
830
- }, list_dni(e, t) {
831
- if (!Array.isArray(t)) return !1;
832
- const r = Array.isArray(e) ? e : [e], n = new Set(r);
833
- return t.every((o) => !n.has(o));
834
- }, contains(e, t) {
835
- const r = e.toLowerCase(), n = t.toLowerCase();
836
- return r.includes(n);
837
- }, notcontains(e, t) {
838
- return !this.contains(e, t);
839
- } }, co = (e, t, r) => {
840
- switch (t) {
841
- case "videovoice":
842
- return !!(e && e.value);
843
- case "open":
844
- return !!r;
845
- case "multipleselect":
846
- return !!(r && Object.keys(r).length);
847
- case "recordedtask":
848
- return (r == null ? void 0 : r.taskStatus) === "completed";
849
- case "texturlprompt":
850
- return !e.value;
851
- case "consentlegal":
852
- case "nps":
853
- case "likert":
854
- return r !== null;
855
- case "multiplechoice":
856
- return r !== void 0;
857
- case "matrix":
858
- return !!(r && Object.values(r).every((n) => n !== null));
859
- default:
860
- return !0;
861
- }
862
- }, en = (e, t) => {
863
- if (t === "matrix") {
864
- const r = Object.keys(e).length, n = Object.values(e).filter((o) => o !== null).length;
865
- return n > 0 && n < r;
866
- }
867
- return !1;
868
- }, tn = ({ cards: e, index: t, hasEndCard: r, allResponses: n, uploadProgress: o = {} }) => {
869
- if (t >= e.length || t < 0) return null;
870
- const i = e[t];
871
- let s = t + 1;
872
- const l = i.props.routingOptions || [];
873
- for (let m = 0; m < l.length; m++) {
874
- const { group: u, target: p } = l[m];
875
- if (!(u != null && u.length)) continue;
876
- const g = u[0];
877
- if (g.questionIndex === void 0 || g.questionIndex > n.length) continue;
878
- let h = Xt({ comparator: g.comparator, response: n[g.questionIndex], type: i.type, value: g.value });
879
- for (let _ = 1; _ < u.length; _ += 2) {
880
- const b = u[_], x = u[_ + 1], v = Xt({ comparator: x.comparator, response: n[x.questionIndex], type: e[x.questionIndex].type, value: x.value });
881
- b === so ? h && (h = v) : b === lo && (h || (h = v));
882
- }
883
- if (h) {
884
- s = p === -1 && r ? e.length - 1 : p;
885
- break;
886
- }
887
- }
888
- const c = e.findIndex((m) => m.type === "uploading");
889
- let d;
890
- return d = c > 0 ? r ? e.length - 3 : e.length - 2 : e.length - 1, t >= d || s === -1 || s !== null && s > d ? c > 0 && Object.values(o).some((u) => u.isSubmitted && !u.isComplete) ? c : r ? e.length - 1 : null : s === -1 ? null : s;
891
- }, Xt = ({ comparator: e, response: t, type: r, value: n }) => {
892
- if (e === "answered") switch (r) {
893
- case "texturlprompt":
894
- return t === void 0;
895
- case "consentlegal":
896
- return t && t.submitted === !0;
897
- case "recordedtask":
898
- return "taskStatus" in t && t.taskStatus === "completed";
899
- case "likert":
900
- case "nps":
901
- return Number.isInteger(t);
902
- case "rankorder":
903
- case "matrix":
904
- return Object.values(t).every((o) => o !== null);
905
- case "multiplechoice":
906
- return t !== void 0;
907
- case "multipleselect":
908
- return (t == null ? void 0 : t.length) > 0;
909
- case "open":
910
- return t && t.length > 0;
911
- case "videovoice":
912
- return !!(t != null && t.mediaRecordingUid);
913
- default:
914
- return !1;
915
- }
916
- if (e === "given_up") return r !== "recordedtask" || "taskStatus" in t && t.taskStatus === "given.up";
917
- if (e === "partial") return r === "matrix" && en(t, r);
918
- if (e === "skipped") switch (r) {
919
- case "texturlprompt":
920
- return t == null ? void 0 : t.skipped;
921
- case "consentlegal":
922
- case "likert":
923
- case "nps":
924
- case "videovoice":
925
- return t === null;
926
- case "recordedtask":
927
- return "taskStatus" in t && t.taskStatus === "abandoned";
928
- case "open":
929
- case "multipleselect":
930
- return (t == null ? void 0 : t.length) === 0;
931
- case "multiplechoice":
932
- return t === void 0;
933
- case "matrix":
934
- return Object.values(t).every((o) => o === null);
935
- case "rankorder":
936
- return t === null || Object.values(t).some((o) => o === null);
937
- default:
938
- return !1;
939
- }
940
- return bt[e](t, n);
941
- }, uo = (e) => {
942
- var n, o, i;
943
- switch (e.type) {
944
- case "multipleselect":
945
- return e && e.props && e.props.options ? e.props.options.length > 13 ? e.props.options.map((s) => [s.value]) : (t = e.props.options.map((s) => s.value), r = !e.props.properties.required, t.reduce((s, l) => s.concat(s.map((c) => [...c, l])), [[]]).filter((s) => r || s.length > 0)) : null;
946
- case "multiplechoice": {
947
- if (!e || !e.props || !e.props.options) return null;
948
- const s = e.props.options.map((l) => l.value);
949
- return e.props.properties.required || s.push(void 0), s;
950
- }
951
- case "matrix": {
952
- if (!((n = e == null ? void 0 : e.props) != null && n.options)) return null;
953
- const s = e.props.properties.matrixColumn, l = e.props.options, c = l.reduce((m, u) => (m[u.id] = null, m), {}), d = [{ ...c, [l[0].id]: s[0].value }, l.reduce((m, u) => (m[u.id] = s[0].value, m), {})];
954
- return e.props.properties.required || d.push(c), d;
955
- }
956
- case "likert": {
957
- const s = Number((i = (o = e.props) == null ? void 0 : o.properties) == null ? void 0 : i.range) || 5;
958
- return [...Array.from(Array(s).keys()).map((c) => c + 1), ...e.props.properties.required ? [] : [null]];
959
- }
960
- case "nps":
961
- return [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ...e.props.properties.required ? [] : [null]];
962
- case "videovoice":
963
- case "open":
964
- return ["1", ...e.props.properties.required ? [] : [""]];
965
- case "recordedtask": {
966
- const s = [{ taskStatus: "completed" }, { taskStatus: "given.up" }];
967
- return e.props.properties.required || s.push({ taskStatus: "abandoned" }), s;
968
- }
969
- case "texturlprompt":
970
- return [void 0, ...e.props.properties.required ? [] : [{ skipped: !0 }]];
971
- case "consentlegal":
972
- return [1, ...e.props.properties.required ? [] : [null]];
973
- default:
974
- return [1];
975
- }
976
- var t, r;
977
- }, po = (e) => e in bt, mo = (e) => typeof e == "object" && e !== null && "taskStatus" in e, ho = (e, t = []) => t.reduce((r, n) => {
978
- const { group: o, target: i } = n;
979
- if (!(o != null && o.length)) return [...r];
980
- const s = o.filter((l) => !!Number(l) || typeof l == "object" && l.questionIndex === e).map((l) => {
981
- const { comparator: c, value: d } = l;
982
- return { comparator: c, target: i, value: d };
983
- });
984
- return [...r, ...s];
985
- }, []), Ke = /* @__PURE__ */ new Set(["thanks", "uploading"]), O = Xr()((e, t) => ({ allResponses: [], answers: void 0, apiURL: "", border: "#000000", cards: [], close: async (r = be) => {
986
- const n = t(), { fadeout: o, remove: i, trackHistory: s, studyType: l } = n;
987
- await o(r), Ye(n) || s({ event: "closed" }), In.info("SurveyClosing", { surveyId: n.surveyId }), kt.enable(), i({ initiator: wt.Closed, studyType: l });
988
- }, configureExitOnOverlayClick: () => {
989
- }, customMetadata: {}, destroy: async (r) => {
990
- const { eventEmitFn: n, fadeout: o, remove: i, studyType: s, surveyId: l } = t();
991
- n("survey.complete", l), await o(r), kt.enable(), i({ initiator: wt.Complete, studyType: s });
992
- }, endCard: { headline: "" }, envId: "", eventEmitFn: Ce.emit.bind(Ce), fadeout: async (r) => {
993
- const { eventEmitFn: n, headers: o, viewDocument: i } = t();
994
- return Oe(o) ? Promise.resolve() : (n(X.SurveyFadingOut), new Promise((s) => {
995
- const l = i.getElementById(r);
996
- l ? (l.addEventListener("transitionend", () => {
997
- s();
998
- }), l.classList.remove("ul-app--visible")) : s();
999
- }));
1000
- }, forceBrandedLogo: !1, frame: document.createElement("iframe"), handleClickEmbedButton: (r) => {
1001
- const { cards: n, eventEmitFn: o, index: i } = t();
1002
- o(r, { qid: n[i].name, props: n[i].props }), e(() => ({ hasViewedEmbed: !0 }));
1003
- }, handleUploadUpdate: ({ mediaRecordingUid: r, isComplete: n, progressPct: o, isSubmitted: i }) => {
1004
- var g, h, _;
1005
- const { cards: s, destroy: l, index: c, uploadProgress: d } = t(), m = n || ((g = d[r]) == null ? void 0 : g.isComplete), u = { ...d, [r]: { progressPct: m ? 100 : o || ((h = d[r]) == null ? void 0 : h.progressPct), isComplete: m, isSubmitted: i || ((_ = d[r]) == null ? void 0 : _.isSubmitted) } };
1006
- if (e({ uploadProgress: u }), s[c].type !== "uploading") return;
1007
- const p = Object.entries(d).every(([b, x]) => !x.isSubmitted || x.isComplete || r == b && n);
1008
- if (p && c >= s.length - 1) return l(be);
1009
- e({ index: p ? c + 1 : c, uploadingCardViewed: !0 });
1010
- }, hasViewedEmbed: !1, headers: { Authorization: "", "Content-Type": "", "userleap-platform": "web", "x-ul-environment-id": "", "x-ul-installation-method": "web-snippet", "x-ul-sdk-version": "", "x-ul-visitor-id": "" }, index: 0, isPreview: !1, marketingUrl: "https://sprig.com", meta: { ch: 0, cw: 0, l: "", mode: null, p: "", sh: 0, sw: 0 }, mode: void 0, next: (r) => {
1011
- const { allResponses: n, cards: o, eventEmitFn: i, index: s, responseGroupUid: l, submit: c, trackHistory: d, uploadProgress: m, viewedCardCount: u } = t();
1012
- e({ minScrollableHeight: void 0 });
1013
- const p = Array.isArray(r.data) ? r.data : [r.data], g = Date.now(), h = [...o], _ = { response: [], responseGroupUid: l, questionIndex: s };
1014
- let b = null;
1015
- const x = n.slice(0);
1016
- p.forEach((T, k) => {
1017
- const C = h[s + k], { type: f, ...I } = T, S = { ...I, answeredAt: g }, P = S.value;
1018
- ((w) => w && !Ke.has(w.type))(C) && (C.value = P), _.response.push(S);
1019
- let y = P;
1020
- f !== "multipleselect" && f !== "multiplechoice" || P === null || (y = f === "multiplechoice" ? Object.values(P).find((w) => w !== !1) : P, f === "multipleselect" && (y = h[s + k].props.options.reduce((w, L) => (P[L.id] && w.push(L.value), w), []))), x[s + k] = y, b = tn({ cards: h, index: s + k, hasEndCard: !!r.endCard, uploadProgress: m, allResponses: x });
1021
- }), e({ allResponses: x }), (b === null || Ke.has(h[b].type)) && (_.completedAt = g);
1022
- const v = c(_);
1023
- if (b === null) return void r.completeSurvey();
1024
- b && !Ke.has(h[b].type) && v.finally(() => {
1025
- d({ event: "seen", index: b });
1026
- });
1027
- const E = h[b];
1028
- h[b] && i && i("survey.question", { qid: E.name, props: E.props }), e({ cards: h, hasViewedEmbed: !1, index: b, viewedCardCount: u + 1 });
1029
- }, pendingRemoveIframeReason: null, previewKey: null, previewMode: void 0, recorder: () => {
1030
- }, recorderEventEmitter: Ce, resolveTrackedPromise: () => {
1031
- const { removeIframeIfReady: r } = t();
1032
- e((n) => ({ unresolvedRequestCount: n.unresolvedRequestCount - 1 })), r();
1033
- }, responseGroupUid: "", remove: ({ initiator: r, studyType: n }) => {
1034
- const { eventEmitFn: o, removeIframeIfReady: i, surveyId: s } = t();
1035
- e({ pendingRemoveIframeReason: r, studyType: n }), o(X.SurveyCloseRequested, { name: X.SurveyCloseRequested, initiator: r, studyType: n, "survey.id": s }), i();
1036
- }, removeIframeIfReady: () => {
1037
- const { eventEmitFn: r, pendingRemoveIframeReason: n, unresolvedRequestCount: o, studyType: i, surveyId: s } = t();
1038
- n && o === 0 && (r(X.SurveyWillClose, { name: X.SurveyWillClose, initiator: n, studyType: i, "survey.id": s }), e({ pendingRemoveIframeReason: null, studyType: i }));
1039
- }, seen: async () => {
1040
- const { trackHistory: r } = t();
1041
- return r({ event: "seen", isNew: !0 });
1042
- }, slugName: null, showStripes: !1, showSurveyBrand: !1, styleNonce: "", submit: async ({ completedAt: r, questionIndex: n, response: o, responseGroupUid: i }) => {
1043
- const s = t();
1044
- if (!i || Ye(s)) return;
1045
- const l = { responseGroupUid: i, meta: s.meta, customMetadata: s.customMetadata, responses: o, completedAt: r, previewKey: s.previewKey }, c = await s.trackPromise(Je(`${s.apiURL}/sdk/1/environments/${s.envId}/visitors/${s.userId}/responses/submit`, { body: JSON.stringify(l), headers: s.headers, method: "POST" }));
1046
- c.ok ? o.forEach((d, m) => {
1047
- s.eventEmitFn(X.QuestionAnswered, { ...d, questionIndex: n ? n + m : void 0, "survey.id": s.surveyId });
1048
- }) : c.reportError && (console.warn("[Sprig] (ERR-427) Failed to submit response", c.error), await s.trackPromise(er(s, "submitResponse", c.error)));
1049
- }, surveyId: 0, tabTitle: "", trackHistory: async ({ event: r, index: n, isNew: o = !1 }) => {
1050
- const i = t();
1051
- if (Ye(i)) return;
1052
- const { cards: s, index: l } = i;
1053
- let c = n ?? l, d = s[c];
1054
- for (; d; ) {
1055
- const m = { sid: i.surveyId, qid: d.name, action: r, vid: i.userId, eid: i.envId, isNew: o, responseGroupUid: i.responseGroupUid, previewKey: i.previewKey }, u = await i.trackPromise(Je(`${i.apiURL}/sdk/1/visitors/${i.userId}/surveys/${i.surveyId}/history`, { method: "POST", headers: i.headers, body: JSON.stringify(m) }));
1056
- !u.ok && u.reportError && (console.warn("[Sprig] (ERR-428) Failed to track survey event", u.error), await i.trackPromise(er(i, "trackHistory", u.error)));
1057
- const p = s[c + 1];
1058
- if (!d.groupId || !(p != null && p.groupId) || p.groupId !== d.groupId) break;
1059
- c++, d = p, o = !1;
1060
- }
1061
- }, trackPromise: async (r) => {
1062
- const { resolveTrackedPromise: n } = t();
1063
- return e((o) => ({ unresolvedRequestCount: o.unresolvedRequestCount + 1 })), r.then((o) => (n(), o)).catch((o) => {
1064
- throw n(), o;
1065
- });
1066
- }, unresolvedRequestCount: 0, update: () => {
1067
- const { cards: r, index: n, headers: o, eventEmitFn: i, frame: s, useMobileStyling: l, surveyId: c, viewDocument: d } = t(), m = o["userleap-platform"] === "web", u = Oe(o), p = r[n], g = p.type === "matrix" && !(p.props.properties.displayMatrixAsAccordion || l);
1068
- e({ minScrollableHeight: void 0 }), setTimeout(() => {
1069
- var x, v, E;
1070
- !u && !l && ((x = s == null ? void 0 : s.setWidth) == null || x.call(s, Sn));
1071
- const [h, _, b] = Tn(d, m && !l, u);
1072
- u ? (i(X.SurveyHeight, { name: X.SurveyHeight, contentFrameHeight: h, "survey.id": c }), i(X.SurveyWidth, { name: X.SurveyWidth, contentFrameWidth: _, "survey.id": c })) : ((v = s.setHeight) == null || v.call(s, h), e({ minScrollableHeight: b }), !l && g && ((E = s.setWidth) == null || E.call(s, _)));
1073
- }, 100);
1074
- }, uploadingCardViewed: !1, uploadProgress: {}, useDesktopPrototype: void 0, useMobileStyling: !1, userId: "", viewDocument: window.document, viewedCardCount: 0, focusedQuestionId: null, setFocusedQuestionId: (r) => e({ focusedQuestionId: r }) })), Ye = (e) => !e.userId || e.meta && e.meta.mode === "test" || e.isPreview || e.previewMode, er = async (e, t, r) => {
1075
- const { mode: n, userId: o, envId: i, apiURL: s, headers: l, viewDocument: c } = e, d = c.documentElement, m = { mode: n, screenWidth: window.screen.width, screenHeight: window.screen.height, clientWidth: d.clientWidth, clientHeight: d.clientHeight, location: window.location.href, language: window.navigator.language }, u = { action: t, err: { message: `${r == null ? void 0 : r.name} - ${r == null ? void 0 : r.message}`, stack: r == null ? void 0 : r.stack }, meta: m, vid: o, envId: i };
1076
- (await Je(`${s}/sdk/1/errors`, { method: "POST", headers: Object.assign({ "x-ul-error": window.btoa(`userleap-${Date.now()}-error`) }, l), body: JSON.stringify(u) })).ok || console.warn("[Sprig] (ERR-444) Failed to report error to API", r);
1077
- }, rn = (e) => J("svg", { fill: "none", height: 24, viewBox: "0 0 24 24", width: 24, xmlns: "http://www.w3.org/2000/svg", ...e }, J("path", { d: "M17 10L12 15L7 10", stroke: "#0B2330", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5 })), nn = (e) => J("svg", { fill: "none", height: 10, viewBox: "0 0 10 10", width: 10, xmlns: "http://www.w3.org/2000/svg", ...e }, J("path", { d: "M9.15377 1.30774L4.07685 8.23082L1.30762 5.00005", stroke: "white", strokeLinecap: "round", strokeWidth: 2 })), fo = ({ visible: e }) => a("div", { className: "sprig-check-background", style: { opacity: e ? 1 : 0 }, children: a(nn, { className: "sprig-check" }) }), tr = "250ms", go = ht(({ animate: e, children: t, header: r, isOpen: n, onClick: o, showHeaderCheck: i }, s) => {
1078
- const l = G(null), [c, d] = F(0), [m, u] = F("none"), [p, g] = F(!0);
1079
- return V(() => {
1080
- var _;
1081
- const h = (_ = l.current) == null ? void 0 : _.getBoundingClientRect();
1082
- d(n && h ? h.height : 0);
1083
- }, [n]), V(() => {
1084
- !c && n || !p || g(!1), u(e && !p ? `height ${tr} ease` : "none");
1085
- }, [e, p, c, n]), a("div", { className: "sprig-accordion", ref: s, children: [a("button", { className: "sprig-accordion-header-container", onClick: o, type: "button", children: [a("div", { className: "sprig-header-label-container", children: [a("span", { className: "sprig-header-label", children: r }), a(fo, { visible: i })] }), a(rn, { className: "sprig-caret", style: { transitionDuration: e ? tr : "0", transform: n ? "rotate(-180deg)" : "none" } })] }), a("div", { className: "sprig-accordion-body", style: { transition: m, height: c }, children: a("div", { ref: l, children: t }) })] });
1086
- }), vt = ({ style: e, stroke: t = "black" }) => a("svg", { fill: "none", height: "10", style: e, viewBox: "0 0 12 10", width: "12", xmlns: "http://www.w3.org/2000/svg", children: [a("path", { d: "M1.47839 5.2085L10.9384 5.2085", stroke: t, strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1.35" }), a("path", { d: "M7.0686 1.15845L10.9386 5.20845L7.0686 9.25845", stroke: t, strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1.35" })] }), R = (...e) => e.filter(Boolean).join(" "), W = (e, t, r) => {
1087
- const n = t ? "--mobile" : "--desktop";
1088
- return `${e + n} ${e + (r ? `${n}_${r}` : "")} ${e}`;
1089
- }, _o = (e, t) => `${e} ${e}__${t}`, K = (e) => a("button", { ...e, className: R("ul-card-text__button", e.className), id: "ul-card-text__button" }), on = () => {
1090
- const { viewDocument: e } = O((n) => ({ viewDocument: n.viewDocument })), [t, r] = F(!1);
1091
- return V(() => {
1092
- const n = e.querySelector(".sprig-question-body"), o = new ResizeObserver(() => {
1093
- window.requestAnimationFrame(() => {
1094
- r(!!(n && Nn(n) && n.scrollHeight > n.offsetHeight));
1095
- });
1096
- });
1097
- return n && o.observe(n), () => {
1098
- n && o.disconnect();
1099
- };
1100
- }, [e]), t;
1101
- }, rr = ({ plainText: e, richText: t, id: r, className: n, isHeader: o }) => t ? a("div", { className: n, dangerouslySetInnerHTML: { __html: t }, id: r }) : e ? a(o ? "h1" : "p", { className: n, id: r, children: e }) : null, bo = () => {
1102
- const { cards: e, close: t, endCard: r, headers: n, index: o } = O((l) => ({ cards: l.cards, close: l.close, endCard: l.endCard, headers: l.headers, index: l.index, useMobileStyling: l.useMobileStyling })), i = e.length, s = ne(() => () => t(be), [t]);
1103
- return ["email", "link"].includes(n["userleap-platform"]) || r && o + 1 === i ? null : a("div", { "aria-label": "Close button", className: "close-btn", onClick: s, onKeyPress: (l) => {
1104
- l.key === "Enter" && s();
1105
- }, role: "button", tabIndex: 0, children: a("svg", { fill: "none", height: "16px", viewBox: "0 0 13 13", width: "16px", xmlns: "http://www.w3.org/2000/svg", children: a("path", { d: "M2.54964 1.78369L1.78369 2.54964L5.73405 6.5L1.78369 10.4504L2.54964 11.2163L6.5 7.26595L10.4504 11.2163L11.2163 10.4504L7.26595 6.5L11.2163 2.54964L10.4504 1.78369L6.5 5.73405L2.54964 1.78369Z", fill: "#262136" }) }) });
1106
- }, te = ({ message: e, properties: t }) => {
1107
- const r = G(null), n = t == null ? void 0 : t.captionText, o = on();
1108
- return a("div", { className: R("question-header-container", "sprig-header-container", o ? "sprig-border-bottom" : null), ref: r, children: [a("div", { className: "question-header-button-container", children: [a(rr, { className: "ul-question", id: "ul-question", isHeader: !0, plainText: e, richText: t == null ? void 0 : t.questionHtml }), a(bo, {})] }), a(rr, { className: "ul-caption", id: "ul-caption", plainText: n, richText: t == null ? void 0 : t.captionHtml })] });
1109
- }, vo = () => a("svg", { fill: "none", height: "10", viewBox: "0 0 13 10", width: "13", xmlns: "http://www.w3.org/2000/svg", children: a("path", { d: "M11.5 1.5L4.5 8.5L1 5", stroke: "#FFFFFF", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1.5" }) }), Ae = ({ isSubmitDisabled: e, handleSubmit: t }) => a("div", { className: "ul-card-longform__submit-button-container", children: a(K, { className: "ul-card-longform__submit-button", disabled: e, onClick: t, children: ["OK ", a(vo, {})] }) }), nr = ({ buttonText: e = "View Prototype", handleClick: t }) => a("button", { className: "prototype-button", onClick: t, children: e }, "prototype-btn"), se = ({ defaultBody: e, embeddedType: t = "prototype", properties: r }) => {
1110
- var u;
1111
- const { handleClickEmbedButton: n, hasViewedEmbed: o, headers: i, useDesktopPrototype: s } = O((p) => ({ handleClickEmbedButton: p.handleClickEmbedButton, hasViewedEmbed: p.hasViewedEmbed, headers: p.headers, useDesktopPrototype: p.useDesktopPrototype })), l = (r == null ? void 0 : r.conceptUrl) || ((u = r == null ? void 0 : r.consentDocument) == null ? void 0 : u.url), c = window.innerWidth < En, d = i["userleap-platform"], m = (p, g) => {
1112
- p.preventDefault(), n(g);
1113
- };
1114
- if (!s && c && !o && l && ["email", "link"].includes(d)) {
1115
- if (t === "prototype") return a(nr, { handleClick: (p) => {
1116
- m(p, "question.prototype.click");
1117
- } });
1118
- if (t === "pdf") return a(nr, { buttonText: (r == null ? void 0 : r.viewDocumentText) || "View Document", handleClick: (p) => {
1119
- m(p, "question.agreement.click");
1120
- } });
1121
- }
1122
- return e();
1123
- }, an = ({ isSelected: e, id: t, divId: r, themeColor: n }) => a("div", { "aria-checked": e, "aria-labelledby": `label-${t}`, className: "select-checkbox", id: r, role: "checkbox", style: e ? { backgroundColor: n, borderColor: n, boxShadow: "none" } : {}, tabIndex: 0, children: e && a(nn, {}) }), sn = (e, t) => {
1124
- const r = G(0);
1125
- return () => {
1126
- if (e.current) {
1127
- const n = e.current;
1128
- n.style.height = "1px";
1129
- const o = n.scrollHeight + (n.offsetHeight - n.clientHeight), i = parseInt(window.getComputedStyle(n).getPropertyValue("max-height")), s = o <= i ? o : i;
1130
- r.current !== s && t(), r.current = s, n.style.height = `${s}px`;
1131
- }
1132
- };
1133
- }, je = ({ ariaLabel: e, border: t, choiceStyle: r = {}, label: n, isSelected: o, value: i, text: s, id: l, isRadio: c, useMobileStyling: d, error: m, allowTextEntry: u, noneOfTheAbove: p, promptText: g, onUserInputChanged: h }) => {
1134
- const { styleNonce: _, viewDocument: b } = O((w) => ({ styleNonce: w.styleNonce, viewDocument: w.viewDocument })), [x, v] = F(!1);
1135
- xo(b, t, _);
1136
- const E = ({ isSelected: w, userText: L }) => {
1137
- h && h({ id: l, selected: w, value: i, userText: L, noneOfTheAbove: p });
1138
- }, T = (w) => {
1139
- w.stopPropagation(), E({ isSelected: c || !o, userText: s }), v(!1);
1140
- }, k = () => {
1141
- x || v(!0);
1142
- }, C = () => {
1143
- x && v(!1);
1144
- }, f = { onClick: (w) => T(w), onKeyPress: (w) => ((L) => {
1145
- L.key !== "Enter" && L.key !== " " || T(L);
1146
- })(w) };
1147
- "ontouchstart" in b.documentElement ? (f.onTouchStart = C, f.onTouchCancel = C, f.onTouchEnd = C) : (f.onMouseDown = k, f.onMouseLeave = C);
1148
- const I = c ? `radio-${l}` : `checkbox-${l}`, S = o || x ? [De] : [], P = [...m ? [ln] : [], ...S], y = n ? { "aria-labelledby": `label-${l}` } : { "aria-label": e };
1149
- return a("div", { className: R(W("choice", d), ...P), id: `choice-div-${l}`, style: { ...r, ...m ? { borderColor: Se } : {} }, ...f, children: [a("div", { className: R("choice-label-container"), children: [c ? a("div", { ...y, className: R("select-radio", ...S), id: I, role: "radio", tabIndex: 0 }) : a(an, { divId: I, id: l, isSelected: o, themeColor: t }), n && a("label", { className: R(W("select-label", d)), htmlFor: I, id: `label-${l}`, children: n })] }), u && o && a("div", { className: R("choice-text-entry-container", ...S), children: a(yo, { onTextChange: (w) => E({ isSelected: o, userText: w }), promptText: g || "Please specify", textValue: s, useMobileStyling: d }) })] });
1150
- }, yo = ({ promptText: e, textValue: t, onTextChange: r, useMobileStyling: n }) => {
1151
- const o = G(null), { update: i } = O((l) => ({ update: l.update })), s = sn(o, () => i());
1152
- return V(() => (s(), o.current && o.current.focus(), () => {
1153
- i();
1154
- }), []), a("textarea", { "aria-label": e, "aria-multiline": "true", "aria-placeholder": e, className: R(W("choice-text-input", n)), "data-gramm": "false", maxLength: 5e3, name: "text", onChange: (l) => {
1155
- s(), l.stopPropagation(), r(l.currentTarget.value);
1156
- }, onClick: (l) => {
1157
- l.stopPropagation();
1158
- }, onKeyPress: (l) => {
1159
- l.stopPropagation();
1160
- }, placeholder: e, ref: o, role: "textbox", rows: 1, value: t });
1161
- }, or = "ul-select-style-element", De = "ul-select-active-dynamic-style", ln = "ul-select-error-dynamic-style", xo = (e, t, r) => {
1162
- let n = e.getElementById(or), o = !1;
1163
- n || (n = e.createElement("style"), o = !0), n.tagName.toLowerCase() === "style" && (n.id = or, r && (n.nonce = r), n.textContent = ko(t), o && e.head.appendChild(n));
1164
- }, ko = (e) => `
1165
- .${De} {
1166
- border-color: ${e};
1167
- }
1168
- .${De} .select-radio, .${De}.select-radio {
1169
- border: 6px solid ${e};
1170
- box-shadow: none;
1171
- }
1172
- .${ln} {
1173
- border-color: ${Se};
1174
- }
1175
- `, le = ({ children: e }) => a("div", { className: "sprig-question-body", children: e }), ue = ({ children: e }) => {
1176
- const t = on();
1177
- return a("div", { className: R("sprig-question-footer-container", t ? "sprig-border-top" : null), children: e });
1178
- }, cn = ({ logoOnly: e = !1, style: t = {} }) => a("svg", { alt: (e ? "Powered by " : "") + "Sprig", width: e ? "35" : "112", height: "15", viewBox: e ? "79 0 31 15" : "0 0 112 15", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: { display: "block", ...t }, children: [!e && a("path", { d: "M0.648926 12.0181V2.8584H4.21631C6.0127 2.8584 7.25684 4.06445 7.25684 5.86084V5.87354C7.25684 7.66357 6.0127 8.88867 4.21631 8.88867H2.0708V12.0181H0.648926ZM3.86084 4.05811H2.0708V7.69531H3.86084C5.09229 7.69531 5.80957 7.02881 5.80957 5.87988V5.86719C5.80957 4.72461 5.09229 4.05811 3.86084 4.05811ZM11.6621 12.1514C9.63721 12.1514 8.39941 10.7993 8.39941 8.57764V8.56494C8.39941 6.34961 9.64355 4.99121 11.6621 4.99121C13.6743 4.99121 14.9185 6.34326 14.9185 8.56494V8.57764C14.9185 10.7993 13.6807 12.1514 11.6621 12.1514ZM11.6621 11.0024C12.8428 11.0024 13.5156 10.1011 13.5156 8.57764V8.56494C13.5156 7.03516 12.8428 6.14014 11.6621 6.14014C10.4751 6.14014 9.80859 7.03516 9.80859 8.56494V8.57764C9.80859 10.1074 10.4751 11.0024 11.6621 11.0024ZM17.6226 12.0181L15.7183 5.12451H17.1021L18.3398 10.4438H18.4414L19.8633 5.12451H21.1709L22.5928 10.4438H22.7007L23.9321 5.12451H25.2969L23.3989 12.0181H21.9834L20.5552 6.87646H20.4473L19.0254 12.0181H17.6226ZM29.334 12.1514C27.3154 12.1514 26.0967 10.7739 26.0967 8.59033V8.58398C26.0967 6.43213 27.3408 4.99121 29.2642 4.99121C31.1875 4.99121 32.3682 6.38135 32.3682 8.45068V8.93311H27.4805C27.5059 10.2534 28.2295 11.0215 29.3657 11.0215C30.248 11.0215 30.7749 10.5835 30.9399 10.228L30.9653 10.1772L32.292 10.1709L32.2793 10.228C32.0508 11.1357 31.0986 12.1514 29.334 12.1514ZM29.2705 6.12109C28.3311 6.12109 27.6201 6.76221 27.4995 7.94922H31.0034C30.8955 6.71777 30.2036 6.12109 29.2705 6.12109ZM34.0059 12.0181V5.12451H35.3833V6.16553H35.4849C35.7324 5.43555 36.3735 5.00391 37.2939 5.00391C37.5161 5.00391 37.7573 5.03564 37.897 5.06738V6.33691C37.6494 6.28613 37.4146 6.25439 37.1543 6.25439C36.1006 6.25439 35.3833 6.90186 35.3833 7.89844V12.0181H34.0059ZM41.9277 12.1514C39.9092 12.1514 38.6904 10.7739 38.6904 8.59033V8.58398C38.6904 6.43213 39.9346 4.99121 41.8579 4.99121C43.7812 4.99121 44.9619 6.38135 44.9619 8.45068V8.93311H40.0742C40.0996 10.2534 40.8232 11.0215 41.9595 11.0215C42.8418 11.0215 43.3687 10.5835 43.5337 10.228L43.5591 10.1772L44.8857 10.1709L44.873 10.228C44.6445 11.1357 43.6924 12.1514 41.9277 12.1514ZM41.8643 6.12109C40.9248 6.12109 40.2139 6.76221 40.0933 7.94922H43.5972C43.4893 6.71777 42.7974 6.12109 41.8643 6.12109ZM49.1133 12.1323C47.3804 12.1323 46.2568 10.7422 46.2568 8.57764V8.56494C46.2568 6.38135 47.3613 5.00391 49.1133 5.00391C50.0591 5.00391 50.8652 5.47363 51.2334 6.21631H51.3413V2.42041H52.7124V12.0181H51.3413V10.9326H51.2334C50.8335 11.688 50.0781 12.1323 49.1133 12.1323ZM49.5068 10.958C50.6558 10.958 51.3604 10.0503 51.3604 8.57764V8.56494C51.3604 7.09229 50.6494 6.18457 49.5068 6.18457C48.3516 6.18457 47.6597 7.08594 47.6597 8.56494V8.57764C47.6597 10.0566 48.3516 10.958 49.5068 10.958ZM61.98 12.1323C61.0151 12.1323 60.2598 11.688 59.8599 10.9326H59.7583V12.0181H58.3809V2.42041H59.7583V6.21631H59.8599C60.228 5.47363 61.0342 5.00391 61.98 5.00391C63.7319 5.00391 64.8364 6.38135 64.8364 8.56494V8.57764C64.8364 10.7422 63.7192 12.1323 61.98 12.1323ZM61.5928 10.958C62.7417 10.958 63.4336 10.0566 63.4336 8.57764V8.56494C63.4336 7.08594 62.7417 6.18457 61.5928 6.18457C60.4438 6.18457 59.7329 7.09229 59.7329 8.56494V8.57764C59.7329 10.0503 60.4438 10.958 61.5928 10.958ZM66.8867 14.4429C66.7153 14.4429 66.5122 14.4302 66.3345 14.4111V13.3257C66.4678 13.3447 66.6392 13.3511 66.7979 13.3511C67.439 13.3511 67.8262 13.0781 68.0293 12.3799L68.1309 12.0244L65.6299 5.12451H67.1152L68.8418 10.6343H68.9624L70.6826 5.12451H72.1299L69.5654 12.2847C68.9814 13.9287 68.2832 14.4429 66.8867 14.4429Z", fill: "black", fillOpacity: "0.7" }), a("path", { d: "M81.1088 6.63629C79.6878 6.32154 78.9672 5.76865 78.9672 4.99369C78.9672 4.19299 79.736 3.5886 80.7556 3.5886C81.8066 3.5886 82.5995 4.25285 82.5995 5.13336V5.20352H84.0518V5.13336C84.0518 3.52424 82.6405 2.30774 80.7693 2.30774C79.8676 2.30774 79.0414 2.58451 78.4433 3.08655C78.1463 3.33144 77.9077 3.63818 77.7448 3.98479C77.5818 4.33141 77.4984 4.70934 77.5005 5.09153C77.4946 5.44197 77.5675 5.78934 77.714 6.10857C77.8605 6.42779 78.0769 6.71092 78.3475 6.93752C78.8512 7.37584 79.5659 7.70024 80.4709 7.90299C81.9949 8.23898 82.7676 8.81054 82.7676 9.60094C82.7676 10.4576 81.9258 11.1032 80.813 11.1032C79.6571 11.1032 78.7854 10.3856 78.7854 9.43424V9.36408H77.3318V9.43424C77.3318 11.1167 78.8219 12.3847 80.7973 12.3847C81.7421 12.3847 82.6093 12.0983 83.2393 11.5769C83.5519 11.3237 83.8034 11.0048 83.9753 10.6433C84.1472 10.2818 84.2352 9.88702 84.2329 9.48766C84.2329 8.05875 83.1833 7.09907 81.1088 6.63629Z", fill: "black", fillOpacity: "0.7" }), a("path", { d: "M89.2394 4.68276C88.6963 4.67605 88.1596 4.79915 87.6751 5.04156C87.1905 5.28397 86.7725 5.63851 86.4566 6.07497V4.85204H85.0747V14.8479H86.4566V11.0356C86.7725 11.472 87.1906 11.8265 87.6751 12.0688C88.1596 12.3111 88.6963 12.434 89.2394 12.4272C91.3836 12.4272 93 10.7627 93 8.55495C93 6.34723 91.3836 4.68276 89.2394 4.68276ZM91.5608 8.84202C91.5057 9.41605 91.2512 9.95356 90.8406 10.3633C90.4299 10.773 89.8883 11.0296 89.3078 11.0896C88.5363 11.1669 87.8177 10.9461 87.2841 10.4692C86.7505 9.99222 86.4566 9.3106 86.4566 8.55495C86.4566 7.10159 87.5538 6.00546 89.0087 6.00546C89.7619 6.00546 90.4421 6.29124 90.9171 6.81002C91.407 7.34232 91.6357 8.06385 91.5608 8.84202Z", fill: "black", fillOpacity: "0.7" }), a("path", { d: "M109.95 4.85407V6.06349C109.298 5.18298 108.292 4.68286 107.153 4.68286C105.017 4.68286 103.406 6.31709 103.406 8.48426C103.406 10.6514 105.017 12.285 107.153 12.285C108.296 12.285 109.303 11.79 109.95 10.9185V11.1046C109.95 12.6101 108.993 13.5826 107.513 13.5826C106.513 13.5826 105.68 13.1494 105.284 12.424L105.264 12.3867H103.838L103.871 12.48C104.112 13.1892 104.583 13.8001 105.211 14.2179C105.841 14.6324 106.637 14.8512 107.513 14.8512C108.637 14.8512 109.594 14.4972 110.28 13.8285C110.967 13.1597 111.332 12.2194 111.332 11.1213V4.85407H109.95ZM109.175 10.3502C108.588 10.905 107.752 11.138 106.879 10.9887C106.361 10.8984 105.886 10.6475 105.523 10.2725C105.16 9.89751 104.927 9.41787 104.859 8.90328C104.736 8.03757 104.999 7.21756 105.581 6.655C106.069 6.19093 106.723 5.93643 107.401 5.94699C107.565 5.94713 107.729 5.96026 107.891 5.98625C108.946 6.15489 109.781 7.01609 109.921 8.0852C110.039 8.96507 109.766 9.78958 109.175 10.3502Z", fill: "black", fillOpacity: "0.7" }), a("path", { d: "M101.89 2.12378C101.63 2.06766 101.358 2.11486 101.133 2.25518C100.908 2.39551 100.747 2.61769 100.687 2.87371C100.626 3.12973 100.67 3.39902 100.809 3.62339C100.947 3.84775 101.17 4.00917 101.428 4.07275C101.503 4.08936 101.58 4.09778 101.657 4.09786C101.906 4.09824 102.146 4.0083 102.331 3.84518C102.517 3.68206 102.636 3.45714 102.664 3.21327C102.693 2.9694 102.63 2.72361 102.487 2.5227C102.344 2.32179 102.132 2.17981 101.89 2.12378Z", fill: "black", fillOpacity: "0.7" }), a("path", { d: "M100.967 10.934H99.7755C98.9285 10.934 98.4196 10.3644 98.4196 9.40982C98.4196 8.4791 98.8757 7.36945 99.8054 6.01778L99.8178 5.99976V5.61807L95.8571 5.06453C95.8585 4.90331 95.8162 4.74466 95.7346 4.60501C95.653 4.46536 95.5352 4.34979 95.3932 4.27027C95.0381 4.07718 94.6498 4.07717 94.3279 4.26383C94.1667 4.35799 94.035 4.4945 93.9476 4.65816C93.8602 4.82182 93.8205 5.00623 93.8328 5.19087C93.8452 5.37552 93.9092 5.55315 94.0176 5.70402C94.1261 5.85489 94.2748 5.97309 94.4472 6.04546L93.2151 12.258H94.5833L95.7196 6.35891L97.8593 6.7155C97.284 7.73439 96.9921 8.68442 96.9921 9.53919C96.9921 11.1168 97.9577 12.1498 99.5187 12.2496V12.258H102.346V4.87723H100.967V10.934Z", fill: "black", fillOpacity: "0.7" })] }), un = ({ forceBrandedLogo: e, marketingUrlLink: t }) => a("div", { className: e ? "yellow-footer-logo" : "", style: { marginTop: "4px", marginBottom: "4px" }, children: a("a", { href: t, rel: "noreferrer", target: "_blank", children: a("div", { style: { display: "flex" }, children: [a(cn, { logoOnly: !1 }), e && a(vt, { style: { display: "block", margin: "auto 0 auto 4px", transform: "rotateY(0deg) rotate(-45deg)" } })] }) }) }), dn = ({ marketingUrlLink: e }) => a("a", { dir: "ltr", href: e, rel: "noreferrer", target: "_blank", children: a("div", { className: "thank-you-card-link", children: [a("div", { className: "sprig-box-logo", children: a(cn, { logoOnly: !0, style: { margin: "auto" } }) }), a("div", { children: a("p", { children: ["Capture insights about your own product", a(vt, { style: { display: "inline-flex", marginInlineStart: "4px", verticalAlign: "middle" } })] }) })] }) }), fe = (e) => (e == null ? void 0 : e.buttonText) || "Next", pn = (e) => (e == null ? void 0 : e.skipButtonText) || "Skip", mn = ({ marketingUrl: e, slugName: t, surveyId: r, forceBrandedLogo: n }) => `${e}?utm_source=survey_branding&utm_medium=website&utm_campaign=${t}&utm_content=${r}${n ? "&utm_term=poweredby_pill" : ""}`, wo = ({ className: e, message: t, next: r, properties: n, questionId: o, type: i }) => {
1179
- const { useMobileStyling: s, border: l, isLongFormSurvey: c, focusedQuestionId: d } = O((w) => ({ useMobileStyling: w.useMobileStyling, border: w.border, isLongFormSurvey: Y(w.studyType), focusedQuestionId: w.focusedQuestionId })), [m, u] = F(!1), [p, g] = F(""), [h, _] = F(!1), b = c && d === o, x = n == null ? void 0 : n.collectName, v = (n == null ? void 0 : n.nameLabelText) || "Full Name", E = (n == null ? void 0 : n.consentText) || "I agree to the stated conditions", T = (n == null ? void 0 : n.submitButtonText) || "Submit", k = !!p.trim(), C = m && (!x || k), f = (w, L = !1) => {
1180
- w.preventDefault(), w.stopPropagation();
1181
- let M = null;
1182
- if (!L) {
1183
- if (!C) return void _(!0);
1184
- M = { submitted: !0 }, x && (M.name = p);
1185
- }
1186
- r({ value: M, questionId: o, type: i }, C);
1187
- }, I = (w) => {
1188
- w.preventDefault(), w.stopPropagation(), g(w.currentTarget.value);
1189
- }, S = (w) => {
1190
- w.currentTarget.style.borderColor = h && !k ? Se : l;
1191
- }, P = (w) => {
1192
- w.currentTarget.style.borderColor = h && !k ? Se : lt;
1193
- }, y = () => a(ue, { children: [a("div", { className: "sprig-stretch", children: [a(je, { allowTextEntry: !1, border: l, error: h && !m, id: "consent", isRadio: !1, isSelected: m, label: E, onUserInputChanged: ({ selected: w }) => {
1194
- w !== m && u(!m);
1195
- }, useMobileStyling: s }), x && a("input", { "aria-label": v, "aria-placeholder": v, className: R(W("ul-consent-legal__name-input", s)), "data-gramm": "false", maxLength: 250, name: "name", onBlur: P, onFocus: S, onInput: I, placeholder: v, style: h && !k ? { borderColor: Se } : {}, tabIndex: 0, value: p })] }), a("div", { className: "ul-card__button-wrapper ul-card-vertical__button-wrapper", children: [a(K, { className: C ? "" : "sprig-button-disabled", onClick: f, children: T }), n.required === !1 && !c && a("button", { className: "ul-card-skip__button", onClick: (w) => f(w, !0), children: pn(n) })] })] });
1196
- return a("div", { className: R(e, c && !b && "ul-card--unfocused", "ul-card__consent-legal", "fade-in-transition"), children: [a(te, { message: t, properties: { questionHtml: n.questionHtml } }), a($, { children: [n != null && n.richTextBody ? a(le, { children: a("div", { className: "ul-rich-text-body", dangerouslySetInnerHTML: n != null && n.richTextBody ? { __html: n.richTextBody } : void 0, id: "ul-card__consent-legal-body-container" }) }) : null, a(se, { properties: n, defaultBody: y, embeddedType: "pdf" })] })] }, o);
1197
- }, Co = ({ icon: e, scaleLabelType: t, value: r, selectedValue: n }) => {
1198
- if (t === "smiley" && r === n) {
1199
- let o = 0;
1200
- return e.replace(/black/g, () => ++o == 1 ? "black" : "white");
1201
- }
1202
- return e;
1203
- }, So = ({ activeValue: e, border: t, icon: r, isPressed: n, onSubmit: o, range: i, scaleLabelType: s, selectedValue: l, setSelectedValue: c, setActiveValue: d, setIsPressed: m, useMobileStyling: u, value: p, viewDocument: g }) => {
1204
- const { isLongFormSurvey: h } = O((f) => ({ isLongFormSurvey: Y(f.studyType) })), _ = `option-${p}`, b = s === "number", x = s === "star", v = s === "smiley", E = b && p === e || p === l, [T, k] = (() => {
1205
- const f = x && l !== null && p <= l;
1206
- return x && p <= e || v && p === e || f || p === e || p === l ? [t, n || f || p === l ? 1 : 0.3] : ["", 1];
1207
- })(), C = ne(() => {
1208
- const f = { borderColor: E ? T : "", fillOpacity: E ? "" : k, zIndex: E ? 3 : "auto", color: l === p ? "#fff" : "" };
1209
- return b ? { ...f, backgroundColor: l === p ? T : "" } : { ...f, color: x || v || l === p ? T : "" };
1210
- }, [E, T, k, l, p, b, x, v]);
1211
- return a("button", { "aria-label": b ? void 0 : String(p), className: (() => {
1212
- switch (s) {
1213
- case "star":
1214
- return R(W("likert-star", u), W(`likert-star-${p}`, u));
1215
- case "smiley":
1216
- return R(W("likert-smiley", u), W(`likert-smiley-${p}`, u));
1217
- default:
1218
- return p === i ? R(W("likert-number", u), W(`likert-number-${p}`, u), W("likert-last-option", u)) : R(W("likert-number", u), W(`likert-number-${p}`, u));
1219
- }
1220
- })(), dangerouslySetInnerHTML: { __html: Co({ icon: r, scaleLabelType: s, value: p, selectedValue: l }) }, id: _, onClick: (f) => {
1221
- h && (f.preventDefault(), f.stopPropagation(), c(p)), o();
1222
- }, onKeyDown: (f) => {
1223
- var P, y;
1224
- const I = g.querySelectorAll(`.likert-${s ?? "number"}`), S = p - 1;
1225
- f.key === "ArrowRight" ? (P = I[S + 1]) == null || P.focus() : f.key === "ArrowLeft" ? (y = I[S - 1]) == null || y.focus() : f.key !== "Enter" && f.key !== " " || (h && (f.preventDefault(), f.stopPropagation(), c(p)), o());
1226
- }, onPointerDown: () => m(!0), onPointerEnter: () => d(p), onPointerLeave: () => {
1227
- d(-1), m(!1);
1228
- }, style: C, tabIndex: 0 });
1229
- }, To = ({ className: e, labels: t, message: r, next: n, properties: o, questionId: i, type: s }) => {
1230
- const { border: l, useMobileStyling: c, viewDocument: d, isLongFormSurvey: m, focusedQuestionId: u } = O((L) => ({ border: L.border, useMobileStyling: L.useMobileStyling, viewDocument: L.viewDocument, isLongFormSurvey: Y(L.studyType), focusedQuestionId: L.focusedQuestionId })), [p, g] = F(-1), [h, _] = F(!1), [b, x] = F(null), v = m && u === i, E = t && t.left, T = t && t.right;
1231
- let k;
1232
- const { range: C, scaleLabelType: f, ratingIcons: I } = o;
1233
- C && (k = Number(C));
1234
- const S = k || 5, P = (L) => {
1235
- var M, N;
1236
- switch (f) {
1237
- case "star":
1238
- return (M = I[0]) == null ? void 0 : M.svg;
1239
- case "smiley":
1240
- return (N = I[L]) == null ? void 0 : N.svg;
1241
- default:
1242
- return String(L + 1);
1243
- }
1244
- }, y = [...Array(S)].map((L, M) => {
1245
- const N = M + 1;
1246
- return a(So, { activeValue: p, border: l, icon: P(M), isPressed: h, onSubmit: () => n({ value: N, questionId: i, type: s }, !0), range: S, scaleLabelType: f, selectedValue: b, setActiveValue: g, setIsPressed: _, setSelectedValue: x, useMobileStyling: c, value: N, viewDocument: d }, M);
1247
- }), w = (L) => {
1248
- L.preventDefault(), L.stopPropagation(), n({ value: null, questionId: i, type: s }, !0);
1249
- };
1250
- return a("form", { className: R(e, "ul-card--likert", "fade-in-transition", m && !v && "ul-card--unfocused"), children: [a(te, { message: r, properties: o }), a(se, { properties: o, defaultBody: () => a($, { children: [a(le, { children: [a("div", { "aria-label": `Rating (1 - ${S})`, className: "ul-card--likert__numbers", role: "radiogroup", children: y }), a("div", { className: "ul-card--likert__labels", children: [a("span", { children: E }), a("span", { children: T })] })] }), !o.required && !m && a(ue, { children: a("div", { className: "ul-vertical-centered-container", children: a(K, { onClick: w, children: fe(o) }) }) })] }) })] }, i);
1251
- }, hn = (e) => e && (e.scrollHeight > e.offsetHeight ? e : hn(e.parentElement)), Io = (e) => {
1252
- if (!e || !((r) => r instanceof HTMLElement)(e)) return 0;
1253
- const t = getComputedStyle(e);
1254
- return parseFloat(t.marginTop) + parseFloat(t.marginBottom) + (parseFloat(t.borderTopWidth) + parseFloat(t.borderBottomWidth));
1255
- }, No = ({ columns: e, onSelect: t, options: r, selectedOptions: n }) => {
1256
- const o = G([]), { border: i, useMobileStyling: s } = O((p) => ({ border: p.border, useMobileStyling: p.useMobileStyling })), l = r.findIndex((p) => n[p.id] === null), [c, d] = F(l), m = me((p, g) => {
1257
- t(p, g);
1258
- const h = c + 1, _ = r[h];
1259
- if (_ && n[_.id] === null) {
1260
- d(h);
1261
- const b = o.current[c];
1262
- if (b != null && b.firstElementChild) {
1263
- const x = hn(b), v = b.firstElementChild, E = Io(b) + v.clientHeight;
1264
- x == null || x.scrollTo(0, b.offsetTop + E);
1265
- }
1266
- }
1267
- }, [t, r, n, c]), u = me((p, g) => {
1268
- const h = c === p;
1269
- return a(go, { animate: !0, header: g.label, isOpen: h, onClick: () => d(h && !window.UserLeap.isMobileSDK ? -1 : p), ref: (_) => {
1270
- _ && (o.current[p] = _);
1271
- }, showHeaderCheck: n[g.id] !== null, children: a("div", { style: { paddingTop: "12px" }, children: e.map((_) => a(je, { allowTextEntry: !1, ariaLabel: `${g.label}-${_.label}`, border: i, error: !1, id: `${g.id}-${_.value}`, isRadio: !0, isSelected: n[g.id] === _.value, label: _.label, onUserInputChanged: () => m(g.id, _.value), useMobileStyling: s }, _.label)) }) }, g.id);
1272
- }, [i, e, c, m, n, s]);
1273
- return a("div", { children: r.map((p, g) => u(g, p)) });
1274
- }, Eo = ({ columns: e, onSelect: t, options: r, selectedOptions: n }) => {
1275
- const { border: o, useMobileStyling: i, isLongFormSurvey: s } = O((h) => ({ border: h.border, useMobileStyling: h.useMobileStyling, isLongFormSurvey: Y(h.studyType) })), l = r.length, c = e.length, d = G(null), [m, u] = F(!1), [p, g] = F(!1);
1276
- return V(() => {
1277
- const h = d.current, _ = new ResizeObserver((b) => {
1278
- window.requestAnimationFrame(() => {
1279
- h && (u(Math.round(b[0].contentRect.width) < h.scrollWidth), g(Math.round(b[0].contentRect.width) < h.scrollWidth));
1280
- });
1281
- });
1282
- return h && _.observe(h), () => {
1283
- h && _.unobserve(h);
1284
- };
1285
- }, []), a("div", { className: "ul-card--matrix_question_container", children: [a("div", { className: R("ul-card--matrix_container", m && "ul-matrix-scroll-gradient"), onScroll: () => {
1286
- (() => {
1287
- const h = d.current;
1288
- h && u(h.clientWidth + Math.abs(h.scrollLeft) < h.scrollWidth);
1289
- })();
1290
- }, ref: d, children: a("div", { className: R(s && "ul-card--matrix_grid_longform", "ul-card--matrix_grid"), style: `--numColumns: ${c}; --numRows: ${l + 1};`, children: [a("div", {}), " ", e.map((h) => a("div", { className: "ul-matrix-column-label", children: h.label }, h.label)), r.map((h) => a($, { children: [a("div", { "aria-label": h.label, className: "ul-matrix-row-label", children: h.label }, h.label), a("div", { className: "ul-matrix-row-options", role: "radiogroup", children: e.map((_, b) => a("div", { className: R("ul-matrix-option-wrapper", b === c - 1 && "ul-matrix-last-option"), children: a(je, { allowTextEntry: !1, ariaLabel: `${h.label}-${_.label}`, border: o, choiceStyle: { background: "transparent", border: "none", marginBottom: "0", padding: "0" }, error: !1, id: `${h.id}-${_.value}`, isRadio: !0, isSelected: n[h.id] === _.value, onUserInputChanged: () => t(h.id, _.value), useMobileStyling: i }) }, _.value)) })] }))] }) }), (m || p) && a("button", { className: p && !m ? "ul-matrix-scroll-arrow left" : "ul-matrix-scroll-arrow", onClick: p && !m ? (h) => {
1291
- h.preventDefault();
1292
- const _ = d.current;
1293
- if (_) {
1294
- const b = getComputedStyle(_).direction === "rtl";
1295
- _.scrollTo({ left: b ? _.scrollWidth - _.clientWidth : 0, behavior: "smooth" });
1296
- }
1297
- } : (h) => {
1298
- h.preventDefault();
1299
- const _ = d.current;
1300
- if (_) {
1301
- const b = getComputedStyle(_).direction === "rtl";
1302
- _.scrollTo({ left: b ? _.clientWidth - _.scrollWidth : _.scrollWidth, behavior: "smooth" });
1303
- }
1304
- }, children: a(p && !m ? Lo : Po, {}) })] });
1305
- }, Lo = () => a("svg", { fill: "currentColor", height: "32", transform: "matrix(-1,0,0,1,0,0)", version: "1.1", viewBox: "0 0 256 256", width: "32", xmlns: "http://www.w3.org/2000/svg", children: a("path", { d: "M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z" }) }), Po = () => a("svg", { fill: "currentColor", height: "32", viewBox: "0 0 256 256", width: "32", xmlns: "http://www.w3.org/2000/svg", children: a("path", { d: "M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z" }) }), Mo = ({ className: e, message: t, next: r, options: n, properties: o, questionId: i, type: s, showIndividualSubmit: l = !1, onSubmitButtonClick: c }) => {
1306
- const { useMobileStyling: d, isLongFormSurvey: m, focusedQuestionId: u, setFocusedQuestionId: p } = O((f) => ({ useMobileStyling: f.useMobileStyling, isLongFormSurvey: Y(f.studyType), focusedQuestionId: f.focusedQuestionId, setFocusedQuestionId: f.setFocusedQuestionId })), g = o.matrixColumn, h = o.required, _ = m && u === i, b = (f) => {
1307
- f.preventDefault(), f.stopPropagation(), r({ value: v, questionId: i, type: s }, !0), c && c();
1308
- }, x = n.reduce((f, I) => (f[I.id] = null, f), {}), [v, E] = F(x), T = (f) => h && Object.values(f).every((I) => I == null), k = (f, I) => {
1309
- m && r({ value: { ...v, [f]: I }, questionId: i, type: s }, !T({ ...v, [f]: I })), E((S) => ({ ...S, [f]: I }));
1310
- }, C = o.displayMatrixAsAccordion || d;
1311
- return a("form", { className: R(e, !m && "ul-card__matrix", "fade-in-transition", m && !_ && "ul-card--unfocused"), id: "text-form", onClick: () => {
1312
- _ && p(i);
1313
- }, onSubmit: b, children: [a(te, { message: t, properties: o }), a(se, { properties: o, defaultBody: () => a($, { children: [a(le, { children: [a(C ? No : Eo, { columns: g, onSelect: k, options: n, selectedOptions: v }), l && a(Ae, { handleSubmit: b, isSubmitDisabled: T(v) })] }), !m && a(ue, { children: a("div", { className: "ul-card__button-wrapper", children: a(K, { disabled: T(v), children: fe(o) }) }) })] }) })] }, i);
1314
- }, qo = ({ options: e, selectItem: t, selectedOptions: r, showCheckbox: n }) => {
1315
- const { themeColor: o } = O((i) => ({ doc: i.viewDocument, themeColor: i.border }));
1316
- return a("div", { className: "select-list", children: e.map((i) => {
1317
- return a("div", { className: "select-option", onClick: (l) => {
1318
- t(i), l.stopPropagation();
1319
- }, role: "option", children: [n && a(an, { divId: (s = i.id, `checkbox-div-${s}`), id: i.id, isSelected: r.includes(i), themeColor: o }), i.label] }, i.id);
1320
- var s;
1321
- }) });
1322
- }, Ro = ({ isMultiSelect: e = !1, multiselectText: t = "choices selected", onChange: r, options: n, placeholderText: o, value: i }) => {
1323
- const [s, l] = F(!1), { viewDocument: c, update: d } = O((p) => ({ viewDocument: p.viewDocument, update: p.update })), m = () => {
1324
- l(!s), d();
1325
- };
1326
- V(() => {
1327
- var g;
1328
- const p = () => {
1329
- l(!1), d();
1330
- };
1331
- c.addEventListener("click", p);
1332
- try {
1333
- (g = window.parent) == null || g.addEventListener("click", p);
1334
- } catch {
1335
- window.addEventListener("click", p);
1336
- }
1337
- return () => {
1338
- var h;
1339
- c.removeEventListener("click", p);
1340
- try {
1341
- (h = window.parent) == null || h.removeEventListener("click", p);
1342
- } catch {
1343
- window.removeEventListener("click", p);
1344
- }
1345
- };
1346
- }, [c, d]);
1347
- const u = i.length === 0 ? ["select-button-placeholder"] : [];
1348
- return a($, { children: [a("button", { "aria-label": "choice dropdown button", className: R("select-button", ...u), onClick: (p) => {
1349
- p.stopPropagation(), m();
1350
- }, type: "button", children: [a("span", { children: i.length === 0 ? o : i.length === 1 ? i[0].label : `${i.length} ${t}` }), a(rn, {})] }), s && a(qo, { options: n, selectedOptions: i, selectItem: (p) => {
1351
- var _;
1352
- const g = i.some((b) => b.id === p.id), h = i.some((b) => {
1353
- var x;
1354
- return (x = b.optionProperties) == null ? void 0 : x.noneOfTheAbove;
1355
- });
1356
- (_ = p.optionProperties) != null && _.noneOfTheAbove && !g ? r([p]) : e ? r(g ? i.filter((b) => b.id !== p.id) : h ? [p] : [...i, p]) : g || r([p]), e || m();
1357
- }, showCheckbox: e })] });
1358
- }, fn = ({ className: e, message: t, onSubmit: r, options: n = [], properties: o, questionId: i, type: s, showIndividualSubmit: l = !1, onSubmitButtonClick: c }) => {
1359
- const { border: d, useMobileStyling: m, isLongFormSurvey: u, focusedQuestionId: p, setFocusedQuestionId: g } = O((y) => ({ border: y.border, useMobileStyling: y.useMobileStyling, isLongFormSurvey: Y(y.studyType), focusedQuestionId: y.focusedQuestionId, setFocusedQuestionId: y.setFocusedQuestionId })), h = u && p === i, _ = n.reduce((y, w) => (y[w.id] = { isSelected: !1 }, y), {}), [b, x] = F(_), v = s === "multiplechoice", E = o.required, T = n.find((y) => {
1360
- var w;
1361
- return (w = y.optionProperties) == null ? void 0 : w.noneOfTheAbove;
1362
- }), k = (y) => ((w) => Object.entries(w).some(([L, M]) => {
1363
- var D;
1364
- const N = n.find((H) => `${H.id}` === L), B = M.userText === void 0 || M.userText.trim() === "";
1365
- return ((D = N == null ? void 0 : N.optionProperties) == null ? void 0 : D.allowsTextEntry) && B && M.isSelected;
1366
- }))(y) || E && !((w) => Object.values(w).some((L) => L.isSelected))(y), C = Object.entries(b).some(([y, w]) => {
1367
- var L, M;
1368
- return w.isSelected && ((M = (L = n.find((N) => `${N.id}` === y)) == null ? void 0 : L.optionProperties) == null ? void 0 : M.allowsTextEntry);
1369
- }), f = l && (!v || C), I = n.map(({ id: y, label: w, value: L, optionProperties: M }) => {
1370
- var H, z;
1371
- const N = `${y}`, { allowsTextEntry: B, noneOfTheAbove: D } = { allowsTextEntry: !1, noneOfTheAbove: !1, ...M };
1372
- return a(je, { allowTextEntry: B, border: d, error: !1, id: N, isRadio: v, isSelected: !!((H = b[N]) != null && H.isSelected), label: w, noneOfTheAbove: D, onUserInputChanged: (U) => {
1373
- P(U.id, U.selected, U.userText, U.noneOfTheAbove), U.selected && u && !v && !h && g(i);
1374
- }, promptText: "Please specify", text: (z = b[y]) == null ? void 0 : z.userText, useMobileStyling: m, value: L }, N);
1375
- }), S = (y) => {
1376
- y.preventDefault(), y.stopPropagation(), r(b, !0), c && c();
1377
- }, P = (y, w, L, M) => {
1378
- const N = Object.assign({}, b);
1379
- if ((v || M) && w) for (const H of Object.values(N)) H.isSelected = !1, delete H.userText;
1380
- else T && !M && b[T.id].isSelected && (N[T.id].isSelected = !1);
1381
- N[y] = { isSelected: w, userText: L };
1382
- const B = v && Object.entries(N).some(([H, z]) => {
1383
- var U, Q;
1384
- return z.isSelected && ((Q = (U = n.find((ge) => `${ge.id}` === H)) == null ? void 0 : U.optionProperties) == null ? void 0 : Q.allowsTextEntry);
1385
- }), D = !k(N);
1386
- u && (r(N, D), v && !B && D && c && c()), x(N);
1387
- };
1388
- return a("form", { className: R(e, "ul-card--multiple", "fade-in-transition", u && !h && "ul-card--unfocused"), id: "text-form", onClick: s === "multipleselect" ? () => {
1389
- u && p !== i && s === "multipleselect" && g(i);
1390
- } : void 0, onSubmit: S, children: [a(te, { message: t, properties: o }), a(se, { properties: o, defaultBody: () => a($, { children: [a(le, { children: [o.isDropdown ? a(Ro, { isMultiSelect: !v, multiselectText: o.dropdownMultiselectedText ?? "choices selected", onChange: (y) => {
1391
- const w = { ...b };
1392
- for (const L of n) y.includes(L) ? w[L.id].isSelected = !0 : w[L.id].isSelected = !1;
1393
- u && r(w, !k(w)), x(w);
1394
- }, options: n, placeholderText: o.dropdownPlaceholderText ?? (v ? "Select choice" : "Select choice(s)"), value: n.filter((y) => b[y.id].isSelected) }) : a("div", { className: R(W("ul-card__choices", m)), role: v ? "radiogroup" : "group", children: I }), f && a(Ae, { handleSubmit: S, isSubmitDisabled: k(b) })] }), !u && a(ue, { children: a("div", { className: "ul-card__button-wrapper", children: a(K, { disabled: k(b), onClick: S, children: fe(o) }) }) })] }) })] }, i);
1395
- }, Do = (e) => {
1396
- const { questionId: t, type: r, next: n, options: o } = e, { setFocusedQuestionId: i } = O((s) => ({ setFocusedQuestionId: s.setFocusedQuestionId }));
1397
- return a(fn, { ...e, onSubmit: (s, l) => {
1398
- var g;
1399
- const c = Object.entries(s).find(([, h]) => h.isSelected) || [void 0, void 0], [d, m] = c, u = o.find((h) => `${h.id}` === d);
1400
- !((g = u == null ? void 0 : u.optionProperties) != null && g.allowsTextEntry) || m != null && m.userText && m.userText.trim() !== "" || i(t);
1401
- const p = m != null && m.userText ? { [d]: { userText: m.userText } } : null;
1402
- n({ value: u && d ? { [d]: u.value } : {}, secondaryValue: p, questionId: t, type: r }, l);
1403
- } });
1404
- }, Oo = (e) => {
1405
- const { questionId: t, type: r, next: n } = e;
1406
- return a(fn, { ...e, onSubmit: (o, i) => {
1407
- const s = Object.entries(o).reduce((c, [d, m]) => (c[d] = m.isSelected, c), {}), l = Object.entries(o).reduce((c, [d, m]) => {
1408
- if (!m.userText) return c;
1409
- const u = c || {};
1410
- return u[d] = { userText: m.userText }, u;
1411
- }, null);
1412
- n({ value: s, secondaryValue: l, questionId: t, type: r }, i);
1413
- } });
1414
- }, Ho = ({ className: e, labels: t, message: r, properties: n, next: o, questionId: i, type: s }) => {
1415
- const [l, c] = F(null), { border: d, useMobileStyling: m, viewDocument: u, isLongFormSurvey: p, focusedQuestionId: g } = O((E) => ({ border: E.border, useMobileStyling: E.useMobileStyling, viewDocument: E.viewDocument, isLongFormSurvey: Y(E.studyType), focusedQuestionId: E.focusedQuestionId })), h = p && g === i, _ = t && t.left, b = t && t.right, x = [...Array(11)].map((E, T) => a("button", { className: R(W("nps-number", m), W(`nps-number-${T}`, m)), id: `option-${T}`, onClick: (k) => {
1416
- p && (k.preventDefault(), k.stopPropagation(), c(T)), o({ value: T, questionId: i, type: s }, !0);
1417
- }, onKeyDown: (k) => {
1418
- var f, I;
1419
- const C = u.querySelectorAll("button.nps-number");
1420
- k.key === "ArrowRight" ? (f = C[T + 1]) == null || f.focus() : k.key === "ArrowLeft" ? (I = C[T - 1]) == null || I.focus() : k.key !== "Enter" && k.key !== " " || (p && (k.preventDefault(), k.stopPropagation(), c(T)), o({ value: T, questionId: i, type: s }, !0));
1421
- }, onPointerDown: (k) => {
1422
- k.currentTarget.style.zIndex = "2", k.currentTarget.style.borderColor = d;
1423
- }, onPointerLeave: (k) => {
1424
- k.currentTarget.style.zIndex = "auto", k.currentTarget.style.borderColor = lt;
1425
- }, style: l === T ? { backgroundColor: d, color: "#fff" } : void 0, tabIndex: 0, children: T }, T)), v = (E) => {
1426
- E.preventDefault(), E.stopPropagation(), o({ value: null, questionId: i, type: s }, !0);
1427
- };
1428
- return a("form", { className: R(e, "ul-card--nps", "fade-in-transition", p && !h && "ul-card--unfocused"), children: [a(te, { message: r, properties: n }), a(se, { properties: n, defaultBody: () => a($, { children: [a(le, { children: [a("div", { className: "ul-card--nps__numbers", children: x }), a("div", { className: "ul-card--nps__labels", children: [a("span", { children: _ }), a("span", { children: b })] })] }), !n.required && !p && a(ue, { children: a("div", { className: "ul-vertical-centered-container", children: a(K, { onClick: v, children: fe(n) }) }) })] }) })] }, i);
1429
- }, Uo = ({ className: e, message: t, next: r, properties: n, questionId: o, type: i, showIndividualSubmit: s = !1, onSubmitButtonClick: l }) => {
1430
- const { border: c, useMobileStyling: d, update: m, isLongFormSurvey: u, focusedQuestionId: p, setFocusedQuestionId: g, isPreview: h } = O((y) => ({ border: y.border, useMobileStyling: y.useMobileStyling, update: y.update, isLongFormSurvey: Y(y.studyType), focusedQuestionId: y.focusedQuestionId, setFocusedQuestionId: y.setFocusedQuestionId, isPreview: y.isPreview })), [_, b] = F(""), x = G(null), v = u && p === o;
1431
- V(() => {
1432
- var y, w;
1433
- u && !h && (v ? (y = x.current) == null || y.focus() : (w = x.current) == null || w.blur());
1434
- }, [u, v, h]);
1435
- const E = _.trim(), T = n.required === !0 && !E, k = sn(x, () => m()), C = (y) => {
1436
- const { value: w } = y.currentTarget;
1437
- if (k(), y.preventDefault(), y.stopPropagation(), b(w), u) {
1438
- const L = w.trim().length > 0;
1439
- r({ value: w, questionId: o, type: i }, L);
1440
- }
1441
- }, f = (y) => {
1442
- y.preventDefault(), y.stopPropagation(), r({ value: _, questionId: o, type: i }, E.length > 0), l && l();
1443
- }, I = n && n.openTextPlaceholder ? n.openTextPlaceholder : "", S = (y) => {
1444
- y.currentTarget.style.borderColor = c, g(o);
1445
- }, P = (y) => {
1446
- y.currentTarget.style.borderColor = lt;
1447
- };
1448
- return a("form", { className: R(e, "ul-card-text", "fade-in-transition", u && !v && "ul-card--unfocused"), id: "text-form", onClick: () => {
1449
- u && p !== o && g(o);
1450
- }, children: [a(te, { message: t, properties: n }), a(se, { defaultBody: () => a("div", { className: "ul-card-text", children: [a(le, { children: [a("div", { className: "ul-card-text__container", children: a("textarea", { "aria-describedby": "ul-caption", "aria-labelledby": "ul-question", "aria-multiline": "true", "aria-placeholder": I, className: R(W("ul-card-text__input", d)), "data-gramm": "false", maxLength: 5e3, name: "text", onBlur: P, onChange: C, onFocus: S, placeholder: I, ref: x, role: "textbox", tabIndex: 0 }) }), s && a(Ae, { handleSubmit: f, isSubmitDisabled: T })] }), !u && a(ue, { children: [a(K, { disabled: T, onClick: f, children: fe(n) }), n.footerHtml && a("div", { className: "footer", dangerouslySetInnerHTML: { __html: n.footerHtml } })] })] }), properties: n })] }, o);
1451
- }, Bo = ({ className: e, labels: t, message: r, next: n, properties: o, questionId: i, type: s, onSubmitButtonClick: l, options: c, showIndividualSubmit: d = !1 }) => {
1452
- const m = G(null), [u, p] = F(() => (o == null ? void 0 : o.required) === !0), [g, h] = F(() => c.map((M) => ({ ...M, rank: null }))), _ = ne(() => Array.from({ length: c.length }, (M, N) => N + 1), [c.length]), { isLongFormSurvey: b, focusedQuestionId: x, setFocusedQuestionId: v } = O((M) => ({ useMobileStyling: M.useMobileStyling, border: M.border, isLongFormSurvey: Y(M.studyType), focusedQuestionId: M.focusedQuestionId, setFocusedQuestionId: M.setFocusedQuestionId })), E = b && x === i, T = (M) => {
1453
- M.preventDefault(), C(g), l && l();
1454
- }, k = (M) => {
1455
- M.preventDefault(), M.dataTransfer && (M.dataTransfer.dropEffect = "move");
1456
- }, C = (M) => {
1457
- const N = {};
1458
- M.reduce((B, D) => (B[D.id] = D.rank, B), N), n({ value: N, questionId: i, type: s }, !0);
1459
- }, f = (M) => {
1460
- p(!1), b && C(M);
1461
- }, { left: I, right: S } = t, P = c.length, y = (M) => {
1462
- M.preventDefault(), M.currentTarget.classList.add("is-drop-target");
1463
- }, w = (M) => {
1464
- M.currentTarget.classList.remove("is-drop-target");
1465
- }, L = (M) => {
1466
- m.current = null, M.currentTarget.classList.remove("is-dragging");
1467
- };
1468
- return a("form", { className: R(e, "ul-card-rank", "fade-in-transition", b && !E && "ul-card--unfocused"), onClick: () => {
1469
- b && x !== i && v(i);
1470
- }, onSubmit: T, children: [a(te, { message: r, properties: o }), a(se, { properties: o, defaultBody: () => a($, { children: [a(le, { children: [a("div", { className: "ul-card--rank__question-inner-container", children: [a("div", { className: "ul-card-rank__labels", children: a("span", { children: ["1 - ", I] }) }), a("ol", { className: "ul-card-rank__list", onDragOver: k, children: g.map(({ id: M, label: N, rank: B }, D) => {
1471
- return a("li", { className: "ul-card-rank__option", draggable: !0, onDragEnd: L, onDragEnter: y, onDragLeave: w, onDragStart: (z = D, (U) => {
1472
- m.current = z, U.dataTransfer && (U.dataTransfer.effectAllowed = "move", U.dataTransfer.setData("text/plain", String(z)), U.currentTarget.classList.add("is-dragging"));
1473
- }), onDrop: (H = D, (U) => {
1474
- var ge, ke;
1475
- U.preventDefault(), U.currentTarget.classList.remove("is-drop-target");
1476
- const Q = m.current;
1477
- m.current = null, (ke = (ge = U.currentTarget.closest(".ul-card-rank__list")) == null ? void 0 : ge.querySelector(".is-dragging")) == null || ke.classList.remove("is-dragging"), Q != null && Q !== H && h((de) => {
1478
- const Z = de.map((ce) => ({ ...ce })), [we] = Z.splice(Q, 1);
1479
- return Z.splice(H, 0, we), Z.forEach((ce, j) => {
1480
- ce.rank = j + 1;
1481
- }), f(Z), Z;
1482
- });
1483
- }), children: [a("select", { "aria-label": `Rank for ${N}`, className: R("ul-card-rank__select", B == null && "ul-card-rank__select--placeholder"), name: `rank[${M}]`, onChange: (U) => ((Q, ge) => {
1484
- h((ke) => {
1485
- const de = parseInt(ge), Z = ke.map((j) => ({ ...j }));
1486
- Z.some((j) => j.rank == null) && Z.forEach((j, ze) => j.rank = ze + 1);
1487
- const we = Z.findIndex((j) => j.id === Q);
1488
- if (we === -1) return ke;
1489
- const ce = Z[we].rank;
1490
- return de < ce ? Z.forEach((j) => {
1491
- j.id !== Q && j.rank >= de && j.rank < ce && (j.rank = j.rank + 1);
1492
- }) : de > ce && Z.forEach((j) => {
1493
- j.id !== Q && j.rank > ce && j.rank <= de && (j.rank = j.rank - 1);
1494
- }), Z[we].rank = de, Z.sort((j, ze) => j.rank - ze.rank), f(Z), Z;
1495
- });
1496
- })(M, U.currentTarget.value), value: B ?? "", children: [B == null && a("option", { className: "ul-card-rank__select-option", disabled: !0, value: "", children: "-" }), _.map((U) => a("option", { className: "ul-card-rank__select-option", value: U, children: U }, U))] }), a("span", { children: N }), a("button", { "aria-label": `Drag ${N} to reorder`, className: "ul-card-rank__drag-btn", title: "Drag to reorder", type: "button", children: a("svg", { fill: "none", height: "17", viewBox: "0 0 16 17", width: "16", xmlns: "http://www.w3.org/2000/svg", children: a("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" }) }) })] }, M);
1497
- var H, z;
1498
- }) }), a("div", { className: "ul-card-rank__labels", children: a("span", { children: [P, " - ", S] }) })] }), d && a(Ae, { handleSubmit: T, isSubmitDisabled: u })] }), !b && a(ue, { children: a("div", { className: "ul-card__button-wrapper", children: a(K, { disabled: u, children: fe(o) }) }) })] }) })] }, i);
1499
- }, Fo = /* @__PURE__ */ new Set(["open", "matrix", "multipleselect", "multiplechoice", "rankorder"]), ir = ({ cardInstance: e, moveToNextQuestion: t, showIndividualSubmit: r, submitQuestion: n, updateCardValues: o }) => {
1500
- const { isLongFormSurvey: i } = O((p) => ({ isLongFormSurvey: Y(p.studyType) }));
1501
- if (!e) return null;
1502
- const { name: s, type: l, props: c } = e, d = r && Fo.has(l), m = { className: "ul-card", next: (p, g) => n(p, g), questionId: s, type: l, showIndividualSubmit: r, ...d ? { next: (p, g) => {
1503
- o(p.questionId, p, g ?? !0);
1504
- }, onSubmitButtonClick: () => t(s) } : {} }, u = (() => {
1505
- switch (l) {
1506
- case "consentlegal":
1507
- return a(wo, { ...m, ...c });
1508
- case "likert":
1509
- return a(To, { ...m, ...c });
1510
- case "matrix":
1511
- return a(Mo, { ...m, ...c });
1512
- case "multiplechoice":
1513
- return a(Do, { ...m, ...c });
1514
- case "multipleselect":
1515
- return a(Oo, { ...m, ...c });
1516
- case "nps":
1517
- return a(Ho, { ...m, ...c });
1518
- case "open":
1519
- return a(Uo, { ...m, ...c });
1520
- case "rankorder":
1521
- return a(Bo, { ...m, ...c });
1522
- case "recordedtask":
1523
- return a(Yo, { ...m, ...c });
1524
- case "texturlprompt":
1525
- return a(Xo, { ...m, ...c });
1526
- case "thanks":
1527
- return a(ei, { ...m, ...c });
1528
- case "uploading":
1529
- return a(ti, { ...m, ...c });
1530
- default:
1531
- return null;
1532
- }
1533
- })();
1534
- return u ? i ? a("div", { className: "ul-card-scroll-wrapper", children: u }, s) : u : null;
1535
- }, Ao = ({ isSubmitDisabled: e = !1, onSubmit: t, buttonText: r }) => {
1536
- var g;
1537
- const { cards: n, forceBrandedLogo: o, index: i, marketingUrl: s, showSurveyBrand: l, slugName: c, surveyId: d, useMobileStyling: m } = O((h) => ({ cards: h.cards, forceBrandedLogo: h.forceBrandedLogo, index: h.index, marketingUrl: h.marketingUrl, showSurveyBrand: h.showSurveyBrand, slugName: h.slugName, surveyId: h.surveyId, useMobileStyling: h.useMobileStyling })), u = ((g = n[i]) == null ? void 0 : g.type) === "thanks", p = mn({ marketingUrl: s, slugName: c, surveyId: d, forceBrandedLogo: o });
1538
- return a("footer", { className: R("long-form-question-footer-container", m && "long-form-question-footer-container--mobile", u && "long-form-question-footer-container-center"), children: [u && o ? a(dn, { marketingUrlLink: p }) : a("div", { className: "long-form-question-footer-container-logo", children: l ? a(un, { forceBrandedLogo: o, marketingUrlLink: p }) : null }), !u && a("div", { className: R("ul-card__button-wrapper", "ul-card-vertical__button-wrapper", "long-form-question-footer-container-actions"), children: a(K, { className: R("long-form-button", e && "sprig-button-disabled"), disabled: e, onClick: t, children: a("span", { className: "long-form-button-text-container", children: r ?? a(vt, { stroke: "white" }) }) }) })] });
1539
- }, jo = ({ cards: e, next: t }) => {
1540
- var C;
1541
- const [r, n] = F({}), [o, i] = F({}), { isLongFormSurvey: s, focusedQuestionId: l, setFocusedQuestionId: c } = O((f) => ({ isLongFormSurvey: Y(f.studyType), focusedQuestionId: f.focusedQuestionId, setFocusedQuestionId: f.setFocusedQuestionId })), d = G(null), m = G(!1), u = G(null), p = me((f) => {
1542
- var y, w;
1543
- m.current = !0;
1544
- const I = e.findIndex((L) => L.name === f);
1545
- if (!s || f === null || I === -1) return void (m.current = !1);
1546
- const S = (y = d.current) == null ? void 0 : y.querySelectorAll(".ul-card-scroll-wrapper")[I], P = (w = d.current) == null ? void 0 : w.closest(".ul-card__container");
1547
- if (S && P) {
1548
- if (S && P) {
1549
- const L = S.getBoundingClientRect(), M = P.getBoundingClientRect(), N = L.top - M.top + P.scrollTop, B = N + L.height / 2, D = window.innerHeight - 157;
1550
- let H;
1551
- L.height >= D ? H = N : H = B - P.clientHeight / 2;
1552
- const z = P.clientHeight, U = P.scrollHeight - z, Q = Math.max(0, Math.min(H, U));
1553
- P.scrollTo({ top: Q, behavior: "smooth" }), setTimeout(() => {
1554
- m.current = !1;
1555
- }, 500);
1556
- }
1557
- } else m.current = !1;
1558
- }, [s, e]);
1559
- function g(f, I) {
1560
- return f.map((S) => I[S.name]);
1561
- }
1562
- V(() => {
1563
- l !== null && e.findIndex((f) => f.name === l) !== -1 || c(e[0].name);
1564
- }, [e, l, c]);
1565
- const h = (f) => {
1566
- if (!s) return;
1567
- const I = e.findIndex((S) => S.name === f) + 1;
1568
- if (I < e.length) {
1569
- const S = e[I].name;
1570
- c(S);
1571
- } else c(f);
1572
- };
1573
- V(() => {
1574
- s && l !== null && (u.current !== l ? p(l) : u.current = null);
1575
- }, [l, s, p]);
1576
- const _ = me(() => {
1577
- var M, N;
1578
- if (m.current) return;
1579
- const f = (M = d.current) == null ? void 0 : M.closest(".ul-card__container");
1580
- if (!f) return;
1581
- const I = (N = d.current) == null ? void 0 : N.querySelectorAll(".ul-card-scroll-wrapper");
1582
- if (!I || I.length === 0) return;
1583
- const S = f.getBoundingClientRect(), P = S.top + S.height / 2;
1584
- let y = 0, w = 1 / 0;
1585
- I.forEach((B, D) => {
1586
- const H = B.getBoundingClientRect(), z = H.top + H.height / 2, U = Math.abs(P - z);
1587
- U < w && (w = U, y = D);
1588
- });
1589
- const L = e[y];
1590
- u.current = L.name, c(L.name);
1591
- }, [e, c]);
1592
- V(() => {
1593
- var I;
1594
- if (!s) return;
1595
- const f = ((I = d.current) == null ? void 0 : I.closest(".ul-card__container")) || null;
1596
- return f && f.addEventListener("scroll", _, { passive: !0 }), () => {
1597
- f && f.removeEventListener("scroll", _);
1598
- };
1599
- }, [_, s]);
1600
- const b = ne(() => Object.values(o).every((f) => f), [o]), x = async (f, I, S) => {
1601
- return i((y) => ({ ...y, [f]: S })), await (P = (y) => ({ ...y, [f]: I }), new Promise((y) => {
1602
- n((w) => {
1603
- const L = P(w);
1604
- return y(L), L;
1605
- });
1606
- }));
1607
- var P;
1608
- };
1609
- V(() => {
1610
- if (!s) return;
1611
- const f = {};
1612
- e.forEach((I) => {
1613
- var P, y;
1614
- const S = I;
1615
- (y = (P = S.props) == null ? void 0 : P.properties) != null && y.required || (f[S.name] = { value: null, questionId: S.name, type: S.type });
1616
- }), n(f), i({});
1617
- }, [e, s]);
1618
- const v = async (f, I) => {
1619
- if (s) {
1620
- const S = await x(f.questionId, f, I), P = E(f.type), y = T(f.type);
1621
- if (P && h(f.questionId), y && I) {
1622
- const w = g(e, S);
1623
- t(w);
1624
- }
1625
- } else t([f]);
1626
- }, E = (f) => (/* @__PURE__ */ new Set(["nps", "likert", "multiplechoice"])).has(f), T = (f) => (/* @__PURE__ */ new Set(["videovoice", "consentlegal", "texturlprompt"])).has(f), k = ((C = e[0]) == null ? void 0 : C.type) === "thanks";
1627
- return s ? a("div", { className: "ul-card-list-container--longform", ref: d, children: [e.map((f, I) => a(ir, { cardInstance: f, moveToNextQuestion: h, showIndividualSubmit: s && e.length > 1 && I < e.length - 1, submitQuestion: v, updateCardValues: x }, (f == null ? void 0 : f.name) || I)), !k && a(Ao, { isSubmitDisabled: Object.keys(r).length < e.length || !b, onSubmit: function() {
1628
- const f = g(e, r);
1629
- t(f);
1630
- } })] }) : a($, { children: e.map((f, I) => a(ir, { cardInstance: f, moveToNextQuestion: h, showIndividualSubmit: s && e.length > 1 && I < e.length - 1, submitQuestion: v, updateCardValues: x }, (f == null ? void 0 : f.name) || I)) });
1631
- }, ot = 1, gn = 2, _n = 3, Be = (e) => e.type === "av_permission", ar = (e) => e.type === "screen_permission", bn = (e, t) => e === void 0 ? ot : e ? ((r, n) => !(Be(n) ? n.permissionDescriptors : []).includes("camera") || r.getVideoTracks().length > 0)(e, t) ? _n : ot : gn, sr = { avStream: null, currentPage: null, mediaRecordingUids: null, nextQuestion: () => {
1632
- }, passthroughData: void 0, recordingMediaTypes: void 0, screenPermissionRequested: !1, type: void 0 }, re = Xr((e) => ({ ...sr, reset: () => {
1633
- e(sr);
1634
- }, updatePage: (t) => {
1635
- e(t);
1636
- } }));
1637
- function it({ currentPage: e, pages: t }) {
1638
- const { avStream: r, recordingMediaTypes: n, updatePage: o } = re.getState(), { recorderEventEmitter: i } = O.getState();
1639
- i.emit("av.permission", { "permission.descriptors": e.permissionDescriptors, "stream.ready": (s, l) => {
1640
- if (r === s) return;
1641
- let c = e;
1642
- if (s && !e.permissionDescriptors.includes("camera")) {
1643
- const d = t.indexOf(e), m = l != null && l.active ? d + 2 : d + 1;
1644
- l != null && l.active && n && i.emit("begin.recording", { "recording.media.types": n, "start.recording.callback": (u) => o({ mediaRecordingUids: u }) }), c = t[m];
1645
- }
1646
- o({ currentPage: c, avStream: s });
1647
- } });
1648
- }
1649
- function at({ status: e }) {
1650
- const { nextQuestion: t, passthroughData: r, mediaRecordingUids: n, reset: o } = re.getState(), { recorderEventEmitter: i, handleUploadUpdate: s, index: l } = O.getState(), c = { value: { taskStatus: e }, type: "recordedtask", questionId: (r == null ? void 0 : r.questionId) || 1 };
1651
- r && i.emit("finish.task", { "begin.callback": (d) => {
1652
- s({ mediaRecordingUid: d, isSubmitted: !0, progressPct: 0, isComplete: !1 });
1653
- }, "progress.callback": (d, m) => {
1654
- s({ mediaRecordingUid: d, progressPct: m.detail, isSubmitted: !1, isComplete: !1 });
1655
- }, "upload.callback": (d) => {
1656
- d && s({ mediaRecordingUid: d, isComplete: !0, isSubmitted: !0, progressPct: 100 });
1657
- }, "passthrough.data": r, "current.index": l, "task.response": c, "task.complete.callback": (d) => {
1658
- c.value.taskDurationMillisecond = d, n && (c.value.mediaRecordingUids = n), o(), t(c);
1659
- } });
1660
- }
1661
- function yt({ pages: e, setIsRequestingPermission: t }) {
1662
- const { recorderEventEmitter: r, eventEmitFn: n } = O.getState(), { updatePage: o, currentPage: i, recordingMediaTypes: s, screenPermissionRequested: l } = re.getState();
1663
- if (!i) return;
1664
- const c = e.indexOf(i);
1665
- switch (i.type) {
1666
- case "av_permission": {
1667
- const d = l ? c + 2 : c + 1;
1668
- return l && s && r.emit("begin.recording", { "recording.media.types": s, "start.recording.callback": (m) => {
1669
- o({ mediaRecordingUids: m });
1670
- } }), void o({ currentPage: e[d] });
1671
- }
1672
- case "screen_permission":
1673
- return void r.emit("screen.permission", { "screen.permission.requested": t, "stream.ready.callback": (d, m) => {
1674
- const u = m ? e[c + 1] : i;
1675
- m && s && r.emit("begin.recording", { "recording.media.types": s, "start.recording.callback": (p) => {
1676
- o({ captureStream: m, mediaRecordingUids: p });
1677
- } }), o({ currentPage: u, screenPermissionRequested: !0, captureStream: m });
1678
- } });
1679
- case "start_task":
1680
- return n("recorded.task.start"), r.emit("recorded.task.start"), r.emit("start.task"), void o({ currentPage: e[c + 1], screenPermissionRequested: !0 });
1681
- case "complete_task":
1682
- return;
1683
- }
1684
- }
1685
- const vn = "ul-permission-graphics-container", yn = "ul-permission-body", xn = R(vn, "ul_recorded-task-inset-spacing"), Ve = R("ul-horizontal-button-container", "ul-horizontal-button-container-left"), kn = ({ richTextBody: e }) => a("div", { className: "ul-rich-text-body", dangerouslySetInnerHTML: { __html: e }, id: "ul-task-detail-container" }), $e = ({ required: e, skipButtonText: t, bottom: r = !1 }) => e ? null : a(K, { className: R(r && "ul-skip-button-below", "ul-button-inactive"), onClick: at.bind(null, { status: "abandoned" }), children: t || "Skip" }), xt = (e) => {
1686
- const { avStream: t, captureStream: r, recordingMediaTypes: n, updatePage: o } = re.getState(), i = (n == null ? void 0 : n.includes("audio")) || (n == null ? void 0 : n.includes("video"));
1687
- V(() => {
1688
- const s = setInterval(() => {
1689
- i && t && !t.active ? o({ avStream: null, currentPage: e[0] }) : r && r.active || o({ captureStream: void 0, currentPage: e[i ? 1 : 0] });
1690
- }, 1e3);
1691
- return () => clearInterval(s);
1692
- }, [t, r, i, e, n, o]);
1693
- }, Vo = ({ content: e, pages: t, required: r }) => {
1694
- const { buttonText: n, skipButtonText: o, taskDetail: i } = e;
1695
- return xt(t), a("div", { className: "ul-task-page", children: [i && a(kn, { richTextBody: i }), a("div", { className: Ve, children: [a(K, { onClick: yt.bind(null, { pages: t }), children: n }), a($e, { required: r, skipButtonText: o })] })] }, "start-task");
1696
- }, $o = ({ content: e, pages: t, properties: r }) => {
1697
- const { buttonText: n, skipButtonText: o } = e;
1698
- xt(t);
1699
- const i = a(se, { properties: r, defaultBody: () => a("div", { className: Ve, children: [a(K, { className: "ul-complete-task-button", onClick: at.bind(null, { status: "completed" }), children: n }), a(K, { className: R("ul-button-inactive"), onClick: at.bind(null, { status: "given.up" }), children: o })] }) });
1700
- return a("div", { className: "ul-task-page", children: [e.taskDetail && a(kn, { richTextBody: e.taskDetail }), i] }, "complete-task");
1701
- }, zo = ({ content: e, pages: t, required: r }) => {
1702
- const { buttonText: n, skipButtonText: o } = e, [i] = O((c) => [c.tabTitle]), [s, l] = F(!1);
1703
- return a("div", { children: [a("div", { className: xn, children: [a("p", { style: { marginTop: "auto" }, children: e.selectTabText }), a("div", { className: "ul-select-tab-container", children: a("p", { className: yn, children: i }) })] }), a("div", { className: r ? "" : Ve, children: [a(K, { disabled: s, onClick: yt.bind(null, { pages: t, setIsRequestingPermission: l }), children: n }), a($e, { required: r, skipButtonText: o })] })] });
1704
- }, Qo = ({ content: e }) => a("div", { className: R(vn, "ul_permission_svg_container", "ul_recorded-task-inset-spacing", "ul-center-horizontally"), dangerouslySetInnerHTML: { __html: e.svg } }, "ul-permission-request-graphic"), Wo = ({ content: e, pages: t, required: r }) => {
1705
- const { permissionDeniedHeadline: n, permissionDeniedBody: o, skipButtonText: i, tryAgainButtonText: s } = e, l = Be(t[0]) ? t[0] : null;
1706
- return V(() => {
1707
- const c = setInterval(() => {
1708
- l !== null && it({ currentPage: l, pages: t });
1709
- }, 1e3);
1710
- return () => clearInterval(c);
1711
- }, [l, t]), l ? a("div", { children: [a("div", { className: xn, children: a("p", { className: "ul-av-permission-denied-paragraph", children: [a("span", { className: "ul-av-permission-denied-headline", children: n }), a("span", { className: yn, children: o })] }) }), a("div", { className: Ve, children: [a(K, { onClick: it.bind(null, { currentPage: l, pages: t }), children: s }), a($e, { required: r, skipButtonText: i })] })] }) : null;
1712
- }, Zo = ({ stream: e }) => a("video", { autoPlay: !0, className: R("ul_recorded-task-inset-spacing"), id: "ul-record-task-video-preview", muted: !0, ref: (t) => {
1713
- t && (t.srcObject = e || null);
1714
- } }), Go = ({ content: e, pages: t, required: r }) => {
1715
- const { skipButtonText: n } = e, { avStream: o } = re.getState();
1716
- return xt(t), a("div", { children: [a(Zo, { stream: o }), a("div", { className: "ul-vertical-button-container-center", children: [a(K, { onClick: yt.bind(null, { pages: t }), children: e.buttonText }), a($e, { bottom: !0, required: r, skipButtonText: n })] })] });
1717
- }, Ko = ({ properties: e }) => {
1718
- const { pages: t, required: r } = e, { avStream: n, currentPage: o } = re.getState();
1719
- if (o === void 0) return null;
1720
- switch (o == null ? void 0 : o.type) {
1721
- case "av_permission": {
1722
- const i = bn(n, o);
1723
- return i === ot ? a(Qo, { content: o }) : a(i === gn ? Wo : Go, { content: o, pages: t, required: r });
1724
- }
1725
- case "screen_permission":
1726
- return a(zo, { content: o, pages: t, required: r });
1727
- case "start_task":
1728
- return a(Vo, { content: o, pages: t, required: r });
1729
- case "complete_task":
1730
- return a($o, { content: o, pages: t, properties: e });
1731
- default:
1732
- return null;
1733
- }
1734
- }, Yo = ({ className: e, properties: t, next: r, questionId: n }) => {
1735
- const o = O(), { surveyId: i, responseGroupUid: s, userId: l } = o, c = re(), { screenPermissionRequested: d } = c, m = re((_) => _.avStream);
1736
- let u = re((_) => _.currentPage);
1737
- u || (u = function({ pages: _, userId: b, responseGroupUid: x, surveyId: v, questionId: E, next: T }) {
1738
- const { updatePage: k } = re.getState(), { eventEmitFn: C, recorderEventEmitter: f } = O.getState(), I = { questionId: E, surveyId: v, visitorId: b, responseGroupUid: x };
1739
- let S = 0;
1740
- f.emit("recorded.task.permission.screen"), C("recorded.task.permission.screen"), f.emit("permission.status", { "permission.status.callback": (y, w, L, M) => {
1741
- const N = _[S], { type: B } = N, D = ["screen"];
1742
- if (Be(N)) {
1743
- const { permissionDescriptors: H } = N, z = H == null ? void 0 : H.includes("microphone"), U = H == null ? void 0 : H.includes("camera");
1744
- z && D.push("audio"), U && D.push("video"), (y != null && y.active && !U || y != null && y.active && w) && S++;
1745
- }
1746
- ar(_[S]) && L && (S++, f.emit("begin.recording", { "recording.media.types": D, "start.recording.callback": (H) => k({ mediaRecordingUids: H }) })), k({ currentPage: _[S], avStream: y, screenPermissionRequested: L, nextQuestion: T, type: B, passthroughData: I, recordingMediaTypes: D, captureStream: M });
1747
- } });
1748
- const P = _[S];
1749
- return P.type === "av_permission" && it({ currentPage: P, pages: _ }), P;
1750
- }({ questionId: n, surveyId: i, next: (_) => {
1751
- r(_, !0);
1752
- }, pages: t.pages, responseGroupUid: s, userId: l }));
1753
- let p = u.headline, g = u.captionText;
1754
- const h = bn(m, u);
1755
- return ar(u) && d && (p = u.permissionDeniedHeadline, g = u.permissionDeniedCaptionText), Be(u) && h === _n && (p = u.permissionGrantedHeadline, g = u.permissionGrantedCaptionText), a("div", { className: R(e, "ul-center-horizontally", "fade-in-transition"), children: [a(te, { message: p, properties: { captionText: g } }), a(le, { children: a(Ko, { properties: t }) })] });
1756
- };
1757
- var wn = ((e) => (e.CONTINUE = "CONTINUE", e.EXTERNAL = "EXTERNAL", e.NO_BUTTON = "NO_BUTTON", e))(wn || {});
1758
- const Jo = { "{{user_id}}": "externalUserId", "{{email}}": "email" }, Xo = ({ className: e, message: t, next: r, properties: n, questionId: o, type: i }) => {
1759
- const { visitorAttributes: s, isLongFormSurvey: l } = O((h) => ({ visitorAttributes: h.visitorAttributes, isLongFormSurvey: Y(h.studyType) })), c = (h, _ = !1) => {
1760
- r({ value: _ ? { skipped: !0 } : void 0, questionId: o, type: i }, !0);
1761
- }, d = (h) => {
1762
- h.key !== "Enter" && h.key !== " " || r({ value: void 0, questionId: o, type: i }, !0);
1763
- }, m = ((h, _ = {}) => {
1764
- if (!h) return h;
1765
- try {
1766
- /^https?:\/\//i.test(h) || (h = `http://${h}`);
1767
- const T = new URL(h);
1768
- if (!T.protocol || T.protocol !== "http:" && T.protocol !== "https:") return;
1769
- } catch {
1770
- return;
1771
- }
1772
- let b = h;
1773
- const x = [];
1774
- for (const [T, k] of Object.entries(Jo)) if (b.toLowerCase().includes(T)) if (_[k]) {
1775
- const C = new RegExp(T, "gi");
1776
- b = b.replace(C, _[k]);
1777
- } else x.push(T);
1778
- if (x.length === 0 || !b.includes("?")) return b;
1779
- const v = b.slice(0, b.indexOf("?")), E = b.slice(b.indexOf("?") + 1).split("&").map((T) => T.split("=")).filter((T) => !x.includes(T[1]));
1780
- return E.length === 0 ? v : `${v}?${E.map((T) => T.join("=")).join("&")}`;
1781
- })(n && n.buttonUrl, s), u = l && n.promptActionType === wn.NO_BUTTON ? () => a($, {}) : () => a(ue, { children: a("div", { className: "ul-card-button-group", children: [a("a", { className: "ul-card-text__button ul-card__text-url-prompt-button", href: m, id: "ul-card-text__button", onClick: c, onKeyPress: d, rel: "noreferrer", role: m ? "link" : "button", tabIndex: 0, target: "_blank", children: fe(n) }), n.required === !1 && a("button", { className: "ul-card-skip__button", onClick: (h) => c(0, !0), children: pn(n) })] }) });
1782
- return a("div", { className: R(e, "ul-card__text-url-prompt", "fade-in-transition"), children: [a(te, { message: t, properties: { questionHtml: n.questionHtml } }), a(le, { children: (p = n == null ? void 0 : n.richTextBody, g = n == null ? void 0 : n.body, p ? a("div", { className: "ul-rich-text-body", dangerouslySetInnerHTML: { __html: p }, id: "ul-card__text-url-body-container" }) : g ? a("div", { className: "ul-rich-text-body", id: "ul-card__text-url-body-container", children: (g ? g.split(/\n\s*\n/g) : []).map((h, _) => a("p", { children: h }, _)) }) : null) }), a(se, { defaultBody: u, properties: n })] }, o);
1783
- var p, g;
1784
- }, ei = ({ className: e, questionId: t }) => {
1785
- const { border: r, destroy: n, endCard: o, forceBrandedLogo: i } = O((c) => ({ border: c.border, destroy: c.destroy, endCard: c.endCard, forceBrandedLogo: c.forceBrandedLogo }));
1786
- V(() => {
1787
- setTimeout(() => {
1788
- n(be);
1789
- }, i ? 4e3 : 2e3);
1790
- }, [n, i]);
1791
- const s = o && o.subheader ? a("p", { className: "ul-caption", children: o.subheader }) : null, l = o && o.headline ? o.headline : "";
1792
- return a("div", { className: R(e, "ul-card--thanks", "fade-in-transition"), children: a("div", { children: a("div", { className: "ul-card--thanks-content", children: [a("div", { className: "ul-thanks-check", children: a("svg", { "aria-labelledby": "title", fill: "none", height: "99", viewBox: "0 0 81 99", width: "81", xmlns: "http://www.w3.org/2000/svg", children: [a("path", { clipRule: "evenodd", d: "M40.5 77C60.9345 77 77.5 60.4345 77.5 40C77.5 19.5655 60.9345 3 40.5 3C20.0655 3 3.5 19.5655 3.5 40C3.5 60.4345 20.0655 77 40.5 77ZM80.5 40C80.5 62.0914 62.5914 80 40.5 80C18.4086 80 0.5 62.0914 0.5 40C0.5 17.9086 18.4086 0 40.5 0C62.5914 0 80.5 17.9086 80.5 40Z", fill: r, fillRule: "evenodd" }), a("path", { clipRule: "evenodd", d: "M55.025 22.9046C55.6299 23.4705 55.6616 24.4198 55.0956 25.0247C54.8724 25.2634 54.6109 25.5285 54.3157 25.8277C52.2547 27.9168 48.5549 31.667 44.8135 39.6658C43.2818 42.9406 42.0864 45.8386 41.0823 48.2729C40.6539 49.3116 40.2603 50.2659 39.8902 51.129C39.287 52.5359 38.7248 53.7508 38.1744 54.625C37.8997 55.0613 37.5806 55.4905 37.2017 55.8245C36.8201 56.1607 36.2613 56.5 35.5457 56.5C34.6742 56.5 34.0892 55.9692 33.7774 55.6083C33.4502 55.2296 33.1752 54.7511 32.9396 54.301C32.7305 53.9013 32.5088 53.4367 32.2797 52.9565C32.2429 52.8794 32.2059 52.8019 32.1688 52.7243C31.8942 52.1499 31.5959 51.534 31.2537 50.8868C29.8886 48.305 27.8539 45.2878 24.2343 43.1382C23.522 42.7152 23.2875 41.7949 23.7105 41.0826C24.1335 40.3703 25.0539 40.1358 25.7662 40.5588C30.0556 43.1062 32.4149 46.6647 33.9058 49.4845C34.2776 50.1876 34.5973 50.8487 34.8753 51.4302C34.9147 51.5124 34.9529 51.5926 34.9902 51.6707C35.2222 52.1567 35.4164 52.5637 35.5978 52.9102C35.6151 52.9434 35.6321 52.9754 35.6485 53.0061C36.0565 52.3531 36.5341 51.3434 37.133 49.9468C37.4781 49.1418 37.8572 48.2229 38.2761 47.2074C39.2886 44.7532 40.5339 41.7347 42.0961 38.3948C46.0591 29.9221 50.0641 25.8648 52.1535 23.7482C52.4423 23.4556 52.6944 23.2002 52.9048 22.9753C53.4708 22.3703 54.42 22.3387 55.025 22.9046ZM35.1994 53.5892C35.1994 53.5892 35.2 53.5888 35.2012 53.5879C35.2 53.5889 35.1994 53.5893 35.1994 53.5892ZM36.0666 53.6682C36.0732 53.674 36.0765 53.6775 36.0765 53.6777C36.0765 53.678 36.0732 53.6751 36.0666 53.6682Z", fill: r, fillRule: "evenodd" }), a("path", { d: "M69.5 97C69.5 98.1046 56.2924 99 40 99C23.7076 99 10.5 98.1046 10.5 97C10.5 95.8954 23.7076 95 40 95C56.2924 95 69.5 95.8954 69.5 97Z", fill: "black", fillOpacity: "0.2" })] }) }), a(te, { message: l }), s] }) }) }, t);
1793
- }, ti = ({ className: e }) => {
1794
- const { uploadProgress: t } = O((i) => ({ uploadProgress: i.uploadProgress }));
1795
- let r, n;
1796
- Object.values(t).filter((i) => i.isSubmitted).length > 1 ? (r = "Your responses are processing", n = "Please keep this tab open until your responses are fully processed.") : (r = "Your response is processing", n = "Please keep this tab open until your response is fully processed.");
1797
- const o = Math.round(Math.min(99, ...Object.values(t).filter((i) => i.isSubmitted).map((i) => i.progressPct || 0)));
1798
- return a("div", { className: R(e, "ul-card--uploading", "fade-in-transition"), children: [a("div", { "aria-busy": "true", "aria-label": "Processing...", "aria-live": "polite", className: "ul-loading-spinner-container", role: "progressbar", children: a("div", { className: "ul-loading-spinner", children: [a("div", { className: "first" }), a("div", { className: "second" }), a("div", { className: "third" }), a("div", { className: "fourth" })] }) }), a(te, { message: `${r} (${o}% complete)` }), a("p", { className: "ul-caption", children: n })] });
1799
- }, ri = () => {
1800
- var x;
1801
- const { border: e, cards: t, forceBrandedLogo: r, headers: n, index: o, marketingUrl: i, showSurveyBrand: s, slugName: l, surveyId: c, viewedCardCount: d } = O((v) => ({ border: v.border, cards: v.cards, forceBrandedLogo: v.forceBrandedLogo, headers: v.headers, index: v.index, marketingUrl: v.marketingUrl, showSurveyBrand: v.showSurveyBrand, slugName: v.slugName, surveyId: v.surveyId, viewedCardCount: v.viewedCardCount })), m = G(null), u = t.filter((v) => v.type !== "uploading" && v.type !== "thanks"), p = ((v, E) => {
1802
- const T = /* @__PURE__ */ new Set(["thanks", "uploading"]);
1803
- if (E >= v.length || E < 0 || T.has(v[E].type)) return 0;
1804
- const k = v.filter((f) => !T.has(f.type));
1805
- if (E === k.length - 1) return 1;
1806
- const C = { [k.length - 1]: 1, [-1]: 0 };
1807
- for (let f = k.length - 2; f >= E; f--) {
1808
- const I = k[f], S = ho(f, I.props.routingOptions);
1809
- if (S.length === 0) {
1810
- C[f] = C[f + 1] + 1;
1811
- continue;
1812
- }
1813
- let P = 0, y = uo(I);
1814
- if (y === null) return k.length - 1 - E;
1815
- for (let w = 0; w < S.length && y.length !== 0; w++) {
1816
- const { comparator: L, target: M, value: N } = S[w], B = y.filter((D) => {
1817
- const H = co({ value: D }, I.type, D), z = en(D, I.type);
1818
- return !(H && L === "answered" || z && L === "partial" || !H && !z && L === "skipped" || L === "given_up" && mo(D) && D.taskStatus === "given.up" || H && I.type === "open" && (L === "contains" || L === "notcontains") || H && po(L) && bt[L](D, N));
1819
- });
1820
- if (B.length < y.length) {
1821
- const D = parseInt(String(M), 10);
1822
- if (D !== -1 && D <= f || D >= k.length) return k.length - 1 - E;
1823
- P = Math.max(C[D] + 1, P);
1824
- }
1825
- y = B;
1826
- }
1827
- y.length > 0 && (P = Math.max(C[f + 1] + 1, P)), C[f] = P;
1828
- }
1829
- return C[E];
1830
- })(t, o), g = d + 1, h = g / (g + p), _ = mn({ marketingUrl: i, slugName: l, surveyId: c, forceBrandedLogo: r });
1831
- V(() => {
1832
- m.current && (m.current.style.width = 100 * h + "%");
1833
- }, [h]);
1834
- const b = ((x = t[o]) == null ? void 0 : x.type) === "thanks";
1835
- return a("footer", { className: "ul-footer " + (n["userleap-platform"] === "link" ? "ul-footer__link" : ""), children: b && r ? a(dn, { marketingUrlLink: _ }) : a($, { children: [u.length > 1 && a("div", { className: "ul-progress-bar-container ul-progress-bar-container__footer", children: a("div", { className: "ul-progress-bar-current", ref: m, style: { border: `1px solid ${e || "#000"}` } }) }), s ? a(un, { forceBrandedLogo: r, marketingUrlLink: _ }) : null] }) });
1836
- }, ni = () => {
1837
- const e = O((s) => s.border), t = O((s) => s.cards), r = O((s) => s.index), n = O((s) => s.focusedQuestionId), { totalQuestions: o, fraction: i } = ne(() => {
1838
- var d;
1839
- const s = t.filter((m) => m.type !== "uploading" && m.type !== "thanks"), l = s.length;
1840
- if (l <= 1) return { totalQuestions: l, fraction: 0 };
1841
- if (((d = t[r]) == null ? void 0 : d.type) === "thanks") return { totalQuestions: l, fraction: 1 };
1842
- const c = s.findIndex((m) => m.name === n);
1843
- return { totalQuestions: l, fraction: (c >= 0 ? c : 0) / l };
1844
- }, [t, r, n]);
1845
- return o <= 1 ? null : a("div", { className: "ul-progress-bar-container ul-progress-bar-container__header", children: a("div", { className: "ul-progress-bar-current", style: { width: 100 * i + "%", border: `1px solid ${e ?? "#000"}` } }) });
1846
- }, oi = () => {
1847
- const { answers: e, border: t, cards: r, close: n, configureExitOnOverlayClick: o, destroy: i, endCard: s, eventEmitFn: l, fontFamily: c, headers: d, index: m, minScrollableHeight: u, next: p, previewMode: g, productConfig: h, seen: _, showStripes: b, studyType: x, surveyId: v, update: E, useMobileStyling: T, viewDocument: k } = O((N) => ({ answers: N.answers, border: N.border, cards: N.cards, close: N.close, configureExitOnOverlayClick: N.configureExitOnOverlayClick, destroy: N.destroy, endCard: N.endCard, eventEmitFn: N.eventEmitFn, fontFamily: N.fontFamily, headers: N.headers, index: N.index, previewMode: N.previewMode, productConfig: N.productConfig, minScrollableHeight: N.minScrollableHeight, next: N.next, seen: N.seen, showStripes: N.showStripes, studyType: N.studyType, surveyId: N.surveyId, update: N.update, useMobileStyling: N.useMobileStyling, viewDocument: N.viewDocument })), C = G(null), f = G(!1), I = d["userleap-platform"], { props: S, type: P, name: y } = r[m];
1848
- V(() => {
1849
- if (window.Sprig) return window.Sprig.trackHistory = (N) => O.getState().trackHistory(N), () => {
1850
- window.Sprig.trackHistory = void 0;
1851
- };
1852
- }, []), V(() => {
1853
- C.current && (C.current.classList.contains("ul-app--visible") || C.current.classList.add("ul-app--visible"), !f.current && l && (f.current = !0, l(X.SurveyAppeared, { name: X.SurveyAppeared, "survey.id": v })));
1854
- }, [l, v]), V(() => {
1855
- const N = () => {
1856
- k.visibilityState === "visible" && (_(), k.removeEventListener("visibilitychange", N));
1857
- };
1858
- return k.addEventListener("visibilitychange", N), N(), () => {
1859
- k.removeEventListener("visibilitychange", N);
1860
- };
1861
- }, [_, k]), V(() => {
1862
- E();
1863
- }, [m, E]), V(() => {
1864
- o(() => n());
1865
- }, [n, o]);
1866
- const w = ne(() => Ln(r, m), [r, m]), L = me((N) => {
1867
- p({ data: N, completeSurvey: () => i(be), endCard: s }), Pn(k);
1868
- }, [p, i, s, k]);
1869
- if (e) {
1870
- for (const N of e) if (N.questionId === y) {
1871
- let B;
1872
- if (P === "multiplechoice") {
1873
- const D = S.options.find(({ value: H }) => H === N.value);
1874
- if (!D) break;
1875
- B = { [D.id]: D.value };
1876
- } else B = N.value;
1877
- L({ value: B, type: P, questionId: N.questionId });
1878
- break;
1879
- }
1880
- }
1881
- const M = !T && ((h == null ? void 0 : h.framePosition) === "center" || (h == null ? void 0 : h.desktopDisplay) === "center-modal" || ((h == null ? void 0 : h.placement) || "").includes("center"));
1882
- return a("div", { className: R("ul-app", Oe(d) ? "ul-app--visible" : "ul-app--overlay"), dir: "auto", id: be, onClick: (N) => {
1883
- var z;
1884
- const B = window.sprigAPI, D = N.target;
1885
- if (!B || !D) return;
1886
- const H = [D, D.parentElement];
1887
- for (const U of H) if (((z = U == null ? void 0 : U.tagName) == null ? void 0 : z.toLowerCase()) === "a") {
1888
- N.preventDefault();
1889
- try {
1890
- const Q = new URL(U.href);
1891
- Q.protocol !== "http:" && Q.protocol !== "https:" || (B == null || B.openUrl(Q.toString()));
1892
- } catch (Q) {
1893
- console.error(Q);
1894
- }
1895
- return;
1896
- }
1897
- }, ref: C, style: { "--theme": t, ...c ? { fontFamily: c.replace(";", "") } : {}, ...M ? { position: "relative" } : {} }, children: a("div", { className: "ul-app__container", children: a("div", { className: R(W("ul-card__container", T, x)), style: { ...x !== "feedbackButton" || (h == null ? void 0 : h.desktopDisplay) === "center-modal" ? { borderColor: t } : {}, ...(h == null ? void 0 : h.desktopDisplay) === "slider" ? { margin: "0px" } : {} }, children: a("div", { className: "sprig-container", style: { minHeight: u }, children: [b && a("div", { className: "ul-header__container", dir: "ltr", children: a("div", { className: "ul-header", children: "For development purposes only" }) }), g && a("div", { className: "ul-header__container", dir: "ltr", children: a("div", { className: "ul-header", children: "Preview Mode: Response will not be recorded." }) }), Y(x) && a(ni, {}), a("div", { className: R(_o("ul-card-main-content", I)), children: a(jo, { cards: w, next: L }) }), !Y(x) && a(ri, {})] }) }) }) });
1898
- }, Cn = () => MediaRecorder.isTypeSupported("video/webm") ? "video/webm" : "video/mp4", lr = (e) => {
1899
- const t = { audioBitsPerSecond: 128e3, videoBitsPerSecond: 25e5, mimeType: Cn() };
1900
- return new MediaRecorder(e, t);
1901
- }, cr = (e, t, r) => {
1902
- r[t] = [], e.ondataavailable = function(n) {
1903
- r[t].push(n.data);
1904
- }, e.currentMediaRecordingUid = t, e.start();
1905
- };
1906
- function ur(e, t, r, n, o, i) {
1907
- if (e && e.state !== "inactive") {
1908
- const { "begin.callback": s } = n, l = e.currentMediaRecordingUid;
1909
- if (!l) return;
1910
- s && s(l), e.onstop = () => async function(c, d, m, u, p, g, h) {
1911
- const _ = O.getState().viewDocument, { "upload.callback": b, "progress.callback": x } = u, v = { mediaType: m, updatedAt: (/* @__PURE__ */ new Date()).toISOString(), mediaRecordingUid: p, ...u["passthrough.data"] }, E = await (async (f, I) => {
1912
- var P;
1913
- const S = await fetch(I, { method: "POST", cache: "no-cache", headers: { "Content-Type": "application/json" }, body: JSON.stringify(f) });
1914
- if (S.ok) {
1915
- const y = await S.json();
1916
- return (P = y == null ? void 0 : y.upload) == null ? void 0 : P.url;
1917
- }
1918
- return null;
1919
- })(v, c);
1920
- if (!E) return void (b && b(null, { message: "failed to get upload url" }));
1921
- const T = new Blob(h, { type: Cn() });
1922
- if (!_.defaultView) return;
1923
- const k = new _.defaultView.File([T], `recording video ${Date.now()}`), C = g.createUpload({ endpoint: E, file: k, chunkSize: 5120 });
1924
- C.on("error", (f) => {
1925
- b && b(null, f);
1926
- }), C.on("progress", (f) => {
1927
- x && x(p, f);
1928
- }), C.on("success", () => {
1929
- b && b(p, !0);
1930
- });
1931
- }(t, 0, r, n, l, o, i), e.stop();
1932
- }
1933
- }
1934
- const ii = { state: { chunks: {} }, stopRecording(e) {
1935
- const { uploadApiEndpoint: t, avRecorder: r, screenRecorder: n, UpChunk: o } = this.state, i = this.state.avStream && this.state.avStream.getVideoTracks().length > 0 ? "video" : "audio";
1936
- this.state.chunks && t && o && (r != null && r.currentMediaRecordingUid && ur(r, t, i, e, o, this.state.chunks[r == null ? void 0 : r.currentMediaRecordingUid]), n != null && n.currentMediaRecordingUid && ur(n, t, "screen", e, o, this.state.chunks[n == null ? void 0 : n.currentMediaRecordingUid]));
1937
- }, handleCancelledStream(e) {
1938
- const t = e.getVideoTracks(), r = e.getAudioTracks();
1939
- let n = t.length && t[0];
1940
- n = n || r.length && r[0], n && n.addEventListener("ended", () => {
1941
- [this.state.avRecorder, this.state.screenRecorder].map((o) => {
1942
- o && (o.state === "recording" && o.stop(), o.stream.getTracks().map((i) => {
1943
- i.readyState === "live" && i.stop();
1944
- }));
1945
- }), Object.assign(this.state, { avStream: null, captureStream: null, avRecorder: null, screenRecorder: null });
1946
- });
1947
- }, taskDurationMillisecond() {
1948
- return this.state.startTime ? (/* @__PURE__ */ new Date()).getTime() - this.state.startTime.getTime() : 0;
1949
- }, setUpChunk(e) {
1950
- this.state.UpChunk = e;
1951
- }, configure(e, t) {
1952
- Object.assign(this.state, t), this.state.uploadApiEndpoint = `${t.apiURL}/2/environments/integrations/upload`, this.state.chunks = {}, e.on("permission.status", this.permissionStatusCallback.bind(this)), e.on("av.permission", async (r) => {
1953
- this.avPermissionCallback(r);
1954
- }), e.on("begin.recording", this.beginRecordingCallback.bind(this)), e.on("start.task", this.startTaskCallback.bind(this)), e.on("screen.permission", async (r) => {
1955
- this.screenPermissionCallback(r);
1956
- }), e.on("finish.task", async (r) => {
1957
- this.finishTaskCallback(r);
1958
- });
1959
- }, async avPermissionCallback(e) {
1960
- var n, o, i;
1961
- const { "stream.ready": t, "permission.descriptors": r } = e;
1962
- try {
1963
- (n = this.state.avStream) != null && n.active && (this.state.avStream.getTracks().map((s) => s.readyState === "live" && s.stop()), ((o = this.state.captureStream) == null ? void 0 : o.getAudioTracks().length) === 1 && this.state.captureStream.removeTrack(this.state.captureStream.getAudioTracks()[0])), this.state.avStream = await navigator.mediaDevices.getUserMedia({ video: r.includes("camera"), audio: !0 }), ((i = this.state.captureStream) == null ? void 0 : i.getAudioTracks().length) === 0 && this.state.captureStream.addTrack(this.state.avStream.getAudioTracks()[0]), this.handleCancelledStream(this.state.avStream);
1964
- } catch (s) {
1965
- return console.warn("Error: failed to get permissions: " + s), void (t && t(null, null));
1966
- }
1967
- t && t(this.state.avStream, this.state.captureStream);
1968
- }, async screenPermissionCallback(e) {
1969
- const { "screen.permission.requested": t, "stream.ready.callback": r } = e;
1970
- t == null || t(!0);
1971
- try {
1972
- this.state.captureStream = await navigator.mediaDevices.getDisplayMedia({ video: !0, cursor: "always", displaySurface: "browser", preferCurrentTab: !0 });
1973
- } catch (n) {
1974
- return t == null || t(!1), console.warn("Error: failed to get permissions: " + n), void (r && r(null, null));
1975
- }
1976
- t == null || t(!1), this.state.avStream && this.state.avStream.getAudioTracks().length > 0 && this.state.captureStream.addTrack(this.state.avStream.getAudioTracks()[0]), this.handleCancelledStream(this.state.captureStream), r && r(this.state.avStream || null, this.state.captureStream);
1977
- }, beginRecordingCallback(e) {
1978
- const { "recording.media.types": t, "start.recording.callback": r = () => {
1979
- } } = e;
1980
- if (!t) return;
1981
- const n = [];
1982
- if (t.includes("video") && this.state.avStream) {
1983
- this.state.avRecorder = lr(this.state.avStream);
1984
- const o = Ct();
1985
- cr(this.state.avRecorder, o, this.state.chunks), n.push(o);
1986
- }
1987
- if (t.includes("screen") && this.state.captureStream) {
1988
- this.state.screenRecorder = lr(this.state.captureStream);
1989
- const o = Ct();
1990
- cr(this.state.screenRecorder, o, this.state.chunks), n.push(o);
1991
- }
1992
- n && r && r(n);
1993
- }, async finishTaskCallback(e) {
1994
- const { "current.index": t, "task.response": r, "task.complete.callback": n } = e;
1995
- await this.stopRecording(e), n && n(this.taskDurationMillisecond()), this.state.cards && this.state.hasEndCard !== void 0 && this.lookAheadAndStopStream(t, r, this.state.cards, this.state.hasEndCard);
1996
- }, startTaskCallback() {
1997
- this.state.startTime = /* @__PURE__ */ new Date();
1998
- }, permissionStatusCallback(e) {
1999
- var n;
2000
- const { "permission.status.callback": t } = e, r = this.state.avStream;
2001
- t && t(r, !!r && (r == null ? void 0 : r.getVideoTracks().length) > 0, !!((n = this.state.captureStream) != null && n.active), this.state.captureStream);
2002
- }, lookAheadAndStopStream(e, t, r, n) {
2003
- const { avRecorder: o, screenRecorder: i } = this.state, { allResponses: s } = O.getState(), l = tn({ cards: r, index: e, hasEndCard: n, allResponses: s });
2004
- l !== null && r[l].type === "recordedtask" || [o, i].map((c) => {
2005
- c && (c.state === "recording" && c.stop(), c.stream.getTracks().map((d) => {
2006
- d.readyState === "live" && d.stop();
2007
- }));
2008
- });
2009
- } }, st = Object.create(ii);
2010
- Object.freeze(st);
2011
- const ai = ({ mode: e = null, viewWindow: t, viewDocument: r, trackPageViewUrl: n }) => {
2012
- const o = r.documentElement;
2013
- let i;
2014
- try {
2015
- i = t.parent.location.href;
2016
- } catch {
2017
- i = t.location.href;
2018
- }
2019
- return { mode: e, sw: t.screen.width, sh: t.screen.height, cw: o.clientWidth, ch: o.clientHeight, p: n ?? i, l: t.navigator.language };
2020
- }, li = { configure: function(e, t = !0) {
2021
- var x;
2022
- const { answers: r, apiURL: n, endCard: o, eventEmitFn: i, fontFamilyURL: s, frame: l, previewKey: c, viewDocument: d, viewWindow: m } = e, u = Oe(e.headers) ? e.frame : d.body, p = e.UpChunk || window.UpChunk, g = Ce, h = ((v, E) => {
2023
- const T = [...v], k = /* @__PURE__ */ new Set(["videovoice", "recordedtask"]);
2024
- return v.some((C) => k.has(C.type)) && T.push({ name: -2, props: { routingOptions: [] }, type: "uploading" }), E && T.push({ name: -1, props: { routingOptions: [] }, type: "thanks" }), T;
2025
- })(e.cards, !!o);
2026
- st.configure(g, { cards: h, hasEndCard: !!o, apiURL: n, UpChunk: p }), O.setState({ apiURL: n, answers: r, border: e.border, index: e.startingQuestionIdx || 0, cards: h, configureExitOnOverlayClick: e.configureExitOnOverlayClick, customMetadata: e.customMetadata, endCard: e.endCard, envId: e.envId, eventEmitFn: i, fontFamily: e.fontFamily, forceBrandedLogo: e.forceBrandedLogo, frame: l, headers: e.headers, hasViewedEmbed: !1, isPreview: e.isPreview, marketingUrl: "https://sprig.com", meta: ai({ mode: e.mode, viewWindow: m, viewDocument: d, trackPageViewUrl: e.trackPageViewUrl }), mode: e.mode, previewKey: c, previewMode: e.previewMode, productConfig: e.productConfig, recorder: st, recorderEventEmitter: g, responseGroupUid: e.responseGroupUid, showStripes: e.showStripes, showSurveyBrand: e.showSurveyBrand, slugName: e.slugName, styleNonce: e.styleNonce, studyType: e.studyType, surveyId: e.surveyId, tabTitle: e.tabTitle, uploadingCardViewed: !1, uploadProgress: {}, useMobileStyling: e.useMobileStyling, useDesktopPrototype: e.useDesktopPrototype, userId: e.userId, viewDocument: e.viewDocument, visitorAttributes: e.visitorAttributes, viewedCardCount: e.startingQuestionIdx || 0 });
2027
- const { head: _ } = d;
2028
- if (St({ document: d, elementId: "sprig-style", styleString: `html,body,p,ol,ul,li,dl,dt,dd,blockquote,figure,fieldset,legend,textarea,pre,iframe,hr,h1,h2,h3,h4,h5,h6{margin:0;padding:0}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:400}button,input,select,textarea{margin:0}html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}ol,ul{padding-inline-start:1em}.ul-loading-spinner-container{font-size:1.8rem;flex-grow:1;width:100%;height:100%;display:flex;align-items:center;justify-content:center}.ul-loading-spinner{display:inline-block;position:relative;width:6rem;height:6rem}.ul-loading-spinner div{box-sizing:border-box;display:block;position:absolute;width:80%;height:80%;margin:5px;border:5px solid #152e3e;border-radius:50%;animation:lds-ring 1.2s cubic-bezier(.5,0,.5,1) infinite;border-color:#152e3e transparent transparent transparent}.ul-loading-spinner .first{animation-delay:-.45s}.ul-loading-spinner .second{animation-delay:-.3s}.ul-loading-spinner .third{animation-delay:-.15s}@keyframes lds-ring{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.fade-in-transition{animation:fadeIn .4s ease-in}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.ul-card{flex:1 1 auto;border-radius:2px;display:flex;flex-direction:column;font-size:17px;line-height:19px;text-align:start;min-width:200px;justify-content:center;animation:enable-transitions 0s .3s forwards;min-height:0}@keyframes enable-transitions{to{transition:opacity .2s ease-in-out}}.ul-focus-transitions-active .ul-card,.ul-card--with-transitions{transition:opacity .2s ease-in-out}.ul-card__container--desktop{border:2px solid #fff;box-shadow:0 0 15px #00000026;margin:15px}.ul-card__container--mobile{border-width:0;box-shadow:0 0 5px #00000040;margin-top:5px}.ul-card__container--desktop_longFormSurvey,.ul-card__container--mobile_longFormSurvey{margin:0}.sprig-container{display:flex;flex-direction:column;width:100%;height:fit-content;flex:1 1 auto;min-height:0;justify-content:center}.ul-card__container{background:#fff;border-radius:6px;display:flex;flex-direction:column;flex-grow:1;flex:1 1 auto;font-size:17px;line-height:23px;padding:0;min-height:0;position:relative;text-align:center;word-break:normal;overflow:auto}.ul-card__container--desktop_feedbackButton{box-shadow:unset}.ul-card-vertical__button-wrapper{flex-direction:column;align-items:center}.ul-card__button-wrapper{margin-top:4px;display:flex;gap:16px;justify-content:center;align-self:stretch}.sprig-question-footer-container{align-items:center;width:100%;height:fit-content;display:flex;flex-direction:column;padding:12px 20px 0}.long-form-question-footer-container{position:fixed;bottom:0;left:0;width:100%;display:flex;justify-content:space-between;align-items:center;overflow:visible;z-index:1000;pointer-events:none;padding:32px}.long-form-question-footer-container--mobile{background-color:#fff;border-top:1px solid #e6e6e6;padding:16px 24px}.long-form-question-footer-container-center{justify-content:center}.long-form-question-footer-container .long-form-question-footer-container-logo{width:auto;pointer-events:auto}.long-form-question-footer-container-center .long-form-question-footer-container-logo{margin-left:0}.long-form-question-footer-container .long-form-question-footer-container-actions{display:flex;gap:8px;pointer-events:auto}.long-form-question-footer-container .long-form-question-footer-container-actions .long-form-button{display:flex;justify-content:center;align-items:center;gap:8px;padding:12px;border-radius:8px;height:40px;width:40px}.long-form-question-footer-container .long-form-question-footer-container-actions .long-form-button .long-form-button-text-container{display:flex;align-items:center}.ul-rich-text-body{min-height:2em}.ul-rich-text-body,.ul-rich-text-body p{margin-top:10px;margin-bottom:10px}.ul-rich-text-body li{margin:5px 0}.ul-rich-text-body p,.ul-rich-text-body li{font-size:15px;line-height:130.35%;letter-spacing:.02em;color:#343442;text-align:start;white-space:pre-line}.ul-rich-text-body:last-child,.ul-rich-text-body li:last-child{margin-bottom:15px}.ul-card-main-content__link,.ul-card-main-content__email,.ul-card-main-content__web,.ul-card-main-content__android,.ul-card-main-content__ios{display:flex;flex:1 1 auto;min-height:0;flex-direction:column;z-index:2;height:fit-content}.sprig-border-bottom{border-bottom:1px solid rgba(0,0,0,.1)}.sprig-border-top{border-top:1px solid rgba(0,0,0,.1)}.question-header-container{z-index:1}.sprig-header-container{padding:16px}.question-header-button-container{display:grid;grid-template-columns:97fr 3fr;align-items:center;justify-content:space-between;width:100%;height:fit-content}.ul-card--thanks-content .question-header-button-container{justify-content:center}.sprig-question-body{padding:0 20px;min-height:0;flex-shrink:1;overflow:auto;position:relative;align-self:stretch;width:100%}.sprig-stretch{align-self:stretch}.ul-question{color:#343442;display:block;font-size:17px;line-height:125%;font-weight:500;cursor:default;text-align:start}.ul-question ol,.ul-question ul,.ul-caption ol,.ul-caption ul{margin-left:1em}.ul-caption{flex:1 0 auto;font-size:14px;line-height:130.35%;letter-spacing:.02em;color:#6c6c6e;text-align:start;margin-top:4px}.ul-card__choices{margin:5px 0 0;flex:1 0}.choice--mobile{border:2px solid #e6e6e6}.choice--desktop{border:1px solid #e6e6e6}.choice{align-items:flex-start;color:#262136;cursor:pointer;display:flex;justify-content:flex-start;flex-direction:column;box-sizing:border-box;border-radius:3px;margin-bottom:7px;font-size:15px;line-height:20px;padding:10px 20px 10px 15px;background-color:#00000003}.choice--desktop:hover,.choice--desktop:active,.choice--mobile:active{background-color:#0000000d}.choice-label-container{align-items:center;display:flex;flex-direction:row;flex:0 0 fit-content;gap:15px;height:fit-content;justify-content:flex-start;width:100%}.choice-text-entry-container{width:100%;height:fit-content;flex:0 1 fit-content;overflow:hidden}.choice .choice-text-input--mobile{max-height:63px}.choice .choice-text-input--desktop{max-height:150px}.choice .choice-text-input{box-sizing:border-box;background-color:transparent;color:#343442;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;min-height:20px;max-height:60px;padding:0;margin-top:8px;resize:none;width:100%;font-size:14px;line-height:20px;outline:none;border:none;overflow-wrap:break-word}.choice .choice-text-input::placeholder{color:#6c6c6e80}.ul-thanks-check{text-align:center;margin-bottom:20px}.ul-card--thanks-content{padding:20px 0 10px}.ul-card--thanks .ul-question{padding-top:0;text-align:center}.ul-card--thanks .ul-caption{padding-top:0;text-align:center;overflow-wrap:break-word;-webkit-hyphens:auto;hyphens:auto;hyphenate-limit-lines:no-limit}.ul-card--uploading .ul-question{padding-top:15px;text-align:center}.ul-card--uploading .ul-caption{padding-top:5px;text-align:center;overflow-wrap:break-word}.select-checkbox{height:16px;width:16px;display:flex;box-sizing:border-box;background-color:"transparent";align-items:center;justify-content:center;border-radius:4px;border:1px solid #b0b5b7;flex-shrink:0}.select-radio{height:16px;width:16px;border-radius:16px;border:1px solid #323232;display:flex;box-sizing:border-box;box-shadow:inset 2px 2px #0000001a;background-color:"transparent";align-items:center;justify-content:center}.footer{width:100%;margin-top:12px;font-size:12px;line-height:12px;color:#000000b3}[class^=CenteredSurveyLayout] .ul-header__container,[class^=QuestionConceptTestLayout] .ul-header__container,.ul-websurvey-frame .ul-card__container,.ul-websurvey-frame-mobile .ul-card__container{margin-bottom:unset}[class^=CenteredSurveyLayout] .ul-card__container,[class^=QuestionConceptTestLayout] .ul-card__container,.ul-websurvey-frame .ul-card__container,.ul-websurvey-frame-mobile .ul-card__container{align-self:center;box-shadow:unset;border-radius:unset;border:none!important;position:unset;width:100%}@media only screen and (min-height: 600px) and (width: 600px){.ul-card{position:relative;top:-20px}}.ul-vertical-centered-container{display:flex;flex-direction:column;align-items:center;align-self:stretch}.sprig-accordion{width:100%;margin-bottom:8px}.sprig-accordion-body{width:100%;overflow:hidden}.sprig-accordion-header-container{background:transparent;border:none;display:flex;flex-direction:row;align-items:center;justify-content:space-between;width:100%;cursor:pointer;margin:8px 0 0;padding:0;font-family:inherit}.sprig-header-label-container{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:8px;flex:1 1 0}.sprig-header-label{color:#343442;font-size:15px;font-weight:590;line-height:21px;text-align:start;overflow:hidden}.sprig-check-background{flex:0 0 16px;height:16px;width:16px;border-radius:8px;margin-right:8px;background-color:#efefee;display:flex;align-items:center;justify-content:center}.sprig-check{height:9px;width:9px;margin-left:-1px}.sprig-check path{stroke:#506067;stroke-width:1.5}.sprig-caret{height:20px;width:20px;transition-property:transform}.sprig-caret path{stroke:#000}.ul-card-longform__submit-button-container{display:flex;justify-content:flex-end}.ul-card-longform__submit-button-container .ul-card-longform__submit-button{display:flex;flex-direction:row;align-items:center;white-space:nowrap;gap:4px;border-radius:8px;color:#fff;cursor:pointer}.ul-card-longform__submit-button-container .ul-card-longform__submit-button:disabled{opacity:.5;cursor:not-allowed}.ul-card-list-container--longform{display:flex;flex-direction:column;gap:2rem;width:100%;align-items:center;padding-block-start:calc(40vh - 100px);padding-block-end:calc(50vh - 100px);height:auto}@media (min-height: 1200px){.ul-card-list-container--longform{padding-block-start:calc(50vh - 100px)}}.ul-card-scroll-wrapper{width:100%;max-width:100vw;position:relative;display:flex;justify-content:center}.ul-card--unfocused{opacity:.3;transition:opacity .3s ease-in-out}.ul-consent-legal__name-input--mobile{border:2px solid #e6e6e6}.ul-consent-legal__name-input--desktop{border:1px solid #e6e6e6}.ul-consent-legal__name-input{background:#00000003;box-sizing:border-box;color:#343442;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;padding:10px 20px 10px 15px;border-radius:3px;font-size:15px;line-height:20px;margin-bottom:7px;width:100%}.ul-consent-legal__name-input::placeholder{color:#6c6c6e80}.ul-consent-legal__name-input:focus{outline:none;background:#fff}.ul-consent-legal__name-input--desktop:hover:not(:focus){background-color:#0000000d}.ul-card__consent-legal .choice{font-size:15px;padding:10px 15px;background-color:#00000003}.ul-card__consent-legal .choice--desktop:hover,.ul-card__consent-legal .choice--desktop:active,.ul-card__consent-legal .choice--mobile:active{background-color:#0000000d}.ul-card--likert__numbers{align-items:center;border-radius:5px;display:flex;flex-direction:row;flex:1 0;justify-content:center;margin:5px 0 0}.ul-card--likert__numbers>button{padding:unset}.likert-number--mobile{border:2px solid #e6e6e6}.likert-number--mobile:not(:first-child){margin-inline-start:-2px}.likert-number--desktop{border:1px solid #e6e6e6}.likert-number--desktop:not(:first-child){margin-inline-start:-1px}.likert-number{align-items:center;cursor:pointer;display:flex;justify-content:center;flex:1 0;background-color:#00000003;font-size:18px;line-height:24px;height:67px}.likert-number:first-child{border-start-start-radius:5px;border-end-start-radius:5px}.likert-number:last-child{border-start-end-radius:5px;border-end-end-radius:5px}.likert-number:active,.likert-number--desktop:hover{background-color:#0000000d;font-weight:500}.likert-star--mobile:not(:first-child){margin-inline-start:-2px}.likert-star--desktop:not(:first-child){margin-inline-start:-1px}.likert-star{align-items:center;cursor:pointer;display:flex;justify-content:space-between;flex:1 0;color:transparent;font-size:18px;line-height:24px;height:67px;background:unset;border:unset}.likert-smiley--mobile:not(:first-child){margin-inline-start:-2px}.likert-smiley--desktop:not(:first-child){margin-inline-start:-1px}.likert-smiley{align-items:center;cursor:pointer;display:flex;justify-content:space-between;flex:1 0;color:transparent;line-height:24px;height:67px;background:unset;border:unset}.likert-smiley>svg{margin:0 auto}.likert-smiley circle:not(:first-child){fill-opacity:1}.ul-card--likert__labels{align-items:center;color:#262136;display:flex;flex-direction:row;flex:1 0;font-weight:500;font-size:13px;line-height:15px;justify-content:space-between;margin:7px 0 10px}.ul-card--likert__labels>span:last-child{margin-left:auto;flex:1 1 auto;min-width:0;text-align:right}.ul-card--matrix_grid{display:grid;grid-template-columns:max-content repeat(var(--numColumns),minmax(107px,1fr));grid-template-rows:repeat(var(--numRows),min-content);margin:0 auto;row-gap:4px;width:max-content}.ul-card--matrix_grid_longform{width:100%}.ul-matrix-row-options{display:grid;grid-column:2/-1;grid-template-columns:subgrid}.ul-matrix-column-label{font-size:15px;max-width:150px;padding:10px 12px;text-align:center}.ul-card--matrix_container{margin-bottom:16px;overflow:auto}.ul-card--matrix_question_container{display:flex;flex-direction:column}.ul-matrix-scroll-gradient{-webkit-mask-image:linear-gradient(90deg,#000 90%,transparent);mask-image:linear-gradient(90deg,#000 90%,transparent)}.ul-matrix-scroll-gradient:dir(rtl){-webkit-mask-image:linear-gradient(270deg,#000,90%,transparent);mask-image:linear-gradient(270deg,#000,90%,transparent)}.ul-matrix-scroll-gradient:dir(rtl)+.ul-matrix-scroll-arrow{rotate:180deg}.ul-matrix-scroll-arrow{align-self:flex-end;background:none;border:none;color:#000;padding:0;position:absolute;top:45%}.ul-matrix-scroll-arrow:hover{cursor:pointer}.ul-matrix-option-wrapper{align-items:center;background:#f9f9f8;display:flex;justify-content:center;padding:10px 12px}.ul-matrix-last-option{border-start-end-radius:4px;border-end-end-radius:4px}.ul-matrix-row-label{align-items:center;background:#f9f9f8;border-end-start-radius:4px;border-start-start-radius:4px;display:flex;font-size:15px;left:0;right:0;max-width:200px;min-width:100px;padding:10px 12px;position:sticky}.ul-matrix-option-selected{border:6px solid var(--border);box-shadow:none}.ul-card__matrix{max-width:100%}.select-label{cursor:pointer;flex:1;overflow-wrap:anywhere;text-align:start}.ul-card--nps__numbers{align-items:center;border-radius:5px;display:flex;flex-direction:row;flex:1 0;justify-content:center;margin:5px 0 0}.nps-number--mobile{border:2px solid #e6e6e6}.nps-number--mobile:not(:first-child){margin-inline-start:-2px}.nps-number--desktop{border:1px solid #e6e6e6}.nps-number--desktop:not(:first-child){margin-inline-start:-1px}.nps-number{align-items:center;cursor:pointer;display:flex;justify-content:center;flex:1 0;background-color:#00000003;font-size:18px;line-height:24px;height:67px;padding:unset}.nps-number:first-child{border-start-start-radius:5px;border-end-start-radius:5px}.nps-number:last-child{border-start-end-radius:5px;border-end-end-radius:5px}.nps-number:active,.nps-number--desktop:hover{background-color:#0000000d;font-weight:500}.ul-card--nps__labels{align-items:center;color:#262136;display:flex;flex-direction:row;flex:1 0;font-weight:500;font-size:13px;line-height:15px;justify-content:space-between;margin:7px 0 10px}.ul-card-rank__labels{font-size:14px;font-style:normal;font-weight:600;line-height:150%}.ul-card--rank__question-inner-container{padding:0 16px}.ul-card-rank__list{list-style-type:none;padding-inline-start:0;margin:4px 0}.ul-card-rank__option{display:flex;align-items:center;padding:8px;gap:8px;align-self:stretch;border:1px solid #e2e3e1;border-radius:8px;margin-bottom:4px}.ul-card-rank__option:last-child{margin-bottom:0}.ul-card-rank__drag-btn{display:inline-flex;align-items:center;justify-content:center;line-height:0;padding:0;width:25px;height:25px;margin-left:auto;color:#0b2330;cursor:grab;background:transparent;border:0}.ul-card-rank__drag-btn:active,.ul-card-rank__option:active{cursor:grabbing}.ul-card-rank__option svg{display:block}.ul-card-rank__option.is-dragging{opacity:1;box-shadow:0 8px 25px #00000026,0 3px 10px #0000001a;z-index:1000;background:#fff;border-color:#0b2330}.ul-card-rank__option.is-drop-target{background:#0b23301a;border-radius:8px;border-color:#0b23301a}.ul-card-rank__option.is-drop-target select,.ul-card-rank__option.is-drop-target span,.ul-card-rank__option.is-drop-target button{visibility:hidden}.ul-card-rank__option span{font-size:14px;font-weight:400}.ul-card-rank__select{appearance:none;-webkit-appearance:none;-moz-appearance:none;box-sizing:border-box;height:25px;min-height:25px;border:1px solid #E2E3E1;border-radius:4px;font-size:14px;line-height:1.4;padding:2px 28px 2px 8px;background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='13' viewBox='0 0 12 13' fill='none'><path d='M9.75 5L6 8.75L2.25 5' stroke='%230B2330' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");background-repeat:no-repeat;background-position:right 8px center;background-size:12px 12px;background-color:#fff;cursor:pointer}.ul-card-rank__select.ul-card-rank__select--placeholder{color:#b0b5b7}.ul-card-text{margin-top:2px;margin-bottom:3px;display:flex;flex-direction:column;justify-content:center;padding:0;width:100%}.ul-card-text__container{align-items:center;box-sizing:border-box;border-radius:3px;display:flex;justify-content:center;margin-bottom:12px;flex:1 0 100%}.ul-card-text__input--mobile{border:2px solid #e6e6e6;max-height:63px}.ul-card-text__input--desktop{border:1px solid #e6e6e6;max-height:150px}.ul-card-text__input{background:#00000003;box-sizing:border-box;color:#343442;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;min-height:63px;overflow:auto;padding:12px;resize:none;width:100%;border-radius:3px;font-size:15px;line-height:20px;overflow-wrap:break-word}.ul-card-text__input::placeholder{color:#6c6c6e80}.ul-card-text__input:focus{outline:none;background:#fff}.ul-card-text__input--desktop:hover:not(:focus){background-color:#0000000d}.ul-card__text-url-prompt-button{text-decoration:none;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;max-width:-webkit-fill-available}#ul-card-video__player_recorder{width:100%;width:-moz-available;width:-webkit-fill-available;width:fill-available}.ul-card-record__task{flex:1 0 auto;margin-top:2px;margin-bottom:3px;align-items:center;display:flex;flex-wrap:wrap;justify-content:center;padding:0}#ul-record-task-upload-progress,#ul-record-task-video-preview{width:100%;height:150px}.ul-permission-graphics-container{width:100%;height:150px;background-color:#0000000d;text-align:center;flex-direction:column;margin-left:auto;margin-right:auto;border-radius:5px;display:flex;align-items:center;font-size:15px;color:#000000b3}.ul-av-permission-denied-paragraph{margin:auto 15px;font-size:12px}.ul-av-permission-denied-headline{font-size:14px;color:#262136;text-decoration:underline;font-size:12px}.ul-permission-body{color:#000;margin:5px auto 5px 5px;line-height:135%;text-align:center}.ul-select-tab-container{width:240px;height:46px;background:#fff;border-radius:5px;text-align:start;align-items:center;display:flex;padding:0 5px;margin-top:20px;margin-bottom:auto}.ul-select-tab-text{color:#4b575d;margin:5px;line-height:135%;text-align:center}button.ul-task-skip-button{color:#000;background-color:#fff}#ul-task-detail-container{margin-top:0;margin-bottom:0;overflow:auto}#ul-task-detail-container.ul-rich-text-body p,#ul-task-detail-container.ul-rich-text-body li,#ul-task-detail-container.ul-rich-text-body{color:#4c4c4c}#ul-task-detail-container :first-child{margin-top:0}#ul-task-detail-container :last-child{margin-bottom:20px}.ul-horizontal-button-container{width:100%;display:flex;flex-direction:row}.ul-skip-button-below{margin-top:5px}.ul-horizontal-button-container-center{justify-content:center}.ul-vertical-button-container-center{display:flex;flex-direction:column;align-items:center}.ul-horizontal-button-container-left{justify-content:flex-start}.ul_recorded-task-inset-spacing{margin-top:5px;margin-bottom:24px}.ul_permission_svg_container{justify-content:center}.ul-card-text__button{background-color:var(--theme);border-radius:3px;border:none;color:#fff;cursor:pointer;font-size:15px;font-weight:500;line-height:18px;padding:10.5px 21px}.ul-card-text__button:disabled,.ul-card-text__button.sprig-button-disabled{background-color:#0000001a;color:#0003}.ul-card-text__button:disabled>svg path,.ul-card-text__button.sprig-button-disabled>svg path{stroke:#0003}.ul-card-text__button.ul-button-inactive{background-color:#fff!important;color:#5d696f!important}.ul-card-skip__button{color:#00000080;background:none;border:none;font-size:15px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;cursor:pointer}.ul-card-button-group{align-items:center;display:flex;gap:15px;justify-content:center;flex-direction:column}.select-button{align-items:center;background-color:transparent;border-radius:8px;border:1px solid #0b2330;box-shadow:0 0 0 2px #c8cccc;cursor:pointer;display:flex;font-size:15px;justify-content:space-between;margin-bottom:8px;padding:4px 8px 4px 16px;width:100%}.select-button:hover{background-color:#f3f3f3}.select-button:active{background-color:#eee}.select-button span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select-button.select-button-placeholder{color:#b0b5b7}.select-button svg{flex-shrink:0}.select-list{position:relative;height:fit-content;padding:4px 0;z-index:100;background-color:#fff;border:1px solid #E2E3E1;box-shadow:0 16px 24px #0b23300d,0 4px 12px #0b233008;border-radius:8px;overflow-y:scroll;width:100%}.select-option{align-items:center;cursor:pointer;display:flex;font-size:15px;gap:16px;line-height:20px;padding:8px 16px}.select-option:hover{background-color:#f3f3f3}html,body{cursor:default;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;height:100%;overflow:hidden;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;-webkit-touch-callout:none}b{font-weight:500}form{margin-block-end:0;margin-block-start:0}#ul-app{opacity:0;width:100%;flex-grow:2;display:flex}#ul-app.ul-app--overlay{position:absolute;bottom:0;transition:opacity .1s ease-out;transition-delay:.1s}#ul-app.ul-app--visible{opacity:1;bottom:0}.ul-app__container{width:100%;display:flex;flex-direction:column;max-height:100vh}.ul-header__container{margin-bottom:15px}.ul-header{align-items:center;background:repeating-linear-gradient(120deg,#ebebeb,#ebebeb 24px,#fff 24px,#fff 48px);border-bottom:2px solid #ebebeb;display:flex;font-size:14px;font-weight:500;height:40px;justify-content:center;width:100%}.ul-footer{display:flex;flex-direction:column;align-items:center;justify-content:flex-end;margin-top:auto;flex-grow:0;width:100%;min-height:10px;height:fit-content;flex-shrink:0}.ul-footer>.yellow-footer-logo{background:#fad133;border:1px solid #f9c600;border-radius:14px;padding:6px 12px}.ul-footer>.yellow-footer-logo:hover{background:#f9c600}.ul-footer .thank-you-card-link{background:#00000003;border:1px solid #e6e6e6;border-radius:8px;cursor:pointer;display:inline-flex;font-size:14px;gap:12px;margin-bottom:15px;padding:12px;text-align:initial;width:280px}.ul-footer .thank-you-card-link:hover{background:#00000008}.ul-footer>a{color:inherit}.ul-footer-bubble{display:inline-block;margin:0 3px;width:7px;height:7px;border-radius:3px;border:1px solid transparent}.sprig-box-logo{background:#f9c600;border-radius:5px;display:flex;padding:4px}.close-container{display:flex;justify-content:flex-end;width:100%;height:0}.close-btn{cursor:pointer;height:16px;margin-inline-end:-10px;position:relative;top:-10px;width:16px;z-index:1;align-self:flex-start;justify-self:end;flex-shrink:0}.ul-app__container{transition:opacity .3s ease-out}.ul-center-horizontally{text-align:center}.ul-progress-bar-container{width:100%;height:2px;background-color:#0000001a;border-radius:2px}.ul-progress-bar-container__footer{max-width:250px;margin:16px 0}.ul-progress-bar-container__header{position:fixed;top:80px;max-width:unset;margin:0;z-index:3}.ul-progress-bar-current{transition:width 1s ease;width:0%;height:0;border-radius:2px}.prototype-button{align-self:stretch;background:#00000003;border:1.5px solid #e6e6e6;border-radius:4px 0 0 4px;flex:none;flex-grow:0;height:fit-content;line-height:16.5px;margin:0 20px;padding:20px 0;font-size:14px;font-family:inherit;text-decoration:underline}.prototype-button:hover{cursor:pointer}` }), e.customStyles && St({ document: d, elementId: "ul-custom-style", styleString: e.customStyles, nonce: e.styleNonce }), e.fontFamily && s && parent) {
2029
- const v = d.createElement("link");
2030
- v.rel = "stylesheet", v.href = s, _.appendChild(v);
2031
- }
2032
- const b = i || ((x = l.eventEmitter) == null ? void 0 : x.emit);
2033
- b == null || b("verify.view.version", { "view.version": "2.35.0" }), u && t && (ye(a(oi, {}), u), Ce.once(X.SurveyClosed, () => {
2034
- gt(u);
2035
- }));
2036
- } };
2037
- export {
2038
- li as default
2039
- };