@vouchfor/embeds 0.0.0-experiment.ae8c0d8 → 0.0.0-experiment.af1c4c8

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 (36) hide show
  1. package/dist/es/embeds.js +971 -1454
  2. package/dist/es/embeds.js.map +1 -1
  3. package/dist/es/src/components/DialogEmbed/DialogOverlay.d.ts +20 -0
  4. package/dist/es/src/components/DialogEmbed/DialogPortal.d.ts +36 -0
  5. package/dist/es/src/components/DialogEmbed/index.d.ts +38 -0
  6. package/dist/es/src/components/PlayerEmbed/controllers/event-forwarder.d.ts +15 -0
  7. package/dist/es/src/components/{Embed → PlayerEmbed}/controllers/fetcher.d.ts +4 -4
  8. package/dist/es/src/components/{Embed/controllers/tracking.d.ts → PlayerEmbed/controllers/tracking/index.d.ts} +14 -11
  9. package/dist/es/src/components/PlayerEmbed/controllers/tracking/utils.d.ts +17 -0
  10. package/dist/es/src/components/PlayerEmbed/index.d.ts +75 -0
  11. package/dist/es/src/components/PlayerEmbed/tests/data.d.ts +4 -0
  12. package/dist/es/src/components/PlayerEmbed/tests/media-data.d.ts +19 -0
  13. package/dist/es/src/index.d.ts +2 -1
  14. package/dist/iife/dialog-embed/embed.iife.js +4042 -0
  15. package/dist/iife/dialog-embed/embed.iife.js.map +1 -0
  16. package/dist/iife/embeds.iife.js +2874 -392
  17. package/dist/iife/embeds.iife.js.map +1 -1
  18. package/dist/iife/player-embed/embed.iife.js +3904 -0
  19. package/dist/iife/player-embed/embed.iife.js.map +1 -0
  20. package/package.json +44 -31
  21. package/src/components/DialogEmbed/Dialog.stories.ts +91 -0
  22. package/src/components/DialogEmbed/DialogOverlay.ts +131 -0
  23. package/src/components/DialogEmbed/DialogPortal.ts +126 -0
  24. package/src/components/DialogEmbed/index.ts +97 -0
  25. package/src/components/PlayerEmbed/MultiEmbed.stories.ts +135 -0
  26. package/src/components/{Embed/Embed.stories.ts → PlayerEmbed/PlayerEmbed.stories.ts} +30 -16
  27. package/src/components/{Embed → PlayerEmbed}/controllers/event-forwarder.ts +6 -5
  28. package/src/components/{Embed → PlayerEmbed}/controllers/fetcher.ts +11 -11
  29. package/src/components/{Embed/controllers/tracking.ts → PlayerEmbed/controllers/tracking/index.ts} +53 -121
  30. package/src/components/PlayerEmbed/controllers/tracking/utils.ts +95 -0
  31. package/src/components/{Embed → PlayerEmbed}/index.ts +84 -39
  32. package/src/components/PlayerEmbed/tests/PlayerEmbed.spec.ts +87 -0
  33. package/src/components/PlayerEmbed/tests/data.ts +227 -0
  34. package/src/components/PlayerEmbed/tests/media-data.ts +22 -0
  35. package/src/index.ts +2 -1
  36. package/dist/es/src/components/Embed/index.d.ts +0 -70
package/dist/es/embeds.js CHANGED
@@ -1,1257 +1,226 @@
1
- import { property as y, state as Wt, customElement as de } from "lit/decorators.js";
2
- import { ifDefined as gt } from "lit/directives/if-defined.js";
3
- import { createRef as qt, ref as Xt } from "lit/directives/ref.js";
4
- import { Task as yt } from "@lit/task";
5
- import { v4 as P } from "uuid";
1
+ import { css, LitElement, html } from "lit";
2
+ import { property, state, customElement } from "lit/decorators.js";
3
+ import { ifDefined } from "lit/directives/if-defined.js";
4
+ import { createRef, ref } from "lit/directives/ref.js";
5
+ import { Task } from "@lit/task";
6
+ import { v4 } from "uuid";
7
+ import { TEMPLATE_VERSION } from "@vouchfor/canvas-video";
6
8
  import "@vouchfor/media-player";
