pollcatch 2.0.0 → 2.0.2

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/pc.js +195 -189
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pollcatch",
3
3
  "private": false,
4
- "version": "2.0.0",
4
+ "version": "2.0.2",
5
5
  "type": "module",
6
6
  "main": "pc.js",
7
7
  "module": "pc.js",
@@ -25,4 +25,4 @@
25
25
  ],
26
26
  "author": "David Lin <david@pollcatch.com>",
27
27
  "homepage": "https://www.pollcatch.com"
28
- }
28
+ }
package/pc.js CHANGED
@@ -3,16 +3,16 @@
3
3
  * Copyright 2019 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
5
5
  */
6
- const it = globalThis, kt = it.ShadowRoot && (it.ShadyCSS === void 0 || it.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, At = Symbol(), Lt = /* @__PURE__ */ new WeakMap();
6
+ const it = globalThis, At = it.ShadowRoot && (it.ShadyCSS === void 0 || it.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, kt = Symbol(), Lt = /* @__PURE__ */ new WeakMap();
7
7
  let ae = class {
8
8
  constructor(t, o, r) {
9
- if (this._$cssResult$ = !0, r !== At) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
9
+ if (this._$cssResult$ = !0, r !== kt) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
10
10
  this.cssText = t, this.t = o;
11
11
  }
12
12
  get styleSheet() {
13
13
  let t = this.o;
14
14
  const o = this.t;
15
- if (kt && t === void 0) {
15
+ if (At && t === void 0) {
16
16
  const r = o !== void 0 && o.length === 1;
17
17
  r && (t = Lt.get(o)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), r && Lt.set(o, t));
18
18
  }
@@ -22,33 +22,33 @@ let ae = class {
22
22
  return this.cssText;
23
23
  }
24
24
  };
25
- const ke = (e) => new ae(typeof e == "string" ? e : e + "", void 0, At), H = (e, ...t) => {
25
+ const Ae = (e) => new ae(typeof e == "string" ? e : e + "", void 0, kt), H = (e, ...t) => {
26
26
  const o = e.length === 1 ? e[0] : t.reduce((r, s, i) => r + ((a) => {
27
27
  if (a._$cssResult$ === !0) return a.cssText;
28
28
  if (typeof a == "number") return a;
29
29
  throw Error("Value passed to 'css' function must be a 'css' function result: " + a + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
30
30
  })(s) + e[i + 1], e[0]);
31
- return new ae(o, e, At);
32
- }, Ae = (e, t) => {
33
- if (kt) e.adoptedStyleSheets = t.map((o) => o instanceof CSSStyleSheet ? o : o.styleSheet);
31
+ return new ae(o, e, kt);
32
+ }, ke = (e, t) => {
33
+ if (At) e.adoptedStyleSheets = t.map((o) => o instanceof CSSStyleSheet ? o : o.styleSheet);
34
34
  else for (const o of t) {
35
35
  const r = document.createElement("style"), s = it.litNonce;
36
36
  s !== void 0 && r.setAttribute("nonce", s), r.textContent = o.cssText, e.appendChild(r);
37
37
  }
38
- }, Rt = kt ? (e) => e : (e) => e instanceof CSSStyleSheet ? ((t) => {
38
+ }, Rt = At ? (e) => e : (e) => e instanceof CSSStyleSheet ? ((t) => {
39
39
  let o = "";
40
40
  for (const r of t.cssRules) o += r.cssText;
41
- return ke(o);
41
+ return Ae(o);
42
42
  })(e) : e;
43
43
  /**
44
44
  * @license
45
45
  * Copyright 2017 Google LLC
46
46
  * SPDX-License-Identifier: BSD-3-Clause
47
47
  */
48
- const { is: _e, defineProperty: Ee, getOwnPropertyDescriptor: Pe, getOwnPropertyNames: Oe, getOwnPropertySymbols: Te, getPrototypeOf: ze } = Object, O = globalThis, Ut = O.trustedTypes, Ie = Ut ? Ut.emptyScript : "", ft = O.reactiveElementPolyfillSupport, K = (e, t) => e, at = { toAttribute(e, t) {
48
+ const { is: _e, defineProperty: Ee, getOwnPropertyDescriptor: Pe, getOwnPropertyNames: Oe, getOwnPropertySymbols: Te, getPrototypeOf: ze } = Object, O = globalThis, Ut = O.trustedTypes, Ne = Ut ? Ut.emptyScript : "", ft = O.reactiveElementPolyfillSupport, K = (e, t) => e, at = { toAttribute(e, t) {
49
49
  switch (t) {
50
50
  case Boolean:
51
- e = e ? Ie : null;
51
+ e = e ? Ne : null;
52
52
  break;
53
53
  case Object:
54
54
  case Array:
@@ -97,8 +97,8 @@ let U = class extends HTMLElement {
97
97
  return { get() {
98
98
  return s == null ? void 0 : s.call(this);
99
99
  }, set(a) {
100
- const l = s == null ? void 0 : s.call(this);
101
- i.call(this, a), this.requestUpdate(t, l, r);
100
+ const n = s == null ? void 0 : s.call(this);
101
+ i.call(this, a), this.requestUpdate(t, n, r);
102
102
  }, configurable: !0, enumerable: !0 };
103
103
  }
104
104
  static getPropertyOptions(t) {
@@ -161,7 +161,7 @@ let U = class extends HTMLElement {
161
161
  }
162
162
  createRenderRoot() {
163
163
  const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
164
- return Ae(t, this.constructor.elementStyles), t;
164
+ return ke(t, this.constructor.elementStyles), t;
165
165
  }
166
166
  connectedCallback() {
167
167
  var t;
@@ -194,8 +194,8 @@ let U = class extends HTMLElement {
194
194
  var i;
195
195
  const r = this.constructor, s = r._$Eh.get(t);
196
196
  if (s !== void 0 && this._$Em !== s) {
197
- const a = r.getPropertyOptions(s), l = typeof a.converter == "function" ? { fromAttribute: a.converter } : ((i = a.converter) == null ? void 0 : i.fromAttribute) !== void 0 ? a.converter : at;
198
- this._$Em = s, this[s] = l.fromAttribute(o, a.type), this._$Em = null;
197
+ const a = r.getPropertyOptions(s), n = typeof a.converter == "function" ? { fromAttribute: a.converter } : ((i = a.converter) == null ? void 0 : i.fromAttribute) !== void 0 ? a.converter : at;
198
+ this._$Em = s, this[s] = n.fromAttribute(o, a.type), this._$Em = null;
199
199
  }
200
200
  }
201
201
  requestUpdate(t, o, r) {
@@ -279,9 +279,9 @@ U.elementStyles = [], U.shadowRootOptions = { mode: "open" }, U[K("elementProper
279
279
  * Copyright 2017 Google LLC
280
280
  * SPDX-License-Identifier: BSD-3-Clause
281
281
  */
282
- const G = globalThis, nt = G.trustedTypes, Bt = nt ? nt.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, ne = "$lit$", E = `lit$${Math.random().toFixed(9).slice(2)}$`, le = "?" + E, Ne = `<${le}>`, M = document, J = () => M.createComment(""), X = (e) => e === null || typeof e != "object" && typeof e != "function", Et = Array.isArray, Me = (e) => Et(e) || typeof (e == null ? void 0 : e[Symbol.iterator]) == "function", mt = `[
283
- \f\r]`, Y = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Dt = /-->/g, Vt = />/g, I = RegExp(`>|${mt}(?:([^\\s"'>=/]+)(${mt}*=${mt}*(?:[^
284
- \f\r"'\`<>=]|("|')|))|$)`, "g"), qt = /'/g, Ht = /"/g, ce = /^(?:script|style|textarea|title)$/i, Le = (e) => (t, ...o) => ({ _$litType$: e, strings: t, values: o }), d = Le(1), T = Symbol.for("lit-noChange"), u = Symbol.for("lit-nothing"), Ft = /* @__PURE__ */ new WeakMap(), N = M.createTreeWalker(M, 129);
282
+ const G = globalThis, nt = G.trustedTypes, Bt = nt ? nt.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, ne = "$lit$", E = `lit$${Math.random().toFixed(9).slice(2)}$`, le = "?" + E, Ie = `<${le}>`, M = document, J = () => M.createComment(""), X = (e) => e === null || typeof e != "object" && typeof e != "function", Et = Array.isArray, Me = (e) => Et(e) || typeof (e == null ? void 0 : e[Symbol.iterator]) == "function", mt = `[
283
+ \f\r]`, Y = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Dt = /-->/g, Vt = />/g, N = RegExp(`>|${mt}(?:([^\\s"'>=/]+)(${mt}*=${mt}*(?:[^
284
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), qt = /'/g, Ht = /"/g, ce = /^(?:script|style|textarea|title)$/i, Le = (e) => (t, ...o) => ({ _$litType$: e, strings: t, values: o }), d = Le(1), T = Symbol.for("lit-noChange"), u = Symbol.for("lit-nothing"), Ft = /* @__PURE__ */ new WeakMap(), I = M.createTreeWalker(M, 129);
285
285
  function de(e, t) {
286
286
  if (!Et(e) || !e.hasOwnProperty("raw")) throw Error("invalid template strings array");
287
287
  return Bt !== void 0 ? Bt.createHTML(t) : t;
@@ -289,12 +289,12 @@ function de(e, t) {
289
289
  const Re = (e, t) => {
290
290
  const o = e.length - 1, r = [];
291
291
  let s, i = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", a = Y;
292
- for (let l = 0; l < o; l++) {
293
- const n = e[l];
294
- let p, c, h = -1, w = 0;
295
- for (; w < n.length && (a.lastIndex = w, c = a.exec(n), c !== null); ) w = a.lastIndex, a === Y ? c[1] === "!--" ? a = Dt : c[1] !== void 0 ? a = Vt : c[2] !== void 0 ? (ce.test(c[2]) && (s = RegExp("</" + c[2], "g")), a = I) : c[3] !== void 0 && (a = I) : a === I ? c[0] === ">" ? (a = s ?? Y, h = -1) : c[1] === void 0 ? h = -2 : (h = a.lastIndex - c[2].length, p = c[1], a = c[3] === void 0 ? I : c[3] === '"' ? Ht : qt) : a === Ht || a === qt ? a = I : a === Dt || a === Vt ? a = Y : (a = I, s = void 0);
296
- const C = a === I && e[l + 1].startsWith("/>") ? " " : "";
297
- i += a === Y ? n + Ne : h >= 0 ? (r.push(p), n.slice(0, h) + ne + n.slice(h) + E + C) : n + E + (h === -2 ? l : C);
292
+ for (let n = 0; n < o; n++) {
293
+ const l = e[n];
294
+ let p, c, h = -1, y = 0;
295
+ for (; y < l.length && (a.lastIndex = y, c = a.exec(l), c !== null); ) y = a.lastIndex, a === Y ? c[1] === "!--" ? a = Dt : c[1] !== void 0 ? a = Vt : c[2] !== void 0 ? (ce.test(c[2]) && (s = RegExp("</" + c[2], "g")), a = N) : c[3] !== void 0 && (a = N) : a === N ? c[0] === ">" ? (a = s ?? Y, h = -1) : c[1] === void 0 ? h = -2 : (h = a.lastIndex - c[2].length, p = c[1], a = c[3] === void 0 ? N : c[3] === '"' ? Ht : qt) : a === Ht || a === qt ? a = N : a === Dt || a === Vt ? a = Y : (a = N, s = void 0);
296
+ const C = a === N && e[n + 1].startsWith("/>") ? " " : "";
297
+ i += a === Y ? l + Ie : h >= 0 ? (r.push(p), l.slice(0, h) + ne + l.slice(h) + E + C) : l + E + (h === -2 ? n : C);
298
298
  }
299
299
  return [de(e, i + (e[o] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), r];
300
300
  };
@@ -303,29 +303,29 @@ let Ct = class pe {
303
303
  let s;
304
304
  this.parts = [];
305
305
  let i = 0, a = 0;
306
- const l = t.length - 1, n = this.parts, [p, c] = Re(t, o);
307
- if (this.el = pe.createElement(p, r), N.currentNode = this.el.content, o === 2 || o === 3) {
306
+ const n = t.length - 1, l = this.parts, [p, c] = Re(t, o);
307
+ if (this.el = pe.createElement(p, r), I.currentNode = this.el.content, o === 2 || o === 3) {
308
308
  const h = this.el.content.firstChild;
309
309
  h.replaceWith(...h.childNodes);
310
310
  }
311
- for (; (s = N.nextNode()) !== null && n.length < l; ) {
311
+ for (; (s = I.nextNode()) !== null && l.length < n; ) {
312
312
  if (s.nodeType === 1) {
313
313
  if (s.hasAttributes()) for (const h of s.getAttributeNames()) if (h.endsWith(ne)) {
314
- const w = c[a++], C = s.getAttribute(h).split(E), L = /([.?@])?(.*)/.exec(w);
315
- n.push({ type: 1, index: i, name: L[2], strings: C, ctor: L[1] === "." ? je : L[1] === "?" ? Be : L[1] === "@" ? De : ct }), s.removeAttribute(h);
316
- } else h.startsWith(E) && (n.push({ type: 6, index: i }), s.removeAttribute(h));
314
+ const y = c[a++], C = s.getAttribute(h).split(E), L = /([.?@])?(.*)/.exec(y);
315
+ l.push({ type: 1, index: i, name: L[2], strings: C, ctor: L[1] === "." ? je : L[1] === "?" ? Be : L[1] === "@" ? De : ct }), s.removeAttribute(h);
316
+ } else h.startsWith(E) && (l.push({ type: 6, index: i }), s.removeAttribute(h));
317
317
  if (ce.test(s.tagName)) {
318
- const h = s.textContent.split(E), w = h.length - 1;
319
- if (w > 0) {
318
+ const h = s.textContent.split(E), y = h.length - 1;
319
+ if (y > 0) {
320
320
  s.textContent = nt ? nt.emptyScript : "";
321
- for (let C = 0; C < w; C++) s.append(h[C], J()), N.nextNode(), n.push({ type: 2, index: ++i });
322
- s.append(h[w], J());
321
+ for (let C = 0; C < y; C++) s.append(h[C], J()), I.nextNode(), l.push({ type: 2, index: ++i });
322
+ s.append(h[y], J());
323
323
  }
324
324
  }
325
- } else if (s.nodeType === 8) if (s.data === le) n.push({ type: 2, index: i });
325
+ } else if (s.nodeType === 8) if (s.data === le) l.push({ type: 2, index: i });
326
326
  else {
327
327
  let h = -1;
328
- for (; (h = s.data.indexOf(E, h + 1)) !== -1; ) n.push({ type: 7, index: i }), h += E.length - 1;
328
+ for (; (h = s.data.indexOf(E, h + 1)) !== -1; ) l.push({ type: 7, index: i }), h += E.length - 1;
329
329
  }
330
330
  i++;
331
331
  }
@@ -336,11 +336,11 @@ let Ct = class pe {
336
336
  }
337
337
  };
338
338
  function D(e, t, o = e, r) {
339
- var a, l;
339
+ var a, n;
340
340
  if (t === T) return t;
341
341
  let s = r !== void 0 ? (a = o._$Co) == null ? void 0 : a[r] : o._$Cl;
342
342
  const i = X(t) ? void 0 : t._$litDirective$;
343
- return (s == null ? void 0 : s.constructor) !== i && ((l = s == null ? void 0 : s._$AO) == null || l.call(s, !1), i === void 0 ? s = void 0 : (s = new i(e), s._$AT(e, o, r)), r !== void 0 ? (o._$Co ?? (o._$Co = []))[r] = s : o._$Cl = s), s !== void 0 && (t = D(e, s._$AS(e, t.values), s, r)), t;
343
+ return (s == null ? void 0 : s.constructor) !== i && ((n = s == null ? void 0 : s._$AO) == null || n.call(s, !1), i === void 0 ? s = void 0 : (s = new i(e), s._$AT(e, o, r)), r !== void 0 ? (o._$Co ?? (o._$Co = []))[r] = s : o._$Cl = s), s !== void 0 && (t = D(e, s._$AS(e, t.values), s, r)), t;
344
344
  }
345
345
  let Ue = class {
346
346
  constructor(t, o) {
@@ -354,16 +354,16 @@ let Ue = class {
354
354
  }
355
355
  u(t) {
356
356
  const { el: { content: o }, parts: r } = this._$AD, s = ((t == null ? void 0 : t.creationScope) ?? M).importNode(o, !0);
357
- N.currentNode = s;
358
- let i = N.nextNode(), a = 0, l = 0, n = r[0];
359
- for (; n !== void 0; ) {
360
- if (a === n.index) {
357
+ I.currentNode = s;
358
+ let i = I.nextNode(), a = 0, n = 0, l = r[0];
359
+ for (; l !== void 0; ) {
360
+ if (a === l.index) {
361
361
  let p;
362
- n.type === 2 ? p = new et(i, i.nextSibling, this, t) : n.type === 1 ? p = new n.ctor(i, n.name, n.strings, this, t) : n.type === 6 && (p = new Ve(i, this, t)), this._$AV.push(p), n = r[++l];
362
+ l.type === 2 ? p = new et(i, i.nextSibling, this, t) : l.type === 1 ? p = new l.ctor(i, l.name, l.strings, this, t) : l.type === 6 && (p = new Ve(i, this, t)), this._$AV.push(p), l = r[++n];
363
363
  }
364
- a !== (n == null ? void 0 : n.index) && (i = N.nextNode(), a++);
364
+ a !== (l == null ? void 0 : l.index) && (i = I.nextNode(), a++);
365
365
  }
366
- return N.currentNode = M, s;
366
+ return I.currentNode = M, s;
367
367
  }
368
368
  p(t) {
369
369
  let o = 0;
@@ -406,8 +406,8 @@ class et {
406
406
  const { values: o, _$litType$: r } = t, s = typeof r == "number" ? this._$AC(t) : (r.el === void 0 && (r.el = Ct.createElement(de(r.h, r.h[0]), this.options)), r);
407
407
  if (((i = this._$AH) == null ? void 0 : i._$AD) === s) this._$AH.p(o);
408
408
  else {
409
- const a = new Ue(s, this), l = a.u(this.options);
410
- a.p(o), this.T(l), this._$AH = a;
409
+ const a = new Ue(s, this), n = a.u(this.options);
410
+ a.p(o), this.T(n), this._$AH = a;
411
411
  }
412
412
  }
413
413
  _$AC(t) {
@@ -448,9 +448,9 @@ class ct {
448
448
  let a = !1;
449
449
  if (i === void 0) t = D(this, t, o, 0), a = !X(t) || t !== this._$AH && t !== T, a && (this._$AH = t);
450
450
  else {
451
- const l = t;
452
- let n, p;
453
- for (t = i[0], n = 0; n < i.length - 1; n++) p = D(this, l[r + n], o, n), p === T && (p = this._$AH[n]), a || (a = !X(p) || p !== this._$AH[n]), p === u ? t = u : t !== u && (t += (p ?? "") + i[n + 1]), this._$AH[n] = p;
451
+ const n = t;
452
+ let l, p;
453
+ for (t = i[0], l = 0; l < i.length - 1; l++) p = D(this, n[r + l], o, l), p === T && (p = this._$AH[l]), a || (a = !X(p) || p !== this._$AH[l]), p === u ? t = u : t !== u && (t += (p ?? "") + i[l + 1]), this._$AH[l] = p;
454
454
  }
455
455
  a && !s && this.j(t);
456
456
  }
@@ -565,18 +565,18 @@ const He = { attribute: !0, type: String, converter: at, reflect: !1, hasChanged
565
565
  let i = globalThis.litPropertyMetadata.get(s);
566
566
  if (i === void 0 && globalThis.litPropertyMetadata.set(s, i = /* @__PURE__ */ new Map()), i.set(o.name, e), r === "accessor") {
567
567
  const { name: a } = o;
568
- return { set(l) {
569
- const n = t.get.call(this);
570
- t.set.call(this, l), this.requestUpdate(a, n, e);
571
- }, init(l) {
572
- return l !== void 0 && this.P(a, void 0, e), l;
568
+ return { set(n) {
569
+ const l = t.get.call(this);
570
+ t.set.call(this, n), this.requestUpdate(a, l, e);
571
+ }, init(n) {
572
+ return n !== void 0 && this.P(a, void 0, e), n;
573
573
  } };
574
574
  }
575
575
  if (r === "setter") {
576
576
  const { name: a } = o;
577
- return function(l) {
578
- const n = this[a];
579
- t.call(this, l), this.requestUpdate(a, n, e);
577
+ return function(n) {
578
+ const l = this[a];
579
+ t.call(this, n), this.requestUpdate(a, l, e);
580
580
  };
581
581
  }
582
582
  throw Error("Unsupported decorator location: " + r);
@@ -597,9 +597,9 @@ function Pt(e) {
597
597
  }
598
598
  var $ = /* @__PURE__ */ ((e) => (e.reaction = "reaction", e.stars = "stars", e.poll = "poll", e.text = "text", e.nps = "nps", e))($ || {});
599
599
  const Ye = "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='M640-160v-280h160v280H640Zm-240%200v-640h160v640H400Zm-240%200v-440h160v440H160Z'/%3e%3c/svg%3e", Ze = "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='M160-160v-440h160v440H160Zm240%200v-400l160%20160v240H400Zm160-354L400-674v-126h160v286Zm240%20240L640-434v-6h160v166Zm-9%20219L55-791l57-57%20736%20736-57%2057Z'/%3e%3c/svg%3e", Ke = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='24px'%20viewBox='0%20-960%20960%20960'%20width='24px'%20fill='currentColor'%3e%3cpath%20d='M200-200h57l391-391-57-57-391%20391v57Zm-80%2080v-170l528-527q12-11%2026.5-17t30.5-6q16%200%2031%206t26%2018l55%2056q12%2011%2017.5%2026t5.5%2030q0%2016-5.5%2030.5T817-647L290-120H120Zm640-584-56-56%2056%2056Zm-141%2085-28-29%2057%2057-29-28Z'/%3e%3c/svg%3e", Ge = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='16'%20height='16'%20fill='%23666666'%20class='bi%20bi-x'%20viewBox='0%200%2016%2016'%3e%3cpath%20d='M4.646%204.646a.5.5%200%200%201%20.708%200L8%207.293l2.646-2.647a.5.5%200%200%201%20.708.708L8.707%208l2.647%202.646a.5.5%200%200%201-.708.708L8%208.707l-2.646%202.647a.5.5%200%200%201-.708-.708L7.293%208%204.646%205.354a.5.5%200%200%201%200-.708'/%3e%3c/svg%3e";
600
- var We = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, A = function(e) {
600
+ var We = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, k = function(e) {
601
601
  return typeof e == "string" ? e.length > 0 : typeof e == "number";
602
- }, y = function(e, t, o) {
602
+ }, w = function(e, t, o) {
603
603
  return t === void 0 && (t = 0), o === void 0 && (o = Math.pow(10, t)), Math.round(o * e) / o + 0;
604
604
  }, x = function(e, t, o) {
605
605
  return t === void 0 && (t = 0), o === void 0 && (o = 1), e > o ? o : e > t ? e : t;
@@ -608,22 +608,22 @@ var We = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, A = function(e) {
608
608
  }, Yt = function(e) {
609
609
  return { r: x(e.r, 0, 255), g: x(e.g, 0, 255), b: x(e.b, 0, 255), a: x(e.a) };
610
610
  }, vt = function(e) {
611
- return { r: y(e.r), g: y(e.g), b: y(e.b), a: y(e.a, 3) };
611
+ return { r: w(e.r), g: w(e.g), b: w(e.b), a: w(e.a, 3) };
612
612
  }, Je = /^#([0-9a-f]{3,8})$/i, rt = function(e) {
613
613
  var t = e.toString(16);
614
614
  return t.length < 2 ? "0" + t : t;
615
615
  }, he = function(e) {
616
- 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;
617
- return { h: 60 * (l < 0 ? l + 6 : l), s: i ? a / i * 100 : 0, v: i / 255 * 100, a: s };
616
+ 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), n = a ? i === t ? (o - r) / a : i === o ? 2 + (r - t) / a : 4 + (t - o) / a : 0;
617
+ return { h: 60 * (n < 0 ? n + 6 : n), s: i ? a / i * 100 : 0, v: i / 255 * 100, a: s };
618
618
  }, fe = function(e) {
619
619
  var t = e.h, o = e.s, r = e.v, s = e.a;
620
620
  t = t / 360 * 6, o /= 100, r /= 100;
621
- var i = Math.floor(t), a = r * (1 - o), l = r * (1 - (t - i) * o), n = r * (1 - (1 - t + i) * o), p = i % 6;
622
- return { r: 255 * [r, l, a, a, n, r][p], g: 255 * [n, r, r, l, a, a][p], b: 255 * [a, a, n, r, r, l][p], a: s };
621
+ var i = Math.floor(t), a = r * (1 - o), n = r * (1 - (t - i) * o), l = r * (1 - (1 - t + i) * o), p = i % 6;
622
+ return { r: 255 * [r, n, a, a, l, r][p], g: 255 * [l, r, r, n, a, a][p], b: 255 * [a, a, l, r, r, n][p], a: s };
623
623
  }, Zt = function(e) {
624
624
  return { h: ue(e.h), s: x(e.s, 0, 100), l: x(e.l, 0, 100), a: x(e.a) };
625
625
  }, Kt = function(e) {
626
- return { h: y(e.h), s: y(e.s), l: y(e.l), a: y(e.a, 3) };
626
+ return { h: w(e.h), s: w(e.s), l: w(e.l), a: w(e.a, 3) };
627
627
  }, Gt = function(e) {
628
628
  return fe((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 }));
629
629
  var t, o, r;
@@ -632,7 +632,7 @@ var We = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, A = function(e) {
632
632
  var t, o, r, s;
633
633
  }, Xe = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, Qe = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, to = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, eo = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, Wt = { string: [[function(e) {
634
634
  var t = Je.exec(e);
635
- return t ? (e = t[1]).length <= 4 ? { r: parseInt(e[0] + e[0], 16), g: parseInt(e[1] + e[1], 16), b: parseInt(e[2] + e[2], 16), a: e.length === 4 ? y(parseInt(e[3] + e[3], 16) / 255, 2) : 1 } : e.length === 6 || e.length === 8 ? { r: parseInt(e.substr(0, 2), 16), g: parseInt(e.substr(2, 2), 16), b: parseInt(e.substr(4, 2), 16), a: e.length === 8 ? y(parseInt(e.substr(6, 2), 16) / 255, 2) : 1 } : null : null;
635
+ return t ? (e = t[1]).length <= 4 ? { r: parseInt(e[0] + e[0], 16), g: parseInt(e[1] + e[1], 16), b: parseInt(e[2] + e[2], 16), a: e.length === 4 ? w(parseInt(e[3] + e[3], 16) / 255, 2) : 1 } : e.length === 6 || e.length === 8 ? { r: parseInt(e.substr(0, 2), 16), g: parseInt(e.substr(2, 2), 16), b: parseInt(e.substr(4, 2), 16), a: e.length === 8 ? w(parseInt(e.substr(6, 2), 16) / 255, 2) : 1 } : null : null;
636
636
  }, "hex"], [function(e) {
637
637
  var t = to.exec(e) || eo.exec(e);
638
638
  return t ? t[2] !== t[4] || t[4] !== t[6] ? null : Yt({ r: Number(t[1]) / (t[2] ? 100 / 255 : 1), g: Number(t[3]) / (t[4] ? 100 / 255 : 1), b: Number(t[5]) / (t[6] ? 100 / 255 : 1), a: t[7] === void 0 ? 1 : Number(t[7]) / (t[8] ? 100 : 1) }) : null;
@@ -643,17 +643,17 @@ var We = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, A = function(e) {
643
643
  return Gt(s);
644
644
  }, "hsl"]], object: [[function(e) {
645
645
  var t = e.r, o = e.g, r = e.b, s = e.a, i = s === void 0 ? 1 : s;
646
- return A(t) && A(o) && A(r) ? Yt({ r: Number(t), g: Number(o), b: Number(r), a: Number(i) }) : null;
646
+ return k(t) && k(o) && k(r) ? Yt({ r: Number(t), g: Number(o), b: Number(r), a: Number(i) }) : null;
647
647
  }, "rgb"], [function(e) {
648
648
  var t = e.h, o = e.s, r = e.l, s = e.a, i = s === void 0 ? 1 : s;
649
- if (!A(t) || !A(o) || !A(r)) return null;
649
+ if (!k(t) || !k(o) || !k(r)) return null;
650
650
  var a = Zt({ h: Number(t), s: Number(o), l: Number(r), a: Number(i) });
651
651
  return Gt(a);
652
652
  }, "hsl"], [function(e) {
653
653
  var t = e.h, o = e.s, r = e.v, s = e.a, i = s === void 0 ? 1 : s;
654
- if (!A(t) || !A(o) || !A(r)) return null;
655
- var a = function(l) {
656
- return { h: ue(l.h), s: x(l.s, 0, 100), v: x(l.v, 0, 100), a: x(l.a) };
654
+ if (!k(t) || !k(o) || !k(r)) return null;
655
+ var a = function(n) {
656
+ return { h: ue(n.h), s: x(n.s, 0, 100), v: x(n.v, 0, 100), a: x(n.a) };
657
657
  }({ h: Number(t), s: Number(o), v: Number(r), a: Number(i) });
658
658
  return fe(a);
659
659
  }, "hsv"]] }, Jt = function(e, t) {
@@ -679,13 +679,13 @@ var We = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, A = function(e) {
679
679
  return e.prototype.isValid = function() {
680
680
  return this.parsed !== null;
681
681
  }, e.prototype.brightness = function() {
682
- return y(wt(this.rgba), 2);
682
+ return w(wt(this.rgba), 2);
683
683
  }, e.prototype.isDark = function() {
684
684
  return wt(this.rgba) < 0.5;
685
685
  }, e.prototype.isLight = function() {
686
686
  return wt(this.rgba) >= 0.5;
687
687
  }, e.prototype.toHex = function() {
688
- return t = vt(this.rgba), o = t.r, r = t.g, s = t.b, a = (i = t.a) < 1 ? rt(y(255 * i)) : "", "#" + rt(o) + rt(r) + rt(s) + a;
688
+ return t = vt(this.rgba), o = t.r, r = t.g, s = t.b, a = (i = t.a) < 1 ? rt(w(255 * i)) : "", "#" + rt(o) + rt(r) + rt(s) + a;
689
689
  var t, o, r, s, i, a;
690
690
  }, e.prototype.toRgb = function() {
691
691
  return vt(this.rgba);
@@ -698,7 +698,7 @@ var We = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, A = function(e) {
698
698
  return t = Kt(W(this.rgba)), o = t.h, r = t.s, s = t.l, (i = t.a) < 1 ? "hsla(" + o + ", " + r + "%, " + s + "%, " + i + ")" : "hsl(" + o + ", " + r + "%, " + s + "%)";
699
699
  var t, o, r, s, i;
700
700
  }, e.prototype.toHsv = function() {
701
- return t = he(this.rgba), { h: y(t.h), s: y(t.s), v: y(t.v), a: y(t.a, 3) };
701
+ return t = he(this.rgba), { h: w(t.h), s: w(t.s), v: w(t.v), a: w(t.a, 3) };
702
702
  var t;
703
703
  }, e.prototype.invert = function() {
704
704
  return S({ r: 255 - (t = this.rgba).r, g: 255 - t.g, b: 255 - t.b, a: t.a });
@@ -716,11 +716,11 @@ var We = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, A = function(e) {
716
716
  }, e.prototype.rotate = function(t) {
717
717
  return t === void 0 && (t = 15), this.hue(this.hue() + t);
718
718
  }, e.prototype.alpha = function(t) {
719
- return typeof t == "number" ? S({ r: (o = this.rgba).r, g: o.g, b: o.b, a: t }) : y(this.rgba.a, 3);
719
+ return typeof t == "number" ? S({ r: (o = this.rgba).r, g: o.g, b: o.b, a: t }) : w(this.rgba.a, 3);
720
720
  var o;
721
721
  }, e.prototype.hue = function(t) {
722
722
  var o = W(this.rgba);
723
- return typeof t == "number" ? S({ h: t, s: o.s, l: o.l, a: o.a }) : y(o.h);
723
+ return typeof t == "number" ? S({ h: t, s: o.s, l: o.l, a: o.a }) : w(o.h);
724
724
  }, e.prototype.isEqual = function(t) {
725
725
  return this.toHex() === S(t).toHex();
726
726
  }, e;
@@ -772,8 +772,8 @@ function xt(e, t) {
772
772
  return (s + 0.05) / (i + 0.05);
773
773
  }
774
774
  function te(e) {
775
- const t = no(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);
776
- return 0.2126 * i + 0.7152 * a + 0.0722 * l;
775
+ const t = no(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), n = s <= 0.03928 ? s / 12.92 : Math.pow((s + 0.055) / 1.055, 2.4);
776
+ return 0.2126 * i + 0.7152 * a + 0.0722 * n;
777
777
  }
778
778
  function ao(e, t = {}) {
779
779
  if (!S(e).isValid())
@@ -786,25 +786,25 @@ function ao(e, t = {}) {
786
786
  dark: "#343a40"
787
787
  },
788
788
  fallback: a = "white"
789
- } = t, l = s.map((c) => c === "black" ? "#000000" : c === "white" ? "#ffffff" : c === "light" ? i.light || "#f8f9fa" : c === "dark" ? i.dark || "#343a40" : c);
790
- let n = a, p = 0;
791
- for (const c of l) {
789
+ } = t, n = s.map((c) => c === "black" ? "#000000" : c === "white" ? "#ffffff" : c === "light" ? i.light || "#f8f9fa" : c === "dark" ? i.dark || "#343a40" : c);
790
+ let l = a, p = 0;
791
+ for (const c of n) {
792
792
  const h = xt(e, c);
793
- h >= r && h > p && (p = h, n = c);
793
+ h >= r && h > p && (p = h, l = c);
794
794
  }
795
795
  if (p === 0) {
796
796
  const c = xt(e, a);
797
- n = a, p = c;
798
- for (const h of l) {
797
+ l = a, p = c;
798
+ for (const h of n) {
799
799
  if (h === a) continue;
800
- const w = xt(e, h);
801
- w > p && (p = w, n = h);
800
+ const y = xt(e, h);
801
+ y > p && (p = y, l = h);
802
802
  }
803
803
  b.warn(
804
- `No color option met the minimum contrast ratio of ${r}:1 against ${e}. Using ${n} with contrast ratio ${p.toFixed(2)}:1 instead.`
804
+ `No color option met the minimum contrast ratio of ${r}:1 against ${e}. Using ${l} with contrast ratio ${p.toFixed(2)}:1 instead.`
805
805
  );
806
806
  }
807
- return n;
807
+ return l;
808
808
  }
809
809
  function no(e) {
810
810
  const o = io(e) || e, r = S(o);
@@ -813,7 +813,7 @@ function no(e) {
813
813
  const { r: s, g: i, b: a } = r.toRgb();
814
814
  return { r: s, g: i, b: a };
815
815
  }
816
- function k(e, t) {
816
+ function A(e, t) {
817
817
  const r = t ? {
818
818
  left: "start",
819
819
  right: "end",
@@ -909,7 +909,7 @@ function fo(e) {
909
909
  let t = e;
910
910
  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;
911
911
  }
912
- const ee = "https://jpxwfjorwcsrqraorpbj.supabase.co/functions/v1/data", mo = "pc_session_id", bo = 24 * 60 * 60 * 1e3;
912
+ const ee = typeof window < "u" && window.PC_DATA_ENDPOINT || "https://jpxwfjorwcsrqraorpbj.supabase.co/functions/v1/data", mo = "pc_session_id", bo = 24 * 60 * 60 * 1e3;
913
913
  function oe() {
914
914
  return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : (b.warn("crypto.randomUUID not available, using fallback UUID generator"), "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
915
915
  const t = Math.random() * 16 | 0;
@@ -978,8 +978,8 @@ function lt(e) {
978
978
  return 0;
979
979
  let t = 0, o = 0, r = 0;
980
980
  for (let a = 0; a <= 10; a++) {
981
- const l = a.toString(), n = Math.max(0, e[l] || 0);
982
- r += n, a >= 9 ? t += n : a >= 7 || (o += n);
981
+ const n = a.toString(), l = Math.max(0, e[n] || 0);
982
+ r += l, a >= 9 ? t += l : a >= 7 || (o += l);
983
983
  }
984
984
  if (r === 0)
985
985
  return 0;
@@ -1095,10 +1095,10 @@ function Co(e, t) {
1095
1095
  o ^= r.charCodeAt(s), o += (o << 1) + (o << 4) + (o << 7) + (o << 8) + (o << 24);
1096
1096
  return (o >>> 0).toString(16).padStart(8, "0");
1097
1097
  }
1098
- function ko(e, t = 50) {
1098
+ function Ao(e, t = 50) {
1099
1099
  return e.length <= t ? e : e.substring(0, t).trim() + "...";
1100
1100
  }
1101
- class Ao {
1101
+ class ko {
1102
1102
  constructor(t) {
1103
1103
  this.stats = P(), this.localStats = P(), this.isLoading = !0, this.isSubmitting = !1, (this.host = t).addController(this);
1104
1104
  }
@@ -1129,24 +1129,30 @@ class Ao {
1129
1129
  const o = await this.getProjectId(), r = t.name, s = t.type;
1130
1130
  if (!r)
1131
1131
  throw new Error("Name parameter is required");
1132
- const i = `${ee}/${encodeURIComponent(o)}/${encodeURIComponent(r)}`;
1133
- b.debug(`Fetching stats for: ${r}`, { projectKey: o });
1134
- const a = await fetch(i);
1135
- if (!a.ok)
1136
- throw new Error(`API request failed with status: ${a.status}`);
1137
- const l = await a.json();
1138
- if (!l.success)
1139
- throw b.error("Backend returned unsuccessful response", l), new Error("Backend returned unsuccessful response");
1140
- const n = l.data || {}, p = n.count > 0 ? Math.round(n.sum / n.count) : 0, c = Math.round(n.sum / n.count * 100), h = {
1132
+ const i = typeof window < "u" && window.PC_DATA_FUNC;
1133
+ let a;
1134
+ if (i && typeof i == "function")
1135
+ b.debug(`Using PC_DATA_FUNC for: ${r}`, { projectKey: o }), a = await i(o, r);
1136
+ else {
1137
+ const h = `${ee}/${encodeURIComponent(o)}/${encodeURIComponent(r)}`;
1138
+ b.debug(`Fetching stats for: ${r}`, { projectKey: o });
1139
+ const y = await fetch(h);
1140
+ if (!y.ok)
1141
+ throw new Error(`API request failed with status: ${y.status}`);
1142
+ a = await y.json();
1143
+ }
1144
+ if (!a.success)
1145
+ throw b.error("Backend returned unsuccessful response", a), new Error("Backend returned unsuccessful response");
1146
+ const n = a.data || {}, l = n.count > 0 ? Math.round(n.sum / n.count) : 0, p = Math.round(n.sum / n.count * 100), c = {
1141
1147
  count: n.count ?? 0,
1142
1148
  sum: n.sum,
1143
- avg: p,
1144
- pct: c,
1149
+ avg: l,
1150
+ pct: p,
1145
1151
  nps: s === $.nps ? lt((n == null ? void 0 : n.breakdown) || {}) : 0,
1146
1152
  breakdown: n.breakdown ?? {},
1147
1153
  updated: n.updated_at || (/* @__PURE__ */ new Date()).toISOString()
1148
1154
  };
1149
- this.stats = h;
1155
+ this.stats = c;
1150
1156
  } catch (o) {
1151
1157
  throw b.error("Error loading stats:", o, this.localStats), o;
1152
1158
  } finally {
@@ -1210,27 +1216,27 @@ class Ao {
1210
1216
  async submitStats() {
1211
1217
  if (!this.hasLocalStats())
1212
1218
  throw b.warn("No local stats to submit"), new Error("No local stats to submit");
1213
- const t = this.host, o = Math.floor(Date.now() / 1e3).toString(), r = await re(), s = await this.getProjectId(), i = t.name || "", a = this.localStats.sum, l = Object.keys(this.localStats.breakdown || {});
1219
+ const t = this.host, o = Math.floor(Date.now() / 1e3).toString(), r = await re(), s = await this.getProjectId(), i = t.name || "", a = this.localStats.sum, n = Object.keys(this.localStats.breakdown || {});
1214
1220
  this.isSubmitting = !0, this.host.requestUpdate();
1215
- const n = {
1221
+ const l = {
1216
1222
  sessionId: r,
1217
1223
  projectId: s,
1218
1224
  widgetName: i,
1219
1225
  widgetType: t.type,
1220
1226
  url: window.location.href,
1221
1227
  numericValue: a,
1222
- textValues: l,
1228
+ textValues: n,
1223
1229
  tags: t.tags,
1224
1230
  timestamp: o
1225
- }, p = Co(JSON.stringify(n), o);
1231
+ }, p = Co(JSON.stringify(l), o);
1226
1232
  try {
1227
- await this.sendStats({ ...n, hash: p }), await this.markStatsAsSubmitted();
1233
+ await this.sendStats({ ...l, hash: p }), await this.markStatsAsSubmitted();
1228
1234
  } catch (c) {
1229
1235
  b.warn("Failed to send stats event", c);
1230
1236
  } finally {
1231
1237
  this.isSubmitting = !1, this.host.requestUpdate();
1232
1238
  }
1233
- return n;
1239
+ return l;
1234
1240
  }
1235
1241
  async sendStats(t) {
1236
1242
  const o = JSON.stringify(t), r = `${ee}`;
@@ -1283,8 +1289,8 @@ class Ao {
1283
1289
  }
1284
1290
  getBreakdownInfo() {
1285
1291
  var i;
1286
- const t = ((i = this.stats) == null ? void 0 : i.breakdown) || {}, o = Object.values(t).reduce((a, l) => a + l, 0), r = t, s = Object.fromEntries(
1287
- Object.entries(t).map(([a, l]) => [a, l / o * 100])
1292
+ const t = ((i = this.stats) == null ? void 0 : i.breakdown) || {}, o = Object.values(t).reduce((a, n) => a + n, 0), r = t, s = Object.fromEntries(
1293
+ Object.entries(t).map(([a, n]) => [a, n / o * 100])
1288
1294
  );
1289
1295
  return { totalCount: o, breakdownCount: r, breakdownPercentage: s };
1290
1296
  }
@@ -1298,16 +1304,16 @@ class Ao {
1298
1304
  let a = 1;
1299
1305
  if ((i.type === $.stars || i.type === $.nps) && (a = parseInt(t)), s)
1300
1306
  if (o) {
1301
- const n = r.filter((p) => p !== t);
1302
- this.updateStats(n.length > 0 ? 1 : 0, n);
1307
+ const l = r.filter((p) => p !== t);
1308
+ this.updateStats(l.length > 0 ? 1 : 0, l);
1303
1309
  } else
1304
1310
  this.updateStats(0, []);
1305
1311
  else
1306
1312
  o ? this.updateStats(a, [...r, t]) : this.updateStats(a, [t]);
1307
- const l = i.options.find((n) => n.value === t);
1308
- l && i.announceSelectionChange(
1313
+ const n = i.options.find((l) => l.value === t);
1314
+ n && i.announceSelectionChange(
1309
1315
  i.question || i.name || i.type || "PollCatch Widget",
1310
- l,
1316
+ n,
1311
1317
  this.isValueSelected(t)
1312
1318
  );
1313
1319
  }
@@ -1418,10 +1424,10 @@ function ye(e, t = {}) {
1418
1424
  o === "functional" && !r && !s && console.warn(
1419
1425
  "No alt text or aria-label provided for functional icon. This may cause accessibility issues."
1420
1426
  );
1421
- const a = i ? " (selected)" : "", l = Tt(e) && !r ? "" : r || e, n = s || (l ? `${l}${a}` : a);
1427
+ const a = i ? " (selected)" : "", n = Tt(e) && !r ? "" : r || e, l = s || (n ? `${n}${a}` : a);
1422
1428
  return {
1423
- alt: l,
1424
- ariaLabel: n,
1429
+ alt: n,
1430
+ ariaLabel: l,
1425
1431
  ariaHidden: !1
1426
1432
  };
1427
1433
  }
@@ -1496,7 +1502,7 @@ const st = {
1496
1502
  desktop: "1024px"
1497
1503
  }, Mt = class Mt extends j {
1498
1504
  constructor() {
1499
- super(...arguments), this.dataController = new Ao(this), this.displayController = new _o(this, this.dataController), this.hasEditButton = !0, this.showStats = "never", this.showChart = !1, this.initialized = !1, this.lockAnswer = !1, this.ariaLabel = null, this.minContrast = me.AA_NORMAL, this.options = [], this.project = "public", this.questionPosition = "top", this.statsText = "{count} votes", this.buttonText = "Submit", this.buttonRadius = "sm", this.multiple = !1, this.readOnly = !1, this.handleEditToggleKeyDown = (t) => {
1505
+ super(...arguments), this.dataController = new ko(this), this.displayController = new _o(this, this.dataController), this.hasEditButton = !0, this.showStats = "never", this.showChart = !1, this.initialized = !1, this.lockAnswer = !1, this.ariaLabel = null, this.minContrast = me.AA_NORMAL, this.options = [], this.project = "public", this.questionPosition = "top", this.statsText = "{count} votes", this.buttonText = "Submit", this.buttonRadius = "sm", this.multiple = !1, this.readOnly = !1, this.handleEditToggleKeyDown = (t) => {
1500
1506
  (t.key === "Enter" || t.key === " ") && (t.preventDefault(), this.handleEnterEditMode());
1501
1507
  };
1502
1508
  }
@@ -1662,7 +1668,7 @@ const st = {
1662
1668
  return u;
1663
1669
  const o = {
1664
1670
  "pc-status": !0,
1665
- [`pc-flex-content-${k(this.statsPosition, this.statsAlign)}`]: !0
1671
+ [`pc-flex-content-${A(this.statsPosition, this.statsAlign)}`]: !0
1666
1672
  };
1667
1673
  return d`<div class="${v(o)}" data-testid="pc-status">
1668
1674
  ${this.renderStatsText()} ${this.renderChartToggle()} ${this.renderEditToggleIcon()}
@@ -1680,7 +1686,7 @@ const st = {
1680
1686
  renderThankYouMessage() {
1681
1687
  if (!this.displayController.shouldDisplayThankYouMsg())
1682
1688
  return u;
1683
- const t = ko(this.thankYouMsg || "");
1689
+ const t = Ao(this.thankYouMsg || "");
1684
1690
  return d`
1685
1691
  <div class="pc-thank-you-overlay" data-testid="poll-thank-you-overlay">
1686
1692
  <div class="pc-thank-you" data-testid="thank-you">
@@ -2510,7 +2516,7 @@ const To = H`
2510
2516
  }
2511
2517
  }
2512
2518
  `;
2513
- function It(e, t = {}) {
2519
+ function Nt(e, t = {}) {
2514
2520
  if (!e || e.length === 0)
2515
2521
  return d`<div class="pc-bar-chart pc-bar-chart--empty">No data available</div>`;
2516
2522
  const o = Math.max(...e.map((i) => i.value)), s = { ...{
@@ -2522,15 +2528,15 @@ function It(e, t = {}) {
2522
2528
  return d`
2523
2529
  <div class="pc-bar-chart">
2524
2530
  ${e.map((i) => {
2525
- const l = `
2531
+ const n = `
2526
2532
  width: ${o > 0 ? i.value / o * s.maxWidth : 0}%;
2527
2533
  background-color: ${s.barColor};
2528
- `, n = s.labelFormatter(i), p = i.label ? d`<span class="pc-bar-label-text">${n}</span>` : u, c = !i.label && i.icon ? d`<span class="pc-bar-label-icon">${i.icon}</span>` : u;
2534
+ `, l = s.labelFormatter(i), p = i.label ? d`<span class="pc-bar-label-text">${l}</span>` : u, c = !i.label && i.icon ? d`<span class="pc-bar-label-icon">${i.icon}</span>` : u;
2529
2535
  return d`
2530
2536
  <div class="pc-bar-row">
2531
2537
  <div class="pc-bar-label">${p} ${c}</div>
2532
2538
  <div class="pc-bar-container">
2533
- <div class="pc-bar" style="${l}"></div>
2539
+ <div class="pc-bar" style="${n}"></div>
2534
2540
  <div class="pc-bar-value">${s.valueFormatter(i)}</div>
2535
2541
  </div>
2536
2542
  </div>
@@ -2539,8 +2545,8 @@ function It(e, t = {}) {
2539
2545
  </div>
2540
2546
  `;
2541
2547
  }
2542
- var zo = Object.defineProperty, Io = Object.getOwnPropertyDescriptor, F = (e, t, o, r) => {
2543
- for (var s = r > 1 ? void 0 : r ? Io(t, o) : t, i = e.length - 1, a; i >= 0; i--)
2548
+ var zo = Object.defineProperty, No = Object.getOwnPropertyDescriptor, F = (e, t, o, r) => {
2549
+ for (var s = r > 1 ? void 0 : r ? No(t, o) : t, i = e.length - 1, a; i >= 0; i--)
2544
2550
  (a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
2545
2551
  return r && s && zo(t, o, s), s;
2546
2552
  };
@@ -2564,7 +2570,7 @@ let z = class extends m {
2564
2570
  const i = this.dataController.isValueSelected(String(s)), a = {
2565
2571
  "nps-button": !0,
2566
2572
  selected: i
2567
- }, l = po(`Rate ${s}`, i, !1);
2573
+ }, n = po(`Rate ${s}`, i, !1);
2568
2574
  return d`
2569
2575
  <button
2570
2576
  data-testid="nps-button-${s}"
@@ -2578,7 +2584,7 @@ let z = class extends m {
2578
2584
  @keydown="${this.handleKeyDown}"
2579
2585
  tabindex="0"
2580
2586
  id="${t}-option-${s}"
2581
- ...=${l}
2587
+ ...=${n}
2582
2588
  >
2583
2589
  ${s}
2584
2590
  </button>
@@ -2608,13 +2614,13 @@ let z = class extends m {
2608
2614
  renderChart() {
2609
2615
  var a;
2610
2616
  if (!this.displayController.shouldShowChart()) return u;
2611
- const e = ((a = this.dataController.stats) == null ? void 0 : a.breakdown) || {}, t = Object.values(e).reduce((l, n) => l + n, 0), o = Object.entries(e).map(([l, n]) => ({
2612
- label: l,
2613
- value: n
2614
- })), s = getComputedStyle(this).getPropertyValue("--pc-accent-color").trim() || "#ffc107", i = It(o, {
2617
+ const e = ((a = this.dataController.stats) == null ? void 0 : a.breakdown) || {}, t = Object.values(e).reduce((n, l) => n + l, 0), o = Object.entries(e).map(([n, l]) => ({
2618
+ label: n,
2619
+ value: l
2620
+ })), s = getComputedStyle(this).getPropertyValue("--pc-accent-color").trim() || "#ffc107", i = Nt(o, {
2615
2621
  barColor: s,
2616
- labelFormatter: (l) => `${l.label}`,
2617
- valueFormatter: (l) => `${t > 0 ? Math.round(l.value / t * 100) : 0}%`
2622
+ labelFormatter: (n) => `${n.label}`,
2623
+ valueFormatter: (n) => `${t > 0 ? Math.round(n.value / t * 100) : 0}%`
2618
2624
  });
2619
2625
  return d`
2620
2626
  <div class="pc-stats-chart pc-stats-chart-inline visible" data-testid="stars-chart">
@@ -2655,11 +2661,11 @@ let z = class extends m {
2655
2661
  render() {
2656
2662
  const e = {
2657
2663
  [`pc-flex-pos-${this.questionPosition}`]: !0,
2658
- [`pc-flex-align-${k(this.questionPosition, this.questionAlign)}`]: !0
2664
+ [`pc-flex-align-${A(this.questionPosition, this.questionAlign)}`]: !0
2659
2665
  }, t = {
2660
2666
  nps: !0,
2661
2667
  [`pc-flex-pos-${this.statsPosition}`]: !0,
2662
- [`pc-flex-align-${k(this.statsPosition, this.statsAlign)}`]: !0
2668
+ [`pc-flex-align-${A(this.statsPosition, this.statsAlign)}`]: !0
2663
2669
  };
2664
2670
  return d`
2665
2671
  <div class="pc-container ${v(e)}" data-testid="nps-container">
@@ -2691,7 +2697,7 @@ F([
2691
2697
  z = F([
2692
2698
  ot("pc-nps")
2693
2699
  ], z);
2694
- const No = H`
2700
+ const Io = H`
2695
2701
  /* CSS variables inherit from parent - defaults are specified at usage sites */
2696
2702
 
2697
2703
  .pc-container {
@@ -2948,7 +2954,7 @@ const No = H`
2948
2954
  visibility: hidden;
2949
2955
  }
2950
2956
  `;
2951
- var Mo = Object.defineProperty, Lo = Object.getOwnPropertyDescriptor, Nt = (e, t, o, r) => {
2957
+ var Mo = Object.defineProperty, Lo = Object.getOwnPropertyDescriptor, It = (e, t, o, r) => {
2952
2958
  for (var s = r > 1 ? void 0 : r ? Lo(t, o) : t, i = e.length - 1, a; i >= 0; i--)
2953
2959
  (a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
2954
2960
  return r && s && Mo(t, o, s), s;
@@ -2960,7 +2966,7 @@ let Q = class extends m {
2960
2966
  renderStatus() {
2961
2967
  const t = {
2962
2968
  "pc-status": !0,
2963
- [`pc-flex-content-${k("bottom", this.statsAlign)}`]: !0
2969
+ [`pc-flex-content-${A("bottom", this.statsAlign)}`]: !0
2964
2970
  };
2965
2971
  return d`<div class="${v(t)}" data-testid="pc-status">
2966
2972
  <span>${this.renderStatsText()} ${this.renderEditToggleIcon("stats-edit-button")}</span>
@@ -3048,7 +3054,7 @@ let Q = class extends m {
3048
3054
  selected: o,
3049
3055
  "poll-option--compact": this.compact,
3050
3056
  "poll-option--disabled": r
3051
- }, i = t + 1, a = `poll-${this.type}-${i}`, l = uo(
3057
+ }, i = t + 1, a = `poll-${this.type}-${i}`, n = uo(
3052
3058
  e.label,
3053
3059
  o,
3054
3060
  r,
@@ -3063,7 +3069,7 @@ let Q = class extends m {
3063
3069
  ?disabled="${r}"
3064
3070
  id="${a}-option-${t}"
3065
3071
  title="${e.tooltip || ""}"
3066
- ...=${l}
3072
+ ...=${n}
3067
3073
  >
3068
3074
  <div class="poll-option-content">
3069
3075
  ${this.renderSelectionIndicator()} ${this.renderOptionIcon(e)}
@@ -3100,13 +3106,13 @@ let Q = class extends m {
3100
3106
  * Render chart that replaces poll options when showing
3101
3107
  */
3102
3108
  renderBarChart() {
3103
- var n, p;
3104
- const e = ((n = this.dataController.stats) == null ? void 0 : n.breakdown) || {}, t = ((p = this.dataController.localStats) == null ? void 0 : p.breakdown) || {}, o = Object.values(e).reduce((c, h) => c + h, 0), r = this.options.map((c, h) => {
3105
- const w = e[c.value] || 0, C = o > 0 ? Math.round(w / o * 100) : 0, L = (t[c.value] || 0) > 0;
3109
+ var l, p;
3110
+ const e = ((l = this.dataController.stats) == null ? void 0 : l.breakdown) || {}, t = ((p = this.dataController.localStats) == null ? void 0 : p.breakdown) || {}, o = Object.values(e).reduce((c, h) => c + h, 0), r = this.options.map((c, h) => {
3111
+ const y = e[c.value] || 0, C = o > 0 ? Math.round(y / o * 100) : 0, L = (t[c.value] || 0) > 0;
3106
3112
  return {
3107
3113
  option: c,
3108
3114
  index: h,
3109
- voteCount: w,
3115
+ voteCount: y,
3110
3116
  percentage: C,
3111
3117
  isSelected: L
3112
3118
  };
@@ -3190,10 +3196,10 @@ let Q = class extends m {
3190
3196
  ` : this.displayController.shouldShowChart() ? d`<div class="pc-section">${this.renderBarChart()}</div>` : d`<div class="pc-section">${this.renderPollOptions()}</div>`;
3191
3197
  }
3192
3198
  render() {
3193
- const e = k(this.questionPosition, this.questionAlign), t = {
3199
+ const e = A(this.questionPosition, this.questionAlign), t = {
3194
3200
  [`pc-flex-pos-${this.questionPosition}`]: !0,
3195
3201
  [`pc-flex-align-${e}`]: !0
3196
- }, o = k(this.statsPosition, this.statsAlign), r = {
3202
+ }, o = A(this.statsPosition, this.statsAlign), r = {
3197
3203
  "pc-body": !0,
3198
3204
  [`pc-flex-pos-${this.statsPosition}`]: !0,
3199
3205
  [`pc-flex-align-${o}`]: !0
@@ -3216,14 +3222,14 @@ let Q = class extends m {
3216
3222
  `;
3217
3223
  }
3218
3224
  };
3219
- Q.styles = [...m.styles, dt, No];
3220
- Nt([
3225
+ Q.styles = [...m.styles, dt, Io];
3226
+ It([
3221
3227
  f({ type: Boolean })
3222
3228
  ], Q.prototype, "multiple", 2);
3223
- Nt([
3229
+ It([
3224
3230
  f({ type: Boolean })
3225
3231
  ], Q.prototype, "compact", 2);
3226
- Q = Nt([
3232
+ Q = It([
3227
3233
  ot("pc-poll")
3228
3234
  ], Q);
3229
3235
  const Ro = H`
@@ -3364,25 +3370,25 @@ let V = class extends m {
3364
3370
  renderStars() {
3365
3371
  var i, a;
3366
3372
  if (this.displayController.shouldShowChart()) return u;
3367
- const e = ((i = this.dataController.stats) == null ? void 0 : i.avg) || 0, t = ((a = this.dataController.localStats) == null ? void 0 : a.avg) || 0, o = this.readOnly ? e : t, r = this.displayController.allowEdit(), s = Array.from({ length: this.numStars }, (l, n) => n + 1).map((l) => {
3368
- const n = l <= Math.floor(o) || l <= (this.hoverValue || 0), p = !n && l === Math.ceil(o) && o % 1 !== 0, c = {
3373
+ const e = ((i = this.dataController.stats) == null ? void 0 : i.avg) || 0, t = ((a = this.dataController.localStats) == null ? void 0 : a.avg) || 0, o = this.readOnly ? e : t, r = this.displayController.allowEdit(), s = Array.from({ length: this.numStars }, (n, l) => l + 1).map((n) => {
3374
+ const l = n <= Math.floor(o) || n <= (this.hoverValue || 0), p = !l && n === Math.ceil(o) && o % 1 !== 0, c = {
3369
3375
  star: !0,
3370
- selected: n,
3376
+ selected: l,
3371
3377
  partial: p,
3372
3378
  "view-mode": !r
3373
3379
  }, h = p ? { "--partial-fill": `${o % 1 * 100}%` } : {};
3374
3380
  return d`
3375
3381
  <div class="pc-section" data-testid="pc-section">
3376
3382
  <span
3377
- data-testid="stars-view-star-${l}"
3383
+ data-testid="stars-view-star-${n}"
3378
3384
  class=${v(c)}
3379
3385
  style=${jo(h)}
3380
3386
  role="${r ? "button" : "presentation"}"
3381
3387
  tabindex="${r ? "0" : ""}"
3382
- aria-label="${r ? `Rate ${l} star${l > 1 ? "s" : ""}` : ""}"
3383
- @click="${() => this.handleStarClick(l)}"
3384
- @mouseenter="${() => this.handleStarHover(l)}"
3385
- @focus="${() => this.handleStarHover(l)}"
3388
+ aria-label="${r ? `Rate ${n} star${n > 1 ? "s" : ""}` : ""}"
3389
+ @click="${() => this.handleStarClick(n)}"
3390
+ @mouseenter="${() => this.handleStarHover(n)}"
3391
+ @focus="${() => this.handleStarHover(n)}"
3386
3392
  @mouseleave="${this.handleStarLeave}"
3387
3393
  @blur="${this.handleStarLeave}"
3388
3394
  @keydown="${this.handleStarKeyDown}"
@@ -3400,14 +3406,14 @@ let V = class extends m {
3400
3406
  renderChart() {
3401
3407
  var a;
3402
3408
  if (!this.displayController.shouldShowChart()) return u;
3403
- const e = ((a = this.dataController.stats) == null ? void 0 : a.breakdown) || {}, t = Object.values(e).reduce((l, n) => l + n, 0), o = Object.entries(e).map(([l, n]) => ({
3404
- label: l,
3405
- value: n,
3409
+ const e = ((a = this.dataController.stats) == null ? void 0 : a.breakdown) || {}, t = Object.values(e).reduce((n, l) => n + l, 0), o = Object.entries(e).map(([n, l]) => ({
3410
+ label: n,
3411
+ value: l,
3406
3412
  icon: "★"
3407
- })), s = getComputedStyle(this).getPropertyValue("--pc-accent-color").trim() || "#ffc107", i = It(o, {
3413
+ })), s = getComputedStyle(this).getPropertyValue("--pc-accent-color").trim() || "#ffc107", i = Nt(o, {
3408
3414
  barColor: s,
3409
- labelFormatter: (l) => `${l.label} ${l.icon}`,
3410
- valueFormatter: (l) => `${t > 0 ? Math.round(l.value / t * 100) : 0}%`
3415
+ labelFormatter: (n) => `${n.label} ${n.icon}`,
3416
+ valueFormatter: (n) => `${t > 0 ? Math.round(n.value / t * 100) : 0}%`
3411
3417
  });
3412
3418
  return d`
3413
3419
  <div class="pc-stats-chart pc-stats-chart-inline visible" data-testid="stars-chart">
@@ -3416,10 +3422,10 @@ let V = class extends m {
3416
3422
  `;
3417
3423
  }
3418
3424
  render() {
3419
- const e = k(this.questionPosition, this.questionAlign), t = {
3425
+ const e = A(this.questionPosition, this.questionAlign), t = {
3420
3426
  [`pc-flex-pos-${this.questionPosition}`]: !0,
3421
3427
  [`pc-flex-align-${e}`]: !0
3422
- }, o = k(this.statsPosition, this.statsAlign), r = {
3428
+ }, o = A(this.statsPosition, this.statsAlign), r = {
3423
3429
  "pc-body": !0,
3424
3430
  [`pc-flex-pos-${this.statsPosition}`]: !0,
3425
3431
  [`pc-flex-align-${o}`]: !0
@@ -3965,32 +3971,32 @@ let q = class extends m {
3965
3971
  renderChart() {
3966
3972
  if (!this.displayController.shouldShowChart()) return u;
3967
3973
  const e = this.dataController.getBreakdownInfo(), o = Object.entries(e.breakdownCount).filter(
3968
- ([n, p]) => this.options.some((c) => c.value === n)
3969
- ).map(([n, p]) => {
3970
- const c = this.options.find((h) => h.value === n);
3974
+ ([l, p]) => this.options.some((c) => c.value === l)
3975
+ ).map(([l, p]) => {
3976
+ const c = this.options.find((h) => h.value === l);
3971
3977
  return {
3972
- label: n,
3978
+ label: l,
3973
3979
  // Use the reaction value as label
3974
3980
  value: p,
3975
- icon: (c == null ? void 0 : c.icon) || n
3981
+ icon: (c == null ? void 0 : c.icon) || l
3976
3982
  // Use the icon or fall back to reaction value
3977
3983
  };
3978
- }), r = getComputedStyle(this), s = r.getPropertyValue("--pc-primary-color").trim(), a = r.getPropertyValue("--pc-accent-color").trim() || s || "#ffc107", l = It(o, {
3984
+ }), r = getComputedStyle(this), s = r.getPropertyValue("--pc-primary-color").trim(), a = r.getPropertyValue("--pc-accent-color").trim() || s || "#ffc107", n = Nt(o, {
3979
3985
  barColor: a,
3980
- labelFormatter: (n) => `${n.label}`,
3981
- valueFormatter: (n) => `${e.totalCount > 0 ? Math.round(n.value / e.totalCount * 100) : 0}%`
3986
+ labelFormatter: (l) => `${l.label}`,
3987
+ valueFormatter: (l) => `${e.totalCount > 0 ? Math.round(l.value / e.totalCount * 100) : 0}%`
3982
3988
  });
3983
3989
  return d`
3984
3990
  <div class="pc-stats-chart pc-stats-chart-inline visible" data-testid="reaction-chart">
3985
- <div class="pc-chart-container" data-testid="reaction-chart-container">${l}</div>
3991
+ <div class="pc-chart-container" data-testid="reaction-chart-container">${n}</div>
3986
3992
  </div>
3987
3993
  `;
3988
3994
  }
3989
3995
  render() {
3990
- const e = k(this.questionPosition, this.questionAlign), t = {
3996
+ const e = A(this.questionPosition, this.questionAlign), t = {
3991
3997
  [`pc-flex-pos-${this.questionPosition}`]: !0,
3992
3998
  [`pc-flex-align-${e}`]: !0
3993
- }, o = k(this.statsPosition, this.statsAlign), r = {
3999
+ }, o = A(this.statsPosition, this.statsAlign), r = {
3994
4000
  "pc-body": !0,
3995
4001
  [`pc-flex-pos-${this.statsPosition}`]: !0,
3996
4002
  [`pc-flex-align-${o}`]: !0
@@ -4085,12 +4091,12 @@ let tt = class extends j {
4085
4091
  // REACTION widget uses options for the icon
4086
4092
  }));
4087
4093
  t && t.length > 0 && (r = Array.from(t).map((s) => {
4088
- const i = Z(s, "value", "") || "", a = Z(s, "label", Yo(s, i)) || "", l = Z(s, "icon", void 0), n = Z(s, "tooltip", void 0), p = Z(s, "disabled", void 0), c = { value: i, label: a };
4089
- if (l !== void 0) {
4090
- const h = Ce(l);
4094
+ const i = Z(s, "value", "") || "", a = Z(s, "label", Yo(s, i)) || "", n = Z(s, "icon", void 0), l = Z(s, "tooltip", void 0), p = Z(s, "disabled", void 0), c = { value: i, label: a };
4095
+ if (n !== void 0) {
4096
+ const h = Ce(n);
4091
4097
  c.icon = h.icon;
4092
4098
  }
4093
- return n !== void 0 && (c.tooltip = n), p !== void 0 && (c.disabled = !0), c;
4099
+ return l !== void 0 && (c.tooltip = l), p !== void 0 && (c.disabled = !0), c;
4094
4100
  })), this.parsedOptions = r;
4095
4101
  }
4096
4102
  /**