@vouchfor/embeds 0.0.0-experiment.88ebbc0 → 0.0.0-experiment.8b3403f

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/es/embeds.js CHANGED
@@ -1,6 +1,6 @@
1
- import { property as y, state as Lt, customElement as Qt } from "lit/decorators.js";
1
+ import { property as A, state as Mt, customElement as Qt } from "lit/decorators.js";
2
2
  import { ifDefined as mt } from "lit/directives/if-defined.js";
3
- import { createRef as kt, ref as Dt } from "lit/directives/ref.js";
3
+ import { createRef as Lt, ref as Dt } from "lit/directives/ref.js";
4
4
  import { Task as te } from "@lit/task";
5
5
  import "@vouchfor/media-player";
6
6
  /**
@@ -100,8 +100,8 @@ let T = class extends HTMLElement {
100
100
  return { get() {
101
101
  return this[e];
102
102
  }, set(s) {
103
- const r = this[t];
104
- this[e] = s, this.requestUpdate(t, r, i);
103
+ const o = this[t];
104
+ this[e] = s, this.requestUpdate(t, o, i);
105
105
  }, configurable: !0, enumerable: !0 };
106
106
  }
107
107
  static getPropertyOptions(t) {
@@ -176,18 +176,18 @@ let T = class extends HTMLElement {
176
176
  }
177
177
  _$EO(t, e, i = it) {
178
178
  var s;
179
- const r = this.constructor._$Ep(t, i);
180
- if (r !== void 0 && i.reflect === !0) {
181
- const o = (((s = i.converter) === null || s === void 0 ? void 0 : s.toAttribute) !== void 0 ? i.converter : dt).toAttribute(e, i.type);
182
- this._$El = t, o == null ? this.removeAttribute(r) : this.setAttribute(r, o), this._$El = null;
179
+ const o = this.constructor._$Ep(t, i);
180
+ if (o !== void 0 && i.reflect === !0) {
181
+ const r = (((s = i.converter) === null || s === void 0 ? void 0 : s.toAttribute) !== void 0 ? i.converter : dt).toAttribute(e, i.type);
182
+ this._$El = t, r == null ? this.removeAttribute(o) : this.setAttribute(o, r), this._$El = null;
183
183
  }
184
184
  }
185
185
  _$AK(t, e) {
186
186
  var i;
187
- const s = this.constructor, r = s._$Ev.get(t);
188
- if (r !== void 0 && this._$El !== r) {
189
- const o = s.getPropertyOptions(r), d = typeof o.converter == "function" ? { fromAttribute: o.converter } : ((i = o.converter) === null || i === void 0 ? void 0 : i.fromAttribute) !== void 0 ? o.converter : dt;
190
- this._$El = r, this[r] = d.fromAttribute(e, o.type), this._$El = null;
187
+ const s = this.constructor, o = s._$Ev.get(t);
188
+ if (o !== void 0 && this._$El !== o) {
189
+ const r = s.getPropertyOptions(o), d = typeof r.converter == "function" ? { fromAttribute: r.converter } : ((i = r.converter) === null || i === void 0 ? void 0 : i.fromAttribute) !== void 0 ? r.converter : dt;
190
+ this._$El = o, this[o] = d.fromAttribute(e, r.type), this._$El = null;
191
191
  }
192
192
  }
193
193
  requestUpdate(t, e, i) {
@@ -211,13 +211,13 @@ let T = class extends HTMLElement {
211
211
  var t;
212
212
  if (!this.isUpdatePending)
213
213
  return;
214
- this.hasUpdated, this._$Ei && (this._$Ei.forEach((s, r) => this[r] = s), this._$Ei = void 0);
214
+ this.hasUpdated, this._$Ei && (this._$Ei.forEach((s, o) => this[o] = s), this._$Ei = void 0);
215
215
  let e = !1;
216
216
  const i = this._$AL;
217
217
  try {
218
218
  e = this.shouldUpdate(i), e ? (this.willUpdate(i), (t = this._$ES) === null || t === void 0 || t.forEach((s) => {
219
- var r;
220
- return (r = s.hostUpdate) === null || r === void 0 ? void 0 : r.call(s);
219
+ var o;
220
+ return (o = s.hostUpdate) === null || o === void 0 ? void 0 : o.call(s);
221
221
  }), this.update(i)) : this._$Ek();
222
222
  } catch (s) {
223
223
  throw e = !1, this._$Ek(), s;
@@ -260,9 +260,9 @@ T[ct] = !0, T.elementProperties = /* @__PURE__ */ new Map(), T.elementStyles = [
260
260
  * SPDX-License-Identifier: BSD-3-Clause
261
261
  */
262
262
  var st;
263
- const J = window, x = J.trustedTypes, Et = x ? x.createPolicy("lit-html", { createHTML: (n) => n }) : void 0, ut = "$lit$", E = `lit$${(Math.random() + "").slice(9)}$`, zt = "?" + E, re = `<${zt}>`, C = document, G = () => C.createComment(""), D = (n) => n === null || typeof n != "object" && typeof n != "function", qt = Array.isArray, oe = (n) => qt(n) || typeof (n == null ? void 0 : n[Symbol.iterator]) == "function", nt = `[
264
- \f\r]`, O = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, wt = /-->/g, bt = />/g, b = RegExp(`>|${nt}(?:([^\\s"'>=/]+)(${nt}*=${nt}*(?:[^
265
- \f\r"'\`<>=]|("|')|))|$)`, "g"), St = /'/g, Pt = /"/g, Wt = /^(?:script|style|textarea|title)$/i, j = Symbol.for("lit-noChange"), v = Symbol.for("lit-nothing"), Ut = /* @__PURE__ */ new WeakMap(), P = C.createTreeWalker(C, 129, null, !1);
263
+ const G = window, x = G.trustedTypes, Et = x ? x.createPolicy("lit-html", { createHTML: (n) => n }) : void 0, ut = "$lit$", E = `lit$${(Math.random() + "").slice(9)}$`, zt = "?" + E, re = `<${zt}>`, U = document, J = () => U.createComment(""), D = (n) => n === null || typeof n != "object" && typeof n != "function", qt = Array.isArray, oe = (n) => qt(n) || typeof (n == null ? void 0 : n[Symbol.iterator]) == "function", nt = `[
264
+ \f\r]`, k = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, wt = /-->/g, bt = />/g, b = RegExp(`>|${nt}(?:([^\\s"'>=/]+)(${nt}*=${nt}*(?:[^
265
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), St = /'/g, Pt = /"/g, Wt = /^(?:script|style|textarea|title)$/i, j = Symbol.for("lit-noChange"), v = Symbol.for("lit-nothing"), Ct = /* @__PURE__ */ new WeakMap(), P = U.createTreeWalker(U, 129, null, !1);
266
266
  function Zt(n, t) {
267
267
  if (!Array.isArray(n) || !n.hasOwnProperty("raw"))
268
268
  throw Error("invalid template strings array");
@@ -270,22 +270,22 @@ function Zt(n, t) {
270
270
  }
271
271
  const le = (n, t) => {
272
272
  const e = n.length - 1, i = [];
273
- let s, r = t === 2 ? "<svg>" : "", o = O;
273
+ let s, o = t === 2 ? "<svg>" : "", r = k;
274
274
  for (let d = 0; d < e; d++) {
275
275
  const l = n[d];
276
276
  let a, u, h = -1, c = 0;
277
- for (; c < l.length && (o.lastIndex = c, u = o.exec(l), u !== null); )
278
- c = o.lastIndex, o === O ? u[1] === "!--" ? o = wt : u[1] !== void 0 ? o = bt : u[2] !== void 0 ? (Wt.test(u[2]) && (s = RegExp("</" + u[2], "g")), o = b) : u[3] !== void 0 && (o = b) : o === b ? u[0] === ">" ? (o = s ?? O, h = -1) : u[1] === void 0 ? h = -2 : (h = o.lastIndex - u[2].length, a = u[1], o = u[3] === void 0 ? b : u[3] === '"' ? Pt : St) : o === Pt || o === St ? o = b : o === wt || o === bt ? o = O : (o = b, s = void 0);
279
- const p = o === b && n[d + 1].startsWith("/>") ? " " : "";
280
- r += o === O ? l + re : h >= 0 ? (i.push(a), l.slice(0, h) + ut + l.slice(h) + E + p) : l + E + (h === -2 ? (i.push(void 0), d) : p);
277
+ for (; c < l.length && (r.lastIndex = c, u = r.exec(l), u !== null); )
278
+ c = r.lastIndex, r === k ? u[1] === "!--" ? r = wt : u[1] !== void 0 ? r = bt : u[2] !== void 0 ? (Wt.test(u[2]) && (s = RegExp("</" + u[2], "g")), r = b) : u[3] !== void 0 && (r = b) : r === b ? u[0] === ">" ? (r = s ?? k, h = -1) : u[1] === void 0 ? h = -2 : (h = r.lastIndex - u[2].length, a = u[1], r = u[3] === void 0 ? b : u[3] === '"' ? Pt : St) : r === Pt || r === St ? r = b : r === wt || r === bt ? r = k : (r = b, s = void 0);
279
+ const p = r === b && n[d + 1].startsWith("/>") ? " " : "";
280
+ o += r === k ? l + re : h >= 0 ? (i.push(a), l.slice(0, h) + ut + l.slice(h) + E + p) : l + E + (h === -2 ? (i.push(void 0), d) : p);
281
281
  }
282
- return [Zt(n, r + (n[e] || "<?>") + (t === 2 ? "</svg>" : "")), i];
282
+ return [Zt(n, o + (n[e] || "<?>") + (t === 2 ? "</svg>" : "")), i];
283
283
  };
284
284
  let pt = class Ft {
285
285
  constructor({ strings: t, _$litType$: e }, i) {
286
286
  let s;
287
287
  this.parts = [];
288
- let r = 0, o = 0;
288
+ let o = 0, r = 0;
289
289
  const d = t.length - 1, l = this.parts, [a, u] = le(t, e);
290
290
  if (this.el = Ft.createElement(a, i), P.currentNode = this.el.content, e === 2) {
291
291
  const h = this.el.content, c = h.firstChild;
@@ -297,12 +297,12 @@ let pt = class Ft {
297
297
  const h = [];
298
298
  for (const c of s.getAttributeNames())
299
299
  if (c.endsWith(ut) || c.startsWith(E)) {
300
- const p = u[o++];
300
+ const p = u[r++];
301
301
  if (h.push(c), p !== void 0) {
302
- const A = s.getAttribute(p.toLowerCase() + ut).split(E), m = /([.?@])?(.*)/.exec(p);
303
- l.push({ type: 1, index: r, name: m[2], strings: A, ctor: m[1] === "." ? he : m[1] === "?" ? ce : m[1] === "@" ? ue : Q });
302
+ const y = s.getAttribute(p.toLowerCase() + ut).split(E), m = /([.?@])?(.*)/.exec(p);
303
+ l.push({ type: 1, index: o, name: m[2], strings: y, ctor: m[1] === "." ? he : m[1] === "?" ? ce : m[1] === "@" ? ue : Q });
304
304
  } else
305
- l.push({ type: 6, index: r });
305
+ l.push({ type: 6, index: o });
306
306
  }
307
307
  for (const c of h)
308
308
  s.removeAttribute(c);
@@ -312,33 +312,33 @@ let pt = class Ft {
312
312
  if (c > 0) {
313
313
  s.textContent = x ? x.emptyScript : "";
314
314
  for (let p = 0; p < c; p++)
315
- s.append(h[p], G()), P.nextNode(), l.push({ type: 2, index: ++r });
316
- s.append(h[c], G());
315
+ s.append(h[p], J()), P.nextNode(), l.push({ type: 2, index: ++o });
316
+ s.append(h[c], J());
317
317
  }
318
318
  }
319
319
  } else if (s.nodeType === 8)
320
320
  if (s.data === zt)
321
- l.push({ type: 2, index: r });
321
+ l.push({ type: 2, index: o });
322
322
  else {
323
323
  let h = -1;
324
324
  for (; (h = s.data.indexOf(E, h + 1)) !== -1; )
325
- l.push({ type: 7, index: r }), h += E.length - 1;
325
+ l.push({ type: 7, index: o }), h += E.length - 1;
326
326
  }
327
- r++;
327
+ o++;
328
328
  }
329
329
  }
330
330
  static createElement(t, e) {
331
- const i = C.createElement("template");
331
+ const i = U.createElement("template");
332
332
  return i.innerHTML = t, i;
333
333
  }
334
334
  };
335
335
  function H(n, t, e = n, i) {
336
- var s, r, o, d;
336
+ var s, o, r, d;
337
337
  if (t === j)
338
338
  return t;
339
339
  let l = i !== void 0 ? (s = e._$Co) === null || s === void 0 ? void 0 : s[i] : e._$Cl;
340
340
  const a = D(t) ? void 0 : t._$litDirective$;
341
- return (l == null ? void 0 : l.constructor) !== a && ((r = l == null ? void 0 : l._$AO) === null || r === void 0 || r.call(l, !1), a === void 0 ? l = void 0 : (l = new a(n), l._$AT(n, e, i)), i !== void 0 ? ((o = (d = e)._$Co) !== null && o !== void 0 ? o : d._$Co = [])[i] = l : e._$Cl = l), l !== void 0 && (t = H(n, l._$AS(n, t.values), l, i)), t;
341
+ return (l == null ? void 0 : l.constructor) !== a && ((o = l == null ? void 0 : l._$AO) === null || o === void 0 || o.call(l, !1), a === void 0 ? l = void 0 : (l = new a(n), l._$AT(n, e, i)), i !== void 0 ? ((r = (d = e)._$Co) !== null && r !== void 0 ? r : d._$Co = [])[i] = l : e._$Cl = l), l !== void 0 && (t = H(n, l._$AS(n, t.values), l, i)), t;
342
342
  }
343
343
  let ae = class {
344
344
  constructor(t, e) {
@@ -352,27 +352,27 @@ let ae = class {
352
352
  }
353
353
  u(t) {
354
354
  var e;
355
- const { el: { content: i }, parts: s } = this._$AD, r = ((e = t == null ? void 0 : t.creationScope) !== null && e !== void 0 ? e : C).importNode(i, !0);
356
- P.currentNode = r;
357
- let o = P.nextNode(), d = 0, l = 0, a = s[0];
355
+ const { el: { content: i }, parts: s } = this._$AD, o = ((e = t == null ? void 0 : t.creationScope) !== null && e !== void 0 ? e : U).importNode(i, !0);
356
+ P.currentNode = o;
357
+ let r = P.nextNode(), d = 0, l = 0, a = s[0];
358
358
  for (; a !== void 0; ) {
359
359
  if (d === a.index) {
360
360
  let u;
361
- a.type === 2 ? u = new Kt(o, o.nextSibling, this, t) : a.type === 1 ? u = new a.ctor(o, a.name, a.strings, this, t) : a.type === 6 && (u = new pe(o, this, t)), this._$AV.push(u), a = s[++l];
361
+ a.type === 2 ? u = new Kt(r, r.nextSibling, this, t) : a.type === 1 ? u = new a.ctor(r, a.name, a.strings, this, t) : a.type === 6 && (u = new pe(r, this, t)), this._$AV.push(u), a = s[++l];
362
362
  }
363
- d !== (a == null ? void 0 : a.index) && (o = P.nextNode(), d++);
363
+ d !== (a == null ? void 0 : a.index) && (r = P.nextNode(), d++);
364
364
  }
365
- return P.currentNode = C, r;
365
+ return P.currentNode = U, o;
366
366
  }
367
367
  v(t) {
368
368
  let e = 0;
369
369
  for (const i of this._$AV)
370
370
  i !== void 0 && (i.strings !== void 0 ? (i._$AI(t, i, e), e += i.strings.length - 2) : i._$AI(t[e])), e++;
371
371
  }
372
- }, Kt = class Jt {
372
+ }, Kt = class Gt {
373
373
  constructor(t, e, i, s) {
374
- var r;
375
- this.type = 2, this._$AH = v, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = i, this.options = s, this._$Cp = (r = s == null ? void 0 : s.isConnected) === null || r === void 0 || r;
374
+ var o;
375
+ this.type = 2, this._$AH = v, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = i, this.options = s, this._$Cp = (o = s == null ? void 0 : s.isConnected) === null || o === void 0 || o;
376
376
  }
377
377
  get _$AU() {
378
378
  var t, e;
@@ -399,28 +399,28 @@ let ae = class {
399
399
  this._$AH !== t && (this._$AR(), this._$AH = this.k(t));
400
400
  }
401
401
  _(t) {
402
- this._$AH !== v && D(this._$AH) ? this._$AA.nextSibling.data = t : this.$(C.createTextNode(t)), this._$AH = t;
402
+ this._$AH !== v && D(this._$AH) ? this._$AA.nextSibling.data = t : this.$(U.createTextNode(t)), this._$AH = t;
403
403
  }
404
404
  g(t) {
405
405
  var e;
406
- const { values: i, _$litType$: s } = t, r = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = pt.createElement(Zt(s.h, s.h[0]), this.options)), s);
407
- if (((e = this._$AH) === null || e === void 0 ? void 0 : e._$AD) === r)
406
+ const { values: i, _$litType$: s } = t, o = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = pt.createElement(Zt(s.h, s.h[0]), this.options)), s);
407
+ if (((e = this._$AH) === null || e === void 0 ? void 0 : e._$AD) === o)
408
408
  this._$AH.v(i);
409
409
  else {
410
- const o = new ae(r, this), d = o.u(this.options);
411
- o.v(i), this.$(d), this._$AH = o;
410
+ const r = new ae(o, this), d = r.u(this.options);
411
+ r.v(i), this.$(d), this._$AH = r;
412
412
  }
413
413
  }
414
414
  _$AC(t) {
415
- let e = Ut.get(t.strings);
416
- return e === void 0 && Ut.set(t.strings, e = new pt(t)), e;
415
+ let e = Ct.get(t.strings);
416
+ return e === void 0 && Ct.set(t.strings, e = new pt(t)), e;
417
417
  }
418
418
  T(t) {
419
419
  qt(this._$AH) || (this._$AH = [], this._$AR());
420
420
  const e = this._$AH;
421
421
  let i, s = 0;
422
- for (const r of t)
423
- s === e.length ? e.push(i = new Jt(this.k(G()), this.k(G()), this, this.options)) : i = e[s], i._$AI(r), s++;
422
+ for (const o of t)
423
+ s === e.length ? e.push(i = new Gt(this.k(J()), this.k(J()), this, this.options)) : i = e[s], i._$AI(o), s++;
424
424
  s < e.length && (this._$AR(i && i._$AB.nextSibling, s), e.length = s);
425
425
  }
426
426
  _$AR(t = this._$AA.nextSibling, e) {
@@ -435,8 +435,8 @@ let ae = class {
435
435
  this._$AM === void 0 && (this._$Cp = t, (e = this._$AP) === null || e === void 0 || e.call(this, t));
436
436
  }
437
437
  }, Q = class {
438
- constructor(t, e, i, s, r) {
439
- this.type = 1, this._$AH = v, this._$AN = void 0, this.element = t, this.name = e, this._$AM = s, this.options = r, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = v;
438
+ constructor(t, e, i, s, o) {
439
+ this.type = 1, this._$AH = v, this._$AN = void 0, this.element = t, this.name = e, this._$AM = s, this.options = o, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = v;
440
440
  }
441
441
  get tagName() {
442
442
  return this.element.tagName;
@@ -445,17 +445,17 @@ let ae = class {
445
445
  return this._$AM._$AU;
446
446
  }
447
447
  _$AI(t, e = this, i, s) {
448
- const r = this.strings;
449
- let o = !1;
450
- if (r === void 0)
451
- t = H(this, t, e, 0), o = !D(t) || t !== this._$AH && t !== j, o && (this._$AH = t);
448
+ const o = this.strings;
449
+ let r = !1;
450
+ if (o === void 0)
451
+ t = H(this, t, e, 0), r = !D(t) || t !== this._$AH && t !== j, r && (this._$AH = t);
452
452
  else {
453
453
  const d = t;
454
454
  let l, a;
455
- for (t = r[0], l = 0; l < r.length - 1; l++)
456
- a = H(this, d[i + l], e, l), a === j && (a = this._$AH[l]), o || (o = !D(a) || a !== this._$AH[l]), a === v ? t = v : t !== v && (t += (a ?? "") + r[l + 1]), this._$AH[l] = a;
455
+ for (t = o[0], l = 0; l < o.length - 1; l++)
456
+ a = H(this, d[i + l], e, l), a === j && (a = this._$AH[l]), r || (r = !D(a) || a !== this._$AH[l]), a === v ? t = v : t !== v && (t += (a ?? "") + o[l + 1]), this._$AH[l] = a;
457
457
  }
458
- o && !s && this.j(t);
458
+ r && !s && this.j(t);
459
459
  }
460
460
  j(t) {
461
461
  t === v ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
@@ -477,15 +477,15 @@ let ce = class extends Q {
477
477
  t && t !== v ? this.element.setAttribute(this.name, de) : this.element.removeAttribute(this.name);
478
478
  }
479
479
  }, ue = class extends Q {
480
- constructor(t, e, i, s, r) {
481
- super(t, e, i, s, r), this.type = 5;
480
+ constructor(t, e, i, s, o) {
481
+ super(t, e, i, s, o), this.type = 5;
482
482
  }
483
483
  _$AI(t, e = this) {
484
484
  var i;
485
485
  if ((t = (i = H(this, t, e, 0)) !== null && i !== void 0 ? i : v) === j)
486
486
  return;
487
- const s = this._$AH, r = t === v && s !== v || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, o = t !== v && (s === v || r);
488
- r && this.element.removeEventListener(this.name, this, s), o && this.element.addEventListener(this.name, this, t), this._$AH = t;
487
+ const s = this._$AH, o = t === v && s !== v || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, r = t !== v && (s === v || o);
488
+ o && this.element.removeEventListener(this.name, this, s), r && this.element.addEventListener(this.name, this, t), this._$AH = t;
489
489
  }
490
490
  handleEvent(t) {
491
491
  var e, i;
@@ -503,28 +503,28 @@ class pe {
503
503
  H(this, t);
504
504
  }
505
505
  }
506
- const Ct = J.litHtmlPolyfillSupport;
507
- Ct == null || Ct(pt, Kt), ((st = J.litHtmlVersions) !== null && st !== void 0 ? st : J.litHtmlVersions = []).push("2.8.0");
506
+ const Ut = G.litHtmlPolyfillSupport;
507
+ Ut == null || Ut(pt, Kt), ((st = G.litHtmlVersions) !== null && st !== void 0 ? st : G.litHtmlVersions = []).push("2.8.0");
508
508
  /**
509
509
  * @license
510
510
  * Copyright 2017 Google LLC
511
511
  * SPDX-License-Identifier: BSD-3-Clause
512
512
  */
513
513
  var rt;
514
- const X = window, N = X.trustedTypes, Rt = N ? N.createPolicy("lit-html", { createHTML: (n) => n }) : void 0, vt = "$lit$", w = `lit$${(Math.random() + "").slice(9)}$`, Gt = "?" + w, ve = `<${Gt}>`, R = document, B = () => R.createComment(""), z = (n) => n === null || typeof n != "object" && typeof n != "function", Xt = Array.isArray, _e = (n) => Xt(n) || typeof (n == null ? void 0 : n[Symbol.iterator]) == "function", ot = `[
515
- \f\r]`, M = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Tt = /-->/g, xt = />/g, S = RegExp(`>|${ot}(?:([^\\s"'>=/]+)(${ot}*=${ot}*(?:[^
516
- \f\r"'\`<>=]|("|')|))|$)`, "g"), Ht = /'/g, Nt = /"/g, Yt = /^(?:script|style|textarea|title)$/i, $e = (n) => (t, ...e) => ({ _$litType$: n, strings: t, values: e }), me = $e(1), I = Symbol.for("lit-noChange"), _ = Symbol.for("lit-nothing"), It = /* @__PURE__ */ new WeakMap(), U = R.createTreeWalker(R, 129, null, !1), ge = (n, t) => {
514
+ const X = window, N = X.trustedTypes, Rt = N ? N.createPolicy("lit-html", { createHTML: (n) => n }) : void 0, vt = "$lit$", w = `lit$${(Math.random() + "").slice(9)}$`, Jt = "?" + w, ve = `<${Jt}>`, R = document, B = () => R.createComment(""), z = (n) => n === null || typeof n != "object" && typeof n != "function", Xt = Array.isArray, _e = (n) => Xt(n) || typeof (n == null ? void 0 : n[Symbol.iterator]) == "function", ot = `[
515
+ \f\r]`, O = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Tt = /-->/g, xt = />/g, S = RegExp(`>|${ot}(?:([^\\s"'>=/]+)(${ot}*=${ot}*(?:[^
516
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), Ht = /'/g, Nt = /"/g, Yt = /^(?:script|style|textarea|title)$/i, $e = (n) => (t, ...e) => ({ _$litType$: n, strings: t, values: e }), me = $e(1), I = Symbol.for("lit-noChange"), _ = Symbol.for("lit-nothing"), It = /* @__PURE__ */ new WeakMap(), C = R.createTreeWalker(R, 129, null, !1), ge = (n, t) => {
517
517
  const e = n.length - 1, i = [];
518
- let s, r = t === 2 ? "<svg>" : "", o = M;
518
+ let s, o = t === 2 ? "<svg>" : "", r = O;
519
519
  for (let l = 0; l < e; l++) {
520
520
  const a = n[l];
521
521
  let u, h, c = -1, p = 0;
522
- for (; p < a.length && (o.lastIndex = p, h = o.exec(a), h !== null); )
523
- p = o.lastIndex, o === M ? h[1] === "!--" ? o = Tt : h[1] !== void 0 ? o = xt : h[2] !== void 0 ? (Yt.test(h[2]) && (s = RegExp("</" + h[2], "g")), o = S) : h[3] !== void 0 && (o = S) : o === S ? h[0] === ">" ? (o = s ?? M, c = -1) : h[1] === void 0 ? c = -2 : (c = o.lastIndex - h[2].length, u = h[1], o = h[3] === void 0 ? S : h[3] === '"' ? Nt : Ht) : o === Nt || o === Ht ? o = S : o === Tt || o === xt ? o = M : (o = S, s = void 0);
524
- const A = o === S && n[l + 1].startsWith("/>") ? " " : "";
525
- r += o === M ? a + ve : c >= 0 ? (i.push(u), a.slice(0, c) + vt + a.slice(c) + w + A) : a + w + (c === -2 ? (i.push(void 0), l) : A);
522
+ for (; p < a.length && (r.lastIndex = p, h = r.exec(a), h !== null); )
523
+ p = r.lastIndex, r === O ? h[1] === "!--" ? r = Tt : h[1] !== void 0 ? r = xt : h[2] !== void 0 ? (Yt.test(h[2]) && (s = RegExp("</" + h[2], "g")), r = S) : h[3] !== void 0 && (r = S) : r === S ? h[0] === ">" ? (r = s ?? O, c = -1) : h[1] === void 0 ? c = -2 : (c = r.lastIndex - h[2].length, u = h[1], r = h[3] === void 0 ? S : h[3] === '"' ? Nt : Ht) : r === Nt || r === Ht ? r = S : r === Tt || r === xt ? r = O : (r = S, s = void 0);
524
+ const y = r === S && n[l + 1].startsWith("/>") ? " " : "";
525
+ o += r === O ? a + ve : c >= 0 ? (i.push(u), a.slice(0, c) + vt + a.slice(c) + w + y) : a + w + (c === -2 ? (i.push(void 0), l) : y);
526
526
  }
527
- const d = r + (n[e] || "<?>") + (t === 2 ? "</svg>" : "");
527
+ const d = o + (n[e] || "<?>") + (t === 2 ? "</svg>" : "");
528
528
  if (!Array.isArray(n) || !n.hasOwnProperty("raw"))
529
529
  throw Error("invalid template strings array");
530
530
  return [Rt !== void 0 ? Rt.createHTML(d) : d, i];
@@ -533,24 +533,24 @@ class q {
533
533
  constructor({ strings: t, _$litType$: e }, i) {
534
534
  let s;
535
535
  this.parts = [];
536
- let r = 0, o = 0;
536
+ let o = 0, r = 0;
537
537
  const d = t.length - 1, l = this.parts, [a, u] = ge(t, e);
538
- if (this.el = q.createElement(a, i), U.currentNode = this.el.content, e === 2) {
538
+ if (this.el = q.createElement(a, i), C.currentNode = this.el.content, e === 2) {
539
539
  const h = this.el.content, c = h.firstChild;
540
540
  c.remove(), h.append(...c.childNodes);
541
541
  }
542
- for (; (s = U.nextNode()) !== null && l.length < d; ) {
542
+ for (; (s = C.nextNode()) !== null && l.length < d; ) {
543
543
  if (s.nodeType === 1) {
544
544
  if (s.hasAttributes()) {
545
545
  const h = [];
546
546
  for (const c of s.getAttributeNames())
547
547
  if (c.endsWith(vt) || c.startsWith(w)) {
548
- const p = u[o++];
548
+ const p = u[r++];
549
549
  if (h.push(c), p !== void 0) {
550
- const A = s.getAttribute(p.toLowerCase() + vt).split(w), m = /([.?@])?(.*)/.exec(p);
551
- l.push({ type: 1, index: r, name: m[2], strings: A, ctor: m[1] === "." ? Ae : m[1] === "?" ? Ee : m[1] === "@" ? we : tt });
550
+ const y = s.getAttribute(p.toLowerCase() + vt).split(w), m = /([.?@])?(.*)/.exec(p);
551
+ l.push({ type: 1, index: o, name: m[2], strings: y, ctor: m[1] === "." ? Ae : m[1] === "?" ? Ee : m[1] === "@" ? we : tt });
552
552
  } else
553
- l.push({ type: 6, index: r });
553
+ l.push({ type: 6, index: o });
554
554
  }
555
555
  for (const c of h)
556
556
  s.removeAttribute(c);
@@ -560,19 +560,19 @@ class q {
560
560
  if (c > 0) {
561
561
  s.textContent = N ? N.emptyScript : "";
562
562
  for (let p = 0; p < c; p++)
563
- s.append(h[p], B()), U.nextNode(), l.push({ type: 2, index: ++r });
563
+ s.append(h[p], B()), C.nextNode(), l.push({ type: 2, index: ++o });
564
564
  s.append(h[c], B());
565
565
  }
566
566
  }
567
567
  } else if (s.nodeType === 8)
568
- if (s.data === Gt)
569
- l.push({ type: 2, index: r });
568
+ if (s.data === Jt)
569
+ l.push({ type: 2, index: o });
570
570
  else {
571
571
  let h = -1;
572
572
  for (; (h = s.data.indexOf(w, h + 1)) !== -1; )
573
- l.push({ type: 7, index: r }), h += w.length - 1;
573
+ l.push({ type: 7, index: o }), h += w.length - 1;
574
574
  }
575
- r++;
575
+ o++;
576
576
  }
577
577
  }
578
578
  static createElement(t, e) {
@@ -581,12 +581,12 @@ class q {
581
581
  }
582
582
  }
583
583
  function V(n, t, e = n, i) {
584
- var s, r, o, d;
584
+ var s, o, r, d;
585
585
  if (t === I)
586
586
  return t;
587
587
  let l = i !== void 0 ? (s = e._$Co) === null || s === void 0 ? void 0 : s[i] : e._$Cl;
588
588
  const a = z(t) ? void 0 : t._$litDirective$;
589
- return (l == null ? void 0 : l.constructor) !== a && ((r = l == null ? void 0 : l._$AO) === null || r === void 0 || r.call(l, !1), a === void 0 ? l = void 0 : (l = new a(n), l._$AT(n, e, i)), i !== void 0 ? ((o = (d = e)._$Co) !== null && o !== void 0 ? o : d._$Co = [])[i] = l : e._$Cl = l), l !== void 0 && (t = V(n, l._$AS(n, t.values), l, i)), t;
589
+ return (l == null ? void 0 : l.constructor) !== a && ((o = l == null ? void 0 : l._$AO) === null || o === void 0 || o.call(l, !1), a === void 0 ? l = void 0 : (l = new a(n), l._$AT(n, e, i)), i !== void 0 ? ((r = (d = e)._$Co) !== null && r !== void 0 ? r : d._$Co = [])[i] = l : e._$Cl = l), l !== void 0 && (t = V(n, l._$AS(n, t.values), l, i)), t;
590
590
  }
591
591
  class fe {
592
592
  constructor(t, e) {
@@ -600,17 +600,17 @@ class fe {
600
600
  }
601
601
  u(t) {
602
602
  var e;
603
- const { el: { content: i }, parts: s } = this._$AD, r = ((e = t == null ? void 0 : t.creationScope) !== null && e !== void 0 ? e : R).importNode(i, !0);
604
- U.currentNode = r;
605
- let o = U.nextNode(), d = 0, l = 0, a = s[0];
603
+ const { el: { content: i }, parts: s } = this._$AD, o = ((e = t == null ? void 0 : t.creationScope) !== null && e !== void 0 ? e : R).importNode(i, !0);
604
+ C.currentNode = o;
605
+ let r = C.nextNode(), d = 0, l = 0, a = s[0];
606
606
  for (; a !== void 0; ) {
607
607
  if (d === a.index) {
608
608
  let u;
609
- a.type === 2 ? u = new W(o, o.nextSibling, this, t) : a.type === 1 ? u = new a.ctor(o, a.name, a.strings, this, t) : a.type === 6 && (u = new be(o, this, t)), this._$AV.push(u), a = s[++l];
609
+ a.type === 2 ? u = new W(r, r.nextSibling, this, t) : a.type === 1 ? u = new a.ctor(r, a.name, a.strings, this, t) : a.type === 6 && (u = new be(r, this, t)), this._$AV.push(u), a = s[++l];
610
610
  }
611
- d !== (a == null ? void 0 : a.index) && (o = U.nextNode(), d++);
611
+ d !== (a == null ? void 0 : a.index) && (r = C.nextNode(), d++);
612
612
  }
613
- return U.currentNode = R, r;
613
+ return C.currentNode = R, o;
614
614
  }
615
615
  v(t) {
616
616
  let e = 0;
@@ -620,8 +620,8 @@ class fe {
620
620
  }
621
621
  class W {
622
622
  constructor(t, e, i, s) {
623
- var r;
624
- this.type = 2, this._$AH = _, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = i, this.options = s, this._$Cp = (r = s == null ? void 0 : s.isConnected) === null || r === void 0 || r;
623
+ var o;
624
+ this.type = 2, this._$AH = _, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = i, this.options = s, this._$Cp = (o = s == null ? void 0 : s.isConnected) === null || o === void 0 || o;
625
625
  }
626
626
  get _$AU() {
627
627
  var t, e;
@@ -652,12 +652,12 @@ class W {
652
652
  }
653
653
  g(t) {
654
654
  var e;
655
- const { values: i, _$litType$: s } = t, r = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = q.createElement(s.h, this.options)), s);
656
- if (((e = this._$AH) === null || e === void 0 ? void 0 : e._$AD) === r)
655
+ const { values: i, _$litType$: s } = t, o = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = q.createElement(s.h, this.options)), s);
656
+ if (((e = this._$AH) === null || e === void 0 ? void 0 : e._$AD) === o)
657
657
  this._$AH.v(i);
658
658
  else {
659
- const o = new fe(r, this), d = o.u(this.options);
660
- o.v(i), this.$(d), this._$AH = o;
659
+ const r = new fe(o, this), d = r.u(this.options);
660
+ r.v(i), this.$(d), this._$AH = r;
661
661
  }
662
662
  }
663
663
  _$AC(t) {
@@ -668,8 +668,8 @@ class W {
668
668
  Xt(this._$AH) || (this._$AH = [], this._$AR());
669
669
  const e = this._$AH;
670
670
  let i, s = 0;
671
- for (const r of t)
672
- s === e.length ? e.push(i = new W(this.k(B()), this.k(B()), this, this.options)) : i = e[s], i._$AI(r), s++;
671
+ for (const o of t)
672
+ s === e.length ? e.push(i = new W(this.k(B()), this.k(B()), this, this.options)) : i = e[s], i._$AI(o), s++;
673
673
  s < e.length && (this._$AR(i && i._$AB.nextSibling, s), e.length = s);
674
674
  }
675
675
  _$AR(t = this._$AA.nextSibling, e) {
@@ -685,8 +685,8 @@ class W {
685
685
  }
686
686
  }
687
687
  class tt {
688
- constructor(t, e, i, s, r) {
689
- this.type = 1, this._$AH = _, this._$AN = void 0, this.element = t, this.name = e, this._$AM = s, this.options = r, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = _;
688
+ constructor(t, e, i, s, o) {
689
+ this.type = 1, this._$AH = _, this._$AN = void 0, this.element = t, this.name = e, this._$AM = s, this.options = o, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = _;
690
690
  }
691
691
  get tagName() {
692
692
  return this.element.tagName;
@@ -695,17 +695,17 @@ class tt {
695
695
  return this._$AM._$AU;
696
696
  }
697
697
  _$AI(t, e = this, i, s) {
698
- const r = this.strings;
699
- let o = !1;
700
- if (r === void 0)
701
- t = V(this, t, e, 0), o = !z(t) || t !== this._$AH && t !== I, o && (this._$AH = t);
698
+ const o = this.strings;
699
+ let r = !1;
700
+ if (o === void 0)
701
+ t = V(this, t, e, 0), r = !z(t) || t !== this._$AH && t !== I, r && (this._$AH = t);
702
702
  else {
703
703
  const d = t;
704
704
  let l, a;
705
- for (t = r[0], l = 0; l < r.length - 1; l++)
706
- a = V(this, d[i + l], e, l), a === I && (a = this._$AH[l]), o || (o = !z(a) || a !== this._$AH[l]), a === _ ? t = _ : t !== _ && (t += (a ?? "") + r[l + 1]), this._$AH[l] = a;
705
+ for (t = o[0], l = 0; l < o.length - 1; l++)
706
+ a = V(this, d[i + l], e, l), a === I && (a = this._$AH[l]), r || (r = !z(a) || a !== this._$AH[l]), a === _ ? t = _ : t !== _ && (t += (a ?? "") + o[l + 1]), this._$AH[l] = a;
707
707
  }
708
- o && !s && this.j(t);
708
+ r && !s && this.j(t);
709
709
  }
710
710
  j(t) {
711
711
  t === _ ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
@@ -729,15 +729,15 @@ class Ee extends tt {
729
729
  }
730
730
  }
731
731
  class we extends tt {
732
- constructor(t, e, i, s, r) {
733
- super(t, e, i, s, r), this.type = 5;
732
+ constructor(t, e, i, s, o) {
733
+ super(t, e, i, s, o), this.type = 5;
734
734
  }
735
735
  _$AI(t, e = this) {
736
736
  var i;
737
737
  if ((t = (i = V(this, t, e, 0)) !== null && i !== void 0 ? i : _) === I)
738
738
  return;
739
- const s = this._$AH, r = t === _ && s !== _ || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, o = t !== _ && (s === _ || r);
740
- r && this.element.removeEventListener(this.name, this, s), o && this.element.addEventListener(this.name, this, t), this._$AH = t;
739
+ const s = this._$AH, o = t === _ && s !== _ || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, r = t !== _ && (s === _ || o);
740
+ o && this.element.removeEventListener(this.name, this, s), r && this.element.addEventListener(this.name, this, t), this._$AH = t;
741
741
  }
742
742
  handleEvent(t) {
743
743
  var e, i;
@@ -759,13 +759,13 @@ const Vt = X.litHtmlPolyfillSupport;
759
759
  Vt == null || Vt(q, W), ((rt = X.litHtmlVersions) !== null && rt !== void 0 ? rt : X.litHtmlVersions = []).push("2.7.4");
760
760
  const Se = (n, t, e) => {
761
761
  var i, s;
762
- const r = (i = e == null ? void 0 : e.renderBefore) !== null && i !== void 0 ? i : t;
763
- let o = r._$litPart$;
764
- if (o === void 0) {
762
+ const o = (i = e == null ? void 0 : e.renderBefore) !== null && i !== void 0 ? i : t;
763
+ let r = o._$litPart$;
764
+ if (r === void 0) {
765
765
  const d = (s = e == null ? void 0 : e.renderBefore) !== null && s !== void 0 ? s : null;
766
- r._$litPart$ = o = new W(t.insertBefore(B(), d), d, void 0, e ?? {});
766
+ o._$litPart$ = r = new W(t.insertBefore(B(), d), d, void 0, e ?? {});
767
767
  }
768
- return o._$AI(n), o;
768
+ return r._$AI(n), r;
769
769
  };
770
770
  /**
771
771
  * @license
@@ -773,7 +773,7 @@ const Se = (n, t, e) => {
773
773
  * SPDX-License-Identifier: BSD-3-Clause
774
774
  */
775
775
  var lt, at;
776
- class k extends T {
776
+ class L extends T {
777
777
  constructor() {
778
778
  super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
779
779
  }
@@ -798,9 +798,9 @@ class k extends T {
798
798
  return I;
799
799
  }
800
800
  }
801
- k.finalized = !0, k._$litElement$ = !0, (lt = globalThis.litElementHydrateSupport) === null || lt === void 0 || lt.call(globalThis, { LitElement: k });
802
- const Ot = globalThis.litElementPolyfillSupport;
803
- Ot == null || Ot({ LitElement: k });
801
+ L.finalized = !0, L._$litElement$ = !0, (lt = globalThis.litElementHydrateSupport) === null || lt === void 0 || lt.call(globalThis, { LitElement: L });
802
+ const kt = globalThis.litElementPolyfillSupport;
803
+ kt == null || kt({ LitElement: L });
804
804
  ((at = globalThis.litElementVersions) !== null && at !== void 0 ? at : globalThis.litElementVersions = []).push("3.3.2");
805
805
  function Pe(n, t, e) {
806
806
  function i(s) {
@@ -810,9 +810,9 @@ function Pe(n, t, e) {
810
810
  t.removeEventListener(n, i);
811
811
  };
812
812
  }
813
- class Ue {
813
+ class Ce {
814
814
  constructor(t, e) {
815
- this._events = [], this._cleanup = [], this._forwardElementRef = kt(), this.host = t, this._events = e, t.addController(this);
815
+ this._events = [], this._cleanup = [], this._forwardElementRef = Lt(), this.host = t, this._events = e, t.addController(this);
816
816
  }
817
817
  register() {
818
818
  return Dt(this._forwardElementRef);
@@ -830,17 +830,17 @@ class Ue {
830
830
  }), this._cleanup = [];
831
831
  }
832
832
  }
833
- const ht = "https://vouchfor.com", Ce = "https://d2rxhdlm2q91uk.cloudfront.net", Re = "https://d1ix11aj5kfygl.cloudfront.net", Te = "https://d157jlwnudd93d.cloudfront.net", xe = "https://bshyfw4h5a.execute-api.ap-southeast-2.amazonaws.com/dev", He = "https://gyzw7rpbq3.execute-api.ap-southeast-2.amazonaws.com/staging", Ne = "https://vfcjuim1l3.execute-api.ap-southeast-2.amazonaws.com/prod", Ie = "https://embed-dev.vouchfor.com/v2", Ve = "https://embed-staging.vouchfor.com/v2", Oe = "https://embed.vouchfor.com/v2", Me = "https://dev.vouchfor.com", Le = "https://staging.vouchfor.com", ke = "https://app.vouchfor.com";
833
+ const ht = "https://vouchfor.com", Ue = "https://d2rxhdlm2q91uk.cloudfront.net", Re = "https://d1ix11aj5kfygl.cloudfront.net", Te = "https://d157jlwnudd93d.cloudfront.net", xe = "https://bshyfw4h5a.execute-api.ap-southeast-2.amazonaws.com/dev", He = "https://gyzw7rpbq3.execute-api.ap-southeast-2.amazonaws.com/staging", Ne = "https://vfcjuim1l3.execute-api.ap-southeast-2.amazonaws.com/prod", Ie = "https://embed-dev.vouchfor.com/v2", Ve = "https://embed-staging.vouchfor.com/v2", ke = "https://embed.vouchfor.com/v2", Oe = "https://dev.vouchfor.com", Me = "https://staging.vouchfor.com", Le = "https://app.vouchfor.com";
834
834
  function Y(n) {
835
835
  if (!["dev", "staging", "prod"].includes(n))
836
836
  throw new Error(`Unknown environment: ${n}`);
837
837
  if (n === "dev")
838
838
  return {
839
839
  marketingUrl: ht,
840
- videoUrl: Ce,
840
+ videoUrl: Ue,
841
841
  publicApiUrl: xe,
842
842
  embedApiUrl: Ie,
843
- publicRecorderUrl: Me
843
+ publicRecorderUrl: Oe
844
844
  };
845
845
  if (n === "staging")
846
846
  return {
@@ -848,32 +848,56 @@ function Y(n) {
848
848
  videoUrl: Re,
849
849
  publicApiUrl: He,
850
850
  embedApiUrl: Ve,
851
- publicRecorderUrl: Le
851
+ publicRecorderUrl: Me
852
852
  };
853
853
  if (n === "prod")
854
854
  return {
855
855
  marketingUrl: ht,
856
856
  videoUrl: Te,
857
857
  publicApiUrl: Ne,
858
- embedApiUrl: Oe,
859
- publicRecorderUrl: ke
858
+ embedApiUrl: ke,
859
+ publicRecorderUrl: Le
860
860
  };
861
861
  }
862
862
  class De {
863
863
  constructor(t) {
864
- this._fetching = !1, this.host = t, new te(
864
+ this._fetching = !1, this.getVouch = async (e, i, s) => {
865
+ const { embedApiUrl: o } = Y(e), r = await fetch(`${o}/vouches/${s}`, {
866
+ method: "GET",
867
+ headers: [["X-Api-Key", i]]
868
+ }).then((d) => (this.host.dispatchEvent(new CustomEvent("vouch:loaded", { detail: s })), d.json()));
869
+ return fetch(`${o}/vouches/${s}`, {
870
+ method: "GET",
871
+ headers: [
872
+ ["X-Api-Key", i],
873
+ ["Cache-Control", "max-age=0"]
874
+ ]
875
+ }), r;
876
+ }, this.getTemplate = async (e, i, s) => {
877
+ const { embedApiUrl: o } = Y(e), r = await fetch(`${o}/templates/${s}`, {
878
+ method: "GET",
879
+ headers: [["X-Api-Key", i]]
880
+ }).then((d) => d.json());
881
+ return fetch(`${o}/templates/${s}`, {
882
+ method: "GET",
883
+ headers: [
884
+ ["X-Api-Key", i],
885
+ ["Cache-Control", "max-age=0"]
886
+ ]
887
+ }), r;
888
+ }, this.host = t, new te(
865
889
  this.host,
866
- async ([e, i, s, r, o]) => {
890
+ async ([e, i, s, o, r]) => {
867
891
  var d, l, a, u;
868
892
  try {
869
893
  if (t.vouch = void 0, t.template = void 0, s) {
870
894
  let h;
871
- o && (this.fetching = !0, h = await this.getTemplate(e, i, o)), t.vouch = s, t.template = h ?? ((l = (d = s == null ? void 0 : s.settings) == null ? void 0 : d.template) == null ? void 0 : l.instance);
872
- } else if (r) {
895
+ r && (this.fetching = !0, h = await this.getTemplate(e, i, r)), t.vouch = s, t.template = h ?? ((l = (d = s == null ? void 0 : s.settings) == null ? void 0 : d.template) == null ? void 0 : l.instance);
896
+ } else if (o) {
873
897
  this.fetching = !0;
874
898
  const [h, c] = await Promise.all([
875
- this.getVouch(e, i, r),
876
- o ? this.getTemplate(e, i, o) : null
899
+ this.getVouch(e, i, o),
900
+ r ? this.getTemplate(e, i, r) : null
877
901
  ]);
878
902
  t.vouch = h, t.template = c ?? ((u = (a = h == null ? void 0 : h.settings) == null ? void 0 : a.template) == null ? void 0 : u.instance);
879
903
  }
@@ -890,20 +914,6 @@ class De {
890
914
  get fetching() {
891
915
  return this._fetching;
892
916
  }
893
- async getVouch(t, e, i) {
894
- const { embedApiUrl: s } = Y(t);
895
- return fetch(`${s}/vouches/${i}`, {
896
- method: "GET",
897
- headers: [["X-Api-Key", e]]
898
- }).then((r) => r.json());
899
- }
900
- async getTemplate(t, e, i) {
901
- const { embedApiUrl: s } = Y(t);
902
- return fetch(`${s}/templates/${i}`, {
903
- method: "GET",
904
- headers: [["X-Api-Key", e]]
905
- }).then((r) => r.json());
906
- }
907
917
  }
908
918
  let Z;
909
919
  const je = new Uint8Array(16);
@@ -918,12 +928,12 @@ for (let n = 0; n < 256; ++n)
918
928
  function ze(n, t = 0) {
919
929
  return $[n[t + 0]] + $[n[t + 1]] + $[n[t + 2]] + $[n[t + 3]] + "-" + $[n[t + 4]] + $[n[t + 5]] + "-" + $[n[t + 6]] + $[n[t + 7]] + "-" + $[n[t + 8]] + $[n[t + 9]] + "-" + $[n[t + 10]] + $[n[t + 11]] + $[n[t + 12]] + $[n[t + 13]] + $[n[t + 14]] + $[n[t + 15]];
920
930
  }
921
- const qe = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Mt = {
931
+ const qe = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Ot = {
922
932
  randomUUID: qe
923
933
  };
924
- function L(n, t, e) {
925
- if (Mt.randomUUID && !t && !n)
926
- return Mt.randomUUID();
934
+ function M(n, t, e) {
935
+ if (Ot.randomUUID && !t && !n)
936
+ return Ot.randomUUID();
927
937
  n = n || {};
928
938
  const i = n.random || (n.rng || Be)();
929
939
  if (i[6] = i[6] & 15 | 64, i[8] = i[8] & 63 | 128, t) {
@@ -938,19 +948,19 @@ const We = 2e3;
938
948
  class Ze {
939
949
  constructor(t) {
940
950
  this._tabId = void 0, this._clientId = void 0, this._visitorId = void 0, this._hasPlayed = !1, this._hasLoaded = {}, this._answersViewed = {}, this._streamedTime = {}, this._streamedPrevTimestamp = {}, this._createVisitor = (e) => {
941
- var s, r;
951
+ var s, o;
942
952
  const { publicApiUrl: i } = Y(this.host.env);
943
- return (r = (s = window.localStorage) == null ? void 0 : s.setItem) == null || r.call(s, "vouch-uid-visitor", e), navigator.sendBeacon(`${i}/api/visitor`, JSON.stringify({ visitorId: e })), e;
953
+ return (o = (s = window.localStorage) == null ? void 0 : s.setItem) == null || o.call(s, "vouch-uid-visitor", e), navigator.sendBeacon(`${i}/api/visitor`, JSON.stringify({ visitorId: e })), e;
944
954
  }, this._getReportingMetadata = () => {
945
- var r, o;
946
- const [e, i] = ((o = (r = Intl.DateTimeFormat().resolvedOptions().timeZone) == null ? void 0 : r.split) == null ? void 0 : o.call(r, "/")) ?? [], s = {};
955
+ var o, r;
956
+ const [e, i] = ((r = (o = Intl.DateTimeFormat().resolvedOptions().timeZone) == null ? void 0 : o.split) == null ? void 0 : r.call(o, "/")) ?? [], s = {};
947
957
  return [...new URLSearchParams(location.search).entries()].forEach(([d, l]) => {
948
958
  if (/utm/.test(d)) {
949
959
  const a = d.toLowerCase().replace(/[-_][a-z0-9]/g, (u) => u.slice(-1).toUpperCase());
950
960
  s[a] = l;
951
961
  }
952
962
  }), {
953
- source: "media_player",
963
+ source: this.host.trackingSource,
954
964
  time: /* @__PURE__ */ new Date(),
955
965
  region: i,
956
966
  country: e,
@@ -961,15 +971,15 @@ class Ze {
961
971
  ...s
962
972
  };
963
973
  }, this._sendTrackingEvent = (e, i) => {
964
- const { publicApiUrl: s } = Y(this.host.env), { client: r, tab: o, request: d, visitor: l } = this._getUids();
974
+ const { publicApiUrl: s } = Y(this.host.env), { client: o, tab: r, request: d, visitor: l } = this._getUids();
965
975
  navigator.sendBeacon(
966
976
  `${s}/api/events`,
967
977
  JSON.stringify({
968
978
  event: e,
969
979
  payload: i,
970
980
  context: {
971
- "x-uid-client": r,
972
- "x-uid-tab": o,
981
+ "x-uid-client": o,
982
+ "x-uid-tab": r,
973
983
  "x-uid-request": d,
974
984
  "x-uid-visitor": l,
975
985
  "x-reporting-metadata": this._getReportingMetadata()
@@ -993,19 +1003,19 @@ class Ze {
993
1003
  answerId: e
994
1004
  }), this._answersViewed[e] = !0), this._streamedTime[e] = i.currentTime, this._streamedPrevTimestamp[e] = Date.now());
995
1005
  }, this._handleVideoTimeUpdate = ({ detail: { id: e, node: i } }) => {
996
- var o, d;
1006
+ var r, d;
997
1007
  const s = this._findVouchId();
998
1008
  if (!s)
999
1009
  return;
1000
- const r = Date.now();
1010
+ const o = Date.now();
1001
1011
  !this.host.paused && // Only fire the video seeked event when this video is the active one
1002
- e === ((d = (o = this.host.scene) == null ? void 0 : o.video) == null ? void 0 : d.id) && // Throttle the frequency that we send streamed events while playing
1003
- r - this._streamedPrevTimestamp[e] > We && (this._sendTrackingEvent("VIDEO_STREAMED", {
1012
+ e === ((d = (r = this.host.scene) == null ? void 0 : r.video) == null ? void 0 : d.id) && // Throttle the frequency that we send streamed events while playing
1013
+ o - this._streamedPrevTimestamp[e] > We && (this._sendTrackingEvent("VIDEO_STREAMED", {
1004
1014
  vouchId: s,
1005
1015
  answerId: e,
1006
1016
  streamStart: this._streamedTime[e],
1007
1017
  streamEnd: i.currentTime
1008
- }), this._streamedTime[e] = i.currentTime, this._streamedPrevTimestamp[e] = r);
1018
+ }), this._streamedTime[e] = i.currentTime, this._streamedPrevTimestamp[e] = o);
1009
1019
  }, this._handleVideoPause = ({ detail: { id: e, node: i } }) => {
1010
1020
  const s = this._findVouchId();
1011
1021
  s && (this._sendTrackingEvent("VIDEO_STREAMED", {
@@ -1021,15 +1031,15 @@ class Ze {
1021
1031
  return "uuid" in this.host.data ? this.host.data.uuid : this.host.data.id;
1022
1032
  }
1023
1033
  _getUids() {
1024
- var r, o, d, l, a, u, h, c, p, A, m, $t;
1034
+ var o, r, d, l, a, u, h, c, p, y, m, $t;
1025
1035
  if (typeof window > "u")
1026
1036
  return {
1027
1037
  client: null,
1028
1038
  tab: null,
1029
- request: L()
1039
+ request: M()
1030
1040
  };
1031
- const t = this._visitorId || ((o = (r = window.localStorage) == null ? void 0 : r.getItem) == null ? void 0 : o.call(r, "vouch-uid-visitor")) || this._createVisitor(L()), e = this._clientId || ((l = (d = window.localStorage) == null ? void 0 : d.getItem) == null ? void 0 : l.call(d, "vouch-uid-client")) || L(), i = this._tabId || ((u = (a = window.sessionStorage) == null ? void 0 : a.getItem) == null ? void 0 : u.call(a, "vouch-uid-tab")) || L(), s = L();
1032
- return t !== this._visitorId && (this._visitorId = t, (c = (h = window.localStorage) == null ? void 0 : h.setItem) == null || c.call(h, "vouch-uid-visitor", t)), e !== this._clientId && (this._clientId = e, (A = (p = window.localStorage) == null ? void 0 : p.setItem) == null || A.call(p, "vouch-uid-client", e)), i !== this._tabId && (this._tabId = i, ($t = (m = window.sessionStorage) == null ? void 0 : m.setItem) == null || $t.call(m, "vouch-uid-tab", i)), {
1041
+ const t = this._visitorId || ((r = (o = window.localStorage) == null ? void 0 : o.getItem) == null ? void 0 : r.call(o, "vouch-uid-visitor")) || this._createVisitor(M()), e = this._clientId || ((l = (d = window.localStorage) == null ? void 0 : d.getItem) == null ? void 0 : l.call(d, "vouch-uid-client")) || M(), i = this._tabId || ((u = (a = window.sessionStorage) == null ? void 0 : a.getItem) == null ? void 0 : u.call(a, "vouch-uid-tab")) || M(), s = M();
1042
+ return t !== this._visitorId && (this._visitorId = t, (c = (h = window.localStorage) == null ? void 0 : h.setItem) == null || c.call(h, "vouch-uid-visitor", t)), e !== this._clientId && (this._clientId = e, (y = (p = window.localStorage) == null ? void 0 : p.setItem) == null || y.call(p, "vouch-uid-client", e)), i !== this._tabId && (this._tabId = i, ($t = (m = window.sessionStorage) == null ? void 0 : m.setItem) == null || $t.call(m, "vouch-uid-tab", i)), {
1033
1043
  client: e,
1034
1044
  tab: i,
1035
1045
  request: s,
@@ -1048,13 +1058,13 @@ class Ze {
1048
1058
  }
1049
1059
  }
1050
1060
  var Fe = Object.defineProperty, Ke = Object.getOwnPropertyDescriptor, f = (n, t, e, i) => {
1051
- for (var s = i > 1 ? void 0 : i ? Ke(t, e) : t, r = n.length - 1, o; r >= 0; r--)
1052
- (o = n[r]) && (s = (i ? o(t, e, s) : o(s)) || s);
1061
+ for (var s = i > 1 ? void 0 : i ? Ke(t, e) : t, o = n.length - 1, r; o >= 0; o--)
1062
+ (r = n[o]) && (s = (i ? r(t, e, s) : r(s)) || s);
1053
1063
  return i && s && Fe(t, e, s), s;
1054
1064
  };
1055
- let g = class extends k {
1065
+ let g = class extends L {
1056
1066
  constructor() {
1057
- super(...arguments), this._mediaPlayerRef = kt(), this.env = "prod", this.apiKey = "", this.preload = "auto", this.autoplay = !1, this.aspectRatio = 0, this.eventController = new Ue(this, [
1067
+ super(...arguments), this._mediaPlayerRef = Lt(), this.env = "prod", this.apiKey = "", this.trackingSource = "embed", this.preload = "auto", this.autoplay = !1, this.aspectRatio = 0, this.eventController = new Ce(this, [
1058
1068
  "durationchange",
1059
1069
  "ended",
1060
1070
  "error",
@@ -1180,37 +1190,40 @@ let g = class extends k {
1180
1190
  }
1181
1191
  };
1182
1192
  f([
1183
- y({ type: Object, attribute: "data" })
1193
+ A({ type: Object, attribute: "data" })
1184
1194
  ], g.prototype, "data", 2);
1185
1195
  f([
1186
- y({ type: String })
1196
+ A({ type: String })
1187
1197
  ], g.prototype, "vouchId", 2);
1188
1198
  f([
1189
- y({ type: String })
1199
+ A({ type: String })
1190
1200
  ], g.prototype, "templateId", 2);
1191
1201
  f([
1192
- y({ type: String })
1202
+ A({ type: String })
1193
1203
  ], g.prototype, "env", 2);
1194
1204
  f([
1195
- y({ type: String })
1205
+ A({ type: String })
1196
1206
  ], g.prototype, "apiKey", 2);
1197
1207
  f([
1198
- y({ type: Array })
1208
+ A({ type: String })
1209
+ ], g.prototype, "trackingSource", 2);
1210
+ f([
1211
+ A({ type: Array })
1199
1212
  ], g.prototype, "controls", 2);
1200
1213
  f([
1201
- y({ type: String })
1214
+ A({ type: String })
1202
1215
  ], g.prototype, "preload", 2);
1203
1216
  f([
1204
- y({ type: Boolean })
1217
+ A({ type: Boolean })
1205
1218
  ], g.prototype, "autoplay", 2);
1206
1219
  f([
1207
- y({ type: Number })
1220
+ A({ type: Number })
1208
1221
  ], g.prototype, "aspectRatio", 2);
1209
1222
  f([
1210
- Lt()
1223
+ Mt()
1211
1224
  ], g.prototype, "vouch", 2);
1212
1225
  f([
1213
- Lt()
1226
+ Mt()
1214
1227
  ], g.prototype, "template", 2);
1215
1228
  g = f([
1216
1229
  Qt("vouch-embed")