pollcatch 2.4.0 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/pc.js +740 -688
package/pc.js CHANGED
@@ -3,18 +3,18 @@
3
3
  * Copyright 2019 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
5
5
  */
6
- const wt = globalThis, Yt = wt.ShadowRoot && (wt.ShadyCSS === void 0 || wt.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Kt = Symbol(), ee = /* @__PURE__ */ new WeakMap();
7
- let Ee = class {
6
+ const St = globalThis, Kt = St.ShadowRoot && (St.ShadyCSS === void 0 || St.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Gt = Symbol(), re = /* @__PURE__ */ new WeakMap();
7
+ let Pe = class {
8
8
  constructor(t, o, r) {
9
- if (this._$cssResult$ = !0, r !== Kt) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
9
+ if (this._$cssResult$ = !0, r !== Gt) 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 (Yt && t === void 0) {
15
+ if (Kt && t === void 0) {
16
16
  const r = o !== void 0 && o.length === 1;
17
- r && (t = ee.get(o)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), r && ee.set(o, t));
17
+ r && (t = re.get(o)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), r && re.set(o, t));
18
18
  }
19
19
  return t;
20
20
  }
@@ -22,33 +22,33 @@ let Ee = class {
22
22
  return this.cssText;
23
23
  }
24
24
  };
25
- const Fe = (e) => new Ee(typeof e == "string" ? e : e + "", void 0, Kt), B = (e, ...t) => {
25
+ const We = (e) => new Pe(typeof e == "string" ? e : e + "", void 0, Gt), U = (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 Ee(o, e, Kt);
32
- }, Ye = (e, t) => {
33
- if (Yt) e.adoptedStyleSheets = t.map((o) => o instanceof CSSStyleSheet ? o : o.styleSheet);
31
+ return new Pe(o, e, Gt);
32
+ }, Ke = (e, t) => {
33
+ if (Kt) e.adoptedStyleSheets = t.map((o) => o instanceof CSSStyleSheet ? o : o.styleSheet);
34
34
  else for (const o of t) {
35
- const r = document.createElement("style"), s = wt.litNonce;
35
+ const r = document.createElement("style"), s = St.litNonce;
36
36
  s !== void 0 && r.setAttribute("nonce", s), r.textContent = o.cssText, e.appendChild(r);
37
37
  }
38
- }, oe = Yt ? (e) => e : (e) => e instanceof CSSStyleSheet ? ((t) => {
38
+ }, se = Kt ? (e) => e : (e) => e instanceof CSSStyleSheet ? ((t) => {
39
39
  let o = "";
40
40
  for (const r of t.cssRules) o += r.cssText;
41
- return Fe(o);
41
+ return We(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: Ke, defineProperty: We, getOwnPropertyDescriptor: Ge, getOwnPropertyNames: Ze, getOwnPropertySymbols: Je, getPrototypeOf: Xe } = Object, q = globalThis, re = q.trustedTypes, Qe = re ? re.emptyScript : "", Mt = q.reactiveElementPolyfillSupport, dt = (e, t) => e, St = { toAttribute(e, t) {
48
+ const { is: Ge, defineProperty: Ze, getOwnPropertyDescriptor: Je, getOwnPropertyNames: Xe, getOwnPropertySymbols: Qe, getPrototypeOf: to } = Object, q = globalThis, ie = q.trustedTypes, eo = ie ? ie.emptyScript : "", Mt = q.reactiveElementPolyfillSupport, pt = (e, t) => e, kt = { toAttribute(e, t) {
49
49
  switch (t) {
50
50
  case Boolean:
51
- e = e ? Qe : null;
51
+ e = e ? eo : null;
52
52
  break;
53
53
  case Object:
54
54
  case Array:
@@ -73,23 +73,23 @@ const { is: Ke, defineProperty: We, getOwnPropertyDescriptor: Ge, getOwnProperty
73
73
  }
74
74
  }
75
75
  return o;
76
- } }, Wt = (e, t) => !Ke(e, t), se = { attribute: !0, type: String, converter: St, reflect: !1, hasChanged: Wt };
76
+ } }, Zt = (e, t) => !Ge(e, t), ae = { attribute: !0, type: String, converter: kt, reflect: !1, hasChanged: Zt };
77
77
  Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), q.litPropertyMetadata ?? (q.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
78
- let ot = class extends HTMLElement {
78
+ let rt = class extends HTMLElement {
79
79
  static addInitializer(t) {
80
80
  this._$Ei(), (this.l ?? (this.l = [])).push(t);
81
81
  }
82
82
  static get observedAttributes() {
83
83
  return this.finalize(), this._$Eh && [...this._$Eh.keys()];
84
84
  }
85
- static createProperty(t, o = se) {
85
+ static createProperty(t, o = ae) {
86
86
  if (o.state && (o.attribute = !1), this._$Ei(), this.elementProperties.set(t, o), !o.noAccessor) {
87
87
  const r = Symbol(), s = this.getPropertyDescriptor(t, r, o);
88
- s !== void 0 && We(this.prototype, t, s);
88
+ s !== void 0 && Ze(this.prototype, t, s);
89
89
  }
90
90
  }
91
91
  static getPropertyDescriptor(t, o, r) {
92
- const { get: s, set: i } = Ge(this.prototype, t) ?? { get() {
92
+ const { get: s, set: i } = Je(this.prototype, t) ?? { get() {
93
93
  return this[o];
94
94
  }, set(a) {
95
95
  this[o] = a;
@@ -102,17 +102,17 @@ let ot = class extends HTMLElement {
102
102
  }, configurable: !0, enumerable: !0 };
103
103
  }
104
104
  static getPropertyOptions(t) {
105
- return this.elementProperties.get(t) ?? se;
105
+ return this.elementProperties.get(t) ?? ae;
106
106
  }
107
107
  static _$Ei() {
108
- if (this.hasOwnProperty(dt("elementProperties"))) return;
109
- const t = Xe(this);
108
+ if (this.hasOwnProperty(pt("elementProperties"))) return;
109
+ const t = to(this);
110
110
  t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
111
111
  }
112
112
  static finalize() {
113
- if (this.hasOwnProperty(dt("finalized"))) return;
114
- if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(dt("properties"))) {
115
- const o = this.properties, r = [...Ze(o), ...Je(o)];
113
+ if (this.hasOwnProperty(pt("finalized"))) return;
114
+ if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(pt("properties"))) {
115
+ const o = this.properties, r = [...Xe(o), ...Qe(o)];
116
116
  for (const s of r) this.createProperty(s, o[s]);
117
117
  }
118
118
  const t = this[Symbol.metadata];
@@ -131,8 +131,8 @@ let ot = class extends HTMLElement {
131
131
  const o = [];
132
132
  if (Array.isArray(t)) {
133
133
  const r = new Set(t.flat(1 / 0).reverse());
134
- for (const s of r) o.unshift(oe(s));
135
- } else t !== void 0 && o.push(oe(t));
134
+ for (const s of r) o.unshift(se(s));
135
+ } else t !== void 0 && o.push(se(t));
136
136
  return o;
137
137
  }
138
138
  static _$Eu(t, o) {
@@ -161,7 +161,7 @@ let ot = class extends HTMLElement {
161
161
  }
162
162
  createRenderRoot() {
163
163
  const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
164
- return Ye(t, this.constructor.elementStyles), t;
164
+ return Ke(t, this.constructor.elementStyles), t;
165
165
  }
166
166
  connectedCallback() {
167
167
  var t;
@@ -186,7 +186,7 @@ let ot = class extends HTMLElement {
186
186
  var i;
187
187
  const r = this.constructor.elementProperties.get(t), s = this.constructor._$Eu(t, r);
188
188
  if (s !== void 0 && r.reflect === !0) {
189
- const a = (((i = r.converter) == null ? void 0 : i.toAttribute) !== void 0 ? r.converter : St).toAttribute(o, r.type);
189
+ const a = (((i = r.converter) == null ? void 0 : i.toAttribute) !== void 0 ? r.converter : kt).toAttribute(o, r.type);
190
190
  this._$Em = t, a == null ? this.removeAttribute(s) : this.setAttribute(s, a), this._$Em = null;
191
191
  }
192
192
  }
@@ -194,13 +194,13 @@ let ot = 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 : St;
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 : kt;
198
198
  this._$Em = s, this[s] = l.fromAttribute(o, a.type), this._$Em = null;
199
199
  }
200
200
  }
201
201
  requestUpdate(t, o, r) {
202
202
  if (t !== void 0) {
203
- if (r ?? (r = this.constructor.getPropertyOptions(t)), !(r.hasChanged ?? Wt)(this[t], o)) return;
203
+ if (r ?? (r = this.constructor.getPropertyOptions(t)), !(r.hasChanged ?? Zt)(this[t], o)) return;
204
204
  this.P(t, o, r);
205
205
  }
206
206
  this.isUpdatePending === !1 && (this._$ES = this._$ET());
@@ -273,56 +273,56 @@ let ot = class extends HTMLElement {
273
273
  firstUpdated(t) {
274
274
  }
275
275
  };
276
- ot.elementStyles = [], ot.shadowRootOptions = { mode: "open" }, ot[dt("elementProperties")] = /* @__PURE__ */ new Map(), ot[dt("finalized")] = /* @__PURE__ */ new Map(), Mt == null || Mt({ ReactiveElement: ot }), (q.reactiveElementVersions ?? (q.reactiveElementVersions = [])).push("2.0.4");
276
+ rt.elementStyles = [], rt.shadowRootOptions = { mode: "open" }, rt[pt("elementProperties")] = /* @__PURE__ */ new Map(), rt[pt("finalized")] = /* @__PURE__ */ new Map(), Mt == null || Mt({ ReactiveElement: rt }), (q.reactiveElementVersions ?? (q.reactiveElementVersions = [])).push("2.0.4");
277
277
  /**
278
278
  * @license
279
279
  * Copyright 2017 Google LLC
280
280
  * SPDX-License-Identifier: BSD-3-Clause
281
281
  */
282
- const pt = globalThis, Ct = pt.trustedTypes, ie = Ct ? Ct.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, Ae = "$lit$", j = `lit$${Math.random().toFixed(9).slice(2)}$`, Pe = "?" + j, to = `<${Pe}>`, J = document, ht = () => J.createComment(""), ft = (e) => e === null || typeof e != "object" && typeof e != "function", Gt = Array.isArray, eo = (e) => Gt(e) || typeof (e == null ? void 0 : e[Symbol.iterator]) == "function", Lt = `[
283
- \f\r]`, lt = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, ae = /-->/g, ne = />/g, G = RegExp(`>|${Lt}(?:([^\\s"'>=/]+)(${Lt}*=${Lt}*(?:[^
284
- \f\r"'\`<>=]|("|')|))|$)`, "g"), le = /'/g, ce = /"/g, Te = /^(?:script|style|textarea|title)$/i, oo = (e) => (t, ...o) => ({ _$litType$: e, strings: t, values: o }), c = oo(1), H = Symbol.for("lit-noChange"), u = Symbol.for("lit-nothing"), de = /* @__PURE__ */ new WeakMap(), Z = J.createTreeWalker(J, 129);
285
- function _e(e, t) {
286
- if (!Gt(e) || !e.hasOwnProperty("raw")) throw Error("invalid template strings array");
287
- return ie !== void 0 ? ie.createHTML(t) : t;
282
+ const ut = globalThis, Et = ut.trustedTypes, ne = Et ? Et.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, Te = "$lit$", j = `lit$${Math.random().toFixed(9).slice(2)}$`, _e = "?" + j, oo = `<${_e}>`, X = document, gt = () => X.createComment(""), mt = (e) => e === null || typeof e != "object" && typeof e != "function", Jt = Array.isArray, ro = (e) => Jt(e) || typeof (e == null ? void 0 : e[Symbol.iterator]) == "function", Lt = `[
283
+ \f\r]`, ct = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, le = /-->/g, ce = />/g, Z = RegExp(`>|${Lt}(?:([^\\s"'>=/]+)(${Lt}*=${Lt}*(?:[^
284
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), de = /'/g, pe = /"/g, Oe = /^(?:script|style|textarea|title)$/i, so = (e) => (t, ...o) => ({ _$litType$: e, strings: t, values: o }), c = so(1), H = Symbol.for("lit-noChange"), u = Symbol.for("lit-nothing"), ue = /* @__PURE__ */ new WeakMap(), J = X.createTreeWalker(X, 129);
285
+ function Ie(e, t) {
286
+ if (!Jt(e) || !e.hasOwnProperty("raw")) throw Error("invalid template strings array");
287
+ return ne !== void 0 ? ne.createHTML(t) : t;
288
288
  }
289
- const ro = (e, t) => {
289
+ const io = (e, t) => {
290
290
  const o = e.length - 1, r = [];
291
- let s, i = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", a = lt;
291
+ let s, i = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", a = ct;
292
292
  for (let l = 0; l < o; l++) {
293
293
  const n = e[l];
294
- let d, p, h = -1, b = 0;
295
- for (; b < n.length && (a.lastIndex = b, p = a.exec(n), p !== null); ) b = a.lastIndex, a === lt ? p[1] === "!--" ? a = ae : p[1] !== void 0 ? a = ne : p[2] !== void 0 ? (Te.test(p[2]) && (s = RegExp("</" + p[2], "g")), a = G) : p[3] !== void 0 && (a = G) : a === G ? p[0] === ">" ? (a = s ?? lt, h = -1) : p[1] === void 0 ? h = -2 : (h = a.lastIndex - p[2].length, d = p[1], a = p[3] === void 0 ? G : p[3] === '"' ? ce : le) : a === ce || a === le ? a = G : a === ae || a === ne ? a = lt : (a = G, s = void 0);
296
- const x = a === G && e[l + 1].startsWith("/>") ? " " : "";
297
- i += a === lt ? n + to : h >= 0 ? (r.push(d), n.slice(0, h) + Ae + n.slice(h) + j + x) : n + j + (h === -2 ? l : x);
294
+ let d, p, h = -1, v = 0;
295
+ for (; v < n.length && (a.lastIndex = v, p = a.exec(n), p !== null); ) v = a.lastIndex, a === ct ? p[1] === "!--" ? a = le : p[1] !== void 0 ? a = ce : p[2] !== void 0 ? (Oe.test(p[2]) && (s = RegExp("</" + p[2], "g")), a = Z) : p[3] !== void 0 && (a = Z) : a === Z ? p[0] === ">" ? (a = s ?? ct, h = -1) : p[1] === void 0 ? h = -2 : (h = a.lastIndex - p[2].length, d = p[1], a = p[3] === void 0 ? Z : p[3] === '"' ? pe : de) : a === pe || a === de ? a = Z : a === le || a === ce ? a = ct : (a = Z, s = void 0);
296
+ const x = a === Z && e[l + 1].startsWith("/>") ? " " : "";
297
+ i += a === ct ? n + oo : h >= 0 ? (r.push(d), n.slice(0, h) + Te + n.slice(h) + j + x) : n + j + (h === -2 ? l : x);
298
298
  }
299
- return [_e(e, i + (e[o] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), r];
299
+ return [Ie(e, i + (e[o] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), r];
300
300
  };
301
- let Ft = class Oe {
301
+ let Ft = class ze {
302
302
  constructor({ strings: t, _$litType$: o }, r) {
303
303
  let s;
304
304
  this.parts = [];
305
305
  let i = 0, a = 0;
306
- const l = t.length - 1, n = this.parts, [d, p] = ro(t, o);
307
- if (this.el = Oe.createElement(d, r), Z.currentNode = this.el.content, o === 2 || o === 3) {
306
+ const l = t.length - 1, n = this.parts, [d, p] = io(t, o);
307
+ if (this.el = ze.createElement(d, r), J.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 = Z.nextNode()) !== null && n.length < l; ) {
311
+ for (; (s = J.nextNode()) !== null && n.length < l; ) {
312
312
  if (s.nodeType === 1) {
313
- if (s.hasAttributes()) for (const h of s.getAttributeNames()) if (h.endsWith(Ae)) {
314
- const b = p[a++], x = s.getAttribute(h).split(j), E = /([.?@])?(.*)/.exec(b);
315
- n.push({ type: 1, index: i, name: E[2], strings: x, ctor: E[1] === "." ? io : E[1] === "?" ? ao : E[1] === "@" ? no : Pt }), s.removeAttribute(h);
313
+ if (s.hasAttributes()) for (const h of s.getAttributeNames()) if (h.endsWith(Te)) {
314
+ const v = p[a++], x = s.getAttribute(h).split(j), k = /([.?@])?(.*)/.exec(v);
315
+ n.push({ type: 1, index: i, name: k[2], strings: x, ctor: k[1] === "." ? no : k[1] === "?" ? lo : k[1] === "@" ? co : Tt }), s.removeAttribute(h);
316
316
  } else h.startsWith(j) && (n.push({ type: 6, index: i }), s.removeAttribute(h));
317
- if (Te.test(s.tagName)) {
318
- const h = s.textContent.split(j), b = h.length - 1;
319
- if (b > 0) {
320
- s.textContent = Ct ? Ct.emptyScript : "";
321
- for (let x = 0; x < b; x++) s.append(h[x], ht()), Z.nextNode(), n.push({ type: 2, index: ++i });
322
- s.append(h[b], ht());
317
+ if (Oe.test(s.tagName)) {
318
+ const h = s.textContent.split(j), v = h.length - 1;
319
+ if (v > 0) {
320
+ s.textContent = Et ? Et.emptyScript : "";
321
+ for (let x = 0; x < v; x++) s.append(h[x], gt()), J.nextNode(), n.push({ type: 2, index: ++i });
322
+ s.append(h[v], gt());
323
323
  }
324
324
  }
325
- } else if (s.nodeType === 8) if (s.data === Pe) n.push({ type: 2, index: i });
325
+ } else if (s.nodeType === 8) if (s.data === _e) n.push({ type: 2, index: i });
326
326
  else {
327
327
  let h = -1;
328
328
  for (; (h = s.data.indexOf(j, h + 1)) !== -1; ) n.push({ type: 7, index: i }), h += j.length - 1;
@@ -331,18 +331,18 @@ let Ft = class Oe {
331
331
  }
332
332
  }
333
333
  static createElement(t, o) {
334
- const r = J.createElement("template");
334
+ const r = X.createElement("template");
335
335
  return r.innerHTML = t, r;
336
336
  }
337
337
  };
338
- function st(e, t, o = e, r) {
338
+ function it(e, t, o = e, r) {
339
339
  var a, l;
340
340
  if (t === H) return t;
341
341
  let s = r !== void 0 ? (a = o._$Co) == null ? void 0 : a[r] : o._$Cl;
342
- const i = ft(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 = st(e, s._$AS(e, t.values), s, r)), t;
342
+ const i = mt(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 = it(e, s._$AS(e, t.values), s, r)), t;
344
344
  }
345
- let so = class {
345
+ let ao = class {
346
346
  constructor(t, o) {
347
347
  this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = o;
348
348
  }
@@ -353,24 +353,24 @@ let so = class {
353
353
  return this._$AM._$AU;
354
354
  }
355
355
  u(t) {
356
- const { el: { content: o }, parts: r } = this._$AD, s = ((t == null ? void 0 : t.creationScope) ?? J).importNode(o, !0);
357
- Z.currentNode = s;
358
- let i = Z.nextNode(), a = 0, l = 0, n = r[0];
356
+ const { el: { content: o }, parts: r } = this._$AD, s = ((t == null ? void 0 : t.creationScope) ?? X).importNode(o, !0);
357
+ J.currentNode = s;
358
+ let i = J.nextNode(), a = 0, l = 0, n = r[0];
359
359
  for (; n !== void 0; ) {
360
360
  if (a === n.index) {
361
361
  let d;
362
- n.type === 2 ? d = new gt(i, i.nextSibling, this, t) : n.type === 1 ? d = new n.ctor(i, n.name, n.strings, this, t) : n.type === 6 && (d = new lo(i, this, t)), this._$AV.push(d), n = r[++l];
362
+ n.type === 2 ? d = new vt(i, i.nextSibling, this, t) : n.type === 1 ? d = new n.ctor(i, n.name, n.strings, this, t) : n.type === 6 && (d = new po(i, this, t)), this._$AV.push(d), n = r[++l];
363
363
  }
364
- a !== (n == null ? void 0 : n.index) && (i = Z.nextNode(), a++);
364
+ a !== (n == null ? void 0 : n.index) && (i = J.nextNode(), a++);
365
365
  }
366
- return Z.currentNode = J, s;
366
+ return J.currentNode = X, s;
367
367
  }
368
368
  p(t) {
369
369
  let o = 0;
370
370
  for (const r of this._$AV) r !== void 0 && (r.strings !== void 0 ? (r._$AI(t, r, o), o += r.strings.length - 2) : r._$AI(t[o])), o++;
371
371
  }
372
372
  };
373
- class gt {
373
+ class vt {
374
374
  get _$AU() {
375
375
  var t;
376
376
  return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
@@ -390,7 +390,7 @@ class gt {
390
390
  return this._$AB;
391
391
  }
392
392
  _$AI(t, o = this) {
393
- t = st(this, t, o), ft(t) ? t === u || t == null || t === "" ? (this._$AH !== u && this._$AR(), this._$AH = u) : t !== this._$AH && t !== H && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : eo(t) ? this.k(t) : this._(t);
393
+ t = it(this, t, o), mt(t) ? t === u || t == null || t === "" ? (this._$AH !== u && this._$AR(), this._$AH = u) : t !== this._$AH && t !== H && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : ro(t) ? this.k(t) : this._(t);
394
394
  }
395
395
  O(t) {
396
396
  return this._$AA.parentNode.insertBefore(t, this._$AB);
@@ -399,26 +399,26 @@ class gt {
399
399
  this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
400
400
  }
401
401
  _(t) {
402
- this._$AH !== u && ft(this._$AH) ? this._$AA.nextSibling.data = t : this.T(J.createTextNode(t)), this._$AH = t;
402
+ this._$AH !== u && mt(this._$AH) ? this._$AA.nextSibling.data = t : this.T(X.createTextNode(t)), this._$AH = t;
403
403
  }
404
404
  $(t) {
405
405
  var i;
406
- const { values: o, _$litType$: r } = t, s = typeof r == "number" ? this._$AC(t) : (r.el === void 0 && (r.el = Ft.createElement(_e(r.h, r.h[0]), this.options)), r);
406
+ const { values: o, _$litType$: r } = t, s = typeof r == "number" ? this._$AC(t) : (r.el === void 0 && (r.el = Ft.createElement(Ie(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 so(s, this), l = a.u(this.options);
409
+ const a = new ao(s, this), l = a.u(this.options);
410
410
  a.p(o), this.T(l), this._$AH = a;
411
411
  }
412
412
  }
413
413
  _$AC(t) {
414
- let o = de.get(t.strings);
415
- return o === void 0 && de.set(t.strings, o = new Ft(t)), o;
414
+ let o = ue.get(t.strings);
415
+ return o === void 0 && ue.set(t.strings, o = new Ft(t)), o;
416
416
  }
417
417
  k(t) {
418
- Gt(this._$AH) || (this._$AH = [], this._$AR());
418
+ Jt(this._$AH) || (this._$AH = [], this._$AR());
419
419
  const o = this._$AH;
420
420
  let r, s = 0;
421
- for (const i of t) s === o.length ? o.push(r = new gt(this.O(ht()), this.O(ht()), this, this.options)) : r = o[s], r._$AI(i), s++;
421
+ for (const i of t) s === o.length ? o.push(r = new vt(this.O(gt()), this.O(gt()), this, this.options)) : r = o[s], r._$AI(i), s++;
422
422
  s < o.length && (this._$AR(r && r._$AB.nextSibling, s), o.length = s);
423
423
  }
424
424
  _$AR(t = this._$AA.nextSibling, o) {
@@ -433,7 +433,7 @@ class gt {
433
433
  this._$AM === void 0 && (this._$Cv = t, (o = this._$AP) == null || o.call(this, t));
434
434
  }
435
435
  }
436
- class Pt {
436
+ class Tt {
437
437
  get tagName() {
438
438
  return this.element.tagName;
439
439
  }
@@ -446,11 +446,11 @@ class Pt {
446
446
  _$AI(t, o = this, r, s) {
447
447
  const i = this.strings;
448
448
  let a = !1;
449
- if (i === void 0) t = st(this, t, o, 0), a = !ft(t) || t !== this._$AH && t !== H, a && (this._$AH = t);
449
+ if (i === void 0) t = it(this, t, o, 0), a = !mt(t) || t !== this._$AH && t !== H, a && (this._$AH = t);
450
450
  else {
451
451
  const l = t;
452
452
  let n, d;
453
- for (t = i[0], n = 0; n < i.length - 1; n++) d = st(this, l[r + n], o, n), d === H && (d = this._$AH[n]), a || (a = !ft(d) || d !== this._$AH[n]), d === u ? t = u : t !== u && (t += (d ?? "") + i[n + 1]), this._$AH[n] = d;
453
+ for (t = i[0], n = 0; n < i.length - 1; n++) d = it(this, l[r + n], o, n), d === H && (d = this._$AH[n]), a || (a = !mt(d) || d !== this._$AH[n]), d === u ? t = u : t !== u && (t += (d ?? "") + i[n + 1]), this._$AH[n] = d;
454
454
  }
455
455
  a && !s && this.j(t);
456
456
  }
@@ -458,7 +458,7 @@ class Pt {
458
458
  t === u ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
459
459
  }
460
460
  }
461
- let io = class extends Pt {
461
+ let no = class extends Tt {
462
462
  constructor() {
463
463
  super(...arguments), this.type = 3;
464
464
  }
@@ -466,7 +466,7 @@ let io = class extends Pt {
466
466
  this.element[this.name] = t === u ? void 0 : t;
467
467
  }
468
468
  };
469
- class ao extends Pt {
469
+ class lo extends Tt {
470
470
  constructor() {
471
471
  super(...arguments), this.type = 4;
472
472
  }
@@ -474,12 +474,12 @@ class ao extends Pt {
474
474
  this.element.toggleAttribute(this.name, !!t && t !== u);
475
475
  }
476
476
  }
477
- class no extends Pt {
477
+ class co extends Tt {
478
478
  constructor(t, o, r, s, i) {
479
479
  super(t, o, r, s, i), this.type = 5;
480
480
  }
481
481
  _$AI(t, o = this) {
482
- if ((t = st(this, t, o, 0) ?? u) === H) return;
482
+ if ((t = it(this, t, o, 0) ?? u) === H) return;
483
483
  const r = this._$AH, s = t === u && r !== u || t.capture !== r.capture || t.once !== r.once || t.passive !== r.passive, i = t !== u && (r === u || s);
484
484
  s && this.element.removeEventListener(this.name, this, r), i && this.element.addEventListener(this.name, this, t), this._$AH = t;
485
485
  }
@@ -488,7 +488,7 @@ class no extends Pt {
488
488
  typeof this._$AH == "function" ? this._$AH.call(((o = this.options) == null ? void 0 : o.host) ?? this.element, t) : this._$AH.handleEvent(t);
489
489
  }
490
490
  }
491
- class lo {
491
+ class po {
492
492
  constructor(t, o, r) {
493
493
  this.element = t, this.type = 6, this._$AN = void 0, this._$AM = o, this.options = r;
494
494
  }
@@ -496,17 +496,17 @@ class lo {
496
496
  return this._$AM._$AU;
497
497
  }
498
498
  _$AI(t) {
499
- st(this, t);
499
+ it(this, t);
500
500
  }
501
501
  }
502
- const Nt = pt.litHtmlPolyfillSupport;
503
- Nt == null || Nt(Ft, gt), (pt.litHtmlVersions ?? (pt.litHtmlVersions = [])).push("3.2.1");
504
- const co = (e, t, o) => {
502
+ const Nt = ut.litHtmlPolyfillSupport;
503
+ Nt == null || Nt(Ft, vt), (ut.litHtmlVersions ?? (ut.litHtmlVersions = [])).push("3.2.1");
504
+ const uo = (e, t, o) => {
505
505
  const r = (o == null ? void 0 : o.renderBefore) ?? t;
506
506
  let s = r._$litPart$;
507
507
  if (s === void 0) {
508
508
  const i = (o == null ? void 0 : o.renderBefore) ?? null;
509
- r._$litPart$ = s = new gt(t.insertBefore(ht(), i), i, void 0, o ?? {});
509
+ r._$litPart$ = s = new vt(t.insertBefore(gt(), i), i, void 0, o ?? {});
510
510
  }
511
511
  return s._$AI(e), s;
512
512
  };
@@ -515,7 +515,7 @@ const co = (e, t, o) => {
515
515
  * Copyright 2017 Google LLC
516
516
  * SPDX-License-Identifier: BSD-3-Clause
517
517
  */
518
- let R = class extends ot {
518
+ let R = class extends rt {
519
519
  constructor() {
520
520
  super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
521
521
  }
@@ -526,7 +526,7 @@ let R = class extends ot {
526
526
  }
527
527
  update(t) {
528
528
  const o = this.render();
529
- this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = co(o, this.renderRoot, this.renderOptions);
529
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = uo(o, this.renderRoot, this.renderOptions);
530
530
  }
531
531
  connectedCallback() {
532
532
  var t;
@@ -540,8 +540,8 @@ let R = class extends ot {
540
540
  return H;
541
541
  }
542
542
  };
543
- var ke;
544
- R._$litElement$ = !0, R.finalized = !0, (ke = globalThis.litElementHydrateSupport) == null || ke.call(globalThis, { LitElement: R });
543
+ var Ae;
544
+ R._$litElement$ = !0, R.finalized = !0, (Ae = globalThis.litElementHydrateSupport) == null || Ae.call(globalThis, { LitElement: R });
545
545
  const Dt = globalThis.litElementPolyfillSupport;
546
546
  Dt == null || Dt({ LitElement: R });
547
547
  (globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.1.1");
@@ -550,7 +550,7 @@ Dt == null || Dt({ LitElement: R });
550
550
  * Copyright 2017 Google LLC
551
551
  * SPDX-License-Identifier: BSD-3-Clause
552
552
  */
553
- const Y = (e) => (t, o) => {
553
+ const W = (e) => (t, o) => {
554
554
  o !== void 0 ? o.addInitializer(() => {
555
555
  customElements.define(e, t);
556
556
  }) : customElements.define(e, t);
@@ -560,7 +560,7 @@ const Y = (e) => (t, o) => {
560
560
  * Copyright 2017 Google LLC
561
561
  * SPDX-License-Identifier: BSD-3-Clause
562
562
  */
563
- const po = { attribute: !0, type: String, converter: St, reflect: !1, hasChanged: Wt }, uo = (e = po, t, o) => {
563
+ const ho = { attribute: !0, type: String, converter: kt, reflect: !1, hasChanged: Zt }, fo = (e = ho, t, o) => {
564
564
  const { kind: r, metadata: s } = o;
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") {
@@ -582,7 +582,7 @@ const po = { attribute: !0, type: String, converter: St, reflect: !1, hasChanged
582
582
  throw Error("Unsupported decorator location: " + r);
583
583
  };
584
584
  function f(e) {
585
- return (t, o) => typeof o == "object" ? uo(e, t, o) : ((r, s, i) => {
585
+ return (t, o) => typeof o == "object" ? fo(e, t, o) : ((r, s, i) => {
586
586
  const a = s.hasOwnProperty(i);
587
587
  return s.constructor.createProperty(i, a ? { ...r, wrapped: !0 } : r), a ? Object.getOwnPropertyDescriptor(s, i) : void 0;
588
588
  })(e, t, o);
@@ -592,7 +592,7 @@ function f(e) {
592
592
  * Copyright 2017 Google LLC
593
593
  * SPDX-License-Identifier: BSD-3-Clause
594
594
  */
595
- function k(e) {
595
+ function A(e) {
596
596
  return f({ ...e, state: !0, attribute: !1 });
597
597
  }
598
598
  /**
@@ -600,25 +600,25 @@ function k(e) {
600
600
  * Copyright 2017 Google LLC
601
601
  * SPDX-License-Identifier: BSD-3-Clause
602
602
  */
603
- const ho = (e, t, o) => (o.configurable = !0, o.enumerable = !0, Reflect.decorate && typeof t != "object" && Object.defineProperty(e, t, o), o);
603
+ const go = (e, t, o) => (o.configurable = !0, o.enumerable = !0, Reflect.decorate && typeof t != "object" && Object.defineProperty(e, t, o), o);
604
604
  /**
605
605
  * @license
606
606
  * Copyright 2017 Google LLC
607
607
  * SPDX-License-Identifier: BSD-3-Clause
608
608
  */
609
- function mt(e, t) {
609
+ function bt(e, t) {
610
610
  return (o, r, s) => {
611
611
  const i = (a) => {
612
612
  var l;
613
613
  return ((l = a.renderRoot) == null ? void 0 : l.querySelector(e)) ?? null;
614
614
  };
615
- return ho(o, r, { get() {
615
+ return go(o, r, { get() {
616
616
  return i(this);
617
617
  } });
618
618
  };
619
619
  }
620
620
  var S = /* @__PURE__ */ ((e) => (e.reaction = "reaction", e.stars = "stars", e.poll = "poll", e.text = "text", e.nps = "nps", e))(S || {});
621
- const Zt = c`
621
+ const Xt = c`
622
622
  <svg
623
623
  xmlns="http://www.w3.org/2000/svg"
624
624
  height="24px"
@@ -628,7 +628,7 @@ const Zt = c`
628
628
  >
629
629
  <path d="M640-160v-280h160v280H640Zm-240 0v-640h160v640H400Zm-240 0v-440h160v440H160Z" />
630
630
  </svg>
631
- `, Jt = c`
631
+ `, Qt = c`
632
632
  <svg
633
633
  xmlns="http://www.w3.org/2000/svg"
634
634
  height="24px"
@@ -640,7 +640,7 @@ const Zt = c`
640
640
  d="M160-160v-440h160v440H160Zm240 0v-400l160 160v240H400Zm160-354L400-674v-126h160v286Zm240 240L640-434v-6h160v166Zm-9 219L55-791l57-57 736 736-57 57Z"
641
641
  />
642
642
  </svg>
643
- `, kt = c`
643
+ `, At = c`
644
644
  <svg
645
645
  xmlns="http://www.w3.org/2000/svg"
646
646
  height="24px"
@@ -652,7 +652,7 @@ const Zt = c`
652
652
  d="M200-200h57l391-391-57-57-391 391v57Zm-80 80v-170l528-527q12-11 26.5-17t30.5-6q16 0 31 6t26 18l55 56q12 11 17.5 26t5.5 30q0 16-5.5 30.5T817-647L290-120H120Zm640-584-56-56 56 56Zm-141 85-28-29 57 57-29-28Z"
653
653
  />
654
654
  </svg>
655
- `, Tt = c`
655
+ `, _t = c`
656
656
  <svg
657
657
  xmlns="http://www.w3.org/2000/svg"
658
658
  width="16"
@@ -664,7 +664,7 @@ const Zt = c`
664
664
  d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708"
665
665
  />
666
666
  </svg>
667
- `, Ie = c`
667
+ `, Me = c`
668
668
  <svg
669
669
  xmlns="http://www.w3.org/2000/svg"
670
670
  height="24px"
@@ -675,95 +675,95 @@ const Zt = c`
675
675
  <path d="M440-440H200v-80h240v-240h80v240h240v80H520v240h-80v-240Z" />
676
676
  </svg>
677
677
  `;
678
- var fo = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, L = function(e) {
678
+ var mo = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, L = function(e) {
679
679
  return typeof e == "string" ? e.length > 0 : typeof e == "number";
680
- }, $ = function(e, t, o) {
680
+ }, C = function(e, t, o) {
681
681
  return t === void 0 && (t = 0), o === void 0 && (o = Math.pow(10, t)), Math.round(o * e) / o + 0;
682
- }, P = function(e, t, o) {
682
+ }, T = function(e, t, o) {
683
683
  return t === void 0 && (t = 0), o === void 0 && (o = 1), e > o ? o : e > t ? e : t;
684
- }, ze = function(e) {
684
+ }, Le = function(e) {
685
685
  return (e = isFinite(e) ? e % 360 : 0) > 0 ? e : e + 360;
686
- }, pe = function(e) {
687
- return { r: P(e.r, 0, 255), g: P(e.g, 0, 255), b: P(e.b, 0, 255), a: P(e.a) };
686
+ }, he = function(e) {
687
+ return { r: T(e.r, 0, 255), g: T(e.g, 0, 255), b: T(e.b, 0, 255), a: T(e.a) };
688
688
  }, Rt = function(e) {
689
- return { r: $(e.r), g: $(e.g), b: $(e.b), a: $(e.a, 3) };
690
- }, go = /^#([0-9a-f]{3,8})$/i, yt = function(e) {
689
+ return { r: C(e.r), g: C(e.g), b: C(e.b), a: C(e.a, 3) };
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
- }, Me = function(e) {
693
+ }, Ne = 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
- }, Le = function(e) {
696
+ }, De = 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;
700
700
  return { r: 255 * [r, l, a, a, n, r][d], g: 255 * [n, r, r, l, a, a][d], b: 255 * [a, a, n, r, r, l][d], a: s };
701
- }, ue = function(e) {
702
- return { h: ze(e.h), s: P(e.s, 0, 100), l: P(e.l, 0, 100), a: P(e.a) };
703
- }, he = function(e) {
704
- return { h: $(e.h), s: $(e.s), l: $(e.l), a: $(e.a, 3) };
705
701
  }, fe = function(e) {
706
- return Le((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 }));
702
+ return { h: Le(e.h), s: T(e.s, 0, 100), l: T(e.l, 0, 100), a: T(e.a) };
703
+ }, ge = function(e) {
704
+ return { h: C(e.h), s: C(e.s), l: C(e.l), a: C(e.a, 3) };
705
+ }, me = function(e) {
706
+ return De((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
- }, ut = function(e) {
709
- return { h: (t = Me(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 };
708
+ }, ht = function(e) {
709
+ return { h: (t = Ne(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
- }, mo = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, vo = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, bo = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, yo = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, ge = { string: [[function(e) {
712
- var t = go.exec(e);
713
- 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 ? $(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 ? $(parseInt(e.substr(6, 2), 16) / 255, 2) : 1 } : null : null;
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
+ var t = vo.exec(e);
713
+ 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 ? C(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 ? C(parseInt(e.substr(6, 2), 16) / 255, 2) : 1 } : null : null;
714
714
  }, "hex"], [function(e) {
715
- var t = bo.exec(e) || yo.exec(e);
716
- return t ? t[2] !== t[4] || t[4] !== t[6] ? null : pe({ 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;
715
+ var t = wo.exec(e) || xo.exec(e);
716
+ return t ? t[2] !== t[4] || t[4] !== t[6] ? null : he({ 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;
717
717
  }, "rgb"], [function(e) {
718
- var t = mo.exec(e) || vo.exec(e);
718
+ var t = bo.exec(e) || yo.exec(e);
719
719
  if (!t) return null;
720
- var o, r, s = ue({ h: (o = t[1], r = t[2], r === void 0 && (r = "deg"), Number(o) * (fo[r] || 1)), s: Number(t[3]), l: Number(t[4]), a: t[5] === void 0 ? 1 : Number(t[5]) / (t[6] ? 100 : 1) });
721
- return fe(s);
720
+ var o, r, s = fe({ h: (o = t[1], r = t[2], r === void 0 && (r = "deg"), Number(o) * (mo[r] || 1)), s: Number(t[3]), l: Number(t[4]), a: t[5] === void 0 ? 1 : Number(t[5]) / (t[6] ? 100 : 1) });
721
+ return me(s);
722
722
  }, "hsl"]], object: [[function(e) {
723
723
  var t = e.r, o = e.g, r = e.b, s = e.a, i = s === void 0 ? 1 : s;
724
- return L(t) && L(o) && L(r) ? pe({ r: Number(t), g: Number(o), b: Number(r), a: Number(i) }) : null;
724
+ return L(t) && L(o) && L(r) ? he({ r: Number(t), g: Number(o), b: Number(r), a: Number(i) }) : null;
725
725
  }, "rgb"], [function(e) {
726
726
  var t = e.h, o = e.s, r = e.l, s = e.a, i = s === void 0 ? 1 : s;
727
727
  if (!L(t) || !L(o) || !L(r)) return null;
728
- var a = ue({ h: Number(t), s: Number(o), l: Number(r), a: Number(i) });
729
- return fe(a);
728
+ var a = fe({ h: Number(t), s: Number(o), l: Number(r), a: Number(i) });
729
+ return me(a);
730
730
  }, "hsl"], [function(e) {
731
731
  var t = e.h, o = e.s, r = e.v, s = e.a, i = s === void 0 ? 1 : s;
732
732
  if (!L(t) || !L(o) || !L(r)) return null;
733
733
  var a = function(l) {
734
- return { h: ze(l.h), s: P(l.s, 0, 100), v: P(l.v, 0, 100), a: P(l.a) };
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 Le(a);
737
- }, "hsv"]] }, me = function(e, t) {
736
+ return De(a);
737
+ }, "hsv"]] }, be = function(e, t) {
738
738
  for (var o = 0; o < t.length; o++) {
739
739
  var r = t[o][0](e);
740
740
  if (r) return [r, t[o][1]];
741
741
  }
742
742
  return [null, void 0];
743
- }, xo = function(e) {
744
- return typeof e == "string" ? me(e.trim(), ge.string) : typeof e == "object" && e !== null ? me(e, ge.object) : [null, void 0];
745
- }, Vt = function(e, t) {
746
- var o = ut(e);
747
- return { h: o.h, s: P(o.s + 100 * t, 0, 100), l: o.l, a: o.a };
748
- }, Bt = function(e) {
743
+ }, $o = function(e) {
744
+ return typeof e == "string" ? be(e.trim(), ve.string) : typeof e == "object" && e !== null ? be(e, ve.object) : [null, void 0];
745
+ }, Bt = function(e, t) {
746
+ var o = ht(e);
747
+ return { h: o.h, s: T(o.s + 100 * t, 0, 100), l: o.l, a: o.a };
748
+ }, Ut = function(e) {
749
749
  return (299 * e.r + 587 * e.g + 114 * e.b) / 1e3 / 255;
750
- }, ve = function(e, t) {
751
- var o = ut(e);
752
- return { h: o.h, s: o.s, l: P(o.l + 100 * t, 0, 100), a: o.a };
753
- }, be = function() {
750
+ }, ye = function(e, t) {
751
+ var o = ht(e);
752
+ return { h: o.h, s: o.s, l: T(o.l + 100 * t, 0, 100), a: o.a };
753
+ }, we = function() {
754
754
  function e(t) {
755
- this.parsed = xo(t)[0], this.rgba = this.parsed || { r: 0, g: 0, b: 0, a: 1 };
755
+ this.parsed = $o(t)[0], this.rgba = this.parsed || { r: 0, g: 0, b: 0, a: 1 };
756
756
  }
757
757
  return e.prototype.isValid = function() {
758
758
  return this.parsed !== null;
759
759
  }, e.prototype.brightness = function() {
760
- return $(Bt(this.rgba), 2);
760
+ return C(Ut(this.rgba), 2);
761
761
  }, e.prototype.isDark = function() {
762
- return Bt(this.rgba) < 0.5;
762
+ return Ut(this.rgba) < 0.5;
763
763
  }, e.prototype.isLight = function() {
764
- return Bt(this.rgba) >= 0.5;
764
+ return Ut(this.rgba) >= 0.5;
765
765
  }, e.prototype.toHex = function() {
766
- return t = Rt(this.rgba), o = t.r, r = t.g, s = t.b, a = (i = t.a) < 1 ? yt($(255 * i)) : "", "#" + yt(o) + yt(r) + yt(s) + a;
766
+ return t = Rt(this.rgba), o = t.r, r = t.g, s = t.b, a = (i = t.a) < 1 ? xt(C(255 * i)) : "", "#" + xt(o) + xt(r) + xt(s) + a;
767
767
  var t, o, r, s, i, a;
768
768
  }, e.prototype.toRgb = function() {
769
769
  return Rt(this.rgba);
@@ -771,60 +771,60 @@ var fo = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, L = function(e) {
771
771
  return t = Rt(this.rgba), o = t.r, r = t.g, s = t.b, (i = t.a) < 1 ? "rgba(" + o + ", " + r + ", " + s + ", " + i + ")" : "rgb(" + o + ", " + r + ", " + s + ")";
772
772
  var t, o, r, s, i;
773
773
  }, e.prototype.toHsl = function() {
774
- return he(ut(this.rgba));
774
+ return ge(ht(this.rgba));
775
775
  }, e.prototype.toHslString = function() {
776
- return t = he(ut(this.rgba)), o = t.h, r = t.s, s = t.l, (i = t.a) < 1 ? "hsla(" + o + ", " + r + "%, " + s + "%, " + i + ")" : "hsl(" + o + ", " + r + "%, " + s + "%)";
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 = Me(this.rgba), { h: $(t.h), s: $(t.s), v: $(t.v), a: $(t.a, 3) };
779
+ return t = Ne(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
- return T({ r: 255 - (t = this.rgba).r, g: 255 - t.g, b: 255 - t.b, a: t.a });
782
+ return O({ r: 255 - (t = this.rgba).r, g: 255 - t.g, b: 255 - t.b, a: t.a });
783
783
  var t;
784
784
  }, e.prototype.saturate = function(t) {
785
- return t === void 0 && (t = 0.1), T(Vt(this.rgba, t));
785
+ return t === void 0 && (t = 0.1), O(Bt(this.rgba, t));
786
786
  }, e.prototype.desaturate = function(t) {
787
- return t === void 0 && (t = 0.1), T(Vt(this.rgba, -t));
787
+ return t === void 0 && (t = 0.1), O(Bt(this.rgba, -t));
788
788
  }, e.prototype.grayscale = function() {
789
- return T(Vt(this.rgba, -1));
789
+ return O(Bt(this.rgba, -1));
790
790
  }, e.prototype.lighten = function(t) {
791
- return t === void 0 && (t = 0.1), T(ve(this.rgba, t));
791
+ return t === void 0 && (t = 0.1), O(ye(this.rgba, t));
792
792
  }, e.prototype.darken = function(t) {
793
- return t === void 0 && (t = 0.1), T(ve(this.rgba, -t));
793
+ return t === void 0 && (t = 0.1), O(ye(this.rgba, -t));
794
794
  }, e.prototype.rotate = function(t) {
795
795
  return t === void 0 && (t = 15), this.hue(this.hue() + t);
796
796
  }, e.prototype.alpha = function(t) {
797
- return typeof t == "number" ? T({ r: (o = this.rgba).r, g: o.g, b: o.b, a: t }) : $(this.rgba.a, 3);
797
+ return typeof t == "number" ? O({ r: (o = this.rgba).r, g: o.g, b: o.b, a: t }) : C(this.rgba.a, 3);
798
798
  var o;
799
799
  }, e.prototype.hue = function(t) {
800
- var o = ut(this.rgba);
801
- return typeof t == "number" ? T({ h: t, s: o.s, l: o.l, a: o.a }) : $(o.h);
800
+ var o = ht(this.rgba);
801
+ return typeof t == "number" ? O({ h: t, s: o.s, l: o.l, a: o.a }) : C(o.h);
802
802
  }, e.prototype.isEqual = function(t) {
803
- return this.toHex() === T(t).toHex();
803
+ return this.toHex() === O(t).toHex();
804
804
  }, e;
805
- }(), T = function(e) {
806
- return e instanceof be ? e : new be(e);
805
+ }(), O = function(e) {
806
+ return e instanceof we ? e : new we(e);
807
807
  };
808
- const Ut = process.env.NODE_ENV === "development" || process.env.NODE_ENV === "test";
809
- function wo(e) {
808
+ const Vt = process.env.NODE_ENV === "development" || process.env.NODE_ENV === "test";
809
+ function So(e) {
810
810
  return {
811
811
  debug: (t, ...o) => {
812
- Ut && console.debug(`[${e}]`, t, ...o);
812
+ Vt && console.debug(`[${e}]`, t, ...o);
813
813
  },
814
814
  info: (t, ...o) => {
815
- Ut && console.info(`[${e}]`, t, ...o);
815
+ Vt && console.info(`[${e}]`, t, ...o);
816
816
  },
817
817
  warn: (t, ...o) => {
818
- Ut && console.warn(`[${e}]`, t, ...o);
818
+ Vt && console.warn(`[${e}]`, t, ...o);
819
819
  },
820
820
  error: (t, ...o) => {
821
821
  console.error(`[${e}]`, t, ...o);
822
822
  }
823
823
  };
824
824
  }
825
- const m = wo("Pollcatch");
826
- var Ne = /* @__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))(Ne || {});
827
- const $o = {
825
+ const g = So("Pollcatch");
826
+ 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 Co = {
828
828
  black: "#000000",
829
829
  white: "#ffffff",
830
830
  red: "#ff0000",
@@ -841,21 +841,21 @@ const $o = {
841
841
  teal: "#008080",
842
842
  navy: "#000080"
843
843
  };
844
- function So(e) {
844
+ function ko(e) {
845
845
  const t = e.toLowerCase().trim();
846
- return $o[t] || null;
846
+ return Co[t] || null;
847
847
  }
848
848
  function jt(e, t) {
849
- const o = ye(e), r = ye(t), s = Math.max(o, r), i = Math.min(o, r);
849
+ const o = xe(e), r = xe(t), s = Math.max(o, r), i = Math.min(o, r);
850
850
  return (s + 0.05) / (i + 0.05);
851
851
  }
852
- function ye(e) {
853
- const t = ko(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);
852
+ function xe(e) {
853
+ const t = Ao(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
854
  return 0.2126 * i + 0.7152 * a + 0.0722 * l;
855
855
  }
856
- function Co(e, t = {}) {
857
- if (!T(e).isValid())
858
- return m.warn(`Invalid color provided: ${e}`), "black";
856
+ function Eo(e, t = {}) {
857
+ if (!O(e).isValid())
858
+ return g.warn(`Invalid color provided: ${e}`), "black";
859
859
  const {
860
860
  minContrast: r = 4.5,
861
861
  colorOptions: s = ["black", "white", "light", "dark"],
@@ -875,23 +875,23 @@ function Co(e, t = {}) {
875
875
  n = a, d = p;
876
876
  for (const h of l) {
877
877
  if (h === a) continue;
878
- const b = jt(e, h);
879
- b > d && (d = b, n = h);
878
+ const v = jt(e, h);
879
+ v > d && (d = v, n = h);
880
880
  }
881
- m.warn(
881
+ g.warn(
882
882
  `No color option met the minimum contrast ratio of ${r}:1 against ${e}. Using ${n} with contrast ratio ${d.toFixed(2)}:1 instead.`
883
883
  );
884
884
  }
885
885
  return n;
886
886
  }
887
- function ko(e) {
888
- const o = So(e) || e, r = T(o);
887
+ function Ao(e) {
888
+ const o = ko(e) || e, r = O(o);
889
889
  if (!r.isValid())
890
- return m.warn(`Invalid color provided: ${e}`), { r: 0, g: 0, b: 0 };
890
+ return g.warn(`Invalid color provided: ${e}`), { r: 0, g: 0, b: 0 };
891
891
  const { r: s, g: i, b: a } = r.toRgb();
892
892
  return { r: s, g: i, b: a };
893
893
  }
894
- function O(e, t) {
894
+ function z(e, t) {
895
895
  const r = t ? {
896
896
  left: "start",
897
897
  right: "end",
@@ -922,7 +922,7 @@ function qt(e, t = "1rem", o = 1) {
922
922
  const l = parseFloat(i);
923
923
  return isNaN(l) ? t : `${l}rem`;
924
924
  }
925
- function Eo(e, t = "4px") {
925
+ function Po(e, t = "4px") {
926
926
  if (!e) return t;
927
927
  const o = {
928
928
  xs: "2px",
@@ -943,7 +943,7 @@ function Eo(e, t = "4px") {
943
943
  return isNaN(a) ? t : `${a}px`;
944
944
  }
945
945
  var N = /* @__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))(N || {});
946
- function rt(e) {
946
+ function st(e) {
947
947
  const t = {};
948
948
  e.role !== void 0 && (t.role = e.role);
949
949
  for (const [o, r] of Object.entries(e)) {
@@ -953,16 +953,16 @@ function rt(e) {
953
953
  }
954
954
  return t;
955
955
  }
956
- function Ao(e, t, o) {
957
- return rt({
956
+ function To(e, t, o) {
957
+ return st({
958
958
  role: "button",
959
959
  ariaLabel: e,
960
960
  ariaPressed: t,
961
961
  ariaDisabled: o
962
962
  });
963
963
  }
964
- function Po(e, t, o, r = !1) {
965
- return rt({
964
+ function _o(e, t, o, r = !1) {
965
+ return st({
966
966
  role: r ? "radio" : "checkbox",
967
967
  ariaLabel: e,
968
968
  ariaChecked: t,
@@ -972,79 +972,79 @@ function Po(e, t, o, r = !1) {
972
972
  function Ht(e, t, o) {
973
973
  typeof o == "boolean" ? e.setAttribute(t, o ? "true" : "false") : e.setAttribute(t, o);
974
974
  }
975
- function To(e) {
975
+ function Oo(e) {
976
976
  if (typeof e != "string")
977
977
  return !1;
978
978
  const t = e.replace(/[<>"']/g, "").trim();
979
979
  return /^(#[0-9a-fA-F]{3,8}|rgb\([^)]+\)|rgba\([^)]+\)|hsl\([^)]+\)|hsla\([^)]+\)|[a-zA-Z]+)$/.test(t);
980
980
  }
981
- function et(e) {
982
- return To(e) ? e.replace(/[<>"']/g, "").trim() : (m.warn("Invalid color value:", e), "#000000");
981
+ function ot(e) {
982
+ return Oo(e) ? e.replace(/[<>"']/g, "").trim() : (g.warn("Invalid color value:", e), "#000000");
983
983
  }
984
- function _o(e) {
984
+ function Io(e) {
985
985
  if (typeof e != "string")
986
- return m.warn("Non-string value passed to sanitizeCSS:", typeof e), "";
986
+ return g.warn("Non-string value passed to sanitizeCSS:", typeof e), "";
987
987
  let t = e;
988
988
  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
989
  }
990
- function Oo(e) {
990
+ function zo(e) {
991
991
  return typeof e != "string" || !e.trim() ? "" : e.replace(
992
992
  /([^{}:;]+):\s*([^;{}!]+)(\s*!important)?\s*(;|})/gi,
993
993
  (t, o, r, s, i) => s ? t : `${o}: ${r.trim()} !important${i}`
994
994
  );
995
995
  }
996
- const xe = "https://jpxwfjorwcsrqraorpbj.supabase.co/functions/v1/data", Io = "pc_session_id", zo = 24 * 60 * 60 * 1e3;
997
- function we() {
998
- return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : (m.warn("crypto.randomUUID not available, using fallback UUID generator"), "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
996
+ const Yt = "https://jpxwfjorwcsrqraorpbj.supabase.co/functions/v1/data", Mo = "pc_session_id", Lo = 24 * 60 * 60 * 1e3;
997
+ function $e() {
998
+ 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
999
  const t = Math.random() * 16 | 0;
1000
1000
  return (e === "x" ? t : t & 3 | 8).toString(16);
1001
1001
  }));
1002
1002
  }
1003
- function Xt() {
1003
+ function te() {
1004
1004
  const e = "test-local-storage";
1005
1005
  try {
1006
1006
  return localStorage.setItem(e, e), localStorage.removeItem(e), !0;
1007
1007
  } catch {
1008
- return m.warn("localStorage not available, session ID will not persist"), !1;
1008
+ return g.warn("localStorage not available, session ID will not persist"), !1;
1009
1009
  }
1010
1010
  }
1011
- function De(e) {
1011
+ function Be(e) {
1012
1012
  try {
1013
1013
  const t = localStorage.getItem(e);
1014
1014
  return t ? JSON.parse(t) : void 0;
1015
1015
  } catch (t) {
1016
- m.warn(`Failed to get item from localStorage: ${e}`, t);
1016
+ g.warn(`Failed to get item from localStorage: ${e}`, t);
1017
1017
  return;
1018
1018
  }
1019
1019
  }
1020
- function Re(e, t) {
1020
+ function Ue(e, t) {
1021
1021
  try {
1022
1022
  return localStorage.setItem(e, JSON.stringify(t)), !0;
1023
1023
  } catch (o) {
1024
- return m.warn(`Failed to set item in localStorage: ${e}`, o), !1;
1024
+ return g.warn(`Failed to set item in localStorage: ${e}`, o), !1;
1025
1025
  }
1026
1026
  }
1027
- async function $e() {
1028
- const e = Io, t = zo;
1029
- if (Xt()) {
1030
- const o = De(e);
1027
+ async function Se() {
1028
+ const e = Mo, t = Lo;
1029
+ if (te()) {
1030
+ const o = Be(e);
1031
1031
  if (o && o.id && o.timestamp && Date.now() - o.timestamp < t)
1032
- return m.debug("Using existing session ID from localStorage"), o.id;
1033
- m.debug(
1032
+ return g.debug("Using existing session ID from localStorage"), o.id;
1033
+ g.debug(
1034
1034
  o ? "Session ID expired" : "No session ID found",
1035
1035
  "generating new one"
1036
1036
  );
1037
- const r = we();
1038
- return Re(e, {
1037
+ const r = $e();
1038
+ return Ue(e, {
1039
1039
  id: r,
1040
1040
  timestamp: Date.now()
1041
- }) ? m.debug("Generated and stored new session ID") : m.warn("Generated session ID but failed to store it"), r;
1041
+ }) ? g.debug("Generated and stored new session ID") : g.warn("Generated session ID but failed to store it"), r;
1042
1042
  } else {
1043
- const o = we();
1044
- return m.debug("Generated non-persistent session ID"), o;
1043
+ const o = $e();
1044
+ return g.debug("Generated non-persistent session ID"), o;
1045
1045
  }
1046
1046
  }
1047
- function Et(e) {
1047
+ function ft(e) {
1048
1048
  if (!e || typeof e != "object")
1049
1049
  return 0;
1050
1050
  let t = 0, o = 0, r = 0;
@@ -1057,7 +1057,7 @@ function Et(e) {
1057
1057
  const s = t / r * 100, i = o / r * 100;
1058
1058
  return Math.round(s - i);
1059
1059
  }
1060
- function Mo(e) {
1060
+ function No(e) {
1061
1061
  if (!e || typeof e != "object")
1062
1062
  return { promoters: 0, passives: 0, detractors: 0 };
1063
1063
  let t = 0, o = 0, r = 0;
@@ -1067,14 +1067,14 @@ function Mo(e) {
1067
1067
  }
1068
1068
  return { promoters: t, passives: o, detractors: r };
1069
1069
  }
1070
- function Lo(e, t) {
1070
+ function Do(e, t) {
1071
1071
  const o = {};
1072
1072
  for (const r of t)
1073
1073
  o[r] = e[r] || 0;
1074
1074
  return o;
1075
1075
  }
1076
- function No(e, t) {
1077
- const o = t ? Lo(e, t) : e;
1076
+ function Ce(e, t) {
1077
+ const o = t ? Do(e, t) : e;
1078
1078
  let r = 0, s = 0;
1079
1079
  for (const [a, l] of Object.entries(o)) {
1080
1080
  s += l;
@@ -1093,26 +1093,26 @@ function D() {
1093
1093
  updated: (/* @__PURE__ */ new Date()).toISOString()
1094
1094
  };
1095
1095
  }
1096
- function Do(e) {
1097
- if (!Xt())
1096
+ function Ro(e) {
1097
+ if (!te())
1098
1098
  return D();
1099
1099
  try {
1100
- const t = De(e);
1100
+ const t = Be(e);
1101
1101
  return t ? { ...D(), ...t } : D();
1102
1102
  } catch (t) {
1103
- return m.warn("Failed to load localStats from localStorage", t), D();
1103
+ return g.warn("Failed to load localStats from localStorage", t), D();
1104
1104
  }
1105
1105
  }
1106
- function Ro(e, t) {
1107
- if (!Xt())
1106
+ function Bo(e, t) {
1107
+ if (!te())
1108
1108
  return !1;
1109
1109
  try {
1110
- return Re(e, t) ? (m.debug("Saved localStats to localStorage", t), !0) : !1;
1110
+ return Ue(e, t) ? (g.debug("Saved localStats to localStorage", t), !0) : !1;
1111
1111
  } catch (o) {
1112
- return m.warn("Failed to save localStats to localStorage", o), !1;
1112
+ return g.warn("Failed to save localStats to localStorage", o), !1;
1113
1113
  }
1114
1114
  }
1115
- function Vo(e, t) {
1115
+ function Uo(e, t) {
1116
1116
  const o = {
1117
1117
  count: Math.max(0, e.count - t.count),
1118
1118
  sum: (e.sum || 0) - (t.sum || 0),
@@ -1125,9 +1125,9 @@ function Vo(e, t) {
1125
1125
  if (o.count > 0 && o.sum !== void 0 ? o.avg = Math.round(o.sum / o.count * 100) / 100 : o.avg = 0, t.breakdown && o.breakdown)
1126
1126
  for (const [r, s] of Object.entries(t.breakdown))
1127
1127
  o.breakdown[r] && (o.breakdown[r] = Math.max(0, o.breakdown[r] - s), o.breakdown[r] === 0 && delete o.breakdown[r]);
1128
- return o.nps = Et((o == null ? void 0 : o.breakdown) || {}), o;
1128
+ return o.nps = ft((o == null ? void 0 : o.breakdown) || {}), o;
1129
1129
  }
1130
- function Bo(e, t) {
1130
+ function Vo(e, t) {
1131
1131
  if (!e.count && !t.count)
1132
1132
  return D();
1133
1133
  if (!e.count)
@@ -1146,12 +1146,12 @@ function Bo(e, t) {
1146
1146
  for (const [r, s] of Object.entries(t.breakdown))
1147
1147
  o.breakdown[r] = (o.breakdown[r] || 0) + s;
1148
1148
  }
1149
- return o.nps = Et((o == null ? void 0 : o.breakdown) || {}), o;
1149
+ return o.nps = ft((o == null ? void 0 : o.breakdown) || {}), o;
1150
1150
  }
1151
1151
  function Ve(e) {
1152
1152
  return !e || typeof e != "string" ? !1 : /^[\p{Emoji}]$/u.test(e) ? !0 : new RegExp("^\\p{Emoji}(\\p{Emoji_Modifier}|\\u200D\\p{Emoji})*$", "u").test(e);
1153
1153
  }
1154
- function _t(e) {
1154
+ function Ot(e) {
1155
1155
  if (!e || typeof e != "string")
1156
1156
  return !1;
1157
1157
  const t = e.trim();
@@ -1165,7 +1165,7 @@ function _t(e) {
1165
1165
  return !1;
1166
1166
  }
1167
1167
  }
1168
- function Uo(e) {
1168
+ function jo(e) {
1169
1169
  if (!e || typeof e != "string")
1170
1170
  return [];
1171
1171
  const t = e.trim();
@@ -1180,25 +1180,33 @@ function Uo(e) {
1180
1180
  }
1181
1181
  return t.split(",").map((o) => o.trim()).filter((o) => o !== "");
1182
1182
  }
1183
- function jo(e, t) {
1183
+ function qo(e, t) {
1184
1184
  const o = /{([^{}]+)}/g;
1185
1185
  return e.replace(o, (r, s) => {
1186
1186
  const i = s.trim(), a = t[i];
1187
1187
  return a !== void 0 ? String(a) : r;
1188
1188
  });
1189
1189
  }
1190
- function qo(e, t) {
1190
+ function Ho(e, t) {
1191
1191
  let o = 2166136261;
1192
1192
  const r = e + ":" + t;
1193
1193
  for (let s = 0; s < r.length; s++)
1194
1194
  o ^= r.charCodeAt(s), o += (o << 1) + (o << 4) + (o << 7) + (o << 8) + (o << 24);
1195
1195
  return (o >>> 0).toString(16).padStart(8, "0");
1196
1196
  }
1197
- function Ho(e, t = 50) {
1197
+ function Fo(e, t = 50) {
1198
1198
  return e.length <= t ? e : e.substring(0, t).trim() + "...";
1199
1199
  }
1200
- const Se = 5;
1201
- class Fo {
1200
+ const Wt = /* @__PURE__ */ new Map();
1201
+ function Yo(e, t) {
1202
+ Wt.set(e, t);
1203
+ }
1204
+ function Wo(e) {
1205
+ const t = Wt.get(e);
1206
+ return t && Wt.delete(e), t;
1207
+ }
1208
+ const ke = 5;
1209
+ class Ko {
1202
1210
  // Tracks if user has ever made a selection (even if later deselected)
1203
1211
  constructor(t) {
1204
1212
  this.stats = D(), this.localStats = D(), this.prevLocalStats = D(), this.isLoading = !0, this.isLoadingConfig = !1, this.isSubmitting = !1, this.hasInteracted = !1, (this.host = t).addController(this);
@@ -1212,13 +1220,13 @@ class Fo {
1212
1220
  */
1213
1221
  validateWidgetIdentifier() {
1214
1222
  const t = this.host;
1215
- return t.widgetId ? /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(t.widgetId) ? { type: "registered" } : { type: "none", error: `Invalid widget-id format: ${t.widgetId}` } : t.name ? t.name.length < Se ? {
1223
+ return t.widgetId ? /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(t.widgetId) ? { type: "registered" } : { type: "none", error: `Invalid widget-id format: ${t.widgetId}` } : t.name ? t.name.length < ke ? {
1216
1224
  type: "none",
1217
- error: `Widget name must be at least ${Se} characters long. Got: "${t.name}"`
1225
+ error: `Widget name must be at least ${ke} characters long. Got: "${t.name}"`
1218
1226
  } : { type: "public" } : { type: "none", error: "Widget requires either widget-id or name attribute" };
1219
1227
  }
1220
1228
  async getLocalStatsKey() {
1221
- const t = this.host, o = await $e(), r = t.widgetId || t.name || "unnamed";
1229
+ const t = this.host, o = await Se(), r = t.widgetId || t.name || "unnamed";
1222
1230
  return `pc-local-stats-${o}-${r}`;
1223
1231
  }
1224
1232
  /**
@@ -1238,7 +1246,7 @@ class Fo {
1238
1246
  for (const [s, i] of Object.entries(t)) {
1239
1247
  if (i == null) continue;
1240
1248
  const a = s.replace(/([A-Z])/g, "-$1").toLowerCase();
1241
- typeof i == "boolean" ? i ? r.setAttribute(a, "") : r.removeAttribute(a) : typeof i == "object" ? r.setAttribute(a, JSON.stringify(i)) : r.setAttribute(a, String(i)), m.debug(`Applied widget attribute: ${a}=${i}`);
1249
+ typeof i == "boolean" ? i ? r.setAttribute(a, "") : r.removeAttribute(a) : typeof i == "object" ? r.setAttribute(a, JSON.stringify(i)) : r.setAttribute(a, String(i)), g.debug(`Applied widget attribute: ${a}=${i}`);
1242
1250
  }
1243
1251
  }
1244
1252
  /**
@@ -1250,61 +1258,78 @@ class Fo {
1250
1258
  this.isLoading = !1, this.stats = this.localStats, this.host.requestUpdate();
1251
1259
  const o = this.validateWidgetIdentifier();
1252
1260
  if (o.error) {
1253
- m.error(o.error);
1261
+ g.error(o.error);
1254
1262
  return;
1255
1263
  }
1264
+ if (o.type === "registered" && t.widgetId) {
1265
+ const a = Wo(t.widgetId);
1266
+ if (a) {
1267
+ g.debug("Using prefetched config from cache", { widgetId: t.widgetId }), this.applyWidgetAttributes(a.attributes);
1268
+ 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;
1269
+ this.stats = {
1270
+ count: d,
1271
+ sum: p,
1272
+ avg: h,
1273
+ pct: v,
1274
+ nps: t.type === S.nps ? ft(n.breakdown) : 0,
1275
+ breakdown: n.breakdown,
1276
+ updated: a.stats.updatedAt || (/* @__PURE__ */ new Date()).toISOString()
1277
+ }, this.isLoading = !1, this.isLoadingConfig = !1, this.host.requestUpdate();
1278
+ return;
1279
+ }
1280
+ }
1256
1281
  try {
1257
1282
  const a = t.type;
1258
1283
  let l;
1259
1284
  if (t.dataFunc && typeof window < "u") {
1260
- const w = t.dataFunc.replace(/^window\./, "").split(".");
1261
- let A = window;
1262
- for (const W of w)
1263
- if (A = A == null ? void 0 : A[W], A === void 0) break;
1264
- l = A;
1285
+ const y = t.dataFunc.replace(/^window\./, "").split(".");
1286
+ let E = window;
1287
+ for (const G of y)
1288
+ if (E = E == null ? void 0 : E[G], E === void 0) break;
1289
+ l = E;
1265
1290
  }
1266
1291
  let n, d = null;
1267
1292
  if (l && typeof l == "function") {
1268
- const C = this.getOptionsForDataFunc(t);
1269
- m.debug(`Using data function for: ${t.widgetId || t.name}`, {
1293
+ const $ = this.getOptionsForDataFunc(t);
1294
+ g.debug(`Using data function for: ${t.widgetId || t.name}`, {
1270
1295
  dataFuncName: t.dataFunc,
1271
- options: C
1296
+ options: $
1272
1297
  });
1273
- const w = await l(t.widgetId, t.name, C);
1274
- if (w && typeof w == "object" && "success" in w && "data" in w) {
1275
- if (!w.success)
1276
- throw m.error("Custom data function returned unsuccessful response", w), new Error("Custom data function returned unsuccessful response");
1277
- n = w.data || {};
1298
+ const y = await l(t.widgetId, t.name, $);
1299
+ if (y && typeof y == "object" && "success" in y && "data" in y) {
1300
+ if (!y.success)
1301
+ throw g.error("Custom data function returned unsuccessful response", y), new Error("Custom data function returned unsuccessful response");
1302
+ n = y.data || {};
1278
1303
  } else
1279
- n = w || {};
1304
+ n = y || {};
1280
1305
  } else {
1281
- const C = t.dataEndpoint || xe;
1282
- let w;
1283
- o.type === "registered" ? (w = `${C}/widgets/${encodeURIComponent(t.widgetId)}`, this.isLoadingConfig = !0, this.host.requestUpdate()) : w = `${C}/public-widgets/${encodeURIComponent(t.name)}`, m.debug("Fetching stats for widget", {
1284
- endpoint: w,
1306
+ const $ = t.dataEndpoint || Yt;
1307
+ let y;
1308
+ o.type === "registered" ? (y = `${$}/widgets/${encodeURIComponent(t.widgetId)}`, this.isLoadingConfig = !0, this.host.requestUpdate()) : y = `${$}/public-widgets/${encodeURIComponent(t.name)}`, g.debug("Fetching stats for widget", {
1309
+ endpoint: y,
1285
1310
  type: o.type
1286
1311
  });
1287
- const A = await fetch(w);
1288
- if (!A.ok)
1289
- throw new Error(`API request failed with status: ${A.status}`);
1290
- const W = await A.json();
1291
- if (!W.success)
1292
- throw m.error("Backend returned unsuccessful response", W), new Error("Backend returned unsuccessful response");
1293
- o.type === "registered" ? (d = ((s = (r = W.data) == null ? void 0 : r.config) == null ? void 0 : s.attributes) || null, n = ((i = W.data) == null ? void 0 : i.stats) || {}) : n = W.data || {};
1312
+ const E = await fetch(y);
1313
+ if (!E.ok)
1314
+ throw new Error(`API request failed with status: ${E.status}`);
1315
+ const G = await E.json();
1316
+ if (!G.success)
1317
+ throw g.error("Backend returned unsuccessful response", G), new Error("Backend returned unsuccessful response");
1318
+ o.type === "registered" ? (d = ((s = (r = G.data) == null ? void 0 : r.config) == null ? void 0 : s.attributes) || null, n = ((i = G.data) == null ? void 0 : i.stats) || {}) : n = G.data || {};
1294
1319
  }
1295
1320
  d && !l && this.applyWidgetAttributes(d);
1296
- const p = this.getOptionsForDataFunc(t), h = No(n.breakdown ?? {}, p), b = h.count, x = h.sum, E = b > 0 ? Math.round(x / b * 10) / 10 : 0, z = b > 0 ? Math.round(x / b * 100) : 0, M = {
1297
- count: b,
1321
+ const p = this.getOptionsForDataFunc(t), h = Ce(n.breakdown ?? {}, p), v = h.count, x = h.sum, k = v > 0 ? Math.round(x / v * 10) / 10 : 0, P = v > 0 ? Math.round(x / v * 100) : 0, _ = {
1322
+ count: v,
1298
1323
  sum: x,
1299
- avg: E,
1300
- pct: z,
1301
- nps: a === S.nps ? Et(h.breakdown) : 0,
1324
+ avg: k,
1325
+ pct: P,
1326
+ nps: a === S.nps ? ft(h.breakdown) : 0,
1302
1327
  breakdown: h.breakdown,
1303
1328
  updated: n.updatedAt || n.updated_at || (/* @__PURE__ */ new Date()).toISOString()
1304
1329
  };
1305
- this.stats = M;
1330
+ this.stats = _;
1306
1331
  } catch (a) {
1307
- throw m.error("Error loading stats:", a, this.localStats), a;
1332
+ throw g.error("Error loading stats:", a, this.localStats), a;
1308
1333
  } finally {
1309
1334
  this.isLoading = !1, this.isLoadingConfig = !1, this.host.requestUpdate();
1310
1335
  }
@@ -1335,10 +1360,10 @@ class Fo {
1335
1360
  async loadLocalStats() {
1336
1361
  const t = await this.getLocalStatsKey();
1337
1362
  try {
1338
- const o = Do(t);
1339
- m.debug("Loaded localStats from localStorage", o), this.localStats = o, o.submitted && (this.prevLocalStats = { ...o });
1363
+ const o = Ro(t);
1364
+ g.debug("Loaded localStats from localStorage", o), this.localStats = o, o.submitted && (this.prevLocalStats = { ...o });
1340
1365
  } catch (o) {
1341
- m.warn("Failed to generate localStorage key for localStats", o), this.localStats = D();
1366
+ g.warn("Failed to generate localStorage key for localStats", o), this.localStats = D();
1342
1367
  }
1343
1368
  this.host.requestUpdate();
1344
1369
  }
@@ -1348,9 +1373,9 @@ class Fo {
1348
1373
  async persistLocalStats() {
1349
1374
  try {
1350
1375
  const t = await this.getLocalStatsKey();
1351
- Ro(t, this.localStats) || m.warn("Failed to save localStats to localStorage");
1376
+ Bo(t, this.localStats) || g.warn("Failed to save localStats to localStorage");
1352
1377
  } catch (t) {
1353
- m.warn("Failed to save localStats to localStorage", t);
1378
+ g.warn("Failed to save localStats to localStorage", t);
1354
1379
  }
1355
1380
  }
1356
1381
  /**
@@ -1362,7 +1387,7 @@ class Fo {
1362
1387
  * @param textValues
1363
1388
  */
1364
1389
  updateStats(t, o) {
1365
- if (this.hasInteracted = !0, this.stats && (this.stats = Vo(this.stats, this.localStats)), this.localStats = {
1390
+ if (this.hasInteracted = !0, this.stats && (this.stats = Uo(this.stats, this.localStats)), this.localStats = {
1366
1391
  count: t > 0 || o.length > 0 ? 1 : 0,
1367
1392
  sum: t,
1368
1393
  // e.g. number of stars, nps value
@@ -1376,15 +1401,15 @@ class Fo {
1376
1401
  }, o && o.length > 0)
1377
1402
  for (const r of o)
1378
1403
  r && (this.localStats.breakdown[r] = 1);
1379
- this.stats = Bo(this.stats, this.localStats), m.debug("Stats updated - remote: ", this.stats), m.debug("Stats updated - local: ", this.stats), this.persistLocalStats(), this.host.requestUpdate();
1404
+ this.stats = Vo(this.stats, this.localStats), g.debug("Stats updated - remote: ", this.stats), g.debug("Stats updated - local: ", this.stats), this.persistLocalStats(), this.host.requestUpdate();
1380
1405
  }
1381
1406
  async markStatsAsSubmitted() {
1382
1407
  this.localStats.submitted = (/* @__PURE__ */ new Date()).toISOString(), this.prevLocalStats = { ...this.localStats }, await this.persistLocalStats(), this.host.requestUpdate();
1383
1408
  }
1384
1409
  async submitStats() {
1385
1410
  if (!this.hasLocalStats() && !this.hasInteracted)
1386
- throw m.warn("No local stats to submit"), new Error("No local stats to submit");
1387
- const t = this.host, o = Math.floor(Date.now() / 1e3).toString(), r = await $e(), s = this.localStats.sum, i = Object.keys(this.localStats.breakdown || {}), a = this.prevLocalStats.sum, l = Object.keys(this.prevLocalStats.breakdown || {});
1411
+ throw g.warn("No local stats to submit"), new Error("No local stats to submit");
1412
+ const t = this.host, o = Math.floor(Date.now() / 1e3).toString(), r = await Se(), s = this.localStats.sum, i = Object.keys(this.localStats.breakdown || {}), a = this.prevLocalStats.sum, l = Object.keys(this.prevLocalStats.breakdown || {});
1388
1413
  this.isSubmitting = !0, this.host.requestUpdate();
1389
1414
  const n = {
1390
1415
  sessionId: r,
@@ -1398,11 +1423,11 @@ class Fo {
1398
1423
  prevTextValues: l,
1399
1424
  metadata: t.metadata,
1400
1425
  timestamp: o
1401
- }, d = qo(JSON.stringify(n), o);
1426
+ }, d = Ho(JSON.stringify(n), o);
1402
1427
  try {
1403
1428
  await this.sendStats({ ...n, hash: d }), await this.markStatsAsSubmitted(), this.dispatchSubmitEvent(n);
1404
1429
  } catch (p) {
1405
- m.warn("Failed to send stats event", p);
1430
+ g.warn("Failed to send stats event", p);
1406
1431
  } finally {
1407
1432
  this.isSubmitting = !1, this.host.requestUpdate();
1408
1433
  }
@@ -1411,43 +1436,25 @@ class Fo {
1411
1436
  async sendStats(t) {
1412
1437
  const o = this.host;
1413
1438
  if (o.dataFunc) {
1414
- m.debug("Skip sending stats as data function is in use.");
1439
+ g.debug("Skip sending stats as data function is in use.");
1415
1440
  return;
1416
1441
  }
1417
1442
  const r = this.validateWidgetIdentifier();
1418
1443
  if (r.error)
1419
- throw m.error(r.error), new Error(r.error);
1420
- const s = o.dataEndpoint || xe;
1421
- if (!_t(s))
1422
- throw m.error("Invalid data endpoint", { dataEndpoint: s }), new Error(`Invalid data endpoint: ${s}`);
1423
- let i, a;
1424
- r.type === "registered" ? (i = `${s}/widgets/${encodeURIComponent(o.widgetId)}`, a = JSON.stringify({
1425
- sessionId: t.sessionId,
1426
- numericValue: t.numericValue,
1427
- textValues: t.textValues,
1428
- prevNumericValue: t.prevNumericValue,
1429
- prevTextValues: t.prevTextValues,
1430
- metadata: t.metadata,
1431
- url: t.url,
1432
- timestamp: t.timestamp,
1433
- hash: t.hash
1434
- })) : (i = `${s}/public-widgets/${encodeURIComponent(o.name)}`, a = JSON.stringify({
1435
- sessionId: t.sessionId,
1436
- widgetType: t.widgetType,
1437
- numericValue: t.numericValue,
1438
- textValues: t.textValues,
1439
- prevNumericValue: t.prevNumericValue,
1440
- prevTextValues: t.prevTextValues,
1441
- timestamp: t.timestamp,
1442
- hash: t.hash
1443
- }));
1444
+ throw g.error(r.error), new Error(r.error);
1445
+ const s = o.dataEndpoint || Yt;
1446
+ if (!Ot(s))
1447
+ throw g.error("Invalid data endpoint", { dataEndpoint: s }), new Error(`Invalid data endpoint: ${s}`);
1448
+ let i;
1449
+ r.type === "registered" ? i = `${s}/widgets/${encodeURIComponent(o.widgetId)}` : i = `${s}/public-widgets/${encodeURIComponent(o.name)}`;
1450
+ const a = JSON.stringify(t);
1444
1451
  try {
1445
- if (m.debug("Sending stats", { endpoint: i, event: t }), typeof navigator < "u" && navigator.sendBeacon)
1452
+ if (g.debug("Sending stats", { endpoint: i, event: t }), typeof navigator < "u" && navigator.sendBeacon)
1446
1453
  if (navigator.sendBeacon(i, a)) {
1447
- m.debug("Successfully sent stats via sendBeacon");
1454
+ g.debug("Successfully sent stats via sendBeacon");
1448
1455
  return;
1449
1456
  } else
1450
- m.debug("sendBeacon failed, falling back to fetch");
1457
+ g.debug("sendBeacon failed, falling back to fetch");
1451
1458
  const l = await fetch(i, {
1452
1459
  body: a,
1453
1460
  method: "POST",
@@ -1458,9 +1465,9 @@ class Fo {
1458
1465
  });
1459
1466
  if (!l.ok)
1460
1467
  throw new Error(`API request failed with status: ${l.status}`);
1461
- m.debug("Successfully sent stats via fetch");
1468
+ g.debug("Successfully sent stats via fetch");
1462
1469
  } catch (l) {
1463
- throw m.error("Failed to send analytics:", l), l;
1470
+ throw g.error("Failed to send analytics:", l), l;
1464
1471
  }
1465
1472
  }
1466
1473
  /**
@@ -1475,9 +1482,9 @@ class Fo {
1475
1482
  sum: (o == null ? void 0 : o.sum) || 0,
1476
1483
  avg: s,
1477
1484
  pct: (o == null ? void 0 : o.pct) || 0,
1478
- nps: r.type === S.nps ? Et((o == null ? void 0 : o.breakdown) || {}) : 0
1485
+ nps: r.type === S.nps ? ft((o == null ? void 0 : o.breakdown) || {}) : 0
1479
1486
  };
1480
- return m.debug("Stats data: ", this.stats), jo(t, i);
1487
+ return g.debug("Stats data: ", this.stats), qo(t, i);
1481
1488
  }
1482
1489
  /**
1483
1490
  * Checks if a value is selected in the local stats
@@ -1537,7 +1544,7 @@ class Fo {
1537
1544
  bubbles: !0,
1538
1545
  composed: !0
1539
1546
  });
1540
- t.dispatchEvent(i), m.debug("Dispatched change event", s);
1547
+ t.dispatchEvent(i), g.debug("Dispatched change event", s);
1541
1548
  }
1542
1549
  /**
1543
1550
  * Dispatches a 'submit' CustomEvent on the host element
@@ -1549,7 +1556,7 @@ class Fo {
1549
1556
  bubbles: !0,
1550
1557
  composed: !0
1551
1558
  });
1552
- o.dispatchEvent(r), m.debug("Dispatched submit event", t);
1559
+ o.dispatchEvent(r), g.debug("Dispatched submit event", t);
1553
1560
  }
1554
1561
  hasLocalStats() {
1555
1562
  var t;
@@ -1564,7 +1571,7 @@ class Fo {
1564
1571
  return ((t = this.localStats) == null ? void 0 : t.submitted) !== void 0 && this.hasLocalStats();
1565
1572
  }
1566
1573
  }
1567
- class Yo {
1574
+ class Go {
1568
1575
  constructor(t, o) {
1569
1576
  this.isEditing = !0, this.isChartVisible = !1, this.isStatsVisible = !1, this.isThankYouVisible = !1, this.isReactionPopoverVisible = !1, this.initialized = !1, this.handleClickOutside = (r) => {
1570
1577
  r.target !== this.host && (this.toggleThankYouVisibility(!1), this.toggleReactionPopoverVisibility(!1));
@@ -1652,8 +1659,8 @@ class Yo {
1652
1659
  return !(this.host.readonly || !this.isEditing);
1653
1660
  }
1654
1661
  }
1655
- var Qt = /* @__PURE__ */ ((e) => (e.DECORATIVE = "decorative", e.FUNCTIONAL = "functional", e.STATUS = "status", e))(Qt || {});
1656
- function Be(e, t = {}) {
1662
+ var ee = /* @__PURE__ */ ((e) => (e.DECORATIVE = "decorative", e.FUNCTIONAL = "functional", e.STATUS = "status", e))(ee || {});
1663
+ function je(e, t = {}) {
1657
1664
  const { type: o = "functional", alt: r, ariaLabel: s, isSelected: i } = t;
1658
1665
  if (!e)
1659
1666
  return { alt: "", ariaHidden: !0 };
@@ -1662,20 +1669,20 @@ function Be(e, t = {}) {
1662
1669
  o === "functional" && !r && !s && console.warn(
1663
1670
  "No alt text or aria-label provided for functional icon. This may cause accessibility issues."
1664
1671
  );
1665
- const a = i ? " (selected)" : "", l = _t(e) && !r ? "" : r || e, n = s || (l ? `${l}${a}` : a);
1672
+ const a = i ? " (selected)" : "", l = Ot(e) && !r ? "" : r || e, n = s || (l ? `${l}${a}` : a);
1666
1673
  return {
1667
1674
  alt: l,
1668
1675
  ariaLabel: n,
1669
1676
  ariaHidden: !1
1670
1677
  };
1671
1678
  }
1672
- function Ko(e, t = "polite") {
1679
+ function Zo(e, t = "polite") {
1673
1680
  let o = document.getElementById("screen-reader-announcer");
1674
1681
  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(() => {
1675
1682
  o.textContent = e;
1676
1683
  }, 50);
1677
1684
  }
1678
- function Wo(e, t) {
1685
+ function Jo(e, t) {
1679
1686
  return `${e}: ${t}`;
1680
1687
  }
1681
1688
  /**
@@ -1683,8 +1690,8 @@ function Wo(e, t) {
1683
1690
  * Copyright 2017 Google LLC
1684
1691
  * SPDX-License-Identifier: BSD-3-Clause
1685
1692
  */
1686
- const Ue = { ATTRIBUTE: 1 }, je = (e) => (...t) => ({ _$litDirective$: e, values: t });
1687
- let qe = class {
1693
+ const qe = { ATTRIBUTE: 1 }, He = (e) => (...t) => ({ _$litDirective$: e, values: t });
1694
+ let Fe = class {
1688
1695
  constructor(t) {
1689
1696
  }
1690
1697
  get _$AU() {
@@ -1705,10 +1712,10 @@ let qe = class {
1705
1712
  * Copyright 2018 Google LLC
1706
1713
  * SPDX-License-Identifier: BSD-3-Clause
1707
1714
  */
1708
- const y = je(class extends qe {
1715
+ const w = He(class extends Fe {
1709
1716
  constructor(e) {
1710
1717
  var t;
1711
- if (super(e), e.type !== Ue.ATTRIBUTE || e.name !== "class" || ((t = e.strings) == null ? void 0 : t.length) > 2) throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");
1718
+ if (super(e), e.type !== qe.ATTRIBUTE || e.name !== "class" || ((t = e.strings) == null ? void 0 : t.length) > 2) throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");
1712
1719
  }
1713
1720
  render(e) {
1714
1721
  return " " + Object.keys(e).filter((t) => e[t]).join(" ") + " ";
@@ -1729,18 +1736,18 @@ const y = je(class extends qe {
1729
1736
  return H;
1730
1737
  }
1731
1738
  });
1732
- var Go = Object.defineProperty, v = (e, t, o, r) => {
1739
+ var Xo = Object.defineProperty, b = (e, t, o, r) => {
1733
1740
  for (var s = void 0, i = e.length - 1, a; i >= 0; i--)
1734
1741
  (a = e[i]) && (s = a(t, o, s) || s);
1735
- return s && Go(t, o, s), s;
1742
+ return s && Xo(t, o, s), s;
1736
1743
  };
1737
- const xt = {
1744
+ const $t = {
1738
1745
  mobile: "480px",
1739
1746
  tablet: "768px",
1740
1747
  desktop: "1024px"
1741
- }, te = class te extends R {
1748
+ }, oe = class oe extends R {
1742
1749
  constructor() {
1743
- super(...arguments), this.dataController = new Fo(this), this.displayController = new Yo(this, this.dataController), this.hasEditButton = !0, this.showStats = "never", this.showChart = !1, this.initialized = !1, this.ariaLabel = null, this.minContrast = Ne.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) => {
1750
+ super(...arguments), this.dataController = new Ko(this), this.displayController = new Go(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) => {
1744
1751
  (t.key === "Enter" || t.key === " ") && (t.preventDefault(), this.handleEnterEditMode());
1745
1752
  };
1746
1753
  }
@@ -1772,10 +1779,10 @@ const xt = {
1772
1779
  let o = `:host {
1773
1780
  `;
1774
1781
  if (this.primaryColor) {
1775
- const i = et(this.primaryColor);
1782
+ const i = ot(this.primaryColor);
1776
1783
  o += `--pc-primary-color: ${i} !important;
1777
1784
  `;
1778
- const a = Co(i, {
1785
+ const a = Eo(i, {
1779
1786
  minContrast: this.minContrast,
1780
1787
  colorOptions: ["black", "white", "light", "dark"]
1781
1788
  });
@@ -1783,27 +1790,27 @@ const xt = {
1783
1790
  `;
1784
1791
  }
1785
1792
  if (this.muteColor) {
1786
- const i = et(this.muteColor);
1793
+ const i = ot(this.muteColor);
1787
1794
  o += `--pc-mute-color: ${i} !important;
1788
1795
  `;
1789
1796
  }
1790
1797
  if (this.textColor) {
1791
- const i = et(this.textColor);
1798
+ const i = ot(this.textColor);
1792
1799
  o += `--pc-text-color: ${i} !important;
1793
1800
  `;
1794
1801
  }
1795
1802
  if (this.backgroundColor) {
1796
- const i = et(this.backgroundColor);
1803
+ const i = ot(this.backgroundColor);
1797
1804
  o += `--pc-background-color: ${i} !important;
1798
1805
  `;
1799
1806
  }
1800
1807
  const r = this.starColor || this.accentColor || this.primaryColor;
1801
1808
  if (r) {
1802
- const i = et(r);
1809
+ const i = ot(r);
1803
1810
  o += `--pc-star-color: ${i} !important;
1804
1811
  `;
1805
1812
  }
1806
- const s = this.starHoverColor || (r ? `color-mix(in srgb, ${et(r)} 80%, white)` : null);
1813
+ const s = this.starHoverColor || (r ? `color-mix(in srgb, ${ot(r)} 80%, white)` : null);
1807
1814
  if (s && (o += `--pc-star-hover-color: ${s} !important;
1808
1815
  `), this.starSize) {
1809
1816
  const i = qt(this.starSize, "1.5em", 1.5);
@@ -1821,12 +1828,12 @@ const xt = {
1821
1828
  `;
1822
1829
  }
1823
1830
  if (this.buttonRadius) {
1824
- const i = Eo(this.buttonRadius);
1831
+ const i = Po(this.buttonRadius);
1825
1832
  o += `--pc-button-radius: ${i} !important;
1826
1833
  `;
1827
1834
  }
1828
1835
  o += `}
1829
- `, this.css && (o += Oo(_o(this.css))), t.textContent = o;
1836
+ `, this.css && (o += zo(Io(this.css))), t.textContent = o;
1830
1837
  }
1831
1838
  /**
1832
1839
  * Update ARIA attributes for accessibility
@@ -1845,11 +1852,11 @@ const xt = {
1845
1852
  */
1846
1853
  getBreakpointClasses() {
1847
1854
  return {
1848
- "pc-mobile": window.matchMedia(`(max-width: ${xt.mobile})`).matches,
1855
+ "pc-mobile": window.matchMedia(`(max-width: ${$t.mobile})`).matches,
1849
1856
  "pc-tablet": window.matchMedia(
1850
- `(min-width: ${xt.mobile}) and (max-width: ${xt.tablet})`
1857
+ `(min-width: ${$t.mobile}) and (max-width: ${$t.tablet})`
1851
1858
  ).matches,
1852
- "pc-desktop": window.matchMedia(`(min-width: ${xt.desktop})`).matches
1859
+ "pc-desktop": window.matchMedia(`(min-width: ${$t.desktop})`).matches
1853
1860
  };
1854
1861
  }
1855
1862
  /**
@@ -1857,7 +1864,7 @@ const xt = {
1857
1864
  */
1858
1865
  announceSelectionChange(t, o, r) {
1859
1866
  const s = `Poll for "${t}"`, i = r ? `${o.label} selected` : `${o.label} unselected`;
1860
- Ko(Wo(s, i));
1867
+ Zo(Jo(s, i));
1861
1868
  }
1862
1869
  /** Common render methods */
1863
1870
  renderLabel() {
@@ -1888,7 +1895,7 @@ const xt = {
1888
1895
  tabindex="0"
1889
1896
  aria-label="Edit vote"
1890
1897
  @keydown="${this.handleEditToggleKeyDown}"
1891
- >${kt}</span
1898
+ >${At}</span
1892
1899
  >
1893
1900
  ` : u;
1894
1901
  }
@@ -1907,7 +1914,7 @@ const xt = {
1907
1914
  tabindex="0"
1908
1915
  aria-label="${this.displayController.isChartVisible ? "Hide chart" : "Show chart"}"
1909
1916
  @keydown="${() => this.displayController.toggleChartVisibility()}"
1910
- >${this.displayController.isChartVisible ? Jt : Zt}</span
1917
+ >${this.displayController.isChartVisible ? Qt : Xt}</span
1911
1918
  >
1912
1919
  ` : u;
1913
1920
  }
@@ -1916,9 +1923,9 @@ const xt = {
1916
1923
  return u;
1917
1924
  const o = {
1918
1925
  "pc-status": !0,
1919
- [`pc-flex-content-${O(this.statsPosition, this.statsAlign)}`]: !0
1926
+ [`pc-flex-content-${z(this.statsPosition, this.statsAlign)}`]: !0
1920
1927
  };
1921
- return c`<div class="${y(o)}" data-testid="pc-status">
1928
+ return c`<div class="${w(o)}" data-testid="pc-status">
1922
1929
  ${this.renderStatsText()} ${this.renderChartToggle()} ${this.renderEditToggleIcon()}
1923
1930
  </div>`;
1924
1931
  }
@@ -1934,7 +1941,7 @@ const xt = {
1934
1941
  renderThankYouMessage() {
1935
1942
  if (!this.displayController.shouldDisplayThankYouMsg())
1936
1943
  return u;
1937
- const t = Ho(this.thankYouMsg || "");
1944
+ const t = Fo(this.thankYouMsg || "");
1938
1945
  return c`
1939
1946
  <div class="pc-thank-you-overlay" data-testid="poll-thank-you-overlay">
1940
1947
  <div class="pc-thank-you" data-testid="thank-you">
@@ -1946,7 +1953,7 @@ const xt = {
1946
1953
  @click="${() => this.displayController.toggleThankYouVisibility(!1)}"
1947
1954
  role="button"
1948
1955
  aria-label="Close"
1949
- >${Tt}</span
1956
+ >${_t}</span
1950
1957
  >
1951
1958
  </div>
1952
1959
  </div>
@@ -1954,8 +1961,8 @@ const xt = {
1954
1961
  `;
1955
1962
  }
1956
1963
  };
1957
- te.styles = [
1958
- B`
1964
+ oe.styles = [
1965
+ U`
1959
1966
  :host {
1960
1967
  /* Default values for CSS variables - can be overridden by external :root or parent definitions */
1961
1968
  --default-font-size-base: 1rem;
@@ -2035,113 +2042,113 @@ te.styles = [
2035
2042
  }
2036
2043
  `
2037
2044
  ];
2038
- let g = te;
2039
- v([
2045
+ let m = oe;
2046
+ b([
2040
2047
  f({ type: String, attribute: "show-stats" })
2041
- ], g.prototype, "showStats");
2042
- v([
2048
+ ], m.prototype, "showStats");
2049
+ b([
2043
2050
  f({ type: Boolean, attribute: "show-chart" })
2044
- ], g.prototype, "showChart");
2045
- v([
2051
+ ], m.prototype, "showChart");
2052
+ b([
2046
2053
  f({ type: Boolean, attribute: "initialized" })
2047
- ], g.prototype, "initialized");
2048
- v([
2054
+ ], m.prototype, "initialized");
2055
+ b([
2049
2056
  f({ type: String, attribute: "primary-color" })
2050
- ], g.prototype, "primaryColor");
2051
- v([
2057
+ ], m.prototype, "primaryColor");
2058
+ b([
2052
2059
  f({ type: String, attribute: "mute-color" })
2053
- ], g.prototype, "muteColor");
2054
- v([
2060
+ ], m.prototype, "muteColor");
2061
+ b([
2055
2062
  f({ type: String, attribute: "text-color" })
2056
- ], g.prototype, "textColor");
2057
- v([
2063
+ ], m.prototype, "textColor");
2064
+ b([
2058
2065
  f({ type: String, attribute: "background-color" })
2059
- ], g.prototype, "backgroundColor");
2060
- v([
2066
+ ], m.prototype, "backgroundColor");
2067
+ b([
2061
2068
  f({ type: String, attribute: "accent-color" })
2062
- ], g.prototype, "accentColor");
2063
- v([
2069
+ ], m.prototype, "accentColor");
2070
+ b([
2064
2071
  f({ type: String, attribute: "star-color" })
2065
- ], g.prototype, "starColor");
2066
- v([
2072
+ ], m.prototype, "starColor");
2073
+ b([
2067
2074
  f({ type: String, attribute: "star-hover-color" })
2068
- ], g.prototype, "starHoverColor");
2069
- v([
2075
+ ], m.prototype, "starHoverColor");
2076
+ b([
2070
2077
  f({ type: String, attribute: "star-size" })
2071
- ], g.prototype, "starSize");
2072
- v([
2078
+ ], m.prototype, "starSize");
2079
+ b([
2073
2080
  f({ type: String, attribute: "reaction-size" })
2074
- ], g.prototype, "reactionSize");
2075
- v([
2081
+ ], m.prototype, "reactionSize");
2082
+ b([
2076
2083
  f({ type: String })
2077
- ], g.prototype, "size");
2078
- v([
2084
+ ], m.prototype, "size");
2085
+ b([
2079
2086
  f({ type: String, attribute: "aria-label" })
2080
- ], g.prototype, "ariaLabel");
2081
- v([
2087
+ ], m.prototype, "ariaLabel");
2088
+ b([
2082
2089
  f({ type: String, attribute: "aria-describedby" })
2083
- ], g.prototype, "ariaDescribedby");
2084
- v([
2090
+ ], m.prototype, "ariaDescribedby");
2091
+ b([
2085
2092
  f({ type: Number, attribute: "min-contrast" })
2086
- ], g.prototype, "minContrast");
2087
- v([
2093
+ ], m.prototype, "minContrast");
2094
+ b([
2088
2095
  f({ type: String })
2089
- ], g.prototype, "css");
2090
- v([
2096
+ ], m.prototype, "css");
2097
+ b([
2091
2098
  f({ type: Array })
2092
- ], g.prototype, "options");
2093
- v([
2099
+ ], m.prototype, "options");
2100
+ b([
2094
2101
  f({ type: String, attribute: "widget-id" })
2095
- ], g.prototype, "widgetId");
2096
- v([
2102
+ ], m.prototype, "widgetId");
2103
+ b([
2097
2104
  f({ type: String, attribute: "name" })
2098
- ], g.prototype, "name");
2099
- v([
2105
+ ], m.prototype, "name");
2106
+ b([
2100
2107
  f({ type: String })
2101
- ], g.prototype, "metadata");
2102
- v([
2108
+ ], m.prototype, "metadata");
2109
+ b([
2103
2110
  f({ type: String, attribute: "data-func" })
2104
- ], g.prototype, "dataFunc");
2105
- v([
2111
+ ], m.prototype, "dataFunc");
2112
+ b([
2106
2113
  f({ type: String, attribute: "data-endpoint" })
2107
- ], g.prototype, "dataEndpoint");
2108
- v([
2114
+ ], m.prototype, "dataEndpoint");
2115
+ b([
2109
2116
  f({ type: String })
2110
- ], g.prototype, "question");
2111
- v([
2117
+ ], m.prototype, "question");
2118
+ b([
2112
2119
  f({ type: String, attribute: "question-position" })
2113
- ], g.prototype, "questionPosition");
2114
- v([
2120
+ ], m.prototype, "questionPosition");
2121
+ b([
2115
2122
  f({ type: String, attribute: "question-align" })
2116
- ], g.prototype, "questionAlign");
2117
- v([
2123
+ ], m.prototype, "questionAlign");
2124
+ b([
2118
2125
  f({ type: String, attribute: "stats-text" })
2119
- ], g.prototype, "statsText");
2120
- v([
2126
+ ], m.prototype, "statsText");
2127
+ b([
2121
2128
  f({ type: String, attribute: "stats-position" })
2122
- ], g.prototype, "statsPosition");
2123
- v([
2129
+ ], m.prototype, "statsPosition");
2130
+ b([
2124
2131
  f({ type: String, attribute: "stats-align" })
2125
- ], g.prototype, "statsAlign");
2126
- v([
2132
+ ], m.prototype, "statsAlign");
2133
+ b([
2127
2134
  f({ type: String, attribute: "button-text" })
2128
- ], g.prototype, "buttonText");
2129
- v([
2135
+ ], m.prototype, "buttonText");
2136
+ b([
2130
2137
  f({ type: String, attribute: "button-radius" })
2131
- ], g.prototype, "buttonRadius");
2132
- v([
2138
+ ], m.prototype, "buttonRadius");
2139
+ b([
2133
2140
  f({ type: String, attribute: "thank-you-msg" })
2134
- ], g.prototype, "thankYouMsg");
2135
- v([
2141
+ ], m.prototype, "thankYouMsg");
2142
+ b([
2136
2143
  f({ type: Boolean, attribute: "multiple" })
2137
- ], g.prototype, "multiple");
2138
- v([
2144
+ ], m.prototype, "multiple");
2145
+ b([
2139
2146
  f({ type: Boolean, reflect: !0 })
2140
- ], g.prototype, "inline");
2141
- v([
2147
+ ], m.prototype, "inline");
2148
+ b([
2142
2149
  f({ type: Boolean, reflect: !0 })
2143
- ], g.prototype, "readonly");
2144
- const Zo = B`
2150
+ ], m.prototype, "readonly");
2151
+ const Qo = U`
2145
2152
  /* CSS variables inherit from parent - defaults are specified at usage sites */
2146
2153
 
2147
2154
  .pc-body {
@@ -2592,7 +2599,7 @@ const Zo = B`
2592
2599
  animation: none;
2593
2600
  }
2594
2601
  }
2595
- `, Ot = B`
2602
+ `, It = U`
2596
2603
  /* Default values for CSS variables - can be overridden by external :root or parent definitions */
2597
2604
  :host {
2598
2605
  --default-primary-color: #2196f3;
@@ -3311,7 +3318,7 @@ const Zo = B`
3311
3318
  opacity: 1;
3312
3319
  }
3313
3320
  }
3314
- `, Jo = B`
3321
+ `, tr = U`
3315
3322
  :host {
3316
3323
  --popover-bg: light-dark(#ffffff, #1a1a1a);
3317
3324
  --popover-border: light-dark(#e0e0e0, #333333);
@@ -3433,12 +3440,12 @@ const Zo = B`
3433
3440
  max-width: 100%;
3434
3441
  }
3435
3442
  `;
3436
- var Xo = Object.defineProperty, Qo = Object.getOwnPropertyDescriptor, U = (e, t, o, r) => {
3437
- for (var s = r > 1 ? void 0 : r ? Qo(t, o) : t, i = e.length - 1, a; i >= 0; i--)
3443
+ var er = Object.defineProperty, or = Object.getOwnPropertyDescriptor, V = (e, t, o, r) => {
3444
+ for (var s = r > 1 ? void 0 : r ? or(t, o) : t, i = e.length - 1, a; i >= 0; i--)
3438
3445
  (a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
3439
- return r && s && Xo(t, o, s), s;
3446
+ return r && s && er(t, o, s), s;
3440
3447
  };
3441
- let _ = class extends R {
3448
+ let I = class extends R {
3442
3449
  constructor() {
3443
3450
  super(...arguments), this.open = !1, this.position = "auto", this.isClosing = !1, this.computedPosition = "bottom", this.popoverStyles = {}, this.arrowStyles = {}, this.updatePosition = () => {
3444
3451
  var h;
@@ -3446,8 +3453,8 @@ let _ = class extends R {
3446
3453
  const e = this.anchor.getBoundingClientRect(), t = window.innerWidth, o = window.innerHeight, r = 12, s = (h = this.popoverElement) == null ? void 0 : h.getBoundingClientRect(), i = (s == null ? void 0 : s.width) || 280, a = (s == null ? void 0 : s.height) || 200;
3447
3454
  let l = this.position;
3448
3455
  if (l === "auto") {
3449
- const b = o - e.bottom, x = e.top;
3450
- l = b >= a + r || b >= x ? "bottom" : "top";
3456
+ const v = o - e.bottom, x = e.top;
3457
+ l = v >= a + r || v >= x ? "bottom" : "top";
3451
3458
  }
3452
3459
  this.computedPosition = l;
3453
3460
  let n, d;
@@ -3511,7 +3518,7 @@ let _ = class extends R {
3511
3518
  return c`
3512
3519
  <div class="pc-popover-scrim" @click=${this.handleScrimClick}></div>
3513
3520
  <div
3514
- class=${y(e)}
3521
+ class=${w(e)}
3515
3522
  data-position=${this.computedPosition}
3516
3523
  style=${Object.entries(this.popoverStyles).map(([t, o]) => `${t}: ${o}`).join("; ")}
3517
3524
  role="dialog"
@@ -3527,35 +3534,35 @@ let _ = class extends R {
3527
3534
  `;
3528
3535
  }
3529
3536
  };
3530
- _.styles = [Jo];
3531
- U([
3537
+ I.styles = [tr];
3538
+ V([
3532
3539
  f({ type: Boolean, reflect: !0 })
3533
- ], _.prototype, "open", 2);
3534
- U([
3540
+ ], I.prototype, "open", 2);
3541
+ V([
3535
3542
  f({ type: String })
3536
- ], _.prototype, "position", 2);
3537
- U([
3543
+ ], I.prototype, "position", 2);
3544
+ V([
3538
3545
  f({ attribute: !1 })
3539
- ], _.prototype, "anchor", 2);
3540
- U([
3541
- k()
3542
- ], _.prototype, "isClosing", 2);
3543
- U([
3544
- k()
3545
- ], _.prototype, "computedPosition", 2);
3546
- U([
3547
- k()
3548
- ], _.prototype, "popoverStyles", 2);
3549
- U([
3550
- k()
3551
- ], _.prototype, "arrowStyles", 2);
3552
- U([
3553
- mt(".pc-popover")
3554
- ], _.prototype, "popoverElement", 2);
3555
- _ = U([
3556
- Y("pc-popover")
3557
- ], _);
3558
- const tr = B`
3546
+ ], I.prototype, "anchor", 2);
3547
+ V([
3548
+ A()
3549
+ ], I.prototype, "isClosing", 2);
3550
+ V([
3551
+ A()
3552
+ ], I.prototype, "computedPosition", 2);
3553
+ V([
3554
+ A()
3555
+ ], I.prototype, "popoverStyles", 2);
3556
+ V([
3557
+ A()
3558
+ ], I.prototype, "arrowStyles", 2);
3559
+ V([
3560
+ bt(".pc-popover")
3561
+ ], I.prototype, "popoverElement", 2);
3562
+ I = V([
3563
+ W("pc-popover")
3564
+ ], I);
3565
+ const rr = U`
3559
3566
  :host {
3560
3567
  --sheet-bg: light-dark(#ffffff, #1a1a1a);
3561
3568
  --sheet-border: light-dark(#e0e0e0, #333333);
@@ -3668,12 +3675,12 @@ const tr = B`
3668
3675
  max-width: 100%;
3669
3676
  }
3670
3677
  `;
3671
- var er = Object.defineProperty, or = Object.getOwnPropertyDescriptor, tt = (e, t, o, r) => {
3672
- for (var s = r > 1 ? void 0 : r ? or(t, o) : t, i = e.length - 1, a; i >= 0; i--)
3678
+ var sr = Object.defineProperty, ir = Object.getOwnPropertyDescriptor, et = (e, t, o, r) => {
3679
+ for (var s = r > 1 ? void 0 : r ? ir(t, o) : t, i = e.length - 1, a; i >= 0; i--)
3673
3680
  (a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
3674
- return r && s && er(t, o, s), s;
3681
+ return r && s && sr(t, o, s), s;
3675
3682
  };
3676
- let V = class extends R {
3683
+ let B = class extends R {
3677
3684
  constructor() {
3678
3685
  super(...arguments), this.open = !1, this.dragToClose = !0, this.isClosing = !1, this.isDragging = !1, this.dragOffset = 0, this.dragStartY = 0, this.sheetHeight = 0, this.handleKeyDown = (e) => {
3679
3686
  if (e.key === "Escape" && this.open && (e.preventDefault(), e.stopPropagation(), this.close()), e.key === "Tab" && this.open && this.sheetElement) {
@@ -3751,8 +3758,8 @@ let V = class extends R {
3751
3758
  dragging: this.isDragging
3752
3759
  };
3753
3760
  return c`
3754
- <div class=${y(e)} @click=${this.handleScrimClick}></div>
3755
- <div class=${y(t)} role="dialog" aria-modal="true" tabindex="-1">
3761
+ <div class=${w(e)} @click=${this.handleScrimClick}></div>
3762
+ <div class=${w(t)} role="dialog" aria-modal="true" tabindex="-1">
3756
3763
  <div
3757
3764
  class="pc-sheet-handle"
3758
3765
  @touchstart=${this.handleDragStart}
@@ -3767,35 +3774,35 @@ let V = class extends R {
3767
3774
  `;
3768
3775
  }
3769
3776
  };
3770
- V.styles = [tr];
3771
- tt([
3777
+ B.styles = [rr];
3778
+ et([
3772
3779
  f({ type: Boolean, reflect: !0 })
3773
- ], V.prototype, "open", 2);
3774
- tt([
3780
+ ], B.prototype, "open", 2);
3781
+ et([
3775
3782
  f({ type: Boolean, attribute: "drag-to-close" })
3776
- ], V.prototype, "dragToClose", 2);
3777
- tt([
3778
- k()
3779
- ], V.prototype, "isClosing", 2);
3780
- tt([
3781
- k()
3782
- ], V.prototype, "isDragging", 2);
3783
- tt([
3784
- k()
3785
- ], V.prototype, "dragOffset", 2);
3786
- tt([
3787
- mt(".pc-bottom-sheet")
3788
- ], V.prototype, "sheetElement", 2);
3789
- V = tt([
3790
- Y("pc-bottom-sheet")
3791
- ], V);
3792
- var rr = Object.defineProperty, sr = Object.getOwnPropertyDescriptor, vt = (e, t, o, r) => {
3793
- for (var s = r > 1 ? void 0 : r ? sr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
3783
+ ], B.prototype, "dragToClose", 2);
3784
+ et([
3785
+ A()
3786
+ ], B.prototype, "isClosing", 2);
3787
+ et([
3788
+ A()
3789
+ ], B.prototype, "isDragging", 2);
3790
+ et([
3791
+ A()
3792
+ ], B.prototype, "dragOffset", 2);
3793
+ et([
3794
+ bt(".pc-bottom-sheet")
3795
+ ], B.prototype, "sheetElement", 2);
3796
+ B = et([
3797
+ W("pc-bottom-sheet")
3798
+ ], B);
3799
+ var ar = Object.defineProperty, nr = Object.getOwnPropertyDescriptor, yt = (e, t, o, r) => {
3800
+ for (var s = r > 1 ? void 0 : r ? nr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
3794
3801
  (a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
3795
- return r && s && rr(t, o, s), s;
3802
+ return r && s && ar(t, o, s), s;
3796
3803
  };
3797
- const ir = 768;
3798
- let X = class extends R {
3804
+ const lr = 768;
3805
+ let Q = class extends R {
3799
3806
  constructor() {
3800
3807
  super(...arguments), this.open = !1, this.position = "auto", this.isMobile = !1, this.handleMediaChange = (e) => {
3801
3808
  this.isMobile = e.matches;
@@ -3811,7 +3818,7 @@ let X = class extends R {
3811
3818
  super.disconnectedCallback(), (e = this.mediaQuery) == null || e.removeEventListener("change", this.handleMediaChange);
3812
3819
  }
3813
3820
  setupMediaQuery() {
3814
- this.mediaQuery = window.matchMedia(`(max-width: ${ir - 1}px)`), this.isMobile = this.mediaQuery.matches, this.mediaQuery.addEventListener("change", this.handleMediaChange);
3821
+ this.mediaQuery = window.matchMedia(`(max-width: ${lr - 1}px)`), this.isMobile = this.mediaQuery.matches, this.mediaQuery.addEventListener("change", this.handleMediaChange);
3815
3822
  }
3816
3823
  render() {
3817
3824
  return this.isMobile ? c`
@@ -3830,32 +3837,32 @@ let X = class extends R {
3830
3837
  `;
3831
3838
  }
3832
3839
  };
3833
- X.styles = B`
3840
+ Q.styles = U`
3834
3841
  :host {
3835
3842
  display: contents;
3836
3843
  }
3837
3844
  `;
3838
- vt([
3845
+ yt([
3839
3846
  f({ type: Boolean, reflect: !0 })
3840
- ], X.prototype, "open", 2);
3841
- vt([
3847
+ ], Q.prototype, "open", 2);
3848
+ yt([
3842
3849
  f({ type: String })
3843
- ], X.prototype, "position", 2);
3844
- vt([
3850
+ ], Q.prototype, "position", 2);
3851
+ yt([
3845
3852
  f({ attribute: !1 })
3846
- ], X.prototype, "anchor", 2);
3847
- vt([
3848
- k()
3849
- ], X.prototype, "isMobile", 2);
3850
- X = vt([
3851
- Y("pc-responsive-modal")
3852
- ], X);
3853
- var ar = Object.defineProperty, nr = Object.getOwnPropertyDescriptor, K = (e, t, o, r) => {
3854
- for (var s = r > 1 ? void 0 : r ? nr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
3853
+ ], Q.prototype, "anchor", 2);
3854
+ yt([
3855
+ A()
3856
+ ], Q.prototype, "isMobile", 2);
3857
+ Q = yt([
3858
+ W("pc-responsive-modal")
3859
+ ], Q);
3860
+ var cr = Object.defineProperty, dr = Object.getOwnPropertyDescriptor, K = (e, t, o, r) => {
3861
+ for (var s = r > 1 ? void 0 : r ? dr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
3855
3862
  (a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
3856
- return r && s && ar(t, o, s), s;
3863
+ return r && s && cr(t, o, s), s;
3857
3864
  };
3858
- let I = class extends g {
3865
+ let M = class extends m {
3859
3866
  constructor() {
3860
3867
  super(), this.min = 0, this.max = 10, this.type = S.nps, this.minLabel = "Not at all", this.maxLabel = "Extremely", this.minMaxPosition = "top", this.hoverValue = -1, this.popoverOpen = !1, this.handleNumberLeave = () => {
3861
3868
  this.hoverValue = -1;
@@ -3867,7 +3874,7 @@ let I = class extends g {
3867
3874
  * Render NPS buttons for edit mode
3868
3875
  */
3869
3876
  renderNpsButtons() {
3870
- const e = Array.from({ length: this.max - this.min + 1 }, (s, i) => i + this.min), t = `nps-control-${this.name || this.type}`, o = rt({
3877
+ const e = Array.from({ length: this.max - this.min + 1 }, (s, i) => i + this.min), t = `nps-control-${this.name || this.type}`, o = st({
3871
3878
  role: N.GROUP,
3872
3879
  ariaLabel: this.question || "NPS Rating",
3873
3880
  ariaDescribedby: `${t}-description`
@@ -3875,12 +3882,12 @@ let I = class extends g {
3875
3882
  const i = this.dataController.isValueSelected(String(s)), a = {
3876
3883
  "nps-button": !0,
3877
3884
  selected: i
3878
- }, l = Ao(`Rate ${s}`, i, !1);
3885
+ }, l = To(`Rate ${s}`, i, !1);
3879
3886
  return c`
3880
3887
  <button
3881
3888
  data-testid="nps-button-${s}"
3882
3889
  ?disabled=${!this.displayController.allowEdit()}
3883
- class=${y(a)}
3890
+ class=${w(a)}
3884
3891
  @click="${() => this.handleNumberClick(s)}"
3885
3892
  @mouseenter="${() => this.handleNumberHover(s)}"
3886
3893
  @focus="${() => this.handleNumberHover(s)}"
@@ -3919,10 +3926,10 @@ let I = class extends g {
3919
3926
  * NPS score displayed prominently in the middle
3920
3927
  */
3921
3928
  renderChart() {
3922
- const e = this.dataController.stats, t = (e == null ? void 0 : e.nps) ?? 0, o = 100, r = 100, s = 80, i = (C) => ({
3923
- x: o + s * Math.cos(C),
3924
- y: r - s * Math.sin(C)
3925
- }), a = i(Math.PI), l = i(Math.PI / 2), n = i(Math.PI / 4), d = i(0), p = (C, w, A = 0) => `M ${C.x} ${C.y} A ${s} ${s} 0 ${A} 1 ${w.x} ${w.y}`, h = p(a, l), b = p(l, n), x = p(n, d), z = ((C) => Math.PI - (C + 100) / 200 * Math.PI)(t), M = i(z);
3929
+ const e = this.dataController.stats, t = (e == null ? void 0 : e.nps) ?? 0, o = 100, r = 100, s = 80, i = ($) => ({
3930
+ x: o + s * Math.cos($),
3931
+ y: r - s * Math.sin($)
3932
+ }), a = i(Math.PI), l = i(Math.PI / 2), n = i(Math.PI / 4), d = i(0), p = ($, y, E = 0) => `M ${$.x} ${$.y} A ${s} ${s} 0 ${E} 1 ${y.x} ${y.y}`, h = p(a, l), v = p(l, n), x = p(n, d), P = (($) => Math.PI - ($ + 100) / 200 * Math.PI)(t), _ = i(P);
3926
3933
  return c`
3927
3934
  <div class="nps-semicircle-gauge" data-testid="nps-semicircle-gauge">
3928
3935
  <svg viewBox="0 0 200 115">
@@ -3934,11 +3941,11 @@ let I = class extends g {
3934
3941
 
3935
3942
  <!-- Colored segments -->
3936
3943
  <path class="gauge-arc gauge-arc-detractor" d="${h}" />
3937
- <path class="gauge-arc gauge-arc-passive" d="${b}" />
3944
+ <path class="gauge-arc gauge-arc-passive" d="${v}" />
3938
3945
  <path class="gauge-arc gauge-arc-promoter" d="${x}" />
3939
3946
 
3940
3947
  <!-- Needle indicator -->
3941
- <circle class="gauge-needle" cx="${M.x}" cy="${M.y}" r="5" />
3948
+ <circle class="gauge-needle" cx="${_.x}" cy="${_.y}" r="5" />
3942
3949
 
3943
3950
  <!-- Score display in center -->
3944
3951
  <text class="gauge-score" x="${o}" y="${r - 15}">${t}</text>
@@ -3998,7 +4005,7 @@ let I = class extends g {
3998
4005
  * Uses SVG with 3 colored segments for detractors/passives/promoters
3999
4006
  */
4000
4007
  renderInlineGauge() {
4001
- const e = this.dataController.stats, t = (e == null ? void 0 : e.breakdown) || {}, o = 8, r = 2 * Math.PI * o, s = Mo(t), i = s.detractors + s.passives + s.promoters;
4008
+ const e = this.dataController.stats, t = (e == null ? void 0 : e.breakdown) || {}, o = 8, r = 2 * Math.PI * o, s = No(t), i = s.detractors + s.passives + s.promoters;
4002
4009
  if (i === 0)
4003
4010
  return c`
4004
4011
  <div class="inline-nps-gauge">
@@ -4007,9 +4014,9 @@ let I = class extends g {
4007
4014
  </svg>
4008
4015
  </div>
4009
4016
  `;
4010
- const a = s.detractors / i * 100, l = s.passives / i * 100, n = s.promoters / i * 100, d = a / 100 * r, p = l / 100 * r, h = n / 100 * r, b = 0, x = -d, E = -(d + p), z = this.getUserScore();
4011
- let M = "gauge-bg";
4012
- return z !== null && (z <= 6 ? M = "gauge-detractor" : z <= 8 ? M = "gauge-passive" : M = "gauge-promoter"), c`
4017
+ const a = s.detractors / i * 100, l = s.passives / i * 100, n = s.promoters / i * 100, d = a / 100 * r, p = l / 100 * r, h = n / 100 * r, v = 0, x = -d, k = -(d + p), P = this.getUserScore();
4018
+ let _ = "gauge-bg";
4019
+ return P !== null && (P <= 6 ? _ = "gauge-detractor" : P <= 8 ? _ = "gauge-passive" : _ = "gauge-promoter"), c`
4013
4020
  <div class="inline-nps-gauge">
4014
4021
  <svg viewBox="0 0 20 20">
4015
4022
  <!-- Background circle -->
@@ -4021,7 +4028,7 @@ let I = class extends g {
4021
4028
  cy="10"
4022
4029
  r="${o}"
4023
4030
  stroke-dasharray="${d} ${r}"
4024
- stroke-dashoffset="${b}"
4031
+ stroke-dashoffset="${v}"
4025
4032
  />
4026
4033
  <!-- Passive segment (yellow) -->
4027
4034
  <circle
@@ -4039,10 +4046,10 @@ let I = class extends g {
4039
4046
  cy="10"
4040
4047
  r="${o}"
4041
4048
  stroke-dasharray="${h} ${r}"
4042
- stroke-dashoffset="${E}"
4049
+ stroke-dashoffset="${k}"
4043
4050
  />
4044
4051
  <!-- Center dot showing user's score category -->
4045
- <circle class="gauge-dot ${M}" cx="10" cy="10" r="2" />
4052
+ <circle class="gauge-dot ${_}" cx="10" cy="10" r="2" />
4046
4053
  </svg>
4047
4054
  </div>
4048
4055
  `;
@@ -4053,7 +4060,7 @@ let I = class extends g {
4053
4060
  * Shows add icon when no selection, edit icon when user has submitted
4054
4061
  */
4055
4062
  renderInlineTrigger() {
4056
- const t = this.displayController.shouldShowStats() && this.statsText ? this.dataController.formatStatsText(this.statsText) : "", r = this.dataController.hasLocalStats() ? kt : Ie;
4063
+ const t = this.displayController.shouldShowStats() && this.statsText ? this.dataController.formatStatsText(this.statsText) : "", r = this.dataController.hasLocalStats() ? At : Me;
4057
4064
  return c`
4058
4065
  <button
4059
4066
  class="pc-inline-trigger"
@@ -4085,7 +4092,7 @@ let I = class extends g {
4085
4092
  };
4086
4093
  return c`
4087
4094
  <button
4088
- class=${y(i)}
4095
+ class=${w(i)}
4089
4096
  @click=${() => this.handlePopoverNumberClick(r)}
4090
4097
  @mouseenter=${() => this.handleNumberHover(r)}
4091
4098
  @mouseleave=${this.handleNumberLeave}
@@ -4119,7 +4126,7 @@ let I = class extends g {
4119
4126
  @keydown="${(e) => {
4120
4127
  (e.key === "Enter" || e.key === " ") && (e.preventDefault(), this.displayController.toggleChartVisibility());
4121
4128
  }}"
4122
- >${this.displayController.isChartVisible ? Jt : Zt}</span
4129
+ >${this.displayController.isChartVisible ? Qt : Xt}</span
4123
4130
  >
4124
4131
  `;
4125
4132
  }
@@ -4138,7 +4145,7 @@ let I = class extends g {
4138
4145
  aria-label="Close"
4139
4146
  data-testid="popover-close-button"
4140
4147
  >
4141
- ${Tt}
4148
+ ${_t}
4142
4149
  </button>
4143
4150
  ${this.question ? c`<div class="pc-popover-question">${this.question}</div>` : u}
4144
4151
  ${this.renderPopoverNpsButtons()}
@@ -4188,16 +4195,16 @@ let I = class extends g {
4188
4195
  renderStandardMode() {
4189
4196
  const e = {
4190
4197
  [`pc-flex-pos-${this.questionPosition}`]: !0,
4191
- [`pc-flex-align-${O(this.questionPosition, this.questionAlign)}`]: !0
4198
+ [`pc-flex-align-${z(this.questionPosition, this.questionAlign)}`]: !0
4192
4199
  }, t = {
4193
4200
  nps: !0,
4194
4201
  [`pc-flex-pos-${this.statsPosition}`]: !0,
4195
- [`pc-flex-align-${O(this.statsPosition, this.statsAlign)}`]: !0
4202
+ [`pc-flex-align-${z(this.statsPosition, this.statsAlign)}`]: !0
4196
4203
  };
4197
4204
  return c`
4198
- <div class="pc-container ${y(e)}" data-testid="nps-container">
4205
+ <div class="pc-container ${w(e)}" data-testid="nps-container">
4199
4206
  ${this.renderLabelAtStart()}
4200
- <div class="pc-body ${y(t)}" data-testid="nps-body">
4207
+ <div class="pc-body ${w(t)}" data-testid="nps-body">
4201
4208
  ${this.renderStatusAtStart()} ${this.renderContent()} ${this.renderStatusAtEnd()}
4202
4209
  </div>
4203
4210
  ${this.renderLabelAtEnd()}
@@ -4211,32 +4218,32 @@ let I = class extends g {
4211
4218
  return this.inline ? this.renderInlineMode() : this.readonly ? this.renderReadonlyMode() : this.renderStandardMode();
4212
4219
  }
4213
4220
  };
4214
- I.styles = [...g.styles, Ot, Zo];
4221
+ M.styles = [...m.styles, It, Qo];
4215
4222
  K([
4216
4223
  f({ type: String, attribute: "min-label" })
4217
- ], I.prototype, "minLabel", 2);
4224
+ ], M.prototype, "minLabel", 2);
4218
4225
  K([
4219
4226
  f({ type: String, attribute: "max-label" })
4220
- ], I.prototype, "maxLabel", 2);
4227
+ ], M.prototype, "maxLabel", 2);
4221
4228
  K([
4222
4229
  f({ type: String, attribute: "thank-you-msg" })
4223
- ], I.prototype, "thankYouMsg", 2);
4230
+ ], M.prototype, "thankYouMsg", 2);
4224
4231
  K([
4225
4232
  f({ type: String, attribute: "min-max-position" })
4226
- ], I.prototype, "minMaxPosition", 2);
4233
+ ], M.prototype, "minMaxPosition", 2);
4227
4234
  K([
4228
- k()
4229
- ], I.prototype, "hoverValue", 2);
4235
+ A()
4236
+ ], M.prototype, "hoverValue", 2);
4230
4237
  K([
4231
- k()
4232
- ], I.prototype, "popoverOpen", 2);
4238
+ A()
4239
+ ], M.prototype, "popoverOpen", 2);
4233
4240
  K([
4234
- mt(".pc-inline-trigger")
4235
- ], I.prototype, "triggerElement", 2);
4236
- I = K([
4237
- Y("pc-nps")
4238
- ], I);
4239
- const lr = B`
4241
+ bt(".pc-inline-trigger")
4242
+ ], M.prototype, "triggerElement", 2);
4243
+ M = K([
4244
+ W("pc-nps")
4245
+ ], M);
4246
+ const pr = U`
4240
4247
  /* CSS variables inherit from parent - defaults are specified at usage sites */
4241
4248
 
4242
4249
  .pc-container {
@@ -4621,21 +4628,21 @@ const lr = B`
4621
4628
  opacity: 0.8;
4622
4629
  }
4623
4630
  `;
4624
- var cr = Object.defineProperty, dr = Object.getOwnPropertyDescriptor, bt = (e, t, o, r) => {
4625
- for (var s = r > 1 ? void 0 : r ? dr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
4631
+ var ur = Object.defineProperty, hr = Object.getOwnPropertyDescriptor, wt = (e, t, o, r) => {
4632
+ for (var s = r > 1 ? void 0 : r ? hr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
4626
4633
  (a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
4627
- return r && s && cr(t, o, s), s;
4634
+ return r && s && ur(t, o, s), s;
4628
4635
  };
4629
- let Q = class extends g {
4636
+ let tt = class extends m {
4630
4637
  constructor() {
4631
4638
  super(), this.type = S.poll, this.multiple = !1, this.compact = !1, this.popoverOpen = !1, this.hasEditButton = !0, this.statsText = "{count} votes", this.questionPosition = "top", this.statsPosition = "bottom", this.showStats = "after-vote";
4632
4639
  }
4633
4640
  renderStatus() {
4634
4641
  const t = {
4635
4642
  "pc-status": !0,
4636
- [`pc-flex-content-${O("bottom", this.statsAlign)}`]: !0
4643
+ [`pc-flex-content-${z("bottom", this.statsAlign)}`]: !0
4637
4644
  };
4638
- return c`<div class="${y(t)}" data-testid="pc-status">
4645
+ return c`<div class="${w(t)}" data-testid="pc-status">
4639
4646
  <span>${this.renderStatsText()} ${this.renderEditToggleIcon("stats-edit-button")}</span>
4640
4647
  </div>`;
4641
4648
  }
@@ -4650,7 +4657,7 @@ let Q = class extends g {
4650
4657
  }, t = this.displayController.shouldDisableSubmitButton();
4651
4658
  return c`
4652
4659
  <button
4653
- class="${y(e)}"
4660
+ class="${w(e)}"
4654
4661
  data-testid="pc-submit-button"
4655
4662
  @click="${this.handleSubmit}"
4656
4663
  ?disabled="${t}"
@@ -4684,7 +4691,7 @@ let Q = class extends g {
4684
4691
  */
4685
4692
  renderOptionIcon(e) {
4686
4693
  if (!(e != null && e.icon)) return "";
4687
- const t = Qt.DECORATIVE, o = (e == null ? void 0 : e.label) || "", r = e ? this.dataController.isValueSelected(e.value) : !1, s = Be(e == null ? void 0 : e.icon, {
4694
+ const t = ee.DECORATIVE, o = (e == null ? void 0 : e.label) || "", r = e ? this.dataController.isValueSelected(e.value) : !1, s = je(e == null ? void 0 : e.icon, {
4688
4695
  type: t,
4689
4696
  alt: o,
4690
4697
  isSelected: r
@@ -4693,7 +4700,7 @@ let Q = class extends g {
4693
4700
  class="poll-option-icon"
4694
4701
  aria-hidden="${s.ariaHidden ? "true" : "false"}"
4695
4702
  >${e == null ? void 0 : e.icon}</span
4696
- >` : _t(e == null ? void 0 : e.icon) ? c`<img
4703
+ >` : Ot(e == null ? void 0 : e.icon) ? c`<img
4697
4704
  src="${e == null ? void 0 : e.icon}"
4698
4705
  alt="${s.alt}"
4699
4706
  class="poll-option-icon-img"
@@ -4721,7 +4728,7 @@ let Q = class extends g {
4721
4728
  selected: o,
4722
4729
  "poll-option--compact": this.compact,
4723
4730
  "poll-option--disabled": r
4724
- }, i = t + 1, a = `poll-${this.type}-${i}`, l = Po(
4731
+ }, i = t + 1, a = `poll-${this.type}-${i}`, l = _o(
4725
4732
  e.label,
4726
4733
  o,
4727
4734
  r,
@@ -4731,7 +4738,7 @@ let Q = class extends g {
4731
4738
  return c`
4732
4739
  <button
4733
4740
  data-testid="poll-option-i${t}"
4734
- class="${y(s)}"
4741
+ class="${w(s)}"
4735
4742
  @click="${(n) => {
4736
4743
  n.stopPropagation(), this.handleClick(e);
4737
4744
  }}"
@@ -4755,13 +4762,13 @@ let Q = class extends g {
4755
4762
  */
4756
4763
  renderPollOptions() {
4757
4764
  var s;
4758
- const e = this.multiple ? N.GROUP : N.RADIOGROUP, t = this.question || this.name || "Options", o = rt({
4765
+ const e = this.multiple ? N.GROUP : N.RADIOGROUP, t = this.question || this.name || "Options", o = st({
4759
4766
  role: e,
4760
4767
  ariaLabel: t
4761
4768
  });
4762
4769
  return c`
4763
4770
  <div
4764
- class="${y({
4771
+ class="${w({
4765
4772
  "poll-container": !0
4766
4773
  })}"
4767
4774
  data-testid="poll-option-container"
@@ -4778,21 +4785,21 @@ let Q = class extends g {
4778
4785
  renderBarChart() {
4779
4786
  var n, d;
4780
4787
  const e = ((n = this.dataController.stats) == null ? void 0 : n.breakdown) || {}, t = ((d = this.dataController.localStats) == null ? void 0 : d.breakdown) || {}, o = Object.values(e).reduce((p, h) => p + h, 0), r = this.options.map((p, h) => {
4781
- const b = e[p.value] || 0, x = o > 0 ? Math.round(b / o * 100) : 0, E = (t[p.value] || 0) > 0;
4788
+ const v = e[p.value] || 0, x = o > 0 ? Math.round(v / o * 100) : 0, k = (t[p.value] || 0) > 0;
4782
4789
  return {
4783
4790
  option: p,
4784
4791
  index: h,
4785
- voteCount: b,
4792
+ voteCount: v,
4786
4793
  percentage: x,
4787
- isSelected: E
4794
+ isSelected: k
4788
4795
  };
4789
- }), s = this.multiple ? N.GROUP : N.RADIOGROUP, i = this.question || this.name || "Options", a = rt({
4796
+ }), s = this.multiple ? N.GROUP : N.RADIOGROUP, i = this.question || this.name || "Options", a = st({
4790
4797
  role: s,
4791
4798
  ariaLabel: i
4792
4799
  });
4793
4800
  return c`
4794
4801
  <div
4795
- class="${y({
4802
+ class="${w({
4796
4803
  "poll-container": !0
4797
4804
  })}"
4798
4805
  data-testid="poll-chart-container"
@@ -4808,7 +4815,7 @@ let Q = class extends g {
4808
4815
  };
4809
4816
  return c`
4810
4817
  <div
4811
- class="${y(h)}"
4818
+ class="${w(h)}"
4812
4819
  data-testid="poll-chart-item-${p.index}"
4813
4820
  role="listitem"
4814
4821
  aria-label="${p.option.label}: ${p.percentage}% (${p.voteCount} votes)"
@@ -4879,7 +4886,7 @@ let Q = class extends g {
4879
4886
  * Shows add icon when no selection, edit icon when user has submitted
4880
4887
  */
4881
4888
  renderInlineTrigger() {
4882
- const t = this.displayController.shouldShowStats() && this.statsText ? this.dataController.formatStatsText(this.statsText) : "", r = this.dataController.hasLocalStats() ? kt : Ie;
4889
+ const t = this.displayController.shouldShowStats() && this.statsText ? this.dataController.formatStatsText(this.statsText) : "", r = this.dataController.hasLocalStats() ? At : Me;
4883
4890
  return c`
4884
4891
  <button
4885
4892
  class="pc-inline-trigger"
@@ -4938,7 +4945,7 @@ let Q = class extends g {
4938
4945
  aria-label="Close"
4939
4946
  data-testid="popover-close-button"
4940
4947
  >
4941
- ${Tt}
4948
+ ${_t}
4942
4949
  </button>
4943
4950
  ${this.question ? c`<div class="pc-popover-question">${this.question}</div>` : u}
4944
4951
  ${e ? this.renderBarChart() : this.renderPollOptions()}
@@ -4955,7 +4962,7 @@ let Q = class extends g {
4955
4962
  @keydown=${(s) => {
4956
4963
  (s.key === "Enter" || s.key === " ") && (s.preventDefault(), this.handlePopoverEditClick());
4957
4964
  }}
4958
- >${kt}</span
4965
+ >${At}</span
4959
4966
  >` : u}
4960
4967
  </div>` : u}
4961
4968
  </div>
@@ -5012,25 +5019,25 @@ let Q = class extends g {
5012
5019
  * Render standard mode - original behavior
5013
5020
  */
5014
5021
  renderStandardMode() {
5015
- const e = O(this.questionPosition, this.questionAlign), t = {
5022
+ const e = z(this.questionPosition, this.questionAlign), t = {
5016
5023
  [`pc-flex-pos-${this.questionPosition}`]: !0,
5017
5024
  [`pc-flex-align-${e}`]: !0
5018
- }, o = O(this.statsPosition, this.statsAlign), r = {
5025
+ }, o = z(this.statsPosition, this.statsAlign), r = {
5019
5026
  "pc-body": !0,
5020
5027
  [`pc-flex-pos-${this.statsPosition}`]: !0,
5021
5028
  [`pc-flex-align-${o}`]: !0
5022
- }, s = rt({
5029
+ }, s = st({
5023
5030
  role: N.REGION,
5024
5031
  ariaLabel: this.question || this.name || "Poll"
5025
5032
  });
5026
5033
  return c`
5027
5034
  <div
5028
- class="pc-container ${y(t)}"
5035
+ class="pc-container ${w(t)}"
5029
5036
  data-testid="poll-container"
5030
5037
  ...=${s}
5031
5038
  >
5032
5039
  ${this.renderLabelAtStart()}
5033
- <div class="${y(r)}" data-testid="poll-body">
5040
+ <div class="${w(r)}" data-testid="poll-body">
5034
5041
  ${this.renderContent()} ${this.renderFooter()}
5035
5042
  </div>
5036
5043
  ${this.renderLabelAtEnd()}
@@ -5041,23 +5048,23 @@ let Q = class extends g {
5041
5048
  return this.inline ? this.renderInlineMode() : this.readonly ? this.renderReadonlyMode() : this.renderStandardMode();
5042
5049
  }
5043
5050
  };
5044
- Q.styles = [...g.styles, Ot, lr];
5045
- bt([
5051
+ tt.styles = [...m.styles, It, pr];
5052
+ wt([
5046
5053
  f({ type: Boolean })
5047
- ], Q.prototype, "multiple", 2);
5048
- bt([
5054
+ ], tt.prototype, "multiple", 2);
5055
+ wt([
5049
5056
  f({ type: Boolean })
5050
- ], Q.prototype, "compact", 2);
5051
- bt([
5052
- k()
5053
- ], Q.prototype, "popoverOpen", 2);
5054
- bt([
5055
- mt(".pc-inline-trigger")
5056
- ], Q.prototype, "triggerElement", 2);
5057
- Q = bt([
5058
- Y("pc-poll")
5059
- ], Q);
5060
- const pr = B`
5057
+ ], tt.prototype, "compact", 2);
5058
+ wt([
5059
+ A()
5060
+ ], tt.prototype, "popoverOpen", 2);
5061
+ wt([
5062
+ bt(".pc-inline-trigger")
5063
+ ], tt.prototype, "triggerElement", 2);
5064
+ tt = wt([
5065
+ W("pc-poll")
5066
+ ], tt);
5067
+ const fr = U`
5061
5068
  /* CSS variables inherit from parent - defaults are specified at usage sites */
5062
5069
 
5063
5070
  .pc-section {
@@ -5244,10 +5251,10 @@ const pr = B`
5244
5251
  * Copyright 2018 Google LLC
5245
5252
  * SPDX-License-Identifier: BSD-3-Clause
5246
5253
  */
5247
- const He = "important", ur = " !" + He, hr = je(class extends qe {
5254
+ const Ye = "important", gr = " !" + Ye, mr = He(class extends Fe {
5248
5255
  constructor(e) {
5249
5256
  var t;
5250
- if (super(e), e.type !== Ue.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.");
5257
+ 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.");
5251
5258
  }
5252
5259
  render(e) {
5253
5260
  return Object.keys(e).reduce((t, o) => {
@@ -5263,14 +5270,14 @@ const He = "important", ur = " !" + He, hr = je(class extends qe {
5263
5270
  const s = t[r];
5264
5271
  if (s != null) {
5265
5272
  this.ft.add(r);
5266
- const i = typeof s == "string" && s.endsWith(ur);
5267
- r.includes("-") || i ? o.setProperty(r, i ? s.slice(0, -11) : s, i ? He : "") : o[r] = s;
5273
+ const i = typeof s == "string" && s.endsWith(gr);
5274
+ r.includes("-") || i ? o.setProperty(r, i ? s.slice(0, -11) : s, i ? Ye : "") : o[r] = s;
5268
5275
  }
5269
5276
  }
5270
5277
  return H;
5271
5278
  }
5272
5279
  });
5273
- function $t(e, t = {}) {
5280
+ function Ct(e, t = {}) {
5274
5281
  if (!e || e.length === 0)
5275
5282
  return c`<div class="pc-bar-chart pc-bar-chart--empty">No data available</div>`;
5276
5283
  const o = Math.max(...e.map((i) => i.value)), s = { ...{
@@ -5299,7 +5306,7 @@ function $t(e, t = {}) {
5299
5306
  </div>
5300
5307
  `;
5301
5308
  }
5302
- const Ce = {
5309
+ const Ee = {
5303
5310
  // Faces
5304
5311
  smile: "😊",
5305
5312
  laugh: "😄",
@@ -5442,19 +5449,19 @@ const Ce = {
5442
5449
  hiking: "🥾",
5443
5450
  yoga: "🧘"
5444
5451
  };
5445
- function At(e) {
5452
+ function Pt(e) {
5446
5453
  let t = "❓", o = !1;
5447
- return e ? e in Ce ? t = Ce[e] : Ve(e) ? t = e : _t(e) ? (o = !0, t = e) : /^\w+@\w+$/.test(e) ? t = e : e.endsWith(".svg") && !e.includes("/") ? (t = `https://cdn.jsdelivr.net/npm/@mdi/svg@7.4.47/svg/${e}`, o = !0) : t = e : t = "❓", {
5454
+ return e ? e in Ee ? t = Ee[e] : Ve(e) ? t = e : Ot(e) ? (o = !0, t = e) : /^\w+@\w+$/.test(e) ? t = e : e.endsWith(".svg") && !e.includes("/") ? (t = `https://cdn.jsdelivr.net/npm/@mdi/svg@7.4.47/svg/${e}`, o = !0) : t = e : t = "❓", {
5448
5455
  icon: t,
5449
5456
  isRemoteImage: o
5450
5457
  };
5451
5458
  }
5452
- var fr = Object.defineProperty, gr = Object.getOwnPropertyDescriptor, nt = (e, t, o, r) => {
5453
- for (var s = r > 1 ? void 0 : r ? gr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
5459
+ var vr = Object.defineProperty, br = Object.getOwnPropertyDescriptor, nt = (e, t, o, r) => {
5460
+ for (var s = r > 1 ? void 0 : r ? br(t, o) : t, i = e.length - 1, a; i >= 0; i--)
5454
5461
  (a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
5455
- return r && s && fr(t, o, s), s;
5462
+ return r && s && vr(t, o, s), s;
5456
5463
  };
5457
- let F = class extends g {
5464
+ let F = class extends m {
5458
5465
  constructor() {
5459
5466
  super(), this.type = S.stars, this.icon = "★", this.numStars = 5, this.hoverValue = -1, this.popoverOpen = !1, this.handleStarKeyDown = (e) => {
5460
5467
  if (e.key === "Enter" || e.key === " ") {
@@ -5477,14 +5484,14 @@ let F = class extends g {
5477
5484
  * Renders the star icon using resolveIcon for emoji, URL, or MDI support
5478
5485
  */
5479
5486
  renderStarIcon() {
5480
- const { icon: e, isRemoteImage: t } = At(this.icon);
5487
+ const { icon: e, isRemoteImage: t } = Pt(this.icon);
5481
5488
  return t ? c`<img class="star-icon-img" src="${e}" alt="star" />` : e;
5482
5489
  }
5483
5490
  /**
5484
5491
  * Gets the resolved icon string (for use in chart labels)
5485
5492
  */
5486
5493
  getResolvedIconString() {
5487
- const { icon: e, isRemoteImage: t } = At(this.icon);
5494
+ const { icon: e, isRemoteImage: t } = Pt(this.icon);
5488
5495
  return t ? "★" : e;
5489
5496
  }
5490
5497
  /**
@@ -5495,22 +5502,22 @@ let F = class extends g {
5495
5502
  renderStars(e = !1) {
5496
5503
  var n;
5497
5504
  const t = this.getUserVotePosition(), o = this.dataController.stats, r = (o == null ? void 0 : o.avg) ?? 0, s = ((n = this.dataController.localStats) == null ? void 0 : n.avg) ?? 0, i = this.readonly ? r : s, a = this.displayController.allowEdit(), l = Array.from({ length: this.numStars }, (d, p) => p + 1).map((d) => {
5498
- const p = e ? t || 0 : Math.floor(i), h = d <= p || d <= (this.hoverValue || 0), b = !e && !h && d === Math.ceil(i) && i % 1 !== 0, x = {
5505
+ const p = e ? t || 0 : Math.floor(i), h = d <= p || d <= (this.hoverValue || 0), v = !e && !h && d === Math.ceil(i) && i % 1 !== 0, x = {
5499
5506
  star: !0,
5500
5507
  selected: h,
5501
- partial: b,
5508
+ partial: v,
5502
5509
  "view-mode": !a
5503
- }, E = b ? { "--partial-fill": `${i % 1 * 100}%` } : {}, z = e ? () => this.handlePopoverStarClick(d) : () => this.handleStarClick(d);
5510
+ }, k = v ? { "--partial-fill": `${i % 1 * 100}%` } : {}, P = e ? () => this.handlePopoverStarClick(d) : () => this.handleStarClick(d);
5504
5511
  return c`
5505
5512
  <div class="pc-section" data-testid="pc-section">
5506
5513
  <span
5507
5514
  data-testid="${e ? "popover" : "stars-view"}-star-${d}"
5508
- class=${y(x)}
5509
- style=${hr(E)}
5515
+ class=${w(x)}
5516
+ style=${mr(k)}
5510
5517
  role="${a ? "button" : "presentation"}"
5511
5518
  tabindex="${a ? "0" : ""}"
5512
5519
  aria-label="${a ? `Rate ${d} star${d > 1 ? "s" : ""}` : ""}"
5513
- @click="${z}"
5520
+ @click="${P}"
5514
5521
  @mouseenter="${() => this.handleStarHover(d)}"
5515
5522
  @focus="${() => this.handleStarHover(d)}"
5516
5523
  @mouseleave="${this.handleStarLeave}"
@@ -5534,7 +5541,7 @@ let F = class extends g {
5534
5541
  label: n,
5535
5542
  value: d,
5536
5543
  icon: r
5537
- })), a = getComputedStyle(this).getPropertyValue("--pc-accent-color").trim() || "#ffc107", l = $t(s, {
5544
+ })), a = getComputedStyle(this).getPropertyValue("--pc-accent-color").trim() || "#ffc107", l = Ct(s, {
5538
5545
  barColor: a,
5539
5546
  labelFormatter: (n) => `${n.label} ${n.icon}`,
5540
5547
  valueFormatter: (n) => `${o > 0 ? Math.round(n.value / o * 100) : 0}%`
@@ -5601,7 +5608,7 @@ let F = class extends g {
5601
5608
  };
5602
5609
  return c`
5603
5610
  <button
5604
- class=${y(i)}
5611
+ class=${w(i)}
5605
5612
  @click=${() => {
5606
5613
  this.popoverOpen = !0;
5607
5614
  }}
@@ -5634,7 +5641,7 @@ let F = class extends g {
5634
5641
  aria-label="Close"
5635
5642
  data-testid="popover-close-button"
5636
5643
  >
5637
- ${Tt}
5644
+ ${_t}
5638
5645
  </button>
5639
5646
  ${this.question ? c`<div class="pc-popover-question">${this.question}</div>` : u}
5640
5647
  ${this.renderStars(!0)}
@@ -5657,7 +5664,7 @@ let F = class extends g {
5657
5664
  label: n,
5658
5665
  value: d,
5659
5666
  icon: r
5660
- })), a = getComputedStyle(this).getPropertyValue("--pc-accent-color").trim() || "#ffc107", l = $t(s, {
5667
+ })), a = getComputedStyle(this).getPropertyValue("--pc-accent-color").trim() || "#ffc107", l = Ct(s, {
5661
5668
  barColor: a,
5662
5669
  labelFormatter: (n) => `${n.label} ${n.icon}`,
5663
5670
  valueFormatter: (n) => `${o > 0 ? Math.round(n.value / o * 100) : 0}%`
@@ -5683,7 +5690,7 @@ let F = class extends g {
5683
5690
  @keydown="${(e) => {
5684
5691
  (e.key === "Enter" || e.key === " ") && (e.preventDefault(), this.displayController.toggleChartVisibility());
5685
5692
  }}"
5686
- >${this.displayController.isChartVisible ? Jt : Zt}</span
5693
+ >${this.displayController.isChartVisible ? Qt : Xt}</span
5687
5694
  >
5688
5695
  `;
5689
5696
  }
@@ -5726,7 +5733,7 @@ let F = class extends g {
5726
5733
  label: n,
5727
5734
  value: d,
5728
5735
  icon: r
5729
- })), a = getComputedStyle(this).getPropertyValue("--pc-accent-color").trim() || "#ffc107", l = $t(s, {
5736
+ })), a = getComputedStyle(this).getPropertyValue("--pc-accent-color").trim() || "#ffc107", l = Ct(s, {
5730
5737
  barColor: a,
5731
5738
  labelFormatter: (n) => `${n.label} ${n.icon}`,
5732
5739
  valueFormatter: (n) => `${o > 0 ? Math.round(n.value / o * 100) : 0}%`
@@ -5741,18 +5748,18 @@ let F = class extends g {
5741
5748
  * Render standard mode - original behavior
5742
5749
  */
5743
5750
  renderStandardMode() {
5744
- const e = O(this.questionPosition, this.questionAlign), t = {
5751
+ const e = z(this.questionPosition, this.questionAlign), t = {
5745
5752
  [`pc-flex-pos-${this.questionPosition}`]: !0,
5746
5753
  [`pc-flex-align-${e}`]: !0
5747
- }, o = O(this.statsPosition, this.statsAlign), r = {
5754
+ }, o = z(this.statsPosition, this.statsAlign), r = {
5748
5755
  "pc-body": !0,
5749
5756
  [`pc-flex-pos-${this.statsPosition}`]: !0,
5750
5757
  [`pc-flex-align-${o}`]: !0
5751
5758
  }, s = !this.displayController.shouldShowChart();
5752
5759
  return c`
5753
- <div class="pc-container ${y(t)}" data-testid="pc-container">
5760
+ <div class="pc-container ${w(t)}" data-testid="pc-container">
5754
5761
  ${this.renderLabelAtStart()}
5755
- <div class="${y(r)}" data-testid="stars-body">
5762
+ <div class="${w(r)}" data-testid="stars-body">
5756
5763
  ${this.renderStatusAtStart()} ${this.renderChart()}
5757
5764
  ${s ? this.renderStars() : u} ${this.renderStatusAtEnd()}
5758
5765
  </div>
@@ -5764,7 +5771,7 @@ let F = class extends g {
5764
5771
  return this.inline ? this.renderInlineMode() : this.readonly ? this.renderReadonlyMode() : this.renderStandardMode();
5765
5772
  }
5766
5773
  };
5767
- F.styles = [...g.styles, Ot, pr];
5774
+ F.styles = [...m.styles, It, fr];
5768
5775
  nt([
5769
5776
  f({ type: String })
5770
5777
  ], F.prototype, "icon", 2);
@@ -5772,18 +5779,18 @@ nt([
5772
5779
  f({ type: Number, attribute: "num-stars" })
5773
5780
  ], F.prototype, "numStars", 2);
5774
5781
  nt([
5775
- k()
5782
+ A()
5776
5783
  ], F.prototype, "hoverValue", 2);
5777
5784
  nt([
5778
- k()
5785
+ A()
5779
5786
  ], F.prototype, "popoverOpen", 2);
5780
5787
  nt([
5781
- mt(".pc-inline-trigger")
5788
+ bt(".pc-inline-trigger")
5782
5789
  ], F.prototype, "triggerElement", 2);
5783
5790
  F = nt([
5784
- Y("pc-stars")
5791
+ W("pc-stars")
5785
5792
  ], F);
5786
- const mr = B`
5793
+ const yr = U`
5787
5794
  /* Adjust stats text for reactions */
5788
5795
  .pc-stats-text {
5789
5796
  font-size: var(--pc-font-size-small, var(--default-font-size-small));
@@ -6046,13 +6053,13 @@ const mr = B`
6046
6053
  animation: none;
6047
6054
  }
6048
6055
  }
6049
- `, vr = "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";
6050
- var br = Object.defineProperty, yr = Object.getOwnPropertyDescriptor, It = (e, t, o, r) => {
6051
- for (var s = r > 1 ? void 0 : r ? yr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
6056
+ `, wr = "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";
6057
+ var xr = Object.defineProperty, $r = Object.getOwnPropertyDescriptor, zt = (e, t, o, r) => {
6058
+ for (var s = r > 1 ? void 0 : r ? $r(t, o) : t, i = e.length - 1, a; i >= 0; i--)
6052
6059
  (a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
6053
- return r && s && br(t, o, s), s;
6060
+ return r && s && xr(t, o, s), s;
6054
6061
  };
6055
- let it = class extends g {
6062
+ let at = class extends m {
6056
6063
  constructor() {
6057
6064
  super(), this.type = S.reaction, this.showCounts = !1, this.compact = !1, this.popupPosition = "auto", this.hasEditButton = !1, this.statsText = "{count} votes", this.buttonRadius = "990px", this.muteColor = "#cccccc", this.questionPosition = "top", this.statsPosition = "right", this.popupPosition = "auto";
6058
6065
  }
@@ -6076,7 +6083,7 @@ let it = class extends g {
6076
6083
  * Renders the icon for a reaction
6077
6084
  */
6078
6085
  renderReactionIcon(e, t) {
6079
- const { icon: o, isRemoteImage: r } = At(e), s = Qt.FUNCTIONAL, i = t.tooltip || `${t.value} reaction`, a = Be(o, {
6086
+ const { icon: o, isRemoteImage: r } = Pt(e), s = ee.FUNCTIONAL, i = t.tooltip || `${t.value} reaction`, a = je(o, {
6080
6087
  type: s,
6081
6088
  alt: i,
6082
6089
  ariaLabel: i,
@@ -6103,7 +6110,7 @@ let it = class extends g {
6103
6110
  }, l = `${e.tooltip || e.value} reaction${o ? ", selected" : ""}${t ? `, ${r} votes` : ""}`;
6104
6111
  return c`
6105
6112
  <button
6106
- class="${y(a)}"
6113
+ class="${w(a)}"
6107
6114
  @click="${() => this.handleReactionClick(e)}"
6108
6115
  ?disabled="${s}"
6109
6116
  aria-pressed="${o}"
@@ -6130,7 +6137,7 @@ let it = class extends g {
6130
6137
  aria-expanded="${this.displayController.shouldShowReactionPopover()}"
6131
6138
  aria-haspopup="true"
6132
6139
  >
6133
- <img src="${vr}" alt="" class="trigger-icon" />
6140
+ <img src="${wr}" alt="" class="trigger-icon" />
6134
6141
  </button>
6135
6142
  `;
6136
6143
  }
@@ -6145,7 +6152,7 @@ let it = class extends g {
6145
6152
  bottom: this.popupPosition === "bottom" || this.popupPosition === "auto" && !this.shouldShowPopoverOnTop()
6146
6153
  };
6147
6154
  return c`
6148
- <div class="${y(e)}" role="menu">
6155
+ <div class="${w(e)}" role="menu">
6149
6156
  <div class="popover-content">
6150
6157
  ${this.options.map((t) => {
6151
6158
  const o = this.displayController.shouldDisableOption(t);
@@ -6192,7 +6199,7 @@ let it = class extends g {
6192
6199
  (o) => this.dataController.isValueSelected(o.value)
6193
6200
  );
6194
6201
  return c`
6195
- <div class="${y(e)}">
6202
+ <div class="${w(e)}">
6196
6203
  ${t.length > 0 ? c`
6197
6204
  <div class="reaction-list">
6198
6205
  ${t.map(
@@ -6205,7 +6212,7 @@ let it = class extends g {
6205
6212
  `;
6206
6213
  } else
6207
6214
  return c`
6208
- <div class="${y(e)}">
6215
+ <div class="${w(e)}">
6209
6216
  <div class="reaction-list">
6210
6217
  ${this.options.map((t) => this.renderReactionButton(t, this.showCounts))}
6211
6218
  </div>
@@ -6228,7 +6235,7 @@ let it = class extends g {
6228
6235
  icon: (p == null ? void 0 : p.icon) || n
6229
6236
  // Use the icon or fall back to reaction value
6230
6237
  };
6231
- }), r = getComputedStyle(this), s = r.getPropertyValue("--pc-primary-color").trim(), a = r.getPropertyValue("--pc-accent-color").trim() || s || "#ffc107", l = $t(o, {
6238
+ }), r = getComputedStyle(this), s = r.getPropertyValue("--pc-primary-color").trim(), a = r.getPropertyValue("--pc-accent-color").trim() || s || "#ffc107", l = Ct(o, {
6232
6239
  barColor: a,
6233
6240
  labelFormatter: (n) => `${n.label}`,
6234
6241
  valueFormatter: (n) => `${e.totalCount > 0 ? Math.round(n.value / e.totalCount * 100) : 0}%`
@@ -6269,18 +6276,18 @@ let it = class extends g {
6269
6276
  * (Reactions are inherently inline, so inline mode = standard mode)
6270
6277
  */
6271
6278
  renderStandardMode() {
6272
- const e = O(this.questionPosition, this.questionAlign), t = {
6279
+ const e = z(this.questionPosition, this.questionAlign), t = {
6273
6280
  [`pc-flex-pos-${this.questionPosition}`]: !0,
6274
6281
  [`pc-flex-align-${e}`]: !0
6275
- }, o = O(this.statsPosition, this.statsAlign), r = {
6282
+ }, o = z(this.statsPosition, this.statsAlign), r = {
6276
6283
  "pc-body": !0,
6277
6284
  [`pc-flex-pos-${this.statsPosition}`]: !0,
6278
6285
  [`pc-flex-align-${o}`]: !0
6279
6286
  };
6280
6287
  return c`
6281
- <div class="${y(t)}" data-testid="reaction-container">
6288
+ <div class="${w(t)}" data-testid="reaction-container">
6282
6289
  ${this.renderLabelAtStart()}
6283
- <div class="${y(r)}" data-testid="reaction-body">
6290
+ <div class="${w(r)}" data-testid="reaction-body">
6284
6291
  ${this.renderStatusAtStart()} ${this.renderChart()} ${this.renderReactions()}
6285
6292
  ${this.renderStatusAtEnd()}
6286
6293
  </div>
@@ -6292,35 +6299,35 @@ let it = class extends g {
6292
6299
  return this.readonly ? this.renderReadonlyMode() : this.renderStandardMode();
6293
6300
  }
6294
6301
  };
6295
- it.styles = [...g.styles, Ot, mr];
6296
- It([
6302
+ at.styles = [...m.styles, It, yr];
6303
+ zt([
6297
6304
  f({ type: Boolean, attribute: "show-counts" })
6298
- ], it.prototype, "showCounts", 2);
6299
- It([
6305
+ ], at.prototype, "showCounts", 2);
6306
+ zt([
6300
6307
  f({ type: Boolean, reflect: !0 })
6301
- ], it.prototype, "compact", 2);
6302
- It([
6308
+ ], at.prototype, "compact", 2);
6309
+ zt([
6303
6310
  f({ type: String, attribute: "popup-position" })
6304
- ], it.prototype, "popupPosition", 2);
6305
- it = It([
6306
- Y("pc-reaction")
6307
- ], it);
6308
- function ct(e, t, o = void 0) {
6311
+ ], at.prototype, "popupPosition", 2);
6312
+ at = zt([
6313
+ W("pc-reaction")
6314
+ ], at);
6315
+ function dt(e, t, o = void 0) {
6309
6316
  const r = e.getAttribute(t);
6310
6317
  return r === null ? o : r == null ? void 0 : r.trim();
6311
6318
  }
6312
- function xr(e, t = void 0) {
6319
+ function Sr(e, t = void 0) {
6313
6320
  const o = e.textContent;
6314
6321
  return o === "" || o === null ? t : o == null ? void 0 : o.trim();
6315
6322
  }
6316
- var wr = Object.defineProperty, $r = Object.getOwnPropertyDescriptor, zt = (e, t, o, r) => {
6317
- for (var s = r > 1 ? void 0 : r ? $r(t, o) : t, i = e.length - 1, a; i >= 0; i--)
6323
+ var Cr = Object.defineProperty, kr = Object.getOwnPropertyDescriptor, lt = (e, t, o, r) => {
6324
+ for (var s = r > 1 ? void 0 : r ? kr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
6318
6325
  (a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
6319
- return r && s && wr(t, o, s), s;
6326
+ return r && s && Cr(t, o, s), s;
6320
6327
  };
6321
- let at = class extends R {
6328
+ let Y = class extends R {
6322
6329
  constructor() {
6323
- super(), this.options = "", this.parsedOptions = [], at.injectGlobalStyle();
6330
+ super(), this.options = "", this.parsedOptions = [], this.isLoadingType = !1, Y.injectGlobalStyle();
6324
6331
  }
6325
6332
  /**
6326
6333
  * Inject global style to hide poll-catch-option elements
@@ -6344,6 +6351,43 @@ let at = class extends R {
6344
6351
  createRenderRoot() {
6345
6352
  return this;
6346
6353
  }
6354
+ connectedCallback() {
6355
+ super.connectedCallback(), this.maybeFetchType();
6356
+ }
6357
+ async maybeFetchType() {
6358
+ var t, o, r, s, i, a, l, n, d, p, h, v, x, k;
6359
+ if (this.type || !this.widgetId) return;
6360
+ if (!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(this.widgetId)) {
6361
+ g.error(`poll-catch: Invalid widget-id format: ${this.widgetId}`);
6362
+ return;
6363
+ }
6364
+ this.isLoadingType = !0;
6365
+ try {
6366
+ const _ = `${this.getAttribute("data-endpoint") || Yt}/widgets/${encodeURIComponent(this.widgetId)}`, $ = await fetch(_);
6367
+ if (!$.ok)
6368
+ throw new Error(`API request failed with status: ${$.status}`);
6369
+ const y = await $.json();
6370
+ if (!y.success)
6371
+ throw new Error("Backend returned unsuccessful response");
6372
+ const E = (o = (t = y.data) == null ? void 0 : t.config) == null ? void 0 : o.type;
6373
+ if (!E)
6374
+ throw new Error("Backend response missing widget type");
6375
+ Yo(this.widgetId, {
6376
+ type: E,
6377
+ attributes: ((s = (r = y.data) == null ? void 0 : r.config) == null ? void 0 : s.attributes) || null,
6378
+ stats: {
6379
+ count: ((a = (i = y.data) == null ? void 0 : i.stats) == null ? void 0 : a.count) ?? 0,
6380
+ sum: ((n = (l = y.data) == null ? void 0 : l.stats) == null ? void 0 : n.sum) ?? 0,
6381
+ breakdown: ((p = (d = y.data) == null ? void 0 : d.stats) == null ? void 0 : p.breakdown) ?? {},
6382
+ updatedAt: ((v = (h = y.data) == null ? void 0 : h.stats) == null ? void 0 : v.updatedAt) || ((k = (x = y.data) == null ? void 0 : x.stats) == null ? void 0 : k.updated_at)
6383
+ }
6384
+ }), this.type = E, await this.updateComplete, this.forceUpdate();
6385
+ } catch (P) {
6386
+ g.error("poll-catch: Failed to fetch widget config", P);
6387
+ } finally {
6388
+ this.isLoadingType = !1;
6389
+ }
6390
+ }
6347
6391
  forceUpdate() {
6348
6392
  this.forwardAttributesToWidget(), this.forwardOptionsToWidget();
6349
6393
  }
@@ -6379,16 +6423,16 @@ let at = class extends R {
6379
6423
  const e = this.querySelector("pc-poll, pc-reaction");
6380
6424
  if (!e) return;
6381
6425
  const t = this.querySelectorAll("poll-catch-option");
6382
- let r = Uo(this.options).map((s) => ({
6426
+ let r = jo(this.options).map((s) => ({
6383
6427
  value: s,
6384
6428
  label: s,
6385
6429
  icon: e.tagName === "PC-REACTION" ? s : void 0
6386
6430
  // REACTION widget uses options for the icon
6387
6431
  }));
6388
6432
  t && t.length > 0 && (r = Array.from(t).map((s) => {
6389
- const i = ct(s, "value", "") || "", a = ct(s, "label", xr(s, i)) || "", l = ct(s, "icon", void 0), n = ct(s, "tooltip", void 0), d = ct(s, "disabled", void 0), p = { value: i, label: a };
6433
+ const i = dt(s, "value", "") || "", a = dt(s, "label", Sr(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 };
6390
6434
  if (l !== void 0) {
6391
- const h = At(l);
6435
+ const h = Pt(l);
6392
6436
  p.icon = h.icon;
6393
6437
  }
6394
6438
  return n !== void 0 && (p.tooltip = n), d !== void 0 && (p.disabled = !0), p;
@@ -6398,6 +6442,8 @@ let at = class extends R {
6398
6442
  * Render the appropriate widget based on the type
6399
6443
  */
6400
6444
  render() {
6445
+ if (this.isLoadingType)
6446
+ return u;
6401
6447
  switch (this.type) {
6402
6448
  case S.nps:
6403
6449
  return c`<pc-nps></pc-nps>`;
@@ -6408,24 +6454,30 @@ let at = class extends R {
6408
6454
  case S.reaction:
6409
6455
  return c`<pc-reaction .options=${this.parsedOptions}></pc-reaction>`;
6410
6456
  default:
6411
- return console.warn(
6457
+ return this.widgetId || console.warn(
6412
6458
  `poll-catch: Unknown widget type "${this.type}". Supported types: nps, poll, stars, reaction.`
6413
6459
  ), u;
6414
6460
  }
6415
6461
  }
6416
6462
  };
6417
- zt([
6463
+ lt([
6418
6464
  f({ type: String })
6419
- ], at.prototype, "type", 2);
6420
- zt([
6465
+ ], Y.prototype, "type", 2);
6466
+ lt([
6467
+ f({ type: String, attribute: "widget-id" })
6468
+ ], Y.prototype, "widgetId", 2);
6469
+ lt([
6421
6470
  f({ type: String })
6422
- ], at.prototype, "options", 2);
6423
- zt([
6424
- k()
6425
- ], at.prototype, "parsedOptions", 2);
6426
- at = zt([
6427
- Y("poll-catch")
6428
- ], at);
6471
+ ], Y.prototype, "options", 2);
6472
+ lt([
6473
+ A()
6474
+ ], Y.prototype, "parsedOptions", 2);
6475
+ lt([
6476
+ A()
6477
+ ], Y.prototype, "isLoadingType", 2);
6478
+ Y = lt([
6479
+ W("poll-catch")
6480
+ ], Y);
6429
6481
  export {
6430
- at as PollCatch
6482
+ Y as PollCatch
6431
6483
  };