@vouchfor/embeds 0.0.0-experiment.a210804 → 0.0.0-experiment.a28ca44

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 (40) hide show
  1. package/dist/es/embeds.js +1144 -7
  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 +2882 -398
  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 +45 -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 -124
  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/browser-af8e1451.js +0 -433
  37. package/dist/es/browser-af8e1451.js.map +0 -1
  38. package/dist/es/index-34bf8334.js +0 -9948
  39. package/dist/es/index-34bf8334.js.map +0 -1
  40. package/dist/es/src/components/Embed/index.d.ts +0 -70
package/dist/es/embeds.js CHANGED
@@ -1,11 +1,1148 @@
1
- import { E as a } from "./index-34bf8334.js";
2
- import "lit/decorators.js";
3
- import "lit/directives/if-defined.js";
4
- import "lit/directives/ref.js";
5
- import "@lit/task";
6
- import "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";
7
8
  import "@vouchfor/media-player";
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);
19
+ };
20
+ }
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);
29
+ }
30
+ register() {
31
+ return ref(this._forwardElementRef);
32
+ }
33
+ hostConnected() {
34
+ requestAnimationFrame(() => {
35
+ this._events.forEach((event) => {
36
+ if (this._forwardElementRef.value) {
37
+ this._cleanup.push(forwardEvent(event, this._forwardElementRef.value, this.host));
38
+ }
39
+ });
40
+ });
41
+ }
42
+ hostDisconnected() {
43
+ this._cleanup.forEach((fn) => {
44
+ fn();
45
+ });
46
+ this._cleanup = [];
47
+ }
48
+ }
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") {
64
+ return {
65
+ videoUrl: devVideoUrl,
66
+ publicApiUrl: devPublicApiUrl,
67
+ embedApiUrl: localEmbedApiUrl
68
+ };
69
+ }
70
+ if (env === "dev") {
71
+ return {
72
+ videoUrl: devVideoUrl,
73
+ publicApiUrl: devPublicApiUrl,
74
+ embedApiUrl: devEmbedApiUrl
75
+ };
76
+ }
77
+ if (env === "staging") {
78
+ return {
79
+ videoUrl: stagingVideoUrl,
80
+ publicApiUrl: stagingPublicApiUrl,
81
+ embedApiUrl: stagingEmbedApiUrl
82
+ };
83
+ }
84
+ if (env === "prod") {
85
+ return {
86
+ videoUrl: prodVideoUrl,
87
+ publicApiUrl: prodPublicApiUrl,
88
+ embedApiUrl: prodEmbedApiUrl
89
+ };
90
+ }
91
+ }
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}`, {
100
+ method: "GET",
101
+ headers: [
102
+ ["X-Api-Key", apiKey],
103
+ ["X-Cache-Check", cacheCheck]
104
+ ]
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}`, {
125
+ method: "GET",
126
+ headers: [
127
+ ["X-Api-Key", apiKey],
128
+ ["X-Cache-Check", cacheCheck]
129
+ ]
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(
146
+ this.host,
147
+ async ([env, apiKey, data, vouchId, templateId]) => {
148
+ var _a, _b, _c, _d;
149
+ try {
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
165
+ ]);
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);
168
+ }
169
+ } finally {
170
+ this.fetching = false;
171
+ }
172
+ },
173
+ () => [host.env, host.apiKey, host.data, host.vouchId, host.templateId]
174
+ );
175
+ new Task(
176
+ this.host,
177
+ ([vouch, questions]) => {
178
+ host.vouch = vouch ? {
179
+ ...vouch,
180
+ questions: {
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)))
182
+ }
183
+ } : void 0;
184
+ },
185
+ () => [this._vouch, host.questions]
186
+ );
187
+ }
188
+ set fetching(value) {
189
+ if (this._fetching !== value) {
190
+ this._fetching = value;
191
+ this.host.requestUpdate();
192
+ }
193
+ }
194
+ get fetching() {
195
+ return this._fetching;
196
+ }
197
+ }
198
+ const name = "@vouchfor/embeds";
199
+ const version = "0.0.0-experiment.a28ca44";
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 = {
207
+ ".": "./dist/es/embeds.js"
208
+ };
209
+ const files = [
210
+ "dist",
211
+ "src"
212
+ ];
213
+ const publishConfig = {
214
+ tag: "experiment",
215
+ access: "public"
216
+ };
217
+ const engines = {
218
+ node: ">=18.18.0"
219
+ };
220
+ const scripts = {
221
+ build: "rm -rf dist && tsc && yarn build:self",
222
+ "build:deps": "yarn --cwd ../media-player build",
223
+ "build:self": "vite build --mode iife && vite build --mode es && node scripts/build.cjs",
224
+ "build:package": "yarn build",
225
+ "build:storybook": "yarn prebuild && storybook build",
226
+ "generate:manifest": "wca src --outFile custom-elements.json",
227
+ lint: "eslint . --quiet",
228
+ "lint:fix": "eslint . --fix",
229
+ "lint:staged": "lint-staged",
230
+ prepublishOnly: "yarn build",
231
+ size: "size-limit",
232
+ storybook: "yarn prebuild && storybook dev -p 6007",
233
+ prebuild: "yarn build:deps && yarn generate:manifest",
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
+ typecheck: "tsc --noEmit"
238
+ };
239
+ const dependencies = {
240
+ "@a11y/focus-trap": "^1.0.5",
241
+ "@lit/task": "^1.0.0",
242
+ "@vouchfor/canvas-video": "0.0.0-experiment.a28ca44",
243
+ "@vouchfor/media-player": "0.0.0-experiment.a28ca44",
244
+ uuid: "^9.0.1"
245
+ };
246
+ const peerDependencies = {
247
+ lit: "^3.1.2"
248
+ };
249
+ const devDependencies = {
250
+ "@esm-bundle/chai": "^4.3.4-fix.0",
251
+ "@open-wc/testing": "^4.0.0",
252
+ "@storybook/addon-essentials": "^8.5.8",
253
+ "@storybook/addon-links": "^8.5.8",
254
+ "@storybook/blocks": "^8.5.8",
255
+ "@storybook/web-components": "^8.5.8",
256
+ "@storybook/web-components-vite": "^8.5.8",
257
+ "@svgr/core": "^8.1.0",
258
+ "@types/flat": "^5.0.5",
259
+ "@types/mocha": "^10.0.6",
260
+ "@vouchfor/eslint-config": "^1.0.1",
261
+ "@vouchfor/prettier-config": "^1.0.1",
262
+ "@vouchfor/video-utils": "0.0.0-experiment.a28ca44",
263
+ "@web/dev-server-esbuild": "^1.0.2",
264
+ "@web/test-runner": "^0.18.1",
265
+ "@web/test-runner-browserstack": "^0.7.1",
266
+ "@web/test-runner-mocha": "^0.9.0",
267
+ "@web/test-runner-playwright": "^0.11.0",
268
+ glob: "^10.3.10",
269
+ "lint-staged": "^15.2.2",
270
+ lit: "^3.1.2",
271
+ lodash: "^4.17.21",
272
+ react: "^18.2.0",
273
+ "react-dom": "^18.2.0",
274
+ "rollup-plugin-tla": "^0.0.2",
275
+ sinon: "^17.0.1",
276
+ storybook: "^8.5.8",
277
+ svgson: "^5.3.1",
278
+ typescript: "^5.4.3",
279
+ vite: "^5.2.2",
280
+ "vite-plugin-commonjs": "^0.10.1",
281
+ "vite-plugin-dts": "^3.7.3",
282
+ "web-component-analyzer": "^2.0.0"
283
+ };
284
+ const packageJson = {
285
+ name,
286
+ version,
287
+ license,
288
+ author,
289
+ main,
290
+ module,
291
+ type,
292
+ types,
293
+ exports,
294
+ files,
295
+ publishConfig,
296
+ engines,
297
+ scripts,
298
+ "lint-staged": {
299
+ "**/*.{ts,tsx,js}": "eslint --fix --quiet",
300
+ "**/*.{md,json,yml}": "prettier --write"
301
+ },
302
+ dependencies,
303
+ peerDependencies,
304
+ devDependencies
305
+ };
306
+ function createVisitor(env) {
307
+ const { publicApiUrl } = getEnvUrls(env);
308
+ const visitorId = v4();
309
+ navigator.sendBeacon(`${publicApiUrl}/api/visitor`, JSON.stringify({ visitorId }));
310
+ return visitorId;
311
+ }
312
+ function getUids(env) {
313
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
314
+ if (typeof window === "undefined") {
315
+ return {
316
+ client: null,
317
+ tab: null,
318
+ request: v4()
319
+ };
320
+ }
321
+ let visitorId = (_b = (_a = window.localStorage) == null ? void 0 : _a.getItem) == null ? void 0 : _b.call(_a, "vouch-uid-visitor");
322
+ let clientId = (_d = (_c = window.localStorage) == null ? void 0 : _c.getItem) == null ? void 0 : _d.call(_c, "vouch-uid-client");
323
+ let tabId = (_f = (_e = window.sessionStorage) == null ? void 0 : _e.getItem) == null ? void 0 : _f.call(_e, "vouch-uid-tab");
324
+ const requestId = v4();
325
+ if (!visitorId) {
326
+ visitorId = createVisitor(env);
327
+ (_h = (_g = window.localStorage) == null ? void 0 : _g.setItem) == null ? void 0 : _h.call(_g, "vouch-uid-visitor", visitorId);
328
+ }
329
+ if (!clientId) {
330
+ clientId = v4();
331
+ (_j = (_i = window.localStorage) == null ? void 0 : _i.setItem) == null ? void 0 : _j.call(_i, "vouch-uid-client", clientId);
332
+ }
333
+ if (!tabId) {
334
+ tabId = v4();
335
+ (_l = (_k = window.sessionStorage) == null ? void 0 : _k.setItem) == null ? void 0 : _l.call(_k, "vouch-uid-tab", tabId);
336
+ }
337
+ return {
338
+ client: clientId,
339
+ tab: tabId,
340
+ request: requestId,
341
+ visitor: visitorId
342
+ };
343
+ }
344
+ function findVouchId(payload, vouch) {
345
+ if (payload && "vouchId" in payload) {
346
+ return payload.vouchId;
347
+ }
348
+ return (vouch == null ? void 0 : vouch.id) ?? null;
349
+ }
350
+ function getReportingMetadata(source = "embedded_player") {
351
+ var _a, _b;
352
+ const [country, region] = ((_b = (_a = Intl.DateTimeFormat().resolvedOptions().timeZone) == null ? void 0 : _a.split) == null ? void 0 : _b.call(_a, "/")) ?? [];
353
+ const utmParams = {};
354
+ [...new URLSearchParams(location.search).entries()].forEach(([key, value]) => {
355
+ if (/utm/.test(key)) {
356
+ const param = key.toLowerCase().replace(/[-_][a-z0-9]/g, (group) => group.slice(-1).toUpperCase());
357
+ utmParams[param] = value;
358
+ }
359
+ });
360
+ return {
361
+ source,
362
+ time: /* @__PURE__ */ new Date(),
363
+ region,
364
+ country,
365
+ screenHeight: window.screen.height,
366
+ screenWidth: window.screen.width,
367
+ referrer: document.referrer,
368
+ currentUrl: location.href,
369
+ embedType: "media-player-embed",
370
+ embedVersion: packageJson.version,
371
+ templateVersion: TEMPLATE_VERSION,
372
+ ...utmParams
373
+ };
374
+ }
375
+ const MINIMUM_SEND_THRESHOLD = 1;
376
+ class TrackingController {
377
+ constructor(host) {
378
+ this._batchedEvents = [];
379
+ this._hasPlayed = false;
380
+ this._hasLoaded = {};
381
+ this._answersViewed = {};
382
+ this._streamStartTime = {};
383
+ this._streamLatestTime = {};
384
+ this._currentlyPlayingVideo = null;
385
+ this._createTrackingEvent = (event, payload) => {
386
+ const vouchId = findVouchId(payload, this.host.vouch);
387
+ if (!vouchId || this.host.disableTracking) {
388
+ return;
389
+ }
390
+ this._batchedEvents.push({
391
+ event,
392
+ payload: {
393
+ ...payload,
394
+ vouchId,
395
+ time: (/* @__PURE__ */ new Date()).toISOString()
396
+ }
397
+ });
398
+ };
399
+ this._sendTrackingEvent = () => {
400
+ if (this._batchedEvents.length <= 0) {
401
+ return;
402
+ }
403
+ const { publicApiUrl } = getEnvUrls(this.host.env);
404
+ const { client, tab, request, visitor } = getUids(this.host.env);
405
+ navigator.sendBeacon(
406
+ `${publicApiUrl}/api/batchevents`,
407
+ JSON.stringify({
408
+ payload: {
409
+ events: this._batchedEvents
410
+ },
411
+ context: {
412
+ "x-uid-client": client,
413
+ "x-uid-tab": tab,
414
+ "x-uid-request": request,
415
+ "x-uid-visitor": visitor,
416
+ "x-reporting-metadata": getReportingMetadata(this.host.trackingSource)
417
+ }
418
+ })
419
+ );
420
+ this._batchedEvents = [];
421
+ };
422
+ this._streamEnded = () => {
423
+ if (this._currentlyPlayingVideo) {
424
+ const { id, key } = this._currentlyPlayingVideo;
425
+ if (this._streamLatestTime[key] > this._streamStartTime[key] + MINIMUM_SEND_THRESHOLD) {
426
+ this._createTrackingEvent("VIDEO_STREAMED", {
427
+ answerId: id,
428
+ streamStart: this._streamStartTime[key],
429
+ streamEnd: this._streamLatestTime[key]
430
+ });
431
+ }
432
+ delete this._streamStartTime[key];
433
+ delete this._streamLatestTime[key];
434
+ }
435
+ };
436
+ this._handleVouchLoaded = ({ detail: vouchId }) => {
437
+ if (!vouchId) {
438
+ return;
439
+ }
440
+ if (!this._hasLoaded[vouchId]) {
441
+ this._createTrackingEvent("VOUCH_LOADED", { vouchId });
442
+ this._hasLoaded[vouchId] = true;
443
+ }
444
+ };
445
+ this._handlePlay = () => {
446
+ if (!this._hasPlayed) {
447
+ this._createTrackingEvent("VIDEO_PLAYED", {
448
+ streamStart: this.host.currentTime
449
+ });
450
+ this._hasPlayed = true;
451
+ }
452
+ };
453
+ this._handleVideoPlay = ({ detail: { id, key } }) => {
454
+ if (!this._answersViewed[key]) {
455
+ this._createTrackingEvent("VOUCH_RESPONSE_VIEWED", {
456
+ answerId: id
457
+ });
458
+ this._answersViewed[key] = true;
459
+ }
460
+ };
461
+ this._handleVideoTimeUpdate = ({ detail: { id, key, node } }) => {
462
+ if (
463
+ // We only want to count any time that the video is actually playing
464
+ !this.host.paused
465
+ ) {
466
+ this._currentlyPlayingVideo = { id, key, node };
467
+ this._streamLatestTime[key] = node.currentTime;
468
+ if (!this._streamStartTime[key]) {
469
+ this._streamStartTime[key] = node.currentTime;
470
+ this._streamLatestTime[key] = node.currentTime;
471
+ }
472
+ }
473
+ };
474
+ this._handleVideoPause = ({ detail: { id, key } }) => {
475
+ if (this._streamLatestTime[key] > this._streamStartTime[key] + MINIMUM_SEND_THRESHOLD) {
476
+ this._createTrackingEvent("VIDEO_STREAMED", {
477
+ answerId: id,
478
+ streamStart: this._streamStartTime[key],
479
+ streamEnd: this._streamLatestTime[key]
480
+ });
481
+ }
482
+ delete this._streamStartTime[key];
483
+ delete this._streamLatestTime[key];
484
+ };
485
+ this._pageUnloading = () => {
486
+ this._streamEnded();
487
+ this._sendTrackingEvent();
488
+ };
489
+ this._handleVisibilityChange = () => {
490
+ if (document.visibilityState === "hidden") {
491
+ this._pageUnloading();
492
+ }
493
+ };
494
+ this._handlePageHide = () => {
495
+ this._pageUnloading();
496
+ };
497
+ this.host = host;
498
+ host.addController(this);
499
+ }
500
+ hostConnected() {
501
+ requestAnimationFrame(() => {
502
+ var _a, _b, _c, _d;
503
+ if ("onvisibilitychange" in document) {
504
+ document.addEventListener("visibilitychange", this._handleVisibilityChange);
505
+ } else {
506
+ window.addEventListener("pagehide", this._handlePageHide);
507
+ }
508
+ this.host.addEventListener("vouch:loaded", this._handleVouchLoaded);
509
+ (_a = this.host.mediaPlayer) == null ? void 0 : _a.addEventListener("play", this._handlePlay);
510
+ (_b = this.host.mediaPlayer) == null ? void 0 : _b.addEventListener("video:play", this._handleVideoPlay);
511
+ (_c = this.host.mediaPlayer) == null ? void 0 : _c.addEventListener("video:pause", this._handleVideoPause);
512
+ (_d = this.host.mediaPlayer) == null ? void 0 : _d.addEventListener("video:timeupdate", this._handleVideoTimeUpdate);
513
+ });
514
+ }
515
+ hostDisconnected() {
516
+ var _a, _b, _c, _d;
517
+ this._pageUnloading();
518
+ if ("onvisibilitychange" in document) {
519
+ document.removeEventListener("visibilitychange", this._handleVisibilityChange);
520
+ } else {
521
+ window.removeEventListener("pagehide", this._handlePageHide);
522
+ }
523
+ this.host.removeEventListener("vouch:loaded", this._handleVouchLoaded);
524
+ (_a = this.host.mediaPlayer) == null ? void 0 : _a.removeEventListener("play", this._handlePlay);
525
+ (_b = this.host.mediaPlayer) == null ? void 0 : _b.removeEventListener("video:play", this._handleVideoPlay);
526
+ (_c = this.host.mediaPlayer) == null ? void 0 : _c.removeEventListener("video:pause", this._handleVideoPause);
527
+ (_d = this.host.mediaPlayer) == null ? void 0 : _d.removeEventListener("video:timeupdate", this._handleVideoTimeUpdate);
528
+ }
529
+ }
530
+ var __defProp$3 = Object.defineProperty;
531
+ var __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor;
532
+ var __decorateClass$3 = (decorators, target, key, kind) => {
533
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target;
534
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
535
+ if (decorator = decorators[i])
536
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
537
+ if (kind && result)
538
+ __defProp$3(target, key, result);
539
+ return result;
540
+ };
541
+ let PlayerEmbed = class extends LitElement {
542
+ constructor() {
543
+ super(...arguments);
544
+ this.env = "prod";
545
+ this.apiKey = "";
546
+ this.disableTracking = false;
547
+ this.trackingSource = "embedded_player";
548
+ this.preload = "auto";
549
+ this.autoplay = false;
550
+ this.aspectRatio = 0;
551
+ this.eventController = new EventForwardController(this, [
552
+ "durationchange",
553
+ "ended",
554
+ "error",
555
+ "loadeddata",
556
+ "pause",
557
+ "stalled",
558
+ "play",
559
+ "playing",
560
+ "ratechange",
561
+ "scenechange",
562
+ "scenesupdate",
563
+ "seeking",
564
+ "seeked",
565
+ "timeupdate",
566
+ "volumechange",
567
+ "processing",
568
+ "waiting",
569
+ "video:loadeddata",
570
+ "video:seeking",
571
+ "video:seeked",
572
+ "video:play",
573
+ "video:playing",
574
+ "video:pause",
575
+ "video:stalled",
576
+ "video:timeupdate",
577
+ "video:ended",
578
+ "video:error"
579
+ ]);
580
+ this._fetcherController = new FetcherController(this);
581
+ this._trackingController = new TrackingController(this);
582
+ this._mediaPlayerRef = createRef();
583
+ }
584
+ get fetching() {
585
+ return this._fetcherController.fetching;
586
+ }
587
+ get waiting() {
588
+ var _a;
589
+ return (_a = this._mediaPlayerRef.value) == null ? void 0 : _a.waiting;
590
+ }
591
+ get initialised() {
592
+ var _a;
593
+ return (_a = this._mediaPlayerRef.value) == null ? void 0 : _a.initialised;
594
+ }
595
+ get seeking() {
596
+ var _a;
597
+ return (_a = this._mediaPlayerRef.value) == null ? void 0 : _a.seeking;
598
+ }
599
+ get paused() {
600
+ var _a;
601
+ return (_a = this._mediaPlayerRef.value) == null ? void 0 : _a.paused;
602
+ }
603
+ get captions() {
604
+ var _a;
605
+ return (_a = this._mediaPlayerRef.value) == null ? void 0 : _a.captions;
606
+ }
607
+ get fullscreen() {
608
+ var _a;
609
+ return (_a = this._mediaPlayerRef.value) == null ? void 0 : _a.fullscreen;
610
+ }
611
+ get duration() {
612
+ var _a;
613
+ return (_a = this._mediaPlayerRef.value) == null ? void 0 : _a.duration;
614
+ }
615
+ set currentTime(value) {
616
+ if (this._mediaPlayerRef.value) {
617
+ this._mediaPlayerRef.value.currentTime = value;
618
+ }
619
+ }
620
+ get currentTime() {
621
+ var _a;
622
+ return ((_a = this._mediaPlayerRef.value) == null ? void 0 : _a.currentTime) ?? 0;
623
+ }
624
+ set playbackRate(value) {
625
+ if (this._mediaPlayerRef.value) {
626
+ this._mediaPlayerRef.value.playbackRate = value;
627
+ }
628
+ }
629
+ get playbackRate() {
630
+ var _a;
631
+ return ((_a = this._mediaPlayerRef.value) == null ? void 0 : _a.playbackRate) ?? 1;
632
+ }
633
+ set volume(value) {
634
+ if (this._mediaPlayerRef.value) {
635
+ this._mediaPlayerRef.value.volume = value;
636
+ }
637
+ }
638
+ get volume() {
639
+ var _a;
640
+ return ((_a = this._mediaPlayerRef.value) == null ? void 0 : _a.volume) ?? 1;
641
+ }
642
+ set muted(value) {
643
+ if (this._mediaPlayerRef.value) {
644
+ this._mediaPlayerRef.value.muted = value;
645
+ }
646
+ }
647
+ get muted() {
648
+ var _a;
649
+ return ((_a = this._mediaPlayerRef.value) == null ? void 0 : _a.muted) ?? false;
650
+ }
651
+ // get scene(): Scene | null {
652
+ // return this._mediaPlayerRef.value?.scene ?? null;
653
+ // }
654
+ // get scenes(): Scene[] {
655
+ // return this._mediaPlayerRef.value?.scenes ?? [];
656
+ // }
657
+ // get sceneConfig(): Scenes | null {
658
+ // return this._mediaPlayerRef.value?.sceneConfig ?? null;
659
+ // }
660
+ get mediaState() {
661
+ var _a;
662
+ return (_a = this._mediaPlayerRef.value) == null ? void 0 : _a.mediaState;
663
+ }
664
+ get mediaPlayer() {
665
+ return this._mediaPlayerRef.value;
666
+ }
667
+ play() {
668
+ var _a;
669
+ (_a = this._mediaPlayerRef.value) == null ? void 0 : _a.play();
670
+ }
671
+ pause() {
672
+ var _a;
673
+ (_a = this._mediaPlayerRef.value) == null ? void 0 : _a.pause();
674
+ }
675
+ reset(time = 0, play = false) {
676
+ var _a;
677
+ (_a = this._mediaPlayerRef.value) == null ? void 0 : _a.reset(time, play);
678
+ }
679
+ // setScene(index: number) {
680
+ // this._mediaPlayerRef.value?.setScene(index);
681
+ // }
682
+ _renderStyles() {
683
+ if (!this.aspectRatio) {
684
+ return html`
685
+ <style>
686
+ :host {
687
+ width: 100%;
688
+ height: 100%;
689
+ }
690
+ </style>
691
+ `;
692
+ }
693
+ if (typeof this.aspectRatio === "number") {
694
+ return html`
695
+ <style>
696
+ :host {
697
+ aspect-ratio: ${this.aspectRatio};
698
+ }
699
+ </style>
700
+ `;
701
+ }
702
+ return null;
703
+ }
704
+ willUpdate(changedProperties) {
705
+ if (changedProperties.has("vouchId") && this.vouchId !== changedProperties.get("vouchId")) {
706
+ this.reset(0, false);
707
+ }
708
+ }
709
+ render() {
710
+ return html`
711
+ ${this._renderStyles()}
712
+ <vmp-media-player
713
+ ${ref(this._mediaPlayerRef)}
714
+ ${this.eventController.register()}
715
+ ?autoplay=${this.autoplay}
716
+ ?loading=${this.fetching}
717
+ aspectRatio=${ifDefined(this.aspectRatio)}
718
+ preload=${ifDefined(this.preload)}
719
+ language=${ifDefined(this.language)}
720
+ .controls=${this.controls}
721
+ ></vmp-media-player>
722
+ `;
723
+ }
724
+ };
725
+ PlayerEmbed.styles = [
726
+ css`
727
+ :host {
728
+ display: flex;
729
+ }
730
+ `
731
+ ];
732
+ __decorateClass$3([
733
+ property({ type: Object })
734
+ ], PlayerEmbed.prototype, "data", 2);
735
+ __decorateClass$3([
736
+ property({ type: String })
737
+ ], PlayerEmbed.prototype, "vouchId", 2);
738
+ __decorateClass$3([
739
+ property({ type: String })
740
+ ], PlayerEmbed.prototype, "templateId", 2);
741
+ __decorateClass$3([
742
+ property({ type: Array })
743
+ ], PlayerEmbed.prototype, "questions", 2);
744
+ __decorateClass$3([
745
+ property({ type: String })
746
+ ], PlayerEmbed.prototype, "env", 2);
747
+ __decorateClass$3([
748
+ property({ type: String })
749
+ ], PlayerEmbed.prototype, "apiKey", 2);
750
+ __decorateClass$3([
751
+ property({ type: Boolean })
752
+ ], PlayerEmbed.prototype, "disableTracking", 2);
753
+ __decorateClass$3([
754
+ property({ type: String })
755
+ ], PlayerEmbed.prototype, "trackingSource", 2);
756
+ __decorateClass$3([
757
+ property({ type: Array })
758
+ ], PlayerEmbed.prototype, "controls", 2);
759
+ __decorateClass$3([
760
+ property({ type: String })
761
+ ], PlayerEmbed.prototype, "preload", 2);
762
+ __decorateClass$3([
763
+ property({ type: Boolean })
764
+ ], PlayerEmbed.prototype, "autoplay", 2);
765
+ __decorateClass$3([
766
+ property({ type: Number })
767
+ ], PlayerEmbed.prototype, "aspectRatio", 2);
768
+ __decorateClass$3([
769
+ property({ type: String })
770
+ ], PlayerEmbed.prototype, "language", 2);
771
+ __decorateClass$3([
772
+ state()
773
+ ], PlayerEmbed.prototype, "vouch", 2);
774
+ __decorateClass$3([
775
+ state()
776
+ ], PlayerEmbed.prototype, "template", 2);
777
+ PlayerEmbed = __decorateClass$3([
778
+ customElement("vouch-embed-player")
779
+ ], PlayerEmbed);
780
+ var __defProp$2 = Object.defineProperty;
781
+ var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor;
782
+ var __decorateClass$2 = (decorators, target, key, kind) => {
783
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key) : target;
784
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
785
+ if (decorator = decorators[i])
786
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
787
+ if (kind && result)
788
+ __defProp$2(target, key, result);
789
+ return result;
790
+ };
791
+ let DialogOverlay = class extends LitElement {
792
+ constructor() {
793
+ super(...arguments);
794
+ this.open = false;
795
+ this.aspectRatio = 0;
796
+ }
797
+ render() {
798
+ return html`
799
+ <div
800
+ class=${classMap({
801
+ container: true,
802
+ hidden: !this.open
803
+ })}
804
+ >
805
+ <div
806
+ class="background"
807
+ @click=${() => this.dispatchEvent(new CustomEvent("overlay:click", { bubbles: true, composed: true }))}
808
+ ></div>
809
+ <focus-trap>
810
+ <div
811
+ class=${classMap({
812
+ "video-frame": true,
813
+ grow: this.aspectRatio === 0
814
+ })}
815
+ style=${styleMap({
816
+ aspectRatio: this.aspectRatio
817
+ })}
818
+ >
819
+ <slot></slot>
820
+ <vmp-icon-button
821
+ icon="close"
822
+ rounded="full"
823
+ weight="heavy"
824
+ @click=${() => this.dispatchEvent(new CustomEvent("close:click", { bubbles: true, composed: true }))}
825
+ ></vmp-icon-button>
826
+ </div>
827
+ </focus-trap>
828
+ </div>
829
+ `;
830
+ }
831
+ };
832
+ DialogOverlay.styles = [
833
+ css`
834
+ :host {
835
+ --vouch-media-player-border-radius: var(--vu-media-player-border-radius, 12px);
836
+ --overlay-background-color: var(--vu-overlay-background-color, black);
837
+ --overlay-background-opacity: var(--vu-overlay-background-opacity, 0.4);
838
+
839
+ --dialog-width: var(--vu-dialog-width, 890px);
840
+ --dialog-height: var(--vu-dialog-height, 500px);
841
+ }
842
+
843
+ .container {
844
+ position: fixed;
845
+ display: flex;
846
+ inset: 0;
847
+ opacity: 1;
848
+ z-index: 2147483647;
849
+ align-items: center;
850
+ justify-content: center;
851
+ transition: opacity 100ms ease-in;
852
+ }
853
+
854
+ .hidden {
855
+ opacity: 0;
856
+ pointer-events: none;
857
+ }
858
+
859
+ .background {
860
+ position: absolute;
861
+ inset: 0;
862
+ opacity: var(--overlay-background-opacity);
863
+ background-color: var(--overlay-background-color);
864
+ }
865
+
866
+ focus-trap {
867
+ display: flex;
868
+ align-items: center;
869
+ justify-content: center;
870
+ margin: 40px;
871
+ width: var(--dialog-width);
872
+ height: var(--dialog-height);
873
+ max-width: calc(100% - 80px);
874
+ max-height: calc(100% - 80px);
875
+ }
876
+
877
+ .video-frame {
878
+ position: relative;
879
+ display: flex;
880
+ align-items: center;
881
+ justify-content: center;
882
+ max-width: 100%;
883
+ max-height: 100%;
884
+ }
885
+
886
+ .video-frame.grow {
887
+ width: 100%;
888
+ height: 100%;
889
+ }
890
+
891
+ vmp-icon-button {
892
+ position: absolute;
893
+ top: 0;
894
+ right: 0;
895
+ margin: 10px;
896
+ }
897
+ `
898
+ ];
899
+ __decorateClass$2([
900
+ property({ type: Boolean })
901
+ ], DialogOverlay.prototype, "open", 2);
902
+ __decorateClass$2([
903
+ property({ type: Number })
904
+ ], DialogOverlay.prototype, "aspectRatio", 2);
905
+ DialogOverlay = __decorateClass$2([
906
+ customElement("vouch-embed-dialog-overlay")
907
+ ], DialogOverlay);
908
+ var __defProp$1 = Object.defineProperty;
909
+ var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
910
+ var __decorateClass$1 = (decorators, target, key, kind) => {
911
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target;
912
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
913
+ if (decorator = decorators[i])
914
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
915
+ if (kind && result)
916
+ __defProp$1(target, key, result);
917
+ return result;
918
+ };
919
+ let DialogPortal = class extends LitElement {
920
+ constructor() {
921
+ super(...arguments);
922
+ this.env = "prod";
923
+ this.apiKey = "";
924
+ this.disableTracking = false;
925
+ this.trackingSource = "embedded_player";
926
+ this.preload = "none";
927
+ this.disableAutoplay = false;
928
+ this.aspectRatio = 0;
929
+ this._mediaPlayerRef = createRef();
930
+ this.open = false;
931
+ this._handleToggle = ({ detail }) => {
932
+ var _a, _b, _c;
933
+ if (this.id === detail) {
934
+ this.open = !this.open;
935
+ if (this.open) {
936
+ if (!this.disableAutoplay && ((_a = this._mediaPlayerRef) == null ? void 0 : _a.value)) {
937
+ this._mediaPlayerRef.value.muted = false;
938
+ this._mediaPlayerRef.value.play();
939
+ }
940
+ } else {
941
+ (_c = (_b = this._mediaPlayerRef) == null ? void 0 : _b.value) == null ? void 0 : _c.pause();
942
+ }
943
+ }
944
+ };
945
+ this._handleClose = () => {
946
+ var _a, _b;
947
+ this.open = false;
948
+ (_b = (_a = this._mediaPlayerRef) == null ? void 0 : _a.value) == null ? void 0 : _b.pause();
949
+ };
950
+ this._handleDocumentKeyUp = (e) => {
951
+ if (e.key === "Escape") {
952
+ this._handleClose();
953
+ }
954
+ };
955
+ }
956
+ connectedCallback() {
957
+ super.connectedCallback();
958
+ document.addEventListener("dialogembed:click", this._handleToggle);
959
+ document.addEventListener("keyup", this._handleDocumentKeyUp);
960
+ document.addEventListener("close:click", this._handleClose);
961
+ document.addEventListener("overlay:click", this._handleClose);
962
+ }
963
+ disconnectedCallback() {
964
+ super.disconnectedCallback();
965
+ document.removeEventListener("dialogembed:click", this._handleToggle);
966
+ document.removeEventListener("keyup", this._handleDocumentKeyUp);
967
+ document.removeEventListener("close:click", this._handleClose);
968
+ document.removeEventListener("overlay:click", this._handleClose);
969
+ }
970
+ createRenderRoot() {
971
+ const newNode = document.createElement("div");
972
+ document.body.appendChild(newNode);
973
+ return newNode;
974
+ }
975
+ render() {
976
+ return html`
977
+ <vouch-embed-dialog-overlay ?open=${this.open} aspectRatio=${this.aspectRatio}>
978
+ <vouch-embed-player
979
+ ${ref(this._mediaPlayerRef)}
980
+ style=${styleMap({
981
+ maxWidth: "100%",
982
+ maxHeight: "100%"
983
+ })}
984
+ ?autoplay=${false}
985
+ vouchId=${ifDefined(this.vouchId)}
986
+ templateId=${ifDefined(this.templateId)}
987
+ .questions=${this.questions}
988
+ .controls=${this.controls}
989
+ env=${ifDefined(this.env)}
990
+ apiKey=${ifDefined(this.apiKey)}
991
+ ?disableTracking=${this.disableTracking}
992
+ trackingSource=${ifDefined(this.trackingSource)}
993
+ preload=${ifDefined(this.preload)}
994
+ aspectRatio=${this.aspectRatio}
995
+ ></vouch-embed-player>
996
+ </vouch-embed-dialog-overlay>
997
+ `;
998
+ }
999
+ };
1000
+ __decorateClass$1([
1001
+ property({ type: String })
1002
+ ], DialogPortal.prototype, "vouchId", 2);
1003
+ __decorateClass$1([
1004
+ property({ type: String })
1005
+ ], DialogPortal.prototype, "templateId", 2);
1006
+ __decorateClass$1([
1007
+ property({ type: Array })
1008
+ ], DialogPortal.prototype, "questions", 2);
1009
+ __decorateClass$1([
1010
+ property({ type: String })
1011
+ ], DialogPortal.prototype, "env", 2);
1012
+ __decorateClass$1([
1013
+ property({ type: String })
1014
+ ], DialogPortal.prototype, "apiKey", 2);
1015
+ __decorateClass$1([
1016
+ property({ type: Boolean })
1017
+ ], DialogPortal.prototype, "disableTracking", 2);
1018
+ __decorateClass$1([
1019
+ property({ type: String })
1020
+ ], DialogPortal.prototype, "trackingSource", 2);
1021
+ __decorateClass$1([
1022
+ property({ type: Array })
1023
+ ], DialogPortal.prototype, "controls", 2);
1024
+ __decorateClass$1([
1025
+ property({ type: String })
1026
+ ], DialogPortal.prototype, "preload", 2);
1027
+ __decorateClass$1([
1028
+ property({ type: Boolean })
1029
+ ], DialogPortal.prototype, "disableAutoplay", 2);
1030
+ __decorateClass$1([
1031
+ property({ type: Number })
1032
+ ], DialogPortal.prototype, "aspectRatio", 2);
1033
+ __decorateClass$1([
1034
+ state()
1035
+ ], DialogPortal.prototype, "open", 2);
1036
+ DialogPortal = __decorateClass$1([
1037
+ customElement("vouch-embed-dialog-portal")
1038
+ ], DialogPortal);
1039
+ var __defProp = Object.defineProperty;
1040
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
1041
+ var __decorateClass = (decorators, target, key, kind) => {
1042
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
1043
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
1044
+ if (decorator = decorators[i])
1045
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1046
+ if (kind && result)
1047
+ __defProp(target, key, result);
1048
+ return result;
1049
+ };
1050
+ let DialogEmbed = class extends LitElement {
1051
+ constructor() {
1052
+ super(...arguments);
1053
+ this.env = "prod";
1054
+ this.apiKey = "";
1055
+ this.disableTracking = false;
1056
+ this.trackingSource = "embedded_player";
1057
+ this.preload = "none";
1058
+ this.disableAutoplay = false;
1059
+ this.aspectRatio = 0;
1060
+ this._id = v4();
1061
+ this._handleRootClick = () => {
1062
+ this.dispatchEvent(new CustomEvent("dialogembed:click", { detail: this._id, bubbles: true, composed: true }));
1063
+ };
1064
+ }
1065
+ connectedCallback() {
1066
+ super.connectedCallback();
1067
+ this.addEventListener("click", this._handleRootClick);
1068
+ }
1069
+ disconnectedCallback() {
1070
+ super.disconnectedCallback();
1071
+ this.removeEventListener("click", this._handleRootClick);
1072
+ }
1073
+ render() {
1074
+ return html`
1075
+ <slot>
1076
+ <vmp-button size="large">Play</vmp-button>
1077
+ </slot>
1078
+ <vouch-embed-dialog-portal
1079
+ id=${this._id}
1080
+ ?autoplay=${false}
1081
+ vouchId=${ifDefined(this.vouchId)}
1082
+ templateId=${ifDefined(this.templateId)}
1083
+ .questions=${this.questions}
1084
+ .controls=${this.controls}
1085
+ env=${ifDefined(this.env)}
1086
+ apiKey=${ifDefined(this.apiKey)}
1087
+ ?disableTracking=${this.disableTracking}
1088
+ trackingSource=${ifDefined(this.trackingSource)}
1089
+ preload=${ifDefined(this.preload)}
1090
+ aspectRatio=${this.aspectRatio}
1091
+ ></vouch-embed-dialog-portal>
1092
+ `;
1093
+ }
1094
+ };
1095
+ DialogEmbed.styles = [
1096
+ css`
1097
+ :host {
1098
+ --vu-button-padding: 10px 20px;
1099
+ --vu-button-background: #287179;
1100
+ --vu-button-background-hover: #4faab2;
1101
+
1102
+ display: flex;
1103
+ width: fit-content;
1104
+ height: fit-content;
1105
+ }
1106
+ `
1107
+ ];
1108
+ __decorateClass([
1109
+ property({ type: String })
1110
+ ], DialogEmbed.prototype, "vouchId", 2);
1111
+ __decorateClass([
1112
+ property({ type: String })
1113
+ ], DialogEmbed.prototype, "templateId", 2);
1114
+ __decorateClass([
1115
+ property({ type: Array })
1116
+ ], DialogEmbed.prototype, "questions", 2);
1117
+ __decorateClass([
1118
+ property({ type: String })
1119
+ ], DialogEmbed.prototype, "env", 2);
1120
+ __decorateClass([
1121
+ property({ type: String })
1122
+ ], DialogEmbed.prototype, "apiKey", 2);
1123
+ __decorateClass([
1124
+ property({ type: Boolean })
1125
+ ], DialogEmbed.prototype, "disableTracking", 2);
1126
+ __decorateClass([
1127
+ property({ type: String })
1128
+ ], DialogEmbed.prototype, "trackingSource", 2);
1129
+ __decorateClass([
1130
+ property({ type: Array })
1131
+ ], DialogEmbed.prototype, "controls", 2);
1132
+ __decorateClass([
1133
+ property({ type: String })
1134
+ ], DialogEmbed.prototype, "preload", 2);
1135
+ __decorateClass([
1136
+ property({ type: Boolean })
1137
+ ], DialogEmbed.prototype, "disableAutoplay", 2);
1138
+ __decorateClass([
1139
+ property({ type: Number })
1140
+ ], DialogEmbed.prototype, "aspectRatio", 2);
1141
+ DialogEmbed = __decorateClass([
1142
+ customElement("vouch-embed-dialog")
1143
+ ], DialogEmbed);
8
1144
  export {
9
- a as Embed
1145
+ DialogEmbed,
1146
+ PlayerEmbed
10
1147
  };
11
1148
  //# sourceMappingURL=embeds.js.map