@vouchfor/embeds 0.0.0-experiment.5d16720 → 0.0.0-experiment.607fdcd
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/components/Embed/controllers/fetcher.d.ts +0 -7
- package/dist/es/components/Embed/controllers/tracking.d.ts +3 -2
- package/dist/es/components/Embed/index.d.ts +66 -0
- package/dist/es/embeds.js +896 -618
- package/dist/es/embeds.js.map +1 -1
- package/dist/es/utils/env.d.ts +5 -11
- package/dist/iife/embeds.iife.js +327 -374
- package/dist/iife/embeds.iife.js.map +1 -1
- package/package.json +6 -6
- package/src/components/Embed/Embed.stories.ts +7 -20
- package/src/components/Embed/controllers/fetcher.ts +63 -45
- package/src/components/Embed/controllers/tracking.ts +67 -59
- package/src/components/Embed/index.ts +13 -19
- package/src/utils/env.ts +18 -32
- package/dist/es/components/Embed/controllers/event-forwarder.d.ts +0 -14
package/dist/es/embeds.js
CHANGED
@@ -1,24 +1,25 @@
|
|
1
|
-
import { property as
|
2
|
-
import { ifDefined as
|
3
|
-
import { createRef as
|
4
|
-
import { Task as
|
1
|
+
import { property as v, state as zt, customElement as he } from "lit/decorators.js";
|
2
|
+
import { ifDefined as ft } from "lit/directives/if-defined.js";
|
3
|
+
import { createRef as jt, ref as Bt } from "lit/directives/ref.js";
|
4
|
+
import { Task as ae } from "@lit/task";
|
5
|
+
import { v4 as P } from "uuid";
|
5
6
|
import "@vouchfor/media-player";
|
6
7
|
/**
|
7
8
|
* @license
|
8
9
|
* Copyright 2019 Google LLC
|
9
10
|
* SPDX-License-Identifier: BSD-3-Clause
|
10
11
|
*/
|
11
|
-
const
|
12
|
-
let
|
12
|
+
const G = globalThis, _t = G.ShadowRoot && (G.ShadyCSS === void 0 || G.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Wt = Symbol(), gt = /* @__PURE__ */ new WeakMap();
|
13
|
+
let le = class {
|
13
14
|
constructor(t, e, i) {
|
14
|
-
if (this._$cssResult$ = !0, i !==
|
15
|
+
if (this._$cssResult$ = !0, i !== Wt)
|
15
16
|
throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
16
17
|
this.cssText = t, this.t = e;
|
17
18
|
}
|
18
19
|
get styleSheet() {
|
19
20
|
let t = this.o;
|
20
21
|
const e = this.t;
|
21
|
-
if (
|
22
|
+
if (_t && t === void 0) {
|
22
23
|
const i = e !== void 0 && e.length === 1;
|
23
24
|
i && (t = gt.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && gt.set(e, t));
|
24
25
|
}
|
@@ -28,176 +29,201 @@ let te = class {
|
|
28
29
|
return this.cssText;
|
29
30
|
}
|
30
31
|
};
|
31
|
-
const
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
32
|
+
const ce = (r) => new le(typeof r == "string" ? r : r + "", void 0, Wt), de = (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
|
+
}, vt = _t ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
|
37
41
|
let e = "";
|
38
42
|
for (const i of t.cssRules)
|
39
43
|
e += i.cssText;
|
40
|
-
return
|
41
|
-
})(
|
44
|
+
return ce(e);
|
45
|
+
})(r) : r;
|
42
46
|
/**
|
43
47
|
* @license
|
44
48
|
* Copyright 2017 Google LLC
|
45
49
|
* SPDX-License-Identifier: BSD-3-Clause
|
46
50
|
*/
|
47
|
-
|
48
|
-
const K = window, At = K.trustedTypes, se = At ? At.emptyScript : "", yt = K.reactiveElementPolyfillSupport, ct = { toAttribute(n, t) {
|
51
|
+
const { is: pe, defineProperty: ue, getOwnPropertyDescriptor: _e, getOwnPropertyNames: $e, getOwnPropertySymbols: me, getPrototypeOf: fe } = Object, E = globalThis, yt = E.trustedTypes, ge = yt ? yt.emptyScript : "", rt = E.reactiveElementPolyfillSupport, I = (r, t) => r, dt = { toAttribute(r, t) {
|
49
52
|
switch (t) {
|
50
53
|
case Boolean:
|
51
|
-
|
54
|
+
r = r ? ge : null;
|
52
55
|
break;
|
53
56
|
case Object:
|
54
57
|
case Array:
|
55
|
-
|
58
|
+
r = r == null ? r : JSON.stringify(r);
|
56
59
|
}
|
57
|
-
return
|
58
|
-
}, fromAttribute(
|
59
|
-
let e =
|
60
|
+
return r;
|
61
|
+
}, fromAttribute(r, t) {
|
62
|
+
let e = r;
|
60
63
|
switch (t) {
|
61
64
|
case Boolean:
|
62
|
-
e =
|
65
|
+
e = r !== null;
|
63
66
|
break;
|
64
67
|
case Number:
|
65
|
-
e =
|
68
|
+
e = r === null ? null : Number(r);
|
66
69
|
break;
|
67
70
|
case Object:
|
68
71
|
case Array:
|
69
72
|
try {
|
70
|
-
e = JSON.parse(
|
73
|
+
e = JSON.parse(r);
|
71
74
|
} catch {
|
72
75
|
e = null;
|
73
76
|
}
|
74
77
|
}
|
75
78
|
return e;
|
76
|
-
} },
|
77
|
-
|
78
|
-
|
79
|
-
super(), this._$Ei = /* @__PURE__ */ new Map(), this.isUpdatePending = !1, this.hasUpdated = !1, this._$El = null, this.u();
|
80
|
-
}
|
79
|
+
} }, qt = (r, t) => !pe(r, t), At = { attribute: !0, type: String, converter: dt, reflect: !1, hasChanged: qt };
|
80
|
+
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), E.litPropertyMetadata ?? (E.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
81
|
+
let L = class extends HTMLElement {
|
81
82
|
static addInitializer(t) {
|
82
|
-
|
83
|
-
this.finalize(), ((e = this.h) !== null && e !== void 0 ? e : this.h = []).push(t);
|
83
|
+
this._$Ei(), (this.l ?? (this.l = [])).push(t);
|
84
84
|
}
|
85
85
|
static get observedAttributes() {
|
86
|
-
this.finalize();
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
}
|
93
|
-
static createProperty(t, e = st) {
|
94
|
-
if (e.state && (e.attribute = !1), this.finalize(), this.elementProperties.set(t, e), !e.noAccessor && !this.prototype.hasOwnProperty(t)) {
|
95
|
-
const i = typeof t == "symbol" ? Symbol() : "__" + t, s = this.getPropertyDescriptor(t, i, e);
|
96
|
-
s !== void 0 && Object.defineProperty(this.prototype, t, s);
|
86
|
+
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
87
|
+
}
|
88
|
+
static createProperty(t, e = At) {
|
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 && ue(this.prototype, t, s);
|
97
92
|
}
|
98
93
|
}
|
99
94
|
static getPropertyDescriptor(t, e, i) {
|
100
|
-
|
95
|
+
const { get: s, set: n } = _e(this.prototype, t) ?? { get() {
|
101
96
|
return this[e];
|
102
|
-
}, set(
|
103
|
-
|
104
|
-
|
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 a = s == null ? void 0 : s.call(this);
|
104
|
+
n.call(this, o), this.requestUpdate(t, a, i);
|
105
105
|
}, configurable: !0, enumerable: !0 };
|
106
106
|
}
|
107
107
|
static getPropertyOptions(t) {
|
108
|
-
return this.elementProperties.get(t)
|
108
|
+
return this.elementProperties.get(t) ?? At;
|
109
|
+
}
|
110
|
+
static _$Ei() {
|
111
|
+
if (this.hasOwnProperty(I("elementProperties")))
|
112
|
+
return;
|
113
|
+
const t = fe(this);
|
114
|
+
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
109
115
|
}
|
110
116
|
static finalize() {
|
111
|
-
if (this.hasOwnProperty(
|
112
|
-
return
|
113
|
-
this
|
114
|
-
|
115
|
-
if (t.finalize(), t.h !== void 0 && (this.h = [...t.h]), this.elementProperties = new Map(t.elementProperties), this._$Ev = /* @__PURE__ */ new Map(), this.hasOwnProperty("properties")) {
|
116
|
-
const e = this.properties, i = [...Object.getOwnPropertyNames(e), ...Object.getOwnPropertySymbols(e)];
|
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 = [...$e(e), ...me(e)];
|
117
121
|
for (const s of i)
|
118
122
|
this.createProperty(s, e[s]);
|
119
123
|
}
|
120
|
-
|
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);
|
121
137
|
}
|
122
138
|
static finalizeStyles(t) {
|
123
139
|
const e = [];
|
124
140
|
if (Array.isArray(t)) {
|
125
141
|
const i = new Set(t.flat(1 / 0).reverse());
|
126
142
|
for (const s of i)
|
127
|
-
e.unshift(
|
143
|
+
e.unshift(vt(s));
|
128
144
|
} else
|
129
|
-
t !== void 0 && e.push(
|
145
|
+
t !== void 0 && e.push(vt(t));
|
130
146
|
return e;
|
131
147
|
}
|
132
|
-
static _$
|
148
|
+
static _$Eu(t, e) {
|
133
149
|
const i = e.attribute;
|
134
150
|
return i === !1 ? void 0 : typeof i == "string" ? i : typeof t == "string" ? t.toLowerCase() : void 0;
|
135
151
|
}
|
136
|
-
|
152
|
+
constructor() {
|
153
|
+
super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
|
154
|
+
}
|
155
|
+
_$Ev() {
|
137
156
|
var t;
|
138
|
-
this._$
|
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));
|
139
158
|
}
|
140
159
|
addController(t) {
|
141
|
-
var e
|
142
|
-
(
|
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));
|
143
162
|
}
|
144
163
|
removeController(t) {
|
145
164
|
var e;
|
146
|
-
(e = this._$
|
165
|
+
(e = this._$E_) == null || e.delete(t);
|
147
166
|
}
|
148
|
-
_$
|
149
|
-
|
150
|
-
|
151
|
-
|
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);
|
152
172
|
}
|
153
173
|
createRenderRoot() {
|
154
|
-
|
155
|
-
|
156
|
-
return ie(e, this.constructor.elementStyles), e;
|
174
|
+
const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
175
|
+
return de(t, this.constructor.elementStyles), t;
|
157
176
|
}
|
158
177
|
connectedCallback() {
|
159
178
|
var t;
|
160
|
-
this.renderRoot
|
179
|
+
this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$E_) == null || t.forEach((e) => {
|
161
180
|
var i;
|
162
|
-
return (i = e.hostConnected)
|
181
|
+
return (i = e.hostConnected) == null ? void 0 : i.call(e);
|
163
182
|
});
|
164
183
|
}
|
165
184
|
enableUpdating(t) {
|
166
185
|
}
|
167
186
|
disconnectedCallback() {
|
168
187
|
var t;
|
169
|
-
(t = this._$
|
188
|
+
(t = this._$E_) == null || t.forEach((e) => {
|
170
189
|
var i;
|
171
|
-
return (i = e.hostDisconnected)
|
190
|
+
return (i = e.hostDisconnected) == null ? void 0 : i.call(e);
|
172
191
|
});
|
173
192
|
}
|
174
193
|
attributeChangedCallback(t, e, i) {
|
175
194
|
this._$AK(t, i);
|
176
195
|
}
|
177
|
-
_$EO(t, e
|
178
|
-
var
|
179
|
-
const
|
180
|
-
if (
|
181
|
-
const o = (((
|
182
|
-
this._$
|
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 : dt).toAttribute(e, i.type);
|
201
|
+
this._$Em = t, o == null ? this.removeAttribute(s) : this.setAttribute(s, o), this._$Em = null;
|
183
202
|
}
|
184
203
|
}
|
185
204
|
_$AK(t, e) {
|
186
|
-
var
|
187
|
-
const
|
188
|
-
if (
|
189
|
-
const o =
|
190
|
-
this._$
|
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), a = typeof o.converter == "function" ? { fromAttribute: o.converter } : ((n = o.converter) == null ? void 0 : n.fromAttribute) !== void 0 ? o.converter : dt;
|
209
|
+
this._$Em = s, this[s] = a.fromAttribute(e, o.type), this._$Em = null;
|
191
210
|
}
|
192
211
|
}
|
193
|
-
requestUpdate(t, e, i) {
|
194
|
-
|
195
|
-
|
212
|
+
requestUpdate(t, e, i, s = !1, n) {
|
213
|
+
if (t !== void 0) {
|
214
|
+
if (i ?? (i = this.constructor.getPropertyOptions(t)), !(i.hasChanged ?? qt)(s ? n : this[t], e))
|
215
|
+
return;
|
216
|
+
this.C(t, e, i);
|
217
|
+
}
|
218
|
+
this.isUpdatePending === !1 && (this._$Eg = this._$EP());
|
196
219
|
}
|
197
|
-
|
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() {
|
198
224
|
this.isUpdatePending = !0;
|
199
225
|
try {
|
200
|
-
await this._$
|
226
|
+
await this._$Eg;
|
201
227
|
} catch (e) {
|
202
228
|
Promise.reject(e);
|
203
229
|
}
|
@@ -208,139 +234,141 @@ let T = class extends HTMLElement {
|
|
208
234
|
return this.performUpdate();
|
209
235
|
}
|
210
236
|
performUpdate() {
|
211
|
-
var
|
237
|
+
var i;
|
212
238
|
if (!this.isUpdatePending)
|
213
239
|
return;
|
214
|
-
|
215
|
-
|
216
|
-
|
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;
|
217
253
|
try {
|
218
|
-
|
219
|
-
var
|
220
|
-
return (
|
221
|
-
}), this.update(
|
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();
|
222
258
|
} catch (s) {
|
223
|
-
throw
|
259
|
+
throw t = !1, this._$ET(), s;
|
224
260
|
}
|
225
|
-
|
261
|
+
t && this._$AE(e);
|
226
262
|
}
|
227
263
|
willUpdate(t) {
|
228
264
|
}
|
229
265
|
_$AE(t) {
|
230
266
|
var e;
|
231
|
-
(e = this._$
|
267
|
+
(e = this._$E_) == null || e.forEach((i) => {
|
232
268
|
var s;
|
233
|
-
return (s = i.hostUpdated)
|
269
|
+
return (s = i.hostUpdated) == null ? void 0 : s.call(i);
|
234
270
|
}), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
|
235
271
|
}
|
236
|
-
_$
|
272
|
+
_$ET() {
|
237
273
|
this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
|
238
274
|
}
|
239
275
|
get updateComplete() {
|
240
276
|
return this.getUpdateComplete();
|
241
277
|
}
|
242
278
|
getUpdateComplete() {
|
243
|
-
return this._$
|
279
|
+
return this._$Eg;
|
244
280
|
}
|
245
281
|
shouldUpdate(t) {
|
246
282
|
return !0;
|
247
283
|
}
|
248
284
|
update(t) {
|
249
|
-
this._$
|
285
|
+
this._$Ej && (this._$Ej = this._$Ej.forEach((e) => this._$EO(e, this[e]))), this._$ET();
|
250
286
|
}
|
251
287
|
updated(t) {
|
252
288
|
}
|
253
289
|
firstUpdated(t) {
|
254
290
|
}
|
255
291
|
};
|
256
|
-
|
292
|
+
L.elementStyles = [], L.shadowRootOptions = { mode: "open" }, L[I("elementProperties")] = /* @__PURE__ */ new Map(), L[I("finalized")] = /* @__PURE__ */ new Map(), rt == null || rt({ ReactiveElement: L }), (E.reactiveElementVersions ?? (E.reactiveElementVersions = [])).push("2.0.2");
|
257
293
|
/**
|
258
294
|
* @license
|
259
295
|
* Copyright 2017 Google LLC
|
260
296
|
* SPDX-License-Identifier: BSD-3-Clause
|
261
297
|
*/
|
262
|
-
|
263
|
-
|
264
|
-
\f\r]
|
265
|
-
|
266
|
-
|
267
|
-
if (!Array.isArray(n) || !n.hasOwnProperty("raw"))
|
298
|
+
const V = globalThis, Y = V.trustedTypes, Et = Y ? Y.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, Xt = "$lit$", y = `lit$${(Math.random() + "").slice(9)}$`, Kt = "?" + y, ve = `<${Kt}>`, U = document, Q = () => U.createComment(""), B = (r) => r === null || typeof r != "object" && typeof r != "function", Jt = Array.isArray, ye = (r) => Jt(r) || typeof (r == null ? void 0 : r[Symbol.iterator]) == "function", nt = `[
|
299
|
+
\f\r]`, M = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, St = /-->/g, bt = />/g, b = RegExp(`>|${nt}(?:([^\\s"'>=/]+)(${nt}*=${nt}*(?:[^
|
300
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), wt = /'/g, Pt = /"/g, Ft = /^(?:script|style|textarea|title)$/i, W = Symbol.for("lit-noChange"), _ = Symbol.for("lit-nothing"), Ct = /* @__PURE__ */ new WeakMap(), C = U.createTreeWalker(U, 129);
|
301
|
+
function Gt(r, t) {
|
302
|
+
if (!Array.isArray(r) || !r.hasOwnProperty("raw"))
|
268
303
|
throw Error("invalid template strings array");
|
269
304
|
return Et !== void 0 ? Et.createHTML(t) : t;
|
270
305
|
}
|
271
|
-
const
|
272
|
-
const e =
|
273
|
-
let s,
|
274
|
-
for (let
|
275
|
-
const
|
276
|
-
let
|
277
|
-
for (;
|
278
|
-
|
279
|
-
const
|
280
|
-
|
281
|
-
}
|
282
|
-
return [
|
306
|
+
const Ae = (r, t) => {
|
307
|
+
const e = r.length - 1, i = [];
|
308
|
+
let s, n = t === 2 ? "<svg>" : "", o = M;
|
309
|
+
for (let a = 0; a < e; a++) {
|
310
|
+
const h = r[a];
|
311
|
+
let c, d, l = -1, p = 0;
|
312
|
+
for (; p < h.length && (o.lastIndex = p, d = o.exec(h), d !== null); )
|
313
|
+
p = o.lastIndex, o === M ? d[1] === "!--" ? o = St : d[1] !== void 0 ? o = bt : d[2] !== void 0 ? (Ft.test(d[2]) && (s = RegExp("</" + d[2], "g")), o = b) : d[3] !== void 0 && (o = b) : o === b ? d[0] === ">" ? (o = s ?? M, l = -1) : d[1] === void 0 ? l = -2 : (l = o.lastIndex - d[2].length, c = d[1], o = d[3] === void 0 ? b : d[3] === '"' ? Pt : wt) : o === Pt || o === wt ? o = b : o === St || o === bt ? o = M : (o = b, s = void 0);
|
314
|
+
const u = o === b && r[a + 1].startsWith("/>") ? " " : "";
|
315
|
+
n += o === M ? h + ve : l >= 0 ? (i.push(c), h.slice(0, l) + Xt + h.slice(l) + y + u) : h + y + (l === -2 ? a : u);
|
316
|
+
}
|
317
|
+
return [Gt(r, n + (r[e] || "<?>") + (t === 2 ? "</svg>" : "")), i];
|
283
318
|
};
|
284
|
-
let
|
319
|
+
let pt = class Zt {
|
285
320
|
constructor({ strings: t, _$litType$: e }, i) {
|
286
321
|
let s;
|
287
322
|
this.parts = [];
|
288
|
-
let
|
289
|
-
const
|
290
|
-
if (this.el = Zt.createElement(
|
291
|
-
const
|
292
|
-
|
323
|
+
let n = 0, o = 0;
|
324
|
+
const a = t.length - 1, h = this.parts, [c, d] = Ae(t, e);
|
325
|
+
if (this.el = Zt.createElement(c, i), C.currentNode = this.el.content, e === 2) {
|
326
|
+
const l = this.el.content.firstChild;
|
327
|
+
l.replaceWith(...l.childNodes);
|
293
328
|
}
|
294
|
-
for (; (s =
|
329
|
+
for (; (s = C.nextNode()) !== null && h.length < a; ) {
|
295
330
|
if (s.nodeType === 1) {
|
296
|
-
if (s.hasAttributes())
|
297
|
-
const
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
if (qt.test(s.tagName)) {
|
311
|
-
const a = s.textContent.split(E), c = a.length - 1;
|
312
|
-
if (c > 0) {
|
313
|
-
s.textContent = x ? x.emptyScript : "";
|
314
|
-
for (let p = 0; p < c; p++)
|
315
|
-
s.append(a[p], G()), P.nextNode(), l.push({ type: 2, index: ++r });
|
316
|
-
s.append(a[c], G());
|
331
|
+
if (s.hasAttributes())
|
332
|
+
for (const l of s.getAttributeNames())
|
333
|
+
if (l.endsWith(Xt)) {
|
334
|
+
const p = d[o++], u = s.getAttribute(l).split(y), g = /([.?@])?(.*)/.exec(p);
|
335
|
+
h.push({ type: 1, index: n, name: g[2], strings: u, ctor: g[1] === "." ? Se : g[1] === "?" ? be : g[1] === "@" ? we : it }), s.removeAttribute(l);
|
336
|
+
} else
|
337
|
+
l.startsWith(y) && (h.push({ type: 6, index: n }), s.removeAttribute(l));
|
338
|
+
if (Ft.test(s.tagName)) {
|
339
|
+
const l = s.textContent.split(y), 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(), h.push({ type: 2, index: ++n });
|
344
|
+
s.append(l[p], Q());
|
317
345
|
}
|
318
346
|
}
|
319
347
|
} else if (s.nodeType === 8)
|
320
|
-
if (s.data ===
|
321
|
-
|
348
|
+
if (s.data === Kt)
|
349
|
+
h.push({ type: 2, index: n });
|
322
350
|
else {
|
323
|
-
let
|
324
|
-
for (; (
|
325
|
-
|
351
|
+
let l = -1;
|
352
|
+
for (; (l = s.data.indexOf(y, l + 1)) !== -1; )
|
353
|
+
h.push({ type: 7, index: n }), l += y.length - 1;
|
326
354
|
}
|
327
|
-
|
355
|
+
n++;
|
328
356
|
}
|
329
357
|
}
|
330
358
|
static createElement(t, e) {
|
331
|
-
const i =
|
359
|
+
const i = U.createElement("template");
|
332
360
|
return i.innerHTML = t, i;
|
333
361
|
}
|
334
362
|
};
|
335
|
-
function H(
|
336
|
-
var
|
337
|
-
if (t ===
|
363
|
+
function H(r, t, e = r, i) {
|
364
|
+
var o, a;
|
365
|
+
if (t === W)
|
338
366
|
return t;
|
339
|
-
let
|
340
|
-
const
|
341
|
-
return (
|
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 && ((a = s == null ? void 0 : s._$AO) == null || a.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;
|
342
370
|
}
|
343
|
-
let
|
371
|
+
let Ee = class {
|
344
372
|
constructor(t, e) {
|
345
373
|
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
|
346
374
|
}
|
@@ -351,32 +379,30 @@ let le = class {
|
|
351
379
|
return this._$AM._$AU;
|
352
380
|
}
|
353
381
|
u(t) {
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
let o = P.nextNode(), d = 0, l = 0, h = s[0];
|
382
|
+
const { el: { content: e }, parts: i } = this._$AD, s = ((t == null ? void 0 : t.creationScope) ?? U).importNode(e, !0);
|
383
|
+
C.currentNode = s;
|
384
|
+
let n = C.nextNode(), o = 0, a = 0, h = i[0];
|
358
385
|
for (; h !== void 0; ) {
|
359
|
-
if (
|
360
|
-
let
|
361
|
-
h.type === 2 ?
|
386
|
+
if (o === h.index) {
|
387
|
+
let c;
|
388
|
+
h.type === 2 ? c = new Yt(n, n.nextSibling, this, t) : h.type === 1 ? c = new h.ctor(n, h.name, h.strings, this, t) : h.type === 6 && (c = new Pe(n, this, t)), this._$AV.push(c), h = i[++a];
|
362
389
|
}
|
363
|
-
|
390
|
+
o !== (h == null ? void 0 : h.index) && (n = C.nextNode(), o++);
|
364
391
|
}
|
365
|
-
return
|
392
|
+
return C.currentNode = U, s;
|
366
393
|
}
|
367
|
-
|
394
|
+
p(t) {
|
368
395
|
let e = 0;
|
369
396
|
for (const i of this._$AV)
|
370
397
|
i !== void 0 && (i.strings !== void 0 ? (i._$AI(t, i, e), e += i.strings.length - 2) : i._$AI(t[e])), e++;
|
371
398
|
}
|
372
|
-
},
|
373
|
-
constructor(t, e, i, s) {
|
374
|
-
var r;
|
375
|
-
this.type = 2, this._$AH = v, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = i, this.options = s, this._$Cp = (r = s == null ? void 0 : s.isConnected) === null || r === void 0 || r;
|
376
|
-
}
|
399
|
+
}, Yt = class Qt {
|
377
400
|
get _$AU() {
|
378
|
-
var t
|
379
|
-
return (
|
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;
|
380
406
|
}
|
381
407
|
get parentNode() {
|
382
408
|
let t = this._$AA.parentNode;
|
@@ -390,7 +416,7 @@ let le = class {
|
|
390
416
|
return this._$AB;
|
391
417
|
}
|
392
418
|
_$AI(t, e = this) {
|
393
|
-
t = H(this, t, e),
|
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) : ye(t) ? this.T(t) : this._(t);
|
394
420
|
}
|
395
421
|
k(t) {
|
396
422
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
@@ -399,100 +425,96 @@ let le = class {
|
|
399
425
|
this._$AH !== t && (this._$AR(), this._$AH = this.k(t));
|
400
426
|
}
|
401
427
|
_(t) {
|
402
|
-
this._$AH !==
|
428
|
+
this._$AH !== _ && B(this._$AH) ? this._$AA.nextSibling.data = t : this.$(U.createTextNode(t)), this._$AH = t;
|
403
429
|
}
|
404
430
|
g(t) {
|
405
|
-
var
|
406
|
-
const { values:
|
407
|
-
if (((
|
408
|
-
this._$AH.
|
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(Gt(i.h, i.h[0]), this.options)), i);
|
433
|
+
if (((n = this._$AH) == null ? void 0 : n._$AD) === s)
|
434
|
+
this._$AH.p(e);
|
409
435
|
else {
|
410
|
-
const o = new
|
411
|
-
o.
|
436
|
+
const o = new Ee(s, this), a = o.u(this.options);
|
437
|
+
o.p(e), this.$(a), this._$AH = o;
|
412
438
|
}
|
413
439
|
}
|
414
440
|
_$AC(t) {
|
415
|
-
let e =
|
416
|
-
return e === void 0 &&
|
441
|
+
let e = Ct.get(t.strings);
|
442
|
+
return e === void 0 && Ct.set(t.strings, e = new pt(t)), e;
|
417
443
|
}
|
418
444
|
T(t) {
|
419
|
-
|
445
|
+
Jt(this._$AH) || (this._$AH = [], this._$AR());
|
420
446
|
const e = this._$AH;
|
421
447
|
let i, s = 0;
|
422
|
-
for (const
|
423
|
-
s === e.length ? e.push(i = new
|
448
|
+
for (const n of t)
|
449
|
+
s === e.length ? e.push(i = new Qt(this.k(Q()), this.k(Q()), this, this.options)) : i = e[s], i._$AI(n), s++;
|
424
450
|
s < e.length && (this._$AR(i && i._$AB.nextSibling, s), e.length = s);
|
425
451
|
}
|
426
452
|
_$AR(t = this._$AA.nextSibling, e) {
|
427
453
|
var i;
|
428
|
-
for ((i = this._$AP)
|
454
|
+
for ((i = this._$AP) == null ? void 0 : i.call(this, !1, !0, e); t && t !== this._$AB; ) {
|
429
455
|
const s = t.nextSibling;
|
430
456
|
t.remove(), t = s;
|
431
457
|
}
|
432
458
|
}
|
433
459
|
setConnected(t) {
|
434
460
|
var e;
|
435
|
-
this._$AM === void 0 && (this._$
|
436
|
-
}
|
437
|
-
}, Q = class {
|
438
|
-
constructor(t, e, i, s, r) {
|
439
|
-
this.type = 1, this._$AH = v, this._$AN = void 0, this.element = t, this.name = e, this._$AM = s, this.options = r, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = v;
|
461
|
+
this._$AM === void 0 && (this._$Cv = t, (e = this._$AP) == null || e.call(this, t));
|
440
462
|
}
|
463
|
+
}, it = class {
|
441
464
|
get tagName() {
|
442
465
|
return this.element.tagName;
|
443
466
|
}
|
444
467
|
get _$AU() {
|
445
468
|
return this._$AM._$AU;
|
446
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
|
+
}
|
447
473
|
_$AI(t, e = this, i, s) {
|
448
|
-
const
|
474
|
+
const n = this.strings;
|
449
475
|
let o = !1;
|
450
|
-
if (
|
451
|
-
t = H(this, t, e, 0), o = !
|
476
|
+
if (n === void 0)
|
477
|
+
t = H(this, t, e, 0), o = !B(t) || t !== this._$AH && t !== W, o && (this._$AH = t);
|
452
478
|
else {
|
453
|
-
const
|
454
|
-
let
|
455
|
-
for (t =
|
456
|
-
|
479
|
+
const a = t;
|
480
|
+
let h, c;
|
481
|
+
for (t = n[0], h = 0; h < n.length - 1; h++)
|
482
|
+
c = H(this, a[i + h], e, h), c === W && (c = this._$AH[h]), o || (o = !B(c) || c !== this._$AH[h]), c === _ ? t = _ : t !== _ && (t += (c ?? "") + n[h + 1]), this._$AH[h] = c;
|
457
483
|
}
|
458
|
-
o && !s && this.
|
484
|
+
o && !s && this.O(t);
|
459
485
|
}
|
460
|
-
|
461
|
-
t ===
|
486
|
+
O(t) {
|
487
|
+
t === _ ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
462
488
|
}
|
463
|
-
},
|
489
|
+
}, Se = class extends it {
|
464
490
|
constructor() {
|
465
491
|
super(...arguments), this.type = 3;
|
466
492
|
}
|
467
|
-
|
468
|
-
this.element[this.name] = t ===
|
493
|
+
O(t) {
|
494
|
+
this.element[this.name] = t === _ ? void 0 : t;
|
469
495
|
}
|
470
|
-
}
|
471
|
-
const ae = x ? x.emptyScript : "";
|
472
|
-
let de = class extends Q {
|
496
|
+
}, be = class extends it {
|
473
497
|
constructor() {
|
474
498
|
super(...arguments), this.type = 4;
|
475
499
|
}
|
476
|
-
|
477
|
-
|
500
|
+
O(t) {
|
501
|
+
this.element.toggleAttribute(this.name, !!t && t !== _);
|
478
502
|
}
|
479
|
-
},
|
480
|
-
constructor(t, e, i, s,
|
481
|
-
super(t, e, i, s,
|
503
|
+
}, we = class extends it {
|
504
|
+
constructor(t, e, i, s, n) {
|
505
|
+
super(t, e, i, s, n), this.type = 5;
|
482
506
|
}
|
483
507
|
_$AI(t, e = this) {
|
484
|
-
|
485
|
-
if ((t = (i = H(this, t, e, 0)) !== null && i !== void 0 ? i : v) === j)
|
508
|
+
if ((t = H(this, t, e, 0) ?? _) === W)
|
486
509
|
return;
|
487
|
-
const
|
488
|
-
|
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;
|
489
512
|
}
|
490
513
|
handleEvent(t) {
|
491
|
-
var e
|
492
|
-
typeof this._$AH == "function" ? this._$AH.call((
|
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);
|
493
516
|
}
|
494
|
-
}
|
495
|
-
class ue {
|
517
|
+
}, Pe = class {
|
496
518
|
constructor(t, e, i) {
|
497
519
|
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = i;
|
498
520
|
}
|
@@ -502,77 +524,358 @@ class ue {
|
|
502
524
|
_$AI(t) {
|
503
525
|
H(this, t);
|
504
526
|
}
|
527
|
+
};
|
528
|
+
const ot = V.litHtmlPolyfillSupport;
|
529
|
+
ot == null || ot(pt, Yt), (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, $t = Z.ShadowRoot && (Z.ShadyCSS === void 0 || Z.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, te = Symbol(), Tt = /* @__PURE__ */ new WeakMap();
|
536
|
+
let Ce = class {
|
537
|
+
constructor(t, e, i) {
|
538
|
+
if (this._$cssResult$ = !0, i !== te)
|
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 ($t && t === void 0) {
|
546
|
+
const i = e !== void 0 && e.length === 1;
|
547
|
+
i && (t = Tt.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && Tt.set(e, t));
|
548
|
+
}
|
549
|
+
return t;
|
550
|
+
}
|
551
|
+
toString() {
|
552
|
+
return this.cssText;
|
553
|
+
}
|
554
|
+
};
|
555
|
+
const Te = (r) => new Ce(typeof r == "string" ? r : r + "", void 0, te), Ue = (r, t) => {
|
556
|
+
if ($t)
|
557
|
+
r.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
|
558
|
+
else
|
559
|
+
for (const e of t) {
|
560
|
+
const i = document.createElement("style"), s = Z.litNonce;
|
561
|
+
s !== void 0 && i.setAttribute("nonce", s), i.textContent = e.cssText, r.appendChild(i);
|
562
|
+
}
|
563
|
+
}, Ut = $t ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
|
564
|
+
let e = "";
|
565
|
+
for (const i of t.cssRules)
|
566
|
+
e += i.cssText;
|
567
|
+
return Te(e);
|
568
|
+
})(r) : r;
|
569
|
+
/**
|
570
|
+
* @license
|
571
|
+
* Copyright 2017 Google LLC
|
572
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
573
|
+
*/
|
574
|
+
const { is: Re, defineProperty: xe, getOwnPropertyDescriptor: He, getOwnPropertyNames: Oe, getOwnPropertySymbols: Ne, getPrototypeOf: Le } = Object, S = globalThis, Rt = S.trustedTypes, Me = Rt ? Rt.emptyScript : "", ht = S.reactiveElementPolyfillSupport, D = (r, t) => r, ut = { toAttribute(r, t) {
|
575
|
+
switch (t) {
|
576
|
+
case Boolean:
|
577
|
+
r = r ? Me : null;
|
578
|
+
break;
|
579
|
+
case Object:
|
580
|
+
case Array:
|
581
|
+
r = r == null ? r : JSON.stringify(r);
|
582
|
+
}
|
583
|
+
return r;
|
584
|
+
}, fromAttribute(r, t) {
|
585
|
+
let e = r;
|
586
|
+
switch (t) {
|
587
|
+
case Boolean:
|
588
|
+
e = r !== null;
|
589
|
+
break;
|
590
|
+
case Number:
|
591
|
+
e = r === null ? null : Number(r);
|
592
|
+
break;
|
593
|
+
case Object:
|
594
|
+
case Array:
|
595
|
+
try {
|
596
|
+
e = JSON.parse(r);
|
597
|
+
} catch {
|
598
|
+
e = null;
|
599
|
+
}
|
600
|
+
}
|
601
|
+
return e;
|
602
|
+
} }, ee = (r, t) => !Re(r, t), xt = { attribute: !0, type: String, converter: ut, reflect: !1, hasChanged: ee };
|
603
|
+
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), S.litPropertyMetadata ?? (S.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
604
|
+
class x extends HTMLElement {
|
605
|
+
static addInitializer(t) {
|
606
|
+
this._$Ei(), (this.l ?? (this.l = [])).push(t);
|
607
|
+
}
|
608
|
+
static get observedAttributes() {
|
609
|
+
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
610
|
+
}
|
611
|
+
static createProperty(t, e = xt) {
|
612
|
+
if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) {
|
613
|
+
const i = Symbol(), s = this.getPropertyDescriptor(t, i, e);
|
614
|
+
s !== void 0 && xe(this.prototype, t, s);
|
615
|
+
}
|
616
|
+
}
|
617
|
+
static getPropertyDescriptor(t, e, i) {
|
618
|
+
const { get: s, set: n } = He(this.prototype, t) ?? { get() {
|
619
|
+
return this[e];
|
620
|
+
}, set(o) {
|
621
|
+
this[e] = o;
|
622
|
+
} };
|
623
|
+
return { get() {
|
624
|
+
return s == null ? void 0 : s.call(this);
|
625
|
+
}, set(o) {
|
626
|
+
const a = s == null ? void 0 : s.call(this);
|
627
|
+
n.call(this, o), this.requestUpdate(t, a, i);
|
628
|
+
}, configurable: !0, enumerable: !0 };
|
629
|
+
}
|
630
|
+
static getPropertyOptions(t) {
|
631
|
+
return this.elementProperties.get(t) ?? xt;
|
632
|
+
}
|
633
|
+
static _$Ei() {
|
634
|
+
if (this.hasOwnProperty(D("elementProperties")))
|
635
|
+
return;
|
636
|
+
const t = Le(this);
|
637
|
+
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
638
|
+
}
|
639
|
+
static finalize() {
|
640
|
+
if (this.hasOwnProperty(D("finalized")))
|
641
|
+
return;
|
642
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(D("properties"))) {
|
643
|
+
const e = this.properties, i = [...Oe(e), ...Ne(e)];
|
644
|
+
for (const s of i)
|
645
|
+
this.createProperty(s, e[s]);
|
646
|
+
}
|
647
|
+
const t = this[Symbol.metadata];
|
648
|
+
if (t !== null) {
|
649
|
+
const e = litPropertyMetadata.get(t);
|
650
|
+
if (e !== void 0)
|
651
|
+
for (const [i, s] of e)
|
652
|
+
this.elementProperties.set(i, s);
|
653
|
+
}
|
654
|
+
this._$Eh = /* @__PURE__ */ new Map();
|
655
|
+
for (const [e, i] of this.elementProperties) {
|
656
|
+
const s = this._$Eu(e, i);
|
657
|
+
s !== void 0 && this._$Eh.set(s, e);
|
658
|
+
}
|
659
|
+
this.elementStyles = this.finalizeStyles(this.styles);
|
660
|
+
}
|
661
|
+
static finalizeStyles(t) {
|
662
|
+
const e = [];
|
663
|
+
if (Array.isArray(t)) {
|
664
|
+
const i = new Set(t.flat(1 / 0).reverse());
|
665
|
+
for (const s of i)
|
666
|
+
e.unshift(Ut(s));
|
667
|
+
} else
|
668
|
+
t !== void 0 && e.push(Ut(t));
|
669
|
+
return e;
|
670
|
+
}
|
671
|
+
static _$Eu(t, e) {
|
672
|
+
const i = e.attribute;
|
673
|
+
return i === !1 ? void 0 : typeof i == "string" ? i : typeof t == "string" ? t.toLowerCase() : void 0;
|
674
|
+
}
|
675
|
+
constructor() {
|
676
|
+
super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
|
677
|
+
}
|
678
|
+
_$Ev() {
|
679
|
+
var t;
|
680
|
+
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));
|
681
|
+
}
|
682
|
+
addController(t) {
|
683
|
+
var e;
|
684
|
+
(this._$E_ ?? (this._$E_ = /* @__PURE__ */ new Set())).add(t), this.renderRoot !== void 0 && this.isConnected && ((e = t.hostConnected) == null || e.call(t));
|
685
|
+
}
|
686
|
+
removeController(t) {
|
687
|
+
var e;
|
688
|
+
(e = this._$E_) == null || e.delete(t);
|
689
|
+
}
|
690
|
+
_$ES() {
|
691
|
+
const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties;
|
692
|
+
for (const i of e.keys())
|
693
|
+
this.hasOwnProperty(i) && (t.set(i, this[i]), delete this[i]);
|
694
|
+
t.size > 0 && (this._$Ep = t);
|
695
|
+
}
|
696
|
+
createRenderRoot() {
|
697
|
+
const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
698
|
+
return Ue(t, this.constructor.elementStyles), t;
|
699
|
+
}
|
700
|
+
connectedCallback() {
|
701
|
+
var t;
|
702
|
+
this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$E_) == null || t.forEach((e) => {
|
703
|
+
var i;
|
704
|
+
return (i = e.hostConnected) == null ? void 0 : i.call(e);
|
705
|
+
});
|
706
|
+
}
|
707
|
+
enableUpdating(t) {
|
708
|
+
}
|
709
|
+
disconnectedCallback() {
|
710
|
+
var t;
|
711
|
+
(t = this._$E_) == null || t.forEach((e) => {
|
712
|
+
var i;
|
713
|
+
return (i = e.hostDisconnected) == null ? void 0 : i.call(e);
|
714
|
+
});
|
715
|
+
}
|
716
|
+
attributeChangedCallback(t, e, i) {
|
717
|
+
this._$AK(t, i);
|
718
|
+
}
|
719
|
+
_$EO(t, e) {
|
720
|
+
var n;
|
721
|
+
const i = this.constructor.elementProperties.get(t), s = this.constructor._$Eu(t, i);
|
722
|
+
if (s !== void 0 && i.reflect === !0) {
|
723
|
+
const o = (((n = i.converter) == null ? void 0 : n.toAttribute) !== void 0 ? i.converter : ut).toAttribute(e, i.type);
|
724
|
+
this._$Em = t, o == null ? this.removeAttribute(s) : this.setAttribute(s, o), this._$Em = null;
|
725
|
+
}
|
726
|
+
}
|
727
|
+
_$AK(t, e) {
|
728
|
+
var n;
|
729
|
+
const i = this.constructor, s = i._$Eh.get(t);
|
730
|
+
if (s !== void 0 && this._$Em !== s) {
|
731
|
+
const o = i.getPropertyOptions(s), a = typeof o.converter == "function" ? { fromAttribute: o.converter } : ((n = o.converter) == null ? void 0 : n.fromAttribute) !== void 0 ? o.converter : ut;
|
732
|
+
this._$Em = s, this[s] = a.fromAttribute(e, o.type), this._$Em = null;
|
733
|
+
}
|
734
|
+
}
|
735
|
+
requestUpdate(t, e, i, s = !1, n) {
|
736
|
+
if (t !== void 0) {
|
737
|
+
if (i ?? (i = this.constructor.getPropertyOptions(t)), !(i.hasChanged ?? ee)(s ? n : this[t], e))
|
738
|
+
return;
|
739
|
+
this.C(t, e, i);
|
740
|
+
}
|
741
|
+
this.isUpdatePending === !1 && (this._$Eg = this._$EP());
|
742
|
+
}
|
743
|
+
C(t, e, i) {
|
744
|
+
this._$AL.has(t) || this._$AL.set(t, e), i.reflect === !0 && this._$Em !== t && (this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Set())).add(t);
|
745
|
+
}
|
746
|
+
async _$EP() {
|
747
|
+
this.isUpdatePending = !0;
|
748
|
+
try {
|
749
|
+
await this._$Eg;
|
750
|
+
} catch (e) {
|
751
|
+
Promise.reject(e);
|
752
|
+
}
|
753
|
+
const t = this.scheduleUpdate();
|
754
|
+
return t != null && await t, !this.isUpdatePending;
|
755
|
+
}
|
756
|
+
scheduleUpdate() {
|
757
|
+
return this.performUpdate();
|
758
|
+
}
|
759
|
+
performUpdate() {
|
760
|
+
var i;
|
761
|
+
if (!this.isUpdatePending)
|
762
|
+
return;
|
763
|
+
if (!this.hasUpdated) {
|
764
|
+
if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
|
765
|
+
for (const [n, o] of this._$Ep)
|
766
|
+
this[n] = o;
|
767
|
+
this._$Ep = void 0;
|
768
|
+
}
|
769
|
+
const s = this.constructor.elementProperties;
|
770
|
+
if (s.size > 0)
|
771
|
+
for (const [n, o] of s)
|
772
|
+
o.wrapped !== !0 || this._$AL.has(n) || this[n] === void 0 || this.C(n, this[n], o);
|
773
|
+
}
|
774
|
+
let t = !1;
|
775
|
+
const e = this._$AL;
|
776
|
+
try {
|
777
|
+
t = this.shouldUpdate(e), t ? (this.willUpdate(e), (i = this._$E_) == null || i.forEach((s) => {
|
778
|
+
var n;
|
779
|
+
return (n = s.hostUpdate) == null ? void 0 : n.call(s);
|
780
|
+
}), this.update(e)) : this._$ET();
|
781
|
+
} catch (s) {
|
782
|
+
throw t = !1, this._$ET(), s;
|
783
|
+
}
|
784
|
+
t && this._$AE(e);
|
785
|
+
}
|
786
|
+
willUpdate(t) {
|
787
|
+
}
|
788
|
+
_$AE(t) {
|
789
|
+
var e;
|
790
|
+
(e = this._$E_) == null || e.forEach((i) => {
|
791
|
+
var s;
|
792
|
+
return (s = i.hostUpdated) == null ? void 0 : s.call(i);
|
793
|
+
}), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
|
794
|
+
}
|
795
|
+
_$ET() {
|
796
|
+
this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
|
797
|
+
}
|
798
|
+
get updateComplete() {
|
799
|
+
return this.getUpdateComplete();
|
800
|
+
}
|
801
|
+
getUpdateComplete() {
|
802
|
+
return this._$Eg;
|
803
|
+
}
|
804
|
+
shouldUpdate(t) {
|
805
|
+
return !0;
|
806
|
+
}
|
807
|
+
update(t) {
|
808
|
+
this._$Ej && (this._$Ej = this._$Ej.forEach((e) => this._$EO(e, this[e]))), this._$ET();
|
809
|
+
}
|
810
|
+
updated(t) {
|
811
|
+
}
|
812
|
+
firstUpdated(t) {
|
813
|
+
}
|
505
814
|
}
|
506
|
-
|
507
|
-
Ct == null || Ct(vt, Ft), ((nt = J.litHtmlVersions) !== null && nt !== void 0 ? nt : J.litHtmlVersions = []).push("2.8.0");
|
815
|
+
x.elementStyles = [], x.shadowRootOptions = { mode: "open" }, x[D("elementProperties")] = /* @__PURE__ */ new Map(), x[D("finalized")] = /* @__PURE__ */ new Map(), ht == null || ht({ ReactiveElement: x }), (S.reactiveElementVersions ?? (S.reactiveElementVersions = [])).push("2.0.2");
|
508
816
|
/**
|
509
817
|
* @license
|
510
818
|
* Copyright 2017 Google LLC
|
511
819
|
* SPDX-License-Identifier: BSD-3-Clause
|
512
820
|
*/
|
513
|
-
|
514
|
-
|
515
|
-
\f\r]
|
516
|
-
|
517
|
-
|
518
|
-
let s, r = t === 2 ? "<svg>" : "", o = M;
|
519
|
-
for (let l = 0; l < e; l++) {
|
520
|
-
const h = n[l];
|
521
|
-
let u, a, c = -1, p = 0;
|
522
|
-
for (; p < h.length && (o.lastIndex = p, a = o.exec(h), a !== null); )
|
523
|
-
p = o.lastIndex, o === M ? a[1] === "!--" ? o = Tt : a[1] !== void 0 ? o = xt : a[2] !== void 0 ? (Xt.test(a[2]) && (s = RegExp("</" + a[2], "g")), o = S) : a[3] !== void 0 && (o = S) : o === S ? a[0] === ">" ? (o = s ?? M, c = -1) : a[1] === void 0 ? c = -2 : (c = o.lastIndex - a[2].length, u = a[1], o = a[3] === void 0 ? S : a[3] === '"' ? Nt : Ht) : o === Nt || o === Ht ? o = S : o === Tt || o === xt ? o = M : (o = S, s = void 0);
|
524
|
-
const y = o === S && n[l + 1].startsWith("/>") ? " " : "";
|
525
|
-
r += o === M ? h + pe : c >= 0 ? (i.push(u), h.slice(0, c) + _t + h.slice(c) + w + y) : h + w + (c === -2 ? (i.push(void 0), l) : y);
|
526
|
-
}
|
527
|
-
const d = r + (n[e] || "<?>") + (t === 2 ? "</svg>" : "");
|
528
|
-
if (!Array.isArray(n) || !n.hasOwnProperty("raw"))
|
821
|
+
const z = globalThis, tt = z.trustedTypes, Ht = tt ? tt.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, ie = "$lit$", A = `lit$${(Math.random() + "").slice(9)}$`, se = "?" + A, ke = `<${se}>`, R = document, q = () => R.createComment(""), X = (r) => r === null || typeof r != "object" && typeof r != "function", re = Array.isArray, Ie = (r) => re(r) || typeof (r == null ? void 0 : r[Symbol.iterator]) == "function", at = `[
|
822
|
+
\f\r]`, k = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Ot = /-->/g, Nt = />/g, w = RegExp(`>|${at}(?:([^\\s"'>=/]+)(${at}*=${at}*(?:[^
|
823
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), Lt = /'/g, Mt = /"/g, ne = /^(?:script|style|textarea|title)$/i, Ve = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), De = Ve(1), O = Symbol.for("lit-noChange"), $ = Symbol.for("lit-nothing"), kt = /* @__PURE__ */ new WeakMap(), T = R.createTreeWalker(R, 129);
|
824
|
+
function oe(r, t) {
|
825
|
+
if (!Array.isArray(r) || !r.hasOwnProperty("raw"))
|
529
826
|
throw Error("invalid template strings array");
|
530
|
-
return
|
827
|
+
return Ht !== void 0 ? Ht.createHTML(t) : t;
|
828
|
+
}
|
829
|
+
const ze = (r, t) => {
|
830
|
+
const e = r.length - 1, i = [];
|
831
|
+
let s, n = t === 2 ? "<svg>" : "", o = k;
|
832
|
+
for (let a = 0; a < e; a++) {
|
833
|
+
const h = r[a];
|
834
|
+
let c, d, l = -1, p = 0;
|
835
|
+
for (; p < h.length && (o.lastIndex = p, d = o.exec(h), d !== null); )
|
836
|
+
p = o.lastIndex, o === k ? d[1] === "!--" ? o = Ot : d[1] !== void 0 ? o = Nt : d[2] !== void 0 ? (ne.test(d[2]) && (s = RegExp("</" + d[2], "g")), o = w) : d[3] !== void 0 && (o = w) : o === w ? d[0] === ">" ? (o = s ?? k, l = -1) : d[1] === void 0 ? l = -2 : (l = o.lastIndex - d[2].length, c = d[1], o = d[3] === void 0 ? w : d[3] === '"' ? Mt : Lt) : o === Mt || o === Lt ? o = w : o === Ot || o === Nt ? o = k : (o = w, s = void 0);
|
837
|
+
const u = o === w && r[a + 1].startsWith("/>") ? " " : "";
|
838
|
+
n += o === k ? h + ke : l >= 0 ? (i.push(c), h.slice(0, l) + ie + h.slice(l) + A + u) : h + A + (l === -2 ? a : u);
|
839
|
+
}
|
840
|
+
return [oe(r, n + (r[e] || "<?>") + (t === 2 ? "</svg>" : "")), i];
|
531
841
|
};
|
532
|
-
class
|
842
|
+
class K {
|
533
843
|
constructor({ strings: t, _$litType$: e }, i) {
|
534
844
|
let s;
|
535
845
|
this.parts = [];
|
536
|
-
let
|
537
|
-
const
|
538
|
-
if (this.el =
|
539
|
-
const
|
540
|
-
|
846
|
+
let n = 0, o = 0;
|
847
|
+
const a = t.length - 1, h = this.parts, [c, d] = ze(t, e);
|
848
|
+
if (this.el = K.createElement(c, i), T.currentNode = this.el.content, e === 2) {
|
849
|
+
const l = this.el.content.firstChild;
|
850
|
+
l.replaceWith(...l.childNodes);
|
541
851
|
}
|
542
|
-
for (; (s =
|
852
|
+
for (; (s = T.nextNode()) !== null && h.length < a; ) {
|
543
853
|
if (s.nodeType === 1) {
|
544
|
-
if (s.hasAttributes())
|
545
|
-
const
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
if (Xt.test(s.tagName)) {
|
559
|
-
const a = s.textContent.split(w), c = a.length - 1;
|
560
|
-
if (c > 0) {
|
561
|
-
s.textContent = N ? N.emptyScript : "";
|
562
|
-
for (let p = 0; p < c; p++)
|
563
|
-
s.append(a[p], B()), U.nextNode(), l.push({ type: 2, index: ++r });
|
564
|
-
s.append(a[c], B());
|
854
|
+
if (s.hasAttributes())
|
855
|
+
for (const l of s.getAttributeNames())
|
856
|
+
if (l.endsWith(ie)) {
|
857
|
+
const p = d[o++], u = s.getAttribute(l).split(A), g = /([.?@])?(.*)/.exec(p);
|
858
|
+
h.push({ type: 1, index: n, name: g[2], strings: u, ctor: g[1] === "." ? Be : g[1] === "?" ? We : g[1] === "@" ? qe : st }), s.removeAttribute(l);
|
859
|
+
} else
|
860
|
+
l.startsWith(A) && (h.push({ type: 6, index: n }), s.removeAttribute(l));
|
861
|
+
if (ne.test(s.tagName)) {
|
862
|
+
const l = s.textContent.split(A), p = l.length - 1;
|
863
|
+
if (p > 0) {
|
864
|
+
s.textContent = tt ? tt.emptyScript : "";
|
865
|
+
for (let u = 0; u < p; u++)
|
866
|
+
s.append(l[u], q()), T.nextNode(), h.push({ type: 2, index: ++n });
|
867
|
+
s.append(l[p], q());
|
565
868
|
}
|
566
869
|
}
|
567
870
|
} else if (s.nodeType === 8)
|
568
|
-
if (s.data ===
|
569
|
-
|
871
|
+
if (s.data === se)
|
872
|
+
h.push({ type: 2, index: n });
|
570
873
|
else {
|
571
|
-
let
|
572
|
-
for (; (
|
573
|
-
|
874
|
+
let l = -1;
|
875
|
+
for (; (l = s.data.indexOf(A, l + 1)) !== -1; )
|
876
|
+
h.push({ type: 7, index: n }), l += A.length - 1;
|
574
877
|
}
|
575
|
-
|
878
|
+
n++;
|
576
879
|
}
|
577
880
|
}
|
578
881
|
static createElement(t, e) {
|
@@ -580,15 +883,15 @@ class q {
|
|
580
883
|
return i.innerHTML = t, i;
|
581
884
|
}
|
582
885
|
}
|
583
|
-
function
|
584
|
-
var
|
585
|
-
if (t ===
|
886
|
+
function N(r, t, e = r, i) {
|
887
|
+
var o, a;
|
888
|
+
if (t === O)
|
586
889
|
return t;
|
587
|
-
let
|
588
|
-
const
|
589
|
-
return (
|
890
|
+
let s = i !== void 0 ? (o = e._$Co) == null ? void 0 : o[i] : e._$Cl;
|
891
|
+
const n = X(t) ? void 0 : t._$litDirective$;
|
892
|
+
return (s == null ? void 0 : s.constructor) !== n && ((a = s == null ? void 0 : s._$AO) == null || a.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 = N(r, s._$AS(r, t.values), s, i)), t;
|
590
893
|
}
|
591
|
-
class
|
894
|
+
class je {
|
592
895
|
constructor(t, e) {
|
593
896
|
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
|
594
897
|
}
|
@@ -599,33 +902,31 @@ class ge {
|
|
599
902
|
return this._$AM._$AU;
|
600
903
|
}
|
601
904
|
u(t) {
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
let o = U.nextNode(), d = 0, l = 0, h = s[0];
|
905
|
+
const { el: { content: e }, parts: i } = this._$AD, s = ((t == null ? void 0 : t.creationScope) ?? R).importNode(e, !0);
|
906
|
+
T.currentNode = s;
|
907
|
+
let n = T.nextNode(), o = 0, a = 0, h = i[0];
|
606
908
|
for (; h !== void 0; ) {
|
607
|
-
if (
|
608
|
-
let
|
609
|
-
h.type === 2 ?
|
909
|
+
if (o === h.index) {
|
910
|
+
let c;
|
911
|
+
h.type === 2 ? c = new J(n, n.nextSibling, this, t) : h.type === 1 ? c = new h.ctor(n, h.name, h.strings, this, t) : h.type === 6 && (c = new Xe(n, this, t)), this._$AV.push(c), h = i[++a];
|
610
912
|
}
|
611
|
-
|
913
|
+
o !== (h == null ? void 0 : h.index) && (n = T.nextNode(), o++);
|
612
914
|
}
|
613
|
-
return
|
915
|
+
return T.currentNode = R, s;
|
614
916
|
}
|
615
|
-
|
917
|
+
p(t) {
|
616
918
|
let e = 0;
|
617
919
|
for (const i of this._$AV)
|
618
920
|
i !== void 0 && (i.strings !== void 0 ? (i._$AI(t, i, e), e += i.strings.length - 2) : i._$AI(t[e])), e++;
|
619
921
|
}
|
620
922
|
}
|
621
|
-
class
|
622
|
-
constructor(t, e, i, s) {
|
623
|
-
var r;
|
624
|
-
this.type = 2, this._$AH = _, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = i, this.options = s, this._$Cp = (r = s == null ? void 0 : s.isConnected) === null || r === void 0 || r;
|
625
|
-
}
|
923
|
+
class J {
|
626
924
|
get _$AU() {
|
627
|
-
var t
|
628
|
-
return (
|
925
|
+
var t;
|
926
|
+
return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
|
927
|
+
}
|
928
|
+
constructor(t, e, i, s) {
|
929
|
+
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;
|
629
930
|
}
|
630
931
|
get parentNode() {
|
631
932
|
let t = this._$AA.parentNode;
|
@@ -639,7 +940,7 @@ class W {
|
|
639
940
|
return this._$AB;
|
640
941
|
}
|
641
942
|
_$AI(t, e = this) {
|
642
|
-
t =
|
943
|
+
t = N(this, t, e), X(t) ? t === $ || t == null || t === "" ? (this._$AH !== $ && this._$AR(), this._$AH = $) : t !== this._$AH && t !== O && this._(t) : t._$litType$ !== void 0 ? this.g(t) : t.nodeType !== void 0 ? this.$(t) : Ie(t) ? this.T(t) : this._(t);
|
643
944
|
}
|
644
945
|
k(t) {
|
645
946
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
@@ -648,103 +949,101 @@ class W {
|
|
648
949
|
this._$AH !== t && (this._$AR(), this._$AH = this.k(t));
|
649
950
|
}
|
650
951
|
_(t) {
|
651
|
-
this._$AH !==
|
952
|
+
this._$AH !== $ && X(this._$AH) ? this._$AA.nextSibling.data = t : this.$(R.createTextNode(t)), this._$AH = t;
|
652
953
|
}
|
653
954
|
g(t) {
|
654
|
-
var
|
655
|
-
const { values:
|
656
|
-
if (((
|
657
|
-
this._$AH.
|
955
|
+
var n;
|
956
|
+
const { values: e, _$litType$: i } = t, s = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = K.createElement(oe(i.h, i.h[0]), this.options)), i);
|
957
|
+
if (((n = this._$AH) == null ? void 0 : n._$AD) === s)
|
958
|
+
this._$AH.p(e);
|
658
959
|
else {
|
659
|
-
const o = new
|
660
|
-
o.
|
960
|
+
const o = new je(s, this), a = o.u(this.options);
|
961
|
+
o.p(e), this.$(a), this._$AH = o;
|
661
962
|
}
|
662
963
|
}
|
663
964
|
_$AC(t) {
|
664
|
-
let e =
|
665
|
-
return e === void 0 &&
|
965
|
+
let e = kt.get(t.strings);
|
966
|
+
return e === void 0 && kt.set(t.strings, e = new K(t)), e;
|
666
967
|
}
|
667
968
|
T(t) {
|
668
|
-
|
969
|
+
re(this._$AH) || (this._$AH = [], this._$AR());
|
669
970
|
const e = this._$AH;
|
670
971
|
let i, s = 0;
|
671
|
-
for (const
|
672
|
-
s === e.length ? e.push(i = new
|
972
|
+
for (const n of t)
|
973
|
+
s === e.length ? e.push(i = new J(this.k(q()), this.k(q()), this, this.options)) : i = e[s], i._$AI(n), s++;
|
673
974
|
s < e.length && (this._$AR(i && i._$AB.nextSibling, s), e.length = s);
|
674
975
|
}
|
675
976
|
_$AR(t = this._$AA.nextSibling, e) {
|
676
977
|
var i;
|
677
|
-
for ((i = this._$AP)
|
978
|
+
for ((i = this._$AP) == null ? void 0 : i.call(this, !1, !0, e); t && t !== this._$AB; ) {
|
678
979
|
const s = t.nextSibling;
|
679
980
|
t.remove(), t = s;
|
680
981
|
}
|
681
982
|
}
|
682
983
|
setConnected(t) {
|
683
984
|
var e;
|
684
|
-
this._$AM === void 0 && (this._$
|
985
|
+
this._$AM === void 0 && (this._$Cv = t, (e = this._$AP) == null || e.call(this, t));
|
685
986
|
}
|
686
987
|
}
|
687
|
-
class
|
688
|
-
constructor(t, e, i, s, r) {
|
689
|
-
this.type = 1, this._$AH = _, this._$AN = void 0, this.element = t, this.name = e, this._$AM = s, this.options = r, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = _;
|
690
|
-
}
|
988
|
+
class st {
|
691
989
|
get tagName() {
|
692
990
|
return this.element.tagName;
|
693
991
|
}
|
694
992
|
get _$AU() {
|
695
993
|
return this._$AM._$AU;
|
696
994
|
}
|
995
|
+
constructor(t, e, i, s, n) {
|
996
|
+
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 = $;
|
997
|
+
}
|
697
998
|
_$AI(t, e = this, i, s) {
|
698
|
-
const
|
999
|
+
const n = this.strings;
|
699
1000
|
let o = !1;
|
700
|
-
if (
|
701
|
-
t =
|
1001
|
+
if (n === void 0)
|
1002
|
+
t = N(this, t, e, 0), o = !X(t) || t !== this._$AH && t !== O, o && (this._$AH = t);
|
702
1003
|
else {
|
703
|
-
const
|
704
|
-
let
|
705
|
-
for (t =
|
706
|
-
|
1004
|
+
const a = t;
|
1005
|
+
let h, c;
|
1006
|
+
for (t = n[0], h = 0; h < n.length - 1; h++)
|
1007
|
+
c = N(this, a[i + h], e, h), c === O && (c = this._$AH[h]), o || (o = !X(c) || c !== this._$AH[h]), c === $ ? t = $ : t !== $ && (t += (c ?? "") + n[h + 1]), this._$AH[h] = c;
|
707
1008
|
}
|
708
|
-
o && !s && this.
|
1009
|
+
o && !s && this.O(t);
|
709
1010
|
}
|
710
|
-
|
711
|
-
t ===
|
1011
|
+
O(t) {
|
1012
|
+
t === $ ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
712
1013
|
}
|
713
1014
|
}
|
714
|
-
class
|
1015
|
+
class Be extends st {
|
715
1016
|
constructor() {
|
716
1017
|
super(...arguments), this.type = 3;
|
717
1018
|
}
|
718
|
-
|
719
|
-
this.element[this.name] = t ===
|
1019
|
+
O(t) {
|
1020
|
+
this.element[this.name] = t === $ ? void 0 : t;
|
720
1021
|
}
|
721
1022
|
}
|
722
|
-
|
723
|
-
class ye extends tt {
|
1023
|
+
class We extends st {
|
724
1024
|
constructor() {
|
725
1025
|
super(...arguments), this.type = 4;
|
726
1026
|
}
|
727
|
-
|
728
|
-
|
1027
|
+
O(t) {
|
1028
|
+
this.element.toggleAttribute(this.name, !!t && t !== $);
|
729
1029
|
}
|
730
1030
|
}
|
731
|
-
class
|
732
|
-
constructor(t, e, i, s,
|
733
|
-
super(t, e, i, s,
|
1031
|
+
class qe extends st {
|
1032
|
+
constructor(t, e, i, s, n) {
|
1033
|
+
super(t, e, i, s, n), this.type = 5;
|
734
1034
|
}
|
735
1035
|
_$AI(t, e = this) {
|
736
|
-
|
737
|
-
if ((t = (i = V(this, t, e, 0)) !== null && i !== void 0 ? i : _) === I)
|
1036
|
+
if ((t = N(this, t, e, 0) ?? $) === O)
|
738
1037
|
return;
|
739
|
-
const
|
740
|
-
|
1038
|
+
const i = this._$AH, s = t === $ && i !== $ || t.capture !== i.capture || t.once !== i.once || t.passive !== i.passive, n = t !== $ && (i === $ || s);
|
1039
|
+
s && this.element.removeEventListener(this.name, this, i), n && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
741
1040
|
}
|
742
1041
|
handleEvent(t) {
|
743
|
-
var e
|
744
|
-
typeof this._$AH == "function" ? this._$AH.call((
|
1042
|
+
var e;
|
1043
|
+
typeof this._$AH == "function" ? this._$AH.call(((e = this.options) == null ? void 0 : e.host) ?? this.element, t) : this._$AH.handleEvent(t);
|
745
1044
|
}
|
746
1045
|
}
|
747
|
-
class
|
1046
|
+
class Xe {
|
748
1047
|
constructor(t, e, i) {
|
749
1048
|
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = i;
|
750
1049
|
}
|
@@ -752,75 +1051,74 @@ class we {
|
|
752
1051
|
return this._$AM._$AU;
|
753
1052
|
}
|
754
1053
|
_$AI(t) {
|
755
|
-
|
1054
|
+
N(this, t);
|
756
1055
|
}
|
757
1056
|
}
|
758
|
-
const
|
759
|
-
|
760
|
-
const
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
return o._$AI(n), o;
|
1057
|
+
const lt = z.litHtmlPolyfillSupport;
|
1058
|
+
lt == null || lt(K, J), (z.litHtmlVersions ?? (z.litHtmlVersions = [])).push("3.1.0");
|
1059
|
+
const Ke = (r, t, e) => {
|
1060
|
+
const i = (e == null ? void 0 : e.renderBefore) ?? t;
|
1061
|
+
let s = i._$litPart$;
|
1062
|
+
if (s === void 0) {
|
1063
|
+
const n = (e == null ? void 0 : e.renderBefore) ?? null;
|
1064
|
+
i._$litPart$ = s = new J(t.insertBefore(q(), n), n, void 0, e ?? {});
|
1065
|
+
}
|
1066
|
+
return s._$AI(r), s;
|
769
1067
|
};
|
770
1068
|
/**
|
771
1069
|
* @license
|
772
1070
|
* Copyright 2017 Google LLC
|
773
1071
|
* SPDX-License-Identifier: BSD-3-Clause
|
774
1072
|
*/
|
775
|
-
|
776
|
-
class k extends T {
|
1073
|
+
class j extends x {
|
777
1074
|
constructor() {
|
778
1075
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
779
1076
|
}
|
780
1077
|
createRenderRoot() {
|
781
|
-
var
|
782
|
-
const
|
783
|
-
return (
|
1078
|
+
var e;
|
1079
|
+
const t = super.createRenderRoot();
|
1080
|
+
return (e = this.renderOptions).renderBefore ?? (e.renderBefore = t.firstChild), t;
|
784
1081
|
}
|
785
1082
|
update(t) {
|
786
1083
|
const e = this.render();
|
787
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do =
|
1084
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Ke(e, this.renderRoot, this.renderOptions);
|
788
1085
|
}
|
789
1086
|
connectedCallback() {
|
790
1087
|
var t;
|
791
|
-
super.connectedCallback(), (t = this._$Do)
|
1088
|
+
super.connectedCallback(), (t = this._$Do) == null || t.setConnected(!0);
|
792
1089
|
}
|
793
1090
|
disconnectedCallback() {
|
794
1091
|
var t;
|
795
|
-
super.disconnectedCallback(), (t = this._$Do)
|
1092
|
+
super.disconnectedCallback(), (t = this._$Do) == null || t.setConnected(!1);
|
796
1093
|
}
|
797
1094
|
render() {
|
798
|
-
return
|
1095
|
+
return O;
|
799
1096
|
}
|
800
1097
|
}
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
1098
|
+
var Dt;
|
1099
|
+
j._$litElement$ = !0, j.finalized = !0, (Dt = globalThis.litElementHydrateSupport) == null || Dt.call(globalThis, { LitElement: j });
|
1100
|
+
const ct = globalThis.litElementPolyfillSupport;
|
1101
|
+
ct == null || ct({ LitElement: j });
|
1102
|
+
(globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.0.2");
|
1103
|
+
function Je(r, t, e) {
|
806
1104
|
function i(s) {
|
807
1105
|
e.dispatchEvent(new CustomEvent(s.type, s));
|
808
1106
|
}
|
809
|
-
return t.addEventListener(
|
810
|
-
t.removeEventListener(
|
1107
|
+
return t.addEventListener(r, i), () => {
|
1108
|
+
t.removeEventListener(r, i);
|
811
1109
|
};
|
812
1110
|
}
|
813
|
-
class
|
1111
|
+
class Fe {
|
814
1112
|
constructor(t, e) {
|
815
|
-
this._events = [], this._cleanup = [], this._forwardElementRef =
|
1113
|
+
this._events = [], this._cleanup = [], this._forwardElementRef = jt(), this.host = t, this._events = e, t.addController(this);
|
816
1114
|
}
|
817
1115
|
register() {
|
818
|
-
return
|
1116
|
+
return Bt(this._forwardElementRef);
|
819
1117
|
}
|
820
1118
|
hostConnected() {
|
821
1119
|
requestAnimationFrame(() => {
|
822
1120
|
this._events.forEach((t) => {
|
823
|
-
this._forwardElementRef.value && this._cleanup.push(
|
1121
|
+
this._forwardElementRef.value && this._cleanup.push(Je(t, this._forwardElementRef.value, this.host));
|
824
1122
|
});
|
825
1123
|
});
|
826
1124
|
}
|
@@ -830,52 +1128,84 @@ class Pe {
|
|
830
1128
|
}), this._cleanup = [];
|
831
1129
|
}
|
832
1130
|
}
|
833
|
-
const
|
834
|
-
function
|
835
|
-
if (!["dev", "staging", "prod"].includes(
|
836
|
-
throw new Error(`Unknown environment: ${
|
837
|
-
if (
|
1131
|
+
const It = "https://d2rxhdlm2q91uk.cloudfront.net", Ge = "https://d1ix11aj5kfygl.cloudfront.net", Ze = "https://d157jlwnudd93d.cloudfront.net", Vt = "https://bshyfw4h5a.execute-api.ap-southeast-2.amazonaws.com/dev", Ye = "https://gyzw7rpbq3.execute-api.ap-southeast-2.amazonaws.com/staging", Qe = "https://vfcjuim1l3.execute-api.ap-southeast-2.amazonaws.com/prod", ti = "http://localhost:6060/v2", ei = "https://embed-dev.vouchfor.com/v2", ii = "https://embed-staging.vouchfor.com/v2", si = "https://embed.vouchfor.com/v2";
|
1132
|
+
function et(r) {
|
1133
|
+
if (!["local", "dev", "staging", "prod"].includes(r))
|
1134
|
+
throw new Error(`Unknown environment: ${r}`);
|
1135
|
+
if (r === "local")
|
1136
|
+
return {
|
1137
|
+
videoUrl: It,
|
1138
|
+
publicApiUrl: Vt,
|
1139
|
+
embedApiUrl: ti
|
1140
|
+
};
|
1141
|
+
if (r === "dev")
|
838
1142
|
return {
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
embedApiUrl: Ne,
|
843
|
-
publicRecorderUrl: Oe
|
1143
|
+
videoUrl: It,
|
1144
|
+
publicApiUrl: Vt,
|
1145
|
+
embedApiUrl: ei
|
844
1146
|
};
|
845
|
-
if (
|
1147
|
+
if (r === "staging")
|
846
1148
|
return {
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
embedApiUrl: Ie,
|
851
|
-
publicRecorderUrl: Me
|
1149
|
+
videoUrl: Ge,
|
1150
|
+
publicApiUrl: Ye,
|
1151
|
+
embedApiUrl: ii
|
852
1152
|
};
|
853
|
-
if (
|
1153
|
+
if (r === "prod")
|
854
1154
|
return {
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
embedApiUrl: Ve,
|
859
|
-
publicRecorderUrl: Le
|
1155
|
+
videoUrl: Ze,
|
1156
|
+
publicApiUrl: Qe,
|
1157
|
+
embedApiUrl: si
|
860
1158
|
};
|
861
1159
|
}
|
862
|
-
class
|
1160
|
+
class ri {
|
863
1161
|
constructor(t) {
|
864
|
-
this._fetching = !1, this.
|
1162
|
+
this._fetching = !1, this.getVouch = async (e, i, s) => {
|
1163
|
+
var d;
|
1164
|
+
const { embedApiUrl: n } = et(e), o = P(), a = await fetch(`${n}/vouches/${s}`, {
|
1165
|
+
method: "GET",
|
1166
|
+
headers: [
|
1167
|
+
["X-Api-Key", i],
|
1168
|
+
["X-Cache-Check", o]
|
1169
|
+
]
|
1170
|
+
}), h = await a.json();
|
1171
|
+
return this.host.dispatchEvent(new CustomEvent("vouch:loaded", { detail: s })), ((d = a == null ? void 0 : a.headers) == null ? void 0 : d.get("X-Cache-Check")) !== o && fetch(`${n}/vouches/${s}`, {
|
1172
|
+
method: "GET",
|
1173
|
+
headers: [
|
1174
|
+
["X-Api-Key", i],
|
1175
|
+
["Cache-Control", "max-age=0"]
|
1176
|
+
]
|
1177
|
+
}), h;
|
1178
|
+
}, this.getTemplate = async (e, i, s) => {
|
1179
|
+
var d;
|
1180
|
+
const { embedApiUrl: n } = et(e), o = P(), a = await fetch(`${n}/templates/${s}`, {
|
1181
|
+
method: "GET",
|
1182
|
+
headers: [
|
1183
|
+
["X-Api-Key", i],
|
1184
|
+
["X-Cache-Check", o]
|
1185
|
+
]
|
1186
|
+
}), h = await a.json();
|
1187
|
+
return ((d = a == null ? void 0 : a.headers) == null ? void 0 : d.get("X-Cache-Check")) !== o && fetch(`${n}/templates/${s}`, {
|
1188
|
+
method: "GET",
|
1189
|
+
headers: [
|
1190
|
+
["X-Api-Key", i],
|
1191
|
+
["Cache-Control", "max-age=0"]
|
1192
|
+
]
|
1193
|
+
}), h;
|
1194
|
+
}, this.host = t, new ae(
|
865
1195
|
this.host,
|
866
|
-
async ([e, i, s,
|
867
|
-
var
|
1196
|
+
async ([e, i, s, n, o]) => {
|
1197
|
+
var a, h, c, d;
|
868
1198
|
try {
|
869
|
-
if (
|
870
|
-
|
871
|
-
this.vouch = s,
|
872
|
-
} else if (
|
1199
|
+
if (t.vouch = void 0, t.template = void 0, s) {
|
1200
|
+
let l;
|
1201
|
+
o && (this.fetching = !0, l = await this.getTemplate(e, i, o)), t.vouch = s, t.template = l ?? ((h = (a = s == null ? void 0 : s.settings) == null ? void 0 : a.template) == null ? void 0 : h.instance);
|
1202
|
+
} else if (n) {
|
873
1203
|
this.fetching = !0;
|
874
|
-
const [
|
875
|
-
this.getVouch(e, i,
|
876
|
-
this.getTemplate(e, i, o)
|
1204
|
+
const [l, p] = await Promise.all([
|
1205
|
+
this.getVouch(e, i, n),
|
1206
|
+
o ? this.getTemplate(e, i, o) : null
|
877
1207
|
]);
|
878
|
-
|
1208
|
+
t.vouch = l, t.template = p ?? ((d = (c = l == null ? void 0 : l.settings) == null ? void 0 : c.template) == null ? void 0 : d.instance);
|
879
1209
|
}
|
880
1210
|
} finally {
|
881
1211
|
this.fetching = !1;
|
@@ -890,79 +1220,24 @@ class ke {
|
|
890
1220
|
get fetching() {
|
891
1221
|
return this._fetching;
|
892
1222
|
}
|
893
|
-
set vouch(t) {
|
894
|
-
this._vouch !== t && (this._vouch = t, this.host.requestUpdate());
|
895
|
-
}
|
896
|
-
get vouch() {
|
897
|
-
return this._vouch;
|
898
|
-
}
|
899
|
-
set template(t) {
|
900
|
-
this._template !== t && (this._template = t, this.host.requestUpdate());
|
901
|
-
}
|
902
|
-
get template() {
|
903
|
-
return this._template;
|
904
|
-
}
|
905
|
-
async getVouch(t, e, i) {
|
906
|
-
const { embedApiUrl: s } = Y(t);
|
907
|
-
return i ? fetch(`${s}/vouches/${i}`, {
|
908
|
-
method: "GET",
|
909
|
-
headers: [["X-Api-Key", e]]
|
910
|
-
}).then((r) => r.json()) : null;
|
911
|
-
}
|
912
|
-
async getTemplate(t, e, i) {
|
913
|
-
const { embedApiUrl: s } = Y(t);
|
914
|
-
return i ? fetch(`${s}/templates/${i}`, {
|
915
|
-
method: "GET",
|
916
|
-
headers: [["X-Api-Key", e]]
|
917
|
-
}).then((r) => r.json()) : null;
|
918
|
-
}
|
919
|
-
}
|
920
|
-
let Z;
|
921
|
-
const De = new Uint8Array(16);
|
922
|
-
function je() {
|
923
|
-
if (!Z && (Z = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !Z))
|
924
|
-
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
925
|
-
return Z(De);
|
926
|
-
}
|
927
|
-
const $ = [];
|
928
|
-
for (let n = 0; n < 256; ++n)
|
929
|
-
$.push((n + 256).toString(16).slice(1));
|
930
|
-
function Be(n, t = 0) {
|
931
|
-
return $[n[t + 0]] + $[n[t + 1]] + $[n[t + 2]] + $[n[t + 3]] + "-" + $[n[t + 4]] + $[n[t + 5]] + "-" + $[n[t + 6]] + $[n[t + 7]] + "-" + $[n[t + 8]] + $[n[t + 9]] + "-" + $[n[t + 10]] + $[n[t + 11]] + $[n[t + 12]] + $[n[t + 13]] + $[n[t + 14]] + $[n[t + 15]];
|
932
|
-
}
|
933
|
-
const ze = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Mt = {
|
934
|
-
randomUUID: ze
|
935
|
-
};
|
936
|
-
function L(n, t, e) {
|
937
|
-
if (Mt.randomUUID && !t && !n)
|
938
|
-
return Mt.randomUUID();
|
939
|
-
n = n || {};
|
940
|
-
const i = n.random || (n.rng || je)();
|
941
|
-
if (i[6] = i[6] & 15 | 64, i[8] = i[8] & 63 | 128, t) {
|
942
|
-
e = e || 0;
|
943
|
-
for (let s = 0; s < 16; ++s)
|
944
|
-
t[e + s] = i[s];
|
945
|
-
return t;
|
946
|
-
}
|
947
|
-
return Be(i);
|
948
1223
|
}
|
949
|
-
const
|
950
|
-
class
|
1224
|
+
const ni = 10;
|
1225
|
+
class oi {
|
951
1226
|
constructor(t) {
|
952
|
-
this._tabId = void 0, this._clientId = void 0, this._visitorId = void 0, this._hasPlayed = !1, this._hasLoaded = {}, this._answersViewed = {}, this.
|
953
|
-
var s,
|
954
|
-
const { publicApiUrl: i } =
|
955
|
-
return (
|
1227
|
+
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) => {
|
1228
|
+
var s, n;
|
1229
|
+
const { publicApiUrl: i } = et(this.host.env);
|
1230
|
+
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;
|
956
1231
|
}, this._getReportingMetadata = () => {
|
957
|
-
var
|
958
|
-
const [e, i] = ((o = (
|
959
|
-
return [...new URLSearchParams(location.search).entries()].forEach(([
|
960
|
-
if (/utm/.test(
|
961
|
-
const
|
962
|
-
s[
|
1232
|
+
var n, o;
|
1233
|
+
const [e, i] = ((o = (n = Intl.DateTimeFormat().resolvedOptions().timeZone) == null ? void 0 : n.split) == null ? void 0 : o.call(n, "/")) ?? [], s = {};
|
1234
|
+
return [...new URLSearchParams(location.search).entries()].forEach(([a, h]) => {
|
1235
|
+
if (/utm/.test(a)) {
|
1236
|
+
const c = a.toLowerCase().replace(/[-_][a-z0-9]/g, (d) => d.slice(-1).toUpperCase());
|
1237
|
+
s[c] = h;
|
963
1238
|
}
|
964
1239
|
}), {
|
965
|
-
source:
|
1240
|
+
source: this.host.trackingSource,
|
966
1241
|
time: /* @__PURE__ */ new Date(),
|
967
1242
|
region: i,
|
968
1243
|
country: e,
|
@@ -973,75 +1248,67 @@ class We {
|
|
973
1248
|
...s
|
974
1249
|
};
|
975
1250
|
}, this._sendTrackingEvent = (e, i) => {
|
976
|
-
const
|
1251
|
+
const s = this._findVouchId();
|
1252
|
+
if (!s || this.host.disableTracking)
|
1253
|
+
return;
|
1254
|
+
const { publicApiUrl: n } = et(this.host.env), { client: o, tab: a, request: h, visitor: c } = this._getUids();
|
977
1255
|
navigator.sendBeacon(
|
978
|
-
`${
|
1256
|
+
`${n}/api/events`,
|
979
1257
|
JSON.stringify({
|
980
1258
|
event: e,
|
981
|
-
payload:
|
1259
|
+
payload: {
|
1260
|
+
vouchId: s,
|
1261
|
+
...i
|
1262
|
+
},
|
982
1263
|
context: {
|
983
|
-
"x-uid-client":
|
984
|
-
"x-uid-tab":
|
985
|
-
"x-uid-request":
|
986
|
-
"x-uid-visitor":
|
1264
|
+
"x-uid-client": o,
|
1265
|
+
"x-uid-tab": a,
|
1266
|
+
"x-uid-request": h,
|
1267
|
+
"x-uid-visitor": c,
|
987
1268
|
"x-reporting-metadata": this._getReportingMetadata()
|
988
1269
|
}
|
989
1270
|
})
|
990
1271
|
);
|
991
1272
|
}, this._handleVouchLoaded = ({ detail: e }) => {
|
992
|
-
e && (this._hasLoaded[e] || (this._sendTrackingEvent("VOUCH_LOADED",
|
993
|
-
vouchId: e
|
994
|
-
}), this._hasLoaded[e] = !0));
|
1273
|
+
e && (this._hasLoaded[e] || (this._sendTrackingEvent("VOUCH_LOADED"), this._hasLoaded[e] = !0));
|
995
1274
|
}, this._handlePlay = () => {
|
996
|
-
|
997
|
-
e && (this._hasPlayed || (this._sendTrackingEvent("VIDEO_PLAYED", {
|
998
|
-
vouchId: e,
|
1275
|
+
this._hasPlayed || (this._sendTrackingEvent("VIDEO_PLAYED", {
|
999
1276
|
streamStart: this.host.currentTime
|
1000
|
-
}), this._hasPlayed = !0)
|
1001
|
-
}, this._handleVideoPlay = ({ detail: { id: e,
|
1002
|
-
|
1003
|
-
s && (this._answersViewed[e] || (this._sendTrackingEvent("VOUCH_RESPONSE_VIEWED", {
|
1004
|
-
vouchId: s,
|
1277
|
+
}), this._hasPlayed = !0);
|
1278
|
+
}, this._handleVideoPlay = ({ detail: { id: e, key: i, node: s } }) => {
|
1279
|
+
this._answersViewed[i] || (this._sendTrackingEvent("VOUCH_RESPONSE_VIEWED", {
|
1005
1280
|
answerId: e
|
1006
|
-
}), this._answersViewed[
|
1007
|
-
}, this._handleVideoTimeUpdate = ({ detail: { id: e,
|
1008
|
-
var
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1012
|
-
const r = Date.now();
|
1013
|
-
!this.host.paused && // Only fire the video seeked event when this video is the active one
|
1014
|
-
e === ((d = (o = this.host.scene) == null ? void 0 : o.video) == null ? void 0 : d.id) && // Throttle the frequency that we send streamed events while playing
|
1015
|
-
r - this._streamedPrevTimestamp[e] > qe && (this._sendTrackingEvent("VIDEO_STREAMED", {
|
1016
|
-
vouchId: s,
|
1281
|
+
}), this._answersViewed[i] = !0), this._streamStartTime[i] = s.currentTime, this._streamLatestTime[i] = s.currentTime;
|
1282
|
+
}, this._handleVideoTimeUpdate = ({ detail: { id: e, key: i, node: s } }) => {
|
1283
|
+
var n, o;
|
1284
|
+
this.host.paused || (this._currentlyPlayingVideo = { id: e, key: i, node: s }, this._streamLatestTime[i] = s.currentTime), !s.paused && !this.host.paused && // Only fire the video seeked event when this video is the active one
|
1285
|
+
e === ((o = (n = this.host.scene) == null ? void 0 : n.video) == null ? void 0 : o.id) && // Throttle the frequency that we send streamed events while playing
|
1286
|
+
this._streamLatestTime[i] - this._streamStartTime[i] > ni && (this._sendTrackingEvent("VIDEO_STREAMED", {
|
1017
1287
|
answerId: e,
|
1018
|
-
streamStart: this.
|
1019
|
-
streamEnd: i
|
1020
|
-
}), this.
|
1021
|
-
}, this._handleVideoPause = ({ detail: { id: e,
|
1022
|
-
|
1023
|
-
s && (this._sendTrackingEvent("VIDEO_STREAMED", {
|
1024
|
-
vouchId: s,
|
1288
|
+
streamStart: this._streamStartTime[i],
|
1289
|
+
streamEnd: this._streamLatestTime[i]
|
1290
|
+
}), this._streamStartTime[i] = s.currentTime);
|
1291
|
+
}, this._handleVideoPause = ({ detail: { id: e, key: i } }) => {
|
1292
|
+
this._streamLatestTime[i] > this._streamStartTime[i] && this._sendTrackingEvent("VIDEO_STREAMED", {
|
1025
1293
|
answerId: e,
|
1026
|
-
streamStart: this.
|
1027
|
-
streamEnd: i
|
1028
|
-
}), delete this.
|
1294
|
+
streamStart: this._streamStartTime[i],
|
1295
|
+
streamEnd: this._streamLatestTime[i]
|
1296
|
+
}), this._currentlyPlayingVideo = null, delete this._streamStartTime[i], delete this._streamLatestTime[i];
|
1029
1297
|
}, this.host = t, t.addController(this);
|
1030
1298
|
}
|
1031
1299
|
_findVouchId() {
|
1032
|
-
|
1033
|
-
return "uuid" in this.host.data ? this.host.data.uuid : this.host.data.id;
|
1300
|
+
return this.host.vouch ? this.host.vouch.id : null;
|
1034
1301
|
}
|
1035
1302
|
_getUids() {
|
1036
|
-
var
|
1303
|
+
var n, o, a, h, c, d, l, p, u, g, F, mt;
|
1037
1304
|
if (typeof window > "u")
|
1038
1305
|
return {
|
1039
1306
|
client: null,
|
1040
1307
|
tab: null,
|
1041
|
-
request:
|
1308
|
+
request: P()
|
1042
1309
|
};
|
1043
|
-
const t = this._visitorId || ((o = (
|
1044
|
-
return t !== this._visitorId && (this._visitorId = t, (
|
1310
|
+
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 || ((h = (a = window.localStorage) == null ? void 0 : a.getItem) == null ? void 0 : h.call(a, "vouch-uid-client")) || P(), i = this._tabId || ((d = (c = window.sessionStorage) == null ? void 0 : c.getItem) == null ? void 0 : d.call(c, "vouch-uid-tab")) || P(), s = P();
|
1311
|
+
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, (mt = (F = window.sessionStorage) == null ? void 0 : F.setItem) == null || mt.call(F, "vouch-uid-tab", i)), {
|
1045
1312
|
client: e,
|
1046
1313
|
tab: i,
|
1047
1314
|
request: s,
|
@@ -1056,17 +1323,25 @@ class We {
|
|
1056
1323
|
}
|
1057
1324
|
hostDisconnected() {
|
1058
1325
|
var t, e, i, s;
|
1326
|
+
if (this._currentlyPlayingVideo) {
|
1327
|
+
const { id: n, key: o } = this._currentlyPlayingVideo;
|
1328
|
+
this._streamLatestTime[o] > this._streamStartTime[o] && this._sendTrackingEvent("VIDEO_STREAMED", {
|
1329
|
+
answerId: n,
|
1330
|
+
streamStart: this._streamStartTime[o],
|
1331
|
+
streamEnd: this._streamLatestTime[o]
|
1332
|
+
});
|
1333
|
+
}
|
1059
1334
|
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);
|
1060
1335
|
}
|
1061
1336
|
}
|
1062
|
-
var
|
1063
|
-
for (var s = i > 1 ? void 0 : i ?
|
1064
|
-
(o = n
|
1065
|
-
return i && s &&
|
1337
|
+
var hi = Object.defineProperty, ai = Object.getOwnPropertyDescriptor, f = (r, t, e, i) => {
|
1338
|
+
for (var s = i > 1 ? void 0 : i ? ai(t, e) : t, n = r.length - 1, o; n >= 0; n--)
|
1339
|
+
(o = r[n]) && (s = (i ? o(t, e, s) : o(s)) || s);
|
1340
|
+
return i && s && hi(t, e, s), s;
|
1066
1341
|
};
|
1067
|
-
let
|
1342
|
+
let m = class extends j {
|
1068
1343
|
constructor() {
|
1069
|
-
super(...arguments), this._mediaPlayerRef =
|
1344
|
+
super(...arguments), this._mediaPlayerRef = jt(), this.env = "prod", this.apiKey = "", this.disableTracking = !1, this.trackingSource = "embed", this.preload = "auto", this.autoplay = !1, this.aspectRatio = 0, this.eventController = new Fe(this, [
|
1070
1345
|
"durationchange",
|
1071
1346
|
"ended",
|
1072
1347
|
"error",
|
@@ -1083,6 +1358,7 @@ let g = class extends k {
|
|
1083
1358
|
"volumechange",
|
1084
1359
|
"waiting",
|
1085
1360
|
"video:loadeddata",
|
1361
|
+
"video:seeking",
|
1086
1362
|
"video:seeked",
|
1087
1363
|
"video:play",
|
1088
1364
|
"video:playing",
|
@@ -1091,147 +1367,149 @@ let g = class extends k {
|
|
1091
1367
|
"video:timeupdate",
|
1092
1368
|
"video:ended",
|
1093
1369
|
"video:error"
|
1094
|
-
]), this._fetcherController = new
|
1095
|
-
}
|
1096
|
-
get vouch() {
|
1097
|
-
return this._fetcherController.vouch;
|
1098
|
-
}
|
1099
|
-
get template() {
|
1100
|
-
return this._fetcherController.template;
|
1370
|
+
]), this._fetcherController = new ri(this), this._trackingController = new oi(this);
|
1101
1371
|
}
|
1102
1372
|
get fetching() {
|
1103
1373
|
return this._fetcherController.fetching;
|
1104
1374
|
}
|
1105
1375
|
get waiting() {
|
1106
|
-
var
|
1107
|
-
return (
|
1376
|
+
var r;
|
1377
|
+
return (r = this._mediaPlayerRef.value) == null ? void 0 : r.waiting;
|
1108
1378
|
}
|
1109
1379
|
get seeking() {
|
1110
|
-
var
|
1111
|
-
return (
|
1380
|
+
var r;
|
1381
|
+
return (r = this._mediaPlayerRef.value) == null ? void 0 : r.seeking;
|
1112
1382
|
}
|
1113
1383
|
get paused() {
|
1114
|
-
var
|
1115
|
-
return (
|
1384
|
+
var r;
|
1385
|
+
return (r = this._mediaPlayerRef.value) == null ? void 0 : r.paused;
|
1116
1386
|
}
|
1117
1387
|
get captions() {
|
1118
|
-
var
|
1119
|
-
return (
|
1388
|
+
var r;
|
1389
|
+
return (r = this._mediaPlayerRef.value) == null ? void 0 : r.captions;
|
1120
1390
|
}
|
1121
1391
|
get fullscreen() {
|
1122
|
-
var
|
1123
|
-
return (
|
1392
|
+
var r;
|
1393
|
+
return (r = this._mediaPlayerRef.value) == null ? void 0 : r.fullscreen;
|
1124
1394
|
}
|
1125
1395
|
get duration() {
|
1126
|
-
var
|
1127
|
-
return (
|
1396
|
+
var r;
|
1397
|
+
return (r = this._mediaPlayerRef.value) == null ? void 0 : r.duration;
|
1128
1398
|
}
|
1129
|
-
set currentTime(
|
1130
|
-
this._mediaPlayerRef.value && (this._mediaPlayerRef.value.currentTime =
|
1399
|
+
set currentTime(r) {
|
1400
|
+
this._mediaPlayerRef.value && (this._mediaPlayerRef.value.currentTime = r);
|
1131
1401
|
}
|
1132
1402
|
get currentTime() {
|
1133
|
-
var
|
1134
|
-
return ((
|
1403
|
+
var r;
|
1404
|
+
return ((r = this._mediaPlayerRef.value) == null ? void 0 : r.currentTime) ?? 0;
|
1135
1405
|
}
|
1136
|
-
set playbackRate(
|
1137
|
-
this._mediaPlayerRef.value && (this._mediaPlayerRef.value.playbackRate =
|
1406
|
+
set playbackRate(r) {
|
1407
|
+
this._mediaPlayerRef.value && (this._mediaPlayerRef.value.playbackRate = r);
|
1138
1408
|
}
|
1139
1409
|
get playbackRate() {
|
1140
|
-
var
|
1141
|
-
return ((
|
1410
|
+
var r;
|
1411
|
+
return ((r = this._mediaPlayerRef.value) == null ? void 0 : r.playbackRate) ?? 1;
|
1142
1412
|
}
|
1143
|
-
set volume(
|
1144
|
-
this._mediaPlayerRef.value && (this._mediaPlayerRef.value.volume =
|
1413
|
+
set volume(r) {
|
1414
|
+
this._mediaPlayerRef.value && (this._mediaPlayerRef.value.volume = r);
|
1145
1415
|
}
|
1146
1416
|
get volume() {
|
1147
|
-
var
|
1148
|
-
return ((
|
1417
|
+
var r;
|
1418
|
+
return ((r = this._mediaPlayerRef.value) == null ? void 0 : r.volume) ?? 1;
|
1149
1419
|
}
|
1150
|
-
set muted(
|
1151
|
-
this._mediaPlayerRef.value && (this._mediaPlayerRef.value.muted =
|
1420
|
+
set muted(r) {
|
1421
|
+
this._mediaPlayerRef.value && (this._mediaPlayerRef.value.muted = r);
|
1152
1422
|
}
|
1153
1423
|
get muted() {
|
1154
|
-
var
|
1155
|
-
return ((
|
1424
|
+
var r;
|
1425
|
+
return ((r = this._mediaPlayerRef.value) == null ? void 0 : r.muted) ?? !1;
|
1156
1426
|
}
|
1157
1427
|
get scene() {
|
1158
|
-
var
|
1159
|
-
return ((
|
1428
|
+
var r;
|
1429
|
+
return ((r = this._mediaPlayerRef.value) == null ? void 0 : r.scene) ?? null;
|
1160
1430
|
}
|
1161
1431
|
get scenes() {
|
1162
|
-
var
|
1163
|
-
return ((
|
1432
|
+
var r;
|
1433
|
+
return ((r = this._mediaPlayerRef.value) == null ? void 0 : r.scenes) ?? [];
|
1164
1434
|
}
|
1165
1435
|
get videoState() {
|
1166
|
-
var
|
1167
|
-
return (
|
1436
|
+
var r;
|
1437
|
+
return (r = this._mediaPlayerRef.value) == null ? void 0 : r.videoState;
|
1168
1438
|
}
|
1169
1439
|
get mediaPlayer() {
|
1170
1440
|
return this._mediaPlayerRef.value;
|
1171
1441
|
}
|
1172
1442
|
play() {
|
1173
|
-
var
|
1174
|
-
(
|
1443
|
+
var r;
|
1444
|
+
(r = this._mediaPlayerRef.value) == null || r.play();
|
1175
1445
|
}
|
1176
1446
|
pause() {
|
1177
|
-
var
|
1178
|
-
(
|
1447
|
+
var r;
|
1448
|
+
(r = this._mediaPlayerRef.value) == null || r.pause();
|
1179
1449
|
}
|
1180
|
-
setScene(
|
1450
|
+
setScene(r) {
|
1181
1451
|
var t;
|
1182
|
-
(t = this._mediaPlayerRef.value) == null || t.setScene(
|
1452
|
+
(t = this._mediaPlayerRef.value) == null || t.setScene(r);
|
1183
1453
|
}
|
1184
1454
|
render() {
|
1185
|
-
return
|
1186
|
-
<vmp-media-player
|
1187
|
-
${
|
1455
|
+
return De`
|
1456
|
+
<vmp-new-media-player
|
1457
|
+
${Bt(this._mediaPlayerRef)}
|
1188
1458
|
${this.eventController.register()}
|
1189
1459
|
?autoplay=${this.autoplay}
|
1190
1460
|
?loading=${this.fetching}
|
1191
1461
|
.data=${this.vouch}
|
1192
1462
|
.template=${this.template}
|
1193
|
-
|
1194
|
-
|
1195
|
-
preload=${et(this.preload)}
|
1463
|
+
aspectRatio=${ft(this.aspectRatio)}
|
1464
|
+
preload=${ft(this.preload)}
|
1196
1465
|
.controls=${this.controls}
|
1197
|
-
></vmp-media-player>
|
1466
|
+
></vmp-new-media-player>
|
1198
1467
|
`;
|
1199
1468
|
}
|
1200
1469
|
};
|
1201
1470
|
f([
|
1202
|
-
|
1203
|
-
],
|
1471
|
+
v({ type: Object, attribute: "data" })
|
1472
|
+
], m.prototype, "data", 2);
|
1473
|
+
f([
|
1474
|
+
v({ type: String })
|
1475
|
+
], m.prototype, "vouchId", 2);
|
1476
|
+
f([
|
1477
|
+
v({ type: String })
|
1478
|
+
], m.prototype, "templateId", 2);
|
1479
|
+
f([
|
1480
|
+
v({ type: String })
|
1481
|
+
], m.prototype, "env", 2);
|
1204
1482
|
f([
|
1205
|
-
|
1206
|
-
],
|
1483
|
+
v({ type: String })
|
1484
|
+
], m.prototype, "apiKey", 2);
|
1207
1485
|
f([
|
1208
|
-
|
1209
|
-
],
|
1486
|
+
v({ type: Boolean })
|
1487
|
+
], m.prototype, "disableTracking", 2);
|
1210
1488
|
f([
|
1211
|
-
|
1212
|
-
],
|
1489
|
+
v({ type: String })
|
1490
|
+
], m.prototype, "trackingSource", 2);
|
1213
1491
|
f([
|
1214
|
-
|
1215
|
-
],
|
1492
|
+
v({ type: Array })
|
1493
|
+
], m.prototype, "controls", 2);
|
1216
1494
|
f([
|
1217
|
-
|
1218
|
-
],
|
1495
|
+
v({ type: String })
|
1496
|
+
], m.prototype, "preload", 2);
|
1219
1497
|
f([
|
1220
|
-
|
1221
|
-
],
|
1498
|
+
v({ type: Boolean })
|
1499
|
+
], m.prototype, "autoplay", 2);
|
1222
1500
|
f([
|
1223
|
-
|
1224
|
-
],
|
1501
|
+
v({ type: Number })
|
1502
|
+
], m.prototype, "aspectRatio", 2);
|
1225
1503
|
f([
|
1226
|
-
|
1227
|
-
],
|
1504
|
+
zt()
|
1505
|
+
], m.prototype, "vouch", 2);
|
1228
1506
|
f([
|
1229
|
-
|
1230
|
-
],
|
1231
|
-
|
1232
|
-
|
1233
|
-
],
|
1507
|
+
zt()
|
1508
|
+
], m.prototype, "template", 2);
|
1509
|
+
m = f([
|
1510
|
+
he("vouch-embed")
|
1511
|
+
], m);
|
1234
1512
|
export {
|
1235
|
-
|
1513
|
+
m as Embed
|
1236
1514
|
};
|
1237
1515
|
//# sourceMappingURL=embeds.js.map
|