@vouchfor/embeds 0.0.0-experiment.dcc3e68 → 0.0.0-experiment.dd49cfd
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/es/embeds.js +1009 -1099
- package/dist/es/embeds.js.map +1 -1
- package/dist/es/src/components/DialogEmbed/DialogOverlay.d.ts +20 -0
- package/dist/es/src/components/DialogEmbed/DialogPortal.d.ts +36 -0
- package/dist/es/src/components/DialogEmbed/index.d.ts +38 -0
- package/dist/es/{components/Embed → src/components/PlayerEmbed}/controllers/event-forwarder.d.ts +6 -5
- package/dist/es/src/components/PlayerEmbed/controllers/fetcher.d.ts +14 -0
- package/dist/es/src/components/PlayerEmbed/controllers/tracking/index.d.ts +36 -0
- package/dist/es/src/components/PlayerEmbed/controllers/tracking/utils.d.ts +17 -0
- package/dist/es/src/components/PlayerEmbed/index.d.ts +75 -0
- package/dist/es/src/components/PlayerEmbed/tests/data.d.ts +3 -0
- package/dist/es/src/index.d.ts +2 -0
- package/dist/es/src/utils/env.d.ts +12 -0
- package/dist/iife/dialog-embed/embed.iife.js +1755 -0
- package/dist/iife/dialog-embed/embed.iife.js.map +1 -0
- package/dist/iife/embeds.iife.js +705 -440
- package/dist/iife/embeds.iife.js.map +1 -1
- package/dist/iife/player-embed/embed.iife.js +1617 -0
- package/dist/iife/player-embed/embed.iife.js.map +1 -0
- package/package.json +45 -33
- package/src/components/DialogEmbed/Dialog.stories.ts +91 -0
- package/src/components/DialogEmbed/DialogOverlay.ts +131 -0
- package/src/components/DialogEmbed/DialogPortal.ts +126 -0
- package/src/components/DialogEmbed/index.ts +97 -0
- package/src/components/{Embed/Embed.stories.ts → PlayerEmbed/PlayerEmbed.stories.ts} +38 -24
- package/src/components/{Embed → PlayerEmbed}/controllers/event-forwarder.ts +6 -5
- package/src/components/PlayerEmbed/controllers/fetcher.ts +152 -0
- package/src/components/PlayerEmbed/controllers/tracking/index.ts +224 -0
- package/src/components/PlayerEmbed/controllers/tracking/utils.ts +95 -0
- package/src/components/{Embed → PlayerEmbed}/index.ts +82 -35
- package/src/components/PlayerEmbed/tests/PlayerEmbed.spec.ts +80 -0
- package/src/components/PlayerEmbed/tests/data.ts +183 -0
- package/src/index.ts +2 -1
- package/src/utils/env.ts +18 -32
- package/dist/es/components/Embed/controllers/fetcher.d.ts +0 -20
- package/dist/es/components/Embed/controllers/tracking.d.ts +0 -28
- package/dist/es/components/Embed/index.d.ts +0 -63
- package/dist/es/index.d.ts +0 -1
- package/dist/es/utils/env.d.ts +0 -18
- package/src/components/Embed/controllers/fetcher.ts +0 -115
- package/src/components/Embed/controllers/tracking.ts +0 -261
- /package/dist/es/{utils → src/utils}/events.d.ts +0 -0
package/dist/es/embeds.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"embeds.js","sources":["../../../../node_modules/@lit/reactive-element/css-tag.js","../../../../node_modules/@lit/reactive-element/reactive-element.js","../../node_modules/lit-html/lit-html.js","../../../../node_modules/lit-html/lit-html.js","../../../../node_modules/lit-element/lit-element.js","../../src/utils/events.ts","../../src/components/Embed/controllers/event-forwarder.ts","../../src/utils/env.ts","../../src/components/Embed/controllers/fetcher.ts","../../node_modules/uuid/dist/esm-browser/rng.js","../../node_modules/uuid/dist/esm-browser/stringify.js","../../node_modules/uuid/dist/esm-browser/native.js","../../node_modules/uuid/dist/esm-browser/v4.js","../../src/components/Embed/controllers/tracking.ts","../../src/components/Embed/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t=window,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&\"adoptedStyleSheets\"in Document.prototype&&\"replace\"in CSSStyleSheet.prototype,s=Symbol(),n=new WeakMap;class o{constructor(t,e,n){if(this._$cssResult$=!0,n!==s)throw Error(\"CSSResult is not constructable. Use `unsafeCSS` or `css` instead.\");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const s=this.t;if(e&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=n.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&n.set(s,t))}return t}toString(){return this.cssText}}const r=t=>new o(\"string\"==typeof t?t:t+\"\",void 0,s),i=(t,...e)=>{const n=1===t.length?t[0]:e.reduce(((e,s,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if(\"number\"==typeof t)return t;throw Error(\"Value passed to 'css' function must be a 'css' function result: \"+t+\". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.\")})(s)+t[n+1]),t[0]);return new o(n,t,s)},S=(s,n)=>{e?s.adoptedStyleSheets=n.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):n.forEach((e=>{const n=document.createElement(\"style\"),o=t.litNonce;void 0!==o&&n.setAttribute(\"nonce\",o),n.textContent=e.cssText,s.appendChild(n)}))},c=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e=\"\";for(const s of t.cssRules)e+=s.cssText;return r(e)})(t):t;export{o as CSSResult,S as adoptStyles,i as css,c as getCompatibleStyle,e as supportsAdoptingStyleSheets,r as unsafeCSS};\n//# sourceMappingURL=css-tag.js.map\n","import{getCompatibleStyle as t,adoptStyles as i}from\"./css-tag.js\";export{CSSResult,adoptStyles,css,getCompatibleStyle,supportsAdoptingStyleSheets,unsafeCSS}from\"./css-tag.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */var s;const e=window,r=e.trustedTypes,h=r?r.emptyScript:\"\",o=e.reactiveElementPolyfillSupport,n={toAttribute(t,i){switch(i){case Boolean:t=t?h:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,i){let s=t;switch(i){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch(t){s=null}}return s}},a=(t,i)=>i!==t&&(i==i||t==t),l={attribute:!0,type:String,converter:n,reflect:!1,hasChanged:a},d=\"finalized\";class u extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(t){var i;this.finalize(),(null!==(i=this.h)&&void 0!==i?i:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((i,s)=>{const e=this._$Ep(s,i);void 0!==e&&(this._$Ev.set(e,s),t.push(e))})),t}static createProperty(t,i=l){if(i.state&&(i.attribute=!1),this.finalize(),this.elementProperties.set(t,i),!i.noAccessor&&!this.prototype.hasOwnProperty(t)){const s=\"symbol\"==typeof t?Symbol():\"__\"+t,e=this.getPropertyDescriptor(t,s,i);void 0!==e&&Object.defineProperty(this.prototype,t,e)}}static getPropertyDescriptor(t,i,s){return{get(){return this[i]},set(e){const r=this[t];this[i]=e,this.requestUpdate(t,r,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||l}static finalize(){if(this.hasOwnProperty(d))return!1;this[d]=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty(\"properties\")){const t=this.properties,i=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const s of i)this.createProperty(s,t[s])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(i){const s=[];if(Array.isArray(i)){const e=new Set(i.flat(1/0).reverse());for(const i of e)s.unshift(t(i))}else void 0!==i&&s.push(t(i));return s}static _$Ep(t,i){const s=i.attribute;return!1===s?void 0:\"string\"==typeof s?s:\"string\"==typeof t?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var i,s;(null!==(i=this._$ES)&&void 0!==i?i:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(s=t.hostConnected)||void 0===s||s.call(t))}removeController(t){var i;null===(i=this._$ES)||void 0===i||i.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,i)=>{this.hasOwnProperty(i)&&(this._$Ei.set(i,this[i]),delete this[i])}))}createRenderRoot(){var t;const s=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return i(s,this.constructor.elementStyles),s}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostConnected)||void 0===i?void 0:i.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostDisconnected)||void 0===i?void 0:i.call(t)}))}attributeChangedCallback(t,i,s){this._$AK(t,s)}_$EO(t,i,s=l){var e;const r=this.constructor._$Ep(t,s);if(void 0!==r&&!0===s.reflect){const h=(void 0!==(null===(e=s.converter)||void 0===e?void 0:e.toAttribute)?s.converter:n).toAttribute(i,s.type);this._$El=t,null==h?this.removeAttribute(r):this.setAttribute(r,h),this._$El=null}}_$AK(t,i){var s;const e=this.constructor,r=e._$Ev.get(t);if(void 0!==r&&this._$El!==r){const t=e.getPropertyOptions(r),h=\"function\"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(s=t.converter)||void 0===s?void 0:s.fromAttribute)?t.converter:n;this._$El=r,this[r]=h.fromAttribute(i,t.type),this._$El=null}}requestUpdate(t,i,s){let e=!0;void 0!==t&&(((s=s||this.constructor.getPropertyOptions(t)).hasChanged||a)(this[t],i)?(this._$AL.has(t)||this._$AL.set(t,i),!0===s.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,s))):e=!1),!this.isUpdatePending&&e&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,i)=>this[i]=t)),this._$Ei=void 0);let i=!1;const s=this._$AL;try{i=this.shouldUpdate(s),i?(this.willUpdate(s),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostUpdate)||void 0===i?void 0:i.call(t)})),this.update(s)):this._$Ek()}catch(t){throw i=!1,this._$Ek(),t}i&&this._$AE(s)}willUpdate(t){}_$AE(t){var i;null===(i=this._$ES)||void 0===i||i.forEach((t=>{var i;return null===(i=t.hostUpdated)||void 0===i?void 0:i.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,i)=>this._$EO(i,this[i],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}u[d]=!0,u.elementProperties=new Map,u.elementStyles=[],u.shadowRootOptions={mode:\"open\"},null==o||o({ReactiveElement:u}),(null!==(s=e.reactiveElementVersions)&&void 0!==s?s:e.reactiveElementVersions=[]).push(\"1.6.2\");export{u as ReactiveElement,n as defaultConverter,a as notEqual};\n//# sourceMappingURL=reactive-element.js.map\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nvar t;const i=window,s=i.trustedTypes,e=s?s.createPolicy(\"lit-html\",{createHTML:t=>t}):void 0,o=\"$lit$\",n=`lit$${(Math.random()+\"\").slice(9)}$`,l=\"?\"+n,h=`<${l}>`,r=document,u=()=>r.createComment(\"\"),d=t=>null===t||\"object\"!=typeof t&&\"function\"!=typeof t,c=Array.isArray,v=t=>c(t)||\"function\"==typeof(null==t?void 0:t[Symbol.iterator]),a=\"[ \\t\\n\\f\\r]\",f=/<(?:(!--|\\/[^a-zA-Z])|(\\/?[a-zA-Z][^>\\s]*)|(\\/?$))/g,_=/-->/g,m=/>/g,p=RegExp(`>|${a}(?:([^\\\\s\"'>=/]+)(${a}*=${a}*(?:[^ \\t\\n\\f\\r\"'\\`<>=]|(\"|')|))|$)`,\"g\"),g=/'/g,$=/\"/g,y=/^(?:script|style|textarea|title)$/i,w=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),x=w(1),b=w(2),T=Symbol.for(\"lit-noChange\"),A=Symbol.for(\"lit-nothing\"),E=new WeakMap,C=r.createTreeWalker(r,129,null,!1);function P(t,i){if(!Array.isArray(t)||!t.hasOwnProperty(\"raw\"))throw Error(\"invalid template strings array\");return void 0!==e?e.createHTML(i):i}const V=(t,i)=>{const s=t.length-1,e=[];let l,r=2===i?\"<svg>\":\"\",u=f;for(let i=0;i<s;i++){const s=t[i];let d,c,v=-1,a=0;for(;a<s.length&&(u.lastIndex=a,c=u.exec(s),null!==c);)a=u.lastIndex,u===f?\"!--\"===c[1]?u=_:void 0!==c[1]?u=m:void 0!==c[2]?(y.test(c[2])&&(l=RegExp(\"</\"+c[2],\"g\")),u=p):void 0!==c[3]&&(u=p):u===p?\">\"===c[0]?(u=null!=l?l:f,v=-1):void 0===c[1]?v=-2:(v=u.lastIndex-c[2].length,d=c[1],u=void 0===c[3]?p:'\"'===c[3]?$:g):u===$||u===g?u=p:u===_||u===m?u=f:(u=p,l=void 0);const w=u===p&&t[i+1].startsWith(\"/>\")?\" \":\"\";r+=u===f?s+h:v>=0?(e.push(d),s.slice(0,v)+o+s.slice(v)+n+w):s+n+(-2===v?(e.push(void 0),i):w)}return[P(t,r+(t[s]||\"<?>\")+(2===i?\"</svg>\":\"\")),e]};class N{constructor({strings:t,_$litType$:i},e){let h;this.parts=[];let r=0,d=0;const c=t.length-1,v=this.parts,[a,f]=V(t,i);if(this.el=N.createElement(a,e),C.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(h=C.nextNode())&&v.length<c;){if(1===h.nodeType){if(h.hasAttributes()){const t=[];for(const i of h.getAttributeNames())if(i.endsWith(o)||i.startsWith(n)){const s=f[d++];if(t.push(i),void 0!==s){const t=h.getAttribute(s.toLowerCase()+o).split(n),i=/([.?@])?(.*)/.exec(s);v.push({type:1,index:r,name:i[2],strings:t,ctor:\".\"===i[1]?H:\"?\"===i[1]?L:\"@\"===i[1]?z:k})}else v.push({type:6,index:r})}for(const i of t)h.removeAttribute(i)}if(y.test(h.tagName)){const t=h.textContent.split(n),i=t.length-1;if(i>0){h.textContent=s?s.emptyScript:\"\";for(let s=0;s<i;s++)h.append(t[s],u()),C.nextNode(),v.push({type:2,index:++r});h.append(t[i],u())}}}else if(8===h.nodeType)if(h.data===l)v.push({type:2,index:r});else{let t=-1;for(;-1!==(t=h.data.indexOf(n,t+1));)v.push({type:7,index:r}),t+=n.length-1}r++}}static createElement(t,i){const s=r.createElement(\"template\");return s.innerHTML=t,s}}function S(t,i,s=t,e){var o,n,l,h;if(i===T)return i;let r=void 0!==e?null===(o=s._$Co)||void 0===o?void 0:o[e]:s._$Cl;const u=d(i)?void 0:i._$litDirective$;return(null==r?void 0:r.constructor)!==u&&(null===(n=null==r?void 0:r._$AO)||void 0===n||n.call(r,!1),void 0===u?r=void 0:(r=new u(t),r._$AT(t,s,e)),void 0!==e?(null!==(l=(h=s)._$Co)&&void 0!==l?l:h._$Co=[])[e]=r:s._$Cl=r),void 0!==r&&(i=S(t,r._$AS(t,i.values),r,e)),i}class M{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var i;const{el:{content:s},parts:e}=this._$AD,o=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:r).importNode(s,!0);C.currentNode=o;let n=C.nextNode(),l=0,h=0,u=e[0];for(;void 0!==u;){if(l===u.index){let i;2===u.type?i=new R(n,n.nextSibling,this,t):1===u.type?i=new u.ctor(n,u.name,u.strings,this,t):6===u.type&&(i=new Z(n,this,t)),this._$AV.push(i),u=e[++h]}l!==(null==u?void 0:u.index)&&(n=C.nextNode(),l++)}return C.currentNode=r,o}v(t){let i=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++}}class R{constructor(t,i,s,e){var o;this.type=2,this._$AH=A,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cp=null===(o=null==e?void 0:e.isConnected)||void 0===o||o}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$Cp}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===(null==t?void 0:t.nodeType)&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=S(this,t,i),d(t)?t===A||null==t||\"\"===t?(this._$AH!==A&&this._$AR(),this._$AH=A):t!==this._$AH&&t!==T&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):v(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==A&&d(this._$AH)?this._$AA.nextSibling.data=t:this.$(r.createTextNode(t)),this._$AH=t}g(t){var i;const{values:s,_$litType$:e}=t,o=\"number\"==typeof e?this._$AC(t):(void 0===e.el&&(e.el=N.createElement(P(e.h,e.h[0]),this.options)),e);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===o)this._$AH.v(s);else{const t=new M(o,this),i=t.u(this.options);t.v(s),this.$(i),this._$AH=t}}_$AC(t){let i=E.get(t.strings);return void 0===i&&E.set(t.strings,i=new N(t)),i}T(t){c(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const o of t)e===i.length?i.push(s=new R(this.k(u()),this.k(u()),this,this.options)):s=i[e],s._$AI(o),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e)}_$AR(t=this._$AA.nextSibling,i){var s;for(null===(s=this._$AP)||void 0===s||s.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var i;void 0===this._$AM&&(this._$Cp=t,null===(i=this._$AP)||void 0===i||i.call(this,t))}}class k{constructor(t,i,s,e,o){this.type=1,this._$AH=A,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=o,s.length>2||\"\"!==s[0]||\"\"!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=A}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,s,e){const o=this.strings;let n=!1;if(void 0===o)t=S(this,t,i,0),n=!d(t)||t!==this._$AH&&t!==T,n&&(this._$AH=t);else{const e=t;let l,h;for(t=o[0],l=0;l<o.length-1;l++)h=S(this,e[s+l],i,l),h===T&&(h=this._$AH[l]),n||(n=!d(h)||h!==this._$AH[l]),h===A?t=A:t!==A&&(t+=(null!=h?h:\"\")+o[l+1]),this._$AH[l]=h}n&&!e&&this.j(t)}j(t){t===A?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:\"\")}}class H extends k{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===A?void 0:t}}const I=s?s.emptyScript:\"\";class L extends k{constructor(){super(...arguments),this.type=4}j(t){t&&t!==A?this.element.setAttribute(this.name,I):this.element.removeAttribute(this.name)}}class z extends k{constructor(t,i,s,e,o){super(t,i,s,e,o),this.type=5}_$AI(t,i=this){var s;if((t=null!==(s=S(this,t,i,0))&&void 0!==s?s:A)===T)return;const e=this._$AH,o=t===A&&e!==A||t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive,n=t!==A&&(e===A||o);o&&this.element.removeEventListener(this.name,this,e),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var i,s;\"function\"==typeof this._$AH?this._$AH.call(null!==(s=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==s?s:this.element,t):this._$AH.handleEvent(t)}}class Z{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){S(this,t)}}const j={O:o,P:n,A:l,C:1,M:V,L:M,R:v,D:S,I:R,V:k,H:L,N:z,U:H,F:Z},B=i.litHtmlPolyfillSupport;null==B||B(N,R),(null!==(t=i.litHtmlVersions)&&void 0!==t?t:i.litHtmlVersions=[]).push(\"2.8.0\");const D=(t,i,s)=>{var e,o;const n=null!==(e=null==s?void 0:s.renderBefore)&&void 0!==e?e:i;let l=n._$litPart$;if(void 0===l){const t=null!==(o=null==s?void 0:s.renderBefore)&&void 0!==o?o:null;n._$litPart$=l=new R(i.insertBefore(u(),t),t,void 0,null!=s?s:{})}return l._$AI(t),l};export{j as _$LH,x as html,T as noChange,A as nothing,D as render,b as svg};\n//# sourceMappingURL=lit-html.js.map\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nvar t;const i=window,s=i.trustedTypes,e=s?s.createPolicy(\"lit-html\",{createHTML:t=>t}):void 0,o=\"$lit$\",n=`lit$${(Math.random()+\"\").slice(9)}$`,l=\"?\"+n,h=`<${l}>`,r=document,d=()=>r.createComment(\"\"),u=t=>null===t||\"object\"!=typeof t&&\"function\"!=typeof t,c=Array.isArray,v=t=>c(t)||\"function\"==typeof(null==t?void 0:t[Symbol.iterator]),a=\"[ \\t\\n\\f\\r]\",f=/<(?:(!--|\\/[^a-zA-Z])|(\\/?[a-zA-Z][^>\\s]*)|(\\/?$))/g,_=/-->/g,m=/>/g,p=RegExp(`>|${a}(?:([^\\\\s\"'>=/]+)(${a}*=${a}*(?:[^ \\t\\n\\f\\r\"'\\`<>=]|(\"|')|))|$)`,\"g\"),g=/'/g,$=/\"/g,y=/^(?:script|style|textarea|title)$/i,w=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),x=w(1),b=w(2),T=Symbol.for(\"lit-noChange\"),A=Symbol.for(\"lit-nothing\"),E=new WeakMap,C=r.createTreeWalker(r,129,null,!1),P=(t,i)=>{const s=t.length-1,l=[];let r,d=2===i?\"<svg>\":\"\",u=f;for(let i=0;i<s;i++){const s=t[i];let e,c,v=-1,a=0;for(;a<s.length&&(u.lastIndex=a,c=u.exec(s),null!==c);)a=u.lastIndex,u===f?\"!--\"===c[1]?u=_:void 0!==c[1]?u=m:void 0!==c[2]?(y.test(c[2])&&(r=RegExp(\"</\"+c[2],\"g\")),u=p):void 0!==c[3]&&(u=p):u===p?\">\"===c[0]?(u=null!=r?r:f,v=-1):void 0===c[1]?v=-2:(v=u.lastIndex-c[2].length,e=c[1],u=void 0===c[3]?p:'\"'===c[3]?$:g):u===$||u===g?u=p:u===_||u===m?u=f:(u=p,r=void 0);const w=u===p&&t[i+1].startsWith(\"/>\")?\" \":\"\";d+=u===f?s+h:v>=0?(l.push(e),s.slice(0,v)+o+s.slice(v)+n+w):s+n+(-2===v?(l.push(void 0),i):w)}const c=d+(t[s]||\"<?>\")+(2===i?\"</svg>\":\"\");if(!Array.isArray(t)||!t.hasOwnProperty(\"raw\"))throw Error(\"invalid template strings array\");return[void 0!==e?e.createHTML(c):c,l]};class V{constructor({strings:t,_$litType$:i},e){let h;this.parts=[];let r=0,u=0;const c=t.length-1,v=this.parts,[a,f]=P(t,i);if(this.el=V.createElement(a,e),C.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(h=C.nextNode())&&v.length<c;){if(1===h.nodeType){if(h.hasAttributes()){const t=[];for(const i of h.getAttributeNames())if(i.endsWith(o)||i.startsWith(n)){const s=f[u++];if(t.push(i),void 0!==s){const t=h.getAttribute(s.toLowerCase()+o).split(n),i=/([.?@])?(.*)/.exec(s);v.push({type:1,index:r,name:i[2],strings:t,ctor:\".\"===i[1]?k:\"?\"===i[1]?I:\"@\"===i[1]?L:R})}else v.push({type:6,index:r})}for(const i of t)h.removeAttribute(i)}if(y.test(h.tagName)){const t=h.textContent.split(n),i=t.length-1;if(i>0){h.textContent=s?s.emptyScript:\"\";for(let s=0;s<i;s++)h.append(t[s],d()),C.nextNode(),v.push({type:2,index:++r});h.append(t[i],d())}}}else if(8===h.nodeType)if(h.data===l)v.push({type:2,index:r});else{let t=-1;for(;-1!==(t=h.data.indexOf(n,t+1));)v.push({type:7,index:r}),t+=n.length-1}r++}}static createElement(t,i){const s=r.createElement(\"template\");return s.innerHTML=t,s}}function N(t,i,s=t,e){var o,n,l,h;if(i===T)return i;let r=void 0!==e?null===(o=s._$Co)||void 0===o?void 0:o[e]:s._$Cl;const d=u(i)?void 0:i._$litDirective$;return(null==r?void 0:r.constructor)!==d&&(null===(n=null==r?void 0:r._$AO)||void 0===n||n.call(r,!1),void 0===d?r=void 0:(r=new d(t),r._$AT(t,s,e)),void 0!==e?(null!==(l=(h=s)._$Co)&&void 0!==l?l:h._$Co=[])[e]=r:s._$Cl=r),void 0!==r&&(i=N(t,r._$AS(t,i.values),r,e)),i}class S{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var i;const{el:{content:s},parts:e}=this._$AD,o=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:r).importNode(s,!0);C.currentNode=o;let n=C.nextNode(),l=0,h=0,d=e[0];for(;void 0!==d;){if(l===d.index){let i;2===d.type?i=new M(n,n.nextSibling,this,t):1===d.type?i=new d.ctor(n,d.name,d.strings,this,t):6===d.type&&(i=new z(n,this,t)),this._$AV.push(i),d=e[++h]}l!==(null==d?void 0:d.index)&&(n=C.nextNode(),l++)}return C.currentNode=r,o}v(t){let i=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++}}class M{constructor(t,i,s,e){var o;this.type=2,this._$AH=A,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cp=null===(o=null==e?void 0:e.isConnected)||void 0===o||o}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$Cp}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===(null==t?void 0:t.nodeType)&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=N(this,t,i),u(t)?t===A||null==t||\"\"===t?(this._$AH!==A&&this._$AR(),this._$AH=A):t!==this._$AH&&t!==T&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):v(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==A&&u(this._$AH)?this._$AA.nextSibling.data=t:this.$(r.createTextNode(t)),this._$AH=t}g(t){var i;const{values:s,_$litType$:e}=t,o=\"number\"==typeof e?this._$AC(t):(void 0===e.el&&(e.el=V.createElement(e.h,this.options)),e);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===o)this._$AH.v(s);else{const t=new S(o,this),i=t.u(this.options);t.v(s),this.$(i),this._$AH=t}}_$AC(t){let i=E.get(t.strings);return void 0===i&&E.set(t.strings,i=new V(t)),i}T(t){c(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const o of t)e===i.length?i.push(s=new M(this.k(d()),this.k(d()),this,this.options)):s=i[e],s._$AI(o),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e)}_$AR(t=this._$AA.nextSibling,i){var s;for(null===(s=this._$AP)||void 0===s||s.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var i;void 0===this._$AM&&(this._$Cp=t,null===(i=this._$AP)||void 0===i||i.call(this,t))}}class R{constructor(t,i,s,e,o){this.type=1,this._$AH=A,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=o,s.length>2||\"\"!==s[0]||\"\"!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=A}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,s,e){const o=this.strings;let n=!1;if(void 0===o)t=N(this,t,i,0),n=!u(t)||t!==this._$AH&&t!==T,n&&(this._$AH=t);else{const e=t;let l,h;for(t=o[0],l=0;l<o.length-1;l++)h=N(this,e[s+l],i,l),h===T&&(h=this._$AH[l]),n||(n=!u(h)||h!==this._$AH[l]),h===A?t=A:t!==A&&(t+=(null!=h?h:\"\")+o[l+1]),this._$AH[l]=h}n&&!e&&this.j(t)}j(t){t===A?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:\"\")}}class k extends R{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===A?void 0:t}}const H=s?s.emptyScript:\"\";class I extends R{constructor(){super(...arguments),this.type=4}j(t){t&&t!==A?this.element.setAttribute(this.name,H):this.element.removeAttribute(this.name)}}class L extends R{constructor(t,i,s,e,o){super(t,i,s,e,o),this.type=5}_$AI(t,i=this){var s;if((t=null!==(s=N(this,t,i,0))&&void 0!==s?s:A)===T)return;const e=this._$AH,o=t===A&&e!==A||t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive,n=t!==A&&(e===A||o);o&&this.element.removeEventListener(this.name,this,e),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var i,s;\"function\"==typeof this._$AH?this._$AH.call(null!==(s=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==s?s:this.element,t):this._$AH.handleEvent(t)}}class z{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){N(this,t)}}const Z={O:o,P:n,A:l,C:1,M:P,L:S,D:v,R:N,I:M,V:R,H:I,N:L,U:k,F:z},j=i.litHtmlPolyfillSupport;null==j||j(V,M),(null!==(t=i.litHtmlVersions)&&void 0!==t?t:i.litHtmlVersions=[]).push(\"2.7.4\");const B=(t,i,s)=>{var e,o;const n=null!==(e=null==s?void 0:s.renderBefore)&&void 0!==e?e:i;let l=n._$litPart$;if(void 0===l){const t=null!==(o=null==s?void 0:s.renderBefore)&&void 0!==o?o:null;n._$litPart$=l=new M(i.insertBefore(d(),t),t,void 0,null!=s?s:{})}return l._$AI(t),l};export{Z as _$LH,x as html,T as noChange,A as nothing,B as render,b as svg};\n//# sourceMappingURL=lit-html.js.map\n","import{ReactiveElement as t}from\"@lit/reactive-element\";export*from\"@lit/reactive-element\";import{render as e,noChange as i}from\"lit-html\";export*from\"lit-html\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */var l,o;const r=t;class s extends t{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=e(i,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return i}}s.finalized=!0,s._$litElement$=!0,null===(l=globalThis.litElementHydrateSupport)||void 0===l||l.call(globalThis,{LitElement:s});const n=globalThis.litElementPolyfillSupport;null==n||n({LitElement:s});const h={_$AK:(t,e,i)=>{t._$AK(e,i)},_$AL:t=>t._$AL};(null!==(o=globalThis.litElementVersions)&&void 0!==o?o:globalThis.litElementVersions=[]).push(\"3.3.2\");export{s as LitElement,r as UpdatingElement,h as _$LE};\n//# sourceMappingURL=lit-element.js.map\n","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 { Embed } from '..';\nimport type { ReactiveController, ReactiveControllerHost } from 'lit';\nimport type { Ref } from 'lit/directives/ref.js';\n\nimport { forwardEvent } from '~/utils/events';\n\ntype EmbedHost = ReactiveControllerHost & Embed;\n\nclass EventForwardController implements ReactiveController {\n host: EmbedHost;\n\n private _events: string[] = [];\n private _cleanup: (() => void)[] = [];\n private _forwardElementRef: Ref<HTMLElement> = createRef();\n\n constructor(host: EmbedHost, events: string[]) {\n this.host = host;\n this._events = events;\n host.addController(this);\n }\n\n register() {\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 = 'dev' | 'staging' | 'prod';\n\ntype GetEnvUrlsReturn = {\n marketingUrl: string;\n videoUrl: string;\n publicApiUrl: string;\n embedApiUrl: string;\n publicRecorderUrl: string;\n};\n\nconst marketingUrl = 'https://vouchfor.com';\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 devEmbedApiUrl = 'http://localhost:6060/v1';\nconst stagingEmbedApiUrl = 'https://embed-staging.vouchfor.com/v1';\nconst prodEmbedApiUrl = 'https://embed.vouchfor.com/v1';\n\nconst devPublicRecorderUrl = 'https://dev.vouchfor.com';\nconst stagingPublicRecorderUrl = 'https://staging.vouchfor.com';\nconst prodPublicRecorderUrl = 'https://app.vouchfor.com';\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 (!['dev', 'staging', 'prod'].includes(env)) {\n throw new Error(`Unknown environment: ${env}`);\n }\n\n if (env === 'dev') {\n return {\n marketingUrl,\n videoUrl: devVideoUrl,\n publicApiUrl: devPublicApiUrl,\n embedApiUrl: devEmbedApiUrl,\n publicRecorderUrl: devPublicRecorderUrl\n };\n }\n\n if (env === 'staging') {\n return {\n marketingUrl,\n videoUrl: stagingVideoUrl,\n publicApiUrl: stagingPublicApiUrl,\n embedApiUrl: stagingEmbedApiUrl,\n publicRecorderUrl: stagingPublicRecorderUrl\n };\n }\n\n if (env === 'prod') {\n return {\n marketingUrl,\n videoUrl: prodVideoUrl,\n publicApiUrl: prodPublicApiUrl,\n embedApiUrl: prodEmbedApiUrl,\n publicRecorderUrl: prodPublicRecorderUrl\n };\n }\n}\n\nexport {\n marketingUrl,\n devEmbedApiUrl,\n stagingEmbedApiUrl,\n prodEmbedApiUrl,\n devPublicRecorderUrl,\n stagingPublicRecorderUrl,\n prodPublicRecorderUrl,\n getEnvUrls\n};\nexport type { Environment };\n","import { Task } from '@lit/task';\n\nimport type { Embed, EmbedProps } from '..';\nimport type { TemplateInstance } from '@vouchfor/canvas-video';\nimport type { ReactiveControllerHost } from 'lit';\nimport type { Environment } from '~/utils/env';\n\nimport { getEnvUrls } from '~/utils/env';\n\ntype EmbedHost = ReactiveControllerHost & Embed;\n\ntype TaskDeps = [\n EmbedProps['env'],\n EmbedProps['apiKey'],\n EmbedProps['data'],\n EmbedProps['vouchId'],\n EmbedProps['templateId']\n];\n\nclass FetcherController {\n host: EmbedHost;\n\n private _fetching = false;\n private _vouch: EmbedProps['data'] | null = null;\n private _template: TemplateInstance | null = null;\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 set vouch(value) {\n if (this._vouch !== value) {\n this._vouch = value;\n this.host.requestUpdate();\n }\n }\n get vouch() {\n return this._vouch;\n }\n\n set template(value) {\n if (this._template !== value) {\n this._template = value;\n this.host.requestUpdate();\n }\n }\n get template() {\n return this._template;\n }\n\n private async getVouch(env: Environment, apiKey: string, vouchId?: string) {\n const { embedApiUrl } = getEnvUrls(env);\n\n if (vouchId) {\n return fetch(`${embedApiUrl}/vouches/${vouchId}`, {\n method: 'GET',\n headers: [['X-Api-Key', apiKey]]\n }).then((response) => response.json());\n }\n\n return null;\n }\n\n private async getTemplate(env: Environment, apiKey: string, templateId?: string) {\n const { embedApiUrl } = getEnvUrls(env);\n\n if (templateId) {\n return fetch(`${embedApiUrl}/templates/${templateId}`, {\n method: 'GET',\n headers: [['X-Api-Key', apiKey]]\n }).then((response) => response.json());\n }\n\n return null;\n }\n\n constructor(host: EmbedHost) {\n this.host = host;\n new Task<TaskDeps, void>(\n this.host,\n async ([env, apiKey, data, vouchId, templateId]: TaskDeps) => {\n try {\n this.vouch = null;\n this.template = null;\n\n if (data) {\n const template = await this.getTemplate(env, apiKey, templateId);\n this.vouch = data;\n this.template = data?.settings?.template?.instance ?? template;\n } else if (vouchId) {\n this.fetching = true;\n\n const [vouch, template] = await Promise.all([\n this.getVouch(env, apiKey, vouchId),\n this.getTemplate(env, apiKey, templateId)\n ]);\n this.vouch = vouch;\n this.template = vouch?.settings?.template?.instance ?? template;\n }\n } finally {\n this.fetching = false;\n }\n },\n () => [host.env, host.apiKey, host.data, host.vouchId, host.templateId]\n );\n }\n}\n\nexport { FetcherController };\n","// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nlet getRandomValues;\nconst rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\n\nexport function unsafeStringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];\n}\n\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\nexport default {\n randomUUID\n};","import native from './native.js';\nimport rng from './rng.js';\nimport { unsafeStringify } from './stringify.js';\n\nfunction v4(options, buf, offset) {\n if (native.randomUUID && !buf && !options) {\n return native.randomUUID();\n }\n\n options = options || {};\n const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return unsafeStringify(rnds);\n}\n\nexport default v4;","import { v4 as uuidv4 } from 'uuid';\n\nimport type { Embed } from '..';\nimport type { VideoEventDetail } from '@vouchfor/media-player';\nimport type { ReactiveController, ReactiveControllerHost } from 'lit';\n\nimport { getEnvUrls } from '~/utils/env';\n\nconst STREAMED_THROTTLE = 2000;\n\ntype EmbedHost = ReactiveControllerHost & Embed;\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 TimeMap = {\n [key: string]: number;\n};\n\ntype BooleanMap = {\n [key: string]: boolean;\n};\n\nclass TrackingController implements ReactiveController {\n host: EmbedHost;\n\n private _tabId: string | undefined = undefined;\n private _clientId: string | undefined = undefined;\n private _visitorId: string | undefined = undefined;\n\n private _hasPlayed = false;\n private _hasLoaded: BooleanMap = {};\n private _answersViewed: BooleanMap = {};\n private _streamedTime: TimeMap = {};\n private _streamedPrevTimestamp: TimeMap = {};\n\n constructor(host: EmbedHost) {\n this.host = host;\n host.addController(this);\n }\n\n private _findVouchId() {\n if (this.host.data) {\n if ('uuid' in this.host.data) {\n return this.host.data.uuid;\n }\n return this.host.data.id;\n }\n }\n\n private _createVisitor = (visitorId: string) => {\n const { publicApiUrl } = getEnvUrls(this.host.env);\n window.localStorage?.setItem?.('vouch-uid-visitor', visitorId);\n navigator.sendBeacon(`${publicApiUrl}/api/visitor`, JSON.stringify({ visitorId }));\n return visitorId;\n };\n\n private _getUids() {\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 const visitorId =\n this._visitorId || window.localStorage?.getItem?.('vouch-uid-visitor') || this._createVisitor(uuidv4());\n // Persisted for a user for the same device + browser, so we can e.g. search for all logs related to that browser\n const clientId = this._clientId || window.localStorage?.getItem?.('vouch-uid-client') || uuidv4();\n // Persisted in session storage, so we can search for everything the user has done in a specific tab\n const tabId = this._tabId || window.sessionStorage?.getItem?.('vouch-uid-tab') || uuidv4();\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 and persist uids\n if (visitorId !== this._visitorId) {\n this._visitorId = visitorId;\n window.localStorage?.setItem?.('vouch-uid-visitor', visitorId);\n }\n\n if (clientId !== this._clientId) {\n this._clientId = clientId;\n window.localStorage?.setItem?.('vouch-uid-client', clientId);\n }\n\n if (tabId !== this._tabId) {\n this._tabId = tabId;\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\n private _getReportingMetadata = () => {\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: 'media_player',\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 ...utmParams\n };\n };\n\n private _sendTrackingEvent = (event: TrackingEvent, payload: TrackingPayload) => {\n const { publicApiUrl } = getEnvUrls(this.host.env);\n const { client, tab, request, visitor } = this._getUids();\n\n // Don't send tracking if we don't have a source\n navigator.sendBeacon(\n `${publicApiUrl}/api/events`,\n JSON.stringify({\n event,\n payload,\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': this._getReportingMetadata()\n }\n })\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._sendTrackingEvent('VOUCH_LOADED', {\n vouchId\n });\n this._hasLoaded[vouchId] = true;\n }\n };\n\n private _handlePlay = () => {\n const vouchId = this._findVouchId();\n\n if (!vouchId) {\n return;\n }\n\n // Only send the video played event once per session\n if (!this._hasPlayed) {\n this._sendTrackingEvent('VIDEO_PLAYED', {\n vouchId,\n streamStart: this.host.currentTime\n });\n this._hasPlayed = true;\n }\n };\n\n private _handleVideoPlay = ({ detail: { id, node } }: CustomEvent<VideoEventDetail>) => {\n const vouchId = this._findVouchId();\n if (!vouchId) {\n return;\n }\n // Only increment play count once per session\n if (!this._answersViewed[id]) {\n this._sendTrackingEvent('VOUCH_RESPONSE_VIEWED', {\n vouchId,\n answerId: id\n });\n this._answersViewed[id] = true;\n }\n this._streamedTime[id] = node.currentTime;\n this._streamedPrevTimestamp[id] = Date.now();\n };\n\n private _handleVideoTimeUpdate = ({ detail: { id, node } }: CustomEvent<VideoEventDetail>) => {\n const vouchId = this._findVouchId();\n if (!vouchId) {\n return;\n }\n const currentTimestamp = Date.now();\n if (\n !this.host.paused &&\n // Only fire the video seeked event when this video is the active one\n id === this.host.scene?.video?.id &&\n // Throttle the frequency that we send streamed events while playing\n currentTimestamp - this._streamedPrevTimestamp[id] > STREAMED_THROTTLE\n ) {\n this._sendTrackingEvent('VIDEO_STREAMED', {\n vouchId,\n answerId: id,\n streamStart: this._streamedTime[id],\n streamEnd: node.currentTime\n });\n this._streamedTime[id] = node.currentTime;\n this._streamedPrevTimestamp[id] = currentTimestamp;\n }\n };\n\n private _handleVideoPause = ({ detail: { id, node } }: CustomEvent<VideoEventDetail>) => {\n const vouchId = this._findVouchId();\n if (!vouchId) {\n return;\n }\n // Send a video streamed event any time the video pauses then reset the streamed state\n // We do this to capture the last bit of time that the video was played between the previous\n // stream event and the video being paused manually or stopping because it ended\n this._sendTrackingEvent('VIDEO_STREAMED', {\n vouchId,\n answerId: id,\n streamStart: this._streamedTime[id],\n streamEnd: node.currentTime\n });\n delete this._streamedTime[id];\n delete this._streamedPrevTimestamp[id];\n };\n\n hostConnected() {\n requestAnimationFrame(() => {\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 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 };\n","import { html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { createRef, ref } from 'lit/directives/ref.js';\n\nimport type { Scene, TemplateInstance } from '@vouchfor/canvas-video';\nimport type { MediaPlayer, MediaPlayerProps } from '@vouchfor/media-player';\nimport type { Ref } from 'lit/directives/ref.js';\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 EmbedProps = Pick<\n MediaPlayerProps,\n 'data' | 'resolution' | 'aspectRatio' | 'preload' | 'autoplay' | 'controls'\n> & {\n env: Environment;\n apiKey: string;\n vouchId?: string;\n templateId?: string;\n};\n\n@customElement('vouch-embed')\nclass Embed extends LitElement {\n private _mediaPlayerRef: Ref<MediaPlayer> = createRef();\n\n @property({ type: Object, attribute: 'data' }) data: EmbedProps['data'];\n @property({ type: String }) vouchId: EmbedProps['vouchId'];\n @property({ type: String }) templateId: EmbedProps['templateId'];\n\n @property({ type: String }) env: EmbedProps['env'] = 'prod';\n @property({ type: String }) apiKey: EmbedProps['apiKey'] = '';\n\n @property({ type: String }) preload: EmbedProps['preload'] = 'auto';\n @property({ type: Boolean }) autoplay: EmbedProps['autoplay'] = false;\n\n @property({ type: Number }) resolution: EmbedProps['resolution'] = 1080;\n @property({ type: Number }) aspectRatio: EmbedProps['aspectRatio'] = 0;\n @property({ type: Array }) controls: EmbedProps['controls'];\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 'seeking',\n 'seeked',\n 'timeupdate',\n 'volumechange',\n 'waiting',\n\n 'video:loadeddata',\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 get vouch() {\n return this._fetcherController.vouch;\n }\n\n get template(): TemplateInstance | null {\n return this._fetcherController.template;\n }\n\n get fetching() {\n return this._fetcherController.fetching;\n }\n\n get waiting() {\n return this._mediaPlayerRef.value?.waiting;\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 videoState() {\n return this._mediaPlayerRef.value?.videoState;\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 setScene(index: number) {\n this._mediaPlayerRef.value?.setScene(index);\n }\n\n render() {\n return html`\n <vmp-media-player\n ${ref(this._mediaPlayerRef)}\n ${this.eventController.register()}\n ?autoplay=${this.autoplay}\n ?loading=${this.fetching}\n .data=${this.vouch}\n .template=${this.template}\n resolution=${ifDefined(this.resolution)}\n aspectRatio=${ifDefined(this.aspectRatio)}\n preload=${ifDefined(this.preload)}\n .controls=${this.controls}\n ></vmp-media-player>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'vouch-embed': Embed;\n }\n\n namespace JSX {\n interface IntrinsicElements {\n 'vouch-embed': Embed;\n }\n }\n}\n\nexport { Embed };\nexport type { EmbedProps };\n"],"names":["t","e","s","n","o$4","r","o","S","c","h","i","a","l","d","u$2","u","v","f","_","m","p","g","$","y","T","A","E","C","P","V","w","N","H","L","z","k","M$1","R","Z","R$1","M","k$1","H$1","I","L$1","z$1","B","x","j","forwardEvent","type","fromElement","toElement","forwarder","event","EventForwardController","host","events","createRef","ref","fn","marketingUrl","devVideoUrl","stagingVideoUrl","prodVideoUrl","devPublicApiUrl","stagingPublicApiUrl","prodPublicApiUrl","devEmbedApiUrl","stagingEmbedApiUrl","prodEmbedApiUrl","devPublicRecorderUrl","stagingPublicRecorderUrl","prodPublicRecorderUrl","getEnvUrls","env","FetcherController","Task","apiKey","data","vouchId","templateId","template","_b","_a","vouch","_d","_c","value","embedApiUrl","response","getRandomValues","rnds8","rng","byteToHex","unsafeStringify","arr","offset","randomUUID","native","v4","options","buf","rnds","STREAMED_THROTTLE","TrackingController","visitorId","publicApiUrl","country","region","utmParams","key","param","group","payload","client","tab","request","visitor","id","node","currentTimestamp","uuidv4","clientId","tabId","_f","_e","requestId","_h","_g","_j","_i","_l","_k","Embed","LitElement","index","html","ifDefined","__decorateClass","property","customElement"],"mappings":";;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,MAAMA,IAAE,QAAOC,KAAED,EAAE,eAAsBA,EAAE,aAAX,UAAqBA,EAAE,SAAS,iBAAe,wBAAuB,SAAS,aAAW,aAAY,cAAc,WAAUE,KAAE,OAAQ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,EAAS,EAAE,MAAM,QAAQ;AAAA,GAbtBN,EAawB,WAAA,cAAA,CAAA;AACAK,EAAA;AAAA,EAA3BC,EAAS,EAAE,MAAM,QAAQ;AAAA,GAdtBN,EAcwB,WAAA,eAAA,CAAA;AACDK,EAAA;AAAA,EAA1BC,EAAS,EAAE,MAAM,OAAO;AAAA,GAfrBN,EAeuB,WAAA,YAAA,CAAA;AAfvBA,IAANK,EAAA;AAAA,EADCE,GAAc,aAAa;AAAA,GACtBP,CAAA;","x_google_ignoreList":[0,1,2,3,4,9,10,11,12]}
|
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 { VideoEventDetail } 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: VideoEventDetail | 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<VideoEventDetail>) => {\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<VideoEventDetail>) => {\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<VideoEventDetail>) => {\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 { Scene, Scenes, TemplateInstance } from '@vouchfor/canvas-video';\nimport type { MediaPlayer, MediaPlayerProps } from '@vouchfor/media-player';\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<\n MediaPlayerProps,\n 'data' | 'aspectRatio' | 'language' | 'preload' | 'autoplay' | 'controls'\n> & {\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 'seeking',\n 'seeked',\n 'timeupdate',\n 'volumechange',\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 videoState() {\n return this._mediaPlayerRef.value?.videoState;\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 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 .data=${this.vouch}\n .template=${this.template}\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,E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,WAAA,WAAA,CAAA;AACA,gBAAA;AAAA,EAA3B,SAAS,EAAE,MAAM,QAAQ;AAAA,GAhBtB,YAgBwB,WAAA,cAAA,CAAA;AACD,gBAAA;AAAA,EAA1B,SAAS,EAAE,MAAM,OAAO;AAAA,GAjBrB,YAiBuB,WAAA,aAAA,CAAA;AAEC,gBAAA;AAAA,EAA3B,SAAS,EAAE,MAAM,QAAQ;AAAA,GAnBtB,YAmBwB,WAAA,OAAA,CAAA;AACA,gBAAA;AAAA,EAA3B,SAAS,EAAE,MAAM,QAAQ;AAAA,GApBtB,YAoBwB,WAAA,UAAA,CAAA;AACC,gBAAA;AAAA,EAA5B,SAAS,EAAE,MAAM,SAAS;AAAA,GArBvB,YAqByB,WAAA,mBAAA,CAAA;AACD,gBAAA;AAAA,EAA3B,SAAS,EAAE,MAAM,QAAQ;AAAA,GAtBtB,YAsBwB,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 };
|
package/dist/es/{components/Embed → src/components/PlayerEmbed}/controllers/event-forwarder.d.ts
RENAMED
@@ -1,13 +1,14 @@
|
|
1
|
-
import type {
|
1
|
+
import type { PlayerEmbed } from '..';
|
2
2
|
import type { ReactiveController, ReactiveControllerHost } from 'lit';
|
3
|
-
type
|
3
|
+
import type { DirectiveResult } from 'lit/directive.js';
|
4
|
+
type PlayerEmbedHost = ReactiveControllerHost & PlayerEmbed;
|
4
5
|
declare class EventForwardController implements ReactiveController {
|
5
|
-
host:
|
6
|
+
host: PlayerEmbedHost;
|
6
7
|
private _events;
|
7
8
|
private _cleanup;
|
8
9
|
private _forwardElementRef;
|
9
|
-
constructor(host:
|
10
|
-
register():
|
10
|
+
constructor(host: PlayerEmbedHost, events: string[]);
|
11
|
+
register(): DirectiveResult;
|
11
12
|
hostConnected(): void;
|
12
13
|
hostDisconnected(): void;
|
13
14
|
}
|
@@ -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 };
|