fansunited-frontend-components 0.0.48 → 0.0.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ChanceGame.js +45 -45
- package/ClassicQuizPlay.js +184 -183
- package/CollectLead.js +16 -15
- package/Discussion.js +1 -1
- package/EitherOrPlay.js +66 -65
- package/EventGamePlay.js +68 -67
- package/Leaderboard.js +22 -22
- package/MatchQuizPlay.js +82 -81
- package/PersonalityQuizPlay.js +77 -76
- package/PickThePair.js +42 -42
- package/PollVote.js +53 -52
- package/Predictor.js +75 -75
- package/README.md +272 -0
- package/chunks/{AlertMessage-D4Uc6n5U.js → AlertMessage-Ds45MBHB.js} +3 -3
- package/chunks/{ArrowRightAlt-wEs8SY1V.js → ArrowRightAlt-DKADQN2o.js} +1 -1
- package/chunks/{Avatar-BXHdXHLA.js → Avatar-K1EWhhkA.js} +2 -2
- package/chunks/{ChanceGameEmbedVariant-DfS5LPpp.js → ChanceGameEmbedVariant-DqFg4YKU.js} +31 -29
- package/chunks/{CheckCircle-CU2itira.js → CheckCircle-CV9iMpkZ.js} +1 -1
- package/chunks/{Close-DBt1nfGo.js → Close-BHp4N1-6.js} +1 -1
- package/chunks/{Close-C5SGTkPr.js → Close-C6Cw96SJ.js} +1 -1
- package/chunks/{CollectLeadForm-BqjgPYKX.js → CollectLeadForm-DnLKA8qz.js} +13 -13
- package/chunks/{Divider-Cbns9B3Y.js → Divider-BvUimRFw.js} +2 -2
- package/chunks/{Edit-BVP8fCB4.js → Edit-CZ3ni-Ur.js} +4 -4
- package/chunks/{EmojiEvents-D_ObJxNy.js → EmojiEvents-DpmLq98V.js} +1 -1
- package/chunks/{FavoriteBorder-_mUf1vas.js → FavoriteBorder-DUK_DrY4.js} +1 -1
- package/chunks/{FormControl-DLBvX-Sn.js → FormControl-BUItlVIg.js} +3 -3
- package/chunks/{FormLabel-jXtScWTI.js → FormLabel-CeTNPUn7.js} +2 -2
- package/chunks/{Input-Cha_dm3J.js → Input-MJCQcYzo.js} +2 -2
- package/chunks/{KeyboardArrowDown-C_8g8wLS.js → KeyboardArrowDown-SZpn2GhJ.js} +1 -1
- package/chunks/{ModalDialog-Co3jck0z.js → ModalDialog-Cfgv9UAA.js} +2 -2
- package/chunks/{NotFoundSkeleton-D5Jh3lnu.js → NotFoundSkeleton-Cs6DtD9u.js} +13 -12
- package/chunks/{Notification-r1Fm0If2.js → Notification-pcKtlRms.js} +4 -4
- package/chunks/{OverlayApiErrorSkeleton-BUuD0zL8.js → OverlayApiErrorSkeleton-Dl3s5Oaf.js} +20 -19
- package/chunks/{OverlayLeadAfterCollection-B-N1OjPu.js → OverlayLeadAfterCollection-F2TAV9wK.js} +14 -12
- package/chunks/{OverlayScoreStateSkeleton-Bd3-ZNlU.js → OverlayScoreStateSkeleton-LQ0svzeX.js} +3 -3
- package/chunks/{Person-K8GGMiAW.js → Person-BGdniS_p.js} +1 -1
- package/chunks/{PickOneOfX-CvIn7QOd.js → PickOneOfX-Ci4ZJf7G.js} +8 -7
- package/chunks/{Popper-Bti_HOMS.js → Popper-DOVSI4rJ.js} +1 -1
- package/chunks/{Portal-B-nN3a_R.js → Portal-Cs0dgwmH.js} +1 -1
- package/chunks/{index-Btf_jw7-.js → PrizeCard-DF3QxwQJ.js} +0 -1
- package/chunks/{Select-C2QtqgA7.js → Select-BHeTdOYr.js} +3 -3
- package/chunks/{Spinner-D7-MZe2m.js → Spinner-DbUB64Gj.js} +1 -1
- package/chunks/{SplitLeadAfterCollection-CyXBWAIK.js → SplitLeadAfterCollection-DSw6X5fx.js} +36 -34
- package/chunks/{Stack-CU36SsgA.js → Stack-BpHk5eb0.js} +1 -1
- package/chunks/{StandardContentSkeleton-CYduGHsc.js → StandardContentSkeleton-Bae1LLQ_.js} +1 -1
- package/chunks/{Tabs-CA-FqQfT.js → Tabs-hwJ7jsUl.js} +3 -3
- package/chunks/{Textarea-Cn4VvCBl.js → Textarea-zOtMdgc5.js} +3 -3
- package/chunks/{TimerOutlined-DOpryr42.js → TimerOutlined-DWE7f0YX.js} +1 -1
- package/chunks/{helpers-1jFObSvc.js → helpers-NuC1SzL3.js} +1 -1
- package/chunks/index-BaypiKlO.js +4 -0
- package/chunks/{main-Chqd9Wwn.js → main-hB01WcoP.js} +88 -88
- package/chunks/{useEventCallback-CkO2rd5W.js → useEventCallback-CizlfWBo.js} +1 -1
- package/chunks/{useForwardedInput-C3SP2QmS.js → useForwardedInput-RWDntqBU.js} +2 -2
- package/chunks/{useImageVariant-BJ722AFw.js → useImageVariant-Cex1eIqq.js} +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/chunks/index-CyODGG_P.js +0 -4
package/PickThePair.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx as t, jsxs as w, Fragment as J } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import K, { useMemo as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
2
|
+
import { g as Ie, h as se, c as We, l as De } from "./chunks/helpers-NuC1SzL3.js";
|
|
3
|
+
import K, { useMemo as me, useCallback as Le, useEffect as de, useState as G } from "react";
|
|
4
|
+
import { f as ne, i as Z, h as ze, b as ee, a as X, d as ge, B as h, G as ae, c as re, p as Be, T as p, u as ue, e as te, j as ke, l as pe, W as fe, H as Ue, o as Ae, J as $e, K as _e, L as He, M as Oe, N as Ee } from "./chunks/PrizeCard-DF3QxwQJ.js";
|
|
5
|
+
import { S as je } from "./chunks/Spinner-DbUB64Gj.js";
|
|
6
|
+
import { createPortal as Me } from "react-dom";
|
|
7
|
+
import { u as Ne } from "./chunks/useInfoPage-BHdgKdme.js";
|
|
8
|
+
import { N as Ve, S as Ye, O as qe } from "./chunks/NotFoundSkeleton-Cs6DtD9u.js";
|
|
9
|
+
import { C as Xe } from "./chunks/CollectLeadForm-DnLKA8qz.js";
|
|
10
|
+
import { b as he, d as Ge, a as Je } from "./chunks/useImageVariant-Cex1eIqq.js";
|
|
11
|
+
import { T as Qe } from "./chunks/TimerOutlined-DWE7f0YX.js";
|
|
12
12
|
const xe = ({
|
|
13
13
|
sdk: e,
|
|
14
14
|
contentId: n,
|
|
@@ -47,7 +47,7 @@ const xe = ({
|
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
49
|
return /* @__PURE__ */ t(
|
|
50
|
-
|
|
50
|
+
Xe,
|
|
51
51
|
{
|
|
52
52
|
sdk: e,
|
|
53
53
|
content: F,
|
|
@@ -74,7 +74,7 @@ const xe = ({
|
|
|
74
74
|
brandingBorderColor: n,
|
|
75
75
|
state: r
|
|
76
76
|
}) => {
|
|
77
|
-
const c = Z(), i =
|
|
77
|
+
const c = Z(), i = ze(), s = r === "play" ? i : c, l = ee().md, d = n || X().secondaryContainer, o = ge().size + " solid " + d;
|
|
78
78
|
return /* @__PURE__ */ t(
|
|
79
79
|
h,
|
|
80
80
|
{
|
|
@@ -94,7 +94,7 @@ const xe = ({
|
|
|
94
94
|
);
|
|
95
95
|
}, Ke = ({ template: e }) => {
|
|
96
96
|
const { t: n } = ne(), r = /* @__PURE__ */ t(
|
|
97
|
-
|
|
97
|
+
Ve,
|
|
98
98
|
{
|
|
99
99
|
notFoundTitle: n("pickThePair.pickThePairNotFound"),
|
|
100
100
|
notFoundMessage: n("pickThePair.pickThePairNotFoundDescription")
|
|
@@ -102,7 +102,7 @@ const xe = ({
|
|
|
102
102
|
);
|
|
103
103
|
return e === ae.LANDING_PAGE ? r : /* @__PURE__ */ t(we, { brandingBorderColor: null, children: r });
|
|
104
104
|
}, Re = (e) => {
|
|
105
|
-
const n = re().secondary, r =
|
|
105
|
+
const n = re().secondary, r = Be(), c = e.isSplitVariant && r, i = Z(), s = Ie(e.primaryUrl, e.secondaryUrl, "logo");
|
|
106
106
|
if (!e.brandingLogo)
|
|
107
107
|
return null;
|
|
108
108
|
const l = () => {
|
|
@@ -521,7 +521,7 @@ const ve = ({
|
|
|
521
521
|
disabled: o = !1,
|
|
522
522
|
isTimeUp: y = !1
|
|
523
523
|
}) => {
|
|
524
|
-
const g = Z(), u = X(), x =
|
|
524
|
+
const g = Z(), u = X(), x = ue(), b = te(), P = ee().xl, S = ge().size, W = (a == null ? void 0 : a.primary_color) || u.palette.primary.plainColor, R = (a == null ? void 0 : a.content_color) || x.colorSchemes.light.textColor, T = x.colorSchemes.dark.textColor, N = u.palette.success.plainColor, z = u.palette.danger.plainColor, I = et({
|
|
525
525
|
primaryColor: W,
|
|
526
526
|
textColor: R,
|
|
527
527
|
whiteTextColor: T,
|
|
@@ -531,7 +531,7 @@ const ve = ({
|
|
|
531
531
|
spacingScale: b,
|
|
532
532
|
xlBorderRadius: P,
|
|
533
533
|
borderSize: S
|
|
534
|
-
}), U =
|
|
534
|
+
}), U = me(
|
|
535
535
|
() => Fe(e, n),
|
|
536
536
|
[e, n]
|
|
537
537
|
), F = (k) => e.find((f) => f.id === k), $ = (k) => r.some((f) => f.leftId === k), O = (k) => r.some((f) => f.rightId === k), _ = (k, f) => {
|
|
@@ -603,11 +603,11 @@ const ve = ({
|
|
|
603
603
|
transform: "scale(1)"
|
|
604
604
|
}
|
|
605
605
|
}
|
|
606
|
-
}, x =
|
|
606
|
+
}, x = Le(() => {
|
|
607
607
|
const S = e.timer - 1;
|
|
608
608
|
e.onTimeUpdate(S);
|
|
609
609
|
}, [e.onTimeUpdate, e.timer]);
|
|
610
|
-
|
|
610
|
+
de(() => (e.isRunning && (n = setInterval(x, 1e3)), () => {
|
|
611
611
|
n && clearInterval(n);
|
|
612
612
|
}), [e.isRunning, x, e.timer]);
|
|
613
613
|
const b = (S) => {
|
|
@@ -651,7 +651,7 @@ const ve = ({
|
|
|
651
651
|
},
|
|
652
652
|
children: [
|
|
653
653
|
/* @__PURE__ */ t(
|
|
654
|
-
|
|
654
|
+
Qe,
|
|
655
655
|
{
|
|
656
656
|
sx: {
|
|
657
657
|
width: "24px",
|
|
@@ -904,12 +904,12 @@ const ve = ({
|
|
|
904
904
|
images: e.infoPage.images,
|
|
905
905
|
imagePlaceholder: e.defaultImagePlaceholderUrl || ""
|
|
906
906
|
},
|
|
907
|
-
|
|
907
|
+
fe.STANDARD
|
|
908
908
|
), y = c || r && !!o, g = (i == null ? void 0 : i.content_color) || X().textColor, u = re().primary, x = (i == null ? void 0 : i.background_color) || X().surfaceVariant, b = ee().md, P = te(), S = Ze({
|
|
909
909
|
spacingScale: P,
|
|
910
910
|
fontFamilyPrimary: u,
|
|
911
911
|
textColor: g,
|
|
912
|
-
bgcolor:
|
|
912
|
+
bgcolor: se(x || ""),
|
|
913
913
|
mdBorderRadius: b,
|
|
914
914
|
isExtraSmall: y
|
|
915
915
|
}), W = e.matchedPairs.length === e.pairData.pairs.length, R = (M) => {
|
|
@@ -926,7 +926,7 @@ const ve = ({
|
|
|
926
926
|
);
|
|
927
927
|
};
|
|
928
928
|
return /* @__PURE__ */ t(we, { brandingBorderColor: (i == null ? void 0 : i.border_color) || null, children: /* @__PURE__ */ t(
|
|
929
|
-
|
|
929
|
+
Ye,
|
|
930
930
|
{
|
|
931
931
|
entity: {
|
|
932
932
|
...e.infoPage,
|
|
@@ -994,7 +994,7 @@ const ve = ({
|
|
|
994
994
|
totalPairs: e.pairData.pairs.length,
|
|
995
995
|
matchedPairs: e.matchedPairs.length,
|
|
996
996
|
brandingColors: i,
|
|
997
|
-
bgcolor: `rgba(${x ?
|
|
997
|
+
bgcolor: `rgba(${x ? se(x || "").replace(/[^\d,]/g, "") : ""}, 0.5)`
|
|
998
998
|
}
|
|
999
999
|
)
|
|
1000
1000
|
}
|
|
@@ -1419,7 +1419,7 @@ const ve = ({
|
|
|
1419
1419
|
disabled: o = !1,
|
|
1420
1420
|
isTimeUp: y = !1
|
|
1421
1421
|
}) => {
|
|
1422
|
-
const g = Z(), u =
|
|
1422
|
+
const g = Z(), u = ue(), x = X(), b = Ue(), P = te(), S = ee().xl, W = ge().size, R = (a == null ? void 0 : a.primary_color) || x.palette.primary.plainColor, T = (a == null ? void 0 : a.content_color) || u.colorSchemes.light.textColor, N = u.colorSchemes.dark.textColor, z = x.palette.success.plainColor, L = x.palette.danger.plainColor, I = b === "dark" ? "#FFFFFF" : x.onSurface, U = x.surface, F = ot({
|
|
1423
1423
|
primaryColor: R,
|
|
1424
1424
|
textColor: T,
|
|
1425
1425
|
whiteTextColor: N,
|
|
@@ -1431,7 +1431,7 @@ const ve = ({
|
|
|
1431
1431
|
spacingScale: P,
|
|
1432
1432
|
xlBorderRadius: S,
|
|
1433
1433
|
borderSize: W
|
|
1434
|
-
}), $ =
|
|
1434
|
+
}), $ = me(
|
|
1435
1435
|
() => Fe(e, n),
|
|
1436
1436
|
[e, n]
|
|
1437
1437
|
), O = (C) => e.find((m) => m.id === C), _ = (C) => r.some((m) => m.leftId === C), k = (C) => r.some((m) => m.rightId === C), f = (C, m) => {
|
|
@@ -1513,12 +1513,12 @@ const ve = ({
|
|
|
1513
1513
|
images: e.infoPage.images,
|
|
1514
1514
|
imagePlaceholder: e.defaultImagePlaceholderUrl || ""
|
|
1515
1515
|
},
|
|
1516
|
-
|
|
1516
|
+
fe.STANDARD
|
|
1517
1517
|
), s = e.matchedPairs.length === e.pairData.pairs.length, l = X(), d = (c == null ? void 0 : c.content_color) || l.textColor, a = re().primary, o = (c == null ? void 0 : c.background_color) || l.surfaceVariant, y = ee().md, g = (c == null ? void 0 : c.primary_color) || l.palette.primary.plainColor, u = te(), x = l.surface, b = it({
|
|
1518
1518
|
spacingScale: u,
|
|
1519
1519
|
fontFamilyPrimary: a,
|
|
1520
1520
|
textColor: d,
|
|
1521
|
-
bgcolor:
|
|
1521
|
+
bgcolor: se(o || ""),
|
|
1522
1522
|
mdBorderRadius: y,
|
|
1523
1523
|
primaryColor: g,
|
|
1524
1524
|
mobile: r,
|
|
@@ -1734,12 +1734,12 @@ const ve = ({
|
|
|
1734
1734
|
}
|
|
1735
1735
|
}), ct = (e) => {
|
|
1736
1736
|
var $, O, _, k, f, C, m, v, H, A, E, V;
|
|
1737
|
-
const [n, r] = K.useState(!1), c = te(), i =
|
|
1737
|
+
const [n, r] = K.useState(!1), c = te(), i = ue(), { t: s } = ne(), l = Z(), d = pe(), { brandingImage: a, brandingColors: o, brandingLogo: y } = We(e.infoPage.branding || null), g = e.defaultImagePlaceholderUrl ? e.defaultImagePlaceholderUrl : l ? Ge : Je, u = a || he(
|
|
1738
1738
|
{
|
|
1739
1739
|
images: e.infoPage.images,
|
|
1740
1740
|
imagePlaceholder: g
|
|
1741
1741
|
},
|
|
1742
|
-
|
|
1742
|
+
fe.OVERLAY
|
|
1743
1743
|
), x = i.customRadius.dark.md, b = (o == null ? void 0 : o.background_color) || ((O = ($ = i.colorSchemes) == null ? void 0 : $.dark) == null ? void 0 : O.surfaceVariant), P = (k = (_ = i.customRadius) == null ? void 0 : _.light) == null ? void 0 : k.xl, S = (o == null ? void 0 : o.primary_color) || ((v = (m = (C = (f = i.colorSchemes) == null ? void 0 : f.light) == null ? void 0 : C.palette) == null ? void 0 : m.primary) == null ? void 0 : v.plainColor), W = (V = (E = (A = (H = i.colorSchemes) == null ? void 0 : H.light) == null ? void 0 : A.palette) == null ? void 0 : E.primary) == null ? void 0 : V.onPrimary, R = i.customFontFamily.dark.primary, T = i.colorSchemes.dark.textColor, N = (o == null ? void 0 : o.content_color) || i.colorSchemes.dark.textColor, L = rt({
|
|
1744
1744
|
spacingScale: c,
|
|
1745
1745
|
mdBorderRadius: x,
|
|
@@ -1873,7 +1873,7 @@ const ve = ({
|
|
|
1873
1873
|
] }) });
|
|
1874
1874
|
};
|
|
1875
1875
|
return /* @__PURE__ */ t(
|
|
1876
|
-
|
|
1876
|
+
qe,
|
|
1877
1877
|
{
|
|
1878
1878
|
entity: {
|
|
1879
1879
|
...e.infoPage,
|
|
@@ -1887,9 +1887,9 @@ const ve = ({
|
|
|
1887
1887
|
}
|
|
1888
1888
|
);
|
|
1889
1889
|
}, st = (e) => {
|
|
1890
|
-
const [n, r] = G([]), [c, i] = G(null), [s, l] = G(null), [d, a] = G(!1), [o, y] = G(0), [g, u] = G(!1), [x, b] = G(!1), [P, S] = G(0), [W, R] = G(0), { infoPage: T } =
|
|
1890
|
+
const [n, r] = G([]), [c, i] = G(null), [s, l] = G(null), [d, a] = G(!1), [o, y] = G(0), [g, u] = G(!1), [x, b] = G(!1), [P, S] = G(0), [W, R] = G(0), { infoPage: T } = Ne(e.entityId, "pick-the-pair", e.sdk), N = () => {
|
|
1891
1891
|
if (T && T.id !== "not-found") {
|
|
1892
|
-
const f = Object.keys(
|
|
1892
|
+
const f = Object.keys(De);
|
|
1893
1893
|
if (T.language && f.includes(T.language))
|
|
1894
1894
|
return T.language;
|
|
1895
1895
|
if (T.language)
|
|
@@ -1897,11 +1897,11 @@ const ve = ({
|
|
|
1897
1897
|
}
|
|
1898
1898
|
return e.language || "en";
|
|
1899
1899
|
};
|
|
1900
|
-
|
|
1900
|
+
de(() => {
|
|
1901
1901
|
const f = N();
|
|
1902
|
-
|
|
1902
|
+
Ae(f);
|
|
1903
1903
|
}, [e.language, T]);
|
|
1904
|
-
const z =
|
|
1904
|
+
const z = me(() => {
|
|
1905
1905
|
if (!T || T.id === "not-found")
|
|
1906
1906
|
return {
|
|
1907
1907
|
pairs: [],
|
|
@@ -1926,12 +1926,12 @@ const ve = ({
|
|
|
1926
1926
|
};
|
|
1927
1927
|
}
|
|
1928
1928
|
}, [T]);
|
|
1929
|
-
|
|
1929
|
+
de(() => {
|
|
1930
1930
|
z.config.timeLimit && z.config.timeLimit > 0 && (y(z.config.timeLimit), u(!0));
|
|
1931
1931
|
}, [z.config.timeLimit]);
|
|
1932
1932
|
const L = z.config.mode.toLowerCase() === "challenge", I = n.length, U = P > 0 ? I / P * 100 : 0, F = U >= z.config.successThresholdPercent;
|
|
1933
1933
|
if (!T)
|
|
1934
|
-
return /* @__PURE__ */ t(
|
|
1934
|
+
return /* @__PURE__ */ t(je, { my: 20 });
|
|
1935
1935
|
if (T.id === "not-found")
|
|
1936
1936
|
return /* @__PURE__ */ t(Ke, { template: e.template });
|
|
1937
1937
|
const $ = (f) => {
|
|
@@ -2055,7 +2055,7 @@ const ve = ({
|
|
|
2055
2055
|
if (i.current)
|
|
2056
2056
|
return i.current.shadowRoot ? (s.current = i.current.shadowRoot, l.current = s.current.getElementById(
|
|
2057
2057
|
c.current
|
|
2058
|
-
), l.current || (l.current = document.createElement("div"), l.current.id = c.current, s.current.appendChild(l.current))) : (s.current = i.current.attachShadow({ mode: "open" }), l.current = document.createElement("div"), l.current.id = c.current, s.current.appendChild(l.current)), d.current || (d.current =
|
|
2058
|
+
), l.current || (l.current = document.createElement("div"), l.current.id = c.current, s.current.appendChild(l.current))) : (s.current = i.current.attachShadow({ mode: "open" }), l.current = document.createElement("div"), l.current.id = c.current, s.current.appendChild(l.current)), d.current || (d.current = $e({
|
|
2059
2059
|
key: "pick-the-pair-css",
|
|
2060
2060
|
prepend: !0,
|
|
2061
2061
|
container: s.current
|
|
@@ -2066,15 +2066,15 @@ const ve = ({
|
|
|
2066
2066
|
const a = e.themeOptions, o = {
|
|
2067
2067
|
...a,
|
|
2068
2068
|
mode: e.template === ae.OVERLAY ? "dark" : a == null ? void 0 : a.mode
|
|
2069
|
-
}, y = /* @__PURE__ */ t(h, { ref: i }), g = n && i.current && l.current && d.current ?
|
|
2070
|
-
/* @__PURE__ */ t(
|
|
2071
|
-
|
|
2069
|
+
}, y = /* @__PURE__ */ t(h, { ref: i }), g = n && i.current && l.current && d.current ? Me(
|
|
2070
|
+
/* @__PURE__ */ t(_e, { value: d.current, children: /* @__PURE__ */ t(He, { containerRef: i, children: /* @__PURE__ */ t(
|
|
2071
|
+
Oe,
|
|
2072
2072
|
{
|
|
2073
2073
|
customTheme: o,
|
|
2074
2074
|
mode: o == null ? void 0 : o.mode,
|
|
2075
2075
|
shadowRootElement: l.current,
|
|
2076
2076
|
children: /* @__PURE__ */ t(
|
|
2077
|
-
|
|
2077
|
+
Ee,
|
|
2078
2078
|
{
|
|
2079
2079
|
shadowRootElement: l.current,
|
|
2080
2080
|
leadPhoneCountryCode: ((u = e.leads) == null ? void 0 : u.phoneCountryCode) || null,
|
package/PollVote.js
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import { jsxs as x, Fragment as B, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { C as
|
|
9
|
-
import {
|
|
2
|
+
import Ie, { useState as J, useEffect as Me, useMemo as Xe } from "react";
|
|
3
|
+
import { i as G, u as Z, e as ee, c as _, b as Y, a as F, n as Be, W as V, B as l, T as h, p as ot, f as N, d as je, g as Te, C as Ae, h as ze, j as p, l as at, m as rt, q as ct, o as st } from "./chunks/PrizeCard-DF3QxwQJ.js";
|
|
4
|
+
import { P as dt } from "./chunks/Portal-Cs0dgwmH.js";
|
|
5
|
+
import "react-dom";
|
|
6
|
+
import { h as Ce, s as He, g as gt, e as We, a as tt, b as mt } from "./chunks/helpers-NuC1SzL3.js";
|
|
7
|
+
import { S as ut } from "./chunks/Spinner-DbUB64Gj.js";
|
|
8
|
+
import { S as ft, a as xt, b as nt, C as Ze, c as et } from "./chunks/ChanceGameEmbedVariant-DqFg4YKU.js";
|
|
9
|
+
import { n as yt, c as ht } from "./chunks/index-D1K1OB4p.js";
|
|
10
|
+
import { R as Ee, A as Ue, O as bt, S as Ct, N as St } from "./chunks/NotFoundSkeleton-Cs6DtD9u.js";
|
|
11
|
+
import { d as he, a as be, b as ie } from "./chunks/useImageVariant-Cex1eIqq.js";
|
|
10
12
|
import { u as Oe } from "./chunks/useEmbedCode-DCWnWGak.js";
|
|
11
|
-
import {
|
|
12
|
-
import { A as Ne, R as pe, O as lt, S as it } from "./chunks/OverlayApiErrorSkeleton-
|
|
13
|
-
import { C as
|
|
14
|
-
import { A as
|
|
15
|
-
import { S as
|
|
16
|
-
import { O as
|
|
17
|
-
import { S as
|
|
18
|
-
import { S as
|
|
19
|
-
import { P as zt } from "./chunks/Portal-B-nN3a_R.js";
|
|
13
|
+
import { C as It } from "./chunks/CollectLeadForm-DnLKA8qz.js";
|
|
14
|
+
import { A as Ne, R as pe, O as lt, S as it } from "./chunks/OverlayApiErrorSkeleton-Dl3s5Oaf.js";
|
|
15
|
+
import { C as Tt } from "./chunks/CheckCircle-CV9iMpkZ.js";
|
|
16
|
+
import { A as At, I as Pt, W as kt } from "./chunks/AlertMessage-Ds45MBHB.js";
|
|
17
|
+
import { S as vt } from "./chunks/Stack-BpHk5eb0.js";
|
|
18
|
+
import { O as Ft } from "./chunks/OverlayScoreStateSkeleton-LQ0svzeX.js";
|
|
19
|
+
import { S as Dt, O as Rt, a as Lt, b as wt } from "./chunks/OverlayLeadAfterCollection-F2TAV9wK.js";
|
|
20
|
+
import { S as Bt, a as zt } from "./chunks/SplitLeadAfterCollection-DSw6X5fx.js";
|
|
20
21
|
const Wt = (e) => {
|
|
21
22
|
var n, o, i;
|
|
22
23
|
return {
|
|
@@ -353,17 +354,17 @@ const Wt = (e) => {
|
|
|
353
354
|
const c = await n.voting.getPollById(e, !0);
|
|
354
355
|
i(c);
|
|
355
356
|
} catch (c) {
|
|
356
|
-
console.error(c), i(new
|
|
357
|
+
console.error(c), i(new yt());
|
|
357
358
|
}
|
|
358
359
|
};
|
|
359
|
-
return
|
|
360
|
+
return Me(() => (s(), () => i(null)), [e, n]), { poll: o, setPoll: i };
|
|
360
361
|
}, Ut = (e, n, o) => {
|
|
361
362
|
const [i, s] = J(null), [c, r] = J(!1), [f, m] = J(!1), [y, d] = J(""), g = async () => {
|
|
362
363
|
try {
|
|
363
364
|
const k = await n.voting.getMyPollVote(e);
|
|
364
365
|
s(k);
|
|
365
366
|
} catch (u) {
|
|
366
|
-
if (s(new
|
|
367
|
+
if (s(new ht()), n.helpers.getSDKConfiguration().errorHandlingMode === "standard") {
|
|
367
368
|
const a = u;
|
|
368
369
|
if (a.error.code === 404)
|
|
369
370
|
return;
|
|
@@ -384,7 +385,7 @@ const Wt = (e) => {
|
|
|
384
385
|
m(!0), d(I.data.error.message);
|
|
385
386
|
}
|
|
386
387
|
};
|
|
387
|
-
return
|
|
388
|
+
return Me(() => (g(), () => {
|
|
388
389
|
s(null), r(!1), m(!1);
|
|
389
390
|
}), [e, n, o]), {
|
|
390
391
|
myVote: i,
|
|
@@ -397,7 +398,7 @@ const Wt = (e) => {
|
|
|
397
398
|
setApiErrorMessage: d
|
|
398
399
|
};
|
|
399
400
|
}, $ = (e) => {
|
|
400
|
-
const n = _().secondary, o = ot(), i = e.isSplitVariant && o, s = G(), c =
|
|
401
|
+
const n = _().secondary, o = ot(), i = e.isSplitVariant && o, s = G(), c = gt(e.primaryUrl, e.secondaryUrl, "logo");
|
|
401
402
|
if (!e.brandingLogo)
|
|
402
403
|
return null;
|
|
403
404
|
const r = () => {
|
|
@@ -525,7 +526,7 @@ const Wt = (e) => {
|
|
|
525
526
|
onClick: f
|
|
526
527
|
};
|
|
527
528
|
return /* @__PURE__ */ t(
|
|
528
|
-
|
|
529
|
+
It,
|
|
529
530
|
{
|
|
530
531
|
sdk: e,
|
|
531
532
|
content: {
|
|
@@ -657,7 +658,7 @@ const Wt = (e) => {
|
|
|
657
658
|
}
|
|
658
659
|
}), qe = (e) => {
|
|
659
660
|
var b;
|
|
660
|
-
const n = Z(), o = F(), i = Y().sm, s = _().primary, c = Y().xs, r = ee(), f =
|
|
661
|
+
const n = Z(), o = F(), i = Y().sm, s = _().primary, c = Y().xs, r = ee(), f = je().size, m = Oe(e.option.embedCode || ""), y = !!e.option.embedCode, d = ((b = e.brandingColors) == null ? void 0 : b.primaryColor) || o.palette.primary.plainColor, g = o.palette.primary.onPrimary, u = e.selectedOptions.includes(e.option.id) ? g : n.colorSchemes.light.textColor, k = e.optionsImages.get(e.option.id), I = () => {
|
|
661
662
|
e.multipleChoice ? e.answerPoll([e.option.id]) : e.answerPoll([e.option.id]);
|
|
662
663
|
}, a = e.selectedOptions.includes(e.option.id), A = e.isVoting || e.multipleChoice && !a && e.selectedOptions.length >= (e.maxChoices || 1), S = () => y ? /* @__PURE__ */ x(B, { children: [
|
|
663
664
|
/* @__PURE__ */ t(
|
|
@@ -1036,7 +1037,7 @@ const Wt = (e) => {
|
|
|
1036
1037
|
brandingBorderColor: n,
|
|
1037
1038
|
state: o
|
|
1038
1039
|
}) => {
|
|
1039
|
-
const i = G(), s = ze(), c = o === "play" ? s : i, r = Y().md, f = n || F().secondaryContainer, y =
|
|
1040
|
+
const i = G(), s = ze(), c = o === "play" ? s : i, r = Y().md, f = n || F().secondaryContainer, y = je().size + " solid " + f;
|
|
1040
1041
|
return /* @__PURE__ */ t(
|
|
1041
1042
|
l,
|
|
1042
1043
|
{
|
|
@@ -1642,7 +1643,7 @@ const Wt = (e) => {
|
|
|
1642
1643
|
state: "play",
|
|
1643
1644
|
children: [
|
|
1644
1645
|
/* @__PURE__ */ t(
|
|
1645
|
-
|
|
1646
|
+
ft,
|
|
1646
1647
|
{
|
|
1647
1648
|
entity: { ...e.poll, type: "poll" },
|
|
1648
1649
|
headline: d("poll.headline"),
|
|
@@ -1787,7 +1788,7 @@ const Wt = (e) => {
|
|
|
1787
1788
|
}
|
|
1788
1789
|
);
|
|
1789
1790
|
}, Gt = (e) => {
|
|
1790
|
-
const n = Y(), o = G(), i =
|
|
1791
|
+
const n = Y(), o = G(), i = je().size, s = F(), c = _(), r = s.palette.primary.plainColor, f = s.textPrimary, m = s.textSecondary, y = s.secondaryContainer, d = s.surface, g = s.onSurface, u = `rgba(${Ce(s.surfaceVariant)}, 0.5)`;
|
|
1791
1792
|
return {
|
|
1792
1793
|
// Question area
|
|
1793
1794
|
questionArea: {
|
|
@@ -1940,11 +1941,11 @@ const Wt = (e) => {
|
|
|
1940
1941
|
}, Nt = (e, n) => {
|
|
1941
1942
|
switch (e) {
|
|
1942
1943
|
case "success":
|
|
1943
|
-
return /* @__PURE__ */ t(
|
|
1944
|
+
return /* @__PURE__ */ t(Tt, {});
|
|
1944
1945
|
case "error":
|
|
1945
|
-
return /* @__PURE__ */ t(
|
|
1946
|
+
return /* @__PURE__ */ t(kt, { sx: { color: n } });
|
|
1946
1947
|
case "info":
|
|
1947
|
-
return /* @__PURE__ */ t(
|
|
1948
|
+
return /* @__PURE__ */ t(Pt, {});
|
|
1948
1949
|
}
|
|
1949
1950
|
}, pt = (e) => {
|
|
1950
1951
|
switch (e) {
|
|
@@ -1963,7 +1964,7 @@ const Wt = (e) => {
|
|
|
1963
1964
|
}) => {
|
|
1964
1965
|
const s = Z(), c = Y(), r = _().secondary, f = pt(e);
|
|
1965
1966
|
return /* @__PURE__ */ t(
|
|
1966
|
-
|
|
1967
|
+
At,
|
|
1967
1968
|
{
|
|
1968
1969
|
variant: "soft",
|
|
1969
1970
|
color: f,
|
|
@@ -1978,7 +1979,7 @@ const Wt = (e) => {
|
|
|
1978
1979
|
"--Icon-fontSize": "1.25em"
|
|
1979
1980
|
},
|
|
1980
1981
|
children: /* @__PURE__ */ x(
|
|
1981
|
-
|
|
1982
|
+
vt,
|
|
1982
1983
|
{
|
|
1983
1984
|
sx: {
|
|
1984
1985
|
fontSize: "1.5em"
|
|
@@ -2020,7 +2021,7 @@ const Wt = (e) => {
|
|
|
2020
2021
|
}), "People"), $e = (e) => {
|
|
2021
2022
|
var S;
|
|
2022
2023
|
const [n, o] = J(0), i = Z(), s = F(), c = Y().sm, r = _(), f = Y().xs, m = ee(), y = e.optionsImages.get(e.option.id), d = e.selectedOptions.includes(e.option.id), g = ((S = e.brandingColors) == null ? void 0 : S.primaryColor) || s.palette.primary.plainColor, u = s.palette.primary.onPrimary, k = d ? u : i.colorSchemes.light.textColor, I = e.option.votes, a = e.totalVotes > 0 ? I / e.totalVotes * 100 : 0;
|
|
2023
|
-
|
|
2024
|
+
Me(() => {
|
|
2024
2025
|
const b = setTimeout(() => {
|
|
2025
2026
|
o(a);
|
|
2026
2027
|
}, 100);
|
|
@@ -2262,7 +2263,7 @@ const Wt = (e) => {
|
|
|
2262
2263
|
e.option.id
|
|
2263
2264
|
);
|
|
2264
2265
|
}, Ke = (e) => {
|
|
2265
|
-
const { t: n } = N(), o = ee(), i = F(), s = _(), c =
|
|
2266
|
+
const { t: n } = N(), o = ee(), i = F(), s = _(), c = je().size, f = e.options.reduce((m, y) => m + (y.votes || 0), 0);
|
|
2266
2267
|
if (e.optionsLayout === "twoByTwo") {
|
|
2267
2268
|
const m = [];
|
|
2268
2269
|
for (let y = 0; y < e.options.length; y += 2) {
|
|
@@ -2784,7 +2785,7 @@ const Wt = (e) => {
|
|
|
2784
2785
|
}
|
|
2785
2786
|
) : null;
|
|
2786
2787
|
return /* @__PURE__ */ t(
|
|
2787
|
-
|
|
2788
|
+
xt,
|
|
2788
2789
|
{
|
|
2789
2790
|
entity: e.poll,
|
|
2790
2791
|
headline: m("poll.headline"),
|
|
@@ -3063,7 +3064,7 @@ const Wt = (e) => {
|
|
|
3063
3064
|
imagePlaceholder: d
|
|
3064
3065
|
},
|
|
3065
3066
|
V.OVERLAY
|
|
3066
|
-
), u =
|
|
3067
|
+
), u = tt(g), k = ke(e.poll.options), I = (m == null ? void 0 : m.secondaryColor) || n.colorSchemes.dark.textSecondary, a = n.colorSchemes.dark.secondaryContainer, A = n.colorSchemes.dark.textPrimary, S = n.customFontFamily.light.primary, b = n.customRadius.light.md, P = n.customRadius.light.xl, D = (m == null ? void 0 : m.backgroundColor) || n.colorSchemes.dark.surfaceVariant, T = Qt({
|
|
3067
3068
|
spacingScale: o,
|
|
3068
3069
|
secondaryColor: I,
|
|
3069
3070
|
secondaryContainer: a,
|
|
@@ -3125,7 +3126,7 @@ const Wt = (e) => {
|
|
|
3125
3126
|
] });
|
|
3126
3127
|
};
|
|
3127
3128
|
return /* @__PURE__ */ t(
|
|
3128
|
-
|
|
3129
|
+
Ft,
|
|
3129
3130
|
{
|
|
3130
3131
|
entity: e.poll,
|
|
3131
3132
|
headline: i("poll.headline"),
|
|
@@ -3182,7 +3183,7 @@ const Wt = (e) => {
|
|
|
3182
3183
|
defaultImagePlaceholderUrl: i || (r ? he : be)
|
|
3183
3184
|
}
|
|
3184
3185
|
) : n === V.SPLIT ? /* @__PURE__ */ t(X, { brandingBorderColor: (f == null ? void 0 : f.borderColor) || null, children: /* @__PURE__ */ t(
|
|
3185
|
-
|
|
3186
|
+
nt,
|
|
3186
3187
|
{
|
|
3187
3188
|
...d,
|
|
3188
3189
|
defaultImagePlaceholderUrl: i
|
|
@@ -3227,7 +3228,7 @@ const Wt = (e) => {
|
|
|
3227
3228
|
var c, r, f, m;
|
|
3228
3229
|
const n = G(), { t: o } = N(), i = ((c = e.poll.branding) == null ? void 0 : c.colors) || null, s = n ? ((r = e.poll.branding) == null ? void 0 : r.images.mobileLogo) || ((f = e.poll.branding) == null ? void 0 : f.images.mainLogo) || "" : ((m = e.poll.branding) == null ? void 0 : m.images.mainLogo) || "";
|
|
3229
3230
|
return console.log("defaultImagePlaceholderUrl", e.defaultImagePlaceholderUrl), /* @__PURE__ */ t(X, { brandingBorderColor: (i == null ? void 0 : i.borderColor) || null, children: /* @__PURE__ */ t(
|
|
3230
|
-
|
|
3231
|
+
nt,
|
|
3231
3232
|
{
|
|
3232
3233
|
entity: e.poll,
|
|
3233
3234
|
headline: o("poll.headline"),
|
|
@@ -3613,7 +3614,7 @@ const Wt = (e) => {
|
|
|
3613
3614
|
);
|
|
3614
3615
|
};
|
|
3615
3616
|
return /* @__PURE__ */ t(X, { brandingBorderColor: (n == null ? void 0 : n.borderColor) || null, children: /* @__PURE__ */ t(
|
|
3616
|
-
|
|
3617
|
+
Dt,
|
|
3617
3618
|
{
|
|
3618
3619
|
entity: e.poll,
|
|
3619
3620
|
headline: A("poll.headline"),
|
|
@@ -3759,7 +3760,7 @@ const Wt = (e) => {
|
|
|
3759
3760
|
);
|
|
3760
3761
|
};
|
|
3761
3762
|
return /* @__PURE__ */ t(X, { brandingBorderColor: (r == null ? void 0 : r.borderColor) || null, children: /* @__PURE__ */ t(
|
|
3762
|
-
|
|
3763
|
+
Bt,
|
|
3763
3764
|
{
|
|
3764
3765
|
entity: e.poll,
|
|
3765
3766
|
headline: c("poll.headline"),
|
|
@@ -3824,7 +3825,7 @@ const Wt = (e) => {
|
|
|
3824
3825
|
imagePlaceholder: m
|
|
3825
3826
|
},
|
|
3826
3827
|
V.OVERLAY
|
|
3827
|
-
), d =
|
|
3828
|
+
), d = tt(y), g = (b = (S = n.customRadius) == null ? void 0 : S.light) == null ? void 0 : b.xl, u = (r == null ? void 0 : r.primaryColor) || ((C = (T = (D = (P = n.colorSchemes) == null ? void 0 : P.light) == null ? void 0 : D.palette) == null ? void 0 : T.primary) == null ? void 0 : C.plainColor), k = (H = (v = (R = (z = n.colorSchemes) == null ? void 0 : z.light) == null ? void 0 : R.palette) == null ? void 0 : v.primary) == null ? void 0 : H.onPrimary, I = n.customFontFamily.dark.primary, a = cn({
|
|
3828
3829
|
buttonRadius: g,
|
|
3829
3830
|
primaryColor: u,
|
|
3830
3831
|
onPrimaryColor: k,
|
|
@@ -3895,7 +3896,7 @@ const Wt = (e) => {
|
|
|
3895
3896
|
);
|
|
3896
3897
|
};
|
|
3897
3898
|
return /* @__PURE__ */ t(
|
|
3898
|
-
|
|
3899
|
+
Rt,
|
|
3899
3900
|
{
|
|
3900
3901
|
entity: e.poll,
|
|
3901
3902
|
headline: o("poll.headline"),
|
|
@@ -3916,7 +3917,7 @@ const Wt = (e) => {
|
|
|
3916
3917
|
}, dn = (e) => {
|
|
3917
3918
|
const { t: n } = N();
|
|
3918
3919
|
return /* @__PURE__ */ t(
|
|
3919
|
-
|
|
3920
|
+
Lt,
|
|
3920
3921
|
{
|
|
3921
3922
|
entity: e.poll,
|
|
3922
3923
|
headline: n("poll.headline"),
|
|
@@ -3934,7 +3935,7 @@ const Wt = (e) => {
|
|
|
3934
3935
|
}, gn = (e) => {
|
|
3935
3936
|
const { t: n } = N();
|
|
3936
3937
|
return /* @__PURE__ */ t(
|
|
3937
|
-
|
|
3938
|
+
zt,
|
|
3938
3939
|
{
|
|
3939
3940
|
entity: e.poll,
|
|
3940
3941
|
headline: n("poll.headline"),
|
|
@@ -3951,7 +3952,7 @@ const Wt = (e) => {
|
|
|
3951
3952
|
}, mn = (e) => {
|
|
3952
3953
|
const { t: n } = N();
|
|
3953
3954
|
return /* @__PURE__ */ t(
|
|
3954
|
-
|
|
3955
|
+
wt,
|
|
3955
3956
|
{
|
|
3956
3957
|
entity: e.poll,
|
|
3957
3958
|
headline: n("poll.headline"),
|
|
@@ -3978,11 +3979,11 @@ const un = (e) => {
|
|
|
3978
3979
|
setIsApiError: C,
|
|
3979
3980
|
setApiErrorMessage: z,
|
|
3980
3981
|
setIsUnauthorized: R
|
|
3981
|
-
} = Ut(e.entityId, e.sdk, f), v =
|
|
3982
|
-
if (
|
|
3982
|
+
} = Ut(e.entityId, e.sdk, f), v = Xe(() => !a || !S || !(S != null && S.id) || a.maxAttempts === -1 || a.maxAttempts === null || S.attempts === null ? !1 : (a == null ? void 0 : a.maxAttempts) <= (S == null ? void 0 : S.attempts), [a, S]), H = Xe(() => a ? mt(a.related) : null, [a]);
|
|
3983
|
+
if (Me(() => {
|
|
3983
3984
|
st(e.language || "en");
|
|
3984
3985
|
}, [e.language]), !a || !S)
|
|
3985
|
-
return /* @__PURE__ */ t(
|
|
3986
|
+
return /* @__PURE__ */ t(ut, { my: 20 });
|
|
3986
3987
|
if (!a.id)
|
|
3987
3988
|
return /* @__PURE__ */ t(Xt, {});
|
|
3988
3989
|
if (a.status !== "ACTIVE")
|
|
@@ -4180,7 +4181,7 @@ const un = (e) => {
|
|
|
4180
4181
|
}
|
|
4181
4182
|
);
|
|
4182
4183
|
if (i || v) {
|
|
4183
|
-
const j = H ? /* @__PURE__ */ t(
|
|
4184
|
+
const j = H ? /* @__PURE__ */ t(Ze, { entityId: H, sdk: e.sdk, children: (w) => /* @__PURE__ */ t(et, { infoPage: w, variant: e.chanceGameVariant }) }) : void 0, q = H ? /* @__PURE__ */ t(Ze, { entityId: H, sdk: e.sdk, children: (w) => /* @__PURE__ */ t(et, { infoPage: w, variant: e.chanceGameVariant, forceMobile: !0 }) }) : void 0;
|
|
4184
4185
|
return e.template === V.OVERLAY ? /* @__PURE__ */ t(
|
|
4185
4186
|
Jt,
|
|
4186
4187
|
{
|
|
@@ -4230,7 +4231,7 @@ const un = (e) => {
|
|
|
4230
4231
|
);
|
|
4231
4232
|
}
|
|
4232
4233
|
return Q();
|
|
4233
|
-
}, fn = (e) => /* @__PURE__ */ t(
|
|
4234
|
+
}, fn = (e) => /* @__PURE__ */ t(dt, { packageName: "poll-vote", ...e, children: /* @__PURE__ */ t(un, { ...e }) }), Vn = fn;
|
|
4234
4235
|
export {
|
|
4235
|
-
|
|
4236
|
+
Vn as PollVote
|
|
4236
4237
|
};
|