@beyondwords/player 0.1.13 → 0.1.14

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 l2=Object.defineProperty,a2=Object.defineProperties;var u2=Object.getOwnPropertyDescriptors;var To=Object.getOwnPropertySymbols;var ca=Object.prototype.hasOwnProperty,da=Object.prototype.propertyIsEnumerable;var tr=(E,Ie,Me)=>Ie in E?l2(E,Ie,{enumerable:!0,configurable:!0,writable:!0,value:Me}):E[Ie]=Me,oi=(E,Ie)=>{for(var Me in Ie||(Ie={}))ca.call(Ie,Me)&&tr(E,Me,Ie[Me]);if(To)for(var Me of To(Ie))da.call(Ie,Me)&&tr(E,Me,Ie[Me]);return E},sn=(E,Ie)=>a2(E,u2(Ie));var ir=(E,Ie)=>{var Me={};for(var Ht in E)ca.call(E,Ht)&&Ie.indexOf(Ht)<0&&(Me[Ht]=E[Ht]);if(E!=null&&To)for(var Ht of To(E))Ie.indexOf(Ht)<0&&da.call(E,Ht)&&(Me[Ht]=E[Ht]);return Me};var nr=(E,Ie,Me)=>(tr(E,typeof Ie!="symbol"?Ie+"":Ie,Me),Me),sr=(E,Ie,Me)=>{if(!Ie.has(E))throw TypeError("Cannot "+Me)};var Mi=(E,Ie,Me)=>(sr(E,Ie,"read from private field"),Me?Me.call(E):Ie.get(E)),We=(E,Ie,Me)=>{if(Ie.has(E))throw TypeError("Cannot add the same private member more than once");Ie instanceof WeakSet?Ie.add(E):Ie.set(E,Me)},ga=(E,Ie,Me,Ht)=>(sr(E,Ie,"write to private field"),Ht?Ht.call(E,Me):Ie.set(E,Me),Me);var z=(E,Ie,Me)=>(sr(E,Ie,"access private method"),Me);var wi=(E,Ie,Me)=>new Promise((Ht,Kn)=>{var Je=Pi=>{try{_e(Me.next(Pi))}catch(Wi){Kn(Wi)}},rn=Pi=>{try{_e(Me.throw(Pi))}catch(Wi){Kn(Wi)}},_e=Pi=>Pi.done?Ht(Pi.value):Promise.resolve(Pi.value).then(Je,rn);_e((Me=Me.apply(E,Ie)).next())});/*! version:"0.1.13" */(function(E,Ie){typeof exports=="object"&&typeof module!="undefined"?module.exports=Ie():typeof define=="function"&&define.amd?define(Ie):(E=typeof globalThis!="undefined"?globalThis:E||self,E.BeyondWords=Ie())})(this,function(){var us,or,Js,fa,cs,Xs,ha,Qs,_a,ds,$s,ma,eo,va,gs,to,ya,io,ba,no,ka,so,pa,oo,Sa,fs,rr,ro,wa,lo,Pa,Oi,on,Qi,Vn,vi,Vi,ao,Ta,Tn,bs,$i,Wn,uo,Ca,hs,lr,Fi,kn,_s,ar,en,On,Rt,ri,tn,jn,qi,pn,co,Aa,go,Ba,Cn,ks,ms,ur,fo,Ia,ho,Va,_o,Wa,mo,Oa,gn,ua;"use strict";function E(){}const Ie=t=>t;function Me(t,e){for(const i in e)t[i]=e[i];return t}function Ht(t){return t()}function Kn(){return Object.create(null)}function Je(t){t.forEach(Ht)}function rn(t){return typeof t=="function"}function _e(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let Pi;function Wi(t,e){return t===e?!0:(Pi||(Pi=document.createElement("a")),Pi.href=e,t===Pi.href)}function ja(t){return Object.keys(t).length===0}function En(t,e,i,n){if(t){const s=cr(t,e,i,n);return t[0](s)}}function cr(t,e,i,n){return t[1]&&n?Me(i.ctx.slice(),t[1](n(e))):i.ctx}function Mn(t,e,i,n){if(t[2]&&n){const s=t[2](n(i));if(e.dirty===void 0)return s;if(typeof s=="object"){const o=[],r=Math.max(e.dirty.length,s.length);for(let l=0;l<r;l+=1)o[l]=e.dirty[l]|s[l];return o}return e.dirty|s}return e.dirty}function zn(t,e,i,n,s,o){if(s){const r=cr(e,i,n,o);t.p(r,s)}}function Ln(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 dr(t){return t==null?"":t}function gr(t){const e=typeof t=="string"&&t.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[t,"px"]}const fr=typeof window!="undefined";let Ea=fr?()=>window.performance.now():()=>Date.now(),ps=fr?t=>requestAnimationFrame(t):E;const Nn=new Set;function hr(t){Nn.forEach(e=>{e.c(t)||(Nn.delete(e),e.f())}),Nn.size!==0&&ps(hr)}function Ma(t){let e;return Nn.size===0&&ps(hr),{promise:new Promise(i=>{Nn.add(e={c:t,f:i})}),abort(){Nn.delete(e)}}}const za=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global;function f(t,e){t.appendChild(e)}function _r(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function La(t){const e=y("style");return e.textContent="/* empty */",Na(_r(t),e),e.sheet}function Na(t,e){return f(t.head||t,e),e.sheet}function B(t,e,i){t.insertBefore(e,i||null)}function A(t){t.parentNode&&t.parentNode.removeChild(t)}function ln(t,e){for(let i=0;i<t.length;i+=1)t[i]&&t[i].d(e)}function y(t){return document.createElement(t)}function ye(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function Q(t){return document.createTextNode(t)}function H(){return Q(" ")}function Hi(){return Q("")}function D(t,e,i,n){return t.addEventListener(e,i,n),()=>t.removeEventListener(e,i,n)}function Se(t,e,i){i==null?t.removeAttribute(e):t.getAttribute(e)!==i&&t.setAttribute(e,i)}function Da(t){return Array.from(t.childNodes)}function yi(t,e){e=""+e,t.data!==e&&(t.data=e)}function M(t,e){t.value=e==null?"":e}function Dt(t,e,i,n){i==null?t.style.removeProperty(e):t.style.setProperty(e,i,n?"important":"")}function Ae(t,e,i){for(let n=0;n<t.options.length;n+=1){const s=t.options[n];if(s.__value===e){s.selected=!0;return}}(!i||e!==void 0)&&(t.selectedIndex=-1)}function Pt(t){const e=t.querySelector(":checked");return e&&e.__value}function ie(t,e,i){t.classList.toggle(e,!!i)}function Ra(t,e,{bubbles:i=!1,cancelable:n=!1}={}){return new CustomEvent(t,{detail:e,bubbles:i,cancelable:n})}const Ss=new Map;let ws=0;function xa(t){let e=5381,i=t.length;for(;i--;)e=(e<<5)-e^t.charCodeAt(i);return e>>>0}function Ua(t,e){const i={stylesheet:La(e),rules:{}};return Ss.set(t,i),i}function mr(t,e,i,n,s,o,r,l=0){const a=16.666/n;let d=`{
1
+ var l2=Object.defineProperty,a2=Object.defineProperties;var u2=Object.getOwnPropertyDescriptors;var To=Object.getOwnPropertySymbols;var ca=Object.prototype.hasOwnProperty,da=Object.prototype.propertyIsEnumerable;var tr=(E,Ie,Me)=>Ie in E?l2(E,Ie,{enumerable:!0,configurable:!0,writable:!0,value:Me}):E[Ie]=Me,oi=(E,Ie)=>{for(var Me in Ie||(Ie={}))ca.call(Ie,Me)&&tr(E,Me,Ie[Me]);if(To)for(var Me of To(Ie))da.call(Ie,Me)&&tr(E,Me,Ie[Me]);return E},sn=(E,Ie)=>a2(E,u2(Ie));var ir=(E,Ie)=>{var Me={};for(var Ht in E)ca.call(E,Ht)&&Ie.indexOf(Ht)<0&&(Me[Ht]=E[Ht]);if(E!=null&&To)for(var Ht of To(E))Ie.indexOf(Ht)<0&&da.call(E,Ht)&&(Me[Ht]=E[Ht]);return Me};var nr=(E,Ie,Me)=>(tr(E,typeof Ie!="symbol"?Ie+"":Ie,Me),Me),sr=(E,Ie,Me)=>{if(!Ie.has(E))throw TypeError("Cannot "+Me)};var Mi=(E,Ie,Me)=>(sr(E,Ie,"read from private field"),Me?Me.call(E):Ie.get(E)),We=(E,Ie,Me)=>{if(Ie.has(E))throw TypeError("Cannot add the same private member more than once");Ie instanceof WeakSet?Ie.add(E):Ie.set(E,Me)},ga=(E,Ie,Me,Ht)=>(sr(E,Ie,"write to private field"),Ht?Ht.call(E,Me):Ie.set(E,Me),Me);var z=(E,Ie,Me)=>(sr(E,Ie,"access private method"),Me);var wi=(E,Ie,Me)=>new Promise((Ht,Kn)=>{var Je=Pi=>{try{_e(Me.next(Pi))}catch(Wi){Kn(Wi)}},rn=Pi=>{try{_e(Me.throw(Pi))}catch(Wi){Kn(Wi)}},_e=Pi=>Pi.done?Ht(Pi.value):Promise.resolve(Pi.value).then(Je,rn);_e((Me=Me.apply(E,Ie)).next())});/*! version:"0.1.14" */(function(E,Ie){typeof exports=="object"&&typeof module!="undefined"?module.exports=Ie():typeof define=="function"&&define.amd?define(Ie):(E=typeof globalThis!="undefined"?globalThis:E||self,E.BeyondWords=Ie())})(this,function(){var us,or,Js,fa,cs,Xs,ha,Qs,_a,ds,$s,ma,eo,va,gs,to,ya,io,ba,no,ka,so,pa,oo,Sa,fs,rr,ro,wa,lo,Pa,Oi,on,Qi,Vn,vi,Vi,ao,Ta,Tn,bs,$i,Wn,uo,Ca,hs,lr,Fi,kn,_s,ar,en,On,Rt,ri,tn,jn,qi,pn,co,Aa,go,Ba,Cn,ks,ms,ur,fo,Ia,ho,Va,_o,Wa,mo,Oa,gn,ua;"use strict";function E(){}const Ie=t=>t;function Me(t,e){for(const i in e)t[i]=e[i];return t}function Ht(t){return t()}function Kn(){return Object.create(null)}function Je(t){t.forEach(Ht)}function rn(t){return typeof t=="function"}function _e(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let Pi;function Wi(t,e){return t===e?!0:(Pi||(Pi=document.createElement("a")),Pi.href=e,t===Pi.href)}function ja(t){return Object.keys(t).length===0}function En(t,e,i,n){if(t){const s=cr(t,e,i,n);return t[0](s)}}function cr(t,e,i,n){return t[1]&&n?Me(i.ctx.slice(),t[1](n(e))):i.ctx}function Mn(t,e,i,n){if(t[2]&&n){const s=t[2](n(i));if(e.dirty===void 0)return s;if(typeof s=="object"){const o=[],r=Math.max(e.dirty.length,s.length);for(let l=0;l<r;l+=1)o[l]=e.dirty[l]|s[l];return o}return e.dirty|s}return e.dirty}function zn(t,e,i,n,s,o){if(s){const r=cr(e,i,n,o);t.p(r,s)}}function Ln(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 dr(t){return t==null?"":t}function gr(t){const e=typeof t=="string"&&t.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[t,"px"]}const fr=typeof window!="undefined";let Ea=fr?()=>window.performance.now():()=>Date.now(),ps=fr?t=>requestAnimationFrame(t):E;const Nn=new Set;function hr(t){Nn.forEach(e=>{e.c(t)||(Nn.delete(e),e.f())}),Nn.size!==0&&ps(hr)}function Ma(t){let e;return Nn.size===0&&ps(hr),{promise:new Promise(i=>{Nn.add(e={c:t,f:i})}),abort(){Nn.delete(e)}}}const za=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global;function f(t,e){t.appendChild(e)}function _r(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function La(t){const e=y("style");return e.textContent="/* empty */",Na(_r(t),e),e.sheet}function Na(t,e){return f(t.head||t,e),e.sheet}function B(t,e,i){t.insertBefore(e,i||null)}function A(t){t.parentNode&&t.parentNode.removeChild(t)}function ln(t,e){for(let i=0;i<t.length;i+=1)t[i]&&t[i].d(e)}function y(t){return document.createElement(t)}function ye(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function Q(t){return document.createTextNode(t)}function H(){return Q(" ")}function Hi(){return Q("")}function D(t,e,i,n){return t.addEventListener(e,i,n),()=>t.removeEventListener(e,i,n)}function Se(t,e,i){i==null?t.removeAttribute(e):t.getAttribute(e)!==i&&t.setAttribute(e,i)}function Da(t){return Array.from(t.childNodes)}function yi(t,e){e=""+e,t.data!==e&&(t.data=e)}function M(t,e){t.value=e==null?"":e}function Dt(t,e,i,n){i==null?t.style.removeProperty(e):t.style.setProperty(e,i,n?"important":"")}function Ae(t,e,i){for(let n=0;n<t.options.length;n+=1){const s=t.options[n];if(s.__value===e){s.selected=!0;return}}(!i||e!==void 0)&&(t.selectedIndex=-1)}function Pt(t){const e=t.querySelector(":checked");return e&&e.__value}function ie(t,e,i){t.classList.toggle(e,!!i)}function Ra(t,e,{bubbles:i=!1,cancelable:n=!1}={}){return new CustomEvent(t,{detail:e,bubbles:i,cancelable:n})}const Ss=new Map;let ws=0;function xa(t){let e=5381,i=t.length;for(;i--;)e=(e<<5)-e^t.charCodeAt(i);return e>>>0}function Ua(t,e){const i={stylesheet:La(e),rules:{}};return Ss.set(t,i),i}function mr(t,e,i,n,s,o,r,l=0){const a=16.666/n;let d=`{
2
2
  `;for(let b=0;b<=1;b+=a){const C=e+(i-e)*o(b);d+=b*100+`%{${r(C,1-C)}}
3
3
  `}const u=d+`100% {${r(i,1-i)}}
4
- }`,g=`__svelte_${xa(u)}_${l}`,m=_r(t),{stylesheet:v,rules:_}=Ss.get(m)||Ua(m,t);_[g]||(_[g]=!0,v.insertRule(`@keyframes ${g} ${u}`,v.cssRules.length));const k=t.style.animation||"";return t.style.animation=`${k?`${k}, `:""}${g} ${n}ms linear ${s}ms 1 both`,ws+=1,g}function Fa(t,e){const i=(t.style.animation||"").split(", "),n=i.filter(e?o=>o.indexOf(e)<0:o=>o.indexOf("__svelte")===-1),s=i.length-n.length;s&&(t.style.animation=n.join(", "),ws-=s,ws||qa())}function qa(){ps(()=>{ws||(Ss.forEach(t=>{const{ownerNode:e}=t.stylesheet;e&&A(e)}),Ss.clear())})}let Jn;function Xn(t){Jn=t}function vr(){if(!Jn)throw new Error("Function called outside component initialization");return Jn}function Qn(t){vr().$$.on_mount.push(t)}function Ha(t){vr().$$.on_destroy.push(t)}const Dn=[],$=[];let Rn=[];const Co=[],yr=Promise.resolve();let Ao=!1;function br(){Ao||(Ao=!0,yr.then(c))}function Ya(){return br(),yr}function nt(t){Rn.push(t)}function fe(t){Co.push(t)}const Bo=new Set;let xn=0;function c(){if(xn!==0)return;const t=Jn;do{try{for(;xn<Dn.length;){const e=Dn[xn];xn++,Xn(e),Za(e.$$)}}catch(e){throw Dn.length=0,xn=0,e}for(Xn(null),Dn.length=0,xn=0;$.length;)$.pop()();for(let e=0;e<Rn.length;e+=1){const i=Rn[e];Bo.has(i)||(Bo.add(i),i())}Rn.length=0}while(Dn.length);for(;Co.length;)Co.pop()();Ao=!1,Bo.clear(),Xn(t)}function Za(t){if(t.fragment!==null){t.update(),Je(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(nt)}}function Ga(t){const e=[],i=[];Rn.forEach(n=>t.indexOf(n)===-1?e.push(n):i.push(n)),i.forEach(n=>n()),Rn=e}let $n;function Ka(){return $n||($n=Promise.resolve(),$n.then(()=>{$n=null})),$n}function Io(t,e,i){t.dispatchEvent(Ra(`${e?"intro":"outro"}${i}`))}const Ps=new Set;let Yi;function Re(){Yi={r:0,c:[],p:Yi}}function xe(){Yi.r||Je(Yi.c),Yi=Yi.p}function p(t,e){t&&t.i&&(Ps.delete(t),t.i(e))}function I(t,e,i,n){if(t&&t.o){if(Ps.has(t))return;Ps.add(t),Yi.c.push(()=>{Ps.delete(t),n&&(i&&t.d(1),n())}),t.o(e)}else n&&n()}const Ja={duration:0};function kr(t,e,i,n){let o=e(t,i,{direction:"both"}),r=n?0:1,l=null,a=null,d=null,u;function g(){d&&Fa(t,d)}function m(_,k){const b=_.b-r;return k*=Math.abs(b),{a:r,b:_.b,d:b,duration:k,start:_.start,end:_.start+k,group:_.group}}function v(_){const{delay:k=0,duration:b=300,easing:C=Ie,tick:V=E,css:Z}=o||Ja,O={start:Ea()+k,b:_};_||(O.group=Yi,Yi.r+=1),"inert"in t&&(_?u!==void 0&&(t.inert=u):(u=t.inert,t.inert=!0)),l||a?a=O:(Z&&(g(),d=mr(t,r,_,b,k,C,Z)),_&&V(0,1),l=m(O,b),nt(()=>Io(t,_,"start")),Ma(j=>{if(a&&j>a.start&&(l=m(a,b),a=null,Io(t,l.b,"start"),Z&&(g(),d=mr(t,r,l.b,l.duration,0,C,o.css))),l){if(j>=l.end)V(r=l.b,1-r),Io(t,l.b,"end"),a||(l.b?g():--l.group.r||Je(l.group.c)),l=null;else if(j>=l.start){const L=j-l.start;r=l.a+l.d*C(L/l.duration),V(r,1-r)}}return!!(l||a)}))}return{run(_){rn(o)?Ka().then(()=>{o=o({direction:_?"in":"out"}),v(_)}):v(_)},end(){g(),l=a=null}}}function Yt(t){return(t==null?void 0:t.length)!==void 0?t:Array.from(t)}function Xa(t,e){I(t,1,1,()=>{e.delete(t.key)})}function Qa(t,e,i,n,s,o,r,l,a,d,u,g){let m=t.length,v=o.length,_=m;const k={};for(;_--;)k[t[_].key]=_;const b=[],C=new Map,V=new Map,Z=[];for(_=v;_--;){const N=g(s,o,_),K=i(N);let U=r.get(K);U?n&&Z.push(()=>U.p(N,e)):(U=d(K,N),U.c()),C.set(K,b[_]=U),K in k&&V.set(K,Math.abs(_-k[K]))}const O=new Set,j=new Set;function L(N){p(N,1),N.m(l,u),r.set(N.key,N),u=N.first,v--}for(;m&&v;){const N=b[v-1],K=t[m-1],U=N.key,X=K.key;N===K?(u=N.first,m--,v--):C.has(X)?!r.has(U)||O.has(U)?L(N):j.has(X)?m--:V.get(U)>V.get(X)?(j.add(U),L(N)):(O.add(X),m--):(a(K,r),m--)}for(;m--;){const N=t[m];C.has(N.key)||a(N,r)}for(;v;)L(b[v-1]);return Je(Z),b}function he(t,e,i){const n=t.$$.props[e];n!==void 0&&(t.$$.bound[n]=i,i(t.$$.ctx[n]))}function ue(t){t&&t.c()}function re(t,e,i){const{fragment:n,after_update:s}=t.$$;n&&n.m(e,i),nt(()=>{const o=t.$$.on_mount.map(Ht).filter(rn);t.$$.on_destroy?t.$$.on_destroy.push(...o):Je(o),t.$$.on_mount=[]}),s.forEach(nt)}function le(t,e){const i=t.$$;i.fragment!==null&&(Ga(i.after_update),Je(i.on_destroy),i.fragment&&i.fragment.d(e),i.on_destroy=i.fragment=null,i.ctx=[])}function $a(t,e){t.$$.dirty[0]===-1&&(Dn.push(t),br(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function ke(t,e,i,n,s,o,r,l=[-1]){const a=Jn;Xn(t);const d=t.$$={fragment:null,ctx:[],props:o,update:E,not_equal:s,bound:Kn(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:Kn(),dirty:l,skip_bound:!1,root:e.target||a.$$.root};r&&r(d.root);let u=!1;if(d.ctx=i?i(t,e.props||{},(g,m,...v)=>{const _=v.length?v[0]:m;return d.ctx&&s(d.ctx[g],d.ctx[g]=_)&&(!d.skip_bound&&d.bound[g]&&d.bound[g](_),u&&$a(t,g)),m}):[],d.update(),u=!0,Je(d.before_update),d.fragment=n?n(d.ctx):!1,e.target){if(e.hydrate){const g=Da(e.target);d.fragment&&d.fragment.l(g),g.forEach(A)}else d.fragment&&d.fragment.c();e.intro&&p(t.$$.fragment),re(t,e.target,e.anchor),c()}Xn(a)}class pe{constructor(){nr(this,"$$");nr(this,"$$set")}$destroy(){le(this,1),this.$destroy=E}$on(e,i){if(!rn(i))return E;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(i),()=>{const s=n.indexOf(i);s!==-1&&n.splice(s,1)}}$set(e){this.$$set&&!ja(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const eu="4";typeof window!="undefined"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(eu);const tu="@beyondwords/player",Ts="0.1.13",li=(t,e)=>{t=[t].flat().join(`
4
+ }`,g=`__svelte_${xa(u)}_${l}`,m=_r(t),{stylesheet:v,rules:_}=Ss.get(m)||Ua(m,t);_[g]||(_[g]=!0,v.insertRule(`@keyframes ${g} ${u}`,v.cssRules.length));const k=t.style.animation||"";return t.style.animation=`${k?`${k}, `:""}${g} ${n}ms linear ${s}ms 1 both`,ws+=1,g}function Fa(t,e){const i=(t.style.animation||"").split(", "),n=i.filter(e?o=>o.indexOf(e)<0:o=>o.indexOf("__svelte")===-1),s=i.length-n.length;s&&(t.style.animation=n.join(", "),ws-=s,ws||qa())}function qa(){ps(()=>{ws||(Ss.forEach(t=>{const{ownerNode:e}=t.stylesheet;e&&A(e)}),Ss.clear())})}let Jn;function Xn(t){Jn=t}function vr(){if(!Jn)throw new Error("Function called outside component initialization");return Jn}function Qn(t){vr().$$.on_mount.push(t)}function Ha(t){vr().$$.on_destroy.push(t)}const Dn=[],$=[];let Rn=[];const Co=[],yr=Promise.resolve();let Ao=!1;function br(){Ao||(Ao=!0,yr.then(c))}function Ya(){return br(),yr}function nt(t){Rn.push(t)}function fe(t){Co.push(t)}const Bo=new Set;let xn=0;function c(){if(xn!==0)return;const t=Jn;do{try{for(;xn<Dn.length;){const e=Dn[xn];xn++,Xn(e),Za(e.$$)}}catch(e){throw Dn.length=0,xn=0,e}for(Xn(null),Dn.length=0,xn=0;$.length;)$.pop()();for(let e=0;e<Rn.length;e+=1){const i=Rn[e];Bo.has(i)||(Bo.add(i),i())}Rn.length=0}while(Dn.length);for(;Co.length;)Co.pop()();Ao=!1,Bo.clear(),Xn(t)}function Za(t){if(t.fragment!==null){t.update(),Je(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(nt)}}function Ga(t){const e=[],i=[];Rn.forEach(n=>t.indexOf(n)===-1?e.push(n):i.push(n)),i.forEach(n=>n()),Rn=e}let $n;function Ka(){return $n||($n=Promise.resolve(),$n.then(()=>{$n=null})),$n}function Io(t,e,i){t.dispatchEvent(Ra(`${e?"intro":"outro"}${i}`))}const Ps=new Set;let Yi;function Re(){Yi={r:0,c:[],p:Yi}}function xe(){Yi.r||Je(Yi.c),Yi=Yi.p}function p(t,e){t&&t.i&&(Ps.delete(t),t.i(e))}function I(t,e,i,n){if(t&&t.o){if(Ps.has(t))return;Ps.add(t),Yi.c.push(()=>{Ps.delete(t),n&&(i&&t.d(1),n())}),t.o(e)}else n&&n()}const Ja={duration:0};function kr(t,e,i,n){let o=e(t,i,{direction:"both"}),r=n?0:1,l=null,a=null,d=null,u;function g(){d&&Fa(t,d)}function m(_,k){const b=_.b-r;return k*=Math.abs(b),{a:r,b:_.b,d:b,duration:k,start:_.start,end:_.start+k,group:_.group}}function v(_){const{delay:k=0,duration:b=300,easing:C=Ie,tick:V=E,css:Z}=o||Ja,O={start:Ea()+k,b:_};_||(O.group=Yi,Yi.r+=1),"inert"in t&&(_?u!==void 0&&(t.inert=u):(u=t.inert,t.inert=!0)),l||a?a=O:(Z&&(g(),d=mr(t,r,_,b,k,C,Z)),_&&V(0,1),l=m(O,b),nt(()=>Io(t,_,"start")),Ma(j=>{if(a&&j>a.start&&(l=m(a,b),a=null,Io(t,l.b,"start"),Z&&(g(),d=mr(t,r,l.b,l.duration,0,C,o.css))),l){if(j>=l.end)V(r=l.b,1-r),Io(t,l.b,"end"),a||(l.b?g():--l.group.r||Je(l.group.c)),l=null;else if(j>=l.start){const L=j-l.start;r=l.a+l.d*C(L/l.duration),V(r,1-r)}}return!!(l||a)}))}return{run(_){rn(o)?Ka().then(()=>{o=o({direction:_?"in":"out"}),v(_)}):v(_)},end(){g(),l=a=null}}}function Yt(t){return(t==null?void 0:t.length)!==void 0?t:Array.from(t)}function Xa(t,e){I(t,1,1,()=>{e.delete(t.key)})}function Qa(t,e,i,n,s,o,r,l,a,d,u,g){let m=t.length,v=o.length,_=m;const k={};for(;_--;)k[t[_].key]=_;const b=[],C=new Map,V=new Map,Z=[];for(_=v;_--;){const N=g(s,o,_),K=i(N);let U=r.get(K);U?n&&Z.push(()=>U.p(N,e)):(U=d(K,N),U.c()),C.set(K,b[_]=U),K in k&&V.set(K,Math.abs(_-k[K]))}const O=new Set,j=new Set;function L(N){p(N,1),N.m(l,u),r.set(N.key,N),u=N.first,v--}for(;m&&v;){const N=b[v-1],K=t[m-1],U=N.key,X=K.key;N===K?(u=N.first,m--,v--):C.has(X)?!r.has(U)||O.has(U)?L(N):j.has(X)?m--:V.get(U)>V.get(X)?(j.add(U),L(N)):(O.add(X),m--):(a(K,r),m--)}for(;m--;){const N=t[m];C.has(N.key)||a(N,r)}for(;v;)L(b[v-1]);return Je(Z),b}function he(t,e,i){const n=t.$$.props[e];n!==void 0&&(t.$$.bound[n]=i,i(t.$$.ctx[n]))}function ue(t){t&&t.c()}function re(t,e,i){const{fragment:n,after_update:s}=t.$$;n&&n.m(e,i),nt(()=>{const o=t.$$.on_mount.map(Ht).filter(rn);t.$$.on_destroy?t.$$.on_destroy.push(...o):Je(o),t.$$.on_mount=[]}),s.forEach(nt)}function le(t,e){const i=t.$$;i.fragment!==null&&(Ga(i.after_update),Je(i.on_destroy),i.fragment&&i.fragment.d(e),i.on_destroy=i.fragment=null,i.ctx=[])}function $a(t,e){t.$$.dirty[0]===-1&&(Dn.push(t),br(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function ke(t,e,i,n,s,o,r,l=[-1]){const a=Jn;Xn(t);const d=t.$$={fragment:null,ctx:[],props:o,update:E,not_equal:s,bound:Kn(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:Kn(),dirty:l,skip_bound:!1,root:e.target||a.$$.root};r&&r(d.root);let u=!1;if(d.ctx=i?i(t,e.props||{},(g,m,...v)=>{const _=v.length?v[0]:m;return d.ctx&&s(d.ctx[g],d.ctx[g]=_)&&(!d.skip_bound&&d.bound[g]&&d.bound[g](_),u&&$a(t,g)),m}):[],d.update(),u=!0,Je(d.before_update),d.fragment=n?n(d.ctx):!1,e.target){if(e.hydrate){const g=Da(e.target);d.fragment&&d.fragment.l(g),g.forEach(A)}else d.fragment&&d.fragment.c();e.intro&&p(t.$$.fragment),re(t,e.target,e.anchor),c()}Xn(a)}class pe{constructor(){nr(this,"$$");nr(this,"$$set")}$destroy(){le(this,1),this.$destroy=E}$on(e,i){if(!rn(i))return E;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(i),()=>{const s=n.indexOf(i);s!==-1&&n.splice(s,1)}}$set(e){this.$$set&&!ja(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const eu="4";typeof window!="undefined"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(eu);const tu="@beyondwords/player",Ts="0.1.14",li=(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
  `),te=y("select"),ei=y("option"),ei.textContent="all",_n=y("option"),_n.textContent="body",mn=y("option"),mn.textContent="none",vn=y("option"),vn.textContent="all-none",yn=y("option"),yn.textContent="none-all",vo=H(),Bn=y("div"),yo=Q(`segmentWidgetPosition:
55
55
  `),Ei=y("select");for(let de=0;de<12;de+=1)In[de].c();bo=H(),si&&si.c(),vs=H(),ko=y("br"),po=H(),Ii.c(),T(i,"class","heading svelte-g76q0j"),d.__value="small",M(d,d.__value),u.__value="standard",M(u,u.__value),g.__value="large",M(g,g.__value),m.__value="video",M(m,m.__value),T(a,"tabindex",-1),T(a,"class","svelte-g76q0j"),t[6]===void 0&&nt(()=>t[45].call(a)),T(r,"class","control svelte-g76q0j"),C.__value="stopped",M(C,C.__value),V.__value="playing",M(V,V.__value),Z.__value="paused",M(Z,Z.__value),T(b,"tabindex",-1),T(b,"class","svelte-g76q0j"),t[20]===void 0&&nt(()=>t[46].call(b)),T(_,"class","control svelte-g76q0j"),T(N,"tabindex",-1),T(N,"type","text"),T(N,"class","svelte-g76q0j"),T(j,"class","control svelte-g76q0j"),T(Te,"tabindex",-1),T(Te,"type","text"),T(Te,"class","svelte-g76q0j"),T(U,"class","control svelte-g76q0j"),F.__value="auto",M(F,F.__value),se.__value="segments",M(se,se.__value),ge.__value="seconds",M(ge,ge.__value),G.__value="seconds-15",M(G,G.__value),ae.__value="seconds-15-30",M(ae,ae.__value),w.__value="tracks",M(w,w.__value),T(ee,"tabindex",-1),T(ee,"class","svelte-g76q0j"),t[9]===void 0&&nt(()=>t[49].call(ee)),T(be,"class","control svelte-g76q0j"),J.__value="auto",M(J,J.__value),Ce.__value="show",M(Ce,Ce.__value),Be.__value="show-3",M(Be,Be.__value),Ue.__value="show-999",M(Ue,Ue.__value),He.__value="hide",M(He,He.__value),T(Ve,"tabindex",-1),T(Ve,"class","svelte-g76q0j"),t[10]===void 0&&nt(()=>t[50].call(Ve)),T(we,"class","control svelte-g76q0j"),Ee.__value="auto",M(Ee,Ee.__value),$e.__value="show",M($e,$e.__value),Ze.__value="hide",M(Ze,Ze.__value),T(je,"tabindex",-1),T(je,"class","svelte-g76q0j"),t[11]===void 0&&nt(()=>t[51].call(je)),T(_t,"class","control svelte-g76q0j"),Ne.__value=-1,M(Ne,Ne.__value),T(tt,"tabindex",-1),T(tt,"class","svelte-g76q0j"),t[15]===void 0&&nt(()=>t[52].call(tt)),T(Xe,"class","control svelte-g76q0j"),lt.__value="small",M(lt,lt.__value),ot.__value="standard",M(ot,ot.__value),Bt.__value="large",M(Bt,Bt.__value),qe.__value="video",M(qe,qe.__value),T(Fe,"tabindex",-1),T(Fe,"class","svelte-g76q0j"),t[22]===void 0&&nt(()=>t[53].call(Fe)),T(Ge,"class","control svelte-g76q0j"),De.__value="auto",M(De,De.__value),Qe.__value="left",M(Qe,Qe.__value),Ke.__value="center",M(Ke,Ke.__value),mt.__value="right",M(mt,mt.__value),T(Le,"tabindex",-1),T(Le,"class","svelte-g76q0j"),t[23]===void 0&&nt(()=>t[54].call(Le)),T(gt,"class","control svelte-g76q0j"),ut.__value="auto",M(ut,ut.__value),zt.__value="400px",M(zt,zt.__value),Vt.__value="30rem",M(Vt,Vt.__value),Lt.__value="fit-content",M(Lt,Lt.__value),ct.__value="initial",M(ct,ct.__value),xt.__value="0",M(xt,xt.__value),T(Ye,"tabindex",-1),T(Ye,"class","svelte-g76q0j"),t[24]===void 0&&nt(()=>t[55].call(Ye)),T(It,"class","control svelte-g76q0j"),T(dt,"tabindex",-1),T(dt,"type","text"),T(dt,"class","svelte-g76q0j"),T(R,"class","control svelte-g76q0j"),T(oe,"tabindex",-1),T(oe,"type","text"),T(oe,"class","svelte-g76q0j"),T(S,"class","control svelte-g76q0j"),T(Nt,"tabindex",-1),T(Nt,"type","text"),T(Nt,"class","svelte-g76q0j"),T(ai,"class","control svelte-g76q0j"),T(ft,"tabindex",-1),T(ft,"type","text"),T(ft,"class","svelte-g76q0j"),T(ui,"class","control svelte-g76q0j"),Ut.__value="all",M(Ut,Ut.__value),ji.__value="body",M(ji,ji.__value),Ft.__value="none",M(Ft,Ft.__value),Bi.__value="all-none",M(Bi,Bi.__value),ci.__value="none-all",M(ci,ci.__value),T(Wt,"tabindex",-1),T(Wt,"class","svelte-g76q0j"),t[33]===void 0&&nt(()=>t[60].call(Wt)),T(ni,"class","control svelte-g76q0j"),di.__value="all",M(di,di.__value),vt.__value="body",M(vt,vt.__value),gi.__value="none",M(gi,gi.__value),yt.__value="all-none",M(yt,yt.__value),fi.__value="none-all",M(fi,fi.__value),T(qt,"tabindex",-1),T(qt,"class","svelte-g76q0j"),t[34]===void 0&&nt(()=>t[61].call(qt)),T($t,"class","control svelte-g76q0j"),ei.__value="all",M(ei,ei.__value),_n.__value="body",M(_n,_n.__value),mn.__value="none",M(mn,mn.__value),vn.__value="all-none",M(vn,vn.__value),yn.__value="none-all",M(yn,yn.__value),T(te,"tabindex",-1),T(te,"class","svelte-g76q0j"),t[35]===void 0&&nt(()=>t[62].call(te)),T(W,"class","control svelte-g76q0j"),T(Ei,"tabindex",-1),T(Ei,"class","svelte-g76q0j"),t[36]===void 0&&nt(()=>t[63].call(Ei)),T(Bn,"class","control svelte-g76q0j"),T(e,"class","control-panel")},m(de,rt){B(de,e,rt),f(e,i),f(e,n),f(e,s),f(e,o),f(e,r),f(r,l),f(r,a),f(a,d),f(a,u),f(a,g),f(a,m),Ae(a,t[6],!0),f(e,v),f(e,_),f(_,k),f(_,b),f(b,C),f(b,V),f(b,Z),Ae(b,t[20],!0),f(e,O),f(e,j),f(j,L),f(j,N),M(N,t[7]),f(e,K),f(e,U),f(U,X),f(U,Te),M(Te,t[8]),f(e,ve),f(e,be),f(be,ne),f(be,ee),f(ee,F),f(ee,se),f(ee,ge),f(ee,G),f(ee,ae),f(ee,w),Ae(ee,t[9],!0),f(e,q),f(e,we),f(we,Pe),f(we,Ve),f(Ve,J),f(Ve,Ce),f(Ve,Be),f(Ve,Ue),f(Ve,He),Ae(Ve,t[10],!0),f(e,st),f(e,_t),f(_t,kt),f(_t,je),f(je,Ee),f(je,$e),f(je,Ze),Ae(je,t[11],!0),f(e,At),f(e,Xe),f(Xe,et),f(Xe,tt),f(tt,Ne);for(let bt=0;bt<ti.length;bt+=1)ti[bt]&&ti[bt].m(tt,null);Ae(tt,t[15],!0),f(e,it),f(e,Ge),f(Ge,ht),f(Ge,Fe),f(Fe,lt),f(Fe,ot),f(Fe,Bt),f(Fe,qe),Ae(Fe,t[22],!0),f(e,pt),f(e,gt),f(gt,x),f(gt,Le),f(Le,De),f(Le,Qe),f(Le,Ke),f(Le,mt),Ae(Le,t[23],!0),f(e,at),f(e,It),f(It,St),f(It,Ye),f(Ye,ut),f(Ye,zt),f(Ye,Vt),f(Ye,Lt),f(Ye,ct),f(Ye,xt),Ae(Ye,t[24],!0),f(e,Qt),f(e,R),f(R,wt),f(R,dt),M(dt,t[26]),f(e,ce),f(e,S),f(S,P),f(S,oe),M(oe,t[27]),f(e,jt),f(e,ai),f(ai,Ai),f(ai,Nt),M(Nt,t[28]),f(e,nn),f(e,ui),f(ui,fn),f(ui,ft),M(ft,t[29]),f(e,pi),f(e,ni),f(ni,Si),f(ni,Wt),f(Wt,Ut),f(Wt,ji),f(Wt,Ft),f(Wt,Bi),f(Wt,ci),Ae(Wt,t[33],!0),f(e,An),f(e,$t),f($t,hn),f($t,qt),f(qt,di),f(qt,vt),f(qt,gi),f(qt,yt),f(qt,fi),Ae(qt,t[34],!0),f(e,Mt),f(e,W),f(W,Y),f(W,te),f(te,ei),f(te,_n),f(te,mn),f(te,vn),f(te,yn),Ae(te,t[35],!0),f(e,vo),f(e,Bn),f(Bn,yo),f(Bn,Ei);for(let bt=0;bt<12;bt+=1)In[bt]&&In[bt].m(Ei,null);Ae(Ei,t[36],!0),f(e,bo),si&&si.m(e,null),f(e,vs),f(e,ko),f(e,po),Ii.m(e,null),ys||(So=[D(a,"change",t[45]),D(b,"change",t[46]),D(N,"input",t[47]),D(Te,"input",t[48]),D(ee,"change",t[49]),D(Ve,"change",t[50]),D(je,"change",t[51]),D(tt,"change",t[52]),D(Fe,"change",t[53]),D(Le,"change",t[54]),D(Ye,"change",t[55]),D(dt,"input",t[56]),D(oe,"input",t[57]),D(Nt,"input",t[58]),D(ft,"input",t[59]),D(Wt,"change",t[60]),D(qt,"change",t[61]),D(te,"change",t[62]),D(Ei,"change",t[63])],ys=!0)},p(de,rt){if(rt[0]&64&&Ae(a,de[6]),rt[0]&1048576&&Ae(b,de[20]),rt[0]&128&&N.value!==de[7]&&M(N,de[7]),rt[0]&256&&Te.value!==de[8]&&M(Te,de[8]),rt[0]&512&&Ae(ee,de[9]),rt[0]&1024&&Ae(Ve,de[10]),rt[0]&2048&&Ae(je,de[11]),rt[1]&4096){bn=Yt(de[43]);let bt;for(bt=0;bt<bn.length;bt+=1){const Po=pl(de,bn,bt);ti[bt]?ti[bt].p(Po,rt):(ti[bt]=Sl(Po),ti[bt].c(),ti[bt].m(tt,null))}for(;bt<ti.length;bt+=1)ti[bt].d(1);ti.length=bn.length}rt[0]&32768&&Ae(tt,de[15]),rt[0]&4194304&&Ae(Fe,de[22]),rt[0]&8388608&&Ae(Le,de[23]),rt[0]&16777216&&Ae(Ye,de[24]),rt[0]&67108864&&dt.value!==de[26]&&M(dt,de[26]),rt[0]&134217728&&oe.value!==de[27]&&M(oe,de[27]),rt[0]&268435456&&Nt.value!==de[28]&&M(Nt,de[28]),rt[0]&536870912&&ft.value!==de[29]&&M(ft,de[29]),rt[1]&4&&Ae(Wt,de[33]),rt[1]&8&&Ae(qt,de[34]),rt[1]&16&&Ae(te,de[35]),rt[1]&32&&Ae(Ei,de[36]),de[44]?si?si.p(de,rt):(si=wl(de),si.c(),si.m(e,vs)):si&&(si.d(1),si=null),Gn===(Gn=wo(de))&&Ii?Ii.p(de,rt):(Ii.d(1),Ii=Gn(de),Ii&&(Ii.c(),Ii.m(e,null)))},i:E,o:E,d(de){de&&A(e),ln(ti,de),ln(In,de),si&&si.d(),Ii.d(),ys=!1,Je(So)}}}function X_(t,e,i){import(BeyondWords.Player.styleSrc );let{projectId:n}=e,{contentId:s}=e,{playlistId:o}=e,{sourceId:r}=e,{sourceUrl:l}=e,{showUserInterface:a}=e,{playerStyle:d}=e,{playerTitle:u}=e,{callToAction:g}=e,{skipButtonStyle:m}=e,{playlistStyle:v}=e,{playlistToggle:_}=e,{mediaSession:k}=e,{content:b}=e,{contentIndex:C}=e,{introsOutros:V}=e,{introsOutrosIndex:Z}=e,{adverts:O}=e,{advertIndex:j}=e,{persistentAdImage:L}=e,{persistentIndex:N}=e,{duration:K}=e,{currentTime:U}=e,{playbackState:X}=e,{playbackRate:Te}=e,{widgetStyle:ve}=e,{widgetPosition:be}=e,{widgetWidth:ne}=e,{widgetTarget:ee}=e,{textColor:F}=e,{backgroundColor:se}=e,{iconColor:ge}=e,{highlightColor:G}=e,{videoTextColor:ae}=e,{videoIconColor:w}=e,{logoIconEnabled:q}=e,{highlightSections:we}=e,{clickableSections:Pe}=e,{segmentWidgetSections:Ve}=e,{segmentWidgetPosition:J}=e,{advertConsent:Ce}=e,{analyticsConsent:Be}=e,{analyticsCustomUrl:Ue}=e,{analyticsTag:He}=e,st=!1;function _t(){d=Pt(this),i(6,d)}function kt(){X=Pt(this),i(20,X)}function je(){u=this.value,i(7,u)}function Ee(){g=this.value,i(8,g)}function $e(){m=Pt(this),i(9,m)}function Ze(){v=Pt(this),i(10,v)}function At(){_=Pt(this),i(11,_)}function Xe(){j=Pt(this),i(15,j)}function et(){ve=Pt(this),i(22,ve)}function tt(){be=Pt(this),i(23,be)}function Ne(){ne=Pt(this),i(24,ne)}function it(){F=this.value,i(26,F)}function Ge(){se=this.value,i(27,se)}function ht(){ge=this.value,i(28,ge)}function Fe(){G=this.value,i(29,G)}function lt(){we=Pt(this),i(33,we)}function ot(){Pe=Pt(this),i(34,Pe)}function Bt(){Ve=Pt(this),i(35,Ve)}function qe(){J=Pt(this),i(36,J)}function pt(){n=this.value,i(0,n)}function gt(){s=this.value,i(1,s)}function x(){o=this.value,i(2,o)}function Le(){r=this.value,i(3,r)}function De(){l=this.value,i(4,l)}function Qe(){a=Pt(this),i(5,a)}function Ke(){ae=this.value,i(30,ae)}function mt(){w=this.value,i(31,w)}function at(){k=Pt(this),i(12,k)}function It(){C=Pt(this),i(13,C)}function St(){Z=Pt(this),i(14,Z)}function Ye(){L=Pt(this),i(16,L)}function ut(){N=Pt(this),i(17,N)}function zt(){K=this.value,i(18,K)}function Vt(){U=this.value,i(19,U)}function Lt(){Te=this.value,i(21,Te)}function ct(){ee=this.value,i(25,ee)}function xt(){q=Pt(this),i(32,q)}function Qt(){Ce=Pt(this),i(37,Ce)}function R(){Be=Pt(this),i(38,Be)}function wt(){Ue=this.value,i(39,Ue)}function dt(){He=this.value,i(40,He)}const ce=()=>i(44,st=!1),S=()=>i(44,st=!0);return t.$$set=P=>{"projectId"in P&&i(0,n=P.projectId),"contentId"in P&&i(1,s=P.contentId),"playlistId"in P&&i(2,o=P.playlistId),"sourceId"in P&&i(3,r=P.sourceId),"sourceUrl"in P&&i(4,l=P.sourceUrl),"showUserInterface"in P&&i(5,a=P.showUserInterface),"playerStyle"in P&&i(6,d=P.playerStyle),"playerTitle"in P&&i(7,u=P.playerTitle),"callToAction"in P&&i(8,g=P.callToAction),"skipButtonStyle"in P&&i(9,m=P.skipButtonStyle),"playlistStyle"in P&&i(10,v=P.playlistStyle),"playlistToggle"in P&&i(11,_=P.playlistToggle),"mediaSession"in P&&i(12,k=P.mediaSession),"content"in P&&i(41,b=P.content),"contentIndex"in P&&i(13,C=P.contentIndex),"introsOutros"in P&&i(42,V=P.introsOutros),"introsOutrosIndex"in P&&i(14,Z=P.introsOutrosIndex),"adverts"in P&&i(43,O=P.adverts),"advertIndex"in P&&i(15,j=P.advertIndex),"persistentAdImage"in P&&i(16,L=P.persistentAdImage),"persistentIndex"in P&&i(17,N=P.persistentIndex),"duration"in P&&i(18,K=P.duration),"currentTime"in P&&i(19,U=P.currentTime),"playbackState"in P&&i(20,X=P.playbackState),"playbackRate"in P&&i(21,Te=P.playbackRate),"widgetStyle"in P&&i(22,ve=P.widgetStyle),"widgetPosition"in P&&i(23,be=P.widgetPosition),"widgetWidth"in P&&i(24,ne=P.widgetWidth),"widgetTarget"in P&&i(25,ee=P.widgetTarget),"textColor"in P&&i(26,F=P.textColor),"backgroundColor"in P&&i(27,se=P.backgroundColor),"iconColor"in P&&i(28,ge=P.iconColor),"highlightColor"in P&&i(29,G=P.highlightColor),"videoTextColor"in P&&i(30,ae=P.videoTextColor),"videoIconColor"in P&&i(31,w=P.videoIconColor),"logoIconEnabled"in P&&i(32,q=P.logoIconEnabled),"highlightSections"in P&&i(33,we=P.highlightSections),"clickableSections"in P&&i(34,Pe=P.clickableSections),"segmentWidgetSections"in P&&i(35,Ve=P.segmentWidgetSections),"segmentWidgetPosition"in P&&i(36,J=P.segmentWidgetPosition),"advertConsent"in P&&i(37,Ce=P.advertConsent),"analyticsConsent"in P&&i(38,Be=P.analyticsConsent),"analyticsCustomUrl"in P&&i(39,Ue=P.analyticsCustomUrl),"analyticsTag"in P&&i(40,He=P.analyticsTag)},[n,s,o,r,l,a,d,u,g,m,v,_,k,C,Z,j,L,N,K,U,X,Te,ve,be,ne,ee,F,se,ge,G,ae,w,q,we,Pe,Ve,J,Ce,Be,Ue,He,b,V,O,st,_t,kt,je,Ee,$e,Ze,At,Xe,et,tt,Ne,it,Ge,ht,Fe,lt,ot,Bt,qe,pt,gt,x,Le,De,Qe,Ke,mt,at,It,St,Ye,ut,zt,Vt,Lt,ct,xt,Qt,R,wt,dt,ce,S]}class Q_ extends pe{constructor(e){super(),ke(this,e,X_,J_,_e,{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}),c()}get contentId(){return this.$$.ctx[1]}set contentId(e){this.$$set({contentId:e}),c()}get playlistId(){return this.$$.ctx[2]}set playlistId(e){this.$$set({playlistId:e}),c()}get sourceId(){return this.$$.ctx[3]}set sourceId(e){this.$$set({sourceId:e}),c()}get sourceUrl(){return this.$$.ctx[4]}set sourceUrl(e){this.$$set({sourceUrl:e}),c()}get showUserInterface(){return this.$$.ctx[5]}set showUserInterface(e){this.$$set({showUserInterface:e}),c()}get playerStyle(){return this.$$.ctx[6]}set playerStyle(e){this.$$set({playerStyle:e}),c()}get playerTitle(){return this.$$.ctx[7]}set playerTitle(e){this.$$set({playerTitle:e}),c()}get callToAction(){return this.$$.ctx[8]}set callToAction(e){this.$$set({callToAction:e}),c()}get skipButtonStyle(){return this.$$.ctx[9]}set skipButtonStyle(e){this.$$set({skipButtonStyle:e}),c()}get playlistStyle(){return this.$$.ctx[10]}set playlistStyle(e){this.$$set({playlistStyle:e}),c()}get playlistToggle(){return this.$$.ctx[11]}set playlistToggle(e){this.$$set({playlistToggle:e}),c()}get mediaSession(){return this.$$.ctx[12]}set mediaSession(e){this.$$set({mediaSession:e}),c()}get content(){return this.$$.ctx[41]}set content(e){this.$$set({content:e}),c()}get contentIndex(){return this.$$.ctx[13]}set contentIndex(e){this.$$set({contentIndex:e}),c()}get introsOutros(){return this.$$.ctx[42]}set introsOutros(e){this.$$set({introsOutros:e}),c()}get introsOutrosIndex(){return this.$$.ctx[14]}set introsOutrosIndex(e){this.$$set({introsOutrosIndex:e}),c()}get adverts(){return this.$$.ctx[43]}set adverts(e){this.$$set({adverts:e}),c()}get advertIndex(){return this.$$.ctx[15]}set advertIndex(e){this.$$set({advertIndex:e}),c()}get persistentAdImage(){return this.$$.ctx[16]}set persistentAdImage(e){this.$$set({persistentAdImage:e}),c()}get persistentIndex(){return this.$$.ctx[17]}set persistentIndex(e){this.$$set({persistentIndex:e}),c()}get duration(){return this.$$.ctx[18]}set duration(e){this.$$set({duration:e}),c()}get currentTime(){return this.$$.ctx[19]}set currentTime(e){this.$$set({currentTime:e}),c()}get playbackState(){return this.$$.ctx[20]}set playbackState(e){this.$$set({playbackState:e}),c()}get playbackRate(){return this.$$.ctx[21]}set playbackRate(e){this.$$set({playbackRate:e}),c()}get widgetStyle(){return this.$$.ctx[22]}set widgetStyle(e){this.$$set({widgetStyle:e}),c()}get widgetPosition(){return this.$$.ctx[23]}set widgetPosition(e){this.$$set({widgetPosition:e}),c()}get widgetWidth(){return this.$$.ctx[24]}set widgetWidth(e){this.$$set({widgetWidth:e}),c()}get widgetTarget(){return this.$$.ctx[25]}set widgetTarget(e){this.$$set({widgetTarget:e}),c()}get textColor(){return this.$$.ctx[26]}set textColor(e){this.$$set({textColor:e}),c()}get backgroundColor(){return this.$$.ctx[27]}set backgroundColor(e){this.$$set({backgroundColor:e}),c()}get iconColor(){return this.$$.ctx[28]}set iconColor(e){this.$$set({iconColor:e}),c()}get highlightColor(){return this.$$.ctx[29]}set highlightColor(e){this.$$set({highlightColor:e}),c()}get videoTextColor(){return this.$$.ctx[30]}set videoTextColor(e){this.$$set({videoTextColor:e}),c()}get videoIconColor(){return this.$$.ctx[31]}set videoIconColor(e){this.$$set({videoIconColor:e}),c()}get logoIconEnabled(){return this.$$.ctx[32]}set logoIconEnabled(e){this.$$set({logoIconEnabled:e}),c()}get highlightSections(){return this.$$.ctx[33]}set highlightSections(e){this.$$set({highlightSections:e}),c()}get clickableSections(){return this.$$.ctx[34]}set clickableSections(e){this.$$set({clickableSections:e}),c()}get segmentWidgetSections(){return this.$$.ctx[35]}set segmentWidgetSections(e){this.$$set({segmentWidgetSections:e}),c()}get segmentWidgetPosition(){return this.$$.ctx[36]}set segmentWidgetPosition(e){this.$$set({segmentWidgetPosition:e}),c()}get advertConsent(){return this.$$.ctx[37]}set advertConsent(e){this.$$set({advertConsent:e}),c()}get analyticsConsent(){return this.$$.ctx[38]}set analyticsConsent(e){this.$$set({analyticsConsent:e}),c()}get analyticsCustomUrl(){return this.$$.ctx[39]}set analyticsCustomUrl(e){this.$$set({analyticsCustomUrl:e}),c()}get analyticsTag(){return this.$$.ctx[40]}set analyticsTag(e){this.$$set({analyticsTag:e}),c()}}const $_=(t,e,i)=>{im(t);const n=new Image;return n.setAttribute("crossorigin","anonymous"),new Promise((s,o)=>{n.addEventListener("load",em(n,e,i,s,o)),n.addEventListener("error",o),n.src=t})},em=(t,e,i,n,s)=>()=>{const o=document.createElement("canvas"),r=o.getContext("2d");o.width=e,o.height=i,r.drawImage(t,0,0,e,i),o.toBlob(tm(t,e,i,n,s))},Zn={},tm=(t,e,i,n,s)=>o=>{var l;o||s();const r=URL.createObjectURL(o);Zn[l=t.src]||(Zn[l]=[]),Zn[t.src].push(r),n({src:r,sizes:`${e}x${i}`,type:"image/png"})},im=t=>{Object.keys(Zn).filter(n=>n!==t).map(n=>Zn[n]).flat().forEach(n=>URL.revokeObjectURL(n))},nm=(t,e,i)=>wi(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"}}),sm=(t,e,i)=>Dt(t,e,i,1),om=(t,e,i)=>Se(t,e,e==="style"?lm(i):i),rm=/;(?!([^()]*\([^()]*\))*[^()]*\))/,lm=t=>t.split(rm).filter(e=>e).map(e=>e+" !important").join(";");function Al(t,e,i){const n=t.slice();return n[39]=e[i],n[40]=e,n[41]=i,n}function Bl(t){let e,i,n,s=t[41],o;i=new Qr({props:{fill:t[2],color:t[1],scale:t[39]/18,zoom:.65}});const r=()=>t[36](e,s),l=()=>t[36](null,s);return{c(){e=y("div"),ue(i.$$.fragment),n=H(),sm(e,"display","none")},m(a,d){B(a,e,d),re(i,e,null),f(e,n),r(),o=!0},p(a,d){t=a;const u={};d[0]&4&&(u.fill=t[2]),d[0]&2&&(u.color=t[1]),i.$set(u),s!==t[41]&&(l(),s=t[41],r())},i(a){o||(p(i.$$.fragment,a),o=!0)},o(a){I(i.$$.fragment,a),o=!1},d(a){a&&A(e),le(i),l()}}}function am(t){let e,i,n=Yt(t[3]),s=[];for(let r=0;r<n.length;r+=1)s[r]=Bl(Al(t,n,r));const o=r=>I(s[r],1,1,()=>{s[r]=null});return{c(){e=y("div");for(let r=0;r<s.length;r+=1)s[r].c();om(e,"class","media-session")},m(r,l){B(r,e,l);for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(e,null);i=!0},p(r,l){if(l[0]&15){n=Yt(r[3]);let a;for(a=0;a<n.length;a+=1){const d=Al(r,n,a);s[a]?(s[a].p(d,l),p(s[a],1)):(s[a]=Bl(d),s[a].c(),p(s[a],1),s[a].m(e,null))}for(Re(),a=n.length;a<s.length;a+=1)o(a);xe()}},i(r){if(!i){for(let l=0;l<n.length;l+=1)p(s[l]);i=!0}},o(r){s=s.filter(Boolean);for(let l=0;l<s.length;l+=1)I(s[l]);i=!1},d(r){r&&A(e),ln(s,r)}}}function um(t,e,i){let n,s,o,r,l,a,d,u,g,m,v,_,k,b,C,V,Z,O,j,L,N;const K=[96,128,192,256,384,512],U=["hangup","nextslide","nexttrack","pause","play","previousslide","previoustrack","seekbackward","seekforward","seekto","skipad","stop","togglecamera","togglemicrophone"];let{content:X=[]}=e,{contentIndex:Te=0}=e,{activeAdvert:ve=void 0}=e,{persistentAdvert:be=void 0}=e,{duration:ne=0}=e,{playbackState:ee="stopped"}=e,{skipButtonStyle:F="auto"}=e,{backgroundColor:se="#f5f5f5"}=e,{iconColor:ge="black"}=e,{onEvent:G=()=>{}}=e,ae=[],w=new Set,q=K.map(()=>{}),we=K.map(()=>{});const Pe=()=>i(15,w=w.add(b));function Ve(J,Ce){$[J?"unshift":"push"](()=>{q[Ce]=J,i(0,q)})}return t.$$set=J=>{"content"in J&&i(4,X=J.content),"contentIndex"in J&&i(5,Te=J.contentIndex),"activeAdvert"in J&&i(6,ve=J.activeAdvert),"persistentAdvert"in J&&i(7,be=J.persistentAdvert),"duration"in J&&i(8,ne=J.duration),"playbackState"in J&&i(9,ee=J.playbackState),"skipButtonStyle"in J&&i(10,F=J.skipButtonStyle),"backgroundColor"in J&&i(11,se=J.backgroundColor),"iconColor"in J&&i(12,ge=J.iconColor),"onEvent"in J&&i(13,G=J.onEvent)},t.$$.update=()=>{t.$$.dirty[0]&512&&i(33,n=ee==="stopped"),t.$$.dirty[0]&64|t.$$.dirty[1]&4&&i(34,s=ve&&!n),t.$$.dirty[0]&16&&i(35,o=X.length>1),t.$$.dirty[0]&48&&i(27,r=X[Te]),t.$$.dirty[0]&1024|t.$$.dirty[1]&16&&i(19,l=F==="auto"?o?"tracks":"segments":F),t.$$.dirty[0]&524288&&i(21,a=parseFloat(l.split("-")[1]||10)),t.$$.dirty[0]&2621440&&i(18,d=parseFloat(l.split("-")[2]||a)),t.$$.dirty[0]&524288|t.$$.dirty[1]&8&&i(20,u=!s&&l!=="tracks"),t.$$.dirty[0]&524288|t.$$.dirty[1]&8&&i(17,g=!s&&l==="tracks"),t.$$.dirty[1]&8&&i(22,m=!s),t.$$.dirty[0]&2112|t.$$.dirty[1]&8&&i(2,v=s&&(ve==null?void 0:ve.backgroundColor)||se),t.$$.dirty[0]&4160|t.$$.dirty[1]&8&&i(1,_=s&&(ve==null?void 0:ve.iconColor)||ge),t.$$.dirty[0]&7&&i(16,we=K.map((J,Ce)=>Ya().then(()=>q[Ce]))),t.$$.dirty[0]&134217920|t.$$.dirty[1]&12&&i(32,k=s&&ve.imageUrl||!n&&(be==null?void 0:be.imageUrl)||(r==null?void 0:r.imageUrl)),t.$$.dirty[0]&32768|t.$$.dirty[1]&2&&i(28,b=w.has(k)?null:k),t.$$.dirty[0]&268435456&&i(31,C=b?K.map(J=>$_(b,J,J)):[]),t.$$.dirty[0]&268435456&&i(30,V=b?[{src:b,sizes:"any"}]:[]),t.$$.dirty[0]&268500992&&i(29,Z=b?[]:K.map((J,Ce)=>nm(we[Ce],J,J))),t.$$.dirty[0]&1610612736|t.$$.dirty[1]&1&&i(26,O=Promise.all([...C,...V,...Z])),t.$$.dirty[0]&134217728&&i(25,j=(r==null?void 0:r.title)||""),t.$$.dirty[0]&67108864&&O.then(J=>i(14,ae=J)).catch(Pe),t.$$.dirty[0]&58736640&&(navigator.mediaSession.metadata=new MediaMetadata({title:j,artist:L,album:N,artwork:ae})),t.$$.dirty[0]&8192&&navigator.mediaSession.setActionHandler("play",()=>{G(me({type:"PressedPlay",description:"The play button was pressed.",initiatedBy:"media-session-api"}))}),t.$$.dirty[0]&8192&&navigator.mediaSession.setActionHandler("pause",()=>{G(me({type:"PressedPause",description:"The pause button was pressed.",initiatedBy:"media-session-api"}))}),t.$$.dirty[0]&4202752&&navigator.mediaSession.setActionHandler("seekto",m?({seekTime:J})=>{G(me({type:"ScrubbedProgressBar",description:"The user pressed on the progress bar then dragged.",initiatedBy:"media-session-api",ratio:Math.max(0,Math.min(1,J/ne))}))}:null),t.$$.dirty[0]&3678208&&navigator.mediaSession.setActionHandler("seekbackward",u?({seekOffset:J})=>{G(me(l==="seconds"||J?{type:"PressedSeekBack",description:"The seek backward button was pressed.",initiatedBy:"media-session-api",seconds:J||a}:{type:"PressedPrevSegment",description:"The previous segment button was pressed.",initiatedBy:"media-session-api"}))}:null),t.$$.dirty[0]&1843200&&navigator.mediaSession.setActionHandler("seekforward",u?({seekOffset:J})=>{G(me(l==="seconds"||J?{type:"PressedSeekAhead",description:"The seek ahead button was pressed.",initiatedBy:"media-session-api",seconds:J||d}:{type:"PressedNextSegment",description:"The next segment button was pressed.",initiatedBy:"media-session-api"}))}:null),t.$$.dirty[0]&139264&&navigator.mediaSession.setActionHandler("previoustrack",g?()=>{G(me({type:"PressedPrevTrack",description:"The previous track button was pressed.",initiatedBy:"media-session-api"}))}:null),t.$$.dirty[0]&139264&&navigator.mediaSession.setActionHandler("nexttrack",g?()=>{G(me({type:"PressedNextTrack",description:"The next track button was pressed.",initiatedBy:"media-session-api"}))}:null)},i(24,L=""),i(23,N=""),navigator.mediaSession.setByPlayer=!0,U.forEach(J=>{try{navigator.mediaSession.setActionHandler(J,null)}catch(Ce){}}),[q,_,v,K,X,Te,ve,be,ne,ee,F,se,ge,G,ae,w,we,g,d,l,u,a,m,N,L,j,O,r,b,Z,V,C,k,n,s,o,Ve]}class cm extends pe{constructor(e){super(),ke(this,e,um,am,_e,{content:4,contentIndex:5,activeAdvert:6,persistentAdvert:7,duration:8,playbackState:9,skipButtonStyle:10,backgroundColor:11,iconColor:12,onEvent:13},null,[-1,-1])}get content(){return this.$$.ctx[4]}set content(e){this.$$set({content:e}),c()}get contentIndex(){return this.$$.ctx[5]}set contentIndex(e){this.$$set({contentIndex:e}),c()}get activeAdvert(){return this.$$.ctx[6]}set activeAdvert(e){this.$$set({activeAdvert:e}),c()}get persistentAdvert(){return this.$$.ctx[7]}set persistentAdvert(e){this.$$set({persistentAdvert:e}),c()}get duration(){return this.$$.ctx[8]}set duration(e){this.$$set({duration:e}),c()}get playbackState(){return this.$$.ctx[9]}set playbackState(e){this.$$set({playbackState:e}),c()}get skipButtonStyle(){return this.$$.ctx[10]}set skipButtonStyle(e){this.$$set({skipButtonStyle:e}),c()}get backgroundColor(){return this.$$.ctx[11]}set backgroundColor(e){this.$$set({backgroundColor:e}),c()}get iconColor(){return this.$$.ctx[12]}set iconColor(e){this.$$set({iconColor:e}),c()}get onEvent(){return this.$$.ctx[13]}set onEvent(e){this.$$set({onEvent:e}),c()}}const Il=(t,e,i)=>Se(t,e,e==="style"?gm(i):i),dm=/;(?!([^()]*\([^()]*\))*[^()]*\))/,gm=t=>t.split(dm).filter(e=>e).map(e=>e+" !important").join(";");function Vl(t){let e,i,n,s;return{c(){e=y("script"),n=H(),s=y("script"),s.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])||Il(e,"src",i)},m(o,r){B(o,e,r),B(o,n,r),B(o,s,r)},p(o,r){r&1&&!Wi(e.src,i="https://www.googletagmanager.com/gtag/js?id="+o[0])&&Il(e,"src",i)},d(o){o&&(A(e),A(n),A(s))}}}function fm(t){let e,i=!t[1]&&Vl(t);return{c(){i&&i.c(),e=Hi()},m(n,s){i&&i.m(document.head,null),f(document.head,e)},p(n,[s]){n[1]?i&&(i.d(1),i=null):i?i.p(n,s):(i=Vl(n),i.c(),i.m(e.parentNode,e))},i:E,o:E,d(n){i&&i.d(n),A(e)}}}function hm(t,e,i){let n,{analyticsTag:s}=e;return t.$$set=o=>{"analyticsTag"in o&&i(0,s=o.analyticsTag)},i(1,n=window.gtag),[s,n]}class _m extends pe{constructor(e){super(),ke(this,e,hm,fm,_e,{analyticsTag:0})}get analyticsTag(){return this.$$.ctx[0]}set analyticsTag(e){this.$$set({analyticsTag:e}),c()}}const Fv="";class mm extends pe{constructor(e){super(),ke(this,e,null,null,_e,{})}}class qo{constructor(e,i){We(this,us);We(this,Js);this.onSelected=e,this.onDeselected=i,this.consumers={}}addInterest(e,i,...n){var o;(o=this.consumers)[e]||(o[e]=[]);const s=this.consumers[e].slice(-1)[0];this.consumers[e].push({consumerId:i,args:n}),!(s&&z(this,us,or).call(this,n,s.args))&&(s&&this.onDeselected(e,...s.args),this.onSelected(e,...n))}removeInterest(e,i){var r;(r=this.consumers)[e]||(r[e]=[]);const n=this.consumers[e].slice(-1)[0];if(z(this,Js,fa).call(this,this.consumers[e],l=>l.consumerId===i),!(n&&i===n.consumerId))return;const o=this.consumers[e].slice(-1)[0];o&&z(this,us,or).call(this,n.args,o.args)||(this.onDeselected(e,...n.args),o&&this.onSelected(e,...o.args))}}us=new WeakSet,or=function(e,i){return e.length===i.length&&e.every((n,s)=>n===i[s])},Js=new WeakSet,fa=function(e,i){for(let n=e.length-1;n>=0;n-=1)if(i(e[n])){e.splice(n,1);return}};const rs=(t,e,i)=>{let[n,s]=i.split("-");n||(n="none"),s||(s=n);const o=t==="current"?n:s;return o==="all"||o==="body"&&(e==null?void 0:e.section)==="body"},dn="data-beyondwords-marker",Wl=t=>["beyondwords-highlight","bwp",`marker-${t}`],Ki=class Ki{update(e,i,n,s){const o=rs(e,i,n),r=this[`prev${e}`],l=o?i==null?void 0:i.marker:null;l&&Mi(Ki,cs).addInterest(l,this,s),r&&Mi(Ki,cs).removeInterest(r,this),this[`prev${e}`]=l}};cs=new WeakMap,Xs=new WeakSet,ha=function(e,i){const n=document.querySelectorAll(`[${dn}="${e}"]`);for(const s of n){const o=document.createTreeWalker(s,NodeFilter.SHOW_TEXT,null,!1);let r;for(;r=o.nextNode();){if(/^\s*$/.test(r.nodeValue))continue;r.parentNode.nodeName.toLowerCase()==="a"&&(r=r.parentNode);const d=document.createElement("mark");d.classList.add(...Wl(e)),d.style.background=i,r.parentNode.insertBefore(d,r),d.appendChild(r)}}},Qs=new WeakSet,_a=function(e){const i=document.querySelectorAll(`[${dn}="${e}"]`);for(const n of i){const s=n.querySelectorAll(`mark.${Wl(e)}`);for(const o of s)for(const r of o.childNodes)o.parentNode.insertBefore(r,o),o.remove()}},We(Ki,Xs),We(Ki,Qs),We(Ki,cs,new qo(z(Ki,Xs,ha),z(Ki,Qs,_a)));let Ho=Ki;const Ol=["beyondwords-clickable","bwp"],Ji=class Ji{update(e,i){const n=rs("hovered",e,i),s=this.previous,o=n?e==null?void 0:e.marker:null;o&&Mi(Ji,ds).addInterest(o,this),s&&Mi(Ji,ds).removeInterest(s,this),this.previous=o}};ds=new WeakMap,$s=new WeakSet,ma=function(e){const i=document.querySelectorAll(`[${dn}="${e}"]`);for(const n of i)n.classList.add(...Ol)},eo=new WeakSet,va=function(e){const i=document.querySelectorAll(`[${dn}="${e}"]`);for(const n of i)jl(n,Ol)},We(Ji,$s),We(Ji,eo),We(Ji,ds,new qo(z(Ji,$s,ma),z(Ji,eo,va)));let Yo=Ji;const jl=(t,e)=>{if(!t)return;const s=[...t.classList].filter(o=>!e.includes(o)).some(o=>o.startsWith("beyondwords-"))?e.filter(o=>o!=="bwp"):e;t.classList.remove(...s)},El=(t,e,i)=>["beyondwords-widget","bwp",`marker-${t}`,`position-${e}`,`for-${i}-player`],Ml=["beyondwords-relative","bwp"],Xi=class Xi{constructor(e){this.onUpdate=e,this.containers=[]}update(e,i,n,s){const o=i.includes("all")||i.includes("body"),r=this.previous,l=(e==null?void 0:e.marker)||o&&(r==null?void 0:r.marker);l&&Mi(Xi,gs).addInterest(l,this,this,n,s),r&&Mi(Xi,gs).removeInterest(r,this),this.previous=l}reset(){this.update(null,"none")}};gs=new WeakMap,to=new WeakSet,ya=function(e,i,n,s){const o=document.querySelector(`[${dn}="${e}"]`),r=document.createElement("div");if(!o)return;["2-oclock","3-oclock","4-oclock","8-oclock","9-oclock","10-oclock"].includes(n)&&o.classList.add(...Ml),r.classList.add(...El(e,n,s)),["11-oclock","12-oclock","1-oclock"].includes(n)?o.insertBefore(r,o.firstChild):o.appendChild(r),i.containers.push(r),i.onUpdate(i.containers)},io=new WeakSet,ba=function(e,i,n,s){const o=El(e,n,s);for(let r=0;r<i.containers.length;r+=1){if(!o.every(d=>i.containers[r].classList.contains(d)))continue;const a=i.containers[r].parentNode;jl(a,Ml),i.containers[r].remove(),i.containers.splice(r,1),r-=1}i.onUpdate(i.containers)},We(Xi,to),We(Xi,io),We(Xi,gs,new qo(z(Xi,to,ya),z(Xi,io,ba)));let Zo=Xi;const vm=()=>me({type:"IdentifiersChanged",description:"The Player's content identifiers changed.",initiatedBy:"browser"}),wn=(i,...n)=>wi(this,[i,...n],function*(t,e={}){const s=yield fetch(t,e).catch(()=>{}),o=yield s==null?void 0:s.json().catch(()=>{});return(s==null?void 0:s.status)!==200&&li(`Failed to fetch ${t}`,sn(oi({},e),{responseStatus:s==null?void 0:s.status,responseJson:o})),o}),ym=(t,e)=>wn(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e,(i,n)=>n===void 0?null:n)});class bm{constructor(e,i,n){We(this,no);this.baseUrl=z(this,no,ka).call(this,e),this.projectId=i,this.writeToken=n}getWebSocketToken(){return wi(this,null,function*(){const e={Authorization:`Token token=${this.writeToken}`},{token:i}=yield wn(`https://${this.baseUrl}/api/v4/token/ws`,{headers:e});this.webSocketToken=i})}establishConnection(e,i){return wi(this,null,function*(){const n=`wss://${this.baseUrl}/cable?token=${this.webSocketToken}`,s="actioncable-v1-json";this.webSocket=new WebSocket(n,s),this.webSocket.onmessage=o=>e(JSON.parse(o.data)),this.webSocket.onerror=i,yield new Promise(o=>this.webSocket.onopen=o)})}subscribeToStatusChanges(){const e=JSON.stringify({channel:"Api::V1::ProjectChannel",id:this.projectId}),i=JSON.stringify({command:"subscribe",identifier:e});this.webSocket.send(i)}destroy(){this.webSocketToken=null,this.webSocket&&(this.webSocket.onmessage=()=>{},this.webSocket.onerror=()=>{},this.webSocket.close(),this.webSocket=null)}}no=new WeakSet,ka=function(e){return e.includes("staging")?"app.staging-beyondwords.io":"app.beyondwords.io"};let Pn;const km=(t,e,i,n)=>wi(this,null,function*(){!t||!e||!i||(Pn==null||Pn.destroy(),Pn=new bm(t,e,i),yield Pn.getWebSocketToken(),yield Pn.establishConnection(pm(n),Pm),yield Pn.subscribeToStatusChanges())}),pm=t=>e=>{var s,o;((o=(s=e==null?void 0:e.message)==null?void 0:s.result)==null?void 0:o.action)==="podcast_state_updated"&&Sm(e,t),e.type==="reject_subscription"&&wm(e)},Sm=(t,e)=>{const i=t.message.result;e(me({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}))},wm=t=>{li("The WebSocket status change subscription was rejected.",{webSocketEvent:t})},Pm=t=>{li("Unexpected WebSocket error.",{error:t})},zl=t=>{if(!t())return new Promise(e=>{setInterval(()=>t()&&e(),10)})},Ys=t=>{const i=Object.keys(t.$$.props).filter(n=>!Tm.has(n)).map(n=>[n,t[n]]);return Object.fromEntries(i)},Tm=new Set(["addEventListener","removeEventListener","mediaElement","userInterface","widgetInterface","controller"]),Ll=(t,e)=>{const i=new Set([...Object.keys(t),...Object.keys(e)]),n={};for(const s of i){const o=t[s],r=e[s];o!==r&&(n[s]={previousValue:o,currentValue:r})}return n};let ls=-1;const Nl=[],Cm=(t,e,i)=>wi(this,null,function*(){yield zl(()=>e.player);const n=e.player,s=Am(n.contentIndex,i,t);s>ls&&Bm(n,ls,s,t),s<ls&&Im(n,ls,s),ls=s}),Am=(t,e,i)=>{const n=i.findIndex(o=>o[0]===t&&o[1]>e||o[0]>t);return n===-1?i.length-1:n-1},Bm=(t,e,i,n)=>{for(let s=e+1;s<=i;s+=1){const o=Ys(t);n[s][2](t);const r=Ys(t),l=Ll(o,r);Nl.push(l)}},Im=(t,e,i)=>{for(let n=e;n>i;n-=1){const s=Nl.pop();for(const[o,r]of Object.entries(s))t[o]=r.previousValue}},Vm=t=>t?Wm(t)?{newTarget:jm(t),showUserInterface:!0}:typeof t=="string"?{newTarget:Go(t),showUserInterface:!0}:{newTarget:t,showUserInterface:!0}:{newTarget:Om(),showUserInterface:!1},Wm=t=>typeof t=="object"&&t.nodeName.toLowerCase()==="script",Om=()=>{const t=document.createElement("div");return document.body.appendChild(t),t},jm=t=>{const e=document.createElement("div");return t.parentNode.insertBefore(e,t.nextSibling),e},Go=(t,e="player")=>{if(typeof t!="string")return t;const i=document.querySelectorAll(t);return i.length===0&&li(`Failed to initialize ${e} because the target could not be found.`,{target:t,elements:i}),i.length>1&&li(`Failed to initialize ${e} because the target is ambiguous. (${i.length} elements match)`,{target:t,elements:i}),i[0]},Em=["small","standard","large","screen","video"],Ko=t=>Em.indexOf(t)!==-1;function Dl(t,e,i){const n=t.slice();return n[157]=e[i],n}function Mm(t){let e,i,n,s,o,r,l,a;function d(b){t[103](b)}function u(b){t[104](b)}function g(b){t[105](b)}function m(b){t[106](b)}function v(b){t[107](b)}function _(b){t[108](b)}let k={onEvent:t[58],content:t[51],contentIndex:t[7],introOrOutro:t[60],activeAdvert:t[61],advertConsent:t[41],showUserInterface:t[5],videoBehindWidget:t[64],videoBehindStatic:t[69],videoMightBeShown:t[63],widgetPosition:t[33],widgetWidth:t[34],widgetTarget:t[14]};return t[12]!==void 0&&(k.playbackState=t[12]),t[31]!==void 0&&(k.duration=t[31]),t[11]!==void 0&&(k.currentTime=t[11]),t[32]!==void 0&&(k.playbackRate=t[32]),t[48]!==void 0&&(k.prevPercentage=t[48]),t[23]!==void 0&&(k.isLoaded=t[23]),e=new Ud({props:k}),t[102](e),$.push(()=>he(e,"playbackState",d)),$.push(()=>he(e,"duration",u)),$.push(()=>he(e,"currentTime",g)),$.push(()=>he(e,"playbackRate",m)),$.push(()=>he(e,"prevPercentage",v)),$.push(()=>he(e,"isLoaded",_)),{c(){ue(e.$$.fragment)},m(b,C){re(e,b,C),a=!0},p(b,C){const V={};C[1]&1048576&&(V.content=b[51]),C[0]&128&&(V.contentIndex=b[7]),C[1]&536870912&&(V.introOrOutro=b[60]),C[1]&1073741824&&(V.activeAdvert=b[61]),C[1]&1024&&(V.advertConsent=b[41]),C[0]&32&&(V.showUserInterface=b[5]),C[2]&4&&(V.videoBehindWidget=b[64]),C[2]&128&&(V.videoBehindStatic=b[69]),C[2]&2&&(V.videoMightBeShown=b[63]),C[1]&4&&(V.widgetPosition=b[33]),C[1]&8&&(V.widgetWidth=b[34]),C[0]&16384&&(V.widgetTarget=b[14]),!i&&C[0]&4096&&(i=!0,V.playbackState=b[12],fe(()=>i=!1)),!n&&C[1]&1&&(n=!0,V.duration=b[31],fe(()=>n=!1)),!s&&C[0]&2048&&(s=!0,V.currentTime=b[11],fe(()=>s=!1)),!o&&C[1]&2&&(o=!0,V.playbackRate=b[32],fe(()=>o=!1)),!r&&C[1]&131072&&(r=!0,V.prevPercentage=b[48],fe(()=>r=!1)),!l&&C[0]&8388608&&(l=!0,V.isLoaded=b[23],fe(()=>l=!1)),e.$set(V)},i(b){a||(p(e.$$.fragment,b),a=!0)},o(b){I(e.$$.fragment,b),a=!1},d(b){t[102](null),le(e,b)}}}function Rl(t){let e,i,n={onEvent:t[58],playerStyle:t[65],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],activeAdvert:t[61],persistentAdvert:t[72],textColor:t[35],backgroundColor:t[36],iconColor:t[37],videoTextColor:t[38],videoBackgroundColor:t[54],videoIconColor:t[39],logoIconEnabled:t[40],logoImagePosition:t[57],isFullScreen:t[56],videoPosterImage:t[67],videoIsBehind:t[69]};return e=new Uo({props:n}),t[109](e),{c(){ue(e.$$.fragment)},m(s,o){re(e,s,o),i=!0},p(s,o){const r={};o[2]&8&&(r.playerStyle=s[65]),o[0]&33554432&&(r.callToAction=s[25]),o[0]&67108864&&(r.skipButtonStyle=s[26]),o[0]&134217728&&(r.playlistStyle=s[27]),o[0]&268435456&&(r.playlistToggle=s[28]),o[1]&524288&&(r.downloadFormats=s[50]),o[0]&16777216&&(r.playerTitle=s[24]),o[1]&1048576&&(r.content=s[51]),o[0]&128&&(r.contentIndex=s[7]),o[1]&1&&(r.duration=s[31]),o[0]&2048&&(r.currentTime=s[11]),o[0]&4096&&(r.playbackState=s[12]),o[1]&2&&(r.playbackRate=s[32]),o[1]&1073741824&&(r.activeAdvert=s[61]),o[2]&1024&&(r.persistentAdvert=s[72]),o[1]&16&&(r.textColor=s[35]),o[1]&32&&(r.backgroundColor=s[36]),o[1]&64&&(r.iconColor=s[37]),o[1]&128&&(r.videoTextColor=s[38]),o[1]&8388608&&(r.videoBackgroundColor=s[54]),o[1]&256&&(r.videoIconColor=s[39]),o[1]&512&&(r.logoIconEnabled=s[40]),o[1]&67108864&&(r.logoImagePosition=s[57]),o[1]&33554432&&(r.isFullScreen=s[56]),o[2]&32&&(r.videoPosterImage=s[67]),o[2]&128&&(r.videoIsBehind=s[69]),e.$set(r)},i(s){i||(p(e.$$.fragment,s),i=!0)},o(s){I(e.$$.fragment,s),i=!1},d(s){t[109](null),le(e,s)}}}function xl(t){let e,i;return e=new Hs({props:{root:t[14],$$slots:{default:[zm]},$$scope:{ctx:t}}}),{c(){ue(e.$$.fragment)},m(n,s){re(e,n,s),i=!0},p(n,s){const o={};s[0]&16384&&(o.root=n[14]),s[0]&117471360|s[1]&1150878719|s[2]&1060|s[5]&32&&(o.$$scope={dirty:s,ctx:n}),e.$set(o)},i(n){i||(p(e.$$.fragment,n),i=!0)},o(n){I(e.$$.fragment,n),i=!1},d(n){le(e,n)}}}function zm(t){let e,i,n={onEvent:t[58],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],activeAdvert:t[61],persistentAdvert:t[72],textColor:t[35],backgroundColor:t[36],iconColor:t[37],videoTextColor:t[38],videoBackgroundColor:t[54],videoIconColor:t[39],logoIconEnabled:t[40],logoImagePosition:t[57],videoPosterImage:t[67],videoIsBehind:t[64]};return e=new Uo({props:n}),t[110](e),{c(){ue(e.$$.fragment)},m(s,o){re(e,s,o),i=!0},p(s,o){const r={};o[0]&8192&&(r.playerStyle=s[13]),o[0]&33554432&&(r.callToAction=s[25]),o[0]&67108864&&(r.skipButtonStyle=s[26]),o[1]&524288&&(r.downloadFormats=s[50]),o[0]&16777216&&(r.playerTitle=s[24]),o[0]&16384|o[1]&4&&(r.fixedPosition=!s[14]&&s[33]),o[1]&8&&(r.fixedWidth=s[34]),o[1]&1048576&&(r.content=s[51]),o[0]&128&&(r.contentIndex=s[7]),o[1]&1&&(r.duration=s[31]),o[0]&2048&&(r.currentTime=s[11]),o[0]&4096&&(r.playbackState=s[12]),o[1]&2&&(r.playbackRate=s[32]),o[1]&1073741824&&(r.activeAdvert=s[61]),o[2]&1024&&(r.persistentAdvert=s[72]),o[1]&16&&(r.textColor=s[35]),o[1]&32&&(r.backgroundColor=s[36]),o[1]&64&&(r.iconColor=s[37]),o[1]&128&&(r.videoTextColor=s[38]),o[1]&8388608&&(r.videoBackgroundColor=s[54]),o[1]&256&&(r.videoIconColor=s[39]),o[1]&512&&(r.logoIconEnabled=s[40]),o[1]&67108864&&(r.logoImagePosition=s[57]),o[2]&32&&(r.videoPosterImage=s[67]),o[2]&4&&(r.videoIsBehind=s[64]),e.$set(r)},i(s){i||(p(e.$$.fragment,s),i=!0)},o(s){I(e.$$.fragment,s),i=!1},d(s){t[110](null),le(e,s)}}}function Lm(t){let e,i;return e=new Uo({props:{onEvent:t[111],playerStyle:"small",fixedWidth:0,logoIconEnabled:!1,content:t[51],contentIndex:t[7],duration:t[31],currentTime:t[66]?t[11]:t[59].startTime,playbackState:t[66]?t[12]:"paused",activeAdvert:t[61],persistentAdvert:t[72],textColor:t[35],backgroundColor:t[36],iconColor:t[37],videoTextColor:t[38],videoBackgroundColor:t[54],videoIconColor:t[39]}}),{c(){ue(e.$$.fragment)},m(n,s){re(e,n,s),i=!0},p(n,s){const o={};s[1]&268435456|s[2]&1&&(o.onEvent=n[111]),s[1]&1048576&&(o.content=n[51]),s[0]&128&&(o.contentIndex=n[7]),s[1]&1&&(o.duration=n[31]),s[0]&2048|s[1]&268435456|s[2]&16&&(o.currentTime=n[66]?n[11]:n[59].startTime),s[0]&4096|s[2]&16&&(o.playbackState=n[66]?n[12]:"paused"),s[1]&1073741824&&(o.activeAdvert=n[61]),s[2]&1024&&(o.persistentAdvert=n[72]),s[1]&16&&(o.textColor=n[35]),s[1]&32&&(o.backgroundColor=n[36]),s[1]&64&&(o.iconColor=n[37]),s[1]&128&&(o.videoTextColor=n[38]),s[1]&8388608&&(o.videoBackgroundColor=n[54]),s[1]&256&&(o.videoIconColor=n[39]),e.$set(o)},i(n){i||(p(e.$$.fragment,n),i=!0)},o(n){I(e.$$.fragment,n),i=!1},d(n){le(e,n)}}}function Ul(t,e){let i,n,s;return n=new Hs({props:{root:e[157],$$slots:{default:[Lm]},$$scope:{ctx:e}}}),{key:t,first:null,c(){i=Hi(),ue(n.$$.fragment),this.first=i},m(o,r){B(o,i,r),re(n,o,r),s=!0},p(o,r){e=o;const l={};r[1]&262144&&(l.root=e[157]),r[0]&6272|r[1]&1351614961|r[2]&1041|r[5]&32&&(l.$$scope={dirty:r,ctx:e}),n.$set(l)},i(o){s||(p(n.$$.fragment,o),s=!0)},o(o){I(n.$$.fragment,o),s=!1},d(o){o&&A(i),le(n,o)}}}function Fl(t){let e,i;return e=new Hs({props:{root:t[22],$$slots:{default:[Nm]},$$scope:{ctx:t}}}),{c(){ue(e.$$.fragment)},m(n,s){re(e,n,s),i=!0},p(n,s){const o={};s[0]&4194304&&(o.root=n[22]),s[0]&2134900735|s[1]&7356415|s[5]&32&&(o.$$scope={dirty:s,ctx:n}),e.$set(o)},i(n){i||(p(e.$$.fragment,n),i=!0)},o(n){I(e.$$.fragment,n),i=!1},d(n){le(e,n)}}}function Nm(t){let e,i,n,s,o,r,l,a,d,u,g,m,v,_,k,b,C,V,Z,O,j,L,N,K,U,X,Te,ve,be,ne,ee,F,se,ge,G,ae,w,q,we,Pe,Ve,J,Ce,Be,Ue;function He(S){t[112](S)}function st(S){t[113](S)}function _t(S){t[114](S)}function kt(S){t[115](S)}function je(S){t[116](S)}function Ee(S){t[117](S)}function $e(S){t[118](S)}function Ze(S){t[119](S)}function At(S){t[120](S)}function Xe(S){t[121](S)}function et(S){t[122](S)}function tt(S){t[123](S)}function Ne(S){t[124](S)}function it(S){t[125](S)}function Ge(S){t[126](S)}function ht(S){t[127](S)}function Fe(S){t[128](S)}function lt(S){t[129](S)}function ot(S){t[130](S)}function Bt(S){t[131](S)}function qe(S){t[132](S)}function pt(S){t[133](S)}function gt(S){t[134](S)}function x(S){t[135](S)}function Le(S){t[136](S)}function De(S){t[137](S)}function Qe(S){t[138](S)}function Ke(S){t[139](S)}function mt(S){t[140](S)}function at(S){t[141](S)}function It(S){t[142](S)}function St(S){t[143](S)}function Ye(S){t[144](S)}function ut(S){t[145](S)}function zt(S){t[146](S)}function Vt(S){t[147](S)}function Lt(S){t[148](S)}function ct(S){t[149](S)}function xt(S){t[150](S)}function Qt(S){t[151](S)}function R(S){t[152](S)}function wt(S){t[153](S)}function dt(S){t[154](S)}let ce={content:t[51],introsOutros:t[52],adverts:t[53]};return t[0]!==void 0&&(ce.projectId=t[0]),t[1]!==void 0&&(ce.contentId=t[1]),t[2]!==void 0&&(ce.playlistId=t[2]),t[3]!==void 0&&(ce.sourceId=t[3]),t[4]!==void 0&&(ce.sourceUrl=t[4]),t[5]!==void 0&&(ce.showUserInterface=t[5]),t[6]!==void 0&&(ce.playerStyle=t[6]),t[24]!==void 0&&(ce.playerTitle=t[24]),t[25]!==void 0&&(ce.callToAction=t[25]),t[26]!==void 0&&(ce.skipButtonStyle=t[26]),t[27]!==void 0&&(ce.playlistStyle=t[27]),t[28]!==void 0&&(ce.playlistToggle=t[28]),t[29]!==void 0&&(ce.mediaSession=t[29]),t[7]!==void 0&&(ce.contentIndex=t[7]),t[8]!==void 0&&(ce.introsOutrosIndex=t[8]),t[9]!==void 0&&(ce.advertIndex=t[9]),t[30]!==void 0&&(ce.persistentAdImage=t[30]),t[10]!==void 0&&(ce.persistentIndex=t[10]),t[31]!==void 0&&(ce.duration=t[31]),t[11]!==void 0&&(ce.currentTime=t[11]),t[12]!==void 0&&(ce.playbackState=t[12]),t[32]!==void 0&&(ce.playbackRate=t[32]),t[13]!==void 0&&(ce.widgetStyle=t[13]),t[33]!==void 0&&(ce.widgetPosition=t[33]),t[34]!==void 0&&(ce.widgetWidth=t[34]),t[14]!==void 0&&(ce.widgetTarget=t[14]),t[35]!==void 0&&(ce.textColor=t[35]),t[36]!==void 0&&(ce.backgroundColor=t[36]),t[37]!==void 0&&(ce.iconColor=t[37]),t[15]!==void 0&&(ce.highlightColor=t[15]),t[38]!==void 0&&(ce.videoTextColor=t[38]),t[39]!==void 0&&(ce.videoIconColor=t[39]),t[40]!==void 0&&(ce.logoIconEnabled=t[40]),t[16]!==void 0&&(ce.highlightSections=t[16]),t[17]!==void 0&&(ce.clickableSections=t[17]),t[18]!==void 0&&(ce.segmentWidgetSections=t[18]),t[19]!==void 0&&(ce.segmentWidgetPosition=t[19]),t[20]!==void 0&&(ce.currentSegment=t[20]),t[21]!==void 0&&(ce.hoveredSegment=t[21]),t[41]!==void 0&&(ce.advertConsent=t[41]),t[42]!==void 0&&(ce.analyticsConsent=t[42]),t[43]!==void 0&&(ce.analyticsCustomUrl=t[43]),t[44]!==void 0&&(ce.analyticsTag=t[44]),e=new Q_({props:ce}),$.push(()=>he(e,"projectId",He)),$.push(()=>he(e,"contentId",st)),$.push(()=>he(e,"playlistId",_t)),$.push(()=>he(e,"sourceId",kt)),$.push(()=>he(e,"sourceUrl",je)),$.push(()=>he(e,"showUserInterface",Ee)),$.push(()=>he(e,"playerStyle",$e)),$.push(()=>he(e,"playerTitle",Ze)),$.push(()=>he(e,"callToAction",At)),$.push(()=>he(e,"skipButtonStyle",Xe)),$.push(()=>he(e,"playlistStyle",et)),$.push(()=>he(e,"playlistToggle",tt)),$.push(()=>he(e,"mediaSession",Ne)),$.push(()=>he(e,"contentIndex",it)),$.push(()=>he(e,"introsOutrosIndex",Ge)),$.push(()=>he(e,"advertIndex",ht)),$.push(()=>he(e,"persistentAdImage",Fe)),$.push(()=>he(e,"persistentIndex",lt)),$.push(()=>he(e,"duration",ot)),$.push(()=>he(e,"currentTime",Bt)),$.push(()=>he(e,"playbackState",qe)),$.push(()=>he(e,"playbackRate",pt)),$.push(()=>he(e,"widgetStyle",gt)),$.push(()=>he(e,"widgetPosition",x)),$.push(()=>he(e,"widgetWidth",Le)),$.push(()=>he(e,"widgetTarget",De)),$.push(()=>he(e,"textColor",Qe)),$.push(()=>he(e,"backgroundColor",Ke)),$.push(()=>he(e,"iconColor",mt)),$.push(()=>he(e,"highlightColor",at)),$.push(()=>he(e,"videoTextColor",It)),$.push(()=>he(e,"videoIconColor",St)),$.push(()=>he(e,"logoIconEnabled",Ye)),$.push(()=>he(e,"highlightSections",ut)),$.push(()=>he(e,"clickableSections",zt)),$.push(()=>he(e,"segmentWidgetSections",Vt)),$.push(()=>he(e,"segmentWidgetPosition",Lt)),$.push(()=>he(e,"currentSegment",ct)),$.push(()=>he(e,"hoveredSegment",xt)),$.push(()=>he(e,"advertConsent",Qt)),$.push(()=>he(e,"analyticsConsent",R)),$.push(()=>he(e,"analyticsCustomUrl",wt)),$.push(()=>he(e,"analyticsTag",dt)),{c(){ue(e.$$.fragment)},m(S,P){re(e,S,P),Ue=!0},p(S,P){const oe={};P[1]&1048576&&(oe.content=S[51]),P[1]&2097152&&(oe.introsOutros=S[52]),P[1]&4194304&&(oe.adverts=S[53]),!i&&P[0]&1&&(i=!0,oe.projectId=S[0],fe(()=>i=!1)),!n&&P[0]&2&&(n=!0,oe.contentId=S[1],fe(()=>n=!1)),!s&&P[0]&4&&(s=!0,oe.playlistId=S[2],fe(()=>s=!1)),!o&&P[0]&8&&(o=!0,oe.sourceId=S[3],fe(()=>o=!1)),!r&&P[0]&16&&(r=!0,oe.sourceUrl=S[4],fe(()=>r=!1)),!l&&P[0]&32&&(l=!0,oe.showUserInterface=S[5],fe(()=>l=!1)),!a&&P[0]&64&&(a=!0,oe.playerStyle=S[6],fe(()=>a=!1)),!d&&P[0]&16777216&&(d=!0,oe.playerTitle=S[24],fe(()=>d=!1)),!u&&P[0]&33554432&&(u=!0,oe.callToAction=S[25],fe(()=>u=!1)),!g&&P[0]&67108864&&(g=!0,oe.skipButtonStyle=S[26],fe(()=>g=!1)),!m&&P[0]&134217728&&(m=!0,oe.playlistStyle=S[27],fe(()=>m=!1)),!v&&P[0]&268435456&&(v=!0,oe.playlistToggle=S[28],fe(()=>v=!1)),!_&&P[0]&536870912&&(_=!0,oe.mediaSession=S[29],fe(()=>_=!1)),!k&&P[0]&128&&(k=!0,oe.contentIndex=S[7],fe(()=>k=!1)),!b&&P[0]&256&&(b=!0,oe.introsOutrosIndex=S[8],fe(()=>b=!1)),!C&&P[0]&512&&(C=!0,oe.advertIndex=S[9],fe(()=>C=!1)),!V&&P[0]&1073741824&&(V=!0,oe.persistentAdImage=S[30],fe(()=>V=!1)),!Z&&P[0]&1024&&(Z=!0,oe.persistentIndex=S[10],fe(()=>Z=!1)),!O&&P[1]&1&&(O=!0,oe.duration=S[31],fe(()=>O=!1)),!j&&P[0]&2048&&(j=!0,oe.currentTime=S[11],fe(()=>j=!1)),!L&&P[0]&4096&&(L=!0,oe.playbackState=S[12],fe(()=>L=!1)),!N&&P[1]&2&&(N=!0,oe.playbackRate=S[32],fe(()=>N=!1)),!K&&P[0]&8192&&(K=!0,oe.widgetStyle=S[13],fe(()=>K=!1)),!U&&P[1]&4&&(U=!0,oe.widgetPosition=S[33],fe(()=>U=!1)),!X&&P[1]&8&&(X=!0,oe.widgetWidth=S[34],fe(()=>X=!1)),!Te&&P[0]&16384&&(Te=!0,oe.widgetTarget=S[14],fe(()=>Te=!1)),!ve&&P[1]&16&&(ve=!0,oe.textColor=S[35],fe(()=>ve=!1)),!be&&P[1]&32&&(be=!0,oe.backgroundColor=S[36],fe(()=>be=!1)),!ne&&P[1]&64&&(ne=!0,oe.iconColor=S[37],fe(()=>ne=!1)),!ee&&P[0]&32768&&(ee=!0,oe.highlightColor=S[15],fe(()=>ee=!1)),!F&&P[1]&128&&(F=!0,oe.videoTextColor=S[38],fe(()=>F=!1)),!se&&P[1]&256&&(se=!0,oe.videoIconColor=S[39],fe(()=>se=!1)),!ge&&P[1]&512&&(ge=!0,oe.logoIconEnabled=S[40],fe(()=>ge=!1)),!G&&P[0]&65536&&(G=!0,oe.highlightSections=S[16],fe(()=>G=!1)),!ae&&P[0]&131072&&(ae=!0,oe.clickableSections=S[17],fe(()=>ae=!1)),!w&&P[0]&262144&&(w=!0,oe.segmentWidgetSections=S[18],fe(()=>w=!1)),!q&&P[0]&524288&&(q=!0,oe.segmentWidgetPosition=S[19],fe(()=>q=!1)),!we&&P[0]&1048576&&(we=!0,oe.currentSegment=S[20],fe(()=>we=!1)),!Pe&&P[0]&2097152&&(Pe=!0,oe.hoveredSegment=S[21],fe(()=>Pe=!1)),!Ve&&P[1]&1024&&(Ve=!0,oe.advertConsent=S[41],fe(()=>Ve=!1)),!J&&P[1]&2048&&(J=!0,oe.analyticsConsent=S[42],fe(()=>J=!1)),!Ce&&P[1]&4096&&(Ce=!0,oe.analyticsCustomUrl=S[43],fe(()=>Ce=!1)),!Be&&P[1]&8192&&(Be=!0,oe.analyticsTag=S[44],fe(()=>Be=!1)),e.$set(oe)},i(S){Ue||(p(e.$$.fragment,S),Ue=!0)},o(S){I(e.$$.fragment,S),Ue=!1},d(S){le(e,S)}}}function ql(t){let e,i;return e=new cm({props:{onEvent:t[58],content:t[51],contentIndex:t[7],activeAdvert:t[61],persistentAdvert:t[72],duration:t[31],playbackState:t[12],skipButtonStyle:t[26],backgroundColor:t[36],iconColor:t[37]}}),{c(){ue(e.$$.fragment)},m(n,s){re(e,n,s),i=!0},p(n,s){const o={};s[1]&1048576&&(o.content=n[51]),s[0]&128&&(o.contentIndex=n[7]),s[1]&1073741824&&(o.activeAdvert=n[61]),s[2]&1024&&(o.persistentAdvert=n[72]),s[1]&1&&(o.duration=n[31]),s[0]&4096&&(o.playbackState=n[12]),s[0]&67108864&&(o.skipButtonStyle=n[26]),s[1]&32&&(o.backgroundColor=n[36]),s[1]&64&&(o.iconColor=n[37]),e.$set(o)},i(n){i||(p(e.$$.fragment,n),i=!0)},o(n){I(e.$$.fragment,n),i=!1},d(n){le(e,n)}}}function Hl(t){let e,i;return e=new _m({props:{analyticsTag:t[44]}}),{c(){ue(e.$$.fragment)},m(n,s){re(e,n,s),i=!0},p(n,s){const o={};s[1]&8192&&(o.analyticsTag=n[44]),e.$set(o)},i(n){i||(p(e.$$.fragment,n),i=!0)},o(n){I(e.$$.fragment,n),i=!1},d(n){le(e,n)}}}function Dm(t){let e,i,n,s,o=[],r=new Map,l,a,d,u,g,m;e=new Hs({props:{prepend:!0,root:t[68],$$slots:{default:[Mm]},$$scope:{ctx:t}}});let v=t[71]&&Rl(t),_=t[70]&&xl(t),k=Yt(t[49]);const b=O=>O[157];for(let O=0;O<k.length;O+=1){let j=Dl(t,k,O),L=b(j);r.set(L,o[O]=Ul(L,j))}let C=t[22]&&Fl(t),V=t[55]&&ql(t),Z=t[44]&&Hl(t);return g=new mm({}),{c(){ue(e.$$.fragment),i=H(),v&&v.c(),n=H(),_&&_.c(),s=H();for(let O=0;O<o.length;O+=1)o[O].c();l=H(),C&&C.c(),a=H(),V&&V.c(),d=H(),Z&&Z.c(),u=H(),ue(g.$$.fragment)},m(O,j){re(e,O,j),B(O,i,j),v&&v.m(O,j),B(O,n,j),_&&_.m(O,j),B(O,s,j);for(let L=0;L<o.length;L+=1)o[L]&&o[L].m(O,j);B(O,l,j),C&&C.m(O,j),B(O,a,j),V&&V.m(O,j),B(O,d,j),Z&&Z.m(O,j),B(O,u,j),re(g,O,j),m=!0},p(O,j){const L={};j[2]&64&&(L.root=O[68]),j[0]&8411296|j[1]&1611809807|j[2]&134|j[5]&32&&(L.$$scope={dirty:j,ctx:O}),e.$set(L),O[71]?v?(v.p(O,j),j[2]&512&&p(v,1)):(v=Rl(O),v.c(),p(v,1),v.m(n.parentNode,n)):v&&(Re(),I(v,1,1,()=>{v=null}),xe()),O[70]?_?(_.p(O,j),j[2]&256&&p(_,1)):(_=xl(O),_.c(),p(_,1),_.m(s.parentNode,s)):_&&(Re(),I(_,1,1,()=>{_=null}),xe()),j[0]&6272|j[1]&1486094833|j[2]&1041&&(k=Yt(O[49]),Re(),o=Qa(o,j,b,1,O,k,r,l.parentNode,Xa,Ul,l,Dl),xe()),O[22]?C?(C.p(O,j),j[0]&4194304&&p(C,1)):(C=Fl(O),C.c(),p(C,1),C.m(a.parentNode,a)):C&&(Re(),I(C,1,1,()=>{C=null}),xe()),O[55]?V?(V.p(O,j),j[1]&16777216&&p(V,1)):(V=ql(O),V.c(),p(V,1),V.m(d.parentNode,d)):V&&(Re(),I(V,1,1,()=>{V=null}),xe()),O[44]?Z?(Z.p(O,j),j[1]&8192&&p(Z,1)):(Z=Hl(O),Z.c(),p(Z,1),Z.m(u.parentNode,u)):Z&&(Re(),I(Z,1,1,()=>{Z=null}),xe())},i(O){if(!m){p(e.$$.fragment,O),p(v),p(_);for(let j=0;j<k.length;j+=1)p(o[j]);p(C),p(V),p(Z),p(g.$$.fragment,O),m=!0}},o(O){I(e.$$.fragment,O),I(v),I(_);for(let j=0;j<o.length;j+=1)I(o[j]);I(C),I(V),I(Z),I(g.$$.fragment,O),m=!1},d(O){O&&(A(i),A(n),A(s),A(l),A(a),A(d),A(u)),le(e,O),v&&v.d(O),_&&_.d(O);for(let j=0;j<o.length;j+=1)o[j].d(O);C&&C.d(O),V&&V.d(O),Z&&Z.d(O),le(g,O)}}}function Rm(t,e,i){let n,s,o,r,l,a,d,u,g,m,v,_,k,b,C,V,Z,O,j,L,N,K,U,{playerApiUrl:X="https://api.beyondwords.io/v1/projects/{id}/player"}=e,{projectId:Te=void 0}=e,{contentId:ve=void 0}=e,{playlistId:be=void 0}=e,{sourceId:ne=void 0}=e,{sourceUrl:ee=void 0}=e,{playlist:F=[]}=e,{showUserInterface:se=!0}=e,{showBottomWidget:ge=!1}=e,{playerStyle:G="standard"}=e,{playerTitle:ae=void 0}=e,{callToAction:w=void 0}=e,{skipButtonStyle:q="auto"}=e,{playlistStyle:we="auto-5-4"}=e,{playlistToggle:Pe="auto"}=e,{downloadFormats:Ve=[]}=e,{mediaSession:J="auto"}=e,{content:Ce=[]}=e,{contentIndex:Be=0}=e,{introsOutros:Ue=[]}=e,{introsOutrosIndex:He=-1}=e,{adverts:st=[]}=e,{advertIndex:_t=-1}=e,{persistentAdImage:kt=!1}=e,{persistentIndex:je=-1}=e,{duration:Ee=0}=e,{currentTime:$e=0}=e,{playbackState:Ze="stopped"}=e,{playbackRate:At=1}=e,{playbackRates:Xe=[.5,.6,.7,.8,.9,1,1.1,1.2,1.3,1.4,1.5,2,2.5,3]}=e,{widgetStyle:et="standard"}=e,{widgetPosition:tt="auto"}=e,{widgetWidth:Ne="auto"}=e,{widgetTarget:it=void 0}=e,{textColor:Ge="#111"}=e,{backgroundColor:ht="#f5f5f5"}=e,{iconColor:Fe="rgba(0, 0, 0, 0.8)"}=e,{highlightColor:lt="#eee"}=e,{videoTextColor:ot="white"}=e,{videoBackgroundColor:Bt="black"}=e,{videoIconColor:qe="white"}=e,{logoIconEnabled:pt=!0}=e,{highlightSections:gt="all"}=e,{clickableSections:x="all"}=e,{segmentWidgetSections:Le="body"}=e,{segmentWidgetPosition:De="7-oclock"}=e,{currentSegment:Qe=void 0}=e,{hoveredSegment:Ke=void 0}=e,{loadedMedia:mt=void 0}=e,{advertConsent:at="personalized"}=e,{analyticsConsent:It="allowed"}=e,{analyticsCustomUrl:St=void 0}=e,{analyticsTag:Ye=void 0}=e,{writeToken:ut=void 0}=e,{captureErrors:zt=!0}=e,{onError:Vt=()=>{}}=e,{transitions:Lt=[]}=e,{controlPanel:ct=void 0}=e;const xt=(...h)=>jt.addEventListener(...h),Qt=(...h)=>jt.removeEventListener(...h);let{initialProps:R={}}=e,{showMediaSession:wt=!1}=e,{isLoaded:dt=!1}=e,{isFullScreen:ce=!1}=e,{mediaElement:S=void 0}=e,{userInterface:P=void 0}=e,{widgetInterface:oe=void 0}=e,{controller:jt=void 0}=e,{logoImagePosition:ai=void 0}=e,{analyticsUrl:Ai=void 0}=e,{analyticsId:Nt=void 0}=e,{listenSessionId:nn=void 0}=e,{sessionCreatedAt:ui=void 0}=e,{isNewListen:fn=!1}=e,{prevPercentage:ft=0}=e,{segmentWidgets:pi=[]}=e,{segmentContainers:ni=new Zo(h=>i(49,pi=h))}=e,{segmentClickables:Si=new Yo}=e,{segmentHighlights:Wt=new Ho}=e;const Ut=h=>jt.processEvent(oi({emittedFrom:k},h)),ji=()=>i(95,O=Ke);function Ft(h){$[h?"unshift":"push"](()=>{S=h,i(45,S)})}function Bi(h){Ze=h,i(12,Ze)}function ci(h){Ee=h,i(31,Ee)}function An(h){$e=h,i(11,$e)}function $t(h){At=h,i(32,At)}function hn(h){ft=h,i(48,ft)}function qt(h){dt=h,i(23,dt)}function di(h){$[h?"unshift":"push"](()=>{P=h,i(46,P)})}function vt(h){$[h?"unshift":"push"](()=>{oe=h,i(47,oe)})}const gi=h=>Ut(sn(oi({},h),{emittedFrom:"segment-widget",widgetSegment:N,widgetIsCurrent:K}));function yt(h){Te=h,i(0,Te)}function fi(h){ve=h,i(1,ve)}function Mt(h){be=h,i(2,be)}function W(h){ne=h,i(3,ne)}function Y(h){ee=h,i(4,ee)}function te(h){se=h,i(5,se)}function ei(h){G=h,i(6,G)}function _n(h){ae=h,i(24,ae)}function mn(h){w=h,i(25,w)}function vn(h){q=h,i(26,q)}function yn(h){we=h,i(27,we)}function vo(h){Pe=h,i(28,Pe)}function Bn(h){J=h,i(29,J)}function yo(h){Be=h,i(7,Be)}function Ei(h){He=h,i(8,He)}function bo(h){_t=h,i(9,_t)}function vs(h){kt=h,i(30,kt)}function ko(h){je=h,i(10,je)}function po(h){Ee=h,i(31,Ee)}function ys(h){$e=h,i(11,$e)}function So(h){Ze=h,i(12,Ze)}function bn(h){At=h,i(32,At)}function ti(h){et=h,i(13,et)}function er(h){tt=h,i(33,tt)}function In(h){Ne=h,i(34,Ne)}function si(h){it=h,i(14,it)}function wo(h){Ge=h,i(35,Ge)}function Gn(h){ht=h,i(36,ht)}function Ii(h){Fe=h,i(37,Fe)}function de(h){lt=h,i(15,lt)}function rt(h){ot=h,i(38,ot)}function bt(h){qe=h,i(39,qe)}function Po(h){pt=h,i(40,pt)}function X0(h){gt=h,i(16,gt)}function Q0(h){x=h,i(17,x)}function $0(h){Le=h,i(18,Le)}function e2(h){De=h,i(19,De)}function t2(h){Qe=h,i(20,Qe)}function i2(h){Ke=h,i(21,Ke)}function n2(h){at=h,i(41,at)}function s2(h){It=h,i(42,It)}function o2(h){St=h,i(43,St)}function r2(h){Ye=h,i(44,Ye)}return t.$$set=h=>{"playerApiUrl"in h&&i(73,X=h.playerApiUrl),"projectId"in h&&i(0,Te=h.projectId),"contentId"in h&&i(1,ve=h.contentId),"playlistId"in h&&i(2,be=h.playlistId),"sourceId"in h&&i(3,ne=h.sourceId),"sourceUrl"in h&&i(4,ee=h.sourceUrl),"playlist"in h&&i(74,F=h.playlist),"showUserInterface"in h&&i(5,se=h.showUserInterface),"showBottomWidget"in h&&i(75,ge=h.showBottomWidget),"playerStyle"in h&&i(6,G=h.playerStyle),"playerTitle"in h&&i(24,ae=h.playerTitle),"callToAction"in h&&i(25,w=h.callToAction),"skipButtonStyle"in h&&i(26,q=h.skipButtonStyle),"playlistStyle"in h&&i(27,we=h.playlistStyle),"playlistToggle"in h&&i(28,Pe=h.playlistToggle),"downloadFormats"in h&&i(50,Ve=h.downloadFormats),"mediaSession"in h&&i(29,J=h.mediaSession),"content"in h&&i(51,Ce=h.content),"contentIndex"in h&&i(7,Be=h.contentIndex),"introsOutros"in h&&i(52,Ue=h.introsOutros),"introsOutrosIndex"in h&&i(8,He=h.introsOutrosIndex),"adverts"in h&&i(53,st=h.adverts),"advertIndex"in h&&i(9,_t=h.advertIndex),"persistentAdImage"in h&&i(30,kt=h.persistentAdImage),"persistentIndex"in h&&i(10,je=h.persistentIndex),"duration"in h&&i(31,Ee=h.duration),"currentTime"in h&&i(11,$e=h.currentTime),"playbackState"in h&&i(12,Ze=h.playbackState),"playbackRate"in h&&i(32,At=h.playbackRate),"playbackRates"in h&&i(76,Xe=h.playbackRates),"widgetStyle"in h&&i(13,et=h.widgetStyle),"widgetPosition"in h&&i(33,tt=h.widgetPosition),"widgetWidth"in h&&i(34,Ne=h.widgetWidth),"widgetTarget"in h&&i(14,it=h.widgetTarget),"textColor"in h&&i(35,Ge=h.textColor),"backgroundColor"in h&&i(36,ht=h.backgroundColor),"iconColor"in h&&i(37,Fe=h.iconColor),"highlightColor"in h&&i(15,lt=h.highlightColor),"videoTextColor"in h&&i(38,ot=h.videoTextColor),"videoBackgroundColor"in h&&i(54,Bt=h.videoBackgroundColor),"videoIconColor"in h&&i(39,qe=h.videoIconColor),"logoIconEnabled"in h&&i(40,pt=h.logoIconEnabled),"highlightSections"in h&&i(16,gt=h.highlightSections),"clickableSections"in h&&i(17,x=h.clickableSections),"segmentWidgetSections"in h&&i(18,Le=h.segmentWidgetSections),"segmentWidgetPosition"in h&&i(19,De=h.segmentWidgetPosition),"currentSegment"in h&&i(20,Qe=h.currentSegment),"hoveredSegment"in h&&i(21,Ke=h.hoveredSegment),"loadedMedia"in h&&i(77,mt=h.loadedMedia),"advertConsent"in h&&i(41,at=h.advertConsent),"analyticsConsent"in h&&i(42,It=h.analyticsConsent),"analyticsCustomUrl"in h&&i(43,St=h.analyticsCustomUrl),"analyticsTag"in h&&i(44,Ye=h.analyticsTag),"writeToken"in h&&i(78,ut=h.writeToken),"captureErrors"in h&&i(79,zt=h.captureErrors),"onError"in h&&i(80,Vt=h.onError),"transitions"in h&&i(81,Lt=h.transitions),"controlPanel"in h&&i(22,ct=h.controlPanel),"initialProps"in h&&i(84,R=h.initialProps),"showMediaSession"in h&&i(55,wt=h.showMediaSession),"isLoaded"in h&&i(23,dt=h.isLoaded),"isFullScreen"in h&&i(56,ce=h.isFullScreen),"mediaElement"in h&&i(45,S=h.mediaElement),"userInterface"in h&&i(46,P=h.userInterface),"widgetInterface"in h&&i(47,oe=h.widgetInterface),"controller"in h&&i(85,jt=h.controller),"logoImagePosition"in h&&i(57,ai=h.logoImagePosition),"analyticsUrl"in h&&i(86,Ai=h.analyticsUrl),"analyticsId"in h&&i(87,Nt=h.analyticsId),"listenSessionId"in h&&i(88,nn=h.listenSessionId),"sessionCreatedAt"in h&&i(89,ui=h.sessionCreatedAt),"isNewListen"in h&&i(90,fn=h.isNewListen),"prevPercentage"in h&&i(48,ft=h.prevPercentage),"segmentWidgets"in h&&i(49,pi=h.segmentWidgets),"segmentContainers"in h&&i(91,ni=h.segmentContainers),"segmentClickables"in h&&i(92,Si=h.segmentClickables),"segmentHighlights"in h&&i(93,Wt=h.segmentHighlights)},t.$$.update=()=>{t.$$.dirty[0]&128|t.$$.dirty[1]&1048576&&i(97,n=Ce[Be]),t.$$.dirty[0]&256|t.$$.dirty[1]&2097152&&i(60,s=Ue[He]),t.$$.dirty[0]&512|t.$$.dirty[1]&4194304&&i(61,o=st[_t]),t.$$.dirty[0]&1024|t.$$.dirty[1]&4194304&&i(72,r=st[je]),t.$$.dirty[0]&4096|t.$$.dirty[1]&1073741824&&i(98,l=o&&Ze!=="stopped"),t.$$.dirty[2]&32768&&i(100,a=(mt==null?void 0:mt.format)==="audio"),t.$$.dirty[0]&64|t.$$.dirty[1]&33554432&&i(65,d=ce?"video":G),t.$$.dirty[0]&16384&&i(14,it=Go(it,"widget")),t.$$.dirty[0]&16384|t.$$.dirty[2]&8192&&i(101,u=ge||it),t.$$.dirty[0]&32|t.$$.dirty[1]&1048576|t.$$.dirty[2]&8&&i(71,g=se&&Ko(d)&&Ce.length>0),t.$$.dirty[0]&8224|t.$$.dirty[1]&1048576|t.$$.dirty[3]&256&&i(70,m=se&&u&&Ko(et)&&Ce.length>0),t.$$.dirty[0]&4194304&&i(22,ct=Go(ct,"control panel")),t.$$.dirty[0]&8192|t.$$.dirty[1]&33554432|t.$$.dirty[3]&256&&i(64,v=u&&et==="video"&&!ce),t.$$.dirty[2]&12&&i(69,_=d==="video"&&!v),t.$$.dirty[2]&4&&(k=v?"bottom-widget":"inline-player"),t.$$.dirty[0]&8256&&i(63,b=G==="video"||et==="video"),t.$$.dirty[0]&16384|t.$$.dirty[2]&4&&i(68,C=v?it:null),t.$$.dirty[0]&8388608|t.$$.dirty[2]&2|t.$$.dirty[3]&128&&i(99,V=a&&b&&dt),t.$$.dirty[1]&1073741824|t.$$.dirty[3]&112&&i(67,Z=V?l&&(o==null?void 0:o.imageUrl)||(n==null?void 0:n.imageUrl):""),t.$$.dirty[0]&31|t.$$.dirty[2]&4096&&Ut(vm()),t.$$.dirty[0]&1|t.$$.dirty[2]&67584&&km(X,Te,ut,h=>Ut(h)),t.$$.dirty[0]&2097152|t.$$.dirty[3]&4&&i(95,O=Ke||O),t.$$.dirty[0]&1310720&&i(94,j=rs("current",Qe,Le)),t.$$.dirty[0]&1048576|t.$$.dirty[3]&2&&j&&ji(),t.$$.dirty[0]&262144|t.$$.dirty[3]&4&&i(96,L=rs("hovered",O,Le)),t.$$.dirty[0]&1048576|t.$$.dirty[3]&14&&i(59,N=L&&O||j&&Qe),t.$$.dirty[0]&1048576|t.$$.dirty[1]&268435456&&i(62,K=(N==null?void 0:N.marker)===(Qe==null?void 0:Qe.marker)),t.$$.dirty[1]&1610612736|t.$$.dirty[2]&1&&i(66,U=K||o||s),t.$$.dirty[0]&786496|t.$$.dirty[1]&268435456|t.$$.dirty[2]&536870912&&ni.update(N,Le,De,G),t.$$.dirty[0]&2228224|t.$$.dirty[2]&1073741824&&Si.update(Ke,x),t.$$.dirty[0]&1146880|t.$$.dirty[3]&1&&Wt.update("current",Qe,gt,lt),t.$$.dirty[0]&2195456|t.$$.dirty[3]&1&&Wt.update("hovered",Ke,gt,lt),t.$$.dirty[0]&2048|t.$$.dirty[2]&8912896&&Cm(Lt,jt,$e)},[Te,ve,be,ne,ee,se,G,Be,He,_t,je,$e,Ze,et,it,lt,gt,x,Le,De,Qe,Ke,ct,dt,ae,w,q,we,Pe,J,kt,Ee,At,tt,Ne,Ge,ht,Fe,ot,qe,pt,at,It,St,Ye,S,P,oe,ft,pi,Ve,Ce,Ue,st,Bt,wt,ce,ai,Ut,N,s,o,K,b,v,d,U,Z,C,_,m,g,r,X,F,ge,Xe,mt,ut,zt,Vt,Lt,xt,Qt,R,jt,Ai,Nt,nn,ui,fn,ni,Si,Wt,j,O,L,n,l,V,a,u,Ft,Bi,ci,An,$t,hn,qt,di,vt,gi,yt,fi,Mt,W,Y,te,ei,_n,mn,vn,yn,vo,Bn,yo,Ei,bo,vs,ko,po,ys,So,bn,ti,er,In,si,wo,Gn,Ii,de,rt,bt,Po,X0,Q0,$0,e2,t2,i2,n2,s2,o2,r2]}let xm=class extends pe{constructor(e){super(),ke(this,e,Rm,Dm,_e,{playerApiUrl:73,projectId:0,contentId:1,playlistId:2,sourceId:3,sourceUrl:4,playlist:74,showUserInterface:5,showBottomWidget:75,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,persistentAdImage:30,persistentIndex:10,duration:31,currentTime:11,playbackState:12,playbackRate:32,playbackRates:76,widgetStyle:13,widgetPosition:33,widgetWidth:34,widgetTarget:14,textColor:35,backgroundColor:36,iconColor:37,highlightColor:15,videoTextColor:38,videoBackgroundColor:54,videoIconColor:39,logoIconEnabled:40,highlightSections:16,clickableSections:17,segmentWidgetSections:18,segmentWidgetPosition:19,currentSegment:20,hoveredSegment:21,loadedMedia:77,advertConsent:41,analyticsConsent:42,analyticsCustomUrl:43,analyticsTag:44,writeToken:78,captureErrors:79,onError:80,transitions:81,controlPanel:22,addEventListener:82,removeEventListener:83,initialProps:84,showMediaSession:55,isLoaded:23,isFullScreen:56,mediaElement:45,userInterface:46,widgetInterface:47,controller:85,logoImagePosition:57,analyticsUrl:86,analyticsId:87,listenSessionId:88,sessionCreatedAt:89,isNewListen:90,prevPercentage:48,segmentWidgets:49,segmentContainers:91,segmentClickables:92,segmentHighlights:93,onEvent:58},null,[-1,-1,-1,-1,-1,-1])}get playerApiUrl(){return this.$$.ctx[73]}set playerApiUrl(e){this.$$set({playerApiUrl:e}),c()}get projectId(){return this.$$.ctx[0]}set projectId(e){this.$$set({projectId:e}),c()}get contentId(){return this.$$.ctx[1]}set contentId(e){this.$$set({contentId:e}),c()}get playlistId(){return this.$$.ctx[2]}set playlistId(e){this.$$set({playlistId:e}),c()}get sourceId(){return this.$$.ctx[3]}set sourceId(e){this.$$set({sourceId:e}),c()}get sourceUrl(){return this.$$.ctx[4]}set sourceUrl(e){this.$$set({sourceUrl:e}),c()}get playlist(){return this.$$.ctx[74]}set playlist(e){this.$$set({playlist:e}),c()}get showUserInterface(){return this.$$.ctx[5]}set showUserInterface(e){this.$$set({showUserInterface:e}),c()}get showBottomWidget(){return this.$$.ctx[75]}set showBottomWidget(e){this.$$set({showBottomWidget:e}),c()}get playerStyle(){return this.$$.ctx[6]}set playerStyle(e){this.$$set({playerStyle:e}),c()}get playerTitle(){return this.$$.ctx[24]}set playerTitle(e){this.$$set({playerTitle:e}),c()}get callToAction(){return this.$$.ctx[25]}set callToAction(e){this.$$set({callToAction:e}),c()}get skipButtonStyle(){return this.$$.ctx[26]}set skipButtonStyle(e){this.$$set({skipButtonStyle:e}),c()}get playlistStyle(){return this.$$.ctx[27]}set playlistStyle(e){this.$$set({playlistStyle:e}),c()}get playlistToggle(){return this.$$.ctx[28]}set playlistToggle(e){this.$$set({playlistToggle:e}),c()}get downloadFormats(){return this.$$.ctx[50]}set downloadFormats(e){this.$$set({downloadFormats:e}),c()}get mediaSession(){return this.$$.ctx[29]}set mediaSession(e){this.$$set({mediaSession:e}),c()}get content(){return this.$$.ctx[51]}set content(e){this.$$set({content:e}),c()}get contentIndex(){return this.$$.ctx[7]}set contentIndex(e){this.$$set({contentIndex:e}),c()}get introsOutros(){return this.$$.ctx[52]}set introsOutros(e){this.$$set({introsOutros:e}),c()}get introsOutrosIndex(){return this.$$.ctx[8]}set introsOutrosIndex(e){this.$$set({introsOutrosIndex:e}),c()}get adverts(){return this.$$.ctx[53]}set adverts(e){this.$$set({adverts:e}),c()}get advertIndex(){return this.$$.ctx[9]}set advertIndex(e){this.$$set({advertIndex:e}),c()}get persistentAdImage(){return this.$$.ctx[30]}set persistentAdImage(e){this.$$set({persistentAdImage:e}),c()}get persistentIndex(){return this.$$.ctx[10]}set persistentIndex(e){this.$$set({persistentIndex:e}),c()}get duration(){return this.$$.ctx[31]}set duration(e){this.$$set({duration:e}),c()}get currentTime(){return this.$$.ctx[11]}set currentTime(e){this.$$set({currentTime:e}),c()}get playbackState(){return this.$$.ctx[12]}set playbackState(e){this.$$set({playbackState:e}),c()}get playbackRate(){return this.$$.ctx[32]}set playbackRate(e){this.$$set({playbackRate:e}),c()}get playbackRates(){return this.$$.ctx[76]}set playbackRates(e){this.$$set({playbackRates:e}),c()}get widgetStyle(){return this.$$.ctx[13]}set widgetStyle(e){this.$$set({widgetStyle:e}),c()}get widgetPosition(){return this.$$.ctx[33]}set widgetPosition(e){this.$$set({widgetPosition:e}),c()}get widgetWidth(){return this.$$.ctx[34]}set widgetWidth(e){this.$$set({widgetWidth:e}),c()}get widgetTarget(){return this.$$.ctx[14]}set widgetTarget(e){this.$$set({widgetTarget:e}),c()}get textColor(){return this.$$.ctx[35]}set textColor(e){this.$$set({textColor:e}),c()}get backgroundColor(){return this.$$.ctx[36]}set backgroundColor(e){this.$$set({backgroundColor:e}),c()}get iconColor(){return this.$$.ctx[37]}set iconColor(e){this.$$set({iconColor:e}),c()}get highlightColor(){return this.$$.ctx[15]}set highlightColor(e){this.$$set({highlightColor:e}),c()}get videoTextColor(){return this.$$.ctx[38]}set videoTextColor(e){this.$$set({videoTextColor:e}),c()}get videoBackgroundColor(){return this.$$.ctx[54]}set videoBackgroundColor(e){this.$$set({videoBackgroundColor:e}),c()}get videoIconColor(){return this.$$.ctx[39]}set videoIconColor(e){this.$$set({videoIconColor:e}),c()}get logoIconEnabled(){return this.$$.ctx[40]}set logoIconEnabled(e){this.$$set({logoIconEnabled:e}),c()}get highlightSections(){return this.$$.ctx[16]}set highlightSections(e){this.$$set({highlightSections:e}),c()}get clickableSections(){return this.$$.ctx[17]}set clickableSections(e){this.$$set({clickableSections:e}),c()}get segmentWidgetSections(){return this.$$.ctx[18]}set segmentWidgetSections(e){this.$$set({segmentWidgetSections:e}),c()}get segmentWidgetPosition(){return this.$$.ctx[19]}set segmentWidgetPosition(e){this.$$set({segmentWidgetPosition:e}),c()}get currentSegment(){return this.$$.ctx[20]}set currentSegment(e){this.$$set({currentSegment:e}),c()}get hoveredSegment(){return this.$$.ctx[21]}set hoveredSegment(e){this.$$set({hoveredSegment:e}),c()}get loadedMedia(){return this.$$.ctx[77]}set loadedMedia(e){this.$$set({loadedMedia:e}),c()}get advertConsent(){return this.$$.ctx[41]}set advertConsent(e){this.$$set({advertConsent:e}),c()}get analyticsConsent(){return this.$$.ctx[42]}set analyticsConsent(e){this.$$set({analyticsConsent:e}),c()}get analyticsCustomUrl(){return this.$$.ctx[43]}set analyticsCustomUrl(e){this.$$set({analyticsCustomUrl:e}),c()}get analyticsTag(){return this.$$.ctx[44]}set analyticsTag(e){this.$$set({analyticsTag:e}),c()}get writeToken(){return this.$$.ctx[78]}set writeToken(e){this.$$set({writeToken:e}),c()}get captureErrors(){return this.$$.ctx[79]}set captureErrors(e){this.$$set({captureErrors:e}),c()}get onError(){return this.$$.ctx[80]}set onError(e){this.$$set({onError:e}),c()}get transitions(){return this.$$.ctx[81]}set transitions(e){this.$$set({transitions:e}),c()}get controlPanel(){return this.$$.ctx[22]}set controlPanel(e){this.$$set({controlPanel:e}),c()}get addEventListener(){return this.$$.ctx[82]}get removeEventListener(){return this.$$.ctx[83]}get initialProps(){return this.$$.ctx[84]}set initialProps(e){this.$$set({initialProps:e}),c()}get showMediaSession(){return this.$$.ctx[55]}set showMediaSession(e){this.$$set({showMediaSession:e}),c()}get isLoaded(){return this.$$.ctx[23]}set isLoaded(e){this.$$set({isLoaded:e}),c()}get isFullScreen(){return this.$$.ctx[56]}set isFullScreen(e){this.$$set({isFullScreen:e}),c()}get mediaElement(){return this.$$.ctx[45]}set mediaElement(e){this.$$set({mediaElement:e}),c()}get userInterface(){return this.$$.ctx[46]}set userInterface(e){this.$$set({userInterface:e}),c()}get widgetInterface(){return this.$$.ctx[47]}set widgetInterface(e){this.$$set({widgetInterface:e}),c()}get controller(){return this.$$.ctx[85]}set controller(e){this.$$set({controller:e}),c()}get logoImagePosition(){return this.$$.ctx[57]}set logoImagePosition(e){this.$$set({logoImagePosition:e}),c()}get analyticsUrl(){return this.$$.ctx[86]}set analyticsUrl(e){this.$$set({analyticsUrl:e}),c()}get analyticsId(){return this.$$.ctx[87]}set analyticsId(e){this.$$set({analyticsId:e}),c()}get listenSessionId(){return this.$$.ctx[88]}set listenSessionId(e){this.$$set({listenSessionId:e}),c()}get sessionCreatedAt(){return this.$$.ctx[89]}set sessionCreatedAt(e){this.$$set({sessionCreatedAt:e}),c()}get isNewListen(){return this.$$.ctx[90]}set isNewListen(e){this.$$set({isNewListen:e}),c()}get prevPercentage(){return this.$$.ctx[48]}set prevPercentage(e){this.$$set({prevPercentage:e}),c()}get segmentWidgets(){return this.$$.ctx[49]}set segmentWidgets(e){this.$$set({segmentWidgets:e}),c()}get segmentContainers(){return this.$$.ctx[91]}set segmentContainers(e){this.$$set({segmentContainers:e}),c()}get segmentClickables(){return this.$$.ctx[92]}set segmentClickables(e){this.$$set({segmentClickables:e}),c()}get segmentHighlights(){return this.$$.ctx[93]}set segmentHighlights(e){this.$$set({segmentHighlights:e}),c()}get onEvent(){return this.$$.ctx[58]}};class Um{constructor(e,i){this.baseUrl=e==null?void 0:e.replace("{id}",i)}byContentId(e){return wn(`${this.baseUrl}/by_content_id/${e}`)}byPlaylistId(e){return wn(`${this.baseUrl}/by_playlist_id/${e}`)}bySourceId(e){return wn(`${this.baseUrl}/by_source_id/${e}`)}bySourceUrl(e){return wn(`${this.baseUrl}/by_source_url/${e}`)}byIdentifiers(e){return wn(`${this.baseUrl}/by_identifiers/${encodeURIComponent(JSON.stringify(e))}`)}}const Jo=t=>typeof t!="object"||t===null?t:Array.isArray(t)?t.map(Jo):Object.fromEntries(Object.entries(t).map(([e,i])=>[e.replace(/([A-Z])/g,n=>`_${n.toLowerCase()}`),Jo(i)])),Yl=t=>t==="dark"||t==="auto"&&Fm()?"dark":"light",Fm=()=>window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches,Zl=t=>wi(this,null,function*(){const e=new Um(t.playerApiUrl,t.projectId);if(!t.playerApiUrl||!t.projectId)return;const i=qm(t);if(i.length===0)return;const n=yield Hm(e,i).catch(()=>{});if(!(n!=null&&n.content)){Ym(t);return}Zm(t,n)}),qm=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(...Jo(t.playlist)),[...new Set(e.map(JSON.stringify))].map(JSON.parse)},Hm=(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)},Ym=t=>{Gl(t),Kl(t),Jl(t),t.onEvent(me({type:"NoContentAvailable",description:"No published and processed content is available for the identifiers.",initiatedBy:"browser"}))},Zm=(t,e)=>{var o;const i=Yl(e.settings.theme),n=e.settings[`${i}_theme`],s=e.settings.video_theme;Gl(t),Kl(t,e),Jl(t,e),ze(t,"playerStyle",e.settings.player_style),ze(t,"playerTitle",((o=e.playlist)==null?void 0:o.title)||e.settings.player_title),ze(t,"callToAction",e.settings.call_to_action==="Listen to this article"?null:e.settings.call_to_action),ze(t,"skipButtonStyle",e.settings.skip_button_style),ze(t,"downloadFormats",e.settings.download_button_enabled?["mp3"]:[]),ze(t,"introsOutros",Gm(e.settings)),ze(t,"persistentAdImage",e.settings.persistent_ad_image),ze(t,"widgetStyle",e.settings.widget_style),ze(t,"widgetPosition",e.settings.widget_position),ze(t,"textColor",n.text_color),ze(t,"backgroundColor",n.background_color),ze(t,"iconColor",n.icon_color),ze(t,"highlightColor",n.highlight_color),ze(t,"videoTextColor",s.text_color),ze(t,"videoBackgroundColor",s.background_color),ze(t,"videoIconColor",s.icon_color),ze(t,"logoIconEnabled",e.settings.logo_icon_enabled),ze(t,"logoImagePosition",e.video_settings.logo_image_position),ze(t,"highlightSections",e.settings.segment_playback_enabled?"all":"none"),ze(t,"clickableSections",e.settings.segment_playback_enabled?"all":"none"),ze(t,"segmentWidgetSections",(e.settings.segment_playback_enabled,"none")),ze(t,"analyticsConsent",Km(e.settings)),ze(t,"analyticsCustomUrl",e.settings.analytics_custom_url),ze(t,"analyticsTag",e.settings.analytics_tag),ze(t,"analyticsUrl",e.settings.analytics_url),ze(t,"analyticsId",e.settings.analytics_id)},Gl=t=>{ze(t,"contentIndex",0),ze(t,"introsOutrosIndex",-1),ze(t,"advertIndex",-1),ze(t,"persistentIndex",-1),ze(t,"duration",0),ze(t,"currentTime",0),ze(t,"playbackState","stopped"),ze(t,"currentSegment",void 0),ze(t,"hoveredSegment",void 0)},Kl=(t,e)=>{var s;const i=(s=e==null?void 0:e.settings)==null?void 0:s.image_enabled,n=(e==null?void 0:e.content)||[];ze(t,"content",n.map(o=>{var r;return{id:o.id,title:o.title,imageUrl:i?((r=e.playlist)==null?void 0:r.image_url)||e.settings.image_url||o.image_url:null,sourceId:o.source_id,sourceUrl:o.source_url,adsEnabled:o.ads_enabled,duration:o.audio[0]?o.audio[0].duration/1e3:0,audio:o.audio.map(l=>({id:l.id,url:l.url,contentType:l.content_type,duration:l.duration?l.duration/1e3:0})),video:o.video.map(l=>({id:l.id,url:l.url,contentType:l.content_type,duration:l.duration?l.duration/1e3:0})),segments:o.segments.map(l=>({marker:l.marker,section:l.section,startTime:l.start_time?l.start_time/1e3:0,duration:l.duration?l.duration/1e3:0}))}}))},Jl=(t,e)=>{var s;const i=(s=e==null?void 0:e.settings)==null?void 0:s.image_enabled,n=(e==null?void 0:e.ads)||[];ze(t,"adverts",n.map(o=>{const r=o.type==="vast",l=Yl(o.theme),a=o[`${l}_theme`],d=o.video_theme;return{id:o.id,type:o.type,placement:o.placement,vastUrl:r?o.vast_url:null,clickThroughUrl:r?null:o.click_through_url,imageUrl:i?o.image_url:null,textColor:a==null?void 0:a.text_color,backgroundColor:a==null?void 0:a.background_color,iconColor:a==null?void 0:a.icon_color,videoTextColor:d==null?void 0:d.text_color,videoBackgroundColor:d==null?void 0:d.background_color,videoIconColor:d==null?void 0:d.icon_color,audio:r?[]:(o.audio||o.media).map(u=>({id:u.id,url:u.url,contentType:u.content_type,duration:u.duration?u.duration/1e3:0})),video:r?[]:(o.video||[]).map(u=>({id:u.id,url:u.url,contentType:u.content_type,duration:u.duration?u.duration/1e3:0}))}}))},ze=(t,e,i)=>{var s;typeof((s=t.initialProps)==null?void 0:s[e])!="undefined"||(t[e]=i)},Gm=({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},Km=({analytics_enabled:t,analytics_uuid_enabled:e})=>t?e?"allowed":"without-local-storage":"none",Jm=(t,e)=>wi(this,null,function*(){const n=yield(yield fetch(t)).blob(),s=URL.createObjectURL(n),o=document.createElement("a");document.body.append(o),o.href=s,o.setAttribute("download",e),o.setAttribute("target","_blank"),o.click(),o.remove()}),Zs={vastUrls:new Set,mediaSources:new Set},Xm=t=>{t.vastUrl&&Zs.vastUrls.add(t.vastUrl);for(const e of[...t.audio||[],...t.video||[]])Zs.mediaSources.add(e.url)},Xl=t=>{if(t.vastUrl&&Zs.vastUrls.has(t.vastUrl))return!0;for(const e of[...t.audio||[],...t.video||[]])if(Zs.mediaSources.has(e.url))return!0;return!1},Ql=new Set,Qm=t=>{[...t.audio||[],...t.video||[]].forEach(i=>Ql.add(i.url))},$m=t=>[...t.audio||[],...t.video||[]].some(i=>Ql.has(i.url)),e0=({introsOutrosIndex:t,adverts:e,advertIndex:i,content:n=[],contentIndex:s,currentTime:o,atTheStart:r,atTheEnd:l,errored:a}={})=>{var _;const d=e&&e[i];e:if(d){if(a){Xm(d);break e}if(l)return Qm(d),-1;if(!l)return i}if(!((_=n[s])!=null&&_.adsEnabled)||t!==-1)return-1;const u=i0({content:n,contentIndex:s,currentTime:o,atTheStart:r,atTheEnd:l});let g=-1,m=-1/0,v=-1/0;for(const[k,b]of e.entries()){if($m(b)||Xl(b)||!u.has(b.placement))continue;const C=t0[b.type]||0;if(C<m)continue;const V=Math.random();C===m&&V<v||(g=k,m=C,v=V)}return g},t0={vast:1,custom:0},i0=({content:t,contentIndex:e,currentTime:i,atTheStart:n,atTheEnd:s})=>{const o=e===0,r=e===t.length-1,l=t.length>1,a=l&&n&&!o,d=t[e].segments,u=d[d.length-1],g=l?null:r0(d),m=d[g],v=m&&i>m.startTime,_=u?u.startTime+u.duration:0,k=i>_-s0,b=new Set;return n&&b.add("pre-roll"),v&&!k&&b.add("mid-roll"),a&&b.add("mid-roll"),s&&r&&b.add("post-roll"),a&&b.add("post-roll"),b},n0=2*60,s0=10,o0=.5,r0=t=>{const e=t[t.length-1];if(!e)return;const i=e.startTime+e.duration;if(i<n0)return;const n=i/2,s=Mo(t,i/2),l=t[s].startTime>=n-o0?s:s+1;if(l!==t.length)return l},l0=(t,e,i,n)=>{let s=-1,o=-1/0,r=-1/0;for(const[l,a]of(n||[]).entries()){if(!t||Xl(a)||a.type==="vast")continue;const d=u0(l,e,i);if(d<o)continue;const u=a0[a.placement]||0;d===o&&u<r||(s=l,o=d,r=u)}return s},a0={"pre-roll":2,"mid-roll":1},u0=(t,e,i)=>t===i?2:t===e?1:0,$l={mediaSources:new Set},c0=t=>{for(const e of[...t.audio||[],t.video||[]])$l.mediaSources.add(e.url)},d0=t=>{for(const e of[...t.audio||[],t.video||[]])if($l.mediaSources.has(e.url))return!0;return!1},ea=new Set,g0=t=>{[...t.audio||[],...t.video||[]].forEach(i=>ea.add(i.url))},f0=t=>[...t.audio||[],...t.video||[]].some(i=>ea.has(i.url)),h0=({introsOutros:t=[],introsOutrosIndex:e,advertIndex:i,content:n,contentIndex:s,currentTime:o,atTheStart:r,atTheEnd:l,errored:a})=>{const d=t[e];e:if(d){if(a){c0(d);break e}if(l)return g0(d),-1;if(!l)return e}if(i!==-1)return-1;const u=_0({content:n,contentIndex:s,currentTime:o,atTheStart:r,atTheEnd:l});let g=-1,m=-1/0,v=-1/0;for(const[_,k]of t.entries()){if(d0(k)||!u.has(k.placement))continue;const b=f0(k)?1:0;if(b<m)continue;const C=Math.random();b===m&&C<v||(g=_,m=b,v=C)}return g},_0=({content:t,contentIndex:e,currentTime:i,atTheStart:n,atTheEnd:s})=>{const o=new Set,r=n&&e===0&&i===0,l=s&&e===t.length-1;return r&&o.add("pre-roll"),l&&o.add("post-roll"),o},m0=t=>{if(!navigator.mediaSession)return;const e=t.instances().some(o=>o.mediaSession==="override");if(b0()&&!e)return;let i,n=-1/0,s=-1/0;for(const o of t.instances()){if(o.mediaSession==="none")continue;const r=v0[o.playbackState]||0;if(r<n)continue;const l=y0[o.showMediaSession]||0;r===n&&l<s||(i=o,n=r,s=l)}for(const o of t.instances())o.showMediaSession=o===i;return i},v0={playing:1,paused:0,stopped:0},y0={true:1,false:0},b0=()=>{const t=navigator.mediaSession.metadata;if(!t||navigator.mediaSession.setByPlayer)return!1;const{title:e,artist:i,album:n,artwork:s}=t;return e||i||n||(s==null?void 0:s.length)},k0=t=>{let e=!1,i,n=-1/0,s=-1/0;for(const o of t.instances()){if(!o.userInterface||!Ko(o.widgetStyle))continue;if(o.userInterface.isVisible){e=!0;continue}if(!(o.userInterface.relativeY<0))continue;const d=p0[o.playbackState]||0;if(d<n)continue;const u=o.userInterface.absoluteY;d===n&&u<s||(i=o,n=d,s=u)}e&&n===0&&(i=null);for(const o of t.instances())o.showBottomWidget=o===i},p0={playing:2,paused:1,stopped:0};class S0{constructor(e,i){We(this,so);We(this,oo);We(this,fs);We(this,ro);We(this,lo);We(this,Oi);We(this,Qi);We(this,vi);We(this,ao);We(this,Tn);We(this,$i);We(this,uo);We(this,hs);We(this,Fi);We(this,_s);We(this,en);We(this,Rt);We(this,tn);We(this,qi);We(this,co);We(this,go);We(this,Cn);We(this,ms);We(this,fo);We(this,ho);We(this,_o);We(this,mo);this.player=e,this.PlayerClass=i,this.eventListeners={"<any>":{}}}addEventListener(e,i){e==="<any>"||this[`handle${e}`]||li(`Cannot add listener for unknown event type '${e}'.`);const s=`listener-handle-${As()}`;return this.eventListeners[e]=this.eventListeners[e]||{},this.eventListeners[e][s]=i,s}removeEventListener(e,i){this.eventListeners[e]=this.eventListeners[e]||{},delete this.eventListeners[e][i]}processEvent(e){return wi(this,null,function*(){yield zl(()=>this.player),du(e);const i=this[`handle${e.type}`],n=Ys(this.player);z(this,so,pa).call(this,e)?e.status="ignored-due-to-advert":z(this,oo,Sa).call(this,e)?e.status="ignored-due-to-scrubbing":i?(yield i.call(this,e),z(this,co,Aa).call(this),z(this,go,Ba).call(this),e.status="handled"):li("No handler function for event.",e);const s=Ys(this.player);e.changedProps=Ll(n,s),e.processedAt=new Date().toISOString(),gu(e),z(this,fs,rr).call(this,e.type,e),z(this,fs,rr).call(this,"<any>",e)})}handlePressedChangeRate(){z(this,Fi,kn).call(this,e=>e+1,{cycle:!0})}handlePressedEnterOnChangeRate(){z(this,Fi,kn).call(this,e=>e+1,{cycle:!0})}handlePressedSpaceOnChangeRate(){z(this,Fi,kn).call(this,e=>e+1,{cycle:!0})}handlePressedUpOnChangeRate(){z(this,Fi,kn).call(this,e=>e+1)}handlePressedRightOnChangeRate(){z(this,Fi,kn).call(this,e=>e+1)}handlePressedDownOnChangeRate(){z(this,Fi,kn).call(this,e=>e-1)}handlePressedLeftOnChangeRate(){z(this,Fi,kn).call(this,e=>e-1)}handlePressedPrevSegment(){z(this,_s,ar).call(this,e=>e-1)}handlePressedNextSegment(){z(this,_s,ar).call(this,e=>e+1)}handlePressedSeekBack({seconds:e}){z(this,Rt,ri).call(this,i=>i-e)}handlePressedSeekAhead({seconds:e}){z(this,Rt,ri).call(this,i=>i+e)}handlePressedPrevTrack(){z(this,en,On).call(this,e=>e-1)}handlePressedNextTrack(){z(this,en,On).call(this,e=>e+1)}handlePressedAdvertLink(){}handlePressedAdvertButton(){}handlePressedAdvertImage(){}handlePressedAdvertVideo(){}handlePressedBeyondWords(){}handlePressedSourceUrl(){}handleDurationUpdated(){}handleMediaLoaded({loadedMedia:e}){this.player.loadedMedia=e}handlePlaybackRateUpdated(){}handleVisibilityChanged(){k0(this.PlayerClass)}handlePressedVideoBackground(){z(this,$i,Wn).call(this)}handlePressedEnterOnProgressBar(){z(this,$i,Wn).call(this)}handlePressedSpaceOnProgressBar(){z(this,$i,Wn).call(this)}handlePressedEnterOnProgressCircle(){z(this,$i,Wn).call(this)}handlePressedSpaceOnProgressCircle(){z(this,$i,Wn).call(this)}handlePressedLeftOnProgressBar(){z(this,Rt,ri).call(this,e=>e-5)}handlePressedRightOnProgressBar(){z(this,Rt,ri).call(this,e=>e+5)}handlePressedLeftOnProgressCircle(){z(this,Rt,ri).call(this,e=>e-5)}handlePressedRightOnProgressCircle(){z(this,Rt,ri).call(this,e=>e+5)}handlePressedProgressBar({ratio:e}){this.preScrubState=this.player.playbackState,this.pauseTimeout=setTimeout(()=>z(this,uo,Ca).call(this),100),z(this,Rt,ri).call(this,(i,n)=>e*n),e!==0&&(this.segmentPlayed=!0)}handleScrubbedProgressBar({ratio:e}){z(this,Rt,ri).call(this,(i,n)=>e*n),e!==0&&(this.segmentPlayed=!0)}handleFinishedScrubbingProgressBar(){clearTimeout(this.pauseTimeout),this.player.playbackState=this.preScrubState,delete this.preScrubState}handleIdentifiersChanged(){Zl(this.player).then(()=>{z(this,tn,jn).call(this,{atTheStart:!0}),z(this,qi,pn).call(this,{atTheStart:!0})})}handleNoContentAvailable({description:e}){console.warn(`BeyondWords.Player: ${e}`)}handlePressedPlay({emittedFrom:e,widgetSegment:i,widgetIsCurrent:n}){e==="segment-widget"&&!n?z(this,hs,lr).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"),m0(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||z(this,qi,pn).call(this);const e=this.player.currentTime<=is,i=this.player.currentTime>=this.player.duration,n=this.player.mediaElement.video.paused;!e&&!i&&!n&&(this.player.playbackState="playing")}handlePlaybackEnded(){z(this,ao,Ta).call(this)&&(this.midrollPlayed=!0),this.segmentPlayed=!1;const e=z(this,Oi,on).call(this),i=z(this,vi,Vi).call(this);z(this,qi,pn).call(this,{atTheEnd:!0,wasIntro:e}),!i&&(z(this,tn,jn).call(this,{atTheEnd:!0}),!e&&(z(this,Qi,Vn).call(this)||z(this,vi,Vi).call(this)||z(this,en,On).call(this,n=>n+1)))}handlePlaybackNotAllowed({description:e}){console.warn(`BeyondWords.Player: ${e}`);const i=this.player.contentIndex<=0&&this.player.currentTime<=is;this.player.playbackState=i?"stopped":"paused"}handlePlaybackErrored({mediaType:e,errorMessage:i}){console.warn(`BeyondWords.Player: ${e} playback error: ${i}`),z(this,Oi,on).call(this)||z(this,Qi,Vn).call(this)?z(this,tn,jn).call(this,{errored:!0}):z(this,vi,Vi).call(this)?z(this,qi,pn).call(this,{errored:!0}):this.handlePlaybackEnded()}handlePressedMaximize(){nl()?C_():T_(this.player.target)}handleFullScreenModeUpdated(){const e=nl()===this.player.target,i=e?"add":"remove";this.player.isFullScreen=e,this.player.target.classList[i]("maximized")}handlePressedPlaylistItem({index:e}){z(this,en,On).call(this,()=>e),this.player.playbackState="playing"}handlePressedTogglePlaylist(){const e=this.player.playlistStyle.split("-"),i=this.player.content.length>1,n=e[0]==="show"||e[0]==="auto"&&i;e[0]=n?"hide":"show",this.player.playlistStyle=e.join("-")}handlePressedDownload({contentIndex:e,audioIndex:i,videoIndex:n}){var u,g;const s=this.player.content[e],o=(u=s.audio)==null?void 0:u[i],r=(g=s.video)==null?void 0:g[n],l=(o||r).url,a=l.split(".").pop(),d=`${s.title}.${a}`;return Jm(l,d)}handlePressedCloseWidget(){for(const e of this.PlayerClass.instances())e.playbackState="paused",e.widgetStyle="closed-by-user"}handleContentStatusChanged({contentId:e,legacyId:i,sourceId:n,sourceUrl:s,contentStatus:o}){o==="processed"&&this.player.playbackState==="stopped"&&this.player.contentIndex===0&&this.player.currentTime===0&&z(this,_o,Wa).call(this,{contentId:e,legacyId:i,sourceId:n,sourceUrl:s})&&Zl(this.player).then(()=>{z(this,tn,jn).call(this,{atTheStart:!0}),z(this,qi,pn).call(this,{atTheStart:!0})})}handleCurrentSegmentUpdated({segment:e,segmentIndex:i,contentIndex:n}){var s;z(this,Tn,bs).call(this)?this.player.currentSegment=sn(oi({},e),{segmentIndex:i,contentIndex:n}):this.segmentPlayed||((s=this.player.segmentContainers)==null||s.reset(),this.player.currentSegment=null)}handleHoveredSegmentUpdated({segment:e,segmentIndex:i,contentIndex:n}){e?this.player.hoveredSegment=sn(oi({},e),{segmentIndex:i,contentIndex:n}):this.player.hoveredSegment=null}handlePressedSegment({segment:e,segmentIndex:i,contentIndex:n}){if(!rs("hovered",e,this.player.clickableSections))return;if(!z(this,mo,Oa).call(this,{contentIndex:n,segmentIndex:i})&&!z(this,vi,Vi).call(this)){z(this,$i,Wn).call(this);return}n!==this.player.contentIndex&&z(this,en,On).call(this,()=>n),z(this,hs,lr).call(this,oi({segmentIndex:i,contentIndex:n},e))}}so=new WeakSet,pa=function({type:e}){return z(this,vi,Vi).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"))},oo=new WeakSet,Sa=function({type:e}){return this.preScrubState&&(e.includes("CurrentTimeUpdated")||e.includes("PlaybackEnded"))},fs=new WeakSet,rr=function(e,i){const n=this.eventListeners[e]||{};Object.values(n).forEach(s=>s(i))},ro=new WeakSet,wa=function(){return this.player.introsOutros.some(e=>e.placement==="pre-roll")},lo=new WeakSet,Pa=function(){return this.player.introsOutros.some(e=>e.placement==="post-roll")},Oi=new WeakSet,on=function(e=this.player.introsOutrosIndex){var i,n,s;return((s=(n=(i=this.player)==null?void 0:i.introsOutros)==null?void 0:n[e])==null?void 0:s.placement)==="pre-roll"},Qi=new WeakSet,Vn=function(e=this.player.introsOutrosIndex){var i,n,s;return((s=(n=(i=this.player)==null?void 0:i.introsOutros)==null?void 0:n[e])==null?void 0:s.placement)==="post-roll"},vi=new WeakSet,Vi=function(){return this.player.advertIndex!==-1},ao=new WeakSet,Ta=function(){var e;return((e=this.player.adverts[this.player.advertIndex])==null?void 0:e.placement)==="mid-roll"},Tn=new WeakSet,bs=function(){return!z(this,Oi,on).call(this)&&!z(this,Qi,Vn).call(this)&&!z(this,vi,Vi).call(this)},$i=new WeakSet,Wn=function(){this.player.playbackState==="playing"?this.player.playbackState="paused":this.player.playbackState="playing"},uo=new WeakSet,Ca=function(){this.player.playbackState==="playing"&&(this.player.playbackState="paused")},hs=new WeakSet,lr=function(s){var o=s,{segmentIndex:e,contentIndex:i}=o,n=ir(o,["segmentIndex","contentIndex"]);z(this,Rt,ri).call(this,()=>n.startTime,i),this.player.currentSegment=oi({segmentIndex:e,contentIndex:i},n),this.player.playbackState="playing",this.segmentPlayed=!0},Fi=new WeakSet,kn=function(e,{cycle:i}={}){const n=this.player.playbackRates,s=n.length-1,o=n.indexOf(this.player.playbackRate),r=e(o);let l;i?l=r%n.length:l=Math.max(0,Math.min(s,r)),this.player.playbackRate=n[l]||1},_s=new WeakSet,ar=function(e){const i=this.player.content[this.player.contentIndex].segments,n=Mo(i,this.player.currentTime),s=e(n);z(this,Oi,on).call(this)&&s>=0?this.handlePlaybackEnded():z(this,Qi,Vn).call(this)&&s<0?(z(this,Cn,ks).call(this,-1),z(this,Rt,ri).call(this,()=>{var o;return((o=i[i.length-1])==null?void 0:o.startTime)||.01}),this.player.playbackState="playing"):z(this,Tn,bs).call(this)&&s<0&&z(this,ro,wa).call(this)?(z(this,Rt,ri).call(this,()=>0),z(this,tn,jn).call(this,{atTheStart:!0})):z(this,Tn,bs).call(this)&&s===i.length&&z(this,lo,Pa).call(this)?z(this,Rt,ri).call(this,()=>this.player.duration-.01):z(this,Tn,bs).call(this)&&s>=0&&s<i.length&&z(this,Rt,ri).call(this,()=>i[s].startTime)},en=new WeakSet,On=function(e){const i=e(this.player.contentIndex),n=i<0||i>=this.player.content.length;n?(this.player.playbackState="stopped",z(this,Rt,ri).call(this,()=>0)):(this.player.contentIndex=i,z(this,vi,Vi).call(this)||(z(this,Rt,ri).call(this,()=>0),this.midrollPlayed=!1)),z(this,Cn,ks).call(this,-1),z(this,tn,jn).call(this,{atTheStart:!0}),n||z(this,qi,pn).call(this,{atTheStart:!0})},Rt=new WeakSet,ri=function(e,i){if(z(this,vi,Vi).call(this))this.prevTime=e(),this.prevContent=i;else{const n=this.player.duration||0;this.player.currentTime=e(this.player.currentTime,n)}},tn=new WeakSet,jn=function({atTheStart:e,atTheEnd:i,errored:n}={}){const{content:s,introsOutros:o,currentTime:r}=this.player,l=typeof this.nextIntroOutro!="undefined"?this.nextIntroOutro:this.player.introsOutrosIndex,a=typeof this.nextAdvert!="undefined"?this.nextAdvert:this.player.advertIndex,d=typeof this.prevContent!="undefined"?this.prevContent:this.player.contentIndex;z(this,Cn,ks).call(this,h0({introsOutros:o,introsOutrosIndex:l,advertIndex:a,content:s,contentIndex:d,currentTime:r,atTheStart:e,atTheEnd:i,errored:n}))},qi=new WeakSet,pn=function({atTheStart:e,atTheEnd:i,wasIntro:n,errored:s}={}){const{adverts:o,content:r,currentTime:l}=this.player;let a=typeof this.nextIntroOutro!="undefined"?this.nextIntroOutro:this.player.introsOutrosIndex;const d=typeof this.nextAdvert!="undefined"?this.nextAdvert:this.player.advertIndex,u=typeof this.prevContent!="undefined"?this.prevContent:this.player.contentIndex;n&&(e=!0,i=!1,a=-1),z(this,ms,ur).call(this,e0({introsOutrosIndex:a,adverts:o,advertIndex:d,content:r,contentIndex:u,currentTime:l,atTheStart:e,atTheEnd:i,errored:s}));const g=this.player.persistentAdImage,m=this.player.persistentIndex;this.player.persistentIndex=l0(g,m,d,o)},co=new WeakSet,Aa=function(){this.player.playbackState==="playing"&&typeof this.nextIntroOutro!="undefined"&&(z(this,Cn,ks).call(this,this.nextIntroOutro),delete this.nextIntroOutro)},go=new WeakSet,Ba=function(){this.player.playbackState==="playing"&&typeof this.nextAdvert!="undefined"&&(z(this,ms,ur).call(this,this.nextAdvert),delete this.nextAdvert)},Cn=new WeakSet,ks=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<=is)&&z(this,Oi,on).call(this,e)){this.player.introsOutrosIndex=-1,z(this,qi,pn).call(this,{atTheStart:!0});return}const o=z(this,Oi,on).call(this),r=z(this,Qi,Vn).call(this);this.player.introsOutrosIndex=e;const l=o&&!z(this,Oi,on).call(this),a=r&&!z(this,Qi,Vn).call(this);l&&(this.player.currentTime=0),a&&z(this,en,On).call(this,()=>1/0)},ms=new WeakSet,ur=function(e){if(this.player.playbackState!=="playing"&&e!==-1){this.nextAdvert=e;return}else delete this.nextAdvert;const n=z(this,vi,Vi).call(this);this.player.advertIndex=e;const s=!n&&z(this,vi,Vi).call(this),o=n&&!z(this,vi,Vi).call(this);s&&z(this,fo,Ia).call(this),o&&z(this,ho,Va).call(this)},fo=new WeakSet,Ia=function(){z(this,Oi,on).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},ho=new WeakSet,Va=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},_o=new WeakSet,Wa=function({contentId:e,legacyId:i,sourceId:n,sourceUrl:s}){var o,r,l,a;return this.player.contentId===e||this.player.contentId===i||this.player.sourceId===n||this.player.sourceUrl===s||((o=this.player.playlist)==null?void 0:o.some(d=>d.contentId===e))||((r=this.player.playlist)==null?void 0:r.some(d=>d.contentId===i))||((l=this.player.playlist)==null?void 0:l.some(d=>d.sourceId===n))||((a=this.player.playlist)==null?void 0:a.some(d=>d.sourceUrl===s))},mo=new WeakSet,Oa=function({contentIndex:e,segmentIndex:i}){var n,s;return((n=this.player.currentSegment)==null?void 0:n.contentIndex)!==e||((s=this.player.currentSegment)==null?void 0:s.segmentIndex)!==i};var as="<unknown>";function w0(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])||Il(e,"src",i)},m(o,r){B(o,e,r),B(o,n,r),B(o,s,r)},p(o,r){r&1&&!Wi(e.src,i="https://www.googletagmanager.com/gtag/js?id="+o[0])&&Il(e,"src",i)},d(o){o&&(A(e),A(n),A(s))}}}function fm(t){let e,i=!t[1]&&Vl(t);return{c(){i&&i.c(),e=Hi()},m(n,s){i&&i.m(document.head,null),f(document.head,e)},p(n,[s]){n[1]?i&&(i.d(1),i=null):i?i.p(n,s):(i=Vl(n),i.c(),i.m(e.parentNode,e))},i:E,o:E,d(n){i&&i.d(n),A(e)}}}function hm(t,e,i){let n,{analyticsTag:s}=e;return t.$$set=o=>{"analyticsTag"in o&&i(0,s=o.analyticsTag)},i(1,n=window.gtag),[s,n]}class _m extends pe{constructor(e){super(),ke(this,e,hm,fm,_e,{analyticsTag:0})}get analyticsTag(){return this.$$.ctx[0]}set analyticsTag(e){this.$$set({analyticsTag:e}),c()}}const Fv="";class mm extends pe{constructor(e){super(),ke(this,e,null,null,_e,{})}}class qo{constructor(e,i){We(this,us);We(this,Js);this.onSelected=e,this.onDeselected=i,this.consumers={}}addInterest(e,i,...n){var o;(o=this.consumers)[e]||(o[e]=[]);const s=this.consumers[e].slice(-1)[0];this.consumers[e].push({consumerId:i,args:n}),!(s&&z(this,us,or).call(this,n,s.args))&&(s&&this.onDeselected(e,...s.args),this.onSelected(e,...n))}removeInterest(e,i){var r;(r=this.consumers)[e]||(r[e]=[]);const n=this.consumers[e].slice(-1)[0];if(z(this,Js,fa).call(this,this.consumers[e],l=>l.consumerId===i),!(n&&i===n.consumerId))return;const o=this.consumers[e].slice(-1)[0];o&&z(this,us,or).call(this,n.args,o.args)||(this.onDeselected(e,...n.args),o&&this.onSelected(e,...o.args))}}us=new WeakSet,or=function(e,i){return e.length===i.length&&e.every((n,s)=>n===i[s])},Js=new WeakSet,fa=function(e,i){for(let n=e.length-1;n>=0;n-=1)if(i(e[n])){e.splice(n,1);return}};const rs=(t,e,i)=>{let[n,s]=i.split("-");n||(n="none"),s||(s=n);const o=t==="current"?n:s;return o==="all"||o==="body"&&(e==null?void 0:e.section)==="body"},dn="data-beyondwords-marker",Wl=t=>["beyondwords-highlight","bwp",`marker-${t}`],Ki=class Ki{update(e,i,n,s){const o=rs(e,i,n),r=this[`prev${e}`],l=o?i==null?void 0:i.marker:null;l&&Mi(Ki,cs).addInterest(l,this,s),r&&Mi(Ki,cs).removeInterest(r,this),this[`prev${e}`]=l}};cs=new WeakMap,Xs=new WeakSet,ha=function(e,i){const n=document.querySelectorAll(`[${dn}="${e}"]`);for(const s of n){const o=document.createTreeWalker(s,NodeFilter.SHOW_TEXT,null,!1);let r;for(;r=o.nextNode();){if(/^\s*$/.test(r.nodeValue))continue;r.parentNode.nodeName.toLowerCase()==="a"&&(r=r.parentNode);const d=document.createElement("mark");d.classList.add(...Wl(e)),d.style.background=i,r.parentNode.insertBefore(d,r),d.appendChild(r)}}},Qs=new WeakSet,_a=function(e){const i=document.querySelectorAll(`[${dn}="${e}"]`);for(const n of i){const s=n.querySelectorAll(`mark.${Wl(e)}`);for(const o of s)for(const r of o.childNodes)o.parentNode.insertBefore(r,o),o.remove()}},We(Ki,Xs),We(Ki,Qs),We(Ki,cs,new qo(z(Ki,Xs,ha),z(Ki,Qs,_a)));let Ho=Ki;const Ol=["beyondwords-clickable","bwp"],Ji=class Ji{update(e,i){const n=rs("hovered",e,i),s=this.previous,o=n?e==null?void 0:e.marker:null;o&&Mi(Ji,ds).addInterest(o,this),s&&Mi(Ji,ds).removeInterest(s,this),this.previous=o}};ds=new WeakMap,$s=new WeakSet,ma=function(e){const i=document.querySelectorAll(`[${dn}="${e}"]`);for(const n of i)n.classList.add(...Ol)},eo=new WeakSet,va=function(e){const i=document.querySelectorAll(`[${dn}="${e}"]`);for(const n of i)jl(n,Ol)},We(Ji,$s),We(Ji,eo),We(Ji,ds,new qo(z(Ji,$s,ma),z(Ji,eo,va)));let Yo=Ji;const jl=(t,e)=>{if(!t)return;const s=[...t.classList].filter(o=>!e.includes(o)).some(o=>o.startsWith("beyondwords-"))?e.filter(o=>o!=="bwp"):e;t.classList.remove(...s)},El=(t,e,i)=>["beyondwords-widget","bwp",`marker-${t}`,`position-${e}`,`for-${i}-player`],Ml=["beyondwords-relative","bwp"],Xi=class Xi{constructor(e){this.onUpdate=e,this.containers=[]}update(e,i,n,s){const o=i.includes("all")||i.includes("body"),r=this.previous,l=(e==null?void 0:e.marker)||o&&(r==null?void 0:r.marker);l&&Mi(Xi,gs).addInterest(l,this,this,n,s),r&&Mi(Xi,gs).removeInterest(r,this),this.previous=l}reset(){this.update(null,"none")}};gs=new WeakMap,to=new WeakSet,ya=function(e,i,n,s){const o=document.querySelector(`[${dn}="${e}"]`),r=document.createElement("div");if(!o)return;["2-oclock","3-oclock","4-oclock","8-oclock","9-oclock","10-oclock"].includes(n)&&o.classList.add(...Ml),r.classList.add(...El(e,n,s)),["11-oclock","12-oclock","1-oclock"].includes(n)?o.insertBefore(r,o.firstChild):o.appendChild(r),i.containers.push(r),i.onUpdate(i.containers)},io=new WeakSet,ba=function(e,i,n,s){const o=El(e,n,s);for(let r=0;r<i.containers.length;r+=1){if(!o.every(d=>i.containers[r].classList.contains(d)))continue;const a=i.containers[r].parentNode;jl(a,Ml),i.containers[r].remove(),i.containers.splice(r,1),r-=1}i.onUpdate(i.containers)},We(Xi,to),We(Xi,io),We(Xi,gs,new qo(z(Xi,to,ya),z(Xi,io,ba)));let Zo=Xi;const vm=()=>me({type:"IdentifiersChanged",description:"The Player's content identifiers changed.",initiatedBy:"browser"}),wn=(i,...n)=>wi(this,[i,...n],function*(t,e={}){const s=yield fetch(t,e).catch(()=>{}),o=yield s==null?void 0:s.json().catch(()=>{});return(s==null?void 0:s.status)!==200&&li(`Failed to fetch ${t}`,sn(oi({},e),{responseStatus:s==null?void 0:s.status,responseJson:o})),o}),ym=(t,e)=>wn(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e,(i,n)=>n===void 0?null:n)});class bm{constructor(e,i,n){We(this,no);this.baseUrl=z(this,no,ka).call(this,e),this.projectId=i,this.writeToken=n}getWebSocketToken(){return wi(this,null,function*(){const e={Authorization:`Token token=${this.writeToken}`},{token:i}=yield wn(`https://${this.baseUrl}/api/v4/token/ws`,{headers:e});this.webSocketToken=i})}establishConnection(e,i){return wi(this,null,function*(){const n=`wss://${this.baseUrl}/cable?token=${this.webSocketToken}`,s="actioncable-v1-json";this.webSocket=new WebSocket(n,s),this.webSocket.onmessage=o=>e(JSON.parse(o.data)),this.webSocket.onerror=i,yield new Promise(o=>this.webSocket.onopen=o)})}subscribeToStatusChanges(){const e=JSON.stringify({channel:"Api::V1::ProjectChannel",id:this.projectId}),i=JSON.stringify({command:"subscribe",identifier:e});this.webSocket.send(i)}destroy(){this.webSocketToken=null,this.webSocket&&(this.webSocket.onmessage=()=>{},this.webSocket.onerror=()=>{},this.webSocket.close(),this.webSocket=null)}}no=new WeakSet,ka=function(e){return e.includes("staging")?"app.staging-beyondwords.io":"app.beyondwords.io"};let Pn;const km=(t,e,i,n)=>wi(this,null,function*(){!t||!e||!i||(Pn==null||Pn.destroy(),Pn=new bm(t,e,i),yield Pn.getWebSocketToken(),yield Pn.establishConnection(pm(n),Pm),yield Pn.subscribeToStatusChanges())}),pm=t=>e=>{var s,o;((o=(s=e==null?void 0:e.message)==null?void 0:s.result)==null?void 0:o.action)==="podcast_state_updated"&&Sm(e,t),e.type==="reject_subscription"&&wm(e)},Sm=(t,e)=>{const i=t.message.result;e(me({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}))},wm=t=>{li("The WebSocket status change subscription was rejected.",{webSocketEvent:t})},Pm=t=>{li("Unexpected WebSocket error.",{error:t})},zl=t=>{if(!t())return new Promise(e=>{setInterval(()=>t()&&e(),10)})},Ys=t=>{const i=Object.keys(t.$$.props).filter(n=>!Tm.has(n)).map(n=>[n,t[n]]);return Object.fromEntries(i)},Tm=new Set(["addEventListener","removeEventListener","mediaElement","userInterface","widgetInterface","controller"]),Ll=(t,e)=>{const i=new Set([...Object.keys(t),...Object.keys(e)]),n={};for(const s of i){const o=t[s],r=e[s];o!==r&&(n[s]={previousValue:o,currentValue:r})}return n};let ls=-1;const Nl=[],Cm=(t,e,i)=>wi(this,null,function*(){yield zl(()=>e.player);const n=e.player,s=Am(n.contentIndex,i,t);s>ls&&Bm(n,ls,s,t),s<ls&&Im(n,ls,s),ls=s}),Am=(t,e,i)=>{const n=i.findIndex(o=>o[0]===t&&o[1]>e||o[0]>t);return n===-1?i.length-1:n-1},Bm=(t,e,i,n)=>{for(let s=e+1;s<=i;s+=1){const o=Ys(t);n[s][2](t);const r=Ys(t),l=Ll(o,r);Nl.push(l)}},Im=(t,e,i)=>{for(let n=e;n>i;n-=1){const s=Nl.pop();for(const[o,r]of Object.entries(s))t[o]=r.previousValue}},Vm=t=>t?Wm(t)?{newTarget:jm(t),showUserInterface:!0}:typeof t=="string"?{newTarget:Go(t),showUserInterface:!0}:{newTarget:t,showUserInterface:!0}:{newTarget:Om(),showUserInterface:!1},Wm=t=>typeof t=="object"&&t.nodeName.toLowerCase()==="script",Om=()=>{const t=document.createElement("div");return document.body.appendChild(t),t},jm=t=>{const e=document.createElement("div");return t.parentNode.insertBefore(e,t.nextSibling),e},Go=(t,e="player")=>{if(typeof t!="string")return t;const i=document.querySelectorAll(t);return i.length===0&&li(`Failed to initialize ${e} because the target could not be found.`,{target:t,elements:i}),i.length>1&&li(`Failed to initialize ${e} because the target is ambiguous. (${i.length} elements match)`,{target:t,elements:i}),i[0]},Em=["small","standard","large","screen","video"],Ko=t=>Em.indexOf(t)!==-1;function Dl(t,e,i){const n=t.slice();return n[157]=e[i],n}function Mm(t){let e,i,n,s,o,r,l,a;function d(b){t[103](b)}function u(b){t[104](b)}function g(b){t[105](b)}function m(b){t[106](b)}function v(b){t[107](b)}function _(b){t[108](b)}let k={onEvent:t[58],content:t[51],contentIndex:t[7],introOrOutro:t[60],activeAdvert:t[61],advertConsent:t[41],showUserInterface:t[5],videoBehindWidget:t[64],videoBehindStatic:t[69],videoMightBeShown:t[63],widgetPosition:t[33],widgetWidth:t[34],widgetTarget:t[14]};return t[12]!==void 0&&(k.playbackState=t[12]),t[31]!==void 0&&(k.duration=t[31]),t[11]!==void 0&&(k.currentTime=t[11]),t[32]!==void 0&&(k.playbackRate=t[32]),t[48]!==void 0&&(k.prevPercentage=t[48]),t[23]!==void 0&&(k.isLoaded=t[23]),e=new Ud({props:k}),t[102](e),$.push(()=>he(e,"playbackState",d)),$.push(()=>he(e,"duration",u)),$.push(()=>he(e,"currentTime",g)),$.push(()=>he(e,"playbackRate",m)),$.push(()=>he(e,"prevPercentage",v)),$.push(()=>he(e,"isLoaded",_)),{c(){ue(e.$$.fragment)},m(b,C){re(e,b,C),a=!0},p(b,C){const V={};C[1]&1048576&&(V.content=b[51]),C[0]&128&&(V.contentIndex=b[7]),C[1]&536870912&&(V.introOrOutro=b[60]),C[1]&1073741824&&(V.activeAdvert=b[61]),C[1]&1024&&(V.advertConsent=b[41]),C[0]&32&&(V.showUserInterface=b[5]),C[2]&4&&(V.videoBehindWidget=b[64]),C[2]&128&&(V.videoBehindStatic=b[69]),C[2]&2&&(V.videoMightBeShown=b[63]),C[1]&4&&(V.widgetPosition=b[33]),C[1]&8&&(V.widgetWidth=b[34]),C[0]&16384&&(V.widgetTarget=b[14]),!i&&C[0]&4096&&(i=!0,V.playbackState=b[12],fe(()=>i=!1)),!n&&C[1]&1&&(n=!0,V.duration=b[31],fe(()=>n=!1)),!s&&C[0]&2048&&(s=!0,V.currentTime=b[11],fe(()=>s=!1)),!o&&C[1]&2&&(o=!0,V.playbackRate=b[32],fe(()=>o=!1)),!r&&C[1]&131072&&(r=!0,V.prevPercentage=b[48],fe(()=>r=!1)),!l&&C[0]&8388608&&(l=!0,V.isLoaded=b[23],fe(()=>l=!1)),e.$set(V)},i(b){a||(p(e.$$.fragment,b),a=!0)},o(b){I(e.$$.fragment,b),a=!1},d(b){t[102](null),le(e,b)}}}function Rl(t){let e,i,n={onEvent:t[58],playerStyle:t[65],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],activeAdvert:t[61],persistentAdvert:t[72],textColor:t[35],backgroundColor:t[36],iconColor:t[37],videoTextColor:t[38],videoBackgroundColor:t[54],videoIconColor:t[39],logoIconEnabled:t[40],logoImagePosition:t[57],isFullScreen:t[56],videoPosterImage:t[67],videoIsBehind:t[69]};return e=new Uo({props:n}),t[109](e),{c(){ue(e.$$.fragment)},m(s,o){re(e,s,o),i=!0},p(s,o){const r={};o[2]&8&&(r.playerStyle=s[65]),o[0]&33554432&&(r.callToAction=s[25]),o[0]&67108864&&(r.skipButtonStyle=s[26]),o[0]&134217728&&(r.playlistStyle=s[27]),o[0]&268435456&&(r.playlistToggle=s[28]),o[1]&524288&&(r.downloadFormats=s[50]),o[0]&16777216&&(r.playerTitle=s[24]),o[1]&1048576&&(r.content=s[51]),o[0]&128&&(r.contentIndex=s[7]),o[1]&1&&(r.duration=s[31]),o[0]&2048&&(r.currentTime=s[11]),o[0]&4096&&(r.playbackState=s[12]),o[1]&2&&(r.playbackRate=s[32]),o[1]&1073741824&&(r.activeAdvert=s[61]),o[2]&1024&&(r.persistentAdvert=s[72]),o[1]&16&&(r.textColor=s[35]),o[1]&32&&(r.backgroundColor=s[36]),o[1]&64&&(r.iconColor=s[37]),o[1]&128&&(r.videoTextColor=s[38]),o[1]&8388608&&(r.videoBackgroundColor=s[54]),o[1]&256&&(r.videoIconColor=s[39]),o[1]&512&&(r.logoIconEnabled=s[40]),o[1]&67108864&&(r.logoImagePosition=s[57]),o[1]&33554432&&(r.isFullScreen=s[56]),o[2]&32&&(r.videoPosterImage=s[67]),o[2]&128&&(r.videoIsBehind=s[69]),e.$set(r)},i(s){i||(p(e.$$.fragment,s),i=!0)},o(s){I(e.$$.fragment,s),i=!1},d(s){t[109](null),le(e,s)}}}function xl(t){let e,i;return e=new Hs({props:{root:t[14],$$slots:{default:[zm]},$$scope:{ctx:t}}}),{c(){ue(e.$$.fragment)},m(n,s){re(e,n,s),i=!0},p(n,s){const o={};s[0]&16384&&(o.root=n[14]),s[0]&117471360|s[1]&1150878719|s[2]&1060|s[5]&32&&(o.$$scope={dirty:s,ctx:n}),e.$set(o)},i(n){i||(p(e.$$.fragment,n),i=!0)},o(n){I(e.$$.fragment,n),i=!1},d(n){le(e,n)}}}function zm(t){let e,i,n={onEvent:t[58],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],activeAdvert:t[61],persistentAdvert:t[72],textColor:t[35],backgroundColor:t[36],iconColor:t[37],videoTextColor:t[38],videoBackgroundColor:t[54],videoIconColor:t[39],logoIconEnabled:t[40],logoImagePosition:t[57],videoPosterImage:t[67],videoIsBehind:t[64]};return e=new Uo({props:n}),t[110](e),{c(){ue(e.$$.fragment)},m(s,o){re(e,s,o),i=!0},p(s,o){const r={};o[0]&8192&&(r.playerStyle=s[13]),o[0]&33554432&&(r.callToAction=s[25]),o[0]&67108864&&(r.skipButtonStyle=s[26]),o[1]&524288&&(r.downloadFormats=s[50]),o[0]&16777216&&(r.playerTitle=s[24]),o[0]&16384|o[1]&4&&(r.fixedPosition=!s[14]&&s[33]),o[1]&8&&(r.fixedWidth=s[34]),o[1]&1048576&&(r.content=s[51]),o[0]&128&&(r.contentIndex=s[7]),o[1]&1&&(r.duration=s[31]),o[0]&2048&&(r.currentTime=s[11]),o[0]&4096&&(r.playbackState=s[12]),o[1]&2&&(r.playbackRate=s[32]),o[1]&1073741824&&(r.activeAdvert=s[61]),o[2]&1024&&(r.persistentAdvert=s[72]),o[1]&16&&(r.textColor=s[35]),o[1]&32&&(r.backgroundColor=s[36]),o[1]&64&&(r.iconColor=s[37]),o[1]&128&&(r.videoTextColor=s[38]),o[1]&8388608&&(r.videoBackgroundColor=s[54]),o[1]&256&&(r.videoIconColor=s[39]),o[1]&512&&(r.logoIconEnabled=s[40]),o[1]&67108864&&(r.logoImagePosition=s[57]),o[2]&32&&(r.videoPosterImage=s[67]),o[2]&4&&(r.videoIsBehind=s[64]),e.$set(r)},i(s){i||(p(e.$$.fragment,s),i=!0)},o(s){I(e.$$.fragment,s),i=!1},d(s){t[110](null),le(e,s)}}}function Lm(t){let e,i;return e=new Uo({props:{onEvent:t[111],playerStyle:"small",fixedWidth:0,logoIconEnabled:!1,content:t[51],contentIndex:t[7],duration:t[31],currentTime:t[66]?t[11]:t[59].startTime,playbackState:t[66]?t[12]:"paused",activeAdvert:t[61],persistentAdvert:t[72],textColor:t[35],backgroundColor:t[36],iconColor:t[37],videoTextColor:t[38],videoBackgroundColor:t[54],videoIconColor:t[39]}}),{c(){ue(e.$$.fragment)},m(n,s){re(e,n,s),i=!0},p(n,s){const o={};s[1]&268435456|s[2]&1&&(o.onEvent=n[111]),s[1]&1048576&&(o.content=n[51]),s[0]&128&&(o.contentIndex=n[7]),s[1]&1&&(o.duration=n[31]),s[0]&2048|s[1]&268435456|s[2]&16&&(o.currentTime=n[66]?n[11]:n[59].startTime),s[0]&4096|s[2]&16&&(o.playbackState=n[66]?n[12]:"paused"),s[1]&1073741824&&(o.activeAdvert=n[61]),s[2]&1024&&(o.persistentAdvert=n[72]),s[1]&16&&(o.textColor=n[35]),s[1]&32&&(o.backgroundColor=n[36]),s[1]&64&&(o.iconColor=n[37]),s[1]&128&&(o.videoTextColor=n[38]),s[1]&8388608&&(o.videoBackgroundColor=n[54]),s[1]&256&&(o.videoIconColor=n[39]),e.$set(o)},i(n){i||(p(e.$$.fragment,n),i=!0)},o(n){I(e.$$.fragment,n),i=!1},d(n){le(e,n)}}}function Ul(t,e){let i,n,s;return n=new Hs({props:{root:e[157],$$slots:{default:[Lm]},$$scope:{ctx:e}}}),{key:t,first:null,c(){i=Hi(),ue(n.$$.fragment),this.first=i},m(o,r){B(o,i,r),re(n,o,r),s=!0},p(o,r){e=o;const l={};r[1]&262144&&(l.root=e[157]),r[0]&6272|r[1]&1351614961|r[2]&1041|r[5]&32&&(l.$$scope={dirty:r,ctx:e}),n.$set(l)},i(o){s||(p(n.$$.fragment,o),s=!0)},o(o){I(n.$$.fragment,o),s=!1},d(o){o&&A(i),le(n,o)}}}function Fl(t){let e,i;return e=new Hs({props:{root:t[22],$$slots:{default:[Nm]},$$scope:{ctx:t}}}),{c(){ue(e.$$.fragment)},m(n,s){re(e,n,s),i=!0},p(n,s){const o={};s[0]&4194304&&(o.root=n[22]),s[0]&2134900735|s[1]&7356415|s[5]&32&&(o.$$scope={dirty:s,ctx:n}),e.$set(o)},i(n){i||(p(e.$$.fragment,n),i=!0)},o(n){I(e.$$.fragment,n),i=!1},d(n){le(e,n)}}}function Nm(t){let e,i,n,s,o,r,l,a,d,u,g,m,v,_,k,b,C,V,Z,O,j,L,N,K,U,X,Te,ve,be,ne,ee,F,se,ge,G,ae,w,q,we,Pe,Ve,J,Ce,Be,Ue;function He(S){t[112](S)}function st(S){t[113](S)}function _t(S){t[114](S)}function kt(S){t[115](S)}function je(S){t[116](S)}function Ee(S){t[117](S)}function $e(S){t[118](S)}function Ze(S){t[119](S)}function At(S){t[120](S)}function Xe(S){t[121](S)}function et(S){t[122](S)}function tt(S){t[123](S)}function Ne(S){t[124](S)}function it(S){t[125](S)}function Ge(S){t[126](S)}function ht(S){t[127](S)}function Fe(S){t[128](S)}function lt(S){t[129](S)}function ot(S){t[130](S)}function Bt(S){t[131](S)}function qe(S){t[132](S)}function pt(S){t[133](S)}function gt(S){t[134](S)}function x(S){t[135](S)}function Le(S){t[136](S)}function De(S){t[137](S)}function Qe(S){t[138](S)}function Ke(S){t[139](S)}function mt(S){t[140](S)}function at(S){t[141](S)}function It(S){t[142](S)}function St(S){t[143](S)}function Ye(S){t[144](S)}function ut(S){t[145](S)}function zt(S){t[146](S)}function Vt(S){t[147](S)}function Lt(S){t[148](S)}function ct(S){t[149](S)}function xt(S){t[150](S)}function Qt(S){t[151](S)}function R(S){t[152](S)}function wt(S){t[153](S)}function dt(S){t[154](S)}let ce={content:t[51],introsOutros:t[52],adverts:t[53]};return t[0]!==void 0&&(ce.projectId=t[0]),t[1]!==void 0&&(ce.contentId=t[1]),t[2]!==void 0&&(ce.playlistId=t[2]),t[3]!==void 0&&(ce.sourceId=t[3]),t[4]!==void 0&&(ce.sourceUrl=t[4]),t[5]!==void 0&&(ce.showUserInterface=t[5]),t[6]!==void 0&&(ce.playerStyle=t[6]),t[24]!==void 0&&(ce.playerTitle=t[24]),t[25]!==void 0&&(ce.callToAction=t[25]),t[26]!==void 0&&(ce.skipButtonStyle=t[26]),t[27]!==void 0&&(ce.playlistStyle=t[27]),t[28]!==void 0&&(ce.playlistToggle=t[28]),t[29]!==void 0&&(ce.mediaSession=t[29]),t[7]!==void 0&&(ce.contentIndex=t[7]),t[8]!==void 0&&(ce.introsOutrosIndex=t[8]),t[9]!==void 0&&(ce.advertIndex=t[9]),t[30]!==void 0&&(ce.persistentAdImage=t[30]),t[10]!==void 0&&(ce.persistentIndex=t[10]),t[31]!==void 0&&(ce.duration=t[31]),t[11]!==void 0&&(ce.currentTime=t[11]),t[12]!==void 0&&(ce.playbackState=t[12]),t[32]!==void 0&&(ce.playbackRate=t[32]),t[13]!==void 0&&(ce.widgetStyle=t[13]),t[33]!==void 0&&(ce.widgetPosition=t[33]),t[34]!==void 0&&(ce.widgetWidth=t[34]),t[14]!==void 0&&(ce.widgetTarget=t[14]),t[35]!==void 0&&(ce.textColor=t[35]),t[36]!==void 0&&(ce.backgroundColor=t[36]),t[37]!==void 0&&(ce.iconColor=t[37]),t[15]!==void 0&&(ce.highlightColor=t[15]),t[38]!==void 0&&(ce.videoTextColor=t[38]),t[39]!==void 0&&(ce.videoIconColor=t[39]),t[40]!==void 0&&(ce.logoIconEnabled=t[40]),t[16]!==void 0&&(ce.highlightSections=t[16]),t[17]!==void 0&&(ce.clickableSections=t[17]),t[18]!==void 0&&(ce.segmentWidgetSections=t[18]),t[19]!==void 0&&(ce.segmentWidgetPosition=t[19]),t[20]!==void 0&&(ce.currentSegment=t[20]),t[21]!==void 0&&(ce.hoveredSegment=t[21]),t[41]!==void 0&&(ce.advertConsent=t[41]),t[42]!==void 0&&(ce.analyticsConsent=t[42]),t[43]!==void 0&&(ce.analyticsCustomUrl=t[43]),t[44]!==void 0&&(ce.analyticsTag=t[44]),e=new Q_({props:ce}),$.push(()=>he(e,"projectId",He)),$.push(()=>he(e,"contentId",st)),$.push(()=>he(e,"playlistId",_t)),$.push(()=>he(e,"sourceId",kt)),$.push(()=>he(e,"sourceUrl",je)),$.push(()=>he(e,"showUserInterface",Ee)),$.push(()=>he(e,"playerStyle",$e)),$.push(()=>he(e,"playerTitle",Ze)),$.push(()=>he(e,"callToAction",At)),$.push(()=>he(e,"skipButtonStyle",Xe)),$.push(()=>he(e,"playlistStyle",et)),$.push(()=>he(e,"playlistToggle",tt)),$.push(()=>he(e,"mediaSession",Ne)),$.push(()=>he(e,"contentIndex",it)),$.push(()=>he(e,"introsOutrosIndex",Ge)),$.push(()=>he(e,"advertIndex",ht)),$.push(()=>he(e,"persistentAdImage",Fe)),$.push(()=>he(e,"persistentIndex",lt)),$.push(()=>he(e,"duration",ot)),$.push(()=>he(e,"currentTime",Bt)),$.push(()=>he(e,"playbackState",qe)),$.push(()=>he(e,"playbackRate",pt)),$.push(()=>he(e,"widgetStyle",gt)),$.push(()=>he(e,"widgetPosition",x)),$.push(()=>he(e,"widgetWidth",Le)),$.push(()=>he(e,"widgetTarget",De)),$.push(()=>he(e,"textColor",Qe)),$.push(()=>he(e,"backgroundColor",Ke)),$.push(()=>he(e,"iconColor",mt)),$.push(()=>he(e,"highlightColor",at)),$.push(()=>he(e,"videoTextColor",It)),$.push(()=>he(e,"videoIconColor",St)),$.push(()=>he(e,"logoIconEnabled",Ye)),$.push(()=>he(e,"highlightSections",ut)),$.push(()=>he(e,"clickableSections",zt)),$.push(()=>he(e,"segmentWidgetSections",Vt)),$.push(()=>he(e,"segmentWidgetPosition",Lt)),$.push(()=>he(e,"currentSegment",ct)),$.push(()=>he(e,"hoveredSegment",xt)),$.push(()=>he(e,"advertConsent",Qt)),$.push(()=>he(e,"analyticsConsent",R)),$.push(()=>he(e,"analyticsCustomUrl",wt)),$.push(()=>he(e,"analyticsTag",dt)),{c(){ue(e.$$.fragment)},m(S,P){re(e,S,P),Ue=!0},p(S,P){const oe={};P[1]&1048576&&(oe.content=S[51]),P[1]&2097152&&(oe.introsOutros=S[52]),P[1]&4194304&&(oe.adverts=S[53]),!i&&P[0]&1&&(i=!0,oe.projectId=S[0],fe(()=>i=!1)),!n&&P[0]&2&&(n=!0,oe.contentId=S[1],fe(()=>n=!1)),!s&&P[0]&4&&(s=!0,oe.playlistId=S[2],fe(()=>s=!1)),!o&&P[0]&8&&(o=!0,oe.sourceId=S[3],fe(()=>o=!1)),!r&&P[0]&16&&(r=!0,oe.sourceUrl=S[4],fe(()=>r=!1)),!l&&P[0]&32&&(l=!0,oe.showUserInterface=S[5],fe(()=>l=!1)),!a&&P[0]&64&&(a=!0,oe.playerStyle=S[6],fe(()=>a=!1)),!d&&P[0]&16777216&&(d=!0,oe.playerTitle=S[24],fe(()=>d=!1)),!u&&P[0]&33554432&&(u=!0,oe.callToAction=S[25],fe(()=>u=!1)),!g&&P[0]&67108864&&(g=!0,oe.skipButtonStyle=S[26],fe(()=>g=!1)),!m&&P[0]&134217728&&(m=!0,oe.playlistStyle=S[27],fe(()=>m=!1)),!v&&P[0]&268435456&&(v=!0,oe.playlistToggle=S[28],fe(()=>v=!1)),!_&&P[0]&536870912&&(_=!0,oe.mediaSession=S[29],fe(()=>_=!1)),!k&&P[0]&128&&(k=!0,oe.contentIndex=S[7],fe(()=>k=!1)),!b&&P[0]&256&&(b=!0,oe.introsOutrosIndex=S[8],fe(()=>b=!1)),!C&&P[0]&512&&(C=!0,oe.advertIndex=S[9],fe(()=>C=!1)),!V&&P[0]&1073741824&&(V=!0,oe.persistentAdImage=S[30],fe(()=>V=!1)),!Z&&P[0]&1024&&(Z=!0,oe.persistentIndex=S[10],fe(()=>Z=!1)),!O&&P[1]&1&&(O=!0,oe.duration=S[31],fe(()=>O=!1)),!j&&P[0]&2048&&(j=!0,oe.currentTime=S[11],fe(()=>j=!1)),!L&&P[0]&4096&&(L=!0,oe.playbackState=S[12],fe(()=>L=!1)),!N&&P[1]&2&&(N=!0,oe.playbackRate=S[32],fe(()=>N=!1)),!K&&P[0]&8192&&(K=!0,oe.widgetStyle=S[13],fe(()=>K=!1)),!U&&P[1]&4&&(U=!0,oe.widgetPosition=S[33],fe(()=>U=!1)),!X&&P[1]&8&&(X=!0,oe.widgetWidth=S[34],fe(()=>X=!1)),!Te&&P[0]&16384&&(Te=!0,oe.widgetTarget=S[14],fe(()=>Te=!1)),!ve&&P[1]&16&&(ve=!0,oe.textColor=S[35],fe(()=>ve=!1)),!be&&P[1]&32&&(be=!0,oe.backgroundColor=S[36],fe(()=>be=!1)),!ne&&P[1]&64&&(ne=!0,oe.iconColor=S[37],fe(()=>ne=!1)),!ee&&P[0]&32768&&(ee=!0,oe.highlightColor=S[15],fe(()=>ee=!1)),!F&&P[1]&128&&(F=!0,oe.videoTextColor=S[38],fe(()=>F=!1)),!se&&P[1]&256&&(se=!0,oe.videoIconColor=S[39],fe(()=>se=!1)),!ge&&P[1]&512&&(ge=!0,oe.logoIconEnabled=S[40],fe(()=>ge=!1)),!G&&P[0]&65536&&(G=!0,oe.highlightSections=S[16],fe(()=>G=!1)),!ae&&P[0]&131072&&(ae=!0,oe.clickableSections=S[17],fe(()=>ae=!1)),!w&&P[0]&262144&&(w=!0,oe.segmentWidgetSections=S[18],fe(()=>w=!1)),!q&&P[0]&524288&&(q=!0,oe.segmentWidgetPosition=S[19],fe(()=>q=!1)),!we&&P[0]&1048576&&(we=!0,oe.currentSegment=S[20],fe(()=>we=!1)),!Pe&&P[0]&2097152&&(Pe=!0,oe.hoveredSegment=S[21],fe(()=>Pe=!1)),!Ve&&P[1]&1024&&(Ve=!0,oe.advertConsent=S[41],fe(()=>Ve=!1)),!J&&P[1]&2048&&(J=!0,oe.analyticsConsent=S[42],fe(()=>J=!1)),!Ce&&P[1]&4096&&(Ce=!0,oe.analyticsCustomUrl=S[43],fe(()=>Ce=!1)),!Be&&P[1]&8192&&(Be=!0,oe.analyticsTag=S[44],fe(()=>Be=!1)),e.$set(oe)},i(S){Ue||(p(e.$$.fragment,S),Ue=!0)},o(S){I(e.$$.fragment,S),Ue=!1},d(S){le(e,S)}}}function ql(t){let e,i;return e=new cm({props:{onEvent:t[58],content:t[51],contentIndex:t[7],activeAdvert:t[61],persistentAdvert:t[72],duration:t[31],playbackState:t[12],skipButtonStyle:t[26],backgroundColor:t[36],iconColor:t[37]}}),{c(){ue(e.$$.fragment)},m(n,s){re(e,n,s),i=!0},p(n,s){const o={};s[1]&1048576&&(o.content=n[51]),s[0]&128&&(o.contentIndex=n[7]),s[1]&1073741824&&(o.activeAdvert=n[61]),s[2]&1024&&(o.persistentAdvert=n[72]),s[1]&1&&(o.duration=n[31]),s[0]&4096&&(o.playbackState=n[12]),s[0]&67108864&&(o.skipButtonStyle=n[26]),s[1]&32&&(o.backgroundColor=n[36]),s[1]&64&&(o.iconColor=n[37]),e.$set(o)},i(n){i||(p(e.$$.fragment,n),i=!0)},o(n){I(e.$$.fragment,n),i=!1},d(n){le(e,n)}}}function Hl(t){let e,i;return e=new _m({props:{analyticsTag:t[44]}}),{c(){ue(e.$$.fragment)},m(n,s){re(e,n,s),i=!0},p(n,s){const o={};s[1]&8192&&(o.analyticsTag=n[44]),e.$set(o)},i(n){i||(p(e.$$.fragment,n),i=!0)},o(n){I(e.$$.fragment,n),i=!1},d(n){le(e,n)}}}function Dm(t){let e,i,n,s,o=[],r=new Map,l,a,d,u,g,m;e=new Hs({props:{prepend:!0,root:t[68],$$slots:{default:[Mm]},$$scope:{ctx:t}}});let v=t[71]&&Rl(t),_=t[70]&&xl(t),k=Yt(t[49]);const b=O=>O[157];for(let O=0;O<k.length;O+=1){let j=Dl(t,k,O),L=b(j);r.set(L,o[O]=Ul(L,j))}let C=t[22]&&Fl(t),V=t[55]&&ql(t),Z=t[44]&&Hl(t);return g=new mm({}),{c(){ue(e.$$.fragment),i=H(),v&&v.c(),n=H(),_&&_.c(),s=H();for(let O=0;O<o.length;O+=1)o[O].c();l=H(),C&&C.c(),a=H(),V&&V.c(),d=H(),Z&&Z.c(),u=H(),ue(g.$$.fragment)},m(O,j){re(e,O,j),B(O,i,j),v&&v.m(O,j),B(O,n,j),_&&_.m(O,j),B(O,s,j);for(let L=0;L<o.length;L+=1)o[L]&&o[L].m(O,j);B(O,l,j),C&&C.m(O,j),B(O,a,j),V&&V.m(O,j),B(O,d,j),Z&&Z.m(O,j),B(O,u,j),re(g,O,j),m=!0},p(O,j){const L={};j[2]&64&&(L.root=O[68]),j[0]&8411296|j[1]&1611809807|j[2]&134|j[5]&32&&(L.$$scope={dirty:j,ctx:O}),e.$set(L),O[71]?v?(v.p(O,j),j[2]&512&&p(v,1)):(v=Rl(O),v.c(),p(v,1),v.m(n.parentNode,n)):v&&(Re(),I(v,1,1,()=>{v=null}),xe()),O[70]?_?(_.p(O,j),j[2]&256&&p(_,1)):(_=xl(O),_.c(),p(_,1),_.m(s.parentNode,s)):_&&(Re(),I(_,1,1,()=>{_=null}),xe()),j[0]&6272|j[1]&1486094833|j[2]&1041&&(k=Yt(O[49]),Re(),o=Qa(o,j,b,1,O,k,r,l.parentNode,Xa,Ul,l,Dl),xe()),O[22]?C?(C.p(O,j),j[0]&4194304&&p(C,1)):(C=Fl(O),C.c(),p(C,1),C.m(a.parentNode,a)):C&&(Re(),I(C,1,1,()=>{C=null}),xe()),O[55]?V?(V.p(O,j),j[1]&16777216&&p(V,1)):(V=ql(O),V.c(),p(V,1),V.m(d.parentNode,d)):V&&(Re(),I(V,1,1,()=>{V=null}),xe()),O[44]?Z?(Z.p(O,j),j[1]&8192&&p(Z,1)):(Z=Hl(O),Z.c(),p(Z,1),Z.m(u.parentNode,u)):Z&&(Re(),I(Z,1,1,()=>{Z=null}),xe())},i(O){if(!m){p(e.$$.fragment,O),p(v),p(_);for(let j=0;j<k.length;j+=1)p(o[j]);p(C),p(V),p(Z),p(g.$$.fragment,O),m=!0}},o(O){I(e.$$.fragment,O),I(v),I(_);for(let j=0;j<o.length;j+=1)I(o[j]);I(C),I(V),I(Z),I(g.$$.fragment,O),m=!1},d(O){O&&(A(i),A(n),A(s),A(l),A(a),A(d),A(u)),le(e,O),v&&v.d(O),_&&_.d(O);for(let j=0;j<o.length;j+=1)o[j].d(O);C&&C.d(O),V&&V.d(O),Z&&Z.d(O),le(g,O)}}}function Rm(t,e,i){let n,s,o,r,l,a,d,u,g,m,v,_,k,b,C,V,Z,O,j,L,N,K,U,{playerApiUrl:X="https://api.beyondwords.io/v1/projects/{id}/player"}=e,{projectId:Te=void 0}=e,{contentId:ve=void 0}=e,{playlistId:be=void 0}=e,{sourceId:ne=void 0}=e,{sourceUrl:ee=void 0}=e,{playlist:F=[]}=e,{showUserInterface:se=!0}=e,{showBottomWidget:ge=!1}=e,{playerStyle:G="standard"}=e,{playerTitle:ae=void 0}=e,{callToAction:w=void 0}=e,{skipButtonStyle:q="auto"}=e,{playlistStyle:we="auto-5-4"}=e,{playlistToggle:Pe="auto"}=e,{downloadFormats:Ve=[]}=e,{mediaSession:J="auto"}=e,{content:Ce=[]}=e,{contentIndex:Be=0}=e,{introsOutros:Ue=[]}=e,{introsOutrosIndex:He=-1}=e,{adverts:st=[]}=e,{advertIndex:_t=-1}=e,{persistentAdImage:kt=!1}=e,{persistentIndex:je=-1}=e,{duration:Ee=0}=e,{currentTime:$e=0}=e,{playbackState:Ze="stopped"}=e,{playbackRate:At=1}=e,{playbackRates:Xe=[.5,.6,.7,.8,.9,1,1.1,1.2,1.3,1.4,1.5,2,2.5,3]}=e,{widgetStyle:et="standard"}=e,{widgetPosition:tt="auto"}=e,{widgetWidth:Ne="auto"}=e,{widgetTarget:it=void 0}=e,{textColor:Ge="#111"}=e,{backgroundColor:ht="#f5f5f5"}=e,{iconColor:Fe="rgba(0, 0, 0, 0.8)"}=e,{highlightColor:lt="#eee"}=e,{videoTextColor:ot="white"}=e,{videoBackgroundColor:Bt="black"}=e,{videoIconColor:qe="white"}=e,{logoIconEnabled:pt=!0}=e,{highlightSections:gt="all"}=e,{clickableSections:x="all"}=e,{segmentWidgetSections:Le="body"}=e,{segmentWidgetPosition:De="7-oclock"}=e,{currentSegment:Qe=void 0}=e,{hoveredSegment:Ke=void 0}=e,{loadedMedia:mt=void 0}=e,{advertConsent:at="personalized"}=e,{analyticsConsent:It="allowed"}=e,{analyticsCustomUrl:St=void 0}=e,{analyticsTag:Ye=void 0}=e,{writeToken:ut=void 0}=e,{captureErrors:zt=!0}=e,{onError:Vt=()=>{}}=e,{transitions:Lt=[]}=e,{controlPanel:ct=void 0}=e;const xt=(...h)=>jt.addEventListener(...h),Qt=(...h)=>jt.removeEventListener(...h);let{initialProps:R={}}=e,{showMediaSession:wt=!1}=e,{isLoaded:dt=!1}=e,{isFullScreen:ce=!1}=e,{mediaElement:S=void 0}=e,{userInterface:P=void 0}=e,{widgetInterface:oe=void 0}=e,{controller:jt=void 0}=e,{logoImagePosition:ai=void 0}=e,{analyticsUrl:Ai=void 0}=e,{analyticsId:Nt=void 0}=e,{listenSessionId:nn=void 0}=e,{sessionCreatedAt:ui=void 0}=e,{isNewListen:fn=!1}=e,{prevPercentage:ft=0}=e,{segmentWidgets:pi=[]}=e,{segmentContainers:ni=new Zo(h=>i(49,pi=h))}=e,{segmentClickables:Si=new Yo}=e,{segmentHighlights:Wt=new Ho}=e;const Ut=h=>jt.processEvent(oi({emittedFrom:k},h)),ji=()=>i(95,O=Ke);function Ft(h){$[h?"unshift":"push"](()=>{S=h,i(45,S)})}function Bi(h){Ze=h,i(12,Ze)}function ci(h){Ee=h,i(31,Ee)}function An(h){$e=h,i(11,$e)}function $t(h){At=h,i(32,At)}function hn(h){ft=h,i(48,ft)}function qt(h){dt=h,i(23,dt)}function di(h){$[h?"unshift":"push"](()=>{P=h,i(46,P)})}function vt(h){$[h?"unshift":"push"](()=>{oe=h,i(47,oe)})}const gi=h=>Ut(sn(oi({},h),{emittedFrom:"segment-widget",widgetSegment:N,widgetIsCurrent:K}));function yt(h){Te=h,i(0,Te)}function fi(h){ve=h,i(1,ve)}function Mt(h){be=h,i(2,be)}function W(h){ne=h,i(3,ne)}function Y(h){ee=h,i(4,ee)}function te(h){se=h,i(5,se)}function ei(h){G=h,i(6,G)}function _n(h){ae=h,i(24,ae)}function mn(h){w=h,i(25,w)}function vn(h){q=h,i(26,q)}function yn(h){we=h,i(27,we)}function vo(h){Pe=h,i(28,Pe)}function Bn(h){J=h,i(29,J)}function yo(h){Be=h,i(7,Be)}function Ei(h){He=h,i(8,He)}function bo(h){_t=h,i(9,_t)}function vs(h){kt=h,i(30,kt)}function ko(h){je=h,i(10,je)}function po(h){Ee=h,i(31,Ee)}function ys(h){$e=h,i(11,$e)}function So(h){Ze=h,i(12,Ze)}function bn(h){At=h,i(32,At)}function ti(h){et=h,i(13,et)}function er(h){tt=h,i(33,tt)}function In(h){Ne=h,i(34,Ne)}function si(h){it=h,i(14,it)}function wo(h){Ge=h,i(35,Ge)}function Gn(h){ht=h,i(36,ht)}function Ii(h){Fe=h,i(37,Fe)}function de(h){lt=h,i(15,lt)}function rt(h){ot=h,i(38,ot)}function bt(h){qe=h,i(39,qe)}function Po(h){pt=h,i(40,pt)}function X0(h){gt=h,i(16,gt)}function Q0(h){x=h,i(17,x)}function $0(h){Le=h,i(18,Le)}function e2(h){De=h,i(19,De)}function t2(h){Qe=h,i(20,Qe)}function i2(h){Ke=h,i(21,Ke)}function n2(h){at=h,i(41,at)}function s2(h){It=h,i(42,It)}function o2(h){St=h,i(43,St)}function r2(h){Ye=h,i(44,Ye)}return t.$$set=h=>{"playerApiUrl"in h&&i(73,X=h.playerApiUrl),"projectId"in h&&i(0,Te=h.projectId),"contentId"in h&&i(1,ve=h.contentId),"playlistId"in h&&i(2,be=h.playlistId),"sourceId"in h&&i(3,ne=h.sourceId),"sourceUrl"in h&&i(4,ee=h.sourceUrl),"playlist"in h&&i(74,F=h.playlist),"showUserInterface"in h&&i(5,se=h.showUserInterface),"showBottomWidget"in h&&i(75,ge=h.showBottomWidget),"playerStyle"in h&&i(6,G=h.playerStyle),"playerTitle"in h&&i(24,ae=h.playerTitle),"callToAction"in h&&i(25,w=h.callToAction),"skipButtonStyle"in h&&i(26,q=h.skipButtonStyle),"playlistStyle"in h&&i(27,we=h.playlistStyle),"playlistToggle"in h&&i(28,Pe=h.playlistToggle),"downloadFormats"in h&&i(50,Ve=h.downloadFormats),"mediaSession"in h&&i(29,J=h.mediaSession),"content"in h&&i(51,Ce=h.content),"contentIndex"in h&&i(7,Be=h.contentIndex),"introsOutros"in h&&i(52,Ue=h.introsOutros),"introsOutrosIndex"in h&&i(8,He=h.introsOutrosIndex),"adverts"in h&&i(53,st=h.adverts),"advertIndex"in h&&i(9,_t=h.advertIndex),"persistentAdImage"in h&&i(30,kt=h.persistentAdImage),"persistentIndex"in h&&i(10,je=h.persistentIndex),"duration"in h&&i(31,Ee=h.duration),"currentTime"in h&&i(11,$e=h.currentTime),"playbackState"in h&&i(12,Ze=h.playbackState),"playbackRate"in h&&i(32,At=h.playbackRate),"playbackRates"in h&&i(76,Xe=h.playbackRates),"widgetStyle"in h&&i(13,et=h.widgetStyle),"widgetPosition"in h&&i(33,tt=h.widgetPosition),"widgetWidth"in h&&i(34,Ne=h.widgetWidth),"widgetTarget"in h&&i(14,it=h.widgetTarget),"textColor"in h&&i(35,Ge=h.textColor),"backgroundColor"in h&&i(36,ht=h.backgroundColor),"iconColor"in h&&i(37,Fe=h.iconColor),"highlightColor"in h&&i(15,lt=h.highlightColor),"videoTextColor"in h&&i(38,ot=h.videoTextColor),"videoBackgroundColor"in h&&i(54,Bt=h.videoBackgroundColor),"videoIconColor"in h&&i(39,qe=h.videoIconColor),"logoIconEnabled"in h&&i(40,pt=h.logoIconEnabled),"highlightSections"in h&&i(16,gt=h.highlightSections),"clickableSections"in h&&i(17,x=h.clickableSections),"segmentWidgetSections"in h&&i(18,Le=h.segmentWidgetSections),"segmentWidgetPosition"in h&&i(19,De=h.segmentWidgetPosition),"currentSegment"in h&&i(20,Qe=h.currentSegment),"hoveredSegment"in h&&i(21,Ke=h.hoveredSegment),"loadedMedia"in h&&i(77,mt=h.loadedMedia),"advertConsent"in h&&i(41,at=h.advertConsent),"analyticsConsent"in h&&i(42,It=h.analyticsConsent),"analyticsCustomUrl"in h&&i(43,St=h.analyticsCustomUrl),"analyticsTag"in h&&i(44,Ye=h.analyticsTag),"writeToken"in h&&i(78,ut=h.writeToken),"captureErrors"in h&&i(79,zt=h.captureErrors),"onError"in h&&i(80,Vt=h.onError),"transitions"in h&&i(81,Lt=h.transitions),"controlPanel"in h&&i(22,ct=h.controlPanel),"initialProps"in h&&i(84,R=h.initialProps),"showMediaSession"in h&&i(55,wt=h.showMediaSession),"isLoaded"in h&&i(23,dt=h.isLoaded),"isFullScreen"in h&&i(56,ce=h.isFullScreen),"mediaElement"in h&&i(45,S=h.mediaElement),"userInterface"in h&&i(46,P=h.userInterface),"widgetInterface"in h&&i(47,oe=h.widgetInterface),"controller"in h&&i(85,jt=h.controller),"logoImagePosition"in h&&i(57,ai=h.logoImagePosition),"analyticsUrl"in h&&i(86,Ai=h.analyticsUrl),"analyticsId"in h&&i(87,Nt=h.analyticsId),"listenSessionId"in h&&i(88,nn=h.listenSessionId),"sessionCreatedAt"in h&&i(89,ui=h.sessionCreatedAt),"isNewListen"in h&&i(90,fn=h.isNewListen),"prevPercentage"in h&&i(48,ft=h.prevPercentage),"segmentWidgets"in h&&i(49,pi=h.segmentWidgets),"segmentContainers"in h&&i(91,ni=h.segmentContainers),"segmentClickables"in h&&i(92,Si=h.segmentClickables),"segmentHighlights"in h&&i(93,Wt=h.segmentHighlights)},t.$$.update=()=>{t.$$.dirty[0]&128|t.$$.dirty[1]&1048576&&i(97,n=Ce[Be]),t.$$.dirty[0]&256|t.$$.dirty[1]&2097152&&i(60,s=Ue[He]),t.$$.dirty[0]&512|t.$$.dirty[1]&4194304&&i(61,o=st[_t]),t.$$.dirty[0]&1024|t.$$.dirty[1]&4194304&&i(72,r=st[je]),t.$$.dirty[0]&4096|t.$$.dirty[1]&1073741824&&i(98,l=o&&Ze!=="stopped"),t.$$.dirty[2]&32768&&i(100,a=(mt==null?void 0:mt.format)==="audio"),t.$$.dirty[0]&64|t.$$.dirty[1]&33554432&&i(65,d=ce?"video":G),t.$$.dirty[0]&16384&&i(14,it=Go(it,"widget")),t.$$.dirty[0]&16384|t.$$.dirty[2]&8192&&i(101,u=ge||it),t.$$.dirty[0]&32|t.$$.dirty[1]&1048576|t.$$.dirty[2]&8&&i(71,g=se&&Ko(d)&&Ce.length>0),t.$$.dirty[0]&8224|t.$$.dirty[1]&1048576|t.$$.dirty[3]&256&&i(70,m=se&&u&&Ko(et)&&Ce.length>0),t.$$.dirty[0]&4194304&&i(22,ct=Go(ct,"control panel")),t.$$.dirty[0]&8192|t.$$.dirty[1]&33554432|t.$$.dirty[3]&256&&i(64,v=u&&et==="video"&&!ce),t.$$.dirty[2]&12&&i(69,_=d==="video"&&!v),t.$$.dirty[2]&4&&(k=v?"bottom-widget":"inline-player"),t.$$.dirty[0]&8256&&i(63,b=G==="video"||et==="video"),t.$$.dirty[0]&16384|t.$$.dirty[2]&4&&i(68,C=v?it:null),t.$$.dirty[0]&8388608|t.$$.dirty[2]&2|t.$$.dirty[3]&128&&i(99,V=a&&b&&dt),t.$$.dirty[1]&1073741824|t.$$.dirty[3]&112&&i(67,Z=V?l&&(o==null?void 0:o.imageUrl)||(n==null?void 0:n.imageUrl):""),t.$$.dirty[0]&31|t.$$.dirty[2]&4096&&Ut(vm()),t.$$.dirty[0]&1|t.$$.dirty[2]&67584&&km(X,Te,ut,h=>Ut(h)),t.$$.dirty[0]&2097152|t.$$.dirty[3]&4&&i(95,O=Ke||O),t.$$.dirty[0]&1310720&&i(94,j=rs("current",Qe,Le)),t.$$.dirty[0]&1048576|t.$$.dirty[3]&2&&j&&ji(),t.$$.dirty[0]&262144|t.$$.dirty[3]&4&&i(96,L=rs("hovered",O,Le)),t.$$.dirty[0]&1048576|t.$$.dirty[3]&14&&i(59,N=L&&O||j&&Qe),t.$$.dirty[0]&1048576|t.$$.dirty[1]&268435456&&i(62,K=(N==null?void 0:N.marker)===(Qe==null?void 0:Qe.marker)),t.$$.dirty[1]&1610612736|t.$$.dirty[2]&1&&i(66,U=K||o||s),t.$$.dirty[0]&786496|t.$$.dirty[1]&268435456|t.$$.dirty[2]&536870912&&ni.update(N,Le,De,G),t.$$.dirty[0]&2228224|t.$$.dirty[2]&1073741824&&Si.update(Ke,x),t.$$.dirty[0]&1146880|t.$$.dirty[3]&1&&Wt.update("current",Qe,gt,lt),t.$$.dirty[0]&2195456|t.$$.dirty[3]&1&&Wt.update("hovered",Ke,gt,lt),t.$$.dirty[0]&2048|t.$$.dirty[2]&8912896&&Cm(Lt,jt,$e)},[Te,ve,be,ne,ee,se,G,Be,He,_t,je,$e,Ze,et,it,lt,gt,x,Le,De,Qe,Ke,ct,dt,ae,w,q,we,Pe,J,kt,Ee,At,tt,Ne,Ge,ht,Fe,ot,qe,pt,at,It,St,Ye,S,P,oe,ft,pi,Ve,Ce,Ue,st,Bt,wt,ce,ai,Ut,N,s,o,K,b,v,d,U,Z,C,_,m,g,r,X,F,ge,Xe,mt,ut,zt,Vt,Lt,xt,Qt,R,jt,Ai,Nt,nn,ui,fn,ni,Si,Wt,j,O,L,n,l,V,a,u,Ft,Bi,ci,An,$t,hn,qt,di,vt,gi,yt,fi,Mt,W,Y,te,ei,_n,mn,vn,yn,vo,Bn,yo,Ei,bo,vs,ko,po,ys,So,bn,ti,er,In,si,wo,Gn,Ii,de,rt,bt,Po,X0,Q0,$0,e2,t2,i2,n2,s2,o2,r2]}let xm=class extends pe{constructor(e){super(),ke(this,e,Rm,Dm,_e,{playerApiUrl:73,projectId:0,contentId:1,playlistId:2,sourceId:3,sourceUrl:4,playlist:74,showUserInterface:5,showBottomWidget:75,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,persistentAdImage:30,persistentIndex:10,duration:31,currentTime:11,playbackState:12,playbackRate:32,playbackRates:76,widgetStyle:13,widgetPosition:33,widgetWidth:34,widgetTarget:14,textColor:35,backgroundColor:36,iconColor:37,highlightColor:15,videoTextColor:38,videoBackgroundColor:54,videoIconColor:39,logoIconEnabled:40,highlightSections:16,clickableSections:17,segmentWidgetSections:18,segmentWidgetPosition:19,currentSegment:20,hoveredSegment:21,loadedMedia:77,advertConsent:41,analyticsConsent:42,analyticsCustomUrl:43,analyticsTag:44,writeToken:78,captureErrors:79,onError:80,transitions:81,controlPanel:22,addEventListener:82,removeEventListener:83,initialProps:84,showMediaSession:55,isLoaded:23,isFullScreen:56,mediaElement:45,userInterface:46,widgetInterface:47,controller:85,logoImagePosition:57,analyticsUrl:86,analyticsId:87,listenSessionId:88,sessionCreatedAt:89,isNewListen:90,prevPercentage:48,segmentWidgets:49,segmentContainers:91,segmentClickables:92,segmentHighlights:93,onEvent:58},null,[-1,-1,-1,-1,-1,-1])}get playerApiUrl(){return this.$$.ctx[73]}set playerApiUrl(e){this.$$set({playerApiUrl:e}),c()}get projectId(){return this.$$.ctx[0]}set projectId(e){this.$$set({projectId:e}),c()}get contentId(){return this.$$.ctx[1]}set contentId(e){this.$$set({contentId:e}),c()}get playlistId(){return this.$$.ctx[2]}set playlistId(e){this.$$set({playlistId:e}),c()}get sourceId(){return this.$$.ctx[3]}set sourceId(e){this.$$set({sourceId:e}),c()}get sourceUrl(){return this.$$.ctx[4]}set sourceUrl(e){this.$$set({sourceUrl:e}),c()}get playlist(){return this.$$.ctx[74]}set playlist(e){this.$$set({playlist:e}),c()}get showUserInterface(){return this.$$.ctx[5]}set showUserInterface(e){this.$$set({showUserInterface:e}),c()}get showBottomWidget(){return this.$$.ctx[75]}set showBottomWidget(e){this.$$set({showBottomWidget:e}),c()}get playerStyle(){return this.$$.ctx[6]}set playerStyle(e){this.$$set({playerStyle:e}),c()}get playerTitle(){return this.$$.ctx[24]}set playerTitle(e){this.$$set({playerTitle:e}),c()}get callToAction(){return this.$$.ctx[25]}set callToAction(e){this.$$set({callToAction:e}),c()}get skipButtonStyle(){return this.$$.ctx[26]}set skipButtonStyle(e){this.$$set({skipButtonStyle:e}),c()}get playlistStyle(){return this.$$.ctx[27]}set playlistStyle(e){this.$$set({playlistStyle:e}),c()}get playlistToggle(){return this.$$.ctx[28]}set playlistToggle(e){this.$$set({playlistToggle:e}),c()}get downloadFormats(){return this.$$.ctx[50]}set downloadFormats(e){this.$$set({downloadFormats:e}),c()}get mediaSession(){return this.$$.ctx[29]}set mediaSession(e){this.$$set({mediaSession:e}),c()}get content(){return this.$$.ctx[51]}set content(e){this.$$set({content:e}),c()}get contentIndex(){return this.$$.ctx[7]}set contentIndex(e){this.$$set({contentIndex:e}),c()}get introsOutros(){return this.$$.ctx[52]}set introsOutros(e){this.$$set({introsOutros:e}),c()}get introsOutrosIndex(){return this.$$.ctx[8]}set introsOutrosIndex(e){this.$$set({introsOutrosIndex:e}),c()}get adverts(){return this.$$.ctx[53]}set adverts(e){this.$$set({adverts:e}),c()}get advertIndex(){return this.$$.ctx[9]}set advertIndex(e){this.$$set({advertIndex:e}),c()}get persistentAdImage(){return this.$$.ctx[30]}set persistentAdImage(e){this.$$set({persistentAdImage:e}),c()}get persistentIndex(){return this.$$.ctx[10]}set persistentIndex(e){this.$$set({persistentIndex:e}),c()}get duration(){return this.$$.ctx[31]}set duration(e){this.$$set({duration:e}),c()}get currentTime(){return this.$$.ctx[11]}set currentTime(e){this.$$set({currentTime:e}),c()}get playbackState(){return this.$$.ctx[12]}set playbackState(e){this.$$set({playbackState:e}),c()}get playbackRate(){return this.$$.ctx[32]}set playbackRate(e){this.$$set({playbackRate:e}),c()}get playbackRates(){return this.$$.ctx[76]}set playbackRates(e){this.$$set({playbackRates:e}),c()}get widgetStyle(){return this.$$.ctx[13]}set widgetStyle(e){this.$$set({widgetStyle:e}),c()}get widgetPosition(){return this.$$.ctx[33]}set widgetPosition(e){this.$$set({widgetPosition:e}),c()}get widgetWidth(){return this.$$.ctx[34]}set widgetWidth(e){this.$$set({widgetWidth:e}),c()}get widgetTarget(){return this.$$.ctx[14]}set widgetTarget(e){this.$$set({widgetTarget:e}),c()}get textColor(){return this.$$.ctx[35]}set textColor(e){this.$$set({textColor:e}),c()}get backgroundColor(){return this.$$.ctx[36]}set backgroundColor(e){this.$$set({backgroundColor:e}),c()}get iconColor(){return this.$$.ctx[37]}set iconColor(e){this.$$set({iconColor:e}),c()}get highlightColor(){return this.$$.ctx[15]}set highlightColor(e){this.$$set({highlightColor:e}),c()}get videoTextColor(){return this.$$.ctx[38]}set videoTextColor(e){this.$$set({videoTextColor:e}),c()}get videoBackgroundColor(){return this.$$.ctx[54]}set videoBackgroundColor(e){this.$$set({videoBackgroundColor:e}),c()}get videoIconColor(){return this.$$.ctx[39]}set videoIconColor(e){this.$$set({videoIconColor:e}),c()}get logoIconEnabled(){return this.$$.ctx[40]}set logoIconEnabled(e){this.$$set({logoIconEnabled:e}),c()}get highlightSections(){return this.$$.ctx[16]}set highlightSections(e){this.$$set({highlightSections:e}),c()}get clickableSections(){return this.$$.ctx[17]}set clickableSections(e){this.$$set({clickableSections:e}),c()}get segmentWidgetSections(){return this.$$.ctx[18]}set segmentWidgetSections(e){this.$$set({segmentWidgetSections:e}),c()}get segmentWidgetPosition(){return this.$$.ctx[19]}set segmentWidgetPosition(e){this.$$set({segmentWidgetPosition:e}),c()}get currentSegment(){return this.$$.ctx[20]}set currentSegment(e){this.$$set({currentSegment:e}),c()}get hoveredSegment(){return this.$$.ctx[21]}set hoveredSegment(e){this.$$set({hoveredSegment:e}),c()}get loadedMedia(){return this.$$.ctx[77]}set loadedMedia(e){this.$$set({loadedMedia:e}),c()}get advertConsent(){return this.$$.ctx[41]}set advertConsent(e){this.$$set({advertConsent:e}),c()}get analyticsConsent(){return this.$$.ctx[42]}set analyticsConsent(e){this.$$set({analyticsConsent:e}),c()}get analyticsCustomUrl(){return this.$$.ctx[43]}set analyticsCustomUrl(e){this.$$set({analyticsCustomUrl:e}),c()}get analyticsTag(){return this.$$.ctx[44]}set analyticsTag(e){this.$$set({analyticsTag:e}),c()}get writeToken(){return this.$$.ctx[78]}set writeToken(e){this.$$set({writeToken:e}),c()}get captureErrors(){return this.$$.ctx[79]}set captureErrors(e){this.$$set({captureErrors:e}),c()}get onError(){return this.$$.ctx[80]}set onError(e){this.$$set({onError:e}),c()}get transitions(){return this.$$.ctx[81]}set transitions(e){this.$$set({transitions:e}),c()}get controlPanel(){return this.$$.ctx[22]}set controlPanel(e){this.$$set({controlPanel:e}),c()}get addEventListener(){return this.$$.ctx[82]}get removeEventListener(){return this.$$.ctx[83]}get initialProps(){return this.$$.ctx[84]}set initialProps(e){this.$$set({initialProps:e}),c()}get showMediaSession(){return this.$$.ctx[55]}set showMediaSession(e){this.$$set({showMediaSession:e}),c()}get isLoaded(){return this.$$.ctx[23]}set isLoaded(e){this.$$set({isLoaded:e}),c()}get isFullScreen(){return this.$$.ctx[56]}set isFullScreen(e){this.$$set({isFullScreen:e}),c()}get mediaElement(){return this.$$.ctx[45]}set mediaElement(e){this.$$set({mediaElement:e}),c()}get userInterface(){return this.$$.ctx[46]}set userInterface(e){this.$$set({userInterface:e}),c()}get widgetInterface(){return this.$$.ctx[47]}set widgetInterface(e){this.$$set({widgetInterface:e}),c()}get controller(){return this.$$.ctx[85]}set controller(e){this.$$set({controller:e}),c()}get logoImagePosition(){return this.$$.ctx[57]}set logoImagePosition(e){this.$$set({logoImagePosition:e}),c()}get analyticsUrl(){return this.$$.ctx[86]}set analyticsUrl(e){this.$$set({analyticsUrl:e}),c()}get analyticsId(){return this.$$.ctx[87]}set analyticsId(e){this.$$set({analyticsId:e}),c()}get listenSessionId(){return this.$$.ctx[88]}set listenSessionId(e){this.$$set({listenSessionId:e}),c()}get sessionCreatedAt(){return this.$$.ctx[89]}set sessionCreatedAt(e){this.$$set({sessionCreatedAt:e}),c()}get isNewListen(){return this.$$.ctx[90]}set isNewListen(e){this.$$set({isNewListen:e}),c()}get prevPercentage(){return this.$$.ctx[48]}set prevPercentage(e){this.$$set({prevPercentage:e}),c()}get segmentWidgets(){return this.$$.ctx[49]}set segmentWidgets(e){this.$$set({segmentWidgets:e}),c()}get segmentContainers(){return this.$$.ctx[91]}set segmentContainers(e){this.$$set({segmentContainers:e}),c()}get segmentClickables(){return this.$$.ctx[92]}set segmentClickables(e){this.$$set({segmentClickables:e}),c()}get segmentHighlights(){return this.$$.ctx[93]}set segmentHighlights(e){this.$$set({segmentHighlights:e}),c()}get onEvent(){return this.$$.ctx[58]}};class Um{constructor(e,i){this.baseUrl=e==null?void 0:e.replace("{id}",i)}byContentId(e){return wn(`${this.baseUrl}/by_content_id/${e}`)}byPlaylistId(e){return wn(`${this.baseUrl}/by_playlist_id/${e}`)}bySourceId(e){return wn(`${this.baseUrl}/by_source_id/${e}`)}bySourceUrl(e){return wn(`${this.baseUrl}/by_source_url/${e}`)}byIdentifiers(e){return wn(`${this.baseUrl}/by_identifiers/${encodeURIComponent(JSON.stringify(e))}`)}}const Jo=t=>typeof t!="object"||t===null?t:Array.isArray(t)?t.map(Jo):Object.fromEntries(Object.entries(t).map(([e,i])=>[e.replace(/([A-Z])/g,n=>`_${n.toLowerCase()}`),Jo(i)])),Yl=t=>t==="dark"||t==="auto"&&Fm()?"dark":"light",Fm=()=>window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches,Zl=t=>wi(this,null,function*(){const e=new Um(t.playerApiUrl,t.projectId);if(!t.playerApiUrl||!t.projectId)return;const i=qm(t);if(i.length===0)return;const n=yield Hm(e,i).catch(()=>{});if(!(n!=null&&n.content)){Ym(t);return}Zm(t,n)}),qm=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(...Jo(t.playlist)),[...new Set(e.map(JSON.stringify))].map(JSON.parse)},Hm=(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)},Ym=t=>{Gl(t),Kl(t),Jl(t),t.onEvent(me({type:"NoContentAvailable",description:"No published and processed content is available for the identifiers.",initiatedBy:"browser"}))},Zm=(t,e)=>{var o;const i=Yl(e.settings.theme),n=e.settings[`${i}_theme`],s=e.settings.video_theme;Gl(t),Kl(t,e),Jl(t,e),ze(t,"playerStyle",e.settings.player_style),ze(t,"playerTitle",((o=e.playlist)==null?void 0:o.title)||e.settings.player_title),ze(t,"callToAction",e.settings.call_to_action==="Listen to this article"?null:e.settings.call_to_action),ze(t,"skipButtonStyle",e.settings.skip_button_style),ze(t,"downloadFormats",e.settings.download_button_enabled?["mp3"]:[]),ze(t,"introsOutros",Gm(e.settings)),ze(t,"persistentAdImage",e.settings.persistent_ad_image),ze(t,"widgetStyle",e.settings.widget_style),ze(t,"widgetPosition",e.settings.widget_position),ze(t,"textColor",n.text_color),ze(t,"backgroundColor",n.background_color),ze(t,"iconColor",n.icon_color),ze(t,"highlightColor",n.highlight_color),ze(t,"videoTextColor",s.text_color),ze(t,"videoBackgroundColor",s.background_color),ze(t,"videoIconColor",s.icon_color),ze(t,"logoIconEnabled",e.settings.logo_icon_enabled),ze(t,"logoImagePosition",e.video_settings.logo_image_position),ze(t,"highlightSections",e.settings.segment_playback_enabled?"all":"none"),ze(t,"clickableSections",e.settings.segment_playback_enabled?"all":"none"),ze(t,"segmentWidgetSections",(e.settings.segment_playback_enabled,"none")),ze(t,"analyticsConsent",Km(e.settings)),ze(t,"analyticsCustomUrl",e.settings.analytics_custom_url),ze(t,"analyticsTag",e.settings.analytics_tag),ze(t,"analyticsUrl",e.settings.analytics_url),ze(t,"analyticsId",e.settings.analytics_id)},Gl=t=>{ze(t,"contentIndex",0),ze(t,"introsOutrosIndex",-1),ze(t,"advertIndex",-1),ze(t,"persistentIndex",-1),ze(t,"duration",0),ze(t,"currentTime",0),ze(t,"playbackState","stopped"),ze(t,"currentSegment",void 0),ze(t,"hoveredSegment",void 0)},Kl=(t,e)=>{var s;const i=(s=e==null?void 0:e.settings)==null?void 0:s.image_enabled,n=(e==null?void 0:e.content)||[];ze(t,"content",n.map(o=>{var r;return{id:o.id,title:o.title,imageUrl:i?((r=e.playlist)==null?void 0:r.image_url)||e.settings.image_url||o.image_url:null,sourceId:o.source_id,sourceUrl:o.source_url,adsEnabled:o.ads_enabled,duration:o.audio[0]?o.audio[0].duration/1e3:0,audio:o.audio.map(l=>({id:l.id,url:l.url,contentType:l.content_type,duration:l.duration?l.duration/1e3:0})),video:o.video.map(l=>({id:l.id,url:l.url,contentType:l.content_type,duration:l.duration?l.duration/1e3:0})),segments:o.segments.map(l=>({marker:l.marker,section:l.section,startTime:l.start_time?l.start_time/1e3:0,duration:l.duration?l.duration/1e3:0}))}}))},Jl=(t,e)=>{var s;const i=(s=e==null?void 0:e.settings)==null?void 0:s.image_enabled,n=(e==null?void 0:e.ads)||[];ze(t,"adverts",n.map(o=>{const r=o.type==="vast",l=Yl(o.theme),a=o[`${l}_theme`],d=o.video_theme;return{id:o.id,type:o.type,placement:o.placement,vastUrl:r?o.vast_url:null,clickThroughUrl:r?null:o.click_through_url,imageUrl:i?o.image_url:null,textColor:a==null?void 0:a.text_color,backgroundColor:a==null?void 0:a.background_color,iconColor:a==null?void 0:a.icon_color,videoTextColor:d==null?void 0:d.text_color,videoBackgroundColor:d==null?void 0:d.background_color,videoIconColor:d==null?void 0:d.icon_color,audio:r?[]:(o.audio||o.media).map(u=>({id:u.id,url:u.url,contentType:u.content_type,duration:u.duration?u.duration/1e3:0})),video:r?[]:(o.video||[]).map(u=>({id:u.id,url:u.url,contentType:u.content_type,duration:u.duration?u.duration/1e3:0}))}}))},ze=(t,e,i)=>{var s;typeof((s=t.initialProps)==null?void 0:s[e])!="undefined"||(t[e]=i)},Gm=({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},Km=({analytics_enabled:t,analytics_uuid_enabled:e})=>t?e?"allowed":"without-local-storage":"none",Jm=(t,e)=>wi(this,null,function*(){const n=yield(yield fetch(t)).blob(),s=URL.createObjectURL(n),o=document.createElement("a");document.body.append(o),o.href=s,o.setAttribute("download",e),o.setAttribute("target","_blank"),o.click(),o.remove()}),Zs={vastUrls:new Set,mediaSources:new Set},Xm=t=>{t.vastUrl&&Zs.vastUrls.add(t.vastUrl);for(const e of[...t.audio||[],...t.video||[]])Zs.mediaSources.add(e.url)},Xl=t=>{if(t.vastUrl&&Zs.vastUrls.has(t.vastUrl))return!0;for(const e of[...t.audio||[],...t.video||[]])if(Zs.mediaSources.has(e.url))return!0;return!1},Ql=new Set,Qm=t=>{[...t.audio||[],...t.video||[]].forEach(i=>Ql.add(i.url))},$m=t=>[...t.audio||[],...t.video||[]].some(i=>Ql.has(i.url)),e0=({introsOutrosIndex:t,adverts:e,advertIndex:i,content:n=[],contentIndex:s,currentTime:o,atTheStart:r,atTheEnd:l,errored:a}={})=>{var _;const d=e&&e[i];e:if(d){if(a){Xm(d);break e}if(l)return Qm(d),-1;if(!l)return i}if(!((_=n[s])!=null&&_.adsEnabled)||t!==-1)return-1;const u=i0({content:n,contentIndex:s,currentTime:o,atTheStart:r,atTheEnd:l});let g=-1,m=-1/0,v=-1/0;for(const[k,b]of e.entries()){if($m(b)||Xl(b)||!u.has(b.placement))continue;const C=t0[b.type]||0;if(C<m)continue;const V=Math.random();C===m&&V<v||(g=k,m=C,v=V)}return g},t0={vast:1,custom:0},i0=({content:t,contentIndex:e,currentTime:i,atTheStart:n,atTheEnd:s})=>{const o=e===0,r=e===t.length-1,l=t.length>1,a=l&&n&&!o,d=t[e].segments,u=d[d.length-1],g=l?null:r0(d),m=d[g],v=m&&i>m.startTime,_=u?u.startTime+u.duration:0,k=i>_-s0,b=new Set;return n&&b.add("pre-roll"),v&&!k&&b.add("mid-roll"),a&&b.add("mid-roll"),s&&r&&b.add("post-roll"),a&&b.add("post-roll"),b},n0=2*60,s0=10,o0=.5,r0=t=>{const e=t[t.length-1];if(!e)return;const i=e.startTime+e.duration;if(i<n0)return;const n=i/2,s=Mo(t,i/2),l=t[s].startTime>=n-o0?s:s+1;if(l!==t.length)return l},l0=(t,e,i,n)=>{let s=-1,o=-1/0,r=-1/0;for(const[l,a]of(n||[]).entries()){if(!t||Xl(a)||a.type==="vast")continue;const d=u0(l,e,i);if(d<o)continue;const u=a0[a.placement]||0;d===o&&u<r||(s=l,o=d,r=u)}return s},a0={"pre-roll":2,"mid-roll":1},u0=(t,e,i)=>t===i?2:t===e?1:0,$l={mediaSources:new Set},c0=t=>{for(const e of[...t.audio||[],t.video||[]])$l.mediaSources.add(e.url)},d0=t=>{for(const e of[...t.audio||[],t.video||[]])if($l.mediaSources.has(e.url))return!0;return!1},ea=new Set,g0=t=>{[...t.audio||[],...t.video||[]].forEach(i=>ea.add(i.url))},f0=t=>[...t.audio||[],...t.video||[]].some(i=>ea.has(i.url)),h0=({introsOutros:t=[],introsOutrosIndex:e,advertIndex:i,content:n,contentIndex:s,currentTime:o,atTheStart:r,atTheEnd:l,errored:a})=>{const d=t[e];e:if(d){if(a){c0(d);break e}if(l)return g0(d),-1;if(!l)return e}if(i!==-1)return-1;const u=_0({content:n,contentIndex:s,currentTime:o,atTheStart:r,atTheEnd:l});let g=-1,m=-1/0,v=-1/0;for(const[_,k]of t.entries()){if(d0(k)||!u.has(k.placement))continue;const b=f0(k)?1:0;if(b<m)continue;const C=Math.random();b===m&&C<v||(g=_,m=b,v=C)}return g},_0=({content:t,contentIndex:e,currentTime:i,atTheStart:n,atTheEnd:s})=>{const o=new Set,r=n&&e===0&&i===0,l=s&&e===t.length-1;return r&&o.add("pre-roll"),l&&o.add("post-roll"),o},m0=t=>{if(!navigator.mediaSession)return;const e=t.instances().some(o=>o.mediaSession==="override");if(b0()&&!e)return;let i,n=-1/0,s=-1/0;for(const o of t.instances()){if(o.mediaSession==="none")continue;const r=v0[o.playbackState]||0;if(r<n)continue;const l=y0[o.showMediaSession]||0;r===n&&l<s||(i=o,n=r,s=l)}for(const o of t.instances())o.showMediaSession=o===i;return i},v0={playing:1,paused:0,stopped:0},y0={true:1,false:0},b0=()=>{const t=navigator.mediaSession.metadata;if(!t||navigator.mediaSession.setByPlayer)return!1;const{title:e,artist:i,album:n,artwork:s}=t;return e||i||n||(s==null?void 0:s.length)},k0=t=>{let e=!1,i,n=-1/0,s=-1/0;for(const o of t.instances()){if(!o.userInterface||!Ko(o.widgetStyle))continue;if(o.userInterface.isVisible){e=!0;continue}if(!(o.userInterface.relativeY<0))continue;const d=p0[o.playbackState]||0;if(d<n)continue;const u=o.userInterface.absoluteY;d===n&&u<s||(i=o,n=d,s=u)}e&&n===0&&(i=null);for(const o of t.instances())o.showBottomWidget=o===i},p0={playing:2,paused:1,stopped:0};class S0{constructor(e,i){We(this,so);We(this,oo);We(this,fs);We(this,ro);We(this,lo);We(this,Oi);We(this,Qi);We(this,vi);We(this,ao);We(this,Tn);We(this,$i);We(this,uo);We(this,hs);We(this,Fi);We(this,_s);We(this,en);We(this,Rt);We(this,tn);We(this,qi);We(this,co);We(this,go);We(this,Cn);We(this,ms);We(this,fo);We(this,ho);We(this,_o);We(this,mo);this.player=e,this.PlayerClass=i,this.eventListeners={"<any>":{}}}addEventListener(e,i){e==="<any>"||this[`handle${e}`]||li(`Cannot add listener for unknown event type '${e}'.`);const s=`listener-handle-${As()}`;return this.eventListeners[e]=this.eventListeners[e]||{},this.eventListeners[e][s]=i,s}removeEventListener(e,i){this.eventListeners[e]=this.eventListeners[e]||{},delete this.eventListeners[e][i]}processEvent(e){return wi(this,null,function*(){yield zl(()=>this.player),du(e);const i=this[`handle${e.type}`],n=Ys(this.player);z(this,so,pa).call(this,e)?e.status="ignored-due-to-advert":z(this,oo,Sa).call(this,e)?e.status="ignored-due-to-scrubbing":i?(yield i.call(this,e),z(this,co,Aa).call(this),z(this,go,Ba).call(this),e.status="handled"):li("No handler function for event.",e);const s=Ys(this.player);e.changedProps=Ll(n,s),e.processedAt=new Date().toISOString(),gu(e),z(this,fs,rr).call(this,e.type,e),z(this,fs,rr).call(this,"<any>",e)})}handlePressedChangeRate(){z(this,Fi,kn).call(this,e=>e+1,{cycle:!0})}handlePressedEnterOnChangeRate(){z(this,Fi,kn).call(this,e=>e+1,{cycle:!0})}handlePressedSpaceOnChangeRate(){z(this,Fi,kn).call(this,e=>e+1,{cycle:!0})}handlePressedUpOnChangeRate(){z(this,Fi,kn).call(this,e=>e+1)}handlePressedRightOnChangeRate(){z(this,Fi,kn).call(this,e=>e+1)}handlePressedDownOnChangeRate(){z(this,Fi,kn).call(this,e=>e-1)}handlePressedLeftOnChangeRate(){z(this,Fi,kn).call(this,e=>e-1)}handlePressedPrevSegment(){z(this,_s,ar).call(this,e=>e-1)}handlePressedNextSegment(){z(this,_s,ar).call(this,e=>e+1)}handlePressedSeekBack({seconds:e}){z(this,Rt,ri).call(this,i=>i-e)}handlePressedSeekAhead({seconds:e}){z(this,Rt,ri).call(this,i=>i+e)}handlePressedPrevTrack(){z(this,en,On).call(this,e=>e-1)}handlePressedNextTrack(){z(this,en,On).call(this,e=>e+1)}handlePressedAdvertLink(){}handlePressedAdvertButton(){}handlePressedAdvertImage(){}handlePressedAdvertVideo(){}handlePressedBeyondWords(){}handlePressedSourceUrl(){}handleDurationUpdated(){}handleMediaLoaded({loadedMedia:e}){this.player.loadedMedia=e}handlePlaybackRateUpdated(){}handleVisibilityChanged(){k0(this.PlayerClass)}handlePressedVideoBackground(){z(this,$i,Wn).call(this)}handlePressedEnterOnProgressBar(){z(this,$i,Wn).call(this)}handlePressedSpaceOnProgressBar(){z(this,$i,Wn).call(this)}handlePressedEnterOnProgressCircle(){z(this,$i,Wn).call(this)}handlePressedSpaceOnProgressCircle(){z(this,$i,Wn).call(this)}handlePressedLeftOnProgressBar(){z(this,Rt,ri).call(this,e=>e-5)}handlePressedRightOnProgressBar(){z(this,Rt,ri).call(this,e=>e+5)}handlePressedLeftOnProgressCircle(){z(this,Rt,ri).call(this,e=>e-5)}handlePressedRightOnProgressCircle(){z(this,Rt,ri).call(this,e=>e+5)}handlePressedProgressBar({ratio:e}){this.preScrubState=this.player.playbackState,this.pauseTimeout=setTimeout(()=>z(this,uo,Ca).call(this),100),z(this,Rt,ri).call(this,(i,n)=>e*n),e!==0&&(this.segmentPlayed=!0)}handleScrubbedProgressBar({ratio:e}){z(this,Rt,ri).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(){Zl(this.player).then(()=>{z(this,tn,jn).call(this,{atTheStart:!0}),z(this,qi,pn).call(this,{atTheStart:!0})})}handleNoContentAvailable({description:e}){console.warn(`BeyondWords.Player: ${e}`)}handlePressedPlay({emittedFrom:e,widgetSegment:i,widgetIsCurrent:n}){e==="segment-widget"&&!n?z(this,hs,lr).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"),m0(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||z(this,qi,pn).call(this);const e=this.player.currentTime<=is,i=this.player.currentTime>=this.player.duration,n=this.player.mediaElement.video.paused;!e&&!i&&!n&&(this.player.playbackState="playing")}handlePlaybackEnded(){z(this,ao,Ta).call(this)&&(this.midrollPlayed=!0),this.segmentPlayed=!1;const e=z(this,Oi,on).call(this),i=z(this,vi,Vi).call(this);z(this,qi,pn).call(this,{atTheEnd:!0,wasIntro:e}),!i&&(z(this,tn,jn).call(this,{atTheEnd:!0}),!e&&(z(this,Qi,Vn).call(this)||z(this,vi,Vi).call(this)||z(this,en,On).call(this,n=>n+1)))}handlePlaybackNotAllowed({description:e}){console.warn(`BeyondWords.Player: ${e}`);const i=this.player.contentIndex<=0&&this.player.currentTime<=is;this.player.playbackState=i?"stopped":"paused"}handlePlaybackErrored({mediaType:e,errorMessage:i}){console.warn(`BeyondWords.Player: ${e} playback error: ${i}`),z(this,Oi,on).call(this)||z(this,Qi,Vn).call(this)?z(this,tn,jn).call(this,{errored:!0}):z(this,vi,Vi).call(this)?z(this,qi,pn).call(this,{errored:!0}):this.handlePlaybackEnded()}handlePressedMaximize(){nl()?C_():T_(this.player.target)}handleFullScreenModeUpdated(){const e=nl()===this.player.target,i=e?"add":"remove";this.player.isFullScreen=e,this.player.target.classList[i]("maximized")}handlePressedPlaylistItem({index:e}){z(this,en,On).call(this,()=>e),this.player.playbackState="playing"}handlePressedTogglePlaylist(){const e=this.player.playlistStyle.split("-"),i=this.player.content.length>1,n=e[0]==="show"||e[0]==="auto"&&i;e[0]=n?"hide":"show",this.player.playlistStyle=e.join("-")}handlePressedDownload({contentIndex:e,audioIndex:i,videoIndex:n}){var u,g;const s=this.player.content[e],o=(u=s.audio)==null?void 0:u[i],r=(g=s.video)==null?void 0:g[n],l=(o||r).url,a=l.split(".").pop(),d=`${s.title}.${a}`;return Jm(l,d)}handlePressedCloseWidget(){for(const e of this.PlayerClass.instances())e.playbackState="paused",e.widgetStyle="closed-by-user"}handleContentStatusChanged({contentId:e,legacyId:i,sourceId:n,sourceUrl:s,contentStatus:o}){o==="processed"&&this.player.playbackState==="stopped"&&this.player.contentIndex===0&&this.player.currentTime===0&&z(this,_o,Wa).call(this,{contentId:e,legacyId:i,sourceId:n,sourceUrl:s})&&Zl(this.player).then(()=>{z(this,tn,jn).call(this,{atTheStart:!0}),z(this,qi,pn).call(this,{atTheStart:!0})})}handleCurrentSegmentUpdated({segment:e,segmentIndex:i,contentIndex:n}){var s;z(this,Tn,bs).call(this)?this.player.currentSegment=sn(oi({},e),{segmentIndex:i,contentIndex:n}):this.segmentPlayed||((s=this.player.segmentContainers)==null||s.reset(),this.player.currentSegment=null)}handleHoveredSegmentUpdated({segment:e,segmentIndex:i,contentIndex:n}){e?this.player.hoveredSegment=sn(oi({},e),{segmentIndex:i,contentIndex:n}):this.player.hoveredSegment=null}handlePressedSegment({segment:e,segmentIndex:i,contentIndex:n}){if(!rs("hovered",e,this.player.clickableSections))return;if(!z(this,mo,Oa).call(this,{contentIndex:n,segmentIndex:i})&&!z(this,vi,Vi).call(this)){z(this,$i,Wn).call(this);return}n!==this.player.contentIndex&&z(this,en,On).call(this,()=>n),z(this,hs,lr).call(this,oi({segmentIndex:i,contentIndex:n},e))}}so=new WeakSet,pa=function({type:e}){return z(this,vi,Vi).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"))},oo=new WeakSet,Sa=function({type:e}){return this.preScrubState&&(e.includes("CurrentTimeUpdated")||e.includes("PlaybackEnded"))},fs=new WeakSet,rr=function(e,i){const n=this.eventListeners[e]||{};Object.values(n).forEach(s=>s(i))},ro=new WeakSet,wa=function(){return this.player.introsOutros.some(e=>e.placement==="pre-roll")},lo=new WeakSet,Pa=function(){return this.player.introsOutros.some(e=>e.placement==="post-roll")},Oi=new WeakSet,on=function(e=this.player.introsOutrosIndex){var i,n,s;return((s=(n=(i=this.player)==null?void 0:i.introsOutros)==null?void 0:n[e])==null?void 0:s.placement)==="pre-roll"},Qi=new WeakSet,Vn=function(e=this.player.introsOutrosIndex){var i,n,s;return((s=(n=(i=this.player)==null?void 0:i.introsOutros)==null?void 0:n[e])==null?void 0:s.placement)==="post-roll"},vi=new WeakSet,Vi=function(){return this.player.advertIndex!==-1},ao=new WeakSet,Ta=function(){var e;return((e=this.player.adverts[this.player.advertIndex])==null?void 0:e.placement)==="mid-roll"},Tn=new WeakSet,bs=function(){return!z(this,Oi,on).call(this)&&!z(this,Qi,Vn).call(this)&&!z(this,vi,Vi).call(this)},$i=new WeakSet,Wn=function(){this.player.playbackState==="playing"?this.player.playbackState="paused":this.player.playbackState="playing"},uo=new WeakSet,Ca=function(){this.player.playbackState==="playing"&&(this.player.playbackState="paused")},hs=new WeakSet,lr=function(s){var o=s,{segmentIndex:e,contentIndex:i}=o,n=ir(o,["segmentIndex","contentIndex"]);z(this,Rt,ri).call(this,()=>n.startTime,i),this.player.currentSegment=oi({segmentIndex:e,contentIndex:i},n),this.player.playbackState="playing",this.segmentPlayed=!0},Fi=new WeakSet,kn=function(e,{cycle:i}={}){const n=this.player.playbackRates,s=n.length-1,o=n.indexOf(this.player.playbackRate),r=e(o);let l;i?l=r%n.length:l=Math.max(0,Math.min(s,r)),this.player.playbackRate=n[l]||1},_s=new WeakSet,ar=function(e){const i=this.player.content[this.player.contentIndex].segments,n=Mo(i,this.player.currentTime),s=e(n);z(this,Oi,on).call(this)&&s>=0?this.handlePlaybackEnded():z(this,Qi,Vn).call(this)&&s<0?(z(this,Cn,ks).call(this,-1),z(this,Rt,ri).call(this,()=>{var o;return((o=i[i.length-1])==null?void 0:o.startTime)||.01}),this.player.playbackState="playing"):z(this,Tn,bs).call(this)&&s<0&&z(this,ro,wa).call(this)?(z(this,Rt,ri).call(this,()=>0),z(this,tn,jn).call(this,{atTheStart:!0})):z(this,Tn,bs).call(this)&&s===i.length&&z(this,lo,Pa).call(this)?z(this,Rt,ri).call(this,()=>this.player.duration-.01):z(this,Tn,bs).call(this)&&s>=0&&s<i.length&&z(this,Rt,ri).call(this,()=>i[s].startTime)},en=new WeakSet,On=function(e){const i=e(this.player.contentIndex),n=i<0||i>=this.player.content.length;n?(this.player.playbackState="stopped",z(this,Rt,ri).call(this,()=>0)):(this.player.contentIndex=i,z(this,vi,Vi).call(this)||(z(this,Rt,ri).call(this,()=>0),this.midrollPlayed=!1)),z(this,Cn,ks).call(this,-1),z(this,tn,jn).call(this,{atTheStart:!0}),n||z(this,qi,pn).call(this,{atTheStart:!0})},Rt=new WeakSet,ri=function(e,i){if(z(this,vi,Vi).call(this))this.prevTime=e(),this.prevContent=i;else{const n=this.player.duration||0;this.player.currentTime=e(this.player.currentTime,n)}},tn=new WeakSet,jn=function({atTheStart:e,atTheEnd:i,errored:n}={}){const{content:s,introsOutros:o,currentTime:r}=this.player,l=typeof this.nextIntroOutro!="undefined"?this.nextIntroOutro:this.player.introsOutrosIndex,a=typeof this.nextAdvert!="undefined"?this.nextAdvert:this.player.advertIndex,d=typeof this.prevContent!="undefined"?this.prevContent:this.player.contentIndex;z(this,Cn,ks).call(this,h0({introsOutros:o,introsOutrosIndex:l,advertIndex:a,content:s,contentIndex:d,currentTime:r,atTheStart:e,atTheEnd:i,errored:n}))},qi=new WeakSet,pn=function({atTheStart:e,atTheEnd:i,wasIntro:n,errored:s}={}){const{adverts:o,content:r,currentTime:l}=this.player;let a=typeof this.nextIntroOutro!="undefined"?this.nextIntroOutro:this.player.introsOutrosIndex;const d=typeof this.nextAdvert!="undefined"?this.nextAdvert:this.player.advertIndex,u=typeof this.prevContent!="undefined"?this.prevContent:this.player.contentIndex;n&&(e=!0,i=!1,a=-1),z(this,ms,ur).call(this,e0({introsOutrosIndex:a,adverts:o,advertIndex:d,content:r,contentIndex:u,currentTime:l,atTheStart:e,atTheEnd:i,errored:s}));const g=this.player.persistentAdImage,m=this.player.persistentIndex;this.player.persistentIndex=l0(g,m,d,o)},co=new WeakSet,Aa=function(){this.player.playbackState==="playing"&&typeof this.nextIntroOutro!="undefined"&&(z(this,Cn,ks).call(this,this.nextIntroOutro),delete this.nextIntroOutro)},go=new WeakSet,Ba=function(){this.player.playbackState==="playing"&&typeof this.nextAdvert!="undefined"&&(z(this,ms,ur).call(this,this.nextAdvert),delete this.nextAdvert)},Cn=new WeakSet,ks=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<=is)&&z(this,Oi,on).call(this,e)){this.player.introsOutrosIndex=-1,z(this,qi,pn).call(this,{atTheStart:!0});return}const o=z(this,Oi,on).call(this),r=z(this,Qi,Vn).call(this);this.player.introsOutrosIndex=e;const l=o&&!z(this,Oi,on).call(this),a=r&&!z(this,Qi,Vn).call(this);l&&(this.player.currentTime=0),a&&z(this,en,On).call(this,()=>1/0)},ms=new WeakSet,ur=function(e){if(this.player.playbackState!=="playing"&&e!==-1){this.nextAdvert=e;return}else delete this.nextAdvert;const n=z(this,vi,Vi).call(this);this.player.advertIndex=e;const s=!n&&z(this,vi,Vi).call(this),o=n&&!z(this,vi,Vi).call(this);s&&z(this,fo,Ia).call(this),o&&z(this,ho,Va).call(this)},fo=new WeakSet,Ia=function(){z(this,Oi,on).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},ho=new WeakSet,Va=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},_o=new WeakSet,Wa=function({contentId:e,legacyId:i,sourceId:n,sourceUrl:s}){var o,r,l,a;return this.player.contentId===e||this.player.contentId===i||this.player.sourceId===n||this.player.sourceUrl===s||((o=this.player.playlist)==null?void 0:o.some(d=>d.contentId===e))||((r=this.player.playlist)==null?void 0:r.some(d=>d.contentId===i))||((l=this.player.playlist)==null?void 0:l.some(d=>d.sourceId===n))||((a=this.player.playlist)==null?void 0:a.some(d=>d.sourceUrl===s))},mo=new WeakSet,Oa=function({contentIndex:e,segmentIndex:i}){var n,s;return((n=this.player.currentSegment)==null?void 0:n.contentIndex)!==e||((s=this.player.currentSegment)==null?void 0:s.segmentIndex)!==i};var as="<unknown>";function w0(t){var e=t.split(`
58
58
  `);return e.reduce(function(i,n){var s=C0(n)||B0(n)||W0(n)||M0(n)||j0(n);return s&&i.push(s),i},[])}var P0=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,T0=/\((\S*)(?::(\d+))(?::(\d+))\)/;function C0(t){var e=P0.exec(t);if(!e)return null;var i=e[2]&&e[2].indexOf("native")===0,n=e[2]&&e[2].indexOf("eval")===0,s=T0.exec(e[2]);return n&&s!=null&&(e[2]=s[1],e[3]=s[2],e[4]=s[3]),{file:i?null:e[2],methodName:e[1]||as,arguments:i?[e[2]]:[],lineNumber:e[3]?+e[3]:null,column:e[4]?+e[4]:null}}var A0=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function B0(t){var e=A0.exec(t);return e?{file:e[2],methodName:e[1]||as,arguments:[],lineNumber:+e[3],column:e[4]?+e[4]:null}:null}var I0=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,V0=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function W0(t){var e=I0.exec(t);if(!e)return null;var i=e[3]&&e[3].indexOf(" > eval")>-1,n=V0.exec(e[3]);return i&&n!=null&&(e[3]=n[1],e[4]=n[2],e[5]=null),{file:e[3],methodName:e[1]||as,arguments:e[2]?e[2].split(","):[],lineNumber:e[4]?+e[4]:null,column:e[5]?+e[5]:null}}var O0=/^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;function j0(t){var e=O0.exec(t);return e?{file:e[3],methodName:e[1]||as,arguments:[],lineNumber:+e[4],column:e[5]?+e[5]:null}:null}var E0=/^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;function M0(t){var e=E0.exec(t);return e?{file:e[2],methodName:e[1]||as,arguments:[],lineNumber:+e[3],column:e[4]?+e[4]:null}:null}let ta=!1,Xo,Qo;const z0=({onError:t})=>{if(!t||ta)return;ta=!0;const e=ia(new Error),i=e==null?void 0:e.match(/setErrorHandler/);Xo=window.onerror,Qo=window.onunhandledrejection,window.onerror=(n,s,o,r,l)=>{var g;const a=s===e,d=(g=l==null?void 0:l.message)==null?void 0:g.match(/request was interrupted/);if((i||a||d)&&t(l))return!0;Xo&&Xo(n,s,o,r,l)},window.onunhandledrejection=n=>{var a;const s=n.reason,o=ia(s)===e,r=(a=s==null?void 0:s.message)==null?void 0:a.match(/request was interrupted/);if((i||o||r)&&t(s)){n.preventDefault();return}Qo&&Qo(n)}},ia=t=>{var e;return(e=w0((t==null?void 0:t.stack)||"")[0])==null?void 0:e.file},L0=()=>{typeof window=="undefined"&&li(["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 na=!1;const N0=()=>{na||(na=!0,addEventListener("mousedown",D0),addEventListener("click",R0),addEventListener("mousemove",x0))},D0=t=>{ra=t.pageX,la=t.pageY},R0=t=>{var i;if(t.defaultPrevented||U0(t)||t.button!==0)return;const e=(i=sa(t.target))==null?void 0:i.getAttribute(dn);if(e)for(const n of BeyondWords.Player.instances()){const{segment:s,contentIndex:o,segmentIndex:r}=oa(n,e);s&&n.onEvent(me({type:"PressedSegment",description:"The user pressed on a segment in the article.",initiatedBy:"user",emittedFrom:"segment",segment:s,contentIndex:o,segmentIndex:r}))}},x0=t=>{var n;const e=document.elementFromPoint(t.clientX,t.clientY),i=(n=sa(e))==null?void 0:n.getAttribute(dn);for(const[s,o]of BeyondWords.Player.instances().entries()){const{segment:r,contentIndex:l,segmentIndex:a}=oa(o,i);F0(s,l,a)&&o.onEvent(me({type:"HoveredSegmentUpdated",description:"The user hovered over a different segment in the article.",initiatedBy:"user",emittedFrom:"segment",segment:r,contentIndex:l,segmentIndex:a}))}},sa=t=>{for(;t&&t.hasAttribute;){if(t.hasAttribute(dn))return t;if(t.onclick||t.onmousedown||t.nodeName.toLowerCase()==="a")return;t=t.parentNode}},oa=(t,e)=>{if(!e)return{};let i={},n=-1/0;for(const[s,o]of(t.content||[]).entries())for(const[r,l]of(o.segments||[]).entries()){if(e!==l.marker)continue;const a=t.contentIndex===s?1:0;a<n||a===n&&(i!=null&&i.segment)||(i={contentIndex:s,segmentIndex:r,segment:l},n=a)}return i};let ra,la;const U0=t=>{const e=t.pageX-ra,i=t.pageY-la;return Math.sqrt(e*e+i*i)>5},Gs={},F0=(t,e,i)=>{Gs[t]||(Gs[t]={});const n=Gs[t];return n.contentIndex===e&&n.segmentIndex===i?!1:(n.contentIndex=e,n.segmentIndex=i,!0)};class $o{constructor(e){this.analyticsSink=e}sendToCustomAnalytics(e){return ym(this.analyticsSink,e)}sendToGoogleAnalytics(e,i){window.gtag("event",e,sn(oi({},i),{send_to:this.analyticsSink}))}}const q0=(t,e)=>{const i=H0(t,e.type);if(!i)return;const n=Y0(t,i);fu(n),t.analyticsUrl&&t.analyticsConsent!=="none"&&new $o(t.analyticsUrl).sendToCustomAnalytics(n),t.analyticsCustomUrl&&t.analyticsConsent!=="none"&&new $o(t.analyticsCustomUrl).sendToCustomAnalytics(n),t.analyticsTag&&new $o(t.analyticsTag).sendToGoogleAnalytics(Z0(n),n)},H0=(t,e)=>{if(e==="MediaLoaded"&&!t.listenSessionId)return"load";if(e==="PlaybackPlaying"&&G0(t)&&(t.isNewListen=!0),e==="CurrentTimeUpdated"&&t.isNewListen)return t.isNewListen=!1,"play";if(e==="CurrentTimeUpdated"&&K0(t))return"play_progress";if(e.startsWith("PressedAdvert"))return"ad_link_click"},Y0=(t,e)=>{var r,l;t.listenSessionId||(t.listenSessionId=As()),t.sessionCreatedAt||(t.sessionCreatedAt=Date.now());const i=["without-local-storage","none"].includes(t.analyticsConsent);i||localStorage.beyondwords||(localStorage.beyondwords=JSON.stringify(As()));const n=t.adverts[t.advertIndex],s=t.content[t.contentIndex],o=t.duration?t.currentTime/t.duration*100:0;return{event_type:e,device_type:J0(),media_type:n?"ad":"content",project_id:t.projectId,content_id:s==null?void 0:s.id,source_id:s==null?void 0:s.sourceId,analytics_id:t.analyticsId,ad_id:n==null?void 0:n.id,media_id:(r=t.loadedMedia)==null?void 0:r.id,media_format:(l=t.loadedMedia)==null?void 0:l.format,local_storage_id:i?null:JSON.parse(localStorage.beyondwords),listen_session_id:t.listenSessionId,session_created_at:t.sessionCreatedAt,duration:t.duration,listen_length_seconds:t.currentTime,listen_length_percent:Math.max(0,Math.min(100,o)),speed:t.playbackRate,location:window.location.href,referrer:document.referrer,player_version:"1",player_npm_version:Ts}},Z0=({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"},G0=t=>{var n,s;let e=!1;if(t.advertIndex!==-1){const o=((n=t.adverts[t.advertIndex])==null?void 0:n.id)||t.advertIndex;e=o!==t.prevAdvertId,t.prevAdvertId=o}else{const o=((s=t.content[t.contentIndex])==null?void 0:s.id)||t.contentIndex;e=o!==t.prevContentId,t.prevContentId=o}return e},K0=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},J0=()=>aa(499)?"phone":aa(999)?"tablet":"desktop",aa=t=>window.matchMedia&&window.matchMedia(`only screen and (max-device-width: ${t}px)`).matches,Ci=class Ci extends xm{constructor(n){var s=n,{target:e}=s,i=ir(s,["target"]);L0(),z0(i),N0();const{newTarget:o,showUserInterface:r}=Vm(e);o.classList.add("beyondwords-player","bwp"),Ci._styleLoaded||(o.style.display="none");const l=new S0(null,Ci);l.addEventListener("<any>",d=>q0(this,d));const a=oi({showUserInterface:r},i);super({target:o,props:sn(oi({controller:l},a),{initialProps:a})}),l.player=this,Mi(Ci,gn).push(this)}static styleLoaded(){Ci.instances().forEach(e=>e.target.style.removeProperty("display")),Ci._styleLoaded=!0}static get version(){return Ts}static get styleSrc(){return`https://proxy.beyondwords.io/npm/@beyondwords/player@${Ts}/dist/style.js`}static get hlsSrc(){return`https://proxy.beyondwords.io/npm/@beyondwords/player@${Ts}/dist/hls.light.min.js`}static instances(){return[...Mi(Ci,gn)]}static destroyAll(){Mi(Ci,gn).forEach(e=>e.destroy())}destroy(){this.$destroy(),ga(Ci,gn,Mi(Ci,gn).filter(e=>e!==this))}get target(){return this.$$.root}set target(e){li(["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>"])}};gn=new WeakMap,We(Ci,gn,[]);let Ks=Ci;return typeof window!="undefined"&&(window.BeyondWords||(window.BeyondWords={}),(ua=window.BeyondWords).Player||(ua.Player=Ks)),{Player:Ks}});
59
59
  //# sourceMappingURL=umd.js.map