7
- /**
8
- * @license
9
- * Copyright 2019 Google LLC
10
- * SPDX-License-Identifier: BSD-3-Clause
11
- */
12
- const G = globalThis, _t = G.ShadowRoot && (G.ShadyCSS === void 0 || G.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Jt = Symbol(), vt = /* @__PURE__ */ new WeakMap();
13
- let ce = class {
14
- constructor(t, e, i) {
15
- if (this._$cssResult$ = !0, i !== Jt)
16
- throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
17
- this.cssText = t, this.t = e;
18
- }
19
- get styleSheet() {
20
- let t = this.o;
21
- const e = this.t;
22
- if (_t && t === void 0) {
23
- const i = e !== void 0 && e.length === 1;
24
- i && (t = vt.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && vt.set(e, t));
25
- }
26
- return t;
27
- }
28
- toString() {
29
- return this.cssText;
30
- }
31
- };
32
- const pe = (r) => new ce(typeof r == "string" ? r : r + "", void 0, Jt), ue = (r, t) => {
33
- if (_t)
34
- r.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
35
- else
36
- for (const e of t) {
37
- const i = document.createElement("style"), s = G.litNonce;
38
- s !== void 0 && i.setAttribute("nonce", s), i.textContent = e.cssText, r.appendChild(i);
39
- }
40
- }, At = _t ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
41
- let e = "";
42
- for (const i of t.cssRules)
43
- e += i.cssText;
44
- return pe(e);
45
- })(r) : r;
46
- /**
47
- * @license
48
- * Copyright 2017 Google LLC
49
- * SPDX-License-Identifier: BSD-3-Clause
50
- */
51
- const { is: _e, defineProperty: me, getOwnPropertyDescriptor: $e, getOwnPropertyNames: fe, getOwnPropertySymbols: ge, getPrototypeOf: ye } = Object, b = globalThis, bt = b.trustedTypes, ve = bt ? bt.emptyScript : "", rt = b.reactiveElementPolyfillSupport, I = (r, t) => r, ct = { toAttribute(r, t) {
52
- switch (t) {
53
- case Boolean:
54
- r = r ? ve : null;
55
- break;
56
- case Object:
57
- case Array:
58
- r = r == null ? r : JSON.stringify(r);
59
- }
60
- return r;
61
- }, fromAttribute(r, t) {
62
- let e = r;
63
- switch (t) {
64
- case Boolean:
65
- e = r !== null;
66
- break;
67
- case Number:
68
- e = r === null ? null : Number(r);
69
- break;
70
- case Object:
71
- case Array:
72
- try {
73
- e = JSON.parse(r);
74
- } catch {
75
- e = null;
76
- }
77
- }
78
- return e;
79
- } }, Kt = (r, t) => !_e(r, t), Et = { attribute: !0, type: String, converter: ct, reflect: !1, hasChanged: Kt };
80
- Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), b.litPropertyMetadata ?? (b.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
81
- let N = class extends HTMLElement {
82
- static addInitializer(t) {
83
- this._$Ei(), (this.l ?? (this.l = [])).push(t);
84
- }
85
- static get observedAttributes() {
86
- return this.finalize(), this._$Eh && [...this._$Eh.keys()];
87
- }
88
- static createProperty(t, e = Et) {
89
- if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) {
90
- const i = Symbol(), s = this.getPropertyDescriptor(t, i, e);
91
- s !== void 0 && me(this.prototype, t, s);
92
- }
93
- }
94
- static getPropertyDescriptor(t, e, i) {
95
- const { get: s, set: n } = $e(this.prototype, t) ?? { get() {
96
- return this[e];
97
- }, set(o) {
98
- this[e] = o;
99
- } };
100
- return { get() {
101
- return s == null ? void 0 : s.call(this);
102
- }, set(o) {
103
- const h = s == null ? void 0 : s.call(this);
104
- n.call(this, o), this.requestUpdate(t, h, i);
105
- }, configurable: !0, enumerable: !0 };
106
- }
107
- static getPropertyOptions(t) {
108
- return this.elementProperties.get(t) ?? Et;
109
- }
110
- static _$Ei() {
111
- if (this.hasOwnProperty(I("elementProperties")))
112
- return;
113
- const t = ye(this);
114
- t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
115
- }
116
- static finalize() {
117
- if (this.hasOwnProperty(I("finalized")))
118
- return;
119
- if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(I("properties"))) {
120
- const e = this.properties, i = [...fe(e), ...ge(e)];
121
- for (const s of i)
122
- this.createProperty(s, e[s]);
123
- }
124
- const t = this[Symbol.metadata];
125
- if (t !== null) {
126
- const e = litPropertyMetadata.get(t);
127
- if (e !== void 0)
128
- for (const [i, s] of e)
129
- this.elementProperties.set(i, s);
130
- }
131
- this._$Eh = /* @__PURE__ */ new Map();
132
- for (const [e, i] of this.elementProperties) {
133
- const s = this._$Eu(e, i);
134
- s !== void 0 && this._$Eh.set(s, e);
135
- }
136
- this.elementStyles = this.finalizeStyles(this.styles);
137
- }
138
- static finalizeStyles(t) {
139
- const e = [];
140
- if (Array.isArray(t)) {
141
- const i = new Set(t.flat(1 / 0).reverse());
142
- for (const s of i)
143
- e.unshift(At(s));
144
- } else
145
- t !== void 0 && e.push(At(t));
146
- return e;
147
- }
148
- static _$Eu(t, e) {
149
- const i = e.attribute;
150
- return i === !1 ? void 0 : typeof i == "string" ? i : typeof t == "string" ? t.toLowerCase() : void 0;
151
- }
152
- constructor() {
153
- super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
154
- }
155
- _$Ev() {
156
- var t;
157
- this._$Eg = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$ES(), this.requestUpdate(), (t = this.constructor.l) == null || t.forEach((e) => e(this));
158
- }
159
- addController(t) {
160
- var e;
161
- (this._$E_ ?? (this._$E_ = /* @__PURE__ */ new Set())).add(t), this.renderRoot !== void 0 && this.isConnected && ((e = t.hostConnected) == null || e.call(t));
162
- }
163
- removeController(t) {
164
- var e;
165
- (e = this._$E_) == null || e.delete(t);
166
- }
167
- _$ES() {
168
- const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties;
169
- for (const i of e.keys())
170
- this.hasOwnProperty(i) && (t.set(i, this[i]), delete this[i]);
171
- t.size > 0 && (this._$Ep = t);
172
- }
173
- createRenderRoot() {
174
- const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
175
- return ue(t, this.constructor.elementStyles), t;
176
- }
177
- connectedCallback() {
178
- var t;
179
- this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$E_) == null || t.forEach((e) => {
180
- var i;
181
- return (i = e.hostConnected) == null ? void 0 : i.call(e);
182
- });
183
- }
184
- enableUpdating(t) {
185
- }
186
- disconnectedCallback() {
187
- var t;
188
- (t = this._$E_) == null || t.forEach((e) => {
189
- var i;
190
- return (i = e.hostDisconnected) == null ? void 0 : i.call(e);
191
- });
192
- }
193
- attributeChangedCallback(t, e, i) {
194
- this._$AK(t, i);
195
- }
196
- _$EO(t, e) {
197
- var n;
198
- const i = this.constructor.elementProperties.get(t), s = this.constructor._$Eu(t, i);
199
- if (s !== void 0 && i.reflect === !0) {
200
- const o = (((n = i.converter) == null ? void 0 : n.toAttribute) !== void 0 ? i.converter : ct).toAttribute(e, i.type);
201
- this._$Em = t, o == null ? this.removeAttribute(s) : this.setAttribute(s, o), this._$Em = null;
202
- }
203
- }
204
- _$AK(t, e) {
205
- var n;
206
- const i = this.constructor, s = i._$Eh.get(t);
207
- if (s !== void 0 && this._$Em !== s) {
208
- const o = i.getPropertyOptions(s), h = typeof o.converter == "function" ? { fromAttribute: o.converter } : ((n = o.converter) == null ? void 0 : n.fromAttribute) !== void 0 ? o.converter : ct;
209
- this._$Em = s, this[s] = h.fromAttribute(e, o.type), this._$Em = null;
210
- }
211
- }
212
- requestUpdate(t, e, i, s = !1, n) {
213
- if (t !== void 0) {
214
- if (i ?? (i = this.constructor.getPropertyOptions(t)), !(i.hasChanged ?? Kt)(s ? n : this[t], e))
215
- return;
216
- this.C(t, e, i);
217
- }
218
- this.isUpdatePending === !1 && (this._$Eg = this._$EP());
219
- }
220
- C(t, e, i) {
221
- this._$AL.has(t) || this._$AL.set(t, e), i.reflect === !0 && this._$Em !== t && (this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Set())).add(t);
222
- }
223
- async _$EP() {
224
- this.isUpdatePending = !0;
225
- try {
226
- await this._$Eg;
227
- } catch (e) {
228
- Promise.reject(e);
229
- }
230
- const t = this.scheduleUpdate();
231
- return t != null && await t, !this.isUpdatePending;
232
- }
233
- scheduleUpdate() {
234
- return this.performUpdate();
235
- }
236
- performUpdate() {
237
- var i;
238
- if (!this.isUpdatePending)
239
- return;
240
- if (!this.hasUpdated) {
241
- if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
242
- for (const [n, o] of this._$Ep)
243
- this[n] = o;
244
- this._$Ep = void 0;
245
- }
246
- const s = this.constructor.elementProperties;
247
- if (s.size > 0)
248
- for (const [n, o] of s)
249
- o.wrapped !== !0 || this._$AL.has(n) || this[n] === void 0 || this.C(n, this[n], o);
250
- }
251
- let t = !1;
252
- const e = this._$AL;
253
- try {
254
- t = this.shouldUpdate(e), t ? (this.willUpdate(e), (i = this._$E_) == null || i.forEach((s) => {
255
- var n;
256
- return (n = s.hostUpdate) == null ? void 0 : n.call(s);
257
- }), this.update(e)) : this._$ET();
258
- } catch (s) {
259
- throw t = !1, this._$ET(), s;
260
- }
261
- t && this._$AE(e);
262
- }
263
- willUpdate(t) {
264
- }
265
- _$AE(t) {
266
- var e;
267
- (e = this._$E_) == null || e.forEach((i) => {
268
- var s;
269
- return (s = i.hostUpdated) == null ? void 0 : s.call(i);
270
- }), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
271
- }
272
- _$ET() {
273
- this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
274
- }
275
- get updateComplete() {
276
- return this.getUpdateComplete();
277
- }
278
- getUpdateComplete() {
279
- return this._$Eg;
280
- }
281
- shouldUpdate(t) {
282
- return !0;
283
- }
284
- update(t) {
285
- this._$Ej && (this._$Ej = this._$Ej.forEach((e) => this._$EO(e, this[e]))), this._$ET();
286
- }
287
- updated(t) {
288
- }
289
- firstUpdated(t) {
290
- }
291
- };
292
- N.elementStyles = [], N.shadowRootOptions = { mode: "open" }, N[I("elementProperties")] = /* @__PURE__ */ new Map(), N[I("finalized")] = /* @__PURE__ */ new Map(), rt == null || rt({ ReactiveElement: N }), (b.reactiveElementVersions ?? (b.reactiveElementVersions = [])).push("2.0.2");
293
- /**
294
- * @license
295
- * Copyright 2017 Google LLC
296
- * SPDX-License-Identifier: BSD-3-Clause
297
- */
298
- const V = globalThis, Y = V.trustedTypes, St = Y ? Y.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, Ft = "$lit$", v = `lit$${(Math.random() + "").slice(9)}$`, Gt = "?" + v, Ae = `<${Gt}>`, T = document, Q = () => T.createComment(""), B = (r) => r === null || typeof r != "object" && typeof r != "function", Zt = Array.isArray, be = (r) => Zt(r) || typeof (r == null ? void 0 : r[Symbol.iterator]) == "function", nt = `[
299
- \f\r]`, L = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, wt = /-->/g, Pt = />/g, S = RegExp(`>|${nt}(?:([^\\s"'>=/]+)(${nt}*=${nt}*(?:[^
300
- \f\r"'\`<>=]|("|')|))|$)`, "g"), Ct = /'/g, Ut = /"/g, Yt = /^(?:script|style|textarea|title)$/i, W = Symbol.for("lit-noChange"), _ = Symbol.for("lit-nothing"), Tt = /* @__PURE__ */ new WeakMap(), C = T.createTreeWalker(T, 129);
301
- function Qt(r, t) {
302
- if (!Array.isArray(r) || !r.hasOwnProperty("raw"))
303
- throw Error("invalid template strings array");
304
- return St !== void 0 ? St.createHTML(t) : t;
305
- }
306
- const Ee = (r, t) => {
307
- const e = r.length - 1, i = [];
308
- let s, n = t === 2 ? "<svg>" : "", o = L;
309
- for (let h = 0; h < e; h++) {
310
- const a = r[h];
311
- let d, c, l = -1, p = 0;
312
- for (; p < a.length && (o.lastIndex = p, c = o.exec(a), c !== null); )
313
- p = o.lastIndex, o === L ? c[1] === "!--" ? o = wt : c[1] !== void 0 ? o = Pt : c[2] !== void 0 ? (Yt.test(c[2]) && (s = RegExp("</" + c[2], "g")), o = S) : c[3] !== void 0 && (o = S) : o === S ? c[0] === ">" ? (o = s ?? L, l = -1) : c[1] === void 0 ? l = -2 : (l = o.lastIndex - c[2].length, d = c[1], o = c[3] === void 0 ? S : c[3] === '"' ? Ut : Ct) : o === Ut || o === Ct ? o = S : o === wt || o === Pt ? o = L : (o = S, s = void 0);
314
- const u = o === S && r[h + 1].startsWith("/>") ? " " : "";
315
- n += o === L ? a + Ae : l >= 0 ? (i.push(d), a.slice(0, l) + Ft + a.slice(l) + v + u) : a + v + (l === -2 ? h : u);
316
- }
317
- return [Qt(r, n + (r[e] || "<?>") + (t === 2 ? "</svg>" : "")), i];
318
- };
319
- let pt = class te {
320
- constructor({ strings: t, _$litType$: e }, i) {
321
- let s;
322
- this.parts = [];
323
- let n = 0, o = 0;
324
- const h = t.length - 1, a = this.parts, [d, c] = Ee(t, e);
325
- if (this.el = te.createElement(d, i), C.currentNode = this.el.content, e === 2) {
326
- const l = this.el.content.firstChild;
327
- l.replaceWith(...l.childNodes);
328
- }
329
- for (; (s = C.nextNode()) !== null && a.length < h; ) {
330
- if (s.nodeType === 1) {
331
- if (s.hasAttributes())
332
- for (const l of s.getAttributeNames())
333
- if (l.endsWith(Ft)) {
334
- const p = c[o++], u = s.getAttribute(l).split(v), g = /([.?@])?(.*)/.exec(p);
335
- a.push({ type: 1, index: n, name: g[2], strings: u, ctor: g[1] === "." ? we : g[1] === "?" ? Pe : g[1] === "@" ? Ce : it }), s.removeAttribute(l);
336
- } else
337
- l.startsWith(v) && (a.push({ type: 6, index: n }), s.removeAttribute(l));
338
- if (Yt.test(s.tagName)) {
339
- const l = s.textContent.split(v), p = l.length - 1;
340
- if (p > 0) {
341
- s.textContent = Y ? Y.emptyScript : "";
342
- for (let u = 0; u < p; u++)
343
- s.append(l[u], Q()), C.nextNode(), a.push({ type: 2, index: ++n });
344
- s.append(l[p], Q());
345
- }
346
- }
347
- } else if (s.nodeType === 8)
348
- if (s.data === Gt)
349
- a.push({ type: 2, index: n });
350
- else {
351
- let l = -1;
352
- for (; (l = s.data.indexOf(v, l + 1)) !== -1; )
353
- a.push({ type: 7, index: n }), l += v.length - 1;
354
- }
355
- n++;
356
- }
357
- }
358
- static createElement(t, e) {
359
- const i = T.createElement("template");
360
- return i.innerHTML = t, i;
361
- }
362
- };
363
- function H(r, t, e = r, i) {
364
- var o, h;
365
- if (t === W)
366
- return t;
367
- let s = i !== void 0 ? (o = e._$Co) == null ? void 0 : o[i] : e._$Cl;
368
- const n = B(t) ? void 0 : t._$litDirective$;
369
- return (s == null ? void 0 : s.constructor) !== n && ((h = s == null ? void 0 : s._$AO) == null || h.call(s, !1), n === void 0 ? s = void 0 : (s = new n(r), s._$AT(r, e, i)), i !== void 0 ? (e._$Co ?? (e._$Co = []))[i] = s : e._$Cl = s), s !== void 0 && (t = H(r, s._$AS(r, t.values), s, i)), t;
370
- }
371
- let Se = class {
372
- constructor(t, e) {
373
- this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
374
- }
375
- get parentNode() {
376
- return this._$AM.parentNode;
377
- }
378
- get _$AU() {
379
- return this._$AM._$AU;
380
- }
381
- u(t) {
382
- const { el: { content: e }, parts: i } = this._$AD, s = ((t == null ? void 0 : t.creationScope) ?? T).importNode(e, !0);
383
- C.currentNode = s;
384
- let n = C.nextNode(), o = 0, h = 0, a = i[0];
385
- for (; a !== void 0; ) {
386
- if (o === a.index) {
387
- let d;
388
- a.type === 2 ? d = new ee(n, n.nextSibling, this, t) : a.type === 1 ? d = new a.ctor(n, a.name, a.strings, this, t) : a.type === 6 && (d = new Ue(n, this, t)), this._$AV.push(d), a = i[++h];
389
- }
390
- o !== (a == null ? void 0 : a.index) && (n = C.nextNode(), o++);
391
- }
392
- return C.currentNode = T, s;
393
- }
394
- p(t) {
395
- let e = 0;
396
- for (const i of this._$AV)
397
- i !== void 0 && (i.strings !== void 0 ? (i._$AI(t, i, e), e += i.strings.length - 2) : i._$AI(t[e])), e++;
398
- }
399
- }, ee = class ie {
400
- get _$AU() {
401
- var t;
402
- return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
403
- }
404
- constructor(t, e, i, s) {
405
- this.type = 2, this._$AH = _, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = i, this.options = s, this._$Cv = (s == null ? void 0 : s.isConnected) ?? !0;
406
- }
407
- get parentNode() {
408
- let t = this._$AA.parentNode;
409
- const e = this._$AM;
410
- return e !== void 0 && (t == null ? void 0 : t.nodeType) === 11 && (t = e.parentNode), t;
411
- }
412
- get startNode() {
413
- return this._$AA;
414
- }
415
- get endNode() {
416
- return this._$AB;
417
- }
418
- _$AI(t, e = this) {
419
- t = H(this, t, e), B(t) ? t === _ || t == null || t === "" ? (this._$AH !== _ && this._$AR(), this._$AH = _) : t !== this._$AH && t !== W && this._(t) : t._$litType$ !== void 0 ? this.g(t) : t.nodeType !== void 0 ? this.$(t) : be(t) ? this.T(t) : this._(t);
420
- }
421
- k(t) {
422
- return this._$AA.parentNode.insertBefore(t, this._$AB);
423
- }
424
- $(t) {
425
- this._$AH !== t && (this._$AR(), this._$AH = this.k(t));
426
- }
427
- _(t) {
428
- this._$AH !== _ && B(this._$AH) ? this._$AA.nextSibling.data = t : this.$(T.createTextNode(t)), this._$AH = t;
429
- }
430
- g(t) {
431
- var n;
432
- const { values: e, _$litType$: i } = t, s = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = pt.createElement(Qt(i.h, i.h[0]), this.options)), i);
433
- if (((n = this._$AH) == null ? void 0 : n._$AD) === s)
434
- this._$AH.p(e);
435
- else {
436
- const o = new Se(s, this), h = o.u(this.options);
437
- o.p(e), this.$(h), this._$AH = o;
438
- }
439
- }
440
- _$AC(t) {
441
- let e = Tt.get(t.strings);
442
- return e === void 0 && Tt.set(t.strings, e = new pt(t)), e;
443
- }
444
- T(t) {
445
- Zt(this._$AH) || (this._$AH = [], this._$AR());
446
- const e = this._$AH;
447
- let i, s = 0;
448
- for (const n of t)
449
- s === e.length ? e.push(i = new ie(this.k(Q()), this.k(Q()), this, this.options)) : i = e[s], i._$AI(n), s++;
450
- s < e.length && (this._$AR(i && i._$AB.nextSibling, s), e.length = s);
451
- }
452
- _$AR(t = this._$AA.nextSibling, e) {
453
- var i;
454
- for ((i = this._$AP) == null ? void 0 : i.call(this, !1, !0, e); t && t !== this._$AB; ) {
455
- const s = t.nextSibling;
456
- t.remove(), t = s;
457
- }
458
- }
459
- setConnected(t) {
460
- var e;
461
- this._$AM === void 0 && (this._$Cv = t, (e = this._$AP) == null || e.call(this, t));
462
- }
463
- }, it = class {
464
- get tagName() {
465
- return this.element.tagName;
466
- }
467
- get _$AU() {
468
- return this._$AM._$AU;
469
- }
470
- constructor(t, e, i, s, n) {
471
- this.type = 1, this._$AH = _, this._$AN = void 0, this.element = t, this.name = e, this._$AM = s, this.options = n, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = _;
472
- }
473
- _$AI(t, e = this, i, s) {
474
- const n = this.strings;
475
- let o = !1;
476
- if (n === void 0)
477
- t = H(this, t, e, 0), o = !B(t) || t !== this._$AH && t !== W, o && (this._$AH = t);
478
- else {
479
- const h = t;
480
- let a, d;
481
- for (t = n[0], a = 0; a < n.length - 1; a++)
482
- d = H(this, h[i + a], e, a), d === W && (d = this._$AH[a]), o || (o = !B(d) || d !== this._$AH[a]), d === _ ? t = _ : t !== _ && (t += (d ?? "") + n[a + 1]), this._$AH[a] = d;
483
- }
484
- o && !s && this.O(t);
485
- }
486
- O(t) {
487
- t === _ ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
488
- }
489
- }, we = class extends it {
490
- constructor() {
491
- super(...arguments), this.type = 3;
492
- }
493
- O(t) {
494
- this.element[this.name] = t === _ ? void 0 : t;
495
- }
496
- }, Pe = class extends it {
497
- constructor() {
498
- super(...arguments), this.type = 4;
499
- }
500
- O(t) {
501
- this.element.toggleAttribute(this.name, !!t && t !== _);
502
- }
503
- }, Ce = class extends it {
504
- constructor(t, e, i, s, n) {
505
- super(t, e, i, s, n), this.type = 5;
506
- }
507
- _$AI(t, e = this) {
508
- if ((t = H(this, t, e, 0) ?? _) === W)
509
- return;
510
- const i = this._$AH, s = t === _ && i !== _ || t.capture !== i.capture || t.once !== i.once || t.passive !== i.passive, n = t !== _ && (i === _ || s);
511
- s && this.element.removeEventListener(this.name, this, i), n && this.element.addEventListener(this.name, this, t), this._$AH = t;
512
- }
513
- handleEvent(t) {
514
- var e;
515
- typeof this._$AH == "function" ? this._$AH.call(((e = this.options) == null ? void 0 : e.host) ?? this.element, t) : this._$AH.handleEvent(t);
516
- }
517
- }, Ue = class {
518
- constructor(t, e, i) {
519
- this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = i;
520
- }
521
- get _$AU() {
522
- return this._$AM._$AU;
523
- }
524
- _$AI(t) {
525
- H(this, t);
526
- }
527
- };
528
- const ot = V.litHtmlPolyfillSupport;
529
- ot == null || ot(pt, ee), (V.litHtmlVersions ?? (V.litHtmlVersions = [])).push("3.1.0");
530
- /**
531
- * @license
532
- * Copyright 2019 Google LLC
533
- * SPDX-License-Identifier: BSD-3-Clause
534
- */
535
- const Z = globalThis, mt = Z.ShadowRoot && (Z.ShadyCSS === void 0 || Z.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, $t = Symbol(), xt = /* @__PURE__ */ new WeakMap();
536
- let se = class {
537
- constructor(t, e, i) {
538
- if (this._$cssResult$ = !0, i !== $t)
539
- throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
540
- this.cssText = t, this.t = e;
541
- }
542
- get styleSheet() {
543
- let t = this.o;
544
- const e = this.t;
545
- if (mt && t === void 0) {
546
- const i = e !== void 0 && e.length === 1;
547
- i && (t = xt.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && xt.set(e, t));
548
- }
549
- return t;
550
- }
551
- toString() {
552
- return this.cssText;
553
- }
554
- };
555
- const Te = (r) => new se(typeof r == "string" ? r : r + "", void 0, $t), xe = (r, ...t) => {
556
- const e = r.length === 1 ? r[0] : t.reduce((i, s, n) => i + ((o) => {
557
- if (o._$cssResult$ === !0)
558
- return o.cssText;
559
- if (typeof o == "number")
560
- return o;
561
- throw Error("Value passed to 'css' function must be a 'css' function result: " + o + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
562
- })(s) + r[n + 1], r[0]);
563
- return new se(e, r, $t);
564
- }, Re = (r, t) => {
565
- if (mt)
566
- r.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
567
- else
568
- for (const e of t) {
569
- const i = document.createElement("style"), s = Z.litNonce;
570
- s !== void 0 && i.setAttribute("nonce", s), i.textContent = e.cssText, r.appendChild(i);
571
- }
572
- }, Rt = mt ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
573
- let e = "";
574
- for (const i of t.cssRules)
575
- e += i.cssText;
576
- return Te(e);
577
- })(r) : r;
578
- /**
579
- * @license
580
- * Copyright 2017 Google LLC
581
- * SPDX-License-Identifier: BSD-3-Clause
582
- */
583
- const { is: He, defineProperty: ke, getOwnPropertyDescriptor: Oe, getOwnPropertyNames: Ne, getOwnPropertySymbols: Le, getPrototypeOf: Me } = Object, E = globalThis, Ht = E.trustedTypes, Ie = Ht ? Ht.emptyScript : "", at = E.reactiveElementPolyfillSupport, D = (r, t) => r, ut = { toAttribute(r, t) {
584
- switch (t) {
585
- case Boolean:
586
- r = r ? Ie : null;
587
- break;
588
- case Object:
589
- case Array:
590
- r = r == null ? r : JSON.stringify(r);
591
- }
592
- return r;
593
- }, fromAttribute(r, t) {
594
- let e = r;
595
- switch (t) {
596
- case Boolean:
597
- e = r !== null;
598
- break;
599
- case Number:
600
- e = r === null ? null : Number(r);
601
- break;
602
- case Object:
603
- case Array:
604
- try {
605
- e = JSON.parse(r);
606
- } catch {
607
- e = null;
608
- }
609
- }
610
- return e;
611
- } }, re = (r, t) => !He(r, t), kt = { attribute: !0, type: String, converter: ut, reflect: !1, hasChanged: re };
612
- Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), E.litPropertyMetadata ?? (E.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
613
- class R extends HTMLElement {
614
- static addInitializer(t) {
615
- this._$Ei(), (this.l ?? (this.l = [])).push(t);
616
- }
617
- static get observedAttributes() {
618
- return this.finalize(), this._$Eh && [...this._$Eh.keys()];
619
- }
620
- static createProperty(t, e = kt) {
621
- if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) {
622
- const i = Symbol(), s = this.getPropertyDescriptor(t, i, e);
623
- s !== void 0 && ke(this.prototype, t, s);
624
- }
625
- }
626
- static getPropertyDescriptor(t, e, i) {
627
- const { get: s, set: n } = Oe(this.prototype, t) ?? { get() {
628
- return this[e];
629
- }, set(o) {
630
- this[e] = o;
631
- } };
632
- return { get() {
633
- return s == null ? void 0 : s.call(this);
634
- }, set(o) {
635
- const h = s == null ? void 0 : s.call(this);
636
- n.call(this, o), this.requestUpdate(t, h, i);
637
- }, configurable: !0, enumerable: !0 };
638
- }
639
- static getPropertyOptions(t) {
640
- return this.elementProperties.get(t) ?? kt;
641
- }
642
- static _$Ei() {
643
- if (this.hasOwnProperty(D("elementProperties")))
644
- return;
645
- const t = Me(this);
646
- t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
647
- }
648
- static finalize() {
649
- if (this.hasOwnProperty(D("finalized")))
650
- return;
651
- if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(D("properties"))) {
652
- const e = this.properties, i = [...Ne(e), ...Le(e)];
653
- for (const s of i)
654
- this.createProperty(s, e[s]);
655
- }
656
- const t = this[Symbol.metadata];
657
- if (t !== null) {
658
- const e = litPropertyMetadata.get(t);
659
- if (e !== void 0)
660
- for (const [i, s] of e)
661
- this.elementProperties.set(i, s);
662
- }
663
- this._$Eh = /* @__PURE__ */ new Map();
664
- for (const [e, i] of this.elementProperties) {
665
- const s = this._$Eu(e, i);
666
- s !== void 0 && this._$Eh.set(s, e);
667
- }
668
- this.elementStyles = this.finalizeStyles(this.styles);
669
- }
670
- static finalizeStyles(t) {
671
- const e = [];
672
- if (Array.isArray(t)) {
673
- const i = new Set(t.flat(1 / 0).reverse());
674
- for (const s of i)
675
- e.unshift(Rt(s));
676
- } else
677
- t !== void 0 && e.push(Rt(t));
678
- return e;
679
- }
680
- static _$Eu(t, e) {
681
- const i = e.attribute;
682
- return i === !1 ? void 0 : typeof i == "string" ? i : typeof t == "string" ? t.toLowerCase() : void 0;
683
- }
684
- constructor() {
685
- super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
686
- }
687
- _$Ev() {
688
- var t;
689
- this._$Eg = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$ES(), this.requestUpdate(), (t = this.constructor.l) == null || t.forEach((e) => e(this));
690
- }
691
- addController(t) {
692
- var e;
693
- (this._$E_ ?? (this._$E_ = /* @__PURE__ */ new Set())).add(t), this.renderRoot !== void 0 && this.isConnected && ((e = t.hostConnected) == null || e.call(t));
694
- }
695
- removeController(t) {
696
- var e;
697
- (e = this._$E_) == null || e.delete(t);
698
- }
699
- _$ES() {
700
- const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties;
701
- for (const i of e.keys())
702
- this.hasOwnProperty(i) && (t.set(i, this[i]), delete this[i]);
703
- t.size > 0 && (this._$Ep = t);
704
- }
705
- createRenderRoot() {
706
- const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
707
- return Re(t, this.constructor.elementStyles), t;
708
- }
709
- connectedCallback() {
710
- var t;
711
- this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$E_) == null || t.forEach((e) => {
712
- var i;
713
- return (i = e.hostConnected) == null ? void 0 : i.call(e);
714
- });
715
- }
716
- enableUpdating(t) {
717
- }
718
- disconnectedCallback() {
719
- var t;
720
- (t = this._$E_) == null || t.forEach((e) => {
721
- var i;
722
- return (i = e.hostDisconnected) == null ? void 0 : i.call(e);
723
- });
724
- }
725
- attributeChangedCallback(t, e, i) {
726
- this._$AK(t, i);
727
- }
728
- _$EO(t, e) {
729
- var n;
730
- const i = this.constructor.elementProperties.get(t), s = this.constructor._$Eu(t, i);
731
- if (s !== void 0 && i.reflect === !0) {
732
- const o = (((n = i.converter) == null ? void 0 : n.toAttribute) !== void 0 ? i.converter : ut).toAttribute(e, i.type);
733
- this._$Em = t, o == null ? this.removeAttribute(s) : this.setAttribute(s, o), this._$Em = null;
734
- }
735
- }
736
- _$AK(t, e) {
737
- var n;
738
- const i = this.constructor, s = i._$Eh.get(t);
739
- if (s !== void 0 && this._$Em !== s) {
740
- const o = i.getPropertyOptions(s), h = typeof o.converter == "function" ? { fromAttribute: o.converter } : ((n = o.converter) == null ? void 0 : n.fromAttribute) !== void 0 ? o.converter : ut;
741
- this._$Em = s, this[s] = h.fromAttribute(e, o.type), this._$Em = null;
742
- }
743
- }
744
- requestUpdate(t, e, i, s = !1, n) {
745
- if (t !== void 0) {
746
- if (i ?? (i = this.constructor.getPropertyOptions(t)), !(i.hasChanged ?? re)(s ? n : this[t], e))
747
- return;
748
- this.C(t, e, i);
749
- }
750
- this.isUpdatePending === !1 && (this._$Eg = this._$EP());
751
- }
752
- C(t, e, i) {
753
- this._$AL.has(t) || this._$AL.set(t, e), i.reflect === !0 && this._$Em !== t && (this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Set())).add(t);
754
- }
755
- async _$EP() {
756
- this.isUpdatePending = !0;
757
- try {
758
- await this._$Eg;
759
- } catch (e) {
760
- Promise.reject(e);
761
- }
762
- const t = this.scheduleUpdate();
763
- return t != null && await t, !this.isUpdatePending;
764
- }
765
- scheduleUpdate() {
766
- return this.performUpdate();
767
- }
768
- performUpdate() {
769
- var i;
770
- if (!this.isUpdatePending)
771
- return;
772
- if (!this.hasUpdated) {
773
- if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
774
- for (const [n, o] of this._$Ep)
775
- this[n] = o;
776
- this._$Ep = void 0;
777
- }
778
- const s = this.constructor.elementProperties;
779
- if (s.size > 0)
780
- for (const [n, o] of s)
781
- o.wrapped !== !0 || this._$AL.has(n) || this[n] === void 0 || this.C(n, this[n], o);
782
- }
783
- let t = !1;
784
- const e = this._$AL;
785
- try {
786
- t = this.shouldUpdate(e), t ? (this.willUpdate(e), (i = this._$E_) == null || i.forEach((s) => {
787
- var n;
788
- return (n = s.hostUpdate) == null ? void 0 : n.call(s);
789
- }), this.update(e)) : this._$ET();
790
- } catch (s) {
791
- throw t = !1, this._$ET(), s;
792
- }
793
- t && this._$AE(e);
794
- }
795
- willUpdate(t) {
796
- }
797
- _$AE(t) {
798
- var e;
799
- (e = this._$E_) == null || e.forEach((i) => {
800
- var s;
801
- return (s = i.hostUpdated) == null ? void 0 : s.call(i);
802
- }), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
803
- }
804
- _$ET() {
805
- this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
806
- }
807
- get updateComplete() {
808
- return this.getUpdateComplete();
809
- }
810
- getUpdateComplete() {
811
- return this._$Eg;
812
- }
813
- shouldUpdate(t) {
814
- return !0;
815
- }
816
- update(t) {
817
- this._$Ej && (this._$Ej = this._$Ej.forEach((e) => this._$EO(e, this[e]))), this._$ET();
818
- }
819
- updated(t) {
820
- }
821
- firstUpdated(t) {
822
- }
823
- }
824
- R.elementStyles = [], R.shadowRootOptions = { mode: "open" }, R[D("elementProperties")] = /* @__PURE__ */ new Map(), R[D("finalized")] = /* @__PURE__ */ new Map(), at == null || at({ ReactiveElement: R }), (E.reactiveElementVersions ?? (E.reactiveElementVersions = [])).push("2.0.2");
825
- /**
826
- * @license
827
- * Copyright 2017 Google LLC
828
- * SPDX-License-Identifier: BSD-3-Clause
829
- */
830
- const z = globalThis, tt = z.trustedTypes, Ot = tt ? tt.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, ne = "$lit$", A = `lit$${(Math.random() + "").slice(9)}$`, oe = "?" + A, Ve = `<${oe}>`, x = document, q = () => x.createComment(""), X = (r) => r === null || typeof r != "object" && typeof r != "function", ae = Array.isArray, De = (r) => ae(r) || typeof (r == null ? void 0 : r[Symbol.iterator]) == "function", ht = `[
831
- \f\r]`, M = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Nt = /-->/g, Lt = />/g, w = RegExp(`>|${ht}(?:([^\\s"'>=/]+)(${ht}*=${ht}*(?:[^
832
- \f\r"'\`<>=]|("|')|))|$)`, "g"), Mt = /'/g, It = /"/g, he = /^(?:script|style|textarea|title)$/i, ze = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), je = ze(1), k = Symbol.for("lit-noChange"), m = Symbol.for("lit-nothing"), Vt = /* @__PURE__ */ new WeakMap(), U = x.createTreeWalker(x, 129);
833
- function le(r, t) {
834
- if (!Array.isArray(r) || !r.hasOwnProperty("raw"))
835
- throw Error("invalid template strings array");
836
- return Ot !== void 0 ? Ot.createHTML(t) : t;
837
- }
838
- const Be = (r, t) => {
839
- const e = r.length - 1, i = [];
840
- let s, n = t === 2 ? "<svg>" : "", o = M;
841
- for (let h = 0; h < e; h++) {
842
- const a = r[h];
843
- let d, c, l = -1, p = 0;
844
- for (; p < a.length && (o.lastIndex = p, c = o.exec(a), c !== null); )
845
- p = o.lastIndex, o === M ? c[1] === "!--" ? o = Nt : c[1] !== void 0 ? o = Lt : c[2] !== void 0 ? (he.test(c[2]) && (s = RegExp("</" + c[2], "g")), o = w) : c[3] !== void 0 && (o = w) : o === w ? c[0] === ">" ? (o = s ?? M, l = -1) : c[1] === void 0 ? l = -2 : (l = o.lastIndex - c[2].length, d = c[1], o = c[3] === void 0 ? w : c[3] === '"' ? It : Mt) : o === It || o === Mt ? o = w : o === Nt || o === Lt ? o = M : (o = w, s = void 0);
846
- const u = o === w && r[h + 1].startsWith("/>") ? " " : "";
847
- n += o === M ? a + Ve : l >= 0 ? (i.push(d), a.slice(0, l) + ne + a.slice(l) + A + u) : a + A + (l === -2 ? h : u);
848
- }
849
- return [le(r, n + (r[e] || "<?>") + (t === 2 ? "</svg>" : "")), i];
850
- };
851
- class J {
852
- constructor({ strings: t, _$litType$: e }, i) {
853
- let s;
854
- this.parts = [];
855
- let n = 0, o = 0;
856
- const h = t.length - 1, a = this.parts, [d, c] = Be(t, e);
857
- if (this.el = J.createElement(d, i), U.currentNode = this.el.content, e === 2) {
858
- const l = this.el.content.firstChild;
859
- l.replaceWith(...l.childNodes);
860
- }
861
- for (; (s = U.nextNode()) !== null && a.length < h; ) {
862
- if (s.nodeType === 1) {
863
- if (s.hasAttributes())
864
- for (const l of s.getAttributeNames())
865
- if (l.endsWith(ne)) {
866
- const p = c[o++], u = s.getAttribute(l).split(A), g = /([.?@])?(.*)/.exec(p);
867
- a.push({ type: 1, index: n, name: g[2], strings: u, ctor: g[1] === "." ? qe : g[1] === "?" ? Xe : g[1] === "@" ? Je : st }), s.removeAttribute(l);
868
- } else
869
- l.startsWith(A) && (a.push({ type: 6, index: n }), s.removeAttribute(l));
870
- if (he.test(s.tagName)) {
871
- const l = s.textContent.split(A), p = l.length - 1;
872
- if (p > 0) {
873
- s.textContent = tt ? tt.emptyScript : "";
874
- for (let u = 0; u < p; u++)
875
- s.append(l[u], q()), U.nextNode(), a.push({ type: 2, index: ++n });
876
- s.append(l[p], q());
877
- }
878
- }
879
- } else if (s.nodeType === 8)
880
- if (s.data === oe)
881
- a.push({ type: 2, index: n });
882
- else {
883
- let l = -1;
884
- for (; (l = s.data.indexOf(A, l + 1)) !== -1; )
885
- a.push({ type: 7, index: n }), l += A.length - 1;
886
- }
887
- n++;
888
- }
889
- }
890
- static createElement(t, e) {
891
- const i = x.createElement("template");
892
- return i.innerHTML = t, i;
893
- }
894
- }
895
- function O(r, t, e = r, i) {
896
- var o, h;
897
- if (t === k)
898
- return t;
899
- let s = i !== void 0 ? (o = e._$Co) == null ? void 0 : o[i] : e._$Cl;
900
- const n = X(t) ? void 0 : t._$litDirective$;
901
- return (s == null ? void 0 : s.constructor) !== n && ((h = s == null ? void 0 : s._$AO) == null || h.call(s, !1), n === void 0 ? s = void 0 : (s = new n(r), s._$AT(r, e, i)), i !== void 0 ? (e._$Co ?? (e._$Co = []))[i] = s : e._$Cl = s), s !== void 0 && (t = O(r, s._$AS(r, t.values), s, i)), t;
902
- }
903
- class We {
904
- constructor(t, e) {
905
- this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
906
- }
907
- get parentNode() {
908
- return this._$AM.parentNode;
909
- }
910
- get _$AU() {
911
- return this._$AM._$AU;
912
- }
913
- u(t) {
914
- const { el: { content: e }, parts: i } = this._$AD, s = ((t == null ? void 0 : t.creationScope) ?? x).importNode(e, !0);
915
- U.currentNode = s;
916
- let n = U.nextNode(), o = 0, h = 0, a = i[0];
917
- for (; a !== void 0; ) {
918
- if (o === a.index) {
919
- let d;
920
- a.type === 2 ? d = new K(n, n.nextSibling, this, t) : a.type === 1 ? d = new a.ctor(n, a.name, a.strings, this, t) : a.type === 6 && (d = new Ke(n, this, t)), this._$AV.push(d), a = i[++h];
921
- }
922
- o !== (a == null ? void 0 : a.index) && (n = U.nextNode(), o++);
923
- }
924
- return U.currentNode = x, s;
925
- }
926
- p(t) {
927
- let e = 0;
928
- for (const i of this._$AV)
929
- i !== void 0 && (i.strings !== void 0 ? (i._$AI(t, i, e), e += i.strings.length - 2) : i._$AI(t[e])), e++;
930
- }
931
- }
932
- class K {
933
- get _$AU() {
934
- var t;
935
- return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
936
- }
937
- constructor(t, e, i, s) {
938
- this.type = 2, this._$AH = m, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = i, this.options = s, this._$Cv = (s == null ? void 0 : s.isConnected) ?? !0;
939
- }
940
- get parentNode() {
941
- let t = this._$AA.parentNode;
942
- const e = this._$AM;
943
- return e !== void 0 && (t == null ? void 0 : t.nodeType) === 11 && (t = e.parentNode), t;
944
- }
945
- get startNode() {
946
- return this._$AA;
947
- }
948
- get endNode() {
949
- return this._$AB;
950
- }
951
- _$AI(t, e = this) {
952
- t = O(this, t, e), X(t) ? t === m || t == null || t === "" ? (this._$AH !== m && this._$AR(), this._$AH = m) : t !== this._$AH && t !== k && this._(t) : t._$litType$ !== void 0 ? this.g(t) : t.nodeType !== void 0 ? this.$(t) : De(t) ? this.T(t) : this._(t);
953
- }
954
- k(t) {
955
- return this._$AA.parentNode.insertBefore(t, this._$AB);
956
- }
957
- $(t) {
958
- this._$AH !== t && (this._$AR(), this._$AH = this.k(t));
959
- }
960
- _(t) {
961
- this._$AH !== m && X(this._$AH) ? this._$AA.nextSibling.data = t : this.$(x.createTextNode(t)), this._$AH = t;
962
- }
963
- g(t) {
964
- var n;
965
- const { values: e, _$litType$: i } = t, s = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = J.createElement(le(i.h, i.h[0]), this.options)), i);
966
- if (((n = this._$AH) == null ? void 0 : n._$AD) === s)
967
- this._$AH.p(e);
968
- else {
969
- const o = new We(s, this), h = o.u(this.options);
970
- o.p(e), this.$(h), this._$AH = o;
971
- }
972
- }
973
- _$AC(t) {
974
- let e = Vt.get(t.strings);
975
- return e === void 0 && Vt.set(t.strings, e = new J(t)), e;
976
- }
977
- T(t) {
978
- ae(this._$AH) || (this._$AH = [], this._$AR());
979
- const e = this._$AH;
980
- let i, s = 0;
981
- for (const n of t)
982
- s === e.length ? e.push(i = new K(this.k(q()), this.k(q()), this, this.options)) : i = e[s], i._$AI(n), s++;
983
- s < e.length && (this._$AR(i && i._$AB.nextSibling, s), e.length = s);
984
- }
985
- _$AR(t = this._$AA.nextSibling, e) {
986
- var i;
987
- for ((i = this._$AP) == null ? void 0 : i.call(this, !1, !0, e); t && t !== this._$AB; ) {
988
- const s = t.nextSibling;
989
- t.remove(), t = s;
990
- }
991
- }
992
- setConnected(t) {
993
- var e;
994
- this._$AM === void 0 && (this._$Cv = t, (e = this._$AP) == null || e.call(this, t));
995
- }
996
- }
997
- class st {
998
- get tagName() {
999
- return this.element.tagName;
1000
- }
1001
- get _$AU() {
1002
- return this._$AM._$AU;
1003
- }
1004
- constructor(t, e, i, s, n) {
1005
- this.type = 1, this._$AH = m, this._$AN = void 0, this.element = t, this.name = e, this._$AM = s, this.options = n, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = m;
1006
- }
1007
- _$AI(t, e = this, i, s) {
1008
- const n = this.strings;
1009
- let o = !1;
1010
- if (n === void 0)
1011
- t = O(this, t, e, 0), o = !X(t) || t !== this._$AH && t !== k, o && (this._$AH = t);
1012
- else {
1013
- const h = t;
1014
- let a, d;
1015
- for (t = n[0], a = 0; a < n.length - 1; a++)
1016
- d = O(this, h[i + a], e, a), d === k && (d = this._$AH[a]), o || (o = !X(d) || d !== this._$AH[a]), d === m ? t = m : t !== m && (t += (d ?? "") + n[a + 1]), this._$AH[a] = d;
1017
- }
1018
- o && !s && this.O(t);
1019
- }
1020
- O(t) {
1021
- t === m ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
1022
- }
1023
- }
1024
- class qe extends st {
1025
- constructor() {
1026
- super(...arguments), this.type = 3;
1027
- }
1028
- O(t) {
1029
- this.element[this.name] = t === m ? void 0 : t;
1030
- }
1031
- }
1032
- class Xe extends st {
1033
- constructor() {
1034
- super(...arguments), this.type = 4;
1035
- }
1036
- O(t) {
1037
- this.element.toggleAttribute(this.name, !!t && t !== m);
1038
- }
1039
- }
1040
- class Je extends st {
1041
- constructor(t, e, i, s, n) {
1042
- super(t, e, i, s, n), this.type = 5;
1043
- }
1044
- _$AI(t, e = this) {
1045
- if ((t = O(this, t, e, 0) ?? m) === k)
1046
- return;
1047
- const i = this._$AH, s = t === m && i !== m || t.capture !== i.capture || t.once !== i.once || t.passive !== i.passive, n = t !== m && (i === m || s);
1048
- s && this.element.removeEventListener(this.name, this, i), n && this.element.addEventListener(this.name, this, t), this._$AH = t;
1049
- }
1050
- handleEvent(t) {
1051
- var e;
1052
- typeof this._$AH == "function" ? this._$AH.call(((e = this.options) == null ? void 0 : e.host) ?? this.element, t) : this._$AH.handleEvent(t);
1053
- }
1054
- }
1055
- class Ke {
1056
- constructor(t, e, i) {
1057
- this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = i;
1058
- }
1059
- get _$AU() {
1060
- return this._$AM._$AU;
1061
- }
1062
- _$AI(t) {
1063
- O(this, t);
1064
- }
1065
- }
1066
- const lt = z.litHtmlPolyfillSupport;
1067
- lt == null || lt(J, K), (z.litHtmlVersions ?? (z.litHtmlVersions = [])).push("3.1.0");
1068
- const Fe = (r, t, e) => {
1069
- const i = (e == null ? void 0 : e.renderBefore) ?? t;
1070
- let s = i._$litPart$;
1071
- if (s === void 0) {
1072
- const n = (e == null ? void 0 : e.renderBefore) ?? null;
1073
- i._$litPart$ = s = new K(t.insertBefore(q(), n), n, void 0, e ?? {});
1074
- }
1075
- return s._$AI(r), s;
1076
- };
1077
- /**
1078
- * @license
1079
- * Copyright 2017 Google LLC
1080
- * SPDX-License-Identifier: BSD-3-Clause
1081
- */
1082
- class j extends R {
1083
- constructor() {
1084
- super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
1085
- }
1086
- createRenderRoot() {
1087
- var e;
1088
- const t = super.createRenderRoot();
1089
- return (e = this.renderOptions).renderBefore ?? (e.renderBefore = t.firstChild), t;
1090
- }
1091
- update(t) {
1092
- const e = this.render();
1093
- this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Fe(e, this.renderRoot, this.renderOptions);
1094
- }
1095
- connectedCallback() {
1096
- var t;
1097
- super.connectedCallback(), (t = this._$Do) == null || t.setConnected(!0);
1098
- }
1099
- disconnectedCallback() {
1100
- var t;
1101
- super.disconnectedCallback(), (t = this._$Do) == null || t.setConnected(!1);
1102
- }
1103
- render() {
1104
- return k;
1105
- }
1106
- }
1107
- var Bt;
1108
- j._$litElement$ = !0, j.finalized = !0, (Bt = globalThis.litElementHydrateSupport) == null || Bt.call(globalThis, { LitElement: j });
1109
- const dt = globalThis.litElementPolyfillSupport;
1110
- dt == null || dt({ LitElement: j });
1111
- (globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.0.2");
1112
- function Ge(r, t, e) {
1113
- function i(s) {
1114
- e.dispatchEvent(new CustomEvent(s.type, s));
1115
- }
1116
- return t.addEventListener(r, i), () => {
1117
- t.removeEventListener(r, i);
9
+ import { styleMap } from "lit/directives/style-map.js";
10
+ import { classMap } from "lit/directives/class-map.js";
11
+ import "@a11y/focus-trap";
12
+ function forwardEvent(type2, fromElement, toElement) {
13
+ function forwarder(event) {
14
+ toElement.dispatchEvent(new CustomEvent(event.type, event));
15
+ }
16
+ fromElement.addEventListener(type2, forwarder);
17
+ return () => {
18
+ fromElement.removeEventListener(type2, forwarder);
1118
19
  };
1119
20
  }
1120
- class Ze {
1121
- constructor(t, e) {
1122
- this._events = [], this._cleanup = [], this._forwardElementRef = qt(), this.host = t, this._events = e, t.addController(this);
21
+ class EventForwardController {
22
+ constructor(host, events) {
23
+ this._events = [];
24
+ this._cleanup = [];
25
+ this._forwardElementRef = createRef();
26
+ this.host = host;
27
+ this._events = events;
28
+ host.addController(this);
1123
29
  }
1124
30
  register() {
1125
- return Xt(this._forwardElementRef);
31
+ return ref(this._forwardElementRef);
1126
32
  }
1127
33
  hostConnected() {
1128
34
  requestAnimationFrame(() => {
1129
- this._events.forEach((t) => {
1130
- this._forwardElementRef.value && this._cleanup.push(Ge(t, this._forwardElementRef.value, this.host));
35
+ this._events.forEach((event) => {
36
+ if (this._forwardElementRef.value) {
37
+ this._cleanup.push(forwardEvent(event, this._forwardElementRef.value, this.host));
38
+ }
1131
39
  });
1132
40
  });
1133
41
  }
1134
42
  hostDisconnected() {
1135
- this._cleanup.forEach((t) => {
1136
- t();
1137
- }), this._cleanup = [];
43
+ this._cleanup.forEach((fn) => {
44
+ fn();
45
+ });
46
+ this._cleanup = [];
1138
47
  }
1139
48
  }
1140
- const Dt = "https://d2rxhdlm2q91uk.cloudfront.net", Ye = "https://d1ix11aj5kfygl.cloudfront.net", Qe = "https://d157jlwnudd93d.cloudfront.net", zt = "https://bshyfw4h5a.execute-api.ap-southeast-2.amazonaws.com/dev", ti = "https://gyzw7rpbq3.execute-api.ap-southeast-2.amazonaws.com/staging", ei = "https://vfcjuim1l3.execute-api.ap-southeast-2.amazonaws.com/prod", ii = "http://localhost:6060/v2", si = "https://embed-dev.vouchfor.com/v2", ri = "https://embed-staging.vouchfor.com/v2", ni = "https://embed.vouchfor.com/v2";
1141
- function et(r) {
1142
- if (!["local", "dev", "staging", "prod"].includes(r))
1143
- throw new Error(`Unknown environment: ${r}`);
1144
- if (r === "local")
49
+ const devVideoUrl = "https://d2rxhdlm2q91uk.cloudfront.net";
50
+ const stagingVideoUrl = "https://d1ix11aj5kfygl.cloudfront.net";
51
+ const prodVideoUrl = "https://d157jlwnudd93d.cloudfront.net";
52
+ const devPublicApiUrl = "https://bshyfw4h5a.execute-api.ap-southeast-2.amazonaws.com/dev";
53
+ const stagingPublicApiUrl = "https://gyzw7rpbq3.execute-api.ap-southeast-2.amazonaws.com/staging";
54
+ const prodPublicApiUrl = "https://vfcjuim1l3.execute-api.ap-southeast-2.amazonaws.com/prod";
55
+ const localEmbedApiUrl = "http://localhost:6060/v2";
56
+ const devEmbedApiUrl = "https://embed-dev.vouchfor.com/v2";
57
+ const stagingEmbedApiUrl = "https://embed-staging.vouchfor.com/v2";
58
+ const prodEmbedApiUrl = "https://embed.vouchfor.com/v2";
59
+ function getEnvUrls(env) {
60
+ if (!["local", "dev", "staging", "prod"].includes(env)) {
61
+ throw new Error(`Unknown environment: ${env}`);
62
+ }
63
+ if (env === "local") {
1145
64
  return {
1146
- videoUrl: Dt,
1147
- publicApiUrl: zt,
1148
- embedApiUrl: ii
65
+ videoUrl: devVideoUrl,
66
+ publicApiUrl: devPublicApiUrl,
67
+ embedApiUrl: localEmbedApiUrl
1149
68
  };
1150
- if (r === "dev")
69
+ }
70
+ if (env === "dev") {
1151
71
  return {
1152
- videoUrl: Dt,
1153
- publicApiUrl: zt,
1154
- embedApiUrl: si
72
+ videoUrl: devVideoUrl,
73
+ publicApiUrl: devPublicApiUrl,
74
+ embedApiUrl: devEmbedApiUrl
1155
75
  };
1156
- if (r === "staging")
76
+ }
77
+ if (env === "staging") {
1157
78
  return {
1158
- videoUrl: Ye,
1159
- publicApiUrl: ti,
1160
- embedApiUrl: ri
79
+ videoUrl: stagingVideoUrl,
80
+ publicApiUrl: stagingPublicApiUrl,
81
+ embedApiUrl: stagingEmbedApiUrl
1161
82
  };
1162
- if (r === "prod")
83
+ }
84
+ if (env === "prod") {
1163
85
  return {
1164
- videoUrl: Qe,
1165
- publicApiUrl: ei,
1166
- embedApiUrl: ni
86
+ videoUrl: prodVideoUrl,
87
+ publicApiUrl: prodPublicApiUrl,
88
+ embedApiUrl: prodEmbedApiUrl
1167
89
  };
90
+ }
1168
91
  }
1169
- class oi {
1170
- constructor(t) {
1171
- this._fetching = !1, this.getVouch = async (e, i, s) => {
1172
- var c;
1173
- const { embedApiUrl: n } = et(e), o = P(), h = await fetch(`${n}/vouches/${s}`, {
92
+ class FetcherController {
93
+ constructor(host) {
94
+ this._fetching = false;
95
+ this.getVouch = async (env, apiKey, vouchId) => {
96
+ var _a;
97
+ const { embedApiUrl } = getEnvUrls(env);
98
+ const cacheCheck = v4();
99
+ const res = await fetch(`${embedApiUrl}/vouches/${vouchId}`, {
1174
100
  method: "GET",
1175
101
  headers: [
1176
- ["X-Api-Key", i],
1177
- ["X-Cache-Check", o]
102
+ ["X-Api-Key", apiKey],
103
+ ["X-Cache-Check", cacheCheck]
1178
104
  ]
1179
- }), a = await h.json();
1180
- return this.host.dispatchEvent(new CustomEvent("vouch:loaded", { detail: a == null ? void 0 : a.id })), ((c = h == null ? void 0 : h.headers) == null ? void 0 : c.get("X-Cache-Check")) !== o && fetch(`${n}/vouches/${s}`, {
1181
- method: "GET",
1182
- headers: [
1183
- ["X-Api-Key", i],
1184
- ["Cache-Control", "max-age=0"]
1185
- ]
1186
- }), a;
1187
- }, this.getTemplate = async (e, i, s) => {
1188
- var c;
1189
- const { embedApiUrl: n } = et(e), o = P(), h = await fetch(`${n}/templates/${s}`, {
1190
- method: "GET",
1191
- headers: [
1192
- ["X-Api-Key", i],
1193
- ["X-Cache-Check", o]
1194
- ]
1195
- }), a = await h.json();
1196
- return ((c = h == null ? void 0 : h.headers) == null ? void 0 : c.get("X-Cache-Check")) !== o && fetch(`${n}/templates/${s}`, {
105
+ });
106
+ const vouch = await res.json();
107
+ this.host.dispatchEvent(new CustomEvent("vouch:loaded", { detail: vouch == null ? void 0 : vouch.id }));
108
+ const resCacheCheck = (_a = res == null ? void 0 : res.headers) == null ? void 0 : _a.get("X-Cache-Check");
109
+ if (resCacheCheck !== cacheCheck) {
110
+ fetch(`${embedApiUrl}/vouches/${vouchId}`, {
111
+ method: "GET",
112
+ headers: [
113
+ ["X-Api-Key", apiKey],
114
+ ["Cache-Control", "max-age=0"]
115
+ ]
116
+ });
117
+ }
118
+ return vouch;
119
+ };
120
+ this.getTemplate = async (env, apiKey, templateId) => {
121
+ var _a;
122
+ const { embedApiUrl } = getEnvUrls(env);
123
+ const cacheCheck = v4();
124
+ const res = await fetch(`${embedApiUrl}/templates/${templateId}`, {
1197
125
  method: "GET",
1198
126
  headers: [
1199
- ["X-Api-Key", i],
1200
- ["Cache-Control", "max-age=0"]
127
+ ["X-Api-Key", apiKey],
128
+ ["X-Cache-Check", cacheCheck]
1201
129
  ]
1202
- }), a;
1203
- }, this.host = t, new yt(
130
+ });
131
+ const template = await res.json();
132
+ const resCacheCheck = (_a = res == null ? void 0 : res.headers) == null ? void 0 : _a.get("X-Cache-Check");
133
+ if (resCacheCheck !== cacheCheck) {
134
+ fetch(`${embedApiUrl}/templates/${templateId}`, {
135
+ method: "GET",
136
+ headers: [
137
+ ["X-Api-Key", apiKey],
138
+ ["Cache-Control", "max-age=0"]
139
+ ]
140
+ });
141
+ }
142
+ return template;
143
+ };
144
+ this.host = host;
145
+ new Task(
1204
146
  this.host,
1205
- async ([e, i, s, n, o]) => {
1206
- var h, a, d, c;
147
+ async ([env, apiKey, data, vouchId, templateId]) => {
148
+ var _a, _b, _c, _d;
1207
149
  try {
1208
- if (t.vouch = void 0, t.template = void 0, s) {
1209
- let l;
1210
- o && (this.fetching = !0, l = await this.getTemplate(e, i, o)), this._vouch = s, t.template = l ?? ((a = (h = s == null ? void 0 : s.settings) == null ? void 0 : h.template) == null ? void 0 : a.instance);
1211
- } else if (n) {
1212
- this.fetching = !0;
1213
- const [l, p] = await Promise.all([
1214
- this.getVouch(e, i, n),
1215
- o ? this.getTemplate(e, i, o) : null
150
+ host.vouch = void 0;
151
+ host.template = void 0;
152
+ if (data) {
153
+ let template;
154
+ if (templateId) {
155
+ this.fetching = true;
156
+ template = await this.getTemplate(env, apiKey, templateId);
157
+ }
158
+ this._vouch = data;
159
+ host.template = template ?? ((_b = (_a = data == null ? void 0 : data.settings) == null ? void 0 : _a.template) == null ? void 0 : _b.instance);
160
+ } else if (vouchId) {
161
+ this.fetching = true;
162
+ const [vouch, template] = await Promise.all([
163
+ this.getVouch(env, apiKey, vouchId),
164
+ templateId ? this.getTemplate(env, apiKey, templateId) : null
1216
165
  ]);
1217
- this._vouch = l, t.template = p ?? ((c = (d = l == null ? void 0 : l.settings) == null ? void 0 : d.template) == null ? void 0 : c.instance);
166
+ this._vouch = vouch;
167
+ host.template = template ?? ((_d = (_c = vouch == null ? void 0 : vouch.settings) == null ? void 0 : _c.template) == null ? void 0 : _d.instance);
1218
168
  }
1219
169
  } finally {
1220
- this.fetching = !1;
170
+ this.fetching = false;
1221
171
  }
1222
172
  },
1223
- () => [t.env, t.apiKey, t.data, t.vouchId, t.templateId]
1224
- ), new yt(
173
+ () => [host.env, host.apiKey, host.data, host.vouchId, host.templateId]
174
+ );
175
+ new Task(
1225
176
  this.host,
1226
- ([e, i]) => {
1227
- t.vouch = e ? {
1228
- ...e,
177
+ ([vouch, questions]) => {
178
+ host.vouch = vouch ? {
179
+ ...vouch,
1229
180
  questions: {
1230
- items: e == null ? void 0 : e.questions.items.filter((s, n) => !(i != null && i.length) || (i == null ? void 0 : i.includes(n + 1)))
181
+ items: vouch == null ? void 0 : vouch.questions.items.filter((_, index) => !(questions == null ? void 0 : questions.length) || (questions == null ? void 0 : questions.includes(index + 1)))
1231
182
  }
1232
183
  } : void 0;
1233
184
  },
1234
- () => [this._vouch, t.questions]
185
+ () => [this._vouch, host.questions]
1235
186
  );
1236
187
  }
1237
- set fetching(t) {
1238
- this._fetching !== t && (this._fetching = t, this.host.requestUpdate());
188
+ set fetching(value) {
189
+ if (this._fetching !== value) {
190
+ this._fetching = value;
191
+ this.host.requestUpdate();
192
+ }
1239
193
  }
1240
194
  get fetching() {
1241
195
  return this._fetching;
1242
196
  }
1243
197
  }
1244
- const ai = "@vouchfor/embeds", hi = "0.0.0-experiment.ae8c0d8", li = "MIT", di = "Aaron Williams", ci = "dist/es/embeds.js", pi = "dist/es/embeds.js", ui = "module", _i = "dist/es/index.d.ts", mi = {
198
+ const name = "@vouchfor/embeds";
199
+ const version = "0.0.0-experiment.af1c4c8";
200
+ const license = "MIT";
201
+ const author = "Aaron Williams";
202
+ const main = "dist/es/embeds.js";
203
+ const module = "dist/es/embeds.js";
204
+ const type = "module";
205
+ const types = "dist/es/src/index.d.ts";
206
+ const exports = {
1245
207
  ".": "./dist/es/embeds.js"
1246
- }, $i = [
208
+ };
209
+ const files = [
1247
210
  "dist",
1248
211
  "src"
1249
- ], fi = {
212
+ ];
213
+ const publishConfig = {
1250
214
  tag: "experiment",
1251
215
  access: "public"
1252
- }, gi = {
1253
- build: "rm -rf dist && tsc && vite build --mode iife && vite build --mode es",
216
+ };
217
+ const engines = {
218
+ node: ">=18.18.0"
219
+ };
220
+ const scripts = {
221
+ build: "rm -rf dist && tsc && yarn build:self",
1254
222
  "build:deps": "yarn --cwd ../media-player build",
223
+ "build:self": "vite build --mode iife && vite build --mode es && node scripts/build.cjs",
1255
224
  "build:package": "yarn build",
1256
225
  "build:storybook": "yarn prebuild && storybook build",
1257
226
  "generate:manifest": "wca src --outFile custom-elements.json",
@@ -1262,187 +231,323 @@ const ai = "@vouchfor/embeds", hi = "0.0.0-experiment.ae8c0d8", li = "MIT", di =
1262
231
  size: "size-limit",
1263
232
  storybook: "yarn prebuild && storybook dev -p 6007",
1264
233
  prebuild: "yarn build:deps && yarn generate:manifest",
1265
- test: "true"
1266
- }, yi = {
234
+ test: "rm -rf test/lib && yarn prebuild && vite build --mode test && web-test-runner",
235
+ "test:ci": "yarn test --config web-test-runner.ci.config.js",
236
+ "test:watch": "yarn test --watch"
237
+ };
238
+ const dependencies = {
239
+ "@a11y/focus-trap": "^1.0.5",
1267
240
  "@lit/task": "^1.0.0",
1268
- "@vouchfor/media-player": "0.0.0-experiment.ae8c0d8",
241
+ "@vouchfor/canvas-video": "0.0.0-experiment.af1c4c8",
242
+ "@vouchfor/media-player": "0.0.0-experiment.af1c4c8",
1269
243
  uuid: "^9.0.1"
1270
- }, vi = {
1271
- lit: "^3.1.0"
1272
- }, Ai = {
244
+ };
245
+ const peerDependencies = {
246
+ lit: "^3.1.2"
247
+ };
248
+ const devDependencies = {
1273
249
  "@esm-bundle/chai": "^4.3.4-fix.0",
1274
- "@open-wc/testing": "^3.2.0",
1275
- "@storybook/addon-essentials": "^7.4.5",
1276
- "@storybook/addon-links": "^7.4.5",
1277
- "@storybook/blocks": "^7.4.5",
1278
- "@storybook/web-components": "^7.4.5",
1279
- "@storybook/web-components-vite": "^7.4.5",
1280
- "@types/mocha": "^10.0.1",
1281
- "@vouchfor/eslint-config": "^1.0.0",
1282
- "@vouchfor/prettier-config": "^1.0.0",
1283
- "@web/dev-server-esbuild": "^0.4.1",
1284
- "@web/test-runner": "^0.17.1",
1285
- "@web/test-runner-browserstack": "^0.6.1",
1286
- "@web/test-runner-mocha": "^0.8.1",
1287
- "@web/test-runner-playwright": "^0.10.1",
1288
- dotenv: "^16.3.1",
1289
- eslint: "^8.50.0",
1290
- "eslint-plugin-import": "^2.28.1",
1291
- "lint-staged": "^14.0.1",
1292
- lit: "^3.1.0",
1293
- prettier: "^3.0.3",
250
+ "@open-wc/testing": "^4.0.0",
251
+ "@storybook/addon-essentials": "^8.0.4",
252
+ "@storybook/addon-links": "^8.0.4",
253
+ "@storybook/blocks": "^8.0.4",
254
+ "@storybook/web-components": "^8.0.4",
255
+ "@storybook/web-components-vite": "^8.0.4",
256
+ "@svgr/core": "^8.1.0",
257
+ "@types/flat": "^5.0.5",
258
+ "@types/mocha": "^10.0.6",
259
+ "@vouchfor/eslint-config": "^1.0.1",
260
+ "@vouchfor/prettier-config": "^1.0.1",
261
+ "@vouchfor/video-utils": "0.0.0-experiment.af1c4c8",
262
+ "@web/dev-server-esbuild": "^1.0.2",
263
+ "@web/test-runner": "^0.18.1",
264
+ "@web/test-runner-browserstack": "^0.7.1",
265
+ "@web/test-runner-mocha": "^0.9.0",
266
+ "@web/test-runner-playwright": "^0.11.0",
267
+ glob: "^10.3.10",
268
+ "lint-staged": "^15.2.2",
269
+ lit: "^3.1.2",
270
+ lodash: "^4.17.21",
1294
271
  react: "^18.2.0",
1295
272
  "react-dom": "^18.2.0",
1296
- storybook: "^7.4.5",
1297
- typescript: "^5.1.3",
1298
- vite: "^4.4.9",
1299
- "vite-plugin-dts": "^3.6.0",
1300
- "web-component-analyzer": "^1.1.7"
1301
- }, bi = {
1302
- name: ai,
1303
- version: hi,
1304
- license: li,
1305
- author: di,
1306
- main: ci,
1307
- module: pi,
1308
- type: ui,
1309
- types: _i,
1310
- exports: mi,
1311
- files: $i,
1312
- publishConfig: fi,
1313
- scripts: gi,
273
+ "rollup-plugin-tla": "^0.0.2",
274
+ sinon: "^17.0.1",
275
+ storybook: "^8.0.4",
276
+ svgson: "^5.3.1",
277
+ typescript: "^5.4.3",
278
+ vite: "^5.2.2",
279
+ "vite-plugin-commonjs": "^0.10.1",
280
+ "vite-plugin-dts": "^3.7.3",
281
+ "web-component-analyzer": "^2.0.0"
282
+ };
283
+ const packageJson = {
284
+ name,
285
+ version,
286
+ license,
287
+ author,
288
+ main,
289
+ module,
290
+ type,
291
+ types,
292
+ exports,
293
+ files,
294
+ publishConfig,
295
+ engines,
296
+ scripts,
1314
297
  "lint-staged": {
1315
298
  "**/*.{ts,tsx,js}": "eslint --fix --quiet",
1316
299
  "**/*.{md,json,yml}": "prettier --write"
1317
300
  },
1318
- dependencies: yi,
1319
- peerDependencies: vi,
1320
- devDependencies: Ai
1321
- }, jt = 1;
1322
- class Ei {
1323
- constructor(t) {
1324
- this._tabId = void 0, this._clientId = void 0, this._visitorId = void 0, this._hasPlayed = !1, this._hasLoaded = {}, this._answersViewed = {}, this._streamStartTime = {}, this._streamLatestTime = {}, this._currentlyPlayingVideo = null, this._createVisitor = (e) => {
1325
- var s, n;
1326
- const { publicApiUrl: i } = et(this.host.env);
1327
- return (n = (s = window.localStorage) == null ? void 0 : s.setItem) == null || n.call(s, "vouch-uid-visitor", e), navigator.sendBeacon(`${i}/api/visitor`, JSON.stringify({ visitorId: e })), e;
1328
- }, this._getReportingMetadata = () => {
1329
- var n, o;
1330
- const [e, i] = ((o = (n = Intl.DateTimeFormat().resolvedOptions().timeZone) == null ? void 0 : n.split) == null ? void 0 : o.call(n, "/")) ?? [], s = {};
1331
- return [...new URLSearchParams(location.search).entries()].forEach(([h, a]) => {
1332
- if (/utm/.test(h)) {
1333
- const d = h.toLowerCase().replace(/[-_][a-z0-9]/g, (c) => c.slice(-1).toUpperCase());
1334
- s[d] = a;
301
+ dependencies,
302
+ peerDependencies,
303
+ devDependencies
304
+ };
305
+ function createVisitor(env) {
306
+ const { publicApiUrl } = getEnvUrls(env);
307
+ const visitorId = v4();
308
+ navigator.sendBeacon(`${publicApiUrl}/api/visitor`, JSON.stringify({ visitorId }));
309
+ return visitorId;
310
+ }
311
+ function getUids(env) {
312
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
313
+ if (typeof window === "undefined") {
314
+ return {
315
+ client: null,
316
+ tab: null,
317
+ request: v4()
318
+ };
319
+ }
320
+ let visitorId = (_b = (_a = window.localStorage) == null ? void 0 : _a.getItem) == null ? void 0 : _b.call(_a, "vouch-uid-visitor");
321
+ let clientId = (_d = (_c = window.localStorage) == null ? void 0 : _c.getItem) == null ? void 0 : _d.call(_c, "vouch-uid-client");
322
+ let tabId = (_f = (_e = window.sessionStorage) == null ? void 0 : _e.getItem) == null ? void 0 : _f.call(_e, "vouch-uid-tab");
323
+ const requestId = v4();
324
+ if (!visitorId) {
325
+ visitorId = createVisitor(env);
326
+ (_h = (_g = window.localStorage) == null ? void 0 : _g.setItem) == null ? void 0 : _h.call(_g, "vouch-uid-visitor", visitorId);
327
+ }
328
+ if (!clientId) {
329
+ clientId = v4();
330
+ (_j = (_i = window.localStorage) == null ? void 0 : _i.setItem) == null ? void 0 : _j.call(_i, "vouch-uid-client", clientId);
331
+ }
332
+ if (!tabId) {
333
+ tabId = v4();
334
+ (_l = (_k = window.sessionStorage) == null ? void 0 : _k.setItem) == null ? void 0 : _l.call(_k, "vouch-uid-tab", tabId);
335
+ }
336
+ return {
337
+ client: clientId,
338
+ tab: tabId,
339
+ request: requestId,
340
+ visitor: visitorId
341
+ };
342
+ }
343
+ function findVouchId(payload, vouch) {
344
+ if (payload && "vouchId" in payload) {
345
+ return payload.vouchId;
346
+ }
347
+ return (vouch == null ? void 0 : vouch.id) ?? null;
348
+ }
349
+ function getReportingMetadata(source = "embedded_player") {
350
+ var _a, _b;
351
+ const [country, region] = ((_b = (_a = Intl.DateTimeFormat().resolvedOptions().timeZone) == null ? void 0 : _a.split) == null ? void 0 : _b.call(_a, "/")) ?? [];
352
+ const utmParams = {};
353
+ [...new URLSearchParams(location.search).entries()].forEach(([key, value]) => {
354
+ if (/utm/.test(key)) {
355
+ const param = key.toLowerCase().replace(/[-_][a-z0-9]/g, (group) => group.slice(-1).toUpperCase());
356
+ utmParams[param] = value;
357
+ }
358
+ });
359
+ return {
360
+ source,
361
+ time: /* @__PURE__ */ new Date(),
362
+ region,
363
+ country,
364
+ screenHeight: window.screen.height,
365
+ screenWidth: window.screen.width,
366
+ referrer: document.referrer,
367
+ currentUrl: location.href,
368
+ embedType: "media-player-embed",
369
+ embedVersion: packageJson.version,
370
+ templateVersion: TEMPLATE_VERSION,
371
+ ...utmParams
372
+ };
373
+ }
374
+ const MINIMUM_SEND_THRESHOLD = 1;
375
+ class TrackingController {
376
+ constructor(host) {
377
+ this._batchedEvents = [];
378
+ this._hasPlayed = false;
379
+ this._hasLoaded = {};
380
+ this._answersViewed = {};
381
+ this._streamStartTime = {};
382
+ this._streamLatestTime = {};
383
+ this._currentlyPlayingVideo = null;
384
+ this._createTrackingEvent = (event, payload) => {
385
+ const vouchId = findVouchId(payload, this.host.vouch);
386
+ if (!vouchId || this.host.disableTracking) {
387
+ return;
388
+ }
389
+ this._batchedEvents.push({
390
+ event,
391
+ payload: {
392
+ ...payload,
393
+ vouchId,
394
+ time: (/* @__PURE__ */ new Date()).toISOString()
1335
395
  }
1336
- }), {
1337
- source: this.host.trackingSource,
1338
- time: /* @__PURE__ */ new Date(),
1339
- region: i,
1340
- country: e,
1341
- screenHeight: window.screen.height,
1342
- screenWidth: window.screen.width,
1343
- referrer: document.referrer,
1344
- currentUrl: location.href,
1345
- ...s
1346
- };
1347
- }, this._sendTrackingEvent = (e, i) => {
1348
- const s = this._findVouchId(i);
1349
- if (!s || this.host.disableTracking)
396
+ });
397
+ };
398
+ this._sendTrackingEvent = () => {
399
+ if (this._batchedEvents.length <= 0) {
1350
400
  return;
1351
- const { publicApiUrl: n } = et(this.host.env), { client: o, tab: h, request: a, visitor: d } = this._getUids();
401
+ }
402
+ const { publicApiUrl } = getEnvUrls(this.host.env);
403
+ const { client, tab, request, visitor } = getUids(this.host.env);
1352
404
  navigator.sendBeacon(
1353
- `${n}/api/v2/events`,
405
+ `${publicApiUrl}/api/batchevents`,
1354
406
  JSON.stringify({
1355
- event: e,
1356
407
  payload: {
1357
- ...i,
1358
- vouchId: s
408
+ events: this._batchedEvents
1359
409
  },
1360
410
  context: {
1361
- "x-uid-client": o,
1362
- "x-uid-tab": h,
1363
- "x-uid-request": a,
1364
- "x-uid-visitor": d,
1365
- "x-reporting-metadata": this._getReportingMetadata(),
1366
- "x-embeds-version": bi.version
411
+ "x-uid-client": client,
412
+ "x-uid-tab": tab,
413
+ "x-uid-request": request,
414
+ "x-uid-visitor": visitor,
415
+ "x-reporting-metadata": getReportingMetadata(this.host.trackingSource)
1367
416
  }
1368
417
  })
1369
418
  );
1370
- }, this._streamEnded = () => {
419
+ this._batchedEvents = [];
420
+ };
421
+ this._streamEnded = () => {
1371
422
  if (this._currentlyPlayingVideo) {
1372
- const { id: e, key: i } = this._currentlyPlayingVideo;
1373
- this._streamLatestTime[i] > this._streamStartTime[i] + jt && this._sendTrackingEvent("VIDEO_STREAMED", {
1374
- answerId: e,
1375
- streamStart: this._streamStartTime[i],
1376
- streamEnd: this._streamLatestTime[i]
1377
- }), delete this._streamStartTime[i], delete this._streamLatestTime[i];
423
+ const { id, key } = this._currentlyPlayingVideo;
424
+ if (this._streamLatestTime[key] > this._streamStartTime[key] + MINIMUM_SEND_THRESHOLD) {
425
+ this._createTrackingEvent("VIDEO_STREAMED", {
426
+ answerId: id,
427
+ streamStart: this._streamStartTime[key],
428
+ streamEnd: this._streamLatestTime[key]
429
+ });
430
+ }
431
+ delete this._streamStartTime[key];
432
+ delete this._streamLatestTime[key];
433
+ }
434
+ };
435
+ this._handleVouchLoaded = ({ detail: vouchId }) => {
436
+ if (!vouchId) {
437
+ return;
438
+ }
439
+ if (!this._hasLoaded[vouchId]) {
440
+ this._createTrackingEvent("VOUCH_LOADED", { vouchId });
441
+ this._hasLoaded[vouchId] = true;
442
+ }
443
+ };
444
+ this._handlePlay = () => {
445
+ if (!this._hasPlayed) {
446
+ this._createTrackingEvent("VIDEO_PLAYED", {
447
+ streamStart: this.host.currentTime
448
+ });
449
+ this._hasPlayed = true;
450
+ }
451
+ };
452
+ this._handleVideoPlay = ({ detail: { id, key } }) => {
453
+ if (!this._answersViewed[key]) {
454
+ this._createTrackingEvent("VOUCH_RESPONSE_VIEWED", {
455
+ answerId: id
456
+ });
457
+ this._answersViewed[key] = true;
1378
458
  }
1379
- }, this._handleVouchLoaded = ({ detail: e }) => {
1380
- e && (this._hasLoaded[e] || (this._sendTrackingEvent("VOUCH_LOADED", { vouchId: e }), this._hasLoaded[e] = !0));
1381
- }, this._handlePlay = () => {
1382
- this._hasPlayed || (this._sendTrackingEvent("VIDEO_PLAYED", {
1383
- streamStart: this.host.currentTime
1384
- }), this._hasPlayed = !0);
1385
- }, this._handleVideoPlay = ({ detail: { id: e, key: i, node: s } }) => {
1386
- this._answersViewed[i] || (this._sendTrackingEvent("VOUCH_RESPONSE_VIEWED", {
1387
- answerId: e
1388
- }), this._answersViewed[i] = !0), this._streamStartTime[i] || (this._streamStartTime[i] = s.currentTime, this._streamLatestTime[i] = s.currentTime);
1389
- }, this._handleVideoTimeUpdate = ({ detail: { id: e, key: i, node: s } }) => {
1390
- var n, o;
1391
- // We only want to count any time that the video is actually playing
1392
- !this.host.paused && // Only update the latest time if this event fires for the currently active video
1393
- e === ((o = (n = this.host.scene) == null ? void 0 : n.video) == null ? void 0 : o.id) && (this._currentlyPlayingVideo = { id: e, key: i, node: s }, this._streamLatestTime[i] = s.currentTime);
1394
- }, this._handleVideoPause = ({ detail: { id: e, key: i } }) => {
1395
- this._streamLatestTime[i] > this._streamStartTime[i] + jt && this._sendTrackingEvent("VIDEO_STREAMED", {
1396
- answerId: e,
1397
- streamStart: this._streamStartTime[i],
1398
- streamEnd: this._streamLatestTime[i]
1399
- }), delete this._streamStartTime[i], delete this._streamLatestTime[i];
1400
- }, this._pageUnloading = () => {
1401
- this._streamEnded(), this.host.pause();
1402
- }, this._handleVisibilityChange = () => {
1403
- document.visibilityState === "hidden" && this._pageUnloading();
1404
- }, this._handlePageHide = () => {
459
+ };
460
+ this._handleVideoTimeUpdate = ({ detail: { id, key, node } }) => {
461
+ if (
462
+ // We only want to count any time that the video is actually playing
463
+ !this.host.paused
464
+ ) {
465
+ this._currentlyPlayingVideo = { id, key, node };
466
+ this._streamLatestTime[key] = node.currentTime;
467
+ if (!this._streamStartTime[key]) {
468
+ this._streamStartTime[key] = node.currentTime;
469
+ this._streamLatestTime[key] = node.currentTime;
470
+ }
471
+ }
472
+ };
473
+ this._handleVideoPause = ({ detail: { id, key } }) => {
474
+ if (this._streamLatestTime[key] > this._streamStartTime[key] + MINIMUM_SEND_THRESHOLD) {
475
+ this._createTrackingEvent("VIDEO_STREAMED", {
476
+ answerId: id,
477
+ streamStart: this._streamStartTime[key],
478
+ streamEnd: this._streamLatestTime[key]
479
+ });
480
+ }
481
+ delete this._streamStartTime[key];
482
+ delete this._streamLatestTime[key];
483
+ };
484
+ this._pageUnloading = () => {
485
+ this._streamEnded();
486
+ this._sendTrackingEvent();
487
+ };
488
+ this._handleVisibilityChange = () => {
489
+ if (document.visibilityState === "hidden") {
490
+ this._pageUnloading();
491
+ }
492
+ };
493
+ this._handlePageHide = () => {
1405
494
  this._pageUnloading();
1406
- }, this.host = t, t.addController(this);
1407
- }
1408
- _findVouchId(t) {
1409
- return t && "vouchId" in t ? t.vouchId : this.host.vouch ? this.host.vouch.id : null;
1410
- }
1411
- _getUids() {
1412
- var n, o, h, a, d, c, l, p, u, g, F, ft;
1413
- if (typeof window > "u")
1414
- return {
1415
- client: null,
1416
- tab: null,
1417
- request: P()
1418
- };
1419
- const t = this._visitorId || ((o = (n = window.localStorage) == null ? void 0 : n.getItem) == null ? void 0 : o.call(n, "vouch-uid-visitor")) || this._createVisitor(P()), e = this._clientId || ((a = (h = window.localStorage) == null ? void 0 : h.getItem) == null ? void 0 : a.call(h, "vouch-uid-client")) || P(), i = this._tabId || ((c = (d = window.sessionStorage) == null ? void 0 : d.getItem) == null ? void 0 : c.call(d, "vouch-uid-tab")) || P(), s = P();
1420
- return t !== this._visitorId && (this._visitorId = t, (p = (l = window.localStorage) == null ? void 0 : l.setItem) == null || p.call(l, "vouch-uid-visitor", t)), e !== this._clientId && (this._clientId = e, (g = (u = window.localStorage) == null ? void 0 : u.setItem) == null || g.call(u, "vouch-uid-client", e)), i !== this._tabId && (this._tabId = i, (ft = (F = window.sessionStorage) == null ? void 0 : F.setItem) == null || ft.call(F, "vouch-uid-tab", i)), {
1421
- client: e,
1422
- tab: i,
1423
- request: s,
1424
- visitor: t
1425
495
  };
496
+ this.host = host;
497
+ host.addController(this);
1426
498
  }
1427
499
  hostConnected() {
1428
500
  requestAnimationFrame(() => {
1429
- var t, e, i, s;
1430
- "onvisibilitychange" in document ? document.addEventListener("visibilitychange", this._handleVisibilityChange) : window.addEventListener("pagehide", this._handlePageHide), this.host.addEventListener("vouch:loaded", this._handleVouchLoaded), (t = this.host.mediaPlayer) == null || t.addEventListener("play", this._handlePlay), (e = this.host.mediaPlayer) == null || e.addEventListener("video:play", this._handleVideoPlay), (i = this.host.mediaPlayer) == null || i.addEventListener("video:pause", this._handleVideoPause), (s = this.host.mediaPlayer) == null || s.addEventListener("video:timeupdate", this._handleVideoTimeUpdate);
501
+ var _a, _b, _c, _d;
502
+ if ("onvisibilitychange" in document) {
503
+ document.addEventListener("visibilitychange", this._handleVisibilityChange);
504
+ } else {
505
+ window.addEventListener("pagehide", this._handlePageHide);
506
+ }
507
+ this.host.addEventListener("vouch:loaded", this._handleVouchLoaded);
508
+ (_a = this.host.mediaPlayer) == null ? void 0 : _a.addEventListener("play", this._handlePlay);
509
+ (_b = this.host.mediaPlayer) == null ? void 0 : _b.addEventListener("video:play", this._handleVideoPlay);
510
+ (_c = this.host.mediaPlayer) == null ? void 0 : _c.addEventListener("video:pause", this._handleVideoPause);
511
+ (_d = this.host.mediaPlayer) == null ? void 0 : _d.addEventListener("video:timeupdate", this._handleVideoTimeUpdate);
1431
512
  });
1432
513
  }
1433
514
  hostDisconnected() {
1434
- var t, e, i, s;
1435
- this._streamEnded(), "onvisibilitychange" in document ? document.removeEventListener("visibilitychange", this._handleVisibilityChange) : window.removeEventListener("pagehide", this._handlePageHide), this.host.removeEventListener("vouch:loaded", this._handleVouchLoaded), (t = this.host.mediaPlayer) == null || t.removeEventListener("play", this._handlePlay), (e = this.host.mediaPlayer) == null || e.removeEventListener("video:play", this._handleVideoPlay), (i = this.host.mediaPlayer) == null || i.removeEventListener("video:pause", this._handleVideoPause), (s = this.host.mediaPlayer) == null || s.removeEventListener("video:timeupdate", this._handleVideoTimeUpdate);
515
+ var _a, _b, _c, _d;
516
+ this._pageUnloading();
517
+ if ("onvisibilitychange" in document) {
518
+ document.removeEventListener("visibilitychange", this._handleVisibilityChange);
519
+ } else {
520
+ window.removeEventListener("pagehide", this._handlePageHide);
521
+ }
522
+ this.host.removeEventListener("vouch:loaded", this._handleVouchLoaded);
523
+ (_a = this.host.mediaPlayer) == null ? void 0 : _a.removeEventListener("play", this._handlePlay);
524
+ (_b = this.host.mediaPlayer) == null ? void 0 : _b.removeEventListener("video:play", this._handleVideoPlay);
525
+ (_c = this.host.mediaPlayer) == null ? void 0 : _c.removeEventListener("video:pause", this._handleVideoPause);
526
+ (_d = this.host.mediaPlayer) == null ? void 0 : _d.removeEventListener("video:timeupdate", this._handleVideoTimeUpdate);
1436
527
  }
1437
528
  }
1438
- var Si = Object.defineProperty, wi = Object.getOwnPropertyDescriptor, f = (r, t, e, i) => {
1439
- for (var s = i > 1 ? void 0 : i ? wi(t, e) : t, n = r.length - 1, o; n >= 0; n--)
1440
- (o = r[n]) && (s = (i ? o(t, e, s) : o(s)) || s);
1441
- return i && s && Si(t, e, s), s;
529
+ var __defProp$3 = Object.defineProperty;
530
+ var __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor;
531
+ var __decorateClass$3 = (decorators, target, key, kind) => {
532
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target;
533
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
534
+ if (decorator = decorators[i])
535
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
536
+ if (kind && result)
537
+ __defProp$3(target, key, result);
538
+ return result;
1442
539
  };
1443
- let $ = class extends j {
540
+ let PlayerEmbed = class extends LitElement {
1444
541
  constructor() {
1445
- super(...arguments), this._mediaPlayerRef = qt(), this.env = "prod", this.apiKey = "", this.disableTracking = !1, this.trackingSource = "embed", this.preload = "auto", this.autoplay = !1, this.aspectRatio = 0, this.eventController = new Ze(this, [
542
+ super(...arguments);
543
+ this.env = "prod";
544
+ this.apiKey = "";
545
+ this.disableTracking = false;
546
+ this.trackingSource = "embedded_player";
547
+ this.preload = "auto";
548
+ this.autoplay = false;
549
+ this.aspectRatio = 0;
550
+ this.eventController = new EventForwardController(this, [
1446
551
  "durationchange",
1447
552
  "ended",
1448
553
  "error",
@@ -1453,10 +558,12 @@ let $ = class extends j {
1453
558
  "playing",
1454
559
  "ratechange",
1455
560
  "scenechange",
561
+ "scenesupdate",
1456
562
  "seeking",
1457
563
  "seeked",
1458
564
  "timeupdate",
1459
565
  "volumechange",
566
+ "processing",
1460
567
  "waiting",
1461
568
  "video:loadeddata",
1462
569
  "video:seeking",
@@ -1468,163 +575,573 @@ let $ = class extends j {
1468
575
  "video:timeupdate",
1469
576
  "video:ended",
1470
577
  "video:error"
1471
- ]), this._fetcherController = new oi(this), this._trackingController = new Ei(this);
578
+ ]);
579
+ this._fetcherController = new FetcherController(this);
580
+ this._trackingController = new TrackingController(this);
581
+ this._mediaPlayerRef = createRef();
1472
582
  }
1473
583
  get fetching() {
1474
584
  return this._fetcherController.fetching;
1475
585
  }
1476
586
  get waiting() {
1477
- var r;
1478
- return (r = this._mediaPlayerRef.value) == null ? void 0 : r.waiting;
587
+ var _a;
588
+ return (_a = this._mediaPlayerRef.value) == null ? void 0 : _a.waiting;
589
+ }
590
+ get initialised() {
591
+ var _a;
592
+ return (_a = this._mediaPlayerRef.value) == null ? void 0 : _a.initialised;
1479
593
  }
1480
594
  get seeking() {
1481
- var r;
1482
- return (r = this._mediaPlayerRef.value) == null ? void 0 : r.seeking;
595
+ var _a;
596
+ return (_a = this._mediaPlayerRef.value) == null ? void 0 : _a.seeking;
1483
597
  }
1484
598
  get paused() {
1485
- var r;
1486
- return (r = this._mediaPlayerRef.value) == null ? void 0 : r.paused;
599
+ var _a;
600
+ return (_a = this._mediaPlayerRef.value) == null ? void 0 : _a.paused;
1487
601
  }
1488
602
  get captions() {
1489
- var r;
1490
- return (r = this._mediaPlayerRef.value) == null ? void 0 : r.captions;
603
+ var _a;
604
+ return (_a = this._mediaPlayerRef.value) == null ? void 0 : _a.captions;
1491
605
  }
1492
606
  get fullscreen() {
1493
- var r;
1494
- return (r = this._mediaPlayerRef.value) == null ? void 0 : r.fullscreen;
607
+ var _a;
608
+ return (_a = this._mediaPlayerRef.value) == null ? void 0 : _a.fullscreen;
1495
609
  }
1496
610
  get duration() {
1497
- var r;
1498
- return (r = this._mediaPlayerRef.value) == null ? void 0 : r.duration;
611
+ var _a;
612
+ return (_a = this._mediaPlayerRef.value) == null ? void 0 : _a.duration;
1499
613
  }
1500
- set currentTime(r) {
1501
- this._mediaPlayerRef.value && (this._mediaPlayerRef.value.currentTime = r);
614
+ set currentTime(value) {
615
+ if (this._mediaPlayerRef.value) {
616
+ this._mediaPlayerRef.value.currentTime = value;
617
+ }
1502
618
  }
1503
619
  get currentTime() {
1504
- var r;
1505
- return ((r = this._mediaPlayerRef.value) == null ? void 0 : r.currentTime) ?? 0;
620
+ var _a;
621
+ return ((_a = this._mediaPlayerRef.value) == null ? void 0 : _a.currentTime) ?? 0;
1506
622
  }
1507
- set playbackRate(r) {
1508
- this._mediaPlayerRef.value && (this._mediaPlayerRef.value.playbackRate = r);
623
+ set playbackRate(value) {
624
+ if (this._mediaPlayerRef.value) {
625
+ this._mediaPlayerRef.value.playbackRate = value;
626
+ }
1509
627
  }
1510
628
  get playbackRate() {
1511
- var r;
1512
- return ((r = this._mediaPlayerRef.value) == null ? void 0 : r.playbackRate) ?? 1;
629
+ var _a;
630
+ return ((_a = this._mediaPlayerRef.value) == null ? void 0 : _a.playbackRate) ?? 1;
1513
631
  }
1514
- set volume(r) {
1515
- this._mediaPlayerRef.value && (this._mediaPlayerRef.value.volume = r);
632
+ set volume(value) {
633
+ if (this._mediaPlayerRef.value) {
634
+ this._mediaPlayerRef.value.volume = value;
635
+ }
1516
636
  }
1517
637
  get volume() {
1518
- var r;
1519
- return ((r = this._mediaPlayerRef.value) == null ? void 0 : r.volume) ?? 1;
638
+ var _a;
639
+ return ((_a = this._mediaPlayerRef.value) == null ? void 0 : _a.volume) ?? 1;
1520
640
  }
1521
- set muted(r) {
1522
- this._mediaPlayerRef.value && (this._mediaPlayerRef.value.muted = r);
641
+ set muted(value) {
642
+ if (this._mediaPlayerRef.value) {
643
+ this._mediaPlayerRef.value.muted = value;
644
+ }
1523
645
  }
1524
646
  get muted() {
1525
- var r;
1526
- return ((r = this._mediaPlayerRef.value) == null ? void 0 : r.muted) ?? !1;
1527
- }
1528
- get scene() {
1529
- var r;
1530
- return ((r = this._mediaPlayerRef.value) == null ? void 0 : r.scene) ?? null;
1531
- }
1532
- get scenes() {
1533
- var r;
1534
- return ((r = this._mediaPlayerRef.value) == null ? void 0 : r.scenes) ?? [];
1535
- }
1536
- get sceneConfig() {
1537
- var r;
1538
- return ((r = this._mediaPlayerRef.value) == null ? void 0 : r.sceneConfig) ?? null;
1539
- }
1540
- get videoState() {
1541
- var r;
1542
- return (r = this._mediaPlayerRef.value) == null ? void 0 : r.videoState;
647
+ var _a;
648
+ return ((_a = this._mediaPlayerRef.value) == null ? void 0 : _a.muted) ?? false;
649
+ }
650
+ // get scene(): Scene | null {
651
+ // return this._mediaPlayerRef.value?.scene ?? null;
652
+ // }
653
+ // get scenes(): Scene[] {
654
+ // return this._mediaPlayerRef.value?.scenes ?? [];
655
+ // }
656
+ // get sceneConfig(): Scenes | null {
657
+ // return this._mediaPlayerRef.value?.sceneConfig ?? null;
658
+ // }
659
+ get mediaState() {
660
+ var _a;
661
+ return (_a = this._mediaPlayerRef.value) == null ? void 0 : _a.mediaState;
1543
662
  }
1544
663
  get mediaPlayer() {
1545
664
  return this._mediaPlayerRef.value;
1546
665
  }
1547
666
  play() {
1548
- var r;
1549
- (r = this._mediaPlayerRef.value) == null || r.play();
667
+ var _a;
668
+ (_a = this._mediaPlayerRef.value) == null ? void 0 : _a.play();
1550
669
  }
1551
670
  pause() {
1552
- var r;
1553
- (r = this._mediaPlayerRef.value) == null || r.pause();
671
+ var _a;
672
+ (_a = this._mediaPlayerRef.value) == null ? void 0 : _a.pause();
673
+ }
674
+ reset(time = 0, play = false) {
675
+ var _a;
676
+ (_a = this._mediaPlayerRef.value) == null ? void 0 : _a.reset(time, play);
677
+ }
678
+ // setScene(index: number) {
679
+ // this._mediaPlayerRef.value?.setScene(index);
680
+ // }
681
+ _renderStyles() {
682
+ if (!this.aspectRatio) {
683
+ return html`
684
+ <style>
685
+ :host {
686
+ width: 100%;
687
+ height: 100%;
688
+ }
689
+ </style>
690
+ `;
691
+ }
692
+ if (typeof this.aspectRatio === "number") {
693
+ return html`
694
+ <style>
695
+ :host {
696
+ aspect-ratio: ${this.aspectRatio};
697
+ }
698
+ </style>
699
+ `;
700
+ }
701
+ return null;
1554
702
  }
1555
- setScene(r) {
1556
- var t;
1557
- (t = this._mediaPlayerRef.value) == null || t.setScene(r);
703
+ willUpdate(changedProperties) {
704
+ if (changedProperties.has("vouchId") && this.vouchId !== changedProperties.get("vouchId")) {
705
+ this.reset(0, false);
706
+ }
1558
707
  }
1559
708
  render() {
1560
- return je`
709
+ return html`
710
+ ${this._renderStyles()}
1561
711
  <vmp-media-player
1562
- ${Xt(this._mediaPlayerRef)}
712
+ ${ref(this._mediaPlayerRef)}
1563
713
  ${this.eventController.register()}
1564
714
  ?autoplay=${this.autoplay}
1565
715
  ?loading=${this.fetching}
1566
- .data=${this.vouch}
1567
- .template=${this.template}
1568
- aspectRatio=${gt(this.aspectRatio)}
1569
- preload=${gt(this.preload)}
716
+ aspectRatio=${ifDefined(this.aspectRatio)}
717
+ preload=${ifDefined(this.preload)}
718
+ language=${ifDefined(this.language)}
1570
719
  .controls=${this.controls}
1571
720
  ></vmp-media-player>
1572
721
  `;
1573
722
  }
1574
723
  };
1575
- $.styles = [
1576
- xe`
724
+ PlayerEmbed.styles = [
725
+ css`
726
+ :host {
727
+ display: flex;
728
+ }
729
+ `
730
+ ];
731
+ __decorateClass$3([
732
+ property({ type: Object })
733
+ ], PlayerEmbed.prototype, "data", 2);
734
+ __decorateClass$3([
735
+ property({ type: String })
736
+ ], PlayerEmbed.prototype, "vouchId", 2);
737
+ __decorateClass$3([
738
+ property({ type: String })
739
+ ], PlayerEmbed.prototype, "templateId", 2);
740
+ __decorateClass$3([
741
+ property({ type: Array })
742
+ ], PlayerEmbed.prototype, "questions", 2);
743
+ __decorateClass$3([
744
+ property({ type: String })
745
+ ], PlayerEmbed.prototype, "env", 2);
746
+ __decorateClass$3([
747
+ property({ type: String })
748
+ ], PlayerEmbed.prototype, "apiKey", 2);
749
+ __decorateClass$3([
750
+ property({ type: Boolean })
751
+ ], PlayerEmbed.prototype, "disableTracking", 2);
752
+ __decorateClass$3([
753
+ property({ type: String })
754
+ ], PlayerEmbed.prototype, "trackingSource", 2);
755
+ __decorateClass$3([
756
+ property({ type: Array })
757
+ ], PlayerEmbed.prototype, "controls", 2);
758
+ __decorateClass$3([
759
+ property({ type: String })
760
+ ], PlayerEmbed.prototype, "preload", 2);
761
+ __decorateClass$3([
762
+ property({ type: Boolean })
763
+ ], PlayerEmbed.prototype, "autoplay", 2);
764
+ __decorateClass$3([
765
+ property({ type: Number })
766
+ ], PlayerEmbed.prototype, "aspectRatio", 2);
767
+ __decorateClass$3([
768
+ property({ type: String })
769
+ ], PlayerEmbed.prototype, "language", 2);
770
+ __decorateClass$3([
771
+ state()
772
+ ], PlayerEmbed.prototype, "vouch", 2);
773
+ __decorateClass$3([
774
+ state()
775
+ ], PlayerEmbed.prototype, "template", 2);
776
+ PlayerEmbed = __decorateClass$3([
777
+ customElement("vouch-embed-player")
778
+ ], PlayerEmbed);
779
+ var __defProp$2 = Object.defineProperty;
780
+ var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor;
781
+ var __decorateClass$2 = (decorators, target, key, kind) => {
782
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key) : target;
783
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
784
+ if (decorator = decorators[i])
785
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
786
+ if (kind && result)
787
+ __defProp$2(target, key, result);
788
+ return result;
789
+ };
790
+ let DialogOverlay = class extends LitElement {
791
+ constructor() {
792
+ super(...arguments);
793
+ this.open = false;
794
+ this.aspectRatio = 0;
795
+ }
796
+ render() {
797
+ return html`
798
+ <div
799
+ class=${classMap({
800
+ container: true,
801
+ hidden: !this.open
802
+ })}
803
+ >
804
+ <div
805
+ class="background"
806
+ @click=${() => this.dispatchEvent(new CustomEvent("overlay:click", { bubbles: true, composed: true }))}
807
+ ></div>
808
+ <focus-trap>
809
+ <div
810
+ class=${classMap({
811
+ "video-frame": true,
812
+ grow: this.aspectRatio === 0
813
+ })}
814
+ style=${styleMap({
815
+ aspectRatio: this.aspectRatio
816
+ })}
817
+ >
818
+ <slot></slot>
819
+ <vmp-icon-button
820
+ icon="close"
821
+ rounded="full"
822
+ weight="heavy"
823
+ @click=${() => this.dispatchEvent(new CustomEvent("close:click", { bubbles: true, composed: true }))}
824
+ ></vmp-icon-button>
825
+ </div>
826
+ </focus-trap>
827
+ </div>
828
+ `;
829
+ }
830
+ };
831
+ DialogOverlay.styles = [
832
+ css`
833
+ :host {
834
+ --vouch-media-player-border-radius: var(--vu-media-player-border-radius, 12px);
835
+ --overlay-background-color: var(--vu-overlay-background-color, black);
836
+ --overlay-background-opacity: var(--vu-overlay-background-opacity, 0.4);
837
+
838
+ --dialog-width: var(--vu-dialog-width, 890px);
839
+ --dialog-height: var(--vu-dialog-height, 500px);
840
+ }
841
+
842
+ .container {
843
+ position: fixed;
844
+ display: flex;
845
+ inset: 0;
846
+ opacity: 1;
847
+ z-index: 2147483647;
848
+ align-items: center;
849
+ justify-content: center;
850
+ transition: opacity 100ms ease-in;
851
+ }
852
+
853
+ .hidden {
854
+ opacity: 0;
855
+ pointer-events: none;
856
+ }
857
+
858
+ .background {
859
+ position: absolute;
860
+ inset: 0;
861
+ opacity: var(--overlay-background-opacity);
862
+ background-color: var(--overlay-background-color);
863
+ }
864
+
865
+ focus-trap {
866
+ display: flex;
867
+ align-items: center;
868
+ justify-content: center;
869
+ margin: 40px;
870
+ width: var(--dialog-width);
871
+ height: var(--dialog-height);
872
+ max-width: calc(100% - 80px);
873
+ max-height: calc(100% - 80px);
874
+ }
875
+
876
+ .video-frame {
877
+ position: relative;
878
+ display: flex;
879
+ align-items: center;
880
+ justify-content: center;
881
+ max-width: 100%;
882
+ max-height: 100%;
883
+ }
884
+
885
+ .video-frame.grow {
886
+ width: 100%;
887
+ height: 100%;
888
+ }
889
+
890
+ vmp-icon-button {
891
+ position: absolute;
892
+ top: 0;
893
+ right: 0;
894
+ margin: 10px;
895
+ }
896
+ `
897
+ ];
898
+ __decorateClass$2([
899
+ property({ type: Boolean })
900
+ ], DialogOverlay.prototype, "open", 2);
901
+ __decorateClass$2([
902
+ property({ type: Number })
903
+ ], DialogOverlay.prototype, "aspectRatio", 2);
904
+ DialogOverlay = __decorateClass$2([
905
+ customElement("vouch-embed-dialog-overlay")
906
+ ], DialogOverlay);
907
+ var __defProp$1 = Object.defineProperty;
908
+ var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
909
+ var __decorateClass$1 = (decorators, target, key, kind) => {
910
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target;
911
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
912
+ if (decorator = decorators[i])
913
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
914
+ if (kind && result)
915
+ __defProp$1(target, key, result);
916
+ return result;
917
+ };
918
+ let DialogPortal = class extends LitElement {
919
+ constructor() {
920
+ super(...arguments);
921
+ this.env = "prod";
922
+ this.apiKey = "";
923
+ this.disableTracking = false;
924
+ this.trackingSource = "embedded_player";
925
+ this.preload = "none";
926
+ this.disableAutoplay = false;
927
+ this.aspectRatio = 0;
928
+ this._mediaPlayerRef = createRef();
929
+ this.open = false;
930
+ this._handleToggle = ({ detail }) => {
931
+ var _a, _b, _c;
932
+ if (this.id === detail) {
933
+ this.open = !this.open;
934
+ if (this.open) {
935
+ if (!this.disableAutoplay && ((_a = this._mediaPlayerRef) == null ? void 0 : _a.value)) {
936
+ this._mediaPlayerRef.value.muted = false;
937
+ this._mediaPlayerRef.value.play();
938
+ }
939
+ } else {
940
+ (_c = (_b = this._mediaPlayerRef) == null ? void 0 : _b.value) == null ? void 0 : _c.pause();
941
+ }
942
+ }
943
+ };
944
+ this._handleClose = () => {
945
+ var _a, _b;
946
+ this.open = false;
947
+ (_b = (_a = this._mediaPlayerRef) == null ? void 0 : _a.value) == null ? void 0 : _b.pause();
948
+ };
949
+ this._handleDocumentKeyUp = (e) => {
950
+ if (e.key === "Escape") {
951
+ this._handleClose();
952
+ }
953
+ };
954
+ }
955
+ connectedCallback() {
956
+ super.connectedCallback();
957
+ document.addEventListener("dialogembed:click", this._handleToggle);
958
+ document.addEventListener("keyup", this._handleDocumentKeyUp);
959
+ document.addEventListener("close:click", this._handleClose);
960
+ document.addEventListener("overlay:click", this._handleClose);
961
+ }
962
+ disconnectedCallback() {
963
+ super.disconnectedCallback();
964
+ document.removeEventListener("dialogembed:click", this._handleToggle);
965
+ document.removeEventListener("keyup", this._handleDocumentKeyUp);
966
+ document.removeEventListener("close:click", this._handleClose);
967
+ document.removeEventListener("overlay:click", this._handleClose);
968
+ }
969
+ createRenderRoot() {
970
+ const newNode = document.createElement("div");
971
+ document.body.appendChild(newNode);
972
+ return newNode;
973
+ }
974
+ render() {
975
+ return html`
976
+ <vouch-embed-dialog-overlay ?open=${this.open} aspectRatio=${this.aspectRatio}>
977
+ <vouch-embed-player
978
+ ${ref(this._mediaPlayerRef)}
979
+ style=${styleMap({
980
+ maxWidth: "100%",
981
+ maxHeight: "100%"
982
+ })}
983
+ ?autoplay=${false}
984
+ vouchId=${ifDefined(this.vouchId)}
985
+ templateId=${ifDefined(this.templateId)}
986
+ .questions=${this.questions}
987
+ .controls=${this.controls}
988
+ env=${ifDefined(this.env)}
989
+ apiKey=${ifDefined(this.apiKey)}
990
+ ?disableTracking=${this.disableTracking}
991
+ trackingSource=${ifDefined(this.trackingSource)}
992
+ preload=${ifDefined(this.preload)}
993
+ aspectRatio=${this.aspectRatio}
994
+ ></vouch-embed-player>
995
+ </vouch-embed-dialog-overlay>
996
+ `;
997
+ }
998
+ };
999
+ __decorateClass$1([
1000
+ property({ type: String })
1001
+ ], DialogPortal.prototype, "vouchId", 2);
1002
+ __decorateClass$1([
1003
+ property({ type: String })
1004
+ ], DialogPortal.prototype, "templateId", 2);
1005
+ __decorateClass$1([
1006
+ property({ type: Array })
1007
+ ], DialogPortal.prototype, "questions", 2);
1008
+ __decorateClass$1([
1009
+ property({ type: String })
1010
+ ], DialogPortal.prototype, "env", 2);
1011
+ __decorateClass$1([
1012
+ property({ type: String })
1013
+ ], DialogPortal.prototype, "apiKey", 2);
1014
+ __decorateClass$1([
1015
+ property({ type: Boolean })
1016
+ ], DialogPortal.prototype, "disableTracking", 2);
1017
+ __decorateClass$1([
1018
+ property({ type: String })
1019
+ ], DialogPortal.prototype, "trackingSource", 2);
1020
+ __decorateClass$1([
1021
+ property({ type: Array })
1022
+ ], DialogPortal.prototype, "controls", 2);
1023
+ __decorateClass$1([
1024
+ property({ type: String })
1025
+ ], DialogPortal.prototype, "preload", 2);
1026
+ __decorateClass$1([
1027
+ property({ type: Boolean })
1028
+ ], DialogPortal.prototype, "disableAutoplay", 2);
1029
+ __decorateClass$1([
1030
+ property({ type: Number })
1031
+ ], DialogPortal.prototype, "aspectRatio", 2);
1032
+ __decorateClass$1([
1033
+ state()
1034
+ ], DialogPortal.prototype, "open", 2);
1035
+ DialogPortal = __decorateClass$1([
1036
+ customElement("vouch-embed-dialog-portal")
1037
+ ], DialogPortal);
1038
+ var __defProp = Object.defineProperty;
1039
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
1040
+ var __decorateClass = (decorators, target, key, kind) => {
1041
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
1042
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
1043
+ if (decorator = decorators[i])
1044
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1045
+ if (kind && result)
1046
+ __defProp(target, key, result);
1047
+ return result;
1048
+ };
1049
+ let DialogEmbed = class extends LitElement {
1050
+ constructor() {
1051
+ super(...arguments);
1052
+ this.env = "prod";
1053
+ this.apiKey = "";
1054
+ this.disableTracking = false;
1055
+ this.trackingSource = "embedded_player";
1056
+ this.preload = "none";
1057
+ this.disableAutoplay = false;
1058
+ this.aspectRatio = 0;
1059
+ this._id = v4();
1060
+ this._handleRootClick = () => {
1061
+ this.dispatchEvent(new CustomEvent("dialogembed:click", { detail: this._id, bubbles: true, composed: true }));
1062
+ };
1063
+ }
1064
+ connectedCallback() {
1065
+ super.connectedCallback();
1066
+ this.addEventListener("click", this._handleRootClick);
1067
+ }
1068
+ disconnectedCallback() {
1069
+ super.disconnectedCallback();
1070
+ this.removeEventListener("click", this._handleRootClick);
1071
+ }
1072
+ render() {
1073
+ return html`
1074
+ <slot>
1075
+ <vmp-button size="large">Play</vmp-button>
1076
+ </slot>
1077
+ <vouch-embed-dialog-portal
1078
+ id=${this._id}
1079
+ ?autoplay=${false}
1080
+ vouchId=${ifDefined(this.vouchId)}
1081
+ templateId=${ifDefined(this.templateId)}
1082
+ .questions=${this.questions}
1083
+ .controls=${this.controls}
1084
+ env=${ifDefined(this.env)}
1085
+ apiKey=${ifDefined(this.apiKey)}
1086
+ ?disableTracking=${this.disableTracking}
1087
+ trackingSource=${ifDefined(this.trackingSource)}
1088
+ preload=${ifDefined(this.preload)}
1089
+ aspectRatio=${this.aspectRatio}
1090
+ ></vouch-embed-dialog-portal>
1091
+ `;
1092
+ }
1093
+ };
1094
+ DialogEmbed.styles = [
1095
+ css`
1577
1096
  :host {
1097
+ --vu-button-padding: 10px 20px;
1098
+ --vu-button-background: #287179;
1099
+ --vu-button-background-hover: #4faab2;
1100
+
1578
1101
  display: flex;
1102
+ width: fit-content;
1103
+ height: fit-content;
1579
1104
  }
1580
1105
  `
1581
1106
  ];
1582
- f([
1583
- y({ type: Object })
1584
- ], $.prototype, "data", 2);
1585
- f([
1586
- y({ type: String })
1587
- ], $.prototype, "vouchId", 2);
1588
- f([
1589
- y({ type: String })
1590
- ], $.prototype, "templateId", 2);
1591
- f([
1592
- y({ type: Array })
1593
- ], $.prototype, "questions", 2);
1594
- f([
1595
- y({ type: String })
1596
- ], $.prototype, "env", 2);
1597
- f([
1598
- y({ type: String })
1599
- ], $.prototype, "apiKey", 2);
1600
- f([
1601
- y({ type: Boolean })
1602
- ], $.prototype, "disableTracking", 2);
1603
- f([
1604
- y({ type: String })
1605
- ], $.prototype, "trackingSource", 2);
1606
- f([
1607
- y({ type: Array })
1608
- ], $.prototype, "controls", 2);
1609
- f([
1610
- y({ type: String })
1611
- ], $.prototype, "preload", 2);
1612
- f([
1613
- y({ type: Boolean })
1614
- ], $.prototype, "autoplay", 2);
1615
- f([
1616
- y({ type: Number })
1617
- ], $.prototype, "aspectRatio", 2);
1618
- f([
1619
- Wt()
1620
- ], $.prototype, "vouch", 2);
1621
- f([
1622
- Wt()
1623
- ], $.prototype, "template", 2);
1624
- $ = f([
1625
- de("vouch-embed")
1626
- ], $);
1107
+ __decorateClass([
1108
+ property({ type: String })
1109
+ ], DialogEmbed.prototype, "vouchId", 2);
1110
+ __decorateClass([
1111
+ property({ type: String })
1112
+ ], DialogEmbed.prototype, "templateId", 2);
1113
+ __decorateClass([
1114
+ property({ type: Array })
1115
+ ], DialogEmbed.prototype, "questions", 2);
1116
+ __decorateClass([
1117
+ property({ type: String })
1118
+ ], DialogEmbed.prototype, "env", 2);
1119
+ __decorateClass([
1120
+ property({ type: String })
1121
+ ], DialogEmbed.prototype, "apiKey", 2);
1122
+ __decorateClass([
1123
+ property({ type: Boolean })
1124
+ ], DialogEmbed.prototype, "disableTracking", 2);
1125
+ __decorateClass([
1126
+ property({ type: String })
1127
+ ], DialogEmbed.prototype, "trackingSource", 2);
1128
+ __decorateClass([
1129
+ property({ type: Array })
1130
+ ], DialogEmbed.prototype, "controls", 2);
1131
+ __decorateClass([
1132
+ property({ type: String })
1133
+ ], DialogEmbed.prototype, "preload", 2);
1134
+ __decorateClass([
1135
+ property({ type: Boolean })
1136
+ ], DialogEmbed.prototype, "disableAutoplay", 2);
1137
+ __decorateClass([
1138
+ property({ type: Number })
1139
+ ], DialogEmbed.prototype, "aspectRatio", 2);
1140
+ DialogEmbed = __decorateClass([
1141
+ customElement("vouch-embed-dialog")
1142
+ ], DialogEmbed);
1627
1143
  export {
1628
- $ as Embed
1144
+ DialogEmbed,
1145
+ PlayerEmbed
1629
1146
  };
1630
1147
  //# sourceMappingURL=embeds.js.map