@sprig-technologies/sprig-bundled 1.1.2 → 1.1.4

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,3977 +0,0 @@
1
- import { g as pr, a as fr, C as g, b as G, T as W, i as ze, c as yt, D as xt, A as fe, I as ee, e as Ie, s as $e, S as re, d as ye, P as Ke, f as _r, R as hr, u as Ye, h as mr, j as gr, k as br, l as w, E as vr, m as V, n as xe, o as st, p as de, q as z, r as Se, t as H, v as L, M as Q, w as yr, x as xr, y as Cr, z as Ct, B as kr } from "./index-2R2XP7B7.js";
2
- var Te, C, tn, le, kt, nn, Je, rn, we = {}, on = [], Sr = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, Ve = Array.isArray;
3
- function J(e, t) {
4
- for (var n in t)
5
- e[n] = t[n];
6
- return e;
7
- }
8
- function an(e) {
9
- var t = e.parentNode;
10
- t && t.removeChild(e);
11
- }
12
- function U(e, t, n) {
13
- var r, o, i, a = {};
14
- for (i in t)
15
- i == "key" ? r = t[i] : i == "ref" ? o = t[i] : a[i] = t[i];
16
- if (arguments.length > 2 && (a.children = arguments.length > 3 ? Te.call(arguments, 2) : n), typeof e == "function" && e.defaultProps != null)
17
- for (i in e.defaultProps)
18
- a[i] === void 0 && (a[i] = e.defaultProps[i]);
19
- return Ce(e, a, r, o, null);
20
- }
21
- function Ce(e, t, n, r, o) {
22
- var i = { type: e, props: t, key: n, ref: r, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, constructor: void 0, __v: o ?? ++tn, __i: -1, __u: 0 };
23
- return o == null && C.vnode != null && C.vnode(i), i;
24
- }
25
- function sn() {
26
- return { current: null };
27
- }
28
- function j(e) {
29
- return e.children;
30
- }
31
- function Z(e, t) {
32
- this.props = e, this.context = t;
33
- }
34
- function _e(e, t) {
35
- if (t == null)
36
- return e.__ ? _e(e.__, e.__i + 1) : null;
37
- for (var n; t < e.__k.length; t++)
38
- if ((n = e.__k[t]) != null && n.__e != null)
39
- return n.__e;
40
- return typeof e.type == "function" ? _e(e) : null;
41
- }
42
- function ln(e) {
43
- var t, n;
44
- if ((e = e.__) != null && e.__c != null) {
45
- for (e.__e = e.__c.base = null, t = 0; t < e.__k.length; t++)
46
- if ((n = e.__k[t]) != null && n.__e != null) {
47
- e.__e = e.__c.base = n.__e;
48
- break;
49
- }
50
- return ln(e);
51
- }
52
- }
53
- function Xe(e) {
54
- (!e.__d && (e.__d = !0) && le.push(e) && !Oe.__r++ || kt !== C.debounceRendering) && ((kt = C.debounceRendering) || nn)(Oe);
55
- }
56
- function Oe() {
57
- var e, t, n, r, o, i, a, l, c;
58
- for (le.sort(Je); e = le.shift(); )
59
- e.__d && (t = le.length, r = void 0, i = (o = (n = e).__v).__e, l = [], c = [], (a = n.__P) && ((r = J({}, o)).__v = o.__v + 1, C.vnode && C.vnode(r), lt(a, r, o, n.__n, a.ownerSVGElement !== void 0, 32 & o.__u ? [i] : null, l, i ?? _e(o), !!(32 & o.__u), c), r.__.__k[r.__i] = r, dn(l, r, c), r.__e != i && ln(r)), le.length > t && le.sort(Je));
60
- Oe.__r = 0;
61
- }
62
- function cn(e, t, n, r, o, i, a, l, c, d, p) {
63
- var s, _, f, h, m, y = r && r.__k || on, v = t.length;
64
- for (n.__d = c, wr(n, t, y), c = n.__d, s = 0; s < v; s++)
65
- (f = n.__k[s]) != null && typeof f != "boolean" && typeof f != "function" && (_ = f.__i === -1 ? we : y[f.__i] || we, f.__i = s, lt(e, f, _, o, i, a, l, c, d, p), h = f.__e, f.ref && _.ref != f.ref && (_.ref && ct(_.ref, null, f), p.push(f.ref, f.__c || h, f)), m == null && h != null && (m = h), 65536 & f.__u || _.__k === f.__k ? c = un(f, c, e) : typeof f.type == "function" && f.__d !== void 0 ? c = f.__d : h && (c = h.nextSibling), f.__d = void 0, f.__u &= -196609);
66
- n.__d = c, n.__e = m;
67
- }
68
- function wr(e, t, n) {
69
- var r, o, i, a, l, c = t.length, d = n.length, p = d, s = 0;
70
- for (e.__k = [], r = 0; r < c; r++)
71
- (o = e.__k[r] = (o = t[r]) == null || typeof o == "boolean" || typeof o == "function" ? null : typeof o == "string" || typeof o == "number" || typeof o == "bigint" || o.constructor == String ? Ce(null, o, null, null, o) : Ve(o) ? Ce(j, { children: o }, null, null, null) : o.constructor === void 0 && o.__b > 0 ? Ce(o.type, o.props, o.key, o.ref ? o.ref : null, o.__v) : o) != null ? (o.__ = e, o.__b = e.__b + 1, l = Tr(o, n, a = r + s, p), o.__i = l, i = null, l !== -1 && (p--, (i = n[l]) && (i.__u |= 131072)), i == null || i.__v === null ? (l == -1 && s--, typeof o.type != "function" && (o.__u |= 65536)) : l !== a && (l === a + 1 ? s++ : l > a ? p > c - a ? s += l - a : s-- : s = l < a && l == a - 1 ? l - a : 0, l !== r + s && (o.__u |= 65536))) : (i = n[r]) && i.key == null && i.__e && (i.__e == e.__d && (e.__d = _e(i)), et(i, i, !1), n[r] = null, p--);
72
- if (p)
73
- for (r = 0; r < d; r++)
74
- (i = n[r]) != null && !(131072 & i.__u) && (i.__e == e.__d && (e.__d = _e(i)), et(i, i));
75
- }
76
- function un(e, t, n) {
77
- var r, o;
78
- if (typeof e.type == "function") {
79
- for (r = e.__k, o = 0; r && o < r.length; o++)
80
- r[o] && (r[o].__ = e, t = un(r[o], t, n));
81
- return t;
82
- }
83
- return e.__e != t && (n.insertBefore(e.__e, t || null), t = e.__e), t && t.nextSibling;
84
- }
85
- function X(e, t) {
86
- return t = t || [], e == null || typeof e == "boolean" || (Ve(e) ? e.some(function(n) {
87
- X(n, t);
88
- }) : t.push(e)), t;
89
- }
90
- function Tr(e, t, n, r) {
91
- var o = e.key, i = e.type, a = n - 1, l = n + 1, c = t[n];
92
- if (c === null || c && o == c.key && i === c.type)
93
- return n;
94
- if (r > (c != null && !(131072 & c.__u) ? 1 : 0))
95
- for (; a >= 0 || l < t.length; ) {
96
- if (a >= 0) {
97
- if ((c = t[a]) && !(131072 & c.__u) && o == c.key && i === c.type)
98
- return a;
99
- a--;
100
- }
101
- if (l < t.length) {
102
- if ((c = t[l]) && !(131072 & c.__u) && o == c.key && i === c.type)
103
- return l;
104
- l++;
105
- }
106
- }
107
- return -1;
108
- }
109
- function St(e, t, n) {
110
- t[0] === "-" ? e.setProperty(t, n ?? "") : e[t] = n == null ? "" : typeof n != "number" || Sr.test(t) ? n : n + "px";
111
- }
112
- function Re(e, t, n, r, o) {
113
- var i;
114
- e:
115
- if (t === "style")
116
- if (typeof n == "string")
117
- e.style.cssText = n;
118
- else {
119
- if (typeof r == "string" && (e.style.cssText = r = ""), r)
120
- for (t in r)
121
- n && t in n || St(e.style, t, "");
122
- if (n)
123
- for (t in n)
124
- r && n[t] === r[t] || St(e.style, t, n[t]);
125
- }
126
- else if (t[0] === "o" && t[1] === "n")
127
- 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] = n, n ? r ? n.u = r.u : (n.u = Date.now(), e.addEventListener(t, i ? Tt : wt, i)) : e.removeEventListener(t, i ? Tt : wt, i);
128
- else {
129
- if (o)
130
- t = t.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
131
- 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)
132
- try {
133
- e[t] = n ?? "";
134
- break e;
135
- } catch {
136
- }
137
- typeof n == "function" || (n == null || n === !1 && t[4] !== "-" ? e.removeAttribute(t) : e.setAttribute(t, n));
138
- }
139
- }
140
- function wt(e) {
141
- var t = this.l[e.type + !1];
142
- if (e.t) {
143
- if (e.t <= t.u)
144
- return;
145
- } else
146
- e.t = Date.now();
147
- return t(C.event ? C.event(e) : e);
148
- }
149
- function Tt(e) {
150
- return this.l[e.type + !0](C.event ? C.event(e) : e);
151
- }
152
- function lt(e, t, n, r, o, i, a, l, c, d) {
153
- var p, s, _, f, h, m, y, v, k, S, E, b, x, I, N, T = t.type;
154
- if (t.constructor !== void 0)
155
- return null;
156
- 128 & n.__u && (c = !!(32 & n.__u), i = [l = t.__e = n.__e]), (p = C.__b) && p(t);
157
- e:
158
- if (typeof T == "function")
159
- try {
160
- if (v = t.props, k = (p = T.contextType) && r[p.__c], S = p ? k ? k.props.value : p.__ : r, n.__c ? y = (s = t.__c = n.__c).__ = s.__E : ("prototype" in T && T.prototype.render ? t.__c = s = new T(v, S) : (t.__c = s = new Z(v, S), s.constructor = T, s.render = Er), k && k.sub(s), s.props = v, s.state || (s.state = {}), s.context = S, s.__n = r, _ = s.__d = !0, s.__h = [], s._sb = []), s.__s == null && (s.__s = s.state), T.getDerivedStateFromProps != null && (s.__s == s.state && (s.__s = J({}, s.__s)), J(s.__s, T.getDerivedStateFromProps(v, s.__s))), f = s.props, h = s.state, s.__v = t, _)
161
- T.getDerivedStateFromProps == null && s.componentWillMount != null && s.componentWillMount(), s.componentDidMount != null && s.__h.push(s.componentDidMount);
162
- else {
163
- if (T.getDerivedStateFromProps == null && v !== f && s.componentWillReceiveProps != null && s.componentWillReceiveProps(v, S), !s.__e && (s.shouldComponentUpdate != null && s.shouldComponentUpdate(v, s.__s, S) === !1 || t.__v === n.__v)) {
164
- for (t.__v !== n.__v && (s.props = v, s.state = s.__s, s.__d = !1), t.__e = n.__e, t.__k = n.__k, t.__k.forEach(function(A) {
165
- A && (A.__ = t);
166
- }), E = 0; E < s._sb.length; E++)
167
- s.__h.push(s._sb[E]);
168
- s._sb = [], s.__h.length && a.push(s);
169
- break e;
170
- }
171
- s.componentWillUpdate != null && s.componentWillUpdate(v, s.__s, S), s.componentDidUpdate != null && s.__h.push(function() {
172
- s.componentDidUpdate(f, h, m);
173
- });
174
- }
175
- if (s.context = S, s.props = v, s.__P = e, s.__e = !1, b = C.__r, x = 0, "prototype" in T && T.prototype.render) {
176
- for (s.state = s.__s, s.__d = !1, b && b(t), p = s.render(s.props, s.state, s.context), I = 0; I < s._sb.length; I++)
177
- s.__h.push(s._sb[I]);
178
- s._sb = [];
179
- } else
180
- do
181
- s.__d = !1, b && b(t), p = s.render(s.props, s.state, s.context), s.state = s.__s;
182
- while (s.__d && ++x < 25);
183
- s.state = s.__s, s.getChildContext != null && (r = J(J({}, r), s.getChildContext())), _ || s.getSnapshotBeforeUpdate == null || (m = s.getSnapshotBeforeUpdate(f, h)), cn(e, Ve(N = p != null && p.type === j && p.key == null ? p.props.children : p) ? N : [N], t, n, r, o, i, a, l, c, d), s.base = t.__e, t.__u &= -161, s.__h.length && a.push(s), y && (s.__E = s.__ = null);
184
- } catch (A) {
185
- t.__v = null, c || i != null ? (t.__e = l, t.__u |= c ? 160 : 32, i[i.indexOf(l)] = null) : (t.__e = n.__e, t.__k = n.__k), C.__e(A, t, n);
186
- }
187
- else
188
- i == null && t.__v === n.__v ? (t.__k = n.__k, t.__e = n.__e) : t.__e = Pr(n.__e, t, n, r, o, i, a, c, d);
189
- (p = C.diffed) && p(t);
190
- }
191
- function dn(e, t, n) {
192
- t.__d = void 0;
193
- for (var r = 0; r < n.length; r++)
194
- ct(n[r], n[++r], n[++r]);
195
- C.__c && C.__c(t, e), e.some(function(o) {
196
- try {
197
- e = o.__h, o.__h = [], e.some(function(i) {
198
- i.call(o);
199
- });
200
- } catch (i) {
201
- C.__e(i, o.__v);
202
- }
203
- });
204
- }
205
- function Pr(e, t, n, r, o, i, a, l, c) {
206
- var d, p, s, _, f, h, m, y = n.props, v = t.props, k = t.type;
207
- if (k === "svg" && (o = !0), i != null) {
208
- for (d = 0; d < i.length; d++)
209
- if ((f = i[d]) && "setAttribute" in f == !!k && (k ? f.localName === k : f.nodeType === 3)) {
210
- e = f, i[d] = null;
211
- break;
212
- }
213
- }
214
- if (e == null) {
215
- if (k === null)
216
- return document.createTextNode(v);
217
- e = o ? document.createElementNS("http://www.w3.org/2000/svg", k) : document.createElement(k, v.is && v), i = null, l = !1;
218
- }
219
- if (k === null)
220
- y === v || l && e.data === v || (e.data = v);
221
- else {
222
- if (i = i && Te.call(e.childNodes), y = n.props || we, !l && i != null)
223
- for (y = {}, d = 0; d < e.attributes.length; d++)
224
- y[(f = e.attributes[d]).name] = f.value;
225
- for (d in y)
226
- f = y[d], d == "children" || (d == "dangerouslySetInnerHTML" ? s = f : d === "key" || d in v || Re(e, d, null, f, o));
227
- for (d in v)
228
- f = v[d], d == "children" ? _ = f : d == "dangerouslySetInnerHTML" ? p = f : d == "value" ? h = f : d == "checked" ? m = f : d === "key" || l && typeof f != "function" || y[d] === f || Re(e, d, f, y[d], o);
229
- if (p)
230
- l || s && (p.__html === s.__html || p.__html === e.innerHTML) || (e.innerHTML = p.__html), t.__k = [];
231
- else if (s && (e.innerHTML = ""), cn(e, Ve(_) ? _ : [_], t, n, r, o && k !== "foreignObject", i, a, i ? i[0] : n.__k && _e(n, 0), l, c), i != null)
232
- for (d = i.length; d--; )
233
- i[d] != null && an(i[d]);
234
- l || (d = "value", h !== void 0 && (h !== e[d] || k === "progress" && !h || k === "option" && h !== y[d]) && Re(e, d, h, y[d], !1), d = "checked", m !== void 0 && m !== e[d] && Re(e, d, m, y[d], !1));
235
- }
236
- return e;
237
- }
238
- function ct(e, t, n) {
239
- try {
240
- typeof e == "function" ? e(t) : e.current = t;
241
- } catch (r) {
242
- C.__e(r, n);
243
- }
244
- }
245
- function et(e, t, n) {
246
- var r, o;
247
- if (C.unmount && C.unmount(e), (r = e.ref) && (r.current && r.current !== e.__e || ct(r, null, t)), (r = e.__c) != null) {
248
- if (r.componentWillUnmount)
249
- try {
250
- r.componentWillUnmount();
251
- } catch (i) {
252
- C.__e(i, t);
253
- }
254
- r.base = r.__P = null, e.__c = void 0;
255
- }
256
- if (r = e.__k)
257
- for (o = 0; o < r.length; o++)
258
- r[o] && et(r[o], t, n || typeof e.type != "function");
259
- n || e.__e == null || an(e.__e), e.__ = e.__e = e.__d = void 0;
260
- }
261
- function Er(e, t, n) {
262
- return this.constructor(e, n);
263
- }
264
- function he(e, t, n) {
265
- var r, o, i, a;
266
- C.__ && C.__(e, t), o = (r = typeof n == "function") ? null : n && n.__k || t.__k, i = [], a = [], lt(t, e = (!r && n || t).__k = U(j, null, [e]), o || we, we, t.ownerSVGElement !== void 0, !r && n ? [n] : o ? null : t.firstChild ? Te.call(t.childNodes) : null, i, !r && n ? n : o ? o.__e : t.firstChild, r, a), dn(i, e, a);
267
- }
268
- function pn(e, t) {
269
- he(e, t, pn);
270
- }
271
- function Nr(e, t, n) {
272
- var r, o, i, a, l = J({}, e.props);
273
- for (i in e.type && e.type.defaultProps && (a = e.type.defaultProps), t)
274
- i == "key" ? r = t[i] : i == "ref" ? o = t[i] : l[i] = t[i] === void 0 && a !== void 0 ? a[i] : t[i];
275
- return arguments.length > 2 && (l.children = arguments.length > 3 ? Te.call(arguments, 2) : n), Ce(e.type, l, r || e.key, o || e.ref, null);
276
- }
277
- function fn(e, t) {
278
- var n = { __c: t = "__cC" + rn++, __: e, Consumer: function(r, o) {
279
- return r.children(o);
280
- }, Provider: function(r) {
281
- var o, i;
282
- return this.getChildContext || (o = [], (i = {})[t] = this, this.getChildContext = function() {
283
- return i;
284
- }, this.shouldComponentUpdate = function(a) {
285
- this.props.value !== a.value && o.some(function(l) {
286
- l.__e = !0, Xe(l);
287
- });
288
- }, this.sub = function(a) {
289
- o.push(a);
290
- var l = a.componentWillUnmount;
291
- a.componentWillUnmount = function() {
292
- o.splice(o.indexOf(a), 1), l && l.call(a);
293
- };
294
- }), r.children;
295
- } };
296
- return n.Provider.__ = n.Consumer.contextType = n;
297
- }
298
- Te = on.slice, C = { __e: function(e, t, n, r) {
299
- for (var o, i, a; t = t.__; )
300
- if ((o = t.__c) && !o.__)
301
- try {
302
- if ((i = o.constructor) && i.getDerivedStateFromError != null && (o.setState(i.getDerivedStateFromError(e)), a = o.__d), o.componentDidCatch != null && (o.componentDidCatch(e, r || {}), a = o.__d), a)
303
- return o.__E = o;
304
- } catch (l) {
305
- e = l;
306
- }
307
- throw e;
308
- } }, tn = 0, Z.prototype.setState = function(e, t) {
309
- var n;
310
- n = this.__s != null && this.__s !== this.state ? this.__s : this.__s = J({}, this.state), typeof e == "function" && (e = e(J({}, n), this.props)), e && J(n, e), e != null && this.__v && (t && this._sb.push(t), Xe(this));
311
- }, Z.prototype.forceUpdate = function(e) {
312
- this.__v && (this.__e = !0, e && this.__h.push(e), Xe(this));
313
- }, Z.prototype.render = j, le = [], nn = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, Je = function(e, t) {
314
- return e.__v.__b - t.__v.__b;
315
- }, Oe.__r = 0, rn = 0;
316
- function _n(e) {
317
- var t, n, r = "";
318
- if (typeof e == "string" || typeof e == "number")
319
- r += e;
320
- else if (typeof e == "object")
321
- if (Array.isArray(e))
322
- for (t = 0; t < e.length; t++)
323
- e[t] && (n = _n(e[t])) && (r && (r += " "), r += n);
324
- else
325
- for (t in e)
326
- e[t] && (r && (r += " "), r += t);
327
- return r;
328
- }
329
- function R() {
330
- for (var e, t, n = 0, r = ""; n < arguments.length; )
331
- (e = arguments[n++]) && (t = _n(e)) && (r && (r += " "), r += t);
332
- return r;
333
- }
334
- var te, M, We, Pt, me = 0, hn = [], Le = [], Et = C.__b, Nt = C.__r, Rt = C.diffed, It = C.__c, Lt = C.unmount;
335
- function ce(e, t) {
336
- C.__h && C.__h(M, e, me || t), me = 0;
337
- var n = M.__H || (M.__H = { __: [], __h: [] });
338
- return e >= n.__.length && n.__.push({ __V: Le }), n.__[e];
339
- }
340
- function D(e) {
341
- return me = 1, ut(yn, e);
342
- }
343
- function ut(e, t, n) {
344
- var r = ce(te++, 2);
345
- if (r.t = e, !r.__c && (r.__ = [n ? n(t) : yn(void 0, t), function(l) {
346
- var c = r.__N ? r.__N[0] : r.__[0], d = r.t(c, l);
347
- c !== d && (r.__N = [d, r.__[1]], r.__c.setState({}));
348
- }], r.__c = M, !M.u)) {
349
- var o = function(l, c, d) {
350
- if (!r.__c.__H)
351
- return !0;
352
- var p = r.__c.__H.__.filter(function(_) {
353
- return _.__c;
354
- });
355
- if (p.every(function(_) {
356
- return !_.__N;
357
- }))
358
- return !i || i.call(this, l, c, d);
359
- var s = !1;
360
- return p.forEach(function(_) {
361
- if (_.__N) {
362
- var f = _.__[0];
363
- _.__ = _.__N, _.__N = void 0, f !== _.__[0] && (s = !0);
364
- }
365
- }), !(!s && r.__c.props === l) && (!i || i.call(this, l, c, d));
366
- };
367
- M.u = !0;
368
- var i = M.shouldComponentUpdate, a = M.componentWillUpdate;
369
- M.componentWillUpdate = function(l, c, d) {
370
- if (this.__e) {
371
- var p = i;
372
- i = void 0, o(l, c, d), i = p;
373
- }
374
- a && a.call(this, l, c, d);
375
- }, M.shouldComponentUpdate = o;
376
- }
377
- return r.__N || r.__;
378
- }
379
- function q(e, t) {
380
- var n = ce(te++, 3);
381
- !C.__s && pt(n.__H, t) && (n.__ = e, n.i = t, M.__H.__h.push(n));
382
- }
383
- function Pe(e, t) {
384
- var n = ce(te++, 4);
385
- !C.__s && pt(n.__H, t) && (n.__ = e, n.i = t, M.__h.push(n));
386
- }
387
- function ie(e) {
388
- return me = 5, He(function() {
389
- return { current: e };
390
- }, []);
391
- }
392
- function mn(e, t, n) {
393
- me = 6, Pe(function() {
394
- return typeof e == "function" ? (e(t()), function() {
395
- return e(null);
396
- }) : e ? (e.current = t(), function() {
397
- return e.current = null;
398
- }) : void 0;
399
- }, n == null ? n : n.concat(e));
400
- }
401
- function He(e, t) {
402
- var n = ce(te++, 7);
403
- return pt(n.__H, t) ? (n.__V = e(), n.i = t, n.__h = e, n.__V) : n.__;
404
- }
405
- function gn(e, t) {
406
- return me = 8, He(function() {
407
- return e;
408
- }, t);
409
- }
410
- function bn(e) {
411
- var t = M.context[e.__c], n = ce(te++, 9);
412
- return n.c = e, t ? (n.__ == null && (n.__ = !0, t.sub(M)), t.props.value) : e.__;
413
- }
414
- function dt(e, t) {
415
- C.useDebugValue && C.useDebugValue(t ? t(e) : e);
416
- }
417
- function Rr(e) {
418
- var t = ce(te++, 10), n = D();
419
- return t.__ = e, M.componentDidCatch || (M.componentDidCatch = function(r, o) {
420
- t.__ && t.__(r, o), n[1](r);
421
- }), [n[0], function() {
422
- n[1](void 0);
423
- }];
424
- }
425
- function vn() {
426
- var e = ce(te++, 11);
427
- if (!e.__) {
428
- for (var t = M.__v; t !== null && !t.__m && t.__ !== null; )
429
- t = t.__;
430
- var n = t.__m || (t.__m = [0, 0]);
431
- e.__ = "P" + n[0] + "-" + n[1]++;
432
- }
433
- return e.__;
434
- }
435
- function Ir() {
436
- for (var e; e = hn.shift(); )
437
- if (e.__P && e.__H)
438
- try {
439
- e.__H.__h.forEach(Ae), e.__H.__h.forEach(tt), e.__H.__h = [];
440
- } catch (t) {
441
- e.__H.__h = [], C.__e(t, e.__v);
442
- }
443
- }
444
- C.__b = function(e) {
445
- M = null, Et && Et(e);
446
- }, C.__r = function(e) {
447
- Nt && Nt(e), te = 0;
448
- var t = (M = e.__c).__H;
449
- t && (We === M ? (t.__h = [], M.__h = [], t.__.forEach(function(n) {
450
- n.__N && (n.__ = n.__N), n.__V = Le, n.__N = n.i = void 0;
451
- })) : (t.__h.forEach(Ae), t.__h.forEach(tt), t.__h = [], te = 0)), We = M;
452
- }, C.diffed = function(e) {
453
- Rt && Rt(e);
454
- var t = e.__c;
455
- t && t.__H && (t.__H.__h.length && (hn.push(t) !== 1 && Pt === C.requestAnimationFrame || ((Pt = C.requestAnimationFrame) || Lr)(Ir)), t.__H.__.forEach(function(n) {
456
- n.i && (n.__H = n.i), n.__V !== Le && (n.__ = n.__V), n.i = void 0, n.__V = Le;
457
- })), We = M = null;
458
- }, C.__c = function(e, t) {
459
- t.some(function(n) {
460
- try {
461
- n.__h.forEach(Ae), n.__h = n.__h.filter(function(r) {
462
- return !r.__ || tt(r);
463
- });
464
- } catch (r) {
465
- t.some(function(o) {
466
- o.__h && (o.__h = []);
467
- }), t = [], C.__e(r, n.__v);
468
- }
469
- }), It && It(e, t);
470
- }, C.unmount = function(e) {
471
- Lt && Lt(e);
472
- var t, n = e.__c;
473
- n && n.__H && (n.__H.__.forEach(function(r) {
474
- try {
475
- Ae(r);
476
- } catch (o) {
477
- t = o;
478
- }
479
- }), n.__H = void 0, t && C.__e(t, n.__v));
480
- };
481
- var At = typeof requestAnimationFrame == "function";
482
- function Lr(e) {
483
- var t, n = function() {
484
- clearTimeout(r), At && cancelAnimationFrame(t), setTimeout(e);
485
- }, r = setTimeout(n, 100);
486
- At && (t = requestAnimationFrame(n));
487
- }
488
- function Ae(e) {
489
- var t = M, n = e.__c;
490
- typeof n == "function" && (e.__c = void 0, n()), M = t;
491
- }
492
- function tt(e) {
493
- var t = M;
494
- e.__c = e.__(), M = t;
495
- }
496
- function pt(e, t) {
497
- return !e || e.length !== t.length || t.some(function(n, r) {
498
- return n !== e[r];
499
- });
500
- }
501
- function yn(e, t) {
502
- return typeof t == "function" ? t(e) : t;
503
- }
504
- function xn(e, t) {
505
- for (var n in t)
506
- e[n] = t[n];
507
- return e;
508
- }
509
- function nt(e, t) {
510
- for (var n in e)
511
- if (n !== "__source" && !(n in t))
512
- return !0;
513
- for (var r in t)
514
- if (r !== "__source" && e[r] !== t[r])
515
- return !0;
516
- return !1;
517
- }
518
- function Ue(e) {
519
- this.props = e;
520
- }
521
- function Cn(e, t) {
522
- function n(o) {
523
- var i = this.props.ref, a = i == o.ref;
524
- return !a && i && (i.call ? i(null) : i.current = null), t ? !t(this.props, o) || !a : nt(this.props, o);
525
- }
526
- function r(o) {
527
- return this.shouldComponentUpdate = n, U(e, o);
528
- }
529
- return r.displayName = "Memo(" + (e.displayName || e.name) + ")", r.prototype.isReactComponent = !0, r.__f = !0, r;
530
- }
531
- (Ue.prototype = new Z()).isPureReactComponent = !0, Ue.prototype.shouldComponentUpdate = function(e, t) {
532
- return nt(this.props, e) || nt(this.state, t);
533
- };
534
- var Mt = C.__b;
535
- C.__b = function(e) {
536
- e.type && e.type.__f && e.ref && (e.props.ref = e.ref, e.ref = null), Mt && Mt(e);
537
- };
538
- var Ar = typeof Symbol < "u" && Symbol.for && Symbol.for("react.forward_ref") || 3911;
539
- function kn(e) {
540
- function t(n) {
541
- var r = xn({}, n);
542
- return delete r.ref, e(r, n.ref || null);
543
- }
544
- return t.$$typeof = Ar, t.render = t, t.prototype.isReactComponent = t.__f = !0, t.displayName = "ForwardRef(" + (e.displayName || e.name) + ")", t;
545
- }
546
- var $t = function(e, t) {
547
- return e == null ? null : X(X(e).map(t));
548
- }, Sn = { map: $t, forEach: $t, count: function(e) {
549
- return e ? X(e).length : 0;
550
- }, only: function(e) {
551
- var t = X(e);
552
- if (t.length !== 1)
553
- throw "Children.only";
554
- return t[0];
555
- }, toArray: X }, Mr = C.__e;
556
- C.__e = function(e, t, n, r) {
557
- if (e.then) {
558
- for (var o, i = t; i = i.__; )
559
- if ((o = i.__c) && o.__c)
560
- return t.__e == null && (t.__e = n.__e, t.__k = n.__k), o.__c(e, t);
561
- }
562
- Mr(e, t, n, r);
563
- };
564
- var Ot = C.unmount;
565
- function wn(e, t, n) {
566
- return e && (e.__c && e.__c.__H && (e.__c.__H.__.forEach(function(r) {
567
- typeof r.__c == "function" && r.__c();
568
- }), e.__c.__H = null), (e = xn({}, e)).__c != null && (e.__c.__P === n && (e.__c.__P = t), e.__c = null), e.__k = e.__k && e.__k.map(function(r) {
569
- return wn(r, t, n);
570
- })), e;
571
- }
572
- function Tn(e, t, n) {
573
- return e && n && (e.__v = null, e.__k = e.__k && e.__k.map(function(r) {
574
- return Tn(r, t, n);
575
- }), e.__c && e.__c.__P === t && (e.__e && n.appendChild(e.__e), e.__c.__e = !0, e.__c.__P = n)), e;
576
- }
577
- function ke() {
578
- this.__u = 0, this.t = null, this.__b = null;
579
- }
580
- function Pn(e) {
581
- var t = e.__.__c;
582
- return t && t.__a && t.__a(e);
583
- }
584
- function En(e) {
585
- var t, n, r;
586
- function o(i) {
587
- if (t || (t = e()).then(function(a) {
588
- n = a.default || a;
589
- }, function(a) {
590
- r = a;
591
- }), r)
592
- throw r;
593
- if (!n)
594
- throw t;
595
- return U(n, i);
596
- }
597
- return o.displayName = "Lazy", o.__f = !0, o;
598
- }
599
- function pe() {
600
- this.u = null, this.o = null;
601
- }
602
- C.unmount = function(e) {
603
- var t = e.__c;
604
- t && t.__R && t.__R(), t && 32 & e.__u && (e.type = null), Ot && Ot(e);
605
- }, (ke.prototype = new Z()).__c = function(e, t) {
606
- var n = t.__c, r = this;
607
- r.t == null && (r.t = []), r.t.push(n);
608
- var o = Pn(r.__v), i = !1, a = function() {
609
- i || (i = !0, n.__R = null, o ? o(l) : l());
610
- };
611
- n.__R = a;
612
- var l = function() {
613
- if (!--r.__u) {
614
- if (r.state.__a) {
615
- var c = r.state.__a;
616
- r.__v.__k[0] = Tn(c, c.__c.__P, c.__c.__O);
617
- }
618
- var d;
619
- for (r.setState({ __a: r.__b = null }); d = r.t.pop(); )
620
- d.forceUpdate();
621
- }
622
- };
623
- r.__u++ || 32 & t.__u || r.setState({ __a: r.__b = r.__v.__k[0] }), e.then(a, a);
624
- }, ke.prototype.componentWillUnmount = function() {
625
- this.t = [];
626
- }, ke.prototype.render = function(e, t) {
627
- if (this.__b) {
628
- if (this.__v.__k) {
629
- var n = document.createElement("div"), r = this.__v.__k[0].__c;
630
- this.__v.__k[0] = wn(this.__b, n, r.__O = r.__P);
631
- }
632
- this.__b = null;
633
- }
634
- var o = t.__a && U(j, null, e.fallback);
635
- return o && (o.__u &= -33), [U(j, null, t.__a ? null : e.children), o];
636
- };
637
- var Ut = function(e, t, n) {
638
- if (++n[1] === n[0] && e.o.delete(t), e.props.revealOrder && (e.props.revealOrder[0] !== "t" || !e.o.size))
639
- for (n = e.u; n; ) {
640
- for (; n.length > 3; )
641
- n.pop()();
642
- if (n[1] < n[0])
643
- break;
644
- e.u = n = n[2];
645
- }
646
- };
647
- function $r(e) {
648
- return this.getChildContext = function() {
649
- return e.context;
650
- }, e.children;
651
- }
652
- function Or(e) {
653
- var t = this, n = e.i;
654
- t.componentWillUnmount = function() {
655
- he(null, t.l), t.l = null, t.i = null;
656
- }, t.i && t.i !== n && t.componentWillUnmount(), t.l || (t.i = n, t.l = { nodeType: 1, parentNode: n, childNodes: [], appendChild: function(r) {
657
- this.childNodes.push(r), t.i.appendChild(r);
658
- }, insertBefore: function(r, o) {
659
- this.childNodes.push(r), t.i.appendChild(r);
660
- }, removeChild: function(r) {
661
- this.childNodes.splice(this.childNodes.indexOf(r) >>> 1, 1), t.i.removeChild(r);
662
- } }), he(U($r, { context: t.context }, e.__v), t.l);
663
- }
664
- function Nn(e, t) {
665
- var n = U(Or, { __v: e, i: t });
666
- return n.containerInfo = t, n;
667
- }
668
- (pe.prototype = new Z()).__a = function(e) {
669
- var t = this, n = Pn(t.__v), r = t.o.get(e);
670
- return r[0]++, function(o) {
671
- var i = function() {
672
- t.props.revealOrder ? (r.push(o), Ut(t, e, r)) : o();
673
- };
674
- n ? n(i) : i();
675
- };
676
- }, pe.prototype.render = function(e) {
677
- this.u = null, this.o = /* @__PURE__ */ new Map();
678
- var t = X(e.children);
679
- e.revealOrder && e.revealOrder[0] === "b" && t.reverse();
680
- for (var n = t.length; n--; )
681
- this.o.set(t[n], this.u = [1, 0, this.u]);
682
- return e.children;
683
- }, pe.prototype.componentDidUpdate = pe.prototype.componentDidMount = function() {
684
- var e = this;
685
- this.o.forEach(function(t, n) {
686
- Ut(e, n, t);
687
- });
688
- };
689
- var Rn = typeof Symbol < "u" && Symbol.for && Symbol.for("react.element") || 60103, Ur = /^(?: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]/, Vr = /^on(Ani|Tra|Tou|BeforeInp|Compo)/, Hr = /[A-Z0-9]/g, Br = typeof document < "u", Dr = function(e) {
690
- return (typeof Symbol < "u" && typeof Symbol() == "symbol" ? /fil|che|rad/ : /fil|che|ra/).test(e);
691
- };
692
- function In(e, t, n) {
693
- return t.__k == null && (t.textContent = ""), he(e, t), typeof n == "function" && n(), e ? e.__c : null;
694
- }
695
- function Ln(e, t, n) {
696
- return pn(e, t), typeof n == "function" && n(), e ? e.__c : null;
697
- }
698
- Z.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(e) {
699
- Object.defineProperty(Z.prototype, e, { configurable: !0, get: function() {
700
- return this["UNSAFE_" + e];
701
- }, set: function(t) {
702
- Object.defineProperty(this, e, { configurable: !0, writable: !0, value: t });
703
- } });
704
- });
705
- var Vt = C.event;
706
- function jr() {
707
- }
708
- function Fr() {
709
- return this.cancelBubble;
710
- }
711
- function qr() {
712
- return this.defaultPrevented;
713
- }
714
- C.event = function(e) {
715
- return Vt && (e = Vt(e)), e.persist = jr, e.isPropagationStopped = Fr, e.isDefaultPrevented = qr, e.nativeEvent = e;
716
- };
717
- var ft, zr = { enumerable: !1, configurable: !0, get: function() {
718
- return this.class;
719
- } }, Ht = C.vnode;
720
- C.vnode = function(e) {
721
- typeof e.type == "string" && function(t) {
722
- var n = t.props, r = t.type, o = {};
723
- for (var i in n) {
724
- var a = n[i];
725
- if (!(i === "value" && "defaultValue" in n && a == null || Br && i === "children" && r === "noscript" || i === "class" || i === "className")) {
726
- var l = i.toLowerCase();
727
- i === "defaultValue" && "value" in n && n.value == null ? i = "value" : i === "download" && a === !0 ? a = "" : l === "ondoubleclick" ? i = "ondblclick" : l !== "onchange" || r !== "input" && r !== "textarea" || Dr(n.type) ? l === "onfocus" ? i = "onfocusin" : l === "onblur" ? i = "onfocusout" : Vr.test(i) ? i = l : r.indexOf("-") === -1 && Ur.test(i) ? i = i.replace(Hr, "-$&").toLowerCase() : a === null && (a = void 0) : l = i = "oninput", l === "oninput" && o[i = l] && (i = "oninputCapture"), o[i] = a;
728
- }
729
- }
730
- r == "select" && o.multiple && Array.isArray(o.value) && (o.value = X(n.children).forEach(function(c) {
731
- c.props.selected = o.value.indexOf(c.props.value) != -1;
732
- })), r == "select" && o.defaultValue != null && (o.value = X(n.children).forEach(function(c) {
733
- c.props.selected = o.multiple ? o.defaultValue.indexOf(c.props.value) != -1 : o.defaultValue == c.props.value;
734
- })), n.class && !n.className ? (o.class = n.class, Object.defineProperty(o, "className", zr)) : (n.className && !n.class || n.class && n.className) && (o.class = o.className = n.className), t.props = o;
735
- }(e), e.$$typeof = Rn, Ht && Ht(e);
736
- };
737
- var Bt = C.__r;
738
- C.__r = function(e) {
739
- Bt && Bt(e), ft = e.__c;
740
- };
741
- var Dt = C.diffed;
742
- C.diffed = function(e) {
743
- Dt && Dt(e);
744
- var t = e.props, n = e.__e;
745
- n != null && e.type === "textarea" && "value" in t && t.value !== n.value && (n.value = t.value == null ? "" : t.value), ft = null;
746
- };
747
- var An = { ReactCurrentDispatcher: { current: { readContext: function(e) {
748
- return ft.__n[e.__c].props.value;
749
- } } } }, Wr = "17.0.2";
750
- function Mn(e) {
751
- return U.bind(null, e);
752
- }
753
- function Ee(e) {
754
- return !!e && e.$$typeof === Rn;
755
- }
756
- function $n(e) {
757
- return Ee(e) && e.type === j;
758
- }
759
- function On(e) {
760
- return Ee(e) ? Nr.apply(null, arguments) : e;
761
- }
762
- function Un(e) {
763
- return !!e.__k && (he(null, e), !0);
764
- }
765
- function Vn(e) {
766
- return e && (e.base || e.nodeType === 1 && e) || null;
767
- }
768
- var Hn = function(e, t) {
769
- return e(t);
770
- }, Bn = function(e, t) {
771
- return e(t);
772
- }, Dn = j;
773
- function _t(e) {
774
- e();
775
- }
776
- function jn(e) {
777
- return e;
778
- }
779
- function Fn() {
780
- return [!1, _t];
781
- }
782
- var qn = Pe, zn = Ee;
783
- function Wn(e, t) {
784
- var n = t(), r = D({ h: { __: n, v: t } }), o = r[0].h, i = r[1];
785
- return Pe(function() {
786
- o.__ = n, o.v = t, Ze(o) && i({ h: o });
787
- }, [e, n, t]), q(function() {
788
- return Ze(o) && i({ h: o }), e(function() {
789
- Ze(o) && i({ h: o });
790
- });
791
- }, [e]), n;
792
- }
793
- function Ze(e) {
794
- var t, n, r = e.v, o = e.__;
795
- try {
796
- var i = r();
797
- return !((t = o) === (n = i) && (t !== 0 || 1 / t == 1 / n) || t != t && n != n);
798
- } catch {
799
- return !0;
800
- }
801
- }
802
- var Zr = { useState: D, useId: vn, useReducer: ut, useEffect: q, useLayoutEffect: Pe, useInsertionEffect: qn, useTransition: Fn, useDeferredValue: jn, useSyncExternalStore: Wn, startTransition: _t, useRef: ie, useImperativeHandle: mn, useMemo: He, useCallback: gn, useContext: bn, useDebugValue: dt, version: "17.0.2", Children: Sn, render: In, hydrate: Ln, unmountComponentAtNode: Un, createPortal: Nn, createElement: U, createContext: fn, createFactory: Mn, cloneElement: On, createRef: sn, Fragment: j, isValidElement: Ee, isElement: zn, isFragment: $n, findDOMNode: Vn, Component: Z, PureComponent: Ue, memo: Cn, forwardRef: kn, flushSync: Bn, unstable_batchedUpdates: Hn, StrictMode: Dn, Suspense: ke, SuspenseList: pe, lazy: En, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: An };
803
- const Gr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
804
- __proto__: null,
805
- Children: Sn,
806
- Component: Z,
807
- Fragment: j,
808
- PureComponent: Ue,
809
- StrictMode: Dn,
810
- Suspense: ke,
811
- SuspenseList: pe,
812
- __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: An,
813
- cloneElement: On,
814
- createContext: fn,
815
- createElement: U,
816
- createFactory: Mn,
817
- createPortal: Nn,
818
- createRef: sn,
819
- default: Zr,
820
- findDOMNode: Vn,
821
- flushSync: Bn,
822
- forwardRef: kn,
823
- hydrate: Ln,
824
- isElement: zn,
825
- isFragment: $n,
826
- isValidElement: Ee,
827
- lazy: En,
828
- memo: Cn,
829
- render: In,
830
- startTransition: _t,
831
- unmountComponentAtNode: Un,
832
- unstable_batchedUpdates: Hn,
833
- useCallback: gn,
834
- useContext: bn,
835
- useDebugValue: dt,
836
- useDeferredValue: jn,
837
- useEffect: q,
838
- useErrorBoundary: Rr,
839
- useId: vn,
840
- useImperativeHandle: mn,
841
- useInsertionEffect: qn,
842
- useLayoutEffect: Pe,
843
- useMemo: He,
844
- useReducer: ut,
845
- useRef: ie,
846
- useState: D,
847
- useSyncExternalStore: Wn,
848
- useTransition: Fn,
849
- version: Wr
850
- }, Symbol.toStringTag, { value: "Module" })), jt = (e) => {
851
- let t;
852
- const n = /* @__PURE__ */ new Set(), r = (c, d) => {
853
- const p = typeof c == "function" ? c(t) : c;
854
- if (!Object.is(p, t)) {
855
- const s = t;
856
- t = d ?? typeof p != "object" ? p : Object.assign({}, t, p), n.forEach((_) => _(t, s));
857
- }
858
- }, o = () => t, l = { setState: r, getState: o, subscribe: (c) => (n.add(c), () => n.delete(c)), destroy: () => n.clear() };
859
- return t = e(r, o, l), l;
860
- }, Qr = (e) => e ? jt(e) : jt;
861
- var Zn = { exports: {} }, Gn = {};
862
- const Qn = /* @__PURE__ */ pr(Gr);
863
- var Kn = { exports: {} }, Yn = {};
864
- /**
865
- * @license React
866
- * use-sync-external-store-shim.production.min.js
867
- *
868
- * Copyright (c) Facebook, Inc. and its affiliates.
869
- *
870
- * This source code is licensed under the MIT license found in the
871
- * LICENSE file in the root directory of this source tree.
872
- */
873
- var ge = Qn;
874
- function Kr(e, t) {
875
- return e === t && (e !== 0 || 1 / e === 1 / t) || e !== e && t !== t;
876
- }
877
- var Yr = typeof Object.is == "function" ? Object.is : Kr, Jr = ge.useState, Xr = ge.useEffect, eo = ge.useLayoutEffect, to = ge.useDebugValue;
878
- function no(e, t) {
879
- var n = t(), r = Jr({ inst: { value: n, getSnapshot: t } }), o = r[0].inst, i = r[1];
880
- return eo(function() {
881
- o.value = n, o.getSnapshot = t, Ge(o) && i({ inst: o });
882
- }, [e, n, t]), Xr(function() {
883
- return Ge(o) && i({ inst: o }), e(function() {
884
- Ge(o) && i({ inst: o });
885
- });
886
- }, [e]), to(n), n;
887
- }
888
- function Ge(e) {
889
- var t = e.getSnapshot;
890
- e = e.value;
891
- try {
892
- var n = t();
893
- return !Yr(e, n);
894
- } catch {
895
- return !0;
896
- }
897
- }
898
- function ro(e, t) {
899
- return t();
900
- }
901
- var oo = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? ro : no;
902
- Yn.useSyncExternalStore = ge.useSyncExternalStore !== void 0 ? ge.useSyncExternalStore : oo;
903
- Kn.exports = Yn;
904
- var io = Kn.exports;
905
- /**
906
- * @license React
907
- * use-sync-external-store-shim/with-selector.production.min.js
908
- *
909
- * Copyright (c) Facebook, Inc. and its affiliates.
910
- *
911
- * This source code is licensed under the MIT license found in the
912
- * LICENSE file in the root directory of this source tree.
913
- */
914
- var Be = Qn, ao = io;
915
- function so(e, t) {
916
- return e === t && (e !== 0 || 1 / e === 1 / t) || e !== e && t !== t;
917
- }
918
- var lo = typeof Object.is == "function" ? Object.is : so, co = ao.useSyncExternalStore, uo = Be.useRef, po = Be.useEffect, fo = Be.useMemo, _o = Be.useDebugValue;
919
- Gn.useSyncExternalStoreWithSelector = function(e, t, n, r, o) {
920
- var i = uo(null);
921
- if (i.current === null) {
922
- var a = { hasValue: !1, value: null };
923
- i.current = a;
924
- } else
925
- a = i.current;
926
- i = fo(function() {
927
- function c(f) {
928
- if (!d) {
929
- if (d = !0, p = f, f = r(f), o !== void 0 && a.hasValue) {
930
- var h = a.value;
931
- if (o(h, f))
932
- return s = h;
933
- }
934
- return s = f;
935
- }
936
- if (h = s, lo(p, f))
937
- return h;
938
- var m = r(f);
939
- return o !== void 0 && o(h, m) ? h : (p = f, s = m);
940
- }
941
- var d = !1, p, s, _ = n === void 0 ? null : n;
942
- return [function() {
943
- return c(t());
944
- }, _ === null ? void 0 : function() {
945
- return c(_());
946
- }];
947
- }, [t, n, r, o]);
948
- var l = co(e, i[0], i[1]);
949
- return po(function() {
950
- a.hasValue = !0, a.value = l;
951
- }, [l]), _o(l), l;
952
- };
953
- Zn.exports = Gn;
954
- var ho = Zn.exports;
955
- const mo = /* @__PURE__ */ fr(ho), { useSyncExternalStoreWithSelector: go } = mo;
956
- function bo(e, t = e.getState, n) {
957
- const r = go(
958
- e.subscribe,
959
- e.getState,
960
- e.getServerState || e.getState,
961
- t,
962
- n
963
- );
964
- return dt(r), r;
965
- }
966
- const Ft = (e) => {
967
- const t = typeof e == "function" ? Qr(e) : e, n = (r, o) => bo(t, r, o);
968
- return Object.assign(n, t), n;
969
- }, Jn = (e) => e ? Ft(e) : Ft;
970
- var rt = /* @__PURE__ */ ((e) => (e[e.And = 1] = "And", e[e.Or = 2] = "Or", e))(rt || {});
971
- const qt = 1, ht = {
972
- eq(e, t) {
973
- return e == t;
974
- },
975
- neq(e, t) {
976
- return !this.eq(e, t);
977
- },
978
- gt(e, t) {
979
- return e > t;
980
- },
981
- gte(e, t) {
982
- return e >= t;
983
- },
984
- lt(e, t) {
985
- return e < t;
986
- },
987
- lte(e, t) {
988
- return e <= t;
989
- },
990
- // multiselect comparators
991
- list_exact(e, t) {
992
- return !Array.isArray(e) || !Array.isArray(t) ? !1 : e.slice().sort().join(",") === t.slice().sort().join(",");
993
- },
994
- /**
995
- * a contains b
996
- */
997
- list_all(e, t) {
998
- return !Array.isArray(e) || !Array.isArray(t) ? !1 : !t.some((n) => e.indexOf(n) === -1);
999
- },
1000
- /**
1001
- * a has at least one value from b
1002
- */
1003
- list_alo(e, t) {
1004
- if (!Array.isArray(t))
1005
- return !1;
1006
- const n = Array.isArray(e) ? e : [e], r = new Set(n);
1007
- return t.some((o) => r.has(o));
1008
- },
1009
- /**
1010
- * a is not included in b
1011
- */
1012
- list_dni(e, t) {
1013
- if (!Array.isArray(t))
1014
- return !1;
1015
- const n = Array.isArray(e) ? e : [e], r = new Set(n);
1016
- return t.every((o) => !r.has(o));
1017
- },
1018
- /**
1019
- * a contains b
1020
- */
1021
- contains(e, t) {
1022
- const n = e.toLowerCase(), r = t.toLowerCase();
1023
- return n.includes(r);
1024
- },
1025
- /**
1026
- * a not contains b
1027
- */
1028
- notcontains(e, t) {
1029
- return !this.contains(e, t);
1030
- }
1031
- }, vo = (e, t, n) => {
1032
- switch (t) {
1033
- case g.VideoVoice:
1034
- return !!(e && e.value);
1035
- case g.Open:
1036
- return !!n;
1037
- case g.MultipleSelect:
1038
- return !!(n && Object.keys(n).length);
1039
- case g.RecordedTask:
1040
- return (n == null ? void 0 : n.taskStatus) === W.Completed;
1041
- case g.TextUrlPrompt:
1042
- return !e.value;
1043
- case g.ConsentLegal:
1044
- return n !== null;
1045
- case g.MultipleChoice:
1046
- return n !== void 0;
1047
- case g.Matrix:
1048
- return !!(n && Object.values(n).every((r) => r !== null));
1049
- case g.NPS:
1050
- return n !== null;
1051
- case g.Likert:
1052
- return n !== null;
1053
- default:
1054
- return !0;
1055
- }
1056
- }, Xn = (e, t) => {
1057
- if (t === g.Matrix) {
1058
- const n = Object.keys(e).length, r = Object.values(e).filter((o) => o !== null).length;
1059
- return r > 0 && r < n;
1060
- }
1061
- return !1;
1062
- }, er = ({
1063
- cards: e,
1064
- index: t,
1065
- hasEndCard: n,
1066
- allResponses: r,
1067
- uploadProgress: o = {}
1068
- }) => {
1069
- if (t >= e.length || t < 0)
1070
- return null;
1071
- const i = e[t];
1072
- let a = t + 1;
1073
- const l = i.props.routingOptions || [];
1074
- for (let p = 0; p < l.length; p++) {
1075
- const {
1076
- group: s,
1077
- target: _
1078
- } = l[p];
1079
- if (!(s != null && s.length))
1080
- continue;
1081
- const f = s[0];
1082
- if (f.questionIndex === void 0 || f.questionIndex > r.length)
1083
- continue;
1084
- let h = zt({
1085
- comparator: f.comparator,
1086
- // @ts-expect-error - unknown response type
1087
- response: r[f.questionIndex],
1088
- // @ts-expect-error - expected card type
1089
- type: i.type,
1090
- value: f.value
1091
- });
1092
- for (let m = 1; m < s.length; m += 2) {
1093
- const y = s[m], v = s[m + 1], k = zt({
1094
- comparator: v.comparator,
1095
- // @ts-expect-error - unknown response type
1096
- response: r[v.questionIndex],
1097
- // @ts-expect-error - expected card type
1098
- type: e[v.questionIndex].type,
1099
- value: v.value
1100
- });
1101
- y === rt.And ? h && (h = k) : y === rt.Or && (h || (h = k));
1102
- }
1103
- if (h) {
1104
- a = _ === -1 && n ? e.length - 1 : _;
1105
- break;
1106
- }
1107
- }
1108
- const c = e.findIndex((p) => p.type === g.Uploading);
1109
- let d;
1110
- return c > 0 ? d = n ? e.length - 3 : e.length - 2 : d = e.length - 1, t >= d || a === -1 || a !== null && a > d ? c > 0 && Object.values(o).some((s) => s.isSubmitted && !s.isComplete) ? c : n ? e.length - 1 : null : a === -1 ? null : a;
1111
- }, zt = ({
1112
- comparator: e,
1113
- response: t,
1114
- type: n,
1115
- value: r
1116
- }) => {
1117
- if (e === G.Answered)
1118
- switch (n) {
1119
- case g.TextUrlPrompt:
1120
- return t === void 0;
1121
- case g.ConsentLegal:
1122
- return t && t.submitted === !0;
1123
- case g.RecordedTask:
1124
- return "taskStatus" in t && t.taskStatus === W.Completed;
1125
- case g.Likert:
1126
- return Number.isInteger(t);
1127
- case g.Open:
1128
- return t && t.length > 0;
1129
- case g.MultipleChoice:
1130
- case g.MultipleSelect:
1131
- return Object.keys(t).length > 0;
1132
- case g.Matrix:
1133
- return Object.values(t).every((o) => o !== null);
1134
- case g.NPS:
1135
- return Number.isInteger(t);
1136
- case g.VideoVoice:
1137
- return !!(t != null && t.mediaRecordingUid);
1138
- default:
1139
- return !1;
1140
- }
1141
- if (e === G.GivenUp)
1142
- return n === g.RecordedTask ? "taskStatus" in t && t.taskStatus === W.GivenUp : !0;
1143
- if (e === G.Partial)
1144
- return n === g.Matrix ? Xn(t, n) : !1;
1145
- if (e === G.Skipped)
1146
- switch (n) {
1147
- case g.TextUrlPrompt:
1148
- return t == null ? void 0 : t.skipped;
1149
- case g.ConsentLegal:
1150
- return t === null;
1151
- case g.RecordedTask:
1152
- return "taskStatus" in t && t.taskStatus === W.Abandoned;
1153
- case g.Likert:
1154
- return t === null;
1155
- case g.Open:
1156
- return (t == null ? void 0 : t.length) === 0;
1157
- case g.MultipleChoice:
1158
- return t === void 0;
1159
- case g.MultipleSelect:
1160
- return (t == null ? void 0 : t.length) === 0;
1161
- case g.Matrix:
1162
- return Object.values(t).every((o) => o === null);
1163
- case g.NPS:
1164
- return t === null;
1165
- case g.VideoVoice:
1166
- return t === null;
1167
- default:
1168
- return !1;
1169
- }
1170
- return ht[e](t, r);
1171
- }, yo = 13, xo = (e, t) => e.reduce((n, r) => n.concat(n.map((o) => [...o, r])), [[]]).filter((n) => t || n.length > 0), Co = (e) => {
1172
- var t, n, r;
1173
- switch (e.type) {
1174
- case g.MultipleSelect:
1175
- return !e || !e.props || !e.props.options ? null : e.props.options.length > yo ? e.props.options.map((o) => [o.value]) : xo(e.props.options.map((o) => o.value), !e.props.properties.required);
1176
- case g.MultipleChoice: {
1177
- if (!e || !e.props || !e.props.options)
1178
- return null;
1179
- const o = e.props.options.map((i) => i.value);
1180
- return e.props.properties.required || o.push(void 0), o;
1181
- }
1182
- case g.Matrix: {
1183
- if (!((t = e == null ? void 0 : e.props) != null && t.options))
1184
- return null;
1185
- const o = e.props.properties.matrixColumn, i = e.props.options, a = i.reduce((p, s) => (p[s.id] = null, p), {}), l = {
1186
- ...a,
1187
- [i[0].id]: o[0].value
1188
- }, c = i.reduce((p, s) => (p[s.id] = o[0].value, p), {}), d = [l, c];
1189
- return e.props.properties.required || d.push(a), d;
1190
- }
1191
- case g.Likert: {
1192
- const o = Number((r = (n = e.props) == null ? void 0 : n.properties) == null ? void 0 : r.range) || 5;
1193
- return [...Array.from(Array(o).keys()).map((a) => a + 1), ...e.props.properties.required ? [] : [null]];
1194
- }
1195
- case g.NPS:
1196
- return [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ...e.props.properties.required ? [] : [null]];
1197
- case g.VideoVoice:
1198
- case g.Open:
1199
- return ["1", ...e.props.properties.required ? [] : [""]];
1200
- case g.RecordedTask:
1201
- return [{
1202
- taskStatus: W.Completed
1203
- }, {
1204
- taskStatus: W.GivenUp
1205
- }, ...e.props.properties.required ? [] : [{
1206
- taskStatus: W.Abandoned
1207
- }]];
1208
- case g.TextUrlPrompt:
1209
- return [void 0, ...e.props.properties.required ? [] : [{
1210
- skipped: !0
1211
- }]];
1212
- case g.ConsentLegal:
1213
- return [qt, ...e.props.properties.required ? [] : [null]];
1214
- default:
1215
- return [qt];
1216
- }
1217
- }, ko = (e) => e in ht, So = (e) => typeof e == "object" && e !== null && "taskStatus" in e, wo = (e, t = []) => t.reduce((n, r) => {
1218
- const {
1219
- group: o,
1220
- target: i
1221
- } = r;
1222
- if (!(o != null && o.length))
1223
- return [...n];
1224
- const a = o.filter((l) => Number(l) ? !0 : typeof l == "object" ? l.questionIndex === e : !1).map((l) => {
1225
- const {
1226
- comparator: c,
1227
- value: d
1228
- } = l;
1229
- return {
1230
- comparator: c,
1231
- target: i,
1232
- value: d
1233
- };
1234
- });
1235
- return [...n, ...a];
1236
- }, []), To = (e, t) => {
1237
- const n = /* @__PURE__ */ new Set([g.Thanks, g.Uploading]);
1238
- if (t >= e.length || t < 0 || n.has(e[t].type))
1239
- return 0;
1240
- const r = e.filter((i) => !n.has(i.type));
1241
- if (t === r.length - 1)
1242
- return 1;
1243
- const o = {
1244
- [r.length - 1]: 1,
1245
- [-1]: 0
1246
- };
1247
- for (let i = r.length - 2; i >= t; i--) {
1248
- const a = r[i], l = wo(i, a.props.routingOptions);
1249
- if (l.length === 0) {
1250
- o[i] = o[i + 1] + 1;
1251
- continue;
1252
- }
1253
- let c = 0, d = Co(a);
1254
- if (d === null)
1255
- return r.length - 1 - t;
1256
- for (let p = 0; p < l.length && d.length !== 0; p++) {
1257
- const {
1258
- comparator: s,
1259
- target: _,
1260
- value: f
1261
- } = l[p], h = d.filter((m) => {
1262
- const y = vo({
1263
- value: m
1264
- }, a.type, m), v = Xn(m, a.type);
1265
- return !(y && s === G.Answered || v && s === G.Partial || !y && !v && s === G.Skipped || s === G.GivenUp && So(m) && m.taskStatus === W.GivenUp || y && a.type === g.Open && (s === G.Contains || s === G.DoesNotContain) || y && ko(s) && ht[s](m, f));
1266
- });
1267
- if (h.length < d.length) {
1268
- const m = parseInt(String(_), 10);
1269
- if (m !== -1 && m <= i || m >= r.length)
1270
- return r.length - 1 - t;
1271
- c = Math.max(o[m] + 1, c);
1272
- }
1273
- d = h;
1274
- }
1275
- d.length > 0 && (c = Math.max(o[i + 1] + 1, c)), o[i] = c;
1276
- }
1277
- return o[t];
1278
- }, Po = (e) => !(e.type === g.Thanks || e.type === g.Uploading), $ = Jn()((e, t) => ({
1279
- allResponses: [],
1280
- answers: void 0,
1281
- apiURL: "",
1282
- border: "#000000",
1283
- cards: [],
1284
- close: async (n = fe) => {
1285
- const r = t(), {
1286
- fadeout: o,
1287
- remove: i,
1288
- trackHistory: a
1289
- } = r;
1290
- await o(n), Qe(r) || a({
1291
- event: "closed"
1292
- }), ze(`Closing survey: ${r.surveyId}`), yt.enable(), i({
1293
- initiator: xt.Closed
1294
- });
1295
- },
1296
- configureExitOnOverlayClick: () => {
1297
- },
1298
- customMetadata: {},
1299
- destroy: async (n) => {
1300
- const {
1301
- eventEmitFn: r,
1302
- fadeout: o,
1303
- remove: i
1304
- } = t();
1305
- r(ee.SurveyComplete), await o(n), yt.enable(), i({
1306
- initiator: xt.Complete
1307
- });
1308
- },
1309
- endCard: {
1310
- headline: ""
1311
- },
1312
- envId: "",
1313
- eventEmitFn: Ie.emit.bind(Ie),
1314
- fadeout: async (n) => {
1315
- const {
1316
- eventEmitFn: r,
1317
- headers: o,
1318
- viewDocument: i
1319
- } = t();
1320
- return $e(o) ? Promise.resolve() : (r(re.SurveyFadingOut), new Promise((a) => {
1321
- const l = i.getElementById(n);
1322
- l ? (l.addEventListener("transitionend", () => {
1323
- a();
1324
- }), l.classList.remove("ul-app--visible")) : a();
1325
- }));
1326
- },
1327
- forceBrandedLogo: !1,
1328
- frame: document.createElement("iframe"),
1329
- handleClickEmbedButton: (n) => {
1330
- const {
1331
- cards: r,
1332
- eventEmitFn: o,
1333
- index: i
1334
- } = t();
1335
- o(n, {
1336
- [ye.QuestionId]: r[i].name,
1337
- [ye.Props]: r[i].props
1338
- // Only return the upcoming card
1339
- }), e(() => ({
1340
- hasViewedEmbed: !0
1341
- }));
1342
- },
1343
- handleUploadUpdate: ({
1344
- mediaRecordingUid: n,
1345
- isComplete: r,
1346
- progressPct: o,
1347
- isSubmitted: i
1348
- }) => {
1349
- var f, h, m;
1350
- const {
1351
- cards: a,
1352
- destroy: l,
1353
- index: c,
1354
- uploadProgress: d
1355
- } = t(), p = r || ((f = d[n]) == null ? void 0 : f.isComplete), s = {
1356
- ...d,
1357
- [n]: {
1358
- progressPct: p ? 100 : o || ((h = d[n]) == null ? void 0 : h.progressPct),
1359
- isComplete: p,
1360
- isSubmitted: i || ((m = d[n]) == null ? void 0 : m.isSubmitted)
1361
- }
1362
- };
1363
- if (e({
1364
- uploadProgress: s
1365
- }), a[c].type !== g.Uploading)
1366
- return;
1367
- const _ = Object.entries(d).every(([y, v]) => !v.isSubmitted || v.isComplete || n == y && r);
1368
- if (_ && c >= a.length - 1)
1369
- return l(fe);
1370
- e({
1371
- index: _ ? c + 1 : c,
1372
- uploadingCardViewed: !0
1373
- });
1374
- },
1375
- hasViewedEmbed: !1,
1376
- headers: {
1377
- Authorization: "",
1378
- "Content-Type": "",
1379
- "userleap-platform": Ke.Web,
1380
- "x-ul-environment-id": "",
1381
- "x-ul-installation-method": _r.Snippet,
1382
- "x-ul-sdk-version": "",
1383
- "x-ul-visitor-id": ""
1384
- },
1385
- index: 0,
1386
- isPreview: !1,
1387
- marketingUrl: "https://sprig.com",
1388
- meta: {
1389
- ch: 0,
1390
- cw: 0,
1391
- l: "",
1392
- mode: null,
1393
- p: "",
1394
- sh: 0,
1395
- sw: 0
1396
- },
1397
- mode: void 0,
1398
- next: (n) => {
1399
- const {
1400
- allResponses: r,
1401
- cards: o,
1402
- eventEmitFn: i,
1403
- index: a,
1404
- responseGroupUid: l,
1405
- submit: c,
1406
- trackHistory: d,
1407
- uploadProgress: p,
1408
- viewedCardCount: s
1409
- } = t(), _ = Date.now(), f = [...o], h = f[a], {
1410
- type: m
1411
- } = n.data, y = {
1412
- ...n.data
1413
- }, v = y.value;
1414
- Po(h) && (h.value = v), y.answeredAt = _, delete y.type;
1415
- const k = {
1416
- response: y,
1417
- responseGroupUid: l,
1418
- questionIndex: a
1419
- };
1420
- let S = m === g.MultipleChoice ? Object.values(v).find((N) => N !== !1) : v;
1421
- m === g.MultipleSelect && (S = f[a].props.options.reduce((N, T) => (v[T.id] && N.push(T.value), N), []));
1422
- const E = r.slice(0);
1423
- E[a] = S, e({
1424
- allResponses: E
1425
- });
1426
- const b = er({
1427
- cards: f,
1428
- index: a,
1429
- hasEndCard: !!n.endCard,
1430
- uploadProgress: p,
1431
- allResponses: E
1432
- });
1433
- if (b === null) {
1434
- k.completedAt = _, c(k), n.completeSurvey();
1435
- return;
1436
- } else
1437
- [g.Thanks, g.Uploading].includes(f[b].type) && (k.completedAt = _);
1438
- const x = c(k);
1439
- [g.Thanks, g.Uploading].includes(f[b].type) || x.finally(() => {
1440
- d({
1441
- event: "seen",
1442
- index: b
1443
- });
1444
- });
1445
- const I = f[b];
1446
- f[b] && i && i(ee.CurrentQuestion, {
1447
- [ye.QuestionId]: I.name,
1448
- [ye.Props]: I.props
1449
- // Only return the upcoming card
1450
- }), e({
1451
- cards: f,
1452
- hasViewedEmbed: !1,
1453
- index: b,
1454
- viewedCardCount: s + 1
1455
- });
1456
- },
1457
- pendingRemoveIframeReason: null,
1458
- previewKey: null,
1459
- recorder: () => {
1460
- },
1461
- recorderEventEmitter: Ie,
1462
- resolveTrackedPromise: () => {
1463
- const {
1464
- removeIframeIfReady: n
1465
- } = t();
1466
- e((r) => ({
1467
- unresolvedRequestCount: r.unresolvedRequestCount - 1
1468
- })), n();
1469
- },
1470
- responseGroupUid: "",
1471
- remove: ({
1472
- initiator: n
1473
- }) => {
1474
- const {
1475
- removeIframeIfReady: r
1476
- } = t();
1477
- e({
1478
- pendingRemoveIframeReason: n
1479
- }), r();
1480
- },
1481
- removeIframeIfReady: () => {
1482
- const {
1483
- eventEmitFn: n,
1484
- pendingRemoveIframeReason: r,
1485
- unresolvedRequestCount: o
1486
- } = t();
1487
- r && o === 0 && (n(re.SurveyWillClose, {
1488
- name: re.SurveyWillClose,
1489
- initiator: r
1490
- }), e({
1491
- pendingRemoveIframeReason: null
1492
- }));
1493
- },
1494
- seen: async () => {
1495
- const {
1496
- trackHistory: n
1497
- } = t();
1498
- return n({
1499
- event: "seen",
1500
- isNew: !0
1501
- });
1502
- },
1503
- slugName: null,
1504
- showStripes: !1,
1505
- showSurveyBrand: !1,
1506
- styleNonce: "",
1507
- submit: async ({
1508
- completedAt: n,
1509
- questionIndex: r,
1510
- response: o,
1511
- responseGroupUid: i
1512
- }) => {
1513
- const a = t();
1514
- if (!i || Qe(a))
1515
- return;
1516
- const l = {
1517
- responseGroupUid: i,
1518
- meta: a.meta,
1519
- customMetadata: a.customMetadata,
1520
- responses: [o],
1521
- completedAt: n,
1522
- previewKey: a.previewKey
1523
- };
1524
- ze(`Submitting response: ${JSON.stringify(o.value, null, 2)} for survey: ${a.surveyId}`), n && (ze("Survey complete"), hr({
1525
- id: a.surveyId
1526
- }));
1527
- const c = await a.trackPromise(Ye(`${a.apiURL}/sdk/1/environments/${a.envId}/visitors/${a.userId}/responses/submit`, {
1528
- body: JSON.stringify(l),
1529
- headers: a.headers,
1530
- method: "POST"
1531
- }));
1532
- if (!c.ok) {
1533
- c.reportError && (console.warn("[Sprig] (ERR-427) Failed to submit response", c.error), await a.trackPromise(Wt(a, "submitResponse", c.error)));
1534
- return;
1535
- }
1536
- a.eventEmitFn(re.QuestionAnswered, {
1537
- ...o,
1538
- questionIndex: r
1539
- });
1540
- },
1541
- surveyId: 0,
1542
- tabTitle: "",
1543
- trackHistory: async ({
1544
- event: n,
1545
- index: r,
1546
- isNew: o = !1
1547
- }) => {
1548
- const i = t();
1549
- if (Qe(i))
1550
- return;
1551
- const {
1552
- cards: a,
1553
- index: l
1554
- } = i, c = r !== void 0 ? a[r] : a[l], d = {
1555
- sid: i.surveyId,
1556
- qid: c.name,
1557
- action: n,
1558
- vid: i.userId,
1559
- eid: i.envId,
1560
- isNew: o,
1561
- responseGroupUid: i.responseGroupUid,
1562
- previewKey: i.previewKey
1563
- }, p = await i.trackPromise(Ye(`${i.apiURL}/sdk/1/visitors/${i.userId}/surveys/${i.surveyId}/history`, {
1564
- body: JSON.stringify(d),
1565
- headers: i.headers,
1566
- method: "POST"
1567
- }));
1568
- !p.ok && p.reportError && (console.warn("[Sprig] (ERR-428) Failed to track survey event", p.error), await i.trackPromise(Wt(i, "trackHistory", p.error)));
1569
- },
1570
- trackPromise: async (n) => {
1571
- let {
1572
- resolveTrackedPromise: r
1573
- } = t();
1574
- return e((o) => ({
1575
- unresolvedRequestCount: o.unresolvedRequestCount + 1
1576
- })), n.then((o) => (r(), o)).catch((o) => {
1577
- throw r(), o;
1578
- });
1579
- },
1580
- unresolvedRequestCount: 0,
1581
- update: () => {
1582
- const {
1583
- cards: n,
1584
- index: r,
1585
- headers: o,
1586
- eventEmitFn: i,
1587
- frame: a,
1588
- useMobileStyling: l,
1589
- viewDocument: c
1590
- } = t(), p = n[r].type === g.Matrix;
1591
- setTimeout(() => {
1592
- var f, h;
1593
- const [s, _] = mr(c);
1594
- $e(o) ? i(re.SurveyHeight, {
1595
- name: re.SurveyHeight,
1596
- contentFrameHeight: s
1597
- }) : ((f = a.setHeight) == null || f.call(a, s), l || (h = a.setWidth) == null || h.call(a, p ? _ : parseInt(gr)));
1598
- }, 100);
1599
- },
1600
- uploadingCardViewed: !1,
1601
- uploadProgress: {},
1602
- useDesktopPrototype: void 0,
1603
- useMobileStyling: !1,
1604
- userId: "",
1605
- viewDocument: window.document,
1606
- viewedCardCount: 0
1607
- })), Qe = (e) => !e.userId || e.meta && e.meta.mode === "test" || e.isPreview, Wt = async (e, t, n) => {
1608
- const {
1609
- mode: r,
1610
- userId: o,
1611
- envId: i,
1612
- apiURL: a,
1613
- headers: l,
1614
- viewDocument: c
1615
- } = e, d = c.documentElement, p = {
1616
- mode: r,
1617
- screenWidth: window.screen.width,
1618
- screenHeight: window.screen.height,
1619
- clientWidth: d.clientWidth,
1620
- clientHeight: d.clientHeight,
1621
- location: window.location.href,
1622
- language: window.navigator.language
1623
- }, s = {
1624
- action: t,
1625
- err: {
1626
- message: n == null ? void 0 : n.message,
1627
- stack: n == null ? void 0 : n.stack
1628
- },
1629
- meta: p,
1630
- vid: o,
1631
- envId: i
1632
- }, _ = await Ye(`${a}/sdk/1/errors`, {
1633
- method: "POST",
1634
- headers: Object.assign({
1635
- "x-ul-error": window.btoa(`userleap-${Date.now()}-error`)
1636
- }, l),
1637
- body: JSON.stringify(s)
1638
- });
1639
- if (!_.ok)
1640
- console.warn("[Sprig] (ERR-444) Failed to report error to API", n);
1641
- else {
1642
- const {
1643
- presignedUrl: f
1644
- } = _.json;
1645
- br(f);
1646
- }
1647
- };
1648
- var Eo = 0;
1649
- function u(e, t, n, r, o, i) {
1650
- var a, l, c = {};
1651
- for (l in t)
1652
- l == "ref" ? a = t[l] : c[l] = t[l];
1653
- var d = { type: e, props: c, key: n, ref: a, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, constructor: void 0, __v: --Eo, __i: -1, __u: 0, __source: o, __self: i };
1654
- if (typeof e == "function" && (a = e.defaultProps))
1655
- for (l in a)
1656
- c[l] === void 0 && (c[l] = a[l]);
1657
- return C.vnode && C.vnode(d), d;
1658
- }
1659
- const F = (e) => u("button", {
1660
- ...e,
1661
- className: R("ul-card-text__button", e.className),
1662
- id: "ul-card-text__button"
1663
- }), Y = ({
1664
- message: e,
1665
- properties: t
1666
- }) => {
1667
- const n = t == null ? void 0 : t.captionText;
1668
- return u(j, {
1669
- children: [e && u("h1", {
1670
- className: w.QuestionHeader,
1671
- id: w.QuestionHeader,
1672
- ...n ? {} : {
1673
- style: {
1674
- marginBottom: "15px"
1675
- }
1676
- },
1677
- children: e
1678
- }), n && u("p", {
1679
- className: w.Caption,
1680
- id: w.Caption,
1681
- children: n
1682
- })]
1683
- });
1684
- }, Zt = ({
1685
- buttonText: e = "View Prototype",
1686
- handleClick: t
1687
- }) => u("button", {
1688
- className: "prototype-button",
1689
- onClick: t,
1690
- children: e
1691
- }, "prototype-btn"), ae = ({
1692
- defaultBody: e,
1693
- embeddedType: t = "prototype",
1694
- properties: n
1695
- }) => {
1696
- var s;
1697
- const {
1698
- handleClickEmbedButton: r,
1699
- hasViewedEmbed: o,
1700
- headers: i,
1701
- useDesktopPrototype: a
1702
- } = $((_) => ({
1703
- handleClickEmbedButton: _.handleClickEmbedButton,
1704
- hasViewedEmbed: _.hasViewedEmbed,
1705
- headers: _.headers,
1706
- useDesktopPrototype: _.useDesktopPrototype
1707
- })), l = (n == null ? void 0 : n.conceptUrl) || ((s = n == null ? void 0 : n.consentDocument) == null ? void 0 : s.url), c = window.innerWidth < vr, d = i["userleap-platform"], p = (_, f) => {
1708
- _.preventDefault(), r(f);
1709
- };
1710
- if (!a && c && !o && l && ["email", "link"].includes(d)) {
1711
- if (t === "prototype")
1712
- return u(Zt, {
1713
- handleClick: (_) => {
1714
- p(_, ee.ViewPrototypeClick);
1715
- }
1716
- });
1717
- if (t === "pdf")
1718
- return u(Zt, {
1719
- buttonText: (n == null ? void 0 : n.viewDocumentText) || "View Document",
1720
- handleClick: (_) => {
1721
- p(_, ee.ViewAgreementClick);
1722
- }
1723
- });
1724
- }
1725
- return e();
1726
- }, tr = (e, t) => {
1727
- const n = ie(0), r = () => {
1728
- if (e.current) {
1729
- const o = e.current;
1730
- o.style.height = "1px";
1731
- const i = o.scrollHeight, a = o.offsetHeight - o.clientHeight, l = i + a, c = parseInt(window.getComputedStyle(o).getPropertyValue("max-height")), d = l <= c ? l : c;
1732
- n.current !== d && t(), n.current = d, o.style.height = `${d}px`;
1733
- }
1734
- };
1735
- return q(r, []), r;
1736
- }, mt = ({
1737
- ariaLabel: e,
1738
- border: t,
1739
- choiceStyle: n = {},
1740
- label: r,
1741
- isSelected: o,
1742
- value: i,
1743
- text: a,
1744
- id: l,
1745
- isRadio: c,
1746
- useMobileStyling: d,
1747
- error: p,
1748
- allowTextEntry: s,
1749
- noneOfTheAbove: _,
1750
- promptText: f,
1751
- onUserInputChanged: h
1752
- }) => {
1753
- const {
1754
- styleNonce: m,
1755
- viewDocument: y
1756
- } = $((O) => ({
1757
- styleNonce: O.styleNonce,
1758
- viewDocument: O.viewDocument
1759
- })), [v, k] = D(!1);
1760
- Io(y, t, m);
1761
- const S = ({
1762
- isSelected: O,
1763
- userText: ue
1764
- }) => {
1765
- h && h({
1766
- id: l || "",
1767
- selected: O,
1768
- value: i,
1769
- userText: ue,
1770
- noneOfTheAbove: _
1771
- });
1772
- }, E = (O) => {
1773
- O.stopPropagation(), S({
1774
- isSelected: c || !o,
1775
- userText: a
1776
- }), k(!1);
1777
- }, b = () => {
1778
- v || k(!0);
1779
- }, x = () => {
1780
- v && k(!1);
1781
- }, I = (O) => {
1782
- (O.key === "Enter" || O.key === " ") && E(O);
1783
- }, N = {
1784
- onClick: (O) => E(O),
1785
- onKeyPress: (O) => I(O)
1786
- };
1787
- "ontouchstart" in y.documentElement ? (N.onTouchStart = x, N.onTouchCancel = x, N.onTouchEnd = x) : (N.onMouseDown = b, N.onMouseLeave = x);
1788
- const T = c ? `radio-${l}` : `checkbox-${l}`, A = o || v ? [Me] : [], B = [...p ? [nr] : [], ...A], ve = r ? {
1789
- "aria-labelledby": `label-${l}`
1790
- } : {
1791
- "aria-label": e
1792
- };
1793
- return u("div", {
1794
- className: R([...V(w.Choice, d), ...B]),
1795
- id: `choice-div-${l}`,
1796
- style: {
1797
- ...n,
1798
- ...p ? {
1799
- borderColor: xe
1800
- } : {}
1801
- },
1802
- ...N,
1803
- children: [u("div", {
1804
- className: R([w.ChoiceLabelContainer]),
1805
- children: [c ? u("div", {
1806
- ...ve,
1807
- className: R([w.ChoiceRadio, ...A]),
1808
- id: T,
1809
- role: "radio",
1810
- tabIndex: 0
1811
- }) : u("div", {
1812
- "aria-checked": o,
1813
- "aria-labelledby": `label-${l}`,
1814
- className: w.ChoiceCheckbox,
1815
- id: T,
1816
- role: "checkbox",
1817
- style: o ? {
1818
- backgroundColor: t,
1819
- borderColor: t,
1820
- boxShadow: "none"
1821
- } : {},
1822
- tabIndex: 0,
1823
- children: o && u("svg", {
1824
- fill: "none",
1825
- height: "10",
1826
- viewBox: "0 0 10 10",
1827
- width: "10",
1828
- xmlns: "http://www.w3.org/2000/svg",
1829
- children: u("path", {
1830
- d: "M9.15377 1.30774L4.07685 8.23082L1.30762 5.00005",
1831
- stroke: "white",
1832
- strokeLinecap: "round",
1833
- strokeWidth: "2"
1834
- })
1835
- })
1836
- }), r && u("label", {
1837
- className: R(V(w.ChoiceLabel, d)),
1838
- htmlFor: T,
1839
- id: `label-${l}`,
1840
- children: r
1841
- })]
1842
- }), s && o && u("div", {
1843
- className: R([w.ChoiceTextEntryContainer, ...A]),
1844
- children: u(No, {
1845
- onTextChange: (O) => S({
1846
- isSelected: o,
1847
- userText: O
1848
- }),
1849
- promptText: f || "Please specify",
1850
- textValue: a,
1851
- useMobileStyling: d
1852
- })
1853
- })]
1854
- });
1855
- }, No = ({
1856
- promptText: e,
1857
- textValue: t,
1858
- onTextChange: n,
1859
- useMobileStyling: r
1860
- }) => {
1861
- const o = ie(null), {
1862
- update: i
1863
- } = $((l) => ({
1864
- update: l.update
1865
- })), a = tr(o, () => i());
1866
- return q(() => {
1867
- o.current && o.current.focus();
1868
- }, []), u("textarea", {
1869
- "aria-label": e,
1870
- "aria-multiline": "true",
1871
- "aria-placeholder": e,
1872
- className: R(V(w.ChoiceTextInput, r)),
1873
- "data-gramm": "false",
1874
- maxLength: 5e3,
1875
- name: "text",
1876
- onChange: (l) => {
1877
- a(), l.stopPropagation(), n(l.currentTarget.value);
1878
- },
1879
- onClick: (l) => {
1880
- l.stopPropagation();
1881
- },
1882
- onKeyPress: (l) => {
1883
- l.stopPropagation();
1884
- },
1885
- placeholder: e,
1886
- ref: o,
1887
- role: "textbox",
1888
- rows: 1,
1889
- value: t
1890
- });
1891
- }, Gt = "ul-select-style-element", Me = "ul-select-active-dynamic-style", nr = "ul-select-error-dynamic-style", Ro = (e) => e.tagName.toLowerCase() === "style", Io = (e, t, n) => {
1892
- let r = e.getElementById(Gt), o = !1;
1893
- r || (r = e.createElement("style"), o = !0), Ro(r) && (r.id = Gt, n && (r.nonce = n), r.textContent = Lo(t), o && e.head.appendChild(r));
1894
- }, Lo = (e) => `
1895
- .${Me} {
1896
- border-color: ${e};
1897
- }
1898
- .${Me} .${w.ChoiceRadio}, .${Me}.${w.ChoiceRadio} {
1899
- border: 6px solid ${e};
1900
- box-shadow: none;
1901
- }
1902
- .${nr} {
1903
- border-color: ${xe};
1904
- }
1905
- `, be = (e) => (e == null ? void 0 : e.buttonText) || "Next", rr = (e) => (e == null ? void 0 : e.skipButtonText) || "Skip", Ao = ({
1906
- className: e,
1907
- message: t,
1908
- next: n,
1909
- properties: r,
1910
- questionId: o,
1911
- type: i
1912
- }) => {
1913
- const {
1914
- useMobileStyling: a,
1915
- border: l
1916
- } = $((T) => ({
1917
- useMobileStyling: T.useMobileStyling,
1918
- border: T.border
1919
- })), [c, d] = D(!1), [p, s] = D(""), [_, f] = D(!1), h = r == null ? void 0 : r.collectName, m = (r == null ? void 0 : r.nameLabelText) || "Full Name", y = (r == null ? void 0 : r.consentText) || "I agree to the stated conditions", v = (r == null ? void 0 : r.submitButtonText) || "Submit", k = !!p.trim(), S = c && (!h || k), E = (T, A = !1) => {
1920
- T.preventDefault(), T.stopPropagation();
1921
- let B = null;
1922
- if (!A) {
1923
- if (!S) {
1924
- f(!0);
1925
- return;
1926
- }
1927
- B = {
1928
- submitted: !0
1929
- }, h && (B.name = p);
1930
- }
1931
- n({
1932
- value: B,
1933
- questionId: o,
1934
- type: i
1935
- });
1936
- }, b = (T) => {
1937
- T.preventDefault(), T.stopPropagation(), s(T.currentTarget.value);
1938
- }, x = (T) => {
1939
- T.currentTarget.style.borderColor = _ && !k ? xe : l;
1940
- }, I = (T) => {
1941
- T.currentTarget.style.borderColor = _ && !k ? xe : st;
1942
- }, N = () => u("div", {
1943
- children: [u(mt, {
1944
- allowTextEntry: !1,
1945
- border: l,
1946
- error: _ && !c,
1947
- isRadio: !1,
1948
- isSelected: c,
1949
- label: y,
1950
- onUserInputChanged: ({
1951
- selected: T
1952
- }) => {
1953
- T !== c && d(!c);
1954
- },
1955
- useMobileStyling: a
1956
- }), h && u("input", {
1957
- "aria-label": m,
1958
- "aria-placeholder": m,
1959
- className: R(V(w.ConsentLegalNameInput, a)),
1960
- "data-gramm": "false",
1961
- maxLength: 250,
1962
- name: "name",
1963
- onBlur: I,
1964
- onFocus: x,
1965
- onInput: b,
1966
- placeholder: m,
1967
- style: _ && !k ? {
1968
- borderColor: xe
1969
- } : {},
1970
- tabIndex: 0,
1971
- value: p
1972
- }), u("div", {
1973
- className: "ul-card__button-wrapper ul-card-vertical__button-wrapper",
1974
- children: [u(F, {
1975
- className: S ? "" : w.ButtonDisabled,
1976
- onClick: E,
1977
- children: v
1978
- }), r.required === !1 && u("button", {
1979
- className: w.SkipButton,
1980
- onClick: (T) => E(T, !0),
1981
- children: rr(r)
1982
- })]
1983
- })]
1984
- });
1985
- return u("div", {
1986
- className: R([e, "ul-card__consent-legal", w.FadeInTransition]),
1987
- children: [u(Y, {
1988
- message: t
1989
- }), u("div", {
1990
- className: "ul-rich-text-body",
1991
- dangerouslySetInnerHTML: r != null && r.richTextBody ? {
1992
- __html: r.richTextBody
1993
- } : void 0,
1994
- id: "ul-card__consent-legal-body-container"
1995
- }), u(ae, {
1996
- properties: r,
1997
- defaultBody: N,
1998
- embeddedType: "pdf"
1999
- })]
2000
- }, o);
2001
- }, Mo = ({
2002
- activeValue: e,
2003
- border: t,
2004
- icon: n,
2005
- isPressed: r,
2006
- onSubmit: o,
2007
- range: i,
2008
- scaleLabelType: a,
2009
- setActiveValue: l,
2010
- setIsPressed: c,
2011
- useMobileStyling: d,
2012
- value: p
2013
- }) => {
2014
- const s = `option-${p}`, _ = a === de.Number, f = a === de.Star, h = _ && p === e, [m, y] = p <= e && f || p === e ? r ? [t, 1] : [t, 0.3] : ["", 1], v = () => {
2015
- switch (a) {
2016
- case de.Star:
2017
- return R([...V(w.LikertStar, d), ...V(`${w.LikertStar}-${p}`, d)]);
2018
- case de.Smiley:
2019
- return R([...V(w.LikertSmiley, d), ...V(`${w.LikertSmiley}-${p}`, d)]);
2020
- default:
2021
- return R(p === i ? [...V(w.LikertNumber, d), ...V(`${w.LikertNumber}-${p}`, d), ...V("likert-last-option", d)] : [...V(w.LikertNumber, d), ...V(`${w.LikertNumber}-${p}`, d)]);
2022
- }
2023
- }, k = () => {
2024
- l(-1), c(!1);
2025
- };
2026
- return u("div", {
2027
- "aria-label": _ ? void 0 : String(p),
2028
- className: v(),
2029
- dangerouslySetInnerHTML: {
2030
- __html: n
2031
- },
2032
- id: s,
2033
- onClick: () => o(),
2034
- onPointerDown: () => c(!0),
2035
- onPointerEnter: () => l(p),
2036
- onPointerLeave: k,
2037
- role: "radio",
2038
- style: {
2039
- color: _ ? "" : m,
2040
- borderColor: h ? m : "",
2041
- fillOpacity: h ? "" : y,
2042
- zIndex: h ? 3 : "auto"
2043
- },
2044
- tabIndex: 0
2045
- });
2046
- }, $o = ({
2047
- className: e,
2048
- labels: t,
2049
- message: n,
2050
- next: r,
2051
- properties: o,
2052
- questionId: i,
2053
- type: a
2054
- }) => {
2055
- const {
2056
- border: l,
2057
- useMobileStyling: c
2058
- } = $((N) => ({
2059
- border: N.border,
2060
- useMobileStyling: N.useMobileStyling
2061
- })), [d, p] = D(-1), [s, _] = D(!1), f = t && t.left, h = t && t.right;
2062
- let m;
2063
- const {
2064
- range: y,
2065
- scaleLabelType: v,
2066
- ratingIcons: k
2067
- } = o;
2068
- y && (m = Number(y));
2069
- const S = m || 5, E = (N) => {
2070
- var T, A;
2071
- switch (v) {
2072
- case de.Star:
2073
- return (T = k[0]) == null ? void 0 : T.svg;
2074
- case de.Smiley:
2075
- return (A = k[N]) == null ? void 0 : A.svg;
2076
- default:
2077
- return String(N + 1);
2078
- }
2079
- }, b = [...Array(S)].map((N, T) => {
2080
- const A = T + 1;
2081
- return u(Mo, {
2082
- activeValue: d,
2083
- border: l,
2084
- icon: E(T),
2085
- isPressed: s,
2086
- onSubmit: () => r({
2087
- value: A,
2088
- questionId: i,
2089
- type: a
2090
- }),
2091
- range: S,
2092
- scaleLabelType: v,
2093
- setActiveValue: p,
2094
- setIsPressed: _,
2095
- useMobileStyling: c,
2096
- value: A
2097
- }, T);
2098
- }), x = (N) => {
2099
- N.preventDefault(), N.stopPropagation(), r({
2100
- value: null,
2101
- questionId: i,
2102
- type: a
2103
- });
2104
- }, I = () => u(j, {
2105
- children: [u("div", {
2106
- "aria-label": `Rating (1 - ${S})`,
2107
- className: "ul-card--likert__numbers",
2108
- role: "radiogroup",
2109
- children: b
2110
- }), u("div", {
2111
- className: "ul-card--likert__labels",
2112
- children: [u("span", {
2113
- children: f
2114
- }), u("span", {
2115
- children: h
2116
- })]
2117
- }), !o.required && u("div", {
2118
- className: "ul-vertical-centered-container",
2119
- children: u(F, {
2120
- onClick: x,
2121
- children: be(o)
2122
- })
2123
- })]
2124
- });
2125
- return u("form", {
2126
- className: R([e, "ul-card--likert", w.FadeInTransition]),
2127
- children: [u(Y, {
2128
- message: n,
2129
- properties: o
2130
- }), u(ae, {
2131
- properties: o,
2132
- defaultBody: I
2133
- })]
2134
- }, i);
2135
- }, Oo = ({
2136
- className: e,
2137
- message: t,
2138
- next: n,
2139
- options: r,
2140
- properties: o,
2141
- questionId: i,
2142
- type: a
2143
- }) => {
2144
- const {
2145
- border: l,
2146
- useMobileStyling: c
2147
- } = $((b) => ({
2148
- border: b.border,
2149
- useMobileStyling: b.useMobileStyling
2150
- })), d = o.matrixColumn, p = r.length, s = d.length, _ = o.required, f = (b) => {
2151
- b.preventDefault(), b.stopPropagation(), n({
2152
- value: m,
2153
- questionId: i,
2154
- type: a
2155
- });
2156
- }, h = r.reduce((b, x) => (b[x.id] = null, b), {}), [m, y] = D(h), v = (b, x) => {
2157
- y((I) => ({
2158
- ...I,
2159
- [b]: x
2160
- }));
2161
- }, k = _ && Object.values(m).every((b) => b == null), S = r.map((b) => u(j, {
2162
- children: [u("div", {
2163
- "aria-label": b.label,
2164
- className: "ul-matrix-row-label",
2165
- children: b.label
2166
- }, b.label), u("div", {
2167
- className: "ul-matrix-row-options",
2168
- role: "radiogroup",
2169
- children: d.map((x, I) => {
2170
- const N = I === s - 1;
2171
- return u("div", {
2172
- className: R("ul-matrix-option-wrapper", N && "ul-matrix-last-option"),
2173
- children: u(mt, {
2174
- allowTextEntry: !1,
2175
- ariaLabel: `${b.label}-${x.label}`,
2176
- border: l,
2177
- choiceStyle: {
2178
- background: "transparent",
2179
- border: "none",
2180
- marginBottom: "0",
2181
- padding: "0"
2182
- },
2183
- error: !1,
2184
- id: `${b.id}-${x.value}`,
2185
- isRadio: !0,
2186
- isSelected: m[b.id] === x.value,
2187
- onUserInputChanged: () => v(b.id, x.value),
2188
- useMobileStyling: c
2189
- })
2190
- }, x.value);
2191
- })
2192
- })]
2193
- })), E = () => u("div", {
2194
- children: [u("div", {
2195
- className: "ul-card--matrix_container",
2196
- children: u("div", {
2197
- className: "ul-card--matrix_grid",
2198
- style: `--numColumns: ${s}; --numRows: ${p + 1}`,
2199
- children: [u("div", {}), " ", d.map((b) => u("div", {
2200
- className: "ul-matrix-column-label",
2201
- children: b.label
2202
- }, b.label)), S]
2203
- })
2204
- }), u("div", {
2205
- className: "ul-card__button-wrapper",
2206
- children: u(F, {
2207
- disabled: k,
2208
- children: be(o)
2209
- })
2210
- })]
2211
- });
2212
- return u("form", {
2213
- className: R([e, w.FadeInTransition, "ul-card__matrix"]),
2214
- id: "text-form",
2215
- onSubmit: f,
2216
- children: [u(Y, {
2217
- message: t,
2218
- properties: o
2219
- }), u(ae, {
2220
- properties: o,
2221
- defaultBody: E
2222
- })]
2223
- }, i);
2224
- }, or = ({
2225
- className: e,
2226
- message: t,
2227
- onSubmit: n,
2228
- options: r = [],
2229
- properties: o,
2230
- questionId: i,
2231
- type: a
2232
- }) => {
2233
- const {
2234
- border: l,
2235
- useMobileStyling: c
2236
- } = $((x) => ({
2237
- border: x.border,
2238
- useMobileStyling: x.useMobileStyling
2239
- })), d = r.reduce((x, I) => (x[I.id] = {
2240
- isSelected: !1
2241
- }, x), {}), [p, s] = D(d), _ = a === g.MultipleChoice, f = o.required, h = r.find((x) => {
2242
- var I;
2243
- return (I = x.optionProperties) == null ? void 0 : I.noneOfTheAbove;
2244
- }), m = Object.entries(p).some(([x, I]) => {
2245
- var A;
2246
- const N = r.find((B) => `${B.id}` === x), T = I.userText === void 0 || I.userText.trim() === "";
2247
- return ((A = N == null ? void 0 : N.optionProperties) == null ? void 0 : A.allowsTextEntry) && T && I.isSelected;
2248
- }), y = Object.values(p).some((x) => x.isSelected), v = m || f && !y, k = r.map(({
2249
- id: x,
2250
- label: I,
2251
- value: N,
2252
- optionProperties: T
2253
- }) => {
2254
- var O, ue;
2255
- const A = `${x}`, {
2256
- allowsTextEntry: B,
2257
- noneOfTheAbove: ve
2258
- } = {
2259
- allowsTextEntry: !1,
2260
- noneOfTheAbove: !1,
2261
- ...T
2262
- };
2263
- return u(mt, {
2264
- allowTextEntry: B,
2265
- border: l,
2266
- error: !1,
2267
- id: A,
2268
- isRadio: _,
2269
- noneOfTheAbove: ve,
2270
- isSelected: !!((O = p[A]) != null && O.isSelected),
2271
- label: I,
2272
- onUserInputChanged: (P) => E(P.id, P.selected, P.userText, P.noneOfTheAbove),
2273
- promptText: "Please specify",
2274
- text: (ue = p[x]) == null ? void 0 : ue.userText,
2275
- useMobileStyling: c,
2276
- value: N
2277
- }, A);
2278
- }), S = (x) => {
2279
- x.preventDefault(), x.stopPropagation(), n(p);
2280
- }, E = (x, I, N, T) => {
2281
- const A = Object.assign({}, p);
2282
- if ((_ || T) && I)
2283
- for (const B of Object.values(A))
2284
- B.isSelected = !1, delete B.userText;
2285
- else
2286
- h && !T && p[h.id].isSelected && (A[h.id].isSelected = !1);
2287
- A[x] = {
2288
- isSelected: I,
2289
- userText: N
2290
- }, s(A);
2291
- }, b = () => u("div", {
2292
- children: [u("div", {
2293
- className: R(V(w.ChoiceGroup, c)),
2294
- role: _ ? "radiogroup" : "group",
2295
- children: k
2296
- }), u("div", {
2297
- className: "ul-card__button-wrapper",
2298
- children: u(F, {
2299
- disabled: v,
2300
- onClick: S,
2301
- children: be(o)
2302
- })
2303
- })]
2304
- });
2305
- return u("form", {
2306
- className: R([e, "ul-card--multiple", w.FadeInTransition]),
2307
- id: "text-form",
2308
- onSubmit: S,
2309
- children: [u(Y, {
2310
- message: t,
2311
- properties: o
2312
- }), u(ae, {
2313
- properties: o,
2314
- defaultBody: b
2315
- })]
2316
- }, i);
2317
- }, Uo = (e) => {
2318
- const {
2319
- questionId: t,
2320
- type: n,
2321
- next: r,
2322
- options: o
2323
- } = e;
2324
- return u(or, {
2325
- ...e,
2326
- onSubmit: (a) => {
2327
- const l = Object.entries(a).find(([, _]) => _.isSelected) || [void 0, void 0], [c, d] = l, p = o.find((_) => `${_.id}` === c), s = d != null && d.userText ? {
2328
- [c]: {
2329
- userText: d.userText
2330
- }
2331
- } : null;
2332
- r({
2333
- value: p && c ? {
2334
- [c]: p.value
2335
- } : {},
2336
- secondaryValue: s,
2337
- questionId: t,
2338
- type: n
2339
- });
2340
- }
2341
- });
2342
- }, Vo = (e) => {
2343
- const {
2344
- questionId: t,
2345
- type: n,
2346
- next: r
2347
- } = e;
2348
- return u(or, {
2349
- ...e,
2350
- onSubmit: (i) => {
2351
- const a = {}, l = Object.entries(i).reduce((d, [p, s]) => (d[p] = s.isSelected, d), a), c = Object.entries(i).reduce((d, [p, s]) => {
2352
- if (!s.userText)
2353
- return d;
2354
- const _ = d || {};
2355
- return _[p] = {
2356
- userText: s.userText
2357
- }, _;
2358
- }, null);
2359
- r({
2360
- value: l,
2361
- secondaryValue: c,
2362
- questionId: t,
2363
- type: n
2364
- });
2365
- }
2366
- });
2367
- }, Ho = ({
2368
- className: e,
2369
- props: {
2370
- labels: t,
2371
- message: n,
2372
- properties: r
2373
- },
2374
- next: o,
2375
- questionId: i,
2376
- type: a
2377
- }) => {
2378
- const {
2379
- border: l,
2380
- useMobileStyling: c
2381
- } = $((h) => ({
2382
- border: h.border,
2383
- useMobileStyling: h.useMobileStyling
2384
- })), d = t && t.left, p = t && t.right, s = [...Array(11)].map((h, m) => u("div", {
2385
- className: R([...V(w.NPSNumber, c), ...V(`${w.NPSNumber}-${m}`, c)]),
2386
- id: `option-${m}`,
2387
- onClick: () => o({
2388
- value: m,
2389
- questionId: i,
2390
- type: a
2391
- }),
2392
- onKeyPress: (y) => {
2393
- y.preventDefault(), (y.key === "Enter" || y.key === " ") && o({
2394
- value: m,
2395
- questionId: i,
2396
- type: a
2397
- });
2398
- },
2399
- onPointerDown: (y) => {
2400
- y.currentTarget.style.zIndex = "2", y.currentTarget.style.borderColor = l;
2401
- },
2402
- onPointerLeave: (y) => {
2403
- y.currentTarget.style.zIndex = "auto", y.currentTarget.style.borderColor = st;
2404
- },
2405
- role: "radio",
2406
- tabIndex: 0,
2407
- children: m
2408
- }, m)), _ = (h) => {
2409
- h.preventDefault(), h.stopPropagation(), o({
2410
- value: null,
2411
- questionId: i,
2412
- type: a
2413
- });
2414
- }, f = () => u("div", {
2415
- children: [u("div", {
2416
- className: "ul-card--nps__numbers",
2417
- children: s
2418
- }), u("div", {
2419
- className: "ul-card--nps__labels",
2420
- children: [u("span", {
2421
- children: d
2422
- }), u("span", {
2423
- children: p
2424
- })]
2425
- }), !r.required && u("div", {
2426
- className: "ul-vertical-centered-container",
2427
- children: u(F, {
2428
- onClick: _,
2429
- children: be(r)
2430
- })
2431
- })]
2432
- });
2433
- return u("form", {
2434
- className: R([e, "ul-card--nps", w.FadeInTransition]),
2435
- children: [u(Y, {
2436
- message: n,
2437
- properties: r
2438
- }), u(ae, {
2439
- properties: r,
2440
- defaultBody: f
2441
- })]
2442
- }, i);
2443
- }, Bo = ({
2444
- className: e,
2445
- message: t,
2446
- next: n,
2447
- properties: r,
2448
- questionId: o,
2449
- type: i
2450
- }) => {
2451
- const {
2452
- border: a,
2453
- useMobileStyling: l,
2454
- update: c
2455
- } = $((b) => ({
2456
- border: b.border,
2457
- useMobileStyling: b.useMobileStyling,
2458
- update: b.update
2459
- })), [d, p] = D(""), s = ie(null), _ = d.trim(), f = r.required === !0 && !_, h = tr(s, () => c()), m = (b) => {
2460
- h(), b.preventDefault(), b.stopPropagation(), p(b.currentTarget.value);
2461
- }, y = (b) => {
2462
- b.preventDefault(), b.stopPropagation(), n({
2463
- value: d,
2464
- questionId: o,
2465
- type: i
2466
- });
2467
- }, v = r && r.openTextPlaceholder ? r.openTextPlaceholder : "", k = (b) => {
2468
- b.currentTarget.style.borderColor = a;
2469
- }, S = (b) => {
2470
- b.currentTarget.style.borderColor = st;
2471
- }, E = () => u("div", {
2472
- className: "ul-card-text",
2473
- children: [u("div", {
2474
- className: "ul-card-text__container",
2475
- children: u("textarea", {
2476
- "aria-label": v,
2477
- "aria-labelledby": w.QuestionHeader,
2478
- "aria-multiline": "true",
2479
- "aria-placeholder": v,
2480
- className: R(V(w.OpenTextInput, l)),
2481
- "data-gramm": "false",
2482
- maxLength: 5e3,
2483
- name: "text",
2484
- onBlur: S,
2485
- onChange: m,
2486
- onFocus: k,
2487
- placeholder: v,
2488
- ref: s,
2489
- role: "textbox",
2490
- tabIndex: 0
2491
- })
2492
- }), u(F, {
2493
- disabled: f,
2494
- onClick: y,
2495
- style: {
2496
- backgroundColor: f ? "" : a
2497
- },
2498
- children: be(r)
2499
- })]
2500
- });
2501
- return u("form", {
2502
- className: R([e, "ul-card--text", w.FadeInTransition]),
2503
- id: "text-form",
2504
- children: [u(Y, {
2505
- message: t,
2506
- properties: r
2507
- }), u(ae, {
2508
- defaultBody: E,
2509
- properties: r
2510
- })]
2511
- }, o);
2512
- };
2513
- var oe = /* @__PURE__ */ ((e) => (e[e.RequestNeeded = 1] = "RequestNeeded", e[e.TryAgain = 2] = "TryAgain", e[e.Ready = 3] = "Ready", e))(oe || {});
2514
- const De = (e) => e.type === z.AvPermission, ir = (e) => e.type === z.ScreenPermission, Do = (e, t) => !(De(t) ? t.permissionDescriptors : []).includes(Se.Camera) || e.getVideoTracks().length > 0, ar = (e, t) => {
2515
- if (e === void 0)
2516
- return oe.RequestNeeded;
2517
- if (e) {
2518
- if (!Do(e, t))
2519
- return oe.RequestNeeded;
2520
- } else
2521
- return oe.TryAgain;
2522
- return oe.Ready;
2523
- }, Qt = {
2524
- avStream: null,
2525
- currentPage: null,
2526
- mediaRecordingUids: null,
2527
- nextQuestion: () => {
2528
- },
2529
- passthroughData: void 0,
2530
- recordingMediaTypes: void 0,
2531
- screenPermissionRequested: !1,
2532
- type: void 0
2533
- }, K = Jn((e) => ({
2534
- ...Qt,
2535
- reset: () => {
2536
- e(Qt);
2537
- },
2538
- updatePage: (t) => {
2539
- e(t);
2540
- }
2541
- }));
2542
- function ot({
2543
- currentPage: e,
2544
- pages: t
2545
- }) {
2546
- const {
2547
- avStream: n,
2548
- recordingMediaTypes: r,
2549
- updatePage: o
2550
- } = K.getState(), {
2551
- recorderEventEmitter: i
2552
- } = $.getState();
2553
- i.emit(H.AvPermission, {
2554
- [L.PermissionDescriptors]: e.permissionDescriptors,
2555
- [L.StreamReadyCallback]: (a, l) => {
2556
- if (n === a)
2557
- return;
2558
- let c = e;
2559
- if (a && !e.permissionDescriptors.includes(Se.Camera)) {
2560
- const d = t.indexOf(e), p = l != null && l.active ? d + 2 : d + 1;
2561
- l != null && l.active && r && i.emit(H.BeginRecording, {
2562
- [L.RecordingMediaTypes]: r,
2563
- [L.StartRecordingCallback]: (s) => o({
2564
- mediaRecordingUids: s
2565
- })
2566
- }), c = t[p];
2567
- }
2568
- o({
2569
- currentPage: c,
2570
- avStream: a
2571
- });
2572
- }
2573
- });
2574
- }
2575
- function jo({
2576
- pages: e,
2577
- userId: t,
2578
- responseGroupUid: n,
2579
- surveyId: r,
2580
- questionId: o,
2581
- next: i
2582
- }) {
2583
- const {
2584
- updatePage: a
2585
- } = K.getState(), {
2586
- eventEmitFn: l,
2587
- recorderEventEmitter: c
2588
- } = $.getState(), d = {
2589
- questionId: o,
2590
- surveyId: r,
2591
- visitorId: t,
2592
- responseGroupUid: n
2593
- };
2594
- let p = 0;
2595
- c.emit(ee.RecordedTaskPermissionScreen), l(ee.RecordedTaskPermissionScreen), c.emit(H.PermissionStatus, {
2596
- [L.PermissionStatusCallback]: (_, f, h, m) => {
2597
- const y = e[p], {
2598
- type: v
2599
- } = y, k = [Q.Screen];
2600
- if (De(y)) {
2601
- const {
2602
- permissionDescriptors: S
2603
- } = y, E = S == null ? void 0 : S.includes(Se.Microphone), b = S == null ? void 0 : S.includes(Se.Camera);
2604
- E && k.push(Q.Audio), b && k.push(Q.Video);
2605
- const x = (_ == null ? void 0 : _.active) && !b, I = (_ == null ? void 0 : _.active) && f;
2606
- (x || I) && p++;
2607
- }
2608
- ir(e[p]) && h && (p++, c.emit(H.BeginRecording, {
2609
- [L.RecordingMediaTypes]: k,
2610
- [L.StartRecordingCallback]: (S) => a({
2611
- mediaRecordingUids: S
2612
- })
2613
- })), a({
2614
- currentPage: e[p],
2615
- avStream: _,
2616
- screenPermissionRequested: h,
2617
- nextQuestion: i,
2618
- type: v,
2619
- passthroughData: d,
2620
- recordingMediaTypes: k,
2621
- captureStream: m
2622
- });
2623
- }
2624
- });
2625
- const s = e[p];
2626
- return s.type === z.AvPermission && ot({
2627
- currentPage: s,
2628
- pages: e
2629
- }), s;
2630
- }
2631
- function it({
2632
- status: e
2633
- }) {
2634
- const {
2635
- nextQuestion: t,
2636
- passthroughData: n,
2637
- mediaRecordingUids: r,
2638
- reset: o
2639
- } = K.getState(), {
2640
- recorderEventEmitter: i,
2641
- handleUploadUpdate: a,
2642
- index: l
2643
- } = $.getState(), c = {
2644
- value: {
2645
- taskStatus: e
2646
- },
2647
- type: g.RecordedTask,
2648
- questionId: (n == null ? void 0 : n.questionId) || 1
2649
- };
2650
- n && i.emit(H.FinishTask, {
2651
- [L.BeginCallback]: (d) => {
2652
- a({
2653
- mediaRecordingUid: d,
2654
- isSubmitted: !0,
2655
- progressPct: 0,
2656
- isComplete: !1
2657
- });
2658
- },
2659
- [L.ProgressCallback]: (d, p) => {
2660
- a({
2661
- mediaRecordingUid: d,
2662
- progressPct: p.detail,
2663
- isSubmitted: !1,
2664
- isComplete: !1
2665
- });
2666
- },
2667
- [L.UploadCallback]: (d) => {
2668
- d && a({
2669
- mediaRecordingUid: d,
2670
- isComplete: !0,
2671
- isSubmitted: !0,
2672
- progressPct: 100
2673
- });
2674
- },
2675
- [L.PassthroughData]: n,
2676
- [L.CurrentIndex]: l,
2677
- [L.TaskResponse]: c,
2678
- [L.TaskCompleteCallback]: (d) => {
2679
- c.value.taskDurationMillisecond = d, r && (c.value.mediaRecordingUids = r), o(), t(c);
2680
- }
2681
- });
2682
- }
2683
- function gt({
2684
- pages: e,
2685
- setIsRequestingPermission: t
2686
- }) {
2687
- const {
2688
- recorderEventEmitter: n,
2689
- eventEmitFn: r
2690
- } = $.getState(), {
2691
- updatePage: o,
2692
- currentPage: i,
2693
- recordingMediaTypes: a,
2694
- screenPermissionRequested: l
2695
- } = K.getState();
2696
- if (!i)
2697
- return;
2698
- const c = e.indexOf(i);
2699
- switch (i.type) {
2700
- case z.AvPermission: {
2701
- const d = l ? c + 2 : c + 1;
2702
- l && a && n.emit(H.BeginRecording, {
2703
- [L.RecordingMediaTypes]: a,
2704
- [L.StartRecordingCallback]: (p) => {
2705
- o({
2706
- mediaRecordingUids: p
2707
- });
2708
- }
2709
- }), o({
2710
- currentPage: e[d]
2711
- });
2712
- return;
2713
- }
2714
- case z.ScreenPermission:
2715
- n.emit(H.ScreenPermission, {
2716
- [L.ScreenPermissionRequested]: t,
2717
- [L.StreamReadyCallback]: (d, p) => {
2718
- const s = p ? e[c + 1] : i;
2719
- p && a && n.emit(H.BeginRecording, {
2720
- [L.RecordingMediaTypes]: a,
2721
- [L.StartRecordingCallback]: (_) => {
2722
- o({
2723
- captureStream: p,
2724
- mediaRecordingUids: _
2725
- });
2726
- }
2727
- }), o({
2728
- currentPage: s,
2729
- screenPermissionRequested: !0,
2730
- captureStream: p
2731
- });
2732
- }
2733
- });
2734
- return;
2735
- case z.StartTask:
2736
- r(ee.RecordedTaskStart), n.emit(ee.RecordedTaskStart), n.emit(H.StartTask), o({
2737
- currentPage: e[c + 1],
2738
- screenPermissionRequested: !0
2739
- });
2740
- return;
2741
- case z.CompleteTask:
2742
- return;
2743
- }
2744
- }
2745
- const sr = "ul-permission-graphics-container", lr = "ul-permission-body", cr = R([sr, "ul_recorded-task-inset-spacing"]), je = R(["ul-horizontal-button-container", "ul-horizontal-button-container-left"]), ur = ({
2746
- richTextBody: e
2747
- }) => u("div", {
2748
- className: "ul-rich-text-body",
2749
- dangerouslySetInnerHTML: {
2750
- __html: e
2751
- },
2752
- id: "ul-task-detail-container"
2753
- }), Fe = ({
2754
- required: e,
2755
- skipButtonText: t,
2756
- bottom: n = !1
2757
- }) => e ? null : u(F, {
2758
- className: R([n && "ul-skip-button-below", w.InactiveButton]),
2759
- onClick: it.bind(null, {
2760
- status: W.Abandoned
2761
- }),
2762
- children: t || "Skip"
2763
- }), bt = (e) => {
2764
- const {
2765
- avStream: t,
2766
- captureStream: n,
2767
- recordingMediaTypes: r,
2768
- updatePage: o
2769
- } = K.getState(), i = (r == null ? void 0 : r.includes(Q.Audio)) || (r == null ? void 0 : r.includes(Q.Video));
2770
- q(() => {
2771
- const a = setInterval(() => {
2772
- i && t && !t.active ? o({
2773
- avStream: null,
2774
- currentPage: e[0]
2775
- }) : (!n || !n.active) && o({
2776
- captureStream: void 0,
2777
- currentPage: e[i ? 1 : 0]
2778
- });
2779
- }, 1e3);
2780
- return () => clearInterval(a);
2781
- }, [t, n, i, e, r, o]);
2782
- }, Fo = ({
2783
- content: e,
2784
- pages: t,
2785
- required: n
2786
- }) => {
2787
- const {
2788
- buttonText: r,
2789
- skipButtonText: o,
2790
- taskDetail: i
2791
- } = e;
2792
- return bt(t), u("div", {
2793
- className: "ul-task-page",
2794
- children: [i && u(ur, {
2795
- richTextBody: i
2796
- }), u("div", {
2797
- className: je,
2798
- children: [u(F, {
2799
- onClick: gt.bind(null, {
2800
- pages: t
2801
- }),
2802
- children: r
2803
- }), u(Fe, {
2804
- required: n,
2805
- skipButtonText: o
2806
- })]
2807
- })]
2808
- }, "start-task");
2809
- }, qo = ({
2810
- content: e,
2811
- pages: t,
2812
- properties: n
2813
- }) => {
2814
- const {
2815
- buttonText: r,
2816
- skipButtonText: o
2817
- } = e;
2818
- bt(t);
2819
- const a = u(ae, {
2820
- properties: n,
2821
- defaultBody: () => u("div", {
2822
- className: je,
2823
- children: [u(F, {
2824
- className: "ul-complete-task-button",
2825
- onClick: it.bind(null, {
2826
- status: W.Completed
2827
- }),
2828
- children: r
2829
- }), u(F, {
2830
- className: R([w.InactiveButton]),
2831
- onClick: it.bind(null, {
2832
- status: W.GivenUp
2833
- }),
2834
- children: o
2835
- })]
2836
- })
2837
- });
2838
- return u("div", {
2839
- className: "ul-task-page",
2840
- children: [e.taskDetail && u(ur, {
2841
- richTextBody: e.taskDetail
2842
- }), a]
2843
- }, "complete-task");
2844
- }, zo = ({
2845
- content: e,
2846
- pages: t,
2847
- required: n
2848
- }) => {
2849
- const {
2850
- buttonText: r,
2851
- skipButtonText: o
2852
- } = e, [i] = $((c) => [c.tabTitle]), [a, l] = D(!1);
2853
- return u("div", {
2854
- children: [u("div", {
2855
- className: cr,
2856
- children: [u("p", {
2857
- style: {
2858
- marginTop: "auto"
2859
- },
2860
- children: e.selectTabText
2861
- }), u("div", {
2862
- className: "ul-select-tab-container",
2863
- children: u("p", {
2864
- className: lr,
2865
- children: i
2866
- })
2867
- })]
2868
- }), u("div", {
2869
- className: n ? "" : je,
2870
- children: [u(F, {
2871
- disabled: a,
2872
- onClick: gt.bind(null, {
2873
- pages: t,
2874
- setIsRequestingPermission: l
2875
- }),
2876
- children: r
2877
- }), u(Fe, {
2878
- required: n,
2879
- skipButtonText: o
2880
- })]
2881
- })]
2882
- });
2883
- }, Wo = ({
2884
- content: e
2885
- }) => u("div", {
2886
- className: R([sr, "ul_permission_svg_container", "ul_recorded-task-inset-spacing", "ul-center-horizontally"]),
2887
- dangerouslySetInnerHTML: {
2888
- __html: e.svg
2889
- }
2890
- }, "ul-permission-request-graphic"), Zo = ({
2891
- content: e,
2892
- pages: t,
2893
- required: n
2894
- }) => {
2895
- const {
2896
- permissionDeniedHeadline: r,
2897
- permissionDeniedBody: o,
2898
- skipButtonText: i,
2899
- tryAgainButtonText: a
2900
- } = e, l = De(t[0]) ? t[0] : null;
2901
- return q(() => {
2902
- const c = setInterval(() => {
2903
- l !== null && ot({
2904
- currentPage: l,
2905
- pages: t
2906
- });
2907
- }, 1e3);
2908
- return () => clearInterval(c);
2909
- }, [l, t]), l ? u("div", {
2910
- children: [u("div", {
2911
- className: cr,
2912
- children: u("p", {
2913
- className: "ul-av-permission-denied-paragraph",
2914
- children: [u("span", {
2915
- className: "ul-av-permission-denied-headline",
2916
- children: r
2917
- }), u("span", {
2918
- className: lr,
2919
- children: o
2920
- })]
2921
- })
2922
- }), u("div", {
2923
- className: je,
2924
- children: [u(F, {
2925
- onClick: ot.bind(null, {
2926
- currentPage: l,
2927
- pages: t
2928
- }),
2929
- children: a
2930
- }), u(Fe, {
2931
- required: n,
2932
- skipButtonText: i
2933
- })]
2934
- })]
2935
- }) : null;
2936
- }, Go = ({
2937
- stream: e
2938
- }) => u("video", {
2939
- autoPlay: !0,
2940
- className: R(["ul_recorded-task-inset-spacing"]),
2941
- id: "ul-record-task-video-preview",
2942
- muted: !0,
2943
- ref: (t) => {
2944
- t && (t.srcObject = e || null);
2945
- }
2946
- }), Qo = ({
2947
- content: e,
2948
- pages: t,
2949
- required: n
2950
- }) => {
2951
- const {
2952
- skipButtonText: r
2953
- } = e, {
2954
- avStream: o
2955
- } = K.getState();
2956
- return bt(t), u("div", {
2957
- children: [u(Go, {
2958
- stream: o
2959
- }), u("div", {
2960
- className: "ul-vertical-button-container-center",
2961
- children: [u(F, {
2962
- onClick: gt.bind(null, {
2963
- pages: t
2964
- }),
2965
- children: e.buttonText
2966
- }), u(Fe, {
2967
- bottom: !0,
2968
- required: n,
2969
- skipButtonText: r
2970
- })]
2971
- })]
2972
- });
2973
- }, Ko = ({
2974
- properties: e
2975
- }) => {
2976
- const {
2977
- pages: t,
2978
- required: n
2979
- } = e, {
2980
- avStream: r,
2981
- currentPage: o
2982
- } = K.getState();
2983
- if (o === void 0)
2984
- return null;
2985
- switch (o == null ? void 0 : o.type) {
2986
- case z.AvPermission: {
2987
- const i = ar(r, o);
2988
- return i === oe.RequestNeeded ? u(Wo, {
2989
- content: o
2990
- }) : i === oe.TryAgain ? u(Zo, {
2991
- content: o,
2992
- pages: t,
2993
- required: n
2994
- }) : u(Qo, {
2995
- content: o,
2996
- pages: t,
2997
- required: n
2998
- });
2999
- }
3000
- case z.ScreenPermission:
3001
- return u(zo, {
3002
- content: o,
3003
- pages: t,
3004
- required: n
3005
- });
3006
- case z.StartTask:
3007
- return u(Fo, {
3008
- content: o,
3009
- pages: t,
3010
- required: n
3011
- });
3012
- case z.CompleteTask:
3013
- return u(qo, {
3014
- content: o,
3015
- pages: t,
3016
- properties: e
3017
- });
3018
- default:
3019
- return null;
3020
- }
3021
- }, Yo = ({
3022
- className: e,
3023
- properties: t,
3024
- next: n,
3025
- questionId: r
3026
- }) => {
3027
- const o = $(), {
3028
- surveyId: i,
3029
- responseGroupUid: a,
3030
- userId: l
3031
- } = o, c = K(), {
3032
- screenPermissionRequested: d
3033
- } = c, p = K((m) => m.avStream);
3034
- let s = K((m) => m.currentPage);
3035
- s || (s = jo({
3036
- questionId: r,
3037
- surveyId: i,
3038
- next: (m) => {
3039
- n(m);
3040
- },
3041
- pages: t.pages,
3042
- responseGroupUid: a,
3043
- userId: l
3044
- }));
3045
- let _ = s.headline, f = s.captionText;
3046
- const h = ar(p, s);
3047
- return ir(s) && d && (_ = s.permissionDeniedHeadline, f = s.permissionDeniedCaptionText), De(s) && h === oe.Ready && (_ = s.permissionGrantedHeadline, f = s.permissionGrantedCaptionText), u("div", {
3048
- className: R([e, "ul-center-horizontally", w.FadeInTransition]),
3049
- children: [u(Y, {
3050
- message: _,
3051
- properties: {
3052
- captionText: f
3053
- }
3054
- }), u(Ko, {
3055
- properties: t
3056
- })]
3057
- });
3058
- }, Jo = {
3059
- "{{user_id}}": "externalUserId",
3060
- "{{email}}": "email"
3061
- }, Xo = (e = void 0, t = {}) => {
3062
- if (!e)
3063
- return e;
3064
- let n = e;
3065
- const r = [];
3066
- for (const [c, d] of Object.entries(Jo))
3067
- if (n.toLowerCase().includes(c))
3068
- if (t[d]) {
3069
- const p = new RegExp(c, "gi");
3070
- n = n.replace(p, t[d]);
3071
- } else
3072
- r.push(c);
3073
- if (r.length === 0 || !n.includes("?"))
3074
- return n;
3075
- const o = n.slice(0, n.indexOf("?")), a = n.slice(n.indexOf("?") + 1).split("&").map((c) => c.split("=")).filter((c) => !r.includes(c[1]));
3076
- if (a.length === 0)
3077
- return o;
3078
- const l = a.map((c) => c.join("=")).join("&");
3079
- return `${o}?${l}`;
3080
- }, ei = ({
3081
- className: e,
3082
- message: t,
3083
- next: n,
3084
- properties: r,
3085
- questionId: o,
3086
- type: i
3087
- }) => {
3088
- const {
3089
- visitorAttributes: a
3090
- } = $((s) => ({
3091
- visitorAttributes: s.visitorAttributes
3092
- })), l = (s, _ = !1) => {
3093
- n({
3094
- value: _ ? {
3095
- skipped: !0
3096
- } : void 0,
3097
- questionId: o,
3098
- type: i
3099
- });
3100
- }, c = (s) => {
3101
- (s.key === "Enter" || s.key === " ") && n({
3102
- value: void 0,
3103
- questionId: o,
3104
- type: i
3105
- });
3106
- }, d = () => {
3107
- const s = Xo(r && r.buttonUrl, a);
3108
- return u("div", {
3109
- className: "ul-card-button-group",
3110
- children: [u("a", {
3111
- className: "ul-card-text__button ul-card__text-url-prompt-button",
3112
- href: s,
3113
- id: "ul-card-text__button",
3114
- onClick: l,
3115
- onKeyPress: c,
3116
- rel: "noreferrer",
3117
- role: s ? "link" : "button",
3118
- tabIndex: 0,
3119
- target: "_blank",
3120
- children: be(r)
3121
- }), r.required === !1 && u("button", {
3122
- className: w.SkipButton,
3123
- onClick: (_) => l(_, !0),
3124
- children: rr(r)
3125
- })]
3126
- });
3127
- }, p = (s, _) => s ? u("div", {
3128
- className: "ul-rich-text-body",
3129
- dangerouslySetInnerHTML: {
3130
- __html: s
3131
- },
3132
- id: "ul-card__text-url-body-container"
3133
- }) : u("div", {
3134
- className: "ul-rich-text-body",
3135
- id: "ul-card__text-url-body-container",
3136
- children: (_ ? _.split(/\n\s*\n/g) : []).map((f, h) => u("p", {
3137
- children: f
3138
- }, h))
3139
- });
3140
- return u("div", {
3141
- className: R([e, "ul-card__text-url-prompt", w.FadeInTransition]),
3142
- children: [u(Y, {
3143
- message: t
3144
- }), p(r == null ? void 0 : r.richTextBody, r == null ? void 0 : r.body), u(ae, {
3145
- defaultBody: d,
3146
- properties: r
3147
- })]
3148
- }, o);
3149
- }, ti = ({
3150
- className: e,
3151
- questionId: t
3152
- }) => {
3153
- const {
3154
- border: n,
3155
- destroy: r,
3156
- endCard: o,
3157
- forceBrandedLogo: i
3158
- } = $((c) => ({
3159
- border: c.border,
3160
- destroy: c.destroy,
3161
- endCard: c.endCard,
3162
- forceBrandedLogo: c.forceBrandedLogo
3163
- }));
3164
- q(() => {
3165
- setTimeout(() => {
3166
- r(fe);
3167
- }, i ? 4e3 : 2e3);
3168
- }, [r, i]);
3169
- const a = o && o.subheader ? u("p", {
3170
- className: w.Caption,
3171
- children: o.subheader
3172
- }) : null, l = o && o.headline ? o.headline : "";
3173
- return u("div", {
3174
- className: R([e, "ul-card--thanks", w.FadeInTransition]),
3175
- children: u("div", {
3176
- children: u("div", {
3177
- className: "ul-card--thanks-content",
3178
- children: [u("div", {
3179
- className: "ul-thanks-check",
3180
- children: u("svg", {
3181
- "aria-labelledby": "title",
3182
- fill: "none",
3183
- height: "99",
3184
- viewBox: "0 0 81 99",
3185
- width: "81",
3186
- xmlns: "http://www.w3.org/2000/svg",
3187
- children: [u("path", {
3188
- clipRule: "evenodd",
3189
- 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",
3190
- fill: n,
3191
- fillRule: "evenodd"
3192
- }), u("path", {
3193
- clipRule: "evenodd",
3194
- 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",
3195
- fill: n,
3196
- fillRule: "evenodd"
3197
- }), u("path", {
3198
- 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",
3199
- fill: "black",
3200
- fillOpacity: "0.2"
3201
- })]
3202
- })
3203
- }), u(Y, {
3204
- message: l
3205
- }), a]
3206
- })
3207
- })
3208
- }, t);
3209
- }, ni = ({
3210
- className: e
3211
- }) => {
3212
- const {
3213
- uploadProgress: t
3214
- } = $((i) => ({
3215
- uploadProgress: i.uploadProgress
3216
- }));
3217
- let n, r;
3218
- Object.values(t).filter((i) => i.isSubmitted).length > 1 ? (n = "Your responses are processing", r = "Please keep this tab open until your responses are fully processed.") : (n = "Your response is processing", r = "Please keep this tab open until your response is fully processed.");
3219
- const o = Math.round(Math.min(99, ...Object.values(t).filter((i) => i.isSubmitted).map((i) => i.progressPct || 0)));
3220
- return u("div", {
3221
- className: R([e, "ul-card--uploading", w.FadeInTransition]),
3222
- children: [u("div", {
3223
- "aria-busy": "true",
3224
- "aria-label": "Processing...",
3225
- "aria-live": "polite",
3226
- className: w.LoadingSpinnerContainer,
3227
- role: "progressbar",
3228
- children: u("div", {
3229
- className: w.LoadingSpinner,
3230
- children: [u("div", {
3231
- className: w.LoadingSpinnerFirst
3232
- }), u("div", {
3233
- className: w.LoadingSpinnerSecond
3234
- }), u("div", {
3235
- className: w.LoadingSpinnerThird
3236
- }), u("div", {
3237
- className: w.LoadingSpinnerFourth
3238
- })]
3239
- })
3240
- }), u(Y, {
3241
- message: `${n} (${o}% complete)`
3242
- }), u("p", {
3243
- className: w.Caption,
3244
- children: r
3245
- })]
3246
- });
3247
- }, Kt = ({
3248
- logoOnly: e = !1,
3249
- style: t = {}
3250
- }) => u("svg", {
3251
- alt: `${e ? "Powered by " : ""}Sprig`,
3252
- width: e ? "35" : "112",
3253
- height: "15",
3254
- viewBox: e ? "79 0 31 15" : "0 0 112 15",
3255
- fill: "none",
3256
- xmlns: "http://www.w3.org/2000/svg",
3257
- style: {
3258
- display: "block",
3259
- ...t
3260
- },
3261
- children: [!e && u("path", {
3262
- 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",
3263
- fill: "black",
3264
- fillOpacity: "0.7"
3265
- }), u("path", {
3266
- 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",
3267
- fill: "black",
3268
- fillOpacity: "0.7"
3269
- }), u("path", {
3270
- 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",
3271
- fill: "black",
3272
- fillOpacity: "0.7"
3273
- }), u("path", {
3274
- 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",
3275
- fill: "black",
3276
- fillOpacity: "0.7"
3277
- }), u("path", {
3278
- 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",
3279
- fill: "black",
3280
- fillOpacity: "0.7"
3281
- }), u("path", {
3282
- 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",
3283
- fill: "black",
3284
- fillOpacity: "0.7"
3285
- })]
3286
- }), ri = () => {
3287
- const {
3288
- border: e,
3289
- cards: t,
3290
- forceBrandedLogo: n,
3291
- headers: r,
3292
- index: o,
3293
- marketingUrl: i,
3294
- showSurveyBrand: a,
3295
- slugName: l,
3296
- surveyId: c,
3297
- viewedCardCount: d
3298
- } = $((S) => ({
3299
- border: S.border,
3300
- cards: S.cards,
3301
- forceBrandedLogo: S.forceBrandedLogo,
3302
- headers: S.headers,
3303
- index: S.index,
3304
- marketingUrl: S.marketingUrl,
3305
- showSurveyBrand: S.showSurveyBrand,
3306
- slugName: S.slugName,
3307
- surveyId: S.surveyId,
3308
- viewedCardCount: S.viewedCardCount
3309
- })), p = ie(null), s = t.filter((S) => S.type !== g.Uploading && S.type !== g.Thanks), _ = To(t, o), f = d + 1, h = f / (f + _), m = `${i}?utm_source=survey_branding&utm_medium=website&utm_campaign=${l}&utm_content=${c}${n && "&utm_term=poweredby_pill"}`;
3310
- q(() => {
3311
- p.current && (p.current.style.width = `${h * 100}%`);
3312
- }, [h]);
3313
- const y = () => u(j, {
3314
- children: [s.length > 1 && u("div", {
3315
- id: "ul-progress-bar-container",
3316
- children: u("div", {
3317
- id: "ul-progress-bar-current",
3318
- ref: p,
3319
- style: {
3320
- border: `1px solid ${e || "#000"}`
3321
- }
3322
- })
3323
- }), a ? u("div", {
3324
- className: n ? "yellow-footer-logo" : "",
3325
- style: {
3326
- marginTop: "4px"
3327
- },
3328
- children: u("a", {
3329
- href: m,
3330
- rel: "noreferrer",
3331
- target: "_blank",
3332
- children: u("div", {
3333
- style: {
3334
- display: "flex"
3335
- },
3336
- children: [u(Kt, {
3337
- logoOnly: !1
3338
- }), n && u(Yt, {
3339
- style: {
3340
- display: "block",
3341
- margin: "auto 0 auto 4px",
3342
- transform: "rotateY(0deg) rotate(-45deg)"
3343
- }
3344
- })]
3345
- })
3346
- })
3347
- }) : null]
3348
- }), v = () => u("a", {
3349
- dir: "ltr",
3350
- href: m,
3351
- rel: "noreferrer",
3352
- target: "_blank",
3353
- children: u("div", {
3354
- className: "thank-you-card-link",
3355
- children: [u("div", {
3356
- className: "sprig-box-logo",
3357
- children: u(Kt, {
3358
- logoOnly: !0,
3359
- style: {
3360
- margin: "auto"
3361
- }
3362
- })
3363
- }), u("div", {
3364
- children: u("p", {
3365
- children: ["Capture insights about your own product", u(Yt, {
3366
- style: {
3367
- display: "inline-flex",
3368
- marginInlineStart: "4px",
3369
- verticalAlign: "middle"
3370
- }
3371
- })]
3372
- })
3373
- })]
3374
- })
3375
- }), k = t[o].type === g.Thanks;
3376
- return u("footer", {
3377
- className: `ul-footer ${r["userleap-platform"] === "link" ? "ul-footer__link" : ""}`,
3378
- style: a ? {} : {
3379
- marginBottom: "10px"
3380
- },
3381
- children: k && n ? v() : y()
3382
- });
3383
- }, Yt = ({
3384
- style: e
3385
- }) => u("svg", {
3386
- fill: "none",
3387
- height: "10",
3388
- style: e,
3389
- viewBox: "0 0 12 10",
3390
- width: "12",
3391
- xmlns: "http://www.w3.org/2000/svg",
3392
- children: [u("path", {
3393
- d: "M1.47839 5.2085L10.9384 5.2085",
3394
- stroke: "black",
3395
- strokeLinecap: "round",
3396
- strokeLinejoin: "round",
3397
- strokeWidth: "1.35"
3398
- }), u("path", {
3399
- d: "M7.0686 1.15845L10.9386 5.20845L7.0686 9.25845",
3400
- stroke: "black",
3401
- strokeLinecap: "round",
3402
- strokeLinejoin: "round",
3403
- strokeWidth: "1.35"
3404
- })]
3405
- }), oi = () => {
3406
- const {
3407
- answers: e,
3408
- border: t,
3409
- cards: n,
3410
- close: r,
3411
- configureExitOnOverlayClick: o,
3412
- destroy: i,
3413
- endCard: a,
3414
- eventEmitFn: l,
3415
- fontFamily: c,
3416
- headers: d,
3417
- index: p,
3418
- next: s,
3419
- showStripes: _,
3420
- surveyId: f,
3421
- update: h,
3422
- useMobileStyling: m,
3423
- viewDocument: y
3424
- } = $((P) => ({
3425
- answers: P.answers,
3426
- border: P.border,
3427
- cards: P.cards,
3428
- close: P.close,
3429
- configureExitOnOverlayClick: P.configureExitOnOverlayClick,
3430
- destroy: P.destroy,
3431
- endCard: P.endCard,
3432
- eventEmitFn: P.eventEmitFn,
3433
- fontFamily: P.fontFamily,
3434
- headers: P.headers,
3435
- index: P.index,
3436
- next: P.next,
3437
- showStripes: P.showStripes,
3438
- surveyId: P.surveyId,
3439
- update: P.update,
3440
- useMobileStyling: P.useMobileStyling,
3441
- viewDocument: P.viewDocument
3442
- })), v = ie(null), k = ie(!1), S = d["userleap-platform"], {
3443
- props: E,
3444
- type: b,
3445
- name: x
3446
- } = n[p], I = n.length;
3447
- q(() => {
3448
- v.current && (v.current.classList.contains("ul-app--visible") || v.current.classList.add("ul-app--visible"), !k.current && l && (k.current = !0, l(re.SurveyAppeared, {
3449
- name: re.SurveyAppeared,
3450
- [xr.SurveyId]: f
3451
- })));
3452
- }, [l, f]), q(() => {
3453
- h();
3454
- }, [p, h]), q(() => {
3455
- o(() => r());
3456
- }, [r, o]);
3457
- const N = () => r(fe), T = (P) => {
3458
- P.key === "Enter" && N();
3459
- }, A = async function(P) {
3460
- s({
3461
- data: P,
3462
- completeSurvey: () => {
3463
- i(fe);
3464
- },
3465
- endCard: a
3466
- }), Cr(y);
3467
- };
3468
- if (e) {
3469
- for (const P of e)
3470
- if (P.questionId === x) {
3471
- let ne;
3472
- if (b === g.MultipleChoice) {
3473
- const se = E.options.find(({
3474
- value: qe
3475
- }) => qe === P.value);
3476
- if (!se)
3477
- break;
3478
- ne = {
3479
- [se.id]: se.value
3480
- };
3481
- } else
3482
- ne = P.value;
3483
- A({
3484
- value: ne,
3485
- type: b,
3486
- questionId: P.questionId
3487
- });
3488
- break;
3489
- }
3490
- }
3491
- const B = () => [Ke.Email, Ke.Link].includes(d["userleap-platform"]) ? !1 : !a || p + 1 !== I, ve = () => m ? {
3492
- borderColor: t
3493
- } : {
3494
- borderColor: t,
3495
- margin: "15px"
3496
- }, O = () => {
3497
- const P = {
3498
- className: "ul-card",
3499
- next: A,
3500
- questionId: x,
3501
- type: b
3502
- };
3503
- switch (b) {
3504
- case g.ConsentLegal:
3505
- return U(Ao, {
3506
- ...P,
3507
- ...E,
3508
- key: x
3509
- });
3510
- case g.Likert:
3511
- return U($o, {
3512
- ...P,
3513
- ...E,
3514
- key: x
3515
- });
3516
- case g.Matrix:
3517
- return U(Oo, {
3518
- ...P,
3519
- ...E,
3520
- key: x
3521
- });
3522
- case g.MultipleChoice:
3523
- return U(Uo, {
3524
- ...P,
3525
- ...E,
3526
- key: x
3527
- });
3528
- case g.MultipleSelect:
3529
- return U(Vo, {
3530
- ...P,
3531
- ...E,
3532
- key: x
3533
- });
3534
- case g.NPS:
3535
- return U(Ho, {
3536
- ...P,
3537
- key: x,
3538
- props: E
3539
- });
3540
- case g.Open:
3541
- return U(Bo, {
3542
- ...P,
3543
- ...E,
3544
- key: x
3545
- });
3546
- case g.RecordedTask:
3547
- return U(Yo, {
3548
- ...P,
3549
- ...E,
3550
- key: x
3551
- });
3552
- case g.TextUrlPrompt:
3553
- return U(ei, {
3554
- ...P,
3555
- ...E,
3556
- key: x
3557
- });
3558
- case g.Thanks:
3559
- return U(ti, {
3560
- ...P,
3561
- ...E,
3562
- key: x
3563
- });
3564
- case g.Uploading:
3565
- return U(ni, {
3566
- ...P,
3567
- ...E,
3568
- key: x
3569
- });
3570
- case g.VideoVoice:
3571
- return null;
3572
- default:
3573
- return null;
3574
- }
3575
- }, ue = (P) => {
3576
- var vt;
3577
- const ne = window.sprigAPI, se = P.target;
3578
- if (!ne || !se)
3579
- return;
3580
- const qe = [se, se.parentElement];
3581
- for (const Ne of qe)
3582
- if (((vt = Ne == null ? void 0 : Ne.tagName) == null ? void 0 : vt.toLowerCase()) === "a") {
3583
- P.preventDefault(), ne == null || ne.openUrl(Ne.href);
3584
- return;
3585
- }
3586
- };
3587
- return u("div", {
3588
- className: R("ul-app", $e(d) ? "ul-app--visible" : "ul-app--overlay"),
3589
- dir: "auto",
3590
- id: fe,
3591
- onClick: ue,
3592
- ref: v,
3593
- style: {
3594
- "--theme": t,
3595
- ...c ? {
3596
- fontFamily: c.replace(";", "")
3597
- } : {}
3598
- },
3599
- children: u("div", {
3600
- className: "ul-app__container",
3601
- children: u("div", {
3602
- className: R(V(w.CardContainer, m)),
3603
- style: ve(),
3604
- children: [B() && u("div", {
3605
- className: R(V(w.CloseContainer, m)),
3606
- children: u("div", {
3607
- "aria-label": "Close button",
3608
- className: w.CloseButton,
3609
- onClick: N,
3610
- onKeyPress: T,
3611
- role: "button",
3612
- tabIndex: 0,
3613
- children: u("svg", {
3614
- fill: "none",
3615
- height: "18px",
3616
- viewBox: "0 0 13 13",
3617
- width: "18px",
3618
- xmlns: "http://www.w3.org/2000/svg",
3619
- children: u("path", {
3620
- 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",
3621
- fill: "#262136"
3622
- })
3623
- })
3624
- })
3625
- }), _ && u("div", {
3626
- className: "ul-header__container",
3627
- dir: "ltr",
3628
- children: u("div", {
3629
- className: "ul-header",
3630
- children: "For development purposes only"
3631
- })
3632
- }), u("div", {
3633
- className: R(yr(w.CardMainContent, S)),
3634
- children: O()
3635
- }), u(ri, {})]
3636
- })
3637
- })
3638
- });
3639
- }, ii = '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-card{flex:1 1 auto;border-radius:2px;display:flex;flex-direction:column;font-size:17px;line-height:19px;margin:auto;text-align:start;min-width:200px}.ul-card__container--desktop{border:2px solid #fff;box-shadow:0 0 15px #00000026}.ul-card__container--mobile{border-width:0;box-shadow:0 0 5px #00000040;margin-top:5px}.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;overflow:auto;padding:20px 20px 5px;position:relative;text-align:center;word-break:break-word}.ul-card-vertical__button-wrapper{flex-direction:column;align-items:center}.ul-card__button-wrapper{margin-top:4px;margin-bottom:3px;display:flex;gap:16px;justify-content: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{flex-grow:55;display:flex}.ul-card-main-content__web,.ul-card-main-content__android,.ul-card-main-content__ios{margin-bottom:5px}.ul-question{color:#343442;display:block;font-size:20px;line-height:125%;font-weight:500;cursor:default;text-align:start}.ul-caption{flex:1 0 auto;margin-top:8px;margin-bottom:15px;font-size:15px;line-height:130.35%;letter-spacing:.02em;color:#6c6c6e;text-align:start}.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}.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)}}.select-checkbox{height:16px;width:16px;border-radius:3px;border:1px solid #323232;display:flex;box-sizing:border-box;box-shadow:inset 3px 3px #0000001a;background-color:"transparent";align-items:center;justify-content:center}.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}.fade-in-transition{animation:fadeIn .4s ease-in;-webkit-animation:fadeIn .4s ease-in;-moz-animation:fadeIn .4s ease-in;-o-animation:fadeIn .4s ease-in;-ms-animation:fadeIn .4s ease-in}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@-moz-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@-webkit-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@-o-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@-ms-keyframes fadeIn{0%{opacity:0}to{opacity:1}}[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}.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}.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}.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}.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--matrix_grid{display:grid;grid-template-columns:max-content repeat(var(--numColumns),minmax(93px,1fr));grid-template-rows:repeat(var(--numRows),min-content);margin:0 auto;row-gap:4px;width:max-content}.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-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}.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-text{flex:1 0 auto;margin-top:2px;margin-bottom:3px;align-items:center;display:flex;flex-wrap:wrap;justify-content:center;padding:0}.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-voice__video{align-items:center;display:flex;flex-direction:column}#ul-card-voice__video>div{margin-bottom:10px;width:100%}#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.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}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}#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;left:0;position:absolute;top:0;width:100%}.ul-footer{display:flex;flex-direction:column;align-items:center;justify-content:center;margin-top:auto;flex-grow:1;width:100%}.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%}.close-btn{cursor:pointer;height:18px;margin-inline-end:-10px;position:relative;top:-10px;width:18px;z-index:1}.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;max-width:250px;margin:25px 0}#ul-progress-bar-current{transition:width 1s ease;width:0%;height:0;border-radius:2px}.prototype-button{width:100%;background:#00000003;border:1.5px solid #e6e6e6;border-radius:4px 0 0 4px;flex:none;flex-grow:1;margin:0;padding:20px 0;font-size:14px;font-family:inherit;text-decoration:underline}.prototype-button:hover{cursor:pointer}', ai = async (e, t) => {
3640
- var r;
3641
- const n = await fetch(t, {
3642
- method: "POST",
3643
- cache: "no-cache",
3644
- headers: {
3645
- "Content-Type": "application/json"
3646
- },
3647
- body: JSON.stringify(e)
3648
- });
3649
- if (n.ok) {
3650
- const o = await n.json();
3651
- return (r = o == null ? void 0 : o.upload) == null ? void 0 : r.url;
3652
- } else
3653
- return null;
3654
- }, dr = () => MediaRecorder.isTypeSupported(
3655
- "video/webm"
3656
- /* Webm */
3657
- ) ? "video/webm" : "video/mp4", Jt = (e) => {
3658
- const t = {
3659
- audioBitsPerSecond: 128e3,
3660
- //standard setting based on documentation's example
3661
- videoBitsPerSecond: 25e5,
3662
- mimeType: dr()
3663
- };
3664
- return new MediaRecorder(e, t);
3665
- }, Xt = (e, t, n) => {
3666
- n[t] = [], e.ondataavailable = function(r) {
3667
- n[t].push(r.data);
3668
- }, e.currentMediaRecordingUid = t, e.start();
3669
- };
3670
- function en(e, t, n, r, o, i) {
3671
- if (e && e.state !== "inactive") {
3672
- const {
3673
- [L.BeginCallback]: a
3674
- } = r, l = e.currentMediaRecordingUid;
3675
- if (!l)
3676
- return;
3677
- a && a(l), e.onstop = () => si(t, e, n, r, l, o, i), e.stop();
3678
- }
3679
- }
3680
- async function si(e, t, n, r, o, i, a) {
3681
- const l = $.getState().viewDocument, {
3682
- [L.UploadCallback]: c,
3683
- [L.ProgressCallback]: d
3684
- } = r, p = {
3685
- mediaType: n,
3686
- updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
3687
- mediaRecordingUid: o,
3688
- ...r[L.PassthroughData]
3689
- }, s = await ai(p, e);
3690
- if (!s) {
3691
- c && c(null, {
3692
- message: "failed to get upload url"
3693
- });
3694
- return;
3695
- }
3696
- const _ = new Blob(a, {
3697
- type: dr()
3698
- });
3699
- if (!l.defaultView)
3700
- return;
3701
- const f = new l.defaultView.File([_], `recording video ${Date.now()}`), h = i.createUpload({
3702
- // endpoint computed from backend separately and hacked together
3703
- endpoint: s,
3704
- file: f,
3705
- chunkSize: 5120
3706
- // Uploads the file in ~5mb chunks
3707
- });
3708
- h.on("error", (m) => {
3709
- c && c(null, m);
3710
- }), h.on("progress", (m) => {
3711
- d && d(o, m);
3712
- }), h.on("success", () => {
3713
- c && c(o, !0);
3714
- });
3715
- }
3716
- const li = {
3717
- chunks: {}
3718
- }, ci = {
3719
- state: {
3720
- ...li
3721
- },
3722
- stopRecording(e) {
3723
- const {
3724
- uploadApiEndpoint: t,
3725
- avRecorder: n,
3726
- screenRecorder: r,
3727
- UpChunk: o
3728
- } = this.state, i = this.state.avStream && this.state.avStream.getVideoTracks().length > 0 ? Q.Video : Q.Audio;
3729
- this.state.chunks && t && o && (n != null && n.currentMediaRecordingUid && en(n, t, i, e, o, this.state.chunks[n == null ? void 0 : n.currentMediaRecordingUid]), r != null && r.currentMediaRecordingUid && en(r, t, Q.Screen, e, o, this.state.chunks[r == null ? void 0 : r.currentMediaRecordingUid]));
3730
- },
3731
- handleCancelledStream(e) {
3732
- const t = e.getVideoTracks(), n = e.getAudioTracks();
3733
- let r = t.length && t[0];
3734
- r = r || n.length && n[0], r && r.addEventListener("ended", () => {
3735
- [this.state.avRecorder, this.state.screenRecorder].map((o) => {
3736
- o && (o.state === "recording" && o.stop(), o.stream.getTracks().map((i) => {
3737
- i.readyState === "live" && i.stop();
3738
- }));
3739
- }), Object.assign(this.state, {
3740
- avStream: null,
3741
- captureStream: null,
3742
- avRecorder: null,
3743
- screenRecorder: null
3744
- });
3745
- });
3746
- },
3747
- taskDurationMillisecond() {
3748
- return this.state.startTime ? (/* @__PURE__ */ new Date()).getTime() - this.state.startTime.getTime() : 0;
3749
- },
3750
- setUpChunk(e) {
3751
- this.state.UpChunk = e;
3752
- },
3753
- configure(e, t) {
3754
- Object.assign(this.state, t), this.state.uploadApiEndpoint = `${t.apiURL}/2/environments/integrations/upload`, this.state.chunks = {}, e.on(H.PermissionStatus, this.permissionStatusCallback.bind(this)), e.on(H.AvPermission, async (n) => {
3755
- this.avPermissionCallback(n);
3756
- }), e.on(H.BeginRecording, this.beginRecordingCallback.bind(this)), e.on(H.StartTask, this.startTaskCallback.bind(this)), e.on(H.ScreenPermission, async (n) => {
3757
- this.screenPermissionCallback(n);
3758
- }), e.on(H.FinishTask, async (n) => {
3759
- this.finishTaskCallback(n);
3760
- });
3761
- },
3762
- async avPermissionCallback(e) {
3763
- var r, o, i;
3764
- const {
3765
- [L.StreamReadyCallback]: t,
3766
- [L.PermissionDescriptors]: n
3767
- } = e;
3768
- try {
3769
- (r = this.state.avStream) != null && r.active && (this.state.avStream.getTracks().map((a) => a.readyState === "live" && a.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({
3770
- video: n.includes(Se.Camera),
3771
- audio: !0
3772
- }), ((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);
3773
- } catch (a) {
3774
- console.warn("Error: failed to get permissions: " + a), t && t(null, null);
3775
- return;
3776
- }
3777
- t && t(this.state.avStream, this.state.captureStream);
3778
- },
3779
- async screenPermissionCallback(e) {
3780
- const {
3781
- [L.ScreenPermissionRequested]: t,
3782
- [L.StreamReadyCallback]: n
3783
- } = e;
3784
- t == null || t(!0);
3785
- try {
3786
- this.state.captureStream = await navigator.mediaDevices.getDisplayMedia({
3787
- video: !0,
3788
- cursor: "always",
3789
- displaySurface: "browser",
3790
- preferCurrentTab: !0
3791
- });
3792
- } catch (r) {
3793
- t == null || t(!1), console.warn("Error: failed to get permissions: " + r), n && n(null, null);
3794
- return;
3795
- }
3796
- 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), n && n(this.state.avStream || null, this.state.captureStream);
3797
- },
3798
- beginRecordingCallback(e) {
3799
- const {
3800
- [L.RecordingMediaTypes]: t,
3801
- [L.StartRecordingCallback]: n
3802
- } = e;
3803
- if (!t)
3804
- return;
3805
- const r = [];
3806
- if (t.includes(Q.Video) && this.state.avStream) {
3807
- this.state.avRecorder = Jt(this.state.avStream);
3808
- const o = Ct();
3809
- Xt(this.state.avRecorder, o, this.state.chunks), r.push(o);
3810
- }
3811
- if (t.includes(Q.Screen) && this.state.captureStream) {
3812
- this.state.screenRecorder = Jt(this.state.captureStream);
3813
- const o = Ct();
3814
- Xt(this.state.screenRecorder, o, this.state.chunks), r.push(o);
3815
- }
3816
- r && n && n(r);
3817
- },
3818
- async finishTaskCallback(e) {
3819
- const {
3820
- [L.CurrentIndex]: t,
3821
- [L.TaskResponse]: n,
3822
- [L.TaskCompleteCallback]: r
3823
- } = e;
3824
- await this.stopRecording(e), r && r(this.taskDurationMillisecond()), this.state.cards && this.state.hasEndCard !== void 0 && this.lookAheadAndStopStream(t, n, this.state.cards, this.state.hasEndCard);
3825
- },
3826
- startTaskCallback() {
3827
- this.state.startTime = /* @__PURE__ */ new Date();
3828
- },
3829
- permissionStatusCallback(e) {
3830
- var r;
3831
- const {
3832
- [L.PermissionStatusCallback]: t
3833
- } = e, n = this.state.avStream;
3834
- t && t(n, n ? (n == null ? void 0 : n.getVideoTracks().length) > 0 : !1, !!((r = this.state.captureStream) != null && r.active), this.state.captureStream);
3835
- },
3836
- lookAheadAndStopStream(e, t, n, r) {
3837
- const {
3838
- avRecorder: o,
3839
- screenRecorder: i
3840
- } = this.state, {
3841
- allResponses: a
3842
- } = $.getState(), l = er({
3843
- cards: n,
3844
- index: e,
3845
- hasEndCard: r,
3846
- allResponses: a
3847
- });
3848
- l !== null && n[l].type === g.RecordedTask || [o, i].map((c) => {
3849
- c && (c.state === "recording" && c.stop(), c.stream.getTracks().map((d) => {
3850
- d.readyState === "live" && d.stop();
3851
- }));
3852
- });
3853
- }
3854
- }, at = Object.create(ci);
3855
- Object.freeze(at);
3856
- const ui = (e, t) => {
3857
- const n = [...e], r = /* @__PURE__ */ new Set([g.VideoVoice, g.RecordedTask]);
3858
- return e.some((o) => r.has(o.type)) && n.push({
3859
- name: -2,
3860
- props: {
3861
- routingOptions: []
3862
- },
3863
- type: g.Uploading
3864
- }), t && n.push({
3865
- name: -1,
3866
- props: {
3867
- routingOptions: []
3868
- },
3869
- type: g.Thanks
3870
- }), n;
3871
- }, di = ({
3872
- mode: e = null,
3873
- viewWindow: t,
3874
- viewDocument: n
3875
- }) => {
3876
- const r = n.documentElement;
3877
- let o;
3878
- try {
3879
- o = t.parent.location.href;
3880
- } catch {
3881
- o = t.location.href;
3882
- }
3883
- return {
3884
- mode: e,
3885
- sw: t.screen.width,
3886
- sh: t.screen.height,
3887
- cw: r.clientWidth,
3888
- ch: r.clientHeight,
3889
- p: o,
3890
- l: t.navigator.language
3891
- };
3892
- };
3893
- function pi(e, t = !0) {
3894
- var b;
3895
- const {
3896
- answers: n,
3897
- apiURL: r,
3898
- customStyles: o,
3899
- endCard: i,
3900
- eventEmitFn: a,
3901
- fontFamilyURL: l,
3902
- frame: c,
3903
- previewKey: d,
3904
- viewDocument: p,
3905
- viewWindow: s
3906
- } = e, _ = $e(e.headers) ? e.frame : p.body, f = e.UpChunk || window.UpChunk, h = Ie, m = ui(e.cards, !!i);
3907
- at.configure(h, {
3908
- cards: m,
3909
- hasEndCard: !!i,
3910
- apiURL: r,
3911
- UpChunk: f
3912
- }), $.setState({
3913
- apiURL: r,
3914
- answers: n,
3915
- border: e.border,
3916
- index: e.startingQuestionIdx || 0,
3917
- cards: m,
3918
- configureExitOnOverlayClick: e.configureExitOnOverlayClick,
3919
- customMetadata: e.customMetadata,
3920
- endCard: e.endCard,
3921
- envId: e.envId,
3922
- eventEmitFn: a,
3923
- fontFamily: e.fontFamily,
3924
- forceBrandedLogo: e.forceBrandedLogo,
3925
- frame: c,
3926
- headers: e.headers,
3927
- hasViewedEmbed: !1,
3928
- isPreview: e.isPreview,
3929
- marketingUrl: "https://sprig.com",
3930
- meta: di({
3931
- mode: e.mode,
3932
- viewWindow: s,
3933
- viewDocument: p
3934
- }),
3935
- mode: e.mode,
3936
- previewKey: d,
3937
- recorder: at,
3938
- recorderEventEmitter: h,
3939
- responseGroupUid: e.responseGroupUid,
3940
- showStripes: e.showStripes,
3941
- showSurveyBrand: e.showSurveyBrand,
3942
- slugName: e.slugName,
3943
- styleNonce: e.styleNonce,
3944
- surveyId: e.surveyId,
3945
- tabTitle: e.tabTitle,
3946
- uploadingCardViewed: !1,
3947
- uploadProgress: {},
3948
- useMobileStyling: e.useMobileStyling,
3949
- useDesktopPrototype: e.useDesktopPrototype,
3950
- userId: e.userId,
3951
- viewDocument: e.viewDocument,
3952
- visitorAttributes: e.visitorAttributes,
3953
- viewedCardCount: e.startingQuestionIdx || 0
3954
- });
3955
- const {
3956
- seen: y
3957
- } = $.getState();
3958
- y();
3959
- const {
3960
- head: v
3961
- } = p, k = p.createElement("style");
3962
- if (k.id = "sprig-style", k.textContent = ii, k.nonce = e.styleNonce, v.appendChild(k), e.fontFamily && l && parent) {
3963
- const x = p.createElement("link");
3964
- x.rel = "stylesheet", x.href = l, v.appendChild(x);
3965
- }
3966
- e.customStyles && kr(p, o, e.styleNonce);
3967
- const S = "2.26.3", E = a || ((b = c.eventEmitter) == null ? void 0 : b.emit);
3968
- E == null || E(ee.VerifyViewVersion, {
3969
- [ye.ViewVersion]: S
3970
- }), _ && t && he(u(oi, {}), _);
3971
- }
3972
- const _i = {
3973
- configure: pi
3974
- };
3975
- export {
3976
- _i as default
3977
- };