@beyondwords/player 0.1.38 → 0.1.39

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/umd.js CHANGED
@@ -1,7 +1,7 @@
1
- var $y=Object.defineProperty,e2=Object.defineProperties;var t2=Object.getOwnPropertyDescriptors;var Os=Object.getOwnPropertySymbols;var Vr=Object.prototype.hasOwnProperty,Wr=Object.prototype.propertyIsEnumerable;var fl=(x,Be,je)=>Be in x?$y(x,Be,{enumerable:!0,configurable:!0,writable:!0,value:je}):x[Be]=je,oi=(x,Be)=>{for(var je in Be||(Be={}))Vr.call(Be,je)&&fl(x,je,Be[je]);if(Os)for(var je of Os(Be))Wr.call(Be,je)&&fl(x,je,Be[je]);return x},rn=(x,Be)=>e2(x,t2(Be));var ml=(x,Be)=>{var je={};for(var Zt in x)Vr.call(x,Zt)&&Be.indexOf(Zt)<0&&(je[Zt]=x[Zt]);if(x!=null&&Os)for(var Zt of Os(x))Be.indexOf(Zt)<0&&Wr.call(x,Zt)&&(je[Zt]=x[Zt]);return je};var hl=(x,Be,je)=>(fl(x,typeof Be!="symbol"?Be+"":Be,je),je),_l=(x,Be,je)=>{if(!Be.has(x))throw TypeError("Cannot "+je)};var Ni=(x,Be,je)=>(_l(x,Be,"read from private field"),je?je.call(x):Be.get(x)),Ae=(x,Be,je)=>{if(Be.has(x))throw TypeError("Cannot add the same private member more than once");Be instanceof WeakSet?Be.add(x):Be.set(x,je)},Or=(x,Be,je,Zt)=>(_l(x,Be,"write to private field"),Zt?Zt.call(x,je):Be.set(x,je),je);var N=(x,Be,je)=>(_l(x,Be,"access private method"),je);var Bi=(x,Be,je)=>new Promise((Zt,Qn)=>{var Qe=Vi=>{try{ke(je.next(Vi))}catch(wi){Qn(wi)}},cn=Vi=>{try{ke(je.throw(Vi))}catch(wi){Qn(wi)}},ke=Vi=>Vi.done?Zt(Vi.value):Promise.resolve(Vi.value).then(Qe,cn);ke((je=je.apply(x,Be)).next())});/*! version:"0.1.38" */(function(x,Be){typeof exports=="object"&&typeof module!="undefined"?module.exports=Be():typeof define=="function"&&define.amd?define(Be):(x=typeof globalThis!="undefined"?globalThis:x||self,x._beyond_words_player=Be())})(this,function(){var go,yl,ts,Er,is,Mr,fo,ns,jr,os,zr,mo,ss,Lr,ls,Dr,as,Rr,ho,rs,Nr,us,xr,_o,vl,cs,Ur,mn,Xn,ds,Fr,gs,qr,fs,Hr,yo,bl,ms,Yr,hs,Zr,Di,un,on,Wn,ki,Li,_s,Gr,An,wo,sn,On,ys,Kr,vo,kl,Ki,wn,bo,pl,ln,En,Ft,ai,an,Mn,Ji,Tn,vs,Jr,bs,Xr,In,To,ko,Sl,ks,Qr,ps,$r,Ss,eu,ws,tu,hn,Br;"use strict";function x(){}const Be=t=>t;function je(t,e){for(const i in e)t[i]=e[i];return t}function Zt(t){return t()}function Qn(){return Object.create(null)}function Qe(t){t.forEach(Zt)}function cn(t){return typeof t=="function"}function ke(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let Vi;function wi(t,e){return t===e?!0:(Vi||(Vi=document.createElement("a")),Vi.href=e,t===Vi.href)}function iu(t){return Object.keys(t).length===0}function jn(t,e,i,n){if(t){const o=wl(t,e,i,n);return t[0](o)}}function wl(t,e,i,n){return t[1]&&n?je(i.ctx.slice(),t[1](n(e))):i.ctx}function zn(t,e,i,n){if(t[2]&&n){const o=t[2](n(i));if(e.dirty===void 0)return o;if(typeof o=="object"){const s=[],l=Math.max(e.dirty.length,o.length);for(let a=0;a<l;a+=1)s[a]=e.dirty[a]|o[a];return s}return e.dirty|o}return e.dirty}function Ln(t,e,i,n,o,s){if(o){const l=wl(e,i,n,s);t.p(l,o)}}function Dn(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 Tl(t){return t==null?"":t}function Pl(t){const e=typeof t=="string"&&t.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[t,"px"]}const Cl=typeof window!="undefined";let nu=Cl?()=>window.performance.now():()=>Date.now(),Po=Cl?t=>requestAnimationFrame(t):x;const Rn=new Set;function Al(t){Rn.forEach(e=>{e.c(t)||(Rn.delete(e),e.f())}),Rn.size!==0&&Po(Al)}function ou(t){let e;return Rn.size===0&&Po(Al),{promise:new Promise(i=>{Rn.add(e={c:t,f:i})}),abort(){Rn.delete(e)}}}const su=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global;function f(t,e){t.appendChild(e)}function Il(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function lu(t){const e=p("style");return e.textContent="/* empty */",au(Il(t),e),e.sheet}function au(t,e){return f(t.head||t,e),e.sheet}function E(t,e,i){t.insertBefore(e,i||null)}function O(t){t.parentNode&&t.parentNode.removeChild(t)}function dn(t,e){for(let i=0;i<t.length;i+=1)t[i]&&t[i].d(e)}function p(t){return document.createElement(t)}function pe(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function ne(t){return document.createTextNode(t)}function X(){return ne(" ")}function xi(){return ne("")}function H(t,e,i,n){return t.addEventListener(e,i,n),()=>t.removeEventListener(e,i,n)}function Pe(t,e,i){i==null?t.removeAttribute(e):t.getAttribute(e)!==i&&t.setAttribute(e,i)}function ru(t){return Array.from(t.childNodes)}function Ti(t,e){e=""+e,t.data!==e&&(t.data=e)}function U(t,e){t.value=e==null?"":e}function Ut(t,e,i,n){i==null?t.style.removeProperty(e):t.style.setProperty(e,i,n?"important":"")}function Ie(t,e,i){for(let n=0;n<t.options.length;n+=1){const o=t.options[n];if(o.__value===e){o.selected=!0;return}}(!i||e!==void 0)&&(t.selectedIndex=-1)}function Ct(t){const e=t.querySelector(":checked");return e&&e.__value}function te(t,e,i){t.classList.toggle(e,!!i)}function uu(t,e,{bubbles:i=!1,cancelable:n=!1}={}){return new CustomEvent(t,{detail:e,bubbles:i,cancelable:n})}const Co=new Map;let Ao=0;function cu(t){let e=5381,i=t.length;for(;i--;)e=(e<<5)-e^t.charCodeAt(i);return e>>>0}function du(t,e){const i={stylesheet:lu(e),rules:{}};return Co.set(t,i),i}function Bl(t,e,i,n,o,s,l,a=0){const r=16.666/n;let u=`{
1
+ var $y=Object.defineProperty,e2=Object.defineProperties;var t2=Object.getOwnPropertyDescriptors;var Os=Object.getOwnPropertySymbols;var Vr=Object.prototype.hasOwnProperty,Wr=Object.prototype.propertyIsEnumerable;var fl=(x,Be,je)=>Be in x?$y(x,Be,{enumerable:!0,configurable:!0,writable:!0,value:je}):x[Be]=je,oi=(x,Be)=>{for(var je in Be||(Be={}))Vr.call(Be,je)&&fl(x,je,Be[je]);if(Os)for(var je of Os(Be))Wr.call(Be,je)&&fl(x,je,Be[je]);return x},rn=(x,Be)=>e2(x,t2(Be));var ml=(x,Be)=>{var je={};for(var Zt in x)Vr.call(x,Zt)&&Be.indexOf(Zt)<0&&(je[Zt]=x[Zt]);if(x!=null&&Os)for(var Zt of Os(x))Be.indexOf(Zt)<0&&Wr.call(x,Zt)&&(je[Zt]=x[Zt]);return je};var hl=(x,Be,je)=>(fl(x,typeof Be!="symbol"?Be+"":Be,je),je),_l=(x,Be,je)=>{if(!Be.has(x))throw TypeError("Cannot "+je)};var Ni=(x,Be,je)=>(_l(x,Be,"read from private field"),je?je.call(x):Be.get(x)),Ae=(x,Be,je)=>{if(Be.has(x))throw TypeError("Cannot add the same private member more than once");Be instanceof WeakSet?Be.add(x):Be.set(x,je)},Or=(x,Be,je,Zt)=>(_l(x,Be,"write to private field"),Zt?Zt.call(x,je):Be.set(x,je),je);var N=(x,Be,je)=>(_l(x,Be,"access private method"),je);var Bi=(x,Be,je)=>new Promise((Zt,Qn)=>{var Qe=Vi=>{try{ke(je.next(Vi))}catch(wi){Qn(wi)}},cn=Vi=>{try{ke(je.throw(Vi))}catch(wi){Qn(wi)}},ke=Vi=>Vi.done?Zt(Vi.value):Promise.resolve(Vi.value).then(Qe,cn);ke((je=je.apply(x,Be)).next())});/*! version:"0.1.39" */(function(x,Be){typeof exports=="object"&&typeof module!="undefined"?module.exports=Be():typeof define=="function"&&define.amd?define(Be):(x=typeof globalThis!="undefined"?globalThis:x||self,x._beyond_words_player=Be())})(this,function(){var go,yl,ts,Er,is,Mr,fo,ns,jr,os,zr,mo,ss,Lr,ls,Dr,as,Rr,ho,rs,Nr,us,xr,_o,vl,cs,Ur,mn,Xn,ds,Fr,gs,qr,fs,Hr,yo,bl,ms,Yr,hs,Zr,Di,un,on,Wn,ki,Li,_s,Gr,An,wo,sn,On,ys,Kr,vo,kl,Ki,wn,bo,pl,ln,En,Ft,ai,an,Mn,Ji,Tn,vs,Jr,bs,Xr,In,To,ko,Sl,ks,Qr,ps,$r,Ss,eu,ws,tu,hn,Br;"use strict";function x(){}const Be=t=>t;function je(t,e){for(const i in e)t[i]=e[i];return t}function Zt(t){return t()}function Qn(){return Object.create(null)}function Qe(t){t.forEach(Zt)}function cn(t){return typeof t=="function"}function ke(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let Vi;function wi(t,e){return t===e?!0:(Vi||(Vi=document.createElement("a")),Vi.href=e,t===Vi.href)}function iu(t){return Object.keys(t).length===0}function jn(t,e,i,n){if(t){const o=wl(t,e,i,n);return t[0](o)}}function wl(t,e,i,n){return t[1]&&n?je(i.ctx.slice(),t[1](n(e))):i.ctx}function zn(t,e,i,n){if(t[2]&&n){const o=t[2](n(i));if(e.dirty===void 0)return o;if(typeof o=="object"){const s=[],l=Math.max(e.dirty.length,o.length);for(let a=0;a<l;a+=1)s[a]=e.dirty[a]|o[a];return s}return e.dirty|o}return e.dirty}function Ln(t,e,i,n,o,s){if(o){const l=wl(e,i,n,s);t.p(l,o)}}function Dn(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 Tl(t){return t==null?"":t}function Pl(t){const e=typeof t=="string"&&t.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[t,"px"]}const Cl=typeof window!="undefined";let nu=Cl?()=>window.performance.now():()=>Date.now(),Po=Cl?t=>requestAnimationFrame(t):x;const Rn=new Set;function Al(t){Rn.forEach(e=>{e.c(t)||(Rn.delete(e),e.f())}),Rn.size!==0&&Po(Al)}function ou(t){let e;return Rn.size===0&&Po(Al),{promise:new Promise(i=>{Rn.add(e={c:t,f:i})}),abort(){Rn.delete(e)}}}const su=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global;function f(t,e){t.appendChild(e)}function Il(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function lu(t){const e=p("style");return e.textContent="/* empty */",au(Il(t),e),e.sheet}function au(t,e){return f(t.head||t,e),e.sheet}function E(t,e,i){t.insertBefore(e,i||null)}function O(t){t.parentNode&&t.parentNode.removeChild(t)}function dn(t,e){for(let i=0;i<t.length;i+=1)t[i]&&t[i].d(e)}function p(t){return document.createElement(t)}function pe(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function ne(t){return document.createTextNode(t)}function X(){return ne(" ")}function xi(){return ne("")}function H(t,e,i,n){return t.addEventListener(e,i,n),()=>t.removeEventListener(e,i,n)}function Pe(t,e,i){i==null?t.removeAttribute(e):t.getAttribute(e)!==i&&t.setAttribute(e,i)}function ru(t){return Array.from(t.childNodes)}function Ti(t,e){e=""+e,t.data!==e&&(t.data=e)}function U(t,e){t.value=e==null?"":e}function Ut(t,e,i,n){i==null?t.style.removeProperty(e):t.style.setProperty(e,i,n?"important":"")}function Ie(t,e,i){for(let n=0;n<t.options.length;n+=1){const o=t.options[n];if(o.__value===e){o.selected=!0;return}}(!i||e!==void 0)&&(t.selectedIndex=-1)}function Ct(t){const e=t.querySelector(":checked");return e&&e.__value}function te(t,e,i){t.classList.toggle(e,!!i)}function uu(t,e,{bubbles:i=!1,cancelable:n=!1}={}){return new CustomEvent(t,{detail:e,bubbles:i,cancelable:n})}const Co=new Map;let Ao=0;function cu(t){let e=5381,i=t.length;for(;i--;)e=(e<<5)-e^t.charCodeAt(i);return e>>>0}function du(t,e){const i={stylesheet:lu(e),rules:{}};return Co.set(t,i),i}function Bl(t,e,i,n,o,s,l,a=0){const r=16.666/n;let u=`{
2
2
  `;for(let y=0;y<=1;y+=r){const A=e+(i-e)*s(y);u+=y*100+`%{${l(A,1-A)}}
3
3
  `}const c=u+`100% {${l(i,1-i)}}
4
- }`,g=`__svelte_${cu(c)}_${a}`,v=Il(t),{stylesheet:_,rules:m}=Co.get(v)||du(v,t);m[g]||(m[g]=!0,_.insertRule(`@keyframes ${g} ${c}`,_.cssRules.length));const w=t.style.animation||"";return t.style.animation=`${w?`${w}, `:""}${g} ${n}ms linear ${o}ms 1 both`,Ao+=1,g}function gu(t,e){const i=(t.style.animation||"").split(", "),n=i.filter(e?s=>s.indexOf(e)<0:s=>s.indexOf("__svelte")===-1),o=i.length-n.length;o&&(t.style.animation=n.join(", "),Ao-=o,Ao||fu())}function fu(){Po(()=>{Ao||(Co.forEach(t=>{const{ownerNode:e}=t.stylesheet;e&&O(e)}),Co.clear())})}let $n;function eo(t){$n=t}function Vl(){if(!$n)throw new Error("Function called outside component initialization");return $n}function to(t){Vl().$$.on_mount.push(t)}function mu(t){Vl().$$.on_destroy.push(t)}const Nn=[],oe=[];let xn=[];const Es=[],Wl=Promise.resolve();let Ms=!1;function Ol(){Ms||(Ms=!0,Wl.then(d))}function hu(){return Ol(),Wl}function tt(t){xn.push(t)}function ve(t){Es.push(t)}const js=new Set;let Un=0;function d(){if(Un!==0)return;const t=$n;do{try{for(;Un<Nn.length;){const e=Nn[Un];Un++,eo(e),_u(e.$$)}}catch(e){throw Nn.length=0,Un=0,e}for(eo(null),Nn.length=0,Un=0;oe.length;)oe.pop()();for(let e=0;e<xn.length;e+=1){const i=xn[e];js.has(i)||(js.add(i),i())}xn.length=0}while(Nn.length);for(;Es.length;)Es.pop()();Ms=!1,js.clear(),eo(t)}function _u(t){if(t.fragment!==null){t.update(),Qe(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(tt)}}function yu(t){const e=[],i=[];xn.forEach(n=>t.indexOf(n)===-1?e.push(n):i.push(n)),i.forEach(n=>n()),xn=e}let io;function vu(){return io||(io=Promise.resolve(),io.then(()=>{io=null})),io}function zs(t,e,i){t.dispatchEvent(uu(`${e?"intro":"outro"}${i}`))}const Io=new Set;let Qi;function De(){Qi={r:0,c:[],p:Qi}}function Re(){Qi.r||Qe(Qi.c),Qi=Qi.p}function B(t,e){t&&t.i&&(Io.delete(t),t.i(e))}function z(t,e,i,n){if(t&&t.o){if(Io.has(t))return;Io.add(t),Qi.c.push(()=>{Io.delete(t),n&&(i&&t.d(1),n())}),t.o(e)}else n&&n()}const bu={duration:0};function El(t,e,i,n){let s=e(t,i,{direction:"both"}),l=n?0:1,a=null,r=null,u=null,c;function g(){u&&gu(t,u)}function v(m,w){const y=m.b-l;return w*=Math.abs(y),{a:l,b:m.b,d:y,duration:w,start:m.start,end:m.start+w,group:m.group}}function _(m){const{delay:w=0,duration:y=300,easing:A=Be,tick:S=x,css:C}=s||bu,T={start:nu()+w,b:m};m||(T.group=Qi,Qi.r+=1),"inert"in t&&(m?c!==void 0&&(t.inert=c):(c=t.inert,t.inert=!0)),a||r?r=T:(C&&(g(),u=Bl(t,l,m,y,w,A,C)),m&&S(0,1),a=v(T,y),tt(()=>zs(t,m,"start")),ou(I=>{if(r&&I>r.start&&(a=v(r,y),r=null,zs(t,a.b,"start"),C&&(g(),u=Bl(t,l,a.b,a.duration,0,A,s.css))),a){if(I>=a.end)S(l=a.b,1-l),zs(t,a.b,"end"),r||(a.b?g():--a.group.r||Qe(a.group.c)),a=null;else if(I>=a.start){const M=I-a.start;l=a.a+a.d*A(M/a.duration),S(l,1-l)}}return!!(a||r)}))}return{run(m){cn(s)?vu().then(()=>{s=s({direction:m?"in":"out"}),_(m)}):_(m)},end(){g(),a=r=null}}}function Gt(t){return(t==null?void 0:t.length)!==void 0?t:Array.from(t)}function ku(t,e){z(t,1,1,()=>{e.delete(t.key)})}function pu(t,e,i,n,o,s,l,a,r,u,c,g){let v=t.length,_=s.length,m=v;const w={};for(;m--;)w[t[m].key]=m;const y=[],A=new Map,S=new Map,C=[];for(m=_;m--;){const R=g(o,s,m),G=i(R);let F=l.get(G);F?n&&C.push(()=>F.p(R,e)):(F=u(G,R),F.c()),A.set(G,y[m]=F),G in w&&S.set(G,Math.abs(m-w[G]))}const T=new Set,I=new Set;function M(R){B(R,1),R.m(a,c),l.set(R.key,R),c=R.first,_--}for(;v&&_;){const R=y[_-1],G=t[v-1],F=R.key,q=G.key;R===G?(c=R.first,v--,_--):A.has(q)?!l.has(F)||T.has(F)?M(R):I.has(q)?v--:S.get(F)>S.get(q)?(I.add(F),M(R)):(T.add(q),v--):(r(G,l),v--)}for(;v--;){const R=t[v];A.has(R.key)||r(R,l)}for(;_;)M(y[_-1]);return Qe(C),y}function be(t,e,i){const n=t.$$.props[e];n!==void 0&&(t.$$.bound[n]=i,i(t.$$.ctx[n]))}function me(t){t&&t.c()}function de(t,e,i){const{fragment:n,after_update:o}=t.$$;n&&n.m(e,i),tt(()=>{const s=t.$$.on_mount.map(Zt).filter(cn);t.$$.on_destroy?t.$$.on_destroy.push(...s):Qe(s),t.$$.on_mount=[]}),o.forEach(tt)}function ge(t,e){const i=t.$$;i.fragment!==null&&(yu(i.after_update),Qe(i.on_destroy),i.fragment&&i.fragment.d(e),i.on_destroy=i.fragment=null,i.ctx=[])}function Su(t,e){t.$$.dirty[0]===-1&&(Nn.push(t),Ol(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function Se(t,e,i,n,o,s,l=null,a=[-1]){const r=$n;eo(t);const u=t.$$={fragment:null,ctx:[],props:s,update:x,not_equal:o,bound:Qn(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(r?r.$$.context:[])),callbacks:Qn(),dirty:a,skip_bound:!1,root:e.target||r.$$.root};l&&l(u.root);let c=!1;if(u.ctx=i?i(t,e.props||{},(g,v,..._)=>{const m=_.length?_[0]:v;return u.ctx&&o(u.ctx[g],u.ctx[g]=m)&&(!u.skip_bound&&u.bound[g]&&u.bound[g](m),c&&Su(t,g)),v}):[],u.update(),c=!0,Qe(u.before_update),u.fragment=n?n(u.ctx):!1,e.target){if(e.hydrate){const g=ru(e.target);u.fragment&&u.fragment.l(g),g.forEach(O)}else u.fragment&&u.fragment.c();e.intro&&B(t.$$.fragment),de(t,e.target,e.anchor),d()}eo(r)}class we{constructor(){hl(this,"$$");hl(this,"$$set")}$destroy(){ge(this,1),this.$destroy=x}$on(e,i){if(!cn(i))return x;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(i),()=>{const o=n.indexOf(i);o!==-1&&n.splice(o,1)}}$set(e){this.$$set&&!iu(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const wu="4";typeof window!="undefined"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(wu);const Tu="@beyondwords/player",Bo="0.1.38",ri=(t,e)=>{t=[t].flat().join(`
4
+ }`,g=`__svelte_${cu(c)}_${a}`,v=Il(t),{stylesheet:_,rules:m}=Co.get(v)||du(v,t);m[g]||(m[g]=!0,_.insertRule(`@keyframes ${g} ${c}`,_.cssRules.length));const w=t.style.animation||"";return t.style.animation=`${w?`${w}, `:""}${g} ${n}ms linear ${o}ms 1 both`,Ao+=1,g}function gu(t,e){const i=(t.style.animation||"").split(", "),n=i.filter(e?s=>s.indexOf(e)<0:s=>s.indexOf("__svelte")===-1),o=i.length-n.length;o&&(t.style.animation=n.join(", "),Ao-=o,Ao||fu())}function fu(){Po(()=>{Ao||(Co.forEach(t=>{const{ownerNode:e}=t.stylesheet;e&&O(e)}),Co.clear())})}let $n;function eo(t){$n=t}function Vl(){if(!$n)throw new Error("Function called outside component initialization");return $n}function to(t){Vl().$$.on_mount.push(t)}function mu(t){Vl().$$.on_destroy.push(t)}const Nn=[],oe=[];let xn=[];const Es=[],Wl=Promise.resolve();let Ms=!1;function Ol(){Ms||(Ms=!0,Wl.then(d))}function hu(){return Ol(),Wl}function tt(t){xn.push(t)}function ve(t){Es.push(t)}const js=new Set;let Un=0;function d(){if(Un!==0)return;const t=$n;do{try{for(;Un<Nn.length;){const e=Nn[Un];Un++,eo(e),_u(e.$$)}}catch(e){throw Nn.length=0,Un=0,e}for(eo(null),Nn.length=0,Un=0;oe.length;)oe.pop()();for(let e=0;e<xn.length;e+=1){const i=xn[e];js.has(i)||(js.add(i),i())}xn.length=0}while(Nn.length);for(;Es.length;)Es.pop()();Ms=!1,js.clear(),eo(t)}function _u(t){if(t.fragment!==null){t.update(),Qe(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(tt)}}function yu(t){const e=[],i=[];xn.forEach(n=>t.indexOf(n)===-1?e.push(n):i.push(n)),i.forEach(n=>n()),xn=e}let io;function vu(){return io||(io=Promise.resolve(),io.then(()=>{io=null})),io}function zs(t,e,i){t.dispatchEvent(uu(`${e?"intro":"outro"}${i}`))}const Io=new Set;let Qi;function De(){Qi={r:0,c:[],p:Qi}}function Re(){Qi.r||Qe(Qi.c),Qi=Qi.p}function B(t,e){t&&t.i&&(Io.delete(t),t.i(e))}function z(t,e,i,n){if(t&&t.o){if(Io.has(t))return;Io.add(t),Qi.c.push(()=>{Io.delete(t),n&&(i&&t.d(1),n())}),t.o(e)}else n&&n()}const bu={duration:0};function El(t,e,i,n){let s=e(t,i,{direction:"both"}),l=n?0:1,a=null,r=null,u=null,c;function g(){u&&gu(t,u)}function v(m,w){const y=m.b-l;return w*=Math.abs(y),{a:l,b:m.b,d:y,duration:w,start:m.start,end:m.start+w,group:m.group}}function _(m){const{delay:w=0,duration:y=300,easing:A=Be,tick:S=x,css:C}=s||bu,T={start:nu()+w,b:m};m||(T.group=Qi,Qi.r+=1),"inert"in t&&(m?c!==void 0&&(t.inert=c):(c=t.inert,t.inert=!0)),a||r?r=T:(C&&(g(),u=Bl(t,l,m,y,w,A,C)),m&&S(0,1),a=v(T,y),tt(()=>zs(t,m,"start")),ou(I=>{if(r&&I>r.start&&(a=v(r,y),r=null,zs(t,a.b,"start"),C&&(g(),u=Bl(t,l,a.b,a.duration,0,A,s.css))),a){if(I>=a.end)S(l=a.b,1-l),zs(t,a.b,"end"),r||(a.b?g():--a.group.r||Qe(a.group.c)),a=null;else if(I>=a.start){const M=I-a.start;l=a.a+a.d*A(M/a.duration),S(l,1-l)}}return!!(a||r)}))}return{run(m){cn(s)?vu().then(()=>{s=s({direction:m?"in":"out"}),_(m)}):_(m)},end(){g(),a=r=null}}}function Gt(t){return(t==null?void 0:t.length)!==void 0?t:Array.from(t)}function ku(t,e){z(t,1,1,()=>{e.delete(t.key)})}function pu(t,e,i,n,o,s,l,a,r,u,c,g){let v=t.length,_=s.length,m=v;const w={};for(;m--;)w[t[m].key]=m;const y=[],A=new Map,S=new Map,C=[];for(m=_;m--;){const R=g(o,s,m),G=i(R);let F=l.get(G);F?n&&C.push(()=>F.p(R,e)):(F=u(G,R),F.c()),A.set(G,y[m]=F),G in w&&S.set(G,Math.abs(m-w[G]))}const T=new Set,I=new Set;function M(R){B(R,1),R.m(a,c),l.set(R.key,R),c=R.first,_--}for(;v&&_;){const R=y[_-1],G=t[v-1],F=R.key,q=G.key;R===G?(c=R.first,v--,_--):A.has(q)?!l.has(F)||T.has(F)?M(R):I.has(q)?v--:S.get(F)>S.get(q)?(I.add(F),M(R)):(T.add(q),v--):(r(G,l),v--)}for(;v--;){const R=t[v];A.has(R.key)||r(R,l)}for(;_;)M(y[_-1]);return Qe(C),y}function be(t,e,i){const n=t.$$.props[e];n!==void 0&&(t.$$.bound[n]=i,i(t.$$.ctx[n]))}function me(t){t&&t.c()}function de(t,e,i){const{fragment:n,after_update:o}=t.$$;n&&n.m(e,i),tt(()=>{const s=t.$$.on_mount.map(Zt).filter(cn);t.$$.on_destroy?t.$$.on_destroy.push(...s):Qe(s),t.$$.on_mount=[]}),o.forEach(tt)}function ge(t,e){const i=t.$$;i.fragment!==null&&(yu(i.after_update),Qe(i.on_destroy),i.fragment&&i.fragment.d(e),i.on_destroy=i.fragment=null,i.ctx=[])}function Su(t,e){t.$$.dirty[0]===-1&&(Nn.push(t),Ol(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function Se(t,e,i,n,o,s,l=null,a=[-1]){const r=$n;eo(t);const u=t.$$={fragment:null,ctx:[],props:s,update:x,not_equal:o,bound:Qn(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(r?r.$$.context:[])),callbacks:Qn(),dirty:a,skip_bound:!1,root:e.target||r.$$.root};l&&l(u.root);let c=!1;if(u.ctx=i?i(t,e.props||{},(g,v,..._)=>{const m=_.length?_[0]:v;return u.ctx&&o(u.ctx[g],u.ctx[g]=m)&&(!u.skip_bound&&u.bound[g]&&u.bound[g](m),c&&Su(t,g)),v}):[],u.update(),c=!0,Qe(u.before_update),u.fragment=n?n(u.ctx):!1,e.target){if(e.hydrate){const g=ru(e.target);u.fragment&&u.fragment.l(g),g.forEach(O)}else u.fragment&&u.fragment.c();e.intro&&B(t.$$.fragment),de(t,e.target,e.anchor),d()}eo(r)}class we{constructor(){hl(this,"$$");hl(this,"$$set")}$destroy(){ge(this,1),this.$destroy=x}$on(e,i){if(!cn(i))return x;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(i),()=>{const o=n.indexOf(i);o!==-1&&n.splice(o,1)}}$set(e){this.$$set&&!iu(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const wu="4";typeof window!="undefined"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(wu);const Tu="@beyondwords/player",Bo="0.1.39",ri=(t,e)=>{t=[t].flat().join(`
5
5
  `);let i=`${Tu}:
6
6
 
7
7
  ${t}`;if(e){i+=`
@@ -54,6 +54,6 @@ This context may be helpful:
54
54
  `),le=p("select"),ii=p("option"),ii.textContent="all",vn=p("option"),vn.textContent="body",bn=p("option"),bn.textContent="none",kn=p("option"),kn.textContent="all-none",pn=p("option"),pn.textContent="none-all",Ts=X(),Bn=p("div"),Ps=ne(`segmentWidgetPosition:
55
55
  `),Ri=p("select");for(let he=0;he<12;he+=1)Vn[he].c();Cs=X(),li&&li.c(),po=X(),As=p("br"),Is=X(),zi.c(),W(i,"class","heading svelte-g76q0j"),u.__value="small",U(u,u.__value),c.__value="standard",U(c,c.__value),g.__value="large",U(g,g.__value),v.__value="video",U(v,v.__value),W(r,"tabindex",-1),W(r,"class","svelte-g76q0j"),t[6]===void 0&&tt(()=>t[45].call(r)),W(l,"class","control svelte-g76q0j"),A.__value="stopped",U(A,A.__value),S.__value="playing",U(S,S.__value),C.__value="paused",U(C,C.__value),W(y,"tabindex",-1),W(y,"class","svelte-g76q0j"),t[20]===void 0&&tt(()=>t[46].call(y)),W(m,"class","control svelte-g76q0j"),W(R,"tabindex",-1),W(R,"type","text"),W(R,"class","svelte-g76q0j"),W(I,"class","control svelte-g76q0j"),W(ae,"tabindex",-1),W(ae,"type","text"),W(ae,"class","svelte-g76q0j"),W(F,"class","control svelte-g76q0j"),re.__value="auto",U(re,re.__value),fe.__value="segments",U(fe,fe.__value),Z.__value="seconds",U(Z,Z.__value),J.__value="seconds-15",U(J,J.__value),ie.__value="seconds-15-30",U(ie,ie.__value),b.__value="tracks",U(b,b.__value),W($,"tabindex",-1),W($,"class","svelte-g76q0j"),t[9]===void 0&&tt(()=>t[49].call($)),W(se,"class","control svelte-g76q0j"),We.__value="auto",U(We,We.__value),He.__value="show",U(He,He.__value),K.__value="show-3",U(K,K.__value),Te.__value="show-999",U(Te,Te.__value),Ye.__value="hide",U(Ye,Ye.__value),W(Ce,"tabindex",-1),W(Ce,"class","svelte-g76q0j"),t[10]===void 0&&tt(()=>t[50].call(Ce)),W(j,"class","control svelte-g76q0j"),Ge.__value="auto",U(Ge,Ge.__value),xe.__value="show",U(xe,xe.__value),Ue.__value="hide",U(Ue,Ue.__value),W(dt,"tabindex",-1),W(dt,"class","svelte-g76q0j"),t[11]===void 0&&tt(()=>t[51].call(dt)),W(at,"class","control svelte-g76q0j"),Fe.__value=-1,U(Fe,Fe.__value),W(nt,"tabindex",-1),W(nt,"class","svelte-g76q0j"),t[15]===void 0&&tt(()=>t[52].call(nt)),W(Ne,"class","control svelte-g76q0j"),et.__value="small",U(et,et.__value),ot.__value="standard",U(ot,ot.__value),ut.__value="large",U(ut,ut.__value),qe.__value="video",U(qe,qe.__value),W(Oe,"tabindex",-1),W(Oe,"class","svelte-g76q0j"),t[22]===void 0&&tt(()=>t[53].call(Oe)),W($e,"class","control svelte-g76q0j"),Ke.__value="auto",U(Ke,Ke.__value),st.__value="left",U(st,st.__value),Y.__value="center",U(Y,Y.__value),ze.__value="right",U(ze,ze.__value),W(Ze,"tabindex",-1),W(Ze,"class","svelte-g76q0j"),t[23]===void 0&&tt(()=>t[54].call(Ze)),W(ht,"class","control svelte-g76q0j"),Xe.__value="auto",U(Xe,Xe.__value),Wt.__value="400px",U(Wt,Wt.__value),ct.__value="30rem",U(ct,ct.__value),Pt.__value="fit-content",U(Pt,Pt.__value),gt.__value="initial",U(gt,gt.__value),Dt.__value="0",U(Dt,Dt.__value),W(Je,"tabindex",-1),W(Je,"class","svelte-g76q0j"),t[24]===void 0&&tt(()=>t[55].call(Je)),W(yt,"class","control svelte-g76q0j"),W(vt,"tabindex",-1),W(vt,"type","text"),W(vt,"class","svelte-g76q0j"),W(Nt,"class","control svelte-g76q0j"),W(ue,"tabindex",-1),W(ue,"type","text"),W(ue,"class","svelte-g76q0j"),W(k,"class","control svelte-g76q0j"),W(Ot,"tabindex",-1),W(Ot,"type","text"),W(Ot,"class","svelte-g76q0j"),W(ei,"class","control svelte-g76q0j"),W(bt,"tabindex",-1),W(bt,"type","text"),W(bt,"class","svelte-g76q0j"),W(ui,"class","control svelte-g76q0j"),qt.__value="all",U(qt,qt.__value),Ii.__value="body",U(Ii,Ii.__value),jt.__value="none",U(jt,jt.__value),Si.__value="all-none",U(Si,Si.__value),Ht.__value="none-all",U(Ht,Ht.__value),W(Mt,"tabindex",-1),W(Mt,"class","svelte-g76q0j"),t[33]===void 0&&tt(()=>t[60].call(Mt)),W(ci,"class","control svelte-g76q0j"),di.__value="all",U(di,di.__value),kt.__value="body",U(kt,kt.__value),gi.__value="none",U(gi,gi.__value),pt.__value="all-none",U(pt,pt.__value),fi.__value="none-all",U(fi,fi.__value),W(Yt,"tabindex",-1),W(Yt,"class","svelte-g76q0j"),t[34]===void 0&&tt(()=>t[61].call(Yt)),W(ti,"class","control svelte-g76q0j"),ii.__value="all",U(ii,ii.__value),vn.__value="body",U(vn,vn.__value),bn.__value="none",U(bn,bn.__value),kn.__value="all-none",U(kn,kn.__value),pn.__value="none-all",U(pn,pn.__value),W(le,"tabindex",-1),W(le,"class","svelte-g76q0j"),t[35]===void 0&&tt(()=>t[62].call(le)),W(D,"class","control svelte-g76q0j"),W(Ri,"tabindex",-1),W(Ri,"class","svelte-g76q0j"),t[36]===void 0&&tt(()=>t[63].call(Ri)),W(Bn,"class","control svelte-g76q0j"),W(e,"class","control-panel")},m(he,lt){E(he,e,lt),f(e,i),f(e,n),f(e,o),f(e,s),f(e,l),f(l,a),f(l,r),f(r,u),f(r,c),f(r,g),f(r,v),Ie(r,t[6],!0),f(e,_),f(e,m),f(m,w),f(m,y),f(y,A),f(y,S),f(y,C),Ie(y,t[20],!0),f(e,T),f(e,I),f(I,M),f(I,R),U(R,t[7]),f(e,G),f(e,F),f(F,q),f(F,ae),U(ae,t[8]),f(e,ce),f(e,se),f(se,ee),f(se,$),f($,re),f($,fe),f($,Z),f($,J),f($,ie),f($,b),Ie($,t[9],!0),f(e,P),f(e,j),f(j,L),f(j,Ce),f(Ce,We),f(Ce,He),f(Ce,K),f(Ce,Te),f(Ce,Ye),Ie(Ce,t[10],!0),f(e,it),f(e,at),f(at,wt),f(at,dt),f(dt,Ge),f(dt,xe),f(dt,Ue),Ie(dt,t[11],!0),f(e,mt),f(e,Ne),f(Ne,rt),f(Ne,nt),f(nt,Fe);for(let St=0;St<ni.length;St+=1)ni[St]&&ni[St].m(nt,null);Ie(nt,t[15],!0),f(e,Lt),f(e,$e),f($e,Ve),f($e,Oe),f(Oe,et),f(Oe,ot),f(Oe,ut),f(Oe,qe),Ie(Oe,t[22],!0),f(e,It),f(e,ht),f(ht,_t),f(ht,Ze),f(Ze,Ke),f(Ze,st),f(Ze,Y),f(Ze,ze),Ie(Ze,t[23],!0),f(e,Le),f(e,yt),f(yt,Tt),f(yt,Je),f(Je,Xe),f(Je,Wt),f(Je,ct),f(Je,Pt),f(Je,gt),f(Je,Dt),Ie(Je,t[24],!0),f(e,Rt),f(e,Nt),f(Nt,Bt),f(Nt,vt),U(vt,t[26]),f(e,_e),f(e,k),f(k,V),f(k,ue),U(ue,t[27]),f(e,xt),f(e,ei),f(ei,pi),f(ei,Ot),U(Ot,t[28]),f(e,Ai),f(e,ui),f(ui,_n),f(ui,bt),U(bt,t[29]),f(e,Mi),f(e,ci),f(ci,ji),f(ci,Mt),f(Mt,qt),f(Mt,Ii),f(Mt,jt),f(Mt,Si),f(Mt,Ht),Ie(Mt,t[33],!0),f(e,Xi),f(e,ti),f(ti,yn),f(ti,Yt),f(Yt,di),f(Yt,kt),f(Yt,gi),f(Yt,pt),f(Yt,fi),Ie(Yt,t[34],!0),f(e,zt),f(e,D),f(D,Q),f(D,le),f(le,ii),f(le,vn),f(le,bn),f(le,kn),f(le,pn),Ie(le,t[35],!0),f(e,Ts),f(e,Bn),f(Bn,Ps),f(Bn,Ri);for(let St=0;St<12;St+=1)Vn[St]&&Vn[St].m(Ri,null);Ie(Ri,t[36],!0),f(e,Cs),li&&li.m(e,null),f(e,po),f(e,As),f(e,Is),zi.m(e,null),So||(Bs=[H(r,"change",t[45]),H(y,"change",t[46]),H(R,"input",t[47]),H(ae,"input",t[48]),H($,"change",t[49]),H(Ce,"change",t[50]),H(dt,"change",t[51]),H(nt,"change",t[52]),H(Oe,"change",t[53]),H(Ze,"change",t[54]),H(Je,"change",t[55]),H(vt,"input",t[56]),H(ue,"input",t[57]),H(Ot,"input",t[58]),H(bt,"input",t[59]),H(Mt,"change",t[60]),H(Yt,"change",t[61]),H(le,"change",t[62]),H(Ri,"change",t[63])],So=!0)},p(he,lt){if(lt[0]&64&&Ie(r,he[6]),lt[0]&1048576&&Ie(y,he[20]),lt[0]&128&&R.value!==he[7]&&U(R,he[7]),lt[0]&256&&ae.value!==he[8]&&U(ae,he[8]),lt[0]&512&&Ie($,he[9]),lt[0]&1024&&Ie(Ce,he[10]),lt[0]&2048&&Ie(dt,he[11]),lt[1]&4096){Sn=Gt(he[43]);let St;for(St=0;St<Sn.length;St+=1){const Ws=Ha(he,Sn,St);ni[St]?ni[St].p(Ws,lt):(ni[St]=Ya(Ws),ni[St].c(),ni[St].m(nt,null))}for(;St<ni.length;St+=1)ni[St].d(1);ni.length=Sn.length}lt[0]&32768&&Ie(nt,he[15]),lt[0]&4194304&&Ie(Oe,he[22]),lt[0]&8388608&&Ie(Ze,he[23]),lt[0]&16777216&&Ie(Je,he[24]),lt[0]&67108864&&vt.value!==he[26]&&U(vt,he[26]),lt[0]&134217728&&ue.value!==he[27]&&U(ue,he[27]),lt[0]&268435456&&Ot.value!==he[28]&&U(Ot,he[28]),lt[0]&536870912&&bt.value!==he[29]&&U(bt,he[29]),lt[1]&4&&Ie(Mt,he[33]),lt[1]&8&&Ie(Yt,he[34]),lt[1]&16&&Ie(le,he[35]),lt[1]&32&&Ie(Ri,he[36]),he[44]?li?li.p(he,lt):(li=Za(he),li.c(),li.m(e,po)):li&&(li.d(1),li=null),Jn===(Jn=Vs(he))&&zi?zi.p(he,lt):(zi.d(1),zi=Jn(he),zi&&(zi.c(),zi.m(e,null)))},i:x,o:x,d(he){he&&O(e),dn(ni,he),dn(Vn,he),li&&li.d(),zi.d(),So=!1,Qe(Bs)}}}function N0(t,e,i){import(BeyondWords.Player.styleSrc );let{projectId:n}=e,{contentId:o}=e,{playlistId:s}=e,{sourceId:l}=e,{sourceUrl:a}=e,{showUserInterface:r}=e,{playerStyle:u}=e,{playerTitle:c}=e,{callToAction:g}=e,{skipButtonStyle:v}=e,{playlistStyle:_}=e,{playlistToggle:m}=e,{mediaSession:w}=e,{content:y}=e,{contentIndex:A}=e,{introsOutros:S}=e,{introsOutrosIndex:C}=e,{adverts:T}=e,{advertIndex:I}=e,{persistentAdImage:M}=e,{persistentIndex:R}=e,{duration:G}=e,{currentTime:F}=e,{playbackState:q}=e,{playbackRate:ae}=e,{widgetStyle:ce}=e,{widgetPosition:se}=e,{widgetWidth:ee}=e,{widgetTarget:$}=e,{textColor:re}=e,{backgroundColor:fe}=e,{iconColor:Z}=e,{highlightColor:J}=e,{videoTextColor:ie}=e,{videoIconColor:b}=e,{logoIconEnabled:P}=e,{highlightSections:j}=e,{clickableSections:L}=e,{segmentWidgetSections:Ce}=e,{segmentWidgetPosition:We}=e,{advertConsent:He}=e,{analyticsConsent:K}=e,{analyticsCustomUrl:Te}=e,{analyticsTag:Ye}=e,it=!1;function at(){u=Ct(this),i(6,u)}function wt(){q=Ct(this),i(20,q)}function dt(){c=this.value,i(7,c)}function Ge(){g=this.value,i(8,g)}function xe(){v=Ct(this),i(9,v)}function Ue(){_=Ct(this),i(10,_)}function mt(){m=Ct(this),i(11,m)}function Ne(){I=Ct(this),i(15,I)}function rt(){ce=Ct(this),i(22,ce)}function nt(){se=Ct(this),i(23,se)}function Fe(){ee=Ct(this),i(24,ee)}function Lt(){re=this.value,i(26,re)}function $e(){fe=this.value,i(27,fe)}function Ve(){Z=this.value,i(28,Z)}function Oe(){J=this.value,i(29,J)}function et(){j=Ct(this),i(33,j)}function ot(){L=Ct(this),i(34,L)}function ut(){Ce=Ct(this),i(35,Ce)}function qe(){We=Ct(this),i(36,We)}function It(){n=this.value,i(0,n)}function ht(){o=this.value,i(1,o)}function _t(){s=this.value,i(2,s)}function Ze(){l=this.value,i(3,l)}function Ke(){a=this.value,i(4,a)}function st(){r=Ct(this),i(5,r)}function Y(){ie=this.value,i(30,ie)}function ze(){b=this.value,i(31,b)}function Le(){w=Ct(this),i(12,w)}function yt(){A=Ct(this),i(13,A)}function Tt(){C=Ct(this),i(14,C)}function Je(){M=Ct(this),i(16,M)}function Xe(){R=Ct(this),i(17,R)}function Wt(){G=this.value,i(18,G)}function ct(){F=this.value,i(19,F)}function Pt(){ae=this.value,i(21,ae)}function gt(){$=this.value,i(25,$)}function Dt(){P=Ct(this),i(32,P)}function Rt(){He=Ct(this),i(37,He)}function Nt(){K=Ct(this),i(38,K)}function Bt(){Te=this.value,i(39,Te)}function vt(){Ye=this.value,i(40,Ye)}const _e=()=>i(44,it=!1),k=()=>i(44,it=!0);return t.$$set=V=>{"projectId"in V&&i(0,n=V.projectId),"contentId"in V&&i(1,o=V.contentId),"playlistId"in V&&i(2,s=V.playlistId),"sourceId"in V&&i(3,l=V.sourceId),"sourceUrl"in V&&i(4,a=V.sourceUrl),"showUserInterface"in V&&i(5,r=V.showUserInterface),"playerStyle"in V&&i(6,u=V.playerStyle),"playerTitle"in V&&i(7,c=V.playerTitle),"callToAction"in V&&i(8,g=V.callToAction),"skipButtonStyle"in V&&i(9,v=V.skipButtonStyle),"playlistStyle"in V&&i(10,_=V.playlistStyle),"playlistToggle"in V&&i(11,m=V.playlistToggle),"mediaSession"in V&&i(12,w=V.mediaSession),"content"in V&&i(41,y=V.content),"contentIndex"in V&&i(13,A=V.contentIndex),"introsOutros"in V&&i(42,S=V.introsOutros),"introsOutrosIndex"in V&&i(14,C=V.introsOutrosIndex),"adverts"in V&&i(43,T=V.adverts),"advertIndex"in V&&i(15,I=V.advertIndex),"persistentAdImage"in V&&i(16,M=V.persistentAdImage),"persistentIndex"in V&&i(17,R=V.persistentIndex),"duration"in V&&i(18,G=V.duration),"currentTime"in V&&i(19,F=V.currentTime),"playbackState"in V&&i(20,q=V.playbackState),"playbackRate"in V&&i(21,ae=V.playbackRate),"widgetStyle"in V&&i(22,ce=V.widgetStyle),"widgetPosition"in V&&i(23,se=V.widgetPosition),"widgetWidth"in V&&i(24,ee=V.widgetWidth),"widgetTarget"in V&&i(25,$=V.widgetTarget),"textColor"in V&&i(26,re=V.textColor),"backgroundColor"in V&&i(27,fe=V.backgroundColor),"iconColor"in V&&i(28,Z=V.iconColor),"highlightColor"in V&&i(29,J=V.highlightColor),"videoTextColor"in V&&i(30,ie=V.videoTextColor),"videoIconColor"in V&&i(31,b=V.videoIconColor),"logoIconEnabled"in V&&i(32,P=V.logoIconEnabled),"highlightSections"in V&&i(33,j=V.highlightSections),"clickableSections"in V&&i(34,L=V.clickableSections),"segmentWidgetSections"in V&&i(35,Ce=V.segmentWidgetSections),"segmentWidgetPosition"in V&&i(36,We=V.segmentWidgetPosition),"advertConsent"in V&&i(37,He=V.advertConsent),"analyticsConsent"in V&&i(38,K=V.analyticsConsent),"analyticsCustomUrl"in V&&i(39,Te=V.analyticsCustomUrl),"analyticsTag"in V&&i(40,Ye=V.analyticsTag)},[n,o,s,l,a,r,u,c,g,v,_,m,w,A,C,I,M,R,G,F,q,ae,ce,se,ee,$,re,fe,Z,J,ie,b,P,j,L,Ce,We,He,K,Te,Ye,y,S,T,it,at,wt,dt,Ge,xe,Ue,mt,Ne,rt,nt,Fe,Lt,$e,Ve,Oe,et,ot,ut,qe,It,ht,_t,Ze,Ke,st,Y,ze,Le,yt,Tt,Je,Xe,Wt,ct,Pt,gt,Dt,Rt,Nt,Bt,vt,_e,k]}class x0 extends we{constructor(e){super(),Se(this,e,N0,R0,ke,{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:41,contentIndex:13,introsOutros:42,introsOutrosIndex:14,adverts:43,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,videoTextColor:30,videoIconColor:31,logoIconEnabled:32,highlightSections:33,clickableSections:34,segmentWidgetSections:35,segmentWidgetPosition:36,advertConsent:37,analyticsConsent:38,analyticsCustomUrl:39,analyticsTag:40},null,[-1,-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[41]}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[42]}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[43]}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 videoTextColor(){return this.$$.ctx[30]}set videoTextColor(e){this.$$set({videoTextColor:e}),d()}get videoIconColor(){return this.$$.ctx[31]}set videoIconColor(e){this.$$set({videoIconColor:e}),d()}get logoIconEnabled(){return this.$$.ctx[32]}set logoIconEnabled(e){this.$$set({logoIconEnabled:e}),d()}get highlightSections(){return this.$$.ctx[33]}set highlightSections(e){this.$$set({highlightSections:e}),d()}get clickableSections(){return this.$$.ctx[34]}set clickableSections(e){this.$$set({clickableSections:e}),d()}get segmentWidgetSections(){return this.$$.ctx[35]}set segmentWidgetSections(e){this.$$set({segmentWidgetSections:e}),d()}get segmentWidgetPosition(){return this.$$.ctx[36]}set segmentWidgetPosition(e){this.$$set({segmentWidgetPosition:e}),d()}get advertConsent(){return this.$$.ctx[37]}set advertConsent(e){this.$$set({advertConsent:e}),d()}get analyticsConsent(){return this.$$.ctx[38]}set analyticsConsent(e){this.$$set({analyticsConsent:e}),d()}get analyticsCustomUrl(){return this.$$.ctx[39]}set analyticsCustomUrl(e){this.$$set({analyticsCustomUrl:e}),d()}get analyticsTag(){return this.$$.ctx[40]}set analyticsTag(e){this.$$set({analyticsTag:e}),d()}}const U0=(t,e,i)=>{H0(t);const n=new Image;return n.setAttribute("crossorigin","anonymous"),new Promise((o,s)=>{n.addEventListener("load",F0(n,e,i,o,s)),n.addEventListener("error",s),n.src=t})},F0=(t,e,i,n,o)=>()=>{const s=document.createElement("canvas"),l=s.getContext("2d");s.width=e,s.height=i,l.drawImage(t,0,0,e,i),s.toBlob(q0(t,e,i,n,o))},Kn={},q0=(t,e,i,n,o)=>s=>{var a;s||o();const l=URL.createObjectURL(s);Kn[a=t.src]||(Kn[a]=[]),Kn[t.src].push(l),n({src:l,sizes:`${e}x${i}`,type:"image/png"})},H0=t=>{Object.keys(Kn).filter(n=>n!==t).map(n=>Kn[n]).flat().forEach(n=>URL.revokeObjectURL(n))},Y0=(t,e,i)=>Bi(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"}}),Z0=(t,e,i)=>Ut(t,e,i,1),G0=(t,e,i)=>Pe(t,e,e==="style"?J0(i):i),K0=/;(?!([^()]*\([^()]*\))*[^()]*\))/,J0=t=>t.split(K0).filter(e=>e).map(e=>e+" !important").join(";");function Xa(t,e,i){const n=t.slice();return n[41]=e[i],n[42]=e,n[43]=i,n}function Qa(t){let e,i,n,o=t[43],s;i=new Sa({props:{fill:t[2],color:t[1],scale:t[41]/18,zoom:.65}});const l=()=>t[38](e,o),a=()=>t[38](null,o);return{c(){e=p("div"),me(i.$$.fragment),n=X(),Z0(e,"display","none")},m(r,u){E(r,e,u),de(i,e,null),f(e,n),l(),s=!0},p(r,u){t=r;const c={};u[0]&4&&(c.fill=t[2]),u[0]&2&&(c.color=t[1]),i.$set(c),o!==t[43]&&(a(),o=t[43],l())},i(r){s||(B(i.$$.fragment,r),s=!0)},o(r){z(i.$$.fragment,r),s=!1},d(r){r&&O(e),ge(i),a()}}}function X0(t){let e,i,n=Gt(t[3]),o=[];for(let l=0;l<n.length;l+=1)o[l]=Qa(Xa(t,n,l));const s=l=>z(o[l],1,1,()=>{o[l]=null});return{c(){e=p("div");for(let l=0;l<o.length;l+=1)o[l].c();G0(e,"class","media-session")},m(l,a){E(l,e,a);for(let r=0;r<o.length;r+=1)o[r]&&o[r].m(e,null);i=!0},p(l,a){if(a[0]&15){n=Gt(l[3]);let r;for(r=0;r<n.length;r+=1){const u=Xa(l,n,r);o[r]?(o[r].p(u,a),B(o[r],1)):(o[r]=Qa(u),o[r].c(),B(o[r],1),o[r].m(e,null))}for(De(),r=n.length;r<o.length;r+=1)s(r);Re()}},i(l){if(!i){for(let a=0;a<n.length;a+=1)B(o[a]);i=!0}},o(l){o=o.filter(Boolean);for(let a=0;a<o.length;a+=1)z(o[a]);i=!1},d(l){l&&O(e),dn(o,l)}}}function Q0(t,e,i){let n,o,s,l,a,r,u,c,g,v,_,m,w,y,A,S,C,T,I,M,R,G;const F=[96,128,192,256,384,512],q=["hangup","nextslide","nexttrack","pause","play","previousslide","previoustrack","seekbackward","seekforward","seekto","skipad","stop","togglecamera","togglemicrophone"];let{content:ae=[]}=e,{contentIndex:ce=0}=e,{activeAdvert:se=void 0}=e,{persistentAdvert:ee=void 0}=e,{companionAdvert:$=void 0}=e,{duration:re=0}=e,{playbackState:fe="stopped"}=e,{skipButtonStyle:Z="auto"}=e,{backgroundColor:J="#f5f5f5"}=e,{iconColor:ie="black"}=e,{onEvent:b=()=>{}}=e,P=[],j=new Set,L=F.map(()=>{}),Ce=F.map(()=>{});const We=()=>i(16,j=j.add(A));function He(K,Te){oe[K?"unshift":"push"](()=>{L[Te]=K,i(0,L)})}return t.$$set=K=>{"content"in K&&i(4,ae=K.content),"contentIndex"in K&&i(5,ce=K.contentIndex),"activeAdvert"in K&&i(6,se=K.activeAdvert),"persistentAdvert"in K&&i(7,ee=K.persistentAdvert),"companionAdvert"in K&&i(8,$=K.companionAdvert),"duration"in K&&i(9,re=K.duration),"playbackState"in K&&i(10,fe=K.playbackState),"skipButtonStyle"in K&&i(11,Z=K.skipButtonStyle),"backgroundColor"in K&&i(12,J=K.backgroundColor),"iconColor"in K&&i(13,ie=K.iconColor),"onEvent"in K&&i(14,b=K.onEvent)},t.$$.update=()=>{t.$$.dirty[0]&1024&&i(34,n=fe==="stopped"),t.$$.dirty[0]&64|t.$$.dirty[1]&8&&i(36,o=se&&!n),t.$$.dirty[0]&16&&i(37,s=ae.length>1),t.$$.dirty[0]&48&&i(28,l=ae[ce]),t.$$.dirty[0]&2048|t.$$.dirty[1]&64&&i(20,a=Z==="auto"?s?"tracks":"segments":Z),t.$$.dirty[0]&1048576&&i(22,r=parseFloat(a.split("-")[1]||10)),t.$$.dirty[0]&5242880&&i(19,u=parseFloat(a.split("-")[2]||r)),t.$$.dirty[0]&1048576|t.$$.dirty[1]&32&&i(21,c=!o&&a!=="tracks"),t.$$.dirty[0]&1048576|t.$$.dirty[1]&32&&i(18,g=!o&&a==="tracks"),t.$$.dirty[1]&32&&i(23,v=!o),t.$$.dirty[0]&4160|t.$$.dirty[1]&32&&i(2,_=o&&(se==null?void 0:se.backgroundColor)||J),t.$$.dirty[0]&8256|t.$$.dirty[1]&32&&i(1,m=o&&(se==null?void 0:se.iconColor)||ie),t.$$.dirty[0]&7&&i(17,Ce=F.map((K,Te)=>hu().then(()=>L[Te]))),t.$$.dirty[0]&320&&i(35,w=($==null?void 0:$.imageUrl)||(se==null?void 0:se.imageUrl)),t.$$.dirty[0]&268435584|t.$$.dirty[1]&56&&i(33,y=o&&w||!n&&(ee==null?void 0:ee.imageUrl)||(l==null?void 0:l.imageUrl)),t.$$.dirty[0]&65536|t.$$.dirty[1]&4&&i(29,A=j.has(y)?null:y),t.$$.dirty[0]&536870912&&i(32,S=A?F.map(K=>U0(A,K,K)):[]),t.$$.dirty[0]&536870912&&i(31,C=A?[{src:A,sizes:"any"}]:[]),t.$$.dirty[0]&537001984&&i(30,T=A?[]:F.map((K,Te)=>Y0(Ce[Te],K,K))),t.$$.dirty[0]&1073741824|t.$$.dirty[1]&3&&i(27,I=Promise.all([...S,...C,...T])),t.$$.dirty[0]&268435456&&i(26,M=(l==null?void 0:l.title)||""),t.$$.dirty[0]&134217728&&I.then(K=>i(15,P=K)).catch(We),t.$$.dirty[0]&117473280&&(navigator.mediaSession.metadata=new MediaMetadata({title:M,artist:R,album:G,artwork:P})),t.$$.dirty[0]&16384&&navigator.mediaSession.setActionHandler("play",()=>{b(ye({type:"PressedPlay",description:"The play button was pressed.",initiatedBy:"media-session-api"}))}),t.$$.dirty[0]&16384&&navigator.mediaSession.setActionHandler("pause",()=>{b(ye({type:"PressedPause",description:"The pause button was pressed.",initiatedBy:"media-session-api"}))}),t.$$.dirty[0]&8405504&&navigator.mediaSession.setActionHandler("seekto",v?({seekTime:K})=>{b(ye({type:"ScrubbedProgressBar",description:"The user pressed on the progress bar then dragged.",initiatedBy:"media-session-api",ratio:Math.max(0,Math.min(1,K/re))}))}:null),t.$$.dirty[0]&7356416&&navigator.mediaSession.setActionHandler("seekbackward",c?({seekOffset:K})=>{b(ye(a==="seconds"||K?{type:"PressedSeekBack",description:"The seek backward button was pressed.",initiatedBy:"media-session-api",seconds:K||r}:{type:"PressedPrevSegment",description:"The previous segment button was pressed.",initiatedBy:"media-session-api"}))}:null),t.$$.dirty[0]&3686400&&navigator.mediaSession.setActionHandler("seekforward",c?({seekOffset:K})=>{b(ye(a==="seconds"||K?{type:"PressedSeekAhead",description:"The seek ahead button was pressed.",initiatedBy:"media-session-api",seconds:K||u}:{type:"PressedNextSegment",description:"The next segment button was pressed.",initiatedBy:"media-session-api"}))}:null),t.$$.dirty[0]&278528&&navigator.mediaSession.setActionHandler("previoustrack",g?()=>{b(ye({type:"PressedPrevTrack",description:"The previous track button was pressed.",initiatedBy:"media-session-api"}))}:null),t.$$.dirty[0]&278528&&navigator.mediaSession.setActionHandler("nexttrack",g?()=>{b(ye({type:"PressedNextTrack",description:"The next track button was pressed.",initiatedBy:"media-session-api"}))}:null)},i(25,R=""),i(24,G=""),navigator.mediaSession.setByPlayer=!0,q.forEach(K=>{try{navigator.mediaSession.setActionHandler(K,null)}catch(Te){}}),[L,m,_,F,ae,ce,se,ee,$,re,fe,Z,J,ie,b,P,j,Ce,g,u,a,c,r,v,G,R,M,I,l,A,T,C,S,y,n,w,o,s,He]}class $0 extends we{constructor(e){super(),Se(this,e,Q0,X0,ke,{content:4,contentIndex:5,activeAdvert:6,persistentAdvert:7,companionAdvert:8,duration:9,playbackState:10,skipButtonStyle:11,backgroundColor:12,iconColor:13,onEvent:14},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 companionAdvert(){return this.$$.ctx[8]}set companionAdvert(e){this.$$set({companionAdvert:e}),d()}get duration(){return this.$$.ctx[9]}set duration(e){this.$$set({duration:e}),d()}get playbackState(){return this.$$.ctx[10]}set playbackState(e){this.$$set({playbackState:e}),d()}get skipButtonStyle(){return this.$$.ctx[11]}set skipButtonStyle(e){this.$$set({skipButtonStyle:e}),d()}get backgroundColor(){return this.$$.ctx[12]}set backgroundColor(e){this.$$set({backgroundColor:e}),d()}get iconColor(){return this.$$.ctx[13]}set iconColor(e){this.$$set({iconColor:e}),d()}get onEvent(){return this.$$.ctx[14]}set onEvent(e){this.$$set({onEvent:e}),d()}}const $a=(t,e,i)=>Pe(t,e,e==="style"?t_(i):i),e_=/;(?!([^()]*\([^()]*\))*[^()]*\))/,t_=t=>t.split(e_).filter(e=>e).map(e=>e+" !important").join(";");function er(t){let e,i,n,o;return{c(){e=p("script"),n=X(),o=p("script"),o.textContent=`window.dataLayer = window.dataLayer || [];
56
56
  function gtag() { dataLayer.push(arguments); }
57
- gtag("js", new Date());`,e.async=!0,wi(e.src,i="https://www.googletagmanager.com/gtag/js?id="+t[0])||$a(e,"src",i)},m(s,l){E(s,e,l),E(s,n,l),E(s,o,l)},p(s,l){l&1&&!wi(e.src,i="https://www.googletagmanager.com/gtag/js?id="+s[0])&&$a(e,"src",i)},d(s){s&&(O(e),O(n),O(o))}}}function i_(t){let e,i=!t[1]&&er(t);return{c(){i&&i.c(),e=xi()},m(n,o){i&&i.m(document.head,null),f(document.head,e)},p(n,[o]){n[1]?i&&(i.d(1),i=null):i?i.p(n,o):(i=er(n),i.c(),i.m(e.parentNode,e))},i:x,o:x,d(n){i&&i.d(n),O(e)}}}function n_(t,e,i){let n,{analyticsTag:o}=e;return t.$$set=s=>{"analyticsTag"in s&&i(0,o=s.analyticsTag)},i(1,n=window.gtag),[o,n]}class o_ extends we{constructor(e){super(),Se(this,e,n_,i_,ke,{analyticsTag:0})}get analyticsTag(){return this.$$.ctx[0]}set analyticsTag(e){this.$$set({analyticsTag:e}),d()}}const L3="";class s_ extends we{constructor(e){super(),Se(this,e,null,null,ke,{})}}class $s{constructor(e,i){Ae(this,go);Ae(this,ts);this.onSelected=e,this.onDeselected=i,this.consumers={}}addInterest(e,i,...n){var s;(s=this.consumers)[e]||(s[e]=[]);const o=this.consumers[e].slice(-1)[0];this.consumers[e].push({consumerId:i,args:n}),!(o&&N(this,go,yl).call(this,n,o.args))&&(o&&this.onDeselected(e,...o.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(N(this,ts,Er).call(this,this.consumers[e],a=>a.consumerId===i),!(n&&i===n.consumerId))return;const s=this.consumers[e].slice(-1)[0];s&&N(this,go,yl).call(this,n.args,s.args)||(this.onDeselected(e,...n.args),s&&this.onSelected(e,...s.args))}}go=new WeakSet,yl=function(e,i){return e.length===i.length&&e.every((n,o)=>n===i[o])},ts=new WeakSet,Er=function(e,i){for(let n=e.length-1;n>=0;n-=1)if(i(e[n])){e.splice(n,1);return}};class el{constructor(){Ae(this,is);this.randomIds=new WeakMap}fetchOrAdd(e){return e!=null&&e.segmentElement?e.marker?e.marker:(this.uniqueIds.has(e.segmentElement)||this.uniqueIds.set(e.segmentElement,N(this,is,Mr).call(this)),this.randomIds.get(e.segmentElement)):null}}is=new WeakSet,Mr=function(){return Math.random().toString(36).substring(2)};const ro=(t,e,i)=>{let[n,o]=i.split("-");n||(n="none"),o||(o=n);const s=t==="current"?n:o;return s==="all"||s==="body"&&(e==null?void 0:e.section)==="body"},Jo=["beyondwords-clickable","bwp"],en=class en{constructor(){this.ids=new el}update(e,i){const n=ro("hovered",e,i),o=this.previous,s=n?this.ids.fetchOrAdd(e):null;s&&Ni(en,fo).addInterest(s,this,e),o&&Ni(en,fo).removeInterest(o,this),this.previous=s}};fo=new WeakMap,ns=new WeakSet,jr=function(e,i){if(i.segmentElement.classList.add(...Jo),!i.marker)return;const n=document.querySelectorAll(`[data-beyondwords-marker="${i.marker}"]`);for(const o of n)o.classList.add(...Jo)},os=new WeakSet,zr=function(e,i){if(il(i.segmentElement,Jo),!i.marker)return;const n=document.querySelectorAll(`[data-beyondwords-marker="${i.marker}"]`);for(const o of n)il(o,Jo)},Ae(en,ns),Ae(en,os),Ae(en,fo,new $s(N(en,ns,jr),N(en,os,zr)));let tl=en;const il=(t,e)=>{if(!t)return;const o=[...t.classList].filter(s=>!e.includes(s)).some(s=>s.startsWith("beyondwords-"))?e.filter(s=>s!=="bwp"):e;t.classList.remove(...o)},tr=(t,e,i)=>["beyondwords-widget","bwp",`id-${t}`,`position-${e}`,`for-${i}-player`],ir=["beyondwords-relative","bwp"],tn=class tn{constructor(e){Ae(this,as);this.onUpdate=e,this.containers=[],this.ids=new el}update(e,i,n,o){const s=i.includes("all")||i.includes("body"),l=e||s&&this.previous,a=this.previous,r=this.ids.fetchOrAdd(l);r&&Ni(tn,mo).addInterest(r,this,this,l,n,o),a&&Ni(tn,mo).removeInterest(a,this),this.previous=r}reset(){this.update(null,"none")}};mo=new WeakMap,ss=new WeakSet,Lr=function(e,i,n,o,s){var c;const l=N(c=i,as,Rr).call(c,n);["2-oclock","3-oclock","4-oclock","8-oclock","9-oclock","10-oclock"].includes(o)&&l.classList.add(...ir);const r=document.createElement("div");r.classList.add(...tr(e,o,s)),["11-oclock","12-oclock","1-oclock"].includes(o)?l.insertBefore(r,l.firstChild):l.appendChild(r),i.containers.push(r),i.onUpdate(i.containers)},ls=new WeakSet,Dr=function(e,i,n,o,s){const l=tr(e,o,s);for(let a=0;a<i.containers.length;a+=1){if(!l.every(c=>i.containers[a].classList.contains(c)))continue;const u=i.containers[a].parentNode;il(u,ir),i.containers[a].remove(),i.containers.splice(a,1),a-=1}i.onUpdate(i.containers)},as=new WeakSet,Rr=function(e){var s;const i=e.marker,n=(s=e.segmentElement)==null?void 0:s.getAttribute("data-beyondwords-marker");let o;if(i||n){const l=i&&`[data-beyondwords-marker="${i}"]`,a=n&&`[data-beyondwords-marker="${n}"]`,r=[l,a].filter(u=>u).join(", ");o=document.querySelectorAll(r)}return o.length>0?o[0]:e.segmentElement},Ae(tn,ss),Ae(tn,ls),Ae(tn,mo,new $s(N(tn,ss,Lr),N(tn,ls,Dr)));let nl=tn;const nr=t=>["beyondwords-highlight","bwp",`id-${t}`],nn=class nn{constructor(){Ae(this,_o);this.ids=new el}update(e,i,n,o){const s=ro(e,i,n),l=this[`prev${e}`],a=s?this.ids.fetchOrAdd(i):null;a&&Ni(nn,ho).addInterest(a,this,this,i,o),l&&Ni(nn,ho).removeInterest(l,this),this[`prev${e}`]=a}};ho=new WeakMap,rs=new WeakSet,Nr=function(e,i,n,o){var s;for(const l of N(s=i,_o,vl).call(s,n)){const a=document.createTreeWalker(l,NodeFilter.SHOW_TEXT,null,!1);let r;for(;r=a.nextNode();){if(/^\s*$/.test(r.nodeValue))continue;r.parentNode.nodeName.toLowerCase()==="a"&&(r=r.parentNode);const g=document.createElement("mark");g.classList.add(...nr(e)),g.style.background=o,r.parentNode.insertBefore(g,r),g.appendChild(r)}}},us=new WeakSet,xr=function(e,i,n){var o;for(const s of N(o=i,_o,vl).call(o,n)){const l=s.querySelectorAll(`mark.${nr(e)}`);for(const a of l)for(const r of a.childNodes)a.parentNode.insertBefore(r,a),a.remove()}},_o=new WeakSet,vl=function(e){var s;const i=new Set([e.segmentElement]),n=e.marker,o=(s=e.segmentElement)==null?void 0:s.getAttribute("data-beyondwords-marker");for(const l of[n,o].filter(a=>a)){const a=document.querySelectorAll(`[data-beyondwords-marker="${l}"]`);for(const r of a)i.add(r)}return i},Ae(nn,rs),Ae(nn,us),Ae(nn,ho,new $s(N(nn,rs,Nr),N(nn,us,xr)));let ol=nn;const l_=()=>ye({type:"IdentifiersChanged",description:"The Player's content identifiers changed.",initiatedBy:"browser"}),sl=(i,...n)=>Bi(this,[i,...n],function*(t,e={}){const o=yield fetch(t,e).catch(()=>{}),s=yield o==null?void 0:o.json().catch(()=>{});return(o==null?void 0:o.status)!==200&&ri(`Failed to fetch ${t}`,rn(oi({},e),{responseStatus:o==null?void 0:o.status,responseJson:s})),s}),a_=(t,e)=>sl(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e,(i,n)=>n===void 0?null:n)});class r_{constructor(e,i,n){Ae(this,cs);this.baseUrl=N(this,cs,Ur).call(this,e),this.projectId=i,this.writeToken=n}getWebSocketToken(){return Bi(this,null,function*(){const e={Authorization:`Token token=${this.writeToken}`},{token:i}=yield sl(`https://${this.baseUrl}/api/v4/token/ws`,{headers:e});this.webSocketToken=i})}establishConnection(e,i){return Bi(this,null,function*(){const n=`wss://${this.baseUrl}/cable?token=${this.webSocketToken}`,o="actioncable-v1-json";this.webSocket=new WebSocket(n,o),this.webSocket.onmessage=s=>e(JSON.parse(s.data)),this.webSocket.onerror=i,yield new Promise(s=>this.webSocket.onopen=s)})}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)}}cs=new WeakSet,Ur=function(e){return e.includes("staging")?"app.staging-beyondwords.io":"app.beyondwords.io"};let Cn;const u_=(t,e,i,n)=>Bi(this,null,function*(){!t||!e||!i||(Cn==null||Cn.destroy(),Cn=new r_(t,e,i),yield Cn.getWebSocketToken(),yield Cn.establishConnection(c_(n),f_),yield Cn.subscribeToStatusChanges())}),c_=t=>e=>{var o,s;((s=(o=e==null?void 0:e.message)==null?void 0:o.result)==null?void 0:s.action)==="podcast_state_updated"&&d_(e,t),e.type==="reject_subscription"&&g_(e)},d_=(t,e)=>{const i=t.message.result;e(ye({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}))},g_=t=>{ri("The WebSocket status change subscription was rejected.",{webSocketEvent:t})},f_=t=>{ri("Unexpected WebSocket error.",{error:t})},or=t=>{if(!t())return new Promise(e=>{setInterval(()=>t()&&e(),10)})},Xo=t=>{const i=Object.keys(t.$$.props).filter(n=>!m_.has(n)).map(n=>[n,t[n]]);return Object.fromEntries(i)},m_=new Set(["addEventListener","removeEventListener","mediaElement","userInterface","widgetInterface","controller"]),sr=(t,e)=>{const i=new Set([...Object.keys(t),...Object.keys(e)]),n={};for(const o of i){const s=t[o],l=e[o];s!==l&&(n[o]={previousValue:s,currentValue:l})}return n};let uo=-1;const lr=[],h_=(t,e,i)=>Bi(this,null,function*(){yield or(()=>e.player);const n=e.player,o=__(n.contentIndex,i,t);o>uo&&y_(n,uo,o,t),o<uo&&v_(n,uo,o),uo=o}),__=(t,e,i)=>{const n=i.findIndex(s=>s[0]===t&&s[1]>e||s[0]>t);return n===-1?i.length-1:n-1},y_=(t,e,i,n)=>{for(let o=e+1;o<=i;o+=1){const s=Xo(t);n[o][2](t);const l=Xo(t),a=sr(s,l);lr.push(a)}},v_=(t,e,i)=>{for(let n=e;n>i;n-=1){const o=lr.pop();for(const[s,l]of Object.entries(o))t[s]=l.previousValue}},b_=t=>t?k_(t)?{newTarget:S_(t),showUserInterface:!0}:typeof t=="string"?{newTarget:ll(t),showUserInterface:!0}:{newTarget:t,showUserInterface:!0}:{newTarget:p_(),showUserInterface:!1},k_=t=>typeof t=="object"&&t.nodeName.toLowerCase()==="script",p_=()=>{const t=document.createElement("div");return document.body.appendChild(t),t},S_=t=>{const e=document.createElement("div");return t.parentNode.insertBefore(e,t.nextSibling),e},ll=(t,e="player")=>{if(typeof t!="string")return t;const i=document.querySelectorAll(t);return i.length===0&&ri(`Failed to initialize ${e} because the target could not be found.`,{target:t,elements:i}),i.length>1&&ri(`Failed to initialize ${e} because the target is ambiguous. (${i.length} elements match)`,{target:t,elements:i}),i[0]},w_=["small","standard","large","screen","video"],al=t=>w_.indexOf(t)!==-1;function ar(t,e,i){const n=t.slice();return n[162]=e[i],n}function T_(t){let e,i,n,o,s,l,a,r;function u(y){t[108](y)}function c(y){t[109](y)}function g(y){t[110](y)}function v(y){t[111](y)}function _(y){t[112](y)}function m(y){t[113](y)}let w={onEvent:t[60],content:t[51],contentIndex:t[7],introOrOutro:t[62],activeAdvert:t[63],advertConsent:t[41],showUserInterface:t[5],videoBehindWidget:t[66],videoBehindStatic:t[71],videoMightBeShown:t[65],widgetPosition:t[33],widgetWidth:t[34],widgetTarget:t[14]};return t[12]!==void 0&&(w.playbackState=t[12]),t[31]!==void 0&&(w.duration=t[31]),t[11]!==void 0&&(w.currentTime=t[11]),t[32]!==void 0&&(w.playbackRate=t[32]),t[48]!==void 0&&(w.prevPercentage=t[48]),t[23]!==void 0&&(w.metadataLoaded=t[23]),e=new Ag({props:w}),t[107](e),oe.push(()=>be(e,"playbackState",u)),oe.push(()=>be(e,"duration",c)),oe.push(()=>be(e,"currentTime",g)),oe.push(()=>be(e,"playbackRate",v)),oe.push(()=>be(e,"prevPercentage",_)),oe.push(()=>be(e,"metadataLoaded",m)),{c(){me(e.$$.fragment)},m(y,A){de(e,y,A),r=!0},p(y,A){const S={};A[1]&1048576&&(S.content=y[51]),A[0]&128&&(S.contentIndex=y[7]),A[2]&1&&(S.introOrOutro=y[62]),A[2]&2&&(S.activeAdvert=y[63]),A[1]&1024&&(S.advertConsent=y[41]),A[0]&32&&(S.showUserInterface=y[5]),A[2]&16&&(S.videoBehindWidget=y[66]),A[2]&512&&(S.videoBehindStatic=y[71]),A[2]&8&&(S.videoMightBeShown=y[65]),A[1]&4&&(S.widgetPosition=y[33]),A[1]&8&&(S.widgetWidth=y[34]),A[0]&16384&&(S.widgetTarget=y[14]),!i&&A[0]&4096&&(i=!0,S.playbackState=y[12],ve(()=>i=!1)),!n&&A[1]&1&&(n=!0,S.duration=y[31],ve(()=>n=!1)),!o&&A[0]&2048&&(o=!0,S.currentTime=y[11],ve(()=>o=!1)),!s&&A[1]&2&&(s=!0,S.playbackRate=y[32],ve(()=>s=!1)),!l&&A[1]&131072&&(l=!0,S.prevPercentage=y[48],ve(()=>l=!1)),!a&&A[0]&8388608&&(a=!0,S.metadataLoaded=y[23],ve(()=>a=!1)),e.$set(S)},i(y){r||(B(e.$$.fragment,y),r=!0)},o(y){z(e.$$.fragment,y),r=!1},d(y){t[107](null),ge(e,y)}}}function rr(t){let e,i,n={onEvent:t[60],playerStyle:t[67],callToAction:t[25],skipButtonStyle:t[26],playlistStyle:t[27],playlistToggle:t[28],downloadFormats:t[50],playerTitle:t[24],content:t[51],contentIndex:t[7],duration:t[31],currentTime:t[11],playbackState:t[12],playbackRate:t[32],playbackRates:t[54],activeAdvert:t[63],persistentAdvert:t[74],companionAdvert:t[59],textColor:t[35],backgroundColor:t[36],iconColor:t[37],videoTextColor:t[38],videoBackgroundColor:t[55],videoIconColor:t[39],logoIconEnabled:t[40],logoImagePosition:t[58],isFullScreen:t[57],videoPosterImage:t[69],videoIsBehind:t[71]};return e=new Xs({props:n}),t[114](e),{c(){me(e.$$.fragment)},m(o,s){de(e,o,s),i=!0},p(o,s){const l={};s[2]&32&&(l.playerStyle=o[67]),s[0]&33554432&&(l.callToAction=o[25]),s[0]&67108864&&(l.skipButtonStyle=o[26]),s[0]&134217728&&(l.playlistStyle=o[27]),s[0]&268435456&&(l.playlistToggle=o[28]),s[1]&524288&&(l.downloadFormats=o[50]),s[0]&16777216&&(l.playerTitle=o[24]),s[1]&1048576&&(l.content=o[51]),s[0]&128&&(l.contentIndex=o[7]),s[1]&1&&(l.duration=o[31]),s[0]&2048&&(l.currentTime=o[11]),s[0]&4096&&(l.playbackState=o[12]),s[1]&2&&(l.playbackRate=o[32]),s[1]&8388608&&(l.playbackRates=o[54]),s[2]&2&&(l.activeAdvert=o[63]),s[2]&4096&&(l.persistentAdvert=o[74]),s[1]&268435456&&(l.companionAdvert=o[59]),s[1]&16&&(l.textColor=o[35]),s[1]&32&&(l.backgroundColor=o[36]),s[1]&64&&(l.iconColor=o[37]),s[1]&128&&(l.videoTextColor=o[38]),s[1]&16777216&&(l.videoBackgroundColor=o[55]),s[1]&256&&(l.videoIconColor=o[39]),s[1]&512&&(l.logoIconEnabled=o[40]),s[1]&134217728&&(l.logoImagePosition=o[58]),s[1]&67108864&&(l.isFullScreen=o[57]),s[2]&128&&(l.videoPosterImage=o[69]),s[2]&512&&(l.videoIsBehind=o[71]),e.$set(l)},i(o){i||(B(e.$$.fragment,o),i=!0)},o(o){z(e.$$.fragment,o),i=!1},d(o){t[114](null),ge(e,o)}}}function ur(t){let e,i;return e=new Ko({props:{root:t[14],$$slots:{default:[P_]},$$scope:{ctx:t}}}),{c(){me(e.$$.fragment)},m(n,o){de(e,n,o),i=!0},p(n,o){const s={};o[0]&16384&&(s.root=n[14]),o[0]&117471360|o[1]&429458431|o[2]&4242|o[5]&1024&&(s.$$scope={dirty:o,ctx:n}),e.$set(s)},i(n){i||(B(e.$$.fragment,n),i=!0)},o(n){z(e.$$.fragment,n),i=!1},d(n){ge(e,n)}}}function P_(t){let e,i,n={onEvent:t[60],playerStyle:t[13],callToAction:t[25],skipButtonStyle:t[26],playlistStyle:"hide",playlistToggle:"hide",downloadFormats:t[50],playerTitle:t[24],fixedPosition:!t[14]&&t[33],fixedWidth:t[34],content:t[51],contentIndex:t[7],duration:t[31],currentTime:t[11],playbackState:t[12],playbackRate:t[32],playbackRates:t[54],activeAdvert:t[63],persistentAdvert:t[74],companionAdvert:t[59],textColor:t[35],backgroundColor:t[36],iconColor:t[37],videoTextColor:t[38],videoBackgroundColor:t[55],videoIconColor:t[39],logoIconEnabled:t[40],logoImagePosition:t[58],videoPosterImage:t[69],videoIsBehind:t[66]};return e=new Xs({props:n}),t[115](e),{c(){me(e.$$.fragment)},m(o,s){de(e,o,s),i=!0},p(o,s){const l={};s[0]&8192&&(l.playerStyle=o[13]),s[0]&33554432&&(l.callToAction=o[25]),s[0]&67108864&&(l.skipButtonStyle=o[26]),s[1]&524288&&(l.downloadFormats=o[50]),s[0]&16777216&&(l.playerTitle=o[24]),s[0]&16384|s[1]&4&&(l.fixedPosition=!o[14]&&o[33]),s[1]&8&&(l.fixedWidth=o[34]),s[1]&1048576&&(l.content=o[51]),s[0]&128&&(l.contentIndex=o[7]),s[1]&1&&(l.duration=o[31]),s[0]&2048&&(l.currentTime=o[11]),s[0]&4096&&(l.playbackState=o[12]),s[1]&2&&(l.playbackRate=o[32]),s[1]&8388608&&(l.playbackRates=o[54]),s[2]&2&&(l.activeAdvert=o[63]),s[2]&4096&&(l.persistentAdvert=o[74]),s[1]&268435456&&(l.companionAdvert=o[59]),s[1]&16&&(l.textColor=o[35]),s[1]&32&&(l.backgroundColor=o[36]),s[1]&64&&(l.iconColor=o[37]),s[1]&128&&(l.videoTextColor=o[38]),s[1]&16777216&&(l.videoBackgroundColor=o[55]),s[1]&256&&(l.videoIconColor=o[39]),s[1]&512&&(l.logoIconEnabled=o[40]),s[1]&134217728&&(l.logoImagePosition=o[58]),s[2]&128&&(l.videoPosterImage=o[69]),s[2]&16&&(l.videoIsBehind=o[66]),e.$set(l)},i(o){i||(B(e.$$.fragment,o),i=!0)},o(o){z(e.$$.fragment,o),i=!1},d(o){t[115](null),ge(e,o)}}}function C_(t){let e,i;return e=new Xs({props:{onEvent:t[116],playerStyle:"small",fixedWidth:0,logoIconEnabled:!1,content:t[51],contentIndex:t[7],duration:t[31],currentTime:t[68]?t[11]:t[61].startTime,playbackState:t[68]?t[12]:"paused",activeAdvert:t[63],persistentAdvert:t[74],companionAdvert:t[59],textColor:t[35],backgroundColor:t[36],iconColor:t[37],videoTextColor:t[38],videoBackgroundColor:t[55],videoIconColor:t[39]}}),{c(){me(e.$$.fragment)},m(n,o){de(e,n,o),i=!0},p(n,o){const s={};o[1]&1073741824|o[2]&4&&(s.onEvent=n[116]),o[1]&1048576&&(s.content=n[51]),o[0]&128&&(s.contentIndex=n[7]),o[1]&1&&(s.duration=n[31]),o[0]&2048|o[1]&1073741824|o[2]&64&&(s.currentTime=n[68]?n[11]:n[61].startTime),o[0]&4096|o[2]&64&&(s.playbackState=n[68]?n[12]:"paused"),o[2]&2&&(s.activeAdvert=n[63]),o[2]&4096&&(s.persistentAdvert=n[74]),o[1]&268435456&&(s.companionAdvert=n[59]),o[1]&16&&(s.textColor=n[35]),o[1]&32&&(s.backgroundColor=n[36]),o[1]&64&&(s.iconColor=n[37]),o[1]&128&&(s.videoTextColor=n[38]),o[1]&16777216&&(s.videoBackgroundColor=n[55]),o[1]&256&&(s.videoIconColor=n[39]),e.$set(s)},i(n){i||(B(e.$$.fragment,n),i=!0)},o(n){z(e.$$.fragment,n),i=!1},d(n){ge(e,n)}}}function cr(t,e){let i,n,o;return n=new Ko({props:{root:e[162],$$slots:{default:[C_]},$$scope:{ctx:e}}}),{key:t,first:null,c(){i=xi(),me(n.$$.fragment),this.first=i},m(s,l){E(s,i,l),de(n,s,l),o=!0},p(s,l){e=s;const a={};l[1]&262144&&(a.root=e[162]),l[0]&6272|l[1]&1360003569|l[2]&4166|l[5]&1024&&(a.$$scope={dirty:l,ctx:e}),n.$set(a)},i(s){o||(B(n.$$.fragment,s),o=!0)},o(s){z(n.$$.fragment,s),o=!1},d(s){s&&O(i),ge(n,s)}}}function dr(t){let e,i;return e=new Ko({props:{root:t[22],$$slots:{default:[A_]},$$scope:{ctx:t}}}),{c(){me(e.$$.fragment)},m(n,o){de(e,n,o),i=!0},p(n,o){const s={};o[0]&4194304&&(s.root=n[22]),o[0]&2134900735|o[1]&7356415|o[5]&1024&&(s.$$scope={dirty:o,ctx:n}),e.$set(s)},i(n){i||(B(e.$$.fragment,n),i=!0)},o(n){z(e.$$.fragment,n),i=!1},d(n){ge(e,n)}}}function A_(t){let e,i,n,o,s,l,a,r,u,c,g,v,_,m,w,y,A,S,C,T,I,M,R,G,F,q,ae,ce,se,ee,$,re,fe,Z,J,ie,b,P,j,L,Ce,We,He,K,Te;function Ye(k){t[117](k)}function it(k){t[118](k)}function at(k){t[119](k)}function wt(k){t[120](k)}function dt(k){t[121](k)}function Ge(k){t[122](k)}function xe(k){t[123](k)}function Ue(k){t[124](k)}function mt(k){t[125](k)}function Ne(k){t[126](k)}function rt(k){t[127](k)}function nt(k){t[128](k)}function Fe(k){t[129](k)}function Lt(k){t[130](k)}function $e(k){t[131](k)}function Ve(k){t[132](k)}function Oe(k){t[133](k)}function et(k){t[134](k)}function ot(k){t[135](k)}function ut(k){t[136](k)}function qe(k){t[137](k)}function It(k){t[138](k)}function ht(k){t[139](k)}function _t(k){t[140](k)}function Ze(k){t[141](k)}function Ke(k){t[142](k)}function st(k){t[143](k)}function Y(k){t[144](k)}function ze(k){t[145](k)}function Le(k){t[146](k)}function yt(k){t[147](k)}function Tt(k){t[148](k)}function Je(k){t[149](k)}function Xe(k){t[150](k)}function Wt(k){t[151](k)}function ct(k){t[152](k)}function Pt(k){t[153](k)}function gt(k){t[154](k)}function Dt(k){t[155](k)}function Rt(k){t[156](k)}function Nt(k){t[157](k)}function Bt(k){t[158](k)}function vt(k){t[159](k)}let _e={content:t[51],introsOutros:t[52],adverts:t[53]};return t[0]!==void 0&&(_e.projectId=t[0]),t[1]!==void 0&&(_e.contentId=t[1]),t[2]!==void 0&&(_e.playlistId=t[2]),t[3]!==void 0&&(_e.sourceId=t[3]),t[4]!==void 0&&(_e.sourceUrl=t[4]),t[5]!==void 0&&(_e.showUserInterface=t[5]),t[6]!==void 0&&(_e.playerStyle=t[6]),t[24]!==void 0&&(_e.playerTitle=t[24]),t[25]!==void 0&&(_e.callToAction=t[25]),t[26]!==void 0&&(_e.skipButtonStyle=t[26]),t[27]!==void 0&&(_e.playlistStyle=t[27]),t[28]!==void 0&&(_e.playlistToggle=t[28]),t[29]!==void 0&&(_e.mediaSession=t[29]),t[7]!==void 0&&(_e.contentIndex=t[7]),t[8]!==void 0&&(_e.introsOutrosIndex=t[8]),t[9]!==void 0&&(_e.advertIndex=t[9]),t[30]!==void 0&&(_e.persistentAdImage=t[30]),t[10]!==void 0&&(_e.persistentIndex=t[10]),t[31]!==void 0&&(_e.duration=t[31]),t[11]!==void 0&&(_e.currentTime=t[11]),t[12]!==void 0&&(_e.playbackState=t[12]),t[32]!==void 0&&(_e.playbackRate=t[32]),t[13]!==void 0&&(_e.widgetStyle=t[13]),t[33]!==void 0&&(_e.widgetPosition=t[33]),t[34]!==void 0&&(_e.widgetWidth=t[34]),t[14]!==void 0&&(_e.widgetTarget=t[14]),t[35]!==void 0&&(_e.textColor=t[35]),t[36]!==void 0&&(_e.backgroundColor=t[36]),t[37]!==void 0&&(_e.iconColor=t[37]),t[15]!==void 0&&(_e.highlightColor=t[15]),t[38]!==void 0&&(_e.videoTextColor=t[38]),t[39]!==void 0&&(_e.videoIconColor=t[39]),t[40]!==void 0&&(_e.logoIconEnabled=t[40]),t[16]!==void 0&&(_e.highlightSections=t[16]),t[17]!==void 0&&(_e.clickableSections=t[17]),t[18]!==void 0&&(_e.segmentWidgetSections=t[18]),t[19]!==void 0&&(_e.segmentWidgetPosition=t[19]),t[20]!==void 0&&(_e.currentSegment=t[20]),t[21]!==void 0&&(_e.hoveredSegment=t[21]),t[41]!==void 0&&(_e.advertConsent=t[41]),t[42]!==void 0&&(_e.analyticsConsent=t[42]),t[43]!==void 0&&(_e.analyticsCustomUrl=t[43]),t[44]!==void 0&&(_e.analyticsTag=t[44]),e=new x0({props:_e}),oe.push(()=>be(e,"projectId",Ye)),oe.push(()=>be(e,"contentId",it)),oe.push(()=>be(e,"playlistId",at)),oe.push(()=>be(e,"sourceId",wt)),oe.push(()=>be(e,"sourceUrl",dt)),oe.push(()=>be(e,"showUserInterface",Ge)),oe.push(()=>be(e,"playerStyle",xe)),oe.push(()=>be(e,"playerTitle",Ue)),oe.push(()=>be(e,"callToAction",mt)),oe.push(()=>be(e,"skipButtonStyle",Ne)),oe.push(()=>be(e,"playlistStyle",rt)),oe.push(()=>be(e,"playlistToggle",nt)),oe.push(()=>be(e,"mediaSession",Fe)),oe.push(()=>be(e,"contentIndex",Lt)),oe.push(()=>be(e,"introsOutrosIndex",$e)),oe.push(()=>be(e,"advertIndex",Ve)),oe.push(()=>be(e,"persistentAdImage",Oe)),oe.push(()=>be(e,"persistentIndex",et)),oe.push(()=>be(e,"duration",ot)),oe.push(()=>be(e,"currentTime",ut)),oe.push(()=>be(e,"playbackState",qe)),oe.push(()=>be(e,"playbackRate",It)),oe.push(()=>be(e,"widgetStyle",ht)),oe.push(()=>be(e,"widgetPosition",_t)),oe.push(()=>be(e,"widgetWidth",Ze)),oe.push(()=>be(e,"widgetTarget",Ke)),oe.push(()=>be(e,"textColor",st)),oe.push(()=>be(e,"backgroundColor",Y)),oe.push(()=>be(e,"iconColor",ze)),oe.push(()=>be(e,"highlightColor",Le)),oe.push(()=>be(e,"videoTextColor",yt)),oe.push(()=>be(e,"videoIconColor",Tt)),oe.push(()=>be(e,"logoIconEnabled",Je)),oe.push(()=>be(e,"highlightSections",Xe)),oe.push(()=>be(e,"clickableSections",Wt)),oe.push(()=>be(e,"segmentWidgetSections",ct)),oe.push(()=>be(e,"segmentWidgetPosition",Pt)),oe.push(()=>be(e,"currentSegment",gt)),oe.push(()=>be(e,"hoveredSegment",Dt)),oe.push(()=>be(e,"advertConsent",Rt)),oe.push(()=>be(e,"analyticsConsent",Nt)),oe.push(()=>be(e,"analyticsCustomUrl",Bt)),oe.push(()=>be(e,"analyticsTag",vt)),{c(){me(e.$$.fragment)},m(k,V){de(e,k,V),Te=!0},p(k,V){const ue={};V[1]&1048576&&(ue.content=k[51]),V[1]&2097152&&(ue.introsOutros=k[52]),V[1]&4194304&&(ue.adverts=k[53]),!i&&V[0]&1&&(i=!0,ue.projectId=k[0],ve(()=>i=!1)),!n&&V[0]&2&&(n=!0,ue.contentId=k[1],ve(()=>n=!1)),!o&&V[0]&4&&(o=!0,ue.playlistId=k[2],ve(()=>o=!1)),!s&&V[0]&8&&(s=!0,ue.sourceId=k[3],ve(()=>s=!1)),!l&&V[0]&16&&(l=!0,ue.sourceUrl=k[4],ve(()=>l=!1)),!a&&V[0]&32&&(a=!0,ue.showUserInterface=k[5],ve(()=>a=!1)),!r&&V[0]&64&&(r=!0,ue.playerStyle=k[6],ve(()=>r=!1)),!u&&V[0]&16777216&&(u=!0,ue.playerTitle=k[24],ve(()=>u=!1)),!c&&V[0]&33554432&&(c=!0,ue.callToAction=k[25],ve(()=>c=!1)),!g&&V[0]&67108864&&(g=!0,ue.skipButtonStyle=k[26],ve(()=>g=!1)),!v&&V[0]&134217728&&(v=!0,ue.playlistStyle=k[27],ve(()=>v=!1)),!_&&V[0]&268435456&&(_=!0,ue.playlistToggle=k[28],ve(()=>_=!1)),!m&&V[0]&536870912&&(m=!0,ue.mediaSession=k[29],ve(()=>m=!1)),!w&&V[0]&128&&(w=!0,ue.contentIndex=k[7],ve(()=>w=!1)),!y&&V[0]&256&&(y=!0,ue.introsOutrosIndex=k[8],ve(()=>y=!1)),!A&&V[0]&512&&(A=!0,ue.advertIndex=k[9],ve(()=>A=!1)),!S&&V[0]&1073741824&&(S=!0,ue.persistentAdImage=k[30],ve(()=>S=!1)),!C&&V[0]&1024&&(C=!0,ue.persistentIndex=k[10],ve(()=>C=!1)),!T&&V[1]&1&&(T=!0,ue.duration=k[31],ve(()=>T=!1)),!I&&V[0]&2048&&(I=!0,ue.currentTime=k[11],ve(()=>I=!1)),!M&&V[0]&4096&&(M=!0,ue.playbackState=k[12],ve(()=>M=!1)),!R&&V[1]&2&&(R=!0,ue.playbackRate=k[32],ve(()=>R=!1)),!G&&V[0]&8192&&(G=!0,ue.widgetStyle=k[13],ve(()=>G=!1)),!F&&V[1]&4&&(F=!0,ue.widgetPosition=k[33],ve(()=>F=!1)),!q&&V[1]&8&&(q=!0,ue.widgetWidth=k[34],ve(()=>q=!1)),!ae&&V[0]&16384&&(ae=!0,ue.widgetTarget=k[14],ve(()=>ae=!1)),!ce&&V[1]&16&&(ce=!0,ue.textColor=k[35],ve(()=>ce=!1)),!se&&V[1]&32&&(se=!0,ue.backgroundColor=k[36],ve(()=>se=!1)),!ee&&V[1]&64&&(ee=!0,ue.iconColor=k[37],ve(()=>ee=!1)),!$&&V[0]&32768&&($=!0,ue.highlightColor=k[15],ve(()=>$=!1)),!re&&V[1]&128&&(re=!0,ue.videoTextColor=k[38],ve(()=>re=!1)),!fe&&V[1]&256&&(fe=!0,ue.videoIconColor=k[39],ve(()=>fe=!1)),!Z&&V[1]&512&&(Z=!0,ue.logoIconEnabled=k[40],ve(()=>Z=!1)),!J&&V[0]&65536&&(J=!0,ue.highlightSections=k[16],ve(()=>J=!1)),!ie&&V[0]&131072&&(ie=!0,ue.clickableSections=k[17],ve(()=>ie=!1)),!b&&V[0]&262144&&(b=!0,ue.segmentWidgetSections=k[18],ve(()=>b=!1)),!P&&V[0]&524288&&(P=!0,ue.segmentWidgetPosition=k[19],ve(()=>P=!1)),!j&&V[0]&1048576&&(j=!0,ue.currentSegment=k[20],ve(()=>j=!1)),!L&&V[0]&2097152&&(L=!0,ue.hoveredSegment=k[21],ve(()=>L=!1)),!Ce&&V[1]&1024&&(Ce=!0,ue.advertConsent=k[41],ve(()=>Ce=!1)),!We&&V[1]&2048&&(We=!0,ue.analyticsConsent=k[42],ve(()=>We=!1)),!He&&V[1]&4096&&(He=!0,ue.analyticsCustomUrl=k[43],ve(()=>He=!1)),!K&&V[1]&8192&&(K=!0,ue.analyticsTag=k[44],ve(()=>K=!1)),e.$set(ue)},i(k){Te||(B(e.$$.fragment,k),Te=!0)},o(k){z(e.$$.fragment,k),Te=!1},d(k){ge(e,k)}}}function gr(t){let e,i;return e=new $0({props:{onEvent:t[60],content:t[51],contentIndex:t[7],activeAdvert:t[63],persistentAdvert:t[74],companionAdvert:t[59],duration:t[31],playbackState:t[12],skipButtonStyle:t[26],backgroundColor:t[36],iconColor:t[37]}}),{c(){me(e.$$.fragment)},m(n,o){de(e,n,o),i=!0},p(n,o){const s={};o[1]&1048576&&(s.content=n[51]),o[0]&128&&(s.contentIndex=n[7]),o[2]&2&&(s.activeAdvert=n[63]),o[2]&4096&&(s.persistentAdvert=n[74]),o[1]&268435456&&(s.companionAdvert=n[59]),o[1]&1&&(s.duration=n[31]),o[0]&4096&&(s.playbackState=n[12]),o[0]&67108864&&(s.skipButtonStyle=n[26]),o[1]&32&&(s.backgroundColor=n[36]),o[1]&64&&(s.iconColor=n[37]),e.$set(s)},i(n){i||(B(e.$$.fragment,n),i=!0)},o(n){z(e.$$.fragment,n),i=!1},d(n){ge(e,n)}}}function fr(t){let e,i;return e=new o_({props:{analyticsTag:t[44]}}),{c(){me(e.$$.fragment)},m(n,o){de(e,n,o),i=!0},p(n,o){const s={};o[1]&8192&&(s.analyticsTag=n[44]),e.$set(s)},i(n){i||(B(e.$$.fragment,n),i=!0)},o(n){z(e.$$.fragment,n),i=!1},d(n){ge(e,n)}}}function I_(t){let e,i,n,o,s=[],l=new Map,a,r,u,c,g,v;e=new Ko({props:{prepend:!0,root:t[70],$$slots:{default:[T_]},$$scope:{ctx:t}}});let _=t[73]&&rr(t),m=t[72]&&ur(t),w=Gt(t[49]);const y=T=>T[162];for(let T=0;T<w.length;T+=1){let I=ar(t,w,T),M=y(I);l.set(M,s[T]=cr(M,I))}let A=t[22]&&dr(t),S=t[56]&&gr(t),C=t[44]&&fr(t);return g=new s_({}),{c(){me(e.$$.fragment),i=X(),_&&_.c(),n=X(),m&&m.c(),o=X();for(let T=0;T<s.length;T+=1)s[T].c();a=X(),A&&A.c(),r=X(),S&&S.c(),u=X(),C&&C.c(),c=X(),me(g.$$.fragment)},m(T,I){de(e,T,I),E(T,i,I),_&&_.m(T,I),E(T,n,I),m&&m.m(T,I),E(T,o,I);for(let M=0;M<s.length;M+=1)s[M]&&s[M].m(T,I);E(T,a,I),A&&A.m(T,I),E(T,r,I),S&&S.m(T,I),E(T,u,I),C&&C.m(T,I),E(T,c,I),de(g,T,I),v=!0},p(T,I){const M={};I[2]&256&&(M.root=T[70]),I[0]&8411296|I[1]&1197071|I[2]&539|I[5]&1024&&(M.$$scope={dirty:I,ctx:T}),e.$set(M),T[73]?_?(_.p(T,I),I[2]&2048&&B(_,1)):(_=rr(T),_.c(),B(_,1),_.m(n.parentNode,n)):_&&(De(),z(_,1,1,()=>{_=null}),Re()),T[72]?m?(m.p(T,I),I[2]&1024&&B(m,1)):(m=ur(T),m.c(),B(m,1),m.m(o.parentNode,o)):m&&(De(),z(m,1,1,()=>{m=null}),Re()),I[0]&6272|I[1]&1897136625|I[2]&4166&&(w=Gt(T[49]),De(),s=pu(s,I,y,1,T,w,l,a.parentNode,ku,cr,a,ar),Re()),T[22]?A?(A.p(T,I),I[0]&4194304&&B(A,1)):(A=dr(T),A.c(),B(A,1),A.m(r.parentNode,r)):A&&(De(),z(A,1,1,()=>{A=null}),Re()),T[56]?S?(S.p(T,I),I[1]&33554432&&B(S,1)):(S=gr(T),S.c(),B(S,1),S.m(u.parentNode,u)):S&&(De(),z(S,1,1,()=>{S=null}),Re()),T[44]?C?(C.p(T,I),I[1]&8192&&B(C,1)):(C=fr(T),C.c(),B(C,1),C.m(c.parentNode,c)):C&&(De(),z(C,1,1,()=>{C=null}),Re())},i(T){if(!v){B(e.$$.fragment,T),B(_),B(m);for(let I=0;I<w.length;I+=1)B(s[I]);B(A),B(S),B(C),B(g.$$.fragment,T),v=!0}},o(T){z(e.$$.fragment,T),z(_),z(m);for(let I=0;I<s.length;I+=1)z(s[I]);z(A),z(S),z(C),z(g.$$.fragment,T),v=!1},d(T){T&&(O(i),O(n),O(o),O(a),O(r),O(u),O(c)),ge(e,T),_&&_.d(T),m&&m.d(T);for(let I=0;I<s.length;I+=1)s[I].d(T);A&&A.d(T),S&&S.d(T),C&&C.d(T),ge(g,T)}}}function B_(t,e,i){let n,o,s,l,a,r,u,c,g,v,_,m,w,y,A,S,C,T,I,M,R,G,F,{playerApiUrl:q="https://api.beyondwords.io/v1/projects/{id}/player"}=e,{projectId:ae=void 0}=e,{contentId:ce=void 0}=e,{playlistId:se=void 0}=e,{sourceId:ee=void 0}=e,{sourceUrl:$=void 0}=e,{playlist:re=[]}=e,{showUserInterface:fe=!0}=e,{showBottomWidget:Z=!1}=e,{playerStyle:J="standard"}=e,{playerTitle:ie=void 0}=e,{callToAction:b=void 0}=e,{skipButtonStyle:P="auto"}=e,{playlistStyle:j="auto-5-4"}=e,{playlistToggle:L="auto"}=e,{downloadFormats:Ce=[]}=e,{mediaSession:We="auto"}=e,{content:He=[]}=e,{contentIndex:K=0}=e,{introsOutros:Te=[]}=e,{introsOutrosIndex:Ye=-1}=e,{adverts:it=[]}=e,{advertIndex:at=-1}=e,{minDurationForMidroll:wt=2*60}=e,{minTimeUntilEndForMidroll:dt=10}=e,{persistentAdImage:Ge=!1}=e,{persistentIndex:xe=-1}=e,{duration:Ue=0}=e,{currentTime:mt=0}=e,{playbackState:Ne="stopped"}=e,{playbackRate:rt=1}=e,{playbackRates:nt=[.5,.6,.7,.8,.9,1,1.1,1.2,1.3,1.4,1.5,2,2.5,3]}=e,{widgetStyle:Fe="standard"}=e,{widgetPosition:Lt="auto"}=e,{widgetWidth:$e="auto"}=e,{widgetTarget:Ve=void 0}=e,{textColor:Oe="#111"}=e,{backgroundColor:et="#f5f5f5"}=e,{iconColor:ot="rgba(0, 0, 0, 0.8)"}=e,{highlightColor:ut="#eee"}=e,{videoTextColor:qe="white"}=e,{videoBackgroundColor:It="black"}=e,{videoIconColor:ht="white"}=e,{logoIconEnabled:_t=!0}=e,{highlightSections:Ze="all"}=e,{clickableSections:Ke="all"}=e,{segmentWidgetSections:st="body"}=e,{segmentWidgetPosition:Y="7-oclock"}=e,{currentSegment:ze=void 0}=e,{hoveredSegment:Le=void 0}=e,{loadedMedia:yt=void 0}=e,{advertConsent:Tt="personalized"}=e,{analyticsConsent:Je="allowed"}=e,{analyticsCustomUrl:Xe=void 0}=e,{analyticsDeviceType:Wt="auto"}=e,{analyticsTag:ct=void 0}=e,{writeToken:Pt=void 0}=e,{captureErrors:gt=!0}=e,{onError:Dt=()=>{}}=e,{transitions:Rt=[]}=e,{controlPanel:Nt=void 0}=e,{clientSideIntegration:Bt={}}=e;const vt=(...h)=>Ai.addEventListener(...h),_e=(...h)=>Ai.removeEventListener(...h);let{initialProps:k={}}=e,{showMediaSession:V=!1}=e,{metadataLoaded:ue=!1}=e,{isFullScreen:xt=!1}=e,{mediaElement:ei=void 0}=e,{userInterface:pi=void 0}=e,{widgetInterface:Ot=void 0}=e,{controller:Ai=void 0}=e,{logoImagePosition:ui=void 0}=e,{analyticsUrl:_n=void 0}=e,{analyticsId:bt=void 0}=e,{listenSessionId:Mi=void 0}=e,{sessionCreatedAt:ci=void 0}=e,{companionAdvert:ji=void 0}=e,{isNewListen:Mt=!1}=e,{prevPercentage:qt=0}=e,{segmentWidgets:Ii=[]}=e,{segmentContainers:jt=new nl(h=>i(49,Ii=h))}=e,{segmentClickables:Si=new tl}=e,{segmentHighlights:Ht=new ol}=e;const Xi=h=>Ai.processEvent(oi({emittedFrom:w},h)),ti=()=>i(100,T=Le);function yn(h){oe[h?"unshift":"push"](()=>{ei=h,i(45,ei)})}function Yt(h){Ne=h,i(12,Ne)}function di(h){Ue=h,i(31,Ue)}function kt(h){mt=h,i(11,mt)}function gi(h){rt=h,i(32,rt)}function pt(h){qt=h,i(48,qt)}function fi(h){ue=h,i(23,ue)}function zt(h){oe[h?"unshift":"push"](()=>{pi=h,i(46,pi)})}function D(h){oe[h?"unshift":"push"](()=>{Ot=h,i(47,Ot)})}const Q=h=>Xi(rn(oi({},h),{emittedFrom:"segment-widget",widgetSegment:R,widgetIsCurrent:G}));function le(h){ae=h,i(0,ae)}function ii(h){ce=h,i(1,ce)}function vn(h){se=h,i(2,se)}function bn(h){ee=h,i(3,ee)}function kn(h){$=h,i(4,$)}function pn(h){fe=h,i(5,fe)}function Ts(h){J=h,i(6,J)}function Bn(h){ie=h,i(24,ie)}function Ps(h){b=h,i(25,b)}function Ri(h){P=h,i(26,P)}function Cs(h){j=h,i(27,j)}function po(h){L=h,i(28,L)}function As(h){We=h,i(29,We)}function Is(h){K=h,i(7,K)}function So(h){Ye=h,i(8,Ye)}function Bs(h){at=h,i(9,at)}function Sn(h){Ge=h,i(30,Ge)}function ni(h){xe=h,i(10,xe)}function gl(h){Ue=h,i(31,Ue)}function Vn(h){mt=h,i(11,mt)}function li(h){Ne=h,i(12,Ne)}function Vs(h){rt=h,i(32,rt)}function Jn(h){Fe=h,i(13,Fe)}function zi(h){Lt=h,i(33,Lt)}function he(h){$e=h,i(34,$e)}function lt(h){Ve=h,i(14,Ve)}function St(h){Oe=h,i(35,Oe)}function Ws(h){et=h,i(36,et)}function Dy(h){ot=h,i(37,ot)}function Ry(h){ut=h,i(15,ut)}function Ny(h){qe=h,i(38,qe)}function xy(h){ht=h,i(39,ht)}function Uy(h){_t=h,i(40,_t)}function Fy(h){Ze=h,i(16,Ze)}function qy(h){Ke=h,i(17,Ke)}function Hy(h){st=h,i(18,st)}function Yy(h){Y=h,i(19,Y)}function Zy(h){ze=h,i(20,ze)}function Gy(h){Le=h,i(21,Le)}function Ky(h){Tt=h,i(41,Tt)}function Jy(h){Je=h,i(42,Je)}function Xy(h){Xe=h,i(43,Xe)}function Qy(h){ct=h,i(44,ct)}return t.$$set=h=>{"playerApiUrl"in h&&i(75,q=h.playerApiUrl),"projectId"in h&&i(0,ae=h.projectId),"contentId"in h&&i(1,ce=h.contentId),"playlistId"in h&&i(2,se=h.playlistId),"sourceId"in h&&i(3,ee=h.sourceId),"sourceUrl"in h&&i(4,$=h.sourceUrl),"playlist"in h&&i(76,re=h.playlist),"showUserInterface"in h&&i(5,fe=h.showUserInterface),"showBottomWidget"in h&&i(77,Z=h.showBottomWidget),"playerStyle"in h&&i(6,J=h.playerStyle),"playerTitle"in h&&i(24,ie=h.playerTitle),"callToAction"in h&&i(25,b=h.callToAction),"skipButtonStyle"in h&&i(26,P=h.skipButtonStyle),"playlistStyle"in h&&i(27,j=h.playlistStyle),"playlistToggle"in h&&i(28,L=h.playlistToggle),"downloadFormats"in h&&i(50,Ce=h.downloadFormats),"mediaSession"in h&&i(29,We=h.mediaSession),"content"in h&&i(51,He=h.content),"contentIndex"in h&&i(7,K=h.contentIndex),"introsOutros"in h&&i(52,Te=h.introsOutros),"introsOutrosIndex"in h&&i(8,Ye=h.introsOutrosIndex),"adverts"in h&&i(53,it=h.adverts),"advertIndex"in h&&i(9,at=h.advertIndex),"minDurationForMidroll"in h&&i(78,wt=h.minDurationForMidroll),"minTimeUntilEndForMidroll"in h&&i(79,dt=h.minTimeUntilEndForMidroll),"persistentAdImage"in h&&i(30,Ge=h.persistentAdImage),"persistentIndex"in h&&i(10,xe=h.persistentIndex),"duration"in h&&i(31,Ue=h.duration),"currentTime"in h&&i(11,mt=h.currentTime),"playbackState"in h&&i(12,Ne=h.playbackState),"playbackRate"in h&&i(32,rt=h.playbackRate),"playbackRates"in h&&i(54,nt=h.playbackRates),"widgetStyle"in h&&i(13,Fe=h.widgetStyle),"widgetPosition"in h&&i(33,Lt=h.widgetPosition),"widgetWidth"in h&&i(34,$e=h.widgetWidth),"widgetTarget"in h&&i(14,Ve=h.widgetTarget),"textColor"in h&&i(35,Oe=h.textColor),"backgroundColor"in h&&i(36,et=h.backgroundColor),"iconColor"in h&&i(37,ot=h.iconColor),"highlightColor"in h&&i(15,ut=h.highlightColor),"videoTextColor"in h&&i(38,qe=h.videoTextColor),"videoBackgroundColor"in h&&i(55,It=h.videoBackgroundColor),"videoIconColor"in h&&i(39,ht=h.videoIconColor),"logoIconEnabled"in h&&i(40,_t=h.logoIconEnabled),"highlightSections"in h&&i(16,Ze=h.highlightSections),"clickableSections"in h&&i(17,Ke=h.clickableSections),"segmentWidgetSections"in h&&i(18,st=h.segmentWidgetSections),"segmentWidgetPosition"in h&&i(19,Y=h.segmentWidgetPosition),"currentSegment"in h&&i(20,ze=h.currentSegment),"hoveredSegment"in h&&i(21,Le=h.hoveredSegment),"loadedMedia"in h&&i(80,yt=h.loadedMedia),"advertConsent"in h&&i(41,Tt=h.advertConsent),"analyticsConsent"in h&&i(42,Je=h.analyticsConsent),"analyticsCustomUrl"in h&&i(43,Xe=h.analyticsCustomUrl),"analyticsDeviceType"in h&&i(81,Wt=h.analyticsDeviceType),"analyticsTag"in h&&i(44,ct=h.analyticsTag),"writeToken"in h&&i(82,Pt=h.writeToken),"captureErrors"in h&&i(83,gt=h.captureErrors),"onError"in h&&i(84,Dt=h.onError),"transitions"in h&&i(85,Rt=h.transitions),"controlPanel"in h&&i(22,Nt=h.controlPanel),"clientSideIntegration"in h&&i(86,Bt=h.clientSideIntegration),"initialProps"in h&&i(89,k=h.initialProps),"showMediaSession"in h&&i(56,V=h.showMediaSession),"metadataLoaded"in h&&i(23,ue=h.metadataLoaded),"isFullScreen"in h&&i(57,xt=h.isFullScreen),"mediaElement"in h&&i(45,ei=h.mediaElement),"userInterface"in h&&i(46,pi=h.userInterface),"widgetInterface"in h&&i(47,Ot=h.widgetInterface),"controller"in h&&i(90,Ai=h.controller),"logoImagePosition"in h&&i(58,ui=h.logoImagePosition),"analyticsUrl"in h&&i(91,_n=h.analyticsUrl),"analyticsId"in h&&i(92,bt=h.analyticsId),"listenSessionId"in h&&i(93,Mi=h.listenSessionId),"sessionCreatedAt"in h&&i(94,ci=h.sessionCreatedAt),"companionAdvert"in h&&i(59,ji=h.companionAdvert),"isNewListen"in h&&i(95,Mt=h.isNewListen),"prevPercentage"in h&&i(48,qt=h.prevPercentage),"segmentWidgets"in h&&i(49,Ii=h.segmentWidgets),"segmentContainers"in h&&i(96,jt=h.segmentContainers),"segmentClickables"in h&&i(97,Si=h.segmentClickables),"segmentHighlights"in h&&i(98,Ht=h.segmentHighlights)},t.$$.update=()=>{t.$$.dirty[0]&128|t.$$.dirty[1]&1048576&&i(102,n=He[K]),t.$$.dirty[0]&256|t.$$.dirty[1]&2097152&&i(62,o=Te[Ye]),t.$$.dirty[0]&512|t.$$.dirty[1]&4194304&&i(63,s=it[at]),t.$$.dirty[0]&1024|t.$$.dirty[1]&4194304&&i(74,l=it[xe]),t.$$.dirty[0]&4096|t.$$.dirty[2]&2&&i(103,a=s&&Ne!=="stopped"),t.$$.dirty[2]&262144&&i(105,r=(yt==null?void 0:yt.format)==="audio"),t.$$.dirty[0]&64|t.$$.dirty[1]&67108864&&i(67,u=xt?"video":J),t.$$.dirty[0]&16384&&i(14,Ve=ll(Ve,"widget")),t.$$.dirty[0]&16384|t.$$.dirty[2]&32768&&i(106,c=Z||Ve),t.$$.dirty[0]&32|t.$$.dirty[1]&1048576|t.$$.dirty[2]&32&&i(73,g=fe&&al(u)&&He.length>0),t.$$.dirty[0]&8224|t.$$.dirty[1]&1048576|t.$$.dirty[3]&8192&&i(72,v=fe&&c&&al(Fe)&&He.length>0),t.$$.dirty[0]&4194304&&i(22,Nt=ll(Nt,"control panel")),t.$$.dirty[0]&8192|t.$$.dirty[1]&67108864|t.$$.dirty[3]&8192&&i(66,_=c&&Fe==="video"&&!xt),t.$$.dirty[2]&48&&i(71,m=u==="video"&&!_),t.$$.dirty[2]&16&&(w=_?"bottom-widget":"inline-player"),t.$$.dirty[0]&8256&&i(65,y=J==="video"||Fe==="video"),t.$$.dirty[0]&16384|t.$$.dirty[2]&16&&i(70,A=_?Ve:null),t.$$.dirty[0]&8388608|t.$$.dirty[2]&8|t.$$.dirty[3]&4096&&i(104,S=r&&y&&ue),t.$$.dirty[2]&2|t.$$.dirty[3]&3584&&i(69,C=S?a&&(s==null?void 0:s.imageUrl)||(n==null?void 0:n.imageUrl):""),t.$$.dirty[0]&31|t.$$.dirty[2]&16384&&Xi(l_()),t.$$.dirty[0]&1|t.$$.dirty[2]&1056768&&u_(q,ae,Pt,h=>Xi(h)),t.$$.dirty[0]&2097152|t.$$.dirty[3]&128&&i(100,T=Le||T),t.$$.dirty[0]&1310720&&i(99,I=ro("current",ze,st)),t.$$.dirty[0]&1048576|t.$$.dirty[3]&64&&I&&ti(),t.$$.dirty[0]&262144|t.$$.dirty[3]&128&&i(101,M=ro("hovered",T,st)),t.$$.dirty[0]&1048576|t.$$.dirty[3]&448&&i(61,R=M&&T||I&&ze),t.$$.dirty[0]&1048576|t.$$.dirty[1]&1073741824&&i(64,G=(R==null?void 0:R.marker)===(ze==null?void 0:ze.marker)),t.$$.dirty[2]&7&&i(68,F=G||s||o),t.$$.dirty[0]&786496|t.$$.dirty[1]&1073741824|t.$$.dirty[3]&8&&jt.update(R,st,Y,J),t.$$.dirty[0]&2228224|t.$$.dirty[3]&16&&Si.update(Le,Ke),t.$$.dirty[0]&1146880|t.$$.dirty[3]&32&&Ht.update("current",ze,Ze,ut),t.$$.dirty[0]&2195456|t.$$.dirty[3]&32&&Ht.update("hovered",Le,Ze,ut),t.$$.dirty[0]&2048|t.$$.dirty[2]&276824064&&h_(Rt,Ai,mt)},[ae,ce,se,ee,$,fe,J,K,Ye,at,xe,mt,Ne,Fe,Ve,ut,Ze,Ke,st,Y,ze,Le,Nt,ue,ie,b,P,j,L,We,Ge,Ue,rt,Lt,$e,Oe,et,ot,qe,ht,_t,Tt,Je,Xe,ct,ei,pi,Ot,qt,Ii,Ce,He,Te,it,nt,It,V,xt,ui,ji,Xi,R,o,s,G,y,_,u,F,C,A,m,v,g,l,q,re,Z,wt,dt,yt,Wt,Pt,gt,Dt,Rt,Bt,vt,_e,k,Ai,_n,bt,Mi,ci,Mt,jt,Si,Ht,I,T,M,n,a,S,r,c,yn,Yt,di,kt,gi,pt,fi,zt,D,Q,le,ii,vn,bn,kn,pn,Ts,Bn,Ps,Ri,Cs,po,As,Is,So,Bs,Sn,ni,gl,Vn,li,Vs,Jn,zi,he,lt,St,Ws,Dy,Ry,Ny,xy,Uy,Fy,qy,Hy,Yy,Zy,Gy,Ky,Jy,Xy,Qy]}let V_=class extends we{constructor(e){super(),Se(this,e,B_,I_,ke,{playerApiUrl:75,projectId:0,contentId:1,playlistId:2,sourceId:3,sourceUrl:4,playlist:76,showUserInterface:5,showBottomWidget:77,playerStyle:6,playerTitle:24,callToAction:25,skipButtonStyle:26,playlistStyle:27,playlistToggle:28,downloadFormats:50,mediaSession:29,content:51,contentIndex:7,introsOutros:52,introsOutrosIndex:8,adverts:53,advertIndex:9,minDurationForMidroll:78,minTimeUntilEndForMidroll:79,persistentAdImage:30,persistentIndex:10,duration:31,currentTime:11,playbackState:12,playbackRate:32,playbackRates:54,widgetStyle:13,widgetPosition:33,widgetWidth:34,widgetTarget:14,textColor:35,backgroundColor:36,iconColor:37,highlightColor:15,videoTextColor:38,videoBackgroundColor:55,videoIconColor:39,logoIconEnabled:40,highlightSections:16,clickableSections:17,segmentWidgetSections:18,segmentWidgetPosition:19,currentSegment:20,hoveredSegment:21,loadedMedia:80,advertConsent:41,analyticsConsent:42,analyticsCustomUrl:43,analyticsDeviceType:81,analyticsTag:44,writeToken:82,captureErrors:83,onError:84,transitions:85,controlPanel:22,clientSideIntegration:86,addEventListener:87,removeEventListener:88,initialProps:89,showMediaSession:56,metadataLoaded:23,isFullScreen:57,mediaElement:45,userInterface:46,widgetInterface:47,controller:90,logoImagePosition:58,analyticsUrl:91,analyticsId:92,listenSessionId:93,sessionCreatedAt:94,companionAdvert:59,isNewListen:95,prevPercentage:48,segmentWidgets:49,segmentContainers:96,segmentClickables:97,segmentHighlights:98,onEvent:60},null,[-1,-1,-1,-1,-1,-1])}get playerApiUrl(){return this.$$.ctx[75]}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[76]}set playlist(e){this.$$set({playlist:e}),d()}get showUserInterface(){return this.$$.ctx[5]}set showUserInterface(e){this.$$set({showUserInterface:e}),d()}get showBottomWidget(){return this.$$.ctx[77]}set showBottomWidget(e){this.$$set({showBottomWidget:e}),d()}get playerStyle(){return this.$$.ctx[6]}set playerStyle(e){this.$$set({playerStyle:e}),d()}get playerTitle(){return this.$$.ctx[24]}set playerTitle(e){this.$$set({playerTitle:e}),d()}get callToAction(){return this.$$.ctx[25]}set callToAction(e){this.$$set({callToAction:e}),d()}get skipButtonStyle(){return this.$$.ctx[26]}set skipButtonStyle(e){this.$$set({skipButtonStyle:e}),d()}get playlistStyle(){return this.$$.ctx[27]}set playlistStyle(e){this.$$set({playlistStyle:e}),d()}get playlistToggle(){return this.$$.ctx[28]}set playlistToggle(e){this.$$set({playlistToggle:e}),d()}get downloadFormats(){return this.$$.ctx[50]}set downloadFormats(e){this.$$set({downloadFormats:e}),d()}get mediaSession(){return this.$$.ctx[29]}set mediaSession(e){this.$$set({mediaSession:e}),d()}get content(){return this.$$.ctx[51]}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[52]}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[53]}set adverts(e){this.$$set({adverts:e}),d()}get advertIndex(){return this.$$.ctx[9]}set advertIndex(e){this.$$set({advertIndex:e}),d()}get minDurationForMidroll(){return this.$$.ctx[78]}set minDurationForMidroll(e){this.$$set({minDurationForMidroll:e}),d()}get minTimeUntilEndForMidroll(){return this.$$.ctx[79]}set minTimeUntilEndForMidroll(e){this.$$set({minTimeUntilEndForMidroll:e}),d()}get persistentAdImage(){return this.$$.ctx[30]}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[31]}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[12]}set playbackState(e){this.$$set({playbackState:e}),d()}get playbackRate(){return this.$$.ctx[32]}set playbackRate(e){this.$$set({playbackRate:e}),d()}get playbackRates(){return this.$$.ctx[54]}set playbackRates(e){this.$$set({playbackRates:e}),d()}get widgetStyle(){return this.$$.ctx[13]}set widgetStyle(e){this.$$set({widgetStyle:e}),d()}get widgetPosition(){return this.$$.ctx[33]}set widgetPosition(e){this.$$set({widgetPosition:e}),d()}get widgetWidth(){return this.$$.ctx[34]}set widgetWidth(e){this.$$set({widgetWidth:e}),d()}get widgetTarget(){return this.$$.ctx[14]}set widgetTarget(e){this.$$set({widgetTarget:e}),d()}get textColor(){return this.$$.ctx[35]}set textColor(e){this.$$set({textColor:e}),d()}get backgroundColor(){return this.$$.ctx[36]}set backgroundColor(e){this.$$set({backgroundColor:e}),d()}get iconColor(){return this.$$.ctx[37]}set iconColor(e){this.$$set({iconColor:e}),d()}get highlightColor(){return this.$$.ctx[15]}set highlightColor(e){this.$$set({highlightColor:e}),d()}get videoTextColor(){return this.$$.ctx[38]}set videoTextColor(e){this.$$set({videoTextColor:e}),d()}get videoBackgroundColor(){return this.$$.ctx[55]}set videoBackgroundColor(e){this.$$set({videoBackgroundColor:e}),d()}get videoIconColor(){return this.$$.ctx[39]}set videoIconColor(e){this.$$set({videoIconColor:e}),d()}get logoIconEnabled(){return this.$$.ctx[40]}set logoIconEnabled(e){this.$$set({logoIconEnabled:e}),d()}get highlightSections(){return this.$$.ctx[16]}set highlightSections(e){this.$$set({highlightSections:e}),d()}get clickableSections(){return this.$$.ctx[17]}set clickableSections(e){this.$$set({clickableSections:e}),d()}get segmentWidgetSections(){return this.$$.ctx[18]}set segmentWidgetSections(e){this.$$set({segmentWidgetSections:e}),d()}get segmentWidgetPosition(){return this.$$.ctx[19]}set segmentWidgetPosition(e){this.$$set({segmentWidgetPosition:e}),d()}get currentSegment(){return this.$$.ctx[20]}set currentSegment(e){this.$$set({currentSegment:e}),d()}get hoveredSegment(){return this.$$.ctx[21]}set hoveredSegment(e){this.$$set({hoveredSegment:e}),d()}get loadedMedia(){return this.$$.ctx[80]}set loadedMedia(e){this.$$set({loadedMedia:e}),d()}get advertConsent(){return this.$$.ctx[41]}set advertConsent(e){this.$$set({advertConsent:e}),d()}get analyticsConsent(){return this.$$.ctx[42]}set analyticsConsent(e){this.$$set({analyticsConsent:e}),d()}get analyticsCustomUrl(){return this.$$.ctx[43]}set analyticsCustomUrl(e){this.$$set({analyticsCustomUrl:e}),d()}get analyticsDeviceType(){return this.$$.ctx[81]}set analyticsDeviceType(e){this.$$set({analyticsDeviceType:e}),d()}get analyticsTag(){return this.$$.ctx[44]}set analyticsTag(e){this.$$set({analyticsTag:e}),d()}get writeToken(){return this.$$.ctx[82]}set writeToken(e){this.$$set({writeToken:e}),d()}get captureErrors(){return this.$$.ctx[83]}set captureErrors(e){this.$$set({captureErrors:e}),d()}get onError(){return this.$$.ctx[84]}set onError(e){this.$$set({onError:e}),d()}get transitions(){return this.$$.ctx[85]}set transitions(e){this.$$set({transitions:e}),d()}get controlPanel(){return this.$$.ctx[22]}set controlPanel(e){this.$$set({controlPanel:e}),d()}get clientSideIntegration(){return this.$$.ctx[86]}set clientSideIntegration(e){this.$$set({clientSideIntegration:e}),d()}get addEventListener(){return this.$$.ctx[87]}get removeEventListener(){return this.$$.ctx[88]}get initialProps(){return this.$$.ctx[89]}set initialProps(e){this.$$set({initialProps:e}),d()}get showMediaSession(){return this.$$.ctx[56]}set showMediaSession(e){this.$$set({showMediaSession:e}),d()}get metadataLoaded(){return this.$$.ctx[23]}set metadataLoaded(e){this.$$set({metadataLoaded:e}),d()}get isFullScreen(){return this.$$.ctx[57]}set isFullScreen(e){this.$$set({isFullScreen:e}),d()}get mediaElement(){return this.$$.ctx[45]}set mediaElement(e){this.$$set({mediaElement:e}),d()}get userInterface(){return this.$$.ctx[46]}set userInterface(e){this.$$set({userInterface:e}),d()}get widgetInterface(){return this.$$.ctx[47]}set widgetInterface(e){this.$$set({widgetInterface:e}),d()}get controller(){return this.$$.ctx[90]}set controller(e){this.$$set({controller:e}),d()}get logoImagePosition(){return this.$$.ctx[58]}set logoImagePosition(e){this.$$set({logoImagePosition:e}),d()}get analyticsUrl(){return this.$$.ctx[91]}set analyticsUrl(e){this.$$set({analyticsUrl:e}),d()}get analyticsId(){return this.$$.ctx[92]}set analyticsId(e){this.$$set({analyticsId:e}),d()}get listenSessionId(){return this.$$.ctx[93]}set listenSessionId(e){this.$$set({listenSessionId:e}),d()}get sessionCreatedAt(){return this.$$.ctx[94]}set sessionCreatedAt(e){this.$$set({sessionCreatedAt:e}),d()}get companionAdvert(){return this.$$.ctx[59]}set companionAdvert(e){this.$$set({companionAdvert:e}),d()}get isNewListen(){return this.$$.ctx[95]}set isNewListen(e){this.$$set({isNewListen:e}),d()}get prevPercentage(){return this.$$.ctx[48]}set prevPercentage(e){this.$$set({prevPercentage:e}),d()}get segmentWidgets(){return this.$$.ctx[49]}set segmentWidgets(e){this.$$set({segmentWidgets:e}),d()}get segmentContainers(){return this.$$.ctx[96]}set segmentContainers(e){this.$$set({segmentContainers:e}),d()}get segmentClickables(){return this.$$.ctx[97]}set segmentClickables(e){this.$$set({segmentClickables:e}),d()}get segmentHighlights(){return this.$$.ctx[98]}set segmentHighlights(e){this.$$set({segmentHighlights:e}),d()}get onEvent(){return this.$$.ctx[60]}};class W_{constructor(e,i,n){Ae(this,mn);this.baseUrl=e==null?void 0:e.replace("{id}",i),this.headers={"X-Referer":window.location.href,"X-Import":n==null?void 0:n.enabled,"X-Author":n==null?void 0:n.contentAuthor,"X-Title":n==null?void 0:n.contentTitle,"X-Publish-Date":n==null?void 0:n.publishDate,"X-Published":n==null?void 0:n.published,"X-Ads-Enabled":n==null?void 0:n.adsEnabled}}byContentId(e){return N(this,mn,Xn).call(this,`by_content_id/${e}`)}byPlaylistId(e){return N(this,mn,Xn).call(this,`by_playlist_id/${e}`)}bySourceId(e){return N(this,mn,Xn).call(this,`by_source_id/${e}`)}bySourceUrl(e){return N(this,mn,Xn).call(this,`by_source_url/${encodeURIComponent(e)}`)}byIdentifiers(e){return N(this,mn,Xn).call(this,`by_identifiers/${encodeURIComponent(JSON.stringify(e))}`)}}mn=new WeakSet,Xn=function(e){return sl(`${this.baseUrl}/${e}`,{headers:this.headers})};const rl=t=>typeof t!="object"||t===null?t:Array.isArray(t)?t.map(rl):Object.fromEntries(Object.entries(t).map(([e,i])=>[e.replace(/([A-Z])/g,n=>`_${n.toLowerCase()}`),rl(i)])),mr=t=>t==="dark"||t==="auto"&&O_()?"dark":"light",O_=()=>window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches,hr=t=>Bi(this,null,function*(){const e=new W_(t.playerApiUrl,t.projectId,t.clientSideIntegration);if(!t.playerApiUrl||!t.projectId)return;const i=E_(t);if(i.length===0){t.sourceUrl=window.location.href;return}const n=yield M_(e,i).catch(()=>{});if(!(n!=null&&n.content)){j_(t);return}z_(t,n)}),E_=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(...rl(t.playlist)),[...new Set(e.map(JSON.stringify))].map(JSON.parse)},M_=(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)},j_=t=>{_r(t),yr(t),vr(t),t.onEvent(ye({type:"NoContentAvailable",description:"No published and processed content is available for the identifiers.",initiatedBy:"browser"}))},z_=(t,e)=>{var s,l,a,r;const i=mr(e.settings.theme),n=e.settings[`${i}_theme`],o=e.settings.video_theme;_r(t),yr(t,e),vr(t,e),Me(t,"playerStyle",e.settings.player_style),Me(t,"playerTitle",((s=e.playlist)==null?void 0:s.title)||e.settings.player_title),Me(t,"callToAction",e.settings.call_to_action==="Listen to this article"?null:e.settings.call_to_action),Me(t,"skipButtonStyle",e.settings.skip_button_style),Me(t,"downloadFormats",e.settings.download_button_enabled?["mp3"]:[]),Me(t,"introsOutros",L_(e.settings)),Me(t,"persistentAdImage",e.settings.persistent_ad_image),Me(t,"duration",(r=(a=(l=t.content[t.contentIndex])==null?void 0:l.audio)==null?void 0:a[0])==null?void 0:r.duration),Me(t,"widgetStyle",e.settings.widget_style),Me(t,"widgetPosition",e.settings.widget_position),Me(t,"textColor",n.text_color),Me(t,"backgroundColor",n.background_color),Me(t,"iconColor",n.icon_color),Me(t,"highlightColor",n.highlight_color),Me(t,"videoTextColor",o.text_color),Me(t,"videoBackgroundColor",o.background_color),Me(t,"videoIconColor",o.icon_color),Me(t,"logoIconEnabled",e.settings.logo_icon_enabled),Me(t,"logoImagePosition",e.video_settings.logo_image_position),Me(t,"highlightSections",e.settings.segment_playback_enabled?"all":"none"),Me(t,"clickableSections",e.settings.segment_playback_enabled?"all":"none"),Me(t,"segmentWidgetSections",(e.settings.segment_playback_enabled,"none")),Me(t,"analyticsConsent",D_(e.settings)),Me(t,"analyticsCustomUrl",e.settings.analytics_custom_url),Me(t,"analyticsTag",e.settings.analytics_tag),Me(t,"analyticsUrl",e.settings.analytics_url),Me(t,"analyticsId",e.settings.analytics_id)},_r=t=>{Me(t,"contentIndex",0),Me(t,"introsOutrosIndex",-1),Me(t,"advertIndex",-1),Me(t,"persistentIndex",-1),Me(t,"duration",0),Me(t,"currentTime",0),Me(t,"playbackState","stopped"),Me(t,"currentSegment",void 0),Me(t,"hoveredSegment",void 0)},yr=(t,e)=>{var o;const i=(o=e==null?void 0:e.settings)==null?void 0:o.image_enabled,n=(e==null?void 0:e.content)||[];Me(t,"content",n.map(s=>{var l;return{id:s.id,title:s.title,imageUrl:i?((l=e.playlist)==null?void 0:l.image_url)||e.settings.image_url||s.image_url:null,sourceId:s.source_id,sourceUrl:s.source_url,adsEnabled:s.ads_enabled,duration:s.audio[0]?s.audio[0].duration/1e3:0,audio:s.audio.map(a=>({id:a.id,url:a.url,contentType:a.content_type,duration:a.duration?a.duration/1e3:0})),video:s.video.map(a=>({id:a.id,url:a.url,contentType:a.content_type,duration:a.duration?a.duration/1e3:0})),segments:s.segments.map(a=>({marker:a.marker,xpath:a.xpath,md5:a.md5,section:a.section,startTime:a.start_time?a.start_time/1e3:0,duration:a.duration?a.duration/1e3:0}))}}))},vr=(t,e)=>{var o;const i=(o=e==null?void 0:e.settings)==null?void 0:o.image_enabled,n=(e==null?void 0:e.ads)||[];Me(t,"adverts",n.map(s=>{const l=s.type==="vast",a=mr(s.theme),r=s[`${a}_theme`],u=s.video_theme;return{id:s.id,type:s.type,placement:s.placement,vastUrl:l?s.vast_url:null,clickThroughUrl:l?null:s.click_through_url,imageUrl:i?s.image_url:null,textColor:r==null?void 0:r.text_color,backgroundColor:r==null?void 0:r.background_color,iconColor:r==null?void 0:r.icon_color,videoTextColor:u==null?void 0:u.text_color,videoBackgroundColor:u==null?void 0:u.background_color,videoIconColor:u==null?void 0:u.icon_color,audio:l?[]:(s.audio||s.media).map(c=>({id:c.id,url:c.url,contentType:c.content_type,duration:c.duration?c.duration/1e3:0})),video:l?[]:(s.video||[]).map(c=>({id:c.id,url:c.url,contentType:c.content_type,duration:c.duration?c.duration/1e3:0}))}}))},Me=(t,e,i)=>{var o;typeof((o=t.initialProps)==null?void 0:o[e])!="undefined"||(t[e]=i)},L_=({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},D_=({analytics_enabled:t,analytics_uuid_enabled:e})=>t?e?"allowed":"without-local-storage":"none",R_=(t,e)=>Bi(this,null,function*(){const n=yield(yield fetch(t)).blob(),o=URL.createObjectURL(n),s=document.createElement("a");document.body.append(s),s.href=o,s.setAttribute("download",e),s.setAttribute("target","_blank"),s.click(),s.remove()}),Qo={vastUrls:new Set,mediaSources:new Set},N_=t=>{t.vastUrl&&Qo.vastUrls.add(t.vastUrl);for(const e of[...t.audio||[],...t.video||[]])Qo.mediaSources.add(e.url)},br=t=>{if(t.vastUrl&&Qo.vastUrls.has(t.vastUrl))return!0;for(const e of[...t.audio||[],...t.video||[]])if(Qo.mediaSources.has(e.url))return!0;return!1},kr=new Set,x_=t=>{[...t.audio||[],...t.video||[]].forEach(i=>kr.add(i.url))},U_=t=>[...t.audio||[],...t.video||[]].some(i=>kr.has(i.url)),F_=({introsOutrosIndex:t,adverts:e,advertIndex:i,content:n=[],contentIndex:o,currentTime:s,atTheStart:l,atTheEnd:a,errored:r,minTimeUntilEndForMidroll:u,minDurationForMidroll:c}={})=>{var y;const g=e&&e[i];e:if(g){if(r){N_(g);break e}if(a)return x_(g),-1;if(!a)return i}if(!((y=n[o])!=null&&y.adsEnabled)||t!==-1)return-1;const v=H_({content:n,contentIndex:o,currentTime:s,atTheStart:l,atTheEnd:a,minTimeUntilEndForMidroll:u,minDurationForMidroll:c});let _=-1,m=-1/0,w=-1/0;for(const[A,S]of e.entries()){if(U_(S)||br(S)||!v.has(S.placement))continue;const C=q_[S.type]||0;if(C<m)continue;const T=Math.random();C===m&&T<w||(_=A,m=C,w=T)}return _},q_={vast:1,custom:0},H_=({content:t,contentIndex:e,currentTime:i,atTheStart:n,atTheEnd:o,minTimeUntilEndForMidroll:s,minDurationForMidroll:l})=>{const a=e===0,r=e===t.length-1,u=t.length>1,c=u&&n&&!a,g=t[e].segments,v=g[g.length-1],_=u?null:Z_(g,l),m=g[_],w=m&&i>m.startTime,y=v?v.startTime+v.duration:0,A=i>y-s,S=new Set;return n&&S.add("pre-roll"),w&&!A&&S.add("mid-roll"),c&&S.add("mid-roll"),o&&r&&S.add("post-roll"),c&&S.add("post-roll"),S},Y_=.5,Z_=(t,e)=>{const i=t[t.length-1];if(!i)return;const n=i.startTime+i.duration;if(n<e)return;const o=n/2,s=Us(t,n/2),r=t[s].startTime>=o-Y_?s:s+1;if(r!==t.length)return r},G_=(t,e,i,n)=>{let o=-1,s=-1/0,l=-1/0;for(const[a,r]of(n||[]).entries()){if(!t||br(r)||r.type==="vast")continue;const u=J_(a,e,i);if(u<s)continue;const c=K_[r.placement]||0;u===s&&c<l||(o=a,s=u,l=c)}return o},K_={"pre-roll":2,"mid-roll":1},J_=(t,e,i)=>t===i?2:t===e?1:0,pr={mediaSources:new Set},X_=t=>{for(const e of[...t.audio||[],t.video||[]])pr.mediaSources.add(e.url)},Q_=t=>{for(const e of[...t.audio||[],t.video||[]])if(pr.mediaSources.has(e.url))return!0;return!1},Sr=new Set,$_=t=>{[...t.audio||[],...t.video||[]].forEach(i=>Sr.add(i.url))},ey=t=>[...t.audio||[],...t.video||[]].some(i=>Sr.has(i.url)),ty=({introsOutros:t=[],introsOutrosIndex:e,advertIndex:i,content:n,contentIndex:o,currentTime:s,atTheStart:l,atTheEnd:a,errored:r})=>{const u=t[e];e:if(u){if(r){X_(u);break e}if(a)return $_(u),-1;if(!a)return e}if(i!==-1)return-1;const c=iy({content:n,contentIndex:o,currentTime:s,atTheStart:l,atTheEnd:a});let g=-1,v=-1/0,_=-1/0;for(const[m,w]of t.entries()){if(Q_(w)||!c.has(w.placement))continue;const y=ey(w)?1:0;if(y<v)continue;const A=Math.random();y===v&&A<_||(g=m,v=y,_=A)}return g},iy=({content:t,contentIndex:e,currentTime:i,atTheStart:n,atTheEnd:o})=>{const s=new Set,l=n&&e===0&&i===0,a=o&&e===t.length-1;return l&&s.add("pre-roll"),a&&s.add("post-roll"),s},ny=t=>{if(!navigator.mediaSession)return;const e=t.instances().some(s=>s.mediaSession==="override");if(ly()&&!e)return;let i,n=-1/0,o=-1/0;for(const s of t.instances()){if(s.mediaSession==="none")continue;const l=oy[s.playbackState]||0;if(l<n)continue;const a=sy[s.showMediaSession]||0;l===n&&a<o||(i=s,n=l,o=a)}for(const s of t.instances())s.showMediaSession=s===i;return i},oy={playing:1,paused:0,stopped:0},sy={true:1,false:0},ly=()=>{const t=navigator.mediaSession.metadata;if(!t||navigator.mediaSession.setByPlayer)return!1;const{title:e,artist:i,album:n,artwork:o}=t;return e||i||n||(o==null?void 0:o.length)},ay=t=>{let e=!1,i,n=-1/0,o=-1/0;for(const s of t.instances()){if(!s.userInterface||!al(s.widgetStyle))continue;if(s.userInterface.isVisible){e=!0;continue}if(!(s.userInterface.relativeY<0))continue;const u=ry[s.playbackState]||0;if(u<n)continue;const c=s.userInterface.absoluteY;u===n&&c<o||(i=s,n=u,o=c)}e&&n===0&&(i=null);for(const s of t.instances())s.showBottomWidget=s===i},ry={playing:2,paused:1,stopped:0};class uy{constructor(e,i){Ae(this,ds);Ae(this,gs);Ae(this,fs);Ae(this,yo);Ae(this,ms);Ae(this,hs);Ae(this,Di);Ae(this,on);Ae(this,ki);Ae(this,_s);Ae(this,An);Ae(this,sn);Ae(this,ys);Ae(this,vo);Ae(this,Ki);Ae(this,bo);Ae(this,ln);Ae(this,Ft);Ae(this,an);Ae(this,Ji);Ae(this,vs);Ae(this,bs);Ae(this,In);Ae(this,ko);Ae(this,ks);Ae(this,ps);Ae(this,Ss);Ae(this,ws);this.player=e,this.PlayerClass=i,this.eventListeners={"<any>":{}}}addEventListener(e,i){e==="<any>"||this[`handle${e}`]||ri(`Cannot add listener for unknown event type '${e}'.`);const o=`listener-handle-${Wo()}`;return this.eventListeners[e]=this.eventListeners[e]||{},this.eventListeners[e][o]=i,o}removeEventListener(e,i){this.eventListeners[e]=this.eventListeners[e]||{},delete this.eventListeners[e][i]}processEvent(e){return Bi(this,null,function*(){yield or(()=>this.player),Mu(e);const i=this[`handle${e.type}`],n=Xo(this.player);N(this,ds,Fr).call(this,e)?e.status="ignored-due-to-advert":N(this,gs,qr).call(this,e)?e.status="ignored-due-to-scrubbing":N(this,fs,Hr).call(this,e)?e.status="ignored-due-to-precedence":i?(yield i.call(this,e),N(this,vs,Jr).call(this),N(this,bs,Xr).call(this),e.status="handled"):ri("No handler function for event.",e);const o=Xo(this.player);e.changedProps=sr(n,o),e.processedAt=new Date().toISOString(),ju(e),N(this,yo,bl).call(this,e.type,e),N(this,yo,bl).call(this,"<any>",e)})}handlePressedChangeRate(){N(this,Ki,wn).call(this,e=>e+1,{cycle:!0})}handlePressedEnterOnChangeRate(){N(this,Ki,wn).call(this,e=>e+1,{cycle:!0})}handlePressedSpaceOnChangeRate(){N(this,Ki,wn).call(this,e=>e+1,{cycle:!0})}handlePressedUpOnChangeRate(){N(this,Ki,wn).call(this,e=>e+1)}handlePressedRightOnChangeRate(){N(this,Ki,wn).call(this,e=>e+1)}handlePressedDownOnChangeRate(){N(this,Ki,wn).call(this,e=>e-1)}handlePressedLeftOnChangeRate(){N(this,Ki,wn).call(this,e=>e-1)}handlePressedPrevSegment(){N(this,bo,pl).call(this,e=>e-1)}handlePressedNextSegment(){N(this,bo,pl).call(this,e=>e+1)}handlePressedSeekBack({seconds:e}){N(this,Ft,ai).call(this,i=>i-e)}handlePressedSeekAhead({seconds:e}){N(this,Ft,ai).call(this,i=>i+e)}handlePressedPrevTrack(){N(this,ln,En).call(this,e=>e-1)}handlePressedNextTrack(){N(this,ln,En).call(this,e=>e+1)}handlePressedAdvertLink(){}handlePressedAdvertButton(){}handlePressedAdvertImage(){}handlePressedAdvertVideo(){}handlePressedBeyondWords(){}handlePressedSourceUrl(){}handleDurationUpdated(){}handleMetadataLoaded({loadedMedia:e}){this.player.loadedMedia=e}handleMediaLoaded({loadedMedia:e}){this.player.loadedMedia=e}handleMediaSeeked(){}handlePlaybackRateUpdated(){}handleVisibilityChanged(){ay(this.PlayerClass)}handlePressedVideoBackground(){N(this,sn,On).call(this)}handlePressedEnterOnProgressBar(){N(this,sn,On).call(this)}handlePressedSpaceOnProgressBar(){N(this,sn,On).call(this)}handlePressedEnterOnProgressCircle(){N(this,sn,On).call(this)}handlePressedSpaceOnProgressCircle(){N(this,sn,On).call(this)}handlePressedLeftOnProgressBar(){N(this,Ft,ai).call(this,e=>e-5)}handlePressedRightOnProgressBar(){N(this,Ft,ai).call(this,e=>e+5)}handlePressedLeftOnProgressCircle(){N(this,Ft,ai).call(this,e=>e-5)}handlePressedRightOnProgressCircle(){N(this,Ft,ai).call(this,e=>e+5)}handlePressedProgressBar({ratio:e}){this.preScrubState=this.player.playbackState,this.pauseTimeout=setTimeout(()=>N(this,ys,Kr).call(this),100),N(this,Ft,ai).call(this,(i,n)=>e*n),e!==0&&(this.segmentPlayed=!0)}handleScrubbedProgressBar({ratio:e}){N(this,Ft,ai).call(this,(i,n)=>e*n-.01),e!==0&&(this.segmentPlayed=!0)}handleFinishedScrubbingProgressBar(){clearTimeout(this.pauseTimeout),this.player.playbackState=this.preScrubState,delete this.preScrubState}handleIdentifiersChanged(){hr(this.player).then(()=>{N(this,an,Mn).call(this,{atTheStart:!0}),N(this,Ji,Tn).call(this,{atTheStart:!0})})}handleNoContentAvailable({description:e}){console.warn(`BeyondWords.Player: ${e}`)}handlePressedPlay({emittedFrom:e,widgetSegment:i,widgetIsCurrent:n}){e==="segment-widget"&&!n?N(this,vo,kl).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"),ny(this.PlayerClass)}handlePlaybackPaused(){const e=this.player.playbackState==="playing",i=this.player.currentTime>=this.player.duration-.5;e&&!i&&!this.preScrubState&&(this.player.playbackState="paused")}handleCurrentTimeUpdated(){this.midrollPlayed||N(this,Ji,Tn).call(this);const e=this.player.currentTime<=oo,i=this.player.currentTime>=this.player.duration,n=this.player.mediaElement.video.paused;!e&&!i&&!n&&(this.player.playbackState="playing")}handlePlaybackEnded(){N(this,_s,Gr).call(this)&&(this.midrollPlayed=!0),this.segmentPlayed=!1;const e=N(this,Di,un).call(this),i=N(this,ki,Li).call(this);N(this,Ji,Tn).call(this,{atTheEnd:!0,wasIntro:e}),!i&&(N(this,an,Mn).call(this,{atTheEnd:!0}),!e&&(N(this,on,Wn).call(this)||N(this,ki,Li).call(this)||N(this,ln,En).call(this,n=>n+1)))}handlePlaybackNotAllowed({description:e}){console.warn(`BeyondWords.Player: ${e}`);const i=this.player.contentIndex<=0&&this.player.currentTime<=oo;this.player.playbackState=i?"stopped":"paused"}handlePlaybackErrored({mediaType:e,errorMessage:i}){console.warn(`BeyondWords.Player: ${e} playback error: ${i}`),N(this,Di,un).call(this)||N(this,on,Wn).call(this)?N(this,an,Mn).call(this,{errored:!0}):N(this,ki,Li).call(this)?N(this,Ji,Tn).call(this,{errored:!0}):this.handlePlaybackEnded()}handleCompanionAdvertChanged({clickThroughUrl:e,imageUrl:i}){this.player.companionAdvert={clickThroughUrl:e,imageUrl:i}}handlePressedMaximize(){Aa()?h0():m0(this.player.target)}handleFullScreenModeUpdated(){const e=Aa()===this.player.target,i=e?"add":"remove";this.player.isFullScreen=e,this.player.target.classList[i]("maximized")}handlePressedPlaylistItem({index:e}){N(this,ln,En).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 c,g;const o=this.player.content[e],s=(c=o.audio)==null?void 0:c[i],l=(g=o.video)==null?void 0:g[n],a=(s||l).url,r=a.split(".").pop(),u=`${o.title}.${r}`;return R_(a,u)}handlePressedCloseWidget(){for(const e of this.PlayerClass.instances())e.playbackState="paused",e.widgetStyle="closed-by-user"}handleContentStatusChanged({contentId:e,legacyId:i,sourceId:n,sourceUrl:o,contentStatus:s}){s==="processed"&&this.player.playbackState==="stopped"&&this.player.contentIndex===0&&this.player.currentTime===0&&N(this,Ss,eu).call(this,{contentId:e,legacyId:i,sourceId:n,sourceUrl:o})&&hr(this.player).then(()=>{N(this,an,Mn).call(this,{atTheStart:!0}),N(this,Ji,Tn).call(this,{atTheStart:!0})})}handleCurrentSegmentUpdated({segment:e,contentIndex:i,segmentIndex:n,segmentElement:o}){var s;N(this,An,wo).call(this)?this.player.currentSegment=rn(oi({},e),{contentIndex:i,segmentIndex:n,segmentElement:o}):this.segmentPlayed||((s=this.player.segmentContainers)==null||s.reset(),this.player.currentSegment=null)}handleHoveredSegmentUpdated({segment:e,contentIndex:i,segmentIndex:n,segmentElement:o}){e?this.player.hoveredSegment=rn(oi({},e),{contentIndex:i,segmentIndex:n,segmentElement:o}):this.player.hoveredSegment=null}handlePressedSegment({segment:e,contentIndex:i,segmentIndex:n,segmentElement:o}){if(!ro("hovered",e,this.player.clickableSections))return;if(!N(this,ws,tu).call(this,{contentIndex:i,segmentIndex:n})&&!N(this,ki,Li).call(this)){N(this,sn,On).call(this);return}i!==this.player.contentIndex&&N(this,ln,En).call(this,()=>i),N(this,vo,kl).call(this,oi({contentIndex:i,segmentIndex:n,segmentElement:o},e))}}ds=new WeakSet,Fr=function({type:e}){return N(this,ki,Li).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"))},gs=new WeakSet,qr=function({type:e}){return this.preScrubState&&(e.includes("CurrentTimeUpdated")||e.includes("PlaybackEnded"))},fs=new WeakSet,Hr=function({type:e,precedence:i}){return e.includes("PressedSegment")&&i>0},yo=new WeakSet,bl=function(e,i){const n=this.eventListeners[e]||{};Object.values(n).forEach(o=>o(i))},ms=new WeakSet,Yr=function(){return this.player.introsOutros.some(e=>e.placement==="pre-roll")},hs=new WeakSet,Zr=function(){return this.player.introsOutros.some(e=>e.placement==="post-roll")},Di=new WeakSet,un=function(e=this.player.introsOutrosIndex){var i,n,o;return((o=(n=(i=this.player)==null?void 0:i.introsOutros)==null?void 0:n[e])==null?void 0:o.placement)==="pre-roll"},on=new WeakSet,Wn=function(e=this.player.introsOutrosIndex){var i,n,o;return((o=(n=(i=this.player)==null?void 0:i.introsOutros)==null?void 0:n[e])==null?void 0:o.placement)==="post-roll"},ki=new WeakSet,Li=function(){return this.player.advertIndex!==-1},_s=new WeakSet,Gr=function(){var e;return((e=this.player.adverts[this.player.advertIndex])==null?void 0:e.placement)==="mid-roll"},An=new WeakSet,wo=function(){return!N(this,Di,un).call(this)&&!N(this,on,Wn).call(this)&&!N(this,ki,Li).call(this)},sn=new WeakSet,On=function(){this.player.playbackState==="playing"?this.player.playbackState="paused":this.player.playbackState="playing"},ys=new WeakSet,Kr=function(){this.player.playbackState==="playing"&&(this.player.playbackState="paused")},vo=new WeakSet,kl=function(s){var l=s,{contentIndex:e,segmentIndex:i,segmentElement:n}=l,o=ml(l,["contentIndex","segmentIndex","segmentElement"]);N(this,Ft,ai).call(this,()=>o.startTime,e),this.player.currentSegment=oi({contentIndex:e,segmentIndex:i,segmentElement:n},o),this.player.playbackState="playing",this.segmentPlayed=!0},Ki=new WeakSet,wn=function(e,{cycle:i}={}){const n=this.player.playbackRates,o=n.length-1,s=n.indexOf(this.player.playbackRate),l=e(s);let a;i?a=l%n.length:a=Math.max(0,Math.min(o,l)),this.player.playbackRate=n[a]||1},bo=new WeakSet,pl=function(e){const i=this.player.content[this.player.contentIndex].segments,n=Us(i,this.player.currentTime),o=e(n);N(this,Di,un).call(this)&&o>=0?this.handlePlaybackEnded():N(this,on,Wn).call(this)&&o<0?(N(this,In,To).call(this,-1),N(this,Ft,ai).call(this,()=>{var s;return((s=i[i.length-1])==null?void 0:s.startTime)||.01}),this.player.playbackState="playing"):N(this,An,wo).call(this)&&o<0&&N(this,ms,Yr).call(this)?(N(this,Ft,ai).call(this,()=>0),N(this,an,Mn).call(this,{atTheStart:!0})):N(this,An,wo).call(this)&&o===i.length&&N(this,hs,Zr).call(this)?N(this,Ft,ai).call(this,()=>this.player.duration-.01):N(this,An,wo).call(this)&&o>=0&&o<i.length&&N(this,Ft,ai).call(this,()=>i[o].startTime)},ln=new WeakSet,En=function(e){const i=e(this.player.contentIndex),n=i<0||i>=this.player.content.length;n?(this.player.playbackState="stopped",N(this,Ft,ai).call(this,()=>0)):(this.player.contentIndex=i,N(this,ki,Li).call(this)||(N(this,Ft,ai).call(this,()=>0),this.midrollPlayed=!1)),N(this,In,To).call(this,-1),N(this,an,Mn).call(this,{atTheStart:!0}),n||N(this,Ji,Tn).call(this,{atTheStart:!0})},Ft=new WeakSet,ai=function(e,i){if(N(this,ki,Li).call(this))this.prevTime=e(),this.prevContent=i;else{const n=this.player.duration||0;this.player.currentTime=e(this.player.currentTime,n)}},an=new WeakSet,Mn=function({atTheStart:e,atTheEnd:i,errored:n}={}){const{content:o,introsOutros:s,currentTime:l}=this.player,a=typeof this.nextIntroOutro!="undefined"?this.nextIntroOutro:this.player.introsOutrosIndex,r=typeof this.nextAdvert!="undefined"?this.nextAdvert:this.player.advertIndex,u=typeof this.prevContent!="undefined"?this.prevContent:this.player.contentIndex;N(this,In,To).call(this,ty({introsOutros:s,introsOutrosIndex:a,advertIndex:r,content:o,contentIndex:u,currentTime:l,atTheStart:e,atTheEnd:i,errored:n}))},Ji=new WeakSet,Tn=function({atTheStart:e,atTheEnd:i,wasIntro:n,errored:o}={}){const{adverts:s,content:l,currentTime:a,minDurationForMidroll:r,minTimeUntilEndForMidroll:u}=this.player;let c=typeof this.nextIntroOutro!="undefined"?this.nextIntroOutro:this.player.introsOutrosIndex;const g=typeof this.nextAdvert!="undefined"?this.nextAdvert:this.player.advertIndex,v=typeof this.prevContent!="undefined"?this.prevContent:this.player.contentIndex;n&&(e=!0,i=!1,c=-1),N(this,ko,Sl).call(this,F_({introsOutrosIndex:c,adverts:s,advertIndex:g,content:l,contentIndex:v,currentTime:a,atTheStart:e,atTheEnd:i,errored:o,minDurationForMidroll:r,minTimeUntilEndForMidroll:u}));const _=this.player.persistentAdImage,m=this.player.persistentIndex;this.player.persistentIndex=G_(_,m,g,s)},vs=new WeakSet,Jr=function(){this.player.playbackState==="playing"&&typeof this.nextIntroOutro!="undefined"&&(N(this,In,To).call(this,this.nextIntroOutro),delete this.nextIntroOutro)},bs=new WeakSet,Xr=function(){this.player.playbackState==="playing"&&typeof this.nextAdvert!="undefined"&&(N(this,ko,Sl).call(this,this.nextAdvert),delete this.nextAdvert)},In=new WeakSet,To=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<=oo)&&N(this,Di,un).call(this,e)){this.player.introsOutrosIndex=-1,N(this,Ji,Tn).call(this,{atTheStart:!0});return}const s=N(this,Di,un).call(this),l=N(this,on,Wn).call(this);this.player.introsOutrosIndex=e;const a=s&&!N(this,Di,un).call(this),r=l&&!N(this,on,Wn).call(this);a&&(this.player.currentTime=0),r&&N(this,ln,En).call(this,()=>1/0)},ko=new WeakSet,Sl=function(e){if(this.player.playbackState!=="playing"&&e!==-1){this.nextAdvert=e;return}else delete this.nextAdvert;const n=N(this,ki,Li).call(this);this.player.advertIndex=e;const o=!n&&N(this,ki,Li).call(this),s=n&&!N(this,ki,Li).call(this);o&&N(this,ks,Qr).call(this),s&&N(this,ps,$r).call(this)},ks=new WeakSet,Qr=function(){N(this,Di,un).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},ps=new WeakSet,$r=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},Ss=new WeakSet,eu=function({contentId:e,legacyId:i,sourceId:n,sourceUrl:o}){var s,l,a,r;return this.player.contentId===e||this.player.contentId===i||this.player.sourceId===n||this.player.sourceUrl===o||((s=this.player.playlist)==null?void 0:s.some(u=>u.contentId===e))||((l=this.player.playlist)==null?void 0:l.some(u=>u.contentId===i))||((a=this.player.playlist)==null?void 0:a.some(u=>u.sourceId===n))||((r=this.player.playlist)==null?void 0:r.some(u=>u.sourceUrl===o))},ws=new WeakSet,tu=function({contentIndex:e,segmentIndex:i}){var n,o;return((n=this.player.currentSegment)==null?void 0:n.contentIndex)!==e||((o=this.player.currentSegment)==null?void 0:o.segmentIndex)!==i};var co="<unknown>";function cy(t){var e=t.split(`
57
+ gtag("js", new Date());`,e.async=!0,wi(e.src,i="https://www.googletagmanager.com/gtag/js?id="+t[0])||$a(e,"src",i)},m(s,l){E(s,e,l),E(s,n,l),E(s,o,l)},p(s,l){l&1&&!wi(e.src,i="https://www.googletagmanager.com/gtag/js?id="+s[0])&&$a(e,"src",i)},d(s){s&&(O(e),O(n),O(o))}}}function i_(t){let e,i=!t[1]&&er(t);return{c(){i&&i.c(),e=xi()},m(n,o){i&&i.m(document.head,null),f(document.head,e)},p(n,[o]){n[1]?i&&(i.d(1),i=null):i?i.p(n,o):(i=er(n),i.c(),i.m(e.parentNode,e))},i:x,o:x,d(n){i&&i.d(n),O(e)}}}function n_(t,e,i){let n,{analyticsTag:o}=e;return t.$$set=s=>{"analyticsTag"in s&&i(0,o=s.analyticsTag)},i(1,n=window.gtag),[o,n]}class o_ extends we{constructor(e){super(),Se(this,e,n_,i_,ke,{analyticsTag:0})}get analyticsTag(){return this.$$.ctx[0]}set analyticsTag(e){this.$$set({analyticsTag:e}),d()}}const L3="";class s_ extends we{constructor(e){super(),Se(this,e,null,null,ke,{})}}class $s{constructor(e,i){Ae(this,go);Ae(this,ts);this.onSelected=e,this.onDeselected=i,this.consumers={}}addInterest(e,i,...n){var s;(s=this.consumers)[e]||(s[e]=[]);const o=this.consumers[e].slice(-1)[0];this.consumers[e].push({consumerId:i,args:n}),!(o&&N(this,go,yl).call(this,n,o.args))&&(o&&this.onDeselected(e,...o.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(N(this,ts,Er).call(this,this.consumers[e],a=>a.consumerId===i),!(n&&i===n.consumerId))return;const s=this.consumers[e].slice(-1)[0];s&&N(this,go,yl).call(this,n.args,s.args)||(this.onDeselected(e,...n.args),s&&this.onSelected(e,...s.args))}}go=new WeakSet,yl=function(e,i){return e.length===i.length&&e.every((n,o)=>n===i[o])},ts=new WeakSet,Er=function(e,i){for(let n=e.length-1;n>=0;n-=1)if(i(e[n])){e.splice(n,1);return}};class el{constructor(){Ae(this,is);this.randomIds=new WeakMap}fetchOrAdd(e){return e!=null&&e.segmentElement?e.marker?e.marker:(this.uniqueIds.has(e.segmentElement)||this.uniqueIds.set(e.segmentElement,N(this,is,Mr).call(this)),this.randomIds.get(e.segmentElement)):null}}is=new WeakSet,Mr=function(){return Math.random().toString(36).substring(2)};const ro=(t,e,i)=>{let[n,o]=i.split("-");n||(n="none"),o||(o=n);const s=t==="current"?n:o;return s==="all"||s==="body"&&(e==null?void 0:e.section)==="body"},Jo=["beyondwords-clickable","bwp"],en=class en{constructor(){this.ids=new el}update(e,i){const n=ro("hovered",e,i),o=this.previous,s=n?this.ids.fetchOrAdd(e):null;s&&Ni(en,fo).addInterest(s,this,e),o&&Ni(en,fo).removeInterest(o,this),this.previous=s}};fo=new WeakMap,ns=new WeakSet,jr=function(e,i){if(i.segmentElement.classList.add(...Jo),!i.marker)return;const n=document.querySelectorAll(`[data-beyondwords-marker="${i.marker}"]`);for(const o of n)o.classList.add(...Jo)},os=new WeakSet,zr=function(e,i){if(il(i.segmentElement,Jo),!i.marker)return;const n=document.querySelectorAll(`[data-beyondwords-marker="${i.marker}"]`);for(const o of n)il(o,Jo)},Ae(en,ns),Ae(en,os),Ae(en,fo,new $s(N(en,ns,jr),N(en,os,zr)));let tl=en;const il=(t,e)=>{if(!t)return;const o=[...t.classList].filter(s=>!e.includes(s)).some(s=>s.startsWith("beyondwords-"))?e.filter(s=>s!=="bwp"):e;t.classList.remove(...o)},tr=(t,e,i)=>["beyondwords-widget","bwp",`id-${t}`,`position-${e}`,`for-${i}-player`],ir=["beyondwords-relative","bwp"],tn=class tn{constructor(e){Ae(this,as);this.onUpdate=e,this.containers=[],this.ids=new el}update(e,i,n,o){const s=i.includes("all")||i.includes("body"),l=e||s&&this.previous,a=this.previous,r=this.ids.fetchOrAdd(l);r&&Ni(tn,mo).addInterest(r,this,this,l,n,o),a&&Ni(tn,mo).removeInterest(a,this),this.previous=r}reset(){this.update(null,"none")}};mo=new WeakMap,ss=new WeakSet,Lr=function(e,i,n,o,s){var c;const l=N(c=i,as,Rr).call(c,n);["2-oclock","3-oclock","4-oclock","8-oclock","9-oclock","10-oclock"].includes(o)&&l.classList.add(...ir);const r=document.createElement("div");r.classList.add(...tr(e,o,s)),["11-oclock","12-oclock","1-oclock"].includes(o)?l.insertBefore(r,l.firstChild):l.appendChild(r),i.containers.push(r),i.onUpdate(i.containers)},ls=new WeakSet,Dr=function(e,i,n,o,s){const l=tr(e,o,s);for(let a=0;a<i.containers.length;a+=1){if(!l.every(c=>i.containers[a].classList.contains(c)))continue;const u=i.containers[a].parentNode;il(u,ir),i.containers[a].remove(),i.containers.splice(a,1),a-=1}i.onUpdate(i.containers)},as=new WeakSet,Rr=function(e){var s;const i=e.marker,n=(s=e.segmentElement)==null?void 0:s.getAttribute("data-beyondwords-marker");let o;if(i||n){const l=i&&`[data-beyondwords-marker="${i}"]`,a=n&&`[data-beyondwords-marker="${n}"]`,r=[l,a].filter(u=>u).join(", ");o=document.querySelectorAll(r)}return o.length>0?o[0]:e.segmentElement},Ae(tn,ss),Ae(tn,ls),Ae(tn,mo,new $s(N(tn,ss,Lr),N(tn,ls,Dr)));let nl=tn;const nr=t=>["beyondwords-highlight","bwp",`id-${t}`],nn=class nn{constructor(){Ae(this,_o);this.ids=new el}update(e,i,n,o){const s=ro(e,i,n),l=this[`prev${e}`],a=s?this.ids.fetchOrAdd(i):null;a&&Ni(nn,ho).addInterest(a,this,this,i,o),l&&Ni(nn,ho).removeInterest(l,this),this[`prev${e}`]=a}};ho=new WeakMap,rs=new WeakSet,Nr=function(e,i,n,o){var s;for(const l of N(s=i,_o,vl).call(s,n)){const a=document.createTreeWalker(l,NodeFilter.SHOW_TEXT,null,!1);let r;for(;r=a.nextNode();){if(/^\s*$/.test(r.nodeValue))continue;r.parentNode.nodeName.toLowerCase()==="a"&&(r=r.parentNode);const g=document.createElement("mark");g.classList.add(...nr(e)),g.style.background=o,r.parentNode.insertBefore(g,r),g.appendChild(r)}}},us=new WeakSet,xr=function(e,i,n){var o;for(const s of N(o=i,_o,vl).call(o,n)){const l=s.querySelectorAll(`mark.${nr(e)}`);for(const a of l)for(const r of a.childNodes)a.parentNode.insertBefore(r,a),a.remove()}},_o=new WeakSet,vl=function(e){var s;const i=new Set([e.segmentElement]),n=e.marker,o=(s=e.segmentElement)==null?void 0:s.getAttribute("data-beyondwords-marker");for(const l of[n,o].filter(a=>a)){const a=document.querySelectorAll(`[data-beyondwords-marker="${l}"]`);for(const r of a)i.add(r)}return i},Ae(nn,rs),Ae(nn,us),Ae(nn,ho,new $s(N(nn,rs,Nr),N(nn,us,xr)));let ol=nn;const l_=()=>ye({type:"IdentifiersChanged",description:"The Player's content identifiers changed.",initiatedBy:"browser"}),sl=(i,...n)=>Bi(this,[i,...n],function*(t,e={}){const o=yield fetch(t,e).catch(()=>{}),s=yield o==null?void 0:o.json().catch(()=>{});return(o==null?void 0:o.status)!==200&&ri(`Failed to fetch ${t}`,rn(oi({},e),{responseStatus:o==null?void 0:o.status,responseJson:s})),s}),a_=(t,e)=>sl(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e,(i,n)=>n===void 0?null:n)});class r_{constructor(e,i,n){Ae(this,cs);this.baseUrl=N(this,cs,Ur).call(this,e),this.projectId=i,this.writeToken=n}getWebSocketToken(){return Bi(this,null,function*(){const e={Authorization:`Token token=${this.writeToken}`},{token:i}=yield sl(`https://${this.baseUrl}/api/v4/token/ws`,{headers:e});this.webSocketToken=i})}establishConnection(e,i){return Bi(this,null,function*(){const n=`wss://${this.baseUrl}/cable?token=${this.webSocketToken}`,o="actioncable-v1-json";this.webSocket=new WebSocket(n,o),this.webSocket.onmessage=s=>e(JSON.parse(s.data)),this.webSocket.onerror=i,yield new Promise(s=>this.webSocket.onopen=s)})}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)}}cs=new WeakSet,Ur=function(e){return e.includes("staging")?"app.staging-beyondwords.io":"app.beyondwords.io"};let Cn;const u_=(t,e,i,n)=>Bi(this,null,function*(){!t||!e||!i||(Cn==null||Cn.destroy(),Cn=new r_(t,e,i),yield Cn.getWebSocketToken(),yield Cn.establishConnection(c_(n),f_),yield Cn.subscribeToStatusChanges())}),c_=t=>e=>{var o,s;((s=(o=e==null?void 0:e.message)==null?void 0:o.result)==null?void 0:s.action)==="podcast_state_updated"&&d_(e,t),e.type==="reject_subscription"&&g_(e)},d_=(t,e)=>{const i=t.message.result;e(ye({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}))},g_=t=>{ri("The WebSocket status change subscription was rejected.",{webSocketEvent:t})},f_=t=>{ri("Unexpected WebSocket error.",{error:t})},or=t=>{if(!t())return new Promise(e=>{setInterval(()=>t()&&e(),10)})},Xo=t=>{const i=Object.keys(t.$$.props).filter(n=>!m_.has(n)).map(n=>[n,t[n]]);return Object.fromEntries(i)},m_=new Set(["addEventListener","removeEventListener","mediaElement","userInterface","widgetInterface","controller"]),sr=(t,e)=>{const i=new Set([...Object.keys(t),...Object.keys(e)]),n={};for(const o of i){const s=t[o],l=e[o];s!==l&&(n[o]={previousValue:s,currentValue:l})}return n};let uo=-1;const lr=[],h_=(t,e,i)=>Bi(this,null,function*(){yield or(()=>e.player);const n=e.player,o=__(n.contentIndex,i,t);o>uo&&y_(n,uo,o,t),o<uo&&v_(n,uo,o),uo=o}),__=(t,e,i)=>{const n=i.findIndex(s=>s[0]===t&&s[1]>e||s[0]>t);return n===-1?i.length-1:n-1},y_=(t,e,i,n)=>{for(let o=e+1;o<=i;o+=1){const s=Xo(t);n[o][2](t);const l=Xo(t),a=sr(s,l);lr.push(a)}},v_=(t,e,i)=>{for(let n=e;n>i;n-=1){const o=lr.pop();for(const[s,l]of Object.entries(o))t[s]=l.previousValue}},b_=t=>t?k_(t)?{newTarget:S_(t),showUserInterface:!0}:typeof t=="string"?{newTarget:ll(t),showUserInterface:!0}:{newTarget:t,showUserInterface:!0}:{newTarget:p_(),showUserInterface:!1},k_=t=>typeof t=="object"&&t.nodeName.toLowerCase()==="script",p_=()=>{const t=document.createElement("div");return document.body.appendChild(t),t},S_=t=>{const e=document.createElement("div");return t.parentNode.insertBefore(e,t.nextSibling),e},ll=(t,e="player")=>{if(typeof t!="string")return t;const i=document.querySelectorAll(t);return i.length===0&&ri(`Failed to initialize ${e} because the target could not be found.`,{target:t,elements:i}),i.length>1&&ri(`Failed to initialize ${e} because the target is ambiguous. (${i.length} elements match)`,{target:t,elements:i}),i[0]},w_=["small","standard","large","screen","video"],al=t=>w_.indexOf(t)!==-1;function ar(t,e,i){const n=t.slice();return n[162]=e[i],n}function T_(t){let e,i,n,o,s,l,a,r;function u(y){t[108](y)}function c(y){t[109](y)}function g(y){t[110](y)}function v(y){t[111](y)}function _(y){t[112](y)}function m(y){t[113](y)}let w={onEvent:t[60],content:t[51],contentIndex:t[7],introOrOutro:t[62],activeAdvert:t[63],advertConsent:t[41],showUserInterface:t[5],videoBehindWidget:t[66],videoBehindStatic:t[71],videoMightBeShown:t[65],widgetPosition:t[33],widgetWidth:t[34],widgetTarget:t[14]};return t[12]!==void 0&&(w.playbackState=t[12]),t[31]!==void 0&&(w.duration=t[31]),t[11]!==void 0&&(w.currentTime=t[11]),t[32]!==void 0&&(w.playbackRate=t[32]),t[48]!==void 0&&(w.prevPercentage=t[48]),t[23]!==void 0&&(w.metadataLoaded=t[23]),e=new Ag({props:w}),t[107](e),oe.push(()=>be(e,"playbackState",u)),oe.push(()=>be(e,"duration",c)),oe.push(()=>be(e,"currentTime",g)),oe.push(()=>be(e,"playbackRate",v)),oe.push(()=>be(e,"prevPercentage",_)),oe.push(()=>be(e,"metadataLoaded",m)),{c(){me(e.$$.fragment)},m(y,A){de(e,y,A),r=!0},p(y,A){const S={};A[1]&1048576&&(S.content=y[51]),A[0]&128&&(S.contentIndex=y[7]),A[2]&1&&(S.introOrOutro=y[62]),A[2]&2&&(S.activeAdvert=y[63]),A[1]&1024&&(S.advertConsent=y[41]),A[0]&32&&(S.showUserInterface=y[5]),A[2]&16&&(S.videoBehindWidget=y[66]),A[2]&512&&(S.videoBehindStatic=y[71]),A[2]&8&&(S.videoMightBeShown=y[65]),A[1]&4&&(S.widgetPosition=y[33]),A[1]&8&&(S.widgetWidth=y[34]),A[0]&16384&&(S.widgetTarget=y[14]),!i&&A[0]&4096&&(i=!0,S.playbackState=y[12],ve(()=>i=!1)),!n&&A[1]&1&&(n=!0,S.duration=y[31],ve(()=>n=!1)),!o&&A[0]&2048&&(o=!0,S.currentTime=y[11],ve(()=>o=!1)),!s&&A[1]&2&&(s=!0,S.playbackRate=y[32],ve(()=>s=!1)),!l&&A[1]&131072&&(l=!0,S.prevPercentage=y[48],ve(()=>l=!1)),!a&&A[0]&8388608&&(a=!0,S.metadataLoaded=y[23],ve(()=>a=!1)),e.$set(S)},i(y){r||(B(e.$$.fragment,y),r=!0)},o(y){z(e.$$.fragment,y),r=!1},d(y){t[107](null),ge(e,y)}}}function rr(t){let e,i,n={onEvent:t[60],playerStyle:t[67],callToAction:t[25],skipButtonStyle:t[26],playlistStyle:t[27],playlistToggle:t[28],downloadFormats:t[50],playerTitle:t[24],content:t[51],contentIndex:t[7],duration:t[31],currentTime:t[11],playbackState:t[12],playbackRate:t[32],playbackRates:t[54],activeAdvert:t[63],persistentAdvert:t[74],companionAdvert:t[59],textColor:t[35],backgroundColor:t[36],iconColor:t[37],videoTextColor:t[38],videoBackgroundColor:t[55],videoIconColor:t[39],logoIconEnabled:t[40],logoImagePosition:t[58],isFullScreen:t[57],videoPosterImage:t[69],videoIsBehind:t[71]};return e=new Xs({props:n}),t[114](e),{c(){me(e.$$.fragment)},m(o,s){de(e,o,s),i=!0},p(o,s){const l={};s[2]&32&&(l.playerStyle=o[67]),s[0]&33554432&&(l.callToAction=o[25]),s[0]&67108864&&(l.skipButtonStyle=o[26]),s[0]&134217728&&(l.playlistStyle=o[27]),s[0]&268435456&&(l.playlistToggle=o[28]),s[1]&524288&&(l.downloadFormats=o[50]),s[0]&16777216&&(l.playerTitle=o[24]),s[1]&1048576&&(l.content=o[51]),s[0]&128&&(l.contentIndex=o[7]),s[1]&1&&(l.duration=o[31]),s[0]&2048&&(l.currentTime=o[11]),s[0]&4096&&(l.playbackState=o[12]),s[1]&2&&(l.playbackRate=o[32]),s[1]&8388608&&(l.playbackRates=o[54]),s[2]&2&&(l.activeAdvert=o[63]),s[2]&4096&&(l.persistentAdvert=o[74]),s[1]&268435456&&(l.companionAdvert=o[59]),s[1]&16&&(l.textColor=o[35]),s[1]&32&&(l.backgroundColor=o[36]),s[1]&64&&(l.iconColor=o[37]),s[1]&128&&(l.videoTextColor=o[38]),s[1]&16777216&&(l.videoBackgroundColor=o[55]),s[1]&256&&(l.videoIconColor=o[39]),s[1]&512&&(l.logoIconEnabled=o[40]),s[1]&134217728&&(l.logoImagePosition=o[58]),s[1]&67108864&&(l.isFullScreen=o[57]),s[2]&128&&(l.videoPosterImage=o[69]),s[2]&512&&(l.videoIsBehind=o[71]),e.$set(l)},i(o){i||(B(e.$$.fragment,o),i=!0)},o(o){z(e.$$.fragment,o),i=!1},d(o){t[114](null),ge(e,o)}}}function ur(t){let e,i;return e=new Ko({props:{root:t[14],$$slots:{default:[P_]},$$scope:{ctx:t}}}),{c(){me(e.$$.fragment)},m(n,o){de(e,n,o),i=!0},p(n,o){const s={};o[0]&16384&&(s.root=n[14]),o[0]&117471360|o[1]&429458431|o[2]&4242|o[5]&1024&&(s.$$scope={dirty:o,ctx:n}),e.$set(s)},i(n){i||(B(e.$$.fragment,n),i=!0)},o(n){z(e.$$.fragment,n),i=!1},d(n){ge(e,n)}}}function P_(t){let e,i,n={onEvent:t[60],playerStyle:t[13],callToAction:t[25],skipButtonStyle:t[26],playlistStyle:"hide",playlistToggle:"hide",downloadFormats:t[50],playerTitle:t[24],fixedPosition:!t[14]&&t[33],fixedWidth:t[34],content:t[51],contentIndex:t[7],duration:t[31],currentTime:t[11],playbackState:t[12],playbackRate:t[32],playbackRates:t[54],activeAdvert:t[63],persistentAdvert:t[74],companionAdvert:t[59],textColor:t[35],backgroundColor:t[36],iconColor:t[37],videoTextColor:t[38],videoBackgroundColor:t[55],videoIconColor:t[39],logoIconEnabled:t[40],logoImagePosition:t[58],videoPosterImage:t[69],videoIsBehind:t[66]};return e=new Xs({props:n}),t[115](e),{c(){me(e.$$.fragment)},m(o,s){de(e,o,s),i=!0},p(o,s){const l={};s[0]&8192&&(l.playerStyle=o[13]),s[0]&33554432&&(l.callToAction=o[25]),s[0]&67108864&&(l.skipButtonStyle=o[26]),s[1]&524288&&(l.downloadFormats=o[50]),s[0]&16777216&&(l.playerTitle=o[24]),s[0]&16384|s[1]&4&&(l.fixedPosition=!o[14]&&o[33]),s[1]&8&&(l.fixedWidth=o[34]),s[1]&1048576&&(l.content=o[51]),s[0]&128&&(l.contentIndex=o[7]),s[1]&1&&(l.duration=o[31]),s[0]&2048&&(l.currentTime=o[11]),s[0]&4096&&(l.playbackState=o[12]),s[1]&2&&(l.playbackRate=o[32]),s[1]&8388608&&(l.playbackRates=o[54]),s[2]&2&&(l.activeAdvert=o[63]),s[2]&4096&&(l.persistentAdvert=o[74]),s[1]&268435456&&(l.companionAdvert=o[59]),s[1]&16&&(l.textColor=o[35]),s[1]&32&&(l.backgroundColor=o[36]),s[1]&64&&(l.iconColor=o[37]),s[1]&128&&(l.videoTextColor=o[38]),s[1]&16777216&&(l.videoBackgroundColor=o[55]),s[1]&256&&(l.videoIconColor=o[39]),s[1]&512&&(l.logoIconEnabled=o[40]),s[1]&134217728&&(l.logoImagePosition=o[58]),s[2]&128&&(l.videoPosterImage=o[69]),s[2]&16&&(l.videoIsBehind=o[66]),e.$set(l)},i(o){i||(B(e.$$.fragment,o),i=!0)},o(o){z(e.$$.fragment,o),i=!1},d(o){t[115](null),ge(e,o)}}}function C_(t){let e,i;return e=new Xs({props:{onEvent:t[116],playerStyle:"small",fixedWidth:0,logoIconEnabled:!1,content:t[51],contentIndex:t[7],duration:t[31],currentTime:t[68]?t[11]:t[61].startTime,playbackState:t[68]?t[12]:"paused",activeAdvert:t[63],persistentAdvert:t[74],companionAdvert:t[59],textColor:t[35],backgroundColor:t[36],iconColor:t[37],videoTextColor:t[38],videoBackgroundColor:t[55],videoIconColor:t[39]}}),{c(){me(e.$$.fragment)},m(n,o){de(e,n,o),i=!0},p(n,o){const s={};o[1]&1073741824|o[2]&4&&(s.onEvent=n[116]),o[1]&1048576&&(s.content=n[51]),o[0]&128&&(s.contentIndex=n[7]),o[1]&1&&(s.duration=n[31]),o[0]&2048|o[1]&1073741824|o[2]&64&&(s.currentTime=n[68]?n[11]:n[61].startTime),o[0]&4096|o[2]&64&&(s.playbackState=n[68]?n[12]:"paused"),o[2]&2&&(s.activeAdvert=n[63]),o[2]&4096&&(s.persistentAdvert=n[74]),o[1]&268435456&&(s.companionAdvert=n[59]),o[1]&16&&(s.textColor=n[35]),o[1]&32&&(s.backgroundColor=n[36]),o[1]&64&&(s.iconColor=n[37]),o[1]&128&&(s.videoTextColor=n[38]),o[1]&16777216&&(s.videoBackgroundColor=n[55]),o[1]&256&&(s.videoIconColor=n[39]),e.$set(s)},i(n){i||(B(e.$$.fragment,n),i=!0)},o(n){z(e.$$.fragment,n),i=!1},d(n){ge(e,n)}}}function cr(t,e){let i,n,o;return n=new Ko({props:{root:e[162],$$slots:{default:[C_]},$$scope:{ctx:e}}}),{key:t,first:null,c(){i=xi(),me(n.$$.fragment),this.first=i},m(s,l){E(s,i,l),de(n,s,l),o=!0},p(s,l){e=s;const a={};l[1]&262144&&(a.root=e[162]),l[0]&6272|l[1]&1360003569|l[2]&4166|l[5]&1024&&(a.$$scope={dirty:l,ctx:e}),n.$set(a)},i(s){o||(B(n.$$.fragment,s),o=!0)},o(s){z(n.$$.fragment,s),o=!1},d(s){s&&O(i),ge(n,s)}}}function dr(t){let e,i;return e=new Ko({props:{root:t[22],$$slots:{default:[A_]},$$scope:{ctx:t}}}),{c(){me(e.$$.fragment)},m(n,o){de(e,n,o),i=!0},p(n,o){const s={};o[0]&4194304&&(s.root=n[22]),o[0]&2134900735|o[1]&7356415|o[5]&1024&&(s.$$scope={dirty:o,ctx:n}),e.$set(s)},i(n){i||(B(e.$$.fragment,n),i=!0)},o(n){z(e.$$.fragment,n),i=!1},d(n){ge(e,n)}}}function A_(t){let e,i,n,o,s,l,a,r,u,c,g,v,_,m,w,y,A,S,C,T,I,M,R,G,F,q,ae,ce,se,ee,$,re,fe,Z,J,ie,b,P,j,L,Ce,We,He,K,Te;function Ye(k){t[117](k)}function it(k){t[118](k)}function at(k){t[119](k)}function wt(k){t[120](k)}function dt(k){t[121](k)}function Ge(k){t[122](k)}function xe(k){t[123](k)}function Ue(k){t[124](k)}function mt(k){t[125](k)}function Ne(k){t[126](k)}function rt(k){t[127](k)}function nt(k){t[128](k)}function Fe(k){t[129](k)}function Lt(k){t[130](k)}function $e(k){t[131](k)}function Ve(k){t[132](k)}function Oe(k){t[133](k)}function et(k){t[134](k)}function ot(k){t[135](k)}function ut(k){t[136](k)}function qe(k){t[137](k)}function It(k){t[138](k)}function ht(k){t[139](k)}function _t(k){t[140](k)}function Ze(k){t[141](k)}function Ke(k){t[142](k)}function st(k){t[143](k)}function Y(k){t[144](k)}function ze(k){t[145](k)}function Le(k){t[146](k)}function yt(k){t[147](k)}function Tt(k){t[148](k)}function Je(k){t[149](k)}function Xe(k){t[150](k)}function Wt(k){t[151](k)}function ct(k){t[152](k)}function Pt(k){t[153](k)}function gt(k){t[154](k)}function Dt(k){t[155](k)}function Rt(k){t[156](k)}function Nt(k){t[157](k)}function Bt(k){t[158](k)}function vt(k){t[159](k)}let _e={content:t[51],introsOutros:t[52],adverts:t[53]};return t[0]!==void 0&&(_e.projectId=t[0]),t[1]!==void 0&&(_e.contentId=t[1]),t[2]!==void 0&&(_e.playlistId=t[2]),t[3]!==void 0&&(_e.sourceId=t[3]),t[4]!==void 0&&(_e.sourceUrl=t[4]),t[5]!==void 0&&(_e.showUserInterface=t[5]),t[6]!==void 0&&(_e.playerStyle=t[6]),t[24]!==void 0&&(_e.playerTitle=t[24]),t[25]!==void 0&&(_e.callToAction=t[25]),t[26]!==void 0&&(_e.skipButtonStyle=t[26]),t[27]!==void 0&&(_e.playlistStyle=t[27]),t[28]!==void 0&&(_e.playlistToggle=t[28]),t[29]!==void 0&&(_e.mediaSession=t[29]),t[7]!==void 0&&(_e.contentIndex=t[7]),t[8]!==void 0&&(_e.introsOutrosIndex=t[8]),t[9]!==void 0&&(_e.advertIndex=t[9]),t[30]!==void 0&&(_e.persistentAdImage=t[30]),t[10]!==void 0&&(_e.persistentIndex=t[10]),t[31]!==void 0&&(_e.duration=t[31]),t[11]!==void 0&&(_e.currentTime=t[11]),t[12]!==void 0&&(_e.playbackState=t[12]),t[32]!==void 0&&(_e.playbackRate=t[32]),t[13]!==void 0&&(_e.widgetStyle=t[13]),t[33]!==void 0&&(_e.widgetPosition=t[33]),t[34]!==void 0&&(_e.widgetWidth=t[34]),t[14]!==void 0&&(_e.widgetTarget=t[14]),t[35]!==void 0&&(_e.textColor=t[35]),t[36]!==void 0&&(_e.backgroundColor=t[36]),t[37]!==void 0&&(_e.iconColor=t[37]),t[15]!==void 0&&(_e.highlightColor=t[15]),t[38]!==void 0&&(_e.videoTextColor=t[38]),t[39]!==void 0&&(_e.videoIconColor=t[39]),t[40]!==void 0&&(_e.logoIconEnabled=t[40]),t[16]!==void 0&&(_e.highlightSections=t[16]),t[17]!==void 0&&(_e.clickableSections=t[17]),t[18]!==void 0&&(_e.segmentWidgetSections=t[18]),t[19]!==void 0&&(_e.segmentWidgetPosition=t[19]),t[20]!==void 0&&(_e.currentSegment=t[20]),t[21]!==void 0&&(_e.hoveredSegment=t[21]),t[41]!==void 0&&(_e.advertConsent=t[41]),t[42]!==void 0&&(_e.analyticsConsent=t[42]),t[43]!==void 0&&(_e.analyticsCustomUrl=t[43]),t[44]!==void 0&&(_e.analyticsTag=t[44]),e=new x0({props:_e}),oe.push(()=>be(e,"projectId",Ye)),oe.push(()=>be(e,"contentId",it)),oe.push(()=>be(e,"playlistId",at)),oe.push(()=>be(e,"sourceId",wt)),oe.push(()=>be(e,"sourceUrl",dt)),oe.push(()=>be(e,"showUserInterface",Ge)),oe.push(()=>be(e,"playerStyle",xe)),oe.push(()=>be(e,"playerTitle",Ue)),oe.push(()=>be(e,"callToAction",mt)),oe.push(()=>be(e,"skipButtonStyle",Ne)),oe.push(()=>be(e,"playlistStyle",rt)),oe.push(()=>be(e,"playlistToggle",nt)),oe.push(()=>be(e,"mediaSession",Fe)),oe.push(()=>be(e,"contentIndex",Lt)),oe.push(()=>be(e,"introsOutrosIndex",$e)),oe.push(()=>be(e,"advertIndex",Ve)),oe.push(()=>be(e,"persistentAdImage",Oe)),oe.push(()=>be(e,"persistentIndex",et)),oe.push(()=>be(e,"duration",ot)),oe.push(()=>be(e,"currentTime",ut)),oe.push(()=>be(e,"playbackState",qe)),oe.push(()=>be(e,"playbackRate",It)),oe.push(()=>be(e,"widgetStyle",ht)),oe.push(()=>be(e,"widgetPosition",_t)),oe.push(()=>be(e,"widgetWidth",Ze)),oe.push(()=>be(e,"widgetTarget",Ke)),oe.push(()=>be(e,"textColor",st)),oe.push(()=>be(e,"backgroundColor",Y)),oe.push(()=>be(e,"iconColor",ze)),oe.push(()=>be(e,"highlightColor",Le)),oe.push(()=>be(e,"videoTextColor",yt)),oe.push(()=>be(e,"videoIconColor",Tt)),oe.push(()=>be(e,"logoIconEnabled",Je)),oe.push(()=>be(e,"highlightSections",Xe)),oe.push(()=>be(e,"clickableSections",Wt)),oe.push(()=>be(e,"segmentWidgetSections",ct)),oe.push(()=>be(e,"segmentWidgetPosition",Pt)),oe.push(()=>be(e,"currentSegment",gt)),oe.push(()=>be(e,"hoveredSegment",Dt)),oe.push(()=>be(e,"advertConsent",Rt)),oe.push(()=>be(e,"analyticsConsent",Nt)),oe.push(()=>be(e,"analyticsCustomUrl",Bt)),oe.push(()=>be(e,"analyticsTag",vt)),{c(){me(e.$$.fragment)},m(k,V){de(e,k,V),Te=!0},p(k,V){const ue={};V[1]&1048576&&(ue.content=k[51]),V[1]&2097152&&(ue.introsOutros=k[52]),V[1]&4194304&&(ue.adverts=k[53]),!i&&V[0]&1&&(i=!0,ue.projectId=k[0],ve(()=>i=!1)),!n&&V[0]&2&&(n=!0,ue.contentId=k[1],ve(()=>n=!1)),!o&&V[0]&4&&(o=!0,ue.playlistId=k[2],ve(()=>o=!1)),!s&&V[0]&8&&(s=!0,ue.sourceId=k[3],ve(()=>s=!1)),!l&&V[0]&16&&(l=!0,ue.sourceUrl=k[4],ve(()=>l=!1)),!a&&V[0]&32&&(a=!0,ue.showUserInterface=k[5],ve(()=>a=!1)),!r&&V[0]&64&&(r=!0,ue.playerStyle=k[6],ve(()=>r=!1)),!u&&V[0]&16777216&&(u=!0,ue.playerTitle=k[24],ve(()=>u=!1)),!c&&V[0]&33554432&&(c=!0,ue.callToAction=k[25],ve(()=>c=!1)),!g&&V[0]&67108864&&(g=!0,ue.skipButtonStyle=k[26],ve(()=>g=!1)),!v&&V[0]&134217728&&(v=!0,ue.playlistStyle=k[27],ve(()=>v=!1)),!_&&V[0]&268435456&&(_=!0,ue.playlistToggle=k[28],ve(()=>_=!1)),!m&&V[0]&536870912&&(m=!0,ue.mediaSession=k[29],ve(()=>m=!1)),!w&&V[0]&128&&(w=!0,ue.contentIndex=k[7],ve(()=>w=!1)),!y&&V[0]&256&&(y=!0,ue.introsOutrosIndex=k[8],ve(()=>y=!1)),!A&&V[0]&512&&(A=!0,ue.advertIndex=k[9],ve(()=>A=!1)),!S&&V[0]&1073741824&&(S=!0,ue.persistentAdImage=k[30],ve(()=>S=!1)),!C&&V[0]&1024&&(C=!0,ue.persistentIndex=k[10],ve(()=>C=!1)),!T&&V[1]&1&&(T=!0,ue.duration=k[31],ve(()=>T=!1)),!I&&V[0]&2048&&(I=!0,ue.currentTime=k[11],ve(()=>I=!1)),!M&&V[0]&4096&&(M=!0,ue.playbackState=k[12],ve(()=>M=!1)),!R&&V[1]&2&&(R=!0,ue.playbackRate=k[32],ve(()=>R=!1)),!G&&V[0]&8192&&(G=!0,ue.widgetStyle=k[13],ve(()=>G=!1)),!F&&V[1]&4&&(F=!0,ue.widgetPosition=k[33],ve(()=>F=!1)),!q&&V[1]&8&&(q=!0,ue.widgetWidth=k[34],ve(()=>q=!1)),!ae&&V[0]&16384&&(ae=!0,ue.widgetTarget=k[14],ve(()=>ae=!1)),!ce&&V[1]&16&&(ce=!0,ue.textColor=k[35],ve(()=>ce=!1)),!se&&V[1]&32&&(se=!0,ue.backgroundColor=k[36],ve(()=>se=!1)),!ee&&V[1]&64&&(ee=!0,ue.iconColor=k[37],ve(()=>ee=!1)),!$&&V[0]&32768&&($=!0,ue.highlightColor=k[15],ve(()=>$=!1)),!re&&V[1]&128&&(re=!0,ue.videoTextColor=k[38],ve(()=>re=!1)),!fe&&V[1]&256&&(fe=!0,ue.videoIconColor=k[39],ve(()=>fe=!1)),!Z&&V[1]&512&&(Z=!0,ue.logoIconEnabled=k[40],ve(()=>Z=!1)),!J&&V[0]&65536&&(J=!0,ue.highlightSections=k[16],ve(()=>J=!1)),!ie&&V[0]&131072&&(ie=!0,ue.clickableSections=k[17],ve(()=>ie=!1)),!b&&V[0]&262144&&(b=!0,ue.segmentWidgetSections=k[18],ve(()=>b=!1)),!P&&V[0]&524288&&(P=!0,ue.segmentWidgetPosition=k[19],ve(()=>P=!1)),!j&&V[0]&1048576&&(j=!0,ue.currentSegment=k[20],ve(()=>j=!1)),!L&&V[0]&2097152&&(L=!0,ue.hoveredSegment=k[21],ve(()=>L=!1)),!Ce&&V[1]&1024&&(Ce=!0,ue.advertConsent=k[41],ve(()=>Ce=!1)),!We&&V[1]&2048&&(We=!0,ue.analyticsConsent=k[42],ve(()=>We=!1)),!He&&V[1]&4096&&(He=!0,ue.analyticsCustomUrl=k[43],ve(()=>He=!1)),!K&&V[1]&8192&&(K=!0,ue.analyticsTag=k[44],ve(()=>K=!1)),e.$set(ue)},i(k){Te||(B(e.$$.fragment,k),Te=!0)},o(k){z(e.$$.fragment,k),Te=!1},d(k){ge(e,k)}}}function gr(t){let e,i;return e=new $0({props:{onEvent:t[60],content:t[51],contentIndex:t[7],activeAdvert:t[63],persistentAdvert:t[74],companionAdvert:t[59],duration:t[31],playbackState:t[12],skipButtonStyle:t[26],backgroundColor:t[36],iconColor:t[37]}}),{c(){me(e.$$.fragment)},m(n,o){de(e,n,o),i=!0},p(n,o){const s={};o[1]&1048576&&(s.content=n[51]),o[0]&128&&(s.contentIndex=n[7]),o[2]&2&&(s.activeAdvert=n[63]),o[2]&4096&&(s.persistentAdvert=n[74]),o[1]&268435456&&(s.companionAdvert=n[59]),o[1]&1&&(s.duration=n[31]),o[0]&4096&&(s.playbackState=n[12]),o[0]&67108864&&(s.skipButtonStyle=n[26]),o[1]&32&&(s.backgroundColor=n[36]),o[1]&64&&(s.iconColor=n[37]),e.$set(s)},i(n){i||(B(e.$$.fragment,n),i=!0)},o(n){z(e.$$.fragment,n),i=!1},d(n){ge(e,n)}}}function fr(t){let e,i;return e=new o_({props:{analyticsTag:t[44]}}),{c(){me(e.$$.fragment)},m(n,o){de(e,n,o),i=!0},p(n,o){const s={};o[1]&8192&&(s.analyticsTag=n[44]),e.$set(s)},i(n){i||(B(e.$$.fragment,n),i=!0)},o(n){z(e.$$.fragment,n),i=!1},d(n){ge(e,n)}}}function I_(t){let e,i,n,o,s=[],l=new Map,a,r,u,c,g,v;e=new Ko({props:{prepend:!0,root:t[70],$$slots:{default:[T_]},$$scope:{ctx:t}}});let _=t[73]&&rr(t),m=t[72]&&ur(t),w=Gt(t[49]);const y=T=>T[162];for(let T=0;T<w.length;T+=1){let I=ar(t,w,T),M=y(I);l.set(M,s[T]=cr(M,I))}let A=t[22]&&dr(t),S=t[56]&&gr(t),C=t[44]&&fr(t);return g=new s_({}),{c(){me(e.$$.fragment),i=X(),_&&_.c(),n=X(),m&&m.c(),o=X();for(let T=0;T<s.length;T+=1)s[T].c();a=X(),A&&A.c(),r=X(),S&&S.c(),u=X(),C&&C.c(),c=X(),me(g.$$.fragment)},m(T,I){de(e,T,I),E(T,i,I),_&&_.m(T,I),E(T,n,I),m&&m.m(T,I),E(T,o,I);for(let M=0;M<s.length;M+=1)s[M]&&s[M].m(T,I);E(T,a,I),A&&A.m(T,I),E(T,r,I),S&&S.m(T,I),E(T,u,I),C&&C.m(T,I),E(T,c,I),de(g,T,I),v=!0},p(T,I){const M={};I[2]&256&&(M.root=T[70]),I[0]&8411296|I[1]&1197071|I[2]&539|I[5]&1024&&(M.$$scope={dirty:I,ctx:T}),e.$set(M),T[73]?_?(_.p(T,I),I[2]&2048&&B(_,1)):(_=rr(T),_.c(),B(_,1),_.m(n.parentNode,n)):_&&(De(),z(_,1,1,()=>{_=null}),Re()),T[72]?m?(m.p(T,I),I[2]&1024&&B(m,1)):(m=ur(T),m.c(),B(m,1),m.m(o.parentNode,o)):m&&(De(),z(m,1,1,()=>{m=null}),Re()),I[0]&6272|I[1]&1897136625|I[2]&4166&&(w=Gt(T[49]),De(),s=pu(s,I,y,1,T,w,l,a.parentNode,ku,cr,a,ar),Re()),T[22]?A?(A.p(T,I),I[0]&4194304&&B(A,1)):(A=dr(T),A.c(),B(A,1),A.m(r.parentNode,r)):A&&(De(),z(A,1,1,()=>{A=null}),Re()),T[56]?S?(S.p(T,I),I[1]&33554432&&B(S,1)):(S=gr(T),S.c(),B(S,1),S.m(u.parentNode,u)):S&&(De(),z(S,1,1,()=>{S=null}),Re()),T[44]?C?(C.p(T,I),I[1]&8192&&B(C,1)):(C=fr(T),C.c(),B(C,1),C.m(c.parentNode,c)):C&&(De(),z(C,1,1,()=>{C=null}),Re())},i(T){if(!v){B(e.$$.fragment,T),B(_),B(m);for(let I=0;I<w.length;I+=1)B(s[I]);B(A),B(S),B(C),B(g.$$.fragment,T),v=!0}},o(T){z(e.$$.fragment,T),z(_),z(m);for(let I=0;I<s.length;I+=1)z(s[I]);z(A),z(S),z(C),z(g.$$.fragment,T),v=!1},d(T){T&&(O(i),O(n),O(o),O(a),O(r),O(u),O(c)),ge(e,T),_&&_.d(T),m&&m.d(T);for(let I=0;I<s.length;I+=1)s[I].d(T);A&&A.d(T),S&&S.d(T),C&&C.d(T),ge(g,T)}}}function B_(t,e,i){let n,o,s,l,a,r,u,c,g,v,_,m,w,y,A,S,C,T,I,M,R,G,F,{playerApiUrl:q="https://api.beyondwords.io/v1/projects/{id}/player"}=e,{projectId:ae=void 0}=e,{contentId:ce=void 0}=e,{playlistId:se=void 0}=e,{sourceId:ee=void 0}=e,{sourceUrl:$=void 0}=e,{playlist:re=[]}=e,{showUserInterface:fe=!0}=e,{showBottomWidget:Z=!1}=e,{playerStyle:J="standard"}=e,{playerTitle:ie=void 0}=e,{callToAction:b=void 0}=e,{skipButtonStyle:P="auto"}=e,{playlistStyle:j="auto-5-4"}=e,{playlistToggle:L="auto"}=e,{downloadFormats:Ce=[]}=e,{mediaSession:We="auto"}=e,{content:He=[]}=e,{contentIndex:K=0}=e,{introsOutros:Te=[]}=e,{introsOutrosIndex:Ye=-1}=e,{adverts:it=[]}=e,{advertIndex:at=-1}=e,{minDurationForMidroll:wt=2*60}=e,{minTimeUntilEndForMidroll:dt=10}=e,{persistentAdImage:Ge=!1}=e,{persistentIndex:xe=-1}=e,{duration:Ue=0}=e,{currentTime:mt=0}=e,{playbackState:Ne="stopped"}=e,{playbackRate:rt=1}=e,{playbackRates:nt=[.5,.6,.7,.8,.9,1,1.1,1.2,1.3,1.4,1.5,2,2.5,3]}=e,{widgetStyle:Fe="standard"}=e,{widgetPosition:Lt="auto"}=e,{widgetWidth:$e="auto"}=e,{widgetTarget:Ve=void 0}=e,{textColor:Oe="#111"}=e,{backgroundColor:et="#f5f5f5"}=e,{iconColor:ot="rgba(0, 0, 0, 0.8)"}=e,{highlightColor:ut="#eee"}=e,{videoTextColor:qe="white"}=e,{videoBackgroundColor:It="black"}=e,{videoIconColor:ht="white"}=e,{logoIconEnabled:_t=!0}=e,{highlightSections:Ze="all"}=e,{clickableSections:Ke="all"}=e,{segmentWidgetSections:st="body"}=e,{segmentWidgetPosition:Y="7-oclock"}=e,{currentSegment:ze=void 0}=e,{hoveredSegment:Le=void 0}=e,{loadedMedia:yt=void 0}=e,{advertConsent:Tt="personalized"}=e,{analyticsConsent:Je="allowed"}=e,{analyticsCustomUrl:Xe=void 0}=e,{analyticsDeviceType:Wt="auto"}=e,{analyticsTag:ct=void 0}=e,{writeToken:Pt=void 0}=e,{captureErrors:gt=!0}=e,{onError:Dt=()=>{}}=e,{transitions:Rt=[]}=e,{controlPanel:Nt=void 0}=e,{clientSideIntegration:Bt={}}=e;const vt=(...h)=>Ai.addEventListener(...h),_e=(...h)=>Ai.removeEventListener(...h);let{initialProps:k={}}=e,{showMediaSession:V=!1}=e,{metadataLoaded:ue=!1}=e,{isFullScreen:xt=!1}=e,{mediaElement:ei=void 0}=e,{userInterface:pi=void 0}=e,{widgetInterface:Ot=void 0}=e,{controller:Ai=void 0}=e,{logoImagePosition:ui=void 0}=e,{analyticsUrl:_n=void 0}=e,{analyticsId:bt=void 0}=e,{listenSessionId:Mi=void 0}=e,{sessionCreatedAt:ci=void 0}=e,{companionAdvert:ji=void 0}=e,{isNewListen:Mt=!1}=e,{prevPercentage:qt=0}=e,{segmentWidgets:Ii=[]}=e,{segmentContainers:jt=new nl(h=>i(49,Ii=h))}=e,{segmentClickables:Si=new tl}=e,{segmentHighlights:Ht=new ol}=e;const Xi=h=>Ai.processEvent(oi({emittedFrom:w},h)),ti=()=>i(100,T=Le);function yn(h){oe[h?"unshift":"push"](()=>{ei=h,i(45,ei)})}function Yt(h){Ne=h,i(12,Ne)}function di(h){Ue=h,i(31,Ue)}function kt(h){mt=h,i(11,mt)}function gi(h){rt=h,i(32,rt)}function pt(h){qt=h,i(48,qt)}function fi(h){ue=h,i(23,ue)}function zt(h){oe[h?"unshift":"push"](()=>{pi=h,i(46,pi)})}function D(h){oe[h?"unshift":"push"](()=>{Ot=h,i(47,Ot)})}const Q=h=>Xi(rn(oi({},h),{emittedFrom:"segment-widget",widgetSegment:R,widgetIsCurrent:G}));function le(h){ae=h,i(0,ae)}function ii(h){ce=h,i(1,ce)}function vn(h){se=h,i(2,se)}function bn(h){ee=h,i(3,ee)}function kn(h){$=h,i(4,$)}function pn(h){fe=h,i(5,fe)}function Ts(h){J=h,i(6,J)}function Bn(h){ie=h,i(24,ie)}function Ps(h){b=h,i(25,b)}function Ri(h){P=h,i(26,P)}function Cs(h){j=h,i(27,j)}function po(h){L=h,i(28,L)}function As(h){We=h,i(29,We)}function Is(h){K=h,i(7,K)}function So(h){Ye=h,i(8,Ye)}function Bs(h){at=h,i(9,at)}function Sn(h){Ge=h,i(30,Ge)}function ni(h){xe=h,i(10,xe)}function gl(h){Ue=h,i(31,Ue)}function Vn(h){mt=h,i(11,mt)}function li(h){Ne=h,i(12,Ne)}function Vs(h){rt=h,i(32,rt)}function Jn(h){Fe=h,i(13,Fe)}function zi(h){Lt=h,i(33,Lt)}function he(h){$e=h,i(34,$e)}function lt(h){Ve=h,i(14,Ve)}function St(h){Oe=h,i(35,Oe)}function Ws(h){et=h,i(36,et)}function Dy(h){ot=h,i(37,ot)}function Ry(h){ut=h,i(15,ut)}function Ny(h){qe=h,i(38,qe)}function xy(h){ht=h,i(39,ht)}function Uy(h){_t=h,i(40,_t)}function Fy(h){Ze=h,i(16,Ze)}function qy(h){Ke=h,i(17,Ke)}function Hy(h){st=h,i(18,st)}function Yy(h){Y=h,i(19,Y)}function Zy(h){ze=h,i(20,ze)}function Gy(h){Le=h,i(21,Le)}function Ky(h){Tt=h,i(41,Tt)}function Jy(h){Je=h,i(42,Je)}function Xy(h){Xe=h,i(43,Xe)}function Qy(h){ct=h,i(44,ct)}return t.$$set=h=>{"playerApiUrl"in h&&i(75,q=h.playerApiUrl),"projectId"in h&&i(0,ae=h.projectId),"contentId"in h&&i(1,ce=h.contentId),"playlistId"in h&&i(2,se=h.playlistId),"sourceId"in h&&i(3,ee=h.sourceId),"sourceUrl"in h&&i(4,$=h.sourceUrl),"playlist"in h&&i(76,re=h.playlist),"showUserInterface"in h&&i(5,fe=h.showUserInterface),"showBottomWidget"in h&&i(77,Z=h.showBottomWidget),"playerStyle"in h&&i(6,J=h.playerStyle),"playerTitle"in h&&i(24,ie=h.playerTitle),"callToAction"in h&&i(25,b=h.callToAction),"skipButtonStyle"in h&&i(26,P=h.skipButtonStyle),"playlistStyle"in h&&i(27,j=h.playlistStyle),"playlistToggle"in h&&i(28,L=h.playlistToggle),"downloadFormats"in h&&i(50,Ce=h.downloadFormats),"mediaSession"in h&&i(29,We=h.mediaSession),"content"in h&&i(51,He=h.content),"contentIndex"in h&&i(7,K=h.contentIndex),"introsOutros"in h&&i(52,Te=h.introsOutros),"introsOutrosIndex"in h&&i(8,Ye=h.introsOutrosIndex),"adverts"in h&&i(53,it=h.adverts),"advertIndex"in h&&i(9,at=h.advertIndex),"minDurationForMidroll"in h&&i(78,wt=h.minDurationForMidroll),"minTimeUntilEndForMidroll"in h&&i(79,dt=h.minTimeUntilEndForMidroll),"persistentAdImage"in h&&i(30,Ge=h.persistentAdImage),"persistentIndex"in h&&i(10,xe=h.persistentIndex),"duration"in h&&i(31,Ue=h.duration),"currentTime"in h&&i(11,mt=h.currentTime),"playbackState"in h&&i(12,Ne=h.playbackState),"playbackRate"in h&&i(32,rt=h.playbackRate),"playbackRates"in h&&i(54,nt=h.playbackRates),"widgetStyle"in h&&i(13,Fe=h.widgetStyle),"widgetPosition"in h&&i(33,Lt=h.widgetPosition),"widgetWidth"in h&&i(34,$e=h.widgetWidth),"widgetTarget"in h&&i(14,Ve=h.widgetTarget),"textColor"in h&&i(35,Oe=h.textColor),"backgroundColor"in h&&i(36,et=h.backgroundColor),"iconColor"in h&&i(37,ot=h.iconColor),"highlightColor"in h&&i(15,ut=h.highlightColor),"videoTextColor"in h&&i(38,qe=h.videoTextColor),"videoBackgroundColor"in h&&i(55,It=h.videoBackgroundColor),"videoIconColor"in h&&i(39,ht=h.videoIconColor),"logoIconEnabled"in h&&i(40,_t=h.logoIconEnabled),"highlightSections"in h&&i(16,Ze=h.highlightSections),"clickableSections"in h&&i(17,Ke=h.clickableSections),"segmentWidgetSections"in h&&i(18,st=h.segmentWidgetSections),"segmentWidgetPosition"in h&&i(19,Y=h.segmentWidgetPosition),"currentSegment"in h&&i(20,ze=h.currentSegment),"hoveredSegment"in h&&i(21,Le=h.hoveredSegment),"loadedMedia"in h&&i(80,yt=h.loadedMedia),"advertConsent"in h&&i(41,Tt=h.advertConsent),"analyticsConsent"in h&&i(42,Je=h.analyticsConsent),"analyticsCustomUrl"in h&&i(43,Xe=h.analyticsCustomUrl),"analyticsDeviceType"in h&&i(81,Wt=h.analyticsDeviceType),"analyticsTag"in h&&i(44,ct=h.analyticsTag),"writeToken"in h&&i(82,Pt=h.writeToken),"captureErrors"in h&&i(83,gt=h.captureErrors),"onError"in h&&i(84,Dt=h.onError),"transitions"in h&&i(85,Rt=h.transitions),"controlPanel"in h&&i(22,Nt=h.controlPanel),"clientSideIntegration"in h&&i(86,Bt=h.clientSideIntegration),"initialProps"in h&&i(89,k=h.initialProps),"showMediaSession"in h&&i(56,V=h.showMediaSession),"metadataLoaded"in h&&i(23,ue=h.metadataLoaded),"isFullScreen"in h&&i(57,xt=h.isFullScreen),"mediaElement"in h&&i(45,ei=h.mediaElement),"userInterface"in h&&i(46,pi=h.userInterface),"widgetInterface"in h&&i(47,Ot=h.widgetInterface),"controller"in h&&i(90,Ai=h.controller),"logoImagePosition"in h&&i(58,ui=h.logoImagePosition),"analyticsUrl"in h&&i(91,_n=h.analyticsUrl),"analyticsId"in h&&i(92,bt=h.analyticsId),"listenSessionId"in h&&i(93,Mi=h.listenSessionId),"sessionCreatedAt"in h&&i(94,ci=h.sessionCreatedAt),"companionAdvert"in h&&i(59,ji=h.companionAdvert),"isNewListen"in h&&i(95,Mt=h.isNewListen),"prevPercentage"in h&&i(48,qt=h.prevPercentage),"segmentWidgets"in h&&i(49,Ii=h.segmentWidgets),"segmentContainers"in h&&i(96,jt=h.segmentContainers),"segmentClickables"in h&&i(97,Si=h.segmentClickables),"segmentHighlights"in h&&i(98,Ht=h.segmentHighlights)},t.$$.update=()=>{t.$$.dirty[0]&128|t.$$.dirty[1]&1048576&&i(102,n=He[K]),t.$$.dirty[0]&256|t.$$.dirty[1]&2097152&&i(62,o=Te[Ye]),t.$$.dirty[0]&512|t.$$.dirty[1]&4194304&&i(63,s=it[at]),t.$$.dirty[0]&1024|t.$$.dirty[1]&4194304&&i(74,l=it[xe]),t.$$.dirty[0]&4096|t.$$.dirty[2]&2&&i(103,a=s&&Ne!=="stopped"),t.$$.dirty[2]&262144&&i(105,r=(yt==null?void 0:yt.format)==="audio"),t.$$.dirty[0]&64|t.$$.dirty[1]&67108864&&i(67,u=xt?"video":J),t.$$.dirty[0]&16384&&i(14,Ve=ll(Ve,"widget")),t.$$.dirty[0]&16384|t.$$.dirty[2]&32768&&i(106,c=Z||Ve),t.$$.dirty[0]&32|t.$$.dirty[1]&1048576|t.$$.dirty[2]&32&&i(73,g=fe&&al(u)&&He.length>0),t.$$.dirty[0]&8224|t.$$.dirty[1]&1048576|t.$$.dirty[3]&8192&&i(72,v=fe&&c&&al(Fe)&&He.length>0),t.$$.dirty[0]&4194304&&i(22,Nt=ll(Nt,"control panel")),t.$$.dirty[0]&8192|t.$$.dirty[1]&67108864|t.$$.dirty[3]&8192&&i(66,_=c&&Fe==="video"&&!xt),t.$$.dirty[2]&48&&i(71,m=u==="video"&&!_),t.$$.dirty[2]&16&&(w=_?"bottom-widget":"inline-player"),t.$$.dirty[0]&8256&&i(65,y=J==="video"||Fe==="video"),t.$$.dirty[0]&16384|t.$$.dirty[2]&16&&i(70,A=_?Ve:null),t.$$.dirty[0]&8388608|t.$$.dirty[2]&8|t.$$.dirty[3]&4096&&i(104,S=r&&y&&ue),t.$$.dirty[2]&2|t.$$.dirty[3]&3584&&i(69,C=S?a&&(s==null?void 0:s.imageUrl)||(n==null?void 0:n.imageUrl):""),t.$$.dirty[0]&31|t.$$.dirty[2]&16384&&Xi(l_()),t.$$.dirty[0]&1|t.$$.dirty[2]&1056768&&u_(q,ae,Pt,h=>Xi(h)),t.$$.dirty[0]&2097152|t.$$.dirty[3]&128&&i(100,T=Le||T),t.$$.dirty[0]&1310720&&i(99,I=ro("current",ze,st)),t.$$.dirty[0]&1048576|t.$$.dirty[3]&64&&I&&ti(),t.$$.dirty[0]&262144|t.$$.dirty[3]&128&&i(101,M=ro("hovered",T,st)),t.$$.dirty[0]&1048576|t.$$.dirty[3]&448&&i(61,R=M&&T||I&&ze),t.$$.dirty[0]&1048576|t.$$.dirty[1]&1073741824&&i(64,G=(R==null?void 0:R.marker)===(ze==null?void 0:ze.marker)),t.$$.dirty[2]&7&&i(68,F=G||s||o),t.$$.dirty[0]&786496|t.$$.dirty[1]&1073741824|t.$$.dirty[3]&8&&jt.update(R,st,Y,J),t.$$.dirty[0]&2228224|t.$$.dirty[3]&16&&Si.update(Le,Ke),t.$$.dirty[0]&1146880|t.$$.dirty[3]&32&&Ht.update("current",ze,Ze,ut),t.$$.dirty[0]&2195456|t.$$.dirty[3]&32&&Ht.update("hovered",Le,Ze,ut),t.$$.dirty[0]&2048|t.$$.dirty[2]&276824064&&h_(Rt,Ai,mt)},[ae,ce,se,ee,$,fe,J,K,Ye,at,xe,mt,Ne,Fe,Ve,ut,Ze,Ke,st,Y,ze,Le,Nt,ue,ie,b,P,j,L,We,Ge,Ue,rt,Lt,$e,Oe,et,ot,qe,ht,_t,Tt,Je,Xe,ct,ei,pi,Ot,qt,Ii,Ce,He,Te,it,nt,It,V,xt,ui,ji,Xi,R,o,s,G,y,_,u,F,C,A,m,v,g,l,q,re,Z,wt,dt,yt,Wt,Pt,gt,Dt,Rt,Bt,vt,_e,k,Ai,_n,bt,Mi,ci,Mt,jt,Si,Ht,I,T,M,n,a,S,r,c,yn,Yt,di,kt,gi,pt,fi,zt,D,Q,le,ii,vn,bn,kn,pn,Ts,Bn,Ps,Ri,Cs,po,As,Is,So,Bs,Sn,ni,gl,Vn,li,Vs,Jn,zi,he,lt,St,Ws,Dy,Ry,Ny,xy,Uy,Fy,qy,Hy,Yy,Zy,Gy,Ky,Jy,Xy,Qy]}let V_=class extends we{constructor(e){super(),Se(this,e,B_,I_,ke,{playerApiUrl:75,projectId:0,contentId:1,playlistId:2,sourceId:3,sourceUrl:4,playlist:76,showUserInterface:5,showBottomWidget:77,playerStyle:6,playerTitle:24,callToAction:25,skipButtonStyle:26,playlistStyle:27,playlistToggle:28,downloadFormats:50,mediaSession:29,content:51,contentIndex:7,introsOutros:52,introsOutrosIndex:8,adverts:53,advertIndex:9,minDurationForMidroll:78,minTimeUntilEndForMidroll:79,persistentAdImage:30,persistentIndex:10,duration:31,currentTime:11,playbackState:12,playbackRate:32,playbackRates:54,widgetStyle:13,widgetPosition:33,widgetWidth:34,widgetTarget:14,textColor:35,backgroundColor:36,iconColor:37,highlightColor:15,videoTextColor:38,videoBackgroundColor:55,videoIconColor:39,logoIconEnabled:40,highlightSections:16,clickableSections:17,segmentWidgetSections:18,segmentWidgetPosition:19,currentSegment:20,hoveredSegment:21,loadedMedia:80,advertConsent:41,analyticsConsent:42,analyticsCustomUrl:43,analyticsDeviceType:81,analyticsTag:44,writeToken:82,captureErrors:83,onError:84,transitions:85,controlPanel:22,clientSideIntegration:86,addEventListener:87,removeEventListener:88,initialProps:89,showMediaSession:56,metadataLoaded:23,isFullScreen:57,mediaElement:45,userInterface:46,widgetInterface:47,controller:90,logoImagePosition:58,analyticsUrl:91,analyticsId:92,listenSessionId:93,sessionCreatedAt:94,companionAdvert:59,isNewListen:95,prevPercentage:48,segmentWidgets:49,segmentContainers:96,segmentClickables:97,segmentHighlights:98,onEvent:60},null,[-1,-1,-1,-1,-1,-1])}get playerApiUrl(){return this.$$.ctx[75]}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[76]}set playlist(e){this.$$set({playlist:e}),d()}get showUserInterface(){return this.$$.ctx[5]}set showUserInterface(e){this.$$set({showUserInterface:e}),d()}get showBottomWidget(){return this.$$.ctx[77]}set showBottomWidget(e){this.$$set({showBottomWidget:e}),d()}get playerStyle(){return this.$$.ctx[6]}set playerStyle(e){this.$$set({playerStyle:e}),d()}get playerTitle(){return this.$$.ctx[24]}set playerTitle(e){this.$$set({playerTitle:e}),d()}get callToAction(){return this.$$.ctx[25]}set callToAction(e){this.$$set({callToAction:e}),d()}get skipButtonStyle(){return this.$$.ctx[26]}set skipButtonStyle(e){this.$$set({skipButtonStyle:e}),d()}get playlistStyle(){return this.$$.ctx[27]}set playlistStyle(e){this.$$set({playlistStyle:e}),d()}get playlistToggle(){return this.$$.ctx[28]}set playlistToggle(e){this.$$set({playlistToggle:e}),d()}get downloadFormats(){return this.$$.ctx[50]}set downloadFormats(e){this.$$set({downloadFormats:e}),d()}get mediaSession(){return this.$$.ctx[29]}set mediaSession(e){this.$$set({mediaSession:e}),d()}get content(){return this.$$.ctx[51]}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[52]}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[53]}set adverts(e){this.$$set({adverts:e}),d()}get advertIndex(){return this.$$.ctx[9]}set advertIndex(e){this.$$set({advertIndex:e}),d()}get minDurationForMidroll(){return this.$$.ctx[78]}set minDurationForMidroll(e){this.$$set({minDurationForMidroll:e}),d()}get minTimeUntilEndForMidroll(){return this.$$.ctx[79]}set minTimeUntilEndForMidroll(e){this.$$set({minTimeUntilEndForMidroll:e}),d()}get persistentAdImage(){return this.$$.ctx[30]}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[31]}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[12]}set playbackState(e){this.$$set({playbackState:e}),d()}get playbackRate(){return this.$$.ctx[32]}set playbackRate(e){this.$$set({playbackRate:e}),d()}get playbackRates(){return this.$$.ctx[54]}set playbackRates(e){this.$$set({playbackRates:e}),d()}get widgetStyle(){return this.$$.ctx[13]}set widgetStyle(e){this.$$set({widgetStyle:e}),d()}get widgetPosition(){return this.$$.ctx[33]}set widgetPosition(e){this.$$set({widgetPosition:e}),d()}get widgetWidth(){return this.$$.ctx[34]}set widgetWidth(e){this.$$set({widgetWidth:e}),d()}get widgetTarget(){return this.$$.ctx[14]}set widgetTarget(e){this.$$set({widgetTarget:e}),d()}get textColor(){return this.$$.ctx[35]}set textColor(e){this.$$set({textColor:e}),d()}get backgroundColor(){return this.$$.ctx[36]}set backgroundColor(e){this.$$set({backgroundColor:e}),d()}get iconColor(){return this.$$.ctx[37]}set iconColor(e){this.$$set({iconColor:e}),d()}get highlightColor(){return this.$$.ctx[15]}set highlightColor(e){this.$$set({highlightColor:e}),d()}get videoTextColor(){return this.$$.ctx[38]}set videoTextColor(e){this.$$set({videoTextColor:e}),d()}get videoBackgroundColor(){return this.$$.ctx[55]}set videoBackgroundColor(e){this.$$set({videoBackgroundColor:e}),d()}get videoIconColor(){return this.$$.ctx[39]}set videoIconColor(e){this.$$set({videoIconColor:e}),d()}get logoIconEnabled(){return this.$$.ctx[40]}set logoIconEnabled(e){this.$$set({logoIconEnabled:e}),d()}get highlightSections(){return this.$$.ctx[16]}set highlightSections(e){this.$$set({highlightSections:e}),d()}get clickableSections(){return this.$$.ctx[17]}set clickableSections(e){this.$$set({clickableSections:e}),d()}get segmentWidgetSections(){return this.$$.ctx[18]}set segmentWidgetSections(e){this.$$set({segmentWidgetSections:e}),d()}get segmentWidgetPosition(){return this.$$.ctx[19]}set segmentWidgetPosition(e){this.$$set({segmentWidgetPosition:e}),d()}get currentSegment(){return this.$$.ctx[20]}set currentSegment(e){this.$$set({currentSegment:e}),d()}get hoveredSegment(){return this.$$.ctx[21]}set hoveredSegment(e){this.$$set({hoveredSegment:e}),d()}get loadedMedia(){return this.$$.ctx[80]}set loadedMedia(e){this.$$set({loadedMedia:e}),d()}get advertConsent(){return this.$$.ctx[41]}set advertConsent(e){this.$$set({advertConsent:e}),d()}get analyticsConsent(){return this.$$.ctx[42]}set analyticsConsent(e){this.$$set({analyticsConsent:e}),d()}get analyticsCustomUrl(){return this.$$.ctx[43]}set analyticsCustomUrl(e){this.$$set({analyticsCustomUrl:e}),d()}get analyticsDeviceType(){return this.$$.ctx[81]}set analyticsDeviceType(e){this.$$set({analyticsDeviceType:e}),d()}get analyticsTag(){return this.$$.ctx[44]}set analyticsTag(e){this.$$set({analyticsTag:e}),d()}get writeToken(){return this.$$.ctx[82]}set writeToken(e){this.$$set({writeToken:e}),d()}get captureErrors(){return this.$$.ctx[83]}set captureErrors(e){this.$$set({captureErrors:e}),d()}get onError(){return this.$$.ctx[84]}set onError(e){this.$$set({onError:e}),d()}get transitions(){return this.$$.ctx[85]}set transitions(e){this.$$set({transitions:e}),d()}get controlPanel(){return this.$$.ctx[22]}set controlPanel(e){this.$$set({controlPanel:e}),d()}get clientSideIntegration(){return this.$$.ctx[86]}set clientSideIntegration(e){this.$$set({clientSideIntegration:e}),d()}get addEventListener(){return this.$$.ctx[87]}get removeEventListener(){return this.$$.ctx[88]}get initialProps(){return this.$$.ctx[89]}set initialProps(e){this.$$set({initialProps:e}),d()}get showMediaSession(){return this.$$.ctx[56]}set showMediaSession(e){this.$$set({showMediaSession:e}),d()}get metadataLoaded(){return this.$$.ctx[23]}set metadataLoaded(e){this.$$set({metadataLoaded:e}),d()}get isFullScreen(){return this.$$.ctx[57]}set isFullScreen(e){this.$$set({isFullScreen:e}),d()}get mediaElement(){return this.$$.ctx[45]}set mediaElement(e){this.$$set({mediaElement:e}),d()}get userInterface(){return this.$$.ctx[46]}set userInterface(e){this.$$set({userInterface:e}),d()}get widgetInterface(){return this.$$.ctx[47]}set widgetInterface(e){this.$$set({widgetInterface:e}),d()}get controller(){return this.$$.ctx[90]}set controller(e){this.$$set({controller:e}),d()}get logoImagePosition(){return this.$$.ctx[58]}set logoImagePosition(e){this.$$set({logoImagePosition:e}),d()}get analyticsUrl(){return this.$$.ctx[91]}set analyticsUrl(e){this.$$set({analyticsUrl:e}),d()}get analyticsId(){return this.$$.ctx[92]}set analyticsId(e){this.$$set({analyticsId:e}),d()}get listenSessionId(){return this.$$.ctx[93]}set listenSessionId(e){this.$$set({listenSessionId:e}),d()}get sessionCreatedAt(){return this.$$.ctx[94]}set sessionCreatedAt(e){this.$$set({sessionCreatedAt:e}),d()}get companionAdvert(){return this.$$.ctx[59]}set companionAdvert(e){this.$$set({companionAdvert:e}),d()}get isNewListen(){return this.$$.ctx[95]}set isNewListen(e){this.$$set({isNewListen:e}),d()}get prevPercentage(){return this.$$.ctx[48]}set prevPercentage(e){this.$$set({prevPercentage:e}),d()}get segmentWidgets(){return this.$$.ctx[49]}set segmentWidgets(e){this.$$set({segmentWidgets:e}),d()}get segmentContainers(){return this.$$.ctx[96]}set segmentContainers(e){this.$$set({segmentContainers:e}),d()}get segmentClickables(){return this.$$.ctx[97]}set segmentClickables(e){this.$$set({segmentClickables:e}),d()}get segmentHighlights(){return this.$$.ctx[98]}set segmentHighlights(e){this.$$set({segmentHighlights:e}),d()}get onEvent(){return this.$$.ctx[60]}};class W_{constructor(e,i,n){Ae(this,mn);this.baseUrl=e==null?void 0:e.replace("{id}",i),this.headers={"X-Referer":window.location.href,"X-Import":n==null?void 0:n.enabled,"X-Author":n==null?void 0:n.contentAuthor,"X-Title":n==null?void 0:n.contentTitle,"X-Publish-Date":n==null?void 0:n.publishDate,"X-Published":n==null?void 0:n.published,"X-Ads-Enabled":n==null?void 0:n.adsEnabled};for(const o of Object.keys(this.headers))typeof this.headers[o]=="undefined"&&delete this.headers[o]}byContentId(e){return N(this,mn,Xn).call(this,`by_content_id/${e}`)}byPlaylistId(e){return N(this,mn,Xn).call(this,`by_playlist_id/${e}`)}bySourceId(e){return N(this,mn,Xn).call(this,`by_source_id/${e}`)}bySourceUrl(e){return N(this,mn,Xn).call(this,`by_source_url/${encodeURIComponent(e)}`)}byIdentifiers(e){return N(this,mn,Xn).call(this,`by_identifiers/${encodeURIComponent(JSON.stringify(e))}`)}}mn=new WeakSet,Xn=function(e){return sl(`${this.baseUrl}/${e}`,{headers:this.headers})};const rl=t=>typeof t!="object"||t===null?t:Array.isArray(t)?t.map(rl):Object.fromEntries(Object.entries(t).map(([e,i])=>[e.replace(/([A-Z])/g,n=>`_${n.toLowerCase()}`),rl(i)])),mr=t=>t==="dark"||t==="auto"&&O_()?"dark":"light",O_=()=>window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches,hr=t=>Bi(this,null,function*(){const e=new W_(t.playerApiUrl,t.projectId,t.clientSideIntegration);if(!t.playerApiUrl||!t.projectId)return;const i=E_(t);if(i.length===0){t.sourceUrl=window.location.href;return}const n=yield M_(e,i).catch(()=>{});if(!(n!=null&&n.content)){j_(t);return}z_(t,n)}),E_=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(...rl(t.playlist)),[...new Set(e.map(JSON.stringify))].map(JSON.parse)},M_=(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)},j_=t=>{_r(t),yr(t),vr(t),t.onEvent(ye({type:"NoContentAvailable",description:"No published and processed content is available for the identifiers.",initiatedBy:"browser"}))},z_=(t,e)=>{var s,l,a,r;const i=mr(e.settings.theme),n=e.settings[`${i}_theme`],o=e.settings.video_theme;_r(t),yr(t,e),vr(t,e),Me(t,"playerStyle",e.settings.player_style),Me(t,"playerTitle",((s=e.playlist)==null?void 0:s.title)||e.settings.player_title),Me(t,"callToAction",e.settings.call_to_action==="Listen to this article"?null:e.settings.call_to_action),Me(t,"skipButtonStyle",e.settings.skip_button_style),Me(t,"downloadFormats",e.settings.download_button_enabled?["mp3"]:[]),Me(t,"introsOutros",L_(e.settings)),Me(t,"persistentAdImage",e.settings.persistent_ad_image),Me(t,"duration",(r=(a=(l=t.content[t.contentIndex])==null?void 0:l.audio)==null?void 0:a[0])==null?void 0:r.duration),Me(t,"widgetStyle",e.settings.widget_style),Me(t,"widgetPosition",e.settings.widget_position),Me(t,"textColor",n.text_color),Me(t,"backgroundColor",n.background_color),Me(t,"iconColor",n.icon_color),Me(t,"highlightColor",n.highlight_color),Me(t,"videoTextColor",o.text_color),Me(t,"videoBackgroundColor",o.background_color),Me(t,"videoIconColor",o.icon_color),Me(t,"logoIconEnabled",e.settings.logo_icon_enabled),Me(t,"logoImagePosition",e.video_settings.logo_image_position),Me(t,"highlightSections",e.settings.segment_playback_enabled?"all":"none"),Me(t,"clickableSections",e.settings.segment_playback_enabled?"all":"none"),Me(t,"segmentWidgetSections",(e.settings.segment_playback_enabled,"none")),Me(t,"analyticsConsent",D_(e.settings)),Me(t,"analyticsCustomUrl",e.settings.analytics_custom_url),Me(t,"analyticsTag",e.settings.analytics_tag),Me(t,"analyticsUrl",e.settings.analytics_url),Me(t,"analyticsId",e.settings.analytics_id)},_r=t=>{Me(t,"contentIndex",0),Me(t,"introsOutrosIndex",-1),Me(t,"advertIndex",-1),Me(t,"persistentIndex",-1),Me(t,"duration",0),Me(t,"currentTime",0),Me(t,"playbackState","stopped"),Me(t,"currentSegment",void 0),Me(t,"hoveredSegment",void 0)},yr=(t,e)=>{var o;const i=(o=e==null?void 0:e.settings)==null?void 0:o.image_enabled,n=(e==null?void 0:e.content)||[];Me(t,"content",n.map(s=>{var l;return{id:s.id,title:s.title,imageUrl:i?((l=e.playlist)==null?void 0:l.image_url)||e.settings.image_url||s.image_url:null,sourceId:s.source_id,sourceUrl:s.source_url,adsEnabled:s.ads_enabled,duration:s.audio[0]?s.audio[0].duration/1e3:0,audio:s.audio.map(a=>({id:a.id,url:a.url,contentType:a.content_type,duration:a.duration?a.duration/1e3:0})),video:s.video.map(a=>({id:a.id,url:a.url,contentType:a.content_type,duration:a.duration?a.duration/1e3:0})),segments:s.segments.map(a=>({marker:a.marker,xpath:a.xpath,md5:a.md5,section:a.section,startTime:a.start_time?a.start_time/1e3:0,duration:a.duration?a.duration/1e3:0}))}}))},vr=(t,e)=>{var o;const i=(o=e==null?void 0:e.settings)==null?void 0:o.image_enabled,n=(e==null?void 0:e.ads)||[];Me(t,"adverts",n.map(s=>{const l=s.type==="vast",a=mr(s.theme),r=s[`${a}_theme`],u=s.video_theme;return{id:s.id,type:s.type,placement:s.placement,vastUrl:l?s.vast_url:null,clickThroughUrl:l?null:s.click_through_url,imageUrl:i?s.image_url:null,textColor:r==null?void 0:r.text_color,backgroundColor:r==null?void 0:r.background_color,iconColor:r==null?void 0:r.icon_color,videoTextColor:u==null?void 0:u.text_color,videoBackgroundColor:u==null?void 0:u.background_color,videoIconColor:u==null?void 0:u.icon_color,audio:l?[]:(s.audio||s.media).map(c=>({id:c.id,url:c.url,contentType:c.content_type,duration:c.duration?c.duration/1e3:0})),video:l?[]:(s.video||[]).map(c=>({id:c.id,url:c.url,contentType:c.content_type,duration:c.duration?c.duration/1e3:0}))}}))},Me=(t,e,i)=>{var o;typeof((o=t.initialProps)==null?void 0:o[e])!="undefined"||(t[e]=i)},L_=({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},D_=({analytics_enabled:t,analytics_uuid_enabled:e})=>t?e?"allowed":"without-local-storage":"none",R_=(t,e)=>Bi(this,null,function*(){const n=yield(yield fetch(t)).blob(),o=URL.createObjectURL(n),s=document.createElement("a");document.body.append(s),s.href=o,s.setAttribute("download",e),s.setAttribute("target","_blank"),s.click(),s.remove()}),Qo={vastUrls:new Set,mediaSources:new Set},N_=t=>{t.vastUrl&&Qo.vastUrls.add(t.vastUrl);for(const e of[...t.audio||[],...t.video||[]])Qo.mediaSources.add(e.url)},br=t=>{if(t.vastUrl&&Qo.vastUrls.has(t.vastUrl))return!0;for(const e of[...t.audio||[],...t.video||[]])if(Qo.mediaSources.has(e.url))return!0;return!1},kr=new Set,x_=t=>{[...t.audio||[],...t.video||[]].forEach(i=>kr.add(i.url))},U_=t=>[...t.audio||[],...t.video||[]].some(i=>kr.has(i.url)),F_=({introsOutrosIndex:t,adverts:e,advertIndex:i,content:n=[],contentIndex:o,currentTime:s,atTheStart:l,atTheEnd:a,errored:r,minTimeUntilEndForMidroll:u,minDurationForMidroll:c}={})=>{var y;const g=e&&e[i];e:if(g){if(r){N_(g);break e}if(a)return x_(g),-1;if(!a)return i}if(!((y=n[o])!=null&&y.adsEnabled)||t!==-1)return-1;const v=H_({content:n,contentIndex:o,currentTime:s,atTheStart:l,atTheEnd:a,minTimeUntilEndForMidroll:u,minDurationForMidroll:c});let _=-1,m=-1/0,w=-1/0;for(const[A,S]of e.entries()){if(U_(S)||br(S)||!v.has(S.placement))continue;const C=q_[S.type]||0;if(C<m)continue;const T=Math.random();C===m&&T<w||(_=A,m=C,w=T)}return _},q_={vast:1,custom:0},H_=({content:t,contentIndex:e,currentTime:i,atTheStart:n,atTheEnd:o,minTimeUntilEndForMidroll:s,minDurationForMidroll:l})=>{const a=e===0,r=e===t.length-1,u=t.length>1,c=u&&n&&!a,g=t[e].segments,v=g[g.length-1],_=u?null:Z_(g,l),m=g[_],w=m&&i>m.startTime,y=v?v.startTime+v.duration:0,A=i>y-s,S=new Set;return n&&S.add("pre-roll"),w&&!A&&S.add("mid-roll"),c&&S.add("mid-roll"),o&&r&&S.add("post-roll"),c&&S.add("post-roll"),S},Y_=.5,Z_=(t,e)=>{const i=t[t.length-1];if(!i)return;const n=i.startTime+i.duration;if(n<e)return;const o=n/2,s=Us(t,n/2),r=t[s].startTime>=o-Y_?s:s+1;if(r!==t.length)return r},G_=(t,e,i,n)=>{let o=-1,s=-1/0,l=-1/0;for(const[a,r]of(n||[]).entries()){if(!t||br(r)||r.type==="vast")continue;const u=J_(a,e,i);if(u<s)continue;const c=K_[r.placement]||0;u===s&&c<l||(o=a,s=u,l=c)}return o},K_={"pre-roll":2,"mid-roll":1},J_=(t,e,i)=>t===i?2:t===e?1:0,pr={mediaSources:new Set},X_=t=>{for(const e of[...t.audio||[],t.video||[]])pr.mediaSources.add(e.url)},Q_=t=>{for(const e of[...t.audio||[],t.video||[]])if(pr.mediaSources.has(e.url))return!0;return!1},Sr=new Set,$_=t=>{[...t.audio||[],...t.video||[]].forEach(i=>Sr.add(i.url))},ey=t=>[...t.audio||[],...t.video||[]].some(i=>Sr.has(i.url)),ty=({introsOutros:t=[],introsOutrosIndex:e,advertIndex:i,content:n,contentIndex:o,currentTime:s,atTheStart:l,atTheEnd:a,errored:r})=>{const u=t[e];e:if(u){if(r){X_(u);break e}if(a)return $_(u),-1;if(!a)return e}if(i!==-1)return-1;const c=iy({content:n,contentIndex:o,currentTime:s,atTheStart:l,atTheEnd:a});let g=-1,v=-1/0,_=-1/0;for(const[m,w]of t.entries()){if(Q_(w)||!c.has(w.placement))continue;const y=ey(w)?1:0;if(y<v)continue;const A=Math.random();y===v&&A<_||(g=m,v=y,_=A)}return g},iy=({content:t,contentIndex:e,currentTime:i,atTheStart:n,atTheEnd:o})=>{const s=new Set,l=n&&e===0&&i===0,a=o&&e===t.length-1;return l&&s.add("pre-roll"),a&&s.add("post-roll"),s},ny=t=>{if(!navigator.mediaSession)return;const e=t.instances().some(s=>s.mediaSession==="override");if(ly()&&!e)return;let i,n=-1/0,o=-1/0;for(const s of t.instances()){if(s.mediaSession==="none")continue;const l=oy[s.playbackState]||0;if(l<n)continue;const a=sy[s.showMediaSession]||0;l===n&&a<o||(i=s,n=l,o=a)}for(const s of t.instances())s.showMediaSession=s===i;return i},oy={playing:1,paused:0,stopped:0},sy={true:1,false:0},ly=()=>{const t=navigator.mediaSession.metadata;if(!t||navigator.mediaSession.setByPlayer)return!1;const{title:e,artist:i,album:n,artwork:o}=t;return e||i||n||(o==null?void 0:o.length)},ay=t=>{let e=!1,i,n=-1/0,o=-1/0;for(const s of t.instances()){if(!s.userInterface||!al(s.widgetStyle))continue;if(s.userInterface.isVisible){e=!0;continue}if(!(s.userInterface.relativeY<0))continue;const u=ry[s.playbackState]||0;if(u<n)continue;const c=s.userInterface.absoluteY;u===n&&c<o||(i=s,n=u,o=c)}e&&n===0&&(i=null);for(const s of t.instances())s.showBottomWidget=s===i},ry={playing:2,paused:1,stopped:0};class uy{constructor(e,i){Ae(this,ds);Ae(this,gs);Ae(this,fs);Ae(this,yo);Ae(this,ms);Ae(this,hs);Ae(this,Di);Ae(this,on);Ae(this,ki);Ae(this,_s);Ae(this,An);Ae(this,sn);Ae(this,ys);Ae(this,vo);Ae(this,Ki);Ae(this,bo);Ae(this,ln);Ae(this,Ft);Ae(this,an);Ae(this,Ji);Ae(this,vs);Ae(this,bs);Ae(this,In);Ae(this,ko);Ae(this,ks);Ae(this,ps);Ae(this,Ss);Ae(this,ws);this.player=e,this.PlayerClass=i,this.eventListeners={"<any>":{}}}addEventListener(e,i){e==="<any>"||this[`handle${e}`]||ri(`Cannot add listener for unknown event type '${e}'.`);const o=`listener-handle-${Wo()}`;return this.eventListeners[e]=this.eventListeners[e]||{},this.eventListeners[e][o]=i,o}removeEventListener(e,i){this.eventListeners[e]=this.eventListeners[e]||{},delete this.eventListeners[e][i]}processEvent(e){return Bi(this,null,function*(){yield or(()=>this.player),Mu(e);const i=this[`handle${e.type}`],n=Xo(this.player);N(this,ds,Fr).call(this,e)?e.status="ignored-due-to-advert":N(this,gs,qr).call(this,e)?e.status="ignored-due-to-scrubbing":N(this,fs,Hr).call(this,e)?e.status="ignored-due-to-precedence":i?(yield i.call(this,e),N(this,vs,Jr).call(this),N(this,bs,Xr).call(this),e.status="handled"):ri("No handler function for event.",e);const o=Xo(this.player);e.changedProps=sr(n,o),e.processedAt=new Date().toISOString(),ju(e),N(this,yo,bl).call(this,e.type,e),N(this,yo,bl).call(this,"<any>",e)})}handlePressedChangeRate(){N(this,Ki,wn).call(this,e=>e+1,{cycle:!0})}handlePressedEnterOnChangeRate(){N(this,Ki,wn).call(this,e=>e+1,{cycle:!0})}handlePressedSpaceOnChangeRate(){N(this,Ki,wn).call(this,e=>e+1,{cycle:!0})}handlePressedUpOnChangeRate(){N(this,Ki,wn).call(this,e=>e+1)}handlePressedRightOnChangeRate(){N(this,Ki,wn).call(this,e=>e+1)}handlePressedDownOnChangeRate(){N(this,Ki,wn).call(this,e=>e-1)}handlePressedLeftOnChangeRate(){N(this,Ki,wn).call(this,e=>e-1)}handlePressedPrevSegment(){N(this,bo,pl).call(this,e=>e-1)}handlePressedNextSegment(){N(this,bo,pl).call(this,e=>e+1)}handlePressedSeekBack({seconds:e}){N(this,Ft,ai).call(this,i=>i-e)}handlePressedSeekAhead({seconds:e}){N(this,Ft,ai).call(this,i=>i+e)}handlePressedPrevTrack(){N(this,ln,En).call(this,e=>e-1)}handlePressedNextTrack(){N(this,ln,En).call(this,e=>e+1)}handlePressedAdvertLink(){}handlePressedAdvertButton(){}handlePressedAdvertImage(){}handlePressedAdvertVideo(){}handlePressedBeyondWords(){}handlePressedSourceUrl(){}handleDurationUpdated(){}handleMetadataLoaded({loadedMedia:e}){this.player.loadedMedia=e}handleMediaLoaded({loadedMedia:e}){this.player.loadedMedia=e}handleMediaSeeked(){}handlePlaybackRateUpdated(){}handleVisibilityChanged(){ay(this.PlayerClass)}handlePressedVideoBackground(){N(this,sn,On).call(this)}handlePressedEnterOnProgressBar(){N(this,sn,On).call(this)}handlePressedSpaceOnProgressBar(){N(this,sn,On).call(this)}handlePressedEnterOnProgressCircle(){N(this,sn,On).call(this)}handlePressedSpaceOnProgressCircle(){N(this,sn,On).call(this)}handlePressedLeftOnProgressBar(){N(this,Ft,ai).call(this,e=>e-5)}handlePressedRightOnProgressBar(){N(this,Ft,ai).call(this,e=>e+5)}handlePressedLeftOnProgressCircle(){N(this,Ft,ai).call(this,e=>e-5)}handlePressedRightOnProgressCircle(){N(this,Ft,ai).call(this,e=>e+5)}handlePressedProgressBar({ratio:e}){this.preScrubState=this.player.playbackState,this.pauseTimeout=setTimeout(()=>N(this,ys,Kr).call(this),100),N(this,Ft,ai).call(this,(i,n)=>e*n),e!==0&&(this.segmentPlayed=!0)}handleScrubbedProgressBar({ratio:e}){N(this,Ft,ai).call(this,(i,n)=>e*n-.01),e!==0&&(this.segmentPlayed=!0)}handleFinishedScrubbingProgressBar(){clearTimeout(this.pauseTimeout),this.player.playbackState=this.preScrubState,delete this.preScrubState}handleIdentifiersChanged(){hr(this.player).then(()=>{N(this,an,Mn).call(this,{atTheStart:!0}),N(this,Ji,Tn).call(this,{atTheStart:!0})})}handleNoContentAvailable({description:e}){console.warn(`BeyondWords.Player: ${e}`)}handlePressedPlay({emittedFrom:e,widgetSegment:i,widgetIsCurrent:n}){e==="segment-widget"&&!n?N(this,vo,kl).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"),ny(this.PlayerClass)}handlePlaybackPaused(){const e=this.player.playbackState==="playing",i=this.player.currentTime>=this.player.duration-.5;e&&!i&&!this.preScrubState&&(this.player.playbackState="paused")}handleCurrentTimeUpdated(){this.midrollPlayed||N(this,Ji,Tn).call(this);const e=this.player.currentTime<=oo,i=this.player.currentTime>=this.player.duration,n=this.player.mediaElement.video.paused;!e&&!i&&!n&&(this.player.playbackState="playing")}handlePlaybackEnded(){N(this,_s,Gr).call(this)&&(this.midrollPlayed=!0),this.segmentPlayed=!1;const e=N(this,Di,un).call(this),i=N(this,ki,Li).call(this);N(this,Ji,Tn).call(this,{atTheEnd:!0,wasIntro:e}),!i&&(N(this,an,Mn).call(this,{atTheEnd:!0}),!e&&(N(this,on,Wn).call(this)||N(this,ki,Li).call(this)||N(this,ln,En).call(this,n=>n+1)))}handlePlaybackNotAllowed({description:e}){console.warn(`BeyondWords.Player: ${e}`);const i=this.player.contentIndex<=0&&this.player.currentTime<=oo;this.player.playbackState=i?"stopped":"paused"}handlePlaybackErrored({mediaType:e,errorMessage:i}){console.warn(`BeyondWords.Player: ${e} playback error: ${i}`),N(this,Di,un).call(this)||N(this,on,Wn).call(this)?N(this,an,Mn).call(this,{errored:!0}):N(this,ki,Li).call(this)?N(this,Ji,Tn).call(this,{errored:!0}):this.handlePlaybackEnded()}handleCompanionAdvertChanged({clickThroughUrl:e,imageUrl:i}){this.player.companionAdvert={clickThroughUrl:e,imageUrl:i}}handlePressedMaximize(){Aa()?h0():m0(this.player.target)}handleFullScreenModeUpdated(){const e=Aa()===this.player.target,i=e?"add":"remove";this.player.isFullScreen=e,this.player.target.classList[i]("maximized")}handlePressedPlaylistItem({index:e}){N(this,ln,En).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 c,g;const o=this.player.content[e],s=(c=o.audio)==null?void 0:c[i],l=(g=o.video)==null?void 0:g[n],a=(s||l).url,r=a.split(".").pop(),u=`${o.title}.${r}`;return R_(a,u)}handlePressedCloseWidget(){for(const e of this.PlayerClass.instances())e.playbackState="paused",e.widgetStyle="closed-by-user"}handleContentStatusChanged({contentId:e,legacyId:i,sourceId:n,sourceUrl:o,contentStatus:s}){s==="processed"&&this.player.playbackState==="stopped"&&this.player.contentIndex===0&&this.player.currentTime===0&&N(this,Ss,eu).call(this,{contentId:e,legacyId:i,sourceId:n,sourceUrl:o})&&hr(this.player).then(()=>{N(this,an,Mn).call(this,{atTheStart:!0}),N(this,Ji,Tn).call(this,{atTheStart:!0})})}handleCurrentSegmentUpdated({segment:e,contentIndex:i,segmentIndex:n,segmentElement:o}){var s;N(this,An,wo).call(this)?this.player.currentSegment=rn(oi({},e),{contentIndex:i,segmentIndex:n,segmentElement:o}):this.segmentPlayed||((s=this.player.segmentContainers)==null||s.reset(),this.player.currentSegment=null)}handleHoveredSegmentUpdated({segment:e,contentIndex:i,segmentIndex:n,segmentElement:o}){e?this.player.hoveredSegment=rn(oi({},e),{contentIndex:i,segmentIndex:n,segmentElement:o}):this.player.hoveredSegment=null}handlePressedSegment({segment:e,contentIndex:i,segmentIndex:n,segmentElement:o}){if(!ro("hovered",e,this.player.clickableSections))return;if(!N(this,ws,tu).call(this,{contentIndex:i,segmentIndex:n})&&!N(this,ki,Li).call(this)){N(this,sn,On).call(this);return}i!==this.player.contentIndex&&N(this,ln,En).call(this,()=>i),N(this,vo,kl).call(this,oi({contentIndex:i,segmentIndex:n,segmentElement:o},e))}}ds=new WeakSet,Fr=function({type:e}){return N(this,ki,Li).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"))},gs=new WeakSet,qr=function({type:e}){return this.preScrubState&&(e.includes("CurrentTimeUpdated")||e.includes("PlaybackEnded"))},fs=new WeakSet,Hr=function({type:e,precedence:i}){return e.includes("PressedSegment")&&i>0},yo=new WeakSet,bl=function(e,i){const n=this.eventListeners[e]||{};Object.values(n).forEach(o=>o(i))},ms=new WeakSet,Yr=function(){return this.player.introsOutros.some(e=>e.placement==="pre-roll")},hs=new WeakSet,Zr=function(){return this.player.introsOutros.some(e=>e.placement==="post-roll")},Di=new WeakSet,un=function(e=this.player.introsOutrosIndex){var i,n,o;return((o=(n=(i=this.player)==null?void 0:i.introsOutros)==null?void 0:n[e])==null?void 0:o.placement)==="pre-roll"},on=new WeakSet,Wn=function(e=this.player.introsOutrosIndex){var i,n,o;return((o=(n=(i=this.player)==null?void 0:i.introsOutros)==null?void 0:n[e])==null?void 0:o.placement)==="post-roll"},ki=new WeakSet,Li=function(){return this.player.advertIndex!==-1},_s=new WeakSet,Gr=function(){var e;return((e=this.player.adverts[this.player.advertIndex])==null?void 0:e.placement)==="mid-roll"},An=new WeakSet,wo=function(){return!N(this,Di,un).call(this)&&!N(this,on,Wn).call(this)&&!N(this,ki,Li).call(this)},sn=new WeakSet,On=function(){this.player.playbackState==="playing"?this.player.playbackState="paused":this.player.playbackState="playing"},ys=new WeakSet,Kr=function(){this.player.playbackState==="playing"&&(this.player.playbackState="paused")},vo=new WeakSet,kl=function(s){var l=s,{contentIndex:e,segmentIndex:i,segmentElement:n}=l,o=ml(l,["contentIndex","segmentIndex","segmentElement"]);N(this,Ft,ai).call(this,()=>o.startTime,e),this.player.currentSegment=oi({contentIndex:e,segmentIndex:i,segmentElement:n},o),this.player.playbackState="playing",this.segmentPlayed=!0},Ki=new WeakSet,wn=function(e,{cycle:i}={}){const n=this.player.playbackRates,o=n.length-1,s=n.indexOf(this.player.playbackRate),l=e(s);let a;i?a=l%n.length:a=Math.max(0,Math.min(o,l)),this.player.playbackRate=n[a]||1},bo=new WeakSet,pl=function(e){const i=this.player.content[this.player.contentIndex].segments,n=Us(i,this.player.currentTime),o=e(n);N(this,Di,un).call(this)&&o>=0?this.handlePlaybackEnded():N(this,on,Wn).call(this)&&o<0?(N(this,In,To).call(this,-1),N(this,Ft,ai).call(this,()=>{var s;return((s=i[i.length-1])==null?void 0:s.startTime)||.01}),this.player.playbackState="playing"):N(this,An,wo).call(this)&&o<0&&N(this,ms,Yr).call(this)?(N(this,Ft,ai).call(this,()=>0),N(this,an,Mn).call(this,{atTheStart:!0})):N(this,An,wo).call(this)&&o===i.length&&N(this,hs,Zr).call(this)?N(this,Ft,ai).call(this,()=>this.player.duration-.01):N(this,An,wo).call(this)&&o>=0&&o<i.length&&N(this,Ft,ai).call(this,()=>i[o].startTime)},ln=new WeakSet,En=function(e){const i=e(this.player.contentIndex),n=i<0||i>=this.player.content.length;n?(this.player.playbackState="stopped",N(this,Ft,ai).call(this,()=>0)):(this.player.contentIndex=i,N(this,ki,Li).call(this)||(N(this,Ft,ai).call(this,()=>0),this.midrollPlayed=!1)),N(this,In,To).call(this,-1),N(this,an,Mn).call(this,{atTheStart:!0}),n||N(this,Ji,Tn).call(this,{atTheStart:!0})},Ft=new WeakSet,ai=function(e,i){if(N(this,ki,Li).call(this))this.prevTime=e(),this.prevContent=i;else{const n=this.player.duration||0;this.player.currentTime=e(this.player.currentTime,n)}},an=new WeakSet,Mn=function({atTheStart:e,atTheEnd:i,errored:n}={}){const{content:o,introsOutros:s,currentTime:l}=this.player,a=typeof this.nextIntroOutro!="undefined"?this.nextIntroOutro:this.player.introsOutrosIndex,r=typeof this.nextAdvert!="undefined"?this.nextAdvert:this.player.advertIndex,u=typeof this.prevContent!="undefined"?this.prevContent:this.player.contentIndex;N(this,In,To).call(this,ty({introsOutros:s,introsOutrosIndex:a,advertIndex:r,content:o,contentIndex:u,currentTime:l,atTheStart:e,atTheEnd:i,errored:n}))},Ji=new WeakSet,Tn=function({atTheStart:e,atTheEnd:i,wasIntro:n,errored:o}={}){const{adverts:s,content:l,currentTime:a,minDurationForMidroll:r,minTimeUntilEndForMidroll:u}=this.player;let c=typeof this.nextIntroOutro!="undefined"?this.nextIntroOutro:this.player.introsOutrosIndex;const g=typeof this.nextAdvert!="undefined"?this.nextAdvert:this.player.advertIndex,v=typeof this.prevContent!="undefined"?this.prevContent:this.player.contentIndex;n&&(e=!0,i=!1,c=-1),N(this,ko,Sl).call(this,F_({introsOutrosIndex:c,adverts:s,advertIndex:g,content:l,contentIndex:v,currentTime:a,atTheStart:e,atTheEnd:i,errored:o,minDurationForMidroll:r,minTimeUntilEndForMidroll:u}));const _=this.player.persistentAdImage,m=this.player.persistentIndex;this.player.persistentIndex=G_(_,m,g,s)},vs=new WeakSet,Jr=function(){this.player.playbackState==="playing"&&typeof this.nextIntroOutro!="undefined"&&(N(this,In,To).call(this,this.nextIntroOutro),delete this.nextIntroOutro)},bs=new WeakSet,Xr=function(){this.player.playbackState==="playing"&&typeof this.nextAdvert!="undefined"&&(N(this,ko,Sl).call(this,this.nextAdvert),delete this.nextAdvert)},In=new WeakSet,To=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<=oo)&&N(this,Di,un).call(this,e)){this.player.introsOutrosIndex=-1,N(this,Ji,Tn).call(this,{atTheStart:!0});return}const s=N(this,Di,un).call(this),l=N(this,on,Wn).call(this);this.player.introsOutrosIndex=e;const a=s&&!N(this,Di,un).call(this),r=l&&!N(this,on,Wn).call(this);a&&(this.player.currentTime=0),r&&N(this,ln,En).call(this,()=>1/0)},ko=new WeakSet,Sl=function(e){if(this.player.playbackState!=="playing"&&e!==-1){this.nextAdvert=e;return}else delete this.nextAdvert;const n=N(this,ki,Li).call(this);this.player.advertIndex=e;const o=!n&&N(this,ki,Li).call(this),s=n&&!N(this,ki,Li).call(this);o&&N(this,ks,Qr).call(this),s&&N(this,ps,$r).call(this)},ks=new WeakSet,Qr=function(){N(this,Di,un).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},ps=new WeakSet,$r=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},Ss=new WeakSet,eu=function({contentId:e,legacyId:i,sourceId:n,sourceUrl:o}){var s,l,a,r;return this.player.contentId===e||this.player.contentId===i||this.player.sourceId===n||this.player.sourceUrl===o||((s=this.player.playlist)==null?void 0:s.some(u=>u.contentId===e))||((l=this.player.playlist)==null?void 0:l.some(u=>u.contentId===i))||((a=this.player.playlist)==null?void 0:a.some(u=>u.sourceId===n))||((r=this.player.playlist)==null?void 0:r.some(u=>u.sourceUrl===o))},ws=new WeakSet,tu=function({contentIndex:e,segmentIndex:i}){var n,o;return((n=this.player.currentSegment)==null?void 0:n.contentIndex)!==e||((o=this.player.currentSegment)==null?void 0:o.segmentIndex)!==i};var co="<unknown>";function cy(t){var e=t.split(`
58
58
  `);return e.reduce(function(i,n){var o=fy(n)||hy(n)||vy(n)||Sy(n)||ky(n);return o&&i.push(o),i},[])}var dy=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,gy=/\((\S*)(?::(\d+))(?::(\d+))\)/;function fy(t){var e=dy.exec(t);if(!e)return null;var i=e[2]&&e[2].indexOf("native")===0,n=e[2]&&e[2].indexOf("eval")===0,o=gy.exec(e[2]);return n&&o!=null&&(e[2]=o[1],e[3]=o[2],e[4]=o[3]),{file:i?null:e[2],methodName:e[1]||co,arguments:i?[e[2]]:[],lineNumber:e[3]?+e[3]:null,column:e[4]?+e[4]:null}}var my=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function hy(t){var e=my.exec(t);return e?{file:e[2],methodName:e[1]||co,arguments:[],lineNumber:+e[3],column:e[4]?+e[4]:null}:null}var _y=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,yy=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function vy(t){var e=_y.exec(t);if(!e)return null;var i=e[3]&&e[3].indexOf(" > eval")>-1,n=yy.exec(e[3]);return i&&n!=null&&(e[3]=n[1],e[4]=n[2],e[5]=null),{file:e[3],methodName:e[1]||co,arguments:e[2]?e[2].split(","):[],lineNumber:e[4]?+e[4]:null,column:e[5]?+e[5]:null}}var by=/^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;function ky(t){var e=by.exec(t);return e?{file:e[3],methodName:e[1]||co,arguments:[],lineNumber:+e[4],column:e[5]?+e[5]:null}:null}var py=/^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;function Sy(t){var e=py.exec(t);return e?{file:e[2],methodName:e[1]||co,arguments:[],lineNumber:+e[3],column:e[4]?+e[4]:null}:null}let wr=!1,ul,cl;const wy=({onError:t})=>{if(!t||wr)return;wr=!0;const e=Tr(new Error),i=e==null?void 0:e.match(/setErrorHandler/);ul=window.onerror,cl=window.onunhandledrejection,window.onerror=(n,o,s,l,a)=>{var g;const r=o===e,u=(g=a==null?void 0:a.message)==null?void 0:g.match(/request was interrupted/);if((i||r||u)&&t(a))return!0;ul&&ul(n,o,s,l,a)},window.onunhandledrejection=n=>{var r;const o=n.reason,s=Tr(o)===e,l=(r=o==null?void 0:o.message)==null?void 0:r.match(/request was interrupted/);if((i||s||l)&&t(o)){n.preventDefault();return}cl&&cl(n)}},Tr=t=>{var e;return(e=cy((t==null?void 0:t.stack)||"")[0])==null?void 0:e.file},Ty=()=>{typeof window=="undefined"&&ri(["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 Pr=!1;const Py=()=>{Pr||(addEventListener("mousedown",Cy),addEventListener("click",Iy),addEventListener("mousemove",By),Pr=!0)};let Cr,Ar;const Cy=t=>{Cr=t.pageX,Ar=t.pageY},Ay=t=>{const e=t.pageX-Cr,i=t.pageY-Ar;return Math.sqrt(e*e+i*i)>5},Iy=t=>{if(!t.defaultPrevented&&!Ay(t)&&t.button===0)for(const{player:e,segment:i,contentIndex:n,segmentIndex:o,segmentElement:s,precedence:l}of ql(t.target))i&&e.onEvent(ye({type:"PressedSegment",description:"The user pressed on a segment in the article.",initiatedBy:"user",emittedFrom:"segment",segment:i,contentIndex:n,segmentIndex:o,segmentElement:s,precedence:l}))},By=t=>{for(const{p:e,player:i,segment:n,contentIndex:o,segmentIndex:s,segmentElement:l,precedence:a}of ql(t.target))n&&Vy(e,o,s)&&i.onEvent(ye({type:"HoveredSegmentUpdated",description:"The user hovered over a different segment in the article.",initiatedBy:"user",emittedFrom:"segment",segment:n,contentIndex:o,segmentIndex:s,segmentElement:l,precedence:a}))},$o={},Vy=(t,e,i)=>{$o[t]||($o[t]={});const n=$o[t];return n.contentIndex===e&&n.segmentIndex===i?!1:(n.contentIndex=e,n.segmentIndex=i,!0)};class dl{constructor(e){this.analyticsSink=e}sendToCustomAnalytics(e){return a_(this.analyticsSink,e)}sendToGoogleAnalytics(e,i){window.gtag("event",e,rn(oi({},i),{send_to:this.analyticsSink}))}}const Wy=(t,e)=>{const i=Oy(t,e.type);if(!i)return;const n=Ey(t,i);zu(n),t.analyticsUrl&&t.analyticsConsent!=="none"&&new dl(t.analyticsUrl).sendToCustomAnalytics(n),t.analyticsCustomUrl&&t.analyticsConsent!=="none"&&new dl(t.analyticsCustomUrl).sendToCustomAnalytics(n),t.analyticsTag&&new dl(t.analyticsTag).sendToGoogleAnalytics(My(n),n)},Oy=(t,e)=>{if(e==="MetadataLoaded"&&!t.listenSessionId)return"load";if(e==="PlaybackPlaying"&&jy(t)&&(t.isNewListen=!0),e==="CurrentTimeUpdated"&&t.isNewListen)return t.isNewListen=!1,"play";if(e==="CurrentTimeUpdated"&&zy(t))return"play_progress";if(e.startsWith("PressedAdvert"))return"ad_link_click"},Ey=(t,e)=>{var l,a;t.listenSessionId||(t.listenSessionId=Wo()),t.sessionCreatedAt||(t.sessionCreatedAt=Date.now());const i=["without-local-storage","none"].includes(t.analyticsConsent);i||localStorage.beyondwords||(localStorage.beyondwords=JSON.stringify(Wo()));const n=t.adverts[t.advertIndex],o=t.content[t.contentIndex],s=t.duration?t.currentTime/t.duration*100:0;return{event_type:e,device_type:Ly(t),media_type:n?"ad":"content",project_id:t.projectId,content_id:o==null?void 0:o.id,source_id:o==null?void 0:o.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:(a=t.loadedMedia)==null?void 0:a.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,s)),speed:t.playbackRate,location:window.location.href,referrer:document.referrer,player_version:"1",player_npm_version:Bo}},My=({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"},jy=t=>{var n,o;let e=!1;if(t.advertIndex!==-1){const s=((n=t.adverts[t.advertIndex])==null?void 0:n.id)||t.advertIndex;e=s!==t.prevAdvertId,t.prevAdvertId=s}else{const s=((o=t.content[t.contentIndex])==null?void 0:o.id)||t.contentIndex;e=s!==t.prevContentId,t.prevContentId=s}return e},zy=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},Ly=t=>t.analyticsDeviceType!=="auto"?t.analyticsDeviceType:Ir(499)?"phone":Ir(999)?"tablet":"desktop",Ir=t=>window.matchMedia&&window.matchMedia(`only screen and (max-device-width: ${t}px)`).matches,Ei=class Ei extends V_{constructor(n){var o=n,{target:e}=o,i=ml(o,["target"]);Ty(),wy(i),Py();const{newTarget:s,showUserInterface:l}=b_(e);s.classList.add("beyondwords-player","bwp"),Ei._styleLoaded||(s.style.display="none");const a=new uy(null,Ei);a.addEventListener("<any>",u=>Wy(this,u));const r=oi({showUserInterface:l},i);super({target:s,props:rn(oi({controller:a},r),{initialProps:r})}),a.player=this,Ni(Ei,hn).push(this)}static styleLoaded(){Ei.instances().forEach(e=>e.target.style.removeProperty("display")),Ei._styleLoaded=!0}static get version(){return Bo}static get styleSrc(){return`https://proxy.beyondwords.io/npm/@beyondwords/player@${Bo}/dist/style.js`}static get hlsSrc(){return`https://proxy.beyondwords.io/npm/@beyondwords/player@${Bo}/dist/hls.light.min.js`}static instances(){return[...Ni(Ei,hn)]}static destroyAll(){Ni(Ei,hn).forEach(e=>e.destroy())}destroy(){this.$destroy(),Or(Ei,hn,Ni(Ei,hn).filter(e=>e!==this))}get target(){return this.$$.root}set target(e){ri(["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>"])}};hn=new WeakMap,Ae(Ei,hn,[]);let es=Ei;return typeof window!="undefined"&&(window.BeyondWords||(window.BeyondWords={}),(Br=window.BeyondWords).Player||(Br.Player=es)),{Player:es}});
59
59
  //# sourceMappingURL=umd.js.map