@vouchfor/embeds 0.0.0-experiment.f9b576b → 0.0.0-experiment.fcfd44c

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. package/dist/es/embeds.js +1144 -13
  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/PlayerEmbed/controllers/fetcher.d.ts +14 -0
  8. package/dist/es/src/components/PlayerEmbed/controllers/tracking/index.d.ts +36 -0
  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 -0
  14. package/dist/es/src/utils/env.d.ts +12 -0
  15. package/dist/es/src/utils/events.d.ts +2 -0
  16. package/dist/iife/dialog-embed/embed.iife.js +4042 -0
  17. package/dist/iife/dialog-embed/embed.iife.js.map +1 -0
  18. package/dist/iife/embeds.iife.js +3059 -368
  19. package/dist/iife/embeds.iife.js.map +1 -1
  20. package/dist/iife/player-embed/embed.iife.js +3904 -0
  21. package/dist/iife/player-embed/embed.iife.js.map +1 -0
  22. package/package.json +52 -34
  23. package/src/components/DialogEmbed/Dialog.stories.ts +91 -0
  24. package/src/components/DialogEmbed/DialogOverlay.ts +131 -0
  25. package/src/components/DialogEmbed/DialogPortal.ts +126 -0
  26. package/src/components/DialogEmbed/index.ts +97 -0
  27. package/src/components/PlayerEmbed/MultiEmbed.stories.ts +135 -0
  28. package/src/components/PlayerEmbed/PlayerEmbed.stories.ts +93 -0
  29. package/src/components/PlayerEmbed/controllers/event-forwarder.ts +48 -0
  30. package/src/components/PlayerEmbed/controllers/fetcher.ts +152 -0
  31. package/src/components/PlayerEmbed/controllers/tracking/index.ts +224 -0
  32. package/src/components/PlayerEmbed/controllers/tracking/utils.ts +95 -0
  33. package/src/components/PlayerEmbed/index.ts +262 -0
  34. package/src/components/PlayerEmbed/tests/PlayerEmbed.spec.ts +87 -0
  35. package/src/components/PlayerEmbed/tests/data.ts +227 -0
  36. package/src/components/PlayerEmbed/tests/media-data.ts +22 -0
  37. package/src/index.ts +2 -1
  38. package/src/utils/env.ts +64 -0
  39. package/src/utils/events.ts +13 -0
  40. package/dist/es/components/InlineEmbed.d.ts +0 -12
  41. package/dist/es/components/index.d.ts +0 -2
  42. package/dist/es/index.d.ts +0 -1
  43. package/src/components/InlineEmbed.stories.ts +0 -119
  44. package/src/components/InlineEmbed.ts +0 -18
  45. package/src/components/index.ts +0 -2
