@beyondwords/player 0.0.0-beta48 → 0.0.0-beta49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es.js +10 -9
- package/dist/es.js.map +1 -1
- package/dist/umd.js +3 -3
- package/dist/umd.js.map +1 -1
- package/package.json +1 -1
package/dist/umd.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
(function(M,Be){typeof exports=="object"&&typeof module!="undefined"?module.exports=Be():typeof define=="function"&&define.amd?define(Be):(M=typeof globalThis!="undefined"?globalThis:M||self,M.BeyondWords=Be())})(this,function(){var $n,Ho,Os,qr,es,Es,Hr,Ls,Yr,ts,xs,Zr,Ns,Kr,is,Ds,Jr,Rs,Gr,Us,Xr,Fs,Qr,qs,$r,ns,Yo,Hs,ea,Ys,ta,_i,Ji,Fi,An,ni,fi,Zs,ia,kn,us,qi,Cn,Ks,na,ss,Zo,ji,hn,os,Ko,Hi,Bn,jt,Kt,Yi,In,zi,_n,Js,sa,Gs,oa,pn,cs,ls,Jo,Xs,la,Qs,ra,$s,aa,eo,ua,sn,Lr;"use strict";var nm=Object.defineProperty,sm=Object.defineProperties;var om=Object.getOwnPropertyDescriptors;var co=Object.getOwnPropertySymbols;var Rr=Object.prototype.hasOwnProperty,Ur=Object.prototype.propertyIsEnumerable;var Dr=(M,Be,Me)=>Be in M?nm(M,Be,{enumerable:!0,configurable:!0,writable:!0,value:Me}):M[Be]=Me,Zt=(M,Be)=>{for(var Me in Be||(Be={}))Rr.call(Be,Me)&&Dr(M,Me,Be[Me]);if(co)for(var Me of co(Be))Ur.call(Be,Me)&&Dr(M,Me,Be[Me]);return M},Ki=(M,Be)=>sm(M,om(Be));var Fo=(M,Be)=>{var Me={};for(var Mt in M)Rr.call(M,Mt)&&Be.indexOf(Mt)<0&&(Me[Mt]=M[Mt]);if(M!=null&&co)for(var Mt of co(M))Be.indexOf(Mt)<0&&Ur.call(M,Mt)&&(Me[Mt]=M[Mt]);return Me};var qo=(M,Be,Me)=>{if(!Be.has(M))throw TypeError("Cannot "+Me)};var Pi=(M,Be,Me)=>(qo(M,Be,"read from private field"),Me?Me.call(M):Be.get(M)),Ce=(M,Be,Me)=>{if(Be.has(M))throw TypeError("Cannot add the same private member more than once");Be instanceof WeakSet?Be.add(M):Be.set(M,Me)},Fr=(M,Be,Me,Mt)=>(qo(M,Be,"write to private field"),Mt?Mt.call(M,Me):Be.set(M,Me),Me);var O=(M,Be,Me)=>(qo(M,Be,"access private method"),Me);var di=(M,Be,Me)=>new Promise((Mt,Un)=>{var Ue=gi=>{try{fe(Me.next(gi))}catch(hi){Un(hi)}},Gi=gi=>{try{fe(Me.throw(gi))}catch(hi){Un(hi)}},fe=gi=>gi.done?Mt(gi.value):Promise.resolve(gi.value).then(Ue,Gi);fe((Me=Me.apply(M,Be)).next())})
|
|
1
|
+
(function(M,Be){typeof exports=="object"&&typeof module!="undefined"?module.exports=Be():typeof define=="function"&&define.amd?define(Be):(M=typeof globalThis!="undefined"?globalThis:M||self,M.BeyondWords=Be())})(this,function(){var $n,Ho,Os,qr,es,Es,Hr,Ls,Yr,ts,xs,Zr,Ns,Kr,is,Ds,Jr,Rs,Gr,Us,Xr,Fs,Qr,qs,$r,ns,Yo,Hs,ea,Ys,ta,_i,Ji,Fi,An,ni,fi,Zs,ia,kn,us,qi,Cn,Ks,na,ss,Zo,ji,hn,os,Ko,Hi,Bn,jt,Kt,Yi,In,zi,_n,Js,sa,Gs,oa,pn,cs,ls,Jo,Xs,la,Qs,ra,$s,aa,eo,ua,sn,Lr;"use strict";var nm=Object.defineProperty,sm=Object.defineProperties;var om=Object.getOwnPropertyDescriptors;var co=Object.getOwnPropertySymbols;var Rr=Object.prototype.hasOwnProperty,Ur=Object.prototype.propertyIsEnumerable;var Dr=(M,Be,Me)=>Be in M?nm(M,Be,{enumerable:!0,configurable:!0,writable:!0,value:Me}):M[Be]=Me,Zt=(M,Be)=>{for(var Me in Be||(Be={}))Rr.call(Be,Me)&&Dr(M,Me,Be[Me]);if(co)for(var Me of co(Be))Ur.call(Be,Me)&&Dr(M,Me,Be[Me]);return M},Ki=(M,Be)=>sm(M,om(Be));var Fo=(M,Be)=>{var Me={};for(var Mt in M)Rr.call(M,Mt)&&Be.indexOf(Mt)<0&&(Me[Mt]=M[Mt]);if(M!=null&&co)for(var Mt of co(M))Be.indexOf(Mt)<0&&Ur.call(M,Mt)&&(Me[Mt]=M[Mt]);return Me};var qo=(M,Be,Me)=>{if(!Be.has(M))throw TypeError("Cannot "+Me)};var Pi=(M,Be,Me)=>(qo(M,Be,"read from private field"),Me?Me.call(M):Be.get(M)),Ce=(M,Be,Me)=>{if(Be.has(M))throw TypeError("Cannot add the same private member more than once");Be instanceof WeakSet?Be.add(M):Be.set(M,Me)},Fr=(M,Be,Me,Mt)=>(qo(M,Be,"write to private field"),Mt?Mt.call(M,Me):Be.set(M,Me),Me);var O=(M,Be,Me)=>(qo(M,Be,"access private method"),Me);var di=(M,Be,Me)=>new Promise((Mt,Un)=>{var Ue=gi=>{try{fe(Me.next(gi))}catch(hi){Un(hi)}},Gi=gi=>{try{fe(Me.throw(gi))}catch(hi){Un(hi)}},fe=gi=>gi.done?Mt(gi.value):Promise.resolve(gi.value).then(Ue,Gi);fe((Me=Me.apply(M,Be)).next())});/*! version:"0.0.0-beta49" */function M(){}const Be=t=>t;function Me(t,e){for(const i in e)t[i]=e[i];return t}function Mt(t){return t()}function Un(){return Object.create(null)}function Ue(t){t.forEach(Mt)}function Gi(t){return typeof t=="function"}function fe(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let gi;function hi(t,e){return gi||(gi=document.createElement("a")),gi.href=e,t===gi.href}function ca(t){return Object.keys(t).length===0}function Vn(t,e,i,n){if(t){const s=Go(t,e,i,n);return t[0](s)}}function Go(t,e,i,n){return t[1]&&n?Me(i.ctx.slice(),t[1](n(e))):i.ctx}function Wn(t,e,i,n){if(t[2]&&n){const s=t[2](n(i));if(e.dirty===void 0)return s;if(typeof s=="object"){const o=[],l=Math.max(e.dirty.length,s.length);for(let r=0;r<l;r+=1)o[r]=e.dirty[r]|s[r];return o}return e.dirty|s}return e.dirty}function jn(t,e,i,n,s,o){if(s){const l=Go(e,i,n,o);t.p(l,s)}}function zn(t){if(t.ctx.length>32){const e=[],i=t.ctx.length/32;for(let n=0;n<i;n++)e[n]=-1;return e}return-1}function Xo(t){return t==null?"":t}function Qo(t){const e=typeof t=="string"&&t.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[t,"px"]}const $o=typeof window!="undefined";let da=$o?()=>window.performance.now():()=>Date.now(),ds=$o?t=>requestAnimationFrame(t):M;const Mn=new Set;function el(t){Mn.forEach(e=>{e.c(t)||(Mn.delete(e),e.f())}),Mn.size!==0&&ds(el)}function ga(t){let e;return Mn.size===0&&ds(el),{promise:new Promise(i=>{Mn.add(e={c:t,f:i})}),abort(){Mn.delete(e)}}}const fa=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global;function g(t,e){t.appendChild(e)}function tl(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function ha(t){const e=_("style");return _a(tl(t),e),e.sheet}function _a(t,e){return g(t.head||t,e),e.sheet}function V(t,e,i){t.insertBefore(e,i||null)}function B(t){t.parentNode&&t.parentNode.removeChild(t)}function Xi(t,e){for(let i=0;i<t.length;i+=1)t[i]&&t[i].d(e)}function _(t){return document.createElement(t)}function be(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function $(t){return document.createTextNode(t)}function K(){return $(" ")}function mn(){return $("")}function x(t,e,i,n){return t.addEventListener(e,i,n),()=>t.removeEventListener(e,i,n)}function Se(t,e,i){i==null?t.removeAttribute(e):t.getAttribute(e)!==i&&t.setAttribute(e,i)}function ma(t){return Array.from(t.childNodes)}function ri(t,e){e=""+e,t.data!==e&&(t.data=e)}function Oe(t,e){t.value=e==null?"":e}function Ot(t,e,i,n){i==null?t.style.removeProperty(e):t.style.setProperty(e,i,n?"important":"")}function Te(t,e,i){for(let n=0;n<t.options.length;n+=1){const s=t.options[n];if(s.__value===e){s.selected=!0;return}}(!i||e!==void 0)&&(t.selectedIndex=-1)}function yt(t){const e=t.querySelector(":checked");return e&&e.__value}let gs;function ya(){if(gs===void 0){gs=!1;try{typeof window!="undefined"&&window.parent&&window.parent.document}catch(t){gs=!0}}return gs}function va(t,e){getComputedStyle(t).position==="static"&&(t.style.position="relative");const n=_("iframe");n.setAttribute("style","display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;"),n.setAttribute("aria-hidden","true"),n.tabIndex=-1;const s=ya();let o;return s?(n.src="data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>",o=x(window,"message",l=>{l.source===n.contentWindow&&e()})):(n.src="about:blank",n.onload=()=>{o=x(n.contentWindow,"resize",e),e()}),g(t,n),()=>{(s||o&&n.contentWindow)&&o(),B(n)}}function le(t,e,i){t.classList[i?"add":"remove"](e)}function ba(t,e,{bubbles:i=!1,cancelable:n=!1}={}){const s=document.createEvent("CustomEvent");return s.initCustomEvent(t,i,n,e),s}const fs=new Map;let hs=0;function ka(t){let e=5381,i=t.length;for(;i--;)e=(e<<5)-e^t.charCodeAt(i);return e>>>0}function pa(t,e){const i={stylesheet:ha(e),rules:{}};return fs.set(t,i),i}function il(t,e,i,n,s,o,l,r=0){const a=16.666/n;let c=`{
|
|
2
2
|
`;for(let b=0;b<=1;b+=a){const W=e+(i-e)*o(b);c+=b*100+`%{${l(W,1-W)}}
|
|
3
3
|
`}const u=c+`100% {${l(i,1-i)}}
|
|
4
|
-
}`,h=`__svelte_${ka(u)}_${r}`,m=tl(t),{stylesheet:v,rules:y}=fs.get(m)||pa(m,t);y[h]||(y[h]=!0,v.insertRule(`@keyframes ${h} ${u}`,v.cssRules.length));const p=t.style.animation||"";return t.style.animation=`${p?`${p}, `:""}${h} ${n}ms linear ${s}ms 1 both`,hs+=1,h}function Sa(t,e){const i=(t.style.animation||"").split(", "),n=i.filter(e?o=>o.indexOf(e)<0:o=>o.indexOf("__svelte")===-1),s=i.length-n.length;s&&(t.style.animation=n.join(", "),hs-=s,hs||wa())}function wa(){ds(()=>{hs||(fs.forEach(t=>{const{ownerNode:e}=t.stylesheet;e&&B(e)}),fs.clear())})}let Fn;function qn(t){Fn=t}function nl(){if(!Fn)throw new Error("Function called outside component initialization");return Fn}function go(t){nl().$$.on_mount.push(t)}function Pa(t){nl().$$.on_destroy.push(t)}const On=[],ie=[];let En=[];const fo=[],sl=Promise.resolve();let ho=!1;function ol(){ho||(ho=!0,sl.then(d))}function Ta(){return ol(),sl}function Fe(t){En.push(t)}function _e(t){fo.push(t)}const _o=new Set;let Ln=0;function d(){if(Ln!==0)return;const t=Fn;do{try{for(;Ln<On.length;){const e=On[Ln];Ln++,qn(e),Aa(e.$$)}}catch(e){throw On.length=0,Ln=0,e}for(qn(null),On.length=0,Ln=0;ie.length;)ie.pop()();for(let e=0;e<En.length;e+=1){const i=En[e];_o.has(i)||(_o.add(i),i())}En.length=0}while(On.length);for(;fo.length;)fo.pop()();ho=!1,_o.clear(),qn(t)}function Aa(t){if(t.fragment!==null){t.update(),Ue(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(Fe)}}function Ca(t){const e=[],i=[];En.forEach(n=>t.indexOf(n)===-1?e.push(n):i.push(n)),i.forEach(n=>n()),En=e}let Hn;function Ba(){return Hn||(Hn=Promise.resolve(),Hn.then(()=>{Hn=null})),Hn}function mo(t,e,i){t.dispatchEvent(ba(`${e?"intro":"outro"}${i}`))}const _s=new Set;let Li;function De(){Li={r:0,c:[],p:Li}}function Re(){Li.r||Ue(Li.c),Li=Li.p}function T(t,e){t&&t.i&&(_s.delete(t),t.i(e))}function j(t,e,i,n){if(t&&t.o){if(_s.has(t))return;_s.add(t),Li.c.push(()=>{_s.delete(t),n&&(i&&t.d(1),n())}),t.o(e)}else n&&n()}const Ia={duration:0};function ll(t,e,i,n){const s={direction:"both"};let o=e(t,i,s),l=n?0:1,r=null,a=null,c=null;function u(){c&&Sa(t,c)}function h(v,y){const p=v.b-l;return y*=Math.abs(p),{a:l,b:v.b,d:p,duration:y,start:v.start,end:v.start+y,group:v.group}}function m(v){const{delay:y=0,duration:p=300,easing:b=Be,tick:W=M,css:z}=o||Ia,J={start:da()+y,b:v};v||(J.group=Li,Li.r+=1),r||a?a=J:(z&&(u(),c=il(t,l,v,p,y,b,z)),v&&W(0,1),r=h(J,p),Fe(()=>mo(t,v,"start")),ga(G=>{if(a&&G>a.start&&(r=h(a,p),a=null,mo(t,r.b,"start"),z&&(u(),c=il(t,l,r.b,r.duration,0,b,o.css))),r){if(G>=r.end)W(l=r.b,1-l),mo(t,r.b,"end"),a||(r.b?u():--r.group.r||Ue(r.group.c)),r=null;else if(G>=r.start){const E=G-r.start;l=r.a+r.d*b(E/r.duration),W(l,1-l)}}return!!(r||a)}))}return{run(v){Gi(o)?Ba().then(()=>{o=o(s),m(v)}):m(v)},end(){u(),r=a=null}}}function Va(t,e){j(t,1,1,()=>{e.delete(t.key)})}function Wa(t,e,i,n,s,o,l,r,a,c,u,h){let m=t.length,v=o.length,y=m;const p={};for(;y--;)p[t[y].key]=y;const b=[],W=new Map,z=new Map,J=[];for(y=v;y--;){const D=h(s,o,y),L=i(D);let X=l.get(L);X?n&&J.push(()=>X.p(D,e)):(X=c(L,D),X.c()),W.set(L,b[y]=X),L in p&&z.set(L,Math.abs(y-p[L]))}const G=new Set,E=new Set;function N(D){T(D,1),D.m(r,u),l.set(D.key,D),u=D.first,v--}for(;m&&v;){const D=b[v-1],L=t[m-1],X=D.key,ue=L.key;D===L?(u=D.first,m--,v--):W.has(ue)?!l.has(X)||G.has(X)?N(D):E.has(ue)?m--:z.get(X)>z.get(ue)?(E.add(X),N(D)):(G.add(ue),m--):(a(L,l),m--)}for(;m--;){const D=t[m];W.has(D.key)||a(D,l)}for(;v;)N(b[v-1]);return Ue(J),b}function me(t,e,i){const n=t.$$.props[e];n!==void 0&&(t.$$.bound[n]=i,i(t.$$.ctx[n]))}function ce(t){t&&t.c()}function re(t,e,i,n){const{fragment:s,after_update:o}=t.$$;s&&s.m(e,i),n||Fe(()=>{const l=t.$$.on_mount.map(Mt).filter(Gi);t.$$.on_destroy?t.$$.on_destroy.push(...l):Ue(l),t.$$.on_mount=[]}),o.forEach(Fe)}function ae(t,e){const i=t.$$;i.fragment!==null&&(Ca(i.after_update),Ue(i.on_destroy),i.fragment&&i.fragment.d(e),i.on_destroy=i.fragment=null,i.ctx=[])}function ja(t,e){t.$$.dirty[0]===-1&&(On.push(t),ol(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function ke(t,e,i,n,s,o,l,r=[-1]){const a=Fn;qn(t);const c=t.$$={fragment:null,ctx:[],props:o,update:M,not_equal:s,bound:Un(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:Un(),dirty:r,skip_bound:!1,root:e.target||a.$$.root};l&&l(c.root);let u=!1;if(c.ctx=i?i(t,e.props||{},(h,m,...v)=>{const y=v.length?v[0]:m;return c.ctx&&s(c.ctx[h],c.ctx[h]=y)&&(!c.skip_bound&&c.bound[h]&&c.bound[h](y),u&&ja(t,h)),m}):[],c.update(),u=!0,Ue(c.before_update),c.fragment=n?n(c.ctx):!1,e.target){if(e.hydrate){const h=ma(e.target);c.fragment&&c.fragment.l(h),h.forEach(B)}else c.fragment&&c.fragment.c();e.intro&&T(t.$$.fragment),re(t,e.target,e.anchor,e.customElement),d()}qn(a)}class pe{$destroy(){ae(this,1),this.$destroy=M}$on(e,i){if(!Gi(i))return M;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(i),()=>{const s=n.indexOf(i);s!==-1&&n.splice(s,1)}}$set(e){this.$$set&&!ca(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const za="@beyondwords/player",yo="0.0.0-
|
|
4
|
+
}`,h=`__svelte_${ka(u)}_${r}`,m=tl(t),{stylesheet:v,rules:y}=fs.get(m)||pa(m,t);y[h]||(y[h]=!0,v.insertRule(`@keyframes ${h} ${u}`,v.cssRules.length));const p=t.style.animation||"";return t.style.animation=`${p?`${p}, `:""}${h} ${n}ms linear ${s}ms 1 both`,hs+=1,h}function Sa(t,e){const i=(t.style.animation||"").split(", "),n=i.filter(e?o=>o.indexOf(e)<0:o=>o.indexOf("__svelte")===-1),s=i.length-n.length;s&&(t.style.animation=n.join(", "),hs-=s,hs||wa())}function wa(){ds(()=>{hs||(fs.forEach(t=>{const{ownerNode:e}=t.stylesheet;e&&B(e)}),fs.clear())})}let Fn;function qn(t){Fn=t}function nl(){if(!Fn)throw new Error("Function called outside component initialization");return Fn}function go(t){nl().$$.on_mount.push(t)}function Pa(t){nl().$$.on_destroy.push(t)}const On=[],ie=[];let En=[];const fo=[],sl=Promise.resolve();let ho=!1;function ol(){ho||(ho=!0,sl.then(d))}function Ta(){return ol(),sl}function Fe(t){En.push(t)}function _e(t){fo.push(t)}const _o=new Set;let Ln=0;function d(){if(Ln!==0)return;const t=Fn;do{try{for(;Ln<On.length;){const e=On[Ln];Ln++,qn(e),Aa(e.$$)}}catch(e){throw On.length=0,Ln=0,e}for(qn(null),On.length=0,Ln=0;ie.length;)ie.pop()();for(let e=0;e<En.length;e+=1){const i=En[e];_o.has(i)||(_o.add(i),i())}En.length=0}while(On.length);for(;fo.length;)fo.pop()();ho=!1,_o.clear(),qn(t)}function Aa(t){if(t.fragment!==null){t.update(),Ue(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(Fe)}}function Ca(t){const e=[],i=[];En.forEach(n=>t.indexOf(n)===-1?e.push(n):i.push(n)),i.forEach(n=>n()),En=e}let Hn;function Ba(){return Hn||(Hn=Promise.resolve(),Hn.then(()=>{Hn=null})),Hn}function mo(t,e,i){t.dispatchEvent(ba(`${e?"intro":"outro"}${i}`))}const _s=new Set;let Li;function De(){Li={r:0,c:[],p:Li}}function Re(){Li.r||Ue(Li.c),Li=Li.p}function T(t,e){t&&t.i&&(_s.delete(t),t.i(e))}function j(t,e,i,n){if(t&&t.o){if(_s.has(t))return;_s.add(t),Li.c.push(()=>{_s.delete(t),n&&(i&&t.d(1),n())}),t.o(e)}else n&&n()}const Ia={duration:0};function ll(t,e,i,n){const s={direction:"both"};let o=e(t,i,s),l=n?0:1,r=null,a=null,c=null;function u(){c&&Sa(t,c)}function h(v,y){const p=v.b-l;return y*=Math.abs(p),{a:l,b:v.b,d:p,duration:y,start:v.start,end:v.start+y,group:v.group}}function m(v){const{delay:y=0,duration:p=300,easing:b=Be,tick:W=M,css:z}=o||Ia,J={start:da()+y,b:v};v||(J.group=Li,Li.r+=1),r||a?a=J:(z&&(u(),c=il(t,l,v,p,y,b,z)),v&&W(0,1),r=h(J,p),Fe(()=>mo(t,v,"start")),ga(G=>{if(a&&G>a.start&&(r=h(a,p),a=null,mo(t,r.b,"start"),z&&(u(),c=il(t,l,r.b,r.duration,0,b,o.css))),r){if(G>=r.end)W(l=r.b,1-l),mo(t,r.b,"end"),a||(r.b?u():--r.group.r||Ue(r.group.c)),r=null;else if(G>=r.start){const E=G-r.start;l=r.a+r.d*b(E/r.duration),W(l,1-l)}}return!!(r||a)}))}return{run(v){Gi(o)?Ba().then(()=>{o=o(s),m(v)}):m(v)},end(){u(),r=a=null}}}function Va(t,e){j(t,1,1,()=>{e.delete(t.key)})}function Wa(t,e,i,n,s,o,l,r,a,c,u,h){let m=t.length,v=o.length,y=m;const p={};for(;y--;)p[t[y].key]=y;const b=[],W=new Map,z=new Map,J=[];for(y=v;y--;){const D=h(s,o,y),L=i(D);let X=l.get(L);X?n&&J.push(()=>X.p(D,e)):(X=c(L,D),X.c()),W.set(L,b[y]=X),L in p&&z.set(L,Math.abs(y-p[L]))}const G=new Set,E=new Set;function N(D){T(D,1),D.m(r,u),l.set(D.key,D),u=D.first,v--}for(;m&&v;){const D=b[v-1],L=t[m-1],X=D.key,ue=L.key;D===L?(u=D.first,m--,v--):W.has(ue)?!l.has(X)||G.has(X)?N(D):E.has(ue)?m--:z.get(X)>z.get(ue)?(E.add(X),N(D)):(G.add(ue),m--):(a(L,l),m--)}for(;m--;){const D=t[m];W.has(D.key)||a(D,l)}for(;v;)N(b[v-1]);return Ue(J),b}function me(t,e,i){const n=t.$$.props[e];n!==void 0&&(t.$$.bound[n]=i,i(t.$$.ctx[n]))}function ce(t){t&&t.c()}function re(t,e,i,n){const{fragment:s,after_update:o}=t.$$;s&&s.m(e,i),n||Fe(()=>{const l=t.$$.on_mount.map(Mt).filter(Gi);t.$$.on_destroy?t.$$.on_destroy.push(...l):Ue(l),t.$$.on_mount=[]}),o.forEach(Fe)}function ae(t,e){const i=t.$$;i.fragment!==null&&(Ca(i.after_update),Ue(i.on_destroy),i.fragment&&i.fragment.d(e),i.on_destroy=i.fragment=null,i.ctx=[])}function ja(t,e){t.$$.dirty[0]===-1&&(On.push(t),ol(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function ke(t,e,i,n,s,o,l,r=[-1]){const a=Fn;qn(t);const c=t.$$={fragment:null,ctx:[],props:o,update:M,not_equal:s,bound:Un(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:Un(),dirty:r,skip_bound:!1,root:e.target||a.$$.root};l&&l(c.root);let u=!1;if(c.ctx=i?i(t,e.props||{},(h,m,...v)=>{const y=v.length?v[0]:m;return c.ctx&&s(c.ctx[h],c.ctx[h]=y)&&(!c.skip_bound&&c.bound[h]&&c.bound[h](y),u&&ja(t,h)),m}):[],c.update(),u=!0,Ue(c.before_update),c.fragment=n?n(c.ctx):!1,e.target){if(e.hydrate){const h=ma(e.target);c.fragment&&c.fragment.l(h),h.forEach(B)}else c.fragment&&c.fragment.c();e.intro&&T(t.$$.fragment),re(t,e.target,e.anchor,e.customElement),d()}qn(a)}class pe{$destroy(){ae(this,1),this.$destroy=M}$on(e,i){if(!Gi(i))return M;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(i),()=>{const s=n.indexOf(i);s!==-1&&n.splice(s,1)}}$set(e){this.$$set&&!ca(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const za="@beyondwords/player",yo="0.0.0-beta49",Jt=(t,e)=>{t=[t].flat().join(`
|
|
5
5
|
`);let i=`${za}:
|
|
6
6
|
|
|
7
7
|
${t}`;if(e){i+=`
|
|
@@ -54,6 +54,6 @@ This context may be helpful:
|
|
|
54
54
|
`),ei=_("select"),an=_("option"),an.textContent="all",un=_("option"),un.textContent="body",cn=_("option"),cn.textContent="none",dn=_("option"),dn.textContent="all-none",gn=_("option"),gn.textContent="none-all",no=K(),Pn=_("div"),so=$(`segmentWidgetPosition:
|
|
55
55
|
`),wi=_("select");for(let de=0;de<12;de+=1)Tn[de].c();oo=K(),f&&f.c(),rs=K(),lo=_("br"),ro=K(),Ei.c(),C(i,"class","heading svelte-g76q0j"),c.__value="small",c.value=c.__value,u.__value="standard",u.value=u.__value,h.__value="large",h.value=h.__value,m.__value="video",m.value=m.__value,C(a,"tabindex",-1),C(a,"class","svelte-g76q0j"),t[6]===void 0&&Fe(()=>t[43].call(a)),C(l,"class","control svelte-g76q0j"),W.__value="stopped",W.value=W.__value,z.__value="playing",z.value=z.__value,J.__value="paused",J.value=J.__value,C(b,"tabindex",-1),C(b,"class","svelte-g76q0j"),t[20]===void 0&&Fe(()=>t[44].call(b)),C(y,"class","control svelte-g76q0j"),C(D,"tabindex",-1),C(D,"type","text"),C(D,"class","svelte-g76q0j"),C(E,"class","control svelte-g76q0j"),C(ve,"tabindex",-1),C(ve,"type","text"),C(ve,"class","svelte-g76q0j"),C(X,"class","control svelte-g76q0j"),P.__value="auto",P.value=P.__value,F.__value="segments",F.value=F.__value,ge.__value="seconds",ge.value=ge.__value,se.__value="seconds-15",se.value=se.__value,I.__value="seconds-15-30",I.value=I.__value,R.__value="tracks",R.value=R.__value,C(S,"tabindex",-1),C(S,"class","svelte-g76q0j"),t[9]===void 0&&Fe(()=>t[47].call(S)),C(H,"class","control svelte-g76q0j"),Q.__value="auto",Q.value=Q.__value,Pe.__value="show",Pe.value=Pe.__value,Qe.__value="show-3",Qe.value=Qe.__value,Ne.__value="show-999",Ne.value=Ne.__value,dt.__value="hide",dt.value=dt.__value,C(ye,"tabindex",-1),C(ye,"class","svelte-g76q0j"),t[10]===void 0&&Fe(()=>t[48].call(ye)),C(we,"class","control svelte-g76q0j"),it.__value="auto",it.value=it.__value,Ee.__value="show",Ee.value=Ee.__value,Ze.__value="hide",Ze.value=Ze.__value,C(je,"tabindex",-1),C(je,"class","svelte-g76q0j"),t[11]===void 0&&Fe(()=>t[49].call(je)),C(We,"class","control svelte-g76q0j"),U.__value=-1,U.value=U.__value,C(ze,"tabindex",-1),C(ze,"class","svelte-g76q0j"),t[15]===void 0&&Fe(()=>t[50].call(ze)),C(nt,"class","control svelte-g76q0j"),Ge.__value="small",Ge.value=Ge.__value,st.__value="standard",st.value=st.__value,$e.__value="large",$e.value=$e.__value,Pt.__value="video",Pt.value=Pt.__value,C(Je,"tabindex",-1),C(Je,"class","svelte-g76q0j"),t[22]===void 0&&Fe(()=>t[51].call(Je)),C(gt,"class","control svelte-g76q0j"),at.__value="auto",at.value=at.__value,Vt.__value="left",Vt.value=Vt.__value,ft.__value="center",ft.value=ft.__value,zt.__value="right",zt.value=zt.__value,C(rt,"tabindex",-1),C(rt,"class","svelte-g76q0j"),t[23]===void 0&&Fe(()=>t[52].call(rt)),C(kt,"class","control svelte-g76q0j"),He.__value="auto",He.value=He.__value,Ct.__value="400px",Ct.value=Ct.__value,Bt.__value="30rem",Bt.value=Bt.__value,Rt.__value="fit-content",Rt.value=Rt.__value,It.__value="initial",It.value=It.__value,Yt.__value="0",Yt.value=Yt.__value,C(Xe,"tabindex",-1),C(Xe,"class","svelte-g76q0j"),t[24]===void 0&&Fe(()=>t[53].call(Xe)),C(At,"class","control svelte-g76q0j"),C(te,"tabindex",-1),C(te,"type","text"),C(te,"class","svelte-g76q0j"),C(w,"class","control svelte-g76q0j"),C(_t,"tabindex",-1),C(_t,"type","text"),C(_t,"class","svelte-g76q0j"),C(Ut,"class","control svelte-g76q0j"),C(Gt,"tabindex",-1),C(Gt,"type","text"),C(Gt,"class","svelte-g76q0j"),C(si,"class","control svelte-g76q0j"),C(Xt,"tabindex",-1),C(Xt,"type","text"),C(Xt,"class","svelte-g76q0j"),C(Mi,"class","control svelte-g76q0j"),pi.__value="all",pi.value=pi.__value,Qt.__value="body",Qt.value=Qt.__value,ut.__value="none",ut.value=ut.__value,$t.__value="all-none",$t.value=$t.__value,ct.__value="none-all",ct.value=ct.__value,C(Wt,"tabindex",-1),C(Wt,"class","svelte-g76q0j"),t[31]===void 0&&Fe(()=>t[58].call(Wt)),C(Oi,"class","control svelte-g76q0j"),oe.__value="all",oe.value=oe.__value,Ft.__value="body",Ft.value=Ft.__value,on.__value="none",on.value=on.__value,ln.__value="all-none",ln.value=ln.__value,rn.__value="none-all",rn.value=rn.__value,C(q,"tabindex",-1),C(q,"class","svelte-g76q0j"),t[32]===void 0&&Fe(()=>t[59].call(q)),C(mt,"class","control svelte-g76q0j"),an.__value="all",an.value=an.__value,un.__value="body",un.value=un.__value,cn.__value="none",cn.value=cn.__value,dn.__value="all-none",dn.value=dn.__value,gn.__value="none-all",gn.value=gn.__value,C(ei,"tabindex",-1),C(ei,"class","svelte-g76q0j"),t[33]===void 0&&Fe(()=>t[60].call(ei)),C(wn,"class","control svelte-g76q0j"),C(wi,"tabindex",-1),C(wi,"class","svelte-g76q0j"),t[34]===void 0&&Fe(()=>t[61].call(wi)),C(Pn,"class","control svelte-g76q0j"),C(e,"class","control-panel")},m(de,et){V(de,e,et),g(e,i),g(e,n),g(e,s),g(e,o),g(e,l),g(l,r),g(l,a),g(a,c),g(a,u),g(a,h),g(a,m),Te(a,t[6],!0),g(e,v),g(e,y),g(y,p),g(y,b),g(b,W),g(b,z),g(b,J),Te(b,t[20],!0),g(e,G),g(e,E),g(E,N),g(E,D),Oe(D,t[7]),g(e,L),g(e,X),g(X,ue),g(X,ve),Oe(ve,t[8]),g(e,ee),g(e,H),g(H,Y),g(H,S),g(S,P),g(S,F),g(S,ge),g(S,se),g(S,I),g(S,R),Te(S,t[9],!0),g(e,Ae),g(e,we),g(we,qe),g(we,ye),g(ye,Q),g(ye,Pe),g(ye,Qe),g(ye,Ne),g(ye,dt),Te(ye,t[10],!0),g(e,Ye),g(e,We),g(We,tt),g(We,je),g(je,it),g(je,Ee),g(je,Ze),Te(je,t[11],!0),g(e,Ke),g(e,nt),g(nt,Ve),g(nt,ze),g(ze,U);for(let pt=0;pt<qt.length;pt+=1)qt[pt]&&qt[pt].m(ze,null);Te(ze,t[15],!0),g(e,xe),g(e,gt),g(gt,bt),g(gt,Je),g(Je,Ge),g(Je,st),g(Je,$e),g(Je,Pt),Te(Je,t[22],!0),g(e,ot),g(e,kt),g(kt,lt),g(kt,rt),g(rt,at),g(rt,Vt),g(rt,ft),g(rt,zt),Te(rt,t[23],!0),g(e,ht),g(e,At),g(At,Z),g(At,Xe),g(Xe,He),g(Xe,Ct),g(Xe,Bt),g(Xe,Rt),g(Xe,It),g(Xe,Yt),Te(Xe,t[24],!0),g(e,ne),g(e,w),g(w,A),g(w,te),Oe(te,t[26]),g(e,mi),g(e,Ut),g(Ut,Sn),g(Ut,_t),Oe(_t,t[27]),g(e,yi),g(e,si),g(si,vi),g(si,Gt),Oe(Gt,t[28]),g(e,bi),g(e,Mi),g(Mi,oi),g(Mi,Xt),Oe(Xt,t[29]),g(e,ki),g(e,Oi),g(Oi,li),g(Oi,Wt),g(Wt,pi),g(Wt,Qt),g(Wt,ut),g(Wt,$t),g(Wt,ct),Te(Wt,t[31],!0),g(e,Si),g(e,mt),g(mt,k),g(mt,q),g(q,oe),g(q,Ft),g(q,on),g(q,ln),g(q,rn),Te(q,t[32],!0),g(e,to),g(e,wn),g(wn,io),g(wn,ei),g(ei,an),g(ei,un),g(ei,cn),g(ei,dn),g(ei,gn),Te(ei,t[33],!0),g(e,no),g(e,Pn),g(Pn,so),g(Pn,wi);for(let pt=0;pt<12;pt+=1)Tn[pt]&&Tn[pt].m(wi,null);Te(wi,t[34],!0),g(e,oo),f&&f.m(e,null),g(e,rs),g(e,lo),g(e,ro),Ei.m(e,null),as||(ao=[x(a,"change",t[43]),x(b,"change",t[44]),x(D,"input",t[45]),x(ve,"input",t[46]),x(S,"change",t[47]),x(ye,"change",t[48]),x(je,"change",t[49]),x(ze,"change",t[50]),x(Je,"change",t[51]),x(rt,"change",t[52]),x(Xe,"change",t[53]),x(te,"input",t[54]),x(_t,"input",t[55]),x(Gt,"input",t[56]),x(Xt,"input",t[57]),x(Wt,"change",t[58]),x(q,"change",t[59]),x(ei,"change",t[60]),x(wi,"change",t[61])],as=!0)},p(de,et){if(et[0]&64&&Te(a,de[6]),et[0]&1048576&&Te(b,de[20]),et[0]&128&&D.value!==de[7]&&Oe(D,de[7]),et[0]&256&&ve.value!==de[8]&&Oe(ve,de[8]),et[0]&512&&Te(S,de[9]),et[0]&1024&&Te(ye,de[10]),et[0]&2048&&Te(je,de[11]),et[1]&1024){fn=de[41];let pt;for(pt=0;pt<fn.length;pt+=1){const Nr=Kl(de,fn,pt);qt[pt]?qt[pt].p(Nr,et):(qt[pt]=Jl(Nr),qt[pt].c(),qt[pt].m(ze,null))}for(;pt<qt.length;pt+=1)qt[pt].d(1);qt.length=fn.length}et[0]&32768&&Te(ze,de[15]),et[0]&4194304&&Te(Je,de[22]),et[0]&8388608&&Te(rt,de[23]),et[0]&16777216&&Te(Xe,de[24]),et[0]&67108864&&te.value!==de[26]&&Oe(te,de[26]),et[0]&134217728&&_t.value!==de[27]&&Oe(_t,de[27]),et[0]&268435456&&Gt.value!==de[28]&&Oe(Gt,de[28]),et[0]&536870912&&Xt.value!==de[29]&&Oe(Xt,de[29]),et[1]&1&&Te(Wt,de[31]),et[1]&2&&Te(q,de[32]),et[1]&4&&Te(ei,de[33]),et[1]&8&&Te(wi,de[34]),de[42]?f?f.p(de,et):(f=Gl(de),f.c(),f.m(e,rs)):f&&(f.d(1),f=null),uo===(uo=xr(de))&&Ei?Ei.p(de,et):(Ei.d(1),Ei=uo(de),Ei&&(Ei.c(),Ei.m(e,null)))},i:M,o:M,d(de){de&&B(e),Xi(qt,de),Xi(Tn,de),f&&f.d(),Ei.d(),as=!1,Ue(ao)}}}function o_(t,e,i){import(BeyondWords.Player.styleSrc );let{projectId:n}=e,{contentId:s}=e,{playlistId:o}=e,{sourceId:l}=e,{sourceUrl:r}=e,{showUserInterface:a}=e,{playerStyle:c}=e,{playerTitle:u}=e,{callToAction:h}=e,{skipButtonStyle:m}=e,{playlistStyle:v}=e,{playlistToggle:y}=e,{mediaSession:p}=e,{content:b}=e,{contentIndex:W}=e,{introsOutros:z}=e,{introsOutrosIndex:J}=e,{adverts:G}=e,{advertIndex:E}=e,{persistentAdImage:N}=e,{persistentIndex:D}=e,{duration:L}=e,{currentTime:X}=e,{playbackState:ue}=e,{playbackRate:ve}=e,{widgetStyle:ee}=e,{widgetPosition:H}=e,{widgetWidth:Y}=e,{widgetTarget:S}=e,{textColor:P}=e,{backgroundColor:F}=e,{iconColor:ge}=e,{highlightColor:se}=e,{logoIconEnabled:I}=e,{highlightSections:R}=e,{clickableSections:Ae}=e,{segmentWidgetSections:we}=e,{segmentWidgetPosition:qe}=e,{advertConsent:ye}=e,{analyticsConsent:Q}=e,{analyticsCustomUrl:Pe}=e,{analyticsTag:Qe}=e,Ne=!1;function dt(){c=yt(this),i(6,c)}function Ye(){ue=yt(this),i(20,ue)}function We(){u=this.value,i(7,u)}function tt(){h=this.value,i(8,h)}function je(){m=yt(this),i(9,m)}function it(){v=yt(this),i(10,v)}function Ee(){y=yt(this),i(11,y)}function Ze(){E=yt(this),i(15,E)}function Ke(){ee=yt(this),i(22,ee)}function nt(){H=yt(this),i(23,H)}function Ve(){Y=yt(this),i(24,Y)}function ze(){P=this.value,i(26,P)}function U(){F=this.value,i(27,F)}function xe(){ge=this.value,i(28,ge)}function gt(){se=this.value,i(29,se)}function bt(){R=yt(this),i(31,R)}function Je(){Ae=yt(this),i(32,Ae)}function Ge(){we=yt(this),i(33,we)}function st(){qe=yt(this),i(34,qe)}function $e(){n=this.value,i(0,n)}function Pt(){s=this.value,i(1,s)}function ot(){o=this.value,i(2,o)}function kt(){l=this.value,i(3,l)}function lt(){r=this.value,i(4,r)}function rt(){a=yt(this),i(5,a)}function at(){p=yt(this),i(12,p)}function Vt(){W=yt(this),i(13,W)}function ft(){J=yt(this),i(14,J)}function zt(){N=yt(this),i(16,N)}function ht(){D=yt(this),i(17,D)}function At(){L=this.value,i(18,L)}function Z(){X=this.value,i(19,X)}function Xe(){ve=this.value,i(21,ve)}function He(){S=this.value,i(25,S)}function Ct(){I=yt(this),i(30,I)}function Bt(){ye=yt(this),i(35,ye)}function Rt(){Q=yt(this),i(36,Q)}function It(){Pe=this.value,i(37,Pe)}function Yt(){Qe=this.value,i(38,Qe)}const ne=()=>i(42,Ne=!1),w=()=>i(42,Ne=!0);return t.$$set=A=>{"projectId"in A&&i(0,n=A.projectId),"contentId"in A&&i(1,s=A.contentId),"playlistId"in A&&i(2,o=A.playlistId),"sourceId"in A&&i(3,l=A.sourceId),"sourceUrl"in A&&i(4,r=A.sourceUrl),"showUserInterface"in A&&i(5,a=A.showUserInterface),"playerStyle"in A&&i(6,c=A.playerStyle),"playerTitle"in A&&i(7,u=A.playerTitle),"callToAction"in A&&i(8,h=A.callToAction),"skipButtonStyle"in A&&i(9,m=A.skipButtonStyle),"playlistStyle"in A&&i(10,v=A.playlistStyle),"playlistToggle"in A&&i(11,y=A.playlistToggle),"mediaSession"in A&&i(12,p=A.mediaSession),"content"in A&&i(39,b=A.content),"contentIndex"in A&&i(13,W=A.contentIndex),"introsOutros"in A&&i(40,z=A.introsOutros),"introsOutrosIndex"in A&&i(14,J=A.introsOutrosIndex),"adverts"in A&&i(41,G=A.adverts),"advertIndex"in A&&i(15,E=A.advertIndex),"persistentAdImage"in A&&i(16,N=A.persistentAdImage),"persistentIndex"in A&&i(17,D=A.persistentIndex),"duration"in A&&i(18,L=A.duration),"currentTime"in A&&i(19,X=A.currentTime),"playbackState"in A&&i(20,ue=A.playbackState),"playbackRate"in A&&i(21,ve=A.playbackRate),"widgetStyle"in A&&i(22,ee=A.widgetStyle),"widgetPosition"in A&&i(23,H=A.widgetPosition),"widgetWidth"in A&&i(24,Y=A.widgetWidth),"widgetTarget"in A&&i(25,S=A.widgetTarget),"textColor"in A&&i(26,P=A.textColor),"backgroundColor"in A&&i(27,F=A.backgroundColor),"iconColor"in A&&i(28,ge=A.iconColor),"highlightColor"in A&&i(29,se=A.highlightColor),"logoIconEnabled"in A&&i(30,I=A.logoIconEnabled),"highlightSections"in A&&i(31,R=A.highlightSections),"clickableSections"in A&&i(32,Ae=A.clickableSections),"segmentWidgetSections"in A&&i(33,we=A.segmentWidgetSections),"segmentWidgetPosition"in A&&i(34,qe=A.segmentWidgetPosition),"advertConsent"in A&&i(35,ye=A.advertConsent),"analyticsConsent"in A&&i(36,Q=A.analyticsConsent),"analyticsCustomUrl"in A&&i(37,Pe=A.analyticsCustomUrl),"analyticsTag"in A&&i(38,Qe=A.analyticsTag)},[n,s,o,l,r,a,c,u,h,m,v,y,p,W,J,E,N,D,L,X,ue,ve,ee,H,Y,S,P,F,ge,se,I,R,Ae,we,qe,ye,Q,Pe,Qe,b,z,G,Ne,dt,Ye,We,tt,je,it,Ee,Ze,Ke,nt,Ve,ze,U,xe,gt,bt,Je,Ge,st,$e,Pt,ot,kt,lt,rt,at,Vt,ft,zt,ht,At,Z,Xe,He,Ct,Bt,Rt,It,Yt,ne,w]}class l_ extends pe{constructor(e){super(),ke(this,e,o_,s_,fe,{projectId:0,contentId:1,playlistId:2,sourceId:3,sourceUrl:4,showUserInterface:5,playerStyle:6,playerTitle:7,callToAction:8,skipButtonStyle:9,playlistStyle:10,playlistToggle:11,mediaSession:12,content:39,contentIndex:13,introsOutros:40,introsOutrosIndex:14,adverts:41,advertIndex:15,persistentAdImage:16,persistentIndex:17,duration:18,currentTime:19,playbackState:20,playbackRate:21,widgetStyle:22,widgetPosition:23,widgetWidth:24,widgetTarget:25,textColor:26,backgroundColor:27,iconColor:28,highlightColor:29,logoIconEnabled:30,highlightSections:31,clickableSections:32,segmentWidgetSections:33,segmentWidgetPosition:34,advertConsent:35,analyticsConsent:36,analyticsCustomUrl:37,analyticsTag:38},null,[-1,-1,-1])}get projectId(){return this.$$.ctx[0]}set projectId(e){this.$$set({projectId:e}),d()}get contentId(){return this.$$.ctx[1]}set contentId(e){this.$$set({contentId:e}),d()}get playlistId(){return this.$$.ctx[2]}set playlistId(e){this.$$set({playlistId:e}),d()}get sourceId(){return this.$$.ctx[3]}set sourceId(e){this.$$set({sourceId:e}),d()}get sourceUrl(){return this.$$.ctx[4]}set sourceUrl(e){this.$$set({sourceUrl:e}),d()}get showUserInterface(){return this.$$.ctx[5]}set showUserInterface(e){this.$$set({showUserInterface:e}),d()}get playerStyle(){return this.$$.ctx[6]}set playerStyle(e){this.$$set({playerStyle:e}),d()}get playerTitle(){return this.$$.ctx[7]}set playerTitle(e){this.$$set({playerTitle:e}),d()}get callToAction(){return this.$$.ctx[8]}set callToAction(e){this.$$set({callToAction:e}),d()}get skipButtonStyle(){return this.$$.ctx[9]}set skipButtonStyle(e){this.$$set({skipButtonStyle:e}),d()}get playlistStyle(){return this.$$.ctx[10]}set playlistStyle(e){this.$$set({playlistStyle:e}),d()}get playlistToggle(){return this.$$.ctx[11]}set playlistToggle(e){this.$$set({playlistToggle:e}),d()}get mediaSession(){return this.$$.ctx[12]}set mediaSession(e){this.$$set({mediaSession:e}),d()}get content(){return this.$$.ctx[39]}set content(e){this.$$set({content:e}),d()}get contentIndex(){return this.$$.ctx[13]}set contentIndex(e){this.$$set({contentIndex:e}),d()}get introsOutros(){return this.$$.ctx[40]}set introsOutros(e){this.$$set({introsOutros:e}),d()}get introsOutrosIndex(){return this.$$.ctx[14]}set introsOutrosIndex(e){this.$$set({introsOutrosIndex:e}),d()}get adverts(){return this.$$.ctx[41]}set adverts(e){this.$$set({adverts:e}),d()}get advertIndex(){return this.$$.ctx[15]}set advertIndex(e){this.$$set({advertIndex:e}),d()}get persistentAdImage(){return this.$$.ctx[16]}set persistentAdImage(e){this.$$set({persistentAdImage:e}),d()}get persistentIndex(){return this.$$.ctx[17]}set persistentIndex(e){this.$$set({persistentIndex:e}),d()}get duration(){return this.$$.ctx[18]}set duration(e){this.$$set({duration:e}),d()}get currentTime(){return this.$$.ctx[19]}set currentTime(e){this.$$set({currentTime:e}),d()}get playbackState(){return this.$$.ctx[20]}set playbackState(e){this.$$set({playbackState:e}),d()}get playbackRate(){return this.$$.ctx[21]}set playbackRate(e){this.$$set({playbackRate:e}),d()}get widgetStyle(){return this.$$.ctx[22]}set widgetStyle(e){this.$$set({widgetStyle:e}),d()}get widgetPosition(){return this.$$.ctx[23]}set widgetPosition(e){this.$$set({widgetPosition:e}),d()}get widgetWidth(){return this.$$.ctx[24]}set widgetWidth(e){this.$$set({widgetWidth:e}),d()}get widgetTarget(){return this.$$.ctx[25]}set widgetTarget(e){this.$$set({widgetTarget:e}),d()}get textColor(){return this.$$.ctx[26]}set textColor(e){this.$$set({textColor:e}),d()}get backgroundColor(){return this.$$.ctx[27]}set backgroundColor(e){this.$$set({backgroundColor:e}),d()}get iconColor(){return this.$$.ctx[28]}set iconColor(e){this.$$set({iconColor:e}),d()}get highlightColor(){return this.$$.ctx[29]}set highlightColor(e){this.$$set({highlightColor:e}),d()}get logoIconEnabled(){return this.$$.ctx[30]}set logoIconEnabled(e){this.$$set({logoIconEnabled:e}),d()}get highlightSections(){return this.$$.ctx[31]}set highlightSections(e){this.$$set({highlightSections:e}),d()}get clickableSections(){return this.$$.ctx[32]}set clickableSections(e){this.$$set({clickableSections:e}),d()}get segmentWidgetSections(){return this.$$.ctx[33]}set segmentWidgetSections(e){this.$$set({segmentWidgetSections:e}),d()}get segmentWidgetPosition(){return this.$$.ctx[34]}set segmentWidgetPosition(e){this.$$set({segmentWidgetPosition:e}),d()}get advertConsent(){return this.$$.ctx[35]}set advertConsent(e){this.$$set({advertConsent:e}),d()}get analyticsConsent(){return this.$$.ctx[36]}set analyticsConsent(e){this.$$set({analyticsConsent:e}),d()}get analyticsCustomUrl(){return this.$$.ctx[37]}set analyticsCustomUrl(e){this.$$set({analyticsCustomUrl:e}),d()}get analyticsTag(){return this.$$.ctx[38]}set analyticsTag(e){this.$$set({analyticsTag:e}),d()}}const r_=(t,e,i)=>{c_(t);const n=new Image;return n.setAttribute("crossorigin","anonymous"),new Promise((s,o)=>{n.addEventListener("load",a_(n,e,i,s,o)),n.addEventListener("error",o),n.src=t})},a_=(t,e,i,n,s)=>()=>{const o=document.createElement("canvas"),l=o.getContext("2d");o.width=e,o.height=i,l.drawImage(t,0,0,e,i),o.toBlob(u_(t,e,i,n,s))},Rn={},u_=(t,e,i,n,s)=>o=>{var r;o||s();const l=URL.createObjectURL(o);Rn[r=t.src]||(Rn[r]=[]),Rn[t.src].push(l),n({src:l,sizes:`${e}x${i}`,type:"image/png"})},c_=t=>{Object.keys(Rn).filter(n=>n!==t).map(n=>Rn[n]).flat().forEach(n=>URL.revokeObjectURL(n))},d_=(t,e,i)=>di(this,null,function*(){t=yield t;const n=t.innerHTML;return{src:`data:image/svg+xml,${encodeURIComponent(n)}`,sizes:`${e}x${i}`,type:"image/svg+xml"}}),g_=(t,e,i)=>Ot(t,e,i,1),f_=(t,e,i)=>Se(t,e,e==="style"?__(i):i),h_=/;(?!([^()]*\([^()]*\))*[^()]*\))/,__=t=>t.split(h_).map(e=>e+" !important").join(";");function er(t,e,i){const n=t.slice();return n[39]=e[i],n[40]=e,n[41]=i,n}function tr(t){let e,i,n,s=t[41],o;i=new Al({props:{fill:t[2],color:t[1],scale:t[39]/18,zoom:.65}});const l=()=>t[36](e,s),r=()=>t[36](null,s);return{c(){e=_("div"),ce(i.$$.fragment),n=K(),g_(e,"display","none")},m(a,c){V(a,e,c),re(i,e,null),g(e,n),l(),o=!0},p(a,c){t=a;const u={};c[0]&4&&(u.fill=t[2]),c[0]&2&&(u.color=t[1]),i.$set(u),s!==t[41]&&(r(),s=t[41],l())},i(a){o||(T(i.$$.fragment,a),o=!0)},o(a){j(i.$$.fragment,a),o=!1},d(a){a&&B(e),ae(i),r()}}}function m_(t){let e,i,n=t[3],s=[];for(let l=0;l<n.length;l+=1)s[l]=tr(er(t,n,l));const o=l=>j(s[l],1,1,()=>{s[l]=null});return{c(){e=_("div");for(let l=0;l<s.length;l+=1)s[l].c();f_(e,"class","media-session")},m(l,r){V(l,e,r);for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(e,null);i=!0},p(l,r){if(r[0]&15){n=l[3];let a;for(a=0;a<n.length;a+=1){const c=er(l,n,a);s[a]?(s[a].p(c,r),T(s[a],1)):(s[a]=tr(c),s[a].c(),T(s[a],1),s[a].m(e,null))}for(De(),a=n.length;a<s.length;a+=1)o(a);Re()}},i(l){if(!i){for(let r=0;r<n.length;r+=1)T(s[r]);i=!0}},o(l){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)j(s[r]);i=!1},d(l){l&&B(e),Xi(s,l)}}}function y_(t,e,i){let n,s,o,l,r,a,c,u,h,m,v,y,p,b,W,z,J,G,E,N,D;const L=[96,128,192,256,384,512],X=["hangup","nextslide","nexttrack","pause","play","previousslide","previoustrack","seekbackward","seekforward","seekto","skipad","stop","togglecamera","togglemicrophone"];let{content:ue=[]}=e,{contentIndex:ve=0}=e,{activeAdvert:ee=void 0}=e,{persistentAdvert:H=void 0}=e,{duration:Y=0}=e,{playbackState:S="stopped"}=e,{skipButtonStyle:P="auto"}=e,{backgroundColor:F="#f5f5f5"}=e,{iconColor:ge="black"}=e,{onEvent:se=()=>{}}=e,I=[],R=new Set,Ae=L.map(()=>{}),we=L.map(()=>{});const qe=()=>i(15,R=R.add(b));function ye(Q,Pe){ie[Q?"unshift":"push"](()=>{Ae[Pe]=Q,i(0,Ae)})}return t.$$set=Q=>{"content"in Q&&i(4,ue=Q.content),"contentIndex"in Q&&i(5,ve=Q.contentIndex),"activeAdvert"in Q&&i(6,ee=Q.activeAdvert),"persistentAdvert"in Q&&i(7,H=Q.persistentAdvert),"duration"in Q&&i(8,Y=Q.duration),"playbackState"in Q&&i(9,S=Q.playbackState),"skipButtonStyle"in Q&&i(10,P=Q.skipButtonStyle),"backgroundColor"in Q&&i(11,F=Q.backgroundColor),"iconColor"in Q&&i(12,ge=Q.iconColor),"onEvent"in Q&&i(13,se=Q.onEvent)},t.$$.update=()=>{t.$$.dirty[0]&512&&i(33,n=S==="stopped"),t.$$.dirty[0]&64|t.$$.dirty[1]&4&&i(34,s=ee&&!n),t.$$.dirty[0]&16&&i(35,o=ue.length>1),t.$$.dirty[0]&48&&i(27,l=ue[ve]),t.$$.dirty[0]&1024|t.$$.dirty[1]&16&&i(19,r=P==="auto"?o?"tracks":"segments":P),t.$$.dirty[0]&524288&&i(21,a=parseFloat(r.split("-")[1]||10)),t.$$.dirty[0]&2621440&&i(18,c=parseFloat(r.split("-")[2]||a)),t.$$.dirty[0]&524288|t.$$.dirty[1]&8&&i(20,u=!s&&r!=="tracks"),t.$$.dirty[0]&524288|t.$$.dirty[1]&8&&i(17,h=!s&&r==="tracks"),t.$$.dirty[1]&8&&i(22,m=!s),t.$$.dirty[0]&2112|t.$$.dirty[1]&8&&i(2,v=s&&(ee==null?void 0:ee.backgroundColor)||F),t.$$.dirty[0]&4160|t.$$.dirty[1]&8&&i(1,y=s&&(ee==null?void 0:ee.iconColor)||ge),t.$$.dirty[0]&7&&i(16,we=L.map((Q,Pe)=>Ta().then(()=>Ae[Pe]))),t.$$.dirty[0]&134217920|t.$$.dirty[1]&12&&i(32,p=s&&ee.imageUrl||!n&&(H==null?void 0:H.imageUrl)||(l==null?void 0:l.imageUrl)),t.$$.dirty[0]&32768|t.$$.dirty[1]&2&&i(28,b=R.has(p)?null:p),t.$$.dirty[0]&268435456&&i(31,W=b?L.map(Q=>r_(b,Q,Q)):[]),t.$$.dirty[0]&268435456&&i(30,z=b?[{src:b,sizes:"any"}]:[]),t.$$.dirty[0]&268500992&&i(29,J=b?[]:L.map((Q,Pe)=>d_(we[Pe],Q,Q))),t.$$.dirty[0]&1610612736|t.$$.dirty[1]&1&&i(26,G=Promise.all([...W,...z,...J])),t.$$.dirty[0]&134217728&&i(25,E=(l==null?void 0:l.title)||""),t.$$.dirty[0]&67108864&&G.then(Q=>i(14,I=Q)).catch(qe),t.$$.dirty[0]&58736640&&(navigator.mediaSession.metadata=new MediaMetadata({title:E,artist:N,album:D,artwork:I})),t.$$.dirty[0]&8192&&navigator.mediaSession.setActionHandler("play",()=>{se(he({type:"PressedPlay",description:"The play button was pressed.",initiatedBy:"media-session-api"}))}),t.$$.dirty[0]&8192&&navigator.mediaSession.setActionHandler("pause",()=>{se(he({type:"PressedPause",description:"The pause button was pressed.",initiatedBy:"media-session-api"}))}),t.$$.dirty[0]&4202752&&navigator.mediaSession.setActionHandler("seekto",m?({seekTime:Q})=>{se(he({type:"ScrubbedProgressBar",description:"The user pressed on the progress bar then dragged.",initiatedBy:"media-session-api",ratio:Math.max(0,Math.min(1,Q/Y))}))}:null),t.$$.dirty[0]&3678208&&navigator.mediaSession.setActionHandler("seekbackward",u?({seekOffset:Q})=>{se(he(r==="seconds"||Q?{type:"PressedSeekBack",description:"The seek backward button was pressed.",initiatedBy:"media-session-api",seconds:Q||a}:{type:"PressedPrevSegment",description:"The previous segment button was pressed.",initiatedBy:"media-session-api"}))}:null),t.$$.dirty[0]&1843200&&navigator.mediaSession.setActionHandler("seekforward",u?({seekOffset:Q})=>{se(he(r==="seconds"||Q?{type:"PressedSeekAhead",description:"The seek ahead button was pressed.",initiatedBy:"media-session-api",seconds:Q||c}:{type:"PressedNextSegment",description:"The next segment button was pressed.",initiatedBy:"media-session-api"}))}:null),t.$$.dirty[0]&139264&&navigator.mediaSession.setActionHandler("previoustrack",h?()=>{se(he({type:"PressedPrevTrack",description:"The previous track button was pressed.",initiatedBy:"media-session-api"}))}:null),t.$$.dirty[0]&139264&&navigator.mediaSession.setActionHandler("nexttrack",h?()=>{se(he({type:"PressedNextTrack",description:"The next track button was pressed.",initiatedBy:"media-session-api"}))}:null)},i(24,N=""),i(23,D=""),navigator.mediaSession.setByPlayer=!0,X.forEach(Q=>{try{navigator.mediaSession.setActionHandler(Q,null)}catch(Pe){}}),[Ae,y,v,L,ue,ve,ee,H,Y,S,P,F,ge,se,I,R,we,h,c,r,u,a,m,D,N,E,G,l,b,J,z,W,p,n,s,o,ye]}class v_ extends pe{constructor(e){super(),ke(this,e,y_,m_,fe,{content:4,contentIndex:5,activeAdvert:6,persistentAdvert:7,duration:8,playbackState:9,skipButtonStyle:10,backgroundColor:11,iconColor:12,onEvent:13},null,[-1,-1])}get content(){return this.$$.ctx[4]}set content(e){this.$$set({content:e}),d()}get contentIndex(){return this.$$.ctx[5]}set contentIndex(e){this.$$set({contentIndex:e}),d()}get activeAdvert(){return this.$$.ctx[6]}set activeAdvert(e){this.$$set({activeAdvert:e}),d()}get persistentAdvert(){return this.$$.ctx[7]}set persistentAdvert(e){this.$$set({persistentAdvert:e}),d()}get duration(){return this.$$.ctx[8]}set duration(e){this.$$set({duration:e}),d()}get playbackState(){return this.$$.ctx[9]}set playbackState(e){this.$$set({playbackState:e}),d()}get skipButtonStyle(){return this.$$.ctx[10]}set skipButtonStyle(e){this.$$set({skipButtonStyle:e}),d()}get backgroundColor(){return this.$$.ctx[11]}set backgroundColor(e){this.$$set({backgroundColor:e}),d()}get iconColor(){return this.$$.ctx[12]}set iconColor(e){this.$$set({iconColor:e}),d()}get onEvent(){return this.$$.ctx[13]}set onEvent(e){this.$$set({onEvent:e}),d()}}const ir=(t,e,i)=>Se(t,e,e==="style"?k_(i):i),b_=/;(?!([^()]*\([^()]*\))*[^()]*\))/,k_=t=>t.split(b_).map(e=>e+" !important").join(";");function nr(t){let e,i,n,s;return{c(){e=_("script"),n=K(),s=_("script"),s.textContent=`window.dataLayer = window.dataLayer || [];
|
|
56
56
|
function gtag() { dataLayer.push(arguments); }
|
|
57
|
-
gtag("js", new Date());`,e.async=!0,hi(e.src,i="https://www.googletagmanager.com/gtag/js?id="+t[0])||ir(e,"src",i)},m(o,l){V(o,e,l),V(o,n,l),V(o,s,l)},p(o,l){l&1&&!hi(e.src,i="https://www.googletagmanager.com/gtag/js?id="+o[0])&&ir(e,"src",i)},d(o){o&&B(e),o&&B(n),o&&B(s)}}}function p_(t){let e,i=!t[1]&&nr(t);return{c(){i&&i.c(),e=mn()},m(n,s){i&&i.m(document.head,null),g(document.head,e)},p(n,[s]){n[1]?i&&(i.d(1),i=null):i?i.p(n,s):(i=nr(n),i.c(),i.m(e.parentNode,e))},i:M,o:M,d(n){i&&i.d(n),B(e)}}}function S_(t,e,i){let n,{analyticsTag:s}=e;return t.$$set=o=>{"analyticsTag"in o&&i(0,s=o.analyticsTag)},i(1,n=window.gtag),[s,n]}class w_ extends pe{constructor(e){super(),ke(this,e,S_,p_,fe,{analyticsTag:0})}get analyticsTag(){return this.$$.ctx[0]}set analyticsTag(e){this.$$set({analyticsTag:e}),d()}}const N3="";class P_ extends pe{constructor(e){super(),ke(this,e,null,null,fe,{})}}class jo{constructor(e,i){Ce(this,$n);Ce(this,Os);this.onSelected=e,this.onDeselected=i,this.consumers={}}addInterest(e,i,...n){var o;(o=this.consumers)[e]||(o[e]=[]);const s=this.consumers[e].slice(-1)[0];this.consumers[e].push({consumerId:i,args:n}),!(s&&O(this,$n,Ho).call(this,n,s.args))&&(s&&this.onDeselected(e,...s.args),this.onSelected(e,...n))}removeInterest(e,i){var l;(l=this.consumers)[e]||(l[e]=[]);const n=this.consumers[e].slice(-1)[0];if(O(this,Os,qr).call(this,this.consumers[e],r=>r.consumerId===i),!(n&&i===n.consumerId))return;const o=this.consumers[e].slice(-1)[0];o&&O(this,$n,Ho).call(this,n.args,o.args)||(this.onDeselected(e,...n.args),o&&this.onSelected(e,...o.args))}}$n=new WeakSet,Ho=function(e,i){return e.length===i.length&&e.every((n,s)=>n===i[s])},Os=new WeakSet,qr=function(e,i){for(let n=e.length-1;n>=0;n-=1)if(i(e[n])){e.splice(n,1);return}};const Gn=(t,e,i)=>{let[n,s]=i.split("-");n||(n="none"),s||(s=n);const o=t==="current"?n:s;return o==="all"||o==="body"&&(e==null?void 0:e.section)==="body"},nn="data-beyondwords-marker",sr=t=>["beyondwords-highlight","bwp",`marker-${t}`],Di=class Di{update(e,i,n,s){const o=Gn(e,i,n),l=this[`prev${e}`],r=o?i==null?void 0:i.marker:null;r&&Pi(Di,es).addInterest(r,this,s),l&&Pi(Di,es).removeInterest(l,this),this[`prev${e}`]=r}};es=new WeakMap,Es=new WeakSet,Hr=function(e,i){const n=document.querySelectorAll(`[${nn}="${e}"]`);for(const s of n){const o=document.createTreeWalker(s,NodeFilter.SHOW_TEXT,null,!1);let l;for(;l=o.nextNode();){if(/^\s*$/.test(l.nodeValue))continue;l.parentNode.nodeName.toLowerCase()==="a"&&(l=l.parentNode);const c=document.createElement("mark");c.classList.add(...sr(e)),c.style.background=i,l.parentNode.insertBefore(c,l),c.appendChild(l)}}},Ls=new WeakSet,Yr=function(e){const i=document.querySelectorAll(`[${nn}="${e}"]`);for(const n of i){const s=n.querySelectorAll(`mark.${sr(e)}`);for(const o of s)for(const l of o.childNodes)o.parentNode.insertBefore(l,o),o.remove()}},Ce(Di,Es),Ce(Di,Ls),Ce(Di,es,new jo(O(Di,Es,Hr),O(Di,Ls,Yr)));let zo=Di;const or=["beyondwords-clickable","bwp"],Ri=class Ri{update(e,i){const n=Gn("hovered",e,i),s=this.previous,o=n?e==null?void 0:e.marker:null;o&&Pi(Ri,ts).addInterest(o,this),s&&Pi(Ri,ts).removeInterest(s,this),this.previous=o}};ts=new WeakMap,xs=new WeakSet,Zr=function(e){const i=document.querySelectorAll(`[${nn}="${e}"]`);for(const n of i)n.classList.add(...or)},Ns=new WeakSet,Kr=function(e){const i=document.querySelectorAll(`[${nn}="${e}"]`);for(const n of i)lr(n,or)},Ce(Ri,xs),Ce(Ri,Ns),Ce(Ri,ts,new jo(O(Ri,xs,Zr),O(Ri,Ns,Kr)));let Mo=Ri;const lr=(t,e)=>{if(!t)return;const s=[...t.classList].filter(o=>!e.includes(o)).some(o=>o.startsWith("beyondwords-"))?e.filter(o=>o!=="bwp"):e;t.classList.remove(...s)},rr=(t,e,i)=>["beyondwords-widget","bwp",`marker-${t}`,`position-${e}`,`for-${i}-player`],ar=["beyondwords-relative","bwp"],Ui=class Ui{constructor(e){this.onUpdate=e,this.containers=[]}update(e,i,n,s){const o=i.includes("all")||i.includes("body"),l=this.previous,r=(e==null?void 0:e.marker)||o&&(l==null?void 0:l.marker);r&&Pi(Ui,is).addInterest(r,this,this,n,s),l&&Pi(Ui,is).removeInterest(l,this),this.previous=r}reset(){this.update(null,"none")}};is=new WeakMap,Ds=new WeakSet,Jr=function(e,i,n,s){const o=document.querySelector(`[${nn}="${e}"]`),l=document.createElement("div");["2-oclock","3-oclock","4-oclock","8-oclock","9-oclock","10-oclock"].includes(n)&&o.classList.add(...ar),l.classList.add(...rr(e,n,s)),["11-oclock","12-oclock","1-oclock"].includes(n)?o.insertBefore(l,o.firstChild):o.appendChild(l),i.containers.push(l),i.onUpdate(i.containers)},Rs=new WeakSet,Gr=function(e,i,n,s){const o=rr(e,n,s);for(let l=0;l<i.containers.length;l+=1){if(!o.every(c=>i.containers[l].classList.contains(c)))continue;const a=i.containers[l].parentNode;lr(a,ar),i.containers[l].remove(),i.containers.splice(l,1),l-=1}i.onUpdate(i.containers)},Ce(Ui,Ds),Ce(Ui,Rs),Ce(Ui,is,new jo(O(Ui,Ds,Jr),O(Ui,Rs,Gr)));let Oo=Ui;const T_=()=>he({type:"IdentifiersChanged",description:"The Player's content identifiers changed.",initiatedBy:"browser"}),vn=(i,...n)=>di(this,[i,...n],function*(t,e={}){const s=yield fetch(t,e).catch(()=>{}),o=yield s==null?void 0:s.json().catch(()=>{});return(s==null?void 0:s.status)!==200&&Jt(`Failed to fetch ${t}`,Ki(Zt({},e),{responseStatus:s==null?void 0:s.status,responseJson:o})),o}),A_=(t,e)=>vn(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e,(i,n)=>n===void 0?null:n)});class C_{constructor(e,i,n){Ce(this,Us);this.baseUrl=O(this,Us,Xr).call(this,e),this.projectId=i,this.writeToken=n}getWebSocketToken(){return di(this,null,function*(){const e={Authorization:`Token token=${this.writeToken}`},{token:i}=yield vn(`https://${this.baseUrl}/api/v4/token/ws`,{headers:e});this.webSocketToken=i})}establishConnection(e,i){return di(this,null,function*(){const n=`wss://${this.baseUrl}/cable?token=${this.webSocketToken}`,s="actioncable-v1-json";this.webSocket=new WebSocket(n,s),this.webSocket.onmessage=o=>e(JSON.parse(o.data)),this.webSocket.onerror=i,yield new Promise(o=>this.webSocket.onopen=o)})}subscribeToStatusChanges(){const e=JSON.stringify({channel:"Api::V1::ProjectChannel",id:this.projectId}),i=JSON.stringify({command:"subscribe",identifier:e});this.webSocket.send(i)}destroy(){this.webSocketToken=null,this.webSocket&&(this.webSocket.onmessage=()=>{},this.webSocket.onerror=()=>{},this.webSocket.close(),this.webSocket=null)}}Us=new WeakSet,Xr=function(e){return e.includes("staging")?"app.staging-beyondwords.io":"app.beyondwords.io"};let bn;const B_=(t,e,i,n)=>di(this,null,function*(){!t||!e||!i||(bn==null||bn.destroy(),bn=new C_(t,e,i),yield bn.getWebSocketToken(),yield bn.establishConnection(I_(n),j_),yield bn.subscribeToStatusChanges())}),I_=t=>e=>{var s,o;((o=(s=e==null?void 0:e.message)==null?void 0:s.result)==null?void 0:o.action)==="podcast_state_updated"&&V_(e,t),e.type==="reject_subscription"&&W_(e)},V_=(t,e)=>{const i=t.message.result;e(he({type:"ContentStatusChanged",description:"The processing status of a content item within the project changed.",initiatedBy:"websocket",contentId:i.content_id,legacyId:i.legacy_id,sourceId:i.source_id,sourceUrl:i.source_url,contentStatus:i.state}))},W_=t=>{Jt("The WebSocket status change subscription was rejected.",{webSocketEvent:t})},j_=t=>{Jt("Unexpected WebSocket error.",{error:t})},ur=t=>{if(!t())return new Promise(e=>{setInterval(()=>t()&&e(),10)})},Ws=t=>{const i=Object.keys(t.$$.props).filter(n=>!z_.has(n)).map(n=>[n,t[n]]);return Object.fromEntries(i)},z_=new Set(["addEventListener","removeEventListener","mediaElement","userInterface","widgetInterface","controller"]),cr=(t,e)=>{const i=new Set([...Object.keys(t),...Object.keys(e)]),n={};for(const s of i){const o=t[s],l=e[s];o!==l&&(n[s]={previousValue:o,currentValue:l})}return n};let Xn=-1;const dr=[],M_=(t,e,i)=>di(this,null,function*(){yield ur(()=>e.player);const n=e.player,s=O_(n.contentIndex,i,t);s>Xn&&E_(n,Xn,s,t),s<Xn&&L_(n,Xn,s),Xn=s}),O_=(t,e,i)=>{const n=i.findIndex(o=>o[0]===t&&o[1]>e||o[0]>t);return n===-1?i.length-1:n-1},E_=(t,e,i,n)=>{for(let s=e+1;s<=i;s+=1){const o=Ws(t);n[s][2](t);const l=Ws(t),r=cr(o,l);dr.push(r)}},L_=(t,e,i)=>{for(let n=e;n>i;n-=1){const s=dr.pop();for(const[o,l]of Object.entries(s))t[o]=l.previousValue}},x_=t=>t?N_(t)?{newTarget:R_(t),showUserInterface:!0}:typeof t=="string"?{newTarget:Eo(t),showUserInterface:!0}:{newTarget:t,showUserInterface:!0}:{newTarget:D_(),showUserInterface:!1},N_=t=>typeof t=="object"&&t.nodeName.toLowerCase()==="script",D_=()=>{const t=document.createElement("div");return document.body.appendChild(t),t},R_=t=>{const e=document.createElement("div");return t.parentNode.insertBefore(e,t.nextSibling),e},Eo=(t,e="player")=>{if(typeof t!="string")return t;const i=document.querySelectorAll(t);return i.length===0&&Jt(`Failed to initialize ${e} because the target could not be found.`,{target:t,elements:i}),i.length>1&&Jt(`Failed to initialize ${e} because the target is ambiguous. (${i.length} elements match)`,{target:t,elements:i}),i[0]};function gr(t,e,i){const n=t.slice();return n[140]=e[i],n}function fr(t){let e,i,n={onEvent:t[53],playerStyle:t[59],callToAction:t[23],skipButtonStyle:t[24],playlistStyle:t[25],playlistToggle:t[26],downloadFormats:t[47],playerTitle:t[22],content:t[48],contentIndex:t[7],duration:t[29],currentTime:t[11],playbackState:t[30],playbackRate:t[31],activeAdvert:t[56],persistentAdvert:t[62],textColor:t[34],backgroundColor:t[35],iconColor:t[36],logoIconEnabled:t[37],videoIsBehind:t[61]};return e=new Vo({props:n}),t[93](e),{c(){ce(e.$$.fragment)},m(s,o){re(e,s,o),i=!0},p(s,o){const l={};o[1]&268435456&&(l.playerStyle=s[59]),o[0]&8388608&&(l.callToAction=s[23]),o[0]&16777216&&(l.skipButtonStyle=s[24]),o[0]&33554432&&(l.playlistStyle=s[25]),o[0]&67108864&&(l.playlistToggle=s[26]),o[1]&65536&&(l.downloadFormats=s[47]),o[0]&4194304&&(l.playerTitle=s[22]),o[1]&131072&&(l.content=s[48]),o[0]&128&&(l.contentIndex=s[7]),o[0]&536870912&&(l.duration=s[29]),o[0]&2048&&(l.currentTime=s[11]),o[0]&1073741824&&(l.playbackState=s[30]),o[1]&1&&(l.playbackRate=s[31]),o[1]&33554432&&(l.activeAdvert=s[56]),o[2]&1&&(l.persistentAdvert=s[62]),o[1]&8&&(l.textColor=s[34]),o[1]&16&&(l.backgroundColor=s[35]),o[1]&32&&(l.iconColor=s[36]),o[1]&64&&(l.logoIconEnabled=s[37]),o[1]&1073741824&&(l.videoIsBehind=s[61]),e.$set(l)},i(s){i||(T(e.$$.fragment,s),i=!0)},o(s){j(e.$$.fragment,s),i=!1},d(s){t[93](null),ae(e,s)}}}function hr(t){let e,i;return e=new Wo({props:{root:t[13],$$slots:{default:[U_]},$$scope:{ctx:t}}}),{c(){ce(e.$$.fragment)},m(n,s){re(e,n,s),i=!0},p(n,s){const o={};s[0]&8192&&(o.root=n[13]),s[0]&1639987328|s[1]&167977087|s[2]&1|s[4]&524288&&(o.$$scope={dirty:s,ctx:n}),e.$set(o)},i(n){i||(T(e.$$.fragment,n),i=!0)},o(n){j(e.$$.fragment,n),i=!1},d(n){ae(e,n)}}}function U_(t){let e,i,n={onEvent:t[53],playerStyle:t[12],callToAction:t[23],skipButtonStyle:t[24],playlistStyle:"hide",playlistToggle:"hide",downloadFormats:t[47],playerTitle:t[22],fixedPosition:!t[13]&&t[32],fixedWidth:t[33],content:t[48],contentIndex:t[7],duration:t[29],currentTime:t[11],playbackState:t[30],playbackRate:t[31],activeAdvert:t[56],persistentAdvert:t[62],textColor:t[34],backgroundColor:t[35],iconColor:t[36],logoIconEnabled:t[37],videoIsBehind:t[58]};return e=new Vo({props:n}),t[94](e),{c(){ce(e.$$.fragment)},m(s,o){re(e,s,o),i=!0},p(s,o){const l={};o[0]&4096&&(l.playerStyle=s[12]),o[0]&8388608&&(l.callToAction=s[23]),o[0]&16777216&&(l.skipButtonStyle=s[24]),o[1]&65536&&(l.downloadFormats=s[47]),o[0]&4194304&&(l.playerTitle=s[22]),o[0]&8192|o[1]&2&&(l.fixedPosition=!s[13]&&s[32]),o[1]&4&&(l.fixedWidth=s[33]),o[1]&131072&&(l.content=s[48]),o[0]&128&&(l.contentIndex=s[7]),o[0]&536870912&&(l.duration=s[29]),o[0]&2048&&(l.currentTime=s[11]),o[0]&1073741824&&(l.playbackState=s[30]),o[1]&1&&(l.playbackRate=s[31]),o[1]&33554432&&(l.activeAdvert=s[56]),o[2]&1&&(l.persistentAdvert=s[62]),o[1]&8&&(l.textColor=s[34]),o[1]&16&&(l.backgroundColor=s[35]),o[1]&32&&(l.iconColor=s[36]),o[1]&64&&(l.logoIconEnabled=s[37]),o[1]&134217728&&(l.videoIsBehind=s[58]),e.$set(l)},i(s){i||(T(e.$$.fragment,s),i=!0)},o(s){j(e.$$.fragment,s),i=!1},d(s){t[94](null),ae(e,s)}}}function F_(t){let e,i;return e=new Vo({props:{onEvent:t[95],playerStyle:"small",fixedWidth:0,logoIconEnabled:!1,content:t[48],contentIndex:t[7],duration:t[29],currentTime:t[60]?t[11]:t[54].startTime,playbackState:t[60]?t[30]:"paused",activeAdvert:t[56],persistentAdvert:t[62],textColor:t[34],backgroundColor:t[35],iconColor:t[36]}}),{c(){ce(e.$$.fragment)},m(n,s){re(e,n,s),i=!0},p(n,s){const o={};s[1]&75497472&&(o.onEvent=n[95]),s[1]&131072&&(o.content=n[48]),s[0]&128&&(o.contentIndex=n[7]),s[0]&536870912&&(o.duration=n[29]),s[0]&2048|s[1]&545259520&&(o.currentTime=n[60]?n[11]:n[54].startTime),s[0]&1073741824|s[1]&536870912&&(o.playbackState=n[60]?n[30]:"paused"),s[1]&33554432&&(o.activeAdvert=n[56]),s[2]&1&&(o.persistentAdvert=n[62]),s[1]&8&&(o.textColor=n[34]),s[1]&16&&(o.backgroundColor=n[35]),s[1]&32&&(o.iconColor=n[36]),e.$set(o)},i(n){i||(T(e.$$.fragment,n),i=!0)},o(n){j(e.$$.fragment,n),i=!1},d(n){ae(e,n)}}}function _r(t,e){let i,n,s;return n=new Wo({props:{root:e[140],$$slots:{default:[F_]},$$scope:{ctx:e}}}),{key:t,first:null,c(){i=mn(),ce(n.$$.fragment),this.first=i},m(o,l){V(o,i,l),re(n,o,l),s=!0},p(o,l){e=o;const r={};l[1]&32768&&(r.root=e[140]),l[0]&1610614912|l[1]&646053944|l[2]&1|l[4]&524288&&(r.$$scope={dirty:l,ctx:e}),n.$set(r)},i(o){s||(T(n.$$.fragment,o),s=!0)},o(o){j(n.$$.fragment,o),s=!1},d(o){o&&B(i),ae(n,o)}}}function mr(t){let e,i;return e=new Wo({props:{root:t[21],$$slots:{default:[q_]},$$scope:{ctx:t}}}),{c(){ce(e.$$.fragment)},m(n,s){re(e,n,s),i=!0},p(n,s){const o={};s[0]&2097152&&(o.root=n[21]),s[0]&2145386495|s[1]&919551|s[4]&524288&&(o.$$scope={dirty:s,ctx:n}),e.$set(o)},i(n){i||(T(e.$$.fragment,n),i=!0)},o(n){j(e.$$.fragment,n),i=!1},d(n){ae(e,n)}}}function q_(t){let e,i,n,s,o,l,r,a,c,u,h,m,v,y,p,b,W,z,J,G,E,N,D,L,X,ue,ve,ee,H,Y,S,P,F,ge,se,I,R,Ae,we,qe,ye,Q,Pe;function Qe(w){t[96](w)}function Ne(w){t[97](w)}function dt(w){t[98](w)}function Ye(w){t[99](w)}function We(w){t[100](w)}function tt(w){t[101](w)}function je(w){t[102](w)}function it(w){t[103](w)}function Ee(w){t[104](w)}function Ze(w){t[105](w)}function Ke(w){t[106](w)}function nt(w){t[107](w)}function Ve(w){t[108](w)}function ze(w){t[109](w)}function U(w){t[110](w)}function xe(w){t[111](w)}function gt(w){t[112](w)}function bt(w){t[113](w)}function Je(w){t[114](w)}function Ge(w){t[115](w)}function st(w){t[116](w)}function $e(w){t[117](w)}function Pt(w){t[118](w)}function ot(w){t[119](w)}function kt(w){t[120](w)}function lt(w){t[121](w)}function rt(w){t[122](w)}function at(w){t[123](w)}function Vt(w){t[124](w)}function ft(w){t[125](w)}function zt(w){t[126](w)}function ht(w){t[127](w)}function At(w){t[128](w)}function Z(w){t[129](w)}function Xe(w){t[130](w)}function He(w){t[131](w)}function Ct(w){t[132](w)}function Bt(w){t[133](w)}function Rt(w){t[134](w)}function It(w){t[135](w)}function Yt(w){t[136](w)}let ne={content:t[48],introsOutros:t[49],adverts:t[50]};return t[0]!==void 0&&(ne.projectId=t[0]),t[1]!==void 0&&(ne.contentId=t[1]),t[2]!==void 0&&(ne.playlistId=t[2]),t[3]!==void 0&&(ne.sourceId=t[3]),t[4]!==void 0&&(ne.sourceUrl=t[4]),t[5]!==void 0&&(ne.showUserInterface=t[5]),t[6]!==void 0&&(ne.playerStyle=t[6]),t[22]!==void 0&&(ne.playerTitle=t[22]),t[23]!==void 0&&(ne.callToAction=t[23]),t[24]!==void 0&&(ne.skipButtonStyle=t[24]),t[25]!==void 0&&(ne.playlistStyle=t[25]),t[26]!==void 0&&(ne.playlistToggle=t[26]),t[27]!==void 0&&(ne.mediaSession=t[27]),t[7]!==void 0&&(ne.contentIndex=t[7]),t[8]!==void 0&&(ne.introsOutrosIndex=t[8]),t[9]!==void 0&&(ne.advertIndex=t[9]),t[28]!==void 0&&(ne.persistentAdImage=t[28]),t[10]!==void 0&&(ne.persistentIndex=t[10]),t[29]!==void 0&&(ne.duration=t[29]),t[11]!==void 0&&(ne.currentTime=t[11]),t[30]!==void 0&&(ne.playbackState=t[30]),t[31]!==void 0&&(ne.playbackRate=t[31]),t[12]!==void 0&&(ne.widgetStyle=t[12]),t[32]!==void 0&&(ne.widgetPosition=t[32]),t[33]!==void 0&&(ne.widgetWidth=t[33]),t[13]!==void 0&&(ne.widgetTarget=t[13]),t[34]!==void 0&&(ne.textColor=t[34]),t[35]!==void 0&&(ne.backgroundColor=t[35]),t[36]!==void 0&&(ne.iconColor=t[36]),t[14]!==void 0&&(ne.highlightColor=t[14]),t[37]!==void 0&&(ne.logoIconEnabled=t[37]),t[15]!==void 0&&(ne.highlightSections=t[15]),t[16]!==void 0&&(ne.clickableSections=t[16]),t[17]!==void 0&&(ne.segmentWidgetSections=t[17]),t[18]!==void 0&&(ne.segmentWidgetPosition=t[18]),t[19]!==void 0&&(ne.currentSegment=t[19]),t[20]!==void 0&&(ne.hoveredSegment=t[20]),t[38]!==void 0&&(ne.advertConsent=t[38]),t[39]!==void 0&&(ne.analyticsConsent=t[39]),t[40]!==void 0&&(ne.analyticsCustomUrl=t[40]),t[41]!==void 0&&(ne.analyticsTag=t[41]),e=new l_({props:ne}),ie.push(()=>me(e,"projectId",Qe)),ie.push(()=>me(e,"contentId",Ne)),ie.push(()=>me(e,"playlistId",dt)),ie.push(()=>me(e,"sourceId",Ye)),ie.push(()=>me(e,"sourceUrl",We)),ie.push(()=>me(e,"showUserInterface",tt)),ie.push(()=>me(e,"playerStyle",je)),ie.push(()=>me(e,"playerTitle",it)),ie.push(()=>me(e,"callToAction",Ee)),ie.push(()=>me(e,"skipButtonStyle",Ze)),ie.push(()=>me(e,"playlistStyle",Ke)),ie.push(()=>me(e,"playlistToggle",nt)),ie.push(()=>me(e,"mediaSession",Ve)),ie.push(()=>me(e,"contentIndex",ze)),ie.push(()=>me(e,"introsOutrosIndex",U)),ie.push(()=>me(e,"advertIndex",xe)),ie.push(()=>me(e,"persistentAdImage",gt)),ie.push(()=>me(e,"persistentIndex",bt)),ie.push(()=>me(e,"duration",Je)),ie.push(()=>me(e,"currentTime",Ge)),ie.push(()=>me(e,"playbackState",st)),ie.push(()=>me(e,"playbackRate",$e)),ie.push(()=>me(e,"widgetStyle",Pt)),ie.push(()=>me(e,"widgetPosition",ot)),ie.push(()=>me(e,"widgetWidth",kt)),ie.push(()=>me(e,"widgetTarget",lt)),ie.push(()=>me(e,"textColor",rt)),ie.push(()=>me(e,"backgroundColor",at)),ie.push(()=>me(e,"iconColor",Vt)),ie.push(()=>me(e,"highlightColor",ft)),ie.push(()=>me(e,"logoIconEnabled",zt)),ie.push(()=>me(e,"highlightSections",ht)),ie.push(()=>me(e,"clickableSections",At)),ie.push(()=>me(e,"segmentWidgetSections",Z)),ie.push(()=>me(e,"segmentWidgetPosition",Xe)),ie.push(()=>me(e,"currentSegment",He)),ie.push(()=>me(e,"hoveredSegment",Ct)),ie.push(()=>me(e,"advertConsent",Bt)),ie.push(()=>me(e,"analyticsConsent",Rt)),ie.push(()=>me(e,"analyticsCustomUrl",It)),ie.push(()=>me(e,"analyticsTag",Yt)),{c(){ce(e.$$.fragment)},m(w,A){re(e,w,A),Pe=!0},p(w,A){const te={};A[1]&131072&&(te.content=w[48]),A[1]&262144&&(te.introsOutros=w[49]),A[1]&524288&&(te.adverts=w[50]),!i&&A[0]&1&&(i=!0,te.projectId=w[0],_e(()=>i=!1)),!n&&A[0]&2&&(n=!0,te.contentId=w[1],_e(()=>n=!1)),!s&&A[0]&4&&(s=!0,te.playlistId=w[2],_e(()=>s=!1)),!o&&A[0]&8&&(o=!0,te.sourceId=w[3],_e(()=>o=!1)),!l&&A[0]&16&&(l=!0,te.sourceUrl=w[4],_e(()=>l=!1)),!r&&A[0]&32&&(r=!0,te.showUserInterface=w[5],_e(()=>r=!1)),!a&&A[0]&64&&(a=!0,te.playerStyle=w[6],_e(()=>a=!1)),!c&&A[0]&4194304&&(c=!0,te.playerTitle=w[22],_e(()=>c=!1)),!u&&A[0]&8388608&&(u=!0,te.callToAction=w[23],_e(()=>u=!1)),!h&&A[0]&16777216&&(h=!0,te.skipButtonStyle=w[24],_e(()=>h=!1)),!m&&A[0]&33554432&&(m=!0,te.playlistStyle=w[25],_e(()=>m=!1)),!v&&A[0]&67108864&&(v=!0,te.playlistToggle=w[26],_e(()=>v=!1)),!y&&A[0]&134217728&&(y=!0,te.mediaSession=w[27],_e(()=>y=!1)),!p&&A[0]&128&&(p=!0,te.contentIndex=w[7],_e(()=>p=!1)),!b&&A[0]&256&&(b=!0,te.introsOutrosIndex=w[8],_e(()=>b=!1)),!W&&A[0]&512&&(W=!0,te.advertIndex=w[9],_e(()=>W=!1)),!z&&A[0]&268435456&&(z=!0,te.persistentAdImage=w[28],_e(()=>z=!1)),!J&&A[0]&1024&&(J=!0,te.persistentIndex=w[10],_e(()=>J=!1)),!G&&A[0]&536870912&&(G=!0,te.duration=w[29],_e(()=>G=!1)),!E&&A[0]&2048&&(E=!0,te.currentTime=w[11],_e(()=>E=!1)),!N&&A[0]&1073741824&&(N=!0,te.playbackState=w[30],_e(()=>N=!1)),!D&&A[1]&1&&(D=!0,te.playbackRate=w[31],_e(()=>D=!1)),!L&&A[0]&4096&&(L=!0,te.widgetStyle=w[12],_e(()=>L=!1)),!X&&A[1]&2&&(X=!0,te.widgetPosition=w[32],_e(()=>X=!1)),!ue&&A[1]&4&&(ue=!0,te.widgetWidth=w[33],_e(()=>ue=!1)),!ve&&A[0]&8192&&(ve=!0,te.widgetTarget=w[13],_e(()=>ve=!1)),!ee&&A[1]&8&&(ee=!0,te.textColor=w[34],_e(()=>ee=!1)),!H&&A[1]&16&&(H=!0,te.backgroundColor=w[35],_e(()=>H=!1)),!Y&&A[1]&32&&(Y=!0,te.iconColor=w[36],_e(()=>Y=!1)),!S&&A[0]&16384&&(S=!0,te.highlightColor=w[14],_e(()=>S=!1)),!P&&A[1]&64&&(P=!0,te.logoIconEnabled=w[37],_e(()=>P=!1)),!F&&A[0]&32768&&(F=!0,te.highlightSections=w[15],_e(()=>F=!1)),!ge&&A[0]&65536&&(ge=!0,te.clickableSections=w[16],_e(()=>ge=!1)),!se&&A[0]&131072&&(se=!0,te.segmentWidgetSections=w[17],_e(()=>se=!1)),!I&&A[0]&262144&&(I=!0,te.segmentWidgetPosition=w[18],_e(()=>I=!1)),!R&&A[0]&524288&&(R=!0,te.currentSegment=w[19],_e(()=>R=!1)),!Ae&&A[0]&1048576&&(Ae=!0,te.hoveredSegment=w[20],_e(()=>Ae=!1)),!we&&A[1]&128&&(we=!0,te.advertConsent=w[38],_e(()=>we=!1)),!qe&&A[1]&256&&(qe=!0,te.analyticsConsent=w[39],_e(()=>qe=!1)),!ye&&A[1]&512&&(ye=!0,te.analyticsCustomUrl=w[40],_e(()=>ye=!1)),!Q&&A[1]&1024&&(Q=!0,te.analyticsTag=w[41],_e(()=>Q=!1)),e.$set(te)},i(w){Pe||(T(e.$$.fragment,w),Pe=!0)},o(w){j(e.$$.fragment,w),Pe=!1},d(w){ae(e,w)}}}function yr(t){let e,i;return e=new v_({props:{onEvent:t[53],content:t[48],contentIndex:t[7],activeAdvert:t[56],persistentAdvert:t[62],duration:t[29],playbackState:t[30],skipButtonStyle:t[24],backgroundColor:t[35],iconColor:t[36]}}),{c(){ce(e.$$.fragment)},m(n,s){re(e,n,s),i=!0},p(n,s){const o={};s[1]&131072&&(o.content=n[48]),s[0]&128&&(o.contentIndex=n[7]),s[1]&33554432&&(o.activeAdvert=n[56]),s[2]&1&&(o.persistentAdvert=n[62]),s[0]&536870912&&(o.duration=n[29]),s[0]&1073741824&&(o.playbackState=n[30]),s[0]&16777216&&(o.skipButtonStyle=n[24]),s[1]&16&&(o.backgroundColor=n[35]),s[1]&32&&(o.iconColor=n[36]),e.$set(o)},i(n){i||(T(e.$$.fragment,n),i=!0)},o(n){j(e.$$.fragment,n),i=!1},d(n){ae(e,n)}}}function vr(t){let e,i;return e=new w_({props:{analyticsTag:t[41]}}),{c(){ce(e.$$.fragment)},m(n,s){re(e,n,s),i=!0},p(n,s){const o={};s[1]&1024&&(o.analyticsTag=n[41]),e.$set(o)},i(n){i||(T(e.$$.fragment,n),i=!0)},o(n){j(e.$$.fragment,n),i=!1},d(n){ae(e,n)}}}function H_(t){let e,i,n,s,o,l,r,a,c,u=[],h=new Map,m,v,y,p,b,W;function z(S){t[88](S)}function J(S){t[89](S)}function G(S){t[90](S)}function E(S){t[91](S)}function N(S){t[92](S)}let D={onEvent:t[53],content:t[48],contentIndex:t[7],introOrOutro:t[55],activeAdvert:t[56],advertConsent:t[38],videoBehindWidget:t[58],videoBehindStatic:t[61],widgetPosition:t[32],widgetWidth:t[33]};t[30]!==void 0&&(D.playbackState=t[30]),t[29]!==void 0&&(D.duration=t[29]),t[11]!==void 0&&(D.currentTime=t[11]),t[31]!==void 0&&(D.playbackRate=t[31]),t[45]!==void 0&&(D.prevPercentage=t[45]),e=new hd({props:D}),t[87](e),ie.push(()=>me(e,"playbackState",z)),ie.push(()=>me(e,"duration",J)),ie.push(()=>me(e,"currentTime",G)),ie.push(()=>me(e,"playbackRate",E)),ie.push(()=>me(e,"prevPercentage",N));let L=t[5]&&fr(t),X=(t[51]||t[13])&&hr(t),ue=t[46];const ve=S=>S[140];for(let S=0;S<ue.length;S+=1){let P=gr(t,ue,S),F=ve(P);h.set(F,u[S]=_r(F,P))}let ee=t[21]&&mr(t),H=t[52]&&yr(t),Y=t[41]&&vr(t);return b=new P_({}),{c(){ce(e.$$.fragment),r=K(),L&&L.c(),a=K(),X&&X.c(),c=K();for(let S=0;S<u.length;S+=1)u[S].c();m=K(),ee&&ee.c(),v=K(),H&&H.c(),y=K(),Y&&Y.c(),p=K(),ce(b.$$.fragment)},m(S,P){re(e,S,P),V(S,r,P),L&&L.m(S,P),V(S,a,P),X&&X.m(S,P),V(S,c,P);for(let F=0;F<u.length;F+=1)u[F]&&u[F].m(S,P);V(S,m,P),ee&&ee.m(S,P),V(S,v,P),H&&H.m(S,P),V(S,y,P),Y&&Y.m(S,P),V(S,p,P),re(b,S,P),W=!0},p(S,P){const F={};P[1]&131072&&(F.content=S[48]),P[0]&128&&(F.contentIndex=S[7]),P[1]&16777216&&(F.introOrOutro=S[55]),P[1]&33554432&&(F.activeAdvert=S[56]),P[1]&128&&(F.advertConsent=S[38]),P[1]&134217728&&(F.videoBehindWidget=S[58]),P[1]&1073741824&&(F.videoBehindStatic=S[61]),P[1]&2&&(F.widgetPosition=S[32]),P[1]&4&&(F.widgetWidth=S[33]),!i&&P[0]&1073741824&&(i=!0,F.playbackState=S[30],_e(()=>i=!1)),!n&&P[0]&536870912&&(n=!0,F.duration=S[29],_e(()=>n=!1)),!s&&P[0]&2048&&(s=!0,F.currentTime=S[11],_e(()=>s=!1)),!o&&P[1]&1&&(o=!0,F.playbackRate=S[31],_e(()=>o=!1)),!l&&P[1]&16384&&(l=!0,F.prevPercentage=S[45],_e(()=>l=!1)),e.$set(F),S[5]?L?(L.p(S,P),P[0]&32&&T(L,1)):(L=fr(S),L.c(),T(L,1),L.m(a.parentNode,a)):L&&(De(),j(L,1,1,()=>{L=null}),Re()),S[51]||S[13]?X?(X.p(S,P),P[0]&8192|P[1]&1048576&&T(X,1)):(X=hr(S),X.c(),T(X,1),X.m(c.parentNode,c)):X&&(De(),j(X,1,1,()=>{X=null}),Re()),P[0]&1610614912|P[1]&650281016|P[2]&1&&(ue=S[46],De(),u=Wa(u,P,ve,1,S,ue,h,m.parentNode,Va,_r,m,gr),Re()),S[21]?ee?(ee.p(S,P),P[0]&2097152&&T(ee,1)):(ee=mr(S),ee.c(),T(ee,1),ee.m(v.parentNode,v)):ee&&(De(),j(ee,1,1,()=>{ee=null}),Re()),S[52]?H?(H.p(S,P),P[1]&2097152&&T(H,1)):(H=yr(S),H.c(),T(H,1),H.m(y.parentNode,y)):H&&(De(),j(H,1,1,()=>{H=null}),Re()),S[41]?Y?(Y.p(S,P),P[1]&1024&&T(Y,1)):(Y=vr(S),Y.c(),T(Y,1),Y.m(p.parentNode,p)):Y&&(De(),j(Y,1,1,()=>{Y=null}),Re())},i(S){if(!W){T(e.$$.fragment,S),T(L),T(X);for(let P=0;P<ue.length;P+=1)T(u[P]);T(ee),T(H),T(Y),T(b.$$.fragment,S),W=!0}},o(S){j(e.$$.fragment,S),j(L),j(X);for(let P=0;P<u.length;P+=1)j(u[P]);j(ee),j(H),j(Y),j(b.$$.fragment,S),W=!1},d(S){t[87](null),ae(e,S),S&&B(r),L&&L.d(S),S&&B(a),X&&X.d(S),S&&B(c);for(let P=0;P<u.length;P+=1)u[P].d(S);S&&B(m),ee&&ee.d(S),S&&B(v),H&&H.d(S),S&&B(y),Y&&Y.d(S),S&&B(p),ae(b,S)}}}function Y_(t,e,i){let n,s,o,l,r,a,c,u,h,m,v,y,p,{playerApiUrl:b="https://api.beyondwords.io/v1/projects/{id}/player"}=e,{projectId:W=void 0}=e,{contentId:z=void 0}=e,{playlistId:J=void 0}=e,{sourceId:G=void 0}=e,{sourceUrl:E=void 0}=e,{playlist:N=[]}=e,{showUserInterface:D=!0}=e,{playerStyle:L="standard"}=e,{playerTitle:X=void 0}=e,{callToAction:ue=void 0}=e,{skipButtonStyle:ve="auto"}=e,{playlistStyle:ee="auto-5-4"}=e,{playlistToggle:H="auto"}=e,{downloadFormats:Y=[]}=e,{mediaSession:S="auto"}=e,{content:P=[]}=e,{contentIndex:F=0}=e,{introsOutros:ge=[]}=e,{introsOutrosIndex:se=-1}=e,{adverts:I=[]}=e,{advertIndex:R=-1}=e,{persistentAdImage:Ae=!1}=e,{persistentIndex:we=-1}=e,{duration:qe=0}=e,{currentTime:ye=0}=e,{playbackState:Q="stopped"}=e,{playbackRate:Pe=1}=e,{playbackRates:Qe=[.5,.6,.7,.8,.9,1,1.1,1.2,1.3,1.4,1.5,2,2.5,3]}=e,{widgetStyle:Ne="standard"}=e,{widgetPosition:dt="auto"}=e,{widgetWidth:Ye="auto"}=e,{widgetTarget:We=void 0}=e,{textColor:tt="#111"}=e,{backgroundColor:je="#f5f5f5"}=e,{iconColor:it="rgba(0, 0, 0, 0.8)"}=e,{highlightColor:Ee="#eee"}=e,{logoIconEnabled:Ze=!0}=e,{highlightSections:Ke="all"}=e,{clickableSections:nt="all"}=e,{segmentWidgetSections:Ve="body"}=e,{segmentWidgetPosition:ze="7-oclock"}=e,{currentSegment:U=void 0}=e,{hoveredSegment:xe=void 0}=e,{loadedMedia:gt=void 0}=e,{advertConsent:bt="personalized"}=e,{analyticsConsent:Je="allowed"}=e,{analyticsCustomUrl:Ge=void 0}=e,{analyticsTag:st=void 0}=e,{writeToken:$e=void 0}=e,{captureErrors:Pt=!0}=e,{onError:ot=()=>{}}=e,{transitions:kt=[]}=e,{controlPanel:lt=void 0}=e;const rt=(...f)=>He.addEventListener(...f),at=(...f)=>He.removeEventListener(...f);let{initialProps:Vt={}}=e,{showBottomWidget:ft=!1}=e,{showMediaSession:zt=!1}=e,{isFullScreen:ht=!1}=e,{mediaElement:At=void 0}=e,{userInterface:Z=void 0}=e,{widgetInterface:Xe=void 0}=e,{controller:He=void 0}=e,{analyticsUrl:Ct=void 0}=e,{analyticsId:Bt=void 0}=e,{listenSessionId:Rt=void 0}=e,{sessionCreatedAt:It=void 0}=e,{isNewListen:Yt=!1}=e,{prevPercentage:ne=0}=e,{segmentWidgets:w=[]}=e,{segmentContainers:A=new Oo(f=>i(46,w=f))}=e,{segmentClickables:te=new Mo}=e,{segmentHighlights:mi=new zo}=e;const Ut=f=>He.processEvent(Zt({emittedFrom:r},f)),Sn=()=>i(85,u=xe);function _t(f){ie[f?"unshift":"push"](()=>{At=f,i(42,At)})}function yi(f){Q=f,i(30,Q)}function si(f){qe=f,i(29,qe)}function vi(f){ye=f,i(11,ye)}function Gt(f){Pe=f,i(31,Pe)}function bi(f){ne=f,i(45,ne)}function Mi(f){ie[f?"unshift":"push"](()=>{Z=f,i(43,Z)})}function oi(f){ie[f?"unshift":"push"](()=>{Xe=f,i(44,Xe)})}const Xt=f=>Ut(Ki(Zt({},f),{emittedFrom:"segment-widget",widgetSegment:v,widgetIsCurrent:y}));function ki(f){W=f,i(0,W)}function Oi(f){z=f,i(1,z)}function li(f){J=f,i(2,J)}function Wt(f){G=f,i(3,G)}function pi(f){E=f,i(4,E)}function Qt(f){D=f,i(5,D)}function ut(f){L=f,i(6,L)}function $t(f){X=f,i(22,X)}function ct(f){ue=f,i(23,ue)}function Si(f){ve=f,i(24,ve)}function mt(f){ee=f,i(25,ee)}function k(f){H=f,i(26,H)}function q(f){S=f,i(27,S)}function oe(f){F=f,i(7,F)}function Ft(f){se=f,i(8,se)}function on(f){R=f,i(9,R)}function ln(f){Ae=f,i(28,Ae)}function rn(f){we=f,i(10,we)}function to(f){qe=f,i(29,qe)}function wn(f){ye=f,i(11,ye)}function io(f){Q=f,i(30,Q)}function ei(f){Pe=f,i(31,Pe)}function an(f){Ne=f,i(12,Ne)}function un(f){dt=f,i(32,dt)}function cn(f){Ye=f,i(33,Ye)}function dn(f){We=f,i(13,We)}function gn(f){tt=f,i(34,tt)}function no(f){je=f,i(35,je)}function Pn(f){it=f,i(36,it)}function so(f){Ee=f,i(14,Ee)}function wi(f){Ze=f,i(37,Ze)}function oo(f){Ke=f,i(15,Ke)}function rs(f){nt=f,i(16,nt)}function lo(f){Ve=f,i(17,Ve)}function ro(f){ze=f,i(18,ze)}function as(f){U=f,i(19,U)}function ao(f){xe=f,i(20,xe)}function fn(f){bt=f,i(38,bt)}function qt(f){Je=f,i(39,Je)}function Uo(f){Ge=f,i(40,Ge)}function Tn(f){st=f,i(41,st)}return t.$$set=f=>{"playerApiUrl"in f&&i(63,b=f.playerApiUrl),"projectId"in f&&i(0,W=f.projectId),"contentId"in f&&i(1,z=f.contentId),"playlistId"in f&&i(2,J=f.playlistId),"sourceId"in f&&i(3,G=f.sourceId),"sourceUrl"in f&&i(4,E=f.sourceUrl),"playlist"in f&&i(64,N=f.playlist),"showUserInterface"in f&&i(5,D=f.showUserInterface),"playerStyle"in f&&i(6,L=f.playerStyle),"playerTitle"in f&&i(22,X=f.playerTitle),"callToAction"in f&&i(23,ue=f.callToAction),"skipButtonStyle"in f&&i(24,ve=f.skipButtonStyle),"playlistStyle"in f&&i(25,ee=f.playlistStyle),"playlistToggle"in f&&i(26,H=f.playlistToggle),"downloadFormats"in f&&i(47,Y=f.downloadFormats),"mediaSession"in f&&i(27,S=f.mediaSession),"content"in f&&i(48,P=f.content),"contentIndex"in f&&i(7,F=f.contentIndex),"introsOutros"in f&&i(49,ge=f.introsOutros),"introsOutrosIndex"in f&&i(8,se=f.introsOutrosIndex),"adverts"in f&&i(50,I=f.adverts),"advertIndex"in f&&i(9,R=f.advertIndex),"persistentAdImage"in f&&i(28,Ae=f.persistentAdImage),"persistentIndex"in f&&i(10,we=f.persistentIndex),"duration"in f&&i(29,qe=f.duration),"currentTime"in f&&i(11,ye=f.currentTime),"playbackState"in f&&i(30,Q=f.playbackState),"playbackRate"in f&&i(31,Pe=f.playbackRate),"playbackRates"in f&&i(65,Qe=f.playbackRates),"widgetStyle"in f&&i(12,Ne=f.widgetStyle),"widgetPosition"in f&&i(32,dt=f.widgetPosition),"widgetWidth"in f&&i(33,Ye=f.widgetWidth),"widgetTarget"in f&&i(13,We=f.widgetTarget),"textColor"in f&&i(34,tt=f.textColor),"backgroundColor"in f&&i(35,je=f.backgroundColor),"iconColor"in f&&i(36,it=f.iconColor),"highlightColor"in f&&i(14,Ee=f.highlightColor),"logoIconEnabled"in f&&i(37,Ze=f.logoIconEnabled),"highlightSections"in f&&i(15,Ke=f.highlightSections),"clickableSections"in f&&i(16,nt=f.clickableSections),"segmentWidgetSections"in f&&i(17,Ve=f.segmentWidgetSections),"segmentWidgetPosition"in f&&i(18,ze=f.segmentWidgetPosition),"currentSegment"in f&&i(19,U=f.currentSegment),"hoveredSegment"in f&&i(20,xe=f.hoveredSegment),"loadedMedia"in f&&i(66,gt=f.loadedMedia),"advertConsent"in f&&i(38,bt=f.advertConsent),"analyticsConsent"in f&&i(39,Je=f.analyticsConsent),"analyticsCustomUrl"in f&&i(40,Ge=f.analyticsCustomUrl),"analyticsTag"in f&&i(41,st=f.analyticsTag),"writeToken"in f&&i(67,$e=f.writeToken),"captureErrors"in f&&i(68,Pt=f.captureErrors),"onError"in f&&i(69,ot=f.onError),"transitions"in f&&i(70,kt=f.transitions),"controlPanel"in f&&i(21,lt=f.controlPanel),"initialProps"in f&&i(73,Vt=f.initialProps),"showBottomWidget"in f&&i(51,ft=f.showBottomWidget),"showMediaSession"in f&&i(52,zt=f.showMediaSession),"isFullScreen"in f&&i(74,ht=f.isFullScreen),"mediaElement"in f&&i(42,At=f.mediaElement),"userInterface"in f&&i(43,Z=f.userInterface),"widgetInterface"in f&&i(44,Xe=f.widgetInterface),"controller"in f&&i(75,He=f.controller),"analyticsUrl"in f&&i(76,Ct=f.analyticsUrl),"analyticsId"in f&&i(77,Bt=f.analyticsId),"listenSessionId"in f&&i(78,Rt=f.listenSessionId),"sessionCreatedAt"in f&&i(79,It=f.sessionCreatedAt),"isNewListen"in f&&i(80,Yt=f.isNewListen),"prevPercentage"in f&&i(45,ne=f.prevPercentage),"segmentWidgets"in f&&i(46,w=f.segmentWidgets),"segmentContainers"in f&&i(81,A=f.segmentContainers),"segmentClickables"in f&&i(82,te=f.segmentClickables),"segmentHighlights"in f&&i(83,mi=f.segmentHighlights)},t.$$.update=()=>{t.$$.dirty[0]&256|t.$$.dirty[1]&262144&&i(55,n=ge[se]),t.$$.dirty[0]&512|t.$$.dirty[1]&524288&&i(56,s=I[R]),t.$$.dirty[0]&1024|t.$$.dirty[1]&524288&&i(62,o=I[we]),t.$$.dirty[0]&128|t.$$.dirty[1]&131072&&P[F],t.$$.dirty[0]&64|t.$$.dirty[2]&4096&&i(59,l=ht?"video":L),t.$$.dirty[0]&4096|t.$$.dirty[1]&1048576|t.$$.dirty[2]&4096&&i(58,a=ft&&Ne==="video"&&!ht),t.$$.dirty[1]&134217728&&(r=a?"bottom-widget":"inline-player"),t.$$.dirty[0]&8192&&i(13,We=Eo(We,"widget")),t.$$.dirty[0]&2097152&&i(21,lt=Eo(lt,"control panel")),t.$$.dirty[0]&32|t.$$.dirty[1]&402653184&&i(61,c=D&&l==="video"&&!a),t.$$.dirty[0]&31|t.$$.dirty[2]&4&&Ut(T_()),t.$$.dirty[0]&1|t.$$.dirty[2]&34&&B_(b,W,$e,f=>Ut(f)),t.$$.dirty[0]&1048576|t.$$.dirty[2]&8388608&&i(85,u=xe||u),t.$$.dirty[0]&655360&&i(84,h=Gn("current",U,Ve)),t.$$.dirty[0]&524288|t.$$.dirty[2]&4194304&&h&&Sn(),t.$$.dirty[0]&131072|t.$$.dirty[2]&8388608&&i(86,m=Gn("hovered",u,Ve)),t.$$.dirty[0]&524288|t.$$.dirty[2]&29360128&&i(54,v=m&&u||h&&U),t.$$.dirty[0]&524288|t.$$.dirty[1]&8388608&&i(57,y=(v==null?void 0:v.marker)===(U==null?void 0:U.marker)),t.$$.dirty[1]&117440512&&i(60,p=y||s||n),t.$$.dirty[0]&393280|t.$$.dirty[1]&8388608|t.$$.dirty[2]&524288&&A.update(v,Ve,ze,L),t.$$.dirty[0]&1114112|t.$$.dirty[2]&1048576&&te.update(xe,nt),t.$$.dirty[0]&573440|t.$$.dirty[2]&2097152&&mi.update("current",U,Ke,Ee),t.$$.dirty[0]&1097728|t.$$.dirty[2]&2097152&&mi.update("hovered",xe,Ke,Ee),t.$$.dirty[0]&2048|t.$$.dirty[2]&8448&&M_(kt,He,ye)},[W,z,J,G,E,D,L,F,se,R,we,ye,Ne,We,Ee,Ke,nt,Ve,ze,U,xe,lt,X,ue,ve,ee,H,S,Ae,qe,Q,Pe,dt,Ye,tt,je,it,Ze,bt,Je,Ge,st,At,Z,Xe,ne,w,Y,P,ge,I,ft,zt,Ut,v,n,s,y,a,l,p,c,o,b,N,Qe,gt,$e,Pt,ot,kt,rt,at,Vt,ht,He,Ct,Bt,Rt,It,Yt,A,te,mi,h,u,m,_t,yi,si,vi,Gt,bi,Mi,oi,Xt,ki,Oi,li,Wt,pi,Qt,ut,$t,ct,Si,mt,k,q,oe,Ft,on,ln,rn,to,wn,io,ei,an,un,cn,dn,gn,no,Pn,so,wi,oo,rs,lo,ro,as,ao,fn,qt,Uo,Tn]}let Z_=class extends pe{constructor(e){super(),ke(this,e,Y_,H_,fe,{playerApiUrl:63,projectId:0,contentId:1,playlistId:2,sourceId:3,sourceUrl:4,playlist:64,showUserInterface:5,playerStyle:6,playerTitle:22,callToAction:23,skipButtonStyle:24,playlistStyle:25,playlistToggle:26,downloadFormats:47,mediaSession:27,content:48,contentIndex:7,introsOutros:49,introsOutrosIndex:8,adverts:50,advertIndex:9,persistentAdImage:28,persistentIndex:10,duration:29,currentTime:11,playbackState:30,playbackRate:31,playbackRates:65,widgetStyle:12,widgetPosition:32,widgetWidth:33,widgetTarget:13,textColor:34,backgroundColor:35,iconColor:36,highlightColor:14,logoIconEnabled:37,highlightSections:15,clickableSections:16,segmentWidgetSections:17,segmentWidgetPosition:18,currentSegment:19,hoveredSegment:20,loadedMedia:66,advertConsent:38,analyticsConsent:39,analyticsCustomUrl:40,analyticsTag:41,writeToken:67,captureErrors:68,onError:69,transitions:70,controlPanel:21,addEventListener:71,removeEventListener:72,initialProps:73,showBottomWidget:51,showMediaSession:52,isFullScreen:74,mediaElement:42,userInterface:43,widgetInterface:44,controller:75,analyticsUrl:76,analyticsId:77,listenSessionId:78,sessionCreatedAt:79,isNewListen:80,prevPercentage:45,segmentWidgets:46,segmentContainers:81,segmentClickables:82,segmentHighlights:83,onEvent:53},null,[-1,-1,-1,-1,-1])}get playerApiUrl(){return this.$$.ctx[63]}set playerApiUrl(e){this.$$set({playerApiUrl:e}),d()}get projectId(){return this.$$.ctx[0]}set projectId(e){this.$$set({projectId:e}),d()}get contentId(){return this.$$.ctx[1]}set contentId(e){this.$$set({contentId:e}),d()}get playlistId(){return this.$$.ctx[2]}set playlistId(e){this.$$set({playlistId:e}),d()}get sourceId(){return this.$$.ctx[3]}set sourceId(e){this.$$set({sourceId:e}),d()}get sourceUrl(){return this.$$.ctx[4]}set sourceUrl(e){this.$$set({sourceUrl:e}),d()}get playlist(){return this.$$.ctx[64]}set playlist(e){this.$$set({playlist:e}),d()}get showUserInterface(){return this.$$.ctx[5]}set showUserInterface(e){this.$$set({showUserInterface:e}),d()}get playerStyle(){return this.$$.ctx[6]}set playerStyle(e){this.$$set({playerStyle:e}),d()}get playerTitle(){return this.$$.ctx[22]}set playerTitle(e){this.$$set({playerTitle:e}),d()}get callToAction(){return this.$$.ctx[23]}set callToAction(e){this.$$set({callToAction:e}),d()}get skipButtonStyle(){return this.$$.ctx[24]}set skipButtonStyle(e){this.$$set({skipButtonStyle:e}),d()}get playlistStyle(){return this.$$.ctx[25]}set playlistStyle(e){this.$$set({playlistStyle:e}),d()}get playlistToggle(){return this.$$.ctx[26]}set playlistToggle(e){this.$$set({playlistToggle:e}),d()}get downloadFormats(){return this.$$.ctx[47]}set downloadFormats(e){this.$$set({downloadFormats:e}),d()}get mediaSession(){return this.$$.ctx[27]}set mediaSession(e){this.$$set({mediaSession:e}),d()}get content(){return this.$$.ctx[48]}set content(e){this.$$set({content:e}),d()}get contentIndex(){return this.$$.ctx[7]}set contentIndex(e){this.$$set({contentIndex:e}),d()}get introsOutros(){return this.$$.ctx[49]}set introsOutros(e){this.$$set({introsOutros:e}),d()}get introsOutrosIndex(){return this.$$.ctx[8]}set introsOutrosIndex(e){this.$$set({introsOutrosIndex:e}),d()}get adverts(){return this.$$.ctx[50]}set adverts(e){this.$$set({adverts:e}),d()}get advertIndex(){return this.$$.ctx[9]}set advertIndex(e){this.$$set({advertIndex:e}),d()}get persistentAdImage(){return this.$$.ctx[28]}set persistentAdImage(e){this.$$set({persistentAdImage:e}),d()}get persistentIndex(){return this.$$.ctx[10]}set persistentIndex(e){this.$$set({persistentIndex:e}),d()}get duration(){return this.$$.ctx[29]}set duration(e){this.$$set({duration:e}),d()}get currentTime(){return this.$$.ctx[11]}set currentTime(e){this.$$set({currentTime:e}),d()}get playbackState(){return this.$$.ctx[30]}set playbackState(e){this.$$set({playbackState:e}),d()}get playbackRate(){return this.$$.ctx[31]}set playbackRate(e){this.$$set({playbackRate:e}),d()}get playbackRates(){return this.$$.ctx[65]}set playbackRates(e){this.$$set({playbackRates:e}),d()}get widgetStyle(){return this.$$.ctx[12]}set widgetStyle(e){this.$$set({widgetStyle:e}),d()}get widgetPosition(){return this.$$.ctx[32]}set widgetPosition(e){this.$$set({widgetPosition:e}),d()}get widgetWidth(){return this.$$.ctx[33]}set widgetWidth(e){this.$$set({widgetWidth:e}),d()}get widgetTarget(){return this.$$.ctx[13]}set widgetTarget(e){this.$$set({widgetTarget:e}),d()}get textColor(){return this.$$.ctx[34]}set textColor(e){this.$$set({textColor:e}),d()}get backgroundColor(){return this.$$.ctx[35]}set backgroundColor(e){this.$$set({backgroundColor:e}),d()}get iconColor(){return this.$$.ctx[36]}set iconColor(e){this.$$set({iconColor:e}),d()}get highlightColor(){return this.$$.ctx[14]}set highlightColor(e){this.$$set({highlightColor:e}),d()}get logoIconEnabled(){return this.$$.ctx[37]}set logoIconEnabled(e){this.$$set({logoIconEnabled:e}),d()}get highlightSections(){return this.$$.ctx[15]}set highlightSections(e){this.$$set({highlightSections:e}),d()}get clickableSections(){return this.$$.ctx[16]}set clickableSections(e){this.$$set({clickableSections:e}),d()}get segmentWidgetSections(){return this.$$.ctx[17]}set segmentWidgetSections(e){this.$$set({segmentWidgetSections:e}),d()}get segmentWidgetPosition(){return this.$$.ctx[18]}set segmentWidgetPosition(e){this.$$set({segmentWidgetPosition:e}),d()}get currentSegment(){return this.$$.ctx[19]}set currentSegment(e){this.$$set({currentSegment:e}),d()}get hoveredSegment(){return this.$$.ctx[20]}set hoveredSegment(e){this.$$set({hoveredSegment:e}),d()}get loadedMedia(){return this.$$.ctx[66]}set loadedMedia(e){this.$$set({loadedMedia:e}),d()}get advertConsent(){return this.$$.ctx[38]}set advertConsent(e){this.$$set({advertConsent:e}),d()}get analyticsConsent(){return this.$$.ctx[39]}set analyticsConsent(e){this.$$set({analyticsConsent:e}),d()}get analyticsCustomUrl(){return this.$$.ctx[40]}set analyticsCustomUrl(e){this.$$set({analyticsCustomUrl:e}),d()}get analyticsTag(){return this.$$.ctx[41]}set analyticsTag(e){this.$$set({analyticsTag:e}),d()}get writeToken(){return this.$$.ctx[67]}set writeToken(e){this.$$set({writeToken:e}),d()}get captureErrors(){return this.$$.ctx[68]}set captureErrors(e){this.$$set({captureErrors:e}),d()}get onError(){return this.$$.ctx[69]}set onError(e){this.$$set({onError:e}),d()}get transitions(){return this.$$.ctx[70]}set transitions(e){this.$$set({transitions:e}),d()}get controlPanel(){return this.$$.ctx[21]}set controlPanel(e){this.$$set({controlPanel:e}),d()}get addEventListener(){return this.$$.ctx[71]}get removeEventListener(){return this.$$.ctx[72]}get initialProps(){return this.$$.ctx[73]}set initialProps(e){this.$$set({initialProps:e}),d()}get showBottomWidget(){return this.$$.ctx[51]}set showBottomWidget(e){this.$$set({showBottomWidget:e}),d()}get showMediaSession(){return this.$$.ctx[52]}set showMediaSession(e){this.$$set({showMediaSession:e}),d()}get isFullScreen(){return this.$$.ctx[74]}set isFullScreen(e){this.$$set({isFullScreen:e}),d()}get mediaElement(){return this.$$.ctx[42]}set mediaElement(e){this.$$set({mediaElement:e}),d()}get userInterface(){return this.$$.ctx[43]}set userInterface(e){this.$$set({userInterface:e}),d()}get widgetInterface(){return this.$$.ctx[44]}set widgetInterface(e){this.$$set({widgetInterface:e}),d()}get controller(){return this.$$.ctx[75]}set controller(e){this.$$set({controller:e}),d()}get analyticsUrl(){return this.$$.ctx[76]}set analyticsUrl(e){this.$$set({analyticsUrl:e}),d()}get analyticsId(){return this.$$.ctx[77]}set analyticsId(e){this.$$set({analyticsId:e}),d()}get listenSessionId(){return this.$$.ctx[78]}set listenSessionId(e){this.$$set({listenSessionId:e}),d()}get sessionCreatedAt(){return this.$$.ctx[79]}set sessionCreatedAt(e){this.$$set({sessionCreatedAt:e}),d()}get isNewListen(){return this.$$.ctx[80]}set isNewListen(e){this.$$set({isNewListen:e}),d()}get prevPercentage(){return this.$$.ctx[45]}set prevPercentage(e){this.$$set({prevPercentage:e}),d()}get segmentWidgets(){return this.$$.ctx[46]}set segmentWidgets(e){this.$$set({segmentWidgets:e}),d()}get segmentContainers(){return this.$$.ctx[81]}set segmentContainers(e){this.$$set({segmentContainers:e}),d()}get segmentClickables(){return this.$$.ctx[82]}set segmentClickables(e){this.$$set({segmentClickables:e}),d()}get segmentHighlights(){return this.$$.ctx[83]}set segmentHighlights(e){this.$$set({segmentHighlights:e}),d()}get onEvent(){return this.$$.ctx[53]}};class K_{constructor(e,i){this.baseUrl=e==null?void 0:e.replace("{id}",i)}byContentId(e){return vn(`${this.baseUrl}/by_content_id/${e}`)}byPlaylistId(e){return vn(`${this.baseUrl}/by_playlist_id/${e}`)}bySourceId(e){return vn(`${this.baseUrl}/by_source_id/${e}`)}bySourceUrl(e){return vn(`${this.baseUrl}/by_source_url/${e}`)}byIdentifiers(e){return vn(`${this.baseUrl}/by_identifiers/${encodeURIComponent(JSON.stringify(e))}`)}}const Lo=t=>typeof t!="object"||t===null?t:Array.isArray(t)?t.map(Lo):Object.fromEntries(Object.entries(t).map(([e,i])=>[e.replace(/([A-Z])/g,n=>`_${n.toLowerCase()}`),Lo(i)])),br=t=>t==="dark"||t==="auto"&&J_()?"dark":"light",J_=()=>window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches,kr=t=>di(this,null,function*(){const e=new K_(t.playerApiUrl,t.projectId);if(!t.playerApiUrl||!t.projectId)return;const i=G_(t);if(i.length===0)return;const n=yield X_(e,i).catch(()=>{});if(!(n!=null&&n.content)){Q_(t);return}$_(t,n)}),G_=t=>{const e=[];return t.contentId&&e.push({content_id:t.contentId}),t.playlistId&&e.push({playlist_id:t.playlistId}),t.sourceId&&e.push({source_id:t.sourceId}),t.sourceUrl&&e.push({source_url:t.sourceUrl}),t.playlist&&e.push(...Lo(t.playlist)),[...new Set(e.map(JSON.stringify))].map(JSON.parse)},X_=(t,e)=>{const i=e[0];if(e.length>1)return t.byIdentifiers(e);if(i.content_id)return t.byContentId(i.content_id);if(i.playlist_id)return t.byPlaylistId(i.playlist_id);if(i.source_id)return t.bySourceId(i.source_id);if(i.source_url)return t.bySourceUrl(i.source_url)},Q_=t=>{pr(t),Sr(t),wr(t),t.onEvent(he({type:"NoContentAvailable",description:"No published and processed content is available for the identifiers.",initiatedBy:"browser"}))},$_=(t,e)=>{var s;const i=br(e.settings.theme),n=e.settings[`${i}_theme`];pr(t),Sr(t,e),wr(t,e),Le(t,"playerStyle",e.settings.player_style),Le(t,"playerTitle",((s=e.playlist)==null?void 0:s.title)||e.settings.player_title),Le(t,"callToAction",e.settings.call_to_action==="Listen to this article"?null:e.settings.call_to_action),Le(t,"skipButtonStyle",e.settings.skip_button_style),Le(t,"downloadFormats",e.settings.download_button_enabled?["mp3"]:[]),Le(t,"introsOutros",e0(e.settings)),Le(t,"persistentAdImage",e.settings.persistent_ad_image),Le(t,"widgetStyle",e.settings.widget_style),Le(t,"widgetPosition",e.settings.widget_position),Le(t,"textColor",n.text_color),Le(t,"backgroundColor",n.background_color),Le(t,"iconColor",n.icon_color),Le(t,"highlightColor",n.highlight_color),Le(t,"logoIconEnabled",e.settings.logo_icon_enabled),Le(t,"highlightSections",e.settings.segment_playback_enabled?"all":"none"),Le(t,"clickableSections",e.settings.segment_playback_enabled?"all":"none"),Le(t,"segmentWidgetSections",(e.settings.segment_playback_enabled,"none")),Le(t,"analyticsConsent",t0(e.settings)),Le(t,"analyticsCustomUrl",e.settings.analytics_custom_url),Le(t,"analyticsTag",e.settings.analytics_tag),Le(t,"analyticsUrl",e.settings.analytics_url),Le(t,"analyticsId",e.settings.analytics_id)},pr=t=>{Le(t,"contentIndex",0),Le(t,"introsOutrosIndex",-1),Le(t,"advertIndex",-1),Le(t,"persistentIndex",-1),Le(t,"duration",0),Le(t,"currentTime",0),Le(t,"playbackState","stopped"),Le(t,"currentSegment",void 0),Le(t,"hoveredSegment",void 0)},Sr=(t,e)=>{var s;const i=(s=e==null?void 0:e.settings)==null?void 0:s.image_enabled,n=(e==null?void 0:e.content)||[];Le(t,"content",n.map(o=>{var l;return{id:o.id,title:o.title,imageUrl:i&&(((l=e.playlist)==null?void 0:l.image_url)||e.settings.image_url||o.image_url),sourceId:o.source_id,sourceUrl:o.source_url,adsEnabled:o.ads_enabled,duration:o.audio[0]?o.audio[0].duration/1e3:0,audio:o.audio.map(r=>({id:r.id,url:r.url,contentType:r.content_type,duration:r.duration?r.duration/1e3:0})),video:o.video.map(r=>({id:r.id,url:r.url,contentType:r.content_type,duration:r.duration?r.duration/1e3:0})),segments:o.segments.map(r=>({marker:r.marker,section:r.section,startTime:r.start_time?r.start_time/1e3:0,duration:r.duration?r.duration/1e3:0}))}}))},wr=(t,e)=>{var s;const i=(s=e==null?void 0:e.settings)==null?void 0:s.image_enabled,n=(e==null?void 0:e.ads)||[];Le(t,"adverts",n.map(o=>{const l=o.type==="vast",r=br(o.theme),a=o[`${r}_theme`];return{id:o.id,type:o.type,placement:o.placement,vastUrl:l?o.vast_url:null,clickThroughUrl:l?null:o.click_through_url,imageUrl:i&&o.image_url,textColor:a==null?void 0:a.text_color,backgroundColor:a==null?void 0:a.background_color,iconColor:a==null?void 0:a.icon_color,audio:l?[]:(o.audio||o.media).map(c=>({id:c.id,url:c.url,contentType:c.content_type,duration:c.duration?c.duration/1e3:0})),video:l?[]:(o.video||[]).map(c=>({id:c.id,url:c.url,contentType:c.content_type,duration:c.duration?c.duration/1e3:0}))}}))},Le=(t,e,i)=>{typeof t.initialProps[e]!="undefined"||(t[e]=i)},e0=({intro_outro_enabled:t,intro_url:e,outro_url:i})=>{if(!t)return[];const n=[];return e&&n.push({placement:"pre-roll",audio:[{url:e}],video:[]}),i&&n.push({placement:"post-roll",audio:[{url:i}],video:[]}),n},t0=({analytics_enabled:t,analytics_uuid_enabled:e})=>t?e?"allowed":"without-local-storage":"none",i0=(t,e)=>di(this,null,function*(){const n=yield(yield fetch(t)).blob(),s=URL.createObjectURL(n),o=document.createElement("a");document.body.append(o),o.href=s,o.setAttribute("download",e),o.setAttribute("target","_blank"),o.click(),o.remove()}),js={vastUrls:new Set,mediaSources:new Set},n0=t=>{t.vastUrl&&js.vastUrls.add(t.vastUrl);for(const e of[...t.audio||[],...t.video||[]])js.mediaSources.add(e.url)},Pr=t=>{if(t.vastUrl&&js.vastUrls.has(t.vastUrl))return!0;for(const e of[...t.audio||[],...t.video||[]])if(js.mediaSources.has(e.url))return!0;return!1},Tr=new Set,s0=t=>{[...t.audio||[],...t.video||[]].forEach(i=>Tr.add(i.url))},o0=t=>[...t.audio||[],...t.video||[]].some(i=>Tr.has(i.url)),l0=({introsOutrosIndex:t,adverts:e,advertIndex:i,content:n=[],contentIndex:s,currentTime:o,atTheStart:l,atTheEnd:r,errored:a}={})=>{var y;const c=e&&e[i];e:if(c){if(a){n0(c);break e}if(r)return s0(c),-1;if(!r)return i}if(!((y=n[s])!=null&&y.adsEnabled)||t!==-1)return-1;const u=a0({content:n,contentIndex:s,currentTime:o,atTheStart:l,atTheEnd:r});let h=-1,m=-1/0,v=-1/0;for(const[p,b]of e.entries()){if(o0(b)||Pr(b)||!u.has(b.placement))continue;const W=r0[b.type]||0;if(W<m)continue;const z=Math.random();W===m&&z<v||(h=p,m=W,v=z)}return h},r0={vast:1,custom:0},a0=({content:t,contentIndex:e,currentTime:i,atTheStart:n,atTheEnd:s})=>{const o=e===0,l=e===t.length-1,r=t.length>1,a=r&&n&&!o,c=t[e].segments,u=c[c.length-1],h=r?null:g0(c),m=c[h],v=m&&i>m.startTime,y=u?u.startTime+u.duration:0,p=i>y-c0,b=new Set;return n&&b.add("pre-roll"),v&&!p&&b.add("mid-roll"),a&&b.add("mid-roll"),s&&l&&b.add("post-roll"),a&&b.add("post-roll"),b},u0=2*60,c0=10,d0=.5,g0=t=>{const e=t[t.length-1];if(!e)return;const i=e.startTime+e.duration;if(i<u0)return;const n=i/2,s=wo(t,i/2),r=t[s].startTime>=n-d0?s:s+1;if(r!==t.length)return r},f0=(t,e,i,n)=>{let s=-1,o=-1/0,l=-1/0;for(const[r,a]of(n||[]).entries()){if(!t||Pr(a)||a.type==="vast")continue;const c=_0(r,e,i);if(c<o)continue;const u=h0[a.placement]||0;c===o&&u<l||(s=r,o=c,l=u)}return s},h0={"pre-roll":2,"mid-roll":1},_0=(t,e,i)=>t===i?2:t===e?1:0,Ar={mediaSources:new Set},m0=t=>{for(const e of[...t.audio||[],t.video||[]])Ar.mediaSources.add(e.url)},y0=t=>{for(const e of[...t.audio||[],t.video||[]])if(Ar.mediaSources.has(e.url))return!0;return!1},Cr=new Set,v0=t=>{[...t.audio||[],...t.video||[]].forEach(i=>Cr.add(i.url))},b0=t=>[...t.audio||[],...t.video||[]].some(i=>Cr.has(i.url)),k0=({introsOutros:t=[],introsOutrosIndex:e,advertIndex:i,content:n,contentIndex:s,currentTime:o,atTheStart:l,atTheEnd:r,errored:a})=>{const c=t[e];e:if(c){if(a){m0(c);break e}if(r)return v0(c),-1;if(!r)return e}if(i!==-1)return-1;const u=p0({content:n,contentIndex:s,currentTime:o,atTheStart:l,atTheEnd:r});let h=-1,m=-1/0,v=-1/0;for(const[y,p]of t.entries()){if(y0(p)||!u.has(p.placement))continue;const b=b0(p)?1:0;if(b<m)continue;const W=Math.random();b===m&&W<v||(h=y,m=b,v=W)}return h},p0=({content:t,contentIndex:e,currentTime:i,atTheStart:n,atTheEnd:s})=>{const o=new Set,l=n&&e===0&&i===0,r=s&&e===t.length-1;return l&&o.add("pre-roll"),r&&o.add("post-roll"),o},S0=t=>{if(!navigator.mediaSession)return;const e=t.instances().some(o=>o.mediaSession==="override");if(T0()&&!e)return;let i,n=-1/0,s=-1/0;for(const o of t.instances()){if(o.mediaSession==="none")continue;const l=w0[o.playbackState]||0;if(l<n)continue;const r=P0[o.showMediaSession]||0;l===n&&r<s||(i=o,n=l,s=r)}for(const o of t.instances())o.showMediaSession=o===i;return i},w0={playing:1,paused:0,stopped:0},P0={true:1,false:0},T0=()=>{const t=navigator.mediaSession.metadata;if(!t||navigator.mediaSession.setByPlayer)return!1;const{title:e,artist:i,album:n,artwork:s}=t;return e||i||n||(s==null?void 0:s.length)},A0=t=>{let e=!1,i,n=-1/0,s=-1/0;for(const o of t.instances()){if(!o.userInterface||o.widgetTarget||!Io(o.widgetStyle))continue;if(o.userInterface.isVisible){e=!0;continue}if(!(o.userInterface.relativeY<0))continue;const c=C0[o.playbackState]||0;if(c<n)continue;const u=o.userInterface.absoluteY;c===n&&u<s||(i=o,n=c,s=u)}e&&n===0&&(i=null);for(const o of t.instances())o.showBottomWidget=o===i},C0={playing:2,paused:1,stopped:0};class B0{constructor(e,i){Ce(this,Fs);Ce(this,qs);Ce(this,ns);Ce(this,Hs);Ce(this,Ys);Ce(this,_i);Ce(this,Fi);Ce(this,ni);Ce(this,Zs);Ce(this,kn);Ce(this,qi);Ce(this,Ks);Ce(this,ss);Ce(this,ji);Ce(this,os);Ce(this,Hi);Ce(this,jt);Ce(this,Yi);Ce(this,zi);Ce(this,Js);Ce(this,Gs);Ce(this,pn);Ce(this,ls);Ce(this,Xs);Ce(this,Qs);Ce(this,$s);Ce(this,eo);this.player=e,this.PlayerClass=i,this.eventListeners={"<any>":{}}}addEventListener(e,i){e==="<any>"||this[`handle${e}`]||Jt(`Cannot add listener for unknown event type '${e}'.`);const s=`listener-handle-${ys()}`;return this.eventListeners[e]=this.eventListeners[e]||{},this.eventListeners[e][s]=i,s}removeEventListener(e,i){this.eventListeners[e]=this.eventListeners[e]||{},delete this.eventListeners[e][i]}processEvent(e){return di(this,null,function*(){yield ur(()=>this.player),Fa(e);const i=this[`handle${e.type}`],n=Ws(this.player);O(this,Fs,Qr).call(this,e)?e.status="ignored-due-to-advert":O(this,qs,$r).call(this,e)?e.status="ignored-due-to-scrubbing":i?(yield i.call(this,e),O(this,Js,sa).call(this),O(this,Gs,oa).call(this),e.status="handled"):Jt("No handler function for event.",e);const s=Ws(this.player);e.changedProps=cr(n,s),e.processedAt=new Date().toISOString(),qa(e),O(this,ns,Yo).call(this,e.type,e),O(this,ns,Yo).call(this,"<any>",e)})}handlePressedChangeSpeed(){O(this,ji,hn).call(this,e=>e+1,{cycle:!0})}handlePressedEnterOnChangeSpeed(){O(this,ji,hn).call(this,e=>e+1,{cycle:!0})}handlePressedSpaceOnChangeSpeed(){O(this,ji,hn).call(this,e=>e+1,{cycle:!0})}handlePressedUpOnChangeSpeed(){O(this,ji,hn).call(this,e=>e+1)}handlePressedRightOnChangeSpeed(){O(this,ji,hn).call(this,e=>e+1)}handlePressedDownOnChangeSpeed(){O(this,ji,hn).call(this,e=>e-1)}handlePressedLeftOnChangeSpeed(){O(this,ji,hn).call(this,e=>e-1)}handlePressedPrevSegment(){O(this,os,Ko).call(this,e=>e-1)}handlePressedNextSegment(){O(this,os,Ko).call(this,e=>e+1)}handlePressedSeekBack({seconds:e}){O(this,jt,Kt).call(this,i=>i-e)}handlePressedSeekAhead({seconds:e}){O(this,jt,Kt).call(this,i=>i+e)}handlePressedPrevTrack(){O(this,Hi,Bn).call(this,e=>e-1)}handlePressedNextTrack(){O(this,Hi,Bn).call(this,e=>e+1)}handlePressedAdvertLink(){}handlePressedAdvertButton(){}handlePressedAdvertImage(){}handlePressedAdvertVideo(){}handlePressedBeyondWords(){}handlePressedSourceUrl(){}handleDurationUpdated(){}handleMediaLoaded({loadedMedia:e}){this.player.loadedMedia=e}handlePlaybackRateUpdated(){}handleVisibilityChanged(){A0(this.PlayerClass)}handlePressedVideoBackground(){O(this,qi,Cn).call(this)}handlePressedEnterOnProgressBar(){O(this,qi,Cn).call(this)}handlePressedSpaceOnProgressBar(){O(this,qi,Cn).call(this)}handlePressedEnterOnProgressCircle(){O(this,qi,Cn).call(this)}handlePressedSpaceOnProgressCircle(){O(this,qi,Cn).call(this)}handlePressedLeftOnProgressBar(){O(this,jt,Kt).call(this,e=>e-5)}handlePressedRightOnProgressBar(){O(this,jt,Kt).call(this,e=>e+5)}handlePressedLeftOnProgressCircle(){O(this,jt,Kt).call(this,e=>e-5)}handlePressedRightOnProgressCircle(){O(this,jt,Kt).call(this,e=>e+5)}handlePressedProgressBar({ratio:e}){this.preScrubState=this.player.playbackState,O(this,Ks,na).call(this),O(this,jt,Kt).call(this,(i,n)=>e*n),e!==0&&(this.segmentPlayed=!0)}handleScrubbedProgressBar({ratio:e}){O(this,jt,Kt).call(this,(i,n)=>e*n),e!==0&&(this.segmentPlayed=!0)}handleFinishedScrubbingProgressBar(){this.player.playbackState=this.preScrubState,setTimeout(()=>delete this.preScrubState,500)}handleIdentifiersChanged(){kr(this.player).then(()=>{O(this,Yi,In).call(this,{atTheStart:!0}),O(this,zi,_n).call(this,{atTheStart:!0})})}handleNoContentAvailable({description:e}){console.warn(`BeyondWords.Player: ${e}`)}handlePressedPlay({emittedFrom:e,widgetSegment:i,widgetIsCurrent:n}){e==="segment-widget"&&!n?O(this,ss,Zo).call(this,i):this.player.playbackState="playing"}handlePressedPause(){this.player.playbackState="paused"}handlePlaybackPlaying(){this.PlayerClass.instances().filter(n=>n!==this.player).filter(n=>n.playbackState==="playing").forEach(n=>n.playbackState="paused"),S0(this.PlayerClass)}handlePlaybackPaused(){const e=this.player.playbackState==="playing",i=this.player.currentTime>=this.player.duration;e&&!i&&!this.preScrubState&&(this.player.playbackState="paused")}handleCurrentTimeUpdated(){this.midrollPlayed||O(this,zi,_n).call(this);const e=this.player.currentTime<=0,i=this.player.currentTime>=this.player.duration,n=this.player.mediaElement.video.paused;!e&&!i&&!n&&(this.player.playbackState="playing")}handlePlaybackEnded(){O(this,Zs,ia).call(this)&&(this.midrollPlayed=!0),this.segmentPlayed=!1;const e=O(this,_i,Ji).call(this),i=O(this,ni,fi).call(this);O(this,zi,_n).call(this,{atTheEnd:!0,wasIntro:e}),!i&&(O(this,Yi,In).call(this,{atTheEnd:!0}),!e&&(O(this,Fi,An).call(this)||O(this,ni,fi).call(this)||O(this,Hi,Bn).call(this,n=>n+1)))}handlePlaybackNotAllowed({description:e}){console.warn(`BeyondWords.Player: ${e}`);const i=this.player.contentIndex<=0&&this.player.currentTime<=0;this.player.playbackState=i?"stopped":"paused"}handlePlaybackErrored({mediaType:e,errorMessage:i}){console.warn(`BeyondWords.Player: ${e} playback error: ${i}`),O(this,_i,Ji).call(this)||O(this,Fi,An).call(this)?O(this,Yi,In).call(this,{errored:!0}):O(this,ni,fi).call(this)?O(this,zi,_n).call(this,{errored:!0}):this.handlePlaybackEnded()}handlePressedMaximize(){jl()?zh():jh(this.player.target)}handleFullScreenModeUpdated(){const e=jl()===this.player.target,i=e?"add":"remove";this.player.isFullScreen=e,this.player.target.classList[i]("maximized")}handlePressedPlaylistItem({index:e}){O(this,Hi,Bn).call(this,()=>e),this.player.playbackState="playing"}handlePressedTogglePlaylist(){const e=this.player.playlistStyle.split("-"),i=this.player.content.length>1,n=e[0]==="show"||e[0]==="auto"&&i;e[0]=n?"hide":"show",this.player.playlistStyle=e.join("-")}handlePressedDownload({contentIndex:e,audioIndex:i,videoIndex:n}){var u,h;const s=this.player.content[e],o=(u=s.audio)==null?void 0:u[i],l=(h=s.video)==null?void 0:h[n],r=(o||l).url,a=r.split(".").pop(),c=`${s.title}.${a}`;return i0(r,c)}handlePressedCloseWidget(){for(const e of this.PlayerClass.instances())e.playbackState="paused",e.widgetStyle="closed-by-user"}handleContentStatusChanged({contentId:e,legacyId:i,sourceId:n,sourceUrl:s,contentStatus:o}){o==="processed"&&this.player.playbackState==="stopped"&&this.player.contentIndex===0&&this.player.currentTime===0&&O(this,$s,aa).call(this,{contentId:e,legacyId:i,sourceId:n,sourceUrl:s})&&kr(this.player).then(()=>{O(this,Yi,In).call(this,{atTheStart:!0}),O(this,zi,_n).call(this,{atTheStart:!0})})}handleCurrentSegmentUpdated({segment:e,segmentIndex:i,contentIndex:n}){var s;O(this,kn,us).call(this)?this.player.currentSegment=Ki(Zt({},e),{segmentIndex:i,contentIndex:n}):this.segmentPlayed||((s=this.player.segmentContainers)==null||s.reset(),this.player.currentSegment=null)}handleHoveredSegmentUpdated({segment:e,segmentIndex:i,contentIndex:n}){e?this.player.hoveredSegment=Ki(Zt({},e),{segmentIndex:i,contentIndex:n}):this.player.hoveredSegment=null}handlePressedSegment({segment:e,segmentIndex:i,contentIndex:n}){if(!Gn("hovered",e,this.player.clickableSections))return;if(!O(this,eo,ua).call(this,{contentIndex:n,segmentIndex:i})&&!O(this,ni,fi).call(this)){O(this,qi,Cn).call(this);return}n!==this.player.contentIndex&&O(this,Hi,Bn).call(this,()=>n),O(this,ss,Zo).call(this,Zt({segmentIndex:i,contentIndex:n},e))}}Fs=new WeakSet,Qr=function({type:e}){return O(this,ni,fi).call(this)&&(e.includes("ChangeSpeed")||e.includes("PrevSegment")||e.includes("NextSegment")||e.includes("SeekBack")||e.includes("SeekAhead")||e.includes("Progress")&&!e.includes("Space")&&!e.includes("Enter"))},qs=new WeakSet,$r=function({type:e}){return this.preScrubState&&(e.includes("CurrentTimeUpdated")||e.includes("PlaybackEnded"))},ns=new WeakSet,Yo=function(e,i){const n=this.eventListeners[e]||{};Object.values(n).forEach(s=>s(i))},Hs=new WeakSet,ea=function(){return this.player.introsOutros.some(e=>e.placement==="pre-roll")},Ys=new WeakSet,ta=function(){return this.player.introsOutros.some(e=>e.placement==="post-roll")},_i=new WeakSet,Ji=function(e=this.player.introsOutrosIndex){var i,n,s;return((s=(n=(i=this.player)==null?void 0:i.introsOutros)==null?void 0:n[e])==null?void 0:s.placement)==="pre-roll"},Fi=new WeakSet,An=function(e=this.player.introsOutrosIndex){var i,n,s;return((s=(n=(i=this.player)==null?void 0:i.introsOutros)==null?void 0:n[e])==null?void 0:s.placement)==="post-roll"},ni=new WeakSet,fi=function(){return this.player.advertIndex!==-1},Zs=new WeakSet,ia=function(){var e;return((e=this.player.adverts[this.player.advertIndex])==null?void 0:e.placement)==="mid-roll"},kn=new WeakSet,us=function(){return!O(this,_i,Ji).call(this)&&!O(this,Fi,An).call(this)&&!O(this,ni,fi).call(this)},qi=new WeakSet,Cn=function(){this.player.playbackState==="playing"?this.player.playbackState="paused":this.player.playbackState="playing"},Ks=new WeakSet,na=function(){this.player.playbackState==="playing"&&(this.player.playbackState="paused")},ss=new WeakSet,Zo=function(s){var o=s,{segmentIndex:e,contentIndex:i}=o,n=Fo(o,["segmentIndex","contentIndex"]);O(this,jt,Kt).call(this,()=>n.startTime,i),this.player.currentSegment=Zt({segmentIndex:e,contentIndex:i},n),this.player.playbackState="playing",this.segmentPlayed=!0},ji=new WeakSet,hn=function(e,{cycle:i}={}){const n=this.player.playbackRates,s=n.length-1,o=n.indexOf(this.player.playbackRate),l=e(o);let r;i?r=l%n.length:r=Math.max(0,Math.min(s,l)),this.player.playbackRate=n[r]||1},os=new WeakSet,Ko=function(e){const i=this.player.content[this.player.contentIndex].segments,n=wo(i,this.player.currentTime),s=e(n);O(this,_i,Ji).call(this)&&s>=0?this.handlePlaybackEnded():O(this,Fi,An).call(this)&&s<0?(O(this,pn,cs).call(this,-1),O(this,jt,Kt).call(this,()=>{var o;return((o=i[i.length-1])==null?void 0:o.startTime)||.01}),this.player.playbackState="playing"):O(this,kn,us).call(this)&&s<0&&O(this,Hs,ea).call(this)?(O(this,jt,Kt).call(this,()=>0),O(this,Yi,In).call(this,{atTheStart:!0})):O(this,kn,us).call(this)&&s===i.length&&O(this,Ys,ta).call(this)?O(this,jt,Kt).call(this,()=>this.player.duration-.01):O(this,kn,us).call(this)&&s>=0&&s<i.length&&O(this,jt,Kt).call(this,()=>i[s].startTime)},Hi=new WeakSet,Bn=function(e){const i=e(this.player.contentIndex),n=i<0||i>=this.player.content.length;n?(this.player.playbackState="stopped",O(this,jt,Kt).call(this,()=>0)):(this.player.contentIndex=i,O(this,ni,fi).call(this)||(O(this,jt,Kt).call(this,()=>0),this.midrollPlayed=!1)),O(this,pn,cs).call(this,-1),O(this,Yi,In).call(this,{atTheStart:!0}),n||O(this,zi,_n).call(this,{atTheStart:!0})},jt=new WeakSet,Kt=function(e,i){if(O(this,ni,fi).call(this))this.prevTime=e(),this.prevContent=i;else{const n=this.player.duration||0;this.player.currentTime=e(this.player.currentTime,n)}},Yi=new WeakSet,In=function({atTheStart:e,atTheEnd:i,errored:n}={}){const{content:s,introsOutros:o,currentTime:l}=this.player,r=typeof this.nextIntroOutro!="undefined"?this.nextIntroOutro:this.player.introsOutrosIndex,a=typeof this.nextAdvert!="undefined"?this.nextAdvert:this.player.advertIndex,c=typeof this.prevContent!="undefined"?this.prevContent:this.player.contentIndex;O(this,pn,cs).call(this,k0({introsOutros:o,introsOutrosIndex:r,advertIndex:a,content:s,contentIndex:c,currentTime:l,atTheStart:e,atTheEnd:i,errored:n}))},zi=new WeakSet,_n=function({atTheStart:e,atTheEnd:i,wasIntro:n,errored:s}={}){const{adverts:o,content:l,currentTime:r}=this.player;let a=typeof this.nextIntroOutro!="undefined"?this.nextIntroOutro:this.player.introsOutrosIndex;const c=typeof this.nextAdvert!="undefined"?this.nextAdvert:this.player.advertIndex,u=typeof this.prevContent!="undefined"?this.prevContent:this.player.contentIndex;n&&(e=!0,i=!1,a=-1),O(this,ls,Jo).call(this,l0({introsOutrosIndex:a,adverts:o,advertIndex:c,content:l,contentIndex:u,currentTime:r,atTheStart:e,atTheEnd:i,errored:s}));const h=this.player.persistentAdImage,m=this.player.persistentIndex;this.player.persistentIndex=f0(h,m,c,o)},Js=new WeakSet,sa=function(){this.player.playbackState==="playing"&&typeof this.nextIntroOutro!="undefined"&&(O(this,pn,cs).call(this,this.nextIntroOutro),delete this.nextIntroOutro)},Gs=new WeakSet,oa=function(){this.player.playbackState==="playing"&&typeof this.nextAdvert!="undefined"&&(O(this,ls,Jo).call(this,this.nextAdvert),delete this.nextAdvert)},pn=new WeakSet,cs=function(e){if(this.player.playbackState!=="playing"&&e!==-1){this.nextIntroOutro=e;return}else delete this.nextIntroOutro;if(!(this.player.contentIndex<=0&&this.player.currentTime<=0)&&O(this,_i,Ji).call(this,e)){this.player.introsOutrosIndex=-1,O(this,zi,_n).call(this,{atTheStart:!0});return}const o=O(this,_i,Ji).call(this),l=O(this,Fi,An).call(this);this.player.introsOutrosIndex=e;const r=o&&!O(this,_i,Ji).call(this),a=l&&!O(this,Fi,An).call(this);r&&(this.player.currentTime=0),a&&O(this,Hi,Bn).call(this,()=>1/0)},ls=new WeakSet,Jo=function(e){if(this.player.playbackState!=="playing"&&e!==-1){this.nextAdvert=e;return}else delete this.nextAdvert;const n=O(this,ni,fi).call(this);this.player.advertIndex=e;const s=!n&&O(this,ni,fi).call(this),o=n&&!O(this,ni,fi).call(this);s&&O(this,Xs,la).call(this),o&&O(this,Qs,ra).call(this)},Xs=new WeakSet,la=function(){O(this,_i,Ji).call(this)||(this.prevTime=this.player.currentTime),this.prevRate=this.player.playbackRate,this.prevContent=this.player.contentIndex,this.player.currentTime=0,this.player.playbackRate=1},Qs=new WeakSet,ra=function(){this.player.playbackRate=this.prevRate||1,this.player.contentIndex!==this.prevContent||(this.player.currentTime=this.prevTime),delete this.prevTime,delete this.prevRate,delete this.prevContent},$s=new WeakSet,aa=function({contentId:e,legacyId:i,sourceId:n,sourceUrl:s}){var o,l,r,a;return this.player.contentId===e||this.player.contentId===i||this.player.sourceId===n||this.player.sourceUrl===s||((o=this.player.playlist)==null?void 0:o.some(c=>c.contentId===e))||((l=this.player.playlist)==null?void 0:l.some(c=>c.contentId===i))||((r=this.player.playlist)==null?void 0:r.some(c=>c.sourceId===n))||((a=this.player.playlist)==null?void 0:a.some(c=>c.sourceUrl===s))},eo=new WeakSet,ua=function({contentIndex:e,segmentIndex:i}){var n,s;return((n=this.player.currentSegment)==null?void 0:n.contentIndex)!==e||((s=this.player.currentSegment)==null?void 0:s.segmentIndex)!==i};var Qn="<unknown>";function Br(t){var e=t.split(`
|
|
57
|
+
gtag("js", new Date());`,e.async=!0,hi(e.src,i="https://www.googletagmanager.com/gtag/js?id="+t[0])||ir(e,"src",i)},m(o,l){V(o,e,l),V(o,n,l),V(o,s,l)},p(o,l){l&1&&!hi(e.src,i="https://www.googletagmanager.com/gtag/js?id="+o[0])&&ir(e,"src",i)},d(o){o&&B(e),o&&B(n),o&&B(s)}}}function p_(t){let e,i=!t[1]&&nr(t);return{c(){i&&i.c(),e=mn()},m(n,s){i&&i.m(document.head,null),g(document.head,e)},p(n,[s]){n[1]?i&&(i.d(1),i=null):i?i.p(n,s):(i=nr(n),i.c(),i.m(e.parentNode,e))},i:M,o:M,d(n){i&&i.d(n),B(e)}}}function S_(t,e,i){let n,{analyticsTag:s}=e;return t.$$set=o=>{"analyticsTag"in o&&i(0,s=o.analyticsTag)},i(1,n=window.gtag),[s,n]}class w_ extends pe{constructor(e){super(),ke(this,e,S_,p_,fe,{analyticsTag:0})}get analyticsTag(){return this.$$.ctx[0]}set analyticsTag(e){this.$$set({analyticsTag:e}),d()}}const N3="";class P_ extends pe{constructor(e){super(),ke(this,e,null,null,fe,{})}}class jo{constructor(e,i){Ce(this,$n);Ce(this,Os);this.onSelected=e,this.onDeselected=i,this.consumers={}}addInterest(e,i,...n){var o;(o=this.consumers)[e]||(o[e]=[]);const s=this.consumers[e].slice(-1)[0];this.consumers[e].push({consumerId:i,args:n}),!(s&&O(this,$n,Ho).call(this,n,s.args))&&(s&&this.onDeselected(e,...s.args),this.onSelected(e,...n))}removeInterest(e,i){var l;(l=this.consumers)[e]||(l[e]=[]);const n=this.consumers[e].slice(-1)[0];if(O(this,Os,qr).call(this,this.consumers[e],r=>r.consumerId===i),!(n&&i===n.consumerId))return;const o=this.consumers[e].slice(-1)[0];o&&O(this,$n,Ho).call(this,n.args,o.args)||(this.onDeselected(e,...n.args),o&&this.onSelected(e,...o.args))}}$n=new WeakSet,Ho=function(e,i){return e.length===i.length&&e.every((n,s)=>n===i[s])},Os=new WeakSet,qr=function(e,i){for(let n=e.length-1;n>=0;n-=1)if(i(e[n])){e.splice(n,1);return}};const Gn=(t,e,i)=>{let[n,s]=i.split("-");n||(n="none"),s||(s=n);const o=t==="current"?n:s;return o==="all"||o==="body"&&(e==null?void 0:e.section)==="body"},nn="data-beyondwords-marker",sr=t=>["beyondwords-highlight","bwp",`marker-${t}`],Di=class Di{update(e,i,n,s){const o=Gn(e,i,n),l=this[`prev${e}`],r=o?i==null?void 0:i.marker:null;r&&Pi(Di,es).addInterest(r,this,s),l&&Pi(Di,es).removeInterest(l,this),this[`prev${e}`]=r}};es=new WeakMap,Es=new WeakSet,Hr=function(e,i){const n=document.querySelectorAll(`[${nn}="${e}"]`);for(const s of n){const o=document.createTreeWalker(s,NodeFilter.SHOW_TEXT,null,!1);let l;for(;l=o.nextNode();){if(/^\s*$/.test(l.nodeValue))continue;l.parentNode.nodeName.toLowerCase()==="a"&&(l=l.parentNode);const c=document.createElement("mark");c.classList.add(...sr(e)),c.style.background=i,l.parentNode.insertBefore(c,l),c.appendChild(l)}}},Ls=new WeakSet,Yr=function(e){const i=document.querySelectorAll(`[${nn}="${e}"]`);for(const n of i){const s=n.querySelectorAll(`mark.${sr(e)}`);for(const o of s)for(const l of o.childNodes)o.parentNode.insertBefore(l,o),o.remove()}},Ce(Di,Es),Ce(Di,Ls),Ce(Di,es,new jo(O(Di,Es,Hr),O(Di,Ls,Yr)));let zo=Di;const or=["beyondwords-clickable","bwp"],Ri=class Ri{update(e,i){const n=Gn("hovered",e,i),s=this.previous,o=n?e==null?void 0:e.marker:null;o&&Pi(Ri,ts).addInterest(o,this),s&&Pi(Ri,ts).removeInterest(s,this),this.previous=o}};ts=new WeakMap,xs=new WeakSet,Zr=function(e){const i=document.querySelectorAll(`[${nn}="${e}"]`);for(const n of i)n.classList.add(...or)},Ns=new WeakSet,Kr=function(e){const i=document.querySelectorAll(`[${nn}="${e}"]`);for(const n of i)lr(n,or)},Ce(Ri,xs),Ce(Ri,Ns),Ce(Ri,ts,new jo(O(Ri,xs,Zr),O(Ri,Ns,Kr)));let Mo=Ri;const lr=(t,e)=>{if(!t)return;const s=[...t.classList].filter(o=>!e.includes(o)).some(o=>o.startsWith("beyondwords-"))?e.filter(o=>o!=="bwp"):e;t.classList.remove(...s)},rr=(t,e,i)=>["beyondwords-widget","bwp",`marker-${t}`,`position-${e}`,`for-${i}-player`],ar=["beyondwords-relative","bwp"],Ui=class Ui{constructor(e){this.onUpdate=e,this.containers=[]}update(e,i,n,s){const o=i.includes("all")||i.includes("body"),l=this.previous,r=(e==null?void 0:e.marker)||o&&(l==null?void 0:l.marker);r&&Pi(Ui,is).addInterest(r,this,this,n,s),l&&Pi(Ui,is).removeInterest(l,this),this.previous=r}reset(){this.update(null,"none")}};is=new WeakMap,Ds=new WeakSet,Jr=function(e,i,n,s){const o=document.querySelector(`[${nn}="${e}"]`),l=document.createElement("div");["2-oclock","3-oclock","4-oclock","8-oclock","9-oclock","10-oclock"].includes(n)&&o.classList.add(...ar),l.classList.add(...rr(e,n,s)),["11-oclock","12-oclock","1-oclock"].includes(n)?o.insertBefore(l,o.firstChild):o.appendChild(l),i.containers.push(l),i.onUpdate(i.containers)},Rs=new WeakSet,Gr=function(e,i,n,s){const o=rr(e,n,s);for(let l=0;l<i.containers.length;l+=1){if(!o.every(c=>i.containers[l].classList.contains(c)))continue;const a=i.containers[l].parentNode;lr(a,ar),i.containers[l].remove(),i.containers.splice(l,1),l-=1}i.onUpdate(i.containers)},Ce(Ui,Ds),Ce(Ui,Rs),Ce(Ui,is,new jo(O(Ui,Ds,Jr),O(Ui,Rs,Gr)));let Oo=Ui;const T_=()=>he({type:"IdentifiersChanged",description:"The Player's content identifiers changed.",initiatedBy:"browser"}),vn=(i,...n)=>di(this,[i,...n],function*(t,e={}){const s=yield fetch(t,e).catch(()=>{}),o=yield s==null?void 0:s.json().catch(()=>{});return(s==null?void 0:s.status)!==200&&Jt(`Failed to fetch ${t}`,Ki(Zt({},e),{responseStatus:s==null?void 0:s.status,responseJson:o})),o}),A_=(t,e)=>vn(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e,(i,n)=>n===void 0?null:n)});class C_{constructor(e,i,n){Ce(this,Us);this.baseUrl=O(this,Us,Xr).call(this,e),this.projectId=i,this.writeToken=n}getWebSocketToken(){return di(this,null,function*(){const e={Authorization:`Token token=${this.writeToken}`},{token:i}=yield vn(`https://${this.baseUrl}/api/v4/token/ws`,{headers:e});this.webSocketToken=i})}establishConnection(e,i){return di(this,null,function*(){const n=`wss://${this.baseUrl}/cable?token=${this.webSocketToken}`,s="actioncable-v1-json";this.webSocket=new WebSocket(n,s),this.webSocket.onmessage=o=>e(JSON.parse(o.data)),this.webSocket.onerror=i,yield new Promise(o=>this.webSocket.onopen=o)})}subscribeToStatusChanges(){const e=JSON.stringify({channel:"Api::V1::ProjectChannel",id:this.projectId}),i=JSON.stringify({command:"subscribe",identifier:e});this.webSocket.send(i)}destroy(){this.webSocketToken=null,this.webSocket&&(this.webSocket.onmessage=()=>{},this.webSocket.onerror=()=>{},this.webSocket.close(),this.webSocket=null)}}Us=new WeakSet,Xr=function(e){return e.includes("staging")?"app.staging-beyondwords.io":"app.beyondwords.io"};let bn;const B_=(t,e,i,n)=>di(this,null,function*(){!t||!e||!i||(bn==null||bn.destroy(),bn=new C_(t,e,i),yield bn.getWebSocketToken(),yield bn.establishConnection(I_(n),j_),yield bn.subscribeToStatusChanges())}),I_=t=>e=>{var s,o;((o=(s=e==null?void 0:e.message)==null?void 0:s.result)==null?void 0:o.action)==="podcast_state_updated"&&V_(e,t),e.type==="reject_subscription"&&W_(e)},V_=(t,e)=>{const i=t.message.result;e(he({type:"ContentStatusChanged",description:"The processing status of a content item within the project changed.",initiatedBy:"websocket",contentId:i.content_id,legacyId:i.legacy_id,sourceId:i.source_id,sourceUrl:i.source_url,contentStatus:i.state}))},W_=t=>{Jt("The WebSocket status change subscription was rejected.",{webSocketEvent:t})},j_=t=>{Jt("Unexpected WebSocket error.",{error:t})},ur=t=>{if(!t())return new Promise(e=>{setInterval(()=>t()&&e(),10)})},Ws=t=>{const i=Object.keys(t.$$.props).filter(n=>!z_.has(n)).map(n=>[n,t[n]]);return Object.fromEntries(i)},z_=new Set(["addEventListener","removeEventListener","mediaElement","userInterface","widgetInterface","controller"]),cr=(t,e)=>{const i=new Set([...Object.keys(t),...Object.keys(e)]),n={};for(const s of i){const o=t[s],l=e[s];o!==l&&(n[s]={previousValue:o,currentValue:l})}return n};let Xn=-1;const dr=[],M_=(t,e,i)=>di(this,null,function*(){yield ur(()=>e.player);const n=e.player,s=O_(n.contentIndex,i,t);s>Xn&&E_(n,Xn,s,t),s<Xn&&L_(n,Xn,s),Xn=s}),O_=(t,e,i)=>{const n=i.findIndex(o=>o[0]===t&&o[1]>e||o[0]>t);return n===-1?i.length-1:n-1},E_=(t,e,i,n)=>{for(let s=e+1;s<=i;s+=1){const o=Ws(t);n[s][2](t);const l=Ws(t),r=cr(o,l);dr.push(r)}},L_=(t,e,i)=>{for(let n=e;n>i;n-=1){const s=dr.pop();for(const[o,l]of Object.entries(s))t[o]=l.previousValue}},x_=t=>t?N_(t)?{newTarget:R_(t),showUserInterface:!0}:typeof t=="string"?{newTarget:Eo(t),showUserInterface:!0}:{newTarget:t,showUserInterface:!0}:{newTarget:D_(),showUserInterface:!1},N_=t=>typeof t=="object"&&t.nodeName.toLowerCase()==="script",D_=()=>{const t=document.createElement("div");return document.body.appendChild(t),t},R_=t=>{const e=document.createElement("div");return t.parentNode.insertBefore(e,t.nextSibling),e},Eo=(t,e="player")=>{if(typeof t!="string")return t;const i=document.querySelectorAll(t);return i.length===0&&Jt(`Failed to initialize ${e} because the target could not be found.`,{target:t,elements:i}),i.length>1&&Jt(`Failed to initialize ${e} because the target is ambiguous. (${i.length} elements match)`,{target:t,elements:i}),i[0]};function gr(t,e,i){const n=t.slice();return n[140]=e[i],n}function fr(t){let e,i,n={onEvent:t[53],playerStyle:t[59],callToAction:t[23],skipButtonStyle:t[24],playlistStyle:t[25],playlistToggle:t[26],downloadFormats:t[47],playerTitle:t[22],content:t[48],contentIndex:t[7],duration:t[29],currentTime:t[11],playbackState:t[30],playbackRate:t[31],activeAdvert:t[56],persistentAdvert:t[62],textColor:t[34],backgroundColor:t[35],iconColor:t[36],logoIconEnabled:t[37],videoIsBehind:t[61]};return e=new Vo({props:n}),t[93](e),{c(){ce(e.$$.fragment)},m(s,o){re(e,s,o),i=!0},p(s,o){const l={};o[1]&268435456&&(l.playerStyle=s[59]),o[0]&8388608&&(l.callToAction=s[23]),o[0]&16777216&&(l.skipButtonStyle=s[24]),o[0]&33554432&&(l.playlistStyle=s[25]),o[0]&67108864&&(l.playlistToggle=s[26]),o[1]&65536&&(l.downloadFormats=s[47]),o[0]&4194304&&(l.playerTitle=s[22]),o[1]&131072&&(l.content=s[48]),o[0]&128&&(l.contentIndex=s[7]),o[0]&536870912&&(l.duration=s[29]),o[0]&2048&&(l.currentTime=s[11]),o[0]&1073741824&&(l.playbackState=s[30]),o[1]&1&&(l.playbackRate=s[31]),o[1]&33554432&&(l.activeAdvert=s[56]),o[2]&1&&(l.persistentAdvert=s[62]),o[1]&8&&(l.textColor=s[34]),o[1]&16&&(l.backgroundColor=s[35]),o[1]&32&&(l.iconColor=s[36]),o[1]&64&&(l.logoIconEnabled=s[37]),o[1]&1073741824&&(l.videoIsBehind=s[61]),e.$set(l)},i(s){i||(T(e.$$.fragment,s),i=!0)},o(s){j(e.$$.fragment,s),i=!1},d(s){t[93](null),ae(e,s)}}}function hr(t){let e,i;return e=new Wo({props:{root:t[13],$$slots:{default:[U_]},$$scope:{ctx:t}}}),{c(){ce(e.$$.fragment)},m(n,s){re(e,n,s),i=!0},p(n,s){const o={};s[0]&8192&&(o.root=n[13]),s[0]&1639987328|s[1]&167977087|s[2]&1|s[4]&524288&&(o.$$scope={dirty:s,ctx:n}),e.$set(o)},i(n){i||(T(e.$$.fragment,n),i=!0)},o(n){j(e.$$.fragment,n),i=!1},d(n){ae(e,n)}}}function U_(t){let e,i,n={onEvent:t[53],playerStyle:t[12],callToAction:t[23],skipButtonStyle:t[24],playlistStyle:"hide",playlistToggle:"hide",downloadFormats:t[47],playerTitle:t[22],fixedPosition:!t[13]&&t[32],fixedWidth:t[33],content:t[48],contentIndex:t[7],duration:t[29],currentTime:t[11],playbackState:t[30],playbackRate:t[31],activeAdvert:t[56],persistentAdvert:t[62],textColor:t[34],backgroundColor:t[35],iconColor:t[36],logoIconEnabled:t[37],videoIsBehind:t[58]};return e=new Vo({props:n}),t[94](e),{c(){ce(e.$$.fragment)},m(s,o){re(e,s,o),i=!0},p(s,o){const l={};o[0]&4096&&(l.playerStyle=s[12]),o[0]&8388608&&(l.callToAction=s[23]),o[0]&16777216&&(l.skipButtonStyle=s[24]),o[1]&65536&&(l.downloadFormats=s[47]),o[0]&4194304&&(l.playerTitle=s[22]),o[0]&8192|o[1]&2&&(l.fixedPosition=!s[13]&&s[32]),o[1]&4&&(l.fixedWidth=s[33]),o[1]&131072&&(l.content=s[48]),o[0]&128&&(l.contentIndex=s[7]),o[0]&536870912&&(l.duration=s[29]),o[0]&2048&&(l.currentTime=s[11]),o[0]&1073741824&&(l.playbackState=s[30]),o[1]&1&&(l.playbackRate=s[31]),o[1]&33554432&&(l.activeAdvert=s[56]),o[2]&1&&(l.persistentAdvert=s[62]),o[1]&8&&(l.textColor=s[34]),o[1]&16&&(l.backgroundColor=s[35]),o[1]&32&&(l.iconColor=s[36]),o[1]&64&&(l.logoIconEnabled=s[37]),o[1]&134217728&&(l.videoIsBehind=s[58]),e.$set(l)},i(s){i||(T(e.$$.fragment,s),i=!0)},o(s){j(e.$$.fragment,s),i=!1},d(s){t[94](null),ae(e,s)}}}function F_(t){let e,i;return e=new Vo({props:{onEvent:t[95],playerStyle:"small",fixedWidth:0,logoIconEnabled:!1,content:t[48],contentIndex:t[7],duration:t[29],currentTime:t[60]?t[11]:t[54].startTime,playbackState:t[60]?t[30]:"paused",activeAdvert:t[56],persistentAdvert:t[62],textColor:t[34],backgroundColor:t[35],iconColor:t[36]}}),{c(){ce(e.$$.fragment)},m(n,s){re(e,n,s),i=!0},p(n,s){const o={};s[1]&75497472&&(o.onEvent=n[95]),s[1]&131072&&(o.content=n[48]),s[0]&128&&(o.contentIndex=n[7]),s[0]&536870912&&(o.duration=n[29]),s[0]&2048|s[1]&545259520&&(o.currentTime=n[60]?n[11]:n[54].startTime),s[0]&1073741824|s[1]&536870912&&(o.playbackState=n[60]?n[30]:"paused"),s[1]&33554432&&(o.activeAdvert=n[56]),s[2]&1&&(o.persistentAdvert=n[62]),s[1]&8&&(o.textColor=n[34]),s[1]&16&&(o.backgroundColor=n[35]),s[1]&32&&(o.iconColor=n[36]),e.$set(o)},i(n){i||(T(e.$$.fragment,n),i=!0)},o(n){j(e.$$.fragment,n),i=!1},d(n){ae(e,n)}}}function _r(t,e){let i,n,s;return n=new Wo({props:{root:e[140],$$slots:{default:[F_]},$$scope:{ctx:e}}}),{key:t,first:null,c(){i=mn(),ce(n.$$.fragment),this.first=i},m(o,l){V(o,i,l),re(n,o,l),s=!0},p(o,l){e=o;const r={};l[1]&32768&&(r.root=e[140]),l[0]&1610614912|l[1]&646053944|l[2]&1|l[4]&524288&&(r.$$scope={dirty:l,ctx:e}),n.$set(r)},i(o){s||(T(n.$$.fragment,o),s=!0)},o(o){j(n.$$.fragment,o),s=!1},d(o){o&&B(i),ae(n,o)}}}function mr(t){let e,i;return e=new Wo({props:{root:t[21],$$slots:{default:[q_]},$$scope:{ctx:t}}}),{c(){ce(e.$$.fragment)},m(n,s){re(e,n,s),i=!0},p(n,s){const o={};s[0]&2097152&&(o.root=n[21]),s[0]&2145386495|s[1]&919551|s[4]&524288&&(o.$$scope={dirty:s,ctx:n}),e.$set(o)},i(n){i||(T(e.$$.fragment,n),i=!0)},o(n){j(e.$$.fragment,n),i=!1},d(n){ae(e,n)}}}function q_(t){let e,i,n,s,o,l,r,a,c,u,h,m,v,y,p,b,W,z,J,G,E,N,D,L,X,ue,ve,ee,H,Y,S,P,F,ge,se,I,R,Ae,we,qe,ye,Q,Pe;function Qe(w){t[96](w)}function Ne(w){t[97](w)}function dt(w){t[98](w)}function Ye(w){t[99](w)}function We(w){t[100](w)}function tt(w){t[101](w)}function je(w){t[102](w)}function it(w){t[103](w)}function Ee(w){t[104](w)}function Ze(w){t[105](w)}function Ke(w){t[106](w)}function nt(w){t[107](w)}function Ve(w){t[108](w)}function ze(w){t[109](w)}function U(w){t[110](w)}function xe(w){t[111](w)}function gt(w){t[112](w)}function bt(w){t[113](w)}function Je(w){t[114](w)}function Ge(w){t[115](w)}function st(w){t[116](w)}function $e(w){t[117](w)}function Pt(w){t[118](w)}function ot(w){t[119](w)}function kt(w){t[120](w)}function lt(w){t[121](w)}function rt(w){t[122](w)}function at(w){t[123](w)}function Vt(w){t[124](w)}function ft(w){t[125](w)}function zt(w){t[126](w)}function ht(w){t[127](w)}function At(w){t[128](w)}function Z(w){t[129](w)}function Xe(w){t[130](w)}function He(w){t[131](w)}function Ct(w){t[132](w)}function Bt(w){t[133](w)}function Rt(w){t[134](w)}function It(w){t[135](w)}function Yt(w){t[136](w)}let ne={content:t[48],introsOutros:t[49],adverts:t[50]};return t[0]!==void 0&&(ne.projectId=t[0]),t[1]!==void 0&&(ne.contentId=t[1]),t[2]!==void 0&&(ne.playlistId=t[2]),t[3]!==void 0&&(ne.sourceId=t[3]),t[4]!==void 0&&(ne.sourceUrl=t[4]),t[5]!==void 0&&(ne.showUserInterface=t[5]),t[6]!==void 0&&(ne.playerStyle=t[6]),t[22]!==void 0&&(ne.playerTitle=t[22]),t[23]!==void 0&&(ne.callToAction=t[23]),t[24]!==void 0&&(ne.skipButtonStyle=t[24]),t[25]!==void 0&&(ne.playlistStyle=t[25]),t[26]!==void 0&&(ne.playlistToggle=t[26]),t[27]!==void 0&&(ne.mediaSession=t[27]),t[7]!==void 0&&(ne.contentIndex=t[7]),t[8]!==void 0&&(ne.introsOutrosIndex=t[8]),t[9]!==void 0&&(ne.advertIndex=t[9]),t[28]!==void 0&&(ne.persistentAdImage=t[28]),t[10]!==void 0&&(ne.persistentIndex=t[10]),t[29]!==void 0&&(ne.duration=t[29]),t[11]!==void 0&&(ne.currentTime=t[11]),t[30]!==void 0&&(ne.playbackState=t[30]),t[31]!==void 0&&(ne.playbackRate=t[31]),t[12]!==void 0&&(ne.widgetStyle=t[12]),t[32]!==void 0&&(ne.widgetPosition=t[32]),t[33]!==void 0&&(ne.widgetWidth=t[33]),t[13]!==void 0&&(ne.widgetTarget=t[13]),t[34]!==void 0&&(ne.textColor=t[34]),t[35]!==void 0&&(ne.backgroundColor=t[35]),t[36]!==void 0&&(ne.iconColor=t[36]),t[14]!==void 0&&(ne.highlightColor=t[14]),t[37]!==void 0&&(ne.logoIconEnabled=t[37]),t[15]!==void 0&&(ne.highlightSections=t[15]),t[16]!==void 0&&(ne.clickableSections=t[16]),t[17]!==void 0&&(ne.segmentWidgetSections=t[17]),t[18]!==void 0&&(ne.segmentWidgetPosition=t[18]),t[19]!==void 0&&(ne.currentSegment=t[19]),t[20]!==void 0&&(ne.hoveredSegment=t[20]),t[38]!==void 0&&(ne.advertConsent=t[38]),t[39]!==void 0&&(ne.analyticsConsent=t[39]),t[40]!==void 0&&(ne.analyticsCustomUrl=t[40]),t[41]!==void 0&&(ne.analyticsTag=t[41]),e=new l_({props:ne}),ie.push(()=>me(e,"projectId",Qe)),ie.push(()=>me(e,"contentId",Ne)),ie.push(()=>me(e,"playlistId",dt)),ie.push(()=>me(e,"sourceId",Ye)),ie.push(()=>me(e,"sourceUrl",We)),ie.push(()=>me(e,"showUserInterface",tt)),ie.push(()=>me(e,"playerStyle",je)),ie.push(()=>me(e,"playerTitle",it)),ie.push(()=>me(e,"callToAction",Ee)),ie.push(()=>me(e,"skipButtonStyle",Ze)),ie.push(()=>me(e,"playlistStyle",Ke)),ie.push(()=>me(e,"playlistToggle",nt)),ie.push(()=>me(e,"mediaSession",Ve)),ie.push(()=>me(e,"contentIndex",ze)),ie.push(()=>me(e,"introsOutrosIndex",U)),ie.push(()=>me(e,"advertIndex",xe)),ie.push(()=>me(e,"persistentAdImage",gt)),ie.push(()=>me(e,"persistentIndex",bt)),ie.push(()=>me(e,"duration",Je)),ie.push(()=>me(e,"currentTime",Ge)),ie.push(()=>me(e,"playbackState",st)),ie.push(()=>me(e,"playbackRate",$e)),ie.push(()=>me(e,"widgetStyle",Pt)),ie.push(()=>me(e,"widgetPosition",ot)),ie.push(()=>me(e,"widgetWidth",kt)),ie.push(()=>me(e,"widgetTarget",lt)),ie.push(()=>me(e,"textColor",rt)),ie.push(()=>me(e,"backgroundColor",at)),ie.push(()=>me(e,"iconColor",Vt)),ie.push(()=>me(e,"highlightColor",ft)),ie.push(()=>me(e,"logoIconEnabled",zt)),ie.push(()=>me(e,"highlightSections",ht)),ie.push(()=>me(e,"clickableSections",At)),ie.push(()=>me(e,"segmentWidgetSections",Z)),ie.push(()=>me(e,"segmentWidgetPosition",Xe)),ie.push(()=>me(e,"currentSegment",He)),ie.push(()=>me(e,"hoveredSegment",Ct)),ie.push(()=>me(e,"advertConsent",Bt)),ie.push(()=>me(e,"analyticsConsent",Rt)),ie.push(()=>me(e,"analyticsCustomUrl",It)),ie.push(()=>me(e,"analyticsTag",Yt)),{c(){ce(e.$$.fragment)},m(w,A){re(e,w,A),Pe=!0},p(w,A){const te={};A[1]&131072&&(te.content=w[48]),A[1]&262144&&(te.introsOutros=w[49]),A[1]&524288&&(te.adverts=w[50]),!i&&A[0]&1&&(i=!0,te.projectId=w[0],_e(()=>i=!1)),!n&&A[0]&2&&(n=!0,te.contentId=w[1],_e(()=>n=!1)),!s&&A[0]&4&&(s=!0,te.playlistId=w[2],_e(()=>s=!1)),!o&&A[0]&8&&(o=!0,te.sourceId=w[3],_e(()=>o=!1)),!l&&A[0]&16&&(l=!0,te.sourceUrl=w[4],_e(()=>l=!1)),!r&&A[0]&32&&(r=!0,te.showUserInterface=w[5],_e(()=>r=!1)),!a&&A[0]&64&&(a=!0,te.playerStyle=w[6],_e(()=>a=!1)),!c&&A[0]&4194304&&(c=!0,te.playerTitle=w[22],_e(()=>c=!1)),!u&&A[0]&8388608&&(u=!0,te.callToAction=w[23],_e(()=>u=!1)),!h&&A[0]&16777216&&(h=!0,te.skipButtonStyle=w[24],_e(()=>h=!1)),!m&&A[0]&33554432&&(m=!0,te.playlistStyle=w[25],_e(()=>m=!1)),!v&&A[0]&67108864&&(v=!0,te.playlistToggle=w[26],_e(()=>v=!1)),!y&&A[0]&134217728&&(y=!0,te.mediaSession=w[27],_e(()=>y=!1)),!p&&A[0]&128&&(p=!0,te.contentIndex=w[7],_e(()=>p=!1)),!b&&A[0]&256&&(b=!0,te.introsOutrosIndex=w[8],_e(()=>b=!1)),!W&&A[0]&512&&(W=!0,te.advertIndex=w[9],_e(()=>W=!1)),!z&&A[0]&268435456&&(z=!0,te.persistentAdImage=w[28],_e(()=>z=!1)),!J&&A[0]&1024&&(J=!0,te.persistentIndex=w[10],_e(()=>J=!1)),!G&&A[0]&536870912&&(G=!0,te.duration=w[29],_e(()=>G=!1)),!E&&A[0]&2048&&(E=!0,te.currentTime=w[11],_e(()=>E=!1)),!N&&A[0]&1073741824&&(N=!0,te.playbackState=w[30],_e(()=>N=!1)),!D&&A[1]&1&&(D=!0,te.playbackRate=w[31],_e(()=>D=!1)),!L&&A[0]&4096&&(L=!0,te.widgetStyle=w[12],_e(()=>L=!1)),!X&&A[1]&2&&(X=!0,te.widgetPosition=w[32],_e(()=>X=!1)),!ue&&A[1]&4&&(ue=!0,te.widgetWidth=w[33],_e(()=>ue=!1)),!ve&&A[0]&8192&&(ve=!0,te.widgetTarget=w[13],_e(()=>ve=!1)),!ee&&A[1]&8&&(ee=!0,te.textColor=w[34],_e(()=>ee=!1)),!H&&A[1]&16&&(H=!0,te.backgroundColor=w[35],_e(()=>H=!1)),!Y&&A[1]&32&&(Y=!0,te.iconColor=w[36],_e(()=>Y=!1)),!S&&A[0]&16384&&(S=!0,te.highlightColor=w[14],_e(()=>S=!1)),!P&&A[1]&64&&(P=!0,te.logoIconEnabled=w[37],_e(()=>P=!1)),!F&&A[0]&32768&&(F=!0,te.highlightSections=w[15],_e(()=>F=!1)),!ge&&A[0]&65536&&(ge=!0,te.clickableSections=w[16],_e(()=>ge=!1)),!se&&A[0]&131072&&(se=!0,te.segmentWidgetSections=w[17],_e(()=>se=!1)),!I&&A[0]&262144&&(I=!0,te.segmentWidgetPosition=w[18],_e(()=>I=!1)),!R&&A[0]&524288&&(R=!0,te.currentSegment=w[19],_e(()=>R=!1)),!Ae&&A[0]&1048576&&(Ae=!0,te.hoveredSegment=w[20],_e(()=>Ae=!1)),!we&&A[1]&128&&(we=!0,te.advertConsent=w[38],_e(()=>we=!1)),!qe&&A[1]&256&&(qe=!0,te.analyticsConsent=w[39],_e(()=>qe=!1)),!ye&&A[1]&512&&(ye=!0,te.analyticsCustomUrl=w[40],_e(()=>ye=!1)),!Q&&A[1]&1024&&(Q=!0,te.analyticsTag=w[41],_e(()=>Q=!1)),e.$set(te)},i(w){Pe||(T(e.$$.fragment,w),Pe=!0)},o(w){j(e.$$.fragment,w),Pe=!1},d(w){ae(e,w)}}}function yr(t){let e,i;return e=new v_({props:{onEvent:t[53],content:t[48],contentIndex:t[7],activeAdvert:t[56],persistentAdvert:t[62],duration:t[29],playbackState:t[30],skipButtonStyle:t[24],backgroundColor:t[35],iconColor:t[36]}}),{c(){ce(e.$$.fragment)},m(n,s){re(e,n,s),i=!0},p(n,s){const o={};s[1]&131072&&(o.content=n[48]),s[0]&128&&(o.contentIndex=n[7]),s[1]&33554432&&(o.activeAdvert=n[56]),s[2]&1&&(o.persistentAdvert=n[62]),s[0]&536870912&&(o.duration=n[29]),s[0]&1073741824&&(o.playbackState=n[30]),s[0]&16777216&&(o.skipButtonStyle=n[24]),s[1]&16&&(o.backgroundColor=n[35]),s[1]&32&&(o.iconColor=n[36]),e.$set(o)},i(n){i||(T(e.$$.fragment,n),i=!0)},o(n){j(e.$$.fragment,n),i=!1},d(n){ae(e,n)}}}function vr(t){let e,i;return e=new w_({props:{analyticsTag:t[41]}}),{c(){ce(e.$$.fragment)},m(n,s){re(e,n,s),i=!0},p(n,s){const o={};s[1]&1024&&(o.analyticsTag=n[41]),e.$set(o)},i(n){i||(T(e.$$.fragment,n),i=!0)},o(n){j(e.$$.fragment,n),i=!1},d(n){ae(e,n)}}}function H_(t){let e,i,n,s,o,l,r,a,c,u=[],h=new Map,m,v,y,p,b,W;function z(S){t[88](S)}function J(S){t[89](S)}function G(S){t[90](S)}function E(S){t[91](S)}function N(S){t[92](S)}let D={onEvent:t[53],content:t[48],contentIndex:t[7],introOrOutro:t[55],activeAdvert:t[56],advertConsent:t[38],videoBehindWidget:t[58],videoBehindStatic:t[61],widgetPosition:t[32],widgetWidth:t[33]};t[30]!==void 0&&(D.playbackState=t[30]),t[29]!==void 0&&(D.duration=t[29]),t[11]!==void 0&&(D.currentTime=t[11]),t[31]!==void 0&&(D.playbackRate=t[31]),t[45]!==void 0&&(D.prevPercentage=t[45]),e=new hd({props:D}),t[87](e),ie.push(()=>me(e,"playbackState",z)),ie.push(()=>me(e,"duration",J)),ie.push(()=>me(e,"currentTime",G)),ie.push(()=>me(e,"playbackRate",E)),ie.push(()=>me(e,"prevPercentage",N));let L=t[5]&&fr(t),X=(t[51]||t[13])&&hr(t),ue=t[46];const ve=S=>S[140];for(let S=0;S<ue.length;S+=1){let P=gr(t,ue,S),F=ve(P);h.set(F,u[S]=_r(F,P))}let ee=t[21]&&mr(t),H=t[52]&&yr(t),Y=t[41]&&vr(t);return b=new P_({}),{c(){ce(e.$$.fragment),r=K(),L&&L.c(),a=K(),X&&X.c(),c=K();for(let S=0;S<u.length;S+=1)u[S].c();m=K(),ee&&ee.c(),v=K(),H&&H.c(),y=K(),Y&&Y.c(),p=K(),ce(b.$$.fragment)},m(S,P){re(e,S,P),V(S,r,P),L&&L.m(S,P),V(S,a,P),X&&X.m(S,P),V(S,c,P);for(let F=0;F<u.length;F+=1)u[F]&&u[F].m(S,P);V(S,m,P),ee&&ee.m(S,P),V(S,v,P),H&&H.m(S,P),V(S,y,P),Y&&Y.m(S,P),V(S,p,P),re(b,S,P),W=!0},p(S,P){const F={};P[1]&131072&&(F.content=S[48]),P[0]&128&&(F.contentIndex=S[7]),P[1]&16777216&&(F.introOrOutro=S[55]),P[1]&33554432&&(F.activeAdvert=S[56]),P[1]&128&&(F.advertConsent=S[38]),P[1]&134217728&&(F.videoBehindWidget=S[58]),P[1]&1073741824&&(F.videoBehindStatic=S[61]),P[1]&2&&(F.widgetPosition=S[32]),P[1]&4&&(F.widgetWidth=S[33]),!i&&P[0]&1073741824&&(i=!0,F.playbackState=S[30],_e(()=>i=!1)),!n&&P[0]&536870912&&(n=!0,F.duration=S[29],_e(()=>n=!1)),!s&&P[0]&2048&&(s=!0,F.currentTime=S[11],_e(()=>s=!1)),!o&&P[1]&1&&(o=!0,F.playbackRate=S[31],_e(()=>o=!1)),!l&&P[1]&16384&&(l=!0,F.prevPercentage=S[45],_e(()=>l=!1)),e.$set(F),S[5]?L?(L.p(S,P),P[0]&32&&T(L,1)):(L=fr(S),L.c(),T(L,1),L.m(a.parentNode,a)):L&&(De(),j(L,1,1,()=>{L=null}),Re()),S[51]||S[13]?X?(X.p(S,P),P[0]&8192|P[1]&1048576&&T(X,1)):(X=hr(S),X.c(),T(X,1),X.m(c.parentNode,c)):X&&(De(),j(X,1,1,()=>{X=null}),Re()),P[0]&1610614912|P[1]&650281016|P[2]&1&&(ue=S[46],De(),u=Wa(u,P,ve,1,S,ue,h,m.parentNode,Va,_r,m,gr),Re()),S[21]?ee?(ee.p(S,P),P[0]&2097152&&T(ee,1)):(ee=mr(S),ee.c(),T(ee,1),ee.m(v.parentNode,v)):ee&&(De(),j(ee,1,1,()=>{ee=null}),Re()),S[52]?H?(H.p(S,P),P[1]&2097152&&T(H,1)):(H=yr(S),H.c(),T(H,1),H.m(y.parentNode,y)):H&&(De(),j(H,1,1,()=>{H=null}),Re()),S[41]?Y?(Y.p(S,P),P[1]&1024&&T(Y,1)):(Y=vr(S),Y.c(),T(Y,1),Y.m(p.parentNode,p)):Y&&(De(),j(Y,1,1,()=>{Y=null}),Re())},i(S){if(!W){T(e.$$.fragment,S),T(L),T(X);for(let P=0;P<ue.length;P+=1)T(u[P]);T(ee),T(H),T(Y),T(b.$$.fragment,S),W=!0}},o(S){j(e.$$.fragment,S),j(L),j(X);for(let P=0;P<u.length;P+=1)j(u[P]);j(ee),j(H),j(Y),j(b.$$.fragment,S),W=!1},d(S){t[87](null),ae(e,S),S&&B(r),L&&L.d(S),S&&B(a),X&&X.d(S),S&&B(c);for(let P=0;P<u.length;P+=1)u[P].d(S);S&&B(m),ee&&ee.d(S),S&&B(v),H&&H.d(S),S&&B(y),Y&&Y.d(S),S&&B(p),ae(b,S)}}}function Y_(t,e,i){let n,s,o,l,r,a,c,u,h,m,v,y,p,{playerApiUrl:b="https://api.beyondwords.io/v1/projects/{id}/player"}=e,{projectId:W=void 0}=e,{contentId:z=void 0}=e,{playlistId:J=void 0}=e,{sourceId:G=void 0}=e,{sourceUrl:E=void 0}=e,{playlist:N=[]}=e,{showUserInterface:D=!0}=e,{playerStyle:L="standard"}=e,{playerTitle:X=void 0}=e,{callToAction:ue=void 0}=e,{skipButtonStyle:ve="auto"}=e,{playlistStyle:ee="auto-5-4"}=e,{playlistToggle:H="auto"}=e,{downloadFormats:Y=[]}=e,{mediaSession:S="auto"}=e,{content:P=[]}=e,{contentIndex:F=0}=e,{introsOutros:ge=[]}=e,{introsOutrosIndex:se=-1}=e,{adverts:I=[]}=e,{advertIndex:R=-1}=e,{persistentAdImage:Ae=!1}=e,{persistentIndex:we=-1}=e,{duration:qe=0}=e,{currentTime:ye=0}=e,{playbackState:Q="stopped"}=e,{playbackRate:Pe=1}=e,{playbackRates:Qe=[.5,.6,.7,.8,.9,1,1.1,1.2,1.3,1.4,1.5,2,2.5,3]}=e,{widgetStyle:Ne="standard"}=e,{widgetPosition:dt="auto"}=e,{widgetWidth:Ye="auto"}=e,{widgetTarget:We=void 0}=e,{textColor:tt="#111"}=e,{backgroundColor:je="#f5f5f5"}=e,{iconColor:it="rgba(0, 0, 0, 0.8)"}=e,{highlightColor:Ee="#eee"}=e,{logoIconEnabled:Ze=!0}=e,{highlightSections:Ke="all"}=e,{clickableSections:nt="all"}=e,{segmentWidgetSections:Ve="body"}=e,{segmentWidgetPosition:ze="7-oclock"}=e,{currentSegment:U=void 0}=e,{hoveredSegment:xe=void 0}=e,{loadedMedia:gt=void 0}=e,{advertConsent:bt="personalized"}=e,{analyticsConsent:Je="allowed"}=e,{analyticsCustomUrl:Ge=void 0}=e,{analyticsTag:st=void 0}=e,{writeToken:$e=void 0}=e,{captureErrors:Pt=!0}=e,{onError:ot=()=>{}}=e,{transitions:kt=[]}=e,{controlPanel:lt=void 0}=e;const rt=(...f)=>He.addEventListener(...f),at=(...f)=>He.removeEventListener(...f);let{initialProps:Vt={}}=e,{showBottomWidget:ft=!1}=e,{showMediaSession:zt=!1}=e,{isFullScreen:ht=!1}=e,{mediaElement:At=void 0}=e,{userInterface:Z=void 0}=e,{widgetInterface:Xe=void 0}=e,{controller:He=void 0}=e,{analyticsUrl:Ct=void 0}=e,{analyticsId:Bt=void 0}=e,{listenSessionId:Rt=void 0}=e,{sessionCreatedAt:It=void 0}=e,{isNewListen:Yt=!1}=e,{prevPercentage:ne=0}=e,{segmentWidgets:w=[]}=e,{segmentContainers:A=new Oo(f=>i(46,w=f))}=e,{segmentClickables:te=new Mo}=e,{segmentHighlights:mi=new zo}=e;const Ut=f=>He.processEvent(Zt({emittedFrom:r},f)),Sn=()=>i(85,u=xe);function _t(f){ie[f?"unshift":"push"](()=>{At=f,i(42,At)})}function yi(f){Q=f,i(30,Q)}function si(f){qe=f,i(29,qe)}function vi(f){ye=f,i(11,ye)}function Gt(f){Pe=f,i(31,Pe)}function bi(f){ne=f,i(45,ne)}function Mi(f){ie[f?"unshift":"push"](()=>{Z=f,i(43,Z)})}function oi(f){ie[f?"unshift":"push"](()=>{Xe=f,i(44,Xe)})}const Xt=f=>Ut(Ki(Zt({},f),{emittedFrom:"segment-widget",widgetSegment:v,widgetIsCurrent:y}));function ki(f){W=f,i(0,W)}function Oi(f){z=f,i(1,z)}function li(f){J=f,i(2,J)}function Wt(f){G=f,i(3,G)}function pi(f){E=f,i(4,E)}function Qt(f){D=f,i(5,D)}function ut(f){L=f,i(6,L)}function $t(f){X=f,i(22,X)}function ct(f){ue=f,i(23,ue)}function Si(f){ve=f,i(24,ve)}function mt(f){ee=f,i(25,ee)}function k(f){H=f,i(26,H)}function q(f){S=f,i(27,S)}function oe(f){F=f,i(7,F)}function Ft(f){se=f,i(8,se)}function on(f){R=f,i(9,R)}function ln(f){Ae=f,i(28,Ae)}function rn(f){we=f,i(10,we)}function to(f){qe=f,i(29,qe)}function wn(f){ye=f,i(11,ye)}function io(f){Q=f,i(30,Q)}function ei(f){Pe=f,i(31,Pe)}function an(f){Ne=f,i(12,Ne)}function un(f){dt=f,i(32,dt)}function cn(f){Ye=f,i(33,Ye)}function dn(f){We=f,i(13,We)}function gn(f){tt=f,i(34,tt)}function no(f){je=f,i(35,je)}function Pn(f){it=f,i(36,it)}function so(f){Ee=f,i(14,Ee)}function wi(f){Ze=f,i(37,Ze)}function oo(f){Ke=f,i(15,Ke)}function rs(f){nt=f,i(16,nt)}function lo(f){Ve=f,i(17,Ve)}function ro(f){ze=f,i(18,ze)}function as(f){U=f,i(19,U)}function ao(f){xe=f,i(20,xe)}function fn(f){bt=f,i(38,bt)}function qt(f){Je=f,i(39,Je)}function Uo(f){Ge=f,i(40,Ge)}function Tn(f){st=f,i(41,st)}return t.$$set=f=>{"playerApiUrl"in f&&i(63,b=f.playerApiUrl),"projectId"in f&&i(0,W=f.projectId),"contentId"in f&&i(1,z=f.contentId),"playlistId"in f&&i(2,J=f.playlistId),"sourceId"in f&&i(3,G=f.sourceId),"sourceUrl"in f&&i(4,E=f.sourceUrl),"playlist"in f&&i(64,N=f.playlist),"showUserInterface"in f&&i(5,D=f.showUserInterface),"playerStyle"in f&&i(6,L=f.playerStyle),"playerTitle"in f&&i(22,X=f.playerTitle),"callToAction"in f&&i(23,ue=f.callToAction),"skipButtonStyle"in f&&i(24,ve=f.skipButtonStyle),"playlistStyle"in f&&i(25,ee=f.playlistStyle),"playlistToggle"in f&&i(26,H=f.playlistToggle),"downloadFormats"in f&&i(47,Y=f.downloadFormats),"mediaSession"in f&&i(27,S=f.mediaSession),"content"in f&&i(48,P=f.content),"contentIndex"in f&&i(7,F=f.contentIndex),"introsOutros"in f&&i(49,ge=f.introsOutros),"introsOutrosIndex"in f&&i(8,se=f.introsOutrosIndex),"adverts"in f&&i(50,I=f.adverts),"advertIndex"in f&&i(9,R=f.advertIndex),"persistentAdImage"in f&&i(28,Ae=f.persistentAdImage),"persistentIndex"in f&&i(10,we=f.persistentIndex),"duration"in f&&i(29,qe=f.duration),"currentTime"in f&&i(11,ye=f.currentTime),"playbackState"in f&&i(30,Q=f.playbackState),"playbackRate"in f&&i(31,Pe=f.playbackRate),"playbackRates"in f&&i(65,Qe=f.playbackRates),"widgetStyle"in f&&i(12,Ne=f.widgetStyle),"widgetPosition"in f&&i(32,dt=f.widgetPosition),"widgetWidth"in f&&i(33,Ye=f.widgetWidth),"widgetTarget"in f&&i(13,We=f.widgetTarget),"textColor"in f&&i(34,tt=f.textColor),"backgroundColor"in f&&i(35,je=f.backgroundColor),"iconColor"in f&&i(36,it=f.iconColor),"highlightColor"in f&&i(14,Ee=f.highlightColor),"logoIconEnabled"in f&&i(37,Ze=f.logoIconEnabled),"highlightSections"in f&&i(15,Ke=f.highlightSections),"clickableSections"in f&&i(16,nt=f.clickableSections),"segmentWidgetSections"in f&&i(17,Ve=f.segmentWidgetSections),"segmentWidgetPosition"in f&&i(18,ze=f.segmentWidgetPosition),"currentSegment"in f&&i(19,U=f.currentSegment),"hoveredSegment"in f&&i(20,xe=f.hoveredSegment),"loadedMedia"in f&&i(66,gt=f.loadedMedia),"advertConsent"in f&&i(38,bt=f.advertConsent),"analyticsConsent"in f&&i(39,Je=f.analyticsConsent),"analyticsCustomUrl"in f&&i(40,Ge=f.analyticsCustomUrl),"analyticsTag"in f&&i(41,st=f.analyticsTag),"writeToken"in f&&i(67,$e=f.writeToken),"captureErrors"in f&&i(68,Pt=f.captureErrors),"onError"in f&&i(69,ot=f.onError),"transitions"in f&&i(70,kt=f.transitions),"controlPanel"in f&&i(21,lt=f.controlPanel),"initialProps"in f&&i(73,Vt=f.initialProps),"showBottomWidget"in f&&i(51,ft=f.showBottomWidget),"showMediaSession"in f&&i(52,zt=f.showMediaSession),"isFullScreen"in f&&i(74,ht=f.isFullScreen),"mediaElement"in f&&i(42,At=f.mediaElement),"userInterface"in f&&i(43,Z=f.userInterface),"widgetInterface"in f&&i(44,Xe=f.widgetInterface),"controller"in f&&i(75,He=f.controller),"analyticsUrl"in f&&i(76,Ct=f.analyticsUrl),"analyticsId"in f&&i(77,Bt=f.analyticsId),"listenSessionId"in f&&i(78,Rt=f.listenSessionId),"sessionCreatedAt"in f&&i(79,It=f.sessionCreatedAt),"isNewListen"in f&&i(80,Yt=f.isNewListen),"prevPercentage"in f&&i(45,ne=f.prevPercentage),"segmentWidgets"in f&&i(46,w=f.segmentWidgets),"segmentContainers"in f&&i(81,A=f.segmentContainers),"segmentClickables"in f&&i(82,te=f.segmentClickables),"segmentHighlights"in f&&i(83,mi=f.segmentHighlights)},t.$$.update=()=>{t.$$.dirty[0]&256|t.$$.dirty[1]&262144&&i(55,n=ge[se]),t.$$.dirty[0]&512|t.$$.dirty[1]&524288&&i(56,s=I[R]),t.$$.dirty[0]&1024|t.$$.dirty[1]&524288&&i(62,o=I[we]),t.$$.dirty[0]&128|t.$$.dirty[1]&131072&&P[F],t.$$.dirty[0]&64|t.$$.dirty[2]&4096&&i(59,l=ht?"video":L),t.$$.dirty[0]&4096|t.$$.dirty[1]&1048576|t.$$.dirty[2]&4096&&i(58,a=ft&&Ne==="video"&&!ht),t.$$.dirty[1]&134217728&&(r=a?"bottom-widget":"inline-player"),t.$$.dirty[0]&8192&&i(13,We=Eo(We,"widget")),t.$$.dirty[0]&2097152&&i(21,lt=Eo(lt,"control panel")),t.$$.dirty[0]&32|t.$$.dirty[1]&402653184&&i(61,c=D&&l==="video"&&!a),t.$$.dirty[0]&31|t.$$.dirty[2]&4&&Ut(T_()),t.$$.dirty[0]&1|t.$$.dirty[2]&34&&B_(b,W,$e,f=>Ut(f)),t.$$.dirty[0]&1048576|t.$$.dirty[2]&8388608&&i(85,u=xe||u),t.$$.dirty[0]&655360&&i(84,h=Gn("current",U,Ve)),t.$$.dirty[0]&524288|t.$$.dirty[2]&4194304&&h&&Sn(),t.$$.dirty[0]&131072|t.$$.dirty[2]&8388608&&i(86,m=Gn("hovered",u,Ve)),t.$$.dirty[0]&524288|t.$$.dirty[2]&29360128&&i(54,v=m&&u||h&&U),t.$$.dirty[0]&524288|t.$$.dirty[1]&8388608&&i(57,y=(v==null?void 0:v.marker)===(U==null?void 0:U.marker)),t.$$.dirty[1]&117440512&&i(60,p=y||s||n),t.$$.dirty[0]&393280|t.$$.dirty[1]&8388608|t.$$.dirty[2]&524288&&A.update(v,Ve,ze,L),t.$$.dirty[0]&1114112|t.$$.dirty[2]&1048576&&te.update(xe,nt),t.$$.dirty[0]&573440|t.$$.dirty[2]&2097152&&mi.update("current",U,Ke,Ee),t.$$.dirty[0]&1097728|t.$$.dirty[2]&2097152&&mi.update("hovered",xe,Ke,Ee),t.$$.dirty[0]&2048|t.$$.dirty[2]&8448&&M_(kt,He,ye)},[W,z,J,G,E,D,L,F,se,R,we,ye,Ne,We,Ee,Ke,nt,Ve,ze,U,xe,lt,X,ue,ve,ee,H,S,Ae,qe,Q,Pe,dt,Ye,tt,je,it,Ze,bt,Je,Ge,st,At,Z,Xe,ne,w,Y,P,ge,I,ft,zt,Ut,v,n,s,y,a,l,p,c,o,b,N,Qe,gt,$e,Pt,ot,kt,rt,at,Vt,ht,He,Ct,Bt,Rt,It,Yt,A,te,mi,h,u,m,_t,yi,si,vi,Gt,bi,Mi,oi,Xt,ki,Oi,li,Wt,pi,Qt,ut,$t,ct,Si,mt,k,q,oe,Ft,on,ln,rn,to,wn,io,ei,an,un,cn,dn,gn,no,Pn,so,wi,oo,rs,lo,ro,as,ao,fn,qt,Uo,Tn]}let Z_=class extends pe{constructor(e){super(),ke(this,e,Y_,H_,fe,{playerApiUrl:63,projectId:0,contentId:1,playlistId:2,sourceId:3,sourceUrl:4,playlist:64,showUserInterface:5,playerStyle:6,playerTitle:22,callToAction:23,skipButtonStyle:24,playlistStyle:25,playlistToggle:26,downloadFormats:47,mediaSession:27,content:48,contentIndex:7,introsOutros:49,introsOutrosIndex:8,adverts:50,advertIndex:9,persistentAdImage:28,persistentIndex:10,duration:29,currentTime:11,playbackState:30,playbackRate:31,playbackRates:65,widgetStyle:12,widgetPosition:32,widgetWidth:33,widgetTarget:13,textColor:34,backgroundColor:35,iconColor:36,highlightColor:14,logoIconEnabled:37,highlightSections:15,clickableSections:16,segmentWidgetSections:17,segmentWidgetPosition:18,currentSegment:19,hoveredSegment:20,loadedMedia:66,advertConsent:38,analyticsConsent:39,analyticsCustomUrl:40,analyticsTag:41,writeToken:67,captureErrors:68,onError:69,transitions:70,controlPanel:21,addEventListener:71,removeEventListener:72,initialProps:73,showBottomWidget:51,showMediaSession:52,isFullScreen:74,mediaElement:42,userInterface:43,widgetInterface:44,controller:75,analyticsUrl:76,analyticsId:77,listenSessionId:78,sessionCreatedAt:79,isNewListen:80,prevPercentage:45,segmentWidgets:46,segmentContainers:81,segmentClickables:82,segmentHighlights:83,onEvent:53},null,[-1,-1,-1,-1,-1])}get playerApiUrl(){return this.$$.ctx[63]}set playerApiUrl(e){this.$$set({playerApiUrl:e}),d()}get projectId(){return this.$$.ctx[0]}set projectId(e){this.$$set({projectId:e}),d()}get contentId(){return this.$$.ctx[1]}set contentId(e){this.$$set({contentId:e}),d()}get playlistId(){return this.$$.ctx[2]}set playlistId(e){this.$$set({playlistId:e}),d()}get sourceId(){return this.$$.ctx[3]}set sourceId(e){this.$$set({sourceId:e}),d()}get sourceUrl(){return this.$$.ctx[4]}set sourceUrl(e){this.$$set({sourceUrl:e}),d()}get playlist(){return this.$$.ctx[64]}set playlist(e){this.$$set({playlist:e}),d()}get showUserInterface(){return this.$$.ctx[5]}set showUserInterface(e){this.$$set({showUserInterface:e}),d()}get playerStyle(){return this.$$.ctx[6]}set playerStyle(e){this.$$set({playerStyle:e}),d()}get playerTitle(){return this.$$.ctx[22]}set playerTitle(e){this.$$set({playerTitle:e}),d()}get callToAction(){return this.$$.ctx[23]}set callToAction(e){this.$$set({callToAction:e}),d()}get skipButtonStyle(){return this.$$.ctx[24]}set skipButtonStyle(e){this.$$set({skipButtonStyle:e}),d()}get playlistStyle(){return this.$$.ctx[25]}set playlistStyle(e){this.$$set({playlistStyle:e}),d()}get playlistToggle(){return this.$$.ctx[26]}set playlistToggle(e){this.$$set({playlistToggle:e}),d()}get downloadFormats(){return this.$$.ctx[47]}set downloadFormats(e){this.$$set({downloadFormats:e}),d()}get mediaSession(){return this.$$.ctx[27]}set mediaSession(e){this.$$set({mediaSession:e}),d()}get content(){return this.$$.ctx[48]}set content(e){this.$$set({content:e}),d()}get contentIndex(){return this.$$.ctx[7]}set contentIndex(e){this.$$set({contentIndex:e}),d()}get introsOutros(){return this.$$.ctx[49]}set introsOutros(e){this.$$set({introsOutros:e}),d()}get introsOutrosIndex(){return this.$$.ctx[8]}set introsOutrosIndex(e){this.$$set({introsOutrosIndex:e}),d()}get adverts(){return this.$$.ctx[50]}set adverts(e){this.$$set({adverts:e}),d()}get advertIndex(){return this.$$.ctx[9]}set advertIndex(e){this.$$set({advertIndex:e}),d()}get persistentAdImage(){return this.$$.ctx[28]}set persistentAdImage(e){this.$$set({persistentAdImage:e}),d()}get persistentIndex(){return this.$$.ctx[10]}set persistentIndex(e){this.$$set({persistentIndex:e}),d()}get duration(){return this.$$.ctx[29]}set duration(e){this.$$set({duration:e}),d()}get currentTime(){return this.$$.ctx[11]}set currentTime(e){this.$$set({currentTime:e}),d()}get playbackState(){return this.$$.ctx[30]}set playbackState(e){this.$$set({playbackState:e}),d()}get playbackRate(){return this.$$.ctx[31]}set playbackRate(e){this.$$set({playbackRate:e}),d()}get playbackRates(){return this.$$.ctx[65]}set playbackRates(e){this.$$set({playbackRates:e}),d()}get widgetStyle(){return this.$$.ctx[12]}set widgetStyle(e){this.$$set({widgetStyle:e}),d()}get widgetPosition(){return this.$$.ctx[32]}set widgetPosition(e){this.$$set({widgetPosition:e}),d()}get widgetWidth(){return this.$$.ctx[33]}set widgetWidth(e){this.$$set({widgetWidth:e}),d()}get widgetTarget(){return this.$$.ctx[13]}set widgetTarget(e){this.$$set({widgetTarget:e}),d()}get textColor(){return this.$$.ctx[34]}set textColor(e){this.$$set({textColor:e}),d()}get backgroundColor(){return this.$$.ctx[35]}set backgroundColor(e){this.$$set({backgroundColor:e}),d()}get iconColor(){return this.$$.ctx[36]}set iconColor(e){this.$$set({iconColor:e}),d()}get highlightColor(){return this.$$.ctx[14]}set highlightColor(e){this.$$set({highlightColor:e}),d()}get logoIconEnabled(){return this.$$.ctx[37]}set logoIconEnabled(e){this.$$set({logoIconEnabled:e}),d()}get highlightSections(){return this.$$.ctx[15]}set highlightSections(e){this.$$set({highlightSections:e}),d()}get clickableSections(){return this.$$.ctx[16]}set clickableSections(e){this.$$set({clickableSections:e}),d()}get segmentWidgetSections(){return this.$$.ctx[17]}set segmentWidgetSections(e){this.$$set({segmentWidgetSections:e}),d()}get segmentWidgetPosition(){return this.$$.ctx[18]}set segmentWidgetPosition(e){this.$$set({segmentWidgetPosition:e}),d()}get currentSegment(){return this.$$.ctx[19]}set currentSegment(e){this.$$set({currentSegment:e}),d()}get hoveredSegment(){return this.$$.ctx[20]}set hoveredSegment(e){this.$$set({hoveredSegment:e}),d()}get loadedMedia(){return this.$$.ctx[66]}set loadedMedia(e){this.$$set({loadedMedia:e}),d()}get advertConsent(){return this.$$.ctx[38]}set advertConsent(e){this.$$set({advertConsent:e}),d()}get analyticsConsent(){return this.$$.ctx[39]}set analyticsConsent(e){this.$$set({analyticsConsent:e}),d()}get analyticsCustomUrl(){return this.$$.ctx[40]}set analyticsCustomUrl(e){this.$$set({analyticsCustomUrl:e}),d()}get analyticsTag(){return this.$$.ctx[41]}set analyticsTag(e){this.$$set({analyticsTag:e}),d()}get writeToken(){return this.$$.ctx[67]}set writeToken(e){this.$$set({writeToken:e}),d()}get captureErrors(){return this.$$.ctx[68]}set captureErrors(e){this.$$set({captureErrors:e}),d()}get onError(){return this.$$.ctx[69]}set onError(e){this.$$set({onError:e}),d()}get transitions(){return this.$$.ctx[70]}set transitions(e){this.$$set({transitions:e}),d()}get controlPanel(){return this.$$.ctx[21]}set controlPanel(e){this.$$set({controlPanel:e}),d()}get addEventListener(){return this.$$.ctx[71]}get removeEventListener(){return this.$$.ctx[72]}get initialProps(){return this.$$.ctx[73]}set initialProps(e){this.$$set({initialProps:e}),d()}get showBottomWidget(){return this.$$.ctx[51]}set showBottomWidget(e){this.$$set({showBottomWidget:e}),d()}get showMediaSession(){return this.$$.ctx[52]}set showMediaSession(e){this.$$set({showMediaSession:e}),d()}get isFullScreen(){return this.$$.ctx[74]}set isFullScreen(e){this.$$set({isFullScreen:e}),d()}get mediaElement(){return this.$$.ctx[42]}set mediaElement(e){this.$$set({mediaElement:e}),d()}get userInterface(){return this.$$.ctx[43]}set userInterface(e){this.$$set({userInterface:e}),d()}get widgetInterface(){return this.$$.ctx[44]}set widgetInterface(e){this.$$set({widgetInterface:e}),d()}get controller(){return this.$$.ctx[75]}set controller(e){this.$$set({controller:e}),d()}get analyticsUrl(){return this.$$.ctx[76]}set analyticsUrl(e){this.$$set({analyticsUrl:e}),d()}get analyticsId(){return this.$$.ctx[77]}set analyticsId(e){this.$$set({analyticsId:e}),d()}get listenSessionId(){return this.$$.ctx[78]}set listenSessionId(e){this.$$set({listenSessionId:e}),d()}get sessionCreatedAt(){return this.$$.ctx[79]}set sessionCreatedAt(e){this.$$set({sessionCreatedAt:e}),d()}get isNewListen(){return this.$$.ctx[80]}set isNewListen(e){this.$$set({isNewListen:e}),d()}get prevPercentage(){return this.$$.ctx[45]}set prevPercentage(e){this.$$set({prevPercentage:e}),d()}get segmentWidgets(){return this.$$.ctx[46]}set segmentWidgets(e){this.$$set({segmentWidgets:e}),d()}get segmentContainers(){return this.$$.ctx[81]}set segmentContainers(e){this.$$set({segmentContainers:e}),d()}get segmentClickables(){return this.$$.ctx[82]}set segmentClickables(e){this.$$set({segmentClickables:e}),d()}get segmentHighlights(){return this.$$.ctx[83]}set segmentHighlights(e){this.$$set({segmentHighlights:e}),d()}get onEvent(){return this.$$.ctx[53]}};class K_{constructor(e,i){this.baseUrl=e==null?void 0:e.replace("{id}",i)}byContentId(e){return vn(`${this.baseUrl}/by_content_id/${e}`)}byPlaylistId(e){return vn(`${this.baseUrl}/by_playlist_id/${e}`)}bySourceId(e){return vn(`${this.baseUrl}/by_source_id/${e}`)}bySourceUrl(e){return vn(`${this.baseUrl}/by_source_url/${e}`)}byIdentifiers(e){return vn(`${this.baseUrl}/by_identifiers/${encodeURIComponent(JSON.stringify(e))}`)}}const Lo=t=>typeof t!="object"||t===null?t:Array.isArray(t)?t.map(Lo):Object.fromEntries(Object.entries(t).map(([e,i])=>[e.replace(/([A-Z])/g,n=>`_${n.toLowerCase()}`),Lo(i)])),br=t=>t==="dark"||t==="auto"&&J_()?"dark":"light",J_=()=>window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches,kr=t=>di(this,null,function*(){const e=new K_(t.playerApiUrl,t.projectId);if(!t.playerApiUrl||!t.projectId)return;const i=G_(t);if(i.length===0)return;const n=yield X_(e,i).catch(()=>{});if(!(n!=null&&n.content)){Q_(t);return}$_(t,n)}),G_=t=>{const e=[];return t.contentId&&e.push({content_id:t.contentId}),t.playlistId&&e.push({playlist_id:t.playlistId}),t.sourceId&&e.push({source_id:t.sourceId}),t.sourceUrl&&e.push({source_url:t.sourceUrl}),t.playlist&&e.push(...Lo(t.playlist)),[...new Set(e.map(JSON.stringify))].map(JSON.parse)},X_=(t,e)=>{const i=e[0];if(e.length>1)return t.byIdentifiers(e);if(i.content_id)return t.byContentId(i.content_id);if(i.playlist_id)return t.byPlaylistId(i.playlist_id);if(i.source_id)return t.bySourceId(i.source_id);if(i.source_url)return t.bySourceUrl(i.source_url)},Q_=t=>{pr(t),Sr(t),wr(t),t.onEvent(he({type:"NoContentAvailable",description:"No published and processed content is available for the identifiers.",initiatedBy:"browser"}))},$_=(t,e)=>{var s;const i=br(e.settings.theme),n=e.settings[`${i}_theme`];pr(t),Sr(t,e),wr(t,e),Le(t,"playerStyle",e.settings.player_style),Le(t,"playerTitle",((s=e.playlist)==null?void 0:s.title)||e.settings.player_title),Le(t,"callToAction",e.settings.call_to_action==="Listen to this article"?null:e.settings.call_to_action),Le(t,"skipButtonStyle",e.settings.skip_button_style),Le(t,"downloadFormats",e.settings.download_button_enabled?["mp3"]:[]),Le(t,"introsOutros",e0(e.settings)),Le(t,"persistentAdImage",e.settings.persistent_ad_image),Le(t,"widgetStyle",e.settings.widget_style),Le(t,"widgetPosition",e.settings.widget_position),Le(t,"textColor",n.text_color),Le(t,"backgroundColor",n.background_color),Le(t,"iconColor",n.icon_color),Le(t,"highlightColor",n.highlight_color),Le(t,"logoIconEnabled",e.settings.logo_icon_enabled),Le(t,"highlightSections",e.settings.segment_playback_enabled?"all":"none"),Le(t,"clickableSections",e.settings.segment_playback_enabled?"all":"none"),Le(t,"segmentWidgetSections",(e.settings.segment_playback_enabled,"none")),Le(t,"analyticsConsent",t0(e.settings)),Le(t,"analyticsCustomUrl",e.settings.analytics_custom_url),Le(t,"analyticsTag",e.settings.analytics_tag),Le(t,"analyticsUrl",e.settings.analytics_url),Le(t,"analyticsId",e.settings.analytics_id)},pr=t=>{Le(t,"contentIndex",0),Le(t,"introsOutrosIndex",-1),Le(t,"advertIndex",-1),Le(t,"persistentIndex",-1),Le(t,"duration",0),Le(t,"currentTime",0),Le(t,"playbackState","stopped"),Le(t,"currentSegment",void 0),Le(t,"hoveredSegment",void 0)},Sr=(t,e)=>{var s;const i=(s=e==null?void 0:e.settings)==null?void 0:s.image_enabled,n=(e==null?void 0:e.content)||[];Le(t,"content",n.map(o=>{var l;return{id:o.id,title:o.title,imageUrl:i&&(((l=e.playlist)==null?void 0:l.image_url)||e.settings.image_url||o.image_url),sourceId:o.source_id,sourceUrl:o.source_url,adsEnabled:o.ads_enabled,duration:o.audio[0]?o.audio[0].duration/1e3:0,audio:o.audio.map(r=>({id:r.id,url:r.url,contentType:r.content_type,duration:r.duration?r.duration/1e3:0})),video:o.video.map(r=>({id:r.id,url:r.url,contentType:r.content_type,duration:r.duration?r.duration/1e3:0})),segments:o.segments.map(r=>({marker:r.marker,section:r.section,startTime:r.start_time?r.start_time/1e3:0,duration:r.duration?r.duration/1e3:0}))}}))},wr=(t,e)=>{var s;const i=(s=e==null?void 0:e.settings)==null?void 0:s.image_enabled,n=(e==null?void 0:e.ads)||[];Le(t,"adverts",n.map(o=>{const l=o.type==="vast",r=br(o.theme),a=o[`${r}_theme`];return{id:o.id,type:o.type,placement:o.placement,vastUrl:l?o.vast_url:null,clickThroughUrl:l?null:o.click_through_url,imageUrl:i&&o.image_url,textColor:a==null?void 0:a.text_color,backgroundColor:a==null?void 0:a.background_color,iconColor:a==null?void 0:a.icon_color,audio:l?[]:(o.audio||o.media).map(c=>({id:c.id,url:c.url,contentType:c.content_type,duration:c.duration?c.duration/1e3:0})),video:l?[]:(o.video||[]).map(c=>({id:c.id,url:c.url,contentType:c.content_type,duration:c.duration?c.duration/1e3:0}))}}))},Le=(t,e,i)=>{typeof t.initialProps[e]!="undefined"||(t[e]=i)},e0=({intro_outro_enabled:t,intro_url:e,outro_url:i})=>{if(!t)return[];const n=[];return e&&n.push({placement:"pre-roll",audio:[{url:e}],video:[]}),i&&n.push({placement:"post-roll",audio:[{url:i}],video:[]}),n},t0=({analytics_enabled:t,analytics_uuid_enabled:e})=>t?e?"allowed":"without-local-storage":"none",i0=(t,e)=>di(this,null,function*(){const n=yield(yield fetch(t)).blob(),s=URL.createObjectURL(n),o=document.createElement("a");document.body.append(o),o.href=s,o.setAttribute("download",e),o.setAttribute("target","_blank"),o.click(),o.remove()}),js={vastUrls:new Set,mediaSources:new Set},n0=t=>{t.vastUrl&&js.vastUrls.add(t.vastUrl);for(const e of[...t.audio||[],...t.video||[]])js.mediaSources.add(e.url)},Pr=t=>{if(t.vastUrl&&js.vastUrls.has(t.vastUrl))return!0;for(const e of[...t.audio||[],...t.video||[]])if(js.mediaSources.has(e.url))return!0;return!1},Tr=new Set,s0=t=>{[...t.audio||[],...t.video||[]].forEach(i=>Tr.add(i.url))},o0=t=>[...t.audio||[],...t.video||[]].some(i=>Tr.has(i.url)),l0=({introsOutrosIndex:t,adverts:e,advertIndex:i,content:n=[],contentIndex:s,currentTime:o,atTheStart:l,atTheEnd:r,errored:a}={})=>{var y;const c=e&&e[i];e:if(c){if(a){n0(c);break e}if(r)return s0(c),-1;if(!r)return i}if(!((y=n[s])!=null&&y.adsEnabled)||t!==-1)return-1;const u=a0({content:n,contentIndex:s,currentTime:o,atTheStart:l,atTheEnd:r});let h=-1,m=-1/0,v=-1/0;for(const[p,b]of e.entries()){if(o0(b)||Pr(b)||!u.has(b.placement))continue;const W=r0[b.type]||0;if(W<m)continue;const z=Math.random();W===m&&z<v||(h=p,m=W,v=z)}return h},r0={vast:1,custom:0},a0=({content:t,contentIndex:e,currentTime:i,atTheStart:n,atTheEnd:s})=>{const o=e===0,l=e===t.length-1,r=t.length>1,a=r&&n&&!o,c=t[e].segments,u=c[c.length-1],h=r?null:g0(c),m=c[h],v=m&&i>m.startTime,y=u?u.startTime+u.duration:0,p=i>y-c0,b=new Set;return n&&b.add("pre-roll"),v&&!p&&b.add("mid-roll"),a&&b.add("mid-roll"),s&&l&&b.add("post-roll"),a&&b.add("post-roll"),b},u0=2*60,c0=10,d0=.5,g0=t=>{const e=t[t.length-1];if(!e)return;const i=e.startTime+e.duration;if(i<u0)return;const n=i/2,s=wo(t,i/2),r=t[s].startTime>=n-d0?s:s+1;if(r!==t.length)return r},f0=(t,e,i,n)=>{let s=-1,o=-1/0,l=-1/0;for(const[r,a]of(n||[]).entries()){if(!t||Pr(a)||a.type==="vast")continue;const c=_0(r,e,i);if(c<o)continue;const u=h0[a.placement]||0;c===o&&u<l||(s=r,o=c,l=u)}return s},h0={"pre-roll":2,"mid-roll":1},_0=(t,e,i)=>t===i?2:t===e?1:0,Ar={mediaSources:new Set},m0=t=>{for(const e of[...t.audio||[],t.video||[]])Ar.mediaSources.add(e.url)},y0=t=>{for(const e of[...t.audio||[],t.video||[]])if(Ar.mediaSources.has(e.url))return!0;return!1},Cr=new Set,v0=t=>{[...t.audio||[],...t.video||[]].forEach(i=>Cr.add(i.url))},b0=t=>[...t.audio||[],...t.video||[]].some(i=>Cr.has(i.url)),k0=({introsOutros:t=[],introsOutrosIndex:e,advertIndex:i,content:n,contentIndex:s,currentTime:o,atTheStart:l,atTheEnd:r,errored:a})=>{const c=t[e];e:if(c){if(a){m0(c);break e}if(r)return v0(c),-1;if(!r)return e}if(i!==-1)return-1;const u=p0({content:n,contentIndex:s,currentTime:o,atTheStart:l,atTheEnd:r});let h=-1,m=-1/0,v=-1/0;for(const[y,p]of t.entries()){if(y0(p)||!u.has(p.placement))continue;const b=b0(p)?1:0;if(b<m)continue;const W=Math.random();b===m&&W<v||(h=y,m=b,v=W)}return h},p0=({content:t,contentIndex:e,currentTime:i,atTheStart:n,atTheEnd:s})=>{const o=new Set,l=n&&e===0&&i===0,r=s&&e===t.length-1;return l&&o.add("pre-roll"),r&&o.add("post-roll"),o},S0=t=>{if(!navigator.mediaSession)return;const e=t.instances().some(o=>o.mediaSession==="override");if(T0()&&!e)return;let i,n=-1/0,s=-1/0;for(const o of t.instances()){if(o.mediaSession==="none")continue;const l=w0[o.playbackState]||0;if(l<n)continue;const r=P0[o.showMediaSession]||0;l===n&&r<s||(i=o,n=l,s=r)}for(const o of t.instances())o.showMediaSession=o===i;return i},w0={playing:1,paused:0,stopped:0},P0={true:1,false:0},T0=()=>{const t=navigator.mediaSession.metadata;if(!t||navigator.mediaSession.setByPlayer)return!1;const{title:e,artist:i,album:n,artwork:s}=t;return e||i||n||(s==null?void 0:s.length)},A0=t=>{let e=!1,i,n=-1/0,s=-1/0;for(const o of t.instances()){if(!o.userInterface||o.widgetTarget||!Io(o.widgetStyle))continue;if(o.userInterface.isVisible){e=!0;continue}if(!(o.userInterface.relativeY<0))continue;const c=C0[o.playbackState]||0;if(c<n)continue;const u=o.userInterface.absoluteY;c===n&&u<s||(i=o,n=c,s=u)}e&&n===0&&(i=null);for(const o of t.instances())o.showBottomWidget=o===i},C0={playing:2,paused:1,stopped:0};class B0{constructor(e,i){Ce(this,Fs);Ce(this,qs);Ce(this,ns);Ce(this,Hs);Ce(this,Ys);Ce(this,_i);Ce(this,Fi);Ce(this,ni);Ce(this,Zs);Ce(this,kn);Ce(this,qi);Ce(this,Ks);Ce(this,ss);Ce(this,ji);Ce(this,os);Ce(this,Hi);Ce(this,jt);Ce(this,Yi);Ce(this,zi);Ce(this,Js);Ce(this,Gs);Ce(this,pn);Ce(this,ls);Ce(this,Xs);Ce(this,Qs);Ce(this,$s);Ce(this,eo);this.player=e,this.PlayerClass=i,this.eventListeners={"<any>":{}}}addEventListener(e,i){e==="<any>"||this[`handle${e}`]||Jt(`Cannot add listener for unknown event type '${e}'.`);const s=`listener-handle-${ys()}`;return this.eventListeners[e]=this.eventListeners[e]||{},this.eventListeners[e][s]=i,s}removeEventListener(e,i){this.eventListeners[e]=this.eventListeners[e]||{},delete this.eventListeners[e][i]}processEvent(e){return di(this,null,function*(){yield ur(()=>this.player),Fa(e);const i=this[`handle${e.type}`],n=Ws(this.player);O(this,Fs,Qr).call(this,e)?e.status="ignored-due-to-advert":O(this,qs,$r).call(this,e)?e.status="ignored-due-to-scrubbing":i?(yield i.call(this,e),O(this,Js,sa).call(this),O(this,Gs,oa).call(this),e.status="handled"):Jt("No handler function for event.",e);const s=Ws(this.player);e.changedProps=cr(n,s),e.processedAt=new Date().toISOString(),qa(e),O(this,ns,Yo).call(this,e.type,e),O(this,ns,Yo).call(this,"<any>",e)})}handlePressedChangeRate(){O(this,ji,hn).call(this,e=>e+1,{cycle:!0})}handlePressedEnterOnChangeRate(){O(this,ji,hn).call(this,e=>e+1,{cycle:!0})}handlePressedSpaceOnChangeRate(){O(this,ji,hn).call(this,e=>e+1,{cycle:!0})}handlePressedUpOnChangeRate(){O(this,ji,hn).call(this,e=>e+1)}handlePressedRightOnChangeRate(){O(this,ji,hn).call(this,e=>e+1)}handlePressedDownOnChangeRate(){O(this,ji,hn).call(this,e=>e-1)}handlePressedLeftOnChangeRate(){O(this,ji,hn).call(this,e=>e-1)}handlePressedPrevSegment(){O(this,os,Ko).call(this,e=>e-1)}handlePressedNextSegment(){O(this,os,Ko).call(this,e=>e+1)}handlePressedSeekBack({seconds:e}){O(this,jt,Kt).call(this,i=>i-e)}handlePressedSeekAhead({seconds:e}){O(this,jt,Kt).call(this,i=>i+e)}handlePressedPrevTrack(){O(this,Hi,Bn).call(this,e=>e-1)}handlePressedNextTrack(){O(this,Hi,Bn).call(this,e=>e+1)}handlePressedAdvertLink(){}handlePressedAdvertButton(){}handlePressedAdvertImage(){}handlePressedAdvertVideo(){}handlePressedBeyondWords(){}handlePressedSourceUrl(){}handleDurationUpdated(){}handleMediaLoaded({loadedMedia:e}){this.player.loadedMedia=e}handlePlaybackRateUpdated(){}handleVisibilityChanged(){A0(this.PlayerClass)}handlePressedVideoBackground(){O(this,qi,Cn).call(this)}handlePressedEnterOnProgressBar(){O(this,qi,Cn).call(this)}handlePressedSpaceOnProgressBar(){O(this,qi,Cn).call(this)}handlePressedEnterOnProgressCircle(){O(this,qi,Cn).call(this)}handlePressedSpaceOnProgressCircle(){O(this,qi,Cn).call(this)}handlePressedLeftOnProgressBar(){O(this,jt,Kt).call(this,e=>e-5)}handlePressedRightOnProgressBar(){O(this,jt,Kt).call(this,e=>e+5)}handlePressedLeftOnProgressCircle(){O(this,jt,Kt).call(this,e=>e-5)}handlePressedRightOnProgressCircle(){O(this,jt,Kt).call(this,e=>e+5)}handlePressedProgressBar({ratio:e}){this.preScrubState=this.player.playbackState,O(this,Ks,na).call(this),O(this,jt,Kt).call(this,(i,n)=>e*n),e!==0&&(this.segmentPlayed=!0)}handleScrubbedProgressBar({ratio:e}){O(this,jt,Kt).call(this,(i,n)=>e*n),e!==0&&(this.segmentPlayed=!0)}handleFinishedScrubbingProgressBar(){this.player.playbackState=this.preScrubState,setTimeout(()=>delete this.preScrubState,500)}handleIdentifiersChanged(){kr(this.player).then(()=>{O(this,Yi,In).call(this,{atTheStart:!0}),O(this,zi,_n).call(this,{atTheStart:!0})})}handleNoContentAvailable({description:e}){console.warn(`BeyondWords.Player: ${e}`)}handlePressedPlay({emittedFrom:e,widgetSegment:i,widgetIsCurrent:n}){e==="segment-widget"&&!n?O(this,ss,Zo).call(this,i):this.player.playbackState="playing"}handlePressedPause(){this.player.playbackState="paused"}handlePlaybackPlaying(){this.PlayerClass.instances().filter(n=>n!==this.player).filter(n=>n.playbackState==="playing").forEach(n=>n.playbackState="paused"),S0(this.PlayerClass)}handlePlaybackPaused(){const e=this.player.playbackState==="playing",i=this.player.currentTime>=this.player.duration;e&&!i&&!this.preScrubState&&(this.player.playbackState="paused")}handleCurrentTimeUpdated(){this.midrollPlayed||O(this,zi,_n).call(this);const e=this.player.currentTime<=0,i=this.player.currentTime>=this.player.duration,n=this.player.mediaElement.video.paused;!e&&!i&&!n&&(this.player.playbackState="playing")}handlePlaybackEnded(){O(this,Zs,ia).call(this)&&(this.midrollPlayed=!0),this.segmentPlayed=!1;const e=O(this,_i,Ji).call(this),i=O(this,ni,fi).call(this);O(this,zi,_n).call(this,{atTheEnd:!0,wasIntro:e}),!i&&(O(this,Yi,In).call(this,{atTheEnd:!0}),!e&&(O(this,Fi,An).call(this)||O(this,ni,fi).call(this)||O(this,Hi,Bn).call(this,n=>n+1)))}handlePlaybackNotAllowed({description:e}){console.warn(`BeyondWords.Player: ${e}`);const i=this.player.contentIndex<=0&&this.player.currentTime<=0;this.player.playbackState=i?"stopped":"paused"}handlePlaybackErrored({mediaType:e,errorMessage:i}){console.warn(`BeyondWords.Player: ${e} playback error: ${i}`),O(this,_i,Ji).call(this)||O(this,Fi,An).call(this)?O(this,Yi,In).call(this,{errored:!0}):O(this,ni,fi).call(this)?O(this,zi,_n).call(this,{errored:!0}):this.handlePlaybackEnded()}handlePressedMaximize(){jl()?zh():jh(this.player.target)}handleFullScreenModeUpdated(){const e=jl()===this.player.target,i=e?"add":"remove";this.player.isFullScreen=e,this.player.target.classList[i]("maximized")}handlePressedPlaylistItem({index:e}){O(this,Hi,Bn).call(this,()=>e),this.player.playbackState="playing"}handlePressedTogglePlaylist(){const e=this.player.playlistStyle.split("-"),i=this.player.content.length>1,n=e[0]==="show"||e[0]==="auto"&&i;e[0]=n?"hide":"show",this.player.playlistStyle=e.join("-")}handlePressedDownload({contentIndex:e,audioIndex:i,videoIndex:n}){var u,h;const s=this.player.content[e],o=(u=s.audio)==null?void 0:u[i],l=(h=s.video)==null?void 0:h[n],r=(o||l).url,a=r.split(".").pop(),c=`${s.title}.${a}`;return i0(r,c)}handlePressedCloseWidget(){for(const e of this.PlayerClass.instances())e.playbackState="paused",e.widgetStyle="closed-by-user"}handleContentStatusChanged({contentId:e,legacyId:i,sourceId:n,sourceUrl:s,contentStatus:o}){o==="processed"&&this.player.playbackState==="stopped"&&this.player.contentIndex===0&&this.player.currentTime===0&&O(this,$s,aa).call(this,{contentId:e,legacyId:i,sourceId:n,sourceUrl:s})&&kr(this.player).then(()=>{O(this,Yi,In).call(this,{atTheStart:!0}),O(this,zi,_n).call(this,{atTheStart:!0})})}handleCurrentSegmentUpdated({segment:e,segmentIndex:i,contentIndex:n}){var s;O(this,kn,us).call(this)?this.player.currentSegment=Ki(Zt({},e),{segmentIndex:i,contentIndex:n}):this.segmentPlayed||((s=this.player.segmentContainers)==null||s.reset(),this.player.currentSegment=null)}handleHoveredSegmentUpdated({segment:e,segmentIndex:i,contentIndex:n}){e?this.player.hoveredSegment=Ki(Zt({},e),{segmentIndex:i,contentIndex:n}):this.player.hoveredSegment=null}handlePressedSegment({segment:e,segmentIndex:i,contentIndex:n}){if(!Gn("hovered",e,this.player.clickableSections))return;if(!O(this,eo,ua).call(this,{contentIndex:n,segmentIndex:i})&&!O(this,ni,fi).call(this)){O(this,qi,Cn).call(this);return}n!==this.player.contentIndex&&O(this,Hi,Bn).call(this,()=>n),O(this,ss,Zo).call(this,Zt({segmentIndex:i,contentIndex:n},e))}}Fs=new WeakSet,Qr=function({type:e}){return O(this,ni,fi).call(this)&&(e.includes("ChangeRate")||e.includes("PrevSegment")||e.includes("NextSegment")||e.includes("SeekBack")||e.includes("SeekAhead")||e.includes("Progress")&&!e.includes("Space")&&!e.includes("Enter"))},qs=new WeakSet,$r=function({type:e}){return this.preScrubState&&(e.includes("CurrentTimeUpdated")||e.includes("PlaybackEnded"))},ns=new WeakSet,Yo=function(e,i){const n=this.eventListeners[e]||{};Object.values(n).forEach(s=>s(i))},Hs=new WeakSet,ea=function(){return this.player.introsOutros.some(e=>e.placement==="pre-roll")},Ys=new WeakSet,ta=function(){return this.player.introsOutros.some(e=>e.placement==="post-roll")},_i=new WeakSet,Ji=function(e=this.player.introsOutrosIndex){var i,n,s;return((s=(n=(i=this.player)==null?void 0:i.introsOutros)==null?void 0:n[e])==null?void 0:s.placement)==="pre-roll"},Fi=new WeakSet,An=function(e=this.player.introsOutrosIndex){var i,n,s;return((s=(n=(i=this.player)==null?void 0:i.introsOutros)==null?void 0:n[e])==null?void 0:s.placement)==="post-roll"},ni=new WeakSet,fi=function(){return this.player.advertIndex!==-1},Zs=new WeakSet,ia=function(){var e;return((e=this.player.adverts[this.player.advertIndex])==null?void 0:e.placement)==="mid-roll"},kn=new WeakSet,us=function(){return!O(this,_i,Ji).call(this)&&!O(this,Fi,An).call(this)&&!O(this,ni,fi).call(this)},qi=new WeakSet,Cn=function(){this.player.playbackState==="playing"?this.player.playbackState="paused":this.player.playbackState="playing"},Ks=new WeakSet,na=function(){this.player.playbackState==="playing"&&(this.player.playbackState="paused")},ss=new WeakSet,Zo=function(s){var o=s,{segmentIndex:e,contentIndex:i}=o,n=Fo(o,["segmentIndex","contentIndex"]);O(this,jt,Kt).call(this,()=>n.startTime,i),this.player.currentSegment=Zt({segmentIndex:e,contentIndex:i},n),this.player.playbackState="playing",this.segmentPlayed=!0},ji=new WeakSet,hn=function(e,{cycle:i}={}){const n=this.player.playbackRates,s=n.length-1,o=n.indexOf(this.player.playbackRate),l=e(o);let r;i?r=l%n.length:r=Math.max(0,Math.min(s,l)),this.player.playbackRate=n[r]||1},os=new WeakSet,Ko=function(e){const i=this.player.content[this.player.contentIndex].segments,n=wo(i,this.player.currentTime),s=e(n);O(this,_i,Ji).call(this)&&s>=0?this.handlePlaybackEnded():O(this,Fi,An).call(this)&&s<0?(O(this,pn,cs).call(this,-1),O(this,jt,Kt).call(this,()=>{var o;return((o=i[i.length-1])==null?void 0:o.startTime)||.01}),this.player.playbackState="playing"):O(this,kn,us).call(this)&&s<0&&O(this,Hs,ea).call(this)?(O(this,jt,Kt).call(this,()=>0),O(this,Yi,In).call(this,{atTheStart:!0})):O(this,kn,us).call(this)&&s===i.length&&O(this,Ys,ta).call(this)?O(this,jt,Kt).call(this,()=>this.player.duration-.01):O(this,kn,us).call(this)&&s>=0&&s<i.length&&O(this,jt,Kt).call(this,()=>i[s].startTime)},Hi=new WeakSet,Bn=function(e){const i=e(this.player.contentIndex),n=i<0||i>=this.player.content.length;n?(this.player.playbackState="stopped",O(this,jt,Kt).call(this,()=>0)):(this.player.contentIndex=i,O(this,ni,fi).call(this)||(O(this,jt,Kt).call(this,()=>0),this.midrollPlayed=!1)),O(this,pn,cs).call(this,-1),O(this,Yi,In).call(this,{atTheStart:!0}),n||O(this,zi,_n).call(this,{atTheStart:!0})},jt=new WeakSet,Kt=function(e,i){if(O(this,ni,fi).call(this))this.prevTime=e(),this.prevContent=i;else{const n=this.player.duration||0;this.player.currentTime=e(this.player.currentTime,n)}},Yi=new WeakSet,In=function({atTheStart:e,atTheEnd:i,errored:n}={}){const{content:s,introsOutros:o,currentTime:l}=this.player,r=typeof this.nextIntroOutro!="undefined"?this.nextIntroOutro:this.player.introsOutrosIndex,a=typeof this.nextAdvert!="undefined"?this.nextAdvert:this.player.advertIndex,c=typeof this.prevContent!="undefined"?this.prevContent:this.player.contentIndex;O(this,pn,cs).call(this,k0({introsOutros:o,introsOutrosIndex:r,advertIndex:a,content:s,contentIndex:c,currentTime:l,atTheStart:e,atTheEnd:i,errored:n}))},zi=new WeakSet,_n=function({atTheStart:e,atTheEnd:i,wasIntro:n,errored:s}={}){const{adverts:o,content:l,currentTime:r}=this.player;let a=typeof this.nextIntroOutro!="undefined"?this.nextIntroOutro:this.player.introsOutrosIndex;const c=typeof this.nextAdvert!="undefined"?this.nextAdvert:this.player.advertIndex,u=typeof this.prevContent!="undefined"?this.prevContent:this.player.contentIndex;n&&(e=!0,i=!1,a=-1),O(this,ls,Jo).call(this,l0({introsOutrosIndex:a,adverts:o,advertIndex:c,content:l,contentIndex:u,currentTime:r,atTheStart:e,atTheEnd:i,errored:s}));const h=this.player.persistentAdImage,m=this.player.persistentIndex;this.player.persistentIndex=f0(h,m,c,o)},Js=new WeakSet,sa=function(){this.player.playbackState==="playing"&&typeof this.nextIntroOutro!="undefined"&&(O(this,pn,cs).call(this,this.nextIntroOutro),delete this.nextIntroOutro)},Gs=new WeakSet,oa=function(){this.player.playbackState==="playing"&&typeof this.nextAdvert!="undefined"&&(O(this,ls,Jo).call(this,this.nextAdvert),delete this.nextAdvert)},pn=new WeakSet,cs=function(e){if(this.player.playbackState!=="playing"&&e!==-1){this.nextIntroOutro=e;return}else delete this.nextIntroOutro;if(!(this.player.contentIndex<=0&&this.player.currentTime<=0)&&O(this,_i,Ji).call(this,e)){this.player.introsOutrosIndex=-1,O(this,zi,_n).call(this,{atTheStart:!0});return}const o=O(this,_i,Ji).call(this),l=O(this,Fi,An).call(this);this.player.introsOutrosIndex=e;const r=o&&!O(this,_i,Ji).call(this),a=l&&!O(this,Fi,An).call(this);r&&(this.player.currentTime=0),a&&O(this,Hi,Bn).call(this,()=>1/0)},ls=new WeakSet,Jo=function(e){if(this.player.playbackState!=="playing"&&e!==-1){this.nextAdvert=e;return}else delete this.nextAdvert;const n=O(this,ni,fi).call(this);this.player.advertIndex=e;const s=!n&&O(this,ni,fi).call(this),o=n&&!O(this,ni,fi).call(this);s&&O(this,Xs,la).call(this),o&&O(this,Qs,ra).call(this)},Xs=new WeakSet,la=function(){O(this,_i,Ji).call(this)||(this.prevTime=this.player.currentTime),this.prevRate=this.player.playbackRate,this.prevContent=this.player.contentIndex,this.player.currentTime=0,this.player.playbackRate=1},Qs=new WeakSet,ra=function(){this.player.playbackRate=this.prevRate||1,this.player.contentIndex!==this.prevContent||(this.player.currentTime=this.prevTime),delete this.prevTime,delete this.prevRate,delete this.prevContent},$s=new WeakSet,aa=function({contentId:e,legacyId:i,sourceId:n,sourceUrl:s}){var o,l,r,a;return this.player.contentId===e||this.player.contentId===i||this.player.sourceId===n||this.player.sourceUrl===s||((o=this.player.playlist)==null?void 0:o.some(c=>c.contentId===e))||((l=this.player.playlist)==null?void 0:l.some(c=>c.contentId===i))||((r=this.player.playlist)==null?void 0:r.some(c=>c.sourceId===n))||((a=this.player.playlist)==null?void 0:a.some(c=>c.sourceUrl===s))},eo=new WeakSet,ua=function({contentIndex:e,segmentIndex:i}){var n,s;return((n=this.player.currentSegment)==null?void 0:n.contentIndex)!==e||((s=this.player.currentSegment)==null?void 0:s.segmentIndex)!==i};var Qn="<unknown>";function Br(t){var e=t.split(`
|
|
58
58
|
`);return e.reduce(function(i,n){var s=W0(n)||z0(n)||E0(n)||D0(n)||x0(n);return s&&i.push(s),i},[])}var I0=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,V0=/\((\S*)(?::(\d+))(?::(\d+))\)/;function W0(t){var e=I0.exec(t);if(!e)return null;var i=e[2]&&e[2].indexOf("native")===0,n=e[2]&&e[2].indexOf("eval")===0,s=V0.exec(e[2]);return n&&s!=null&&(e[2]=s[1],e[3]=s[2],e[4]=s[3]),{file:i?null:e[2],methodName:e[1]||Qn,arguments:i?[e[2]]:[],lineNumber:e[3]?+e[3]:null,column:e[4]?+e[4]:null}}var j0=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function z0(t){var e=j0.exec(t);return e?{file:e[2],methodName:e[1]||Qn,arguments:[],lineNumber:+e[3],column:e[4]?+e[4]:null}:null}var M0=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,O0=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function E0(t){var e=M0.exec(t);if(!e)return null;var i=e[3]&&e[3].indexOf(" > eval")>-1,n=O0.exec(e[3]);return i&&n!=null&&(e[3]=n[1],e[4]=n[2],e[5]=null),{file:e[3],methodName:e[1]||Qn,arguments:e[2]?e[2].split(","):[],lineNumber:e[4]?+e[4]:null,column:e[5]?+e[5]:null}}var L0=/^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;function x0(t){var e=L0.exec(t);return e?{file:e[3],methodName:e[1]||Qn,arguments:[],lineNumber:+e[4],column:e[5]?+e[5]:null}:null}var N0=/^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;function D0(t){var e=N0.exec(t);return e?{file:e[2],methodName:e[1]||Qn,arguments:[],lineNumber:+e[3],column:e[4]?+e[4]:null}:null}let Ir=!1,xo,No;const R0=({onError:t})=>{if(!t||Ir)return;Ir=!0;const e=Vr(new Error),i=e==null?void 0:e.match(/setErrorHandler/);xo=window.onerror,No=window.onunhandledrejection,window.onerror=(n,s,o,l,r)=>{var h;const a=s===e,c=(h=r==null?void 0:r.message)==null?void 0:h.match(/request was interrupted/);if((i||a||c)&&t(r))return!0;xo&&xo(n,s,o,l,r)},window.onunhandledrejection=n=>{var a;const s=n.reason,o=Vr(s)===e,l=(a=s==null?void 0:s.message)==null?void 0:a.match(/request was interrupted/);if((i||o||l)&&t(s)){n.preventDefault();return}No&&No(n)}},Vr=t=>{var e;return(e=Br((t==null?void 0:t.stack)||"")[0])==null?void 0:e.file},U0=()=>{typeof window=="undefined"&&Jt(["Trying to initialize BeyondWords.Player in a server context but this is unsupported.","Please only initialize the player in a context where the global window object is available.","For example, by initializing the player inside a useEffect hook in a React application."])};let Wr=!1;const F0=()=>{Wr||(Wr=!0,addEventListener("mousedown",q0),addEventListener("click",H0),addEventListener("mousemove",Y0))},q0=t=>{Mr=t.pageX,Or=t.pageY},H0=t=>{var i;if(t.defaultPrevented||Z0(t)||t.button!==0)return;const e=(i=jr(t.target))==null?void 0:i.getAttribute(nn);if(e)for(const n of BeyondWords.Player.instances()){const{segment:s,contentIndex:o,segmentIndex:l}=zr(n,e);s&&n.onEvent(he({type:"PressedSegment",description:"The user pressed on a segment in the article.",initiatedBy:"user",emittedFrom:"segment",segment:s,contentIndex:o,segmentIndex:l}))}},Y0=t=>{var n;const e=document.elementFromPoint(t.clientX,t.clientY),i=(n=jr(e))==null?void 0:n.getAttribute(nn);for(const[s,o]of BeyondWords.Player.instances().entries()){const{segment:l,contentIndex:r,segmentIndex:a}=zr(o,i);K0(s,r,a)&&o.onEvent(he({type:"HoveredSegmentUpdated",description:"The user hovered over a different segment in the article.",initiatedBy:"user",emittedFrom:"segment",segment:l,contentIndex:r,segmentIndex:a}))}},jr=t=>{for(;t&&t.hasAttribute;){if(t.hasAttribute(nn))return t;if(t.onclick||t.onmousedown||t.nodeName.toLowerCase()==="a")return;t=t.parentNode}},zr=(t,e)=>{if(!e)return{};let i={},n=-1/0;for(const[s,o]of(t.content||[]).entries())for(const[l,r]of(o.segments||[]).entries()){if(e!==r.marker)continue;const a=t.contentIndex===s?1:0;a<n||a===n&&(i!=null&&i.segment)||(i={contentIndex:s,segmentIndex:l,segment:r},n=a)}return i};let Mr,Or;const Z0=t=>{const e=t.pageX-Mr,i=t.pageY-Or;return Math.sqrt(e*e+i*i)>5},zs={},K0=(t,e,i)=>{zs[t]||(zs[t]={});const n=zs[t];return n.contentIndex===e&&n.segmentIndex===i?!1:(n.contentIndex=e,n.segmentIndex=i,!0)};class Do{constructor(e){this.analyticsSink=e}sendToCustomAnalytics(e){return A_(this.analyticsSink,e)}sendToGoogleAnalytics(e,i){window.gtag("event",e,Ki(Zt({},i),{send_to:this.analyticsSink}))}}const J0=(t,e)=>{const i=G0(t,e.type);if(!i)return;const n=X0(t,i);Ha(n),t.analyticsUrl&&t.analyticsConsent!=="none"&&new Do(t.analyticsUrl).sendToCustomAnalytics(n),t.analyticsCustomUrl&&t.analyticsConsent!=="none"&&new Do(t.analyticsCustomUrl).sendToCustomAnalytics(n),t.analyticsTag&&new Do(t.analyticsTag).sendToGoogleAnalytics(Q0(n),n)},G0=(t,e)=>{if(e==="MediaLoaded"&&!t.listenSessionId)return"load";if(e==="PlaybackPlaying"&&$0(t)&&(t.isNewListen=!0),e==="CurrentTimeUpdated"&&t.isNewListen)return t.isNewListen=!1,"play";if(e==="CurrentTimeUpdated"&&em(t))return"play_progress";if(e.startsWith("PressedAdvert"))return"ad_link_click"},X0=(t,e)=>{var l,r;t.listenSessionId||(t.listenSessionId=ys()),t.sessionCreatedAt||(t.sessionCreatedAt=Date.now());const i=["without-local-storage","none"].includes(t.analyticsConsent);i||localStorage.beyondwords||(localStorage.beyondwords=JSON.stringify(ys()));const n=t.adverts[t.advertIndex],s=t.content[t.contentIndex],o=t.duration?t.currentTime/t.duration*100:0;return{event_type:e,device_type:tm(),media_type:n?"ad":"content",project_id:t.projectId,content_id:s==null?void 0:s.id,source_id:s==null?void 0:s.sourceId,analytics_id:t.analyticsId,ad_id:n==null?void 0:n.id,media_id:(l=t.loadedMedia)==null?void 0:l.id,media_format:(r=t.loadedMedia)==null?void 0:r.format,local_storage_id:i?null:JSON.parse(localStorage.beyondwords),listen_session_id:t.listenSessionId,session_created_at:t.sessionCreatedAt,duration:t.duration,listen_length_seconds:t.currentTime,listen_length_percent:Math.max(0,Math.min(100,o)),speed:t.playbackRate,location:window.location.href,referrer:document.referrer,player_version:"1",player_npm_version:yo}},Q0=({event_type:t,listen_length_percent:e})=>{const i=Math.floor(e/10)*10;if(t==="load")return"Load";if(t==="play")return"Play";if(t==="play_progress"&&i===100)return"Complete";if(t==="play_progress")return`${i}% listened`;if(t==="ad_link_click")return"Advert Click"},$0=t=>{var n,s;let e=!1;if(t.advertIndex!==-1){const o=((n=t.adverts[t.advertIndex])==null?void 0:n.id)||t.advertIndex;e=o!==t.prevAdvertId,t.prevAdvertId=o}else{const o=((s=t.content[t.contentIndex])==null?void 0:s.id)||t.contentIndex;e=o!==t.prevContentId,t.prevContentId=o}return e},em=t=>{if(t.introsOutrosIndex!==-1)return;const e=t.prevPercentage+10,i=t.currentTime/t.duration*100;if(i>=e)return t.prevPercentage=Math.floor(i/10)*10,!0},tm=()=>Er(499)?"phone":Er(999)?"tablet":"desktop",Er=t=>window.matchMedia&&window.matchMedia(`only screen and (max-device-width: ${t}px)`).matches,Ro=t=>{var o;const e=new Error,i=(o=Br(e.stack||"")[0])==null?void 0:o.file;if(!i)return console.warn("BeyondWords.Player: unable to load dependencies"),"";if(!t)return i;const n=i.replaceAll("player@latest",`player@${yo}`);return im(n,t)},im=(t,e)=>{const i=t.split("/");return i[i.length-1]=e,i.join("/")},Zi=class Zi extends Z_{constructor(n){var s=n,{target:e}=s,i=Fo(s,["target"]);U0(),R0(i),F0();const{newTarget:o,showUserInterface:l}=x_(e);o.classList.add("beyondwords-player","bwp");const r=new B0(null,Zi);r.addEventListener("<any>",c=>J0(this,c));const a=Zt({showUserInterface:l},i);super({target:o,props:Ki(Zt({controller:r},a),{initialProps:a})}),r.player=this,Pi(Zi,sn).push(this)}static get version(){return yo}static get scriptSrc(){return Ro()}static get styleSrc(){return Ro("style.js")}static get hlsSrc(){return Ro("hls.light.min.js")}static instances(){return[...Pi(Zi,sn)]}static destroyAll(){Pi(Zi,sn).forEach(e=>e.destroy())}destroy(){this.$destroy(),Fr(Zi,sn,Pi(Zi,sn).filter(e=>e!==this))}get target(){return this.$$.root}set target(e){Jt(["Unable to change the player's target after initialization.","Call player.destroy() and initialize a new player, instead.","","Alternatively, you can show or hide the player with:","player.showUserInterface = <bool>"])}};sn=new WeakMap,Ce(Zi,sn,[]);let Ms=Zi;return typeof window!="undefined"&&(window.BeyondWords||(window.BeyondWords={}),(Lr=window.BeyondWords).Player||(Lr.Player=Ms)),{Player:Ms}});
|
|
59
59
|
//# sourceMappingURL=umd.js.map
|