pollcatch 2.5.0 → 2.5.1
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/package.json +1 -1
- package/pc.js +133 -125
package/package.json
CHANGED
package/pc.js
CHANGED
|
@@ -499,8 +499,8 @@ class po {
|
|
|
499
499
|
it(this, t);
|
|
500
500
|
}
|
|
501
501
|
}
|
|
502
|
-
const
|
|
503
|
-
|
|
502
|
+
const Dt = ut.litHtmlPolyfillSupport;
|
|
503
|
+
Dt == null || Dt(Ft, vt), (ut.litHtmlVersions ?? (ut.litHtmlVersions = [])).push("3.2.1");
|
|
504
504
|
const uo = (e, t, o) => {
|
|
505
505
|
const r = (o == null ? void 0 : o.renderBefore) ?? t;
|
|
506
506
|
let s = r._$litPart$;
|
|
@@ -542,8 +542,8 @@ let R = class extends rt {
|
|
|
542
542
|
};
|
|
543
543
|
var Ae;
|
|
544
544
|
R._$litElement$ = !0, R.finalized = !0, (Ae = globalThis.litElementHydrateSupport) == null || Ae.call(globalThis, { LitElement: R });
|
|
545
|
-
const
|
|
546
|
-
|
|
545
|
+
const Nt = globalThis.litElementPolyfillSupport;
|
|
546
|
+
Nt == null || Nt({ LitElement: R });
|
|
547
547
|
(globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.1.1");
|
|
548
548
|
/**
|
|
549
549
|
* @license
|
|
@@ -690,10 +690,10 @@ var mo = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, L = function(e) {
|
|
|
690
690
|
}, vo = /^#([0-9a-f]{3,8})$/i, xt = function(e) {
|
|
691
691
|
var t = e.toString(16);
|
|
692
692
|
return t.length < 2 ? "0" + t : t;
|
|
693
|
-
},
|
|
693
|
+
}, De = function(e) {
|
|
694
694
|
var t = e.r, o = e.g, r = e.b, s = e.a, i = Math.max(t, o, r), a = i - Math.min(t, o, r), l = a ? i === t ? (o - r) / a : i === o ? 2 + (r - t) / a : 4 + (t - o) / a : 0;
|
|
695
695
|
return { h: 60 * (l < 0 ? l + 6 : l), s: i ? a / i * 100 : 0, v: i / 255 * 100, a: s };
|
|
696
|
-
},
|
|
696
|
+
}, Ne = function(e) {
|
|
697
697
|
var t = e.h, o = e.s, r = e.v, s = e.a;
|
|
698
698
|
t = t / 360 * 6, o /= 100, r /= 100;
|
|
699
699
|
var i = Math.floor(t), a = r * (1 - o), l = r * (1 - (t - i) * o), n = r * (1 - (1 - t + i) * o), d = i % 6;
|
|
@@ -703,10 +703,10 @@ var mo = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, L = function(e) {
|
|
|
703
703
|
}, ge = function(e) {
|
|
704
704
|
return { h: C(e.h), s: C(e.s), l: C(e.l), a: C(e.a, 3) };
|
|
705
705
|
}, me = function(e) {
|
|
706
|
-
return
|
|
706
|
+
return Ne((o = (t = e).s, { h: t.h, s: (o *= ((r = t.l) < 50 ? r : 100 - r) / 100) > 0 ? 2 * o / (r + o) * 100 : 0, v: r + o, a: t.a }));
|
|
707
707
|
var t, o, r;
|
|
708
708
|
}, ht = function(e) {
|
|
709
|
-
return { h: (t =
|
|
709
|
+
return { h: (t = De(e)).h, s: (s = (200 - (o = t.s)) * (r = t.v) / 100) > 0 && s < 200 ? o * r / 100 / (s <= 100 ? s : 200 - s) * 100 : 0, l: s / 2, a: t.a };
|
|
710
710
|
var t, o, r, s;
|
|
711
711
|
}, bo = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, yo = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, wo = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, xo = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, ve = { string: [[function(e) {
|
|
712
712
|
var t = vo.exec(e);
|
|
@@ -733,7 +733,7 @@ var mo = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, L = function(e) {
|
|
|
733
733
|
var a = function(l) {
|
|
734
734
|
return { h: Le(l.h), s: T(l.s, 0, 100), v: T(l.v, 0, 100), a: T(l.a) };
|
|
735
735
|
}({ h: Number(t), s: Number(o), v: Number(r), a: Number(i) });
|
|
736
|
-
return
|
|
736
|
+
return Ne(a);
|
|
737
737
|
}, "hsv"]] }, be = function(e, t) {
|
|
738
738
|
for (var o = 0; o < t.length; o++) {
|
|
739
739
|
var r = t[o][0](e);
|
|
@@ -776,7 +776,7 @@ var mo = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, L = function(e) {
|
|
|
776
776
|
return t = ge(ht(this.rgba)), o = t.h, r = t.s, s = t.l, (i = t.a) < 1 ? "hsla(" + o + ", " + r + "%, " + s + "%, " + i + ")" : "hsl(" + o + ", " + r + "%, " + s + "%)";
|
|
777
777
|
var t, o, r, s, i;
|
|
778
778
|
}, e.prototype.toHsv = function() {
|
|
779
|
-
return t =
|
|
779
|
+
return t = De(this.rgba), { h: C(t.h), s: C(t.s), v: C(t.v), a: C(t.a, 3) };
|
|
780
780
|
var t;
|
|
781
781
|
}, e.prototype.invert = function() {
|
|
782
782
|
return O({ r: 255 - (t = this.rgba).r, g: 255 - t.g, b: 255 - t.b, a: t.a });
|
|
@@ -805,26 +805,34 @@ var mo = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, L = function(e) {
|
|
|
805
805
|
}(), O = function(e) {
|
|
806
806
|
return e instanceof we ? e : new we(e);
|
|
807
807
|
};
|
|
808
|
-
const
|
|
809
|
-
function
|
|
808
|
+
const So = typeof process < "u" ? process.env.NODE_ENV === "development" || process.env.NODE_ENV === "test" : !1;
|
|
809
|
+
function Vt() {
|
|
810
|
+
if (So) return !0;
|
|
811
|
+
try {
|
|
812
|
+
return typeof localStorage < "u" && localStorage.getItem("pc-mode") === "development";
|
|
813
|
+
} catch {
|
|
814
|
+
return !1;
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
function Co(e) {
|
|
810
818
|
return {
|
|
811
819
|
debug: (t, ...o) => {
|
|
812
|
-
Vt && console.debug(`[${e}]`, t, ...o);
|
|
820
|
+
Vt() && console.debug(`[${e}]`, t, ...o);
|
|
813
821
|
},
|
|
814
822
|
info: (t, ...o) => {
|
|
815
|
-
Vt && console.info(`[${e}]`, t, ...o);
|
|
823
|
+
Vt() && console.info(`[${e}]`, t, ...o);
|
|
816
824
|
},
|
|
817
825
|
warn: (t, ...o) => {
|
|
818
|
-
Vt && console.warn(`[${e}]`, t, ...o);
|
|
826
|
+
Vt() && console.warn(`[${e}]`, t, ...o);
|
|
819
827
|
},
|
|
820
828
|
error: (t, ...o) => {
|
|
821
829
|
console.error(`[${e}]`, t, ...o);
|
|
822
830
|
}
|
|
823
831
|
};
|
|
824
832
|
}
|
|
825
|
-
const g =
|
|
833
|
+
const g = Co("Pollcatch");
|
|
826
834
|
var Re = /* @__PURE__ */ ((e) => (e[e.AA_NORMAL = 4.5] = "AA_NORMAL", e[e.AA_LARGE = 3] = "AA_LARGE", e[e.AAA_NORMAL = 7] = "AAA_NORMAL", e[e.AAA_LARGE = 4.5] = "AAA_LARGE", e))(Re || {});
|
|
827
|
-
const
|
|
835
|
+
const ko = {
|
|
828
836
|
black: "#000000",
|
|
829
837
|
white: "#ffffff",
|
|
830
838
|
red: "#ff0000",
|
|
@@ -841,19 +849,19 @@ const Co = {
|
|
|
841
849
|
teal: "#008080",
|
|
842
850
|
navy: "#000080"
|
|
843
851
|
};
|
|
844
|
-
function
|
|
852
|
+
function Eo(e) {
|
|
845
853
|
const t = e.toLowerCase().trim();
|
|
846
|
-
return
|
|
854
|
+
return ko[t] || null;
|
|
847
855
|
}
|
|
848
856
|
function jt(e, t) {
|
|
849
857
|
const o = xe(e), r = xe(t), s = Math.max(o, r), i = Math.min(o, r);
|
|
850
858
|
return (s + 0.05) / (i + 0.05);
|
|
851
859
|
}
|
|
852
860
|
function xe(e) {
|
|
853
|
-
const t =
|
|
861
|
+
const t = Po(e), o = t.r / 255, r = t.g / 255, s = t.b / 255, i = o <= 0.03928 ? o / 12.92 : Math.pow((o + 0.055) / 1.055, 2.4), a = r <= 0.03928 ? r / 12.92 : Math.pow((r + 0.055) / 1.055, 2.4), l = s <= 0.03928 ? s / 12.92 : Math.pow((s + 0.055) / 1.055, 2.4);
|
|
854
862
|
return 0.2126 * i + 0.7152 * a + 0.0722 * l;
|
|
855
863
|
}
|
|
856
|
-
function
|
|
864
|
+
function Ao(e, t = {}) {
|
|
857
865
|
if (!O(e).isValid())
|
|
858
866
|
return g.warn(`Invalid color provided: ${e}`), "black";
|
|
859
867
|
const {
|
|
@@ -884,8 +892,8 @@ function Eo(e, t = {}) {
|
|
|
884
892
|
}
|
|
885
893
|
return n;
|
|
886
894
|
}
|
|
887
|
-
function
|
|
888
|
-
const o =
|
|
895
|
+
function Po(e) {
|
|
896
|
+
const o = Eo(e) || e, r = O(o);
|
|
889
897
|
if (!r.isValid())
|
|
890
898
|
return g.warn(`Invalid color provided: ${e}`), { r: 0, g: 0, b: 0 };
|
|
891
899
|
const { r: s, g: i, b: a } = r.toRgb();
|
|
@@ -922,7 +930,7 @@ function qt(e, t = "1rem", o = 1) {
|
|
|
922
930
|
const l = parseFloat(i);
|
|
923
931
|
return isNaN(l) ? t : `${l}rem`;
|
|
924
932
|
}
|
|
925
|
-
function
|
|
933
|
+
function To(e, t = "4px") {
|
|
926
934
|
if (!e) return t;
|
|
927
935
|
const o = {
|
|
928
936
|
xs: "2px",
|
|
@@ -942,7 +950,7 @@ function Po(e, t = "4px") {
|
|
|
942
950
|
const a = parseFloat(s);
|
|
943
951
|
return isNaN(a) ? t : `${a}px`;
|
|
944
952
|
}
|
|
945
|
-
var
|
|
953
|
+
var D = /* @__PURE__ */ ((e) => (e.BUTTON = "button", e.CHECKBOX = "checkbox", e.RADIO = "radio", e.RADIOGROUP = "radiogroup", e.SWITCH = "switch", e.TAB = "tab", e.TABLIST = "tablist", e.TABPANEL = "tabpanel", e.MENU = "menu", e.MENUITEM = "menuitem", e.MENUITEMCHECKBOX = "menuitemcheckbox", e.MENUITEMRADIO = "menuitemradio", e.SLIDER = "slider", e.TEXTBOX = "textbox", e.COMBOBOX = "combobox", e.LISTBOX = "listbox", e.OPTION = "option", e.PROGRESSBAR = "progressbar", e.STATUS = "status", e.ALERT = "alert", e.DIALOG = "dialog", e.GROUP = "group", e.REGION = "region", e.NONE = "none", e.PRESENTATION = "presentation", e))(D || {});
|
|
946
954
|
function st(e) {
|
|
947
955
|
const t = {};
|
|
948
956
|
e.role !== void 0 && (t.role = e.role);
|
|
@@ -953,7 +961,7 @@ function st(e) {
|
|
|
953
961
|
}
|
|
954
962
|
return t;
|
|
955
963
|
}
|
|
956
|
-
function
|
|
964
|
+
function _o(e, t, o) {
|
|
957
965
|
return st({
|
|
958
966
|
role: "button",
|
|
959
967
|
ariaLabel: e,
|
|
@@ -961,7 +969,7 @@ function To(e, t, o) {
|
|
|
961
969
|
ariaDisabled: o
|
|
962
970
|
});
|
|
963
971
|
}
|
|
964
|
-
function
|
|
972
|
+
function Oo(e, t, o, r = !1) {
|
|
965
973
|
return st({
|
|
966
974
|
role: r ? "radio" : "checkbox",
|
|
967
975
|
ariaLabel: e,
|
|
@@ -972,28 +980,28 @@ function _o(e, t, o, r = !1) {
|
|
|
972
980
|
function Ht(e, t, o) {
|
|
973
981
|
typeof o == "boolean" ? e.setAttribute(t, o ? "true" : "false") : e.setAttribute(t, o);
|
|
974
982
|
}
|
|
975
|
-
function
|
|
983
|
+
function Io(e) {
|
|
976
984
|
if (typeof e != "string")
|
|
977
985
|
return !1;
|
|
978
986
|
const t = e.replace(/[<>"']/g, "").trim();
|
|
979
987
|
return /^(#[0-9a-fA-F]{3,8}|rgb\([^)]+\)|rgba\([^)]+\)|hsl\([^)]+\)|hsla\([^)]+\)|[a-zA-Z]+)$/.test(t);
|
|
980
988
|
}
|
|
981
989
|
function ot(e) {
|
|
982
|
-
return
|
|
990
|
+
return Io(e) ? e.replace(/[<>"']/g, "").trim() : (g.warn("Invalid color value:", e), "#000000");
|
|
983
991
|
}
|
|
984
|
-
function
|
|
992
|
+
function zo(e) {
|
|
985
993
|
if (typeof e != "string")
|
|
986
994
|
return g.warn("Non-string value passed to sanitizeCSS:", typeof e), "";
|
|
987
995
|
let t = e;
|
|
988
996
|
return t = t.replace(/@import[^;]+;/gi, "").replace(/expression\s*\([^)]*\)/gi, "").replace(/javascript:\s*[^"'\s;]*/gi, "").replace(/url\s*\(\s*["']?data:(?!image\/[^;]+;base64,)[^"')]*["']?\s*\)/gi, "").replace(/-moz-binding\s*:[^;]+;/gi, "").replace(/behavior\s*:[^;]+;/gi, ""), t;
|
|
989
997
|
}
|
|
990
|
-
function
|
|
998
|
+
function Mo(e) {
|
|
991
999
|
return typeof e != "string" || !e.trim() ? "" : e.replace(
|
|
992
1000
|
/([^{}:;]+):\s*([^;{}!]+)(\s*!important)?\s*(;|})/gi,
|
|
993
1001
|
(t, o, r, s, i) => s ? t : `${o}: ${r.trim()} !important${i}`
|
|
994
1002
|
);
|
|
995
1003
|
}
|
|
996
|
-
const Yt = "https://jpxwfjorwcsrqraorpbj.supabase.co/functions/v1/data",
|
|
1004
|
+
const Yt = "https://jpxwfjorwcsrqraorpbj.supabase.co/functions/v1/data", Lo = "pc_session_id", Do = 24 * 60 * 60 * 1e3;
|
|
997
1005
|
function $e() {
|
|
998
1006
|
return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : (g.warn("crypto.randomUUID not available, using fallback UUID generator"), "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
|
|
999
1007
|
const t = Math.random() * 16 | 0;
|
|
@@ -1025,7 +1033,7 @@ function Ue(e, t) {
|
|
|
1025
1033
|
}
|
|
1026
1034
|
}
|
|
1027
1035
|
async function Se() {
|
|
1028
|
-
const e =
|
|
1036
|
+
const e = Lo, t = Do;
|
|
1029
1037
|
if (te()) {
|
|
1030
1038
|
const o = Be(e);
|
|
1031
1039
|
if (o && o.id && o.timestamp && Date.now() - o.timestamp < t)
|
|
@@ -1067,14 +1075,14 @@ function No(e) {
|
|
|
1067
1075
|
}
|
|
1068
1076
|
return { promoters: t, passives: o, detractors: r };
|
|
1069
1077
|
}
|
|
1070
|
-
function
|
|
1078
|
+
function Ro(e, t) {
|
|
1071
1079
|
const o = {};
|
|
1072
1080
|
for (const r of t)
|
|
1073
1081
|
o[r] = e[r] || 0;
|
|
1074
1082
|
return o;
|
|
1075
1083
|
}
|
|
1076
1084
|
function Ce(e, t) {
|
|
1077
|
-
const o = t ?
|
|
1085
|
+
const o = t ? Ro(e, t) : e;
|
|
1078
1086
|
let r = 0, s = 0;
|
|
1079
1087
|
for (const [a, l] of Object.entries(o)) {
|
|
1080
1088
|
s += l;
|
|
@@ -1083,7 +1091,7 @@ function Ce(e, t) {
|
|
|
1083
1091
|
}
|
|
1084
1092
|
return { avg: s > 0 ? Math.round(r / s * 10) / 10 : 0, count: s, sum: r, breakdown: o };
|
|
1085
1093
|
}
|
|
1086
|
-
function
|
|
1094
|
+
function N() {
|
|
1087
1095
|
return {
|
|
1088
1096
|
count: 0,
|
|
1089
1097
|
sum: 0,
|
|
@@ -1093,17 +1101,17 @@ function D() {
|
|
|
1093
1101
|
updated: (/* @__PURE__ */ new Date()).toISOString()
|
|
1094
1102
|
};
|
|
1095
1103
|
}
|
|
1096
|
-
function
|
|
1104
|
+
function Bo(e) {
|
|
1097
1105
|
if (!te())
|
|
1098
|
-
return
|
|
1106
|
+
return N();
|
|
1099
1107
|
try {
|
|
1100
1108
|
const t = Be(e);
|
|
1101
|
-
return t ? { ...
|
|
1109
|
+
return t ? { ...N(), ...t } : N();
|
|
1102
1110
|
} catch (t) {
|
|
1103
|
-
return g.warn("Failed to load localStats from localStorage", t),
|
|
1111
|
+
return g.warn("Failed to load localStats from localStorage", t), N();
|
|
1104
1112
|
}
|
|
1105
1113
|
}
|
|
1106
|
-
function
|
|
1114
|
+
function Uo(e, t) {
|
|
1107
1115
|
if (!te())
|
|
1108
1116
|
return !1;
|
|
1109
1117
|
try {
|
|
@@ -1112,7 +1120,7 @@ function Bo(e, t) {
|
|
|
1112
1120
|
return g.warn("Failed to save localStats to localStorage", o), !1;
|
|
1113
1121
|
}
|
|
1114
1122
|
}
|
|
1115
|
-
function
|
|
1123
|
+
function Vo(e, t) {
|
|
1116
1124
|
const o = {
|
|
1117
1125
|
count: Math.max(0, e.count - t.count),
|
|
1118
1126
|
sum: (e.sum || 0) - (t.sum || 0),
|
|
@@ -1127,9 +1135,9 @@ function Uo(e, t) {
|
|
|
1127
1135
|
o.breakdown[r] && (o.breakdown[r] = Math.max(0, o.breakdown[r] - s), o.breakdown[r] === 0 && delete o.breakdown[r]);
|
|
1128
1136
|
return o.nps = ft((o == null ? void 0 : o.breakdown) || {}), o;
|
|
1129
1137
|
}
|
|
1130
|
-
function
|
|
1138
|
+
function jo(e, t) {
|
|
1131
1139
|
if (!e.count && !t.count)
|
|
1132
|
-
return
|
|
1140
|
+
return N();
|
|
1133
1141
|
if (!e.count)
|
|
1134
1142
|
return { ...t };
|
|
1135
1143
|
const o = {
|
|
@@ -1165,7 +1173,7 @@ function Ot(e) {
|
|
|
1165
1173
|
return !1;
|
|
1166
1174
|
}
|
|
1167
1175
|
}
|
|
1168
|
-
function
|
|
1176
|
+
function qo(e) {
|
|
1169
1177
|
if (!e || typeof e != "string")
|
|
1170
1178
|
return [];
|
|
1171
1179
|
const t = e.trim();
|
|
@@ -1180,36 +1188,36 @@ function jo(e) {
|
|
|
1180
1188
|
}
|
|
1181
1189
|
return t.split(",").map((o) => o.trim()).filter((o) => o !== "");
|
|
1182
1190
|
}
|
|
1183
|
-
function
|
|
1191
|
+
function Ho(e, t) {
|
|
1184
1192
|
const o = /{([^{}]+)}/g;
|
|
1185
1193
|
return e.replace(o, (r, s) => {
|
|
1186
1194
|
const i = s.trim(), a = t[i];
|
|
1187
1195
|
return a !== void 0 ? String(a) : r;
|
|
1188
1196
|
});
|
|
1189
1197
|
}
|
|
1190
|
-
function
|
|
1198
|
+
function Fo(e, t) {
|
|
1191
1199
|
let o = 2166136261;
|
|
1192
1200
|
const r = e + ":" + t;
|
|
1193
1201
|
for (let s = 0; s < r.length; s++)
|
|
1194
1202
|
o ^= r.charCodeAt(s), o += (o << 1) + (o << 4) + (o << 7) + (o << 8) + (o << 24);
|
|
1195
1203
|
return (o >>> 0).toString(16).padStart(8, "0");
|
|
1196
1204
|
}
|
|
1197
|
-
function
|
|
1205
|
+
function Yo(e, t = 50) {
|
|
1198
1206
|
return e.length <= t ? e : e.substring(0, t).trim() + "...";
|
|
1199
1207
|
}
|
|
1200
1208
|
const Wt = /* @__PURE__ */ new Map();
|
|
1201
|
-
function
|
|
1209
|
+
function Wo(e, t) {
|
|
1202
1210
|
Wt.set(e, t);
|
|
1203
1211
|
}
|
|
1204
|
-
function
|
|
1212
|
+
function Ko(e) {
|
|
1205
1213
|
const t = Wt.get(e);
|
|
1206
1214
|
return t && Wt.delete(e), t;
|
|
1207
1215
|
}
|
|
1208
1216
|
const ke = 5;
|
|
1209
|
-
class
|
|
1217
|
+
class Go {
|
|
1210
1218
|
// Tracks if user has ever made a selection (even if later deselected)
|
|
1211
1219
|
constructor(t) {
|
|
1212
|
-
this.stats =
|
|
1220
|
+
this.stats = N(), this.localStats = N(), this.prevLocalStats = N(), this.isLoading = !0, this.isLoadingConfig = !1, this.isSubmitting = !1, this.hasInteracted = !1, (this.host = t).addController(this);
|
|
1213
1221
|
}
|
|
1214
1222
|
hostConnected() {
|
|
1215
1223
|
this.loadStats();
|
|
@@ -1262,7 +1270,7 @@ class Ko {
|
|
|
1262
1270
|
return;
|
|
1263
1271
|
}
|
|
1264
1272
|
if (o.type === "registered" && t.widgetId) {
|
|
1265
|
-
const a =
|
|
1273
|
+
const a = Ko(t.widgetId);
|
|
1266
1274
|
if (a) {
|
|
1267
1275
|
g.debug("Using prefetched config from cache", { widgetId: t.widgetId }), this.applyWidgetAttributes(a.attributes);
|
|
1268
1276
|
const l = this.getOptionsForDataFunc(t), n = Ce(a.stats.breakdown, l), d = n.count, p = n.sum, h = d > 0 ? Math.round(p / d * 10) / 10 : 0, v = d > 0 ? Math.round(p / d * 100) : 0;
|
|
@@ -1360,10 +1368,10 @@ class Ko {
|
|
|
1360
1368
|
async loadLocalStats() {
|
|
1361
1369
|
const t = await this.getLocalStatsKey();
|
|
1362
1370
|
try {
|
|
1363
|
-
const o =
|
|
1371
|
+
const o = Bo(t);
|
|
1364
1372
|
g.debug("Loaded localStats from localStorage", o), this.localStats = o, o.submitted && (this.prevLocalStats = { ...o });
|
|
1365
1373
|
} catch (o) {
|
|
1366
|
-
g.warn("Failed to generate localStorage key for localStats", o), this.localStats =
|
|
1374
|
+
g.warn("Failed to generate localStorage key for localStats", o), this.localStats = N();
|
|
1367
1375
|
}
|
|
1368
1376
|
this.host.requestUpdate();
|
|
1369
1377
|
}
|
|
@@ -1373,7 +1381,7 @@ class Ko {
|
|
|
1373
1381
|
async persistLocalStats() {
|
|
1374
1382
|
try {
|
|
1375
1383
|
const t = await this.getLocalStatsKey();
|
|
1376
|
-
|
|
1384
|
+
Uo(t, this.localStats) || g.warn("Failed to save localStats to localStorage");
|
|
1377
1385
|
} catch (t) {
|
|
1378
1386
|
g.warn("Failed to save localStats to localStorage", t);
|
|
1379
1387
|
}
|
|
@@ -1387,7 +1395,7 @@ class Ko {
|
|
|
1387
1395
|
* @param textValues
|
|
1388
1396
|
*/
|
|
1389
1397
|
updateStats(t, o) {
|
|
1390
|
-
if (this.hasInteracted = !0, this.stats && (this.stats =
|
|
1398
|
+
if (this.hasInteracted = !0, this.stats && (this.stats = Vo(this.stats, this.localStats)), this.localStats = {
|
|
1391
1399
|
count: t > 0 || o.length > 0 ? 1 : 0,
|
|
1392
1400
|
sum: t,
|
|
1393
1401
|
// e.g. number of stars, nps value
|
|
@@ -1401,7 +1409,7 @@ class Ko {
|
|
|
1401
1409
|
}, o && o.length > 0)
|
|
1402
1410
|
for (const r of o)
|
|
1403
1411
|
r && (this.localStats.breakdown[r] = 1);
|
|
1404
|
-
this.stats =
|
|
1412
|
+
this.stats = jo(this.stats, this.localStats), g.debug("Stats updated - remote: ", this.stats), g.debug("Stats updated - local: ", this.stats), this.persistLocalStats(), this.host.requestUpdate();
|
|
1405
1413
|
}
|
|
1406
1414
|
async markStatsAsSubmitted() {
|
|
1407
1415
|
this.localStats.submitted = (/* @__PURE__ */ new Date()).toISOString(), this.prevLocalStats = { ...this.localStats }, await this.persistLocalStats(), this.host.requestUpdate();
|
|
@@ -1423,7 +1431,7 @@ class Ko {
|
|
|
1423
1431
|
prevTextValues: l,
|
|
1424
1432
|
metadata: t.metadata,
|
|
1425
1433
|
timestamp: o
|
|
1426
|
-
}, d =
|
|
1434
|
+
}, d = Fo(JSON.stringify(n), o);
|
|
1427
1435
|
try {
|
|
1428
1436
|
await this.sendStats({ ...n, hash: d }), await this.markStatsAsSubmitted(), this.dispatchSubmitEvent(n);
|
|
1429
1437
|
} catch (p) {
|
|
@@ -1484,7 +1492,7 @@ class Ko {
|
|
|
1484
1492
|
pct: (o == null ? void 0 : o.pct) || 0,
|
|
1485
1493
|
nps: r.type === S.nps ? ft((o == null ? void 0 : o.breakdown) || {}) : 0
|
|
1486
1494
|
};
|
|
1487
|
-
return g.debug("Stats data: ", this.stats),
|
|
1495
|
+
return g.debug("Stats data: ", this.stats), Ho(t, i);
|
|
1488
1496
|
}
|
|
1489
1497
|
/**
|
|
1490
1498
|
* Checks if a value is selected in the local stats
|
|
@@ -1571,7 +1579,7 @@ class Ko {
|
|
|
1571
1579
|
return ((t = this.localStats) == null ? void 0 : t.submitted) !== void 0 && this.hasLocalStats();
|
|
1572
1580
|
}
|
|
1573
1581
|
}
|
|
1574
|
-
class
|
|
1582
|
+
class Zo {
|
|
1575
1583
|
constructor(t, o) {
|
|
1576
1584
|
this.isEditing = !0, this.isChartVisible = !1, this.isStatsVisible = !1, this.isThankYouVisible = !1, this.isReactionPopoverVisible = !1, this.initialized = !1, this.handleClickOutside = (r) => {
|
|
1577
1585
|
r.target !== this.host && (this.toggleThankYouVisibility(!1), this.toggleReactionPopoverVisibility(!1));
|
|
@@ -1676,13 +1684,13 @@ function je(e, t = {}) {
|
|
|
1676
1684
|
ariaHidden: !1
|
|
1677
1685
|
};
|
|
1678
1686
|
}
|
|
1679
|
-
function
|
|
1687
|
+
function Jo(e, t = "polite") {
|
|
1680
1688
|
let o = document.getElementById("screen-reader-announcer");
|
|
1681
1689
|
o ? o.setAttribute("aria-live", t) : (o = document.createElement("div"), o.id = "screen-reader-announcer", o.setAttribute("aria-live", t), o.setAttribute("role", "status"), o.setAttribute("aria-atomic", "true"), o.style.position = "absolute", o.style.width = "1px", o.style.height = "1px", o.style.margin = "-1px", o.style.padding = "0", o.style.overflow = "hidden", o.style.clip = "rect(0, 0, 0, 0)", o.style.whiteSpace = "nowrap", o.style.border = "0", document.body.appendChild(o)), o.textContent = "", setTimeout(() => {
|
|
1682
1690
|
o.textContent = e;
|
|
1683
1691
|
}, 50);
|
|
1684
1692
|
}
|
|
1685
|
-
function
|
|
1693
|
+
function Xo(e, t) {
|
|
1686
1694
|
return `${e}: ${t}`;
|
|
1687
1695
|
}
|
|
1688
1696
|
/**
|
|
@@ -1736,10 +1744,10 @@ const w = He(class extends Fe {
|
|
|
1736
1744
|
return H;
|
|
1737
1745
|
}
|
|
1738
1746
|
});
|
|
1739
|
-
var
|
|
1747
|
+
var Qo = Object.defineProperty, b = (e, t, o, r) => {
|
|
1740
1748
|
for (var s = void 0, i = e.length - 1, a; i >= 0; i--)
|
|
1741
1749
|
(a = e[i]) && (s = a(t, o, s) || s);
|
|
1742
|
-
return s &&
|
|
1750
|
+
return s && Qo(t, o, s), s;
|
|
1743
1751
|
};
|
|
1744
1752
|
const $t = {
|
|
1745
1753
|
mobile: "480px",
|
|
@@ -1747,7 +1755,7 @@ const $t = {
|
|
|
1747
1755
|
desktop: "1024px"
|
|
1748
1756
|
}, oe = class oe extends R {
|
|
1749
1757
|
constructor() {
|
|
1750
|
-
super(...arguments), this.dataController = new
|
|
1758
|
+
super(...arguments), this.dataController = new Go(this), this.displayController = new Zo(this, this.dataController), this.hasEditButton = !0, this.showStats = "never", this.showChart = !1, this.initialized = !1, this.ariaLabel = null, this.minContrast = Re.AA_NORMAL, this.options = [], this.questionPosition = "top", this.statsText = "{count} votes", this.buttonText = "Submit", this.buttonRadius = "sm", this.multiple = !1, this.inline = !1, this.readonly = !1, this.handleEditToggleKeyDown = (t) => {
|
|
1751
1759
|
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), this.handleEnterEditMode());
|
|
1752
1760
|
};
|
|
1753
1761
|
}
|
|
@@ -1782,7 +1790,7 @@ const $t = {
|
|
|
1782
1790
|
const i = ot(this.primaryColor);
|
|
1783
1791
|
o += `--pc-primary-color: ${i} !important;
|
|
1784
1792
|
`;
|
|
1785
|
-
const a =
|
|
1793
|
+
const a = Ao(i, {
|
|
1786
1794
|
minContrast: this.minContrast,
|
|
1787
1795
|
colorOptions: ["black", "white", "light", "dark"]
|
|
1788
1796
|
});
|
|
@@ -1828,12 +1836,12 @@ const $t = {
|
|
|
1828
1836
|
`;
|
|
1829
1837
|
}
|
|
1830
1838
|
if (this.buttonRadius) {
|
|
1831
|
-
const i =
|
|
1839
|
+
const i = To(this.buttonRadius);
|
|
1832
1840
|
o += `--pc-button-radius: ${i} !important;
|
|
1833
1841
|
`;
|
|
1834
1842
|
}
|
|
1835
1843
|
o += `}
|
|
1836
|
-
`, this.css && (o += zo(
|
|
1844
|
+
`, this.css && (o += Mo(zo(this.css))), t.textContent = o;
|
|
1837
1845
|
}
|
|
1838
1846
|
/**
|
|
1839
1847
|
* Update ARIA attributes for accessibility
|
|
@@ -1864,7 +1872,7 @@ const $t = {
|
|
|
1864
1872
|
*/
|
|
1865
1873
|
announceSelectionChange(t, o, r) {
|
|
1866
1874
|
const s = `Poll for "${t}"`, i = r ? `${o.label} selected` : `${o.label} unselected`;
|
|
1867
|
-
|
|
1875
|
+
Jo(Xo(s, i));
|
|
1868
1876
|
}
|
|
1869
1877
|
/** Common render methods */
|
|
1870
1878
|
renderLabel() {
|
|
@@ -1941,7 +1949,7 @@ const $t = {
|
|
|
1941
1949
|
renderThankYouMessage() {
|
|
1942
1950
|
if (!this.displayController.shouldDisplayThankYouMsg())
|
|
1943
1951
|
return u;
|
|
1944
|
-
const t =
|
|
1952
|
+
const t = Yo(this.thankYouMsg || "");
|
|
1945
1953
|
return c`
|
|
1946
1954
|
<div class="pc-thank-you-overlay" data-testid="poll-thank-you-overlay">
|
|
1947
1955
|
<div class="pc-thank-you" data-testid="thank-you">
|
|
@@ -2148,7 +2156,7 @@ b([
|
|
|
2148
2156
|
b([
|
|
2149
2157
|
f({ type: Boolean, reflect: !0 })
|
|
2150
2158
|
], m.prototype, "readonly");
|
|
2151
|
-
const
|
|
2159
|
+
const tr = U`
|
|
2152
2160
|
/* CSS variables inherit from parent - defaults are specified at usage sites */
|
|
2153
2161
|
|
|
2154
2162
|
.pc-body {
|
|
@@ -3318,7 +3326,7 @@ const Qo = U`
|
|
|
3318
3326
|
opacity: 1;
|
|
3319
3327
|
}
|
|
3320
3328
|
}
|
|
3321
|
-
`,
|
|
3329
|
+
`, er = U`
|
|
3322
3330
|
:host {
|
|
3323
3331
|
--popover-bg: light-dark(#ffffff, #1a1a1a);
|
|
3324
3332
|
--popover-border: light-dark(#e0e0e0, #333333);
|
|
@@ -3440,10 +3448,10 @@ const Qo = U`
|
|
|
3440
3448
|
max-width: 100%;
|
|
3441
3449
|
}
|
|
3442
3450
|
`;
|
|
3443
|
-
var
|
|
3444
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
3451
|
+
var or = Object.defineProperty, rr = Object.getOwnPropertyDescriptor, V = (e, t, o, r) => {
|
|
3452
|
+
for (var s = r > 1 ? void 0 : r ? rr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
|
|
3445
3453
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
3446
|
-
return r && s &&
|
|
3454
|
+
return r && s && or(t, o, s), s;
|
|
3447
3455
|
};
|
|
3448
3456
|
let I = class extends R {
|
|
3449
3457
|
constructor() {
|
|
@@ -3534,7 +3542,7 @@ let I = class extends R {
|
|
|
3534
3542
|
`;
|
|
3535
3543
|
}
|
|
3536
3544
|
};
|
|
3537
|
-
I.styles = [
|
|
3545
|
+
I.styles = [er];
|
|
3538
3546
|
V([
|
|
3539
3547
|
f({ type: Boolean, reflect: !0 })
|
|
3540
3548
|
], I.prototype, "open", 2);
|
|
@@ -3562,7 +3570,7 @@ V([
|
|
|
3562
3570
|
I = V([
|
|
3563
3571
|
W("pc-popover")
|
|
3564
3572
|
], I);
|
|
3565
|
-
const
|
|
3573
|
+
const sr = U`
|
|
3566
3574
|
:host {
|
|
3567
3575
|
--sheet-bg: light-dark(#ffffff, #1a1a1a);
|
|
3568
3576
|
--sheet-border: light-dark(#e0e0e0, #333333);
|
|
@@ -3675,10 +3683,10 @@ const rr = U`
|
|
|
3675
3683
|
max-width: 100%;
|
|
3676
3684
|
}
|
|
3677
3685
|
`;
|
|
3678
|
-
var
|
|
3679
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
3686
|
+
var ir = Object.defineProperty, ar = Object.getOwnPropertyDescriptor, et = (e, t, o, r) => {
|
|
3687
|
+
for (var s = r > 1 ? void 0 : r ? ar(t, o) : t, i = e.length - 1, a; i >= 0; i--)
|
|
3680
3688
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
3681
|
-
return r && s &&
|
|
3689
|
+
return r && s && ir(t, o, s), s;
|
|
3682
3690
|
};
|
|
3683
3691
|
let B = class extends R {
|
|
3684
3692
|
constructor() {
|
|
@@ -3774,7 +3782,7 @@ let B = class extends R {
|
|
|
3774
3782
|
`;
|
|
3775
3783
|
}
|
|
3776
3784
|
};
|
|
3777
|
-
B.styles = [
|
|
3785
|
+
B.styles = [sr];
|
|
3778
3786
|
et([
|
|
3779
3787
|
f({ type: Boolean, reflect: !0 })
|
|
3780
3788
|
], B.prototype, "open", 2);
|
|
@@ -3796,12 +3804,12 @@ et([
|
|
|
3796
3804
|
B = et([
|
|
3797
3805
|
W("pc-bottom-sheet")
|
|
3798
3806
|
], B);
|
|
3799
|
-
var
|
|
3800
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
3807
|
+
var nr = Object.defineProperty, lr = Object.getOwnPropertyDescriptor, yt = (e, t, o, r) => {
|
|
3808
|
+
for (var s = r > 1 ? void 0 : r ? lr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
|
|
3801
3809
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
3802
|
-
return r && s &&
|
|
3810
|
+
return r && s && nr(t, o, s), s;
|
|
3803
3811
|
};
|
|
3804
|
-
const
|
|
3812
|
+
const cr = 768;
|
|
3805
3813
|
let Q = class extends R {
|
|
3806
3814
|
constructor() {
|
|
3807
3815
|
super(...arguments), this.open = !1, this.position = "auto", this.isMobile = !1, this.handleMediaChange = (e) => {
|
|
@@ -3818,7 +3826,7 @@ let Q = class extends R {
|
|
|
3818
3826
|
super.disconnectedCallback(), (e = this.mediaQuery) == null || e.removeEventListener("change", this.handleMediaChange);
|
|
3819
3827
|
}
|
|
3820
3828
|
setupMediaQuery() {
|
|
3821
|
-
this.mediaQuery = window.matchMedia(`(max-width: ${
|
|
3829
|
+
this.mediaQuery = window.matchMedia(`(max-width: ${cr - 1}px)`), this.isMobile = this.mediaQuery.matches, this.mediaQuery.addEventListener("change", this.handleMediaChange);
|
|
3822
3830
|
}
|
|
3823
3831
|
render() {
|
|
3824
3832
|
return this.isMobile ? c`
|
|
@@ -3857,10 +3865,10 @@ yt([
|
|
|
3857
3865
|
Q = yt([
|
|
3858
3866
|
W("pc-responsive-modal")
|
|
3859
3867
|
], Q);
|
|
3860
|
-
var
|
|
3861
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
3868
|
+
var dr = Object.defineProperty, pr = Object.getOwnPropertyDescriptor, K = (e, t, o, r) => {
|
|
3869
|
+
for (var s = r > 1 ? void 0 : r ? pr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
|
|
3862
3870
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
3863
|
-
return r && s &&
|
|
3871
|
+
return r && s && dr(t, o, s), s;
|
|
3864
3872
|
};
|
|
3865
3873
|
let M = class extends m {
|
|
3866
3874
|
constructor() {
|
|
@@ -3875,14 +3883,14 @@ let M = class extends m {
|
|
|
3875
3883
|
*/
|
|
3876
3884
|
renderNpsButtons() {
|
|
3877
3885
|
const e = Array.from({ length: this.max - this.min + 1 }, (s, i) => i + this.min), t = `nps-control-${this.name || this.type}`, o = st({
|
|
3878
|
-
role:
|
|
3886
|
+
role: D.GROUP,
|
|
3879
3887
|
ariaLabel: this.question || "NPS Rating",
|
|
3880
3888
|
ariaDescribedby: `${t}-description`
|
|
3881
3889
|
}), r = e.map((s) => {
|
|
3882
3890
|
const i = this.dataController.isValueSelected(String(s)), a = {
|
|
3883
3891
|
"nps-button": !0,
|
|
3884
3892
|
selected: i
|
|
3885
|
-
}, l =
|
|
3893
|
+
}, l = _o(`Rate ${s}`, i, !1);
|
|
3886
3894
|
return c`
|
|
3887
3895
|
<button
|
|
3888
3896
|
data-testid="nps-button-${s}"
|
|
@@ -4218,7 +4226,7 @@ let M = class extends m {
|
|
|
4218
4226
|
return this.inline ? this.renderInlineMode() : this.readonly ? this.renderReadonlyMode() : this.renderStandardMode();
|
|
4219
4227
|
}
|
|
4220
4228
|
};
|
|
4221
|
-
M.styles = [...m.styles, It,
|
|
4229
|
+
M.styles = [...m.styles, It, tr];
|
|
4222
4230
|
K([
|
|
4223
4231
|
f({ type: String, attribute: "min-label" })
|
|
4224
4232
|
], M.prototype, "minLabel", 2);
|
|
@@ -4243,7 +4251,7 @@ K([
|
|
|
4243
4251
|
M = K([
|
|
4244
4252
|
W("pc-nps")
|
|
4245
4253
|
], M);
|
|
4246
|
-
const
|
|
4254
|
+
const ur = U`
|
|
4247
4255
|
/* CSS variables inherit from parent - defaults are specified at usage sites */
|
|
4248
4256
|
|
|
4249
4257
|
.pc-container {
|
|
@@ -4628,10 +4636,10 @@ const pr = U`
|
|
|
4628
4636
|
opacity: 0.8;
|
|
4629
4637
|
}
|
|
4630
4638
|
`;
|
|
4631
|
-
var
|
|
4632
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
4639
|
+
var hr = Object.defineProperty, fr = Object.getOwnPropertyDescriptor, wt = (e, t, o, r) => {
|
|
4640
|
+
for (var s = r > 1 ? void 0 : r ? fr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
|
|
4633
4641
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
4634
|
-
return r && s &&
|
|
4642
|
+
return r && s && hr(t, o, s), s;
|
|
4635
4643
|
};
|
|
4636
4644
|
let tt = class extends m {
|
|
4637
4645
|
constructor() {
|
|
@@ -4716,7 +4724,7 @@ let tt = class extends m {
|
|
|
4716
4724
|
* Renders the selection indicator (checkbox or radio button) with proper ARIA roles
|
|
4717
4725
|
*/
|
|
4718
4726
|
renderSelectionIndicator() {
|
|
4719
|
-
const e = this.multiple ?
|
|
4727
|
+
const e = this.multiple ? D.CHECKBOX : D.RADIO;
|
|
4720
4728
|
return this.multiple ? c`<span class="poll-checkbox" role="${e}"></span>` : c`<span class="poll-radio" role="${e}"></span>`;
|
|
4721
4729
|
}
|
|
4722
4730
|
/**
|
|
@@ -4728,7 +4736,7 @@ let tt = class extends m {
|
|
|
4728
4736
|
selected: o,
|
|
4729
4737
|
"poll-option--compact": this.compact,
|
|
4730
4738
|
"poll-option--disabled": r
|
|
4731
|
-
}, i = t + 1, a = `poll-${this.type}-${i}`, l =
|
|
4739
|
+
}, i = t + 1, a = `poll-${this.type}-${i}`, l = Oo(
|
|
4732
4740
|
e.label,
|
|
4733
4741
|
o,
|
|
4734
4742
|
r,
|
|
@@ -4762,7 +4770,7 @@ let tt = class extends m {
|
|
|
4762
4770
|
*/
|
|
4763
4771
|
renderPollOptions() {
|
|
4764
4772
|
var s;
|
|
4765
|
-
const e = this.multiple ?
|
|
4773
|
+
const e = this.multiple ? D.GROUP : D.RADIOGROUP, t = this.question || this.name || "Options", o = st({
|
|
4766
4774
|
role: e,
|
|
4767
4775
|
ariaLabel: t
|
|
4768
4776
|
});
|
|
@@ -4793,7 +4801,7 @@ let tt = class extends m {
|
|
|
4793
4801
|
percentage: x,
|
|
4794
4802
|
isSelected: k
|
|
4795
4803
|
};
|
|
4796
|
-
}), s = this.multiple ?
|
|
4804
|
+
}), s = this.multiple ? D.GROUP : D.RADIOGROUP, i = this.question || this.name || "Options", a = st({
|
|
4797
4805
|
role: s,
|
|
4798
4806
|
ariaLabel: i
|
|
4799
4807
|
});
|
|
@@ -5027,7 +5035,7 @@ let tt = class extends m {
|
|
|
5027
5035
|
[`pc-flex-pos-${this.statsPosition}`]: !0,
|
|
5028
5036
|
[`pc-flex-align-${o}`]: !0
|
|
5029
5037
|
}, s = st({
|
|
5030
|
-
role:
|
|
5038
|
+
role: D.REGION,
|
|
5031
5039
|
ariaLabel: this.question || this.name || "Poll"
|
|
5032
5040
|
});
|
|
5033
5041
|
return c`
|
|
@@ -5048,7 +5056,7 @@ let tt = class extends m {
|
|
|
5048
5056
|
return this.inline ? this.renderInlineMode() : this.readonly ? this.renderReadonlyMode() : this.renderStandardMode();
|
|
5049
5057
|
}
|
|
5050
5058
|
};
|
|
5051
|
-
tt.styles = [...m.styles, It,
|
|
5059
|
+
tt.styles = [...m.styles, It, ur];
|
|
5052
5060
|
wt([
|
|
5053
5061
|
f({ type: Boolean })
|
|
5054
5062
|
], tt.prototype, "multiple", 2);
|
|
@@ -5064,7 +5072,7 @@ wt([
|
|
|
5064
5072
|
tt = wt([
|
|
5065
5073
|
W("pc-poll")
|
|
5066
5074
|
], tt);
|
|
5067
|
-
const
|
|
5075
|
+
const gr = U`
|
|
5068
5076
|
/* CSS variables inherit from parent - defaults are specified at usage sites */
|
|
5069
5077
|
|
|
5070
5078
|
.pc-section {
|
|
@@ -5251,7 +5259,7 @@ const fr = U`
|
|
|
5251
5259
|
* Copyright 2018 Google LLC
|
|
5252
5260
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5253
5261
|
*/
|
|
5254
|
-
const Ye = "important",
|
|
5262
|
+
const Ye = "important", mr = " !" + Ye, vr = He(class extends Fe {
|
|
5255
5263
|
constructor(e) {
|
|
5256
5264
|
var t;
|
|
5257
5265
|
if (super(e), e.type !== qe.ATTRIBUTE || e.name !== "style" || ((t = e.strings) == null ? void 0 : t.length) > 2) throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.");
|
|
@@ -5270,7 +5278,7 @@ const Ye = "important", gr = " !" + Ye, mr = He(class extends Fe {
|
|
|
5270
5278
|
const s = t[r];
|
|
5271
5279
|
if (s != null) {
|
|
5272
5280
|
this.ft.add(r);
|
|
5273
|
-
const i = typeof s == "string" && s.endsWith(
|
|
5281
|
+
const i = typeof s == "string" && s.endsWith(mr);
|
|
5274
5282
|
r.includes("-") || i ? o.setProperty(r, i ? s.slice(0, -11) : s, i ? Ye : "") : o[r] = s;
|
|
5275
5283
|
}
|
|
5276
5284
|
}
|
|
@@ -5456,10 +5464,10 @@ function Pt(e) {
|
|
|
5456
5464
|
isRemoteImage: o
|
|
5457
5465
|
};
|
|
5458
5466
|
}
|
|
5459
|
-
var
|
|
5460
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
5467
|
+
var br = Object.defineProperty, yr = Object.getOwnPropertyDescriptor, nt = (e, t, o, r) => {
|
|
5468
|
+
for (var s = r > 1 ? void 0 : r ? yr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
|
|
5461
5469
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
5462
|
-
return r && s &&
|
|
5470
|
+
return r && s && br(t, o, s), s;
|
|
5463
5471
|
};
|
|
5464
5472
|
let F = class extends m {
|
|
5465
5473
|
constructor() {
|
|
@@ -5513,7 +5521,7 @@ let F = class extends m {
|
|
|
5513
5521
|
<span
|
|
5514
5522
|
data-testid="${e ? "popover" : "stars-view"}-star-${d}"
|
|
5515
5523
|
class=${w(x)}
|
|
5516
|
-
style=${
|
|
5524
|
+
style=${vr(k)}
|
|
5517
5525
|
role="${a ? "button" : "presentation"}"
|
|
5518
5526
|
tabindex="${a ? "0" : ""}"
|
|
5519
5527
|
aria-label="${a ? `Rate ${d} star${d > 1 ? "s" : ""}` : ""}"
|
|
@@ -5771,7 +5779,7 @@ let F = class extends m {
|
|
|
5771
5779
|
return this.inline ? this.renderInlineMode() : this.readonly ? this.renderReadonlyMode() : this.renderStandardMode();
|
|
5772
5780
|
}
|
|
5773
5781
|
};
|
|
5774
|
-
F.styles = [...m.styles, It,
|
|
5782
|
+
F.styles = [...m.styles, It, gr];
|
|
5775
5783
|
nt([
|
|
5776
5784
|
f({ type: String })
|
|
5777
5785
|
], F.prototype, "icon", 2);
|
|
@@ -5790,7 +5798,7 @@ nt([
|
|
|
5790
5798
|
F = nt([
|
|
5791
5799
|
W("pc-stars")
|
|
5792
5800
|
], F);
|
|
5793
|
-
const
|
|
5801
|
+
const wr = U`
|
|
5794
5802
|
/* Adjust stats text for reactions */
|
|
5795
5803
|
.pc-stats-text {
|
|
5796
5804
|
font-size: var(--pc-font-size-small, var(--default-font-size-small));
|
|
@@ -6053,11 +6061,11 @@ const yr = U`
|
|
|
6053
6061
|
animation: none;
|
|
6054
6062
|
}
|
|
6055
6063
|
}
|
|
6056
|
-
`,
|
|
6057
|
-
var
|
|
6058
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
6064
|
+
`, xr = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='24px'%20viewBox='0%20-960%20960%20960'%20width='24px'%20fill='%23434343'%3e%3cpath%20d='M480-480Zm0%20400q-83%200-156-31.5T197-197q-54-54-85.5-127T80-480q0-83%2031.5-156T197-763q54-54%20127-85.5T480-880q43%200%2083%208.5t77%2024.5v90q-35-20-75.5-31.5T480-800q-133%200-226.5%2093.5T160-480q0%20133%2093.5%20226.5T480-160q133%200%20226.5-93.5T800-480q0-32-6.5-62T776-600h86q9%2029%2013.5%2058.5T880-480q0%2083-31.5%20156T763-197q-54%2054-127%2085.5T480-80Zm320-600v-80h-80v-80h80v-80h80v80h80v80h-80v80h-80ZM620-520q25%200%2042.5-17.5T680-580q0-25-17.5-42.5T620-640q-25%200-42.5%2017.5T560-580q0%2025%2017.5%2042.5T620-520Zm-280%200q25%200%2042.5-17.5T400-580q0-25-17.5-42.5T340-640q-25%200-42.5%2017.5T280-580q0%2025%2017.5%2042.5T340-520Zm140%20260q68%200%20123.5-38.5T684-400H276q25%2063%2080.5%20101.5T480-260Z'/%3e%3c/svg%3e";
|
|
6065
|
+
var $r = Object.defineProperty, Sr = Object.getOwnPropertyDescriptor, zt = (e, t, o, r) => {
|
|
6066
|
+
for (var s = r > 1 ? void 0 : r ? Sr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
|
|
6059
6067
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
6060
|
-
return r && s &&
|
|
6068
|
+
return r && s && $r(t, o, s), s;
|
|
6061
6069
|
};
|
|
6062
6070
|
let at = class extends m {
|
|
6063
6071
|
constructor() {
|
|
@@ -6137,7 +6145,7 @@ let at = class extends m {
|
|
|
6137
6145
|
aria-expanded="${this.displayController.shouldShowReactionPopover()}"
|
|
6138
6146
|
aria-haspopup="true"
|
|
6139
6147
|
>
|
|
6140
|
-
<img src="${
|
|
6148
|
+
<img src="${xr}" alt="" class="trigger-icon" />
|
|
6141
6149
|
</button>
|
|
6142
6150
|
`;
|
|
6143
6151
|
}
|
|
@@ -6299,7 +6307,7 @@ let at = class extends m {
|
|
|
6299
6307
|
return this.readonly ? this.renderReadonlyMode() : this.renderStandardMode();
|
|
6300
6308
|
}
|
|
6301
6309
|
};
|
|
6302
|
-
at.styles = [...m.styles, It,
|
|
6310
|
+
at.styles = [...m.styles, It, wr];
|
|
6303
6311
|
zt([
|
|
6304
6312
|
f({ type: Boolean, attribute: "show-counts" })
|
|
6305
6313
|
], at.prototype, "showCounts", 2);
|
|
@@ -6316,14 +6324,14 @@ function dt(e, t, o = void 0) {
|
|
|
6316
6324
|
const r = e.getAttribute(t);
|
|
6317
6325
|
return r === null ? o : r == null ? void 0 : r.trim();
|
|
6318
6326
|
}
|
|
6319
|
-
function
|
|
6327
|
+
function Cr(e, t = void 0) {
|
|
6320
6328
|
const o = e.textContent;
|
|
6321
6329
|
return o === "" || o === null ? t : o == null ? void 0 : o.trim();
|
|
6322
6330
|
}
|
|
6323
|
-
var
|
|
6324
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
6331
|
+
var kr = Object.defineProperty, Er = Object.getOwnPropertyDescriptor, lt = (e, t, o, r) => {
|
|
6332
|
+
for (var s = r > 1 ? void 0 : r ? Er(t, o) : t, i = e.length - 1, a; i >= 0; i--)
|
|
6325
6333
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
6326
|
-
return r && s &&
|
|
6334
|
+
return r && s && kr(t, o, s), s;
|
|
6327
6335
|
};
|
|
6328
6336
|
let Y = class extends R {
|
|
6329
6337
|
constructor() {
|
|
@@ -6372,7 +6380,7 @@ let Y = class extends R {
|
|
|
6372
6380
|
const E = (o = (t = y.data) == null ? void 0 : t.config) == null ? void 0 : o.type;
|
|
6373
6381
|
if (!E)
|
|
6374
6382
|
throw new Error("Backend response missing widget type");
|
|
6375
|
-
|
|
6383
|
+
Wo(this.widgetId, {
|
|
6376
6384
|
type: E,
|
|
6377
6385
|
attributes: ((s = (r = y.data) == null ? void 0 : r.config) == null ? void 0 : s.attributes) || null,
|
|
6378
6386
|
stats: {
|
|
@@ -6423,14 +6431,14 @@ let Y = class extends R {
|
|
|
6423
6431
|
const e = this.querySelector("pc-poll, pc-reaction");
|
|
6424
6432
|
if (!e) return;
|
|
6425
6433
|
const t = this.querySelectorAll("poll-catch-option");
|
|
6426
|
-
let r =
|
|
6434
|
+
let r = qo(this.options).map((s) => ({
|
|
6427
6435
|
value: s,
|
|
6428
6436
|
label: s,
|
|
6429
6437
|
icon: e.tagName === "PC-REACTION" ? s : void 0
|
|
6430
6438
|
// REACTION widget uses options for the icon
|
|
6431
6439
|
}));
|
|
6432
6440
|
t && t.length > 0 && (r = Array.from(t).map((s) => {
|
|
6433
|
-
const i = dt(s, "value", "") || "", a = dt(s, "label",
|
|
6441
|
+
const i = dt(s, "value", "") || "", a = dt(s, "label", Cr(s, i)) || "", l = dt(s, "icon", void 0), n = dt(s, "tooltip", void 0), d = dt(s, "disabled", void 0), p = { value: i, label: a };
|
|
6434
6442
|
if (l !== void 0) {
|
|
6435
6443
|
const h = Pt(l);
|
|
6436
6444
|
p.icon = h.icon;
|