@@ -1 +1 @@
1
- {"version":3,"file":"embeds.js","sources":["../../src/components/InlineEmbed.ts"],"sourcesContent":["import { MediaPlayer } from '@vouchfor/media-player';\nimport { customElement } from 'lit/decorators.js';\n\nimport type { MediaPlayerProps } from '@vouchfor/media-player';\n\ntype InlineEmbedProps = MediaPlayerProps;\n\n@customElement('vembed-inline')\nclass InlineEmbed extends MediaPlayer {}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'vembed-inline': InlineEmbed;\n }\n}\n\nexport { InlineEmbed };\nexport type { InlineEmbedProps };\n"],"names":["InlineEmbed","MediaPlayer","__decorateClass","customElement"],"mappings":";;;;;;;AAQM,IAAAA,IAAN,cAA0BC,EAAY;AAAC;AAAjCD,IAANE,EAAA;AAAA,EADCC,EAAc,eAAe;AAAA,GACxBH,CAAA;"}
1
+ {"version":3,"file":"embeds.js","sources":["../../src/utils/events.ts","../../src/components/PlayerEmbed/controllers/event-forwarder.ts","../../src/utils/env.ts","../../src/components/PlayerEmbed/controllers/fetcher.ts","../../src/components/PlayerEmbed/controllers/tracking/utils.ts","../../src/components/PlayerEmbed/controllers/tracking/index.ts","../../src/components/PlayerEmbed/index.ts","../../src/components/DialogEmbed/DialogOverlay.ts","../../src/components/DialogEmbed/DialogPortal.ts","../../src/components/DialogEmbed/index.ts"],"sourcesContent":["function forwardEvent(type: string, fromElement: HTMLElement, toElement: HTMLElement) {\n function forwarder(event: Event) {\n toElement.dispatchEvent(new CustomEvent(event.type, event));\n }\n\n fromElement.addEventListener(type, forwarder);\n\n return () => {\n fromElement.removeEventListener(type, forwarder);\n };\n}\n\nexport { forwardEvent };\n","import { createRef, ref } from 'lit/directives/ref.js';\n\nimport type { PlayerEmbed } from '..';\nimport type { ReactiveController, ReactiveControllerHost } from 'lit';\nimport type { DirectiveResult } from 'lit/directive.js';\nimport type { Ref } from 'lit/directives/ref.js';\n\nimport { forwardEvent } from '~/utils/events';\n\ntype PlayerEmbedHost = ReactiveControllerHost & PlayerEmbed;\n\nclass EventForwardController implements ReactiveController {\n host: PlayerEmbedHost;\n\n private _events: string[] = [];\n private _cleanup: (() => void)[] = [];\n private _forwardElementRef: Ref<HTMLElement> = createRef();\n\n constructor(host: PlayerEmbedHost, events: string[]) {\n this.host = host;\n this._events = events;\n host.addController(this);\n }\n\n register(): DirectiveResult {\n return ref(this._forwardElementRef);\n }\n\n hostConnected() {\n // Guaranteed to have the element ref in the RAF callback because of how the lit lifecycle works\n requestAnimationFrame(() => {\n this._events.forEach((event) => {\n if (this._forwardElementRef.value) {\n this._cleanup.push(forwardEvent(event, this._forwardElementRef.value, this.host));\n }\n });\n });\n }\n\n hostDisconnected() {\n this._cleanup.forEach((fn) => {\n fn();\n });\n this._cleanup = [];\n }\n}\n\nexport { EventForwardController };\n","type Environment = 'local' | 'dev' | 'staging' | 'prod';\n\ntype GetEnvUrlsReturn = {\n videoUrl: string;\n publicApiUrl: string;\n embedApiUrl: string;\n};\n\nconst devVideoUrl = 'https://d2rxhdlm2q91uk.cloudfront.net';\nconst stagingVideoUrl = 'https://d1ix11aj5kfygl.cloudfront.net';\nconst prodVideoUrl = 'https://d157jlwnudd93d.cloudfront.net';\n\nconst devPublicApiUrl = 'https://bshyfw4h5a.execute-api.ap-southeast-2.amazonaws.com/dev';\nconst stagingPublicApiUrl = 'https://gyzw7rpbq3.execute-api.ap-southeast-2.amazonaws.com/staging';\nconst prodPublicApiUrl = 'https://vfcjuim1l3.execute-api.ap-southeast-2.amazonaws.com/prod';\n\nconst localEmbedApiUrl = 'http://localhost:6060/v2';\nconst devEmbedApiUrl = 'https://embed-dev.vouchfor.com/v2';\nconst stagingEmbedApiUrl = 'https://embed-staging.vouchfor.com/v2';\nconst prodEmbedApiUrl = 'https://embed.vouchfor.com/v2';\n\n// We are handling the case where env is an unknown string so the ts error is a lie\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nfunction getEnvUrls(env: Environment): GetEnvUrlsReturn {\n if (!['local', 'dev', 'staging', 'prod'].includes(env)) {\n throw new Error(`Unknown environment: ${env}`);\n }\n\n if (env === 'local') {\n return {\n videoUrl: devVideoUrl,\n publicApiUrl: devPublicApiUrl,\n embedApiUrl: localEmbedApiUrl\n };\n }\n\n if (env === 'dev') {\n return {\n videoUrl: devVideoUrl,\n publicApiUrl: devPublicApiUrl,\n embedApiUrl: devEmbedApiUrl\n };\n }\n\n if (env === 'staging') {\n return {\n videoUrl: stagingVideoUrl,\n publicApiUrl: stagingPublicApiUrl,\n embedApiUrl: stagingEmbedApiUrl\n };\n }\n\n if (env === 'prod') {\n return {\n videoUrl: prodVideoUrl,\n publicApiUrl: prodPublicApiUrl,\n embedApiUrl: prodEmbedApiUrl\n };\n }\n}\n\nexport { devEmbedApiUrl, stagingEmbedApiUrl, prodEmbedApiUrl, getEnvUrls };\nexport type { Environment };\n","import { Task } from '@lit/task';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport type { PlayerEmbed, PlayerEmbedProps } from '..';\nimport type { ReactiveControllerHost } from 'lit';\nimport type { Environment } from '~/utils/env';\n\nimport { getEnvUrls } from '~/utils/env';\n\ntype PlayerEmbedHost = ReactiveControllerHost & PlayerEmbed;\n\ntype FetchTaskDeps = [\n PlayerEmbedProps['env'],\n PlayerEmbedProps['apiKey'],\n PlayerEmbedProps['data'],\n PlayerEmbedProps['vouchId'],\n PlayerEmbedProps['templateId']\n];\n\ntype FilterTaskDeps = [PlayerEmbedProps['data'], PlayerEmbedProps['questions']];\n\nclass FetcherController {\n host: PlayerEmbedHost;\n\n private _fetching = false;\n private _vouch: PlayerEmbedProps['data'];\n\n set fetching(value) {\n if (this._fetching !== value) {\n this._fetching = value;\n this.host.requestUpdate();\n }\n }\n get fetching() {\n return this._fetching;\n }\n\n private getVouch = async (env: Environment, apiKey: string, vouchId: string) => {\n const { embedApiUrl } = getEnvUrls(env);\n\n const cacheCheck = uuidv4();\n const res = await fetch(`${embedApiUrl}/vouches/${vouchId}`, {\n method: 'GET',\n headers: [\n ['X-Api-Key', apiKey],\n ['X-Cache-Check', cacheCheck]\n ]\n });\n\n const vouch = await res.json();\n this.host.dispatchEvent(new CustomEvent('vouch:loaded', { detail: vouch?.id }));\n\n // HACK: we're currently using API Gateway caching on the embed API without any invalidation logic,\n // so to ensure that the cache stays up to date, whenever we detect a cache hit we trigger another\n // API call with the `Cache-Control` header which will re-fill the cache\n const resCacheCheck = res?.headers?.get('X-Cache-Check');\n if (resCacheCheck !== cacheCheck) {\n fetch(`${embedApiUrl}/vouches/${vouchId}`, {\n method: 'GET',\n headers: [\n ['X-Api-Key', apiKey],\n ['Cache-Control', 'max-age=0']\n ]\n });\n }\n\n return vouch;\n };\n\n private getTemplate = async (env: Environment, apiKey: string, templateId: string) => {\n const { embedApiUrl } = getEnvUrls(env);\n\n const cacheCheck = uuidv4();\n const res = await fetch(`${embedApiUrl}/templates/${templateId}`, {\n method: 'GET',\n headers: [\n ['X-Api-Key', apiKey],\n ['X-Cache-Check', cacheCheck]\n ]\n });\n const template = await res.json();\n\n // HACK: we're currently using API Gateway caching on the embed API without any invalidation logic,\n // so to ensure that the cache stays up to date, whenever we detect a cache hit we trigger another\n // API call with the `Cache-Control` header which will re-fill the cache\n const resCacheCheck = res?.headers?.get('X-Cache-Check');\n if (resCacheCheck !== cacheCheck) {\n fetch(`${embedApiUrl}/templates/${templateId}`, {\n method: 'GET',\n headers: [\n ['X-Api-Key', apiKey],\n ['Cache-Control', 'max-age=0']\n ]\n });\n }\n\n return template;\n };\n\n constructor(host: PlayerEmbedHost) {\n this.host = host;\n new Task<FetchTaskDeps, void>(\n this.host,\n async ([env, apiKey, data, vouchId, templateId]: FetchTaskDeps) => {\n try {\n host.vouch = undefined;\n host.template = undefined;\n\n if (data) {\n let template;\n if (templateId) {\n this.fetching = true;\n template = await this.getTemplate(env, apiKey, templateId);\n }\n this._vouch = data;\n host.template = template ?? data?.settings?.template?.instance;\n } else if (vouchId) {\n this.fetching = true;\n\n const [vouch, template] = await Promise.all([\n this.getVouch(env, apiKey, vouchId),\n templateId ? this.getTemplate(env, apiKey, templateId) : null\n ]);\n this._vouch = vouch;\n host.template = template ?? vouch?.settings?.template?.instance;\n }\n } finally {\n this.fetching = false;\n }\n },\n () => [host.env, host.apiKey, host.data, host.vouchId, host.templateId]\n );\n\n // This second task is to be able to filter the vouch without fetching it again if only the questions changed\n new Task<FilterTaskDeps, void>(\n this.host,\n ([vouch, questions]: FilterTaskDeps) => {\n host.vouch = vouch\n ? {\n ...vouch,\n questions: {\n items: vouch?.questions.items.filter((_, index) => !questions?.length || questions?.includes(index + 1))\n }\n }\n : undefined;\n },\n () => [this._vouch, host.questions]\n );\n }\n}\n\nexport { FetcherController };\n","import { TEMPLATE_VERSION } from '@vouchfor/canvas-video';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport type { TrackingPayload } from '.';\nimport type { Vouch } from '@vouchfor/video-utils';\nimport type { Environment } from '~/utils/env';\n\nimport packageJson from '~/../package.json';\nimport { getEnvUrls } from '~/utils/env';\n\nfunction createVisitor(env: Environment) {\n const { publicApiUrl } = getEnvUrls(env);\n const visitorId = uuidv4();\n navigator.sendBeacon(`${publicApiUrl}/api/visitor`, JSON.stringify({ visitorId }));\n return visitorId;\n}\n\nfunction getUids(env: Environment) {\n if (typeof window === 'undefined') {\n return {\n client: null,\n tab: null,\n request: uuidv4()\n };\n }\n\n // Persisted for a user for the same device + browser, so we can e.g. search for all logs related to that browser\n let visitorId = window.localStorage?.getItem?.('vouch-uid-visitor');\n // Persisted for a user for the same device + browser, so we can e.g. search for all logs related to that browser\n let clientId = window.localStorage?.getItem?.('vouch-uid-client');\n // Persisted in session storage, so we can search for everything the user has done in a specific tab\n let tabId = window.sessionStorage?.getItem?.('vouch-uid-tab');\n // Not persisted, allows us to search for any logs related to a single FE request\n // E.g. BE should pass this request ID through all other services to be able to group logs\n const requestId = uuidv4();\n\n // Cache uids\n if (!visitorId) {\n visitorId = createVisitor(env);\n window.localStorage?.setItem?.('vouch-uid-visitor', visitorId);\n }\n\n if (!clientId) {\n clientId = uuidv4();\n window.localStorage?.setItem?.('vouch-uid-client', clientId);\n }\n\n if (!tabId) {\n tabId = uuidv4();\n window.sessionStorage?.setItem?.('vouch-uid-tab', tabId);\n }\n\n return {\n client: clientId,\n tab: tabId,\n request: requestId,\n visitor: visitorId\n };\n}\n\nfunction findVouchId(payload?: TrackingPayload, vouch?: Vouch) {\n if (payload && 'vouchId' in payload) {\n return payload.vouchId;\n }\n return vouch?.id ?? null;\n}\n\nfunction getReportingMetadata(source = 'embedded_player') {\n const [country, region] = Intl.DateTimeFormat().resolvedOptions().timeZone?.split?.('/') ?? [];\n\n const utmParams: any = {};\n [...new URLSearchParams(location.search).entries()].forEach(([key, value]) => {\n if (/utm/.test(key)) {\n const param = key.toLowerCase().replace(/[-_][a-z0-9]/g, (group) => group.slice(-1).toUpperCase());\n utmParams[param] = value;\n }\n });\n\n return {\n source,\n time: new Date(),\n region,\n country,\n screenHeight: window.screen.height,\n screenWidth: window.screen.width,\n referrer: document.referrer,\n currentUrl: location.href,\n embedType: 'media-player-embed',\n embedVersion: packageJson.version,\n templateVersion: TEMPLATE_VERSION,\n ...utmParams\n };\n}\n\nexport { getUids, findVouchId, getReportingMetadata };\n","import type { PlayerEmbed } from '../..';\nimport type { MediaEventDetail } from '@vouchfor/media-player';\nimport type { ReactiveController, ReactiveControllerHost } from 'lit';\n\nimport { findVouchId, getReportingMetadata, getUids } from './utils';\nimport { getEnvUrls } from '~/utils/env';\n\nconst MINIMUM_SEND_THRESHOLD = 1;\n\ntype PlayerEmbedHost = ReactiveControllerHost & PlayerEmbed;\n\ntype TrackingEvent = 'VOUCH_LOADED' | 'VOUCH_RESPONSE_VIEWED' | 'VIDEO_PLAYED' | 'VIDEO_STREAMED';\ntype TrackingPayload = {\n vouchId?: string;\n answerId?: string;\n streamStart?: number;\n streamEnd?: number;\n};\n\ntype BatchEvent = {\n event: TrackingEvent;\n payload: TrackingPayload & {\n time: string;\n };\n};\n\ntype TimeMap = {\n [key: string]: number;\n};\n\ntype BooleanMap = {\n [key: string]: boolean;\n};\n\nclass TrackingController implements ReactiveController {\n host: PlayerEmbedHost;\n\n private _batchedEvents: BatchEvent[] = [];\n private _hasPlayed = false;\n private _hasLoaded: BooleanMap = {};\n private _answersViewed: BooleanMap = {};\n private _streamStartTime: TimeMap = {};\n private _streamLatestTime: TimeMap = {};\n private _currentlyPlayingVideo: MediaEventDetail | null = null;\n\n constructor(host: PlayerEmbedHost) {\n this.host = host;\n host.addController(this);\n }\n\n private _createTrackingEvent = (event: TrackingEvent, payload?: TrackingPayload) => {\n const vouchId = findVouchId(payload, this.host.vouch);\n\n if (!vouchId || this.host.disableTracking) {\n return;\n }\n\n this._batchedEvents.push({\n event,\n payload: {\n ...payload,\n vouchId,\n time: new Date().toISOString()\n }\n });\n };\n\n private _sendTrackingEvent = () => {\n if (this._batchedEvents.length <= 0) {\n return;\n }\n\n const { publicApiUrl } = getEnvUrls(this.host.env);\n const { client, tab, request, visitor } = getUids(this.host.env);\n\n navigator.sendBeacon(\n `${publicApiUrl}/api/batchevents`,\n JSON.stringify({\n payload: {\n events: this._batchedEvents\n },\n context: {\n 'x-uid-client': client,\n 'x-uid-tab': tab,\n 'x-uid-request': request,\n 'x-uid-visitor': visitor,\n 'x-reporting-metadata': getReportingMetadata(this.host.trackingSource)\n }\n })\n );\n\n this._batchedEvents = [];\n };\n\n private _streamEnded = () => {\n if (this._currentlyPlayingVideo) {\n const { id, key } = this._currentlyPlayingVideo;\n // Don't send a tracking event when seeking backwards\n if (this._streamLatestTime[key] > this._streamStartTime[key] + MINIMUM_SEND_THRESHOLD) {\n // Send a video streamed event any time the stream ends to capture the time between starting\n // the video and the video stopping for any reason (pausing, deleting the embed node or closing the browser)\n this._createTrackingEvent('VIDEO_STREAMED', {\n answerId: id,\n streamStart: this._streamStartTime[key],\n streamEnd: this._streamLatestTime[key]\n });\n }\n\n // Make sure these events are only sent once by deleting the start and latest times\n delete this._streamStartTime[key];\n delete this._streamLatestTime[key];\n }\n };\n\n private _handleVouchLoaded = ({ detail: vouchId }: CustomEvent<string>) => {\n if (!vouchId) {\n return;\n }\n\n // Only send loaded event once per session\n if (!this._hasLoaded[vouchId]) {\n this._createTrackingEvent('VOUCH_LOADED', { vouchId });\n this._hasLoaded[vouchId] = true;\n }\n };\n\n private _handlePlay = () => {\n // Only send the video played event once per session\n if (!this._hasPlayed) {\n this._createTrackingEvent('VIDEO_PLAYED', {\n streamStart: this.host.currentTime\n });\n this._hasPlayed = true;\n }\n };\n\n private _handleVideoPlay = ({ detail: { id, key } }: CustomEvent<MediaEventDetail>) => {\n // Only increment play count once per session\n if (!this._answersViewed[key]) {\n this._createTrackingEvent('VOUCH_RESPONSE_VIEWED', {\n answerId: id\n });\n this._answersViewed[key] = true;\n }\n };\n\n private _handleVideoTimeUpdate = ({ detail: { id, key, node } }: CustomEvent<MediaEventDetail>) => {\n if (\n // We only want to count any time that the video is actually playing\n !this.host.paused\n // Only update the latest time if this event fires for the currently active video\n // id === this.host.scene?.video?.id\n ) {\n this._currentlyPlayingVideo = { id, key, node };\n this._streamLatestTime[key] = node.currentTime;\n\n if (!this._streamStartTime[key]) {\n this._streamStartTime[key] = node.currentTime;\n this._streamLatestTime[key] = node.currentTime;\n }\n }\n };\n\n private _handleVideoPause = ({ detail: { id, key } }: CustomEvent<MediaEventDetail>) => {\n if (this._streamLatestTime[key] > this._streamStartTime[key] + MINIMUM_SEND_THRESHOLD) {\n this._createTrackingEvent('VIDEO_STREAMED', {\n answerId: id,\n streamStart: this._streamStartTime[key],\n streamEnd: this._streamLatestTime[key]\n });\n }\n delete this._streamStartTime[key];\n delete this._streamLatestTime[key];\n };\n\n private _pageUnloading = () => {\n this._streamEnded();\n this._sendTrackingEvent();\n };\n\n private _handleVisibilityChange = () => {\n if (document.visibilityState === 'hidden') {\n this._pageUnloading();\n }\n };\n\n private _handlePageHide = () => {\n this._pageUnloading();\n };\n\n hostConnected() {\n requestAnimationFrame(() => {\n if ('onvisibilitychange' in document) {\n document.addEventListener('visibilitychange', this._handleVisibilityChange);\n } else {\n window.addEventListener('pagehide', this._handlePageHide);\n }\n this.host.addEventListener('vouch:loaded', this._handleVouchLoaded);\n this.host.mediaPlayer?.addEventListener('play', this._handlePlay);\n this.host.mediaPlayer?.addEventListener('video:play', this._handleVideoPlay);\n this.host.mediaPlayer?.addEventListener('video:pause', this._handleVideoPause);\n this.host.mediaPlayer?.addEventListener('video:timeupdate', this._handleVideoTimeUpdate);\n });\n }\n\n hostDisconnected() {\n // Send events if DOM node is destroyed\n this._pageUnloading();\n\n if ('onvisibilitychange' in document) {\n document.removeEventListener('visibilitychange', this._handleVisibilityChange);\n } else {\n window.removeEventListener('pagehide', this._handlePageHide);\n }\n this.host.removeEventListener('vouch:loaded', this._handleVouchLoaded);\n this.host.mediaPlayer?.removeEventListener('play', this._handlePlay);\n this.host.mediaPlayer?.removeEventListener('video:play', this._handleVideoPlay);\n this.host.mediaPlayer?.removeEventListener('video:pause', this._handleVideoPause);\n this.host.mediaPlayer?.removeEventListener('video:timeupdate', this._handleVideoTimeUpdate);\n }\n}\n\nexport { TrackingController };\nexport type { TrackingEvent, TrackingPayload };\n","import { css, html, LitElement } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { createRef, ref } from 'lit/directives/ref.js';\n\nimport type { TemplateInstance } from '@vouchfor/canvas-video';\nimport type { MediaPlayer, MediaPlayerProps } from '@vouchfor/media-player';\nimport type { Vouch } from '@vouchfor/video-utils';\nimport type { PropertyValueMap } from 'lit';\nimport type { Environment } from '~/utils/env';\n\nimport { EventForwardController } from './controllers/event-forwarder';\nimport { FetcherController } from './controllers/fetcher';\nimport { TrackingController } from './controllers/tracking';\n\nimport '@vouchfor/media-player';\n\ntype PlayerEmbedProps = Pick<MediaPlayerProps, 'aspectRatio' | 'language' | 'preload' | 'autoplay' | 'controls'> & {\n data?: Vouch;\n env: Environment;\n apiKey: string;\n disableTracking?: boolean;\n trackingSource?: string;\n vouchId?: string;\n templateId?: string;\n // Index of the questions to include starting from 1\n questions?: number[];\n};\n\n@customElement('vouch-embed-player')\nclass PlayerEmbed extends LitElement {\n static styles = [\n css`\n :host {\n display: flex;\n }\n `\n ];\n\n @property({ type: Object }) data: PlayerEmbedProps['data'];\n @property({ type: String }) vouchId: PlayerEmbedProps['vouchId'];\n @property({ type: String }) templateId: PlayerEmbedProps['templateId'];\n @property({ type: Array }) questions: PlayerEmbedProps['questions'];\n\n @property({ type: String }) env: PlayerEmbedProps['env'] = 'prod';\n @property({ type: String }) apiKey: PlayerEmbedProps['apiKey'] = '';\n @property({ type: Boolean }) disableTracking: PlayerEmbedProps['disableTracking'] = false;\n @property({ type: String }) trackingSource: PlayerEmbedProps['trackingSource'] = 'embedded_player';\n\n @property({ type: Array }) controls: PlayerEmbedProps['controls'];\n @property({ type: String }) preload: PlayerEmbedProps['preload'] = 'auto';\n @property({ type: Boolean }) autoplay: PlayerEmbedProps['autoplay'] = false;\n @property({ type: Number }) aspectRatio: PlayerEmbedProps['aspectRatio'] = 0;\n @property({ type: String }) language?: MediaPlayerProps['language'];\n\n private eventController = new EventForwardController(this, [\n 'durationchange',\n 'ended',\n 'error',\n 'loadeddata',\n 'pause',\n 'stalled',\n 'play',\n 'playing',\n 'ratechange',\n 'scenechange',\n 'scenesupdate',\n 'seeking',\n 'seeked',\n 'timeupdate',\n 'volumechange',\n 'processing',\n 'waiting',\n\n 'video:loadeddata',\n 'video:seeking',\n 'video:seeked',\n 'video:play',\n 'video:playing',\n 'video:pause',\n 'video:stalled',\n 'video:timeupdate',\n 'video:ended',\n 'video:error'\n ]);\n private _fetcherController = new FetcherController(this);\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n private _trackingController = new TrackingController(this);\n\n @state() vouch: PlayerEmbedProps['data'];\n @state() template: TemplateInstance | undefined;\n\n get fetching() {\n return this._fetcherController.fetching;\n }\n\n private _mediaPlayerRef = createRef<MediaPlayer>();\n\n get waiting() {\n return this._mediaPlayerRef.value?.waiting;\n }\n\n get initialised() {\n return this._mediaPlayerRef.value?.initialised;\n }\n\n get seeking() {\n return this._mediaPlayerRef.value?.seeking;\n }\n\n get paused() {\n return this._mediaPlayerRef.value?.paused;\n }\n\n get captions() {\n return this._mediaPlayerRef.value?.captions;\n }\n\n get fullscreen() {\n return this._mediaPlayerRef.value?.fullscreen;\n }\n\n get duration() {\n return this._mediaPlayerRef.value?.duration;\n }\n\n set currentTime(value: number) {\n if (this._mediaPlayerRef.value) {\n this._mediaPlayerRef.value.currentTime = value;\n }\n }\n get currentTime() {\n return this._mediaPlayerRef.value?.currentTime ?? 0;\n }\n\n set playbackRate(value: number) {\n if (this._mediaPlayerRef.value) {\n this._mediaPlayerRef.value.playbackRate = value;\n }\n }\n get playbackRate() {\n return this._mediaPlayerRef.value?.playbackRate ?? 1;\n }\n\n set volume(value: number) {\n if (this._mediaPlayerRef.value) {\n this._mediaPlayerRef.value.volume = value;\n }\n }\n get volume() {\n return this._mediaPlayerRef.value?.volume ?? 1;\n }\n\n set muted(value: boolean) {\n if (this._mediaPlayerRef.value) {\n this._mediaPlayerRef.value.muted = value;\n }\n }\n get muted() {\n return this._mediaPlayerRef.value?.muted ?? false;\n }\n\n // get scene(): Scene | null {\n // return this._mediaPlayerRef.value?.scene ?? null;\n // }\n\n // get scenes(): Scene[] {\n // return this._mediaPlayerRef.value?.scenes ?? [];\n // }\n\n // get sceneConfig(): Scenes | null {\n // return this._mediaPlayerRef.value?.sceneConfig ?? null;\n // }\n\n get mediaState() {\n return this._mediaPlayerRef.value?.mediaState;\n }\n\n get mediaPlayer() {\n return this._mediaPlayerRef.value;\n }\n\n play() {\n this._mediaPlayerRef.value?.play();\n }\n\n pause() {\n this._mediaPlayerRef.value?.pause();\n }\n\n reset(time = 0, play = false) {\n this._mediaPlayerRef.value?.reset(time, play);\n }\n\n // setScene(index: number) {\n // this._mediaPlayerRef.value?.setScene(index);\n // }\n\n private _renderStyles() {\n if (!this.aspectRatio) {\n return html`\n <style>\n :host {\n width: 100%;\n height: 100%;\n }\n </style>\n `;\n }\n\n if (typeof this.aspectRatio === 'number') {\n return html`\n <style>\n :host {\n aspect-ratio: ${this.aspectRatio};\n }\n </style>\n `;\n }\n\n return null;\n }\n\n protected willUpdate(changedProperties: PropertyValueMap<PlayerEmbedProps>) {\n // If the vouch this embed is pointing to changes then reset the player\n if (changedProperties.has('vouchId') && this.vouchId !== changedProperties.get('vouchId')) {\n this.reset(0, false);\n }\n }\n\n render() {\n return html`\n ${this._renderStyles()}\n <vmp-media-player\n ${ref(this._mediaPlayerRef)}\n ${this.eventController.register()}\n ?autoplay=${this.autoplay}\n ?loading=${this.fetching}\n aspectRatio=${ifDefined(this.aspectRatio)}\n preload=${ifDefined(this.preload)}\n language=${ifDefined(this.language)}\n .controls=${this.controls}\n ></vmp-media-player>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'vouch-embed-player': PlayerEmbed;\n }\n\n namespace JSX {\n interface IntrinsicElements {\n 'vouch-embed-player': PlayerEmbed;\n }\n }\n}\n\nexport { PlayerEmbed };\nexport type { PlayerEmbedProps };\n","import { css, html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { styleMap } from 'lit/directives/style-map.js';\n\nimport type { DialogEmbedProps } from '.';\n\nimport '@a11y/focus-trap';\n\n@customElement('vouch-embed-dialog-overlay')\nclass DialogOverlay extends LitElement {\n static styles = [\n css`\n :host {\n --vouch-media-player-border-radius: var(--vu-media-player-border-radius, 12px);\n --overlay-background-color: var(--vu-overlay-background-color, black);\n --overlay-background-opacity: var(--vu-overlay-background-opacity, 0.4);\n\n --dialog-width: var(--vu-dialog-width, 890px);\n --dialog-height: var(--vu-dialog-height, 500px);\n }\n\n .container {\n position: fixed;\n display: flex;\n inset: 0;\n opacity: 1;\n z-index: 2147483647;\n align-items: center;\n justify-content: center;\n transition: opacity 100ms ease-in;\n }\n\n .hidden {\n opacity: 0;\n pointer-events: none;\n }\n\n .background {\n position: absolute;\n inset: 0;\n opacity: var(--overlay-background-opacity);\n background-color: var(--overlay-background-color);\n }\n\n focus-trap {\n display: flex;\n align-items: center;\n justify-content: center;\n margin: 40px;\n width: var(--dialog-width);\n height: var(--dialog-height);\n max-width: calc(100% - 80px);\n max-height: calc(100% - 80px);\n }\n\n .video-frame {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n max-width: 100%;\n max-height: 100%;\n }\n\n .video-frame.grow {\n width: 100%;\n height: 100%;\n }\n\n vmp-icon-button {\n position: absolute;\n top: 0;\n right: 0;\n margin: 10px;\n }\n `\n ];\n\n @property({ type: Boolean }) open = false;\n @property({ type: Number }) aspectRatio: DialogEmbedProps['aspectRatio'] = 0;\n\n render() {\n return html`\n <div\n class=${classMap({\n container: true,\n hidden: !this.open\n })}\n >\n <div\n class=\"background\"\n @click=${() => this.dispatchEvent(new CustomEvent('overlay:click', { bubbles: true, composed: true }))}\n ></div>\n <focus-trap>\n <div\n class=${classMap({\n 'video-frame': true,\n grow: this.aspectRatio === 0\n })}\n style=${styleMap({\n aspectRatio: this.aspectRatio\n })}\n >\n <slot></slot>\n <vmp-icon-button\n icon=\"close\"\n rounded=\"full\"\n weight=\"heavy\"\n @click=${() => this.dispatchEvent(new CustomEvent('close:click', { bubbles: true, composed: true }))}\n ></vmp-icon-button>\n </div>\n </focus-trap>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'vouch-embed-dialog-overlay': DialogOverlay;\n }\n\n namespace JSX {\n interface IntrinsicElements {\n 'vouch-embed-dialog-overlay': DialogOverlay;\n }\n }\n}\n\nexport { DialogOverlay };\n","import { html, LitElement } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { createRef, ref } from 'lit/directives/ref.js';\nimport { styleMap } from 'lit/directives/style-map.js';\n\nimport type { DialogEmbedProps } from '.';\nimport type { MediaPlayer } from '@vouchfor/media-player';\n\nimport './DialogOverlay';\n\n@customElement('vouch-embed-dialog-portal')\nclass DialogPortal extends LitElement {\n @property({ type: String }) vouchId: DialogEmbedProps['vouchId'];\n @property({ type: String }) templateId: DialogEmbedProps['templateId'];\n @property({ type: Array }) questions: DialogEmbedProps['questions'];\n\n @property({ type: String }) env: DialogEmbedProps['env'] = 'prod';\n @property({ type: String }) apiKey: DialogEmbedProps['apiKey'] = '';\n @property({ type: Boolean }) disableTracking: DialogEmbedProps['disableTracking'] = false;\n @property({ type: String }) trackingSource: DialogEmbedProps['trackingSource'] = 'embedded_player';\n\n @property({ type: Array }) controls: DialogEmbedProps['controls'];\n @property({ type: String }) preload: DialogEmbedProps['preload'] = 'none';\n @property({ type: Boolean }) disableAutoplay: DialogEmbedProps['disableAutoplay'] = false;\n @property({ type: Number }) aspectRatio: DialogEmbedProps['aspectRatio'] = 0;\n\n private _mediaPlayerRef = createRef<MediaPlayer>();\n\n @state() open = false;\n\n private _handleToggle = ({ detail }: CustomEvent<string>) => {\n // Because we have to attach this listener to the document since this element is portalled outside of the button,\n // we also have to make sure that this player is actually the one we want to open and play by passing in an ID\n // from the button wrapper parent and checking against that same ID we pass as the event detail\n if (this.id === detail) {\n this.open = !this.open;\n\n if (this.open) {\n if (!this.disableAutoplay && this._mediaPlayerRef?.value) {\n this._mediaPlayerRef.value.muted = false;\n this._mediaPlayerRef.value.play();\n }\n } else {\n this._mediaPlayerRef?.value?.pause();\n }\n }\n };\n\n // We could do the same thing on close and check for the correct ID but it doesn't really matter\n private _handleClose = () => {\n this.open = false;\n this._mediaPlayerRef?.value?.pause();\n };\n\n private _handleDocumentKeyUp = (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n this._handleClose();\n }\n };\n\n connectedCallback(): void {\n super.connectedCallback();\n document.addEventListener('dialogembed:click', this._handleToggle);\n document.addEventListener('keyup', this._handleDocumentKeyUp);\n document.addEventListener('close:click', this._handleClose);\n document.addEventListener('overlay:click', this._handleClose);\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n document.removeEventListener('dialogembed:click', this._handleToggle);\n document.removeEventListener('keyup', this._handleDocumentKeyUp);\n document.removeEventListener('close:click', this._handleClose);\n document.removeEventListener('overlay:click', this._handleClose);\n }\n\n protected createRenderRoot(): HTMLElement | DocumentFragment {\n // We must create a new node here because portalling into the same node (document.body) causes the second\n // element to overwrite the first for some reason (not behaviour really stated in the docs)\n // I am fairly certain this function is only run once as the default behaviour creates the open shadow root\n // and returns that shadow root in this function: https://lit.dev/docs/components/shadow-dom/#implementing-createrenderroot\n const newNode = document.createElement('div');\n document.body.appendChild(newNode);\n return newNode;\n }\n\n render() {\n return html`\n <vouch-embed-dialog-overlay ?open=${this.open} aspectRatio=${this.aspectRatio}>\n <vouch-embed-player\n ${ref(this._mediaPlayerRef)}\n style=${styleMap({\n maxWidth: '100%',\n maxHeight: '100%'\n })}\n ?autoplay=${false}\n vouchId=${ifDefined(this.vouchId)}\n templateId=${ifDefined(this.templateId)}\n .questions=${this.questions}\n .controls=${this.controls}\n env=${ifDefined(this.env)}\n apiKey=${ifDefined(this.apiKey)}\n ?disableTracking=${this.disableTracking}\n trackingSource=${ifDefined(this.trackingSource)}\n preload=${ifDefined(this.preload)}\n aspectRatio=${this.aspectRatio}\n ></vouch-embed-player>\n </vouch-embed-dialog-overlay>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'vouch-embed-dialog-portal': DialogPortal;\n }\n\n namespace JSX {\n interface IntrinsicElements {\n 'vouch-embed-dialog-portal': DialogPortal;\n }\n }\n}\n\nexport { DialogPortal };\n","import { css, html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport type { PlayerEmbedProps } from '../PlayerEmbed';\n\nimport '../PlayerEmbed';\nimport './DialogPortal';\n\ntype DialogEmbedProps = Omit<PlayerEmbedProps, 'data'> & {\n disableAutoplay?: boolean;\n};\n\n@customElement('vouch-embed-dialog')\nclass DialogEmbed extends LitElement {\n static styles = [\n css`\n :host {\n --vu-button-padding: 10px 20px;\n --vu-button-background: #287179;\n --vu-button-background-hover: #4faab2;\n\n display: flex;\n width: fit-content;\n height: fit-content;\n }\n `\n ];\n\n @property({ type: String }) vouchId: DialogEmbedProps['vouchId'];\n @property({ type: String }) templateId: DialogEmbedProps['templateId'];\n @property({ type: Array }) questions: DialogEmbedProps['questions'];\n\n @property({ type: String }) env: DialogEmbedProps['env'] = 'prod';\n @property({ type: String }) apiKey: DialogEmbedProps['apiKey'] = '';\n @property({ type: Boolean }) disableTracking: DialogEmbedProps['disableTracking'] = false;\n @property({ type: String }) trackingSource: DialogEmbedProps['trackingSource'] = 'embedded_player';\n\n @property({ type: Array }) controls: DialogEmbedProps['controls'];\n @property({ type: String }) preload: DialogEmbedProps['preload'] = 'none';\n @property({ type: Boolean }) disableAutoplay: DialogEmbedProps['disableAutoplay'] = false;\n @property({ type: Number }) aspectRatio: DialogEmbedProps['aspectRatio'] = 0;\n\n private _id = uuidv4();\n\n private _handleRootClick = () => {\n this.dispatchEvent(new CustomEvent('dialogembed:click', { detail: this._id, bubbles: true, composed: true }));\n };\n\n connectedCallback(): void {\n super.connectedCallback();\n this.addEventListener('click', this._handleRootClick);\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.removeEventListener('click', this._handleRootClick);\n }\n\n render() {\n return html`\n <slot>\n <vmp-button size=\"large\">Play</vmp-button>\n </slot>\n <vouch-embed-dialog-portal\n id=${this._id}\n ?autoplay=${false}\n vouchId=${ifDefined(this.vouchId)}\n templateId=${ifDefined(this.templateId)}\n .questions=${this.questions}\n .controls=${this.controls}\n env=${ifDefined(this.env)}\n apiKey=${ifDefined(this.apiKey)}\n ?disableTracking=${this.disableTracking}\n trackingSource=${ifDefined(this.trackingSource)}\n preload=${ifDefined(this.preload)}\n aspectRatio=${this.aspectRatio}\n ></vouch-embed-dialog-portal>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'vouch-embed-dialog': DialogEmbed;\n }\n\n namespace JSX {\n interface IntrinsicElements {\n 'vouch-embed-dialog': DialogEmbed;\n }\n }\n}\n\nexport { DialogEmbed };\nexport type { DialogEmbedProps };\n"],"names":["type","uuidv4","__decorateClass"],"mappings":";;;;;;;;;;;AAAA,SAAS,aAAaA,OAAc,aAA0B,WAAwB;AACpF,WAAS,UAAU,OAAc;AAC/B,cAAU,cAAc,IAAI,YAAY,MAAM,MAAM,KAAK,CAAC;AAAA,EAC5D;AAEY,cAAA,iBAAiBA,OAAM,SAAS;AAE5C,SAAO,MAAM;AACC,gBAAA,oBAAoBA,OAAM,SAAS;AAAA,EAAA;AAEnD;ACCA,MAAM,uBAAqD;AAAA,EAOzD,YAAY,MAAuB,QAAkB;AAJrD,SAAQ,UAAoB;AAC5B,SAAQ,WAA2B;AACnC,SAAQ,qBAAuC;AAG7C,SAAK,OAAO;AACZ,SAAK,UAAU;AACf,SAAK,cAAc,IAAI;AAAA,EACzB;AAAA,EAEA,WAA4B;AACnB,WAAA,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BwB,WAAA,kBAAA,CAAA;AAED,gBAAA;AAAA,EAA1B,SAAS,EAAE,MAAM,OAAO;AAAA,GAxBrB,YAwBuB,WAAA,YAAA,CAAA;AACC,gBAAA;AAAA,EAA3B,SAAS,EAAE,MAAM,QAAQ;AAAA,GAzBtB,YAyBwB,WAAA,WAAA,CAAA;AACC,gBAAA;AAAA,EAA5B,SAAS,EAAE,MAAM,SAAS;AAAA,GA1BvB,YA0ByB,WAAA,mBAAA,CAAA;AACD,gBAAA;AAAA,EAA3B,SAAS,EAAE,MAAM,QAAQ;AAAA,GA3BtB,YA2BwB,WAAA,eAAA,CAAA;AA3BxB,cAAN,gBAAA;AAAA,EADC,cAAc,oBAAoB;AAAA,GAC7B,WAAA;"}
@@ -0,0 +1,20 @@
1
+ import { LitElement } from 'lit';
2
+ import type { DialogEmbedProps } from '.';
3
+ import '@a11y/focus-trap';
4
+ declare class DialogOverlay extends LitElement {
5
+ static styles: import("lit").CSSResult[];
6
+ open: boolean;
7
+ aspectRatio: DialogEmbedProps['aspectRatio'];
8
+ render(): import("lit-html").TemplateResult<1>;
9
+ }
10
+ declare global {
11
+ interface HTMLElementTagNameMap {
12
+ 'vouch-embed-dialog-overlay': DialogOverlay;
13
+ }
14
+ namespace JSX {
15
+ interface IntrinsicElements {
16
+ 'vouch-embed-dialog-overlay': DialogOverlay;
17
+ }
18
+ }
19
+ }
20
+ export { DialogOverlay };
@@ -0,0 +1,36 @@
1
+ import { LitElement } from 'lit';
2
+ import type { DialogEmbedProps } from '.';
3
+ import './DialogOverlay';
4
+ declare class DialogPortal extends LitElement {
5
+ vouchId: DialogEmbedProps['vouchId'];
6
+ templateId: DialogEmbedProps['templateId'];
7
+ questions: DialogEmbedProps['questions'];
8
+ env: DialogEmbedProps['env'];
9
+ apiKey: DialogEmbedProps['apiKey'];
10
+ disableTracking: DialogEmbedProps['disableTracking'];
11
+ trackingSource: DialogEmbedProps['trackingSource'];
12
+ controls: DialogEmbedProps['controls'];
13
+ preload: DialogEmbedProps['preload'];
14
+ disableAutoplay: DialogEmbedProps['disableAutoplay'];
15
+ aspectRatio: DialogEmbedProps['aspectRatio'];
16
+ private _mediaPlayerRef;
17
+ open: boolean;
18
+ private _handleToggle;
19
+ private _handleClose;
20
+ private _handleDocumentKeyUp;
21
+ connectedCallback(): void;
22
+ disconnectedCallback(): void;
23
+ protected createRenderRoot(): HTMLElement | DocumentFragment;
24
+ render(): import("lit-html").TemplateResult<1>;
25
+ }
26
+ declare global {
27
+ interface HTMLElementTagNameMap {
28
+ 'vouch-embed-dialog-portal': DialogPortal;
29
+ }
30
+ namespace JSX {
31
+ interface IntrinsicElements {
32
+ 'vouch-embed-dialog-portal': DialogPortal;
33
+ }
34
+ }
35
+ }
36
+ export { DialogPortal };
@@ -0,0 +1,38 @@
1
+ import { LitElement } from 'lit';
2
+ import type { PlayerEmbedProps } from '../PlayerEmbed';
3
+ import '../PlayerEmbed';
4
+ import './DialogPortal';
5
+ type DialogEmbedProps = Omit<PlayerEmbedProps, 'data'> & {
6
+ disableAutoplay?: boolean;
7
+ };
8
+ declare class DialogEmbed extends LitElement {
9
+ static styles: import("lit").CSSResult[];
10
+ vouchId: DialogEmbedProps['vouchId'];
11
+ templateId: DialogEmbedProps['templateId'];
12
+ questions: DialogEmbedProps['questions'];
13
+ env: DialogEmbedProps['env'];
14
+ apiKey: DialogEmbedProps['apiKey'];
15
+ disableTracking: DialogEmbedProps['disableTracking'];
16
+ trackingSource: DialogEmbedProps['trackingSource'];
17
+ controls: DialogEmbedProps['controls'];
18
+ preload: DialogEmbedProps['preload'];
19
+ disableAutoplay: DialogEmbedProps['disableAutoplay'];
20
+ aspectRatio: DialogEmbedProps['aspectRatio'];
21
+ private _id;
22
+ private _handleRootClick;
23
+ connectedCallback(): void;
24
+ disconnectedCallback(): void;
25
+ render(): import("lit-html").TemplateResult<1>;
26
+ }
27
+ declare global {
28
+ interface HTMLElementTagNameMap {
29
+ 'vouch-embed-dialog': DialogEmbed;
30
+ }
31
+ namespace JSX {
32
+ interface IntrinsicElements {
33
+ 'vouch-embed-dialog': DialogEmbed;
34
+ }
35
+ }
36
+ }
37
+ export { DialogEmbed };
38
+ export type { DialogEmbedProps };
@@ -0,0 +1,15 @@
1
+ import type { PlayerEmbed } from '..';
2
+ import type { ReactiveController, ReactiveControllerHost } from 'lit';
3
+ import type { DirectiveResult } from 'lit/directive.js';
4
+ type PlayerEmbedHost = ReactiveControllerHost & PlayerEmbed;
5
+ declare class EventForwardController implements ReactiveController {
6
+ host: PlayerEmbedHost;
7
+ private _events;
8
+ private _cleanup;
9
+ private _forwardElementRef;
10
+ constructor(host: PlayerEmbedHost, events: string[]);
11
+ register(): DirectiveResult;
12
+ hostConnected(): void;
13
+ hostDisconnected(): void;
14
+ }
15
+ export { EventForwardController };
@@ -0,0 +1,14 @@
1
+ import type { PlayerEmbed } from '..';
2
+ import type { ReactiveControllerHost } from 'lit';
3
+ type PlayerEmbedHost = ReactiveControllerHost & PlayerEmbed;
4
+ declare class FetcherController {
5
+ host: PlayerEmbedHost;
6
+ private _fetching;
7
+ private _vouch;
8
+ set fetching(value: boolean);
9
+ get fetching(): boolean;
10
+ private getVouch;
11
+ private getTemplate;
12
+ constructor(host: PlayerEmbedHost);
13
+ }
14
+ export { FetcherController };
@@ -0,0 +1,36 @@
1
+ import type { PlayerEmbed } from '../..';
2
+ import type { ReactiveController, ReactiveControllerHost } from 'lit';
3
+ type PlayerEmbedHost = ReactiveControllerHost & PlayerEmbed;
4
+ type TrackingEvent = 'VOUCH_LOADED' | 'VOUCH_RESPONSE_VIEWED' | 'VIDEO_PLAYED' | 'VIDEO_STREAMED';
5
+ type TrackingPayload = {
6
+ vouchId?: string;
7
+ answerId?: string;
8
+ streamStart?: number;
9
+ streamEnd?: number;
10
+ };
11
+ declare class TrackingController implements ReactiveController {
12
+ host: PlayerEmbedHost;
13
+ private _batchedEvents;
14
+ private _hasPlayed;
15
+ private _hasLoaded;
16
+ private _answersViewed;
17
+ private _streamStartTime;
18
+ private _streamLatestTime;
19
+ private _currentlyPlayingVideo;
20
+ constructor(host: PlayerEmbedHost);
21
+ private _createTrackingEvent;
22
+ private _sendTrackingEvent;
23
+ private _streamEnded;
24
+ private _handleVouchLoaded;
25
+ private _handlePlay;
26
+ private _handleVideoPlay;
27
+ private _handleVideoTimeUpdate;
28
+ private _handleVideoPause;
29
+ private _pageUnloading;
30
+ private _handleVisibilityChange;
31
+ private _handlePageHide;
32
+ hostConnected(): void;
33
+ hostDisconnected(): void;
34
+ }
35
+ export { TrackingController };
36
+ export type { TrackingEvent, TrackingPayload };
@@ -0,0 +1,17 @@
1
+ import type { TrackingPayload } from '.';
2
+ import type { Vouch } from '@vouchfor/video-utils';
3
+ import type { Environment } from '../../../../utils/env';
4
+ declare function getUids(env: Environment): {
5
+ client: null;
6
+ tab: null;
7
+ request: string;
8
+ visitor?: undefined;
9
+ } | {
10
+ client: string;
11
+ tab: string;
12
+ request: string;
13
+ visitor: string;
14
+ };
15
+ declare function findVouchId(payload?: TrackingPayload, vouch?: Vouch): string | null | undefined;
16
+ declare function getReportingMetadata(source?: string): any;
17
+ export { getUids, findVouchId, getReportingMetadata };
@@ -0,0 +1,75 @@
1
+ import { LitElement } from 'lit';
2
+ import type { TemplateInstance } from '@vouchfor/canvas-video';
3
+ import type { MediaPlayer, MediaPlayerProps } from '@vouchfor/media-player';
4
+ import type { Vouch } from '@vouchfor/video-utils';
5
+ import type { PropertyValueMap } from 'lit';
6
+ import type { Environment } from '../../utils/env';
7
+ import '@vouchfor/media-player';
8
+ type PlayerEmbedProps = Pick<MediaPlayerProps, 'aspectRatio' | 'language' | 'preload' | 'autoplay' | 'controls'> & {
9
+ data?: Vouch;
10
+ env: Environment;
11
+ apiKey: string;
12
+ disableTracking?: boolean;
13
+ trackingSource?: string;
14
+ vouchId?: string;
15
+ templateId?: string;
16
+ questions?: number[];
17
+ };
18
+ declare class PlayerEmbed extends LitElement {
19
+ static styles: import("lit").CSSResult[];
20
+ data: PlayerEmbedProps['data'];
21
+ vouchId: PlayerEmbedProps['vouchId'];
22
+ templateId: PlayerEmbedProps['templateId'];
23
+ questions: PlayerEmbedProps['questions'];
24
+ env: PlayerEmbedProps['env'];
25
+ apiKey: PlayerEmbedProps['apiKey'];
26
+ disableTracking: PlayerEmbedProps['disableTracking'];
27
+ trackingSource: PlayerEmbedProps['trackingSource'];
28
+ controls: PlayerEmbedProps['controls'];
29
+ preload: PlayerEmbedProps['preload'];
30
+ autoplay: PlayerEmbedProps['autoplay'];
31
+ aspectRatio: PlayerEmbedProps['aspectRatio'];
32
+ language?: MediaPlayerProps['language'];
33
+ private eventController;
34
+ private _fetcherController;
35
+ private _trackingController;
36
+ vouch: PlayerEmbedProps['data'];
37
+ template: TemplateInstance | undefined;
38
+ get fetching(): boolean;
39
+ private _mediaPlayerRef;
40
+ get waiting(): boolean | undefined;
41
+ get initialised(): Promise<boolean> | undefined;
42
+ get seeking(): boolean | undefined;
43
+ get paused(): boolean | undefined;
44
+ get captions(): boolean | undefined;
45
+ get fullscreen(): boolean | undefined;
46
+ get duration(): number | undefined;
47
+ set currentTime(value: number);
48
+ get currentTime(): number;
49
+ set playbackRate(value: number);
50
+ get playbackRate(): number;
51
+ set volume(value: number);
52
+ get volume(): number;
53
+ set muted(value: boolean);
54
+ get muted(): boolean;
55
+ get mediaState(): import("@vouchfor/media-player").MediaStateMap | undefined;
56
+ get mediaPlayer(): MediaPlayer | undefined;
57
+ play(): void;
58
+ pause(): void;
59
+ reset(time?: number, play?: boolean): void;
60
+ private _renderStyles;
61
+ protected willUpdate(changedProperties: PropertyValueMap<PlayerEmbedProps>): void;
62
+ render(): import("lit-html").TemplateResult<1>;
63
+ }
64
+ declare global {
65
+ interface HTMLElementTagNameMap {
66
+ 'vouch-embed-player': PlayerEmbed;
67
+ }
68
+ namespace JSX {
69
+ interface IntrinsicElements {
70
+ 'vouch-embed-player': PlayerEmbed;
71
+ }
72
+ }
73
+ }
74
+ export { PlayerEmbed };
75
+ export type { PlayerEmbedProps };
@@ -0,0 +1,4 @@
1
+ import type { Vouch } from '@vouchfor/video-utils';
2
+ declare const data: Vouch;
3
+ declare const withNullAnswer: Vouch;
4
+ export { data, withNullAnswer };
@@ -0,0 +1,19 @@
1
+ declare const VIDEOA: {
2
+ mp4: string;
3
+ m3u8: string;
4
+ jpg: string;
5
+ duration: number;
6
+ };
7
+ declare const VIDEOB: {
8
+ mp4: string;
9
+ m3u8: string;
10
+ jpg: string;
11
+ duration: number;
12
+ };
13
+ declare const VIDEOC: {
14
+ mp4: string;
15
+ m3u8: string;
16
+ jpg: string;
17
+ duration: number;
18
+ };
19
+ export { VIDEOA, VIDEOB, VIDEOC };
@@ -0,0 +1,2 @@
1
+ export { PlayerEmbed } from './components/PlayerEmbed';
2
+ export { DialogEmbed } from './components/DialogEmbed';
@@ -0,0 +1,12 @@
1
+ type Environment = 'local' | 'dev' | 'staging' | 'prod';
2
+ type GetEnvUrlsReturn = {
3
+ videoUrl: string;
4
+ publicApiUrl: string;
5
+ embedApiUrl: string;
6
+ };
7
+ declare const devEmbedApiUrl = "https://embed-dev.vouchfor.com/v2";
8
+ declare const stagingEmbedApiUrl = "https://embed-staging.vouchfor.com/v2";
9
+ declare const prodEmbedApiUrl = "https://embed.vouchfor.com/v2";
10
+ declare function getEnvUrls(env: Environment): GetEnvUrlsReturn;
11
+ export { devEmbedApiUrl, stagingEmbedApiUrl, prodEmbedApiUrl, getEnvUrls };
12
+ export type { Environment };
@@ -0,0 +1,2 @@
1
+ declare function forwardEvent(type: string, fromElement: HTMLElement, toElement: HTMLElement): () => void;
2
+ export { forwardEvent };