@broadcastingplatforms/player 0.0.0-dev.7888976 → 0.0.0-dev.8619cae

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.
Files changed (35) hide show
  1. package/dist/bp-player.js +126 -126
  2. package/dist/bp-player.js.map +7 -0
  3. package/dist/bp-player.mjs +125 -125
  4. package/dist/bp-player.mjs.map +7 -0
  5. package/dist/bp-player.standalone.mjs +140 -140
  6. package/dist/bp-player.standalone.mjs.map +7 -0
  7. package/dist/bplive/index.d.ts.map +1 -0
  8. package/dist/bplive/service.d.ts.map +1 -0
  9. package/dist/bplive/types.d.ts.map +1 -0
  10. package/dist/components/bp-default-ui.d.ts +2 -2
  11. package/dist/components/bp-default-ui.d.ts.map +1 -0
  12. package/dist/components/bp-error-display.d.ts.map +1 -0
  13. package/dist/components/bp-overlay.d.ts.map +1 -0
  14. package/dist/components/bp-player.d.ts +3 -3
  15. package/dist/components/bp-player.d.ts.map +1 -0
  16. package/dist/components/index.d.ts.map +1 -0
  17. package/dist/core/index.d.ts.map +1 -0
  18. package/dist/core/player-core.d.ts.map +1 -0
  19. package/dist/core/state-receiver.d.ts.map +1 -0
  20. package/dist/core/state.d.ts.map +1 -0
  21. package/dist/elements/hls-video.d.ts.map +1 -0
  22. package/dist/elements/index.d.ts.map +1 -0
  23. package/dist/elements/livekit-video.d.ts.map +1 -0
  24. package/dist/elements/nano-video.d.ts.map +1 -0
  25. package/dist/index.d.ts +1 -1
  26. package/dist/index.d.ts.map +1 -0
  27. package/dist/providers/contract.d.ts +0 -9
  28. package/dist/providers/contract.d.ts.map +1 -0
  29. package/dist/providers/index.d.ts.map +1 -0
  30. package/dist/styles/index.d.ts.map +1 -0
  31. package/dist/util/attribute.d.ts +2 -0
  32. package/dist/util/attribute.d.ts.map +1 -0
  33. package/dist/util/index.d.ts.map +1 -0
  34. package/package.json +3 -5
  35. package/README.md +0 -157
@@ -1,10 +1,10 @@
1
1
  /*!
2
- * BP Player (v0.0.0-dev.7888976)
2
+ * BP Player (v0.0.0-dev.8619cae)
3
3
  * Universal video player web component
4
4
  */
5
- var eu=Object.defineProperty;var Im=Object.getOwnPropertyDescriptor;var tu=i=>{throw TypeError(i)};var Mm=(i,e,t)=>e in i?eu(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var x=(i,e,t,r)=>{for(var o=r>1?void 0:r?Im(e,t):e,n=i.length-1,a;n>=0;n--)(a=i[n])&&(o=(r?a(e,t,o):a(o))||o);return r&&o&&eu(e,t,o),o};var H=(i,e,t)=>Mm(i,typeof e!="symbol"?e+"":e,t),_l=(i,e,t)=>e.has(i)||tu("Cannot "+t);var u=(i,e,t)=>(_l(i,e,"read from private field"),t?t.call(i):e.get(i)),S=(i,e,t)=>e.has(i)?tu("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),_=(i,e,t,r)=>(_l(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),U=(i,e,t)=>(_l(i,e,"access private method"),t);var Jn=globalThis,jn=Jn.ShadowRoot&&(Jn.ShadyCSS===void 0||Jn.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,yl=Symbol(),iu=new WeakMap,Io=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==yl)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(jn&&e===void 0){let r=t!==void 0&&t.length===1;r&&(e=iu.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&iu.set(t,e))}return e}toString(){return this.cssText}},ru=i=>new Io(typeof i=="string"?i:i+"",void 0,yl),Mo=(i,...e)=>{let t=i.length===1?i[0]:e.reduce((r,o,n)=>r+(a=>{if(a._$cssResult$===!0)return a.cssText;if(typeof a=="number")return a;throw Error("Value passed to 'css' function must be a 'css' function result: "+a+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+i[n+1],i[0]);return new Io(t,i,yl)},ou=(i,e)=>{if(jn)i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let r=document.createElement("style"),o=Jn.litNonce;o!==void 0&&r.setAttribute("nonce",o),r.textContent=t.cssText,i.appendChild(r)}},Tl=jn?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(let r of e.cssRules)t+=r.cssText;return ru(t)})(i):i;var{is:Rm,defineProperty:xm,getOwnPropertyDescriptor:Pm,getOwnPropertyNames:Dm,getOwnPropertySymbols:Om,getPrototypeOf:Um}=Object,Wt=globalThis,nu=Wt.trustedTypes,Nm=nu?nu.emptyScript:"",Al=Wt.reactiveElementPolyfillSupport,Ro=(i,e)=>i,xo={toAttribute(i,e){switch(e){case Boolean:i=i?Nm:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let t=i;switch(e){case Boolean:t=i!==null;break;case Number:t=i===null?null:Number(i);break;case Object:case Array:try{t=JSON.parse(i)}catch{t=null}}return t}},ea=(i,e)=>!Rm(i,e),au={attribute:!0,type:String,converter:xo,reflect:!1,useDefault:!1,hasChanged:ea};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Wt.litPropertyMetadata??(Wt.litPropertyMetadata=new WeakMap);var It=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=au){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let r=Symbol(),o=this.getPropertyDescriptor(e,r,t);o!==void 0&&xm(this.prototype,e,o)}}static getPropertyDescriptor(e,t,r){let{get:o,set:n}=Pm(this.prototype,e)??{get(){return this[t]},set(a){this[t]=a}};return{get:o,set(a){let l=o==null?void 0:o.call(this);n==null||n.call(this,a),this.requestUpdate(e,l,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??au}static _$Ei(){if(this.hasOwnProperty(Ro("elementProperties")))return;let e=Um(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Ro("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Ro("properties"))){let t=this.properties,r=[...Dm(t),...Om(t)];for(let o of r)this.createProperty(o,t[o])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[r,o]of t)this.elementProperties.set(r,o)}this._$Eh=new Map;for(let[t,r]of this.elementProperties){let o=this._$Eu(t,r);o!==void 0&&this._$Eh.set(o,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let r=new Set(e.flat(1/0).reverse());for(let o of r)t.unshift(Tl(o))}else e!==void 0&&t.push(Tl(e));return t}static _$Eu(e,t){let r=t.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ou(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var r;return(r=t.hostConnected)==null?void 0:r.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var r;return(r=t.hostDisconnected)==null?void 0:r.call(t)})}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$ET(e,t){var n;let r=this.constructor.elementProperties.get(e),o=this.constructor._$Eu(e,r);if(o!==void 0&&r.reflect===!0){let a=(((n=r.converter)==null?void 0:n.toAttribute)!==void 0?r.converter:xo).toAttribute(t,r.type);this._$Em=e,a==null?this.removeAttribute(o):this.setAttribute(o,a),this._$Em=null}}_$AK(e,t){var n,a;let r=this.constructor,o=r._$Eh.get(e);if(o!==void 0&&this._$Em!==o){let l=r.getPropertyOptions(o),c=typeof l.converter=="function"?{fromAttribute:l.converter}:((n=l.converter)==null?void 0:n.fromAttribute)!==void 0?l.converter:xo;this._$Em=o;let p=c.fromAttribute(t,l.type);this[o]=p??((a=this._$Ej)==null?void 0:a.get(o))??p,this._$Em=null}}requestUpdate(e,t,r){var o;if(e!==void 0){let n=this.constructor,a=this[e];if(r??(r=n.getPropertyOptions(e)),!((r.hasChanged??ea)(a,t)||r.useDefault&&r.reflect&&a===((o=this._$Ej)==null?void 0:o.get(e))&&!this.hasAttribute(n._$Eu(e,r))))return;this.C(e,t,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:r,reflect:o,wrapped:n},a){r&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,a??t??this[e]),n!==!0||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||r||(t=void 0),this._$AL.set(e,t)),o===!0&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var r;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[n,a]of this._$Ep)this[n]=a;this._$Ep=void 0}let o=this.constructor.elementProperties;if(o.size>0)for(let[n,a]of o){let{wrapped:l}=a,c=this[n];l!==!0||this._$AL.has(n)||c===void 0||this.C(n,void 0,a,c)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(r=this._$EO)==null||r.forEach(o=>{var n;return(n=o.hostUpdate)==null?void 0:n.call(o)}),this.update(t)):this._$EM()}catch(o){throw e=!1,this._$EM(),o}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(r=>{var o;return(o=r.hostUpdated)==null?void 0:o.call(r)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach(t=>this._$ET(t,this[t]))),this._$EM()}updated(e){}firstUpdated(e){}};It.elementStyles=[],It.shadowRootOptions={mode:"open"},It[Ro("elementProperties")]=new Map,It[Ro("finalized")]=new Map,Al==null||Al({ReactiveElement:It}),(Wt.reactiveElementVersions??(Wt.reactiveElementVersions=[])).push("2.1.1");var Do=globalThis,ta=Do.trustedTypes,su=ta?ta.createPolicy("lit-html",{createHTML:i=>i}):void 0,pu="$lit$",Ft=`lit$${Math.random().toFixed(9).slice(2)}$`,mu="?"+Ft,$m=`<${mu}>`,Ai=document,Oo=()=>Ai.createComment(""),Uo=i=>i===null||typeof i!="object"&&typeof i!="function",Rl=Array.isArray,Hm=i=>Rl(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",Sl=`[
5
+ var eu=Object.defineProperty;var wm=Object.getOwnPropertyDescriptor;var tu=i=>{throw TypeError(i)};var Im=(i,e,t)=>e in i?eu(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var x=(i,e,t,r)=>{for(var o=r>1?void 0:r?wm(e,t):e,n=i.length-1,a;n>=0;n--)(a=i[n])&&(o=(r?a(e,t,o):a(o))||o);return r&&o&&eu(e,t,o),o};var H=(i,e,t)=>Im(i,typeof e!="symbol"?e+"":e,t),_l=(i,e,t)=>e.has(i)||tu("Cannot "+t);var u=(i,e,t)=>(_l(i,e,"read from private field"),t?t.call(i):e.get(i)),S=(i,e,t)=>e.has(i)?tu("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),_=(i,e,t,r)=>(_l(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),U=(i,e,t)=>(_l(i,e,"access private method"),t);var Jn=globalThis,jn=Jn.ShadowRoot&&(Jn.ShadyCSS===void 0||Jn.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,yl=Symbol(),iu=new WeakMap,Co=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==yl)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(jn&&e===void 0){let r=t!==void 0&&t.length===1;r&&(e=iu.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&iu.set(t,e))}return e}toString(){return this.cssText}},ru=i=>new Co(typeof i=="string"?i:i+"",void 0,yl),Mo=(i,...e)=>{let t=i.length===1?i[0]:e.reduce((r,o,n)=>r+(a=>{if(a._$cssResult$===!0)return a.cssText;if(typeof a=="number")return a;throw Error("Value passed to 'css' function must be a 'css' function result: "+a+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+i[n+1],i[0]);return new Co(t,i,yl)},ou=(i,e)=>{if(jn)i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let r=document.createElement("style"),o=Jn.litNonce;o!==void 0&&r.setAttribute("nonce",o),r.textContent=t.cssText,i.appendChild(r)}},Tl=jn?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(let r of e.cssRules)t+=r.cssText;return ru(t)})(i):i;var{is:Cm,defineProperty:Mm,getOwnPropertyDescriptor:Rm,getOwnPropertyNames:xm,getOwnPropertySymbols:Pm,getPrototypeOf:Dm}=Object,Wt=globalThis,nu=Wt.trustedTypes,Om=nu?nu.emptyScript:"",Al=Wt.reactiveElementPolyfillSupport,Ro=(i,e)=>i,xo={toAttribute(i,e){switch(e){case Boolean:i=i?Om:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let t=i;switch(e){case Boolean:t=i!==null;break;case Number:t=i===null?null:Number(i);break;case Object:case Array:try{t=JSON.parse(i)}catch{t=null}}return t}},ea=(i,e)=>!Cm(i,e),au={attribute:!0,type:String,converter:xo,reflect:!1,useDefault:!1,hasChanged:ea};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Wt.litPropertyMetadata??(Wt.litPropertyMetadata=new WeakMap);var Ct=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=au){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let r=Symbol(),o=this.getPropertyDescriptor(e,r,t);o!==void 0&&Mm(this.prototype,e,o)}}static getPropertyDescriptor(e,t,r){let{get:o,set:n}=Rm(this.prototype,e)??{get(){return this[t]},set(a){this[t]=a}};return{get:o,set(a){let l=o==null?void 0:o.call(this);n==null||n.call(this,a),this.requestUpdate(e,l,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??au}static _$Ei(){if(this.hasOwnProperty(Ro("elementProperties")))return;let e=Dm(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Ro("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Ro("properties"))){let t=this.properties,r=[...xm(t),...Pm(t)];for(let o of r)this.createProperty(o,t[o])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[r,o]of t)this.elementProperties.set(r,o)}this._$Eh=new Map;for(let[t,r]of this.elementProperties){let o=this._$Eu(t,r);o!==void 0&&this._$Eh.set(o,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let r=new Set(e.flat(1/0).reverse());for(let o of r)t.unshift(Tl(o))}else e!==void 0&&t.push(Tl(e));return t}static _$Eu(e,t){let r=t.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ou(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var r;return(r=t.hostConnected)==null?void 0:r.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var r;return(r=t.hostDisconnected)==null?void 0:r.call(t)})}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$ET(e,t){var n;let r=this.constructor.elementProperties.get(e),o=this.constructor._$Eu(e,r);if(o!==void 0&&r.reflect===!0){let a=(((n=r.converter)==null?void 0:n.toAttribute)!==void 0?r.converter:xo).toAttribute(t,r.type);this._$Em=e,a==null?this.removeAttribute(o):this.setAttribute(o,a),this._$Em=null}}_$AK(e,t){var n,a;let r=this.constructor,o=r._$Eh.get(e);if(o!==void 0&&this._$Em!==o){let l=r.getPropertyOptions(o),c=typeof l.converter=="function"?{fromAttribute:l.converter}:((n=l.converter)==null?void 0:n.fromAttribute)!==void 0?l.converter:xo;this._$Em=o;let p=c.fromAttribute(t,l.type);this[o]=p??((a=this._$Ej)==null?void 0:a.get(o))??p,this._$Em=null}}requestUpdate(e,t,r){var o;if(e!==void 0){let n=this.constructor,a=this[e];if(r??(r=n.getPropertyOptions(e)),!((r.hasChanged??ea)(a,t)||r.useDefault&&r.reflect&&a===((o=this._$Ej)==null?void 0:o.get(e))&&!this.hasAttribute(n._$Eu(e,r))))return;this.C(e,t,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:r,reflect:o,wrapped:n},a){r&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,a??t??this[e]),n!==!0||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||r||(t=void 0),this._$AL.set(e,t)),o===!0&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var r;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[n,a]of this._$Ep)this[n]=a;this._$Ep=void 0}let o=this.constructor.elementProperties;if(o.size>0)for(let[n,a]of o){let{wrapped:l}=a,c=this[n];l!==!0||this._$AL.has(n)||c===void 0||this.C(n,void 0,a,c)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(r=this._$EO)==null||r.forEach(o=>{var n;return(n=o.hostUpdate)==null?void 0:n.call(o)}),this.update(t)):this._$EM()}catch(o){throw e=!1,this._$EM(),o}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(r=>{var o;return(o=r.hostUpdated)==null?void 0:o.call(r)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach(t=>this._$ET(t,this[t]))),this._$EM()}updated(e){}firstUpdated(e){}};Ct.elementStyles=[],Ct.shadowRootOptions={mode:"open"},Ct[Ro("elementProperties")]=new Map,Ct[Ro("finalized")]=new Map,Al==null||Al({ReactiveElement:Ct}),(Wt.reactiveElementVersions??(Wt.reactiveElementVersions=[])).push("2.1.1");var Do=globalThis,ta=Do.trustedTypes,su=ta?ta.createPolicy("lit-html",{createHTML:i=>i}):void 0,pu="$lit$",Ft=`lit$${Math.random().toFixed(9).slice(2)}$`,mu="?"+Ft,Um=`<${mu}>`,Ai=document,Oo=()=>Ai.createComment(""),Uo=i=>i===null||typeof i!="object"&&typeof i!="function",Rl=Array.isArray,Nm=i=>Rl(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",Sl=`[
6
6
  \f\r]`,Po=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,lu=/-->/g,du=/>/g,yi=RegExp(`>|${Sl}(?:([^\\s"'>=/]+)(${Sl}*=${Sl}*(?:[^
7
- \f\r"'\`<>=]|("|')|))|$)`,"g"),cu=/'/g,uu=/"/g,vu=/^(?:script|style|textarea|title)$/i,xl=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),Ne=xl(1),qE=xl(2),GE=xl(3),Si=Symbol.for("lit-noChange"),ae=Symbol.for("lit-nothing"),hu=new WeakMap,Ti=Ai.createTreeWalker(Ai,129);function fu(i,e){if(!Rl(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return su!==void 0?su.createHTML(e):e}var Bm=(i,e)=>{let t=i.length-1,r=[],o,n=e===2?"<svg>":e===3?"<math>":"",a=Po;for(let l=0;l<t;l++){let c=i[l],p,h,v=-1,g=0;for(;g<c.length&&(a.lastIndex=g,h=a.exec(c),h!==null);)g=a.lastIndex,a===Po?h[1]==="!--"?a=lu:h[1]!==void 0?a=du:h[2]!==void 0?(vu.test(h[2])&&(o=RegExp("</"+h[2],"g")),a=yi):h[3]!==void 0&&(a=yi):a===yi?h[0]===">"?(a=o??Po,v=-1):h[1]===void 0?v=-2:(v=a.lastIndex-h[2].length,p=h[1],a=h[3]===void 0?yi:h[3]==='"'?uu:cu):a===uu||a===cu?a=yi:a===lu||a===du?a=Po:(a=yi,o=void 0);let m=a===yi&&i[l+1].startsWith("/>")?" ":"";n+=a===Po?c+$m:v>=0?(r.push(p),c.slice(0,v)+pu+c.slice(v)+Ft+m):c+Ft+(v===-2?l:m)}return[fu(i,n+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},No=class i{constructor({strings:e,_$litType$:t},r){let o;this.parts=[];let n=0,a=0,l=e.length-1,c=this.parts,[p,h]=Bm(e,t);if(this.el=i.createElement(p,r),Ti.currentNode=this.el.content,t===2||t===3){let v=this.el.content.firstChild;v.replaceWith(...v.childNodes)}for(;(o=Ti.nextNode())!==null&&c.length<l;){if(o.nodeType===1){if(o.hasAttributes())for(let v of o.getAttributeNames())if(v.endsWith(pu)){let g=h[a++],m=o.getAttribute(v).split(Ft),A=/([.?@])?(.*)/.exec(g);c.push({type:1,index:n,name:A[2],strings:m,ctor:A[1]==="."?wl:A[1]==="?"?Cl:A[1]==="@"?Il:cr}),o.removeAttribute(v)}else v.startsWith(Ft)&&(c.push({type:6,index:n}),o.removeAttribute(v));if(vu.test(o.tagName)){let v=o.textContent.split(Ft),g=v.length-1;if(g>0){o.textContent=ta?ta.emptyScript:"";for(let m=0;m<g;m++)o.append(v[m],Oo()),Ti.nextNode(),c.push({type:2,index:++n});o.append(v[g],Oo())}}}else if(o.nodeType===8)if(o.data===mu)c.push({type:2,index:n});else{let v=-1;for(;(v=o.data.indexOf(Ft,v+1))!==-1;)c.push({type:7,index:n}),v+=Ft.length-1}n++}}static createElement(e,t){let r=Ai.createElement("template");return r.innerHTML=e,r}};function dr(i,e,t=i,r){var a,l;if(e===Si)return e;let o=r!==void 0?(a=t._$Co)==null?void 0:a[r]:t._$Cl,n=Uo(e)?void 0:e._$litDirective$;return(o==null?void 0:o.constructor)!==n&&((l=o==null?void 0:o._$AO)==null||l.call(o,!1),n===void 0?o=void 0:(o=new n(i),o._$AT(i,t,r)),r!==void 0?(t._$Co??(t._$Co=[]))[r]=o:t._$Cl=o),o!==void 0&&(e=dr(i,o._$AS(i,e.values),o,r)),e}var Ll=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:r}=this._$AD,o=((e==null?void 0:e.creationScope)??Ai).importNode(t,!0);Ti.currentNode=o;let n=Ti.nextNode(),a=0,l=0,c=r[0];for(;c!==void 0;){if(a===c.index){let p;c.type===2?p=new $o(n,n.nextSibling,this,e):c.type===1?p=new c.ctor(n,c.name,c.strings,this,e):c.type===6&&(p=new Ml(n,this,e)),this._$AV.push(p),c=r[++l]}a!==(c==null?void 0:c.index)&&(n=Ti.nextNode(),a++)}return Ti.currentNode=Ai,o}p(e){let t=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}},$o=class i{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,r,o){this.type=2,this._$AH=ae,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=o,this._$Cv=(o==null?void 0:o.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=dr(this,e,t),Uo(e)?e===ae||e==null||e===""?(this._$AH!==ae&&this._$AR(),this._$AH=ae):e!==this._$AH&&e!==Si&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Hm(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==ae&&Uo(this._$AH)?this._$AA.nextSibling.data=e:this.T(Ai.createTextNode(e)),this._$AH=e}$(e){var n;let{values:t,_$litType$:r}=e,o=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=No.createElement(fu(r.h,r.h[0]),this.options)),r);if(((n=this._$AH)==null?void 0:n._$AD)===o)this._$AH.p(t);else{let a=new Ll(o,this),l=a.u(this.options);a.p(t),this.T(l),this._$AH=a}}_$AC(e){let t=hu.get(e.strings);return t===void 0&&hu.set(e.strings,t=new No(e)),t}k(e){Rl(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,o=0;for(let n of e)o===t.length?t.push(r=new i(this.O(Oo()),this.O(Oo()),this,this.options)):r=t[o],r._$AI(n),o++;o<t.length&&(this._$AR(r&&r._$AB.nextSibling,o),t.length=o)}_$AR(e=this._$AA.nextSibling,t){var r;for((r=this._$AP)==null?void 0:r.call(this,!1,!0,t);e!==this._$AB;){let o=e.nextSibling;e.remove(),e=o}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}},cr=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,o,n){this.type=1,this._$AH=ae,this._$AN=void 0,this.element=e,this.name=t,this._$AM=o,this.options=n,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=ae}_$AI(e,t=this,r,o){let n=this.strings,a=!1;if(n===void 0)e=dr(this,e,t,0),a=!Uo(e)||e!==this._$AH&&e!==Si,a&&(this._$AH=e);else{let l=e,c,p;for(e=n[0],c=0;c<n.length-1;c++)p=dr(this,l[r+c],t,c),p===Si&&(p=this._$AH[c]),a||(a=!Uo(p)||p!==this._$AH[c]),p===ae?e=ae:e!==ae&&(e+=(p??"")+n[c+1]),this._$AH[c]=p}a&&!o&&this.j(e)}j(e){e===ae?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},wl=class extends cr{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===ae?void 0:e}},Cl=class extends cr{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==ae)}},Il=class extends cr{constructor(e,t,r,o,n){super(e,t,r,o,n),this.type=5}_$AI(e,t=this){if((e=dr(this,e,t,0)??ae)===Si)return;let r=this._$AH,o=e===ae&&r!==ae||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,n=e!==ae&&(r===ae||o);o&&this.element.removeEventListener(this.name,this,r),n&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t;typeof this._$AH=="function"?this._$AH.call(((t=this.options)==null?void 0:t.host)??this.element,e):this._$AH.handleEvent(e)}},Ml=class{constructor(e,t,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){dr(this,e)}};var kl=Do.litHtmlPolyfillSupport;kl==null||kl(No,$o),(Do.litHtmlVersions??(Do.litHtmlVersions=[])).push("3.3.1");var gu=(i,e,t)=>{let r=(t==null?void 0:t.renderBefore)??e,o=r._$litPart$;if(o===void 0){let n=(t==null?void 0:t.renderBefore)??null;r._$litPart$=o=new $o(e.insertBefore(Oo(),n),n,void 0,t??{})}return o._$AI(i),o};var ki=globalThis,Le=class extends It{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;let e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=gu(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return Si}},Eu;Le._$litElement$=!0,Le.finalized=!0,(Eu=ki.litElementHydrateSupport)==null||Eu.call(ki,{LitElement:Le});var Pl=ki.litElementPolyfillSupport;Pl==null||Pl({LitElement:Le});(ki.litElementVersions??(ki.litElementVersions=[])).push("4.2.1");var Kt=i=>(e,t)=>{t!==void 0?t.addInitializer(()=>{customElements.define(i,e)}):customElements.define(i,e)};var Vm={attribute:!0,type:String,converter:xo,reflect:!1,hasChanged:ea},Wm=(i=Vm,e,t)=>{let{kind:r,metadata:o}=t,n=globalThis.litPropertyMetadata.get(o);if(n===void 0&&globalThis.litPropertyMetadata.set(o,n=new Map),r==="setter"&&((i=Object.create(i)).wrapped=!0),n.set(t.name,i),r==="accessor"){let{name:a}=t;return{set(l){let c=e.get.call(this);e.set.call(this,l),this.requestUpdate(a,c,i)},init(l){return l!==void 0&&this.C(a,void 0,i,l),l}}}if(r==="setter"){let{name:a}=t;return function(l){let c=this[a];e.call(this,l),this.requestUpdate(a,c,i)}}throw Error("Unsupported decorator location: "+r)};function V(i){return(e,t)=>typeof t=="object"?Wm(i,e,t):((r,o,n)=>{let a=o.hasOwnProperty(n);return o.constructor.createProperty(n,r),a?Object.getOwnPropertyDescriptor(o,n):void 0})(i,e,t)}function we(i){return V({...i,state:!0,attribute:!1})}var Fm=[1005,1007,1008,1009,3001,3002,3003,3004,3005,3100,3101,3200,4003];function Km(i){return i===1005||i===1007||i===1009?"autoplay":i>=2001&&i<=2004?"offline":i>=3e3&&i<=3999?"media":i>=4900&&i<=4999?"security":i>=4e3&&i<=4899?"network":i>=5e3&&i<=5999?"setup":i>=1e3&&i<=1999?"media":"unknown"}function ra(){return{paused:!0,playing:!1,ended:!1,seeking:!1,waiting:!1,currentTime:0,duration:NaN,buffered:null,volume:1,muted:!1,loop:!1,playbackRate:1,readyState:0,videoWidth:0,videoHeight:0,qualities:[],currentQuality:null,targetQuality:null,fullscreen:!1,presentationMode:"inline",providerType:null,connectionState:"idle",streamType:"vod",contentType:"video",error:null}}function oa(i){return typeof i=="object"&&i!==null&&"type"in i&&i.type==="bplive"&&"streamId"in i}function ur(i){return typeof i=="object"&&i!==null&&"type"in i&&i.type==="bplive"&&"clipId"in i}function qm(i){return oa(i)||ur(i)}var Mt=class extends Error{constructor(t,r,o){super(t);this.code=r;this.status=o;this.name="BPLiveError"}},Ho=class{constructor(e){this._authToken=null;this._stream=null;this._clip=null;this._config=e,this._authToken=e.authToken??null}get config(){return this._config}get authToken(){return this._authToken}get stream(){return this._stream}get clip(){return this._clip}async fetch(e){if(!this._authToken)throw new Mt("No auth token provided. Ensure config.bpLive.authToken is set before loading a BPLive source.","AUTH_REQUIRED");let t=`${this._config.discoveryUrl}${e}`,r=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${this._authToken}`}});if(!r.ok)throw new Mt(`HTTP ${r.status}: ${r.statusText}`,"HTTP_ERROR",r.status);return r.json()}async getStream(e){return this.fetch(`/streams/${e}`)}async getClip(e){return this.fetch(`/clips/${e}`)}mapPlayerSourceToResolvedSource(e){if(e.provider==="livekit")return{type:"livekit",url:e.url,token:e.token,room:e.room};if(e.provider==="nanoplayer"){let{provider:t,...r}=e;return{type:"nano",source:r}}throw new Mt(`Unknown player source provider: ${e.provider}`,"UNKNOWN_PROVIDER")}selectClipMedia(e,t="landscape"){let r=e.filter(l=>l.type==="clip");if(r.length===0)return null;let o=r.find(l=>l.orientation===t);if(o)return o;let n=t==="landscape"?"portrait":"landscape",a=r.find(l=>l.orientation===n);return a||r[0]}mapClipMediaToPlayerSource(e){return{type:"video",url:e.url}}async resolveSource(e){if(this._stream=null,this._clip=null,oa(e))return this.resolveStreamSource(e);if(ur(e))return this.resolveClipSource(e);throw new Mt("Invalid BPLive source","INVALID_SOURCE")}extractStreamPoster(e){var t;return e.cover_photo??((t=e.channel)==null?void 0:t.cover_image)??void 0}async resolveStreamSource(e){var a,l,c;let r=(await this.getStream(e.streamId)).data;this._stream=r;let o=r.player_source??((a=r.active_stream)==null?void 0:a.player_source),n=this.extractStreamPoster(r);if(o)return{source:this.mapPlayerSourceToResolvedSource(o),contentType:"stream",poster:n};if(((c=(l=r.media)==null?void 0:l.vod)==null?void 0:c.length)>0){let p=r.media.vod[0];return{source:{type:"video",url:p.original},contentType:"video",poster:n??p.thumb??void 0}}throw new Mt("Stream is not live and has no VOD content","STREAM_OFFLINE")}async resolveClipSource(e){let r=(await this.getClip(e.clipId)).data;this._clip=r;let o=this.selectClipMedia(r.media,e.preferredOrientation);if(!o)throw new Mt("No playable media found in clip","NO_MEDIA");let n=o.orientation==="portrait"||e.preferredOrientation==="portrait";return{source:this.mapClipMediaToPlayerSource(o),contentType:"clip",poster:o.thumbnail??void 0,aspectRatio:n?"9 / 16":"16 / 9"}}destroy(){this._authToken=null,this._stream=null,this._clip=null}};function Gm(i){if(typeof i=="string")return"video";switch(i.type){case"video":return"video";case"nano":return"nano";case"livekit":return"livekit";default:return"video"}}function zm(i){return typeof i=="object"&&i!==null&&i.type==="bplive"}var Ym=["loadstart","loadedmetadata","loadeddata","canplay","canplaythrough","play","playing","pause","waiting","seeking","seeked","timeupdate","durationchange","ratechange","volumechange","ended","progress","error","resize"],na=class{constructor(){this._mediaElement=null;this._container=null;this._listeners=new Map;this._eventCleanup=[];this._destroyed=!1;this._bpLive=null;this._state=ra()}get state(){return this._state}get videoElement(){return this._mediaElement}get bpLive(){return this._bpLive}addEventListener(e,t){let r=Array.isArray(e)?e:[e];for(let o of r)this._listeners.has(o)||this._listeners.set(o,new Set),this._listeners.get(o).add(t)}removeEventListener(e,t){let r=Array.isArray(e)?e:[e];for(let o of r){let n=this._listeners.get(o);n&&(n.delete(t),n.size===0&&this._listeners.delete(o))}}dispatch(e,t){let r=this._listeners.get(e);if(r)for(let o of r)try{o(t)}catch(n){console.error(`[PlayerCore] Error in event listener for "${e}":`,n)}}updateState(e){this._state={...this._state,...e},this.dispatch("statechange",{state:this._state})}async loadSource(e,t,r){if(!this._destroyed){this.unloadSource(),this._container=t,this.updateState({connectionState:"connecting"}),this.dispatch("sourcechange",{source:e});try{let o=e,n=this._state.contentType,a,l;if(zm(e)){if(r!=null&&r.bpLive&&(this._bpLive&&this._bpLive.destroy(),this._bpLive=new Ho(r.bpLive)),!this._bpLive)throw new Error("BPLive source requires config.bpLive configuration.");let g=await this._bpLive.resolveSource(e);o=g.source,n=g.contentType,a=g.poster,l=g.aspectRatio}let c=Gm(o),v=c==="nano"||c==="livekit"||n==="stream"?"live":"vod";return this.updateState({providerType:c,contentType:n,streamType:v}),this._mediaElement=this.createMediaElement(c,o,r),this._mediaElement.style.width="100%",this._mediaElement.style.height="100%",this._mediaElement.style.objectFit="contain",this._state.muted&&(this._mediaElement.muted=!0),this._state.loop&&(this._mediaElement.loop=!0),this.attachMediaElementListeners(this._mediaElement),t.appendChild(this._mediaElement),this.dispatch("videoelementchange",{video:this._mediaElement}),{poster:a,aspectRatio:l}}catch(o){console.error("[PlayerCore] loadSource error:",o);let n={code:-1,message:o instanceof Error?o.message:"Failed to load source",fatal:!0,category:"setup"};this.updateState({error:n,connectionState:"failed"}),this.dispatch("error",n)}}}createMediaElement(e,t,r){switch(e){case"nano":{let o=document.createElement("nano-video"),n=t;return o.libraryLocation=(r==null?void 0:r.libraryLocation)??"/vendor/bp-player",n.source?o.sourceConfig=n.source:n.streamid&&(o.streamid=n.streamid),r!=null&&r.nano&&(o.config=r.nano),o}case"livekit":{let o=document.createElement("livekit-video"),n=t;return o.url=n.url,o.token=n.token,r!=null&&r.livekit&&(o.config=r.livekit),o}case"video":default:{let o=document.createElement("hls-video"),n=typeof t=="string"?t:t.url;return o.src=n,r!=null&&r.video&&(o.config=r.video),o}}}attachMediaElementListeners(e){for(let t of Ym){let r=()=>this.handleMediaEvent(t,e);e.addEventListener(t,r),this._eventCleanup.push(()=>e.removeEventListener(t,r))}}handleMediaEvent(e,t){var r,o;switch(e){case"loadstart":this.updateState({readyState:1}),this.dispatch("loadstart",void 0);break;case"loadedmetadata":{let a=t.duration===1/0?"live":this._state.streamType;this.updateState({duration:t.duration,videoWidth:t.videoWidth,videoHeight:t.videoHeight,streamType:a}),this.dispatch("loadedmetadata",{duration:t.duration,videoWidth:t.videoWidth,videoHeight:t.videoHeight});break}case"loadeddata":this.updateState({readyState:2}),this.dispatch("loadeddata",void 0);break;case"canplay":this.updateState({readyState:3,connectionState:"connected"}),this.dispatch("canplay",void 0),this.dispatch("connectionstatechange",{state:"connected"});break;case"canplaythrough":this.updateState({readyState:4}),this.dispatch("canplaythrough",void 0);break;case"play":this.updateState({paused:!1,ended:!1}),this.dispatch("play",void 0);break;case"playing":this.updateState({paused:!1,playing:!0,ended:!1,waiting:!1,readyState:4}),this.dispatch("playing",void 0);break;case"pause":this.updateState({paused:!0,playing:!1,waiting:!1}),this.dispatch("pause",void 0);break;case"waiting":this.updateState({playing:!1,waiting:!0,readyState:2}),this.dispatch("waiting",void 0);break;case"seeking":this.updateState({seeking:!0,currentTime:t.currentTime}),this.dispatch("seeking",{currentTime:t.currentTime});break;case"seeked":this.updateState({seeking:!1,currentTime:t.currentTime}),this.dispatch("seeked",{currentTime:t.currentTime});break;case"timeupdate":this.updateState({currentTime:t.currentTime,duration:t.duration}),this.dispatch("timeupdate",{currentTime:t.currentTime,duration:t.duration});break;case"durationchange":{let a=t.duration===1/0?"live":this._state.streamType;this.updateState({duration:t.duration,streamType:a}),this.dispatch("durationchange",{duration:t.duration}),this.dispatch("streamtypechange",{streamType:this._state.streamType});break}case"ratechange":this.updateState({playbackRate:t.playbackRate}),this.dispatch("ratechange",{playbackRate:t.playbackRate});break;case"volumechange":this.updateState({volume:t.volume,muted:t.muted}),this.dispatch("volumechange",{volume:t.volume,muted:t.muted});break;case"ended":this.updateState({ended:!0,paused:!0,playing:!1}),this.dispatch("ended",void 0);break;case"progress":this.updateState({buffered:t.buffered}),this.dispatch("progress",{buffered:t.buffered});break;case"error":let n={code:((r=t.error)==null?void 0:r.code)??-1,message:((o=t.error)==null?void 0:o.message)??"Unknown error",fatal:!0,category:"media"};this.updateState({error:n}),this.dispatch("error",n);break;case"resize":t.videoWidth&&t.videoHeight&&(this.updateState({videoWidth:t.videoWidth,videoHeight:t.videoHeight}),this.dispatch("resize",{videoWidth:t.videoWidth,videoHeight:t.videoHeight}));break}}unloadSource(){this._eventCleanup.forEach(e=>e()),this._eventCleanup=[],this._mediaElement&&(this._mediaElement.remove(),this._mediaElement=null),this.updateState({...ra(),volume:this._state.volume,muted:this._state.muted,playbackRate:this._state.playbackRate}),this.dispatch("videoelementchange",{video:null}),this.dispatch("sourcechange",{source:null})}async play(){if(this._mediaElement){this.updateState({paused:!1}),this.dispatch("play",void 0);try{await this._mediaElement.play()}catch(e){throw this.updateState({paused:!0}),this.dispatch("pause",void 0),e}}}pause(){this._mediaElement&&(this.updateState({paused:!0,playing:!1}),this.dispatch("pause",void 0),this._mediaElement.pause())}seek(e){this._mediaElement&&(this._mediaElement.currentTime=e)}setVolume(e){let t=Math.max(0,Math.min(1,e));this.updateState({volume:t}),this._mediaElement&&(this._mediaElement.volume=t),this.dispatch("volumechange",{volume:t,muted:this._state.muted})}setMuted(e){this.updateState({muted:e}),this._mediaElement&&(this._mediaElement.muted=e),this.dispatch("volumechange",{volume:this._state.volume,muted:e})}setLoop(e){this.updateState({loop:e}),this._mediaElement&&(this._mediaElement.loop=e)}setPlaybackRate(e){this.updateState({playbackRate:e}),this._mediaElement&&(this._mediaElement.playbackRate=e),this.dispatch("ratechange",{playbackRate:e})}setTargetQuality(e){this.updateState({targetQuality:e}),this.dispatch("targetqualitychanged",{quality:e});let t=this._mediaElement;t!=null&&t.videoRenditions&&(t.videoRenditions.selectedIndex=(e==null?void 0:e.index)??-1)}setQuality(e){this.setTargetQuality(e)}setFullscreen(e){this.updateState({fullscreen:e,presentationMode:e?"fullscreen":"inline"}),this.dispatch("fullscreenchange",{fullscreen:e}),this.dispatch("presentationmodechange",{mode:e?"fullscreen":"inline"})}setPresentationMode(e){this.updateState({presentationMode:e,fullscreen:e==="fullscreen"}),this.dispatch("presentationmodechange",{mode:e})}destroy(){this._destroyed||(this._destroyed=!0,this.unloadSource(),this._bpLive&&(this._bpLive.destroy(),this._bpLive=null),this.dispatch("destroy",void 0),this._listeners.clear())}};function Dl(){return new na}var hr="bpPlayerObservedProperties";function Ol(i){return hr in i&&Array.isArray(i[hr])}function Qm(i,e){class t extends i{get[hr](){return e}}return t}function Zm(i){if(i.shadowRoot)return Array.from(i.shadowRoot.children);if(i.localName==="slot"){let t=i.assignedNodes();if(t.length>0)return t.filter(r=>r.nodeType===Node.ELEMENT_NODE)}return Array.from(i.children)}async function pr(i,e,t){if(e!=null&&e.contains(i))return;i.nodeName.includes("-")&&!Ol(i)&&(await Promise.resolve(),await customElements.whenDefined(i.nodeName.toLowerCase()),customElements.upgrade(i)),Ol(i)&&t(i);let r=Zm(i);r.length>0&&await Promise.all(r.map(o=>pr(o,e,t)))}function aa(i,e,t){let r=i[hr];r.includes("player")&&(i.player=e),r.includes("paused")&&(i.paused=t.paused),r.includes("playing")&&(i.playing=t.playing),r.includes("ended")&&(i.ended=t.ended),r.includes("seeking")&&(i.seeking=t.seeking),r.includes("currentTime")&&(i.currentTime=t.currentTime),r.includes("duration")&&(i.duration=t.duration),r.includes("volume")&&(i.volume=t.volume),r.includes("muted")&&(i.muted=t.muted),r.includes("playbackRate")&&(i.playbackRate=t.playbackRate),r.includes("readyState")&&(i.readyState=t.readyState),r.includes("videoWidth")&&(i.videoWidth=t.videoWidth),r.includes("videoHeight")&&(i.videoHeight=t.videoHeight),r.includes("qualities")&&(i.qualities=t.qualities),r.includes("currentQuality")&&(i.currentQuality=t.currentQuality),r.includes("targetQuality")&&(i.targetQuality=t.targetQuality),r.includes("fullscreen")&&(i.fullscreen=t.fullscreen),r.includes("presentationMode")&&(i.presentationMode=t.presentationMode),r.includes("connectionState")&&(i.connectionState=t.connectionState),r.includes("streamType")&&(i.streamType=t.streamType),r.includes("error")&&(i.error=t.error)}function sa(i){i[hr].includes("player")&&(i.player=void 0)}var bu=`/**
7
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),cu=/'/g,uu=/"/g,vu=/^(?:script|style|textarea|title)$/i,xl=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),Ne=xl(1),FE=xl(2),KE=xl(3),Si=Symbol.for("lit-noChange"),ae=Symbol.for("lit-nothing"),hu=new WeakMap,Ti=Ai.createTreeWalker(Ai,129);function fu(i,e){if(!Rl(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return su!==void 0?su.createHTML(e):e}var $m=(i,e)=>{let t=i.length-1,r=[],o,n=e===2?"<svg>":e===3?"<math>":"",a=Po;for(let l=0;l<t;l++){let c=i[l],p,h,v=-1,g=0;for(;g<c.length&&(a.lastIndex=g,h=a.exec(c),h!==null);)g=a.lastIndex,a===Po?h[1]==="!--"?a=lu:h[1]!==void 0?a=du:h[2]!==void 0?(vu.test(h[2])&&(o=RegExp("</"+h[2],"g")),a=yi):h[3]!==void 0&&(a=yi):a===yi?h[0]===">"?(a=o??Po,v=-1):h[1]===void 0?v=-2:(v=a.lastIndex-h[2].length,p=h[1],a=h[3]===void 0?yi:h[3]==='"'?uu:cu):a===uu||a===cu?a=yi:a===lu||a===du?a=Po:(a=yi,o=void 0);let m=a===yi&&i[l+1].startsWith("/>")?" ":"";n+=a===Po?c+Um:v>=0?(r.push(p),c.slice(0,v)+pu+c.slice(v)+Ft+m):c+Ft+(v===-2?l:m)}return[fu(i,n+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},No=class i{constructor({strings:e,_$litType$:t},r){let o;this.parts=[];let n=0,a=0,l=e.length-1,c=this.parts,[p,h]=$m(e,t);if(this.el=i.createElement(p,r),Ti.currentNode=this.el.content,t===2||t===3){let v=this.el.content.firstChild;v.replaceWith(...v.childNodes)}for(;(o=Ti.nextNode())!==null&&c.length<l;){if(o.nodeType===1){if(o.hasAttributes())for(let v of o.getAttributeNames())if(v.endsWith(pu)){let g=h[a++],m=o.getAttribute(v).split(Ft),A=/([.?@])?(.*)/.exec(g);c.push({type:1,index:n,name:A[2],strings:m,ctor:A[1]==="."?wl:A[1]==="?"?Il:A[1]==="@"?Cl:cr}),o.removeAttribute(v)}else v.startsWith(Ft)&&(c.push({type:6,index:n}),o.removeAttribute(v));if(vu.test(o.tagName)){let v=o.textContent.split(Ft),g=v.length-1;if(g>0){o.textContent=ta?ta.emptyScript:"";for(let m=0;m<g;m++)o.append(v[m],Oo()),Ti.nextNode(),c.push({type:2,index:++n});o.append(v[g],Oo())}}}else if(o.nodeType===8)if(o.data===mu)c.push({type:2,index:n});else{let v=-1;for(;(v=o.data.indexOf(Ft,v+1))!==-1;)c.push({type:7,index:n}),v+=Ft.length-1}n++}}static createElement(e,t){let r=Ai.createElement("template");return r.innerHTML=e,r}};function dr(i,e,t=i,r){var a,l;if(e===Si)return e;let o=r!==void 0?(a=t._$Co)==null?void 0:a[r]:t._$Cl,n=Uo(e)?void 0:e._$litDirective$;return(o==null?void 0:o.constructor)!==n&&((l=o==null?void 0:o._$AO)==null||l.call(o,!1),n===void 0?o=void 0:(o=new n(i),o._$AT(i,t,r)),r!==void 0?(t._$Co??(t._$Co=[]))[r]=o:t._$Cl=o),o!==void 0&&(e=dr(i,o._$AS(i,e.values),o,r)),e}var Ll=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:r}=this._$AD,o=((e==null?void 0:e.creationScope)??Ai).importNode(t,!0);Ti.currentNode=o;let n=Ti.nextNode(),a=0,l=0,c=r[0];for(;c!==void 0;){if(a===c.index){let p;c.type===2?p=new $o(n,n.nextSibling,this,e):c.type===1?p=new c.ctor(n,c.name,c.strings,this,e):c.type===6&&(p=new Ml(n,this,e)),this._$AV.push(p),c=r[++l]}a!==(c==null?void 0:c.index)&&(n=Ti.nextNode(),a++)}return Ti.currentNode=Ai,o}p(e){let t=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}},$o=class i{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,r,o){this.type=2,this._$AH=ae,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=o,this._$Cv=(o==null?void 0:o.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=dr(this,e,t),Uo(e)?e===ae||e==null||e===""?(this._$AH!==ae&&this._$AR(),this._$AH=ae):e!==this._$AH&&e!==Si&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Nm(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==ae&&Uo(this._$AH)?this._$AA.nextSibling.data=e:this.T(Ai.createTextNode(e)),this._$AH=e}$(e){var n;let{values:t,_$litType$:r}=e,o=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=No.createElement(fu(r.h,r.h[0]),this.options)),r);if(((n=this._$AH)==null?void 0:n._$AD)===o)this._$AH.p(t);else{let a=new Ll(o,this),l=a.u(this.options);a.p(t),this.T(l),this._$AH=a}}_$AC(e){let t=hu.get(e.strings);return t===void 0&&hu.set(e.strings,t=new No(e)),t}k(e){Rl(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,o=0;for(let n of e)o===t.length?t.push(r=new i(this.O(Oo()),this.O(Oo()),this,this.options)):r=t[o],r._$AI(n),o++;o<t.length&&(this._$AR(r&&r._$AB.nextSibling,o),t.length=o)}_$AR(e=this._$AA.nextSibling,t){var r;for((r=this._$AP)==null?void 0:r.call(this,!1,!0,t);e!==this._$AB;){let o=e.nextSibling;e.remove(),e=o}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}},cr=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,o,n){this.type=1,this._$AH=ae,this._$AN=void 0,this.element=e,this.name=t,this._$AM=o,this.options=n,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=ae}_$AI(e,t=this,r,o){let n=this.strings,a=!1;if(n===void 0)e=dr(this,e,t,0),a=!Uo(e)||e!==this._$AH&&e!==Si,a&&(this._$AH=e);else{let l=e,c,p;for(e=n[0],c=0;c<n.length-1;c++)p=dr(this,l[r+c],t,c),p===Si&&(p=this._$AH[c]),a||(a=!Uo(p)||p!==this._$AH[c]),p===ae?e=ae:e!==ae&&(e+=(p??"")+n[c+1]),this._$AH[c]=p}a&&!o&&this.j(e)}j(e){e===ae?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},wl=class extends cr{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===ae?void 0:e}},Il=class extends cr{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==ae)}},Cl=class extends cr{constructor(e,t,r,o,n){super(e,t,r,o,n),this.type=5}_$AI(e,t=this){if((e=dr(this,e,t,0)??ae)===Si)return;let r=this._$AH,o=e===ae&&r!==ae||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,n=e!==ae&&(r===ae||o);o&&this.element.removeEventListener(this.name,this,r),n&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t;typeof this._$AH=="function"?this._$AH.call(((t=this.options)==null?void 0:t.host)??this.element,e):this._$AH.handleEvent(e)}},Ml=class{constructor(e,t,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){dr(this,e)}};var kl=Do.litHtmlPolyfillSupport;kl==null||kl(No,$o),(Do.litHtmlVersions??(Do.litHtmlVersions=[])).push("3.3.1");var gu=(i,e,t)=>{let r=(t==null?void 0:t.renderBefore)??e,o=r._$litPart$;if(o===void 0){let n=(t==null?void 0:t.renderBefore)??null;r._$litPart$=o=new $o(e.insertBefore(Oo(),n),n,void 0,t??{})}return o._$AI(i),o};var ki=globalThis,Le=class extends Ct{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;let e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=gu(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return Si}},Eu;Le._$litElement$=!0,Le.finalized=!0,(Eu=ki.litElementHydrateSupport)==null||Eu.call(ki,{LitElement:Le});var Pl=ki.litElementPolyfillSupport;Pl==null||Pl({LitElement:Le});(ki.litElementVersions??(ki.litElementVersions=[])).push("4.2.1");var Kt=i=>(e,t)=>{t!==void 0?t.addInitializer(()=>{customElements.define(i,e)}):customElements.define(i,e)};var Hm={attribute:!0,type:String,converter:xo,reflect:!1,hasChanged:ea},Bm=(i=Hm,e,t)=>{let{kind:r,metadata:o}=t,n=globalThis.litPropertyMetadata.get(o);if(n===void 0&&globalThis.litPropertyMetadata.set(o,n=new Map),r==="setter"&&((i=Object.create(i)).wrapped=!0),n.set(t.name,i),r==="accessor"){let{name:a}=t;return{set(l){let c=e.get.call(this);e.set.call(this,l),this.requestUpdate(a,c,i)},init(l){return l!==void 0&&this.C(a,void 0,i,l),l}}}if(r==="setter"){let{name:a}=t;return function(l){let c=this[a];e.call(this,l),this.requestUpdate(a,c,i)}}throw Error("Unsupported decorator location: "+r)};function V(i){return(e,t)=>typeof t=="object"?Bm(i,e,t):((r,o,n)=>{let a=o.hasOwnProperty(n);return o.constructor.createProperty(n,r),a?Object.getOwnPropertyDescriptor(o,n):void 0})(i,e,t)}function we(i){return V({...i,state:!0,attribute:!1})}var Vm=[1005,1007,1008,1009,3001,3002,3003,3004,3005,3100,3101,3200,4003];function Wm(i){return i===1005||i===1007||i===1009?"autoplay":i>=2001&&i<=2004?"offline":i>=3e3&&i<=3999?"media":i>=4900&&i<=4999?"security":i>=4e3&&i<=4899?"network":i>=5e3&&i<=5999?"setup":i>=1e3&&i<=1999?"media":"unknown"}function ra(){return{paused:!0,playing:!1,ended:!1,seeking:!1,waiting:!1,currentTime:0,duration:NaN,buffered:null,volume:1,muted:!1,loop:!1,playbackRate:1,readyState:0,videoWidth:0,videoHeight:0,qualities:[],currentQuality:null,targetQuality:null,fullscreen:!1,presentationMode:"inline",providerType:null,connectionState:"idle",streamType:"vod",contentType:"video",error:null}}function oa(i){return typeof i=="object"&&i!==null&&"type"in i&&i.type==="bplive"&&"streamId"in i}function ur(i){return typeof i=="object"&&i!==null&&"type"in i&&i.type==="bplive"&&"clipId"in i}function Fm(i){return oa(i)||ur(i)}var Mt=class extends Error{constructor(t,r,o){super(t);this.code=r;this.status=o;this.name="BPLiveError"}},Ho=class{constructor(e){this._authToken=null;this._stream=null;this._clip=null;this._config=e,this._authToken=e.authToken??null}get config(){return this._config}get authToken(){return this._authToken}get stream(){return this._stream}get clip(){return this._clip}async fetch(e){if(!this._authToken)throw new Mt("No auth token provided. Ensure config.bpLive.authToken is set before loading a BPLive source.","AUTH_REQUIRED");let t=`${this._config.discoveryUrl}${e}`,r=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${this._authToken}`}});if(!r.ok)throw new Mt(`HTTP ${r.status}: ${r.statusText}`,"HTTP_ERROR",r.status);return r.json()}async getStream(e){return this.fetch(`/streams/${e}`)}async getClip(e){return this.fetch(`/clips/${e}`)}mapPlayerSourceToResolvedSource(e){if(e.provider==="livekit")return{type:"livekit",url:e.url,token:e.token,room:e.room};if(e.provider==="nanoplayer"){let{provider:t,...r}=e;return{type:"nano",source:r}}throw new Mt(`Unknown player source provider: ${e.provider}`,"UNKNOWN_PROVIDER")}selectClipMedia(e,t="landscape"){let r=e.filter(l=>l.type==="clip");if(r.length===0)return null;let o=r.find(l=>l.orientation===t);if(o)return o;let n=t==="landscape"?"portrait":"landscape",a=r.find(l=>l.orientation===n);return a||r[0]}mapClipMediaToPlayerSource(e){return{type:"video",url:e.url}}async resolveSource(e){if(this._stream=null,this._clip=null,oa(e))return this.resolveStreamSource(e);if(ur(e))return this.resolveClipSource(e);throw new Mt("Invalid BPLive source","INVALID_SOURCE")}extractStreamPoster(e){var t;return e.cover_photo??((t=e.channel)==null?void 0:t.cover_image)??void 0}async resolveStreamSource(e){var a,l,c;let r=(await this.getStream(e.streamId)).data;this._stream=r;let o=r.player_source??((a=r.active_stream)==null?void 0:a.player_source),n=this.extractStreamPoster(r);if(o)return{source:this.mapPlayerSourceToResolvedSource(o),contentType:"stream",poster:n};if(((c=(l=r.media)==null?void 0:l.vod)==null?void 0:c.length)>0){let p=r.media.vod[0];return{source:{type:"video",url:p.original},contentType:"video",poster:n??p.thumb??void 0}}throw new Mt("Stream is not live and has no VOD content","STREAM_OFFLINE")}async resolveClipSource(e){let r=(await this.getClip(e.clipId)).data;this._clip=r;let o=this.selectClipMedia(r.media,e.preferredOrientation);if(!o)throw new Mt("No playable media found in clip","NO_MEDIA");let n=o.orientation==="portrait"||e.preferredOrientation==="portrait";return{source:this.mapClipMediaToPlayerSource(o),contentType:"clip",poster:o.thumbnail??void 0,aspectRatio:n?"9 / 16":"16 / 9"}}destroy(){this._authToken=null,this._stream=null,this._clip=null}};function Km(i){if(typeof i=="string")return"video";switch(i.type){case"video":return"video";case"nano":return"nano";case"livekit":return"livekit";default:return"video"}}function qm(i){return typeof i=="object"&&i!==null&&i.type==="bplive"}var Gm=["loadstart","loadedmetadata","loadeddata","canplay","canplaythrough","play","playing","pause","waiting","seeking","seeked","timeupdate","durationchange","ratechange","volumechange","ended","progress","error","resize"],na=class{constructor(){this._mediaElement=null;this._container=null;this._listeners=new Map;this._eventCleanup=[];this._destroyed=!1;this._bpLive=null;this._state=ra()}get state(){return this._state}get videoElement(){return this._mediaElement}get bpLive(){return this._bpLive}addEventListener(e,t){let r=Array.isArray(e)?e:[e];for(let o of r)this._listeners.has(o)||this._listeners.set(o,new Set),this._listeners.get(o).add(t)}removeEventListener(e,t){let r=Array.isArray(e)?e:[e];for(let o of r){let n=this._listeners.get(o);n&&(n.delete(t),n.size===0&&this._listeners.delete(o))}}dispatch(e,t){let r=this._listeners.get(e);if(r)for(let o of r)try{o(t)}catch(n){console.error(`[PlayerCore] Error in event listener for "${e}":`,n)}}updateState(e){this._state={...this._state,...e},this.dispatch("statechange",{state:this._state})}async loadSource(e,t,r){if(!this._destroyed){this.unloadSource(),this._container=t,this.updateState({connectionState:"connecting"}),this.dispatch("sourcechange",{source:e});try{let o=e,n=this._state.contentType,a,l;if(qm(e)){if(r!=null&&r.bpLive&&(this._bpLive&&this._bpLive.destroy(),this._bpLive=new Ho(r.bpLive)),!this._bpLive)throw new Error("BPLive source requires config.bpLive configuration.");let g=await this._bpLive.resolveSource(e);o=g.source,n=g.contentType,a=g.poster,l=g.aspectRatio}let c=Km(o),v=c==="nano"||c==="livekit"||n==="stream"?"live":"vod";return this.updateState({providerType:c,contentType:n,streamType:v}),this._mediaElement=this.createMediaElement(c,o,r),this._mediaElement.style.width="100%",this._mediaElement.style.height="100%",this._mediaElement.style.objectFit="contain",this._state.muted&&(this._mediaElement.muted=!0),this._state.loop&&(this._mediaElement.loop=!0),this.attachMediaElementListeners(this._mediaElement),t.appendChild(this._mediaElement),this.dispatch("videoelementchange",{video:this._mediaElement}),{poster:a,aspectRatio:l}}catch(o){console.error("[PlayerCore] loadSource error:",o);let n={code:-1,message:o instanceof Error?o.message:"Failed to load source",fatal:!0,category:"setup"};this.updateState({error:n,connectionState:"failed"}),this.dispatch("error",n)}}}createMediaElement(e,t,r){switch(e){case"nano":{let o=document.createElement("nano-video"),n=t;return o.libraryLocation=(r==null?void 0:r.libraryLocation)??"/vendor/bp-player",n.source?o.sourceConfig=n.source:n.streamid&&(o.streamid=n.streamid),r!=null&&r.nano&&(o.config=r.nano),o}case"livekit":{let o=document.createElement("livekit-video"),n=t;return o.url=n.url,o.token=n.token,r!=null&&r.livekit&&(o.config=r.livekit),o}case"video":default:{let o=document.createElement("hls-video"),n=typeof t=="string"?t:t.url;return o.src=n,r!=null&&r.video&&(o.config=r.video),o}}}attachMediaElementListeners(e){for(let t of Gm){let r=()=>this.handleMediaEvent(t,e);e.addEventListener(t,r),this._eventCleanup.push(()=>e.removeEventListener(t,r))}}handleMediaEvent(e,t){var r,o;switch(e){case"loadstart":this.updateState({readyState:1}),this.dispatch("loadstart",void 0);break;case"loadedmetadata":{let a=t.duration===1/0?"live":this._state.streamType;this.updateState({duration:t.duration,videoWidth:t.videoWidth,videoHeight:t.videoHeight,streamType:a}),this.dispatch("loadedmetadata",{duration:t.duration,videoWidth:t.videoWidth,videoHeight:t.videoHeight});break}case"loadeddata":this.updateState({readyState:2}),this.dispatch("loadeddata",void 0);break;case"canplay":this.updateState({readyState:3,connectionState:"connected"}),this.dispatch("canplay",void 0),this.dispatch("connectionstatechange",{state:"connected"});break;case"canplaythrough":this.updateState({readyState:4}),this.dispatch("canplaythrough",void 0);break;case"play":this.updateState({paused:!1,ended:!1}),this.dispatch("play",void 0);break;case"playing":this.updateState({paused:!1,playing:!0,ended:!1,waiting:!1,readyState:4}),this.dispatch("playing",void 0);break;case"pause":this.updateState({paused:!0,playing:!1,waiting:!1}),this.dispatch("pause",void 0);break;case"waiting":this.updateState({playing:!1,waiting:!0,readyState:2}),this.dispatch("waiting",void 0);break;case"seeking":this.updateState({seeking:!0,currentTime:t.currentTime}),this.dispatch("seeking",{currentTime:t.currentTime});break;case"seeked":this.updateState({seeking:!1,currentTime:t.currentTime}),this.dispatch("seeked",{currentTime:t.currentTime});break;case"timeupdate":this.updateState({currentTime:t.currentTime,duration:t.duration}),this.dispatch("timeupdate",{currentTime:t.currentTime,duration:t.duration});break;case"durationchange":{let a=t.duration===1/0?"live":this._state.streamType;this.updateState({duration:t.duration,streamType:a}),this.dispatch("durationchange",{duration:t.duration}),this.dispatch("streamtypechange",{streamType:this._state.streamType});break}case"ratechange":this.updateState({playbackRate:t.playbackRate}),this.dispatch("ratechange",{playbackRate:t.playbackRate});break;case"volumechange":this.updateState({volume:t.volume,muted:t.muted}),this.dispatch("volumechange",{volume:t.volume,muted:t.muted});break;case"ended":this.updateState({ended:!0,paused:!0,playing:!1}),this.dispatch("ended",void 0);break;case"progress":this.updateState({buffered:t.buffered}),this.dispatch("progress",{buffered:t.buffered});break;case"error":let n={code:((r=t.error)==null?void 0:r.code)??-1,message:((o=t.error)==null?void 0:o.message)??"Unknown error",fatal:!0,category:"media"};this.updateState({error:n}),this.dispatch("error",n);break;case"resize":t.videoWidth&&t.videoHeight&&(this.updateState({videoWidth:t.videoWidth,videoHeight:t.videoHeight}),this.dispatch("resize",{videoWidth:t.videoWidth,videoHeight:t.videoHeight}));break}}unloadSource(){this._eventCleanup.forEach(e=>e()),this._eventCleanup=[],this._mediaElement&&(this._mediaElement.remove(),this._mediaElement=null),this.updateState({...ra(),volume:this._state.volume,muted:this._state.muted,playbackRate:this._state.playbackRate}),this.dispatch("videoelementchange",{video:null}),this.dispatch("sourcechange",{source:null})}async play(){if(this._mediaElement){this.updateState({paused:!1}),this.dispatch("play",void 0);try{await this._mediaElement.play()}catch(e){throw this.updateState({paused:!0}),this.dispatch("pause",void 0),e}}}pause(){this._mediaElement&&(this.updateState({paused:!0,playing:!1}),this.dispatch("pause",void 0),this._mediaElement.pause())}seek(e){this._mediaElement&&(this._mediaElement.currentTime=e)}setVolume(e){let t=Math.max(0,Math.min(1,e));this.updateState({volume:t}),this._mediaElement&&(this._mediaElement.volume=t),this.dispatch("volumechange",{volume:t,muted:this._state.muted})}setMuted(e){this.updateState({muted:e}),this._mediaElement&&(this._mediaElement.muted=e),this.dispatch("volumechange",{volume:this._state.volume,muted:e})}setLoop(e){this.updateState({loop:e}),this._mediaElement&&(this._mediaElement.loop=e)}setPlaybackRate(e){this.updateState({playbackRate:e}),this._mediaElement&&(this._mediaElement.playbackRate=e),this.dispatch("ratechange",{playbackRate:e})}setTargetQuality(e){this.updateState({targetQuality:e}),this.dispatch("targetqualitychanged",{quality:e});let t=this._mediaElement;t!=null&&t.videoRenditions&&(t.videoRenditions.selectedIndex=(e==null?void 0:e.index)??-1)}setQuality(e){this.setTargetQuality(e)}setFullscreen(e){this.updateState({fullscreen:e,presentationMode:e?"fullscreen":"inline"}),this.dispatch("fullscreenchange",{fullscreen:e}),this.dispatch("presentationmodechange",{mode:e?"fullscreen":"inline"})}setPresentationMode(e){this.updateState({presentationMode:e,fullscreen:e==="fullscreen"}),this.dispatch("presentationmodechange",{mode:e})}destroy(){this._destroyed||(this._destroyed=!0,this.unloadSource(),this._bpLive&&(this._bpLive.destroy(),this._bpLive=null),this.dispatch("destroy",void 0),this._listeners.clear())}};function Dl(){return new na}var hr="bpPlayerObservedProperties";function Ol(i){return hr in i&&Array.isArray(i[hr])}function zm(i,e){class t extends i{get[hr](){return e}}return t}function Ym(i){if(i.shadowRoot)return Array.from(i.shadowRoot.children);if(i.localName==="slot"){let t=i.assignedNodes();if(t.length>0)return t.filter(r=>r.nodeType===Node.ELEMENT_NODE)}return Array.from(i.children)}async function pr(i,e,t){if(e!=null&&e.contains(i))return;i.nodeName.includes("-")&&!Ol(i)&&(await Promise.resolve(),await customElements.whenDefined(i.nodeName.toLowerCase()),customElements.upgrade(i)),Ol(i)&&t(i);let r=Ym(i);r.length>0&&await Promise.all(r.map(o=>pr(o,e,t)))}function aa(i,e,t){let r=i[hr];r.includes("player")&&(i.player=e),r.includes("paused")&&(i.paused=t.paused),r.includes("playing")&&(i.playing=t.playing),r.includes("ended")&&(i.ended=t.ended),r.includes("seeking")&&(i.seeking=t.seeking),r.includes("currentTime")&&(i.currentTime=t.currentTime),r.includes("duration")&&(i.duration=t.duration),r.includes("volume")&&(i.volume=t.volume),r.includes("muted")&&(i.muted=t.muted),r.includes("playbackRate")&&(i.playbackRate=t.playbackRate),r.includes("readyState")&&(i.readyState=t.readyState),r.includes("videoWidth")&&(i.videoWidth=t.videoWidth),r.includes("videoHeight")&&(i.videoHeight=t.videoHeight),r.includes("qualities")&&(i.qualities=t.qualities),r.includes("currentQuality")&&(i.currentQuality=t.currentQuality),r.includes("targetQuality")&&(i.targetQuality=t.targetQuality),r.includes("fullscreen")&&(i.fullscreen=t.fullscreen),r.includes("presentationMode")&&(i.presentationMode=t.presentationMode),r.includes("connectionState")&&(i.connectionState=t.connectionState),r.includes("streamType")&&(i.streamType=t.streamType),r.includes("error")&&(i.error=t.error)}function sa(i){i[hr].includes("player")&&(i.player=void 0)}var bu=`/**
8
8
  * BP Player CSS Custom Properties
9
9
  *
10
10
  * All styling can be customized by overriding these CSS variables.
@@ -134,7 +134,7 @@ html.bp-player-full-window > body {
134
134
  padding: 0 !important;
135
135
  }
136
136
  `;var yu=!1;function Bo(){if(yu)return;let i=document.createElement("style");i.id="bp-player-global-styles",i.textContent=bu+`
137
- `+_u,document.head.appendChild(i),yu=!0}function jm(i,e){let t;return()=>(t||(t=document.createElement("template"),t.innerHTML=e),t)}function ev(i,e){return`<style>${i}</style>${e}`}var la=(L=>(L.CONFIGURATION="configuration",L.SOURCE="source",L.SOURCES="sources",L.AUTOPLAY="autoplay",L.MUTED="muted",L.LOOP="loop",L.POSTER="poster",L.SCALING="scaling",L.ASPECT_RATIO="aspect-ratio",L.DEBUG="debug",L.AUTOHIDE="autohide",L.HOTKEYS="hotkeys",L.PAUSED="paused",L.PLAYING="playing",L.ENDED="ended",L.SEEKING="seeking",L.WAITING="waiting",L.LOADING="loading",L.READY="ready",L.HAS_ERROR="has-error",L.HAS_FIRST_PLAY="has-first-play",L.FULLSCREEN="fullscreen",L.FULLWINDOW="fullwindow",L.DEVICE_TYPE="device-type",L.MOBILE="mobile",L.TV="tv",L.STREAM_TYPE="stream-type",L.LIVE="live",L.CONTENT_TYPE="content-type",L.USER_IDLE="user-idle",L.USER_IDLE_TIMEOUT="user-idle-timeout",L.MOBILE_ONLY="mobile-only",L.MOBILE_HIDDEN="mobile-hidden",L.TV_ONLY="tv-only",L.TV_HIDDEN="tv-hidden",L.LIVE_ONLY="live-only",L.LIVE_HIDDEN="live-hidden",L.VOD_HIDDEN="vod-hidden",L.CLIP_HIDDEN="clip-hidden",L.NO_AUTO_HIDE="no-auto-hide",L.DISABLED="disabled",L.HIDDEN="hidden",L.NOTOOLTIP="notooltip",L.MENU="menu",L.MENU_OPENED="menu-opened",L.ARIA_LABEL="aria-label",L.ARIA_LIVE="aria-live",L.ARIA_CHECKED="aria-checked",L.VOLUME_LEVEL="volume-level",L.PROVIDER_TYPE="provider-type",L))(la||{});function Ce(i,e,t){return t!==void 0?t?(i.setAttribute(e,""),!0):(i.removeAttribute(e),!1):i.hasAttribute(e)?(i.removeAttribute(e),!1):(i.setAttribute(e,""),!0)}var Tu=`/**
137
+ `+_u,document.head.appendChild(i),yu=!0}function Xm(i,e){let t;return()=>(t||(t=document.createElement("template"),t.innerHTML=e),t)}function Jm(i,e){return`<style>${i}</style>${e}`}var la=(L=>(L.CONFIGURATION="configuration",L.SOURCE="source",L.SOURCES="sources",L.AUTOPLAY="autoplay",L.MUTED="muted",L.LOOP="loop",L.POSTER="poster",L.SCALING="scaling",L.ASPECT_RATIO="aspect-ratio",L.DEBUG="debug",L.AUTOHIDE="autohide",L.HOTKEYS="hotkeys",L.PAUSED="paused",L.PLAYING="playing",L.ENDED="ended",L.SEEKING="seeking",L.WAITING="waiting",L.LOADING="loading",L.READY="ready",L.HAS_ERROR="has-error",L.HAS_FIRST_PLAY="has-first-play",L.FULLSCREEN="fullscreen",L.FULLWINDOW="fullwindow",L.DEVICE_TYPE="device-type",L.MOBILE="mobile",L.TV="tv",L.STREAM_TYPE="stream-type",L.LIVE="live",L.CONTENT_TYPE="content-type",L.USER_IDLE="user-idle",L.USER_IDLE_TIMEOUT="user-idle-timeout",L.MOBILE_ONLY="mobile-only",L.MOBILE_HIDDEN="mobile-hidden",L.TV_ONLY="tv-only",L.TV_HIDDEN="tv-hidden",L.LIVE_ONLY="live-only",L.LIVE_HIDDEN="live-hidden",L.VOD_HIDDEN="vod-hidden",L.CLIP_HIDDEN="clip-hidden",L.NO_AUTO_HIDE="no-auto-hide",L.DISABLED="disabled",L.HIDDEN="hidden",L.NOTOOLTIP="notooltip",L.MENU="menu",L.MENU_OPENED="menu-opened",L.ARIA_LABEL="aria-label",L.ARIA_LIVE="aria-live",L.ARIA_CHECKED="aria-checked",L.VOLUME_LEVEL="volume-level",L.PROVIDER_TYPE="provider-type",L))(la||{});function Ie(i,e,t){return t!==void 0?t?(i.setAttribute(e,""),!0):(i.removeAttribute(e),!1):i.hasAttribute(e)?(i.removeAttribute(e),!1):(i.setAttribute(e,""),!0)}var Tu=`/**
138
138
  * BP Player Styles
139
139
  *
140
140
  * Core player component styles using CSS custom properties.
@@ -247,21 +247,21 @@ bp-player[waiting] {
247
247
  bp-player[has-error] {
248
248
  /* Styles when player has an error */
249
249
  }
250
- `;var Au={fromAttribute:i=>{if(i)try{return JSON.parse(i)}catch{console.warn("[bp-player] Failed to parse JSON attribute:",i);return}},toAttribute:i=>i==null?null:JSON.stringify(i)},Su=!1;function iv(){if(Su)return;Bo();let i=document.createElement("style");i.id="bp-player-styles",i.textContent=Tu,document.head.appendChild(i),Su=!0}var rv=["play","playing","pause","waiting","seeking","seeked","timeupdate","durationchange","volumechange","ratechange","ended","loadedmetadata","loadeddata","canplay","canplaythrough","progress","error","resize"],Ul=class extends EventTarget{constructor(t){super();this._renditions=[];this._cleanup=[];this._player=t}get length(){return this._renditions.length}[Symbol.iterator](){return this._renditions[Symbol.iterator]()}get selectedIndex(){var r;let t=(r=this._player.player)==null?void 0:r.state.targetQuality;return t?this._renditions.findIndex(o=>o.id===String(t.index)):-1}set selectedIndex(t){var r,o,n;if(t<0)(r=this._player.player)==null||r.setQuality(null);else{let l=(((o=this._player.player)==null?void 0:o.state.qualities)??[])[t];l&&((n=this._player.player)==null||n.setQuality(l))}this._updateSelection(),this.dispatchEvent(new Event("change"))}_updateSelection(){let t=this.selectedIndex;this._renditions.forEach((r,o)=>{r.selected=o===t})}_syncFromPlayer(){var o,n;let t=((o=this._player.player)==null?void 0:o.state.qualities)??[];if(t.length===0){let a=(n=this._player.player)==null?void 0:n.videoElement;a!=null&&a.videoRenditions&&(t=[...a.videoRenditions].map((l,c)=>({index:c,width:l.width??0,height:l.height??0,bitrate:l.bitrate??0})))}let r=this._renditions.length;for(let a=0;a<r;a++)delete this[a];this._renditions=t.map((a,l)=>({id:String(a.index),width:a.width,height:a.height,bitrate:a.bitrate,selected:!1})),this._renditions.forEach((a,l)=>{this[l]=a}),this._updateSelection();for(let a of this._renditions)this.dispatchEvent(new CustomEvent("addrendition",{detail:a}))}_setupListeners(){let t=this._player.player;if(!t)return;let r=()=>{this._syncFromPlayer()},o=()=>{this._updateSelection(),this.dispatchEvent(new Event("change"))};t.addEventListener("qualitieschange",r),t.addEventListener("qualitychange",o),t.addEventListener("targetqualitychanged",o),this._cleanup.push(()=>{t.removeEventListener("qualitieschange",r),t.removeEventListener("qualitychange",o),t.removeEventListener("targetqualitychanged",o)});let n=t.videoElement;n!=null&&n.videoRenditions&&(n.videoRenditions.addEventListener("addrendition",r),n.videoRenditions.addEventListener("removerendition",r),this._cleanup.push(()=>{var a,l;(a=n.videoRenditions)==null||a.removeEventListener("addrendition",r),(l=n.videoRenditions)==null||l.removeEventListener("removerendition",r)})),this._syncFromPlayer()}_destroy(){this._cleanup.forEach(t=>t()),this._cleanup=[],this._renditions=[]}},Ee=class extends Le{constructor(){super(...arguments);this.autoplay=!1;this.defaultMuted=!1;this.loop=!1;this.scaling="letterbox";this.debug=!1;this._playerCore=null;this._ready=!1;this._resolvedPoster=null;this.containerRef=null;this.providerContainer=null;this.eventCleanup=[];this.stateReceivers=[];this._mutationObserver=null;this._videoRenditions=new Ul(this);this.handleMutation=t=>{for(let r of t)if(r.type==="childList"){for(let o of r.addedNodes)o.nodeType===Node.ELEMENT_NODE&&pr(o,this.providerContainer,this.registerStateReceiver);for(let o of r.removedNodes)o.nodeType===Node.ELEMENT_NODE&&pr(o,this.providerContainer,this.unregisterStateReceiver)}};this.registerStateReceiver=t=>{this.stateReceivers.includes(t)||(this.stateReceivers.push(t),this._playerCore&&aa(t,this._playerCore,this._playerCore.state))};this.unregisterStateReceiver=t=>{let r=this.stateReceivers.indexOf(t);r>=0&&(this.stateReceivers.splice(r,1),sa(t))}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),iv(),this._mutationObserver=new MutationObserver(this.handleMutation),this._mutationObserver.observe(this,{childList:!0,subtree:!0})}get player(){return this._playerCore}get playerState(){var t;return((t=this._playerCore)==null?void 0:t.state)??null}get bpLive(){var t;return((t=this._playerCore)==null?void 0:t.bpLive)??null}async play(){var t;this.debug&&console.log("[BPPlayer] play() called"),await((t=this._playerCore)==null?void 0:t.play())}pause(){var t;this.debug&&console.log("[BPPlayer] pause() called"),(t=this._playerCore)==null||t.pause()}get paused(){var r;let t=((r=this._playerCore)==null?void 0:r.state.paused)??!0;return this.debug&&console.log("[BPPlayer] paused getter:",t),t}get ended(){var t;return((t=this._playerCore)==null?void 0:t.state.ended)??!1}get seeking(){var t;return((t=this._playerCore)==null?void 0:t.state.seeking)??!1}get waiting(){var t;return((t=this._playerCore)==null?void 0:t.state.waiting)??!1}get currentTime(){var t;return((t=this._playerCore)==null?void 0:t.state.currentTime)??0}set currentTime(t){var r;(r=this._playerCore)==null||r.seek(t)}get duration(){var t;return((t=this._playerCore)==null?void 0:t.state.duration)??NaN}get volume(){var t;return((t=this._playerCore)==null?void 0:t.state.volume)??1}set volume(t){var r;(r=this._playerCore)==null||r.setVolume(t)}get muted(){var t;return((t=this._playerCore)==null?void 0:t.state.muted)??this.defaultMuted}set muted(t){var r;(r=this._playerCore)==null||r.setMuted(t),this.defaultMuted=t}get playbackRate(){var t;return((t=this._playerCore)==null?void 0:t.state.playbackRate)??1}set playbackRate(t){var r;(r=this._playerCore)==null||r.setPlaybackRate(t)}get readyState(){var t;return((t=this._playerCore)==null?void 0:t.state.readyState)??0}get buffered(){var r;let t=(r=this._playerCore)==null?void 0:r.state.buffered;return t||{length:0,start:()=>0,end:()=>0}}get videoWidth(){var o,n,a;let t=(o=this._playerCore)==null?void 0:o.videoElement;if(t!=null&&t.videoWidth)return t.videoWidth;let r=(n=this._playerCore)==null?void 0:n.state.currentQuality;return r!=null&&r.width?r.width:((a=this._playerCore)==null?void 0:a.state.videoWidth)??0}get videoHeight(){var o,n,a;let t=(o=this._playerCore)==null?void 0:o.videoElement;if(t!=null&&t.videoHeight)return t.videoHeight;let r=(n=this._playerCore)==null?void 0:n.state.currentQuality;return r!=null&&r.height?r.height:((a=this._playerCore)==null?void 0:a.state.videoHeight)??0}get videoElement(){var t;return((t=this._playerCore)==null?void 0:t.videoElement)??null}get providerType(){var t;return((t=this._playerCore)==null?void 0:t.state.providerType)??null}get videoRenditions(){return this._videoRenditions}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._mutationObserver)==null||t.disconnect(),this.destroyPlayer()}firstUpdated(t){super.firstUpdated(t),this.containerRef=this.renderRoot.querySelector(".bp-player-container"),this.containerRef&&!this.providerContainer&&(this.providerContainer=document.createElement("div"),this.providerContainer.className="bp-player-provider",this.providerContainer.style.cssText="width: 100%; height: 100%; position: absolute; top: 0; left: 0;",this.containerRef.appendChild(this.providerContainer));let{playableSource:r}=this.resolveSourcesArray();r&&!this._ready&&this.initPlayer()}updated(t){if(super.updated(t),t.has("source")){let{playableSource:r,posterUrl:o}=this.resolveSourcesArray();this._resolvedPoster=o,r&&this._ready&&this.loadPlayableSource(r)}t.has("defaultMuted")&&this._playerCore&&this._playerCore.setMuted(this.defaultMuted),t.has("loop")&&this._playerCore&&this._playerCore.setLoop(this.loop)}resolveSourcesArray(){var n,a;let t=(n=this.source)==null?void 0:n.sources;if(!t||t.length===0)return{playableSource:null,posterUrl:null};let r=t[0]??null,o=((a=this.source)==null?void 0:a.poster)??null;return{playableSource:r,posterUrl:o}}propagateStateToAllReceivers(){if(!this._playerCore)return;let t=this._playerCore.state;for(let r of this.stateReceivers)aa(r,this._playerCore,t)}setupEventForwarding(){if(!this._playerCore)return;for(let l of rv){let c=()=>{var p;this.debug&&!["durationchange","timeupdate"].includes(l)&&console.log(`[BPPlayer] Forwarding event: ${l}`,(p=this._playerCore)==null?void 0:p.state),this.dispatchEvent(new Event(l,{bubbles:!0,composed:!0}))};this._playerCore.addEventListener(l,c),this.eventCleanup.push(()=>{var p;return(p=this._playerCore)==null?void 0:p.removeEventListener(l,c)})}let t=l=>{l.videoWidth&&l.videoHeight&&this.setAspectRatioVariable(`${l.videoWidth} / ${l.videoHeight}`)},{videoWidth:r,videoHeight:o}=this._playerCore.state;r&&o&&this.setAspectRatioVariable(`${r} / ${o}`),this._playerCore.addEventListener("loadedmetadata",t),this.eventCleanup.push(()=>{var l;return(l=this._playerCore)==null?void 0:l.removeEventListener("loadedmetadata",t)});let n=()=>{this.dispatchEvent(new Event("resize",{bubbles:!0,composed:!0}))};this._playerCore.addEventListener("qualitychange",n),this.eventCleanup.push(()=>{var l;return(l=this._playerCore)==null?void 0:l.removeEventListener("qualitychange",n)});let a=()=>{this.propagateStateToAllReceivers(),this.updateStateAttributes()};this._playerCore.addEventListener("statechange",a),this.eventCleanup.push(()=>{var l;return(l=this._playerCore)==null?void 0:l.removeEventListener("statechange",a)})}updateStateAttributes(){if(!this._playerCore)return;let t=this._playerCore.state;Ce(this,"paused",t.paused),Ce(this,"playing",t.playing),Ce(this,"ended",t.ended),Ce(this,"seeking",t.seeking),Ce(this,"waiting",t.waiting),Ce(this,"has-error",t.error!==null),Ce(this,"ready",this._ready),this.setAttribute("stream-type",t.streamType),this.setAttribute("content-type",t.contentType),t.providerType&&this.setAttribute("provider-type",t.providerType)}async initPlayer(){var o,n,a;let{playableSource:t,posterUrl:r}=this.resolveSourcesArray();if(!(!t||!this.providerContainer||this._ready)){this._resolvedPoster=r;try{this._playerCore=Dl(),this.defaultMuted&&this._playerCore.setMuted(!0),this.loop&&this._playerCore.setLoop(!0),this.setupEventForwarding();let l=await this._playerCore.loadSource(t,this.providerContainer,this.config);if(!this._playerCore)return;if(!this._resolvedPoster&&(l!=null&&l.poster)&&(this._resolvedPoster=l.poster),this._ready=!0,pr(this,this.providerContainer,this.registerStateReceiver),this.propagateStateToAllReceivers(),this.autoplay)try{await this._playerCore.play()}catch{}this._videoRenditions._setupListeners(),this.dispatchEvent(new CustomEvent("ready",{detail:this._playerCore,bubbles:!0,composed:!0})),(n=(o=this._playerCore)==null?void 0:o.state)!=null&&n.paused&&this.dispatchEvent(new Event("pause",{bubbles:!0,composed:!0})),this.debug&&console.log("[BPPlayer] Player ready",(a=this._playerCore)==null?void 0:a.state)}catch(l){console.error("[BPPlayer] Failed to initialize player:",l)}}}async loadPlayableSource(t){if(!this._playerCore||!this.providerContainer){this.debug&&console.log("[BPPlayer] loadPlayableSource skipped:",{playerCore:!!this._playerCore,providerContainer:!!this.providerContainer});return}this.debug&&console.log("[BPPlayer] loadPlayableSource:",t);try{let r=await this._playerCore.loadSource(t,this.providerContainer,this.config);if(!this._playerCore){this.debug&&console.log("[BPPlayer] Player was destroyed during source load");return}if(!this._resolvedPoster&&(r!=null&&r.poster)&&(this._resolvedPoster=r.poster),r!=null&&r.aspectRatio&&(this.setAspectRatioVariable(r.aspectRatio),this.debug&&console.log("[BPPlayer] BPLive aspect ratio:",r.aspectRatio)),this.autoplay)try{await this._playerCore.play()}catch{}}catch(r){console.error("[BPPlayer] Failed to load source:",r)}}destroyPlayer(){this.eventCleanup.forEach(t=>t()),this.eventCleanup=[],this._videoRenditions._destroy();for(let t of this.stateReceivers)sa(t);if(this.stateReceivers=[],this._playerCore&&(this._playerCore.destroy(),this._playerCore=null),this.providerContainer)for(;this.providerContainer.firstChild;)this.providerContainer.removeChild(this.providerContainer.firstChild);this._ready=!1}setAspectRatioVariable(t){getComputedStyle(this).getPropertyValue("--bp-aspect-ratio").trim()||(this.style.setProperty("--bp-aspect-ratio",t),this.debug&&console.log("[BPPlayer] Set --bp-aspect-ratio:",t))}getContainerClasses(){return["bp-player-container",`bp-player-container--${this.scaling}`].join(" ")}getPosterClasses(){let t=["bp-player-poster"];return this.scaling==="crop"&&t.push("bp-player-poster--crop"),this.scaling==="fill"&&t.push("bp-player-poster--fill"),t.join(" ")}getContainerStyle(){return this.aspectRatio?`aspect-ratio: ${this.aspectRatio}`:""}getPoster(){return this._resolvedPoster??this.poster??null}render(){let t=this.getPoster();return Ne`
250
+ `;var Au=!1;function ev(){if(Au)return;Bo();let i=document.createElement("style");i.id="bp-player-styles",i.textContent=Tu,document.head.appendChild(i),Au=!0}var tv=["play","playing","pause","waiting","seeking","seeked","timeupdate","durationchange","volumechange","ratechange","ended","loadedmetadata","loadeddata","canplay","canplaythrough","progress","error","resize"],Ul=class extends EventTarget{constructor(t){super();this._renditions=[];this._cleanup=[];this._player=t}get length(){return this._renditions.length}[Symbol.iterator](){return this._renditions[Symbol.iterator]()}get selectedIndex(){var r;let t=(r=this._player.player)==null?void 0:r.state.targetQuality;return t?this._renditions.findIndex(o=>o.id===String(t.index)):-1}set selectedIndex(t){var r,o,n;if(t<0)(r=this._player.player)==null||r.setQuality(null);else{let l=(((o=this._player.player)==null?void 0:o.state.qualities)??[])[t];l&&((n=this._player.player)==null||n.setQuality(l))}this._updateSelection(),this.dispatchEvent(new Event("change"))}_updateSelection(){let t=this.selectedIndex;this._renditions.forEach((r,o)=>{r.selected=o===t})}_syncFromPlayer(){var o,n;let t=((o=this._player.player)==null?void 0:o.state.qualities)??[];if(t.length===0){let a=(n=this._player.player)==null?void 0:n.videoElement;a!=null&&a.videoRenditions&&(t=[...a.videoRenditions].map((l,c)=>({index:c,width:l.width??0,height:l.height??0,bitrate:l.bitrate??0})))}let r=this._renditions.length;for(let a=0;a<r;a++)delete this[a];this._renditions=t.map((a,l)=>({id:String(a.index),width:a.width,height:a.height,bitrate:a.bitrate,selected:!1})),this._renditions.forEach((a,l)=>{this[l]=a}),this._updateSelection();for(let a of this._renditions)this.dispatchEvent(new CustomEvent("addrendition",{detail:a}))}_setupListeners(){let t=this._player.player;if(!t)return;let r=()=>{this._syncFromPlayer()},o=()=>{this._updateSelection(),this.dispatchEvent(new Event("change"))};t.addEventListener("qualitieschange",r),t.addEventListener("qualitychange",o),t.addEventListener("targetqualitychanged",o),this._cleanup.push(()=>{t.removeEventListener("qualitieschange",r),t.removeEventListener("qualitychange",o),t.removeEventListener("targetqualitychanged",o)});let n=t.videoElement;n!=null&&n.videoRenditions&&(n.videoRenditions.addEventListener("addrendition",r),n.videoRenditions.addEventListener("removerendition",r),this._cleanup.push(()=>{var a,l;(a=n.videoRenditions)==null||a.removeEventListener("addrendition",r),(l=n.videoRenditions)==null||l.removeEventListener("removerendition",r)})),this._syncFromPlayer()}_destroy(){this._cleanup.forEach(t=>t()),this._cleanup=[],this._renditions=[]}},Ee=class extends Le{constructor(){super(...arguments);this.autoplay=!1;this.defaultMuted=!1;this.loop=!1;this.scaling="letterbox";this.debug=!1;this._playerCore=null;this._ready=!1;this._resolvedPoster=null;this.containerRef=null;this.providerContainer=null;this.eventCleanup=[];this.stateReceivers=[];this._mutationObserver=null;this._videoRenditions=new Ul(this);this.handleMutation=t=>{for(let r of t)if(r.type==="childList"){for(let o of r.addedNodes)o.nodeType===Node.ELEMENT_NODE&&pr(o,this.providerContainer,this.registerStateReceiver);for(let o of r.removedNodes)o.nodeType===Node.ELEMENT_NODE&&pr(o,this.providerContainer,this.unregisterStateReceiver)}};this.registerStateReceiver=t=>{this.stateReceivers.includes(t)||(this.stateReceivers.push(t),this._playerCore&&aa(t,this._playerCore,this._playerCore.state))};this.unregisterStateReceiver=t=>{let r=this.stateReceivers.indexOf(t);r>=0&&(this.stateReceivers.splice(r,1),sa(t))}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),ev(),this._mutationObserver=new MutationObserver(this.handleMutation),this._mutationObserver.observe(this,{childList:!0,subtree:!0})}get player(){return this._playerCore}get playerState(){var t;return((t=this._playerCore)==null?void 0:t.state)??null}get bpLive(){var t;return((t=this._playerCore)==null?void 0:t.bpLive)??null}async play(){var t;this.debug&&console.log("[BPPlayer] play() called"),await((t=this._playerCore)==null?void 0:t.play())}pause(){var t;this.debug&&console.log("[BPPlayer] pause() called"),(t=this._playerCore)==null||t.pause()}get paused(){var r;let t=((r=this._playerCore)==null?void 0:r.state.paused)??!0;return this.debug&&console.log("[BPPlayer] paused getter:",t),t}get ended(){var t;return((t=this._playerCore)==null?void 0:t.state.ended)??!1}get seeking(){var t;return((t=this._playerCore)==null?void 0:t.state.seeking)??!1}get waiting(){var t;return((t=this._playerCore)==null?void 0:t.state.waiting)??!1}get currentTime(){var t;return((t=this._playerCore)==null?void 0:t.state.currentTime)??0}set currentTime(t){var r;(r=this._playerCore)==null||r.seek(t)}get duration(){var t;return((t=this._playerCore)==null?void 0:t.state.duration)??NaN}get volume(){var t;return((t=this._playerCore)==null?void 0:t.state.volume)??1}set volume(t){var r;(r=this._playerCore)==null||r.setVolume(t)}get muted(){var t;return((t=this._playerCore)==null?void 0:t.state.muted)??this.defaultMuted}set muted(t){var r;(r=this._playerCore)==null||r.setMuted(t),this.defaultMuted=t}get playbackRate(){var t;return((t=this._playerCore)==null?void 0:t.state.playbackRate)??1}set playbackRate(t){var r;(r=this._playerCore)==null||r.setPlaybackRate(t)}get readyState(){var t;return((t=this._playerCore)==null?void 0:t.state.readyState)??0}get buffered(){var r;let t=(r=this._playerCore)==null?void 0:r.state.buffered;return t||{length:0,start:()=>0,end:()=>0}}get videoWidth(){var o,n,a;let t=(o=this._playerCore)==null?void 0:o.videoElement;if(t!=null&&t.videoWidth)return t.videoWidth;let r=(n=this._playerCore)==null?void 0:n.state.currentQuality;return r!=null&&r.width?r.width:((a=this._playerCore)==null?void 0:a.state.videoWidth)??0}get videoHeight(){var o,n,a;let t=(o=this._playerCore)==null?void 0:o.videoElement;if(t!=null&&t.videoHeight)return t.videoHeight;let r=(n=this._playerCore)==null?void 0:n.state.currentQuality;return r!=null&&r.height?r.height:((a=this._playerCore)==null?void 0:a.state.videoHeight)??0}get videoElement(){var t;return((t=this._playerCore)==null?void 0:t.videoElement)??null}get providerType(){var t;return((t=this._playerCore)==null?void 0:t.state.providerType)??null}get videoRenditions(){return this._videoRenditions}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._mutationObserver)==null||t.disconnect(),this.destroyPlayer()}firstUpdated(t){super.firstUpdated(t),this.containerRef=this.renderRoot.querySelector(".bp-player-container"),this.containerRef&&!this.providerContainer&&(this.providerContainer=document.createElement("div"),this.providerContainer.className="bp-player-provider",this.providerContainer.style.cssText="width: 100%; height: 100%; position: absolute; top: 0; left: 0;",this.containerRef.appendChild(this.providerContainer));let{playableSource:r}=this.resolveSourcesArray();r&&!this._ready&&this.initPlayer()}updated(t){if(super.updated(t),t.has("sources")){let{playableSource:r,posterUrl:o}=this.resolveSourcesArray();this._resolvedPoster=o,r&&this._ready&&this.loadPlayableSource(r)}t.has("defaultMuted")&&this._playerCore&&this._playerCore.setMuted(this.defaultMuted),t.has("loop")&&this._playerCore&&this._playerCore.setLoop(this.loop)}resolveSourcesArray(){if(!this.sources||this.sources.length===0)return{playableSource:null,posterUrl:null};let t=this.sources.find(o=>o.type==="poster");return{playableSource:this.sources.find(o=>o.type!=="poster")??null,posterUrl:(t==null?void 0:t.url)??null}}propagateStateToAllReceivers(){if(!this._playerCore)return;let t=this._playerCore.state;for(let r of this.stateReceivers)aa(r,this._playerCore,t)}setupEventForwarding(){if(!this._playerCore)return;for(let l of tv){let c=()=>{var p;this.debug&&!["durationchange","timeupdate"].includes(l)&&console.log(`[BPPlayer] Forwarding event: ${l}`,(p=this._playerCore)==null?void 0:p.state),this.dispatchEvent(new Event(l,{bubbles:!0,composed:!0}))};this._playerCore.addEventListener(l,c),this.eventCleanup.push(()=>{var p;return(p=this._playerCore)==null?void 0:p.removeEventListener(l,c)})}let t=l=>{l.videoWidth&&l.videoHeight&&this.setAspectRatioVariable(`${l.videoWidth} / ${l.videoHeight}`)},{videoWidth:r,videoHeight:o}=this._playerCore.state;r&&o&&this.setAspectRatioVariable(`${r} / ${o}`),this._playerCore.addEventListener("loadedmetadata",t),this.eventCleanup.push(()=>{var l;return(l=this._playerCore)==null?void 0:l.removeEventListener("loadedmetadata",t)});let n=()=>{this.dispatchEvent(new Event("resize",{bubbles:!0,composed:!0}))};this._playerCore.addEventListener("qualitychange",n),this.eventCleanup.push(()=>{var l;return(l=this._playerCore)==null?void 0:l.removeEventListener("qualitychange",n)});let a=()=>{this.propagateStateToAllReceivers(),this.updateStateAttributes()};this._playerCore.addEventListener("statechange",a),this.eventCleanup.push(()=>{var l;return(l=this._playerCore)==null?void 0:l.removeEventListener("statechange",a)})}updateStateAttributes(){if(!this._playerCore)return;let t=this._playerCore.state;Ie(this,"paused",t.paused),Ie(this,"playing",t.playing),Ie(this,"ended",t.ended),Ie(this,"seeking",t.seeking),Ie(this,"waiting",t.waiting),Ie(this,"has-error",t.error!==null),Ie(this,"ready",this._ready),this.setAttribute("stream-type",t.streamType),this.setAttribute("content-type",t.contentType),t.providerType&&this.setAttribute("provider-type",t.providerType)}async initPlayer(){var o,n,a;let{playableSource:t,posterUrl:r}=this.resolveSourcesArray();if(!(!t||!this.providerContainer||this._ready)){this._resolvedPoster=r;try{this._playerCore=Dl(),this.defaultMuted&&this._playerCore.setMuted(!0),this.loop&&this._playerCore.setLoop(!0),this.setupEventForwarding();let l=await this._playerCore.loadSource(t,this.providerContainer,this.config);if(!this._playerCore)return;if(!this._resolvedPoster&&(l!=null&&l.poster)&&(this._resolvedPoster=l.poster),this._ready=!0,pr(this,this.providerContainer,this.registerStateReceiver),this.propagateStateToAllReceivers(),this.autoplay)try{await this._playerCore.play()}catch{}this._videoRenditions._setupListeners(),this.dispatchEvent(new CustomEvent("ready",{detail:this._playerCore,bubbles:!0,composed:!0})),(n=(o=this._playerCore)==null?void 0:o.state)!=null&&n.paused&&this.dispatchEvent(new Event("pause",{bubbles:!0,composed:!0})),this.debug&&console.log("[BPPlayer] Player ready",(a=this._playerCore)==null?void 0:a.state)}catch(l){console.error("[BPPlayer] Failed to initialize player:",l)}}}async loadPlayableSource(t){if(!this._playerCore||!this.providerContainer){this.debug&&console.log("[BPPlayer] loadPlayableSource skipped:",{playerCore:!!this._playerCore,providerContainer:!!this.providerContainer});return}this.debug&&console.log("[BPPlayer] loadPlayableSource:",t);try{let r=await this._playerCore.loadSource(t,this.providerContainer,this.config);if(!this._playerCore){this.debug&&console.log("[BPPlayer] Player was destroyed during source load");return}if(!this._resolvedPoster&&(r!=null&&r.poster)&&(this._resolvedPoster=r.poster),r!=null&&r.aspectRatio&&(this.setAspectRatioVariable(r.aspectRatio),this.debug&&console.log("[BPPlayer] BPLive aspect ratio:",r.aspectRatio)),this.autoplay)try{await this._playerCore.play()}catch{}}catch(r){console.error("[BPPlayer] Failed to load source:",r)}}destroyPlayer(){this.eventCleanup.forEach(t=>t()),this.eventCleanup=[],this._videoRenditions._destroy();for(let t of this.stateReceivers)sa(t);if(this.stateReceivers=[],this._playerCore&&(this._playerCore.destroy(),this._playerCore=null),this.providerContainer)for(;this.providerContainer.firstChild;)this.providerContainer.removeChild(this.providerContainer.firstChild);this._ready=!1}setAspectRatioVariable(t){getComputedStyle(this).getPropertyValue("--bp-aspect-ratio").trim()||(this.style.setProperty("--bp-aspect-ratio",t),this.debug&&console.log("[BPPlayer] Set --bp-aspect-ratio:",t))}getContainerClasses(){return["bp-player-container",`bp-player-container--${this.scaling}`].join(" ")}getPosterClasses(){let t=["bp-player-poster"];return this.scaling==="crop"&&t.push("bp-player-poster--crop"),this.scaling==="fill"&&t.push("bp-player-poster--fill"),t.join(" ")}getContainerStyle(){return this.aspectRatio?`aspect-ratio: ${this.aspectRatio}`:""}getEffectivePoster(){return this._resolvedPoster??this.poster??null}render(){let t=this.getEffectivePoster();return Ne`
251
251
  <div
252
252
  class="${this.getContainerClasses()}"
253
253
  style="${this.getContainerStyle()}"
254
254
  >
255
255
  ${t&&!this._ready?Ne`<img class="${this.getPosterClasses()}" src="${t}" alt="" />`:null}
256
256
  </div>
257
- `}};x([V({converter:Au})],Ee.prototype,"source",2),x([V({type:Boolean})],Ee.prototype,"autoplay",2),x([V({type:Boolean,reflect:!0,attribute:"muted"})],Ee.prototype,"defaultMuted",2),x([V({type:Boolean})],Ee.prototype,"loop",2),x([V({type:String})],Ee.prototype,"poster",2),x([V({type:String})],Ee.prototype,"scaling",2),x([V({type:String,attribute:"aspect-ratio"})],Ee.prototype,"aspectRatio",2),x([V({converter:Au})],Ee.prototype,"config",2),x([V({type:Boolean})],Ee.prototype,"debug",2),x([we()],Ee.prototype,"_playerCore",2),x([we()],Ee.prototype,"_ready",2),x([we()],Ee.prototype,"_resolvedPoster",2),Ee=x([Kt("bp-player")],Ee);var b={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_LOOP_REQUEST:"medialooprequest",MEDIA_VOLUME_REQUEST:"mediavolumerequest",MEDIA_SEEK_REQUEST:"mediaseekrequest",MEDIA_AIRPLAY_REQUEST:"mediaairplayrequest",MEDIA_ENTER_FULLSCREEN_REQUEST:"mediaenterfullscreenrequest",MEDIA_EXIT_FULLSCREEN_REQUEST:"mediaexitfullscreenrequest",MEDIA_PREVIEW_REQUEST:"mediapreviewrequest",MEDIA_ENTER_PIP_REQUEST:"mediaenterpiprequest",MEDIA_EXIT_PIP_REQUEST:"mediaexitpiprequest",MEDIA_ENTER_CAST_REQUEST:"mediaentercastrequest",MEDIA_EXIT_CAST_REQUEST:"mediaexitcastrequest",MEDIA_SHOW_TEXT_TRACKS_REQUEST:"mediashowtexttracksrequest",MEDIA_HIDE_TEXT_TRACKS_REQUEST:"mediahidetexttracksrequest",MEDIA_SHOW_SUBTITLES_REQUEST:"mediashowsubtitlesrequest",MEDIA_DISABLE_SUBTITLES_REQUEST:"mediadisablesubtitlesrequest",MEDIA_TOGGLE_SUBTITLES_REQUEST:"mediatogglesubtitlesrequest",MEDIA_PLAYBACK_RATE_REQUEST:"mediaplaybackraterequest",MEDIA_RENDITION_REQUEST:"mediarenditionrequest",MEDIA_AUDIO_TRACK_REQUEST:"mediaaudiotrackrequest",MEDIA_SEEK_TO_LIVE_REQUEST:"mediaseektoliverequest",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},N={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},Nl={MEDIA_AIRPLAY_UNAVAILABLE:"mediaAirplayUnavailable",MEDIA_AUDIO_TRACK_ENABLED:"mediaAudioTrackEnabled",MEDIA_AUDIO_TRACK_LIST:"mediaAudioTrackList",MEDIA_AUDIO_TRACK_UNAVAILABLE:"mediaAudioTrackUnavailable",MEDIA_BUFFERED:"mediaBuffered",MEDIA_CAST_UNAVAILABLE:"mediaCastUnavailable",MEDIA_CHAPTERS_CUES:"mediaChaptersCues",MEDIA_CURRENT_TIME:"mediaCurrentTime",MEDIA_DURATION:"mediaDuration",MEDIA_ENDED:"mediaEnded",MEDIA_ERROR:"mediaError",MEDIA_ERROR_CODE:"mediaErrorCode",MEDIA_ERROR_MESSAGE:"mediaErrorMessage",MEDIA_FULLSCREEN_UNAVAILABLE:"mediaFullscreenUnavailable",MEDIA_HAS_PLAYED:"mediaHasPlayed",MEDIA_HEIGHT:"mediaHeight",MEDIA_IS_AIRPLAYING:"mediaIsAirplaying",MEDIA_IS_CASTING:"mediaIsCasting",MEDIA_IS_FULLSCREEN:"mediaIsFullscreen",MEDIA_IS_PIP:"mediaIsPip",MEDIA_LOADING:"mediaLoading",MEDIA_MUTED:"mediaMuted",MEDIA_LOOP:"mediaLoop",MEDIA_PAUSED:"mediaPaused",MEDIA_PIP_UNAVAILABLE:"mediaPipUnavailable",MEDIA_PLAYBACK_RATE:"mediaPlaybackRate",MEDIA_PREVIEW_CHAPTER:"mediaPreviewChapter",MEDIA_PREVIEW_COORDS:"mediaPreviewCoords",MEDIA_PREVIEW_IMAGE:"mediaPreviewImage",MEDIA_PREVIEW_TIME:"mediaPreviewTime",MEDIA_RENDITION_LIST:"mediaRenditionList",MEDIA_RENDITION_SELECTED:"mediaRenditionSelected",MEDIA_RENDITION_UNAVAILABLE:"mediaRenditionUnavailable",MEDIA_SEEKABLE:"mediaSeekable",MEDIA_STREAM_TYPE:"mediaStreamType",MEDIA_SUBTITLES_LIST:"mediaSubtitlesList",MEDIA_SUBTITLES_SHOWING:"mediaSubtitlesShowing",MEDIA_TARGET_LIVE_WINDOW:"mediaTargetLiveWindow",MEDIA_TIME_IS_LIVE:"mediaTimeIsLive",MEDIA_VOLUME:"mediaVolume",MEDIA_VOLUME_LEVEL:"mediaVolumeLevel",MEDIA_VOLUME_UNAVAILABLE:"mediaVolumeUnavailable",MEDIA_LANG:"mediaLang",MEDIA_WIDTH:"mediaWidth"},ku=Object.entries(Nl),s=ku.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{}),ov={USER_INACTIVE_CHANGE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},Li=ku.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{...ov}),i_=Object.entries(Li).reduce((i,[e,t])=>{let r=s[e];return r&&(i[t]=r),i},{userinactivechange:"userinactive"}),Lu=Object.entries(s).reduce((i,[e,t])=>{let r=Li[e];return r&&(i[t]=r),i},{userinactive:"userinactivechange"}),Ie={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},qt={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var da={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},Me={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},Ze={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var wu={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};function Cu(i){return i==null?void 0:i.map(av).join(" ")}function Iu(i){return i==null?void 0:i.split(/\s+/).map(sv)}function av(i){if(i){let{id:e,width:t,height:r}=i;return[e,t,r].filter(o=>o!=null).join(":")}}function sv(i){if(i){let[e,t,r]=i.split(":");return{id:e,width:+t,height:+r}}}function Mu(i){return i==null?void 0:i.map(lv).join(" ")}function Ru(i){return i==null?void 0:i.split(/\s+/).map(dv)}function lv(i){if(i){let{id:e,kind:t,language:r,label:o}=i;return[e,t,r,o].filter(n=>n!=null).join(":")}}function dv(i){if(i){let[e,t,r,o]=i.split(":");return{id:e,kind:t,language:r,label:o}}}function mr(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}var ca=i=>new Promise(e=>setTimeout(e,i));var xu=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],cv=(i,e)=>{let t=i===1?xu[e].singular:xu[e].plural;return`${i} ${t}`},wi=i=>{if(!mr(i))return"";let e=Math.abs(i),t=e!==i,r=new Date(0,0,0,0,0,e,0);return`${[r.getHours(),r.getMinutes(),r.getSeconds()].map((l,c)=>l&&cv(l,c)).filter(l=>l).join(", ")}${t?" remaining":""}`};function Xe(i,e){let t=!1;i<0&&(t=!0,i=0-i),i=i<0?0:i;let r=Math.floor(i%60),o=Math.floor(i/60%60),n=Math.floor(i/3600),a=Math.floor(e/60%60),l=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(n=o=r="0"),n=n>0||l>0?n+":":"",o=((n||a>=10)&&o<10?"0"+o:o)+":",r=r<10?"0"+r:r,(t?"-":"")+n+o+r}var n_=Object.freeze({length:0,start(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}});var Pu={"Start airplay":"Start airplay","Stop airplay":"Stop airplay",Audio:"Audio",Captions:"Captions","Enable captions":"Enable captions","Disable captions":"Disable captions","Start casting":"Start casting","Stop casting":"Stop casting","Enter fullscreen mode":"Enter fullscreen mode","Exit fullscreen mode":"Exit fullscreen mode",Mute:"Mute",Unmute:"Unmute",Loop:"Loop","Enter picture in picture mode":"Enter picture in picture mode","Exit picture in picture mode":"Exit picture in picture mode",Play:"Play",Pause:"Pause","Playback rate":"Playback rate","Playback rate {playbackRate}":"Playback rate {playbackRate}",Quality:"Quality","Seek backward":"Seek backward","Seek forward":"Seek forward",Settings:"Settings",Auto:"Auto","audio player":"audio player","video player":"video player",volume:"volume",seek:"seek","closed captions":"closed captions","current playback rate":"current playback rate","playback time":"playback time","media loading":"media loading",settings:"settings","audio tracks":"audio tracks",quality:"quality",play:"play",pause:"pause",mute:"mute",unmute:"unmute","chapter: {chapterName}":"chapter: {chapterName}",live:"live",Off:"Off","start airplay":"start airplay","stop airplay":"stop airplay","start casting":"start casting","stop casting":"stop casting","enter fullscreen mode":"enter fullscreen mode","exit fullscreen mode":"exit fullscreen mode","enter picture in picture mode":"enter picture in picture mode","exit picture in picture mode":"exit picture in picture mode","seek to live":"seek to live","playing live":"playing live","seek back {seekOffset} seconds":"seek back {seekOffset} seconds","seek forward {seekOffset} seconds":"seek forward {seekOffset} seconds","Network Error":"Network Error","Decode Error":"Decode Error","Source Not Supported":"Source Not Supported","Encryption Error":"Encryption Error","A network error caused the media download to fail.":"A network error caused the media download to fail.","A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.":"A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.","An unsupported error occurred. The server or network failed, or your browser does not support this format.":"An unsupported error occurred. The server or network failed, or your browser does not support this format.","The media is encrypted and there are no keys to decrypt it.":"The media is encrypted and there are no keys to decrypt it."};var Du,$l={en:Pu},Hl=((Du=globalThis.navigator)==null?void 0:Du.language)||"en",Ou=i=>{Hl=i};var hv=i=>{var e,t,r;let[o]=Hl.split("-");return((e=$l[Hl])==null?void 0:e[i])||((t=$l[o])==null?void 0:t[i])||((r=$l.en)==null?void 0:r[i])||i},E=(i,e={})=>hv(i).replace(/\{(\w+)\}/g,(t,r)=>r in e?String(e[r]):`{${r}}`);var ua=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},ha=class extends ua{},pa=class extends ha{constructor(){super(...arguments),this.role=null}},Bl=class{observe(){}unobserve(){}disconnect(){}},Uu={createElement:function(){return new Vo.HTMLElement},createElementNS:function(){return new Vo.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(i){return!1}},Vo={ResizeObserver:Bl,document:Uu,Node:ha,Element:pa,HTMLElement:class extends pa{constructor(){super(...arguments),this.innerHTML=""}get content(){return new Vo.DocumentFragment}},DocumentFragment:class extends ua{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},localStorage:{getItem(i){return null},setItem(i,e){},removeItem(i){}},CustomEvent:function(){},getComputedStyle:function(){},navigator:{languages:[],get userAgent(){return""}},matchMedia(i){return{matches:!1,media:i}},DOMParser:class{parseFromString(e,t){return{body:{textContent:e}}}}},Nu="global"in globalThis&&(globalThis==null?void 0:globalThis.global)===globalThis||typeof window>"u"||typeof window.customElements>"u",$u=Object.keys(Vo).every(i=>i in globalThis),d=Nu&&!$u?Vo:globalThis,ee=Nu&&!$u?Uu:globalThis.document;var Hu=new WeakMap,Vl=i=>{let e=Hu.get(i);return e||Hu.set(i,e=new Set),e},Bu=new d.ResizeObserver(i=>{for(let e of i)for(let t of Vl(e.target))t(e)});function Rt(i,e){Vl(i).add(e),Bu.observe(i)}function xt(i,e){let t=Vl(i);t.delete(e),t.size||Bu.unobserve(i)}function j(i){let e={};for(let t of i)e[t.name]=t.value;return e}function X(i){var e;return(e=ma(i))!=null?e:nt(i,"media-controller")}function ma(i){var e;let{MEDIA_CONTROLLER:t}=N,r=i.getAttribute(t);if(r)return(e=Ci(i))==null?void 0:e.getElementById(r)}var va=(i,e,t=".value")=>{let r=i.querySelector(t);r&&(r.textContent=e)},pv=(i,e)=>{let t=`slot[name="${e}"]`,r=i.shadowRoot.querySelector(t);return r?r.children:[]},fa=(i,e)=>pv(i,e)[0],Te=(i,e)=>!i||!e?!1:i!=null&&i.contains(e)?!0:Te(i,e.getRootNode().host),nt=(i,e)=>{if(!i)return null;let t=i.closest(e);return t||nt(i.getRootNode().host,e)};function Wo(i=document){var e;let t=i==null?void 0:i.activeElement;return t?(e=Wo(t.shadowRoot))!=null?e:t:null}function Ci(i){var e;let t=(e=i==null?void 0:i.getRootNode)==null?void 0:e.call(i);return t instanceof ShadowRoot||t instanceof Document?t:null}function ga(i,{depth:e=3,checkOpacity:t=!0,checkVisibilityCSS:r=!0}={}){if(i.checkVisibility)return i.checkVisibility({checkOpacity:t,checkVisibilityCSS:r});let o=i;for(;o&&e>0;){let n=getComputedStyle(o);if(t&&n.opacity==="0"||r&&n.visibility==="hidden"||n.display==="none")return!1;o=o.parentElement,e--}return!0}function Vu(i,e,t,r){let o=r.x-t.x,n=r.y-t.y,a=o*o+n*n;if(a===0)return 0;let l=((i-t.x)*o+(e-t.y)*n)/a;return Math.max(0,Math.min(1,l))}function J(i,e){let t=mv(i,r=>r===e);return t||Fo(i,e)}function mv(i,e){var t,r;let o;for(o of(t=i.querySelectorAll("style:not([media])"))!=null?t:[]){let n;try{n=(r=o.sheet)==null?void 0:r.cssRules}catch{continue}for(let a of n??[])if(e(a.selectorText))return a}}function Fo(i,e){var t,r;let o=(t=i.querySelectorAll("style:not([media])"))!=null?t:[],n=o==null?void 0:o[o.length-1];return n!=null&&n.sheet?(n==null||n.sheet.insertRule(`${e}{}`,n.sheet.cssRules.length),(r=n.sheet.cssRules)==null?void 0:r[n.sheet.cssRules.length-1]):(console.warn("Media Chrome: No style sheet found on style tag of",i),{style:{setProperty:()=>{},removeProperty:()=>"",getPropertyValue:()=>""}})}function $(i,e,t=Number.NaN){let r=i.getAttribute(e);return r!=null?+r:t}function B(i,e,t){let r=+t;if(t==null||Number.isNaN(r)){i.hasAttribute(e)&&i.removeAttribute(e);return}$(i,e,void 0)!==r&&i.setAttribute(e,`${r}`)}function w(i,e){return i.hasAttribute(e)}function C(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}w(i,e)!=t&&i.toggleAttribute(e,t)}function P(i,e,t=null){var r;return(r=i.getAttribute(e))!=null?r:t}function D(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}let r=`${t}`;P(i,e,void 0)!==r&&i.setAttribute(e,r)}var Wu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Gt=(i,e,t)=>(Wu(i,e,"read from private field"),t?t.call(i):e.get(i)),vv=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ea=(i,e,t,r)=>(Wu(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Re;function fv(i){return`
257
+ `}};x([V({type:Array})],Ee.prototype,"sources",2),x([V({type:Boolean})],Ee.prototype,"autoplay",2),x([V({type:Boolean,reflect:!0,attribute:"muted"})],Ee.prototype,"defaultMuted",2),x([V({type:Boolean})],Ee.prototype,"loop",2),x([V({type:String})],Ee.prototype,"poster",2),x([V({type:String})],Ee.prototype,"scaling",2),x([V({type:String,attribute:"aspect-ratio"})],Ee.prototype,"aspectRatio",2),x([V({type:Object})],Ee.prototype,"config",2),x([V({type:Boolean})],Ee.prototype,"debug",2),x([we()],Ee.prototype,"_playerCore",2),x([we()],Ee.prototype,"_ready",2),x([we()],Ee.prototype,"_resolvedPoster",2),Ee=x([Kt("bp-player")],Ee);var b={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_LOOP_REQUEST:"medialooprequest",MEDIA_VOLUME_REQUEST:"mediavolumerequest",MEDIA_SEEK_REQUEST:"mediaseekrequest",MEDIA_AIRPLAY_REQUEST:"mediaairplayrequest",MEDIA_ENTER_FULLSCREEN_REQUEST:"mediaenterfullscreenrequest",MEDIA_EXIT_FULLSCREEN_REQUEST:"mediaexitfullscreenrequest",MEDIA_PREVIEW_REQUEST:"mediapreviewrequest",MEDIA_ENTER_PIP_REQUEST:"mediaenterpiprequest",MEDIA_EXIT_PIP_REQUEST:"mediaexitpiprequest",MEDIA_ENTER_CAST_REQUEST:"mediaentercastrequest",MEDIA_EXIT_CAST_REQUEST:"mediaexitcastrequest",MEDIA_SHOW_TEXT_TRACKS_REQUEST:"mediashowtexttracksrequest",MEDIA_HIDE_TEXT_TRACKS_REQUEST:"mediahidetexttracksrequest",MEDIA_SHOW_SUBTITLES_REQUEST:"mediashowsubtitlesrequest",MEDIA_DISABLE_SUBTITLES_REQUEST:"mediadisablesubtitlesrequest",MEDIA_TOGGLE_SUBTITLES_REQUEST:"mediatogglesubtitlesrequest",MEDIA_PLAYBACK_RATE_REQUEST:"mediaplaybackraterequest",MEDIA_RENDITION_REQUEST:"mediarenditionrequest",MEDIA_AUDIO_TRACK_REQUEST:"mediaaudiotrackrequest",MEDIA_SEEK_TO_LIVE_REQUEST:"mediaseektoliverequest",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},N={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},Nl={MEDIA_AIRPLAY_UNAVAILABLE:"mediaAirplayUnavailable",MEDIA_AUDIO_TRACK_ENABLED:"mediaAudioTrackEnabled",MEDIA_AUDIO_TRACK_LIST:"mediaAudioTrackList",MEDIA_AUDIO_TRACK_UNAVAILABLE:"mediaAudioTrackUnavailable",MEDIA_BUFFERED:"mediaBuffered",MEDIA_CAST_UNAVAILABLE:"mediaCastUnavailable",MEDIA_CHAPTERS_CUES:"mediaChaptersCues",MEDIA_CURRENT_TIME:"mediaCurrentTime",MEDIA_DURATION:"mediaDuration",MEDIA_ENDED:"mediaEnded",MEDIA_ERROR:"mediaError",MEDIA_ERROR_CODE:"mediaErrorCode",MEDIA_ERROR_MESSAGE:"mediaErrorMessage",MEDIA_FULLSCREEN_UNAVAILABLE:"mediaFullscreenUnavailable",MEDIA_HAS_PLAYED:"mediaHasPlayed",MEDIA_HEIGHT:"mediaHeight",MEDIA_IS_AIRPLAYING:"mediaIsAirplaying",MEDIA_IS_CASTING:"mediaIsCasting",MEDIA_IS_FULLSCREEN:"mediaIsFullscreen",MEDIA_IS_PIP:"mediaIsPip",MEDIA_LOADING:"mediaLoading",MEDIA_MUTED:"mediaMuted",MEDIA_LOOP:"mediaLoop",MEDIA_PAUSED:"mediaPaused",MEDIA_PIP_UNAVAILABLE:"mediaPipUnavailable",MEDIA_PLAYBACK_RATE:"mediaPlaybackRate",MEDIA_PREVIEW_CHAPTER:"mediaPreviewChapter",MEDIA_PREVIEW_COORDS:"mediaPreviewCoords",MEDIA_PREVIEW_IMAGE:"mediaPreviewImage",MEDIA_PREVIEW_TIME:"mediaPreviewTime",MEDIA_RENDITION_LIST:"mediaRenditionList",MEDIA_RENDITION_SELECTED:"mediaRenditionSelected",MEDIA_RENDITION_UNAVAILABLE:"mediaRenditionUnavailable",MEDIA_SEEKABLE:"mediaSeekable",MEDIA_STREAM_TYPE:"mediaStreamType",MEDIA_SUBTITLES_LIST:"mediaSubtitlesList",MEDIA_SUBTITLES_SHOWING:"mediaSubtitlesShowing",MEDIA_TARGET_LIVE_WINDOW:"mediaTargetLiveWindow",MEDIA_TIME_IS_LIVE:"mediaTimeIsLive",MEDIA_VOLUME:"mediaVolume",MEDIA_VOLUME_LEVEL:"mediaVolumeLevel",MEDIA_VOLUME_UNAVAILABLE:"mediaVolumeUnavailable",MEDIA_LANG:"mediaLang",MEDIA_WIDTH:"mediaWidth"},Su=Object.entries(Nl),s=Su.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{}),iv={USER_INACTIVE_CHANGE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},Li=Su.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{...iv}),e_=Object.entries(Li).reduce((i,[e,t])=>{let r=s[e];return r&&(i[t]=r),i},{userinactivechange:"userinactive"}),ku=Object.entries(s).reduce((i,[e,t])=>{let r=Li[e];return r&&(i[t]=r),i},{userinactive:"userinactivechange"}),Ce={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},qt={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var da={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},Me={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},Ze={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var Lu={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};function wu(i){return i==null?void 0:i.map(ov).join(" ")}function Iu(i){return i==null?void 0:i.split(/\s+/).map(nv)}function ov(i){if(i){let{id:e,width:t,height:r}=i;return[e,t,r].filter(o=>o!=null).join(":")}}function nv(i){if(i){let[e,t,r]=i.split(":");return{id:e,width:+t,height:+r}}}function Cu(i){return i==null?void 0:i.map(av).join(" ")}function Mu(i){return i==null?void 0:i.split(/\s+/).map(sv)}function av(i){if(i){let{id:e,kind:t,language:r,label:o}=i;return[e,t,r,o].filter(n=>n!=null).join(":")}}function sv(i){if(i){let[e,t,r,o]=i.split(":");return{id:e,kind:t,language:r,label:o}}}function mr(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}var ca=i=>new Promise(e=>setTimeout(e,i));var Ru=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],lv=(i,e)=>{let t=i===1?Ru[e].singular:Ru[e].plural;return`${i} ${t}`},wi=i=>{if(!mr(i))return"";let e=Math.abs(i),t=e!==i,r=new Date(0,0,0,0,0,e,0);return`${[r.getHours(),r.getMinutes(),r.getSeconds()].map((l,c)=>l&&lv(l,c)).filter(l=>l).join(", ")}${t?" remaining":""}`};function Xe(i,e){let t=!1;i<0&&(t=!0,i=0-i),i=i<0?0:i;let r=Math.floor(i%60),o=Math.floor(i/60%60),n=Math.floor(i/3600),a=Math.floor(e/60%60),l=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(n=o=r="0"),n=n>0||l>0?n+":":"",o=((n||a>=10)&&o<10?"0"+o:o)+":",r=r<10?"0"+r:r,(t?"-":"")+n+o+r}var r_=Object.freeze({length:0,start(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}});var xu={"Start airplay":"Start airplay","Stop airplay":"Stop airplay",Audio:"Audio",Captions:"Captions","Enable captions":"Enable captions","Disable captions":"Disable captions","Start casting":"Start casting","Stop casting":"Stop casting","Enter fullscreen mode":"Enter fullscreen mode","Exit fullscreen mode":"Exit fullscreen mode",Mute:"Mute",Unmute:"Unmute",Loop:"Loop","Enter picture in picture mode":"Enter picture in picture mode","Exit picture in picture mode":"Exit picture in picture mode",Play:"Play",Pause:"Pause","Playback rate":"Playback rate","Playback rate {playbackRate}":"Playback rate {playbackRate}",Quality:"Quality","Seek backward":"Seek backward","Seek forward":"Seek forward",Settings:"Settings",Auto:"Auto","audio player":"audio player","video player":"video player",volume:"volume",seek:"seek","closed captions":"closed captions","current playback rate":"current playback rate","playback time":"playback time","media loading":"media loading",settings:"settings","audio tracks":"audio tracks",quality:"quality",play:"play",pause:"pause",mute:"mute",unmute:"unmute","chapter: {chapterName}":"chapter: {chapterName}",live:"live",Off:"Off","start airplay":"start airplay","stop airplay":"stop airplay","start casting":"start casting","stop casting":"stop casting","enter fullscreen mode":"enter fullscreen mode","exit fullscreen mode":"exit fullscreen mode","enter picture in picture mode":"enter picture in picture mode","exit picture in picture mode":"exit picture in picture mode","seek to live":"seek to live","playing live":"playing live","seek back {seekOffset} seconds":"seek back {seekOffset} seconds","seek forward {seekOffset} seconds":"seek forward {seekOffset} seconds","Network Error":"Network Error","Decode Error":"Decode Error","Source Not Supported":"Source Not Supported","Encryption Error":"Encryption Error","A network error caused the media download to fail.":"A network error caused the media download to fail.","A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.":"A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.","An unsupported error occurred. The server or network failed, or your browser does not support this format.":"An unsupported error occurred. The server or network failed, or your browser does not support this format.","The media is encrypted and there are no keys to decrypt it.":"The media is encrypted and there are no keys to decrypt it."};var Pu,$l={en:xu},Hl=((Pu=globalThis.navigator)==null?void 0:Pu.language)||"en",Du=i=>{Hl=i};var cv=i=>{var e,t,r;let[o]=Hl.split("-");return((e=$l[Hl])==null?void 0:e[i])||((t=$l[o])==null?void 0:t[i])||((r=$l.en)==null?void 0:r[i])||i},E=(i,e={})=>cv(i).replace(/\{(\w+)\}/g,(t,r)=>r in e?String(e[r]):`{${r}}`);var ua=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},ha=class extends ua{},pa=class extends ha{constructor(){super(...arguments),this.role=null}},Bl=class{observe(){}unobserve(){}disconnect(){}},Ou={createElement:function(){return new Vo.HTMLElement},createElementNS:function(){return new Vo.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(i){return!1}},Vo={ResizeObserver:Bl,document:Ou,Node:ha,Element:pa,HTMLElement:class extends pa{constructor(){super(...arguments),this.innerHTML=""}get content(){return new Vo.DocumentFragment}},DocumentFragment:class extends ua{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},localStorage:{getItem(i){return null},setItem(i,e){},removeItem(i){}},CustomEvent:function(){},getComputedStyle:function(){},navigator:{languages:[],get userAgent(){return""}},matchMedia(i){return{matches:!1,media:i}},DOMParser:class{parseFromString(e,t){return{body:{textContent:e}}}}},Uu="global"in globalThis&&(globalThis==null?void 0:globalThis.global)===globalThis||typeof window>"u"||typeof window.customElements>"u",Nu=Object.keys(Vo).every(i=>i in globalThis),d=Uu&&!Nu?Vo:globalThis,ee=Uu&&!Nu?Ou:globalThis.document;var $u=new WeakMap,Vl=i=>{let e=$u.get(i);return e||$u.set(i,e=new Set),e},Hu=new d.ResizeObserver(i=>{for(let e of i)for(let t of Vl(e.target))t(e)});function Rt(i,e){Vl(i).add(e),Hu.observe(i)}function xt(i,e){let t=Vl(i);t.delete(e),t.size||Hu.unobserve(i)}function j(i){let e={};for(let t of i)e[t.name]=t.value;return e}function X(i){var e;return(e=ma(i))!=null?e:nt(i,"media-controller")}function ma(i){var e;let{MEDIA_CONTROLLER:t}=N,r=i.getAttribute(t);if(r)return(e=Ii(i))==null?void 0:e.getElementById(r)}var va=(i,e,t=".value")=>{let r=i.querySelector(t);r&&(r.textContent=e)},uv=(i,e)=>{let t=`slot[name="${e}"]`,r=i.shadowRoot.querySelector(t);return r?r.children:[]},fa=(i,e)=>uv(i,e)[0],Te=(i,e)=>!i||!e?!1:i!=null&&i.contains(e)?!0:Te(i,e.getRootNode().host),nt=(i,e)=>{if(!i)return null;let t=i.closest(e);return t||nt(i.getRootNode().host,e)};function Wo(i=document){var e;let t=i==null?void 0:i.activeElement;return t?(e=Wo(t.shadowRoot))!=null?e:t:null}function Ii(i){var e;let t=(e=i==null?void 0:i.getRootNode)==null?void 0:e.call(i);return t instanceof ShadowRoot||t instanceof Document?t:null}function ga(i,{depth:e=3,checkOpacity:t=!0,checkVisibilityCSS:r=!0}={}){if(i.checkVisibility)return i.checkVisibility({checkOpacity:t,checkVisibilityCSS:r});let o=i;for(;o&&e>0;){let n=getComputedStyle(o);if(t&&n.opacity==="0"||r&&n.visibility==="hidden"||n.display==="none")return!1;o=o.parentElement,e--}return!0}function Bu(i,e,t,r){let o=r.x-t.x,n=r.y-t.y,a=o*o+n*n;if(a===0)return 0;let l=((i-t.x)*o+(e-t.y)*n)/a;return Math.max(0,Math.min(1,l))}function J(i,e){let t=hv(i,r=>r===e);return t||Fo(i,e)}function hv(i,e){var t,r;let o;for(o of(t=i.querySelectorAll("style:not([media])"))!=null?t:[]){let n;try{n=(r=o.sheet)==null?void 0:r.cssRules}catch{continue}for(let a of n??[])if(e(a.selectorText))return a}}function Fo(i,e){var t,r;let o=(t=i.querySelectorAll("style:not([media])"))!=null?t:[],n=o==null?void 0:o[o.length-1];return n!=null&&n.sheet?(n==null||n.sheet.insertRule(`${e}{}`,n.sheet.cssRules.length),(r=n.sheet.cssRules)==null?void 0:r[n.sheet.cssRules.length-1]):(console.warn("Media Chrome: No style sheet found on style tag of",i),{style:{setProperty:()=>{},removeProperty:()=>"",getPropertyValue:()=>""}})}function $(i,e,t=Number.NaN){let r=i.getAttribute(e);return r!=null?+r:t}function B(i,e,t){let r=+t;if(t==null||Number.isNaN(r)){i.hasAttribute(e)&&i.removeAttribute(e);return}$(i,e,void 0)!==r&&i.setAttribute(e,`${r}`)}function w(i,e){return i.hasAttribute(e)}function I(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}w(i,e)!=t&&i.toggleAttribute(e,t)}function P(i,e,t=null){var r;return(r=i.getAttribute(e))!=null?r:t}function D(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}let r=`${t}`;P(i,e,void 0)!==r&&i.setAttribute(e,r)}var Vu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Gt=(i,e,t)=>(Vu(i,e,"read from private field"),t?t.call(i):e.get(i)),pv=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ea=(i,e,t,r)=>(Vu(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Re;function mv(i){return`
258
258
  <style>
259
259
  :host {
260
260
  display: var(--media-control-display, var(--media-gesture-receiver-display, inline-block));
261
261
  box-sizing: border-box;
262
262
  }
263
263
  </style>
264
- `}var vr=class extends d.HTMLElement{constructor(){if(super(),vv(this,Re,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[N.MEDIA_CONTROLLER,s.MEDIA_PAUSED]}attributeChangedCallback(e,t,r){var o,n,a,l,c;e===N.MEDIA_CONTROLLER&&(t&&((n=(o=Gt(this,Re))==null?void 0:o.unassociateElement)==null||n.call(o,this),Ea(this,Re,null)),r&&this.isConnected&&(Ea(this,Re,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(c=(l=Gt(this,Re))==null?void 0:l.associateElement)==null||c.call(l,this)))}connectedCallback(){var e,t,r,o;this.tabIndex=-1,this.setAttribute("aria-hidden","true"),Ea(this,Re,gv(this)),this.getAttribute(N.MEDIA_CONTROLLER)&&((t=(e=Gt(this,Re))==null?void 0:e.associateElement)==null||t.call(e,this)),(r=Gt(this,Re))==null||r.addEventListener("pointerdown",this),(o=Gt(this,Re))==null||o.addEventListener("click",this)}disconnectedCallback(){var e,t,r,o;this.getAttribute(N.MEDIA_CONTROLLER)&&((t=(e=Gt(this,Re))==null?void 0:e.unassociateElement)==null||t.call(e,this)),(r=Gt(this,Re))==null||r.removeEventListener("pointerdown",this),(o=Gt(this,Re))==null||o.removeEventListener("click",this),Ea(this,Re,null)}handleEvent(e){var t;let r=(t=e.composedPath())==null?void 0:t[0];if(["video","media-controller"].includes(r==null?void 0:r.localName)){if(e.type==="pointerdown")this._pointerType=e.pointerType;else if(e.type==="click"){let{clientX:n,clientY:a}=e,{left:l,top:c,width:p,height:h}=this.getBoundingClientRect(),v=n-l,g=a-c;if(v<0||g<0||v>p||g>h||p===0&&h===0)return;let m=this._pointerType||"mouse";if(this._pointerType=void 0,m===da.TOUCH){this.handleTap(e);return}else if(m===da.MOUSE||m===da.PEN){this.handleMouseClick(e);return}}}}get mediaPaused(){return w(this,s.MEDIA_PAUSED)}set mediaPaused(e){C(this,s.MEDIA_PAUSED,e)}handleTap(e){}handleMouseClick(e){let t=this.mediaPaused?b.MEDIA_PLAY_REQUEST:b.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new d.CustomEvent(t,{composed:!0,bubbles:!0}))}};Re=new WeakMap;vr.shadowRootOptions={mode:"open"};vr.getTemplateHTML=fv;function gv(i){var e;let t=i.getAttribute(N.MEDIA_CONTROLLER);return t?(e=i.getRootNode())==null?void 0:e.getElementById(t):nt(i,"media-controller")}d.customElements.get("media-gesture-receiver")||d.customElements.define("media-gesture-receiver",vr);var ba=vr;var ql=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},He=(i,e,t)=>(ql(i,e,"read from private field"),t?t.call(i):e.get(i)),$e=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ii=(i,e,t,r)=>(ql(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Fe=(i,e,t)=>(ql(i,e,"access private method"),t),Ta,fr,qo,gr,_a,Wl,Fu,Ko,ya,Fl,Ku,Kl,qu,Go,Aa,Sa,Gl,Er,zo,M={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive",AUTOHIDE_OVER_CONTROLS:"autohideovercontrols"};function Ev(i){return`
264
+ `}var vr=class extends d.HTMLElement{constructor(){if(super(),pv(this,Re,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[N.MEDIA_CONTROLLER,s.MEDIA_PAUSED]}attributeChangedCallback(e,t,r){var o,n,a,l,c;e===N.MEDIA_CONTROLLER&&(t&&((n=(o=Gt(this,Re))==null?void 0:o.unassociateElement)==null||n.call(o,this),Ea(this,Re,null)),r&&this.isConnected&&(Ea(this,Re,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(c=(l=Gt(this,Re))==null?void 0:l.associateElement)==null||c.call(l,this)))}connectedCallback(){var e,t,r,o;this.tabIndex=-1,this.setAttribute("aria-hidden","true"),Ea(this,Re,vv(this)),this.getAttribute(N.MEDIA_CONTROLLER)&&((t=(e=Gt(this,Re))==null?void 0:e.associateElement)==null||t.call(e,this)),(r=Gt(this,Re))==null||r.addEventListener("pointerdown",this),(o=Gt(this,Re))==null||o.addEventListener("click",this)}disconnectedCallback(){var e,t,r,o;this.getAttribute(N.MEDIA_CONTROLLER)&&((t=(e=Gt(this,Re))==null?void 0:e.unassociateElement)==null||t.call(e,this)),(r=Gt(this,Re))==null||r.removeEventListener("pointerdown",this),(o=Gt(this,Re))==null||o.removeEventListener("click",this),Ea(this,Re,null)}handleEvent(e){var t;let r=(t=e.composedPath())==null?void 0:t[0];if(["video","media-controller"].includes(r==null?void 0:r.localName)){if(e.type==="pointerdown")this._pointerType=e.pointerType;else if(e.type==="click"){let{clientX:n,clientY:a}=e,{left:l,top:c,width:p,height:h}=this.getBoundingClientRect(),v=n-l,g=a-c;if(v<0||g<0||v>p||g>h||p===0&&h===0)return;let m=this._pointerType||"mouse";if(this._pointerType=void 0,m===da.TOUCH){this.handleTap(e);return}else if(m===da.MOUSE||m===da.PEN){this.handleMouseClick(e);return}}}}get mediaPaused(){return w(this,s.MEDIA_PAUSED)}set mediaPaused(e){I(this,s.MEDIA_PAUSED,e)}handleTap(e){}handleMouseClick(e){let t=this.mediaPaused?b.MEDIA_PLAY_REQUEST:b.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new d.CustomEvent(t,{composed:!0,bubbles:!0}))}};Re=new WeakMap;vr.shadowRootOptions={mode:"open"};vr.getTemplateHTML=mv;function vv(i){var e;let t=i.getAttribute(N.MEDIA_CONTROLLER);return t?(e=i.getRootNode())==null?void 0:e.getElementById(t):nt(i,"media-controller")}d.customElements.get("media-gesture-receiver")||d.customElements.define("media-gesture-receiver",vr);var ba=vr;var ql=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},He=(i,e,t)=>(ql(i,e,"read from private field"),t?t.call(i):e.get(i)),$e=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ci=(i,e,t,r)=>(ql(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Fe=(i,e,t)=>(ql(i,e,"access private method"),t),Ta,fr,qo,gr,_a,Wl,Wu,Ko,ya,Fl,Fu,Kl,Ku,Go,Aa,Sa,Gl,Er,zo,M={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive",AUTOHIDE_OVER_CONTROLS:"autohideovercontrols"};function fv(i){return`
265
265
  <style>
266
266
 
267
267
  :host([${s.MEDIA_IS_FULLSCREEN}]) ::slotted([slot=media]) {
@@ -412,7 +412,7 @@ bp-player[has-error] {
412
412
  <slot part="bottom chrome"></slot>
413
413
  </span>
414
414
  <slot name="dialog" part="layer dialog-layer"></slot>
415
- `}var bv=Object.values(s),_v="sm:384 md:576 lg:768 xl:960";function yv(i){Gu(i.target,i.contentRect.width)}function Gu(i,e){var t;if(!i.isConnected)return;let r=(t=i.getAttribute(M.BREAKPOINTS))!=null?t:_v,o=Tv(r),n=Av(o,e),a=!1;if(Object.keys(o).forEach(l=>{if(n.includes(l)){i.hasAttribute(`breakpoint${l}`)||(i.setAttribute(`breakpoint${l}`,""),a=!0);return}i.hasAttribute(`breakpoint${l}`)&&(i.removeAttribute(`breakpoint${l}`),a=!0)}),a){let l=new CustomEvent(Li.BREAKPOINTS_CHANGE,{detail:n});i.dispatchEvent(l)}i.breakpointsComputed||(i.breakpointsComputed=!0,i.dispatchEvent(new CustomEvent(Li.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))}function Tv(i){let e=i.split(/\s+/);return Object.fromEntries(e.map(t=>t.split(":")))}function Av(i,e){return Object.keys(i).filter(t=>e>=parseInt(i[t]))}var Mi=class extends d.HTMLElement{constructor(){if(super(),$e(this,Wl),$e(this,Fl),$e(this,Kl),$e(this,Go),$e(this,Sa),$e(this,Er),$e(this,Ta,0),$e(this,fr,null),$e(this,qo,null),$e(this,gr,void 0),this.breakpointsComputed=!1,$e(this,_a,new MutationObserver(Fe(this,Wl,Fu).bind(this))),$e(this,Ko,!1),$e(this,ya,t=>{He(this,Ko)||(setTimeout(()=>{yv(t),Ii(this,Ko,!1)},0),Ii(this,Ko,!0))}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let t=j(this.attributes),r=this.constructor.getTemplateHTML(t);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(r):this.shadowRoot.innerHTML=r}let e=this.querySelector(":scope > slot[slot=media]");e&&e.addEventListener("slotchange",()=>{if(!e.assignedElements({flatten:!0}).length){He(this,fr)&&this.mediaUnsetCallback(He(this,fr));return}this.handleMediaUpdated(this.media)})}static get observedAttributes(){return[M.AUTOHIDE,M.GESTURES_DISABLED].concat(bv).filter(e=>![s.MEDIA_RENDITION_LIST,s.MEDIA_AUDIO_TRACK_LIST,s.MEDIA_CHAPTERS_CUES,s.MEDIA_WIDTH,s.MEDIA_HEIGHT,s.MEDIA_ERROR,s.MEDIA_ERROR_MESSAGE].includes(e))}attributeChangedCallback(e,t,r){e.toLowerCase()==M.AUTOHIDE&&(this.autohide=r)}get media(){let e=this.querySelector(":scope > [slot=media]");return(e==null?void 0:e.nodeName)=="SLOT"&&(e=e.assignedElements({flatten:!0})[0]),e}async handleMediaUpdated(e){e&&(Ii(this,fr,e),e.localName.includes("-")&&await d.customElements.whenDefined(e.localName),this.mediaSetCallback(e))}connectedCallback(){var e;He(this,_a).observe(this,{childList:!0,subtree:!0}),Rt(this,He(this,ya));let r=this.getAttribute(M.AUDIO)!=null?E("audio player"):E("video player");this.setAttribute("role","region"),this.setAttribute("aria-label",r),this.handleMediaUpdated(this.media),this.setAttribute(M.USER_INACTIVE,""),Gu(this,this.getBoundingClientRect().width),this.addEventListener("pointerdown",this),this.addEventListener("pointermove",this),this.addEventListener("pointerup",this),this.addEventListener("mouseleave",this),this.addEventListener("keyup",this),(e=d.window)==null||e.addEventListener("mouseup",this)}disconnectedCallback(){var e;He(this,_a).disconnect(),xt(this,He(this,ya)),this.media&&this.mediaUnsetCallback(this.media),(e=d.window)==null||e.removeEventListener("mouseup",this)}mediaSetCallback(e){}mediaUnsetCallback(e){Ii(this,fr,null)}handleEvent(e){switch(e.type){case"pointerdown":Ii(this,Ta,e.timeStamp);break;case"pointermove":Fe(this,Fl,Ku).call(this,e);break;case"pointerup":Fe(this,Kl,qu).call(this,e);break;case"mouseleave":Fe(this,Go,Aa).call(this);break;case"mouseup":this.removeAttribute(M.KEYBOARD_CONTROL);break;case"keyup":Fe(this,Er,zo).call(this),this.setAttribute(M.KEYBOARD_CONTROL,"");break}}set autohide(e){let t=Number(e);Ii(this,gr,isNaN(t)?0:t)}get autohide(){return(He(this,gr)===void 0?2:He(this,gr)).toString()}get breakpoints(){return P(this,M.BREAKPOINTS)}set breakpoints(e){D(this,M.BREAKPOINTS,e)}get audio(){return w(this,M.AUDIO)}set audio(e){C(this,M.AUDIO,e)}get gesturesDisabled(){return w(this,M.GESTURES_DISABLED)}set gesturesDisabled(e){C(this,M.GESTURES_DISABLED,e)}get keyboardControl(){return w(this,M.KEYBOARD_CONTROL)}set keyboardControl(e){C(this,M.KEYBOARD_CONTROL,e)}get noAutohide(){return w(this,M.NO_AUTOHIDE)}set noAutohide(e){C(this,M.NO_AUTOHIDE,e)}get autohideOverControls(){return w(this,M.AUTOHIDE_OVER_CONTROLS)}set autohideOverControls(e){C(this,M.AUTOHIDE_OVER_CONTROLS,e)}get userInteractive(){return w(this,M.USER_INACTIVE)}set userInteractive(e){C(this,M.USER_INACTIVE,e)}};Ta=new WeakMap;fr=new WeakMap;qo=new WeakMap;gr=new WeakMap;_a=new WeakMap;Wl=new WeakSet;Fu=function(i){let e=this.media;for(let t of i){if(t.type!=="childList")continue;let r=t.removedNodes;for(let o of r){if(o.slot!="media"||t.target!=this)continue;let n=t.previousSibling&&t.previousSibling.previousElementSibling;if(!n||!e)this.mediaUnsetCallback(o);else{let a=n.slot!=="media";for(;(n=n.previousSibling)!==null;)n.slot=="media"&&(a=!1);a&&this.mediaUnsetCallback(o)}}if(e)for(let o of t.addedNodes)o===e&&this.handleMediaUpdated(e)}};Ko=new WeakMap;ya=new WeakMap;Fl=new WeakSet;Ku=function(i){if(i.pointerType!=="mouse"&&i.timeStamp-He(this,Ta)<250)return;Fe(this,Sa,Gl).call(this),clearTimeout(He(this,qo));let e=this.hasAttribute(M.AUTOHIDE_OVER_CONTROLS);([this,this.media].includes(i.target)||e)&&Fe(this,Er,zo).call(this)};Kl=new WeakSet;qu=function(i){if(i.pointerType==="touch"){let e=!this.hasAttribute(M.USER_INACTIVE);[this,this.media].includes(i.target)&&e?Fe(this,Go,Aa).call(this):Fe(this,Er,zo).call(this)}else i.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e==null?void 0:e.localName))&&Fe(this,Er,zo).call(this)};Go=new WeakSet;Aa=function(){if(He(this,gr)<0||this.hasAttribute(M.USER_INACTIVE))return;this.setAttribute(M.USER_INACTIVE,"");let i=new d.CustomEvent(Li.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(i)};Sa=new WeakSet;Gl=function(){if(!this.hasAttribute(M.USER_INACTIVE))return;this.removeAttribute(M.USER_INACTIVE);let i=new d.CustomEvent(Li.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(i)};Er=new WeakSet;zo=function(){Fe(this,Sa,Gl).call(this),clearTimeout(He(this,qo));let i=parseInt(this.autohide);i<0||Ii(this,qo,setTimeout(()=>{Fe(this,Go,Aa).call(this)},i*1e3))};Mi.shadowRootOptions={mode:"open"};Mi.getTemplateHTML=Ev;d.customElements.get("media-container")||d.customElements.define("media-container",Mi);var zu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},fe=(i,e,t)=>(zu(i,e,"read from private field"),t?t.call(i):e.get(i)),Yo=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ka=(i,e,t,r)=>(zu(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),br,_r,La,Ri,Pt,zt,Yt=class{constructor(e,t,{defaultValue:r}={defaultValue:void 0}){Yo(this,Pt),Yo(this,br,void 0),Yo(this,_r,void 0),Yo(this,La,void 0),Yo(this,Ri,new Set),ka(this,br,e),ka(this,_r,t),ka(this,La,new Set(r))}[Symbol.iterator](){return fe(this,Pt,zt).values()}get length(){return fe(this,Pt,zt).size}get value(){var e;return(e=[...fe(this,Pt,zt)].join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(ka(this,Ri,new Set),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return[...fe(this,Pt,zt)][e]}values(){return fe(this,Pt,zt).values()}forEach(e,t){fe(this,Pt,zt).forEach(e,t)}add(...e){var t,r;e.forEach(o=>fe(this,Ri).add(o)),!(this.value===""&&!((t=fe(this,br))!=null&&t.hasAttribute(`${fe(this,_r)}`)))&&((r=fe(this,br))==null||r.setAttribute(`${fe(this,_r)}`,`${this.value}`))}remove(...e){var t;e.forEach(r=>fe(this,Ri).delete(r)),(t=fe(this,br))==null||t.setAttribute(`${fe(this,_r)}`,`${this.value}`)}contains(e){return fe(this,Pt,zt).has(e)}toggle(e,t){return typeof t<"u"?t?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,t){return this.remove(e),this.add(t),e===t}};br=new WeakMap;_r=new WeakMap;La=new WeakMap;Ri=new WeakMap;Pt=new WeakSet;zt=function(){return fe(this,Ri).size?fe(this,Ri):fe(this,La)};var Sv=(i="")=>i.split(/\s+/),Yu=(i="")=>{let[e,t,r]=i.split(":"),o=r?decodeURIComponent(r):void 0;return{kind:e==="cc"?Ie.CAPTIONS:Ie.SUBTITLES,language:t,label:o}},xi=(i="",e={})=>Sv(i).map(t=>{let r=Yu(t);return{...e,...r}}),zl=i=>i?Array.isArray(i)?i.map(e=>typeof e=="string"?Yu(e):e):typeof i=="string"?xi(i):[i]:[],wa=({kind:i,label:e,language:t}={kind:"subtitles"})=>e?`${i==="captions"?"cc":"sb"}:${t}:${encodeURIComponent(e)}`:t,Dt=(i=[])=>Array.prototype.map.call(i,wa).join(" "),kv=(i,e)=>t=>t[i]===e,Qu=i=>{let e=Object.entries(i).map(([t,r])=>kv(t,r));return t=>e.every(r=>r(t))},Pi=(i,e=[],t=[])=>{let r=zl(t).map(Qu),o=n=>r.some(a=>a(n));Array.from(e).filter(o).forEach(n=>{n.mode=i})},Di=(i,e=()=>!0)=>{if(!(i!=null&&i.textTracks))return[];let t=typeof e=="function"?e:Qu(e);return Array.from(i.textTracks).filter(t)},Ca=i=>{var e;return!!((e=i.mediaSubtitlesShowing)!=null&&e.length)||i.hasAttribute(s.MEDIA_SUBTITLES_SHOWING)};var Xu=i=>{var e;let{media:t,fullscreenElement:r}=i;try{let o=r&&"requestFullscreen"in r?"requestFullscreen":r&&"webkitRequestFullScreen"in r?"webkitRequestFullScreen":void 0;if(o){let n=(e=r[o])==null?void 0:e.call(r);if(n instanceof Promise)return n.catch(()=>{})}else t!=null&&t.webkitEnterFullscreen?t.webkitEnterFullscreen():t!=null&&t.requestFullscreen&&t.requestFullscreen()}catch(o){console.error(o)}},Zu="exitFullscreen"in ee?"exitFullscreen":"webkitExitFullscreen"in ee?"webkitExitFullscreen":"webkitCancelFullScreen"in ee?"webkitCancelFullScreen":void 0,Ju=i=>{var e;let{documentElement:t}=i;if(Zu){let r=(e=t==null?void 0:t[Zu])==null?void 0:e.call(t);if(r instanceof Promise)return r.catch(()=>{})}},Qo="fullscreenElement"in ee?"fullscreenElement":"webkitFullscreenElement"in ee?"webkitFullscreenElement":void 0,Lv=i=>{let{documentElement:e,media:t}=i,r=e==null?void 0:e[Qo];return!r&&"webkitDisplayingFullscreen"in t&&"webkitPresentationMode"in t&&t.webkitDisplayingFullscreen&&t.webkitPresentationMode===wu.FULLSCREEN?t:r},ju=i=>{var e;let{media:t,documentElement:r,fullscreenElement:o=t}=i;if(!t||!r)return!1;let n=Lv(i);if(!n)return!1;if(n===o||n===t)return!0;if(n.localName.includes("-")){let a=n.shadowRoot;if(!(Qo in a))return Te(n,o);for(;a!=null&&a[Qo];){if(a[Qo]===o)return!0;a=(e=a[Qo])==null?void 0:e.shadowRoot}}return!1},wv="fullscreenEnabled"in ee?"fullscreenEnabled":"webkitFullscreenEnabled"in ee?"webkitFullscreenEnabled":void 0,eh=i=>{let{documentElement:e,media:t}=i;return!!(e!=null&&e[wv])||t&&"webkitSupportsFullscreen"in t};var Ia,Yl=()=>{var i,e;return Ia||(Ia=(e=(i=ee)==null?void 0:i.createElement)==null?void 0:e.call(i,"video"),Ia)},th=async(i=Yl())=>{if(!i)return!1;let e=i.volume;i.volume=e/2+.1;let t=new AbortController,r=await Promise.race([Cv(i,t.signal),Iv(i,e)]);return t.abort(),r},Cv=(i,e)=>new Promise(t=>{i.addEventListener("volumechange",()=>t(!0),{signal:e})}),Iv=async(i,e)=>{for(let t=0;t<10;t++){if(i.volume===e)return!1;await ca(10)}return i.volume!==e},Mv=/.*Version\/.*Safari\/.*/.test(d.navigator.userAgent),Ql=(i=Yl())=>d.matchMedia("(display-mode: standalone)").matches&&Mv?!1:typeof(i==null?void 0:i.requestPictureInPicture)=="function",Zl=(i=Yl())=>eh({documentElement:ee,media:i}),ih=Zl(),rh=Ql(),oh=!!d.WebKitPlaybackTargetAvailabilityEvent,nh=!!d.chrome;var yr=i=>Di(i.media,e=>[Ie.SUBTITLES,Ie.CAPTIONS].includes(e.kind)).sort((e,t)=>e.kind>=t.kind?1:-1),Xl=i=>Di(i.media,e=>e.mode===qt.SHOWING&&[Ie.SUBTITLES,Ie.CAPTIONS].includes(e.kind)),Ma=(i,e)=>{let t=yr(i),r=Xl(i),o=!!r.length;if(t.length){if(e===!1||o&&e!==!0)Pi(qt.DISABLED,t,r);else if(e===!0||!o&&e!==!1){let n=t[0],{options:a}=i;if(!(a!=null&&a.noSubtitlesLangPref)){let h=globalThis.localStorage.getItem("media-chrome-pref-subtitles-lang"),v=h?[h,...globalThis.navigator.languages]:globalThis.navigator.languages,g=t.filter(m=>v.some(A=>m.language.toLowerCase().startsWith(A.split("-")[0]))).sort((m,A)=>{let f=v.findIndex(O=>m.language.toLowerCase().startsWith(O.split("-")[0])),R=v.findIndex(O=>A.language.toLowerCase().startsWith(O.split("-")[0]));return f-R});g[0]&&(n=g[0])}let{language:l,label:c,kind:p}=n;Pi(qt.DISABLED,t,r),Pi(qt.SHOWING,t,[{language:l,label:c,kind:p}])}}},Ra=(i,e)=>i===e?!0:i==null||e==null||typeof i!=typeof e?!1:typeof i=="number"&&Number.isNaN(i)&&Number.isNaN(e)?!0:typeof i!="object"?!1:Array.isArray(i)?Rv(i,e):Object.entries(i).every(([t,r])=>t in e&&Ra(r,e[t])),Rv=(i,e)=>{let t=Array.isArray(i),r=Array.isArray(e);return t!==r?!1:t||r?i.length!==e.length?!1:i.every((o,n)=>Ra(o,e[n])):!0};var xv=Object.values(Ze),xa,Pv=th().then(i=>(xa=i,xa)),ah=async(...i)=>{await Promise.all(i.filter(e=>e).map(async e=>{if(!("localName"in e&&e instanceof d.HTMLElement))return;let t=e.localName;if(!t.includes("-"))return;let r=d.customElements.get(t);r&&e instanceof r||(await d.customElements.whenDefined(t),d.customElements.upgrade(e))}))},Dv=new d.DOMParser,Ov=i=>i&&(Dv.parseFromString(i,"text/html").body.textContent||i),Tr={mediaError:{get(i,e){let{media:t}=i;if((e==null?void 0:e.type)!=="playing")return t==null?void 0:t.error},mediaEvents:["emptied","error","playing"]},mediaErrorCode:{get(i,e){var t;let{media:r}=i;if((e==null?void 0:e.type)!=="playing")return(t=r==null?void 0:r.error)==null?void 0:t.code},mediaEvents:["emptied","error","playing"]},mediaErrorMessage:{get(i,e){var t,r;let{media:o}=i;if((e==null?void 0:e.type)!=="playing")return(r=(t=o==null?void 0:o.error)==null?void 0:t.message)!=null?r:""},mediaEvents:["emptied","error","playing"]},mediaWidth:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.videoWidth)!=null?e:0},mediaEvents:["resize"]},mediaHeight:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.videoHeight)!=null?e:0},mediaEvents:["resize"]},mediaPaused:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.paused)!=null?e:!0},set(i,e){var t;let{media:r}=e;r&&(i?r.pause():(t=r.play())==null||t.catch(()=>{}))},mediaEvents:["play","playing","pause","emptied"]},mediaHasPlayed:{get(i,e){let{media:t}=i;return t?e?e.type==="playing":!t.paused:!1},mediaEvents:["playing","emptied"]},mediaEnded:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.ended)!=null?e:!1},mediaEvents:["seeked","ended","emptied"]},mediaPlaybackRate:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.playbackRate)!=null?e:1},set(i,e){let{media:t}=e;t&&Number.isFinite(+i)&&(t.playbackRate=+i)},mediaEvents:["ratechange","loadstart"]},mediaMuted:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.muted)!=null?e:!1},set(i,e){let{media:t,options:{noMutedPref:r}={}}=e;if(t){t.muted=i;try{let o=d.localStorage.getItem("media-chrome-pref-muted")!==null,n=t.hasAttribute("muted");if(r){o&&d.localStorage.removeItem("media-chrome-pref-muted");return}if(n&&!o)return;d.localStorage.setItem("media-chrome-pref-muted",i?"true":"false")}catch(o){console.debug("Error setting muted pref",o)}}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(i,e)=>{let{options:{noMutedPref:t}}=e,{media:r}=e;if(!(!r||r.muted||t))try{let o=d.localStorage.getItem("media-chrome-pref-muted")==="true";Tr.mediaMuted.set(o,e),i(o)}catch(o){console.debug("Error getting muted pref",o)}}]},mediaLoop:{get(i){let{media:e}=i;return e==null?void 0:e.loop},set(i,e){let{media:t}=e;t&&(t.loop=i)},mediaEvents:["medialooprequest"]},mediaVolume:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.volume)!=null?e:1},set(i,e){let{media:t,options:{noVolumePref:r}={}}=e;if(t){try{i==null?d.localStorage.removeItem("media-chrome-pref-volume"):!t.hasAttribute("muted")&&!r&&d.localStorage.setItem("media-chrome-pref-volume",i.toString())}catch(o){console.debug("Error setting volume pref",o)}Number.isFinite(+i)&&(t.volume=+i)}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(i,e)=>{let{options:{noVolumePref:t}}=e;if(!t)try{let{media:r}=e;if(!r)return;let o=d.localStorage.getItem("media-chrome-pref-volume");if(o==null)return;Tr.mediaVolume.set(+o,e),i(+o)}catch(r){console.debug("Error getting volume pref",r)}}]},mediaVolumeLevel:{get(i){let{media:e}=i;return typeof(e==null?void 0:e.volume)>"u"?"high":e.muted||e.volume===0?"off":e.volume<.5?"low":e.volume<.75?"medium":"high"},mediaEvents:["volumechange"]},mediaCurrentTime:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.currentTime)!=null?e:0},set(i,e){let{media:t}=e;!t||!mr(i)||(t.currentTime=i)},mediaEvents:["timeupdate","loadedmetadata"]},mediaDuration:{get(i){let{media:e,options:{defaultDuration:t}={}}=i;return t&&(!e||!e.duration||Number.isNaN(e.duration)||!Number.isFinite(e.duration))?t:Number.isFinite(e==null?void 0:e.duration)?e.duration:Number.NaN},mediaEvents:["durationchange","loadedmetadata","emptied"]},mediaLoading:{get(i){let{media:e}=i;return(e==null?void 0:e.readyState)<3},mediaEvents:["waiting","playing","emptied"]},mediaSeekable:{get(i){var e;let{media:t}=i;if(!((e=t==null?void 0:t.seekable)!=null&&e.length))return;let r=t.seekable.start(0),o=t.seekable.end(t.seekable.length-1);if(!(!r&&!o))return[Number(r.toFixed(3)),Number(o.toFixed(3))]},mediaEvents:["loadedmetadata","emptied","progress","seekablechange"]},mediaBuffered:{get(i){var e;let{media:t}=i,r=(e=t==null?void 0:t.buffered)!=null?e:[];return Array.from(r).map((o,n)=>[Number(r.start(n).toFixed(3)),Number(r.end(n).toFixed(3))])},mediaEvents:["progress","emptied"]},mediaStreamType:{get(i){let{media:e,options:{defaultStreamType:t}={}}=i,r=[Ze.LIVE,Ze.ON_DEMAND].includes(t)?t:void 0;if(!e)return r;let{streamType:o}=e;if(xv.includes(o))return o===Ze.UNKNOWN?r:o;let n=e.duration;return n===1/0?Ze.LIVE:Number.isFinite(n)?Ze.ON_DEMAND:r},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange"]},mediaTargetLiveWindow:{get(i){let{media:e}=i;if(!e)return Number.NaN;let{targetLiveWindow:t}=e,r=Tr.mediaStreamType.get(i);return(t==null||Number.isNaN(t))&&r===Ze.LIVE?0:t},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange","targetlivewindowchange"]},mediaTimeIsLive:{get(i){let{media:e,options:{liveEdgeOffset:t=10}={}}=i;if(!e)return!1;if(typeof e.liveEdgeStart=="number")return Number.isNaN(e.liveEdgeStart)?!1:e.currentTime>=e.liveEdgeStart;if(!(Tr.mediaStreamType.get(i)===Ze.LIVE))return!1;let o=e.seekable;if(!o)return!0;if(!o.length)return!1;let n=o.end(o.length-1)-t;return e.currentTime>=n},mediaEvents:["playing","timeupdate","progress","waiting","emptied"]},mediaSubtitlesList:{get(i){return yr(i).map(({kind:e,label:t,language:r})=>({kind:e,label:t,language:r}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},mediaSubtitlesShowing:{get(i){return Xl(i).map(({kind:e,label:t,language:r})=>({kind:e,label:t,language:r}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(i,e)=>{var t,r;let{media:o,options:n}=e;if(!o)return;let a=l=>{var c;!n.defaultSubtitles||l&&![Ie.CAPTIONS,Ie.SUBTITLES].includes((c=l==null?void 0:l.track)==null?void 0:c.kind)||Ma(e,!0)};return o.addEventListener("loadstart",a),(t=o.textTracks)==null||t.addEventListener("addtrack",a),(r=o.textTracks)==null||r.addEventListener("removetrack",a),()=>{var l,c;o.removeEventListener("loadstart",a),(l=o.textTracks)==null||l.removeEventListener("addtrack",a),(c=o.textTracks)==null||c.removeEventListener("removetrack",a)}}]},mediaChaptersCues:{get(i){var e;let{media:t}=i;if(!t)return[];let[r]=Di(t,{kind:Ie.CHAPTERS});return Array.from((e=r==null?void 0:r.cues)!=null?e:[]).map(({text:o,startTime:n,endTime:a})=>({text:Ov(o),startTime:n,endTime:a}))},mediaEvents:["loadstart","loadedmetadata"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:r}=e;if(!r)return;let o=r.querySelector('track[kind="chapters"][default][src]'),n=(t=r.shadowRoot)==null?void 0:t.querySelector(':is(video,audio) > track[kind="chapters"][default][src]');return o==null||o.addEventListener("load",i),n==null||n.addEventListener("load",i),()=>{o==null||o.removeEventListener("load",i),n==null||n.removeEventListener("load",i)}}]},mediaIsPip:{get(i){var e,t;let{media:r,documentElement:o}=i;if(!r||!o||!o.pictureInPictureElement)return!1;if(o.pictureInPictureElement===r)return!0;if(o.pictureInPictureElement instanceof HTMLMediaElement)return(e=r.localName)!=null&&e.includes("-")?Te(r,o.pictureInPictureElement):!1;if(o.pictureInPictureElement.localName.includes("-")){let n=o.pictureInPictureElement.shadowRoot;for(;n!=null&&n.pictureInPictureElement;){if(n.pictureInPictureElement===r)return!0;n=(t=n.pictureInPictureElement)==null?void 0:t.shadowRoot}}return!1},set(i,e){let{media:t}=e;if(t)if(i){if(!ee.pictureInPictureEnabled){console.warn("MediaChrome: Picture-in-picture is not enabled");return}if(!t.requestPictureInPicture){console.warn("MediaChrome: The current media does not support picture-in-picture");return}let r=()=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};t.requestPictureInPicture().catch(o=>{if(o.code===11){if(!t.src){console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a src set.");return}if(t.readyState===0&&t.preload==="none"){let n=()=>{t.removeEventListener("loadedmetadata",a),t.preload="none"},a=()=>{t.requestPictureInPicture().catch(r),n()};t.addEventListener("loadedmetadata",a),t.preload="metadata",setTimeout(()=>{t.readyState===0&&r(),n()},1e3)}else throw o}else throw o})}else ee.pictureInPictureElement&&ee.exitPictureInPicture()},mediaEvents:["enterpictureinpicture","leavepictureinpicture"]},mediaRenditionList:{get(i){var e;let{media:t}=i;return[...(e=t==null?void 0:t.videoRenditions)!=null?e:[]].map(r=>({...r}))},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaRenditionSelected:{get(i){var e,t,r;let{media:o}=i;return(r=(t=o==null?void 0:o.videoRenditions)==null?void 0:t[(e=o.videoRenditions)==null?void 0:e.selectedIndex])==null?void 0:r.id},set(i,e){let{media:t}=e;if(!(t!=null&&t.videoRenditions)){console.warn("MediaController: Rendition selection not supported by this media.");return}let r=i,o=Array.prototype.findIndex.call(t.videoRenditions,n=>n.id==r);t.videoRenditions.selectedIndex!=o&&(t.videoRenditions.selectedIndex=o)},mediaEvents:["emptied"],videoRenditionsEvents:["addrendition","removerendition","change"]},mediaAudioTrackList:{get(i){var e;let{media:t}=i;return[...(e=t==null?void 0:t.audioTracks)!=null?e:[]]},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaAudioTrackEnabled:{get(i){var e,t;let{media:r}=i;return(t=[...(e=r==null?void 0:r.audioTracks)!=null?e:[]].find(o=>o.enabled))==null?void 0:t.id},set(i,e){let{media:t}=e;if(!(t!=null&&t.audioTracks)){console.warn("MediaChrome: Audio track selection not supported by this media.");return}let r=i;for(let o of t.audioTracks)o.enabled=r==o.id},mediaEvents:["emptied"],audioTracksEvents:["addtrack","removetrack","change"]},mediaIsFullscreen:{get(i){return ju(i)},set(i,e,t){var r;i?(Xu(e),t.detail&&((r=e.media)==null||r.focus())):Ju(e)},rootEvents:["fullscreenchange","webkitfullscreenchange"],mediaEvents:["webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"]},mediaIsCasting:{get(i){var e;let{media:t}=i;return!(t!=null&&t.remote)||((e=t.remote)==null?void 0:e.state)==="disconnected"?!1:!!t.remote.state},set(i,e){var t,r;let{media:o}=e;if(o&&!(i&&((t=o.remote)==null?void 0:t.state)!=="disconnected")&&!(!i&&((r=o.remote)==null?void 0:r.state)!=="connected")){if(typeof o.remote.prompt!="function"){console.warn("MediaChrome: Casting is not supported in this environment");return}o.remote.prompt().catch(()=>{})}},remoteEvents:["connect","connecting","disconnect"]},mediaIsAirplaying:{get(){return!1},set(i,e){let{media:t}=e;if(t){if(!(t.webkitShowPlaybackTargetPicker&&d.WebKitPlaybackTargetAvailabilityEvent)){console.error("MediaChrome: received a request to select AirPlay but AirPlay is not supported in this environment");return}t.webkitShowPlaybackTargetPicker()}},mediaEvents:["webkitcurrentplaybacktargetiswirelesschanged"]},mediaFullscreenUnavailable:{get(i){let{media:e}=i;if(!ih||!Zl(e))return Me.UNSUPPORTED}},mediaPipUnavailable:{get(i){let{media:e}=i;if(!rh||!Ql(e))return Me.UNSUPPORTED;if(e!=null&&e.disablePictureInPicture)return Me.UNAVAILABLE}},mediaVolumeUnavailable:{get(i){let{media:e}=i;if(xa===!1||(e==null?void 0:e.volume)==null)return Me.UNSUPPORTED},stateOwnersUpdateHandlers:[i=>{xa==null&&Pv.then(e=>i(e?void 0:Me.UNSUPPORTED))}]},mediaCastUnavailable:{get(i,{availability:e="not-available"}={}){var t;let{media:r}=i;if(!nh||!((t=r==null?void 0:r.remote)!=null&&t.state))return Me.UNSUPPORTED;if(!(e==null||e==="available"))return Me.UNAVAILABLE},stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:r}=e;return r?(r.disableRemotePlayback||r.hasAttribute("disableremoteplayback")||(t=r==null?void 0:r.remote)==null||t.watchAvailability(n=>{i({availability:n?"available":"not-available"})}).catch(n=>{n.name==="NotSupportedError"?i({availability:null}):i({availability:"not-available"})}),()=>{var n;(n=r==null?void 0:r.remote)==null||n.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaAirplayUnavailable:{get(i,e){if(!oh)return Me.UNSUPPORTED;if((e==null?void 0:e.availability)==="not-available")return Me.UNAVAILABLE},mediaEvents:["webkitplaybacktargetavailabilitychanged"],stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:r}=e;return r?(r.disableRemotePlayback||r.hasAttribute("disableremoteplayback")||(t=r==null?void 0:r.remote)==null||t.watchAvailability(n=>{i({availability:n?"available":"not-available"})}).catch(n=>{n.name==="NotSupportedError"?i({availability:null}):i({availability:"not-available"})}),()=>{var n;(n=r==null?void 0:r.remote)==null||n.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaRenditionUnavailable:{get(i){var e;let{media:t}=i;if(!(t!=null&&t.videoRenditions))return Me.UNSUPPORTED;if(!((e=t.videoRenditions)!=null&&e.length))return Me.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaAudioTrackUnavailable:{get(i){var e,t;let{media:r}=i;if(!(r!=null&&r.audioTracks))return Me.UNSUPPORTED;if(((t=(e=r.audioTracks)==null?void 0:e.length)!=null?t:0)<=1)return Me.UNAVAILABLE},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaLang:{get(i){let{options:{mediaLang:e}={}}=i;return e??"en"}}};var sh={[b.MEDIA_PREVIEW_REQUEST](i,e,{detail:t}){var r,o,n;let{media:a}=e,l=t??void 0,c,p;if(a&&l!=null){let[m]=Di(a,{kind:Ie.METADATA,label:"thumbnails"}),A=Array.prototype.find.call((r=m==null?void 0:m.cues)!=null?r:[],(f,R,O)=>R===0?f.endTime>l:R===O.length-1?f.startTime<=l:f.startTime<=l&&f.endTime>l);if(A){let f=/'^(?:[a-z]+:)?\/\//i.test(A.text)||(o=a==null?void 0:a.querySelector('track[label="thumbnails"]'))==null?void 0:o.src,R=new URL(A.text,f);p=new URLSearchParams(R.hash).get("#xywh").split(",").map(Oe=>+Oe),c=R.href}}let h=i.mediaDuration.get(e),g=(n=i.mediaChaptersCues.get(e).find((m,A,f)=>A===f.length-1&&h===m.endTime?m.startTime<=l&&m.endTime>=l:m.startTime<=l&&m.endTime>l))==null?void 0:n.text;return t!=null&&g==null&&(g=""),{mediaPreviewTime:l,mediaPreviewImage:c,mediaPreviewCoords:p,mediaPreviewChapter:g}},[b.MEDIA_PAUSE_REQUEST](i,e){i["mediaPaused"].set(!0,e)},[b.MEDIA_PLAY_REQUEST](i,e){var t,r,o,n;let a="mediaPaused",c=i.mediaStreamType.get(e)===Ze.LIVE,p=!((t=e.options)!=null&&t.noAutoSeekToLive),h=i.mediaTargetLiveWindow.get(e)>0;if(c&&p&&!h){let v=(r=i.mediaSeekable.get(e))==null?void 0:r[1];if(v){let g=(n=(o=e.options)==null?void 0:o.seekToLiveOffset)!=null?n:0,m=v-g;i.mediaCurrentTime.set(m,e)}}i[a].set(!1,e)},[b.MEDIA_PLAYBACK_RATE_REQUEST](i,e,{detail:t}){let r="mediaPlaybackRate",o=t;i[r].set(o,e)},[b.MEDIA_MUTE_REQUEST](i,e){i["mediaMuted"].set(!0,e)},[b.MEDIA_UNMUTE_REQUEST](i,e){let t="mediaMuted";i.mediaVolume.get(e)||i.mediaVolume.set(.25,e),i[t].set(!1,e)},[b.MEDIA_LOOP_REQUEST](i,e,{detail:t}){let r="mediaLoop",o=!!t;return i[r].set(o,e),{mediaLoop:o}},[b.MEDIA_VOLUME_REQUEST](i,e,{detail:t}){let r="mediaVolume",o=t;o&&i.mediaMuted.get(e)&&i.mediaMuted.set(!1,e),i[r].set(o,e)},[b.MEDIA_SEEK_REQUEST](i,e,{detail:t}){let r="mediaCurrentTime",o=t;i[r].set(o,e)},[b.MEDIA_SEEK_TO_LIVE_REQUEST](i,e){var t,r,o;let n="mediaCurrentTime",a=(t=i.mediaSeekable.get(e))==null?void 0:t[1];if(Number.isNaN(Number(a)))return;let l=(o=(r=e.options)==null?void 0:r.seekToLiveOffset)!=null?o:0,c=a-l;i[n].set(c,e)},[b.MEDIA_SHOW_SUBTITLES_REQUEST](i,e,{detail:t}){var r;let{options:o}=e,n=yr(e),a=zl(t),l=(r=a[0])==null?void 0:r.language;l&&!o.noSubtitlesLangPref&&d.localStorage.setItem("media-chrome-pref-subtitles-lang",l),Pi(qt.SHOWING,n,a)},[b.MEDIA_DISABLE_SUBTITLES_REQUEST](i,e,{detail:t}){let r=yr(e),o=t??[];Pi(qt.DISABLED,r,o)},[b.MEDIA_TOGGLE_SUBTITLES_REQUEST](i,e,{detail:t}){Ma(e,t)},[b.MEDIA_RENDITION_REQUEST](i,e,{detail:t}){let r="mediaRenditionSelected",o=t;i[r].set(o,e)},[b.MEDIA_AUDIO_TRACK_REQUEST](i,e,{detail:t}){let r="mediaAudioTrackEnabled",o=t;i[r].set(o,e)},[b.MEDIA_ENTER_PIP_REQUEST](i,e){let t="mediaIsPip";i.mediaIsFullscreen.get(e)&&i.mediaIsFullscreen.set(!1,e),i[t].set(!0,e)},[b.MEDIA_EXIT_PIP_REQUEST](i,e){i["mediaIsPip"].set(!1,e)},[b.MEDIA_ENTER_FULLSCREEN_REQUEST](i,e,t){let r="mediaIsFullscreen";i.mediaIsPip.get(e)&&i.mediaIsPip.set(!1,e),i[r].set(!0,e,t)},[b.MEDIA_EXIT_FULLSCREEN_REQUEST](i,e){i["mediaIsFullscreen"].set(!1,e)},[b.MEDIA_ENTER_CAST_REQUEST](i,e){let t="mediaIsCasting";i.mediaIsFullscreen.get(e)&&i.mediaIsFullscreen.set(!1,e),i[t].set(!0,e)},[b.MEDIA_EXIT_CAST_REQUEST](i,e){i["mediaIsCasting"].set(!1,e)},[b.MEDIA_AIRPLAY_REQUEST](i,e){i["mediaIsAirplaying"].set(!0,e)}};var lh=({media:i,fullscreenElement:e,documentElement:t,stateMediator:r=Tr,requestMap:o=sh,options:n={},monitorStateOwnersOnlyWithSubscriptions:a=!0})=>{let l=[],c={options:{...n}},p=Object.freeze({mediaPreviewTime:void 0,mediaPreviewImage:void 0,mediaPreviewCoords:void 0,mediaPreviewChapter:void 0}),h=f=>{f!=null&&(Ra(f,p)||(p=Object.freeze({...p,...f}),l.forEach(R=>R(p))))},v=()=>{let f=Object.entries(r).reduce((R,[O,{get:Oe}])=>(R[O]=Oe(c),R),{});h(f)},g={},m,A=async(f,R)=>{var O,Oe,ot,Lo,ar,Dc,El,k,K,ne,te,G,pe,Ct,wo,Oc;let ym=!!m;if(m={...c,...m??{},...f},ym)return;await ah(...Object.values(f));let sr=l.length>0&&R===0&&a,Uc=c.media!==m.media,Nc=((O=c.media)==null?void 0:O.textTracks)!==((Oe=m.media)==null?void 0:Oe.textTracks),$c=((ot=c.media)==null?void 0:ot.videoRenditions)!==((Lo=m.media)==null?void 0:Lo.videoRenditions),Hc=((ar=c.media)==null?void 0:ar.audioTracks)!==((Dc=m.media)==null?void 0:Dc.audioTracks),Bc=((El=c.media)==null?void 0:El.remote)!==((k=m.media)==null?void 0:k.remote),Vc=c.documentElement!==m.documentElement,Wc=!!c.media&&(Uc||sr),Fc=!!((K=c.media)!=null&&K.textTracks)&&(Nc||sr),Kc=!!((ne=c.media)!=null&&ne.videoRenditions)&&($c||sr),qc=!!((te=c.media)!=null&&te.audioTracks)&&(Hc||sr),Gc=!!((G=c.media)!=null&&G.remote)&&(Bc||sr),zc=!!c.documentElement&&(Vc||sr),bl=Wc||Fc||Kc||qc||Gc||zc,lr=l.length===0&&R===1&&a,Yc=!!m.media&&(Uc||lr),L=!!((pe=m.media)!=null&&pe.textTracks)&&(Nc||lr),Qc=!!((Ct=m.media)!=null&&Ct.videoRenditions)&&($c||lr),Zc=!!((wo=m.media)!=null&&wo.audioTracks)&&(Hc||lr),Xc=!!((Oc=m.media)!=null&&Oc.remote)&&(Bc||lr),Jc=!!m.documentElement&&(Vc||lr),jc=Yc||L||Qc||Zc||Xc||Jc;if(!(bl||jc)){Object.entries(m).forEach(([z,Co])=>{c[z]=Co}),v(),m=void 0;return}Object.entries(r).forEach(([z,{get:Co,mediaEvents:Tm=[],textTracksEvents:Am=[],videoRenditionsEvents:Sm=[],audioTracksEvents:km=[],remoteEvents:Lm=[],rootEvents:wm=[],stateOwnersUpdateHandlers:Cm=[]}])=>{g[z]||(g[z]={});let Ue=ie=>{let ue=Co(c,ie);h({[z]:ue})},ve;ve=g[z].mediaEvents,Tm.forEach(ie=>{ve&&Wc&&(c.media.removeEventListener(ie,ve),g[z].mediaEvents=void 0),Yc&&(m.media.addEventListener(ie,Ue),g[z].mediaEvents=Ue)}),ve=g[z].textTracksEvents,Am.forEach(ie=>{var ue,Qe;ve&&Fc&&((ue=c.media.textTracks)==null||ue.removeEventListener(ie,ve),g[z].textTracksEvents=void 0),L&&((Qe=m.media.textTracks)==null||Qe.addEventListener(ie,Ue),g[z].textTracksEvents=Ue)}),ve=g[z].videoRenditionsEvents,Sm.forEach(ie=>{var ue,Qe;ve&&Kc&&((ue=c.media.videoRenditions)==null||ue.removeEventListener(ie,ve),g[z].videoRenditionsEvents=void 0),Qc&&((Qe=m.media.videoRenditions)==null||Qe.addEventListener(ie,Ue),g[z].videoRenditionsEvents=Ue)}),ve=g[z].audioTracksEvents,km.forEach(ie=>{var ue,Qe;ve&&qc&&((ue=c.media.audioTracks)==null||ue.removeEventListener(ie,ve),g[z].audioTracksEvents=void 0),Zc&&((Qe=m.media.audioTracks)==null||Qe.addEventListener(ie,Ue),g[z].audioTracksEvents=Ue)}),ve=g[z].remoteEvents,Lm.forEach(ie=>{var ue,Qe;ve&&Gc&&((ue=c.media.remote)==null||ue.removeEventListener(ie,ve),g[z].remoteEvents=void 0),Xc&&((Qe=m.media.remote)==null||Qe.addEventListener(ie,Ue),g[z].remoteEvents=Ue)}),ve=g[z].rootEvents,wm.forEach(ie=>{ve&&zc&&(c.documentElement.removeEventListener(ie,ve),g[z].rootEvents=void 0),Jc&&(m.documentElement.addEventListener(ie,Ue),g[z].rootEvents=Ue)});let Xn=g[z].stateOwnersUpdateHandlers;if(Xn&&bl&&(Array.isArray(Xn)?Xn:[Xn]).forEach(ue=>{typeof ue=="function"&&ue()}),jc){let ie=Cm.map(ue=>ue(Ue,m)).filter(ue=>typeof ue=="function");g[z].stateOwnersUpdateHandlers=ie.length===1?ie[0]:ie}else bl&&(g[z].stateOwnersUpdateHandlers=void 0)}),Object.entries(m).forEach(([z,Co])=>{c[z]=Co}),v(),m=void 0};return A({media:i,fullscreenElement:e,documentElement:t,options:n}),{dispatch(f){let{type:R,detail:O}=f;if(o[R]&&p.mediaErrorCode==null){h(o[R](r,c,f));return}R==="mediaelementchangerequest"?A({media:O}):R==="fullscreenelementchangerequest"?A({fullscreenElement:O}):R==="documentelementchangerequest"?A({documentElement:O}):R==="optionschangerequest"&&(Object.entries(O??{}).forEach(([Oe,ot])=>{c.options[Oe]=ot}),v())},getState(){return p},subscribe(f){return A({},l.length+1),l.push(f),f(p),()=>{let R=l.indexOf(f);R>=0&&(A({},l.length-1),l.splice(R,1))}}}};var rd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},I=(i,e,t)=>(rd(i,e,"read from private field"),t?t.call(i):e.get(i)),Ke=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},at=(i,e,t,r)=>(rd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),lt=(i,e,t)=>(rd(i,e,"access private method"),t),Qt,Zo,W,Ui,Xo,st,Pa,Jo,Da,Jl,Ni,Ar,Oa,jl,ed,vh,fh=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter"," ","f","m","k","c","l","j",">","<","p"],dh=10,ch=.025,uh=.25,Uv=.25,Nv=2,y={DEFAULT_SUBTITLES:"defaultsubtitles",DEFAULT_STREAM_TYPE:"defaultstreamtype",DEFAULT_DURATION:"defaultduration",FULLSCREEN_ELEMENT:"fullscreenelement",HOTKEYS:"hotkeys",KEYBOARD_BACKWARD_SEEK_OFFSET:"keyboardbackwardseekoffset",KEYBOARD_FORWARD_SEEK_OFFSET:"keyboardforwardseekoffset",KEYBOARD_DOWN_VOLUME_STEP:"keyboarddownvolumestep",KEYBOARD_UP_VOLUME_STEP:"keyboardupvolumestep",KEYS_USED:"keysused",LANG:"lang",LOOP:"loop",LIVE_EDGE_OFFSET:"liveedgeoffset",NO_AUTO_SEEK_TO_LIVE:"noautoseektolive",NO_DEFAULT_STORE:"nodefaultstore",NO_HOTKEYS:"nohotkeys",NO_MUTED_PREF:"nomutedpref",NO_SUBTITLES_LANG_PREF:"nosubtitleslangpref",NO_VOLUME_PREF:"novolumepref",SEEK_TO_LIVE_OFFSET:"seektoliveoffset"},td=class extends Mi{constructor(){super(),Ke(this,Da),Ke(this,Ni),Ke(this,Oa),Ke(this,ed),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,Ke(this,Qt,new Yt(this,y.HOTKEYS)),Ke(this,Zo,void 0),Ke(this,W,void 0),Ke(this,Ui,null),Ke(this,Xo,void 0),Ke(this,st,void 0),Ke(this,Pa,t=>{var r;(r=I(this,W))==null||r.dispatch(t)}),Ke(this,Jo,void 0),this.associateElement(this);let e={};at(this,Xo,t=>{Object.entries(t).forEach(([r,o])=>{if(r in e&&e[r]===o)return;this.propagateMediaState(r,o);let n=r.toLowerCase(),a=new d.CustomEvent(Lu[n],{composed:!0,detail:o});this.dispatchEvent(a)}),e=t}),this.hasAttribute(y.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat(y.NO_HOTKEYS,y.HOTKEYS,y.DEFAULT_STREAM_TYPE,y.DEFAULT_SUBTITLES,y.DEFAULT_DURATION,y.NO_MUTED_PREF,y.NO_VOLUME_PREF,y.LANG,y.LOOP)}get mediaStore(){return I(this,W)}set mediaStore(e){var t,r;if(I(this,W)&&((t=I(this,st))==null||t.call(this),at(this,st,void 0)),at(this,W,e),!I(this,W)&&!this.hasAttribute(y.NO_DEFAULT_STORE)){lt(this,Da,Jl).call(this);return}at(this,st,(r=I(this,W))==null?void 0:r.subscribe(I(this,Xo)))}get fullscreenElement(){var e;return(e=I(this,Zo))!=null?e:this}set fullscreenElement(e){var t;this.hasAttribute(y.FULLSCREEN_ELEMENT)&&this.removeAttribute(y.FULLSCREEN_ELEMENT),at(this,Zo,e),(t=I(this,W))==null||t.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}get defaultSubtitles(){return w(this,y.DEFAULT_SUBTITLES)}set defaultSubtitles(e){C(this,y.DEFAULT_SUBTITLES,e)}get defaultStreamType(){return P(this,y.DEFAULT_STREAM_TYPE)}set defaultStreamType(e){D(this,y.DEFAULT_STREAM_TYPE,e)}get defaultDuration(){return $(this,y.DEFAULT_DURATION)}set defaultDuration(e){B(this,y.DEFAULT_DURATION,e)}get noHotkeys(){return w(this,y.NO_HOTKEYS)}set noHotkeys(e){C(this,y.NO_HOTKEYS,e)}get keysUsed(){return P(this,y.KEYS_USED)}set keysUsed(e){D(this,y.KEYS_USED,e)}get liveEdgeOffset(){return $(this,y.LIVE_EDGE_OFFSET)}set liveEdgeOffset(e){B(this,y.LIVE_EDGE_OFFSET,e)}get noAutoSeekToLive(){return w(this,y.NO_AUTO_SEEK_TO_LIVE)}set noAutoSeekToLive(e){C(this,y.NO_AUTO_SEEK_TO_LIVE,e)}get noVolumePref(){return w(this,y.NO_VOLUME_PREF)}set noVolumePref(e){C(this,y.NO_VOLUME_PREF,e)}get noMutedPref(){return w(this,y.NO_MUTED_PREF)}set noMutedPref(e){C(this,y.NO_MUTED_PREF,e)}get noSubtitlesLangPref(){return w(this,y.NO_SUBTITLES_LANG_PREF)}set noSubtitlesLangPref(e){C(this,y.NO_SUBTITLES_LANG_PREF,e)}get noDefaultStore(){return w(this,y.NO_DEFAULT_STORE)}set noDefaultStore(e){C(this,y.NO_DEFAULT_STORE,e)}attributeChangedCallback(e,t,r){var o,n,a,l,c,p,h,v,g,m,A,f;if(super.attributeChangedCallback(e,t,r),e===y.NO_HOTKEYS)r!==t&&r===""?(this.hasAttribute(y.HOTKEYS)&&console.warn("Media Chrome: Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):r!==t&&r===null&&this.enableHotkeys();else if(e===y.HOTKEYS)I(this,Qt).value=r;else if(e===y.DEFAULT_SUBTITLES&&r!==t)(o=I(this,W))==null||o.dispatch({type:"optionschangerequest",detail:{defaultSubtitles:this.hasAttribute(y.DEFAULT_SUBTITLES)}});else if(e===y.DEFAULT_STREAM_TYPE)(a=I(this,W))==null||a.dispatch({type:"optionschangerequest",detail:{defaultStreamType:(n=this.getAttribute(y.DEFAULT_STREAM_TYPE))!=null?n:void 0}});else if(e===y.LIVE_EDGE_OFFSET)(l=I(this,W))==null||l.dispatch({type:"optionschangerequest",detail:{liveEdgeOffset:this.hasAttribute(y.LIVE_EDGE_OFFSET)?+this.getAttribute(y.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(y.SEEK_TO_LIVE_OFFSET)?void 0:+this.getAttribute(y.LIVE_EDGE_OFFSET)}});else if(e===y.SEEK_TO_LIVE_OFFSET)(c=I(this,W))==null||c.dispatch({type:"optionschangerequest",detail:{seekToLiveOffset:this.hasAttribute(y.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(y.SEEK_TO_LIVE_OFFSET):void 0}});else if(e===y.NO_AUTO_SEEK_TO_LIVE)(p=I(this,W))==null||p.dispatch({type:"optionschangerequest",detail:{noAutoSeekToLive:this.hasAttribute(y.NO_AUTO_SEEK_TO_LIVE)}});else if(e===y.FULLSCREEN_ELEMENT){let R=r?(h=this.getRootNode())==null?void 0:h.getElementById(r):void 0;at(this,Zo,R),(v=I(this,W))==null||v.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}else e===y.LANG&&r!==t?(Ou(r),(g=I(this,W))==null||g.dispatch({type:"optionschangerequest",detail:{mediaLang:r}})):e===y.LOOP&&r!==t?(m=I(this,W))==null||m.dispatch({type:b.MEDIA_LOOP_REQUEST,detail:r!=null}):e===y.NO_VOLUME_PREF&&r!==t?(A=I(this,W))==null||A.dispatch({type:"optionschangerequest",detail:{noVolumePref:this.hasAttribute(y.NO_VOLUME_PREF)}}):e===y.NO_MUTED_PREF&&r!==t&&((f=I(this,W))==null||f.dispatch({type:"optionschangerequest",detail:{noMutedPref:this.hasAttribute(y.NO_MUTED_PREF)}}))}connectedCallback(){var e,t;!I(this,W)&&!this.hasAttribute(y.NO_DEFAULT_STORE)&&lt(this,Da,Jl).call(this),(e=I(this,W))==null||e.dispatch({type:"documentelementchangerequest",detail:ee}),super.connectedCallback(),I(this,W)&&!I(this,st)&&at(this,st,(t=I(this,W))==null?void 0:t.subscribe(I(this,Xo))),I(this,Jo)!==void 0&&I(this,W)&&this.media&&setTimeout(()=>{var r,o,n;(o=(r=this.media)==null?void 0:r.textTracks)!=null&&o.length&&((n=I(this,W))==null||n.dispatch({type:b.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:I(this,Jo)}))},0),this.hasAttribute(y.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}disconnectedCallback(){var e,t,r,o,n;if((e=super.disconnectedCallback)==null||e.call(this),I(this,W)){let a=I(this,W).getState();at(this,Jo,!!((t=a.mediaSubtitlesShowing)!=null&&t.length)),(r=I(this,W))==null||r.dispatch({type:"documentelementchangerequest",detail:void 0}),(o=I(this,W))==null||o.dispatch({type:b.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:!1})}I(this,st)&&((n=I(this,st))==null||n.call(this),at(this,st,void 0))}mediaSetCallback(e){var t;super.mediaSetCallback(e),(t=I(this,W))==null||t.dispatch({type:"mediaelementchangerequest",detail:e}),e.hasAttribute("tabindex")||(e.tabIndex=-1)}mediaUnsetCallback(e){var t;super.mediaUnsetCallback(e),(t=I(this,W))==null||t.dispatch({type:"mediaelementchangerequest",detail:void 0})}propagateMediaState(e,t){mh(this.mediaStateReceivers,e,t)}associateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(t.has(e))return;let r=this.registerMediaStateReceiver.bind(this),o=this.unregisterMediaStateReceiver.bind(this),n=Fv(e,r,o);Object.values(b).forEach(a=>{e.addEventListener(a,I(this,Pa))}),t.set(e,n)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(!t.has(e))return;t.get(e)(),t.delete(e),Object.values(b).forEach(o=>{e.removeEventListener(o,I(this,Pa))})}registerMediaStateReceiver(e){if(!e)return;let t=this.mediaStateReceivers;t.indexOf(e)>-1||(t.push(e),I(this,W)&&Object.entries(I(this,W).getState()).forEach(([o,n])=>{mh([e],o,n)}))}unregisterMediaStateReceiver(e){let t=this.mediaStateReceivers,r=t.indexOf(e);r<0||t.splice(r,1)}enableHotkeys(){this.addEventListener("keydown",lt(this,Oa,jl))}disableHotkeys(){this.removeEventListener("keydown",lt(this,Oa,jl)),this.removeEventListener("keyup",lt(this,Ni,Ar))}get hotkeys(){return P(this,y.HOTKEYS)}set hotkeys(e){D(this,y.HOTKEYS,e)}keyboardShortcutHandler(e){var t,r,o,n,a,l,c,p,h;let v=e.target;if(((o=(r=(t=v.getAttribute(y.KEYS_USED))==null?void 0:t.split(" "))!=null?r:v==null?void 0:v.keysUsed)!=null?o:[]).map(O=>O==="Space"?" ":O).filter(Boolean).includes(e.key))return;let m,A,f;if(!(I(this,Qt).contains(`no${e.key.toLowerCase()}`)||e.key===" "&&I(this,Qt).contains("nospace")||e.shiftKey&&(e.key==="/"||e.key==="?")&&I(this,Qt).contains("noshift+/")))switch(e.key){case" ":case"k":m=I(this,W).getState().mediaPaused?b.MEDIA_PLAY_REQUEST:b.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new d.CustomEvent(m,{composed:!0,bubbles:!0}));break;case"m":m=this.mediaStore.getState().mediaVolumeLevel==="off"?b.MEDIA_UNMUTE_REQUEST:b.MEDIA_MUTE_REQUEST,this.dispatchEvent(new d.CustomEvent(m,{composed:!0,bubbles:!0}));break;case"f":m=this.mediaStore.getState().mediaIsFullscreen?b.MEDIA_EXIT_FULLSCREEN_REQUEST:b.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new d.CustomEvent(m,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new d.CustomEvent(b.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}));break;case"ArrowLeft":case"j":{let O=this.hasAttribute(y.KEYBOARD_BACKWARD_SEEK_OFFSET)?+this.getAttribute(y.KEYBOARD_BACKWARD_SEEK_OFFSET):dh;A=Math.max(((n=this.mediaStore.getState().mediaCurrentTime)!=null?n:0)-O,0),f=new d.CustomEvent(b.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(f);break}case"ArrowRight":case"l":{let O=this.hasAttribute(y.KEYBOARD_FORWARD_SEEK_OFFSET)?+this.getAttribute(y.KEYBOARD_FORWARD_SEEK_OFFSET):dh;A=Math.max(((a=this.mediaStore.getState().mediaCurrentTime)!=null?a:0)+O,0),f=new d.CustomEvent(b.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(f);break}case"ArrowUp":{let O=this.hasAttribute(y.KEYBOARD_UP_VOLUME_STEP)?+this.getAttribute(y.KEYBOARD_UP_VOLUME_STEP):ch;A=Math.min(((l=this.mediaStore.getState().mediaVolume)!=null?l:1)+O,1),f=new d.CustomEvent(b.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(f);break}case"ArrowDown":{let O=this.hasAttribute(y.KEYBOARD_DOWN_VOLUME_STEP)?+this.getAttribute(y.KEYBOARD_DOWN_VOLUME_STEP):ch;A=Math.max(((c=this.mediaStore.getState().mediaVolume)!=null?c:1)-O,0),f=new d.CustomEvent(b.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(f);break}case"<":{let O=(p=this.mediaStore.getState().mediaPlaybackRate)!=null?p:1;A=Math.max(O-uh,Uv).toFixed(2),f=new d.CustomEvent(b.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(f);break}case">":{let O=(h=this.mediaStore.getState().mediaPlaybackRate)!=null?h:1;A=Math.min(O+uh,Nv).toFixed(2),f=new d.CustomEvent(b.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(f);break}case"/":case"?":{e.shiftKey&&lt(this,ed,vh).call(this);break}case"p":{m=this.mediaStore.getState().mediaIsPip?b.MEDIA_EXIT_PIP_REQUEST:b.MEDIA_ENTER_PIP_REQUEST,f=new d.CustomEvent(m,{composed:!0,bubbles:!0}),this.dispatchEvent(f);break}default:break}}};Qt=new WeakMap;Zo=new WeakMap;W=new WeakMap;Ui=new WeakMap;Xo=new WeakMap;st=new WeakMap;Pa=new WeakMap;Jo=new WeakMap;Da=new WeakSet;Jl=function(){var i;this.mediaStore=lh({media:this.media,fullscreenElement:this.fullscreenElement,options:{defaultSubtitles:this.hasAttribute(y.DEFAULT_SUBTITLES),defaultDuration:this.hasAttribute(y.DEFAULT_DURATION)?+this.getAttribute(y.DEFAULT_DURATION):void 0,defaultStreamType:(i=this.getAttribute(y.DEFAULT_STREAM_TYPE))!=null?i:void 0,liveEdgeOffset:this.hasAttribute(y.LIVE_EDGE_OFFSET)?+this.getAttribute(y.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(y.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(y.SEEK_TO_LIVE_OFFSET):this.hasAttribute(y.LIVE_EDGE_OFFSET)?+this.getAttribute(y.LIVE_EDGE_OFFSET):void 0,noAutoSeekToLive:this.hasAttribute(y.NO_AUTO_SEEK_TO_LIVE),noVolumePref:this.hasAttribute(y.NO_VOLUME_PREF),noMutedPref:this.hasAttribute(y.NO_MUTED_PREF),noSubtitlesLangPref:this.hasAttribute(y.NO_SUBTITLES_LANG_PREF)}})};Ni=new WeakSet;Ar=function(i){let{key:e,shiftKey:t}=i;if(!(t&&(e==="/"||e==="?")||fh.includes(e))){this.removeEventListener("keyup",lt(this,Ni,Ar));return}this.keyboardShortcutHandler(i)};Oa=new WeakSet;jl=function(i){var e;let{metaKey:t,altKey:r,key:o,shiftKey:n}=i,a=n&&(o==="/"||o==="?");if(a&&((e=I(this,Ui))!=null&&e.open)){this.removeEventListener("keyup",lt(this,Ni,Ar));return}if(t||r||!a&&!fh.includes(o)){this.removeEventListener("keyup",lt(this,Ni,Ar));return}let l=i.target,c=l instanceof HTMLElement&&(l.tagName.toLowerCase()==="media-volume-range"||l.tagName.toLowerCase()==="media-time-range");[" ","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(o)&&!(I(this,Qt).contains(`no${o.toLowerCase()}`)||o===" "&&I(this,Qt).contains("nospace"))&&!c&&i.preventDefault(),this.addEventListener("keyup",lt(this,Ni,Ar),{once:!0})};ed=new WeakSet;vh=function(){I(this,Ui)||(at(this,Ui,ee.createElement("media-keyboard-shortcuts-dialog")),this.appendChild(I(this,Ui))),I(this,Ui).open=!0};var $v=Object.values(s),Hv=Object.values(Nl),gh=i=>{var e,t,r,o;let{observedAttributes:n}=i.constructor;!n&&((e=i.nodeName)!=null&&e.includes("-"))&&(d.customElements.upgrade(i),{observedAttributes:n}=i.constructor);let a=(o=(r=(t=i==null?void 0:i.getAttribute)==null?void 0:t.call(i,N.MEDIA_CHROME_ATTRIBUTES))==null?void 0:r.split)==null?void 0:o.call(r,/\s+/);return Array.isArray(n||a)?(n||a).filter(l=>$v.includes(l)):[]},Bv=i=>{var e,t;return(e=i.nodeName)!=null&&e.includes("-")&&d.customElements.get((t=i.nodeName)==null?void 0:t.toLowerCase())&&!(i instanceof d.customElements.get(i.nodeName.toLowerCase()))&&d.customElements.upgrade(i),Hv.some(r=>r in i)},id=i=>Bv(i)||!!gh(i).length,hh=i=>{var e;return(e=i==null?void 0:i.join)==null?void 0:e.call(i,":")},ph={[s.MEDIA_SUBTITLES_LIST]:Dt,[s.MEDIA_SUBTITLES_SHOWING]:Dt,[s.MEDIA_SEEKABLE]:hh,[s.MEDIA_BUFFERED]:i=>i==null?void 0:i.map(hh).join(" "),[s.MEDIA_PREVIEW_COORDS]:i=>i==null?void 0:i.join(" "),[s.MEDIA_RENDITION_LIST]:Cu,[s.MEDIA_AUDIO_TRACK_LIST]:Mu},Vv=async(i,e,t)=>{var r,o;if(i.isConnected||await ca(0),typeof t=="boolean"||t==null)return C(i,e,t);if(typeof t=="number")return B(i,e,t);if(typeof t=="string")return D(i,e,t);if(Array.isArray(t)&&!t.length)return i.removeAttribute(e);let n=(o=(r=ph[e])==null?void 0:r.call(ph,t))!=null?o:t;return i.setAttribute(e,n)},Wv=i=>{var e;return!!((e=i.closest)!=null&&e.call(i,'*[slot="media"]'))},Oi=(i,e)=>{if(Wv(i))return;let t=(o,n)=>{var a,l;id(o)&&n(o);let{children:c=[]}=o??{},p=(l=(a=o==null?void 0:o.shadowRoot)==null?void 0:a.children)!=null?l:[];[...c,...p].forEach(v=>Oi(v,n))},r=i==null?void 0:i.nodeName.toLowerCase();if(r.includes("-")&&!id(i)){d.customElements.whenDefined(r).then(()=>{t(i,e)});return}t(i,e)},mh=(i,e,t)=>{i.forEach(r=>{if(e in r){r[e]=t;return}let o=gh(r),n=e.toLowerCase();o.includes(n)&&Vv(r,n,t)})},Fv=(i,e,t)=>{Oi(i,e);let r=h=>{var v;let g=(v=h==null?void 0:h.composedPath()[0])!=null?v:h.target;e(g)},o=h=>{var v;let g=(v=h==null?void 0:h.composedPath()[0])!=null?v:h.target;t(g)};i.addEventListener(b.REGISTER_MEDIA_STATE_RECEIVER,r),i.addEventListener(b.UNREGISTER_MEDIA_STATE_RECEIVER,o);let n=h=>{h.forEach(v=>{let{addedNodes:g=[],removedNodes:m=[],type:A,target:f,attributeName:R}=v;A==="childList"?(Array.prototype.forEach.call(g,O=>Oi(O,e)),Array.prototype.forEach.call(m,O=>Oi(O,t))):A==="attributes"&&R===N.MEDIA_CHROME_ATTRIBUTES&&(id(f)?e(f):t(f))})},a=[],l=h=>{let v=h.target;v.name!=="media"&&(a.forEach(g=>Oi(g,t)),a=[...v.assignedElements({flatten:!0})],a.forEach(g=>Oi(g,e)))};i.addEventListener("slotchange",l);let c=new MutationObserver(n);return c.observe(i,{childList:!0,attributes:!0,subtree:!0}),()=>{Oi(i,t),i.removeEventListener("slotchange",l),c.disconnect(),i.removeEventListener(b.REGISTER_MEDIA_STATE_RECEIVER,r),i.removeEventListener(b.UNREGISTER_MEDIA_STATE_RECEIVER,o)}};d.customElements.get("media-controller")||d.customElements.define("media-controller",td);var Sr={PLACEMENT:"placement",BOUNDS:"bounds"};function Kv(i){return`
415
+ `}var gv=Object.values(s),Ev="sm:384 md:576 lg:768 xl:960";function bv(i){qu(i.target,i.contentRect.width)}function qu(i,e){var t;if(!i.isConnected)return;let r=(t=i.getAttribute(M.BREAKPOINTS))!=null?t:Ev,o=_v(r),n=yv(o,e),a=!1;if(Object.keys(o).forEach(l=>{if(n.includes(l)){i.hasAttribute(`breakpoint${l}`)||(i.setAttribute(`breakpoint${l}`,""),a=!0);return}i.hasAttribute(`breakpoint${l}`)&&(i.removeAttribute(`breakpoint${l}`),a=!0)}),a){let l=new CustomEvent(Li.BREAKPOINTS_CHANGE,{detail:n});i.dispatchEvent(l)}i.breakpointsComputed||(i.breakpointsComputed=!0,i.dispatchEvent(new CustomEvent(Li.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))}function _v(i){let e=i.split(/\s+/);return Object.fromEntries(e.map(t=>t.split(":")))}function yv(i,e){return Object.keys(i).filter(t=>e>=parseInt(i[t]))}var Mi=class extends d.HTMLElement{constructor(){if(super(),$e(this,Wl),$e(this,Fl),$e(this,Kl),$e(this,Go),$e(this,Sa),$e(this,Er),$e(this,Ta,0),$e(this,fr,null),$e(this,qo,null),$e(this,gr,void 0),this.breakpointsComputed=!1,$e(this,_a,new MutationObserver(Fe(this,Wl,Wu).bind(this))),$e(this,Ko,!1),$e(this,ya,t=>{He(this,Ko)||(setTimeout(()=>{bv(t),Ci(this,Ko,!1)},0),Ci(this,Ko,!0))}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let t=j(this.attributes),r=this.constructor.getTemplateHTML(t);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(r):this.shadowRoot.innerHTML=r}let e=this.querySelector(":scope > slot[slot=media]");e&&e.addEventListener("slotchange",()=>{if(!e.assignedElements({flatten:!0}).length){He(this,fr)&&this.mediaUnsetCallback(He(this,fr));return}this.handleMediaUpdated(this.media)})}static get observedAttributes(){return[M.AUTOHIDE,M.GESTURES_DISABLED].concat(gv).filter(e=>![s.MEDIA_RENDITION_LIST,s.MEDIA_AUDIO_TRACK_LIST,s.MEDIA_CHAPTERS_CUES,s.MEDIA_WIDTH,s.MEDIA_HEIGHT,s.MEDIA_ERROR,s.MEDIA_ERROR_MESSAGE].includes(e))}attributeChangedCallback(e,t,r){e.toLowerCase()==M.AUTOHIDE&&(this.autohide=r)}get media(){let e=this.querySelector(":scope > [slot=media]");return(e==null?void 0:e.nodeName)=="SLOT"&&(e=e.assignedElements({flatten:!0})[0]),e}async handleMediaUpdated(e){e&&(Ci(this,fr,e),e.localName.includes("-")&&await d.customElements.whenDefined(e.localName),this.mediaSetCallback(e))}connectedCallback(){var e;He(this,_a).observe(this,{childList:!0,subtree:!0}),Rt(this,He(this,ya));let r=this.getAttribute(M.AUDIO)!=null?E("audio player"):E("video player");this.setAttribute("role","region"),this.setAttribute("aria-label",r),this.handleMediaUpdated(this.media),this.setAttribute(M.USER_INACTIVE,""),qu(this,this.getBoundingClientRect().width),this.addEventListener("pointerdown",this),this.addEventListener("pointermove",this),this.addEventListener("pointerup",this),this.addEventListener("mouseleave",this),this.addEventListener("keyup",this),(e=d.window)==null||e.addEventListener("mouseup",this)}disconnectedCallback(){var e;He(this,_a).disconnect(),xt(this,He(this,ya)),this.media&&this.mediaUnsetCallback(this.media),(e=d.window)==null||e.removeEventListener("mouseup",this)}mediaSetCallback(e){}mediaUnsetCallback(e){Ci(this,fr,null)}handleEvent(e){switch(e.type){case"pointerdown":Ci(this,Ta,e.timeStamp);break;case"pointermove":Fe(this,Fl,Fu).call(this,e);break;case"pointerup":Fe(this,Kl,Ku).call(this,e);break;case"mouseleave":Fe(this,Go,Aa).call(this);break;case"mouseup":this.removeAttribute(M.KEYBOARD_CONTROL);break;case"keyup":Fe(this,Er,zo).call(this),this.setAttribute(M.KEYBOARD_CONTROL,"");break}}set autohide(e){let t=Number(e);Ci(this,gr,isNaN(t)?0:t)}get autohide(){return(He(this,gr)===void 0?2:He(this,gr)).toString()}get breakpoints(){return P(this,M.BREAKPOINTS)}set breakpoints(e){D(this,M.BREAKPOINTS,e)}get audio(){return w(this,M.AUDIO)}set audio(e){I(this,M.AUDIO,e)}get gesturesDisabled(){return w(this,M.GESTURES_DISABLED)}set gesturesDisabled(e){I(this,M.GESTURES_DISABLED,e)}get keyboardControl(){return w(this,M.KEYBOARD_CONTROL)}set keyboardControl(e){I(this,M.KEYBOARD_CONTROL,e)}get noAutohide(){return w(this,M.NO_AUTOHIDE)}set noAutohide(e){I(this,M.NO_AUTOHIDE,e)}get autohideOverControls(){return w(this,M.AUTOHIDE_OVER_CONTROLS)}set autohideOverControls(e){I(this,M.AUTOHIDE_OVER_CONTROLS,e)}get userInteractive(){return w(this,M.USER_INACTIVE)}set userInteractive(e){I(this,M.USER_INACTIVE,e)}};Ta=new WeakMap;fr=new WeakMap;qo=new WeakMap;gr=new WeakMap;_a=new WeakMap;Wl=new WeakSet;Wu=function(i){let e=this.media;for(let t of i){if(t.type!=="childList")continue;let r=t.removedNodes;for(let o of r){if(o.slot!="media"||t.target!=this)continue;let n=t.previousSibling&&t.previousSibling.previousElementSibling;if(!n||!e)this.mediaUnsetCallback(o);else{let a=n.slot!=="media";for(;(n=n.previousSibling)!==null;)n.slot=="media"&&(a=!1);a&&this.mediaUnsetCallback(o)}}if(e)for(let o of t.addedNodes)o===e&&this.handleMediaUpdated(e)}};Ko=new WeakMap;ya=new WeakMap;Fl=new WeakSet;Fu=function(i){if(i.pointerType!=="mouse"&&i.timeStamp-He(this,Ta)<250)return;Fe(this,Sa,Gl).call(this),clearTimeout(He(this,qo));let e=this.hasAttribute(M.AUTOHIDE_OVER_CONTROLS);([this,this.media].includes(i.target)||e)&&Fe(this,Er,zo).call(this)};Kl=new WeakSet;Ku=function(i){if(i.pointerType==="touch"){let e=!this.hasAttribute(M.USER_INACTIVE);[this,this.media].includes(i.target)&&e?Fe(this,Go,Aa).call(this):Fe(this,Er,zo).call(this)}else i.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e==null?void 0:e.localName))&&Fe(this,Er,zo).call(this)};Go=new WeakSet;Aa=function(){if(He(this,gr)<0||this.hasAttribute(M.USER_INACTIVE))return;this.setAttribute(M.USER_INACTIVE,"");let i=new d.CustomEvent(Li.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(i)};Sa=new WeakSet;Gl=function(){if(!this.hasAttribute(M.USER_INACTIVE))return;this.removeAttribute(M.USER_INACTIVE);let i=new d.CustomEvent(Li.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(i)};Er=new WeakSet;zo=function(){Fe(this,Sa,Gl).call(this),clearTimeout(He(this,qo));let i=parseInt(this.autohide);i<0||Ci(this,qo,setTimeout(()=>{Fe(this,Go,Aa).call(this)},i*1e3))};Mi.shadowRootOptions={mode:"open"};Mi.getTemplateHTML=fv;d.customElements.get("media-container")||d.customElements.define("media-container",Mi);var Gu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},fe=(i,e,t)=>(Gu(i,e,"read from private field"),t?t.call(i):e.get(i)),Yo=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ka=(i,e,t,r)=>(Gu(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),br,_r,La,Ri,Pt,zt,Yt=class{constructor(e,t,{defaultValue:r}={defaultValue:void 0}){Yo(this,Pt),Yo(this,br,void 0),Yo(this,_r,void 0),Yo(this,La,void 0),Yo(this,Ri,new Set),ka(this,br,e),ka(this,_r,t),ka(this,La,new Set(r))}[Symbol.iterator](){return fe(this,Pt,zt).values()}get length(){return fe(this,Pt,zt).size}get value(){var e;return(e=[...fe(this,Pt,zt)].join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(ka(this,Ri,new Set),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return[...fe(this,Pt,zt)][e]}values(){return fe(this,Pt,zt).values()}forEach(e,t){fe(this,Pt,zt).forEach(e,t)}add(...e){var t,r;e.forEach(o=>fe(this,Ri).add(o)),!(this.value===""&&!((t=fe(this,br))!=null&&t.hasAttribute(`${fe(this,_r)}`)))&&((r=fe(this,br))==null||r.setAttribute(`${fe(this,_r)}`,`${this.value}`))}remove(...e){var t;e.forEach(r=>fe(this,Ri).delete(r)),(t=fe(this,br))==null||t.setAttribute(`${fe(this,_r)}`,`${this.value}`)}contains(e){return fe(this,Pt,zt).has(e)}toggle(e,t){return typeof t<"u"?t?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,t){return this.remove(e),this.add(t),e===t}};br=new WeakMap;_r=new WeakMap;La=new WeakMap;Ri=new WeakMap;Pt=new WeakSet;zt=function(){return fe(this,Ri).size?fe(this,Ri):fe(this,La)};var Tv=(i="")=>i.split(/\s+/),zu=(i="")=>{let[e,t,r]=i.split(":"),o=r?decodeURIComponent(r):void 0;return{kind:e==="cc"?Ce.CAPTIONS:Ce.SUBTITLES,language:t,label:o}},xi=(i="",e={})=>Tv(i).map(t=>{let r=zu(t);return{...e,...r}}),zl=i=>i?Array.isArray(i)?i.map(e=>typeof e=="string"?zu(e):e):typeof i=="string"?xi(i):[i]:[],wa=({kind:i,label:e,language:t}={kind:"subtitles"})=>e?`${i==="captions"?"cc":"sb"}:${t}:${encodeURIComponent(e)}`:t,Dt=(i=[])=>Array.prototype.map.call(i,wa).join(" "),Av=(i,e)=>t=>t[i]===e,Yu=i=>{let e=Object.entries(i).map(([t,r])=>Av(t,r));return t=>e.every(r=>r(t))},Pi=(i,e=[],t=[])=>{let r=zl(t).map(Yu),o=n=>r.some(a=>a(n));Array.from(e).filter(o).forEach(n=>{n.mode=i})},Di=(i,e=()=>!0)=>{if(!(i!=null&&i.textTracks))return[];let t=typeof e=="function"?e:Yu(e);return Array.from(i.textTracks).filter(t)},Ia=i=>{var e;return!!((e=i.mediaSubtitlesShowing)!=null&&e.length)||i.hasAttribute(s.MEDIA_SUBTITLES_SHOWING)};var Zu=i=>{var e;let{media:t,fullscreenElement:r}=i;try{let o=r&&"requestFullscreen"in r?"requestFullscreen":r&&"webkitRequestFullScreen"in r?"webkitRequestFullScreen":void 0;if(o){let n=(e=r[o])==null?void 0:e.call(r);if(n instanceof Promise)return n.catch(()=>{})}else t!=null&&t.webkitEnterFullscreen?t.webkitEnterFullscreen():t!=null&&t.requestFullscreen&&t.requestFullscreen()}catch(o){console.error(o)}},Qu="exitFullscreen"in ee?"exitFullscreen":"webkitExitFullscreen"in ee?"webkitExitFullscreen":"webkitCancelFullScreen"in ee?"webkitCancelFullScreen":void 0,Xu=i=>{var e;let{documentElement:t}=i;if(Qu){let r=(e=t==null?void 0:t[Qu])==null?void 0:e.call(t);if(r instanceof Promise)return r.catch(()=>{})}},Qo="fullscreenElement"in ee?"fullscreenElement":"webkitFullscreenElement"in ee?"webkitFullscreenElement":void 0,Sv=i=>{let{documentElement:e,media:t}=i,r=e==null?void 0:e[Qo];return!r&&"webkitDisplayingFullscreen"in t&&"webkitPresentationMode"in t&&t.webkitDisplayingFullscreen&&t.webkitPresentationMode===Lu.FULLSCREEN?t:r},Ju=i=>{var e;let{media:t,documentElement:r,fullscreenElement:o=t}=i;if(!t||!r)return!1;let n=Sv(i);if(!n)return!1;if(n===o||n===t)return!0;if(n.localName.includes("-")){let a=n.shadowRoot;if(!(Qo in a))return Te(n,o);for(;a!=null&&a[Qo];){if(a[Qo]===o)return!0;a=(e=a[Qo])==null?void 0:e.shadowRoot}}return!1},kv="fullscreenEnabled"in ee?"fullscreenEnabled":"webkitFullscreenEnabled"in ee?"webkitFullscreenEnabled":void 0,ju=i=>{let{documentElement:e,media:t}=i;return!!(e!=null&&e[kv])||t&&"webkitSupportsFullscreen"in t};var Ca,Yl=()=>{var i,e;return Ca||(Ca=(e=(i=ee)==null?void 0:i.createElement)==null?void 0:e.call(i,"video"),Ca)},eh=async(i=Yl())=>{if(!i)return!1;let e=i.volume;i.volume=e/2+.1;let t=new AbortController,r=await Promise.race([Lv(i,t.signal),wv(i,e)]);return t.abort(),r},Lv=(i,e)=>new Promise(t=>{i.addEventListener("volumechange",()=>t(!0),{signal:e})}),wv=async(i,e)=>{for(let t=0;t<10;t++){if(i.volume===e)return!1;await ca(10)}return i.volume!==e},Iv=/.*Version\/.*Safari\/.*/.test(d.navigator.userAgent),Ql=(i=Yl())=>d.matchMedia("(display-mode: standalone)").matches&&Iv?!1:typeof(i==null?void 0:i.requestPictureInPicture)=="function",Zl=(i=Yl())=>ju({documentElement:ee,media:i}),th=Zl(),ih=Ql(),rh=!!d.WebKitPlaybackTargetAvailabilityEvent,oh=!!d.chrome;var yr=i=>Di(i.media,e=>[Ce.SUBTITLES,Ce.CAPTIONS].includes(e.kind)).sort((e,t)=>e.kind>=t.kind?1:-1),Xl=i=>Di(i.media,e=>e.mode===qt.SHOWING&&[Ce.SUBTITLES,Ce.CAPTIONS].includes(e.kind)),Ma=(i,e)=>{let t=yr(i),r=Xl(i),o=!!r.length;if(t.length){if(e===!1||o&&e!==!0)Pi(qt.DISABLED,t,r);else if(e===!0||!o&&e!==!1){let n=t[0],{options:a}=i;if(!(a!=null&&a.noSubtitlesLangPref)){let h=globalThis.localStorage.getItem("media-chrome-pref-subtitles-lang"),v=h?[h,...globalThis.navigator.languages]:globalThis.navigator.languages,g=t.filter(m=>v.some(A=>m.language.toLowerCase().startsWith(A.split("-")[0]))).sort((m,A)=>{let f=v.findIndex(O=>m.language.toLowerCase().startsWith(O.split("-")[0])),R=v.findIndex(O=>A.language.toLowerCase().startsWith(O.split("-")[0]));return f-R});g[0]&&(n=g[0])}let{language:l,label:c,kind:p}=n;Pi(qt.DISABLED,t,r),Pi(qt.SHOWING,t,[{language:l,label:c,kind:p}])}}},Ra=(i,e)=>i===e?!0:i==null||e==null||typeof i!=typeof e?!1:typeof i=="number"&&Number.isNaN(i)&&Number.isNaN(e)?!0:typeof i!="object"?!1:Array.isArray(i)?Cv(i,e):Object.entries(i).every(([t,r])=>t in e&&Ra(r,e[t])),Cv=(i,e)=>{let t=Array.isArray(i),r=Array.isArray(e);return t!==r?!1:t||r?i.length!==e.length?!1:i.every((o,n)=>Ra(o,e[n])):!0};var Mv=Object.values(Ze),xa,Rv=eh().then(i=>(xa=i,xa)),nh=async(...i)=>{await Promise.all(i.filter(e=>e).map(async e=>{if(!("localName"in e&&e instanceof d.HTMLElement))return;let t=e.localName;if(!t.includes("-"))return;let r=d.customElements.get(t);r&&e instanceof r||(await d.customElements.whenDefined(t),d.customElements.upgrade(e))}))},xv=new d.DOMParser,Pv=i=>i&&(xv.parseFromString(i,"text/html").body.textContent||i),Tr={mediaError:{get(i,e){let{media:t}=i;if((e==null?void 0:e.type)!=="playing")return t==null?void 0:t.error},mediaEvents:["emptied","error","playing"]},mediaErrorCode:{get(i,e){var t;let{media:r}=i;if((e==null?void 0:e.type)!=="playing")return(t=r==null?void 0:r.error)==null?void 0:t.code},mediaEvents:["emptied","error","playing"]},mediaErrorMessage:{get(i,e){var t,r;let{media:o}=i;if((e==null?void 0:e.type)!=="playing")return(r=(t=o==null?void 0:o.error)==null?void 0:t.message)!=null?r:""},mediaEvents:["emptied","error","playing"]},mediaWidth:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.videoWidth)!=null?e:0},mediaEvents:["resize"]},mediaHeight:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.videoHeight)!=null?e:0},mediaEvents:["resize"]},mediaPaused:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.paused)!=null?e:!0},set(i,e){var t;let{media:r}=e;r&&(i?r.pause():(t=r.play())==null||t.catch(()=>{}))},mediaEvents:["play","playing","pause","emptied"]},mediaHasPlayed:{get(i,e){let{media:t}=i;return t?e?e.type==="playing":!t.paused:!1},mediaEvents:["playing","emptied"]},mediaEnded:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.ended)!=null?e:!1},mediaEvents:["seeked","ended","emptied"]},mediaPlaybackRate:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.playbackRate)!=null?e:1},set(i,e){let{media:t}=e;t&&Number.isFinite(+i)&&(t.playbackRate=+i)},mediaEvents:["ratechange","loadstart"]},mediaMuted:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.muted)!=null?e:!1},set(i,e){let{media:t,options:{noMutedPref:r}={}}=e;if(t){t.muted=i;try{let o=d.localStorage.getItem("media-chrome-pref-muted")!==null,n=t.hasAttribute("muted");if(r){o&&d.localStorage.removeItem("media-chrome-pref-muted");return}if(n&&!o)return;d.localStorage.setItem("media-chrome-pref-muted",i?"true":"false")}catch(o){console.debug("Error setting muted pref",o)}}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(i,e)=>{let{options:{noMutedPref:t}}=e,{media:r}=e;if(!(!r||r.muted||t))try{let o=d.localStorage.getItem("media-chrome-pref-muted")==="true";Tr.mediaMuted.set(o,e),i(o)}catch(o){console.debug("Error getting muted pref",o)}}]},mediaLoop:{get(i){let{media:e}=i;return e==null?void 0:e.loop},set(i,e){let{media:t}=e;t&&(t.loop=i)},mediaEvents:["medialooprequest"]},mediaVolume:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.volume)!=null?e:1},set(i,e){let{media:t,options:{noVolumePref:r}={}}=e;if(t){try{i==null?d.localStorage.removeItem("media-chrome-pref-volume"):!t.hasAttribute("muted")&&!r&&d.localStorage.setItem("media-chrome-pref-volume",i.toString())}catch(o){console.debug("Error setting volume pref",o)}Number.isFinite(+i)&&(t.volume=+i)}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(i,e)=>{let{options:{noVolumePref:t}}=e;if(!t)try{let{media:r}=e;if(!r)return;let o=d.localStorage.getItem("media-chrome-pref-volume");if(o==null)return;Tr.mediaVolume.set(+o,e),i(+o)}catch(r){console.debug("Error getting volume pref",r)}}]},mediaVolumeLevel:{get(i){let{media:e}=i;return typeof(e==null?void 0:e.volume)>"u"?"high":e.muted||e.volume===0?"off":e.volume<.5?"low":e.volume<.75?"medium":"high"},mediaEvents:["volumechange"]},mediaCurrentTime:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.currentTime)!=null?e:0},set(i,e){let{media:t}=e;!t||!mr(i)||(t.currentTime=i)},mediaEvents:["timeupdate","loadedmetadata"]},mediaDuration:{get(i){let{media:e,options:{defaultDuration:t}={}}=i;return t&&(!e||!e.duration||Number.isNaN(e.duration)||!Number.isFinite(e.duration))?t:Number.isFinite(e==null?void 0:e.duration)?e.duration:Number.NaN},mediaEvents:["durationchange","loadedmetadata","emptied"]},mediaLoading:{get(i){let{media:e}=i;return(e==null?void 0:e.readyState)<3},mediaEvents:["waiting","playing","emptied"]},mediaSeekable:{get(i){var e;let{media:t}=i;if(!((e=t==null?void 0:t.seekable)!=null&&e.length))return;let r=t.seekable.start(0),o=t.seekable.end(t.seekable.length-1);if(!(!r&&!o))return[Number(r.toFixed(3)),Number(o.toFixed(3))]},mediaEvents:["loadedmetadata","emptied","progress","seekablechange"]},mediaBuffered:{get(i){var e;let{media:t}=i,r=(e=t==null?void 0:t.buffered)!=null?e:[];return Array.from(r).map((o,n)=>[Number(r.start(n).toFixed(3)),Number(r.end(n).toFixed(3))])},mediaEvents:["progress","emptied"]},mediaStreamType:{get(i){let{media:e,options:{defaultStreamType:t}={}}=i,r=[Ze.LIVE,Ze.ON_DEMAND].includes(t)?t:void 0;if(!e)return r;let{streamType:o}=e;if(Mv.includes(o))return o===Ze.UNKNOWN?r:o;let n=e.duration;return n===1/0?Ze.LIVE:Number.isFinite(n)?Ze.ON_DEMAND:r},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange"]},mediaTargetLiveWindow:{get(i){let{media:e}=i;if(!e)return Number.NaN;let{targetLiveWindow:t}=e,r=Tr.mediaStreamType.get(i);return(t==null||Number.isNaN(t))&&r===Ze.LIVE?0:t},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange","targetlivewindowchange"]},mediaTimeIsLive:{get(i){let{media:e,options:{liveEdgeOffset:t=10}={}}=i;if(!e)return!1;if(typeof e.liveEdgeStart=="number")return Number.isNaN(e.liveEdgeStart)?!1:e.currentTime>=e.liveEdgeStart;if(!(Tr.mediaStreamType.get(i)===Ze.LIVE))return!1;let o=e.seekable;if(!o)return!0;if(!o.length)return!1;let n=o.end(o.length-1)-t;return e.currentTime>=n},mediaEvents:["playing","timeupdate","progress","waiting","emptied"]},mediaSubtitlesList:{get(i){return yr(i).map(({kind:e,label:t,language:r})=>({kind:e,label:t,language:r}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},mediaSubtitlesShowing:{get(i){return Xl(i).map(({kind:e,label:t,language:r})=>({kind:e,label:t,language:r}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(i,e)=>{var t,r;let{media:o,options:n}=e;if(!o)return;let a=l=>{var c;!n.defaultSubtitles||l&&![Ce.CAPTIONS,Ce.SUBTITLES].includes((c=l==null?void 0:l.track)==null?void 0:c.kind)||Ma(e,!0)};return o.addEventListener("loadstart",a),(t=o.textTracks)==null||t.addEventListener("addtrack",a),(r=o.textTracks)==null||r.addEventListener("removetrack",a),()=>{var l,c;o.removeEventListener("loadstart",a),(l=o.textTracks)==null||l.removeEventListener("addtrack",a),(c=o.textTracks)==null||c.removeEventListener("removetrack",a)}}]},mediaChaptersCues:{get(i){var e;let{media:t}=i;if(!t)return[];let[r]=Di(t,{kind:Ce.CHAPTERS});return Array.from((e=r==null?void 0:r.cues)!=null?e:[]).map(({text:o,startTime:n,endTime:a})=>({text:Pv(o),startTime:n,endTime:a}))},mediaEvents:["loadstart","loadedmetadata"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:r}=e;if(!r)return;let o=r.querySelector('track[kind="chapters"][default][src]'),n=(t=r.shadowRoot)==null?void 0:t.querySelector(':is(video,audio) > track[kind="chapters"][default][src]');return o==null||o.addEventListener("load",i),n==null||n.addEventListener("load",i),()=>{o==null||o.removeEventListener("load",i),n==null||n.removeEventListener("load",i)}}]},mediaIsPip:{get(i){var e,t;let{media:r,documentElement:o}=i;if(!r||!o||!o.pictureInPictureElement)return!1;if(o.pictureInPictureElement===r)return!0;if(o.pictureInPictureElement instanceof HTMLMediaElement)return(e=r.localName)!=null&&e.includes("-")?Te(r,o.pictureInPictureElement):!1;if(o.pictureInPictureElement.localName.includes("-")){let n=o.pictureInPictureElement.shadowRoot;for(;n!=null&&n.pictureInPictureElement;){if(n.pictureInPictureElement===r)return!0;n=(t=n.pictureInPictureElement)==null?void 0:t.shadowRoot}}return!1},set(i,e){let{media:t}=e;if(t)if(i){if(!ee.pictureInPictureEnabled){console.warn("MediaChrome: Picture-in-picture is not enabled");return}if(!t.requestPictureInPicture){console.warn("MediaChrome: The current media does not support picture-in-picture");return}let r=()=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};t.requestPictureInPicture().catch(o=>{if(o.code===11){if(!t.src){console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a src set.");return}if(t.readyState===0&&t.preload==="none"){let n=()=>{t.removeEventListener("loadedmetadata",a),t.preload="none"},a=()=>{t.requestPictureInPicture().catch(r),n()};t.addEventListener("loadedmetadata",a),t.preload="metadata",setTimeout(()=>{t.readyState===0&&r(),n()},1e3)}else throw o}else throw o})}else ee.pictureInPictureElement&&ee.exitPictureInPicture()},mediaEvents:["enterpictureinpicture","leavepictureinpicture"]},mediaRenditionList:{get(i){var e;let{media:t}=i;return[...(e=t==null?void 0:t.videoRenditions)!=null?e:[]].map(r=>({...r}))},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaRenditionSelected:{get(i){var e,t,r;let{media:o}=i;return(r=(t=o==null?void 0:o.videoRenditions)==null?void 0:t[(e=o.videoRenditions)==null?void 0:e.selectedIndex])==null?void 0:r.id},set(i,e){let{media:t}=e;if(!(t!=null&&t.videoRenditions)){console.warn("MediaController: Rendition selection not supported by this media.");return}let r=i,o=Array.prototype.findIndex.call(t.videoRenditions,n=>n.id==r);t.videoRenditions.selectedIndex!=o&&(t.videoRenditions.selectedIndex=o)},mediaEvents:["emptied"],videoRenditionsEvents:["addrendition","removerendition","change"]},mediaAudioTrackList:{get(i){var e;let{media:t}=i;return[...(e=t==null?void 0:t.audioTracks)!=null?e:[]]},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaAudioTrackEnabled:{get(i){var e,t;let{media:r}=i;return(t=[...(e=r==null?void 0:r.audioTracks)!=null?e:[]].find(o=>o.enabled))==null?void 0:t.id},set(i,e){let{media:t}=e;if(!(t!=null&&t.audioTracks)){console.warn("MediaChrome: Audio track selection not supported by this media.");return}let r=i;for(let o of t.audioTracks)o.enabled=r==o.id},mediaEvents:["emptied"],audioTracksEvents:["addtrack","removetrack","change"]},mediaIsFullscreen:{get(i){return Ju(i)},set(i,e,t){var r;i?(Zu(e),t.detail&&((r=e.media)==null||r.focus())):Xu(e)},rootEvents:["fullscreenchange","webkitfullscreenchange"],mediaEvents:["webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"]},mediaIsCasting:{get(i){var e;let{media:t}=i;return!(t!=null&&t.remote)||((e=t.remote)==null?void 0:e.state)==="disconnected"?!1:!!t.remote.state},set(i,e){var t,r;let{media:o}=e;if(o&&!(i&&((t=o.remote)==null?void 0:t.state)!=="disconnected")&&!(!i&&((r=o.remote)==null?void 0:r.state)!=="connected")){if(typeof o.remote.prompt!="function"){console.warn("MediaChrome: Casting is not supported in this environment");return}o.remote.prompt().catch(()=>{})}},remoteEvents:["connect","connecting","disconnect"]},mediaIsAirplaying:{get(){return!1},set(i,e){let{media:t}=e;if(t){if(!(t.webkitShowPlaybackTargetPicker&&d.WebKitPlaybackTargetAvailabilityEvent)){console.error("MediaChrome: received a request to select AirPlay but AirPlay is not supported in this environment");return}t.webkitShowPlaybackTargetPicker()}},mediaEvents:["webkitcurrentplaybacktargetiswirelesschanged"]},mediaFullscreenUnavailable:{get(i){let{media:e}=i;if(!th||!Zl(e))return Me.UNSUPPORTED}},mediaPipUnavailable:{get(i){let{media:e}=i;if(!ih||!Ql(e))return Me.UNSUPPORTED;if(e!=null&&e.disablePictureInPicture)return Me.UNAVAILABLE}},mediaVolumeUnavailable:{get(i){let{media:e}=i;if(xa===!1||(e==null?void 0:e.volume)==null)return Me.UNSUPPORTED},stateOwnersUpdateHandlers:[i=>{xa==null&&Rv.then(e=>i(e?void 0:Me.UNSUPPORTED))}]},mediaCastUnavailable:{get(i,{availability:e="not-available"}={}){var t;let{media:r}=i;if(!oh||!((t=r==null?void 0:r.remote)!=null&&t.state))return Me.UNSUPPORTED;if(!(e==null||e==="available"))return Me.UNAVAILABLE},stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:r}=e;return r?(r.disableRemotePlayback||r.hasAttribute("disableremoteplayback")||(t=r==null?void 0:r.remote)==null||t.watchAvailability(n=>{i({availability:n?"available":"not-available"})}).catch(n=>{n.name==="NotSupportedError"?i({availability:null}):i({availability:"not-available"})}),()=>{var n;(n=r==null?void 0:r.remote)==null||n.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaAirplayUnavailable:{get(i,e){if(!rh)return Me.UNSUPPORTED;if((e==null?void 0:e.availability)==="not-available")return Me.UNAVAILABLE},mediaEvents:["webkitplaybacktargetavailabilitychanged"],stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:r}=e;return r?(r.disableRemotePlayback||r.hasAttribute("disableremoteplayback")||(t=r==null?void 0:r.remote)==null||t.watchAvailability(n=>{i({availability:n?"available":"not-available"})}).catch(n=>{n.name==="NotSupportedError"?i({availability:null}):i({availability:"not-available"})}),()=>{var n;(n=r==null?void 0:r.remote)==null||n.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaRenditionUnavailable:{get(i){var e;let{media:t}=i;if(!(t!=null&&t.videoRenditions))return Me.UNSUPPORTED;if(!((e=t.videoRenditions)!=null&&e.length))return Me.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaAudioTrackUnavailable:{get(i){var e,t;let{media:r}=i;if(!(r!=null&&r.audioTracks))return Me.UNSUPPORTED;if(((t=(e=r.audioTracks)==null?void 0:e.length)!=null?t:0)<=1)return Me.UNAVAILABLE},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaLang:{get(i){let{options:{mediaLang:e}={}}=i;return e??"en"}}};var ah={[b.MEDIA_PREVIEW_REQUEST](i,e,{detail:t}){var r,o,n;let{media:a}=e,l=t??void 0,c,p;if(a&&l!=null){let[m]=Di(a,{kind:Ce.METADATA,label:"thumbnails"}),A=Array.prototype.find.call((r=m==null?void 0:m.cues)!=null?r:[],(f,R,O)=>R===0?f.endTime>l:R===O.length-1?f.startTime<=l:f.startTime<=l&&f.endTime>l);if(A){let f=/'^(?:[a-z]+:)?\/\//i.test(A.text)||(o=a==null?void 0:a.querySelector('track[label="thumbnails"]'))==null?void 0:o.src,R=new URL(A.text,f);p=new URLSearchParams(R.hash).get("#xywh").split(",").map(Oe=>+Oe),c=R.href}}let h=i.mediaDuration.get(e),g=(n=i.mediaChaptersCues.get(e).find((m,A,f)=>A===f.length-1&&h===m.endTime?m.startTime<=l&&m.endTime>=l:m.startTime<=l&&m.endTime>l))==null?void 0:n.text;return t!=null&&g==null&&(g=""),{mediaPreviewTime:l,mediaPreviewImage:c,mediaPreviewCoords:p,mediaPreviewChapter:g}},[b.MEDIA_PAUSE_REQUEST](i,e){i["mediaPaused"].set(!0,e)},[b.MEDIA_PLAY_REQUEST](i,e){var t,r,o,n;let a="mediaPaused",c=i.mediaStreamType.get(e)===Ze.LIVE,p=!((t=e.options)!=null&&t.noAutoSeekToLive),h=i.mediaTargetLiveWindow.get(e)>0;if(c&&p&&!h){let v=(r=i.mediaSeekable.get(e))==null?void 0:r[1];if(v){let g=(n=(o=e.options)==null?void 0:o.seekToLiveOffset)!=null?n:0,m=v-g;i.mediaCurrentTime.set(m,e)}}i[a].set(!1,e)},[b.MEDIA_PLAYBACK_RATE_REQUEST](i,e,{detail:t}){let r="mediaPlaybackRate",o=t;i[r].set(o,e)},[b.MEDIA_MUTE_REQUEST](i,e){i["mediaMuted"].set(!0,e)},[b.MEDIA_UNMUTE_REQUEST](i,e){let t="mediaMuted";i.mediaVolume.get(e)||i.mediaVolume.set(.25,e),i[t].set(!1,e)},[b.MEDIA_LOOP_REQUEST](i,e,{detail:t}){let r="mediaLoop",o=!!t;return i[r].set(o,e),{mediaLoop:o}},[b.MEDIA_VOLUME_REQUEST](i,e,{detail:t}){let r="mediaVolume",o=t;o&&i.mediaMuted.get(e)&&i.mediaMuted.set(!1,e),i[r].set(o,e)},[b.MEDIA_SEEK_REQUEST](i,e,{detail:t}){let r="mediaCurrentTime",o=t;i[r].set(o,e)},[b.MEDIA_SEEK_TO_LIVE_REQUEST](i,e){var t,r,o;let n="mediaCurrentTime",a=(t=i.mediaSeekable.get(e))==null?void 0:t[1];if(Number.isNaN(Number(a)))return;let l=(o=(r=e.options)==null?void 0:r.seekToLiveOffset)!=null?o:0,c=a-l;i[n].set(c,e)},[b.MEDIA_SHOW_SUBTITLES_REQUEST](i,e,{detail:t}){var r;let{options:o}=e,n=yr(e),a=zl(t),l=(r=a[0])==null?void 0:r.language;l&&!o.noSubtitlesLangPref&&d.localStorage.setItem("media-chrome-pref-subtitles-lang",l),Pi(qt.SHOWING,n,a)},[b.MEDIA_DISABLE_SUBTITLES_REQUEST](i,e,{detail:t}){let r=yr(e),o=t??[];Pi(qt.DISABLED,r,o)},[b.MEDIA_TOGGLE_SUBTITLES_REQUEST](i,e,{detail:t}){Ma(e,t)},[b.MEDIA_RENDITION_REQUEST](i,e,{detail:t}){let r="mediaRenditionSelected",o=t;i[r].set(o,e)},[b.MEDIA_AUDIO_TRACK_REQUEST](i,e,{detail:t}){let r="mediaAudioTrackEnabled",o=t;i[r].set(o,e)},[b.MEDIA_ENTER_PIP_REQUEST](i,e){let t="mediaIsPip";i.mediaIsFullscreen.get(e)&&i.mediaIsFullscreen.set(!1,e),i[t].set(!0,e)},[b.MEDIA_EXIT_PIP_REQUEST](i,e){i["mediaIsPip"].set(!1,e)},[b.MEDIA_ENTER_FULLSCREEN_REQUEST](i,e,t){let r="mediaIsFullscreen";i.mediaIsPip.get(e)&&i.mediaIsPip.set(!1,e),i[r].set(!0,e,t)},[b.MEDIA_EXIT_FULLSCREEN_REQUEST](i,e){i["mediaIsFullscreen"].set(!1,e)},[b.MEDIA_ENTER_CAST_REQUEST](i,e){let t="mediaIsCasting";i.mediaIsFullscreen.get(e)&&i.mediaIsFullscreen.set(!1,e),i[t].set(!0,e)},[b.MEDIA_EXIT_CAST_REQUEST](i,e){i["mediaIsCasting"].set(!1,e)},[b.MEDIA_AIRPLAY_REQUEST](i,e){i["mediaIsAirplaying"].set(!0,e)}};var sh=({media:i,fullscreenElement:e,documentElement:t,stateMediator:r=Tr,requestMap:o=ah,options:n={},monitorStateOwnersOnlyWithSubscriptions:a=!0})=>{let l=[],c={options:{...n}},p=Object.freeze({mediaPreviewTime:void 0,mediaPreviewImage:void 0,mediaPreviewCoords:void 0,mediaPreviewChapter:void 0}),h=f=>{f!=null&&(Ra(f,p)||(p=Object.freeze({...p,...f}),l.forEach(R=>R(p))))},v=()=>{let f=Object.entries(r).reduce((R,[O,{get:Oe}])=>(R[O]=Oe(c),R),{});h(f)},g={},m,A=async(f,R)=>{var O,Oe,ot,Lo,ar,Dc,El,k,K,ne,te,G,pe,It,wo,Oc;let bm=!!m;if(m={...c,...m??{},...f},bm)return;await nh(...Object.values(f));let sr=l.length>0&&R===0&&a,Uc=c.media!==m.media,Nc=((O=c.media)==null?void 0:O.textTracks)!==((Oe=m.media)==null?void 0:Oe.textTracks),$c=((ot=c.media)==null?void 0:ot.videoRenditions)!==((Lo=m.media)==null?void 0:Lo.videoRenditions),Hc=((ar=c.media)==null?void 0:ar.audioTracks)!==((Dc=m.media)==null?void 0:Dc.audioTracks),Bc=((El=c.media)==null?void 0:El.remote)!==((k=m.media)==null?void 0:k.remote),Vc=c.documentElement!==m.documentElement,Wc=!!c.media&&(Uc||sr),Fc=!!((K=c.media)!=null&&K.textTracks)&&(Nc||sr),Kc=!!((ne=c.media)!=null&&ne.videoRenditions)&&($c||sr),qc=!!((te=c.media)!=null&&te.audioTracks)&&(Hc||sr),Gc=!!((G=c.media)!=null&&G.remote)&&(Bc||sr),zc=!!c.documentElement&&(Vc||sr),bl=Wc||Fc||Kc||qc||Gc||zc,lr=l.length===0&&R===1&&a,Yc=!!m.media&&(Uc||lr),L=!!((pe=m.media)!=null&&pe.textTracks)&&(Nc||lr),Qc=!!((It=m.media)!=null&&It.videoRenditions)&&($c||lr),Zc=!!((wo=m.media)!=null&&wo.audioTracks)&&(Hc||lr),Xc=!!((Oc=m.media)!=null&&Oc.remote)&&(Bc||lr),Jc=!!m.documentElement&&(Vc||lr),jc=Yc||L||Qc||Zc||Xc||Jc;if(!(bl||jc)){Object.entries(m).forEach(([z,Io])=>{c[z]=Io}),v(),m=void 0;return}Object.entries(r).forEach(([z,{get:Io,mediaEvents:_m=[],textTracksEvents:ym=[],videoRenditionsEvents:Tm=[],audioTracksEvents:Am=[],remoteEvents:Sm=[],rootEvents:km=[],stateOwnersUpdateHandlers:Lm=[]}])=>{g[z]||(g[z]={});let Ue=ie=>{let ue=Io(c,ie);h({[z]:ue})},ve;ve=g[z].mediaEvents,_m.forEach(ie=>{ve&&Wc&&(c.media.removeEventListener(ie,ve),g[z].mediaEvents=void 0),Yc&&(m.media.addEventListener(ie,Ue),g[z].mediaEvents=Ue)}),ve=g[z].textTracksEvents,ym.forEach(ie=>{var ue,Qe;ve&&Fc&&((ue=c.media.textTracks)==null||ue.removeEventListener(ie,ve),g[z].textTracksEvents=void 0),L&&((Qe=m.media.textTracks)==null||Qe.addEventListener(ie,Ue),g[z].textTracksEvents=Ue)}),ve=g[z].videoRenditionsEvents,Tm.forEach(ie=>{var ue,Qe;ve&&Kc&&((ue=c.media.videoRenditions)==null||ue.removeEventListener(ie,ve),g[z].videoRenditionsEvents=void 0),Qc&&((Qe=m.media.videoRenditions)==null||Qe.addEventListener(ie,Ue),g[z].videoRenditionsEvents=Ue)}),ve=g[z].audioTracksEvents,Am.forEach(ie=>{var ue,Qe;ve&&qc&&((ue=c.media.audioTracks)==null||ue.removeEventListener(ie,ve),g[z].audioTracksEvents=void 0),Zc&&((Qe=m.media.audioTracks)==null||Qe.addEventListener(ie,Ue),g[z].audioTracksEvents=Ue)}),ve=g[z].remoteEvents,Sm.forEach(ie=>{var ue,Qe;ve&&Gc&&((ue=c.media.remote)==null||ue.removeEventListener(ie,ve),g[z].remoteEvents=void 0),Xc&&((Qe=m.media.remote)==null||Qe.addEventListener(ie,Ue),g[z].remoteEvents=Ue)}),ve=g[z].rootEvents,km.forEach(ie=>{ve&&zc&&(c.documentElement.removeEventListener(ie,ve),g[z].rootEvents=void 0),Jc&&(m.documentElement.addEventListener(ie,Ue),g[z].rootEvents=Ue)});let Xn=g[z].stateOwnersUpdateHandlers;if(Xn&&bl&&(Array.isArray(Xn)?Xn:[Xn]).forEach(ue=>{typeof ue=="function"&&ue()}),jc){let ie=Lm.map(ue=>ue(Ue,m)).filter(ue=>typeof ue=="function");g[z].stateOwnersUpdateHandlers=ie.length===1?ie[0]:ie}else bl&&(g[z].stateOwnersUpdateHandlers=void 0)}),Object.entries(m).forEach(([z,Io])=>{c[z]=Io}),v(),m=void 0};return A({media:i,fullscreenElement:e,documentElement:t,options:n}),{dispatch(f){let{type:R,detail:O}=f;if(o[R]&&p.mediaErrorCode==null){h(o[R](r,c,f));return}R==="mediaelementchangerequest"?A({media:O}):R==="fullscreenelementchangerequest"?A({fullscreenElement:O}):R==="documentelementchangerequest"?A({documentElement:O}):R==="optionschangerequest"&&(Object.entries(O??{}).forEach(([Oe,ot])=>{c.options[Oe]=ot}),v())},getState(){return p},subscribe(f){return A({},l.length+1),l.push(f),f(p),()=>{let R=l.indexOf(f);R>=0&&(A({},l.length-1),l.splice(R,1))}}}};var rd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},C=(i,e,t)=>(rd(i,e,"read from private field"),t?t.call(i):e.get(i)),Ke=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},at=(i,e,t,r)=>(rd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),lt=(i,e,t)=>(rd(i,e,"access private method"),t),Qt,Zo,W,Ui,Xo,st,Pa,Jo,Da,Jl,Ni,Ar,Oa,jl,ed,mh,vh=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter"," ","f","m","k","c","l","j",">","<","p"],lh=10,dh=.025,ch=.25,Dv=.25,Ov=2,y={DEFAULT_SUBTITLES:"defaultsubtitles",DEFAULT_STREAM_TYPE:"defaultstreamtype",DEFAULT_DURATION:"defaultduration",FULLSCREEN_ELEMENT:"fullscreenelement",HOTKEYS:"hotkeys",KEYBOARD_BACKWARD_SEEK_OFFSET:"keyboardbackwardseekoffset",KEYBOARD_FORWARD_SEEK_OFFSET:"keyboardforwardseekoffset",KEYBOARD_DOWN_VOLUME_STEP:"keyboarddownvolumestep",KEYBOARD_UP_VOLUME_STEP:"keyboardupvolumestep",KEYS_USED:"keysused",LANG:"lang",LOOP:"loop",LIVE_EDGE_OFFSET:"liveedgeoffset",NO_AUTO_SEEK_TO_LIVE:"noautoseektolive",NO_DEFAULT_STORE:"nodefaultstore",NO_HOTKEYS:"nohotkeys",NO_MUTED_PREF:"nomutedpref",NO_SUBTITLES_LANG_PREF:"nosubtitleslangpref",NO_VOLUME_PREF:"novolumepref",SEEK_TO_LIVE_OFFSET:"seektoliveoffset"},td=class extends Mi{constructor(){super(),Ke(this,Da),Ke(this,Ni),Ke(this,Oa),Ke(this,ed),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,Ke(this,Qt,new Yt(this,y.HOTKEYS)),Ke(this,Zo,void 0),Ke(this,W,void 0),Ke(this,Ui,null),Ke(this,Xo,void 0),Ke(this,st,void 0),Ke(this,Pa,t=>{var r;(r=C(this,W))==null||r.dispatch(t)}),Ke(this,Jo,void 0),this.associateElement(this);let e={};at(this,Xo,t=>{Object.entries(t).forEach(([r,o])=>{if(r in e&&e[r]===o)return;this.propagateMediaState(r,o);let n=r.toLowerCase(),a=new d.CustomEvent(ku[n],{composed:!0,detail:o});this.dispatchEvent(a)}),e=t}),this.hasAttribute(y.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat(y.NO_HOTKEYS,y.HOTKEYS,y.DEFAULT_STREAM_TYPE,y.DEFAULT_SUBTITLES,y.DEFAULT_DURATION,y.NO_MUTED_PREF,y.NO_VOLUME_PREF,y.LANG,y.LOOP)}get mediaStore(){return C(this,W)}set mediaStore(e){var t,r;if(C(this,W)&&((t=C(this,st))==null||t.call(this),at(this,st,void 0)),at(this,W,e),!C(this,W)&&!this.hasAttribute(y.NO_DEFAULT_STORE)){lt(this,Da,Jl).call(this);return}at(this,st,(r=C(this,W))==null?void 0:r.subscribe(C(this,Xo)))}get fullscreenElement(){var e;return(e=C(this,Zo))!=null?e:this}set fullscreenElement(e){var t;this.hasAttribute(y.FULLSCREEN_ELEMENT)&&this.removeAttribute(y.FULLSCREEN_ELEMENT),at(this,Zo,e),(t=C(this,W))==null||t.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}get defaultSubtitles(){return w(this,y.DEFAULT_SUBTITLES)}set defaultSubtitles(e){I(this,y.DEFAULT_SUBTITLES,e)}get defaultStreamType(){return P(this,y.DEFAULT_STREAM_TYPE)}set defaultStreamType(e){D(this,y.DEFAULT_STREAM_TYPE,e)}get defaultDuration(){return $(this,y.DEFAULT_DURATION)}set defaultDuration(e){B(this,y.DEFAULT_DURATION,e)}get noHotkeys(){return w(this,y.NO_HOTKEYS)}set noHotkeys(e){I(this,y.NO_HOTKEYS,e)}get keysUsed(){return P(this,y.KEYS_USED)}set keysUsed(e){D(this,y.KEYS_USED,e)}get liveEdgeOffset(){return $(this,y.LIVE_EDGE_OFFSET)}set liveEdgeOffset(e){B(this,y.LIVE_EDGE_OFFSET,e)}get noAutoSeekToLive(){return w(this,y.NO_AUTO_SEEK_TO_LIVE)}set noAutoSeekToLive(e){I(this,y.NO_AUTO_SEEK_TO_LIVE,e)}get noVolumePref(){return w(this,y.NO_VOLUME_PREF)}set noVolumePref(e){I(this,y.NO_VOLUME_PREF,e)}get noMutedPref(){return w(this,y.NO_MUTED_PREF)}set noMutedPref(e){I(this,y.NO_MUTED_PREF,e)}get noSubtitlesLangPref(){return w(this,y.NO_SUBTITLES_LANG_PREF)}set noSubtitlesLangPref(e){I(this,y.NO_SUBTITLES_LANG_PREF,e)}get noDefaultStore(){return w(this,y.NO_DEFAULT_STORE)}set noDefaultStore(e){I(this,y.NO_DEFAULT_STORE,e)}attributeChangedCallback(e,t,r){var o,n,a,l,c,p,h,v,g,m,A,f;if(super.attributeChangedCallback(e,t,r),e===y.NO_HOTKEYS)r!==t&&r===""?(this.hasAttribute(y.HOTKEYS)&&console.warn("Media Chrome: Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):r!==t&&r===null&&this.enableHotkeys();else if(e===y.HOTKEYS)C(this,Qt).value=r;else if(e===y.DEFAULT_SUBTITLES&&r!==t)(o=C(this,W))==null||o.dispatch({type:"optionschangerequest",detail:{defaultSubtitles:this.hasAttribute(y.DEFAULT_SUBTITLES)}});else if(e===y.DEFAULT_STREAM_TYPE)(a=C(this,W))==null||a.dispatch({type:"optionschangerequest",detail:{defaultStreamType:(n=this.getAttribute(y.DEFAULT_STREAM_TYPE))!=null?n:void 0}});else if(e===y.LIVE_EDGE_OFFSET)(l=C(this,W))==null||l.dispatch({type:"optionschangerequest",detail:{liveEdgeOffset:this.hasAttribute(y.LIVE_EDGE_OFFSET)?+this.getAttribute(y.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(y.SEEK_TO_LIVE_OFFSET)?void 0:+this.getAttribute(y.LIVE_EDGE_OFFSET)}});else if(e===y.SEEK_TO_LIVE_OFFSET)(c=C(this,W))==null||c.dispatch({type:"optionschangerequest",detail:{seekToLiveOffset:this.hasAttribute(y.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(y.SEEK_TO_LIVE_OFFSET):void 0}});else if(e===y.NO_AUTO_SEEK_TO_LIVE)(p=C(this,W))==null||p.dispatch({type:"optionschangerequest",detail:{noAutoSeekToLive:this.hasAttribute(y.NO_AUTO_SEEK_TO_LIVE)}});else if(e===y.FULLSCREEN_ELEMENT){let R=r?(h=this.getRootNode())==null?void 0:h.getElementById(r):void 0;at(this,Zo,R),(v=C(this,W))==null||v.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}else e===y.LANG&&r!==t?(Du(r),(g=C(this,W))==null||g.dispatch({type:"optionschangerequest",detail:{mediaLang:r}})):e===y.LOOP&&r!==t?(m=C(this,W))==null||m.dispatch({type:b.MEDIA_LOOP_REQUEST,detail:r!=null}):e===y.NO_VOLUME_PREF&&r!==t?(A=C(this,W))==null||A.dispatch({type:"optionschangerequest",detail:{noVolumePref:this.hasAttribute(y.NO_VOLUME_PREF)}}):e===y.NO_MUTED_PREF&&r!==t&&((f=C(this,W))==null||f.dispatch({type:"optionschangerequest",detail:{noMutedPref:this.hasAttribute(y.NO_MUTED_PREF)}}))}connectedCallback(){var e,t;!C(this,W)&&!this.hasAttribute(y.NO_DEFAULT_STORE)&&lt(this,Da,Jl).call(this),(e=C(this,W))==null||e.dispatch({type:"documentelementchangerequest",detail:ee}),super.connectedCallback(),C(this,W)&&!C(this,st)&&at(this,st,(t=C(this,W))==null?void 0:t.subscribe(C(this,Xo))),C(this,Jo)!==void 0&&C(this,W)&&this.media&&setTimeout(()=>{var r,o,n;(o=(r=this.media)==null?void 0:r.textTracks)!=null&&o.length&&((n=C(this,W))==null||n.dispatch({type:b.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:C(this,Jo)}))},0),this.hasAttribute(y.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}disconnectedCallback(){var e,t,r,o,n;if((e=super.disconnectedCallback)==null||e.call(this),C(this,W)){let a=C(this,W).getState();at(this,Jo,!!((t=a.mediaSubtitlesShowing)!=null&&t.length)),(r=C(this,W))==null||r.dispatch({type:"documentelementchangerequest",detail:void 0}),(o=C(this,W))==null||o.dispatch({type:b.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:!1})}C(this,st)&&((n=C(this,st))==null||n.call(this),at(this,st,void 0))}mediaSetCallback(e){var t;super.mediaSetCallback(e),(t=C(this,W))==null||t.dispatch({type:"mediaelementchangerequest",detail:e}),e.hasAttribute("tabindex")||(e.tabIndex=-1)}mediaUnsetCallback(e){var t;super.mediaUnsetCallback(e),(t=C(this,W))==null||t.dispatch({type:"mediaelementchangerequest",detail:void 0})}propagateMediaState(e,t){ph(this.mediaStateReceivers,e,t)}associateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(t.has(e))return;let r=this.registerMediaStateReceiver.bind(this),o=this.unregisterMediaStateReceiver.bind(this),n=Vv(e,r,o);Object.values(b).forEach(a=>{e.addEventListener(a,C(this,Pa))}),t.set(e,n)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(!t.has(e))return;t.get(e)(),t.delete(e),Object.values(b).forEach(o=>{e.removeEventListener(o,C(this,Pa))})}registerMediaStateReceiver(e){if(!e)return;let t=this.mediaStateReceivers;t.indexOf(e)>-1||(t.push(e),C(this,W)&&Object.entries(C(this,W).getState()).forEach(([o,n])=>{ph([e],o,n)}))}unregisterMediaStateReceiver(e){let t=this.mediaStateReceivers,r=t.indexOf(e);r<0||t.splice(r,1)}enableHotkeys(){this.addEventListener("keydown",lt(this,Oa,jl))}disableHotkeys(){this.removeEventListener("keydown",lt(this,Oa,jl)),this.removeEventListener("keyup",lt(this,Ni,Ar))}get hotkeys(){return P(this,y.HOTKEYS)}set hotkeys(e){D(this,y.HOTKEYS,e)}keyboardShortcutHandler(e){var t,r,o,n,a,l,c,p,h;let v=e.target;if(((o=(r=(t=v.getAttribute(y.KEYS_USED))==null?void 0:t.split(" "))!=null?r:v==null?void 0:v.keysUsed)!=null?o:[]).map(O=>O==="Space"?" ":O).filter(Boolean).includes(e.key))return;let m,A,f;if(!(C(this,Qt).contains(`no${e.key.toLowerCase()}`)||e.key===" "&&C(this,Qt).contains("nospace")||e.shiftKey&&(e.key==="/"||e.key==="?")&&C(this,Qt).contains("noshift+/")))switch(e.key){case" ":case"k":m=C(this,W).getState().mediaPaused?b.MEDIA_PLAY_REQUEST:b.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new d.CustomEvent(m,{composed:!0,bubbles:!0}));break;case"m":m=this.mediaStore.getState().mediaVolumeLevel==="off"?b.MEDIA_UNMUTE_REQUEST:b.MEDIA_MUTE_REQUEST,this.dispatchEvent(new d.CustomEvent(m,{composed:!0,bubbles:!0}));break;case"f":m=this.mediaStore.getState().mediaIsFullscreen?b.MEDIA_EXIT_FULLSCREEN_REQUEST:b.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new d.CustomEvent(m,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new d.CustomEvent(b.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}));break;case"ArrowLeft":case"j":{let O=this.hasAttribute(y.KEYBOARD_BACKWARD_SEEK_OFFSET)?+this.getAttribute(y.KEYBOARD_BACKWARD_SEEK_OFFSET):lh;A=Math.max(((n=this.mediaStore.getState().mediaCurrentTime)!=null?n:0)-O,0),f=new d.CustomEvent(b.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(f);break}case"ArrowRight":case"l":{let O=this.hasAttribute(y.KEYBOARD_FORWARD_SEEK_OFFSET)?+this.getAttribute(y.KEYBOARD_FORWARD_SEEK_OFFSET):lh;A=Math.max(((a=this.mediaStore.getState().mediaCurrentTime)!=null?a:0)+O,0),f=new d.CustomEvent(b.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(f);break}case"ArrowUp":{let O=this.hasAttribute(y.KEYBOARD_UP_VOLUME_STEP)?+this.getAttribute(y.KEYBOARD_UP_VOLUME_STEP):dh;A=Math.min(((l=this.mediaStore.getState().mediaVolume)!=null?l:1)+O,1),f=new d.CustomEvent(b.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(f);break}case"ArrowDown":{let O=this.hasAttribute(y.KEYBOARD_DOWN_VOLUME_STEP)?+this.getAttribute(y.KEYBOARD_DOWN_VOLUME_STEP):dh;A=Math.max(((c=this.mediaStore.getState().mediaVolume)!=null?c:1)-O,0),f=new d.CustomEvent(b.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(f);break}case"<":{let O=(p=this.mediaStore.getState().mediaPlaybackRate)!=null?p:1;A=Math.max(O-ch,Dv).toFixed(2),f=new d.CustomEvent(b.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(f);break}case">":{let O=(h=this.mediaStore.getState().mediaPlaybackRate)!=null?h:1;A=Math.min(O+ch,Ov).toFixed(2),f=new d.CustomEvent(b.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(f);break}case"/":case"?":{e.shiftKey&&lt(this,ed,mh).call(this);break}case"p":{m=this.mediaStore.getState().mediaIsPip?b.MEDIA_EXIT_PIP_REQUEST:b.MEDIA_ENTER_PIP_REQUEST,f=new d.CustomEvent(m,{composed:!0,bubbles:!0}),this.dispatchEvent(f);break}default:break}}};Qt=new WeakMap;Zo=new WeakMap;W=new WeakMap;Ui=new WeakMap;Xo=new WeakMap;st=new WeakMap;Pa=new WeakMap;Jo=new WeakMap;Da=new WeakSet;Jl=function(){var i;this.mediaStore=sh({media:this.media,fullscreenElement:this.fullscreenElement,options:{defaultSubtitles:this.hasAttribute(y.DEFAULT_SUBTITLES),defaultDuration:this.hasAttribute(y.DEFAULT_DURATION)?+this.getAttribute(y.DEFAULT_DURATION):void 0,defaultStreamType:(i=this.getAttribute(y.DEFAULT_STREAM_TYPE))!=null?i:void 0,liveEdgeOffset:this.hasAttribute(y.LIVE_EDGE_OFFSET)?+this.getAttribute(y.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(y.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(y.SEEK_TO_LIVE_OFFSET):this.hasAttribute(y.LIVE_EDGE_OFFSET)?+this.getAttribute(y.LIVE_EDGE_OFFSET):void 0,noAutoSeekToLive:this.hasAttribute(y.NO_AUTO_SEEK_TO_LIVE),noVolumePref:this.hasAttribute(y.NO_VOLUME_PREF),noMutedPref:this.hasAttribute(y.NO_MUTED_PREF),noSubtitlesLangPref:this.hasAttribute(y.NO_SUBTITLES_LANG_PREF)}})};Ni=new WeakSet;Ar=function(i){let{key:e,shiftKey:t}=i;if(!(t&&(e==="/"||e==="?")||vh.includes(e))){this.removeEventListener("keyup",lt(this,Ni,Ar));return}this.keyboardShortcutHandler(i)};Oa=new WeakSet;jl=function(i){var e;let{metaKey:t,altKey:r,key:o,shiftKey:n}=i,a=n&&(o==="/"||o==="?");if(a&&((e=C(this,Ui))!=null&&e.open)){this.removeEventListener("keyup",lt(this,Ni,Ar));return}if(t||r||!a&&!vh.includes(o)){this.removeEventListener("keyup",lt(this,Ni,Ar));return}let l=i.target,c=l instanceof HTMLElement&&(l.tagName.toLowerCase()==="media-volume-range"||l.tagName.toLowerCase()==="media-time-range");[" ","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(o)&&!(C(this,Qt).contains(`no${o.toLowerCase()}`)||o===" "&&C(this,Qt).contains("nospace"))&&!c&&i.preventDefault(),this.addEventListener("keyup",lt(this,Ni,Ar),{once:!0})};ed=new WeakSet;mh=function(){C(this,Ui)||(at(this,Ui,ee.createElement("media-keyboard-shortcuts-dialog")),this.appendChild(C(this,Ui))),C(this,Ui).open=!0};var Uv=Object.values(s),Nv=Object.values(Nl),fh=i=>{var e,t,r,o;let{observedAttributes:n}=i.constructor;!n&&((e=i.nodeName)!=null&&e.includes("-"))&&(d.customElements.upgrade(i),{observedAttributes:n}=i.constructor);let a=(o=(r=(t=i==null?void 0:i.getAttribute)==null?void 0:t.call(i,N.MEDIA_CHROME_ATTRIBUTES))==null?void 0:r.split)==null?void 0:o.call(r,/\s+/);return Array.isArray(n||a)?(n||a).filter(l=>Uv.includes(l)):[]},$v=i=>{var e,t;return(e=i.nodeName)!=null&&e.includes("-")&&d.customElements.get((t=i.nodeName)==null?void 0:t.toLowerCase())&&!(i instanceof d.customElements.get(i.nodeName.toLowerCase()))&&d.customElements.upgrade(i),Nv.some(r=>r in i)},id=i=>$v(i)||!!fh(i).length,uh=i=>{var e;return(e=i==null?void 0:i.join)==null?void 0:e.call(i,":")},hh={[s.MEDIA_SUBTITLES_LIST]:Dt,[s.MEDIA_SUBTITLES_SHOWING]:Dt,[s.MEDIA_SEEKABLE]:uh,[s.MEDIA_BUFFERED]:i=>i==null?void 0:i.map(uh).join(" "),[s.MEDIA_PREVIEW_COORDS]:i=>i==null?void 0:i.join(" "),[s.MEDIA_RENDITION_LIST]:wu,[s.MEDIA_AUDIO_TRACK_LIST]:Cu},Hv=async(i,e,t)=>{var r,o;if(i.isConnected||await ca(0),typeof t=="boolean"||t==null)return I(i,e,t);if(typeof t=="number")return B(i,e,t);if(typeof t=="string")return D(i,e,t);if(Array.isArray(t)&&!t.length)return i.removeAttribute(e);let n=(o=(r=hh[e])==null?void 0:r.call(hh,t))!=null?o:t;return i.setAttribute(e,n)},Bv=i=>{var e;return!!((e=i.closest)!=null&&e.call(i,'*[slot="media"]'))},Oi=(i,e)=>{if(Bv(i))return;let t=(o,n)=>{var a,l;id(o)&&n(o);let{children:c=[]}=o??{},p=(l=(a=o==null?void 0:o.shadowRoot)==null?void 0:a.children)!=null?l:[];[...c,...p].forEach(v=>Oi(v,n))},r=i==null?void 0:i.nodeName.toLowerCase();if(r.includes("-")&&!id(i)){d.customElements.whenDefined(r).then(()=>{t(i,e)});return}t(i,e)},ph=(i,e,t)=>{i.forEach(r=>{if(e in r){r[e]=t;return}let o=fh(r),n=e.toLowerCase();o.includes(n)&&Hv(r,n,t)})},Vv=(i,e,t)=>{Oi(i,e);let r=h=>{var v;let g=(v=h==null?void 0:h.composedPath()[0])!=null?v:h.target;e(g)},o=h=>{var v;let g=(v=h==null?void 0:h.composedPath()[0])!=null?v:h.target;t(g)};i.addEventListener(b.REGISTER_MEDIA_STATE_RECEIVER,r),i.addEventListener(b.UNREGISTER_MEDIA_STATE_RECEIVER,o);let n=h=>{h.forEach(v=>{let{addedNodes:g=[],removedNodes:m=[],type:A,target:f,attributeName:R}=v;A==="childList"?(Array.prototype.forEach.call(g,O=>Oi(O,e)),Array.prototype.forEach.call(m,O=>Oi(O,t))):A==="attributes"&&R===N.MEDIA_CHROME_ATTRIBUTES&&(id(f)?e(f):t(f))})},a=[],l=h=>{let v=h.target;v.name!=="media"&&(a.forEach(g=>Oi(g,t)),a=[...v.assignedElements({flatten:!0})],a.forEach(g=>Oi(g,e)))};i.addEventListener("slotchange",l);let c=new MutationObserver(n);return c.observe(i,{childList:!0,attributes:!0,subtree:!0}),()=>{Oi(i,t),i.removeEventListener("slotchange",l),c.disconnect(),i.removeEventListener(b.REGISTER_MEDIA_STATE_RECEIVER,r),i.removeEventListener(b.UNREGISTER_MEDIA_STATE_RECEIVER,o)}};d.customElements.get("media-controller")||d.customElements.define("media-controller",td);var Sr={PLACEMENT:"placement",BOUNDS:"bounds"};function Wv(i){return`
416
416
  <style>
417
417
  :host {
418
418
  --_tooltip-background-color: var(--media-tooltip-background-color, var(--media-secondary-color, rgba(20, 20, 30, .7)));
@@ -521,7 +521,7 @@ bp-player[has-error] {
521
521
  </style>
522
522
  <slot></slot>
523
523
  <div id="arrow"></div>
524
- `}var kr=class extends d.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var e;if(!ga(this,{checkOpacity:!1,checkVisibilityCSS:!1}))return;let t=this.placement;if(t==="left"||t==="right"){this.style.removeProperty("--media-tooltip-offset-x");return}let r=getComputedStyle(this),o=(e=nt(this,"#"+this.bounds))!=null?e:X(this);if(!o)return;let{x:n,width:a}=o.getBoundingClientRect(),{x:l,width:c}=this.getBoundingClientRect(),p=l+c,h=n+a,v=r.getPropertyValue("--media-tooltip-offset-x"),g=v?parseFloat(v.replace("px","")):0,m=r.getPropertyValue("--media-tooltip-container-margin"),A=m?parseFloat(m.replace("px","")):0,f=l-n+g-A,R=p-h+g+A;if(f<0){this.style.setProperty("--media-tooltip-offset-x",`${f}px`);return}if(R>0){this.style.setProperty("--media-tooltip-offset-x",`${R}px`);return}this.style.removeProperty("--media-tooltip-offset-x")},!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}if(this.arrowEl=this.shadowRoot.querySelector("#arrow"),Object.prototype.hasOwnProperty.call(this,"placement")){let e=this.placement;delete this.placement,this.placement=e}}static get observedAttributes(){return[Sr.PLACEMENT,Sr.BOUNDS]}get placement(){return P(this,Sr.PLACEMENT)}set placement(e){D(this,Sr.PLACEMENT,e)}get bounds(){return P(this,Sr.BOUNDS)}set bounds(e){D(this,Sr.BOUNDS,e)}};kr.shadowRootOptions={mode:"open"};kr.getTemplateHTML=Kv;d.customElements.get("media-tooltip")||d.customElements.define("media-tooltip",kr);var Ua=kr;var nd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},he=(i,e,t)=>(nd(i,e,"read from private field"),t?t.call(i):e.get(i)),Lr=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Na=(i,e,t,r)=>(nd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),qv=(i,e,t)=>(nd(i,e,"access private method"),t),dt,Cr,Xt,wr,$a,od,Eh,Zt={TOOLTIP_PLACEMENT:"tooltipplacement",DISABLED:"disabled",NO_TOOLTIP:"notooltip"};function Gv(i,e={}){return`
524
+ `}var kr=class extends d.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var e;if(!ga(this,{checkOpacity:!1,checkVisibilityCSS:!1}))return;let t=this.placement;if(t==="left"||t==="right"){this.style.removeProperty("--media-tooltip-offset-x");return}let r=getComputedStyle(this),o=(e=nt(this,"#"+this.bounds))!=null?e:X(this);if(!o)return;let{x:n,width:a}=o.getBoundingClientRect(),{x:l,width:c}=this.getBoundingClientRect(),p=l+c,h=n+a,v=r.getPropertyValue("--media-tooltip-offset-x"),g=v?parseFloat(v.replace("px","")):0,m=r.getPropertyValue("--media-tooltip-container-margin"),A=m?parseFloat(m.replace("px","")):0,f=l-n+g-A,R=p-h+g+A;if(f<0){this.style.setProperty("--media-tooltip-offset-x",`${f}px`);return}if(R>0){this.style.setProperty("--media-tooltip-offset-x",`${R}px`);return}this.style.removeProperty("--media-tooltip-offset-x")},!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}if(this.arrowEl=this.shadowRoot.querySelector("#arrow"),Object.prototype.hasOwnProperty.call(this,"placement")){let e=this.placement;delete this.placement,this.placement=e}}static get observedAttributes(){return[Sr.PLACEMENT,Sr.BOUNDS]}get placement(){return P(this,Sr.PLACEMENT)}set placement(e){D(this,Sr.PLACEMENT,e)}get bounds(){return P(this,Sr.BOUNDS)}set bounds(e){D(this,Sr.BOUNDS,e)}};kr.shadowRootOptions={mode:"open"};kr.getTemplateHTML=Wv;d.customElements.get("media-tooltip")||d.customElements.define("media-tooltip",kr);var Ua=kr;var nd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},he=(i,e,t)=>(nd(i,e,"read from private field"),t?t.call(i):e.get(i)),Lr=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Na=(i,e,t,r)=>(nd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Fv=(i,e,t)=>(nd(i,e,"access private method"),t),dt,Ir,Xt,wr,$a,od,gh,Zt={TOOLTIP_PLACEMENT:"tooltipplacement",DISABLED:"disabled",NO_TOOLTIP:"notooltip"};function Kv(i,e={}){return`
525
525
  <style>
526
526
  :host {
527
527
  position: relative;
@@ -603,12 +603,12 @@ bp-player[has-error] {
603
603
  </slot>
604
604
  </media-tooltip>
605
605
  </slot>
606
- `}function zv(i,e){return`
606
+ `}function qv(i,e){return`
607
607
  <slot></slot>
608
- `}function Yv(){return""}var F=class extends d.HTMLElement{constructor(){if(super(),Lr(this,od),Lr(this,dt,void 0),this.preventClick=!1,this.tooltipEl=null,Lr(this,Cr,e=>{this.preventClick||this.handleClick(e),setTimeout(he(this,Xt),0)}),Lr(this,Xt,()=>{var e,t;(t=(e=this.tooltipEl)==null?void 0:e.updateXOffset)==null||t.call(e)}),Lr(this,wr,e=>{let{key:t}=e;if(!this.keysUsed.includes(t)){this.removeEventListener("keyup",he(this,wr));return}this.preventClick||this.handleClick(e)}),Lr(this,$a,e=>{let{metaKey:t,altKey:r,key:o}=e;if(t||r||!this.keysUsed.includes(o)){this.removeEventListener("keyup",he(this,wr));return}this.addEventListener("keyup",he(this,wr),{once:!0})}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes),t=this.constructor.getTemplateHTML(e);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(t):this.shadowRoot.innerHTML=t}this.tooltipEl=this.shadowRoot.querySelector("media-tooltip")}static get observedAttributes(){return["disabled",Zt.TOOLTIP_PLACEMENT,N.MEDIA_CONTROLLER,s.MEDIA_LANG]}enable(){this.addEventListener("click",he(this,Cr)),this.addEventListener("keydown",he(this,$a)),this.tabIndex=0}disable(){this.removeEventListener("click",he(this,Cr)),this.removeEventListener("keydown",he(this,$a)),this.removeEventListener("keyup",he(this,wr)),this.tabIndex=-1}attributeChangedCallback(e,t,r){var o,n,a,l,c;e===N.MEDIA_CONTROLLER?(t&&((n=(o=he(this,dt))==null?void 0:o.unassociateElement)==null||n.call(o,this),Na(this,dt,null)),r&&this.isConnected&&(Na(this,dt,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(c=(l=he(this,dt))==null?void 0:l.associateElement)==null||c.call(l,this))):e==="disabled"&&r!==t?r==null?this.enable():this.disable():e===Zt.TOOLTIP_PLACEMENT&&this.tooltipEl&&r!==t?this.tooltipEl.placement=r:e===s.MEDIA_LANG&&(this.shadowRoot.querySelector('slot[name="tooltip-content"]').innerHTML=this.constructor.getTooltipContentHTML()),he(this,Xt).call(this)}connectedCallback(){var e,t,r;let{style:o}=J(this.shadowRoot,":host");o.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),this.hasAttribute("disabled")?this.disable():this.enable(),this.setAttribute("role","button");let n=this.getAttribute(N.MEDIA_CONTROLLER);n&&(Na(this,dt,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(r=(t=he(this,dt))==null?void 0:t.associateElement)==null||r.call(t,this)),d.customElements.whenDefined("media-tooltip").then(()=>qv(this,od,Eh).call(this))}disconnectedCallback(){var e,t;this.disable(),(t=(e=he(this,dt))==null?void 0:e.unassociateElement)==null||t.call(e,this),Na(this,dt,null),this.removeEventListener("mouseenter",he(this,Xt)),this.removeEventListener("focus",he(this,Xt)),this.removeEventListener("click",he(this,Cr))}get keysUsed(){return["Enter"," "]}get tooltipPlacement(){return P(this,Zt.TOOLTIP_PLACEMENT)}set tooltipPlacement(e){D(this,Zt.TOOLTIP_PLACEMENT,e)}get mediaController(){return P(this,N.MEDIA_CONTROLLER)}set mediaController(e){D(this,N.MEDIA_CONTROLLER,e)}get disabled(){return w(this,Zt.DISABLED)}set disabled(e){C(this,Zt.DISABLED,e)}get noTooltip(){return w(this,Zt.NO_TOOLTIP)}set noTooltip(e){C(this,Zt.NO_TOOLTIP,e)}handleClick(e){}};dt=new WeakMap;Cr=new WeakMap;Xt=new WeakMap;wr=new WeakMap;$a=new WeakMap;od=new WeakSet;Eh=function(){this.addEventListener("mouseenter",he(this,Xt)),this.addEventListener("focus",he(this,Xt)),this.addEventListener("click",he(this,Cr));let i=this.tooltipPlacement;i&&this.tooltipEl&&(this.tooltipEl.placement=i)};F.shadowRootOptions={mode:"open"};F.getTemplateHTML=Gv;F.getSlotTemplateHTML=zv;F.getTooltipContentHTML=Yv;d.customElements.get("media-chrome-button")||d.customElements.define("media-chrome-button",F);var bh=`<svg aria-hidden="true" viewBox="0 0 26 24">
608
+ `}function Gv(){return""}var F=class extends d.HTMLElement{constructor(){if(super(),Lr(this,od),Lr(this,dt,void 0),this.preventClick=!1,this.tooltipEl=null,Lr(this,Ir,e=>{this.preventClick||this.handleClick(e),setTimeout(he(this,Xt),0)}),Lr(this,Xt,()=>{var e,t;(t=(e=this.tooltipEl)==null?void 0:e.updateXOffset)==null||t.call(e)}),Lr(this,wr,e=>{let{key:t}=e;if(!this.keysUsed.includes(t)){this.removeEventListener("keyup",he(this,wr));return}this.preventClick||this.handleClick(e)}),Lr(this,$a,e=>{let{metaKey:t,altKey:r,key:o}=e;if(t||r||!this.keysUsed.includes(o)){this.removeEventListener("keyup",he(this,wr));return}this.addEventListener("keyup",he(this,wr),{once:!0})}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes),t=this.constructor.getTemplateHTML(e);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(t):this.shadowRoot.innerHTML=t}this.tooltipEl=this.shadowRoot.querySelector("media-tooltip")}static get observedAttributes(){return["disabled",Zt.TOOLTIP_PLACEMENT,N.MEDIA_CONTROLLER,s.MEDIA_LANG]}enable(){this.addEventListener("click",he(this,Ir)),this.addEventListener("keydown",he(this,$a)),this.tabIndex=0}disable(){this.removeEventListener("click",he(this,Ir)),this.removeEventListener("keydown",he(this,$a)),this.removeEventListener("keyup",he(this,wr)),this.tabIndex=-1}attributeChangedCallback(e,t,r){var o,n,a,l,c;e===N.MEDIA_CONTROLLER?(t&&((n=(o=he(this,dt))==null?void 0:o.unassociateElement)==null||n.call(o,this),Na(this,dt,null)),r&&this.isConnected&&(Na(this,dt,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(c=(l=he(this,dt))==null?void 0:l.associateElement)==null||c.call(l,this))):e==="disabled"&&r!==t?r==null?this.enable():this.disable():e===Zt.TOOLTIP_PLACEMENT&&this.tooltipEl&&r!==t?this.tooltipEl.placement=r:e===s.MEDIA_LANG&&(this.shadowRoot.querySelector('slot[name="tooltip-content"]').innerHTML=this.constructor.getTooltipContentHTML()),he(this,Xt).call(this)}connectedCallback(){var e,t,r;let{style:o}=J(this.shadowRoot,":host");o.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),this.hasAttribute("disabled")?this.disable():this.enable(),this.setAttribute("role","button");let n=this.getAttribute(N.MEDIA_CONTROLLER);n&&(Na(this,dt,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(r=(t=he(this,dt))==null?void 0:t.associateElement)==null||r.call(t,this)),d.customElements.whenDefined("media-tooltip").then(()=>Fv(this,od,gh).call(this))}disconnectedCallback(){var e,t;this.disable(),(t=(e=he(this,dt))==null?void 0:e.unassociateElement)==null||t.call(e,this),Na(this,dt,null),this.removeEventListener("mouseenter",he(this,Xt)),this.removeEventListener("focus",he(this,Xt)),this.removeEventListener("click",he(this,Ir))}get keysUsed(){return["Enter"," "]}get tooltipPlacement(){return P(this,Zt.TOOLTIP_PLACEMENT)}set tooltipPlacement(e){D(this,Zt.TOOLTIP_PLACEMENT,e)}get mediaController(){return P(this,N.MEDIA_CONTROLLER)}set mediaController(e){D(this,N.MEDIA_CONTROLLER,e)}get disabled(){return w(this,Zt.DISABLED)}set disabled(e){I(this,Zt.DISABLED,e)}get noTooltip(){return w(this,Zt.NO_TOOLTIP)}set noTooltip(e){I(this,Zt.NO_TOOLTIP,e)}handleClick(e){}};dt=new WeakMap;Ir=new WeakMap;Xt=new WeakMap;wr=new WeakMap;$a=new WeakMap;od=new WeakSet;gh=function(){this.addEventListener("mouseenter",he(this,Xt)),this.addEventListener("focus",he(this,Xt)),this.addEventListener("click",he(this,Ir));let i=this.tooltipPlacement;i&&this.tooltipEl&&(this.tooltipEl.placement=i)};F.shadowRootOptions={mode:"open"};F.getTemplateHTML=Kv;F.getSlotTemplateHTML=qv;F.getTooltipContentHTML=Gv;d.customElements.get("media-chrome-button")||d.customElements.define("media-chrome-button",F);var Eh=`<svg aria-hidden="true" viewBox="0 0 26 24">
609
609
  <path d="M22.13 3H3.87a.87.87 0 0 0-.87.87v13.26a.87.87 0 0 0 .87.87h3.4L9 16H5V5h16v11h-4l1.72 2h3.4a.87.87 0 0 0 .87-.87V3.87a.87.87 0 0 0-.86-.87Zm-8.75 11.44a.5.5 0 0 0-.76 0l-4.91 5.73a.5.5 0 0 0 .38.83h9.82a.501.501 0 0 0 .38-.83l-4.91-5.73Z"/>
610
610
  </svg>
611
- `;function Qv(i){return`
611
+ `;function zv(i){return`
612
612
  <style>
613
613
  :host([${s.MEDIA_IS_AIRPLAYING}]) slot[name=icon] slot:not([name=exit]) {
614
614
  display: none !important;
@@ -626,17 +626,17 @@ bp-player[has-error] {
626
626
  </style>
627
627
 
628
628
  <slot name="icon">
629
- <slot name="enter">${bh}</slot>
630
- <slot name="exit">${bh}</slot>
629
+ <slot name="enter">${Eh}</slot>
630
+ <slot name="exit">${Eh}</slot>
631
631
  </slot>
632
- `}function Zv(){return`
632
+ `}function Yv(){return`
633
633
  <slot name="tooltip-enter">${E("start airplay")}</slot>
634
634
  <slot name="tooltip-exit">${E("stop airplay")}</slot>
635
- `}var _h=i=>{let e=i.mediaIsAirplaying?E("stop airplay"):E("start airplay");i.setAttribute("aria-label",e)},jo=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_IS_AIRPLAYING,s.MEDIA_AIRPLAY_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),_h(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_IS_AIRPLAYING&&_h(this)}get mediaIsAirplaying(){return w(this,s.MEDIA_IS_AIRPLAYING)}set mediaIsAirplaying(e){C(this,s.MEDIA_IS_AIRPLAYING,e)}get mediaAirplayUnavailable(){return P(this,s.MEDIA_AIRPLAY_UNAVAILABLE)}set mediaAirplayUnavailable(e){D(this,s.MEDIA_AIRPLAY_UNAVAILABLE,e)}handleClick(){let e=new d.CustomEvent(b.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}};jo.getSlotTemplateHTML=Qv;jo.getTooltipContentHTML=Zv;d.customElements.get("media-airplay-button")||d.customElements.define("media-airplay-button",jo);var Xv=`<svg aria-hidden="true" viewBox="0 0 26 24">
635
+ `}var bh=i=>{let e=i.mediaIsAirplaying?E("stop airplay"):E("start airplay");i.setAttribute("aria-label",e)},jo=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_IS_AIRPLAYING,s.MEDIA_AIRPLAY_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),bh(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_IS_AIRPLAYING&&bh(this)}get mediaIsAirplaying(){return w(this,s.MEDIA_IS_AIRPLAYING)}set mediaIsAirplaying(e){I(this,s.MEDIA_IS_AIRPLAYING,e)}get mediaAirplayUnavailable(){return P(this,s.MEDIA_AIRPLAY_UNAVAILABLE)}set mediaAirplayUnavailable(e){D(this,s.MEDIA_AIRPLAY_UNAVAILABLE,e)}handleClick(){let e=new d.CustomEvent(b.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}};jo.getSlotTemplateHTML=zv;jo.getTooltipContentHTML=Yv;d.customElements.get("media-airplay-button")||d.customElements.define("media-airplay-button",jo);var Qv=`<svg aria-hidden="true" viewBox="0 0 26 24">
636
636
  <path d="M22.83 5.68a2.58 2.58 0 0 0-2.3-2.5c-3.62-.24-11.44-.24-15.06 0a2.58 2.58 0 0 0-2.3 2.5c-.23 4.21-.23 8.43 0 12.64a2.58 2.58 0 0 0 2.3 2.5c3.62.24 11.44.24 15.06 0a2.58 2.58 0 0 0 2.3-2.5c.23-4.21.23-8.43 0-12.64Zm-11.39 9.45a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.92 3.92 0 0 1 .92-2.77 3.18 3.18 0 0 1 2.43-1 2.94 2.94 0 0 1 2.13.78c.364.359.62.813.74 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.17 1.61 1.61 0 0 0-1.29.58 2.79 2.79 0 0 0-.5 1.89 3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.48 1.48 0 0 0 1-.37 2.1 2.1 0 0 0 .59-1.14l1.4.44a3.23 3.23 0 0 1-1.07 1.69Zm7.22 0a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.88 3.88 0 0 1 .93-2.77 3.14 3.14 0 0 1 2.42-1 3 3 0 0 1 2.16.82 2.8 2.8 0 0 1 .73 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.21 1.61 1.61 0 0 0-1.29.58A2.79 2.79 0 0 0 15 12a3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.44 1.44 0 0 0 1-.37 2.1 2.1 0 0 0 .6-1.15l1.4.44a3.17 3.17 0 0 1-1.1 1.7Z"/>
637
- </svg>`,Jv=`<svg aria-hidden="true" viewBox="0 0 26 24">
637
+ </svg>`,Zv=`<svg aria-hidden="true" viewBox="0 0 26 24">
638
638
  <path d="M17.73 14.09a1.4 1.4 0 0 1-1 .37 1.579 1.579 0 0 1-1.27-.58A3 3 0 0 1 15 12a2.8 2.8 0 0 1 .5-1.85 1.63 1.63 0 0 1 1.29-.57 1.47 1.47 0 0 1 1.51 1.2l1.43-.34A2.89 2.89 0 0 0 19 9.07a3 3 0 0 0-2.14-.78 3.14 3.14 0 0 0-2.42 1 3.91 3.91 0 0 0-.93 2.78 3.74 3.74 0 0 0 .92 2.66 3.07 3.07 0 0 0 2.34 1 3.07 3.07 0 0 0 1.91-.57 3.17 3.17 0 0 0 1.07-1.74l-1.4-.45c-.083.43-.3.822-.62 1.12Zm-7.22 0a1.43 1.43 0 0 1-1 .37 1.58 1.58 0 0 1-1.27-.58A3 3 0 0 1 7.76 12a2.8 2.8 0 0 1 .5-1.85 1.63 1.63 0 0 1 1.29-.57 1.47 1.47 0 0 1 1.51 1.2l1.43-.34a2.81 2.81 0 0 0-.74-1.32 2.94 2.94 0 0 0-2.13-.78 3.18 3.18 0 0 0-2.43 1 4 4 0 0 0-.92 2.78 3.74 3.74 0 0 0 .92 2.66 3.07 3.07 0 0 0 2.34 1 3.07 3.07 0 0 0 1.91-.57 3.23 3.23 0 0 0 1.07-1.74l-1.4-.45a2.06 2.06 0 0 1-.6 1.07Zm12.32-8.41a2.59 2.59 0 0 0-2.3-2.51C18.72 3.05 15.86 3 13 3c-2.86 0-5.72.05-7.53.17a2.59 2.59 0 0 0-2.3 2.51c-.23 4.207-.23 8.423 0 12.63a2.57 2.57 0 0 0 2.3 2.5c1.81.13 4.67.19 7.53.19 2.86 0 5.72-.06 7.53-.19a2.57 2.57 0 0 0 2.3-2.5c.23-4.207.23-8.423 0-12.63Zm-1.49 12.53a1.11 1.11 0 0 1-.91 1.11c-1.67.11-4.45.18-7.43.18-2.98 0-5.76-.07-7.43-.18a1.11 1.11 0 0 1-.91-1.11c-.21-4.14-.21-8.29 0-12.43a1.11 1.11 0 0 1 .91-1.11C7.24 4.56 10 4.49 13 4.49s5.76.07 7.43.18a1.11 1.11 0 0 1 .91 1.11c.21 4.14.21 8.29 0 12.43Z"/>
639
- </svg>`;function jv(i){return`
639
+ </svg>`;function Xv(i){return`
640
640
  <style>
641
641
  :host([aria-checked="true"]) slot[name=off] {
642
642
  display: none !important;
@@ -654,13 +654,13 @@ bp-player[has-error] {
654
654
  </style>
655
655
 
656
656
  <slot name="icon">
657
- <slot name="on">${Xv}</slot>
658
- <slot name="off">${Jv}</slot>
657
+ <slot name="on">${Qv}</slot>
658
+ <slot name="off">${Zv}</slot>
659
659
  </slot>
660
- `}function ef(){return`
660
+ `}function Jv(){return`
661
661
  <slot name="tooltip-enable">${E("Enable captions")}</slot>
662
662
  <slot name="tooltip-disable">${E("Disable captions")}</slot>
663
- `}var yh=i=>{i.setAttribute("aria-checked",Ca(i).toString())},en=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_SUBTITLES_LIST,s.MEDIA_SUBTITLES_SHOWING]}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",E("closed captions")),yh(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_SUBTITLES_SHOWING&&yh(this)}get mediaSubtitlesList(){return Th(this,s.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Ah(this,s.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Th(this,s.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Ah(this,s.MEDIA_SUBTITLES_SHOWING,e)}handleClick(){this.dispatchEvent(new d.CustomEvent(b.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}))}};en.getSlotTemplateHTML=jv;en.getTooltipContentHTML=ef;var Th=(i,e)=>{let t=i.getAttribute(e);return t?xi(t):[]},Ah=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let r=Dt(t);i.getAttribute(e)!==r&&i.setAttribute(e,r)};d.customElements.get("media-captions-button")||d.customElements.define("media-captions-button",en);var tf='<svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/></g></svg>',rf='<svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/><path class="cast_caf_icon_boxfill" d="M5,7 L5,8.63 C8,8.6 13.37,14 13.37,17 L19,17 L19,7 Z"/></g></svg>';function of(i){return`
663
+ `}var _h=i=>{i.setAttribute("aria-checked",Ia(i).toString())},en=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_SUBTITLES_LIST,s.MEDIA_SUBTITLES_SHOWING]}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",E("closed captions")),_h(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_SUBTITLES_SHOWING&&_h(this)}get mediaSubtitlesList(){return yh(this,s.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Th(this,s.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return yh(this,s.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Th(this,s.MEDIA_SUBTITLES_SHOWING,e)}handleClick(){this.dispatchEvent(new d.CustomEvent(b.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}))}};en.getSlotTemplateHTML=Xv;en.getTooltipContentHTML=Jv;var yh=(i,e)=>{let t=i.getAttribute(e);return t?xi(t):[]},Th=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let r=Dt(t);i.getAttribute(e)!==r&&i.setAttribute(e,r)};d.customElements.get("media-captions-button")||d.customElements.define("media-captions-button",en);var jv='<svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/></g></svg>',ef='<svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/><path class="cast_caf_icon_boxfill" d="M5,7 L5,8.63 C8,8.6 13.37,14 13.37,17 L19,17 L19,7 Z"/></g></svg>';function tf(i){return`
664
664
  <style>
665
665
  :host([${s.MEDIA_IS_CASTING}]) slot[name=icon] slot:not([name=exit]) {
666
666
  display: none !important;
@@ -678,13 +678,13 @@ bp-player[has-error] {
678
678
  </style>
679
679
 
680
680
  <slot name="icon">
681
- <slot name="enter">${tf}</slot>
682
- <slot name="exit">${rf}</slot>
681
+ <slot name="enter">${jv}</slot>
682
+ <slot name="exit">${ef}</slot>
683
683
  </slot>
684
- `}function nf(){return`
684
+ `}function rf(){return`
685
685
  <slot name="tooltip-enter">${E("Start casting")}</slot>
686
686
  <slot name="tooltip-exit">${E("Stop casting")}</slot>
687
- `}var Sh=i=>{let e=i.mediaIsCasting?E("stop casting"):E("start casting");i.setAttribute("aria-label",e)},tn=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_IS_CASTING,s.MEDIA_CAST_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Sh(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_IS_CASTING&&Sh(this)}get mediaIsCasting(){return w(this,s.MEDIA_IS_CASTING)}set mediaIsCasting(e){C(this,s.MEDIA_IS_CASTING,e)}get mediaCastUnavailable(){return P(this,s.MEDIA_CAST_UNAVAILABLE)}set mediaCastUnavailable(e){D(this,s.MEDIA_CAST_UNAVAILABLE,e)}handleClick(){let e=this.mediaIsCasting?b.MEDIA_EXIT_CAST_REQUEST:b.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};tn.getSlotTemplateHTML=of;tn.getTooltipContentHTML=nf;d.customElements.get("media-cast-button")||d.customElements.define("media-cast-button",tn);var hd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Hi=(i,e,t)=>(hd(i,e,"read from private field"),t?t.call(i):e.get(i)),Ot=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},pd=(i,e,t,r)=>(hd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),$i=(i,e,t)=>(hd(i,e,"access private method"),t),Ba,on,Bi,Ha,ad,sd,kh,ld,Lh,dd,wh,cd,Ch,ud,Ih;function af(i){return`
687
+ `}var Ah=i=>{let e=i.mediaIsCasting?E("stop casting"):E("start casting");i.setAttribute("aria-label",e)},tn=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_IS_CASTING,s.MEDIA_CAST_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Ah(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_IS_CASTING&&Ah(this)}get mediaIsCasting(){return w(this,s.MEDIA_IS_CASTING)}set mediaIsCasting(e){I(this,s.MEDIA_IS_CASTING,e)}get mediaCastUnavailable(){return P(this,s.MEDIA_CAST_UNAVAILABLE)}set mediaCastUnavailable(e){D(this,s.MEDIA_CAST_UNAVAILABLE,e)}handleClick(){let e=this.mediaIsCasting?b.MEDIA_EXIT_CAST_REQUEST:b.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};tn.getSlotTemplateHTML=tf;tn.getTooltipContentHTML=rf;d.customElements.get("media-cast-button")||d.customElements.define("media-cast-button",tn);var hd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Hi=(i,e,t)=>(hd(i,e,"read from private field"),t?t.call(i):e.get(i)),Ot=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},pd=(i,e,t,r)=>(hd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),$i=(i,e,t)=>(hd(i,e,"access private method"),t),Ba,on,Bi,Ha,ad,sd,Sh,ld,kh,dd,Lh,cd,wh,ud,Ih;function of(i){return`
688
688
  <style>
689
689
  :host {
690
690
  font: var(--media-font,
@@ -725,9 +725,9 @@ bp-player[has-error] {
725
725
  }
726
726
  </style>
727
727
  ${this.getSlotTemplateHTML(i)}
728
- `}function sf(i){return`
728
+ `}function nf(i){return`
729
729
  <slot id="content"></slot>
730
- `}var rn={OPEN:"open",ANCHOR:"anchor"},ct=class extends d.HTMLElement{constructor(){super(),Ot(this,Ha),Ot(this,sd),Ot(this,ld),Ot(this,dd),Ot(this,cd),Ot(this,ud),Ot(this,Ba,!1),Ot(this,on,null),Ot(this,Bi,null),this.addEventListener("invoke",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this)}static get observedAttributes(){return[rn.OPEN,rn.ANCHOR]}get open(){return w(this,rn.OPEN)}set open(e){C(this,rn.OPEN,e)}handleEvent(e){switch(e.type){case"invoke":$i(this,dd,wh).call(this,e);break;case"focusout":$i(this,cd,Ch).call(this,e);break;case"keydown":$i(this,ud,Ih).call(this,e);break}}connectedCallback(){$i(this,Ha,ad).call(this),this.role||(this.role="dialog")}attributeChangedCallback(e,t,r){$i(this,Ha,ad).call(this),e===rn.OPEN&&r!==t&&(this.open?$i(this,sd,kh).call(this):$i(this,ld,Lh).call(this))}focus(){pd(this,on,Wo());let e=!this.dispatchEvent(new Event("focus",{composed:!0,cancelable:!0})),t=!this.dispatchEvent(new Event("focusin",{composed:!0,bubbles:!0,cancelable:!0}));if(e||t)return;let r=this.querySelector('[autofocus], [tabindex]:not([tabindex="-1"]), [role="menu"]');r==null||r.focus()}get keysUsed(){return["Escape","Tab"]}};Ba=new WeakMap;on=new WeakMap;Bi=new WeakMap;Ha=new WeakSet;ad=function(){if(!Hi(this,Ba)&&(pd(this,Ba,!0),!this.shadowRoot)){this.attachShadow(this.constructor.shadowRootOptions);let i=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(i),queueMicrotask(()=>{let{style:e}=J(this.shadowRoot,":host");e.setProperty("transition","display .15s, visibility .15s, opacity .15s ease-in, transform .15s ease-in")})}};sd=new WeakSet;kh=function(){var i;(i=Hi(this,Bi))==null||i.setAttribute("aria-expanded","true"),this.dispatchEvent(new Event("open",{composed:!0,bubbles:!0})),this.addEventListener("transitionend",()=>this.focus(),{once:!0})};ld=new WeakSet;Lh=function(){var i;(i=Hi(this,Bi))==null||i.setAttribute("aria-expanded","false"),this.dispatchEvent(new Event("close",{composed:!0,bubbles:!0}))};dd=new WeakSet;wh=function(i){pd(this,Bi,i.relatedTarget),Te(this,i.relatedTarget)||(this.open=!this.open)};cd=new WeakSet;Ch=function(i){var e;Te(this,i.relatedTarget)||((e=Hi(this,on))==null||e.focus(),Hi(this,Bi)&&Hi(this,Bi)!==i.relatedTarget&&this.open&&(this.open=!1))};ud=new WeakSet;Ih=function(i){var e,t,r,o,n;let{key:a,ctrlKey:l,altKey:c,metaKey:p}=i;l||c||p||this.keysUsed.includes(a)&&(i.preventDefault(),i.stopPropagation(),a==="Tab"?(i.shiftKey?(t=(e=this.previousElementSibling)==null?void 0:e.focus)==null||t.call(e):(o=(r=this.nextElementSibling)==null?void 0:r.focus)==null||o.call(r),this.blur()):a==="Escape"&&((n=Hi(this,on))==null||n.focus(),this.open=!1))};ct.shadowRootOptions={mode:"open"};ct.getTemplateHTML=af;ct.getSlotTemplateHTML=sf;d.customElements.get("media-chrome-dialog")||d.customElements.define("media-chrome-dialog",ct);var _d=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},oe=(i,e,t)=>(_d(i,e,"read from private field"),t?t.call(i):e.get(i)),be=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Jt=(i,e,t,r)=>(_d(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Je=(i,e,t)=>(_d(i,e,"access private method"),t),ut,Za,Va,Wa,je,Ya,Fa,Ka,qa,yd,Mh,Ga,md,za,vd,Qa,Td,fd,Rh,gd,xh,Ed,Ph,bd,Dh;function lf(i){return`
730
+ `}var rn={OPEN:"open",ANCHOR:"anchor"},ct=class extends d.HTMLElement{constructor(){super(),Ot(this,Ha),Ot(this,sd),Ot(this,ld),Ot(this,dd),Ot(this,cd),Ot(this,ud),Ot(this,Ba,!1),Ot(this,on,null),Ot(this,Bi,null),this.addEventListener("invoke",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this)}static get observedAttributes(){return[rn.OPEN,rn.ANCHOR]}get open(){return w(this,rn.OPEN)}set open(e){I(this,rn.OPEN,e)}handleEvent(e){switch(e.type){case"invoke":$i(this,dd,Lh).call(this,e);break;case"focusout":$i(this,cd,wh).call(this,e);break;case"keydown":$i(this,ud,Ih).call(this,e);break}}connectedCallback(){$i(this,Ha,ad).call(this),this.role||(this.role="dialog")}attributeChangedCallback(e,t,r){$i(this,Ha,ad).call(this),e===rn.OPEN&&r!==t&&(this.open?$i(this,sd,Sh).call(this):$i(this,ld,kh).call(this))}focus(){pd(this,on,Wo());let e=!this.dispatchEvent(new Event("focus",{composed:!0,cancelable:!0})),t=!this.dispatchEvent(new Event("focusin",{composed:!0,bubbles:!0,cancelable:!0}));if(e||t)return;let r=this.querySelector('[autofocus], [tabindex]:not([tabindex="-1"]), [role="menu"]');r==null||r.focus()}get keysUsed(){return["Escape","Tab"]}};Ba=new WeakMap;on=new WeakMap;Bi=new WeakMap;Ha=new WeakSet;ad=function(){if(!Hi(this,Ba)&&(pd(this,Ba,!0),!this.shadowRoot)){this.attachShadow(this.constructor.shadowRootOptions);let i=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(i),queueMicrotask(()=>{let{style:e}=J(this.shadowRoot,":host");e.setProperty("transition","display .15s, visibility .15s, opacity .15s ease-in, transform .15s ease-in")})}};sd=new WeakSet;Sh=function(){var i;(i=Hi(this,Bi))==null||i.setAttribute("aria-expanded","true"),this.dispatchEvent(new Event("open",{composed:!0,bubbles:!0})),this.addEventListener("transitionend",()=>this.focus(),{once:!0})};ld=new WeakSet;kh=function(){var i;(i=Hi(this,Bi))==null||i.setAttribute("aria-expanded","false"),this.dispatchEvent(new Event("close",{composed:!0,bubbles:!0}))};dd=new WeakSet;Lh=function(i){pd(this,Bi,i.relatedTarget),Te(this,i.relatedTarget)||(this.open=!this.open)};cd=new WeakSet;wh=function(i){var e;Te(this,i.relatedTarget)||((e=Hi(this,on))==null||e.focus(),Hi(this,Bi)&&Hi(this,Bi)!==i.relatedTarget&&this.open&&(this.open=!1))};ud=new WeakSet;Ih=function(i){var e,t,r,o,n;let{key:a,ctrlKey:l,altKey:c,metaKey:p}=i;l||c||p||this.keysUsed.includes(a)&&(i.preventDefault(),i.stopPropagation(),a==="Tab"?(i.shiftKey?(t=(e=this.previousElementSibling)==null?void 0:e.focus)==null||t.call(e):(o=(r=this.nextElementSibling)==null?void 0:r.focus)==null||o.call(r),this.blur()):a==="Escape"&&((n=Hi(this,on))==null||n.focus(),this.open=!1))};ct.shadowRootOptions={mode:"open"};ct.getTemplateHTML=of;ct.getSlotTemplateHTML=nf;d.customElements.get("media-chrome-dialog")||d.customElements.define("media-chrome-dialog",ct);var _d=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},oe=(i,e,t)=>(_d(i,e,"read from private field"),t?t.call(i):e.get(i)),be=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Jt=(i,e,t,r)=>(_d(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Je=(i,e,t)=>(_d(i,e,"access private method"),t),ut,Za,Va,Wa,je,Ya,Fa,Ka,qa,yd,Ch,Ga,md,za,vd,Qa,Td,fd,Mh,gd,Rh,Ed,xh,bd,Ph;function af(i){return`
731
731
  <style>
732
732
  :host {
733
733
  --_focus-box-shadow: var(--media-focus-box-shadow, inset 0 0 0 2px rgb(27 127 204 / .9));
@@ -957,7 +957,7 @@ bp-player[has-error] {
957
957
  ${this.getContainerTemplateHTML(i)}
958
958
  </div>
959
959
  <div id="rightgap"></div>
960
- `}function df(i){return""}var ht=class extends d.HTMLElement{constructor(){if(super(),be(this,yd),be(this,Ga),be(this,za),be(this,Qa),be(this,fd),be(this,gd),be(this,Ed),be(this,bd),be(this,ut,void 0),be(this,Za,void 0),be(this,Va,void 0),be(this,Wa,void 0),be(this,je,{}),be(this,Ya,[]),be(this,Fa,()=>{if(this.range.matches(":focus-visible")){let{style:e}=J(this.shadowRoot,":host");e.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),be(this,Ka,()=>{let{style:e}=J(this.shadowRoot,":host");e.removeProperty("--_focus-visible-box-shadow")}),be(this,qa,()=>{let e=this.shadowRoot.querySelector("#segments-clipping");e&&e.parentNode.append(e)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes),t=this.constructor.getTemplateHTML(e);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(t):this.shadowRoot.innerHTML=t}this.container=this.shadowRoot.querySelector("#container"),Jt(this,Va,this.shadowRoot.querySelector("#startpoint")),Jt(this,Wa,this.shadowRoot.querySelector("#endpoint")),this.range=this.shadowRoot.querySelector("#range"),this.appearance=this.shadowRoot.querySelector("#appearance")}static get observedAttributes(){return["disabled","aria-disabled",N.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,r){var o,n,a,l,c;e===N.MEDIA_CONTROLLER?(t&&((n=(o=oe(this,ut))==null?void 0:o.unassociateElement)==null||n.call(o,this),Jt(this,ut,null)),r&&this.isConnected&&(Jt(this,ut,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(c=(l=oe(this,ut))==null?void 0:l.associateElement)==null||c.call(l,this))):(e==="disabled"||e==="aria-disabled"&&t!==r)&&(r==null?(this.range.removeAttribute(e),Je(this,Ga,md).call(this)):(this.range.setAttribute(e,r),Je(this,za,vd).call(this)))}connectedCallback(){var e,t,r;let{style:o}=J(this.shadowRoot,":host");o.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),oe(this,je).pointer=J(this.shadowRoot,"#pointer"),oe(this,je).progress=J(this.shadowRoot,"#progress"),oe(this,je).thumb=J(this.shadowRoot,'#thumb, ::slotted([slot="thumb"])'),oe(this,je).activeSegment=J(this.shadowRoot,"#segments-clipping rect:nth-child(0)");let n=this.getAttribute(N.MEDIA_CONTROLLER);n&&(Jt(this,ut,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(r=(t=oe(this,ut))==null?void 0:t.associateElement)==null||r.call(t,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",oe(this,Fa)),this.shadowRoot.addEventListener("focusout",oe(this,Ka)),Je(this,Ga,md).call(this),Rt(this.container,oe(this,qa))}disconnectedCallback(){var e,t;Je(this,za,vd).call(this),(t=(e=oe(this,ut))==null?void 0:e.unassociateElement)==null||t.call(e,this),Jt(this,ut,null),this.shadowRoot.removeEventListener("focusin",oe(this,Fa)),this.shadowRoot.removeEventListener("focusout",oe(this,Ka)),xt(this.container,oe(this,qa))}updatePointerBar(e){var t;(t=oe(this,je).pointer)==null||t.style.setProperty("width",`${this.getPointerRatio(e)*100}%`)}updateBar(){var e,t;let r=this.range.valueAsNumber*100;(e=oe(this,je).progress)==null||e.style.setProperty("width",`${r}%`),(t=oe(this,je).thumb)==null||t.style.setProperty("left",`${r}%`)}updateSegments(e){let t=this.shadowRoot.querySelector("#segments-clipping");if(t.textContent="",this.container.classList.toggle("segments",!!(e!=null&&e.length)),!(e!=null&&e.length))return;let r=[...new Set([+this.range.min,...e.flatMap(n=>[n.start,n.end]),+this.range.max])];Jt(this,Ya,[...r]);let o=r.pop();for(let[n,a]of r.entries()){let[l,c]=[n===0,n===r.length-1],p=l?"calc(var(--segments-gap) / -1)":`${a*100}%`,v=`calc(${((c?o:r[n+1])-a)*100}%${l||c?"":" - var(--segments-gap)"})`,g=ee.createElementNS("http://www.w3.org/2000/svg","rect"),m=Fo(this.shadowRoot,`#segments-clipping rect:nth-child(${n+1})`);m.style.setProperty("x",p),m.style.setProperty("width",v),t.append(g)}}getPointerRatio(e){return Vu(e.clientX,e.clientY,oe(this,Va).getBoundingClientRect(),oe(this,Wa).getBoundingClientRect())}get dragging(){return this.hasAttribute("dragging")}handleEvent(e){switch(e.type){case"pointermove":Je(this,bd,Dh).call(this,e);break;case"input":this.updateBar();break;case"pointerenter":Je(this,fd,Rh).call(this,e);break;case"pointerdown":Je(this,Qa,Td).call(this,e);break;case"pointerup":Je(this,gd,xh).call(this);break;case"pointerleave":Je(this,Ed,Ph).call(this);break}}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};ut=new WeakMap;Za=new WeakMap;Va=new WeakMap;Wa=new WeakMap;je=new WeakMap;Ya=new WeakMap;Fa=new WeakMap;Ka=new WeakMap;qa=new WeakMap;yd=new WeakSet;Mh=function(i){let e=oe(this,je).activeSegment;if(!e)return;let t=this.getPointerRatio(i),o=`#segments-clipping rect:nth-child(${oe(this,Ya).findIndex((n,a,l)=>{let c=l[a+1];return c!=null&&t>=n&&t<=c})+1})`;(e.selectorText!=o||!e.style.transform)&&(e.selectorText=o,e.style.setProperty("transform","var(--media-range-segment-hover-transform, scaleY(2))"))};Ga=new WeakSet;md=function(){this.hasAttribute("disabled")||(this.addEventListener("input",this),this.addEventListener("pointerdown",this),this.addEventListener("pointerenter",this))};za=new WeakSet;vd=function(){var i,e;this.removeEventListener("input",this),this.removeEventListener("pointerdown",this),this.removeEventListener("pointerenter",this),(i=d.window)==null||i.removeEventListener("pointerup",this),(e=d.window)==null||e.removeEventListener("pointermove",this)};Qa=new WeakSet;Td=function(i){var e;Jt(this,Za,i.composedPath().includes(this.range)),(e=d.window)==null||e.addEventListener("pointerup",this)};fd=new WeakSet;Rh=function(i){var e;i.pointerType!=="mouse"&&Je(this,Qa,Td).call(this,i),this.addEventListener("pointerleave",this),(e=d.window)==null||e.addEventListener("pointermove",this)};gd=new WeakSet;xh=function(){var i;(i=d.window)==null||i.removeEventListener("pointerup",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled")};Ed=new WeakSet;Ph=function(){var i,e;this.removeEventListener("pointerleave",this),(i=d.window)==null||i.removeEventListener("pointermove",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled"),(e=oe(this,je).activeSegment)==null||e.style.removeProperty("transform")};bd=new WeakSet;Dh=function(i){i.pointerType==="pen"&&i.buttons===0||(this.toggleAttribute("dragging",i.buttons===1||i.pointerType!=="mouse"),this.updatePointerBar(i),Je(this,yd,Mh).call(this,i),this.dragging&&(i.pointerType!=="mouse"||!oe(this,Za))&&(this.range.disabled=!0,this.range.valueAsNumber=this.getPointerRatio(i),this.range.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))))};ht.shadowRootOptions={mode:"open"};ht.getTemplateHTML=lf;ht.getContainerTemplateHTML=df;d.customElements.get("media-chrome-range")||d.customElements.define("media-chrome-range",ht);var Oh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Xa=(i,e,t)=>(Oh(i,e,"read from private field"),t?t.call(i):e.get(i)),cf=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ja=(i,e,t,r)=>(Oh(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),pt;function uf(i){return`
960
+ `}function sf(i){return""}var ht=class extends d.HTMLElement{constructor(){if(super(),be(this,yd),be(this,Ga),be(this,za),be(this,Qa),be(this,fd),be(this,gd),be(this,Ed),be(this,bd),be(this,ut,void 0),be(this,Za,void 0),be(this,Va,void 0),be(this,Wa,void 0),be(this,je,{}),be(this,Ya,[]),be(this,Fa,()=>{if(this.range.matches(":focus-visible")){let{style:e}=J(this.shadowRoot,":host");e.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),be(this,Ka,()=>{let{style:e}=J(this.shadowRoot,":host");e.removeProperty("--_focus-visible-box-shadow")}),be(this,qa,()=>{let e=this.shadowRoot.querySelector("#segments-clipping");e&&e.parentNode.append(e)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes),t=this.constructor.getTemplateHTML(e);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(t):this.shadowRoot.innerHTML=t}this.container=this.shadowRoot.querySelector("#container"),Jt(this,Va,this.shadowRoot.querySelector("#startpoint")),Jt(this,Wa,this.shadowRoot.querySelector("#endpoint")),this.range=this.shadowRoot.querySelector("#range"),this.appearance=this.shadowRoot.querySelector("#appearance")}static get observedAttributes(){return["disabled","aria-disabled",N.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,r){var o,n,a,l,c;e===N.MEDIA_CONTROLLER?(t&&((n=(o=oe(this,ut))==null?void 0:o.unassociateElement)==null||n.call(o,this),Jt(this,ut,null)),r&&this.isConnected&&(Jt(this,ut,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(c=(l=oe(this,ut))==null?void 0:l.associateElement)==null||c.call(l,this))):(e==="disabled"||e==="aria-disabled"&&t!==r)&&(r==null?(this.range.removeAttribute(e),Je(this,Ga,md).call(this)):(this.range.setAttribute(e,r),Je(this,za,vd).call(this)))}connectedCallback(){var e,t,r;let{style:o}=J(this.shadowRoot,":host");o.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),oe(this,je).pointer=J(this.shadowRoot,"#pointer"),oe(this,je).progress=J(this.shadowRoot,"#progress"),oe(this,je).thumb=J(this.shadowRoot,'#thumb, ::slotted([slot="thumb"])'),oe(this,je).activeSegment=J(this.shadowRoot,"#segments-clipping rect:nth-child(0)");let n=this.getAttribute(N.MEDIA_CONTROLLER);n&&(Jt(this,ut,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(r=(t=oe(this,ut))==null?void 0:t.associateElement)==null||r.call(t,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",oe(this,Fa)),this.shadowRoot.addEventListener("focusout",oe(this,Ka)),Je(this,Ga,md).call(this),Rt(this.container,oe(this,qa))}disconnectedCallback(){var e,t;Je(this,za,vd).call(this),(t=(e=oe(this,ut))==null?void 0:e.unassociateElement)==null||t.call(e,this),Jt(this,ut,null),this.shadowRoot.removeEventListener("focusin",oe(this,Fa)),this.shadowRoot.removeEventListener("focusout",oe(this,Ka)),xt(this.container,oe(this,qa))}updatePointerBar(e){var t;(t=oe(this,je).pointer)==null||t.style.setProperty("width",`${this.getPointerRatio(e)*100}%`)}updateBar(){var e,t;let r=this.range.valueAsNumber*100;(e=oe(this,je).progress)==null||e.style.setProperty("width",`${r}%`),(t=oe(this,je).thumb)==null||t.style.setProperty("left",`${r}%`)}updateSegments(e){let t=this.shadowRoot.querySelector("#segments-clipping");if(t.textContent="",this.container.classList.toggle("segments",!!(e!=null&&e.length)),!(e!=null&&e.length))return;let r=[...new Set([+this.range.min,...e.flatMap(n=>[n.start,n.end]),+this.range.max])];Jt(this,Ya,[...r]);let o=r.pop();for(let[n,a]of r.entries()){let[l,c]=[n===0,n===r.length-1],p=l?"calc(var(--segments-gap) / -1)":`${a*100}%`,v=`calc(${((c?o:r[n+1])-a)*100}%${l||c?"":" - var(--segments-gap)"})`,g=ee.createElementNS("http://www.w3.org/2000/svg","rect"),m=Fo(this.shadowRoot,`#segments-clipping rect:nth-child(${n+1})`);m.style.setProperty("x",p),m.style.setProperty("width",v),t.append(g)}}getPointerRatio(e){return Bu(e.clientX,e.clientY,oe(this,Va).getBoundingClientRect(),oe(this,Wa).getBoundingClientRect())}get dragging(){return this.hasAttribute("dragging")}handleEvent(e){switch(e.type){case"pointermove":Je(this,bd,Ph).call(this,e);break;case"input":this.updateBar();break;case"pointerenter":Je(this,fd,Mh).call(this,e);break;case"pointerdown":Je(this,Qa,Td).call(this,e);break;case"pointerup":Je(this,gd,Rh).call(this);break;case"pointerleave":Je(this,Ed,xh).call(this);break}}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};ut=new WeakMap;Za=new WeakMap;Va=new WeakMap;Wa=new WeakMap;je=new WeakMap;Ya=new WeakMap;Fa=new WeakMap;Ka=new WeakMap;qa=new WeakMap;yd=new WeakSet;Ch=function(i){let e=oe(this,je).activeSegment;if(!e)return;let t=this.getPointerRatio(i),o=`#segments-clipping rect:nth-child(${oe(this,Ya).findIndex((n,a,l)=>{let c=l[a+1];return c!=null&&t>=n&&t<=c})+1})`;(e.selectorText!=o||!e.style.transform)&&(e.selectorText=o,e.style.setProperty("transform","var(--media-range-segment-hover-transform, scaleY(2))"))};Ga=new WeakSet;md=function(){this.hasAttribute("disabled")||(this.addEventListener("input",this),this.addEventListener("pointerdown",this),this.addEventListener("pointerenter",this))};za=new WeakSet;vd=function(){var i,e;this.removeEventListener("input",this),this.removeEventListener("pointerdown",this),this.removeEventListener("pointerenter",this),(i=d.window)==null||i.removeEventListener("pointerup",this),(e=d.window)==null||e.removeEventListener("pointermove",this)};Qa=new WeakSet;Td=function(i){var e;Jt(this,Za,i.composedPath().includes(this.range)),(e=d.window)==null||e.addEventListener("pointerup",this)};fd=new WeakSet;Mh=function(i){var e;i.pointerType!=="mouse"&&Je(this,Qa,Td).call(this,i),this.addEventListener("pointerleave",this),(e=d.window)==null||e.addEventListener("pointermove",this)};gd=new WeakSet;Rh=function(){var i;(i=d.window)==null||i.removeEventListener("pointerup",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled")};Ed=new WeakSet;xh=function(){var i,e;this.removeEventListener("pointerleave",this),(i=d.window)==null||i.removeEventListener("pointermove",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled"),(e=oe(this,je).activeSegment)==null||e.style.removeProperty("transform")};bd=new WeakSet;Ph=function(i){i.pointerType==="pen"&&i.buttons===0||(this.toggleAttribute("dragging",i.buttons===1||i.pointerType!=="mouse"),this.updatePointerBar(i),Je(this,yd,Ch).call(this,i),this.dragging&&(i.pointerType!=="mouse"||!oe(this,Za))&&(this.range.disabled=!0,this.range.valueAsNumber=this.getPointerRatio(i),this.range.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))))};ht.shadowRootOptions={mode:"open"};ht.getTemplateHTML=af;ht.getContainerTemplateHTML=sf;d.customElements.get("media-chrome-range")||d.customElements.define("media-chrome-range",ht);var Dh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Xa=(i,e,t)=>(Dh(i,e,"read from private field"),t?t.call(i):e.get(i)),lf=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ja=(i,e,t,r)=>(Dh(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),pt;function df(i){return`
961
961
  <style>
962
962
  :host {
963
963
 
@@ -983,7 +983,7 @@ bp-player[has-error] {
983
983
  </style>
984
984
 
985
985
  <slot></slot>
986
- `}var nn=class extends d.HTMLElement{constructor(){if(super(),cf(this,pt,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[N.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,r){var o,n,a,l,c;e===N.MEDIA_CONTROLLER&&(t&&((n=(o=Xa(this,pt))==null?void 0:o.unassociateElement)==null||n.call(o,this),Ja(this,pt,null)),r&&this.isConnected&&(Ja(this,pt,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(c=(l=Xa(this,pt))==null?void 0:l.associateElement)==null||c.call(l,this)))}connectedCallback(){var e,t,r;let o=this.getAttribute(N.MEDIA_CONTROLLER);o&&(Ja(this,pt,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=Xa(this,pt))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Xa(this,pt))==null?void 0:e.unassociateElement)==null||t.call(e,this),Ja(this,pt,null)}};pt=new WeakMap;nn.shadowRootOptions={mode:"open"};nn.getTemplateHTML=uf;d.customElements.get("media-control-bar")||d.customElements.define("media-control-bar",nn);var Uh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ja=(i,e,t)=>(Uh(i,e,"read from private field"),t?t.call(i):e.get(i)),hf=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},es=(i,e,t,r)=>(Uh(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),mt;function pf(i,e={}){return`
986
+ `}var nn=class extends d.HTMLElement{constructor(){if(super(),lf(this,pt,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[N.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,r){var o,n,a,l,c;e===N.MEDIA_CONTROLLER&&(t&&((n=(o=Xa(this,pt))==null?void 0:o.unassociateElement)==null||n.call(o,this),Ja(this,pt,null)),r&&this.isConnected&&(Ja(this,pt,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(c=(l=Xa(this,pt))==null?void 0:l.associateElement)==null||c.call(l,this)))}connectedCallback(){var e,t,r;let o=this.getAttribute(N.MEDIA_CONTROLLER);o&&(Ja(this,pt,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=Xa(this,pt))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Xa(this,pt))==null?void 0:e.unassociateElement)==null||t.call(e,this),Ja(this,pt,null)}};pt=new WeakMap;nn.shadowRootOptions={mode:"open"};nn.getTemplateHTML=df;d.customElements.get("media-control-bar")||d.customElements.define("media-control-bar",nn);var Oh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ja=(i,e,t)=>(Oh(i,e,"read from private field"),t?t.call(i):e.get(i)),cf=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},es=(i,e,t,r)=>(Oh(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),mt;function uf(i,e={}){return`
987
987
  <style>
988
988
  :host {
989
989
  font: var(--media-font,
@@ -1017,11 +1017,11 @@ bp-player[has-error] {
1017
1017
  </style>
1018
1018
 
1019
1019
  ${this.getSlotTemplateHTML(i,e)}
1020
- `}function mf(i,e){return`
1020
+ `}function hf(i,e){return`
1021
1021
  <slot></slot>
1022
- `}var xe=class extends d.HTMLElement{constructor(){if(super(),hf(this,mt,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[N.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,r){var o,n,a,l,c;e===N.MEDIA_CONTROLLER&&(t&&((n=(o=ja(this,mt))==null?void 0:o.unassociateElement)==null||n.call(o,this),es(this,mt,null)),r&&this.isConnected&&(es(this,mt,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(c=(l=ja(this,mt))==null?void 0:l.associateElement)==null||c.call(l,this)))}connectedCallback(){var e,t,r;let{style:o}=J(this.shadowRoot,":host");o.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`);let n=this.getAttribute(N.MEDIA_CONTROLLER);n&&(es(this,mt,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(r=(t=ja(this,mt))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=ja(this,mt))==null?void 0:e.unassociateElement)==null||t.call(e,this),es(this,mt,null)}};mt=new WeakMap;xe.shadowRootOptions={mode:"open"};xe.getTemplateHTML=pf;xe.getSlotTemplateHTML=mf;d.customElements.get("media-text-display")||d.customElements.define("media-text-display",xe);var $h=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Nh=(i,e,t)=>($h(i,e,"read from private field"),t?t.call(i):e.get(i)),vf=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ff=(i,e,t,r)=>($h(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),an;function gf(i,e){return`
1022
+ `}var xe=class extends d.HTMLElement{constructor(){if(super(),cf(this,mt,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[N.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,r){var o,n,a,l,c;e===N.MEDIA_CONTROLLER&&(t&&((n=(o=ja(this,mt))==null?void 0:o.unassociateElement)==null||n.call(o,this),es(this,mt,null)),r&&this.isConnected&&(es(this,mt,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(c=(l=ja(this,mt))==null?void 0:l.associateElement)==null||c.call(l,this)))}connectedCallback(){var e,t,r;let{style:o}=J(this.shadowRoot,":host");o.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`);let n=this.getAttribute(N.MEDIA_CONTROLLER);n&&(es(this,mt,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(r=(t=ja(this,mt))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=ja(this,mt))==null?void 0:e.unassociateElement)==null||t.call(e,this),es(this,mt,null)}};mt=new WeakMap;xe.shadowRootOptions={mode:"open"};xe.getTemplateHTML=uf;xe.getSlotTemplateHTML=hf;d.customElements.get("media-text-display")||d.customElements.define("media-text-display",xe);var Nh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Uh=(i,e,t)=>(Nh(i,e,"read from private field"),t?t.call(i):e.get(i)),pf=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},mf=(i,e,t,r)=>(Nh(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),an;function vf(i,e){return`
1023
1023
  <slot>${Xe(e.mediaDuration)}</slot>
1024
- `}var ts=class extends xe{constructor(){var e;super(),vf(this,an,void 0),ff(this,an,this.shadowRoot.querySelector("slot")),Nh(this,an).textContent=Xe((e=this.mediaDuration)!=null?e:0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_DURATION]}attributeChangedCallback(e,t,r){e===s.MEDIA_DURATION&&(Nh(this,an).textContent=Xe(+r)),super.attributeChangedCallback(e,t,r)}get mediaDuration(){return $(this,s.MEDIA_DURATION)}set mediaDuration(e){B(this,s.MEDIA_DURATION,e)}};an=new WeakMap;ts.getSlotTemplateHTML=gf;d.customElements.get("media-duration-display")||d.customElements.define("media-duration-display",ts);var Ef={2:E("Network Error"),3:E("Decode Error"),4:E("Source Not Supported"),5:E("Encryption Error")},bf={2:E("A network error caused the media download to fail."),3:E("A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format."),4:E("An unsupported error occurred. The server or network failed, or your browser does not support this format."),5:E("The media is encrypted and there are no keys to decrypt it.")},Ad=i=>{var e,t;return i.code===1?null:{title:(e=Ef[i.code])!=null?e:`Error ${i.code}`,message:(t=bf[i.code])!=null?t:i.message}};var Bh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},_f=(i,e,t)=>(Bh(i,e,"read from private field"),t?t.call(i):e.get(i)),yf=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Tf=(i,e,t,r)=>(Bh(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),is;function Af(i){return`
1024
+ `}var ts=class extends xe{constructor(){var e;super(),pf(this,an,void 0),mf(this,an,this.shadowRoot.querySelector("slot")),Uh(this,an).textContent=Xe((e=this.mediaDuration)!=null?e:0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_DURATION]}attributeChangedCallback(e,t,r){e===s.MEDIA_DURATION&&(Uh(this,an).textContent=Xe(+r)),super.attributeChangedCallback(e,t,r)}get mediaDuration(){return $(this,s.MEDIA_DURATION)}set mediaDuration(e){B(this,s.MEDIA_DURATION,e)}};an=new WeakMap;ts.getSlotTemplateHTML=vf;d.customElements.get("media-duration-display")||d.customElements.define("media-duration-display",ts);var ff={2:E("Network Error"),3:E("Decode Error"),4:E("Source Not Supported"),5:E("Encryption Error")},gf={2:E("A network error caused the media download to fail."),3:E("A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format."),4:E("An unsupported error occurred. The server or network failed, or your browser does not support this format."),5:E("The media is encrypted and there are no keys to decrypt it.")},Ad=i=>{var e,t;return i.code===1?null:{title:(e=ff[i.code])!=null?e:`Error ${i.code}`,message:(t=gf[i.code])!=null?t:i.message}};var Hh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ef=(i,e,t)=>(Hh(i,e,"read from private field"),t?t.call(i):e.get(i)),bf=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},_f=(i,e,t,r)=>(Hh(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),is;function yf(i){return`
1025
1025
  <style>
1026
1026
  :host {
1027
1027
  background: rgb(20 20 30 / .8);
@@ -1038,9 +1038,9 @@ bp-player[has-error] {
1038
1038
  }
1039
1039
  </style>
1040
1040
  <slot name="error-${i.mediaerrorcode}" id="content">
1041
- ${Vh({code:+i.mediaerrorcode,message:i.mediaerrormessage})}
1041
+ ${Bh({code:+i.mediaerrorcode,message:i.mediaerrormessage})}
1042
1042
  </slot>
1043
- `}function Sf(i){return i.code&&Ad(i)!==null}function Vh(i){var e;let{title:t,message:r}=(e=Ad(i))!=null?e:{},o="";return t&&(o+=`<slot name="error-${i.code}-title"><h3>${t}</h3></slot>`),r&&(o+=`<slot name="error-${i.code}-message"><p>${r}</p></slot>`),o}var Hh=[s.MEDIA_ERROR_CODE,s.MEDIA_ERROR_MESSAGE],sn=class extends ct{constructor(){super(...arguments),yf(this,is,null)}static get observedAttributes(){return[...super.observedAttributes,...Hh]}formatErrorMessage(e){return this.constructor.formatErrorMessage(e)}attributeChangedCallback(e,t,r){var o;if(super.attributeChangedCallback(e,t,r),!Hh.includes(e))return;let n=(o=this.mediaError)!=null?o:{code:this.mediaErrorCode,message:this.mediaErrorMessage};this.open=Sf(n),this.open&&(this.shadowRoot.querySelector("slot").name=`error-${this.mediaErrorCode}`,this.shadowRoot.querySelector("#content").innerHTML=this.formatErrorMessage(n))}get mediaError(){return _f(this,is)}set mediaError(e){Tf(this,is,e)}get mediaErrorCode(){return $(this,"mediaerrorcode")}set mediaErrorCode(e){B(this,"mediaerrorcode",e)}get mediaErrorMessage(){return P(this,"mediaerrormessage")}set mediaErrorMessage(e){D(this,"mediaerrormessage",e)}};is=new WeakMap;sn.getSlotTemplateHTML=Af;sn.formatErrorMessage=Vh;d.customElements.get("media-error-dialog")||d.customElements.define("media-error-dialog",sn);var kf=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},jt=(i,e,t)=>(kf(i,e,"read from private field"),t?t.call(i):e.get(i)),Wh=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ir,Mr;function Lf(i){return`
1043
+ `}function Tf(i){return i.code&&Ad(i)!==null}function Bh(i){var e;let{title:t,message:r}=(e=Ad(i))!=null?e:{},o="";return t&&(o+=`<slot name="error-${i.code}-title"><h3>${t}</h3></slot>`),r&&(o+=`<slot name="error-${i.code}-message"><p>${r}</p></slot>`),o}var $h=[s.MEDIA_ERROR_CODE,s.MEDIA_ERROR_MESSAGE],sn=class extends ct{constructor(){super(...arguments),bf(this,is,null)}static get observedAttributes(){return[...super.observedAttributes,...$h]}formatErrorMessage(e){return this.constructor.formatErrorMessage(e)}attributeChangedCallback(e,t,r){var o;if(super.attributeChangedCallback(e,t,r),!$h.includes(e))return;let n=(o=this.mediaError)!=null?o:{code:this.mediaErrorCode,message:this.mediaErrorMessage};this.open=Tf(n),this.open&&(this.shadowRoot.querySelector("slot").name=`error-${this.mediaErrorCode}`,this.shadowRoot.querySelector("#content").innerHTML=this.formatErrorMessage(n))}get mediaError(){return Ef(this,is)}set mediaError(e){_f(this,is,e)}get mediaErrorCode(){return $(this,"mediaerrorcode")}set mediaErrorCode(e){B(this,"mediaerrorcode",e)}get mediaErrorMessage(){return P(this,"mediaerrormessage")}set mediaErrorMessage(e){D(this,"mediaerrormessage",e)}};is=new WeakMap;sn.getSlotTemplateHTML=yf;sn.formatErrorMessage=Bh;d.customElements.get("media-error-dialog")||d.customElements.define("media-error-dialog",sn);var Af=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},jt=(i,e,t)=>(Af(i,e,"read from private field"),t?t.call(i):e.get(i)),Vh=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Cr,Mr;function Sf(i){return`
1044
1044
  <style>
1045
1045
  :host {
1046
1046
  position: fixed;
@@ -1125,9 +1125,9 @@ bp-player[has-error] {
1125
1125
  }
1126
1126
  </style>
1127
1127
  <slot id="content">
1128
- ${wf()}
1128
+ ${kf()}
1129
1129
  </slot>
1130
- `}function wf(){return`
1130
+ `}function kf(){return`
1131
1131
  <h2>Keyboard Shortcuts</h2>
1132
1132
  <table class="shortcuts-table">${[{keys:["Space","k"],description:"Toggle Playback"},{keys:["m"],description:"Toggle mute"},{keys:["f"],description:"Toggle fullscreen"},{keys:["c"],description:"Toggle captions or subtitles, if available"},{keys:["p"],description:"Toggle Picture in Picture"},{keys:["\u2190","j"],description:"Seek back 10s"},{keys:["\u2192","l"],description:"Seek forward 10s"},{keys:["\u2191"],description:"Turn volume up"},{keys:["\u2193"],description:"Turn volume down"},{keys:["< (SHIFT+,)"],description:"Decrease playback rate"},{keys:["> (SHIFT+.)"],description:"Increase playback rate"}].map(({keys:t,description:r})=>`
1133
1133
  <tr>
@@ -1137,11 +1137,11 @@ bp-player[has-error] {
1137
1137
  <td class="description">${r}</td>
1138
1138
  </tr>
1139
1139
  `).join("")}</table>
1140
- `}var rs=class extends ct{constructor(){super(...arguments),Wh(this,Ir,e=>{var t;if(!this.open)return;let r=(t=this.shadowRoot)==null?void 0:t.querySelector("#content");if(!r)return;let o=e.composedPath(),n=o[0]===this||o.includes(this),a=o.includes(r);n&&!a&&(this.open=!1)}),Wh(this,Mr,e=>{if(!this.open)return;let t=e.shiftKey&&(e.key==="/"||e.key==="?");(e.key==="Escape"||t)&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&(this.open=!1,e.preventDefault(),e.stopPropagation())})}connectedCallback(){super.connectedCallback(),this.open&&(this.addEventListener("click",jt(this,Ir)),document.addEventListener("keydown",jt(this,Mr)))}disconnectedCallback(){this.removeEventListener("click",jt(this,Ir)),document.removeEventListener("keydown",jt(this,Mr))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e==="open"&&(this.open?(this.addEventListener("click",jt(this,Ir)),document.addEventListener("keydown",jt(this,Mr))):(this.removeEventListener("click",jt(this,Ir)),document.removeEventListener("keydown",jt(this,Mr))))}};Ir=new WeakMap;Mr=new WeakMap;rs.getSlotTemplateHTML=Lf;d.customElements.get("media-keyboard-shortcuts-dialog")||d.customElements.define("media-keyboard-shortcuts-dialog",rs);var Kh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Cf=(i,e,t)=>(Kh(i,e,"read from private field"),t?t.call(i):e.get(i)),If=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Mf=(i,e,t,r)=>(Kh(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),os,Rf=`<svg aria-hidden="true" viewBox="0 0 26 24">
1140
+ `}var rs=class extends ct{constructor(){super(...arguments),Vh(this,Cr,e=>{var t;if(!this.open)return;let r=(t=this.shadowRoot)==null?void 0:t.querySelector("#content");if(!r)return;let o=e.composedPath(),n=o[0]===this||o.includes(this),a=o.includes(r);n&&!a&&(this.open=!1)}),Vh(this,Mr,e=>{if(!this.open)return;let t=e.shiftKey&&(e.key==="/"||e.key==="?");(e.key==="Escape"||t)&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&(this.open=!1,e.preventDefault(),e.stopPropagation())})}connectedCallback(){super.connectedCallback(),this.open&&(this.addEventListener("click",jt(this,Cr)),document.addEventListener("keydown",jt(this,Mr)))}disconnectedCallback(){this.removeEventListener("click",jt(this,Cr)),document.removeEventListener("keydown",jt(this,Mr))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e==="open"&&(this.open?(this.addEventListener("click",jt(this,Cr)),document.addEventListener("keydown",jt(this,Mr))):(this.removeEventListener("click",jt(this,Cr)),document.removeEventListener("keydown",jt(this,Mr))))}};Cr=new WeakMap;Mr=new WeakMap;rs.getSlotTemplateHTML=Sf;d.customElements.get("media-keyboard-shortcuts-dialog")||d.customElements.define("media-keyboard-shortcuts-dialog",rs);var Fh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Lf=(i,e,t)=>(Fh(i,e,"read from private field"),t?t.call(i):e.get(i)),wf=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},If=(i,e,t,r)=>(Fh(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),os,Cf=`<svg aria-hidden="true" viewBox="0 0 26 24">
1141
1141
  <path d="M16 3v2.5h3.5V9H22V3h-6ZM4 9h2.5V5.5H10V3H4v6Zm15.5 9.5H16V21h6v-6h-2.5v3.5ZM6.5 15H4v6h6v-2.5H6.5V15Z"/>
1142
- </svg>`,xf=`<svg aria-hidden="true" viewBox="0 0 26 24">
1142
+ </svg>`,Mf=`<svg aria-hidden="true" viewBox="0 0 26 24">
1143
1143
  <path d="M18.5 6.5V3H16v6h6V6.5h-3.5ZM16 21h2.5v-3.5H22V15h-6v6ZM4 17.5h3.5V21H10v-6H4v2.5Zm3.5-11H4V9h6V3H7.5v3.5Z"/>
1144
- </svg>`;function Pf(i){return`
1144
+ </svg>`;function Rf(i){return`
1145
1145
  <style>
1146
1146
  :host([${s.MEDIA_IS_FULLSCREEN}]) slot[name=icon] slot:not([name=exit]) {
1147
1147
  display: none !important;
@@ -1159,13 +1159,13 @@ bp-player[has-error] {
1159
1159
  </style>
1160
1160
 
1161
1161
  <slot name="icon">
1162
- <slot name="enter">${Rf}</slot>
1163
- <slot name="exit">${xf}</slot>
1162
+ <slot name="enter">${Cf}</slot>
1163
+ <slot name="exit">${Mf}</slot>
1164
1164
  </slot>
1165
- `}function Df(){return`
1165
+ `}function xf(){return`
1166
1166
  <slot name="tooltip-enter">${E("Enter fullscreen mode")}</slot>
1167
1167
  <slot name="tooltip-exit">${E("Exit fullscreen mode")}</slot>
1168
- `}var Fh=i=>{let e=i.mediaIsFullscreen?E("exit fullscreen mode"):E("enter fullscreen mode");i.setAttribute("aria-label",e)},ln=class extends F{constructor(){super(...arguments),If(this,os,null)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_IS_FULLSCREEN,s.MEDIA_FULLSCREEN_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Fh(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_IS_FULLSCREEN&&Fh(this)}get mediaFullscreenUnavailable(){return P(this,s.MEDIA_FULLSCREEN_UNAVAILABLE)}set mediaFullscreenUnavailable(e){D(this,s.MEDIA_FULLSCREEN_UNAVAILABLE,e)}get mediaIsFullscreen(){return w(this,s.MEDIA_IS_FULLSCREEN)}set mediaIsFullscreen(e){C(this,s.MEDIA_IS_FULLSCREEN,e)}handleClick(e){Mf(this,os,e);let t=Cf(this,os)instanceof PointerEvent,r=this.mediaIsFullscreen?new d.CustomEvent(b.MEDIA_EXIT_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0}):new d.CustomEvent(b.MEDIA_ENTER_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(r)}};os=new WeakMap;ln.getSlotTemplateHTML=Pf;ln.getTooltipContentHTML=Df;d.customElements.get("media-fullscreen-button")||d.customElements.define("media-fullscreen-button",ln);var{MEDIA_TIME_IS_LIVE:ns,MEDIA_PAUSED:dn}=s,{MEDIA_SEEK_TO_LIVE_REQUEST:Of,MEDIA_PLAY_REQUEST:Uf}=b,Nf='<svg viewBox="0 0 6 12"><circle cx="3" cy="6" r="2"></circle></svg>';function $f(i){return`
1168
+ `}var Wh=i=>{let e=i.mediaIsFullscreen?E("exit fullscreen mode"):E("enter fullscreen mode");i.setAttribute("aria-label",e)},ln=class extends F{constructor(){super(...arguments),wf(this,os,null)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_IS_FULLSCREEN,s.MEDIA_FULLSCREEN_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Wh(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_IS_FULLSCREEN&&Wh(this)}get mediaFullscreenUnavailable(){return P(this,s.MEDIA_FULLSCREEN_UNAVAILABLE)}set mediaFullscreenUnavailable(e){D(this,s.MEDIA_FULLSCREEN_UNAVAILABLE,e)}get mediaIsFullscreen(){return w(this,s.MEDIA_IS_FULLSCREEN)}set mediaIsFullscreen(e){I(this,s.MEDIA_IS_FULLSCREEN,e)}handleClick(e){If(this,os,e);let t=Lf(this,os)instanceof PointerEvent,r=this.mediaIsFullscreen?new d.CustomEvent(b.MEDIA_EXIT_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0}):new d.CustomEvent(b.MEDIA_ENTER_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(r)}};os=new WeakMap;ln.getSlotTemplateHTML=Rf;ln.getTooltipContentHTML=xf;d.customElements.get("media-fullscreen-button")||d.customElements.define("media-fullscreen-button",ln);var{MEDIA_TIME_IS_LIVE:ns,MEDIA_PAUSED:dn}=s,{MEDIA_SEEK_TO_LIVE_REQUEST:Pf,MEDIA_PLAY_REQUEST:Df}=b,Of='<svg viewBox="0 0 6 12"><circle cx="3" cy="6" r="2"></circle></svg>';function Uf(i){return`
1169
1169
  <style>
1170
1170
  :host { --media-tooltip-display: none; }
1171
1171
 
@@ -1193,10 +1193,10 @@ bp-player[has-error] {
1193
1193
 
1194
1194
  </style>
1195
1195
 
1196
- <slot name="indicator">${Nf}</slot>
1196
+ <slot name="indicator">${Of}</slot>
1197
1197
 
1198
1198
  <slot name="spacer">&nbsp;</slot><slot name="text">${E("live")}</slot>
1199
- `}var qh=i=>{var e;let t=i.mediaPaused||!i.mediaTimeIsLive,r=t?E("seek to live"):E("playing live");i.setAttribute("aria-label",r);let o=(e=i.shadowRoot)==null?void 0:e.querySelector('slot[name="text"]');o&&(o.textContent=E("live")),t?i.removeAttribute("aria-disabled"):i.setAttribute("aria-disabled","true")},as=class extends F{static get observedAttributes(){return[...super.observedAttributes,ns,dn]}connectedCallback(){super.connectedCallback(),qh(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),qh(this)}get mediaPaused(){return w(this,s.MEDIA_PAUSED)}set mediaPaused(e){C(this,s.MEDIA_PAUSED,e)}get mediaTimeIsLive(){return w(this,s.MEDIA_TIME_IS_LIVE)}set mediaTimeIsLive(e){C(this,s.MEDIA_TIME_IS_LIVE,e)}handleClick(){!this.mediaPaused&&this.mediaTimeIsLive||(this.dispatchEvent(new d.CustomEvent(Of,{composed:!0,bubbles:!0})),this.hasAttribute(dn)&&this.dispatchEvent(new d.CustomEvent(Uf,{composed:!0,bubbles:!0})))}};as.getSlotTemplateHTML=$f;d.customElements.get("media-live-button")||d.customElements.define("media-live-button",as);var zh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},cn=(i,e,t)=>(zh(i,e,"read from private field"),t?t.call(i):e.get(i)),Gh=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},un=(i,e,t,r)=>(zh(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),vt,ls,ss={LOADING_DELAY:"loadingdelay",NO_AUTOHIDE:"noautohide"},Yh=500,Hf=`
1199
+ `}var Kh=i=>{var e;let t=i.mediaPaused||!i.mediaTimeIsLive,r=t?E("seek to live"):E("playing live");i.setAttribute("aria-label",r);let o=(e=i.shadowRoot)==null?void 0:e.querySelector('slot[name="text"]');o&&(o.textContent=E("live")),t?i.removeAttribute("aria-disabled"):i.setAttribute("aria-disabled","true")},as=class extends F{static get observedAttributes(){return[...super.observedAttributes,ns,dn]}connectedCallback(){super.connectedCallback(),Kh(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),Kh(this)}get mediaPaused(){return w(this,s.MEDIA_PAUSED)}set mediaPaused(e){I(this,s.MEDIA_PAUSED,e)}get mediaTimeIsLive(){return w(this,s.MEDIA_TIME_IS_LIVE)}set mediaTimeIsLive(e){I(this,s.MEDIA_TIME_IS_LIVE,e)}handleClick(){!this.mediaPaused&&this.mediaTimeIsLive||(this.dispatchEvent(new d.CustomEvent(Pf,{composed:!0,bubbles:!0})),this.hasAttribute(dn)&&this.dispatchEvent(new d.CustomEvent(Df,{composed:!0,bubbles:!0})))}};as.getSlotTemplateHTML=Uf;d.customElements.get("media-live-button")||d.customElements.define("media-live-button",as);var Gh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},cn=(i,e,t)=>(Gh(i,e,"read from private field"),t?t.call(i):e.get(i)),qh=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},un=(i,e,t,r)=>(Gh(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),vt,ls,ss={LOADING_DELAY:"loadingdelay",NO_AUTOHIDE:"noautohide"},zh=500,Nf=`
1200
1200
  <svg aria-hidden="true" viewBox="0 0 100 100">
1201
1201
  <path d="M73,50c0-12.7-10.3-23-23-23S27,37.3,27,50 M30.9,50c0-10.5,8.5-19.1,19.1-19.1S69.1,39.5,69.1,50">
1202
1202
  <animateTransform
@@ -1209,13 +1209,13 @@ bp-player[has-error] {
1209
1209
  repeatCount="indefinite" />
1210
1210
  </path>
1211
1211
  </svg>
1212
- `;function Bf(i){return`
1212
+ `;function $f(i){return`
1213
1213
  <style>
1214
1214
  :host {
1215
1215
  display: var(--media-control-display, var(--media-loading-indicator-display, inline-block));
1216
1216
  vertical-align: middle;
1217
1217
  box-sizing: border-box;
1218
- --_loading-indicator-delay: var(--media-loading-indicator-transition-delay, ${Yh}ms);
1218
+ --_loading-indicator-delay: var(--media-loading-indicator-transition-delay, ${zh}ms);
1219
1219
  }
1220
1220
 
1221
1221
  #status {
@@ -1254,15 +1254,15 @@ bp-player[has-error] {
1254
1254
  }
1255
1255
  </style>
1256
1256
 
1257
- <slot name="icon">${Hf}</slot>
1257
+ <slot name="icon">${Nf}</slot>
1258
1258
  <div id="status" role="status" aria-live="polite">${E("media loading")}</div>
1259
- `}var hn=class extends d.HTMLElement{constructor(){if(super(),Gh(this,vt,void 0),Gh(this,ls,Yh),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[N.MEDIA_CONTROLLER,s.MEDIA_PAUSED,s.MEDIA_LOADING,ss.LOADING_DELAY]}attributeChangedCallback(e,t,r){var o,n,a,l,c;e===ss.LOADING_DELAY&&t!==r?this.loadingDelay=Number(r):e===N.MEDIA_CONTROLLER&&(t&&((n=(o=cn(this,vt))==null?void 0:o.unassociateElement)==null||n.call(o,this),un(this,vt,null)),r&&this.isConnected&&(un(this,vt,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(c=(l=cn(this,vt))==null?void 0:l.associateElement)==null||c.call(l,this)))}connectedCallback(){var e,t,r;let o=this.getAttribute(N.MEDIA_CONTROLLER);o&&(un(this,vt,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=cn(this,vt))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=cn(this,vt))==null?void 0:e.unassociateElement)==null||t.call(e,this),un(this,vt,null)}get loadingDelay(){return cn(this,ls)}set loadingDelay(e){un(this,ls,e);let{style:t}=J(this.shadowRoot,":host");t.setProperty("--_loading-indicator-delay",`var(--media-loading-indicator-transition-delay, ${e}ms)`)}get mediaPaused(){return w(this,s.MEDIA_PAUSED)}set mediaPaused(e){C(this,s.MEDIA_PAUSED,e)}get mediaLoading(){return w(this,s.MEDIA_LOADING)}set mediaLoading(e){C(this,s.MEDIA_LOADING,e)}get mediaController(){return P(this,N.MEDIA_CONTROLLER)}set mediaController(e){D(this,N.MEDIA_CONTROLLER,e)}get noAutohide(){return w(this,ss.NO_AUTOHIDE)}set noAutohide(e){C(this,ss.NO_AUTOHIDE,e)}};vt=new WeakMap;ls=new WeakMap;hn.shadowRootOptions={mode:"open"};hn.getTemplateHTML=Bf;d.customElements.get("media-loading-indicator")||d.customElements.define("media-loading-indicator",hn);var Vf=`<svg aria-hidden="true" viewBox="0 0 24 24">
1259
+ `}var hn=class extends d.HTMLElement{constructor(){if(super(),qh(this,vt,void 0),qh(this,ls,zh),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[N.MEDIA_CONTROLLER,s.MEDIA_PAUSED,s.MEDIA_LOADING,ss.LOADING_DELAY]}attributeChangedCallback(e,t,r){var o,n,a,l,c;e===ss.LOADING_DELAY&&t!==r?this.loadingDelay=Number(r):e===N.MEDIA_CONTROLLER&&(t&&((n=(o=cn(this,vt))==null?void 0:o.unassociateElement)==null||n.call(o,this),un(this,vt,null)),r&&this.isConnected&&(un(this,vt,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(c=(l=cn(this,vt))==null?void 0:l.associateElement)==null||c.call(l,this)))}connectedCallback(){var e,t,r;let o=this.getAttribute(N.MEDIA_CONTROLLER);o&&(un(this,vt,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=cn(this,vt))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=cn(this,vt))==null?void 0:e.unassociateElement)==null||t.call(e,this),un(this,vt,null)}get loadingDelay(){return cn(this,ls)}set loadingDelay(e){un(this,ls,e);let{style:t}=J(this.shadowRoot,":host");t.setProperty("--_loading-indicator-delay",`var(--media-loading-indicator-transition-delay, ${e}ms)`)}get mediaPaused(){return w(this,s.MEDIA_PAUSED)}set mediaPaused(e){I(this,s.MEDIA_PAUSED,e)}get mediaLoading(){return w(this,s.MEDIA_LOADING)}set mediaLoading(e){I(this,s.MEDIA_LOADING,e)}get mediaController(){return P(this,N.MEDIA_CONTROLLER)}set mediaController(e){D(this,N.MEDIA_CONTROLLER,e)}get noAutohide(){return w(this,ss.NO_AUTOHIDE)}set noAutohide(e){I(this,ss.NO_AUTOHIDE,e)}};vt=new WeakMap;ls=new WeakMap;hn.shadowRootOptions={mode:"open"};hn.getTemplateHTML=$f;d.customElements.get("media-loading-indicator")||d.customElements.define("media-loading-indicator",hn);var Hf=`<svg aria-hidden="true" viewBox="0 0 24 24">
1260
1260
  <path d="M16.5 12A4.5 4.5 0 0 0 14 8v2.18l2.45 2.45a4.22 4.22 0 0 0 .05-.63Zm2.5 0a6.84 6.84 0 0 1-.54 2.64L20 16.15A8.8 8.8 0 0 0 21 12a9 9 0 0 0-7-8.77v2.06A7 7 0 0 1 19 12ZM4.27 3 3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25A6.92 6.92 0 0 1 14 18.7v2.06A9 9 0 0 0 17.69 19l2 2.05L21 19.73l-9-9L4.27 3ZM12 4 9.91 6.09 12 8.18V4Z"/>
1261
- </svg>`,Qh=`<svg aria-hidden="true" viewBox="0 0 24 24">
1261
+ </svg>`,Yh=`<svg aria-hidden="true" viewBox="0 0 24 24">
1262
1262
  <path d="M3 9v6h4l5 5V4L7 9H3Zm13.5 3A4.5 4.5 0 0 0 14 8v8a4.47 4.47 0 0 0 2.5-4Z"/>
1263
- </svg>`,Wf=`<svg aria-hidden="true" viewBox="0 0 24 24">
1263
+ </svg>`,Bf=`<svg aria-hidden="true" viewBox="0 0 24 24">
1264
1264
  <path d="M3 9v6h4l5 5V4L7 9H3Zm13.5 3A4.5 4.5 0 0 0 14 8v8a4.47 4.47 0 0 0 2.5-4ZM14 3.23v2.06a7 7 0 0 1 0 13.42v2.06a9 9 0 0 0 0-17.54Z"/>
1265
- </svg>`;function Ff(i){return`
1265
+ </svg>`;function Vf(i){return`
1266
1266
  <style>
1267
1267
  :host(:not([${s.MEDIA_VOLUME_LEVEL}])) slot[name=icon] slot:not([name=high]),
1268
1268
  :host([${s.MEDIA_VOLUME_LEVEL}=high]) slot[name=icon] slot:not([name=high]) {
@@ -1288,17 +1288,17 @@ bp-player[has-error] {
1288
1288
  </style>
1289
1289
 
1290
1290
  <slot name="icon">
1291
- <slot name="off">${Vf}</slot>
1292
- <slot name="low">${Qh}</slot>
1293
- <slot name="medium">${Qh}</slot>
1294
- <slot name="high">${Wf}</slot>
1291
+ <slot name="off">${Hf}</slot>
1292
+ <slot name="low">${Yh}</slot>
1293
+ <slot name="medium">${Yh}</slot>
1294
+ <slot name="high">${Bf}</slot>
1295
1295
  </slot>
1296
- `}function Kf(){return`
1296
+ `}function Wf(){return`
1297
1297
  <slot name="tooltip-mute">${E("Mute")}</slot>
1298
1298
  <slot name="tooltip-unmute">${E("Unmute")}</slot>
1299
- `}var Zh=i=>{let t=i.mediaVolumeLevel==="off"?E("unmute"):E("mute");i.setAttribute("aria-label",t)},pn=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_VOLUME_LEVEL]}connectedCallback(){super.connectedCallback(),Zh(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_VOLUME_LEVEL&&Zh(this)}get mediaVolumeLevel(){return P(this,s.MEDIA_VOLUME_LEVEL)}set mediaVolumeLevel(e){D(this,s.MEDIA_VOLUME_LEVEL,e)}handleClick(){let e=this.mediaVolumeLevel==="off"?b.MEDIA_UNMUTE_REQUEST:b.MEDIA_MUTE_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};pn.getSlotTemplateHTML=Ff;pn.getTooltipContentHTML=Kf;d.customElements.get("media-mute-button")||d.customElements.define("media-mute-button",pn);var Xh=`<svg aria-hidden="true" viewBox="0 0 28 24">
1299
+ `}var Qh=i=>{let t=i.mediaVolumeLevel==="off"?E("unmute"):E("mute");i.setAttribute("aria-label",t)},pn=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_VOLUME_LEVEL]}connectedCallback(){super.connectedCallback(),Qh(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_VOLUME_LEVEL&&Qh(this)}get mediaVolumeLevel(){return P(this,s.MEDIA_VOLUME_LEVEL)}set mediaVolumeLevel(e){D(this,s.MEDIA_VOLUME_LEVEL,e)}handleClick(){let e=this.mediaVolumeLevel==="off"?b.MEDIA_UNMUTE_REQUEST:b.MEDIA_MUTE_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};pn.getSlotTemplateHTML=Vf;pn.getTooltipContentHTML=Wf;d.customElements.get("media-mute-button")||d.customElements.define("media-mute-button",pn);var Zh=`<svg aria-hidden="true" viewBox="0 0 28 24">
1300
1300
  <path d="M24 3H4a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h20a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1Zm-1 16H5V5h18v14Zm-3-8h-7v5h7v-5Z"/>
1301
- </svg>`;function qf(i){return`
1301
+ </svg>`;function Ff(i){return`
1302
1302
  <style>
1303
1303
  :host([${s.MEDIA_IS_PIP}]) slot[name=icon] slot:not([name=exit]) {
1304
1304
  display: none !important;
@@ -1315,13 +1315,13 @@ bp-player[has-error] {
1315
1315
  </style>
1316
1316
 
1317
1317
  <slot name="icon">
1318
- <slot name="enter">${Xh}</slot>
1319
- <slot name="exit">${Xh}</slot>
1318
+ <slot name="enter">${Zh}</slot>
1319
+ <slot name="exit">${Zh}</slot>
1320
1320
  </slot>
1321
- `}function Gf(){return`
1321
+ `}function Kf(){return`
1322
1322
  <slot name="tooltip-enter">${E("Enter picture in picture mode")}</slot>
1323
1323
  <slot name="tooltip-exit">${E("Exit picture in picture mode")}</slot>
1324
- `}var Jh=i=>{let e=i.mediaIsPip?E("exit picture in picture mode"):E("enter picture in picture mode");i.setAttribute("aria-label",e)},mn=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_IS_PIP,s.MEDIA_PIP_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Jh(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_IS_PIP&&Jh(this)}get mediaPipUnavailable(){return P(this,s.MEDIA_PIP_UNAVAILABLE)}set mediaPipUnavailable(e){D(this,s.MEDIA_PIP_UNAVAILABLE,e)}get mediaIsPip(){return w(this,s.MEDIA_IS_PIP)}set mediaIsPip(e){C(this,s.MEDIA_IS_PIP,e)}handleClick(){let e=this.mediaIsPip?b.MEDIA_EXIT_PIP_REQUEST:b.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};mn.getSlotTemplateHTML=qf;mn.getTooltipContentHTML=Gf;d.customElements.get("media-pip-button")||d.customElements.define("media-pip-button",mn);var zf=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Rr=(i,e,t)=>(zf(i,e,"read from private field"),t?t.call(i):e.get(i)),Yf=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ei,Sd={RATES:"rates"},kd=[1,1.2,1.5,1.7,2],Vi=1;function Qf(i){return`
1324
+ `}var Xh=i=>{let e=i.mediaIsPip?E("exit picture in picture mode"):E("enter picture in picture mode");i.setAttribute("aria-label",e)},mn=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_IS_PIP,s.MEDIA_PIP_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Xh(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_IS_PIP&&Xh(this)}get mediaPipUnavailable(){return P(this,s.MEDIA_PIP_UNAVAILABLE)}set mediaPipUnavailable(e){D(this,s.MEDIA_PIP_UNAVAILABLE,e)}get mediaIsPip(){return w(this,s.MEDIA_IS_PIP)}set mediaIsPip(e){I(this,s.MEDIA_IS_PIP,e)}handleClick(){let e=this.mediaIsPip?b.MEDIA_EXIT_PIP_REQUEST:b.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};mn.getSlotTemplateHTML=Ff;mn.getTooltipContentHTML=Kf;d.customElements.get("media-pip-button")||d.customElements.define("media-pip-button",mn);var qf=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Rr=(i,e,t)=>(qf(i,e,"read from private field"),t?t.call(i):e.get(i)),Gf=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ei,Sd={RATES:"rates"},kd=[1,1.2,1.5,1.7,2],Vi=1;function zf(i){return`
1325
1325
  <style>
1326
1326
  :host {
1327
1327
  min-width: 5ch;
@@ -1329,11 +1329,11 @@ bp-player[has-error] {
1329
1329
  }
1330
1330
  </style>
1331
1331
  <slot name="icon">${i.mediaplaybackrate||Vi}x</slot>
1332
- `}function Zf(){return E("Playback rate")}var vn=class extends F{constructor(){var e;super(),Yf(this,ei,new Yt(this,Sd.RATES,{defaultValue:kd})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${(e=this.mediaPlaybackRate)!=null?e:Vi}x`}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PLAYBACK_RATE,Sd.RATES]}attributeChangedCallback(e,t,r){if(super.attributeChangedCallback(e,t,r),e===Sd.RATES&&(Rr(this,ei).value=r),e===s.MEDIA_PLAYBACK_RATE){let o=r?+r:Number.NaN,n=Number.isNaN(o)?Vi:o;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",E("Playback rate {playbackRate}",{playbackRate:n}))}}get rates(){return Rr(this,ei)}set rates(e){e?Array.isArray(e)?Rr(this,ei).value=e.join(" "):typeof e=="string"&&(Rr(this,ei).value=e):Rr(this,ei).value=""}get mediaPlaybackRate(){return $(this,s.MEDIA_PLAYBACK_RATE,Vi)}set mediaPlaybackRate(e){B(this,s.MEDIA_PLAYBACK_RATE,e)}handleClick(){var e,t;let r=Array.from(Rr(this,ei).values(),a=>+a).sort((a,l)=>a-l),o=(t=(e=r.find(a=>a>this.mediaPlaybackRate))!=null?e:r[0])!=null?t:Vi,n=new d.CustomEvent(b.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:o});this.dispatchEvent(n)}};ei=new WeakMap;vn.getSlotTemplateHTML=Qf;vn.getTooltipContentHTML=Zf;d.customElements.get("media-playback-rate-button")||d.customElements.define("media-playback-rate-button",vn);var Xf=`<svg aria-hidden="true" viewBox="0 0 24 24">
1332
+ `}function Yf(){return E("Playback rate")}var vn=class extends F{constructor(){var e;super(),Gf(this,ei,new Yt(this,Sd.RATES,{defaultValue:kd})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${(e=this.mediaPlaybackRate)!=null?e:Vi}x`}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PLAYBACK_RATE,Sd.RATES]}attributeChangedCallback(e,t,r){if(super.attributeChangedCallback(e,t,r),e===Sd.RATES&&(Rr(this,ei).value=r),e===s.MEDIA_PLAYBACK_RATE){let o=r?+r:Number.NaN,n=Number.isNaN(o)?Vi:o;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",E("Playback rate {playbackRate}",{playbackRate:n}))}}get rates(){return Rr(this,ei)}set rates(e){e?Array.isArray(e)?Rr(this,ei).value=e.join(" "):typeof e=="string"&&(Rr(this,ei).value=e):Rr(this,ei).value=""}get mediaPlaybackRate(){return $(this,s.MEDIA_PLAYBACK_RATE,Vi)}set mediaPlaybackRate(e){B(this,s.MEDIA_PLAYBACK_RATE,e)}handleClick(){var e,t;let r=Array.from(Rr(this,ei).values(),a=>+a).sort((a,l)=>a-l),o=(t=(e=r.find(a=>a>this.mediaPlaybackRate))!=null?e:r[0])!=null?t:Vi,n=new d.CustomEvent(b.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:o});this.dispatchEvent(n)}};ei=new WeakMap;vn.getSlotTemplateHTML=zf;vn.getTooltipContentHTML=Yf;d.customElements.get("media-playback-rate-button")||d.customElements.define("media-playback-rate-button",vn);var Qf=`<svg aria-hidden="true" viewBox="0 0 24 24">
1333
1333
  <path d="m6 21 15-9L6 3v18Z"/>
1334
- </svg>`,Jf=`<svg aria-hidden="true" viewBox="0 0 24 24">
1334
+ </svg>`,Zf=`<svg aria-hidden="true" viewBox="0 0 24 24">
1335
1335
  <path d="M6 20h4V4H6v16Zm8-16v16h4V4h-4Z"/>
1336
- </svg>`;function jf(i){return`
1336
+ </svg>`;function Xf(i){return`
1337
1337
  <style>
1338
1338
  :host([${s.MEDIA_PAUSED}]) slot[name=pause],
1339
1339
  :host(:not([${s.MEDIA_PAUSED}])) slot[name=play] {
@@ -1347,13 +1347,13 @@ bp-player[has-error] {
1347
1347
  </style>
1348
1348
 
1349
1349
  <slot name="icon">
1350
- <slot name="play">${Xf}</slot>
1351
- <slot name="pause">${Jf}</slot>
1350
+ <slot name="play">${Qf}</slot>
1351
+ <slot name="pause">${Zf}</slot>
1352
1352
  </slot>
1353
- `}function eg(){return`
1353
+ `}function Jf(){return`
1354
1354
  <slot name="tooltip-play">${E("Play")}</slot>
1355
1355
  <slot name="tooltip-pause">${E("Pause")}</slot>
1356
- `}var jh=i=>{let e=i.mediaPaused?E("play"):E("pause");i.setAttribute("aria-label",e)},fn=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PAUSED,s.MEDIA_ENDED]}connectedCallback(){super.connectedCallback(),jh(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),(e===s.MEDIA_PAUSED||e===s.MEDIA_LANG)&&jh(this)}get mediaPaused(){return w(this,s.MEDIA_PAUSED)}set mediaPaused(e){C(this,s.MEDIA_PAUSED,e)}handleClick(){let e=this.mediaPaused?b.MEDIA_PLAY_REQUEST:b.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};fn.getSlotTemplateHTML=jf;fn.getTooltipContentHTML=eg;d.customElements.get("media-play-button")||d.customElements.define("media-play-button",fn);var ft={PLACEHOLDER_SRC:"placeholdersrc",SRC:"src"};function tg(i){return`
1356
+ `}var Jh=i=>{let e=i.mediaPaused?E("play"):E("pause");i.setAttribute("aria-label",e)},fn=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PAUSED,s.MEDIA_ENDED]}connectedCallback(){super.connectedCallback(),Jh(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),(e===s.MEDIA_PAUSED||e===s.MEDIA_LANG)&&Jh(this)}get mediaPaused(){return w(this,s.MEDIA_PAUSED)}set mediaPaused(e){I(this,s.MEDIA_PAUSED,e)}handleClick(){let e=this.mediaPaused?b.MEDIA_PLAY_REQUEST:b.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};fn.getSlotTemplateHTML=Xf;fn.getTooltipContentHTML=Jf;d.customElements.get("media-play-button")||d.customElements.define("media-play-button",fn);var ft={PLACEHOLDER_SRC:"placeholdersrc",SRC:"src"};function jf(i){return`
1357
1357
  <style>
1358
1358
  :host {
1359
1359
  pointer-events: none;
@@ -1375,7 +1375,7 @@ bp-player[has-error] {
1375
1375
  </style>
1376
1376
 
1377
1377
  <img part="poster img" aria-hidden="true" id="image"/>
1378
- `}var ig=i=>{i.style.removeProperty("background-image")},rg=(i,e)=>{i.style["background-image"]=`url('${e}')`},gn=class extends d.HTMLElement{static get observedAttributes(){return[ft.PLACEHOLDER_SRC,ft.SRC]}constructor(){if(super(),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,t,r){e===ft.SRC&&(r==null?this.image.removeAttribute(ft.SRC):this.image.setAttribute(ft.SRC,r)),e===ft.PLACEHOLDER_SRC&&(r==null?ig(this.image):rg(this.image,r))}get placeholderSrc(){return P(this,ft.PLACEHOLDER_SRC)}set placeholderSrc(e){D(this,ft.SRC,e)}get src(){return P(this,ft.SRC)}set src(e){D(this,ft.SRC,e)}};gn.shadowRootOptions={mode:"open"};gn.getTemplateHTML=tg;d.customElements.get("media-poster-image")||d.customElements.define("media-poster-image",gn);var ep=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},og=(i,e,t)=>(ep(i,e,"read from private field"),t?t.call(i):e.get(i)),ng=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ag=(i,e,t,r)=>(ep(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ds,Ld=class extends xe{constructor(){super(),ng(this,ds,void 0),ag(this,ds,this.shadowRoot.querySelector("slot"))}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PREVIEW_CHAPTER,s.MEDIA_LANG]}attributeChangedCallback(e,t,r){if(super.attributeChangedCallback(e,t,r),(e===s.MEDIA_PREVIEW_CHAPTER||e===s.MEDIA_LANG)&&r!==t&&r!=null)if(og(this,ds).textContent=r,r!==""){let o=E("chapter: {chapterName}",{chapterName:r});this.setAttribute("aria-valuetext",o)}else this.removeAttribute("aria-valuetext")}get mediaPreviewChapter(){return P(this,s.MEDIA_PREVIEW_CHAPTER)}set mediaPreviewChapter(e){D(this,s.MEDIA_PREVIEW_CHAPTER,e)}};ds=new WeakMap;d.customElements.get("media-preview-chapter-display")||d.customElements.define("media-preview-chapter-display",Ld);var tp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},cs=(i,e,t)=>(tp(i,e,"read from private field"),t?t.call(i):e.get(i)),sg=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},us=(i,e,t,r)=>(tp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),gt;function lg(i){return`
1378
+ `}var eg=i=>{i.style.removeProperty("background-image")},tg=(i,e)=>{i.style["background-image"]=`url('${e}')`},gn=class extends d.HTMLElement{static get observedAttributes(){return[ft.PLACEHOLDER_SRC,ft.SRC]}constructor(){if(super(),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,t,r){e===ft.SRC&&(r==null?this.image.removeAttribute(ft.SRC):this.image.setAttribute(ft.SRC,r)),e===ft.PLACEHOLDER_SRC&&(r==null?eg(this.image):tg(this.image,r))}get placeholderSrc(){return P(this,ft.PLACEHOLDER_SRC)}set placeholderSrc(e){D(this,ft.SRC,e)}get src(){return P(this,ft.SRC)}set src(e){D(this,ft.SRC,e)}};gn.shadowRootOptions={mode:"open"};gn.getTemplateHTML=jf;d.customElements.get("media-poster-image")||d.customElements.define("media-poster-image",gn);var jh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ig=(i,e,t)=>(jh(i,e,"read from private field"),t?t.call(i):e.get(i)),rg=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},og=(i,e,t,r)=>(jh(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ds,Ld=class extends xe{constructor(){super(),rg(this,ds,void 0),og(this,ds,this.shadowRoot.querySelector("slot"))}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PREVIEW_CHAPTER,s.MEDIA_LANG]}attributeChangedCallback(e,t,r){if(super.attributeChangedCallback(e,t,r),(e===s.MEDIA_PREVIEW_CHAPTER||e===s.MEDIA_LANG)&&r!==t&&r!=null)if(ig(this,ds).textContent=r,r!==""){let o=E("chapter: {chapterName}",{chapterName:r});this.setAttribute("aria-valuetext",o)}else this.removeAttribute("aria-valuetext")}get mediaPreviewChapter(){return P(this,s.MEDIA_PREVIEW_CHAPTER)}set mediaPreviewChapter(e){D(this,s.MEDIA_PREVIEW_CHAPTER,e)}};ds=new WeakMap;d.customElements.get("media-preview-chapter-display")||d.customElements.define("media-preview-chapter-display",Ld);var ep=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},cs=(i,e,t)=>(ep(i,e,"read from private field"),t?t.call(i):e.get(i)),ng=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},us=(i,e,t,r)=>(ep(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),gt;function ag(i){return`
1379
1379
  <style>
1380
1380
  :host {
1381
1381
  box-sizing: border-box;
@@ -1389,27 +1389,27 @@ bp-player[has-error] {
1389
1389
  }
1390
1390
  </style>
1391
1391
  <img crossorigin loading="eager" decoding="async">
1392
- `}var xr=class extends d.HTMLElement{constructor(){if(super(),sg(this,gt,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[N.MEDIA_CONTROLLER,s.MEDIA_PREVIEW_IMAGE,s.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,t,r;let o=this.getAttribute(N.MEDIA_CONTROLLER);o&&(us(this,gt,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=cs(this,gt))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=cs(this,gt))==null?void 0:e.unassociateElement)==null||t.call(e,this),us(this,gt,null)}attributeChangedCallback(e,t,r){var o,n,a,l,c;[s.MEDIA_PREVIEW_IMAGE,s.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===N.MEDIA_CONTROLLER&&(t&&((n=(o=cs(this,gt))==null?void 0:o.unassociateElement)==null||n.call(o,this),us(this,gt,null)),r&&this.isConnected&&(us(this,gt,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(c=(l=cs(this,gt))==null?void 0:l.associateElement)==null||c.call(l,this)))}get mediaPreviewImage(){return P(this,s.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){D(this,s.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewCoords(){let e=this.getAttribute(s.MEDIA_PREVIEW_COORDS);if(e)return e.split(/\s+/).map(t=>+t)}set mediaPreviewCoords(e){if(!e){this.removeAttribute(s.MEDIA_PREVIEW_COORDS);return}this.setAttribute(s.MEDIA_PREVIEW_COORDS,e.join(" "))}update(){let e=this.mediaPreviewCoords,t=this.mediaPreviewImage;if(!(e&&t))return;let[r,o,n,a]=e,l=t.split("#")[0],c=getComputedStyle(this),{maxWidth:p,maxHeight:h,minWidth:v,minHeight:g}=c,m=Math.min(parseInt(p)/n,parseInt(h)/a),A=Math.max(parseInt(v)/n,parseInt(g)/a),f=m<1,R=f?m:A>1?A:1,{style:O}=J(this.shadowRoot,":host"),Oe=J(this.shadowRoot,"img").style,ot=this.shadowRoot.querySelector("img"),Lo=f?"min":"max";O.setProperty(`${Lo}-width`,"initial","important"),O.setProperty(`${Lo}-height`,"initial","important"),O.width=`${n*R}px`,O.height=`${a*R}px`;let ar=()=>{Oe.width=`${this.imgWidth*R}px`,Oe.height=`${this.imgHeight*R}px`,Oe.display="block"};ot.src!==l&&(ot.onload=()=>{this.imgWidth=ot.naturalWidth,this.imgHeight=ot.naturalHeight,ar()},ot.src=l,ar()),ar(),Oe.transform=`translate(-${r*R}px, -${o*R}px)`}};gt=new WeakMap;xr.shadowRootOptions={mode:"open"};xr.getTemplateHTML=lg;d.customElements.get("media-preview-thumbnail")||d.customElements.define("media-preview-thumbnail",xr);var hs=xr;var rp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ip=(i,e,t)=>(rp(i,e,"read from private field"),t?t.call(i):e.get(i)),dg=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},cg=(i,e,t,r)=>(rp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),En,wd=class extends xe{constructor(){super(),dg(this,En,void 0),cg(this,En,this.shadowRoot.querySelector("slot")),ip(this,En).textContent=Xe(0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PREVIEW_TIME]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_PREVIEW_TIME&&r!=null&&(ip(this,En).textContent=Xe(parseFloat(r)))}get mediaPreviewTime(){return $(this,s.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){B(this,s.MEDIA_PREVIEW_TIME,e)}};En=new WeakMap;d.customElements.get("media-preview-time-display")||d.customElements.define("media-preview-time-display",wd);var Pr={SEEK_OFFSET:"seekoffset"},Cd=30,ug=i=>`
1392
+ `}var xr=class extends d.HTMLElement{constructor(){if(super(),ng(this,gt,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[N.MEDIA_CONTROLLER,s.MEDIA_PREVIEW_IMAGE,s.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,t,r;let o=this.getAttribute(N.MEDIA_CONTROLLER);o&&(us(this,gt,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=cs(this,gt))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=cs(this,gt))==null?void 0:e.unassociateElement)==null||t.call(e,this),us(this,gt,null)}attributeChangedCallback(e,t,r){var o,n,a,l,c;[s.MEDIA_PREVIEW_IMAGE,s.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===N.MEDIA_CONTROLLER&&(t&&((n=(o=cs(this,gt))==null?void 0:o.unassociateElement)==null||n.call(o,this),us(this,gt,null)),r&&this.isConnected&&(us(this,gt,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(c=(l=cs(this,gt))==null?void 0:l.associateElement)==null||c.call(l,this)))}get mediaPreviewImage(){return P(this,s.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){D(this,s.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewCoords(){let e=this.getAttribute(s.MEDIA_PREVIEW_COORDS);if(e)return e.split(/\s+/).map(t=>+t)}set mediaPreviewCoords(e){if(!e){this.removeAttribute(s.MEDIA_PREVIEW_COORDS);return}this.setAttribute(s.MEDIA_PREVIEW_COORDS,e.join(" "))}update(){let e=this.mediaPreviewCoords,t=this.mediaPreviewImage;if(!(e&&t))return;let[r,o,n,a]=e,l=t.split("#")[0],c=getComputedStyle(this),{maxWidth:p,maxHeight:h,minWidth:v,minHeight:g}=c,m=Math.min(parseInt(p)/n,parseInt(h)/a),A=Math.max(parseInt(v)/n,parseInt(g)/a),f=m<1,R=f?m:A>1?A:1,{style:O}=J(this.shadowRoot,":host"),Oe=J(this.shadowRoot,"img").style,ot=this.shadowRoot.querySelector("img"),Lo=f?"min":"max";O.setProperty(`${Lo}-width`,"initial","important"),O.setProperty(`${Lo}-height`,"initial","important"),O.width=`${n*R}px`,O.height=`${a*R}px`;let ar=()=>{Oe.width=`${this.imgWidth*R}px`,Oe.height=`${this.imgHeight*R}px`,Oe.display="block"};ot.src!==l&&(ot.onload=()=>{this.imgWidth=ot.naturalWidth,this.imgHeight=ot.naturalHeight,ar()},ot.src=l,ar()),ar(),Oe.transform=`translate(-${r*R}px, -${o*R}px)`}};gt=new WeakMap;xr.shadowRootOptions={mode:"open"};xr.getTemplateHTML=ag;d.customElements.get("media-preview-thumbnail")||d.customElements.define("media-preview-thumbnail",xr);var hs=xr;var ip=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},tp=(i,e,t)=>(ip(i,e,"read from private field"),t?t.call(i):e.get(i)),sg=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},lg=(i,e,t,r)=>(ip(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),En,wd=class extends xe{constructor(){super(),sg(this,En,void 0),lg(this,En,this.shadowRoot.querySelector("slot")),tp(this,En).textContent=Xe(0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PREVIEW_TIME]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_PREVIEW_TIME&&r!=null&&(tp(this,En).textContent=Xe(parseFloat(r)))}get mediaPreviewTime(){return $(this,s.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){B(this,s.MEDIA_PREVIEW_TIME,e)}};En=new WeakMap;d.customElements.get("media-preview-time-display")||d.customElements.define("media-preview-time-display",wd);var Pr={SEEK_OFFSET:"seekoffset"},Id=30,dg=i=>`
1393
1393
  <svg aria-hidden="true" viewBox="0 0 20 24">
1394
1394
  <defs>
1395
1395
  <style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style>
1396
1396
  </defs>
1397
1397
  <text class="text value" transform="translate(2.18 19.87)">${i}</text>
1398
1398
  <path d="M10 6V3L4.37 7 10 10.94V8a5.54 5.54 0 0 1 1.9 10.48v2.12A7.5 7.5 0 0 0 10 6Z"/>
1399
- </svg>`;function hg(i,e){return`
1400
- <slot name="icon">${ug(e.seekOffset)}</slot>
1401
- `}function pg(){return E("Seek backward")}var mg=0,bn=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_CURRENT_TIME,Pr.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this.seekOffset=$(this,Pr.SEEK_OFFSET,Cd)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===Pr.SEEK_OFFSET&&(this.seekOffset=$(this,Pr.SEEK_OFFSET,Cd))}get seekOffset(){return $(this,Pr.SEEK_OFFSET,Cd)}set seekOffset(e){B(this,Pr.SEEK_OFFSET,e),this.setAttribute("aria-label",E("seek back {seekOffset} seconds",{seekOffset:this.seekOffset})),va(fa(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return $(this,s.MEDIA_CURRENT_TIME,mg)}set mediaCurrentTime(e){B(this,s.MEDIA_CURRENT_TIME,e)}handleClick(){let e=Math.max(this.mediaCurrentTime-this.seekOffset,0),t=new d.CustomEvent(b.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};bn.getSlotTemplateHTML=hg;bn.getTooltipContentHTML=pg;d.customElements.get("media-seek-backward-button")||d.customElements.define("media-seek-backward-button",bn);var Dr={SEEK_OFFSET:"seekoffset"},Id=30,vg=i=>`
1399
+ </svg>`;function cg(i,e){return`
1400
+ <slot name="icon">${dg(e.seekOffset)}</slot>
1401
+ `}function ug(){return E("Seek backward")}var hg=0,bn=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_CURRENT_TIME,Pr.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this.seekOffset=$(this,Pr.SEEK_OFFSET,Id)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===Pr.SEEK_OFFSET&&(this.seekOffset=$(this,Pr.SEEK_OFFSET,Id))}get seekOffset(){return $(this,Pr.SEEK_OFFSET,Id)}set seekOffset(e){B(this,Pr.SEEK_OFFSET,e),this.setAttribute("aria-label",E("seek back {seekOffset} seconds",{seekOffset:this.seekOffset})),va(fa(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return $(this,s.MEDIA_CURRENT_TIME,hg)}set mediaCurrentTime(e){B(this,s.MEDIA_CURRENT_TIME,e)}handleClick(){let e=Math.max(this.mediaCurrentTime-this.seekOffset,0),t=new d.CustomEvent(b.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};bn.getSlotTemplateHTML=cg;bn.getTooltipContentHTML=ug;d.customElements.get("media-seek-backward-button")||d.customElements.define("media-seek-backward-button",bn);var Dr={SEEK_OFFSET:"seekoffset"},Cd=30,pg=i=>`
1402
1402
  <svg aria-hidden="true" viewBox="0 0 20 24">
1403
1403
  <defs>
1404
1404
  <style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style>
1405
1405
  </defs>
1406
1406
  <text class="text value" transform="translate(8.9 19.87)">${i}</text>
1407
1407
  <path d="M10 6V3l5.61 4L10 10.94V8a5.54 5.54 0 0 0-1.9 10.48v2.12A7.5 7.5 0 0 1 10 6Z"/>
1408
- </svg>`;function fg(i,e){return`
1409
- <slot name="icon">${vg(e.seekOffset)}</slot>
1410
- `}function gg(){return E("Seek forward")}var Eg=0,_n=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_CURRENT_TIME,Dr.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this.seekOffset=$(this,Dr.SEEK_OFFSET,Id)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===Dr.SEEK_OFFSET&&(this.seekOffset=$(this,Dr.SEEK_OFFSET,Id))}get seekOffset(){return $(this,Dr.SEEK_OFFSET,Id)}set seekOffset(e){B(this,Dr.SEEK_OFFSET,e),this.setAttribute("aria-label",E("seek forward {seekOffset} seconds",{seekOffset:this.seekOffset})),va(fa(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return $(this,s.MEDIA_CURRENT_TIME,Eg)}set mediaCurrentTime(e){B(this,s.MEDIA_CURRENT_TIME,e)}handleClick(){let e=this.mediaCurrentTime+this.seekOffset,t=new d.CustomEvent(b.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};_n.getSlotTemplateHTML=fg;_n.getTooltipContentHTML=gg;d.customElements.get("media-seek-forward-button")||d.customElements.define("media-seek-forward-button",_n);var ap=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Md=(i,e,t)=>(ap(i,e,"read from private field"),t?t.call(i):e.get(i)),bg=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},_g=(i,e,t,r)=>(ap(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Or,Wi={REMAINING:"remaining",SHOW_DURATION:"showduration",NO_TOGGLE:"notoggle"},op=[...Object.values(Wi),s.MEDIA_CURRENT_TIME,s.MEDIA_DURATION,s.MEDIA_SEEKABLE],np=["Enter"," "],yg="&nbsp;/&nbsp;",Rd=(i,{timesSep:e=yg}={})=>{var t,r;let o=(t=i.mediaCurrentTime)!=null?t:0,[,n]=(r=i.mediaSeekable)!=null?r:[],a=0;Number.isFinite(i.mediaDuration)?a=i.mediaDuration:Number.isFinite(n)&&(a=n);let l=i.remaining?Xe(0-(a-o)):Xe(o);return i.showDuration?`${l}${e}${Xe(a)}`:l},Tg="video not loaded, unknown time.",Ag=i=>{var e;let t=i.mediaCurrentTime,[,r]=(e=i.mediaSeekable)!=null?e:[],o=null;if(Number.isFinite(i.mediaDuration)?o=i.mediaDuration:Number.isFinite(r)&&(o=r),t==null||o===null){i.setAttribute("aria-valuetext",Tg);return}let n=i.remaining?wi(0-(o-t)):wi(t);if(!i.showDuration){i.setAttribute("aria-valuetext",n);return}let a=wi(o),l=`${n} of ${a}`;i.setAttribute("aria-valuetext",l)};function Sg(i,e){return`
1408
+ </svg>`;function mg(i,e){return`
1409
+ <slot name="icon">${pg(e.seekOffset)}</slot>
1410
+ `}function vg(){return E("Seek forward")}var fg=0,_n=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_CURRENT_TIME,Dr.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this.seekOffset=$(this,Dr.SEEK_OFFSET,Cd)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===Dr.SEEK_OFFSET&&(this.seekOffset=$(this,Dr.SEEK_OFFSET,Cd))}get seekOffset(){return $(this,Dr.SEEK_OFFSET,Cd)}set seekOffset(e){B(this,Dr.SEEK_OFFSET,e),this.setAttribute("aria-label",E("seek forward {seekOffset} seconds",{seekOffset:this.seekOffset})),va(fa(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return $(this,s.MEDIA_CURRENT_TIME,fg)}set mediaCurrentTime(e){B(this,s.MEDIA_CURRENT_TIME,e)}handleClick(){let e=this.mediaCurrentTime+this.seekOffset,t=new d.CustomEvent(b.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};_n.getSlotTemplateHTML=mg;_n.getTooltipContentHTML=vg;d.customElements.get("media-seek-forward-button")||d.customElements.define("media-seek-forward-button",_n);var np=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Md=(i,e,t)=>(np(i,e,"read from private field"),t?t.call(i):e.get(i)),gg=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Eg=(i,e,t,r)=>(np(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Or,Wi={REMAINING:"remaining",SHOW_DURATION:"showduration",NO_TOGGLE:"notoggle"},rp=[...Object.values(Wi),s.MEDIA_CURRENT_TIME,s.MEDIA_DURATION,s.MEDIA_SEEKABLE],op=["Enter"," "],bg="&nbsp;/&nbsp;",Rd=(i,{timesSep:e=bg}={})=>{var t,r;let o=(t=i.mediaCurrentTime)!=null?t:0,[,n]=(r=i.mediaSeekable)!=null?r:[],a=0;Number.isFinite(i.mediaDuration)?a=i.mediaDuration:Number.isFinite(n)&&(a=n);let l=i.remaining?Xe(0-(a-o)):Xe(o);return i.showDuration?`${l}${e}${Xe(a)}`:l},_g="video not loaded, unknown time.",yg=i=>{var e;let t=i.mediaCurrentTime,[,r]=(e=i.mediaSeekable)!=null?e:[],o=null;if(Number.isFinite(i.mediaDuration)?o=i.mediaDuration:Number.isFinite(r)&&(o=r),t==null||o===null){i.setAttribute("aria-valuetext",_g);return}let n=i.remaining?wi(0-(o-t)):wi(t);if(!i.showDuration){i.setAttribute("aria-valuetext",n);return}let a=wi(o),l=`${n} of ${a}`;i.setAttribute("aria-valuetext",l)};function Tg(i,e){return`
1411
1411
  <slot>${Rd(e)}</slot>
1412
- `}var ps=class extends xe{constructor(){super(),bg(this,Or,void 0),_g(this,Or,this.shadowRoot.querySelector("slot")),Md(this,Or).innerHTML=`${Rd(this)}`}static get observedAttributes(){return[...super.observedAttributes,...op,"disabled"]}connectedCallback(){let{style:e}=J(this.shadowRoot,":host(:hover:not([notoggle]))");e.setProperty("cursor","var(--media-cursor, pointer)"),e.setProperty("background","var(--media-control-hover-background, rgba(50 50 70 / .7))"),this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","progressbar"),this.setAttribute("aria-label",E("playback time"));let t=r=>{let{key:o}=r;if(!np.includes(o)){this.removeEventListener("keyup",t);return}this.toggleTimeDisplay()};this.addEventListener("keydown",r=>{let{metaKey:o,altKey:n,key:a}=r;if(o||n||!np.includes(a)){this.removeEventListener("keyup",t);return}this.addEventListener("keyup",t)}),this.addEventListener("click",this.toggleTimeDisplay),super.connectedCallback()}toggleTimeDisplay(){this.noToggle||(this.hasAttribute("remaining")?this.removeAttribute("remaining"):this.setAttribute("remaining",""))}disconnectedCallback(){this.disable(),super.disconnectedCallback()}attributeChangedCallback(e,t,r){op.includes(e)?this.update():e==="disabled"&&r!==t&&(r==null?this.enable():this.disable()),super.attributeChangedCallback(e,t,r)}enable(){this.tabIndex=0}disable(){this.tabIndex=-1}get remaining(){return w(this,Wi.REMAINING)}set remaining(e){C(this,Wi.REMAINING,e)}get showDuration(){return w(this,Wi.SHOW_DURATION)}set showDuration(e){C(this,Wi.SHOW_DURATION,e)}get noToggle(){return w(this,Wi.NO_TOGGLE)}set noToggle(e){C(this,Wi.NO_TOGGLE,e)}get mediaDuration(){return $(this,s.MEDIA_DURATION)}set mediaDuration(e){B(this,s.MEDIA_DURATION,e)}get mediaCurrentTime(){return $(this,s.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){B(this,s.MEDIA_CURRENT_TIME,e)}get mediaSeekable(){let e=this.getAttribute(s.MEDIA_SEEKABLE);if(e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(s.MEDIA_SEEKABLE);return}this.setAttribute(s.MEDIA_SEEKABLE,e.join(":"))}update(){let e=Rd(this);Ag(this),e!==Md(this,Or).innerHTML&&(Md(this,Or).innerHTML=e)}};Or=new WeakMap;ps.getSlotTemplateHTML=Sg;d.customElements.get("media-time-display")||d.customElements.define("media-time-display",ps);var sp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ge=(i,e,t)=>(sp(i,e,"read from private field"),t?t.call(i):e.get(i)),Et=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Be=(i,e,t,r)=>(sp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),kg=(i,e,t,r)=>({set _(o){Be(i,e,o,t)},get _(){return ge(i,e,r)}}),Ur,ms,Nr,yn,vs,fs,gs,$r,Fi,Es,bs=class{constructor(e,t,r){Et(this,Ur,void 0),Et(this,ms,void 0),Et(this,Nr,void 0),Et(this,yn,void 0),Et(this,vs,void 0),Et(this,fs,void 0),Et(this,gs,void 0),Et(this,$r,void 0),Et(this,Fi,0),Et(this,Es,(o=performance.now())=>{Be(this,Fi,requestAnimationFrame(ge(this,Es))),Be(this,yn,performance.now()-ge(this,Nr));let n=1e3/this.fps;if(ge(this,yn)>n){Be(this,Nr,o-ge(this,yn)%n);let a=1e3/((o-ge(this,ms))/++kg(this,vs)._),l=(o-ge(this,fs))/1e3/this.duration,c=ge(this,gs)+l*this.playbackRate;c-ge(this,Ur).valueAsNumber>0?Be(this,$r,this.playbackRate/this.duration/a):(Be(this,$r,.995*ge(this,$r)),c=ge(this,Ur).valueAsNumber+ge(this,$r)),this.callback(c)}}),Be(this,Ur,e),this.callback=t,this.fps=r}start(){ge(this,Fi)===0&&(Be(this,Nr,performance.now()),Be(this,ms,ge(this,Nr)),Be(this,vs,0),ge(this,Es).call(this))}stop(){ge(this,Fi)!==0&&(cancelAnimationFrame(ge(this,Fi)),Be(this,Fi,0))}update({start:e,duration:t,playbackRate:r}){let o=e-ge(this,Ur).valueAsNumber,n=Math.abs(t-this.duration);(o>0||o<-.03||n>=.5)&&this.callback(e),Be(this,gs,e),Be(this,fs,performance.now()),this.duration=t,this.playbackRate=r}};Ur=new WeakMap;ms=new WeakMap;Nr=new WeakMap;yn=new WeakMap;vs=new WeakMap;fs=new WeakMap;gs=new WeakMap;$r=new WeakMap;Fi=new WeakMap;Es=new WeakMap;var Od=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},se=(i,e,t)=>(Od(i,e,"read from private field"),t?t.call(i):e.get(i)),me=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},qe=(i,e,t,r)=>(Od(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ye=(i,e,t)=>(Od(i,e,"access private method"),t),Hr,Ki,Ts,An,As,ys,Sn,kn,Br,Vr,Wr,Tn,Ud,lp,xd,Ss,Nd,ks,$d,Ls,Hd,Pd,dp,Ln,ws,Dd,cp,Lg="video not loaded, unknown time.",wg=i=>{let e=i.range,t=wi(+up(i)),r=wi(+i.mediaSeekableEnd),o=t&&r?`${t} of ${r}`:Lg;e.setAttribute("aria-valuetext",o)};function Cg(i){return`
1412
+ `}var ps=class extends xe{constructor(){super(),gg(this,Or,void 0),Eg(this,Or,this.shadowRoot.querySelector("slot")),Md(this,Or).innerHTML=`${Rd(this)}`}static get observedAttributes(){return[...super.observedAttributes,...rp,"disabled"]}connectedCallback(){let{style:e}=J(this.shadowRoot,":host(:hover:not([notoggle]))");e.setProperty("cursor","var(--media-cursor, pointer)"),e.setProperty("background","var(--media-control-hover-background, rgba(50 50 70 / .7))"),this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","progressbar"),this.setAttribute("aria-label",E("playback time"));let t=r=>{let{key:o}=r;if(!op.includes(o)){this.removeEventListener("keyup",t);return}this.toggleTimeDisplay()};this.addEventListener("keydown",r=>{let{metaKey:o,altKey:n,key:a}=r;if(o||n||!op.includes(a)){this.removeEventListener("keyup",t);return}this.addEventListener("keyup",t)}),this.addEventListener("click",this.toggleTimeDisplay),super.connectedCallback()}toggleTimeDisplay(){this.noToggle||(this.hasAttribute("remaining")?this.removeAttribute("remaining"):this.setAttribute("remaining",""))}disconnectedCallback(){this.disable(),super.disconnectedCallback()}attributeChangedCallback(e,t,r){rp.includes(e)?this.update():e==="disabled"&&r!==t&&(r==null?this.enable():this.disable()),super.attributeChangedCallback(e,t,r)}enable(){this.tabIndex=0}disable(){this.tabIndex=-1}get remaining(){return w(this,Wi.REMAINING)}set remaining(e){I(this,Wi.REMAINING,e)}get showDuration(){return w(this,Wi.SHOW_DURATION)}set showDuration(e){I(this,Wi.SHOW_DURATION,e)}get noToggle(){return w(this,Wi.NO_TOGGLE)}set noToggle(e){I(this,Wi.NO_TOGGLE,e)}get mediaDuration(){return $(this,s.MEDIA_DURATION)}set mediaDuration(e){B(this,s.MEDIA_DURATION,e)}get mediaCurrentTime(){return $(this,s.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){B(this,s.MEDIA_CURRENT_TIME,e)}get mediaSeekable(){let e=this.getAttribute(s.MEDIA_SEEKABLE);if(e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(s.MEDIA_SEEKABLE);return}this.setAttribute(s.MEDIA_SEEKABLE,e.join(":"))}update(){let e=Rd(this);yg(this),e!==Md(this,Or).innerHTML&&(Md(this,Or).innerHTML=e)}};Or=new WeakMap;ps.getSlotTemplateHTML=Tg;d.customElements.get("media-time-display")||d.customElements.define("media-time-display",ps);var ap=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ge=(i,e,t)=>(ap(i,e,"read from private field"),t?t.call(i):e.get(i)),Et=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Be=(i,e,t,r)=>(ap(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ag=(i,e,t,r)=>({set _(o){Be(i,e,o,t)},get _(){return ge(i,e,r)}}),Ur,ms,Nr,yn,vs,fs,gs,$r,Fi,Es,bs=class{constructor(e,t,r){Et(this,Ur,void 0),Et(this,ms,void 0),Et(this,Nr,void 0),Et(this,yn,void 0),Et(this,vs,void 0),Et(this,fs,void 0),Et(this,gs,void 0),Et(this,$r,void 0),Et(this,Fi,0),Et(this,Es,(o=performance.now())=>{Be(this,Fi,requestAnimationFrame(ge(this,Es))),Be(this,yn,performance.now()-ge(this,Nr));let n=1e3/this.fps;if(ge(this,yn)>n){Be(this,Nr,o-ge(this,yn)%n);let a=1e3/((o-ge(this,ms))/++Ag(this,vs)._),l=(o-ge(this,fs))/1e3/this.duration,c=ge(this,gs)+l*this.playbackRate;c-ge(this,Ur).valueAsNumber>0?Be(this,$r,this.playbackRate/this.duration/a):(Be(this,$r,.995*ge(this,$r)),c=ge(this,Ur).valueAsNumber+ge(this,$r)),this.callback(c)}}),Be(this,Ur,e),this.callback=t,this.fps=r}start(){ge(this,Fi)===0&&(Be(this,Nr,performance.now()),Be(this,ms,ge(this,Nr)),Be(this,vs,0),ge(this,Es).call(this))}stop(){ge(this,Fi)!==0&&(cancelAnimationFrame(ge(this,Fi)),Be(this,Fi,0))}update({start:e,duration:t,playbackRate:r}){let o=e-ge(this,Ur).valueAsNumber,n=Math.abs(t-this.duration);(o>0||o<-.03||n>=.5)&&this.callback(e),Be(this,gs,e),Be(this,fs,performance.now()),this.duration=t,this.playbackRate=r}};Ur=new WeakMap;ms=new WeakMap;Nr=new WeakMap;yn=new WeakMap;vs=new WeakMap;fs=new WeakMap;gs=new WeakMap;$r=new WeakMap;Fi=new WeakMap;Es=new WeakMap;var Od=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},se=(i,e,t)=>(Od(i,e,"read from private field"),t?t.call(i):e.get(i)),me=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},qe=(i,e,t,r)=>(Od(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ye=(i,e,t)=>(Od(i,e,"access private method"),t),Hr,Ki,Ts,An,As,ys,Sn,kn,Br,Vr,Wr,Tn,Ud,sp,xd,Ss,Nd,ks,$d,Ls,Hd,Pd,lp,Ln,ws,Dd,dp,Sg="video not loaded, unknown time.",kg=i=>{let e=i.range,t=wi(+cp(i)),r=wi(+i.mediaSeekableEnd),o=t&&r?`${t} of ${r}`:Sg;e.setAttribute("aria-valuetext",o)};function Lg(i){return`
1413
1413
  <style>
1414
1414
  :host {
1415
1415
  --media-box-border-radius: 4px;
@@ -1626,7 +1626,7 @@ bp-player[has-error] {
1626
1626
 
1627
1627
  </slot>
1628
1628
  </div>
1629
- `}var _s=(i,e=i.mediaCurrentTime)=>{let t=Number.isFinite(i.mediaSeekableStart)?i.mediaSeekableStart:0,r=Number.isFinite(i.mediaDuration)?i.mediaDuration:i.mediaSeekableEnd;if(Number.isNaN(r))return 0;let o=(e-t)/(r-t);return Math.max(0,Math.min(o,1))},up=(i,e=i.range.valueAsNumber)=>{let t=Number.isFinite(i.mediaSeekableStart)?i.mediaSeekableStart:0,r=Number.isFinite(i.mediaDuration)?i.mediaDuration:i.mediaSeekableEnd;return Number.isNaN(r)?0:e*(r-t)+t},wn=class extends ht{constructor(){super(),me(this,Wr),me(this,Ud),me(this,Ss),me(this,ks),me(this,Ls),me(this,Pd),me(this,Ln),me(this,Dd),me(this,Hr,void 0),me(this,Ki,void 0),me(this,Ts,void 0),me(this,An,void 0),me(this,As,void 0),me(this,ys,void 0),me(this,Sn,void 0),me(this,kn,void 0),me(this,Br,void 0),me(this,Vr,void 0),me(this,xd,r=>{this.dragging||(mr(r)&&(this.range.valueAsNumber=r),se(this,Vr)||this.updateBar())}),this.shadowRoot.querySelector("#track").insertAdjacentHTML("afterbegin",'<div id="buffered" part="buffered"></div>'),qe(this,Ts,this.shadowRoot.querySelectorAll('[part~="box"]')),qe(this,As,this.shadowRoot.querySelector('[part~="preview-box"]')),qe(this,ys,this.shadowRoot.querySelector('[part~="current-box"]'));let t=getComputedStyle(this);qe(this,Sn,parseInt(t.getPropertyValue("--media-box-padding-left"))),qe(this,kn,parseInt(t.getPropertyValue("--media-box-padding-right"))),qe(this,Ki,new bs(this.range,se(this,xd),60))}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PAUSED,s.MEDIA_DURATION,s.MEDIA_SEEKABLE,s.MEDIA_CURRENT_TIME,s.MEDIA_PREVIEW_IMAGE,s.MEDIA_PREVIEW_TIME,s.MEDIA_PREVIEW_CHAPTER,s.MEDIA_BUFFERED,s.MEDIA_PLAYBACK_RATE,s.MEDIA_LOADING,s.MEDIA_ENDED]}connectedCallback(){var e;super.connectedCallback(),this.range.setAttribute("aria-label",E("seek")),ye(this,Wr,Tn).call(this),qe(this,Hr,this.getRootNode()),(e=se(this,Hr))==null||e.addEventListener("transitionstart",this)}disconnectedCallback(){var e;super.disconnectedCallback(),ye(this,Wr,Tn).call(this),(e=se(this,Hr))==null||e.removeEventListener("transitionstart",this),qe(this,Hr,null)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),t!=r&&(e===s.MEDIA_CURRENT_TIME||e===s.MEDIA_PAUSED||e===s.MEDIA_ENDED||e===s.MEDIA_LOADING||e===s.MEDIA_DURATION||e===s.MEDIA_SEEKABLE?(se(this,Ki).update({start:_s(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),ye(this,Wr,Tn).call(this),wg(this)):e===s.MEDIA_BUFFERED&&this.updateBufferedBar(),(e===s.MEDIA_DURATION||e===s.MEDIA_SEEKABLE)&&(this.mediaChaptersCues=se(this,Br),this.updateBar()))}get mediaChaptersCues(){return se(this,Br)}set mediaChaptersCues(e){var t;qe(this,Br,e),this.updateSegments((t=se(this,Br))==null?void 0:t.map(r=>({start:_s(this,r.startTime),end:_s(this,r.endTime)})))}get mediaPaused(){return w(this,s.MEDIA_PAUSED)}set mediaPaused(e){C(this,s.MEDIA_PAUSED,e)}get mediaLoading(){return w(this,s.MEDIA_LOADING)}set mediaLoading(e){C(this,s.MEDIA_LOADING,e)}get mediaDuration(){return $(this,s.MEDIA_DURATION)}set mediaDuration(e){B(this,s.MEDIA_DURATION,e)}get mediaCurrentTime(){return $(this,s.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){B(this,s.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return $(this,s.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){B(this,s.MEDIA_PLAYBACK_RATE,e)}get mediaBuffered(){let e=this.getAttribute(s.MEDIA_BUFFERED);return e?e.split(" ").map(t=>t.split(":").map(r=>+r)):[]}set mediaBuffered(e){if(!e){this.removeAttribute(s.MEDIA_BUFFERED);return}let t=e.map(r=>r.join(":")).join(" ");this.setAttribute(s.MEDIA_BUFFERED,t)}get mediaSeekable(){let e=this.getAttribute(s.MEDIA_SEEKABLE);if(e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(s.MEDIA_SEEKABLE);return}this.setAttribute(s.MEDIA_SEEKABLE,e.join(":"))}get mediaSeekableEnd(){var e;let[,t=this.mediaDuration]=(e=this.mediaSeekable)!=null?e:[];return t}get mediaSeekableStart(){var e;let[t=0]=(e=this.mediaSeekable)!=null?e:[];return t}get mediaPreviewImage(){return P(this,s.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){D(this,s.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return $(this,s.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){B(this,s.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return w(this,s.MEDIA_ENDED)}set mediaEnded(e){C(this,s.MEDIA_ENDED,e)}updateBar(){super.updateBar(),this.updateBufferedBar(),this.updateCurrentBox()}updateBufferedBar(){var e;let t=this.mediaBuffered;if(!t.length)return;let r;if(this.mediaEnded)r=1;else{let n=this.mediaCurrentTime,[,a=this.mediaSeekableStart]=(e=t.find(([l,c])=>l<=n&&n<=c))!=null?e:[];r=_s(this,a)}let{style:o}=J(this.shadowRoot,"#buffered");o.setProperty("width",`${r*100}%`)}updateCurrentBox(){if(!this.shadowRoot.querySelector('slot[name="current"]').assignedElements().length)return;let t=J(this.shadowRoot,"#current-rail"),r=J(this.shadowRoot,'[part~="current-box"]'),o=ye(this,Ss,Nd).call(this,se(this,ys)),n=ye(this,ks,$d).call(this,o,this.range.valueAsNumber),a=ye(this,Ls,Hd).call(this,o,this.range.valueAsNumber);t.style.transform=`translateX(${n})`,t.style.setProperty("--_range-width",`${o.range.width}`),r.style.setProperty("--_box-shift",`${a}`),r.style.setProperty("--_box-width",`${o.box.width}px`),r.style.setProperty("visibility","initial")}handleEvent(e){switch(super.handleEvent(e),e.type){case"input":ye(this,Dd,cp).call(this);break;case"pointermove":ye(this,Pd,dp).call(this,e);break;case"pointerup":se(this,Vr)&&qe(this,Vr,!1);break;case"pointerdown":qe(this,Vr,!0);break;case"pointerleave":ye(this,Ln,ws).call(this,null);break;case"transitionstart":Te(e.target,this)&&setTimeout(()=>ye(this,Wr,Tn).call(this),0);break}}};Hr=new WeakMap;Ki=new WeakMap;Ts=new WeakMap;An=new WeakMap;As=new WeakMap;ys=new WeakMap;Sn=new WeakMap;kn=new WeakMap;Br=new WeakMap;Vr=new WeakMap;Wr=new WeakSet;Tn=function(){ye(this,Ud,lp).call(this)?se(this,Ki).start():se(this,Ki).stop()};Ud=new WeakSet;lp=function(){return this.isConnected&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded&&this.mediaSeekableEnd>0&&ga(this)};xd=new WeakMap;Ss=new WeakSet;Nd=function(i){var e;let r=((e=this.getAttribute("bounds")?nt(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?e:this).getBoundingClientRect(),o=this.range.getBoundingClientRect(),n=i.offsetWidth,a=-(o.left-r.left-n/2),l=r.right-o.left-n/2;return{box:{width:n,min:a,max:l},bounds:r,range:o}};ks=new WeakSet;$d=function(i,e){let t=`${e*100}%`,{width:r,min:o,max:n}=i.box;if(!r)return t;if(Number.isNaN(o)||(t=`max(${`calc(1 / var(--_range-width) * 100 * ${o}% + var(--media-box-padding-left))`}, ${t})`),!Number.isNaN(n)){let l=`calc(1 / var(--_range-width) * 100 * ${n}% - var(--media-box-padding-right))`;t=`min(${t}, ${l})`}return t};Ls=new WeakSet;Hd=function(i,e){let{width:t,min:r,max:o}=i.box,n=e*i.range.width;if(n<r+se(this,Sn)){let a=i.range.left-i.bounds.left-se(this,Sn);return`${n-t/2+a}px`}if(n>o-se(this,kn)){let a=i.bounds.right-i.range.right-se(this,kn);return`${n+t/2-a-i.range.width}px`}return 0};Pd=new WeakSet;dp=function(i){let e=[...se(this,Ts)].some(h=>i.composedPath().includes(h));if(!this.dragging&&(e||!i.composedPath().includes(this))){ye(this,Ln,ws).call(this,null);return}let t=this.mediaSeekableEnd;if(!t)return;let r=J(this.shadowRoot,"#preview-rail"),o=J(this.shadowRoot,'[part~="preview-box"]'),n=ye(this,Ss,Nd).call(this,se(this,As)),a=(i.clientX-n.range.left)/n.range.width;a=Math.max(0,Math.min(1,a));let l=ye(this,ks,$d).call(this,n,a),c=ye(this,Ls,Hd).call(this,n,a);r.style.transform=`translateX(${l})`,r.style.setProperty("--_range-width",`${n.range.width}`),o.style.setProperty("--_box-shift",`${c}`),o.style.setProperty("--_box-width",`${n.box.width}px`);let p=Math.round(se(this,An))-Math.round(a*t);Math.abs(p)<1&&a>.01&&a<.99||(qe(this,An,a*t),ye(this,Ln,ws).call(this,se(this,An)))};Ln=new WeakSet;ws=function(i){this.dispatchEvent(new d.CustomEvent(b.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:i}))};Dd=new WeakSet;cp=function(){se(this,Ki).stop();let i=up(this);this.dispatchEvent(new d.CustomEvent(b.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:i}))};wn.shadowRootOptions={mode:"open"};wn.getContainerTemplateHTML=Cg;d.customElements.get("media-time-range")||d.customElements.define("media-time-range",wn);var Ig=1,Mg=i=>i.mediaMuted?0:i.mediaVolume,Rg=i=>`${Math.round(i*100)}%`,Bd=class extends ht{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_VOLUME,s.MEDIA_MUTED,s.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.addEventListener("input",()=>{let e=this.range.value,t=new d.CustomEvent(b.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)})}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",E("volume"))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),(e===s.MEDIA_VOLUME||e===s.MEDIA_MUTED)&&(this.range.valueAsNumber=Mg(this),this.range.setAttribute("aria-valuetext",Rg(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return $(this,s.MEDIA_VOLUME,Ig)}set mediaVolume(e){B(this,s.MEDIA_VOLUME,e)}get mediaMuted(){return w(this,s.MEDIA_MUTED)}set mediaMuted(e){C(this,s.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return P(this,s.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){D(this,s.MEDIA_VOLUME_UNAVAILABLE,e)}};d.customElements.get("media-volume-range")||d.customElements.define("media-volume-range",Bd);function xg(i){return`
1629
+ `}var _s=(i,e=i.mediaCurrentTime)=>{let t=Number.isFinite(i.mediaSeekableStart)?i.mediaSeekableStart:0,r=Number.isFinite(i.mediaDuration)?i.mediaDuration:i.mediaSeekableEnd;if(Number.isNaN(r))return 0;let o=(e-t)/(r-t);return Math.max(0,Math.min(o,1))},cp=(i,e=i.range.valueAsNumber)=>{let t=Number.isFinite(i.mediaSeekableStart)?i.mediaSeekableStart:0,r=Number.isFinite(i.mediaDuration)?i.mediaDuration:i.mediaSeekableEnd;return Number.isNaN(r)?0:e*(r-t)+t},wn=class extends ht{constructor(){super(),me(this,Wr),me(this,Ud),me(this,Ss),me(this,ks),me(this,Ls),me(this,Pd),me(this,Ln),me(this,Dd),me(this,Hr,void 0),me(this,Ki,void 0),me(this,Ts,void 0),me(this,An,void 0),me(this,As,void 0),me(this,ys,void 0),me(this,Sn,void 0),me(this,kn,void 0),me(this,Br,void 0),me(this,Vr,void 0),me(this,xd,r=>{this.dragging||(mr(r)&&(this.range.valueAsNumber=r),se(this,Vr)||this.updateBar())}),this.shadowRoot.querySelector("#track").insertAdjacentHTML("afterbegin",'<div id="buffered" part="buffered"></div>'),qe(this,Ts,this.shadowRoot.querySelectorAll('[part~="box"]')),qe(this,As,this.shadowRoot.querySelector('[part~="preview-box"]')),qe(this,ys,this.shadowRoot.querySelector('[part~="current-box"]'));let t=getComputedStyle(this);qe(this,Sn,parseInt(t.getPropertyValue("--media-box-padding-left"))),qe(this,kn,parseInt(t.getPropertyValue("--media-box-padding-right"))),qe(this,Ki,new bs(this.range,se(this,xd),60))}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PAUSED,s.MEDIA_DURATION,s.MEDIA_SEEKABLE,s.MEDIA_CURRENT_TIME,s.MEDIA_PREVIEW_IMAGE,s.MEDIA_PREVIEW_TIME,s.MEDIA_PREVIEW_CHAPTER,s.MEDIA_BUFFERED,s.MEDIA_PLAYBACK_RATE,s.MEDIA_LOADING,s.MEDIA_ENDED]}connectedCallback(){var e;super.connectedCallback(),this.range.setAttribute("aria-label",E("seek")),ye(this,Wr,Tn).call(this),qe(this,Hr,this.getRootNode()),(e=se(this,Hr))==null||e.addEventListener("transitionstart",this)}disconnectedCallback(){var e;super.disconnectedCallback(),ye(this,Wr,Tn).call(this),(e=se(this,Hr))==null||e.removeEventListener("transitionstart",this),qe(this,Hr,null)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),t!=r&&(e===s.MEDIA_CURRENT_TIME||e===s.MEDIA_PAUSED||e===s.MEDIA_ENDED||e===s.MEDIA_LOADING||e===s.MEDIA_DURATION||e===s.MEDIA_SEEKABLE?(se(this,Ki).update({start:_s(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),ye(this,Wr,Tn).call(this),kg(this)):e===s.MEDIA_BUFFERED&&this.updateBufferedBar(),(e===s.MEDIA_DURATION||e===s.MEDIA_SEEKABLE)&&(this.mediaChaptersCues=se(this,Br),this.updateBar()))}get mediaChaptersCues(){return se(this,Br)}set mediaChaptersCues(e){var t;qe(this,Br,e),this.updateSegments((t=se(this,Br))==null?void 0:t.map(r=>({start:_s(this,r.startTime),end:_s(this,r.endTime)})))}get mediaPaused(){return w(this,s.MEDIA_PAUSED)}set mediaPaused(e){I(this,s.MEDIA_PAUSED,e)}get mediaLoading(){return w(this,s.MEDIA_LOADING)}set mediaLoading(e){I(this,s.MEDIA_LOADING,e)}get mediaDuration(){return $(this,s.MEDIA_DURATION)}set mediaDuration(e){B(this,s.MEDIA_DURATION,e)}get mediaCurrentTime(){return $(this,s.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){B(this,s.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return $(this,s.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){B(this,s.MEDIA_PLAYBACK_RATE,e)}get mediaBuffered(){let e=this.getAttribute(s.MEDIA_BUFFERED);return e?e.split(" ").map(t=>t.split(":").map(r=>+r)):[]}set mediaBuffered(e){if(!e){this.removeAttribute(s.MEDIA_BUFFERED);return}let t=e.map(r=>r.join(":")).join(" ");this.setAttribute(s.MEDIA_BUFFERED,t)}get mediaSeekable(){let e=this.getAttribute(s.MEDIA_SEEKABLE);if(e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(s.MEDIA_SEEKABLE);return}this.setAttribute(s.MEDIA_SEEKABLE,e.join(":"))}get mediaSeekableEnd(){var e;let[,t=this.mediaDuration]=(e=this.mediaSeekable)!=null?e:[];return t}get mediaSeekableStart(){var e;let[t=0]=(e=this.mediaSeekable)!=null?e:[];return t}get mediaPreviewImage(){return P(this,s.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){D(this,s.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return $(this,s.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){B(this,s.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return w(this,s.MEDIA_ENDED)}set mediaEnded(e){I(this,s.MEDIA_ENDED,e)}updateBar(){super.updateBar(),this.updateBufferedBar(),this.updateCurrentBox()}updateBufferedBar(){var e;let t=this.mediaBuffered;if(!t.length)return;let r;if(this.mediaEnded)r=1;else{let n=this.mediaCurrentTime,[,a=this.mediaSeekableStart]=(e=t.find(([l,c])=>l<=n&&n<=c))!=null?e:[];r=_s(this,a)}let{style:o}=J(this.shadowRoot,"#buffered");o.setProperty("width",`${r*100}%`)}updateCurrentBox(){if(!this.shadowRoot.querySelector('slot[name="current"]').assignedElements().length)return;let t=J(this.shadowRoot,"#current-rail"),r=J(this.shadowRoot,'[part~="current-box"]'),o=ye(this,Ss,Nd).call(this,se(this,ys)),n=ye(this,ks,$d).call(this,o,this.range.valueAsNumber),a=ye(this,Ls,Hd).call(this,o,this.range.valueAsNumber);t.style.transform=`translateX(${n})`,t.style.setProperty("--_range-width",`${o.range.width}`),r.style.setProperty("--_box-shift",`${a}`),r.style.setProperty("--_box-width",`${o.box.width}px`),r.style.setProperty("visibility","initial")}handleEvent(e){switch(super.handleEvent(e),e.type){case"input":ye(this,Dd,dp).call(this);break;case"pointermove":ye(this,Pd,lp).call(this,e);break;case"pointerup":se(this,Vr)&&qe(this,Vr,!1);break;case"pointerdown":qe(this,Vr,!0);break;case"pointerleave":ye(this,Ln,ws).call(this,null);break;case"transitionstart":Te(e.target,this)&&setTimeout(()=>ye(this,Wr,Tn).call(this),0);break}}};Hr=new WeakMap;Ki=new WeakMap;Ts=new WeakMap;An=new WeakMap;As=new WeakMap;ys=new WeakMap;Sn=new WeakMap;kn=new WeakMap;Br=new WeakMap;Vr=new WeakMap;Wr=new WeakSet;Tn=function(){ye(this,Ud,sp).call(this)?se(this,Ki).start():se(this,Ki).stop()};Ud=new WeakSet;sp=function(){return this.isConnected&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded&&this.mediaSeekableEnd>0&&ga(this)};xd=new WeakMap;Ss=new WeakSet;Nd=function(i){var e;let r=((e=this.getAttribute("bounds")?nt(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?e:this).getBoundingClientRect(),o=this.range.getBoundingClientRect(),n=i.offsetWidth,a=-(o.left-r.left-n/2),l=r.right-o.left-n/2;return{box:{width:n,min:a,max:l},bounds:r,range:o}};ks=new WeakSet;$d=function(i,e){let t=`${e*100}%`,{width:r,min:o,max:n}=i.box;if(!r)return t;if(Number.isNaN(o)||(t=`max(${`calc(1 / var(--_range-width) * 100 * ${o}% + var(--media-box-padding-left))`}, ${t})`),!Number.isNaN(n)){let l=`calc(1 / var(--_range-width) * 100 * ${n}% - var(--media-box-padding-right))`;t=`min(${t}, ${l})`}return t};Ls=new WeakSet;Hd=function(i,e){let{width:t,min:r,max:o}=i.box,n=e*i.range.width;if(n<r+se(this,Sn)){let a=i.range.left-i.bounds.left-se(this,Sn);return`${n-t/2+a}px`}if(n>o-se(this,kn)){let a=i.bounds.right-i.range.right-se(this,kn);return`${n+t/2-a-i.range.width}px`}return 0};Pd=new WeakSet;lp=function(i){let e=[...se(this,Ts)].some(h=>i.composedPath().includes(h));if(!this.dragging&&(e||!i.composedPath().includes(this))){ye(this,Ln,ws).call(this,null);return}let t=this.mediaSeekableEnd;if(!t)return;let r=J(this.shadowRoot,"#preview-rail"),o=J(this.shadowRoot,'[part~="preview-box"]'),n=ye(this,Ss,Nd).call(this,se(this,As)),a=(i.clientX-n.range.left)/n.range.width;a=Math.max(0,Math.min(1,a));let l=ye(this,ks,$d).call(this,n,a),c=ye(this,Ls,Hd).call(this,n,a);r.style.transform=`translateX(${l})`,r.style.setProperty("--_range-width",`${n.range.width}`),o.style.setProperty("--_box-shift",`${c}`),o.style.setProperty("--_box-width",`${n.box.width}px`);let p=Math.round(se(this,An))-Math.round(a*t);Math.abs(p)<1&&a>.01&&a<.99||(qe(this,An,a*t),ye(this,Ln,ws).call(this,se(this,An)))};Ln=new WeakSet;ws=function(i){this.dispatchEvent(new d.CustomEvent(b.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:i}))};Dd=new WeakSet;dp=function(){se(this,Ki).stop();let i=cp(this);this.dispatchEvent(new d.CustomEvent(b.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:i}))};wn.shadowRootOptions={mode:"open"};wn.getContainerTemplateHTML=Lg;d.customElements.get("media-time-range")||d.customElements.define("media-time-range",wn);var wg=1,Ig=i=>i.mediaMuted?0:i.mediaVolume,Cg=i=>`${Math.round(i*100)}%`,Bd=class extends ht{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_VOLUME,s.MEDIA_MUTED,s.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.addEventListener("input",()=>{let e=this.range.value,t=new d.CustomEvent(b.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)})}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",E("volume"))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),(e===s.MEDIA_VOLUME||e===s.MEDIA_MUTED)&&(this.range.valueAsNumber=Ig(this),this.range.setAttribute("aria-valuetext",Cg(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return $(this,s.MEDIA_VOLUME,wg)}set mediaVolume(e){B(this,s.MEDIA_VOLUME,e)}get mediaMuted(){return w(this,s.MEDIA_MUTED)}set mediaMuted(e){I(this,s.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return P(this,s.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){D(this,s.MEDIA_VOLUME_UNAVAILABLE,e)}};d.customElements.get("media-volume-range")||d.customElements.define("media-volume-range",Bd);function Mg(i){return`
1630
1630
  <style>
1631
1631
  :host {
1632
1632
  min-width: 4ch;
@@ -1655,7 +1655,7 @@ bp-player[has-error] {
1655
1655
  <path d="m10 15.17 9.193-9.191 1.414 1.414-10.606 10.606-6.364-6.364 1.414-1.414 4.95 4.95Z"/>
1656
1656
  </svg>
1657
1657
  </div>
1658
- `}function Pg(){return E("Loop")}var Cn=class extends F{constructor(){super(...arguments),this.container=null}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_LOOP]}connectedCallback(){var e;super.connectedCallback(),this.container=((e=this.shadowRoot)==null?void 0:e.querySelector("#icon"))||null,this.container&&(this.container.textContent=E("Loop"))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_LOOP&&this.container&&this.setAttribute("aria-checked",this.mediaLoop?"true":"false")}get mediaLoop(){return w(this,s.MEDIA_LOOP)}set mediaLoop(e){C(this,s.MEDIA_LOOP,e)}handleClick(){let e=!this.mediaLoop,t=new d.CustomEvent(b.MEDIA_LOOP_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};Cn.getSlotTemplateHTML=xg;Cn.getTooltipContentHTML=Pg;d.customElements.get("media-loop-button")||d.customElements.define("media-loop-button",Cn);function hp({anchor:i,floating:e,placement:t}){let r=Dg({anchor:i,floating:e}),{x:o,y:n}=Ug(r,t);return{x:o,y:n}}function Dg({anchor:i,floating:e}){return{anchor:Og(i,e.offsetParent),floating:{x:0,y:0,width:e.offsetWidth,height:e.offsetHeight}}}function Og(i,e){var t;let r=i.getBoundingClientRect(),o=(t=e==null?void 0:e.getBoundingClientRect())!=null?t:{x:0,y:0};return{x:r.x-o.x,y:r.y-o.y,width:r.width,height:r.height}}function Ug({anchor:i,floating:e},t){let r=Ng(t)==="x"?"y":"x",o=r==="y"?"height":"width",n=pp(t),a=i.x+i.width/2-e.width/2,l=i.y+i.height/2-e.height/2,c=i[o]/2-e[o]/2,p;switch(n){case"top":p={x:a,y:i.y-e.height};break;case"bottom":p={x:a,y:i.y+i.height};break;case"right":p={x:i.x+i.width,y:l};break;case"left":p={x:i.x-e.width,y:l};break;default:p={x:i.x,y:i.y}}switch(t.split("-")[1]){case"start":p[r]-=c;break;case"end":p[r]+=c;break}return p}function pp(i){return i.split("-")[0]}function Ng(i){return["top","bottom"].includes(pp(i))?"y":"x"}var ti=class extends Event{constructor({action:e="auto",relatedTarget:t,...r}){super("invoke",r),this.action=e,this.relatedTarget=t}},Cs=class extends Event{constructor({newState:e,oldState:t,...r}){super("toggle",r),this.newState=e,this.oldState=t}};var Jd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},q=(i,e,t)=>(Jd(i,e,"read from private field"),t?t.call(i):e.get(i)),Y=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},bt=(i,e,t,r)=>(Jd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Q=(i,e,t)=>(Jd(i,e,"access private method"),t),_t,Gi,ii,Is,Ms,zi,Rn,Vd,mp,Ps,jd,Ds,Rs,Wd,Fd,vp,Kd,fp,qd,gp,Fr,Kr,qr,xn,Os,ec,Gd,Ep,tc,bp,zd,_p,ic,yp,Yd,Tp,Qd,Ap,In,Us,Zd,Sp,Mn,Ns,xs,Xd;function yt({type:i,text:e,value:t,checked:r}){let o=ee.createElement("media-chrome-menu-item");o.type=i??"",o.part.add("menu-item"),i&&o.part.add(i),o.value=t,o.checked=r;let n=ee.createElement("span");return n.textContent=e,o.append(n),o}function et(i,e){let t=i.querySelector(`:scope > [slot="${e}"]`);if((t==null?void 0:t.nodeName)=="SLOT"&&(t=t.assignedElements({flatten:!0})[0]),t)return t=t.cloneNode(!0),t;let r=i.shadowRoot.querySelector(`[name="${e}"] > svg`);return r?r.cloneNode(!0):""}function $g(i){return`
1658
+ `}function Rg(){return E("Loop")}var In=class extends F{constructor(){super(...arguments),this.container=null}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_LOOP]}connectedCallback(){var e;super.connectedCallback(),this.container=((e=this.shadowRoot)==null?void 0:e.querySelector("#icon"))||null,this.container&&(this.container.textContent=E("Loop"))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_LOOP&&this.container&&this.setAttribute("aria-checked",this.mediaLoop?"true":"false")}get mediaLoop(){return w(this,s.MEDIA_LOOP)}set mediaLoop(e){I(this,s.MEDIA_LOOP,e)}handleClick(){let e=!this.mediaLoop,t=new d.CustomEvent(b.MEDIA_LOOP_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};In.getSlotTemplateHTML=Mg;In.getTooltipContentHTML=Rg;d.customElements.get("media-loop-button")||d.customElements.define("media-loop-button",In);function up({anchor:i,floating:e,placement:t}){let r=xg({anchor:i,floating:e}),{x:o,y:n}=Dg(r,t);return{x:o,y:n}}function xg({anchor:i,floating:e}){return{anchor:Pg(i,e.offsetParent),floating:{x:0,y:0,width:e.offsetWidth,height:e.offsetHeight}}}function Pg(i,e){var t;let r=i.getBoundingClientRect(),o=(t=e==null?void 0:e.getBoundingClientRect())!=null?t:{x:0,y:0};return{x:r.x-o.x,y:r.y-o.y,width:r.width,height:r.height}}function Dg({anchor:i,floating:e},t){let r=Og(t)==="x"?"y":"x",o=r==="y"?"height":"width",n=hp(t),a=i.x+i.width/2-e.width/2,l=i.y+i.height/2-e.height/2,c=i[o]/2-e[o]/2,p;switch(n){case"top":p={x:a,y:i.y-e.height};break;case"bottom":p={x:a,y:i.y+i.height};break;case"right":p={x:i.x+i.width,y:l};break;case"left":p={x:i.x-e.width,y:l};break;default:p={x:i.x,y:i.y}}switch(t.split("-")[1]){case"start":p[r]-=c;break;case"end":p[r]+=c;break}return p}function hp(i){return i.split("-")[0]}function Og(i){return["top","bottom"].includes(hp(i))?"y":"x"}var ti=class extends Event{constructor({action:e="auto",relatedTarget:t,...r}){super("invoke",r),this.action=e,this.relatedTarget=t}},Is=class extends Event{constructor({newState:e,oldState:t,...r}){super("toggle",r),this.newState=e,this.oldState=t}};var Jd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},q=(i,e,t)=>(Jd(i,e,"read from private field"),t?t.call(i):e.get(i)),Y=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},bt=(i,e,t,r)=>(Jd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Q=(i,e,t)=>(Jd(i,e,"access private method"),t),_t,Gi,ii,Cs,Ms,zi,Rn,Vd,pp,Ps,jd,Ds,Rs,Wd,Fd,mp,Kd,vp,qd,fp,Fr,Kr,qr,xn,Os,ec,Gd,gp,tc,Ep,zd,bp,ic,_p,Yd,yp,Qd,Tp,Cn,Us,Zd,Ap,Mn,Ns,xs,Xd;function yt({type:i,text:e,value:t,checked:r}){let o=ee.createElement("media-chrome-menu-item");o.type=i??"",o.part.add("menu-item"),i&&o.part.add(i),o.value=t,o.checked=r;let n=ee.createElement("span");return n.textContent=e,o.append(n),o}function et(i,e){let t=i.querySelector(`:scope > [slot="${e}"]`);if((t==null?void 0:t.nodeName)=="SLOT"&&(t=t.assignedElements({flatten:!0})[0]),t)return t=t.cloneNode(!0),t;let r=i.shadowRoot.querySelector(`[name="${e}"] > svg`);return r?r.cloneNode(!0):""}function Ug(i){return`
1659
1659
  <style>
1660
1660
  :host {
1661
1661
  font: var(--media-font,
@@ -1830,7 +1830,7 @@ bp-player[has-error] {
1830
1830
  <slot></slot>
1831
1831
  </div>
1832
1832
  <slot name="checked-indicator" hidden></slot>
1833
- `}var qi={STYLE:"style",HIDDEN:"hidden",DISABLED:"disabled",ANCHOR:"anchor"},le=class extends d.HTMLElement{constructor(){if(super(),Y(this,Vd),Y(this,Ps),Y(this,Rs),Y(this,Fd),Y(this,Kd),Y(this,qd),Y(this,qr),Y(this,Os),Y(this,Gd),Y(this,tc),Y(this,zd),Y(this,ic),Y(this,Yd),Y(this,Qd),Y(this,In),Y(this,Zd),Y(this,Mn),Y(this,xs),Y(this,_t,null),Y(this,Gi,null),Y(this,ii,null),Y(this,Is,new Set),Y(this,Ms,void 0),Y(this,zi,!1),Y(this,Rn,null),Y(this,Ds,()=>{let e=q(this,Is),t=new Set(this.items);for(let r of e)t.has(r)||this.dispatchEvent(new CustomEvent("removemenuitem",{detail:r}));for(let r of t)e.has(r)||this.dispatchEvent(new CustomEvent("addmenuitem",{detail:r}));bt(this,Is,t)}),Y(this,Fr,()=>{Q(this,qr,xn).call(this),Q(this,Os,ec).call(this,!1)}),Y(this,Kr,()=>{Q(this,qr,xn).call(this)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.container=this.shadowRoot.querySelector("#container"),this.defaultSlot=this.shadowRoot.querySelector("slot:not([name])"),this.shadowRoot.addEventListener("slotchange",this),bt(this,Ms,new MutationObserver(q(this,Ds))),q(this,Ms).observe(this.defaultSlot,{childList:!0})}static get observedAttributes(){return[qi.DISABLED,qi.HIDDEN,qi.STYLE,qi.ANCHOR,N.MEDIA_CONTROLLER]}static formatMenuItemText(e,t){return e}enable(){this.addEventListener("click",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this),this.addEventListener("invoke",this),this.addEventListener("toggle",this)}disable(){this.removeEventListener("click",this),this.removeEventListener("focusout",this),this.removeEventListener("keyup",this),this.removeEventListener("invoke",this),this.removeEventListener("toggle",this)}handleEvent(e){switch(e.type){case"slotchange":Q(this,Vd,mp).call(this,e);break;case"invoke":Q(this,Fd,vp).call(this,e);break;case"click":Q(this,Gd,Ep).call(this,e);break;case"toggle":Q(this,zd,_p).call(this,e);break;case"focusout":Q(this,Yd,Tp).call(this,e);break;case"keydown":Q(this,Qd,Ap).call(this,e);break}}connectedCallback(){var e,t;bt(this,Rn,Fo(this.shadowRoot,":host")),Q(this,Rs,Wd).call(this),this.hasAttribute("disabled")||this.enable(),this.role||(this.role="menu"),bt(this,_t,ma(this)),(t=(e=q(this,_t))==null?void 0:e.associateElement)==null||t.call(e,this),this.hidden||(Rt(Pn(this),q(this,Fr)),Rt(this,q(this,Kr))),Q(this,Ps,jd).call(this)}disconnectedCallback(){var e,t;xt(Pn(this),q(this,Fr)),xt(this,q(this,Kr)),this.disable(),(t=(e=q(this,_t))==null?void 0:e.unassociateElement)==null||t.call(e,this),bt(this,_t,null)}attributeChangedCallback(e,t,r){var o,n,a,l;e===qi.HIDDEN&&r!==t?(q(this,zi)||bt(this,zi,!0),this.hidden?Q(this,qd,gp).call(this):Q(this,Kd,fp).call(this),this.dispatchEvent(new Cs({oldState:this.hidden?"open":"closed",newState:this.hidden?"closed":"open",bubbles:!0}))):e===N.MEDIA_CONTROLLER?(t&&((n=(o=q(this,_t))==null?void 0:o.unassociateElement)==null||n.call(o,this),bt(this,_t,null)),r&&this.isConnected&&(bt(this,_t,ma(this)),(l=(a=q(this,_t))==null?void 0:a.associateElement)==null||l.call(a,this))):e===qi.DISABLED&&r!==t?r==null?this.enable():this.disable():e===qi.STYLE&&r!==t&&Q(this,Rs,Wd).call(this)}formatMenuItemText(e,t){return this.constructor.formatMenuItemText(e,t)}get anchor(){return this.getAttribute("anchor")}set anchor(e){this.setAttribute("anchor",`${e}`)}get anchorElement(){var e;return this.anchor?(e=Ci(this))==null?void 0:e.querySelector(`#${this.anchor}`):null}get items(){return this.defaultSlot.assignedElements({flatten:!0}).filter(Hg)}get radioGroupItems(){return this.items.filter(e=>e.role==="menuitemradio")}get checkedItems(){return this.items.filter(e=>e.checked)}get value(){var e,t;return(t=(e=this.checkedItems[0])==null?void 0:e.value)!=null?t:""}set value(e){let t=this.items.find(r=>r.value===e);t&&Q(this,xs,Xd).call(this,t)}focus(){if(bt(this,Gi,Wo()),this.items.length){Q(this,Mn,Ns).call(this,this.items[0]),this.items[0].focus();return}let e=this.querySelector('[autofocus], [tabindex]:not([tabindex="-1"]), [role="menu"]');e==null||e.focus()}handleSelect(e){var t;let r=Q(this,In,Us).call(this,e);r&&(Q(this,xs,Xd).call(this,r,r.type==="checkbox"),q(this,ii)&&!this.hidden&&((t=q(this,Gi))==null||t.focus(),this.hidden=!0))}get keysUsed(){return["Enter","Escape","Tab"," ","ArrowDown","ArrowUp","Home","End"]}handleMove(e){var t,r;let{key:o}=e,n=this.items,a=(r=(t=Q(this,In,Us).call(this,e))!=null?t:Q(this,Zd,Sp).call(this))!=null?r:n[0],l=n.indexOf(a),c=Math.max(0,l);o==="ArrowDown"?c++:o==="ArrowUp"?c--:e.key==="Home"?c=0:e.key==="End"&&(c=n.length-1),c<0&&(c=n.length-1),c>n.length-1&&(c=0),Q(this,Mn,Ns).call(this,n[c]),n[c].focus()}};_t=new WeakMap;Gi=new WeakMap;ii=new WeakMap;Is=new WeakMap;Ms=new WeakMap;zi=new WeakMap;Rn=new WeakMap;Vd=new WeakSet;mp=function(i){let e=i.target;for(let t of e.assignedNodes({flatten:!0}))t.nodeType===3&&t.textContent.trim()===""&&t.remove();["header","title"].includes(e.name)&&Q(this,Ps,jd).call(this),e.name||q(this,Ds).call(this)};Ps=new WeakSet;jd=function(){let i=this.shadowRoot.querySelector('slot[name="header"]'),e=this.shadowRoot.querySelector('slot[name="title"]');i.hidden=e.assignedNodes().length===0&&i.assignedNodes().length===0};Ds=new WeakMap;Rs=new WeakSet;Wd=function(){var i;let e=this.shadowRoot.querySelector("#layout-row"),t=(i=getComputedStyle(this).getPropertyValue("--media-menu-layout"))==null?void 0:i.trim();e.setAttribute("media",t==="row"?"":"width:0")};Fd=new WeakSet;vp=function(i){bt(this,ii,i.relatedTarget),Te(this,i.relatedTarget)||(this.hidden=!this.hidden)};Kd=new WeakSet;fp=function(){var i;(i=q(this,ii))==null||i.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",()=>this.focus(),{once:!0}),Rt(Pn(this),q(this,Fr)),Rt(this,q(this,Kr))};qd=new WeakSet;gp=function(){var i;(i=q(this,ii))==null||i.setAttribute("aria-expanded","false"),xt(Pn(this),q(this,Fr)),xt(this,q(this,Kr))};Fr=new WeakMap;Kr=new WeakMap;qr=new WeakSet;xn=function(i){if(this.hasAttribute("mediacontroller")&&!this.anchor||this.hidden||!this.anchorElement)return;let{x:e,y:t}=hp({anchor:this.anchorElement,floating:this,placement:"top-start"});i??(i=this.offsetWidth);let o=Pn(this).getBoundingClientRect(),n=o.width-e-i,a=o.height-t-this.offsetHeight,{style:l}=q(this,Rn);l.setProperty("position","absolute"),l.setProperty("right",`${Math.max(0,n)}px`),l.setProperty("--_menu-bottom",`${a}px`);let c=getComputedStyle(this),h=l.getPropertyValue("--_menu-bottom")===c.bottom?a:parseFloat(c.bottom),v=o.height-h-parseFloat(c.marginBottom);this.style.setProperty("--_menu-max-height",`${v}px`)};Os=new WeakSet;ec=function(i){let e=this.querySelector('[role="menuitem"][aria-haspopup][aria-expanded="true"]'),t=e==null?void 0:e.querySelector('[role="menu"]'),{style:r}=q(this,Rn);if(i||r.setProperty("--media-menu-transition-in","none"),t){let o=t.offsetHeight,n=Math.max(t.offsetWidth,e.offsetWidth);this.style.setProperty("min-width",`${n}px`),this.style.setProperty("min-height",`${o}px`),Q(this,qr,xn).call(this,n)}else this.style.removeProperty("min-width"),this.style.removeProperty("min-height"),Q(this,qr,xn).call(this);r.removeProperty("--media-menu-transition-in")};Gd=new WeakSet;Ep=function(i){var e;if(i.stopPropagation(),i.composedPath().includes(q(this,tc,bp))){(e=q(this,Gi))==null||e.focus(),this.hidden=!0;return}let t=Q(this,In,Us).call(this,i);!t||t.hasAttribute("disabled")||(Q(this,Mn,Ns).call(this,t),this.handleSelect(i))};tc=new WeakSet;bp=function(){var i;return(i=this.shadowRoot.querySelector('slot[name="header"]').assignedElements({flatten:!0}))==null?void 0:i.find(t=>t.matches('button[part~="back"]'))};zd=new WeakSet;_p=function(i){if(i.target===this)return;Q(this,ic,yp).call(this);let e=Array.from(this.querySelectorAll('[role="menuitem"][aria-haspopup]'));for(let t of e)t.invokeTargetElement!=i.target&&i.newState=="open"&&t.getAttribute("aria-expanded")=="true"&&!t.invokeTargetElement.hidden&&t.invokeTargetElement.dispatchEvent(new ti({relatedTarget:t}));for(let t of e)t.setAttribute("aria-expanded",`${!t.submenuElement.hidden}`);Q(this,Os,ec).call(this,!0)};ic=new WeakSet;yp=function(){let e=this.querySelector('[role="menuitem"] > [role="menu"]:not([hidden])');this.container.classList.toggle("has-expanded",!!e)};Yd=new WeakSet;Tp=function(i){var e;Te(this,i.relatedTarget)||(q(this,zi)&&((e=q(this,Gi))==null||e.focus()),q(this,ii)&&q(this,ii)!==i.relatedTarget&&!this.hidden&&(this.hidden=!0))};Qd=new WeakSet;Ap=function(i){var e,t,r,o,n;let{key:a,ctrlKey:l,altKey:c,metaKey:p}=i;if(!(l||c||p)&&this.keysUsed.includes(a))if(i.preventDefault(),i.stopPropagation(),a==="Tab"){if(q(this,zi)){this.hidden=!0;return}i.shiftKey?(t=(e=this.previousElementSibling)==null?void 0:e.focus)==null||t.call(e):(o=(r=this.nextElementSibling)==null?void 0:r.focus)==null||o.call(r),this.blur()}else a==="Escape"?((n=q(this,Gi))==null||n.focus(),q(this,zi)&&(this.hidden=!0)):a==="Enter"||a===" "?this.handleSelect(i):this.handleMove(i)};In=new WeakSet;Us=function(i){return i.composedPath().find(e=>["menuitemradio","menuitemcheckbox"].includes(e.role))};Zd=new WeakSet;Sp=function(){return this.items.find(i=>i.tabIndex===0)};Mn=new WeakSet;Ns=function(i){for(let e of this.items)e.tabIndex=e===i?0:-1};xs=new WeakSet;Xd=function(i,e){let t=[...this.checkedItems];i.type==="radio"&&this.radioGroupItems.forEach(r=>r.checked=!1),e?i.checked=!i.checked:i.checked=!0,this.checkedItems.some((r,o)=>r!=t[o])&&this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))};le.shadowRootOptions={mode:"open"};le.getTemplateHTML=$g;function Hg(i){return["menuitem","menuitemradio","menuitemcheckbox"].includes(i==null?void 0:i.role)}function Pn(i){var e;return(e=i.getAttribute("bounds")?nt(i,`#${i.getAttribute("bounds")}`):X(i)||i.parentElement)!=null?e:i}d.customElements.get("media-chrome-menu")||d.customElements.define("media-chrome-menu",le);var lc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Tt=(i,e,t)=>(lc(i,e,"read from private field"),t?t.call(i):e.get(i)),Ut=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},rc=(i,e,t,r)=>(lc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),tt=(i,e,t)=>(lc(i,e,"access private method"),t),$s,On,oc,kp,Bs,dc,cc,Lp,At,Gr,Un,nc,wp,Hs,ac;function Bg(i){return`
1833
+ `}var qi={STYLE:"style",HIDDEN:"hidden",DISABLED:"disabled",ANCHOR:"anchor"},le=class extends d.HTMLElement{constructor(){if(super(),Y(this,Vd),Y(this,Ps),Y(this,Rs),Y(this,Fd),Y(this,Kd),Y(this,qd),Y(this,qr),Y(this,Os),Y(this,Gd),Y(this,tc),Y(this,zd),Y(this,ic),Y(this,Yd),Y(this,Qd),Y(this,Cn),Y(this,Zd),Y(this,Mn),Y(this,xs),Y(this,_t,null),Y(this,Gi,null),Y(this,ii,null),Y(this,Cs,new Set),Y(this,Ms,void 0),Y(this,zi,!1),Y(this,Rn,null),Y(this,Ds,()=>{let e=q(this,Cs),t=new Set(this.items);for(let r of e)t.has(r)||this.dispatchEvent(new CustomEvent("removemenuitem",{detail:r}));for(let r of t)e.has(r)||this.dispatchEvent(new CustomEvent("addmenuitem",{detail:r}));bt(this,Cs,t)}),Y(this,Fr,()=>{Q(this,qr,xn).call(this),Q(this,Os,ec).call(this,!1)}),Y(this,Kr,()=>{Q(this,qr,xn).call(this)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.container=this.shadowRoot.querySelector("#container"),this.defaultSlot=this.shadowRoot.querySelector("slot:not([name])"),this.shadowRoot.addEventListener("slotchange",this),bt(this,Ms,new MutationObserver(q(this,Ds))),q(this,Ms).observe(this.defaultSlot,{childList:!0})}static get observedAttributes(){return[qi.DISABLED,qi.HIDDEN,qi.STYLE,qi.ANCHOR,N.MEDIA_CONTROLLER]}static formatMenuItemText(e,t){return e}enable(){this.addEventListener("click",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this),this.addEventListener("invoke",this),this.addEventListener("toggle",this)}disable(){this.removeEventListener("click",this),this.removeEventListener("focusout",this),this.removeEventListener("keyup",this),this.removeEventListener("invoke",this),this.removeEventListener("toggle",this)}handleEvent(e){switch(e.type){case"slotchange":Q(this,Vd,pp).call(this,e);break;case"invoke":Q(this,Fd,mp).call(this,e);break;case"click":Q(this,Gd,gp).call(this,e);break;case"toggle":Q(this,zd,bp).call(this,e);break;case"focusout":Q(this,Yd,yp).call(this,e);break;case"keydown":Q(this,Qd,Tp).call(this,e);break}}connectedCallback(){var e,t;bt(this,Rn,Fo(this.shadowRoot,":host")),Q(this,Rs,Wd).call(this),this.hasAttribute("disabled")||this.enable(),this.role||(this.role="menu"),bt(this,_t,ma(this)),(t=(e=q(this,_t))==null?void 0:e.associateElement)==null||t.call(e,this),this.hidden||(Rt(Pn(this),q(this,Fr)),Rt(this,q(this,Kr))),Q(this,Ps,jd).call(this)}disconnectedCallback(){var e,t;xt(Pn(this),q(this,Fr)),xt(this,q(this,Kr)),this.disable(),(t=(e=q(this,_t))==null?void 0:e.unassociateElement)==null||t.call(e,this),bt(this,_t,null)}attributeChangedCallback(e,t,r){var o,n,a,l;e===qi.HIDDEN&&r!==t?(q(this,zi)||bt(this,zi,!0),this.hidden?Q(this,qd,fp).call(this):Q(this,Kd,vp).call(this),this.dispatchEvent(new Is({oldState:this.hidden?"open":"closed",newState:this.hidden?"closed":"open",bubbles:!0}))):e===N.MEDIA_CONTROLLER?(t&&((n=(o=q(this,_t))==null?void 0:o.unassociateElement)==null||n.call(o,this),bt(this,_t,null)),r&&this.isConnected&&(bt(this,_t,ma(this)),(l=(a=q(this,_t))==null?void 0:a.associateElement)==null||l.call(a,this))):e===qi.DISABLED&&r!==t?r==null?this.enable():this.disable():e===qi.STYLE&&r!==t&&Q(this,Rs,Wd).call(this)}formatMenuItemText(e,t){return this.constructor.formatMenuItemText(e,t)}get anchor(){return this.getAttribute("anchor")}set anchor(e){this.setAttribute("anchor",`${e}`)}get anchorElement(){var e;return this.anchor?(e=Ii(this))==null?void 0:e.querySelector(`#${this.anchor}`):null}get items(){return this.defaultSlot.assignedElements({flatten:!0}).filter(Ng)}get radioGroupItems(){return this.items.filter(e=>e.role==="menuitemradio")}get checkedItems(){return this.items.filter(e=>e.checked)}get value(){var e,t;return(t=(e=this.checkedItems[0])==null?void 0:e.value)!=null?t:""}set value(e){let t=this.items.find(r=>r.value===e);t&&Q(this,xs,Xd).call(this,t)}focus(){if(bt(this,Gi,Wo()),this.items.length){Q(this,Mn,Ns).call(this,this.items[0]),this.items[0].focus();return}let e=this.querySelector('[autofocus], [tabindex]:not([tabindex="-1"]), [role="menu"]');e==null||e.focus()}handleSelect(e){var t;let r=Q(this,Cn,Us).call(this,e);r&&(Q(this,xs,Xd).call(this,r,r.type==="checkbox"),q(this,ii)&&!this.hidden&&((t=q(this,Gi))==null||t.focus(),this.hidden=!0))}get keysUsed(){return["Enter","Escape","Tab"," ","ArrowDown","ArrowUp","Home","End"]}handleMove(e){var t,r;let{key:o}=e,n=this.items,a=(r=(t=Q(this,Cn,Us).call(this,e))!=null?t:Q(this,Zd,Ap).call(this))!=null?r:n[0],l=n.indexOf(a),c=Math.max(0,l);o==="ArrowDown"?c++:o==="ArrowUp"?c--:e.key==="Home"?c=0:e.key==="End"&&(c=n.length-1),c<0&&(c=n.length-1),c>n.length-1&&(c=0),Q(this,Mn,Ns).call(this,n[c]),n[c].focus()}};_t=new WeakMap;Gi=new WeakMap;ii=new WeakMap;Cs=new WeakMap;Ms=new WeakMap;zi=new WeakMap;Rn=new WeakMap;Vd=new WeakSet;pp=function(i){let e=i.target;for(let t of e.assignedNodes({flatten:!0}))t.nodeType===3&&t.textContent.trim()===""&&t.remove();["header","title"].includes(e.name)&&Q(this,Ps,jd).call(this),e.name||q(this,Ds).call(this)};Ps=new WeakSet;jd=function(){let i=this.shadowRoot.querySelector('slot[name="header"]'),e=this.shadowRoot.querySelector('slot[name="title"]');i.hidden=e.assignedNodes().length===0&&i.assignedNodes().length===0};Ds=new WeakMap;Rs=new WeakSet;Wd=function(){var i;let e=this.shadowRoot.querySelector("#layout-row"),t=(i=getComputedStyle(this).getPropertyValue("--media-menu-layout"))==null?void 0:i.trim();e.setAttribute("media",t==="row"?"":"width:0")};Fd=new WeakSet;mp=function(i){bt(this,ii,i.relatedTarget),Te(this,i.relatedTarget)||(this.hidden=!this.hidden)};Kd=new WeakSet;vp=function(){var i;(i=q(this,ii))==null||i.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",()=>this.focus(),{once:!0}),Rt(Pn(this),q(this,Fr)),Rt(this,q(this,Kr))};qd=new WeakSet;fp=function(){var i;(i=q(this,ii))==null||i.setAttribute("aria-expanded","false"),xt(Pn(this),q(this,Fr)),xt(this,q(this,Kr))};Fr=new WeakMap;Kr=new WeakMap;qr=new WeakSet;xn=function(i){if(this.hasAttribute("mediacontroller")&&!this.anchor||this.hidden||!this.anchorElement)return;let{x:e,y:t}=up({anchor:this.anchorElement,floating:this,placement:"top-start"});i??(i=this.offsetWidth);let o=Pn(this).getBoundingClientRect(),n=o.width-e-i,a=o.height-t-this.offsetHeight,{style:l}=q(this,Rn);l.setProperty("position","absolute"),l.setProperty("right",`${Math.max(0,n)}px`),l.setProperty("--_menu-bottom",`${a}px`);let c=getComputedStyle(this),h=l.getPropertyValue("--_menu-bottom")===c.bottom?a:parseFloat(c.bottom),v=o.height-h-parseFloat(c.marginBottom);this.style.setProperty("--_menu-max-height",`${v}px`)};Os=new WeakSet;ec=function(i){let e=this.querySelector('[role="menuitem"][aria-haspopup][aria-expanded="true"]'),t=e==null?void 0:e.querySelector('[role="menu"]'),{style:r}=q(this,Rn);if(i||r.setProperty("--media-menu-transition-in","none"),t){let o=t.offsetHeight,n=Math.max(t.offsetWidth,e.offsetWidth);this.style.setProperty("min-width",`${n}px`),this.style.setProperty("min-height",`${o}px`),Q(this,qr,xn).call(this,n)}else this.style.removeProperty("min-width"),this.style.removeProperty("min-height"),Q(this,qr,xn).call(this);r.removeProperty("--media-menu-transition-in")};Gd=new WeakSet;gp=function(i){var e;if(i.stopPropagation(),i.composedPath().includes(q(this,tc,Ep))){(e=q(this,Gi))==null||e.focus(),this.hidden=!0;return}let t=Q(this,Cn,Us).call(this,i);!t||t.hasAttribute("disabled")||(Q(this,Mn,Ns).call(this,t),this.handleSelect(i))};tc=new WeakSet;Ep=function(){var i;return(i=this.shadowRoot.querySelector('slot[name="header"]').assignedElements({flatten:!0}))==null?void 0:i.find(t=>t.matches('button[part~="back"]'))};zd=new WeakSet;bp=function(i){if(i.target===this)return;Q(this,ic,_p).call(this);let e=Array.from(this.querySelectorAll('[role="menuitem"][aria-haspopup]'));for(let t of e)t.invokeTargetElement!=i.target&&i.newState=="open"&&t.getAttribute("aria-expanded")=="true"&&!t.invokeTargetElement.hidden&&t.invokeTargetElement.dispatchEvent(new ti({relatedTarget:t}));for(let t of e)t.setAttribute("aria-expanded",`${!t.submenuElement.hidden}`);Q(this,Os,ec).call(this,!0)};ic=new WeakSet;_p=function(){let e=this.querySelector('[role="menuitem"] > [role="menu"]:not([hidden])');this.container.classList.toggle("has-expanded",!!e)};Yd=new WeakSet;yp=function(i){var e;Te(this,i.relatedTarget)||(q(this,zi)&&((e=q(this,Gi))==null||e.focus()),q(this,ii)&&q(this,ii)!==i.relatedTarget&&!this.hidden&&(this.hidden=!0))};Qd=new WeakSet;Tp=function(i){var e,t,r,o,n;let{key:a,ctrlKey:l,altKey:c,metaKey:p}=i;if(!(l||c||p)&&this.keysUsed.includes(a))if(i.preventDefault(),i.stopPropagation(),a==="Tab"){if(q(this,zi)){this.hidden=!0;return}i.shiftKey?(t=(e=this.previousElementSibling)==null?void 0:e.focus)==null||t.call(e):(o=(r=this.nextElementSibling)==null?void 0:r.focus)==null||o.call(r),this.blur()}else a==="Escape"?((n=q(this,Gi))==null||n.focus(),q(this,zi)&&(this.hidden=!0)):a==="Enter"||a===" "?this.handleSelect(i):this.handleMove(i)};Cn=new WeakSet;Us=function(i){return i.composedPath().find(e=>["menuitemradio","menuitemcheckbox"].includes(e.role))};Zd=new WeakSet;Ap=function(){return this.items.find(i=>i.tabIndex===0)};Mn=new WeakSet;Ns=function(i){for(let e of this.items)e.tabIndex=e===i?0:-1};xs=new WeakSet;Xd=function(i,e){let t=[...this.checkedItems];i.type==="radio"&&this.radioGroupItems.forEach(r=>r.checked=!1),e?i.checked=!i.checked:i.checked=!0,this.checkedItems.some((r,o)=>r!=t[o])&&this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))};le.shadowRootOptions={mode:"open"};le.getTemplateHTML=Ug;function Ng(i){return["menuitem","menuitemradio","menuitemcheckbox"].includes(i==null?void 0:i.role)}function Pn(i){var e;return(e=i.getAttribute("bounds")?nt(i,`#${i.getAttribute("bounds")}`):X(i)||i.parentElement)!=null?e:i}d.customElements.get("media-chrome-menu")||d.customElements.define("media-chrome-menu",le);var lc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Tt=(i,e,t)=>(lc(i,e,"read from private field"),t?t.call(i):e.get(i)),Ut=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},rc=(i,e,t,r)=>(lc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),tt=(i,e,t)=>(lc(i,e,"access private method"),t),$s,On,oc,Sp,Bs,dc,cc,kp,At,Gr,Un,nc,Lp,Hs,ac;function $g(i){return`
1834
1834
  <style>
1835
1835
  :host {
1836
1836
  transition: var(--media-menu-item-transition,
@@ -1948,7 +1948,7 @@ bp-player[has-error] {
1948
1948
  ${this.getSuffixSlotInnerHTML(i)}
1949
1949
  </slot>
1950
1950
  <slot name="submenu"></slot>
1951
- `}function Vg(i){return""}var Ge={TYPE:"type",VALUE:"value",CHECKED:"checked",DISABLED:"disabled"},Ve=class extends d.HTMLElement{constructor(){if(super(),Ut(this,oc),Ut(this,Bs),Ut(this,cc),Ut(this,Gr),Ut(this,nc),Ut(this,Hs),Ut(this,$s,!1),Ut(this,On,void 0),Ut(this,At,()=>{var e,t;this.submenuElement.items&&this.setAttribute("submenusize",`${this.submenuElement.items.length}`);let r=this.shadowRoot.querySelector('slot[name="description"]'),o=(e=this.submenuElement.checkedItems)==null?void 0:e[0],n=(t=o==null?void 0:o.dataset.description)!=null?t:o==null?void 0:o.text,a=ee.createElement("span");a.textContent=n??"",r.replaceChildren(a)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.shadowRoot.addEventListener("slotchange",this)}static get observedAttributes(){return[Ge.TYPE,Ge.DISABLED,Ge.CHECKED,Ge.VALUE]}enable(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","-1"),Dn(this)&&!this.hasAttribute("aria-checked")&&this.setAttribute("aria-checked","false"),this.addEventListener("click",this),this.addEventListener("keydown",this)}disable(){this.removeAttribute("tabindex"),this.removeEventListener("click",this),this.removeEventListener("keydown",this),this.removeEventListener("keyup",this)}handleEvent(e){switch(e.type){case"slotchange":tt(this,oc,kp).call(this,e);break;case"click":this.handleClick(e);break;case"keydown":tt(this,nc,wp).call(this,e);break;case"keyup":tt(this,Gr,Un).call(this,e);break}}attributeChangedCallback(e,t,r){e===Ge.CHECKED&&Dn(this)&&!Tt(this,$s)?this.setAttribute("aria-checked",r!=null?"true":"false"):e===Ge.TYPE&&r!==t?this.role="menuitem"+r:e===Ge.DISABLED&&r!==t&&(r==null?this.enable():this.disable())}connectedCallback(){this.hasAttribute(Ge.DISABLED)||this.enable(),this.role="menuitem"+this.type,rc(this,On,sc(this,this.parentNode)),tt(this,Hs,ac).call(this),this.submenuElement&&tt(this,Bs,dc).call(this)}disconnectedCallback(){this.disable(),tt(this,Hs,ac).call(this),rc(this,On,null)}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=Ci(this))==null?void 0:e.querySelector(`#${this.invokeTarget}`):this.submenuElement}get submenuElement(){return this.shadowRoot.querySelector('slot[name="submenu"]').assignedElements({flatten:!0})[0]}get type(){var e;return(e=this.getAttribute(Ge.TYPE))!=null?e:""}set type(e){this.setAttribute(Ge.TYPE,`${e}`)}get value(){var e;return(e=this.getAttribute(Ge.VALUE))!=null?e:this.text}set value(e){this.setAttribute(Ge.VALUE,e)}get text(){var e;return((e=this.textContent)!=null?e:"").trim()}get checked(){if(Dn(this))return this.getAttribute("aria-checked")==="true"}set checked(e){Dn(this)&&(rc(this,$s,!0),this.setAttribute("aria-checked",e?"true":"false"),e?this.part.add("checked"):this.part.remove("checked"))}handleClick(e){Dn(this)||this.invokeTargetElement&&Te(this,e.target)&&this.invokeTargetElement.dispatchEvent(new ti({relatedTarget:this}))}get keysUsed(){return["Enter"," "]}};$s=new WeakMap;On=new WeakMap;oc=new WeakSet;kp=function(i){let e=i.target;if(!(e!=null&&e.name))for(let r of e.assignedNodes({flatten:!0}))r instanceof Text&&r.textContent.trim()===""&&r.remove();e.name==="submenu"&&(this.submenuElement?tt(this,Bs,dc).call(this):tt(this,cc,Lp).call(this))};Bs=new WeakSet;dc=async function(){this.setAttribute("aria-haspopup","menu"),this.setAttribute("aria-expanded",`${!this.submenuElement.hidden}`),this.submenuElement.addEventListener("change",Tt(this,At)),this.submenuElement.addEventListener("addmenuitem",Tt(this,At)),this.submenuElement.addEventListener("removemenuitem",Tt(this,At)),Tt(this,At).call(this)};cc=new WeakSet;Lp=function(){this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.submenuElement.removeEventListener("change",Tt(this,At)),this.submenuElement.removeEventListener("addmenuitem",Tt(this,At)),this.submenuElement.removeEventListener("removemenuitem",Tt(this,At)),Tt(this,At).call(this)};At=new WeakMap;Gr=new WeakSet;Un=function(i){let{key:e}=i;if(!this.keysUsed.includes(e)){this.removeEventListener("keyup",tt(this,Gr,Un));return}this.handleClick(i)};nc=new WeakSet;wp=function(i){let{metaKey:e,altKey:t,key:r}=i;if(e||t||!this.keysUsed.includes(r)){this.removeEventListener("keyup",tt(this,Gr,Un));return}this.addEventListener("keyup",tt(this,Gr,Un),{once:!0})};Hs=new WeakSet;ac=function(){var i;let e=(i=Tt(this,On))==null?void 0:i.radioGroupItems;if(!e)return;let t=e.filter(r=>r.getAttribute("aria-checked")==="true").pop();t||(t=e[0]);for(let r of e)r.setAttribute("aria-checked","false");t==null||t.setAttribute("aria-checked","true")};Ve.shadowRootOptions={mode:"open"};Ve.getTemplateHTML=Bg;Ve.getSuffixSlotInnerHTML=Vg;function Dn(i){return i.type==="radio"||i.type==="checkbox"}function sc(i,e){if(!i)return null;let{host:t}=i.getRootNode();return!e&&t?sc(i,t):e!=null&&e.items?e:sc(e,e==null?void 0:e.parentNode)}d.customElements.get("media-chrome-menu-item")||d.customElements.define("media-chrome-menu-item",Ve);function Wg(i){return`
1951
+ `}function Hg(i){return""}var Ge={TYPE:"type",VALUE:"value",CHECKED:"checked",DISABLED:"disabled"},Ve=class extends d.HTMLElement{constructor(){if(super(),Ut(this,oc),Ut(this,Bs),Ut(this,cc),Ut(this,Gr),Ut(this,nc),Ut(this,Hs),Ut(this,$s,!1),Ut(this,On,void 0),Ut(this,At,()=>{var e,t;this.submenuElement.items&&this.setAttribute("submenusize",`${this.submenuElement.items.length}`);let r=this.shadowRoot.querySelector('slot[name="description"]'),o=(e=this.submenuElement.checkedItems)==null?void 0:e[0],n=(t=o==null?void 0:o.dataset.description)!=null?t:o==null?void 0:o.text,a=ee.createElement("span");a.textContent=n??"",r.replaceChildren(a)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.shadowRoot.addEventListener("slotchange",this)}static get observedAttributes(){return[Ge.TYPE,Ge.DISABLED,Ge.CHECKED,Ge.VALUE]}enable(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","-1"),Dn(this)&&!this.hasAttribute("aria-checked")&&this.setAttribute("aria-checked","false"),this.addEventListener("click",this),this.addEventListener("keydown",this)}disable(){this.removeAttribute("tabindex"),this.removeEventListener("click",this),this.removeEventListener("keydown",this),this.removeEventListener("keyup",this)}handleEvent(e){switch(e.type){case"slotchange":tt(this,oc,Sp).call(this,e);break;case"click":this.handleClick(e);break;case"keydown":tt(this,nc,Lp).call(this,e);break;case"keyup":tt(this,Gr,Un).call(this,e);break}}attributeChangedCallback(e,t,r){e===Ge.CHECKED&&Dn(this)&&!Tt(this,$s)?this.setAttribute("aria-checked",r!=null?"true":"false"):e===Ge.TYPE&&r!==t?this.role="menuitem"+r:e===Ge.DISABLED&&r!==t&&(r==null?this.enable():this.disable())}connectedCallback(){this.hasAttribute(Ge.DISABLED)||this.enable(),this.role="menuitem"+this.type,rc(this,On,sc(this,this.parentNode)),tt(this,Hs,ac).call(this),this.submenuElement&&tt(this,Bs,dc).call(this)}disconnectedCallback(){this.disable(),tt(this,Hs,ac).call(this),rc(this,On,null)}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=Ii(this))==null?void 0:e.querySelector(`#${this.invokeTarget}`):this.submenuElement}get submenuElement(){return this.shadowRoot.querySelector('slot[name="submenu"]').assignedElements({flatten:!0})[0]}get type(){var e;return(e=this.getAttribute(Ge.TYPE))!=null?e:""}set type(e){this.setAttribute(Ge.TYPE,`${e}`)}get value(){var e;return(e=this.getAttribute(Ge.VALUE))!=null?e:this.text}set value(e){this.setAttribute(Ge.VALUE,e)}get text(){var e;return((e=this.textContent)!=null?e:"").trim()}get checked(){if(Dn(this))return this.getAttribute("aria-checked")==="true"}set checked(e){Dn(this)&&(rc(this,$s,!0),this.setAttribute("aria-checked",e?"true":"false"),e?this.part.add("checked"):this.part.remove("checked"))}handleClick(e){Dn(this)||this.invokeTargetElement&&Te(this,e.target)&&this.invokeTargetElement.dispatchEvent(new ti({relatedTarget:this}))}get keysUsed(){return["Enter"," "]}};$s=new WeakMap;On=new WeakMap;oc=new WeakSet;Sp=function(i){let e=i.target;if(!(e!=null&&e.name))for(let r of e.assignedNodes({flatten:!0}))r instanceof Text&&r.textContent.trim()===""&&r.remove();e.name==="submenu"&&(this.submenuElement?tt(this,Bs,dc).call(this):tt(this,cc,kp).call(this))};Bs=new WeakSet;dc=async function(){this.setAttribute("aria-haspopup","menu"),this.setAttribute("aria-expanded",`${!this.submenuElement.hidden}`),this.submenuElement.addEventListener("change",Tt(this,At)),this.submenuElement.addEventListener("addmenuitem",Tt(this,At)),this.submenuElement.addEventListener("removemenuitem",Tt(this,At)),Tt(this,At).call(this)};cc=new WeakSet;kp=function(){this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.submenuElement.removeEventListener("change",Tt(this,At)),this.submenuElement.removeEventListener("addmenuitem",Tt(this,At)),this.submenuElement.removeEventListener("removemenuitem",Tt(this,At)),Tt(this,At).call(this)};At=new WeakMap;Gr=new WeakSet;Un=function(i){let{key:e}=i;if(!this.keysUsed.includes(e)){this.removeEventListener("keyup",tt(this,Gr,Un));return}this.handleClick(i)};nc=new WeakSet;Lp=function(i){let{metaKey:e,altKey:t,key:r}=i;if(e||t||!this.keysUsed.includes(r)){this.removeEventListener("keyup",tt(this,Gr,Un));return}this.addEventListener("keyup",tt(this,Gr,Un),{once:!0})};Hs=new WeakSet;ac=function(){var i;let e=(i=Tt(this,On))==null?void 0:i.radioGroupItems;if(!e)return;let t=e.filter(r=>r.getAttribute("aria-checked")==="true").pop();t||(t=e[0]);for(let r of e)r.setAttribute("aria-checked","false");t==null||t.setAttribute("aria-checked","true")};Ve.shadowRootOptions={mode:"open"};Ve.getTemplateHTML=$g;Ve.getSuffixSlotInnerHTML=Hg;function Dn(i){return i.type==="radio"||i.type==="checkbox"}function sc(i,e){if(!i)return null;let{host:t}=i.getRootNode();return!e&&t?sc(i,t):e!=null&&e.items?e:sc(e,e==null?void 0:e.parentNode)}d.customElements.get("media-chrome-menu-item")||d.customElements.define("media-chrome-menu-item",Ve);function Bg(i){return`
1952
1952
  ${le.getTemplateHTML(i)}
1953
1953
  <style>
1954
1954
  :host {
@@ -1983,7 +1983,7 @@ bp-player[has-error] {
1983
1983
  --media-settings-menu-item-opacity: 0;
1984
1984
  }
1985
1985
  </style>
1986
- `}var Nn=class extends le{get anchorElement(){return this.anchor!=="auto"?super.anchorElement:X(this).querySelector("media-settings-menu-button")}};Nn.getTemplateHTML=Wg;d.customElements.get("media-settings-menu")||d.customElements.define("media-settings-menu",Nn);function Fg(i){return`
1986
+ `}var Nn=class extends le{get anchorElement(){return this.anchor!=="auto"?super.anchorElement:X(this).querySelector("media-settings-menu-button")}};Nn.getTemplateHTML=Bg;d.customElements.get("media-settings-menu")||d.customElements.define("media-settings-menu",Nn);function Vg(i){return`
1987
1987
  ${Ve.getTemplateHTML.call(this,i)}
1988
1988
  <style>
1989
1989
  slot:not([name="submenu"]) {
@@ -1994,11 +1994,11 @@ bp-player[has-error] {
1994
1994
  background: transparent;
1995
1995
  }
1996
1996
  </style>
1997
- `}function Kg(i){return`
1997
+ `}function Wg(i){return`
1998
1998
  <svg aria-hidden="true" viewBox="0 0 20 24">
1999
1999
  <path d="m8.12 17.585-.742-.669 4.2-4.665-4.2-4.666.743-.669 4.803 5.335-4.803 5.334Z"/>
2000
2000
  </svg>
2001
- `}var Yi=class extends Ve{};Yi.shadowRootOptions={mode:"open"};Yi.getTemplateHTML=Fg;Yi.getSuffixSlotInnerHTML=Kg;d.customElements.get("media-settings-menu-item")||d.customElements.define("media-settings-menu-item",Yi);var Pe=class extends F{connectedCallback(){super.connectedCallback(),this.invokeTargetElement&&this.setAttribute("aria-haspopup","menu")}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=Ci(this))==null?void 0:e.querySelector(`#${this.invokeTarget}`):null}handleClick(){var e;(e=this.invokeTargetElement)==null||e.dispatchEvent(new ti({relatedTarget:this}))}};d.customElements.get("media-chrome-menu-button")||d.customElements.define("media-chrome-menu-button",Pe);function qg(){return`
2001
+ `}var Yi=class extends Ve{};Yi.shadowRootOptions={mode:"open"};Yi.getTemplateHTML=Vg;Yi.getSuffixSlotInnerHTML=Wg;d.customElements.get("media-settings-menu-item")||d.customElements.define("media-settings-menu-item",Yi);var Pe=class extends F{connectedCallback(){super.connectedCallback(),this.invokeTargetElement&&this.setAttribute("aria-haspopup","menu")}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=Ii(this))==null?void 0:e.querySelector(`#${this.invokeTarget}`):null}handleClick(){var e;(e=this.invokeTargetElement)==null||e.dispatchEvent(new ti({relatedTarget:this}))}};d.customElements.get("media-chrome-menu-button")||d.customElements.define("media-chrome-menu-button",Pe);function Fg(){return`
2002
2002
  <style>
2003
2003
  :host([aria-expanded="true"]) slot[name=tooltip] {
2004
2004
  display: none;
@@ -2009,27 +2009,27 @@ bp-player[has-error] {
2009
2009
  <path d="M4.5 14.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Zm7.5 0a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Zm7.5 0a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z"/>
2010
2010
  </svg>
2011
2011
  </slot>
2012
- `}function Gg(){return E("Settings")}var zr=class extends Pe{static get observedAttributes(){return[...super.observedAttributes,"target"]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",E("settings"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:X(this).querySelector("media-settings-menu")}};zr.getSlotTemplateHTML=qg;zr.getTooltipContentHTML=Gg;d.customElements.get("media-settings-menu-button")||d.customElements.define("media-settings-menu-button",zr);var mc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Cp=(i,e,t)=>(mc(i,e,"read from private field"),t?t.call(i):e.get(i)),Vs=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},uc=(i,e,t,r)=>(mc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ws=(i,e,t)=>(mc(i,e,"access private method"),t),$n,qs,Fs,hc,Ks,pc,Gs=class extends le{constructor(){super(...arguments),Vs(this,Fs),Vs(this,Ks),Vs(this,$n,[]),Vs(this,qs,void 0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_AUDIO_TRACK_LIST,s.MEDIA_AUDIO_TRACK_ENABLED,s.MEDIA_AUDIO_TRACK_UNAVAILABLE]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_AUDIO_TRACK_ENABLED&&t!==r?this.value=r:e===s.MEDIA_AUDIO_TRACK_LIST&&t!==r&&(uc(this,$n,Ru(r??"")),Ws(this,Fs,hc).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Ws(this,Ks,pc))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Ws(this,Ks,pc))}get anchorElement(){var e;return this.anchor!=="auto"?super.anchorElement:(e=X(this))==null?void 0:e.querySelector("media-audio-track-menu-button")}get mediaAudioTrackList(){return Cp(this,$n)}set mediaAudioTrackList(e){uc(this,$n,e),Ws(this,Fs,hc).call(this)}get mediaAudioTrackEnabled(){var e;return(e=P(this,s.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){D(this,s.MEDIA_AUDIO_TRACK_ENABLED,e)}};$n=new WeakMap;qs=new WeakMap;Fs=new WeakSet;hc=function(){if(Cp(this,qs)===JSON.stringify(this.mediaAudioTrackList))return;uc(this,qs,JSON.stringify(this.mediaAudioTrackList));let i=this.mediaAudioTrackList;this.defaultSlot.textContent="",i.sort((e,t)=>e.id.localeCompare(t.id,void 0,{numeric:!0}));for(let e of i){let t=this.formatMenuItemText(e.label,e),r=yt({type:"radio",text:t,value:`${e.id}`,checked:e.enabled});r.prepend(et(this,"checked-indicator")),this.defaultSlot.append(r)}};Ks=new WeakSet;pc=function(){if(this.value==null)return;let i=new d.CustomEvent(b.MEDIA_AUDIO_TRACK_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};d.customElements.get("media-audio-track-menu")||d.customElements.define("media-audio-track-menu",Gs);var zg=`<svg aria-hidden="true" viewBox="0 0 24 24">
2012
+ `}function Kg(){return E("Settings")}var zr=class extends Pe{static get observedAttributes(){return[...super.observedAttributes,"target"]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",E("settings"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:X(this).querySelector("media-settings-menu")}};zr.getSlotTemplateHTML=Fg;zr.getTooltipContentHTML=Kg;d.customElements.get("media-settings-menu-button")||d.customElements.define("media-settings-menu-button",zr);var mc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},wp=(i,e,t)=>(mc(i,e,"read from private field"),t?t.call(i):e.get(i)),Vs=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},uc=(i,e,t,r)=>(mc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ws=(i,e,t)=>(mc(i,e,"access private method"),t),$n,qs,Fs,hc,Ks,pc,Gs=class extends le{constructor(){super(...arguments),Vs(this,Fs),Vs(this,Ks),Vs(this,$n,[]),Vs(this,qs,void 0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_AUDIO_TRACK_LIST,s.MEDIA_AUDIO_TRACK_ENABLED,s.MEDIA_AUDIO_TRACK_UNAVAILABLE]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_AUDIO_TRACK_ENABLED&&t!==r?this.value=r:e===s.MEDIA_AUDIO_TRACK_LIST&&t!==r&&(uc(this,$n,Mu(r??"")),Ws(this,Fs,hc).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Ws(this,Ks,pc))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Ws(this,Ks,pc))}get anchorElement(){var e;return this.anchor!=="auto"?super.anchorElement:(e=X(this))==null?void 0:e.querySelector("media-audio-track-menu-button")}get mediaAudioTrackList(){return wp(this,$n)}set mediaAudioTrackList(e){uc(this,$n,e),Ws(this,Fs,hc).call(this)}get mediaAudioTrackEnabled(){var e;return(e=P(this,s.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){D(this,s.MEDIA_AUDIO_TRACK_ENABLED,e)}};$n=new WeakMap;qs=new WeakMap;Fs=new WeakSet;hc=function(){if(wp(this,qs)===JSON.stringify(this.mediaAudioTrackList))return;uc(this,qs,JSON.stringify(this.mediaAudioTrackList));let i=this.mediaAudioTrackList;this.defaultSlot.textContent="",i.sort((e,t)=>e.id.localeCompare(t.id,void 0,{numeric:!0}));for(let e of i){let t=this.formatMenuItemText(e.label,e),r=yt({type:"radio",text:t,value:`${e.id}`,checked:e.enabled});r.prepend(et(this,"checked-indicator")),this.defaultSlot.append(r)}};Ks=new WeakSet;pc=function(){if(this.value==null)return;let i=new d.CustomEvent(b.MEDIA_AUDIO_TRACK_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};d.customElements.get("media-audio-track-menu")||d.customElements.define("media-audio-track-menu",Gs);var qg=`<svg aria-hidden="true" viewBox="0 0 24 24">
2013
2013
  <path d="M11 17H9.5V7H11v10Zm-3-3H6.5v-4H8v4Zm6-5h-1.5v6H14V9Zm3 7h-1.5V8H17v8Z"/>
2014
2014
  <path d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Zm-2 0a8 8 0 1 0-16 0 8 8 0 0 0 16 0Z"/>
2015
- </svg>`;function Yg(){return`
2015
+ </svg>`;function Gg(){return`
2016
2016
  <style>
2017
2017
  :host([aria-expanded="true"]) slot[name=tooltip] {
2018
2018
  display: none;
2019
2019
  }
2020
2020
  </style>
2021
- <slot name="icon">${zg}</slot>
2022
- `}function Qg(){return E("Audio")}var Ip=i=>{let e=E("Audio");i.setAttribute("aria-label",e)},Yr=class extends Pe{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_AUDIO_TRACK_ENABLED,s.MEDIA_AUDIO_TRACK_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Ip(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_LANG&&Ip(this)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=X(this))==null?void 0:e.querySelector("media-audio-track-menu")}get mediaAudioTrackEnabled(){var e;return(e=P(this,s.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){D(this,s.MEDIA_AUDIO_TRACK_ENABLED,e)}};Yr.getSlotTemplateHTML=Yg;Yr.getTooltipContentHTML=Qg;d.customElements.get("media-audio-track-menu-button")||d.customElements.define("media-audio-track-menu-button",Yr);var Ec=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Zg=(i,e,t)=>(Ec(i,e,"read from private field"),t?t.call(i):e.get(i)),vc=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Xg=(i,e,t,r)=>(Ec(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),zs=(i,e,t)=>(Ec(i,e,"access private method"),t),Zs,Ys,fc,Qs,gc,Jg=`
2021
+ <slot name="icon">${qg}</slot>
2022
+ `}function zg(){return E("Audio")}var Ip=i=>{let e=E("Audio");i.setAttribute("aria-label",e)},Yr=class extends Pe{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_AUDIO_TRACK_ENABLED,s.MEDIA_AUDIO_TRACK_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Ip(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_LANG&&Ip(this)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=X(this))==null?void 0:e.querySelector("media-audio-track-menu")}get mediaAudioTrackEnabled(){var e;return(e=P(this,s.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){D(this,s.MEDIA_AUDIO_TRACK_ENABLED,e)}};Yr.getSlotTemplateHTML=Gg;Yr.getTooltipContentHTML=zg;d.customElements.get("media-audio-track-menu-button")||d.customElements.define("media-audio-track-menu-button",Yr);var Ec=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Yg=(i,e,t)=>(Ec(i,e,"read from private field"),t?t.call(i):e.get(i)),vc=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Qg=(i,e,t,r)=>(Ec(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),zs=(i,e,t)=>(Ec(i,e,"access private method"),t),Zs,Ys,fc,Qs,gc,Zg=`
2023
2023
  <svg aria-hidden="true" viewBox="0 0 26 24" part="captions-indicator indicator">
2024
2024
  <path d="M22.83 5.68a2.58 2.58 0 0 0-2.3-2.5c-3.62-.24-11.44-.24-15.06 0a2.58 2.58 0 0 0-2.3 2.5c-.23 4.21-.23 8.43 0 12.64a2.58 2.58 0 0 0 2.3 2.5c3.62.24 11.44.24 15.06 0a2.58 2.58 0 0 0 2.3-2.5c.23-4.21.23-8.43 0-12.64Zm-11.39 9.45a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.92 3.92 0 0 1 .92-2.77 3.18 3.18 0 0 1 2.43-1 2.94 2.94 0 0 1 2.13.78c.364.359.62.813.74 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.17 1.61 1.61 0 0 0-1.29.58 2.79 2.79 0 0 0-.5 1.89 3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.48 1.48 0 0 0 1-.37 2.1 2.1 0 0 0 .59-1.14l1.4.44a3.23 3.23 0 0 1-1.07 1.69Zm7.22 0a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.88 3.88 0 0 1 .93-2.77 3.14 3.14 0 0 1 2.42-1 3 3 0 0 1 2.16.82 2.8 2.8 0 0 1 .73 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.21 1.61 1.61 0 0 0-1.29.58A2.79 2.79 0 0 0 15 12a3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.44 1.44 0 0 0 1-.37 2.1 2.1 0 0 0 .6-1.15l1.4.44a3.17 3.17 0 0 1-1.1 1.7Z"/>
2025
- </svg>`;function jg(i){return`
2025
+ </svg>`;function Xg(i){return`
2026
2026
  ${le.getTemplateHTML(i)}
2027
- <slot name="captions-indicator" hidden>${Jg}</slot>
2028
- `}var Hn=class extends le{constructor(){super(...arguments),vc(this,Ys),vc(this,Qs),vc(this,Zs,void 0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_SUBTITLES_LIST,s.MEDIA_SUBTITLES_SHOWING]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_SUBTITLES_LIST&&t!==r?zs(this,Ys,fc).call(this):e===s.MEDIA_SUBTITLES_SHOWING&&t!==r&&(this.value=r||"",zs(this,Ys,fc).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",zs(this,Qs,gc))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",zs(this,Qs,gc))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:X(this).querySelector("media-captions-menu-button")}get mediaSubtitlesList(){return Mp(this,s.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Rp(this,s.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Mp(this,s.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Rp(this,s.MEDIA_SUBTITLES_SHOWING,e)}};Zs=new WeakMap;Ys=new WeakSet;fc=function(){var i;let e=Zg(this,Zs)!==JSON.stringify(this.mediaSubtitlesList),t=this.value!==this.getAttribute(s.MEDIA_SUBTITLES_SHOWING);if(!e&&!t)return;Xg(this,Zs,JSON.stringify(this.mediaSubtitlesList)),this.defaultSlot.textContent="";let r=!this.value,o=yt({type:"radio",text:this.formatMenuItemText(E("Off")),value:"off",checked:r});o.prepend(et(this,"checked-indicator")),this.defaultSlot.append(o);let n=this.mediaSubtitlesList;for(let a of n){let l=yt({type:"radio",text:this.formatMenuItemText(a.label,a),value:wa(a),checked:this.value==wa(a)});l.prepend(et(this,"checked-indicator")),((i=a.kind)!=null?i:"subs")==="captions"&&l.append(et(this,"captions-indicator")),this.defaultSlot.append(l)}};Qs=new WeakSet;gc=function(){let i=this.mediaSubtitlesShowing,e=this.getAttribute(s.MEDIA_SUBTITLES_SHOWING),t=this.value!==e;if(i!=null&&i.length&&t&&this.dispatchEvent(new d.CustomEvent(b.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:i})),!this.value||!t)return;let r=new d.CustomEvent(b.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(r)};Hn.getTemplateHTML=jg;var Mp=(i,e)=>{let t=i.getAttribute(e);return t?xi(t):[]},Rp=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let r=Dt(t);i.getAttribute(e)!==r&&i.setAttribute(e,r)};d.customElements.get("media-captions-menu")||d.customElements.define("media-captions-menu",Hn);var eE=`<svg aria-hidden="true" viewBox="0 0 26 24">
2027
+ <slot name="captions-indicator" hidden>${Zg}</slot>
2028
+ `}var Hn=class extends le{constructor(){super(...arguments),vc(this,Ys),vc(this,Qs),vc(this,Zs,void 0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_SUBTITLES_LIST,s.MEDIA_SUBTITLES_SHOWING]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_SUBTITLES_LIST&&t!==r?zs(this,Ys,fc).call(this):e===s.MEDIA_SUBTITLES_SHOWING&&t!==r&&(this.value=r||"",zs(this,Ys,fc).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",zs(this,Qs,gc))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",zs(this,Qs,gc))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:X(this).querySelector("media-captions-menu-button")}get mediaSubtitlesList(){return Cp(this,s.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Mp(this,s.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Cp(this,s.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Mp(this,s.MEDIA_SUBTITLES_SHOWING,e)}};Zs=new WeakMap;Ys=new WeakSet;fc=function(){var i;let e=Yg(this,Zs)!==JSON.stringify(this.mediaSubtitlesList),t=this.value!==this.getAttribute(s.MEDIA_SUBTITLES_SHOWING);if(!e&&!t)return;Qg(this,Zs,JSON.stringify(this.mediaSubtitlesList)),this.defaultSlot.textContent="";let r=!this.value,o=yt({type:"radio",text:this.formatMenuItemText(E("Off")),value:"off",checked:r});o.prepend(et(this,"checked-indicator")),this.defaultSlot.append(o);let n=this.mediaSubtitlesList;for(let a of n){let l=yt({type:"radio",text:this.formatMenuItemText(a.label,a),value:wa(a),checked:this.value==wa(a)});l.prepend(et(this,"checked-indicator")),((i=a.kind)!=null?i:"subs")==="captions"&&l.append(et(this,"captions-indicator")),this.defaultSlot.append(l)}};Qs=new WeakSet;gc=function(){let i=this.mediaSubtitlesShowing,e=this.getAttribute(s.MEDIA_SUBTITLES_SHOWING),t=this.value!==e;if(i!=null&&i.length&&t&&this.dispatchEvent(new d.CustomEvent(b.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:i})),!this.value||!t)return;let r=new d.CustomEvent(b.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(r)};Hn.getTemplateHTML=Xg;var Cp=(i,e)=>{let t=i.getAttribute(e);return t?xi(t):[]},Mp=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let r=Dt(t);i.getAttribute(e)!==r&&i.setAttribute(e,r)};d.customElements.get("media-captions-menu")||d.customElements.define("media-captions-menu",Hn);var Jg=`<svg aria-hidden="true" viewBox="0 0 26 24">
2029
2029
  <path d="M22.83 5.68a2.58 2.58 0 0 0-2.3-2.5c-3.62-.24-11.44-.24-15.06 0a2.58 2.58 0 0 0-2.3 2.5c-.23 4.21-.23 8.43 0 12.64a2.58 2.58 0 0 0 2.3 2.5c3.62.24 11.44.24 15.06 0a2.58 2.58 0 0 0 2.3-2.5c.23-4.21.23-8.43 0-12.64Zm-11.39 9.45a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.92 3.92 0 0 1 .92-2.77 3.18 3.18 0 0 1 2.43-1 2.94 2.94 0 0 1 2.13.78c.364.359.62.813.74 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.17 1.61 1.61 0 0 0-1.29.58 2.79 2.79 0 0 0-.5 1.89 3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.48 1.48 0 0 0 1-.37 2.1 2.1 0 0 0 .59-1.14l1.4.44a3.23 3.23 0 0 1-1.07 1.69Zm7.22 0a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.88 3.88 0 0 1 .93-2.77 3.14 3.14 0 0 1 2.42-1 3 3 0 0 1 2.16.82 2.8 2.8 0 0 1 .73 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.21 1.61 1.61 0 0 0-1.29.58A2.79 2.79 0 0 0 15 12a3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.44 1.44 0 0 0 1-.37 2.1 2.1 0 0 0 .6-1.15l1.4.44a3.17 3.17 0 0 1-1.1 1.7Z"/>
2030
- </svg>`,tE=`<svg aria-hidden="true" viewBox="0 0 26 24">
2030
+ </svg>`,jg=`<svg aria-hidden="true" viewBox="0 0 26 24">
2031
2031
  <path d="M17.73 14.09a1.4 1.4 0 0 1-1 .37 1.579 1.579 0 0 1-1.27-.58A3 3 0 0 1 15 12a2.8 2.8 0 0 1 .5-1.85 1.63 1.63 0 0 1 1.29-.57 1.47 1.47 0 0 1 1.51 1.2l1.43-.34A2.89 2.89 0 0 0 19 9.07a3 3 0 0 0-2.14-.78 3.14 3.14 0 0 0-2.42 1 3.91 3.91 0 0 0-.93 2.78 3.74 3.74 0 0 0 .92 2.66 3.07 3.07 0 0 0 2.34 1 3.07 3.07 0 0 0 1.91-.57 3.17 3.17 0 0 0 1.07-1.74l-1.4-.45c-.083.43-.3.822-.62 1.12Zm-7.22 0a1.43 1.43 0 0 1-1 .37 1.58 1.58 0 0 1-1.27-.58A3 3 0 0 1 7.76 12a2.8 2.8 0 0 1 .5-1.85 1.63 1.63 0 0 1 1.29-.57 1.47 1.47 0 0 1 1.51 1.2l1.43-.34a2.81 2.81 0 0 0-.74-1.32 2.94 2.94 0 0 0-2.13-.78 3.18 3.18 0 0 0-2.43 1 4 4 0 0 0-.92 2.78 3.74 3.74 0 0 0 .92 2.66 3.07 3.07 0 0 0 2.34 1 3.07 3.07 0 0 0 1.91-.57 3.23 3.23 0 0 0 1.07-1.74l-1.4-.45a2.06 2.06 0 0 1-.6 1.07Zm12.32-8.41a2.59 2.59 0 0 0-2.3-2.51C18.72 3.05 15.86 3 13 3c-2.86 0-5.72.05-7.53.17a2.59 2.59 0 0 0-2.3 2.51c-.23 4.207-.23 8.423 0 12.63a2.57 2.57 0 0 0 2.3 2.5c1.81.13 4.67.19 7.53.19 2.86 0 5.72-.06 7.53-.19a2.57 2.57 0 0 0 2.3-2.5c.23-4.207.23-8.423 0-12.63Zm-1.49 12.53a1.11 1.11 0 0 1-.91 1.11c-1.67.11-4.45.18-7.43.18-2.98 0-5.76-.07-7.43-.18a1.11 1.11 0 0 1-.91-1.11c-.21-4.14-.21-8.29 0-12.43a1.11 1.11 0 0 1 .91-1.11C7.24 4.56 10 4.49 13 4.49s5.76.07 7.43.18a1.11 1.11 0 0 1 .91 1.11c.21 4.14.21 8.29 0 12.43Z"/>
2032
- </svg>`;function iE(){return`
2032
+ </svg>`;function eE(){return`
2033
2033
  <style>
2034
2034
  :host([data-captions-enabled="true"]) slot[name=off] {
2035
2035
  display: none !important;
@@ -2046,10 +2046,10 @@ bp-player[has-error] {
2046
2046
  </style>
2047
2047
 
2048
2048
  <slot name="icon">
2049
- <slot name="on">${eE}</slot>
2050
- <slot name="off">${tE}</slot>
2049
+ <slot name="on">${Jg}</slot>
2050
+ <slot name="off">${jg}</slot>
2051
2051
  </slot>
2052
- `}function rE(){return E("Captions")}var xp=i=>{i.setAttribute("data-captions-enabled",Ca(i).toString())},Pp=i=>{i.setAttribute("aria-label",E("closed captions"))},Qr=class extends Pe{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_SUBTITLES_LIST,s.MEDIA_SUBTITLES_SHOWING,s.MEDIA_LANG]}connectedCallback(){super.connectedCallback(),Pp(this),xp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_SUBTITLES_SHOWING?xp(this):e===s.MEDIA_LANG&&Pp(this)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=X(this))==null?void 0:e.querySelector("media-captions-menu")}get mediaSubtitlesList(){return Dp(this,s.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Op(this,s.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Dp(this,s.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Op(this,s.MEDIA_SUBTITLES_SHOWING,e)}};Qr.getSlotTemplateHTML=iE;Qr.getTooltipContentHTML=rE;var Dp=(i,e)=>{let t=i.getAttribute(e);return t?xi(t):[]},Op=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let r=Dt(t);i.getAttribute(e)!==r&&i.setAttribute(e,r)};d.customElements.get("media-captions-menu-button")||d.customElements.define("media-captions-menu-button",Qr);var Up=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Xr=(i,e,t)=>(Up(i,e,"read from private field"),t?t.call(i):e.get(i)),bc=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Zr=(i,e,t)=>(Up(i,e,"access private method"),t),ri,Jr,Bn,Xs,yc,_c={RATES:"rates"},Js=class extends le{constructor(){super(),bc(this,Jr),bc(this,Xs),bc(this,ri,new Yt(this,_c.RATES,{defaultValue:kd})),Zr(this,Jr,Bn).call(this)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PLAYBACK_RATE,_c.RATES]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_PLAYBACK_RATE&&t!=r?(this.value=r,Zr(this,Jr,Bn).call(this)):e===_c.RATES&&t!=r&&(Xr(this,ri).value=r,Zr(this,Jr,Bn).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Zr(this,Xs,yc))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Zr(this,Xs,yc))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:X(this).querySelector("media-playback-rate-menu-button")}get rates(){return Xr(this,ri)}set rates(e){e?Array.isArray(e)?Xr(this,ri).value=e.join(" "):typeof e=="string"&&(Xr(this,ri).value=e):Xr(this,ri).value="",Zr(this,Jr,Bn).call(this)}get mediaPlaybackRate(){return $(this,s.MEDIA_PLAYBACK_RATE,Vi)}set mediaPlaybackRate(e){B(this,s.MEDIA_PLAYBACK_RATE,e)}};ri=new WeakMap;Jr=new WeakSet;Bn=function(){this.defaultSlot.textContent="";let i=this.mediaPlaybackRate,e=new Set(Array.from(Xr(this,ri)).map(r=>Number(r)));i>0&&!e.has(i)&&e.add(i);let t=Array.from(e).sort((r,o)=>r-o);for(let r of t){let o=yt({type:"radio",text:this.formatMenuItemText(`${r}x`,r),value:r.toString(),checked:i===r});o.prepend(et(this,"checked-indicator")),this.defaultSlot.append(o)}};Xs=new WeakSet;yc=function(){if(!this.value)return;let i=new d.CustomEvent(b.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};d.customElements.get("media-playback-rate-menu")||d.customElements.define("media-playback-rate-menu",Js);var js=1;function oE(i){return`
2052
+ `}function tE(){return E("Captions")}var Rp=i=>{i.setAttribute("data-captions-enabled",Ia(i).toString())},xp=i=>{i.setAttribute("aria-label",E("closed captions"))},Qr=class extends Pe{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_SUBTITLES_LIST,s.MEDIA_SUBTITLES_SHOWING,s.MEDIA_LANG]}connectedCallback(){super.connectedCallback(),xp(this),Rp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_SUBTITLES_SHOWING?Rp(this):e===s.MEDIA_LANG&&xp(this)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=X(this))==null?void 0:e.querySelector("media-captions-menu")}get mediaSubtitlesList(){return Pp(this,s.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Dp(this,s.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Pp(this,s.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Dp(this,s.MEDIA_SUBTITLES_SHOWING,e)}};Qr.getSlotTemplateHTML=eE;Qr.getTooltipContentHTML=tE;var Pp=(i,e)=>{let t=i.getAttribute(e);return t?xi(t):[]},Dp=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let r=Dt(t);i.getAttribute(e)!==r&&i.setAttribute(e,r)};d.customElements.get("media-captions-menu-button")||d.customElements.define("media-captions-menu-button",Qr);var Op=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Xr=(i,e,t)=>(Op(i,e,"read from private field"),t?t.call(i):e.get(i)),bc=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Zr=(i,e,t)=>(Op(i,e,"access private method"),t),ri,Jr,Bn,Xs,yc,_c={RATES:"rates"},Js=class extends le{constructor(){super(),bc(this,Jr),bc(this,Xs),bc(this,ri,new Yt(this,_c.RATES,{defaultValue:kd})),Zr(this,Jr,Bn).call(this)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PLAYBACK_RATE,_c.RATES]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_PLAYBACK_RATE&&t!=r?(this.value=r,Zr(this,Jr,Bn).call(this)):e===_c.RATES&&t!=r&&(Xr(this,ri).value=r,Zr(this,Jr,Bn).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Zr(this,Xs,yc))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Zr(this,Xs,yc))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:X(this).querySelector("media-playback-rate-menu-button")}get rates(){return Xr(this,ri)}set rates(e){e?Array.isArray(e)?Xr(this,ri).value=e.join(" "):typeof e=="string"&&(Xr(this,ri).value=e):Xr(this,ri).value="",Zr(this,Jr,Bn).call(this)}get mediaPlaybackRate(){return $(this,s.MEDIA_PLAYBACK_RATE,Vi)}set mediaPlaybackRate(e){B(this,s.MEDIA_PLAYBACK_RATE,e)}};ri=new WeakMap;Jr=new WeakSet;Bn=function(){this.defaultSlot.textContent="";let i=this.mediaPlaybackRate,e=new Set(Array.from(Xr(this,ri)).map(r=>Number(r)));i>0&&!e.has(i)&&e.add(i);let t=Array.from(e).sort((r,o)=>r-o);for(let r of t){let o=yt({type:"radio",text:this.formatMenuItemText(`${r}x`,r),value:r.toString(),checked:i===r});o.prepend(et(this,"checked-indicator")),this.defaultSlot.append(o)}};Xs=new WeakSet;yc=function(){if(!this.value)return;let i=new d.CustomEvent(b.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};d.customElements.get("media-playback-rate-menu")||d.customElements.define("media-playback-rate-menu",Js);var js=1;function iE(i){return`
2053
2053
  <style>
2054
2054
  :host {
2055
2055
  min-width: 5ch;
@@ -2065,16 +2065,16 @@ bp-player[has-error] {
2065
2065
  }
2066
2066
  </style>
2067
2067
  <slot name="icon">${i.mediaplaybackrate||js}x</slot>
2068
- `}function nE(){return E("Playback rate")}var jr=class extends Pe{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PLAYBACK_RATE]}constructor(){var e;super(),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${(e=this.mediaPlaybackRate)!=null?e:js}x`}attributeChangedCallback(e,t,r){if(super.attributeChangedCallback(e,t,r),e===s.MEDIA_PLAYBACK_RATE){let o=r?+r:Number.NaN,n=Number.isNaN(o)?js:o;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",E("Playback rate {playbackRate}",{playbackRate:n}))}}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:X(this).querySelector("media-playback-rate-menu")}get mediaPlaybackRate(){return $(this,s.MEDIA_PLAYBACK_RATE,js)}set mediaPlaybackRate(e){B(this,s.MEDIA_PLAYBACK_RATE,e)}};jr.getSlotTemplateHTML=oE;jr.getTooltipContentHTML=nE;d.customElements.get("media-playback-rate-menu-button")||d.customElements.define("media-playback-rate-menu-button",jr);var Ac=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Vn=(i,e,t)=>(Ac(i,e,"read from private field"),t?t.call(i):e.get(i)),el=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Np=(i,e,t,r)=>(Ac(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),eo=(i,e,t)=>(Ac(i,e,"access private method"),t),Wn,io,to,Fn,tl,Tc,il=class extends le{constructor(){super(...arguments),el(this,to),el(this,tl),el(this,Wn,[]),el(this,io,{})}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_RENDITION_LIST,s.MEDIA_RENDITION_SELECTED,s.MEDIA_RENDITION_UNAVAILABLE,s.MEDIA_HEIGHT]}static formatMenuItemText(e,t){return super.formatMenuItemText(e,t)}static formatRendition(e,{showBitrate:t=!1}={}){let r=`${Math.min(e.width,e.height)}p`;if(t&&e.bitrate){let o=e.bitrate/1e6,n=`${o.toFixed(o<1?1:0)} Mbps`;return`${r} (${n})`}return this.formatMenuItemText(r,e)}static compareRendition(e,t){var r,o;return t.height===e.height?((r=t.bitrate)!=null?r:0)-((o=e.bitrate)!=null?o:0):t.height-e.height}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_RENDITION_SELECTED&&t!==r?(this.value=r??"auto",eo(this,to,Fn).call(this)):e===s.MEDIA_RENDITION_LIST&&t!==r?(Np(this,Wn,Iu(r)),eo(this,to,Fn).call(this)):e===s.MEDIA_HEIGHT&&t!==r&&eo(this,to,Fn).call(this)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",eo(this,tl,Tc))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",eo(this,tl,Tc))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:X(this).querySelector("media-rendition-menu-button")}get mediaRenditionList(){return Vn(this,Wn)}set mediaRenditionList(e){Np(this,Wn,e),eo(this,to,Fn).call(this)}get mediaRenditionSelected(){return P(this,s.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){D(this,s.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return $(this,s.MEDIA_HEIGHT)}set mediaHeight(e){B(this,s.MEDIA_HEIGHT,e)}compareRendition(e,t){return this.constructor.compareRendition(e,t)}formatMenuItemText(e,t){return this.constructor.formatMenuItemText(e,t)}formatRendition(e,t){return this.constructor.formatRendition(e,t)}showRenditionBitrate(e){return this.mediaRenditionList.some(t=>t!==e&&t.height===e.height&&t.bitrate!==e.bitrate)}};Wn=new WeakMap;io=new WeakMap;to=new WeakSet;Fn=function(){if(Vn(this,io).mediaRenditionList===JSON.stringify(this.mediaRenditionList)&&Vn(this,io).mediaHeight===this.mediaHeight)return;Vn(this,io).mediaRenditionList=JSON.stringify(this.mediaRenditionList),Vn(this,io).mediaHeight=this.mediaHeight;let i=this.mediaRenditionList.sort(this.compareRendition.bind(this)),e=i.find(a=>a.id===this.mediaRenditionSelected);for(let a of i)a.selected=a===e;this.defaultSlot.textContent="";let t=!this.mediaRenditionSelected;for(let a of i){let l=this.formatRendition(a,{showBitrate:this.showRenditionBitrate(a)}),c=yt({type:"radio",text:l,value:`${a.id}`,checked:a.selected&&!t});c.prepend(et(this,"checked-indicator")),this.defaultSlot.append(c)}let r=e&&this.showRenditionBitrate(e),o=t?e?this.formatMenuItemText(`${E("Auto")} \u2022 ${this.formatRendition(e,{showBitrate:r})}`,e):this.formatMenuItemText(`${E("Auto")} (${this.mediaHeight}p)`):this.formatMenuItemText(E("Auto")),n=yt({type:"radio",text:o,value:"auto",checked:t});n.dataset.description=o,n.prepend(et(this,"checked-indicator")),this.defaultSlot.append(n)};tl=new WeakSet;Tc=function(){if(this.value==null)return;let i=new d.CustomEvent(b.MEDIA_RENDITION_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};d.customElements.get("media-rendition-menu")||d.customElements.define("media-rendition-menu",il);var aE=`<svg aria-hidden="true" viewBox="0 0 24 24">
2068
+ `}function rE(){return E("Playback rate")}var jr=class extends Pe{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PLAYBACK_RATE]}constructor(){var e;super(),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${(e=this.mediaPlaybackRate)!=null?e:js}x`}attributeChangedCallback(e,t,r){if(super.attributeChangedCallback(e,t,r),e===s.MEDIA_PLAYBACK_RATE){let o=r?+r:Number.NaN,n=Number.isNaN(o)?js:o;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",E("Playback rate {playbackRate}",{playbackRate:n}))}}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:X(this).querySelector("media-playback-rate-menu")}get mediaPlaybackRate(){return $(this,s.MEDIA_PLAYBACK_RATE,js)}set mediaPlaybackRate(e){B(this,s.MEDIA_PLAYBACK_RATE,e)}};jr.getSlotTemplateHTML=iE;jr.getTooltipContentHTML=rE;d.customElements.get("media-playback-rate-menu-button")||d.customElements.define("media-playback-rate-menu-button",jr);var Ac=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Vn=(i,e,t)=>(Ac(i,e,"read from private field"),t?t.call(i):e.get(i)),el=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Up=(i,e,t,r)=>(Ac(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),eo=(i,e,t)=>(Ac(i,e,"access private method"),t),Wn,io,to,Fn,tl,Tc,il=class extends le{constructor(){super(...arguments),el(this,to),el(this,tl),el(this,Wn,[]),el(this,io,{})}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_RENDITION_LIST,s.MEDIA_RENDITION_SELECTED,s.MEDIA_RENDITION_UNAVAILABLE,s.MEDIA_HEIGHT]}static formatMenuItemText(e,t){return super.formatMenuItemText(e,t)}static formatRendition(e,{showBitrate:t=!1}={}){let r=`${Math.min(e.width,e.height)}p`;if(t&&e.bitrate){let o=e.bitrate/1e6,n=`${o.toFixed(o<1?1:0)} Mbps`;return`${r} (${n})`}return this.formatMenuItemText(r,e)}static compareRendition(e,t){var r,o;return t.height===e.height?((r=t.bitrate)!=null?r:0)-((o=e.bitrate)!=null?o:0):t.height-e.height}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_RENDITION_SELECTED&&t!==r?(this.value=r??"auto",eo(this,to,Fn).call(this)):e===s.MEDIA_RENDITION_LIST&&t!==r?(Up(this,Wn,Iu(r)),eo(this,to,Fn).call(this)):e===s.MEDIA_HEIGHT&&t!==r&&eo(this,to,Fn).call(this)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",eo(this,tl,Tc))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",eo(this,tl,Tc))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:X(this).querySelector("media-rendition-menu-button")}get mediaRenditionList(){return Vn(this,Wn)}set mediaRenditionList(e){Up(this,Wn,e),eo(this,to,Fn).call(this)}get mediaRenditionSelected(){return P(this,s.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){D(this,s.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return $(this,s.MEDIA_HEIGHT)}set mediaHeight(e){B(this,s.MEDIA_HEIGHT,e)}compareRendition(e,t){return this.constructor.compareRendition(e,t)}formatMenuItemText(e,t){return this.constructor.formatMenuItemText(e,t)}formatRendition(e,t){return this.constructor.formatRendition(e,t)}showRenditionBitrate(e){return this.mediaRenditionList.some(t=>t!==e&&t.height===e.height&&t.bitrate!==e.bitrate)}};Wn=new WeakMap;io=new WeakMap;to=new WeakSet;Fn=function(){if(Vn(this,io).mediaRenditionList===JSON.stringify(this.mediaRenditionList)&&Vn(this,io).mediaHeight===this.mediaHeight)return;Vn(this,io).mediaRenditionList=JSON.stringify(this.mediaRenditionList),Vn(this,io).mediaHeight=this.mediaHeight;let i=this.mediaRenditionList.sort(this.compareRendition.bind(this)),e=i.find(a=>a.id===this.mediaRenditionSelected);for(let a of i)a.selected=a===e;this.defaultSlot.textContent="";let t=!this.mediaRenditionSelected;for(let a of i){let l=this.formatRendition(a,{showBitrate:this.showRenditionBitrate(a)}),c=yt({type:"radio",text:l,value:`${a.id}`,checked:a.selected&&!t});c.prepend(et(this,"checked-indicator")),this.defaultSlot.append(c)}let r=e&&this.showRenditionBitrate(e),o=t?e?this.formatMenuItemText(`${E("Auto")} \u2022 ${this.formatRendition(e,{showBitrate:r})}`,e):this.formatMenuItemText(`${E("Auto")} (${this.mediaHeight}p)`):this.formatMenuItemText(E("Auto")),n=yt({type:"radio",text:o,value:"auto",checked:t});n.dataset.description=o,n.prepend(et(this,"checked-indicator")),this.defaultSlot.append(n)};tl=new WeakSet;Tc=function(){if(this.value==null)return;let i=new d.CustomEvent(b.MEDIA_RENDITION_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};d.customElements.get("media-rendition-menu")||d.customElements.define("media-rendition-menu",il);var oE=`<svg aria-hidden="true" viewBox="0 0 24 24">
2069
2069
  <path d="M13.5 2.5h2v6h-2v-2h-11v-2h11v-2Zm4 2h4v2h-4v-2Zm-12 4h2v6h-2v-2h-3v-2h3v-2Zm4 2h12v2h-12v-2Zm1 4h2v6h-2v-2h-8v-2h8v-2Zm4 2h7v2h-7v-2Z" />
2070
- </svg>`;function sE(){return`
2070
+ </svg>`;function nE(){return`
2071
2071
  <style>
2072
2072
  :host([aria-expanded="true"]) slot[name=tooltip] {
2073
2073
  display: none;
2074
2074
  }
2075
2075
  </style>
2076
- <slot name="icon">${aE}</slot>
2077
- `}function lE(){return E("Quality")}var ro=class extends Pe{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_RENDITION_SELECTED,s.MEDIA_RENDITION_UNAVAILABLE,s.MEDIA_HEIGHT]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",E("quality"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:X(this).querySelector("media-rendition-menu")}get mediaRenditionSelected(){return P(this,s.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){D(this,s.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return $(this,s.MEDIA_HEIGHT)}set mediaHeight(e){B(this,s.MEDIA_HEIGHT,e)}};ro.getSlotTemplateHTML=sE;ro.getTooltipContentHTML=lE;d.customElements.get("media-rendition-menu-button")||d.customElements.define("media-rendition-menu-button",ro);var Lc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},kt=(i,e,t)=>(Lc(i,e,"read from private field"),t?t.call(i):e.get(i)),St=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},$p=(i,e,t,r)=>(Lc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ze=(i,e,t)=>(Lc(i,e,"access private method"),t),no,Kn,ll,Qi,oo,wc,Hp,rl,Sc,ol,kc,Bp,al,sl,nl;function dE(i){return`
2076
+ <slot name="icon">${oE}</slot>
2077
+ `}function aE(){return E("Quality")}var ro=class extends Pe{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_RENDITION_SELECTED,s.MEDIA_RENDITION_UNAVAILABLE,s.MEDIA_HEIGHT]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",E("quality"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:X(this).querySelector("media-rendition-menu")}get mediaRenditionSelected(){return P(this,s.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){D(this,s.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return $(this,s.MEDIA_HEIGHT)}set mediaHeight(e){B(this,s.MEDIA_HEIGHT,e)}};ro.getSlotTemplateHTML=nE;ro.getTooltipContentHTML=aE;d.customElements.get("media-rendition-menu-button")||d.customElements.define("media-rendition-menu-button",ro);var Lc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},kt=(i,e,t)=>(Lc(i,e,"read from private field"),t?t.call(i):e.get(i)),St=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Np=(i,e,t,r)=>(Lc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ze=(i,e,t)=>(Lc(i,e,"access private method"),t),no,Kn,ll,Qi,oo,wc,$p,rl,Sc,ol,kc,Hp,al,sl,nl;function sE(i){return`
2078
2078
  ${le.getTemplateHTML(i)}
2079
2079
  <style>
2080
2080
  :host {
@@ -2088,7 +2088,7 @@ bp-player[has-error] {
2088
2088
  overflow: hidden;
2089
2089
  }
2090
2090
  </style>
2091
- `}var qn=class extends le{constructor(){super(),St(this,Kn),St(this,Qi),St(this,wc),St(this,rl),St(this,kc),St(this,no,!1),St(this,ol,e=>{let t=e.target,r=(t==null?void 0:t.nodeName)==="VIDEO",o=ze(this,rl,Sc).call(this,t);(r||o)&&(kt(this,no)?ze(this,Qi,oo).call(this):ze(this,kc,Bp).call(this,e))}),St(this,al,e=>{let t=e.target,r=this.contains(t),o=e.button===2,n=(t==null?void 0:t.nodeName)==="VIDEO",a=ze(this,rl,Sc).call(this,t);r||o&&(n||a)||ze(this,Qi,oo).call(this)}),St(this,sl,e=>{e.key==="Escape"&&ze(this,Qi,oo).call(this)}),St(this,nl,e=>{var t,r;let o=e.target;if((t=o.matches)!=null&&t.call(o,'button[invoke="copy"]')){let n=(r=o.closest("media-context-menu-item"))==null?void 0:r.querySelector('input[slot="copy"]');n&&navigator.clipboard.writeText(n.value)}ze(this,Qi,oo).call(this)}),this.setAttribute("noautohide",""),ze(this,Kn,ll).call(this)}connectedCallback(){super.connectedCallback(),X(this).addEventListener("contextmenu",kt(this,ol)),this.addEventListener("click",kt(this,nl))}disconnectedCallback(){super.disconnectedCallback(),X(this).removeEventListener("contextmenu",kt(this,ol)),this.removeEventListener("click",kt(this,nl)),document.removeEventListener("mousedown",kt(this,al)),document.removeEventListener("keydown",kt(this,sl))}};no=new WeakMap;Kn=new WeakSet;ll=function(){this.hidden=!kt(this,no)};Qi=new WeakSet;oo=function(){$p(this,no,!1),ze(this,Kn,ll).call(this)};wc=new WeakSet;Hp=function(){document.querySelectorAll("media-context-menu").forEach(e=>{var t;e!==this&&ze(t=e,Qi,oo).call(t)})};rl=new WeakSet;Sc=function(i){return i?i.hasAttribute("slot")&&i.getAttribute("slot")==="media"?!0:i.nodeName.includes("-")&&i.tagName.includes("-")?i.hasAttribute("src")||i.hasAttribute("poster")||i.hasAttribute("preload")||i.hasAttribute("playsinline"):!1:!1};ol=new WeakMap;kc=new WeakSet;Bp=function(i){i.preventDefault(),ze(this,wc,Hp).call(this),$p(this,no,!0),this.style.position="fixed",this.style.left=`${i.clientX}px`,this.style.top=`${i.clientY}px`,ze(this,Kn,ll).call(this),document.addEventListener("mousedown",kt(this,al),{once:!0}),document.addEventListener("keydown",kt(this,sl),{once:!0})};al=new WeakMap;sl=new WeakMap;nl=new WeakMap;qn.getTemplateHTML=dE;d.customElements.get("media-context-menu")||d.customElements.define("media-context-menu",qn);function cE(i){return`
2091
+ `}var qn=class extends le{constructor(){super(),St(this,Kn),St(this,Qi),St(this,wc),St(this,rl),St(this,kc),St(this,no,!1),St(this,ol,e=>{let t=e.target,r=(t==null?void 0:t.nodeName)==="VIDEO",o=ze(this,rl,Sc).call(this,t);(r||o)&&(kt(this,no)?ze(this,Qi,oo).call(this):ze(this,kc,Hp).call(this,e))}),St(this,al,e=>{let t=e.target,r=this.contains(t),o=e.button===2,n=(t==null?void 0:t.nodeName)==="VIDEO",a=ze(this,rl,Sc).call(this,t);r||o&&(n||a)||ze(this,Qi,oo).call(this)}),St(this,sl,e=>{e.key==="Escape"&&ze(this,Qi,oo).call(this)}),St(this,nl,e=>{var t,r;let o=e.target;if((t=o.matches)!=null&&t.call(o,'button[invoke="copy"]')){let n=(r=o.closest("media-context-menu-item"))==null?void 0:r.querySelector('input[slot="copy"]');n&&navigator.clipboard.writeText(n.value)}ze(this,Qi,oo).call(this)}),this.setAttribute("noautohide",""),ze(this,Kn,ll).call(this)}connectedCallback(){super.connectedCallback(),X(this).addEventListener("contextmenu",kt(this,ol)),this.addEventListener("click",kt(this,nl))}disconnectedCallback(){super.disconnectedCallback(),X(this).removeEventListener("contextmenu",kt(this,ol)),this.removeEventListener("click",kt(this,nl)),document.removeEventListener("mousedown",kt(this,al)),document.removeEventListener("keydown",kt(this,sl))}};no=new WeakMap;Kn=new WeakSet;ll=function(){this.hidden=!kt(this,no)};Qi=new WeakSet;oo=function(){Np(this,no,!1),ze(this,Kn,ll).call(this)};wc=new WeakSet;$p=function(){document.querySelectorAll("media-context-menu").forEach(e=>{var t;e!==this&&ze(t=e,Qi,oo).call(t)})};rl=new WeakSet;Sc=function(i){return i?i.hasAttribute("slot")&&i.getAttribute("slot")==="media"?!0:i.nodeName.includes("-")&&i.tagName.includes("-")?i.hasAttribute("src")||i.hasAttribute("poster")||i.hasAttribute("preload")||i.hasAttribute("playsinline"):!1:!1};ol=new WeakMap;kc=new WeakSet;Hp=function(i){i.preventDefault(),ze(this,wc,$p).call(this),Np(this,no,!0),this.style.position="fixed",this.style.left=`${i.clientX}px`,this.style.top=`${i.clientY}px`,ze(this,Kn,ll).call(this),document.addEventListener("mousedown",kt(this,al),{once:!0}),document.addEventListener("keydown",kt(this,sl),{once:!0})};al=new WeakMap;sl=new WeakMap;nl=new WeakMap;qn.getTemplateHTML=sE;d.customElements.get("media-context-menu")||d.customElements.define("media-context-menu",qn);function lE(i){return`
2092
2092
  ${Ve.getTemplateHTML.call(this,i)}
2093
2093
  <style>
2094
2094
  ::slotted(*) {
@@ -2101,16 +2101,16 @@ bp-player[has-error] {
2101
2101
  min-height: var(--media-control-height, 24px);
2102
2102
  }
2103
2103
  </style>
2104
- `}var ao=class extends Ve{};ao.shadowRootOptions={mode:"open"};ao.getTemplateHTML=cE;d.customElements.get("media-context-menu-item")||d.customElements.define("media-context-menu-item",ao);var uE=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2104
+ `}var ao=class extends Ve{};ao.shadowRootOptions={mode:"open"};ao.getTemplateHTML=lE;d.customElements.get("media-context-menu-item")||d.customElements.define("media-context-menu-item",ao);var dE=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2105
2105
  <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"/>
2106
- </svg>`,hE=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2106
+ </svg>`,cE=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2107
2107
  <path d="M21 6H3c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 10H3V8h18v8zM9 10v4c0 .55-.45 1-1 1H5v-2h2v-2H5v-2h3c.55 0 1 .45 1 1zm4 4h2v1h-4v-6h2v2h2v1h-2v2zm6-3v1h-2v3h-2v-6h4v2h-2z"/>
2108
- </svg>`,pE=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2108
+ </svg>`,uE=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2109
2109
  <path d="M24 8.98C20.93 5.9 16.69 4 12 4S3.07 5.9 0 8.98L12 21 24 8.98zM2.92 9.07C5.51 7.08 8.67 6 12 6s6.49 1.08 9.08 3.07l-1.43 1.43C17.5 8.94 14.86 8 12 8s-5.5.94-7.65 2.51L2.92 9.07zM12 18l-6.36-6.36C7.34 10.27 9.58 9.5 12 9.5s4.66.77 6.36 2.14L12 18z"/>
2110
2110
  <line x1="2" y1="2" x2="22" y2="22" stroke="currentColor" stroke-width="2"/>
2111
- </svg>`,mE=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2111
+ </svg>`,hE=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2112
2112
  <path d="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z"/>
2113
- </svg>`;function vE(i){switch(i){case"offline":return hE;case"network":return pE;case"security":return mE;default:return uE}}function fE(i){switch(i){case"offline":return"Stream Unavailable";case"network":return"Connection Error";case"security":return"Access Denied";case"autoplay":return"Playback Blocked";case"media":return"Playback Error";case"setup":return"Configuration Error";default:return"An error occurred"}}var oi=class extends Le{constructor(){super(...arguments);this.error=null;this.showCode=!1}render(){if(!this.error)return null;let t=this.error.category,r=vE(t),o=fE(t);return Ne`
2113
+ </svg>`;function pE(i){switch(i){case"offline":return cE;case"network":return uE;case"security":return hE;default:return dE}}function mE(i){switch(i){case"offline":return"Stream Unavailable";case"network":return"Connection Error";case"security":return"Access Denied";case"autoplay":return"Playback Blocked";case"media":return"Playback Error";case"setup":return"Configuration Error";default:return"An error occurred"}}var oi=class extends Le{constructor(){super(...arguments);this.error=null;this.showCode=!1}render(){if(!this.error)return null;let t=this.error.category,r=pE(t),o=mE(t);return Ne`
2114
2114
  <div part="icon">
2115
2115
  <slot name="icon">${this.renderIcon(r)}</slot>
2116
2116
  </div>
@@ -2175,19 +2175,19 @@ bp-player[has-error] {
2175
2175
  opacity: var(--bp-error-code-opacity, 0.5);
2176
2176
  font-family: var(--bp-error-code-font-family, monospace);
2177
2177
  }
2178
- `,x([V({type:Object})],oi.prototype,"error",2),x([V({type:Boolean})],oi.prototype,"showCode",2),oi=x([Kt("bp-error-display")],oi);var gE=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
2178
+ `,x([V({type:Object})],oi.prototype,"error",2),x([V({type:Boolean})],oi.prototype,"showCode",2),oi=x([Kt("bp-error-display")],oi);var vE=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
2179
2179
  <circle cx="12" cy="12" r="10" stroke-opacity="0.25"/>
2180
2180
  <path d="M12 2a10 10 0 0 1 10 10" stroke-linecap="round">
2181
2181
  <animateTransform attributeName="transform" type="rotate" from="0 12 12" to="360 12 12" dur="1s" repeatCount="indefinite"/>
2182
2182
  </path>
2183
- </svg>`,EE=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2183
+ </svg>`,fE=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2184
2184
  <path d="M21 6H3c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 10H3V8h18v8z"/>
2185
2185
  <circle cx="12" cy="12" r="3" fill="currentColor"/>
2186
- </svg>`,bE=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2186
+ </svg>`,gE=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2187
2187
  <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/>
2188
- </svg>`,_E=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2188
+ </svg>`,EE=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2189
2189
  <path d="M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z"/>
2190
- </svg>`,Nt=class extends Le{constructor(){super(...arguments);this.type="none";this.live=!1;this.buttonMode=!1}getIcon(){switch(this.type){case"loading":return gE;case"offline":return EE;case"ended":return this.live?bE:_E;default:return""}}getDefaultMessage(){switch(this.type){case"loading":return"Loading...";case"offline":return"The live stream hasn't started yet";case"ended":return this.live?"Stream has ended":"Replay";default:return""}}render(){if(this.type==="none")return null;let t=this.getIcon(),r=this.getDefaultMessage();return Ne`
2190
+ </svg>`,Nt=class extends Le{constructor(){super(...arguments);this.type="none";this.live=!1;this.buttonMode=!1}getIcon(){switch(this.type){case"loading":return vE;case"offline":return fE;case"ended":return this.live?gE:EE;default:return""}}getDefaultMessage(){switch(this.type){case"loading":return"Loading...";case"offline":return"The live stream hasn't started yet";case"ended":return this.live?"Stream has ended":"Replay";default:return""}}render(){if(this.type==="none")return null;let t=this.getIcon(),r=this.getDefaultMessage();return Ne`
2191
2191
  <div part="icon">
2192
2192
  <slot name="icon">${this.renderIcon(t)}</slot>
2193
2193
  </div>
@@ -2268,7 +2268,7 @@ bp-player[has-error] {
2268
2268
  :host([button-mode]) [part="submessage"] {
2269
2269
  display: none;
2270
2270
  }
2271
- `,x([V({type:String,reflect:!0})],Nt.prototype,"type",2),x([V({type:Boolean,reflect:!0})],Nt.prototype,"live",2),x([V({type:Boolean,reflect:!0,attribute:"button-mode"})],Nt.prototype,"buttonMode",2),Nt=x([Kt("bp-overlay")],Nt);var Vp=`/**
2271
+ `,x([V({type:String,reflect:!0})],Nt.prototype,"type",2),x([V({type:Boolean,reflect:!0})],Nt.prototype,"live",2),x([V({type:Boolean,reflect:!0,attribute:"button-mode"})],Nt.prototype,"buttonMode",2),Nt=x([Kt("bp-overlay")],Nt);var Bp=`/**
2272
2272
  * BP Default UI Styles
2273
2273
  *
2274
2274
  * All values use CSS custom properties for easy theming.
@@ -2661,7 +2661,7 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
2661
2661
  outline: 2px solid rgba(0, 255, 0, 1) !important;
2662
2662
  background: rgba(0, 255, 0, 0.3) !important;
2663
2663
  }
2664
- `;var Wp={fromAttribute:i=>{if(i)try{return JSON.parse(i)}catch{console.warn("[bp-default-ui] Failed to parse JSON attribute:",i);return}},toAttribute:i=>i==null?null:JSON.stringify(i)},Fp=!1;function TE(){if(Fp)return;Bo();let i=document.createElement("style");i.id="bp-default-ui-styles",i.textContent=Vp,document.head.appendChild(i),Fp=!0}var Z=class extends Le{constructor(){super(...arguments);this.autoplay=!1;this.muted=!1;this.loop=!1;this.scaling="letterbox";this.debug=!1;this.autohide=2;this.hotkeys=!0;this.mobile=!1;this.live=!1;this.fluid=!1;this._player=null;this._providerType=null;this._error=null;this._overlayType="none";this._connectionState="idle";this._hasError=!1;this._hasCustomTopChrome=!1;this._hasCustomCenteredChrome=!1;this._hasCustomBottomChrome=!1;this._cleanupListeners=[]}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),TE(),this.detectMobile(),this._detectCustomChrome()}disconnectedCallback(){super.disconnectedCallback(),this._cleanupListeners.forEach(t=>t()),this._cleanupListeners=[]}get player(){return this._player}get mediaController(){return this.querySelector("media-controller")}get bpLive(){var t;return((t=this._player)==null?void 0:t.bpLive)??null}_detectCustomChrome(){this._hasCustomTopChrome=this.querySelector(':scope > [slot="top-chrome"]')!==null,this._hasCustomCenteredChrome=this.querySelector(':scope > [slot="centered-chrome"]')!==null,this._hasCustomBottomChrome=this.querySelector(':scope > [slot="bottom-chrome"]')!==null}detectMobile(){let t=/Android|iPhone|iPad|iPod|webOS|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);this.mobile=t}firstUpdated(t){super.firstUpdated(t),this.setupPlayer(),this._moveSlottedContent(),this.fluid&&this._setInitialAspectRatioFromSources()}updated(t){super.updated(t),this._moveSlottedContent(),t.has("debug")&&this.toggleAttribute("debug-hitboxes",this.debug),t.has("source")&&this.fluid&&this._setInitialAspectRatioFromSources()}_setInitialAspectRatioFromSources(){var r;let t=(r=this.source)==null?void 0:r.sources;if(t){for(let o of t)if(ur(o)&&o.preferredOrientation){let n=o.preferredOrientation==="portrait"?"9 / 16":"16 / 9";this.style.setProperty("--bp-aspect-ratio",n),this.debug&&console.log("[BPDefaultUI] Set initial --bp-aspect-ratio from preferredOrientation:",n);break}}}_moveSlottedContent(){let t=this.querySelector("media-controller");if(!t)return;let r=[{from:"top-chrome",to:"top-chrome"},{from:"centered-chrome",to:"centered-chrome"},{from:"bottom-chrome",to:null}];for(let{from:o,to:n}of r)this.querySelectorAll(`:scope > [slot="${o}"]`).forEach(l=>{l.parentElement!==t&&(n?l.setAttribute("slot",n):l.removeAttribute("slot"),t.appendChild(l))})}setupPlayer(){let t=this.querySelector("bp-player");t&&t.addEventListener("ready",r=>{this._player=r.detail,this._providerType=t.providerType,this.live=this._player.state.streamType==="live",this.setupPlayerListeners(),this.dispatchEvent(new CustomEvent("ready",{detail:this._player,bubbles:!0,composed:!0})),this.requestUpdate()})}setupPlayerListeners(){if(!this._player)return;let t=()=>{var v;let h=((v=this._player)==null?void 0:v.state.error)??null;this._error=h,this._hasError=h!==null&&h.category!=="offline",(h==null?void 0:h.category)==="offline"&&(this._overlayType="offline")},r=()=>{var v;let h=(v=this._player)==null?void 0:v.state;h&&(this._connectionState=h.connectionState,this.live=h.streamType==="live",this.setAttribute("content-type",h.contentType),this.setAttribute("stream-type",h.streamType),Ce(this,"paused",h.paused),Ce(this,"ended",h.ended),Ce(this,"waiting",h.waiting),Ce(this,"has-error",this._hasError),h.connectionState==="connecting"?(this._overlayType="loading",this._error=null,this._hasError=!1):h.connectionState==="connected"&&h.playing?(this._overlayType="none",this._error=null,this._hasError=!1):h.ended&&(this._overlayType="ended"))},o=()=>{this._error=null,this._overlayType="none",this._hasError=!1},n=()=>{this._overlayType="loading"},a=()=>{this._overlayType="ended"},l=h=>{if(this.debug&&console.log("[BPDefaultUI] updateAspectRatio called",{fluid:this.fluid,...h}),this.fluid&&h.videoWidth>0&&h.videoHeight>0){let v=`${h.videoWidth} / ${h.videoHeight}`;this.style.setProperty("--bp-aspect-ratio",v),this.debug&&console.log("[BPDefaultUI] Set --bp-aspect-ratio:",v)}};this._player.addEventListener("error",t),this._player.addEventListener("statechange",r),this._player.addEventListener("playing",o),this._player.addEventListener("waiting",n),this._player.addEventListener("ended",a),this._player.addEventListener("resize",l),this._player.addEventListener("loadedmetadata",l);let{videoWidth:c,videoHeight:p}=this._player.state;this.debug&&console.log("[BPDefaultUI] Initial dimensions check",{videoWidth:c,videoHeight:p,fluid:this.fluid}),c>0&&p>0&&l({videoWidth:c,videoHeight:p}),this._cleanupListeners.push(()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("error",t)},()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("statechange",r)},()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("playing",o)},()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("waiting",n)},()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("ended",a)},()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("resize",l)},()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("loadedmetadata",l)})}renderDefaultControls(){return this._providerType==="nano"||this._providerType==="livekit"?Ne`
2664
+ `;var Vp=!1;function _E(){if(Vp)return;Bo();let i=document.createElement("style");i.id="bp-default-ui-styles",i.textContent=Bp,document.head.appendChild(i),Vp=!0}var Z=class extends Le{constructor(){super(...arguments);this.autoplay=!1;this.muted=!1;this.loop=!1;this.scaling="letterbox";this.debug=!1;this.autohide=2;this.hotkeys=!0;this.mobile=!1;this.live=!1;this.fluid=!1;this._player=null;this._providerType=null;this._error=null;this._overlayType="none";this._connectionState="idle";this._hasError=!1;this._hasCustomTopChrome=!1;this._hasCustomCenteredChrome=!1;this._hasCustomBottomChrome=!1;this._cleanupListeners=[]}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),_E(),this.detectMobile(),this._detectCustomChrome()}disconnectedCallback(){super.disconnectedCallback(),this._cleanupListeners.forEach(t=>t()),this._cleanupListeners=[]}get player(){return this._player}get mediaController(){return this.querySelector("media-controller")}get bpLive(){var t;return((t=this._player)==null?void 0:t.bpLive)??null}_detectCustomChrome(){this._hasCustomTopChrome=this.querySelector(':scope > [slot="top-chrome"]')!==null,this._hasCustomCenteredChrome=this.querySelector(':scope > [slot="centered-chrome"]')!==null,this._hasCustomBottomChrome=this.querySelector(':scope > [slot="bottom-chrome"]')!==null}detectMobile(){let t=/Android|iPhone|iPad|iPod|webOS|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);this.mobile=t}firstUpdated(t){super.firstUpdated(t),this.setupPlayer(),this._moveSlottedContent(),this.fluid&&this._setInitialAspectRatioFromSources()}updated(t){super.updated(t),this._moveSlottedContent(),t.has("debug")&&this.toggleAttribute("debug-hitboxes",this.debug),t.has("sources")&&this.fluid&&this._setInitialAspectRatioFromSources()}_setInitialAspectRatioFromSources(){if(this.sources){for(let t of this.sources)if(ur(t)&&t.preferredOrientation){let r=t.preferredOrientation==="portrait"?"9 / 16":"16 / 9";this.style.setProperty("--bp-aspect-ratio",r),this.debug&&console.log("[BPDefaultUI] Set initial --bp-aspect-ratio from preferredOrientation:",r);break}}}_moveSlottedContent(){let t=this.querySelector("media-controller");if(!t)return;let r=[{from:"top-chrome",to:"top-chrome"},{from:"centered-chrome",to:"centered-chrome"},{from:"bottom-chrome",to:null}];for(let{from:o,to:n}of r)this.querySelectorAll(`:scope > [slot="${o}"]`).forEach(l=>{l.parentElement!==t&&(n?l.setAttribute("slot",n):l.removeAttribute("slot"),t.appendChild(l))})}setupPlayer(){let t=this.querySelector("bp-player");t&&t.addEventListener("ready",r=>{this._player=r.detail,this._providerType=t.providerType,this.live=this._player.state.streamType==="live",this.setupPlayerListeners(),this.dispatchEvent(new CustomEvent("ready",{detail:this._player,bubbles:!0,composed:!0})),this.requestUpdate()})}setupPlayerListeners(){if(!this._player)return;let t=()=>{var v;let h=((v=this._player)==null?void 0:v.state.error)??null;this._error=h,this._hasError=h!==null&&h.category!=="offline",(h==null?void 0:h.category)==="offline"&&(this._overlayType="offline")},r=()=>{var v;let h=(v=this._player)==null?void 0:v.state;h&&(this._connectionState=h.connectionState,this.live=h.streamType==="live",this.setAttribute("content-type",h.contentType),this.setAttribute("stream-type",h.streamType),Ie(this,"paused",h.paused),Ie(this,"ended",h.ended),Ie(this,"waiting",h.waiting),Ie(this,"has-error",this._hasError),h.connectionState==="connecting"?(this._overlayType="loading",this._error=null,this._hasError=!1):h.connectionState==="connected"&&h.playing?(this._overlayType="none",this._error=null,this._hasError=!1):h.ended&&(this._overlayType="ended"))},o=()=>{this._error=null,this._overlayType="none",this._hasError=!1},n=()=>{this._overlayType="loading"},a=()=>{this._overlayType="ended"},l=h=>{if(this.debug&&console.log("[BPDefaultUI] updateAspectRatio called",{fluid:this.fluid,...h}),this.fluid&&h.videoWidth>0&&h.videoHeight>0){let v=`${h.videoWidth} / ${h.videoHeight}`;this.style.setProperty("--bp-aspect-ratio",v),this.debug&&console.log("[BPDefaultUI] Set --bp-aspect-ratio:",v)}};this._player.addEventListener("error",t),this._player.addEventListener("statechange",r),this._player.addEventListener("playing",o),this._player.addEventListener("waiting",n),this._player.addEventListener("ended",a),this._player.addEventListener("resize",l),this._player.addEventListener("loadedmetadata",l);let{videoWidth:c,videoHeight:p}=this._player.state;this.debug&&console.log("[BPDefaultUI] Initial dimensions check",{videoWidth:c,videoHeight:p,fluid:this.fluid}),c>0&&p>0&&l({videoWidth:c,videoHeight:p}),this._cleanupListeners.push(()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("error",t)},()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("statechange",r)},()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("playing",o)},()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("waiting",n)},()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("ended",a)},()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("resize",l)},()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("loadedmetadata",l)})}renderDefaultControls(){return this._providerType==="nano"||this._providerType==="livekit"?Ne`
2665
2665
  <media-control-bar>
2666
2666
  <media-play-button notooltip clip-hidden></media-play-button>
2667
2667
  <media-live-button notooltip vod-hidden clip-hidden></media-live-button>
@@ -2691,7 +2691,7 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
2691
2691
  <media-controller autohide="${this.autohide}" ?hotkeys="${this.hotkeys}">
2692
2692
  <bp-player
2693
2693
  slot="media"
2694
- .source="${this.source}"
2694
+ .sources="${this.sources}"
2695
2695
  ?autoplay="${this.autoplay}"
2696
2696
  ?muted="${this.muted}"
2697
2697
  ?loop="${this.loop}"
@@ -2727,7 +2727,7 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
2727
2727
  <!-- Default controls (only if no custom bottom-chrome) -->
2728
2728
  ${this._hasCustomBottomChrome?ae:this.renderDefaultControls()}
2729
2729
  </media-controller>
2730
- `}};x([V({converter:Wp})],Z.prototype,"source",2),x([V({type:Boolean})],Z.prototype,"autoplay",2),x([V({type:Boolean})],Z.prototype,"muted",2),x([V({type:Boolean})],Z.prototype,"loop",2),x([V({type:String})],Z.prototype,"poster",2),x([V({type:String})],Z.prototype,"scaling",2),x([V({type:String,attribute:"aspect-ratio"})],Z.prototype,"aspectRatio",2),x([V({converter:Wp})],Z.prototype,"config",2),x([V({type:Boolean})],Z.prototype,"debug",2),x([V({type:Number})],Z.prototype,"autohide",2),x([V({type:Boolean})],Z.prototype,"hotkeys",2),x([V({type:Boolean,reflect:!0})],Z.prototype,"mobile",2),x([V({type:Boolean,reflect:!0})],Z.prototype,"live",2),x([V({type:Boolean,reflect:!0})],Z.prototype,"fluid",2),x([we()],Z.prototype,"_player",2),x([we()],Z.prototype,"_providerType",2),x([we()],Z.prototype,"_error",2),x([we()],Z.prototype,"_overlayType",2),x([we()],Z.prototype,"_connectionState",2),x([we()],Z.prototype,"_hasError",2),x([we()],Z.prototype,"_hasCustomTopChrome",2),x([we()],Z.prototype,"_hasCustomCenteredChrome",2),x([we()],Z.prototype,"_hasCustomBottomChrome",2),Z=x([Kt("bp-default-ui")],Z);var AE=["abort","canplay","canplaythrough","durationchange","emptied","encrypted","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting","waitingforkey","resize","enterpictureinpicture","leavepictureinpicture","webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"],Kp=["autopictureinpicture","disablepictureinpicture","disableremoteplayback","autoplay","controls","controlslist","crossorigin","loop","muted","playsinline","poster","preload","src"];function SE(i){return`
2730
+ `}};x([V({type:Array})],Z.prototype,"sources",2),x([V({type:Boolean})],Z.prototype,"autoplay",2),x([V({type:Boolean})],Z.prototype,"muted",2),x([V({type:Boolean})],Z.prototype,"loop",2),x([V({type:String})],Z.prototype,"poster",2),x([V({type:String})],Z.prototype,"scaling",2),x([V({type:String,attribute:"aspect-ratio"})],Z.prototype,"aspectRatio",2),x([V({type:Object})],Z.prototype,"config",2),x([V({type:Boolean})],Z.prototype,"debug",2),x([V({type:Number})],Z.prototype,"autohide",2),x([V({type:Boolean})],Z.prototype,"hotkeys",2),x([V({type:Boolean,reflect:!0})],Z.prototype,"mobile",2),x([V({type:Boolean,reflect:!0})],Z.prototype,"live",2),x([V({type:Boolean,reflect:!0})],Z.prototype,"fluid",2),x([we()],Z.prototype,"_player",2),x([we()],Z.prototype,"_providerType",2),x([we()],Z.prototype,"_error",2),x([we()],Z.prototype,"_overlayType",2),x([we()],Z.prototype,"_connectionState",2),x([we()],Z.prototype,"_hasError",2),x([we()],Z.prototype,"_hasCustomTopChrome",2),x([we()],Z.prototype,"_hasCustomCenteredChrome",2),x([we()],Z.prototype,"_hasCustomBottomChrome",2),Z=x([Kt("bp-default-ui")],Z);var yE=["abort","canplay","canplaythrough","durationchange","emptied","encrypted","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting","waitingforkey","resize","enterpictureinpicture","leavepictureinpicture","webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"],Wp=["autopictureinpicture","disablepictureinpicture","disableremoteplayback","autoplay","controls","controlslist","crossorigin","loop","muted","playsinline","poster","preload","src"];function TE(i){return`
2731
2731
  <style>
2732
2732
  :host {
2733
2733
  display: inline-flex;
@@ -2741,10 +2741,10 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
2741
2741
  }
2742
2742
  </style>
2743
2743
  <slot name="media">
2744
- <audio${Zp(i)}></audio>
2744
+ <audio${Yp(i)}></audio>
2745
2745
  </slot>
2746
2746
  <slot></slot>
2747
- `}function kE(i){return`
2747
+ `}function AE(i){return`
2748
2748
  <style>
2749
2749
  :host {
2750
2750
  display: inline-block;
@@ -2766,25 +2766,25 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
2766
2766
  }
2767
2767
  </style>
2768
2768
  <slot name="media">
2769
- <video${Zp(i)}></video>
2769
+ <video${Yp(i)}></video>
2770
2770
  </slot>
2771
2771
  <slot></slot>
2772
- `}function Qp(i,{tag:e,is:t}){var n,a,l,c,p,qp,v,g,m,A,f,Zi,Cc,Gp,Ic,zp,Yp;let r=(a=(n=globalThis.document)==null?void 0:n.createElement)==null?void 0:a.call(n,e,{is:t}),o=r?LE(r):[];return l=class extends i{constructor(){super(...arguments);S(this,f);S(this,v,!1);S(this,g,null);S(this,m,new Map);S(this,A);H(this,"get");H(this,"set");H(this,"call")}static get observedAttributes(){var K,ne;return U(K=l,p,qp).call(K),[...((ne=r==null?void 0:r.constructor)==null?void 0:ne.observedAttributes)??[],...Kp]}get nativeEl(){var k;return U(this,f,Zi).call(this),u(this,g)??this.querySelector(":scope > [slot=media]")??this.querySelector(e)??((k=this.shadowRoot)==null?void 0:k.querySelector(e))??null}set nativeEl(k){_(this,g,k)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(k){this.toggleAttribute("muted",k)}get src(){return this.getAttribute("src")}set src(k){this.setAttribute("src",`${k}`)}get preload(){var k;return this.getAttribute("preload")??((k=this.nativeEl)==null?void 0:k.preload)}set preload(k){this.setAttribute("preload",`${k}`)}init(){if(!this.shadowRoot){this.attachShadow({mode:"open"});let k=wE(this.attributes);t&&(k.is=t),e&&(k.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(k)}this.nativeEl.muted=this.hasAttribute("muted");for(let k of o)U(this,f,zp).call(this,k);_(this,A,new MutationObserver(U(this,f,Gp).bind(this))),this.shadowRoot.addEventListener("slotchange",()=>U(this,f,Cc).call(this)),U(this,f,Cc).call(this);for(let k of this.constructor.Events)this.shadowRoot.addEventListener(k,this,!0)}handleEvent(k){k.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(k.type,{detail:k.detail}))}attributeChangedCallback(k,K,ne){U(this,f,Zi).call(this),U(this,f,Yp).call(this,k,K,ne)}connectedCallback(){U(this,f,Zi).call(this)}},c=new WeakMap,p=new WeakSet,qp=function(){if(u(this,c))return;_(this,c,!0);let k=new Set(this.observedAttributes);k.delete("muted");for(let K of o)if(!(K in this.prototype))if(typeof r[K]=="function")this.prototype[K]=function(...ne){return U(this,f,Zi).call(this),(()=>{var pe;if(this.call)return this.call(K,...ne);let G=(pe=this.nativeEl)==null?void 0:pe[K];return G==null?void 0:G.apply(this.nativeEl,ne)})()};else{let ne={get(){var G,pe;U(this,f,Zi).call(this);let te=K.toLowerCase();if(k.has(te)){let Ct=this.getAttribute(te);return Ct===null?!1:Ct===""?!0:Ct}return((G=this.get)==null?void 0:G.call(this,K))??((pe=this.nativeEl)==null?void 0:pe[K])}};K!==K.toUpperCase()&&(ne.set=function(te){U(this,f,Zi).call(this);let G=K.toLowerCase();if(k.has(G)){te===!0||te===!1||te==null?this.toggleAttribute(G,!!te):this.setAttribute(G,te);return}if(this.set){this.set(K,te);return}this.nativeEl&&(this.nativeEl[K]=te)}),Object.defineProperty(this.prototype,K,ne)}},v=new WeakMap,g=new WeakMap,m=new WeakMap,A=new WeakMap,f=new WeakSet,Zi=function(){u(this,v)||(_(this,v,!0),this.init())},Cc=function(){var te;let k=new Map(u(this,m)),K=(te=this.shadowRoot)==null?void 0:te.querySelector("slot:not([name])");(K==null?void 0:K.assignedElements({flatten:!0}).filter(G=>["track","source"].includes(G.localName))).forEach(G=>{var Ct,wo;k.delete(G);let pe=u(this,m).get(G);pe||(pe=G.cloneNode(),u(this,m).set(G,pe),(Ct=u(this,A))==null||Ct.observe(G,{attributes:!0})),(wo=this.nativeEl)==null||wo.append(pe),U(this,f,Ic).call(this,pe)}),k.forEach((G,pe)=>{G.remove(),u(this,m).delete(pe)})},Gp=function(k){for(let K of k)if(K.type==="attributes"){let{target:ne,attributeName:te}=K,G=u(this,m).get(ne);G&&te&&(G.setAttribute(te,ne.getAttribute(te)??""),U(this,f,Ic).call(this,G))}},Ic=function(k){k&&k.localName==="track"&&k.default&&(k.kind==="chapters"||k.kind==="metadata")&&k.track.mode==="disabled"&&(k.track.mode="hidden")},zp=function(k){if(Object.prototype.hasOwnProperty.call(this,k)){let K=this[k];delete this[k],this[k]=K}},Yp=function(k,K,ne){var te,G,pe;["id","class"].includes(k)||!l.observedAttributes.includes(k)&&this.constructor.observedAttributes.includes(k)||(ne===null?(te=this.nativeEl)==null||te.removeAttribute(k):((G=this.nativeEl)==null?void 0:G.getAttribute(k))!==ne&&((pe=this.nativeEl)==null||pe.setAttribute(k,ne)))},S(l,p),H(l,"getTemplateHTML",e.endsWith("audio")?SE:kE),H(l,"shadowRootOptions",{mode:"open"}),H(l,"Events",AE),S(l,c,!1),l}function LE(i){let e=[];for(let t=Object.getPrototypeOf(i);t&&t!==HTMLElement.prototype;t=Object.getPrototypeOf(t)){let r=Object.getOwnPropertyNames(t);e.push(...r)}return e}function Zp(i){let e="";for(let t in i){if(!Kp.includes(t))continue;let r=i[t];r===""?e+=` ${t}`:e+=` ${t}="${r}"`}return e}function wE(i){let e={};for(let t of i)e[t.name]=t.value;return e}var De=Qp(globalThis.HTMLElement??class{},{tag:"video"}),XL=Qp(globalThis.HTMLElement??class{},{tag:"audio"});var $t=class extends Event{constructor(t,r){super(t);H(this,"track");this.track=r.track}};var Mc=new WeakMap;function T(i){return Mc.get(i)??CE(i,{})}function CE(i,e){let t=Mc.get(i);return t||Mc.set(i,t={}),Object.assign(t,e)}function dl(i,e){let t=i.videoTracks;T(e).media=i,T(e).renditionSet||(T(e).renditionSet=new Set);let r=T(t).trackSet;r.add(e);let o=r.size-1;o in Ji.prototype||Object.defineProperty(Ji.prototype,o,{get(){return[...T(this).trackSet][o]}}),queueMicrotask(()=>{t.dispatchEvent(new $t("addtrack",{track:e}))})}function cl(i){var r;let e=(r=T(i).media)==null?void 0:r.videoTracks;if(!e)return;T(e).trackSet.delete(i),queueMicrotask(()=>{e.dispatchEvent(new $t("removetrack",{track:i}))})}function Xp(i){let e=T(i).media.videoTracks??[],t=!1;for(let r of e)r!==i&&(r.selected=!1,t=!0);if(t){if(T(e).changeRequested)return;T(e).changeRequested=!0,queueMicrotask(()=>{delete T(e).changeRequested,e.dispatchEvent(new Event("change"))})}}var ni,ai,si,Xi,Gn,Ji=class extends EventTarget{constructor(){super();S(this,Xi);S(this,ni);S(this,ai);S(this,si);T(this).trackSet=new Set}[Symbol.iterator](){return u(this,Xi,Gn).values()}get length(){return u(this,Xi,Gn).size}getTrackById(t){return[...u(this,Xi,Gn)].find(r=>r.id===t)??null}get selectedIndex(){return[...u(this,Xi,Gn)].findIndex(t=>t.selected)}get onaddtrack(){return u(this,ni)}set onaddtrack(t){u(this,ni)&&(this.removeEventListener("addtrack",u(this,ni)),_(this,ni,void 0)),typeof t=="function"&&(_(this,ni,t),this.addEventListener("addtrack",t))}get onremovetrack(){return u(this,ai)}set onremovetrack(t){u(this,ai)&&(this.removeEventListener("removetrack",u(this,ai)),_(this,ai,void 0)),typeof t=="function"&&(_(this,ai,t),this.addEventListener("removetrack",t))}get onchange(){return u(this,si)}set onchange(t){u(this,si)&&(this.removeEventListener("change",u(this,si)),_(this,si,void 0)),typeof t=="function"&&(_(this,si,t),this.addEventListener("change",t))}};ni=new WeakMap,ai=new WeakMap,si=new WeakMap,Xi=new WeakSet,Gn=function(){return T(this).trackSet};var Ht=class extends Event{constructor(t,r){super(t);H(this,"rendition");this.rendition=r.rendition}};function Jp(i,e){let t=T(i).media.videoRenditions;T(e).media=T(i).media,T(e).track=i;let r=T(i).renditionSet;r.add(e);let o=r.size-1;o in ji.prototype||Object.defineProperty(ji.prototype,o,{get(){return so(this)[o]}}),queueMicrotask(()=>{i.selected&&t.dispatchEvent(new Ht("addrendition",{rendition:e}))})}function jp(i){let e=T(i).media.videoRenditions,t=T(i).track;T(t).renditionSet.delete(i),queueMicrotask(()=>{T(i).track.selected&&e.dispatchEvent(new Ht("removerendition",{rendition:i}))})}function em(i){let e=T(i).media.videoRenditions;!e||T(e).changeRequested||(T(e).changeRequested=!0,queueMicrotask(()=>{delete T(e).changeRequested,T(i).track.selected&&e.dispatchEvent(new Event("change"))}))}function so(i){return[...T(i).media.videoTracks].filter(t=>t.selected).flatMap(t=>[...T(t).renditionSet])}var li,di,ci,ji=class extends EventTarget{constructor(){super(...arguments);S(this,li);S(this,di);S(this,ci)}[Symbol.iterator](){return so(this).values()}get length(){return so(this).length}getRenditionById(t){return so(this).find(r=>`${r.id}`==`${t}`)??null}get selectedIndex(){return so(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[r,o]of so(this).entries())o.selected=r===t}get onaddrendition(){return u(this,li)}set onaddrendition(t){u(this,li)&&(this.removeEventListener("addrendition",u(this,li)),_(this,li,void 0)),typeof t=="function"&&(_(this,li,t),this.addEventListener("addrendition",t))}get onremoverendition(){return u(this,di)}set onremoverendition(t){u(this,di)&&(this.removeEventListener("removerendition",u(this,di)),_(this,di,void 0)),typeof t=="function"&&(_(this,di,t),this.addEventListener("removerendition",t))}get onchange(){return u(this,ci)}set onchange(t){u(this,ci)&&(this.removeEventListener("change",u(this,ci)),_(this,ci,void 0)),typeof t=="function"&&(_(this,ci,t),this.addEventListener("change",t))}};li=new WeakMap,di=new WeakMap,ci=new WeakMap;var lo,zn=class{constructor(){H(this,"src");H(this,"id");H(this,"width");H(this,"height");H(this,"bitrate");H(this,"frameRate");H(this,"codec");S(this,lo,!1)}get selected(){return u(this,lo)}set selected(e){u(this,lo)!==e&&(_(this,lo,e),em(this))}};lo=new WeakMap;var co,uo=class{constructor(){H(this,"id");H(this,"kind");H(this,"label","");H(this,"language","");H(this,"sourceBuffer");S(this,co,!1)}addRendition(e,t,r,o,n,a){let l=new zn;return l.src=e,l.width=t,l.height=r,l.frameRate=a,l.bitrate=n,l.codec=o,Jp(this,l),l}removeRendition(e){jp(e)}get selected(){return u(this,co)}set selected(e){u(this,co)!==e&&(_(this,co,e),e===!0&&Xp(this))}};co=new WeakMap;function tm(i,e){let t=T(i).media.audioRenditions;T(e).media=T(i).media,T(e).track=i;let r=T(i).renditionSet;r.add(e);let o=r.size-1;o in er.prototype||Object.defineProperty(er.prototype,o,{get(){return ho(this)[o]}}),queueMicrotask(()=>{i.enabled&&t.dispatchEvent(new Ht("addrendition",{rendition:e}))})}function im(i){let e=T(i).media.audioRenditions,t=T(i).track;T(t).renditionSet.delete(i),queueMicrotask(()=>{T(i).track.enabled&&e.dispatchEvent(new Ht("removerendition",{rendition:i}))})}function rm(i){let e=T(i).media.audioRenditions;!e||T(e).changeRequested||(T(e).changeRequested=!0,queueMicrotask(()=>{delete T(e).changeRequested,T(i).track.enabled&&e.dispatchEvent(new Event("change"))}))}function ho(i){return[...T(i).media.audioTracks].filter(t=>t.enabled).flatMap(t=>[...T(t).renditionSet])}var ui,hi,pi,er=class extends EventTarget{constructor(){super(...arguments);S(this,ui);S(this,hi);S(this,pi)}[Symbol.iterator](){return ho(this).values()}get length(){return ho(this).length}getRenditionById(t){return ho(this).find(r=>`${r.id}`==`${t}`)??null}get selectedIndex(){return ho(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[r,o]of ho(this).entries())o.selected=r===t}get onaddrendition(){return u(this,ui)}set onaddrendition(t){u(this,ui)&&(this.removeEventListener("addrendition",u(this,ui)),_(this,ui,void 0)),typeof t=="function"&&(_(this,ui,t),this.addEventListener("addrendition",t))}get onremoverendition(){return u(this,hi)}set onremoverendition(t){u(this,hi)&&(this.removeEventListener("removerendition",u(this,hi)),_(this,hi,void 0)),typeof t=="function"&&(_(this,hi,t),this.addEventListener("removerendition",t))}get onchange(){return u(this,pi)}set onchange(t){u(this,pi)&&(this.removeEventListener("change",u(this,pi)),_(this,pi,void 0)),typeof t=="function"&&(_(this,pi,t),this.addEventListener("change",t))}};ui=new WeakMap,hi=new WeakMap,pi=new WeakMap;var po,Yn=class{constructor(){H(this,"src");H(this,"id");H(this,"bitrate");H(this,"codec");S(this,po,!1)}get selected(){return u(this,po)}set selected(e){u(this,po)!==e&&(_(this,po,e),rm(this))}};po=new WeakMap;function hl(i,e){let t=i.audioTracks;T(e).media=i,T(e).renditionSet||(T(e).renditionSet=new Set);let r=T(t).trackSet;r.add(e);let o=r.size-1;o in tr.prototype||Object.defineProperty(tr.prototype,o,{get(){return[...T(this).trackSet][o]}}),queueMicrotask(()=>{t.dispatchEvent(new $t("addtrack",{track:e}))})}function pl(i){var r;let e=(r=T(i).media)==null?void 0:r.audioTracks;if(!e)return;T(e).trackSet.delete(i),queueMicrotask(()=>{e.dispatchEvent(new $t("removetrack",{track:i}))})}function om(i){let e=T(i).media.audioTracks;!e||T(e).changeRequested||(T(e).changeRequested=!0,queueMicrotask(()=>{delete T(e).changeRequested,e.dispatchEvent(new Event("change"))}))}var mi,vi,fi,mo,ul,tr=class extends EventTarget{constructor(){super();S(this,mo);S(this,mi);S(this,vi);S(this,fi);T(this).trackSet=new Set}[Symbol.iterator](){return u(this,mo,ul).values()}get length(){return u(this,mo,ul).size}getTrackById(t){return[...u(this,mo,ul)].find(r=>r.id===t)??null}get onaddtrack(){return u(this,mi)}set onaddtrack(t){u(this,mi)&&(this.removeEventListener("addtrack",u(this,mi)),_(this,mi,void 0)),typeof t=="function"&&(_(this,mi,t),this.addEventListener("addtrack",t))}get onremovetrack(){return u(this,vi)}set onremovetrack(t){u(this,vi)&&(this.removeEventListener("removetrack",u(this,vi)),_(this,vi,void 0)),typeof t=="function"&&(_(this,vi,t),this.addEventListener("removetrack",t))}get onchange(){return u(this,fi)}set onchange(t){u(this,fi)&&(this.removeEventListener("change",u(this,fi)),_(this,fi,void 0)),typeof t=="function"&&(_(this,fi,t),this.addEventListener("change",t))}};mi=new WeakMap,vi=new WeakMap,fi=new WeakMap,mo=new WeakSet,ul=function(){return T(this).trackSet};var vo,fo=class{constructor(){H(this,"id");H(this,"kind");H(this,"label","");H(this,"language","");H(this,"sourceBuffer");S(this,vo,!1)}addRendition(e,t,r){let o=new Yn;return o.src=e,o.codec=t,o.bitrate=r,tm(this,o),o}removeRendition(e){im(e)}get enabled(){return u(this,vo)}set enabled(e){u(this,vo)!==e&&(_(this,vo,e),om(this))}};vo=new WeakMap;var nm=ml(globalThis.HTMLMediaElement,"video"),am=ml(globalThis.HTMLMediaElement,"audio");function go(i){if(!(i!=null&&i.prototype))return i;let e=ml(i,"video");(!e||`${e}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"videoTracks",{get(){return IE(this)}});let t=ml(i,"audio");(!t||`${t}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"audioTracks",{get(){return ME(this)}}),"addVideoTrack"in i.prototype||(i.prototype.addVideoTrack=function(n,a="",l=""){let c=new uo;return c.kind=n,c.label=a,c.language=l,dl(this,c),c}),"removeVideoTrack"in i.prototype||(i.prototype.removeVideoTrack=cl),"addAudioTrack"in i.prototype||(i.prototype.addAudioTrack=function(n,a="",l=""){let c=new fo;return c.kind=n,c.label=a,c.language=l,hl(this,c),c}),"removeAudioTrack"in i.prototype||(i.prototype.removeAudioTrack=pl),"videoRenditions"in i.prototype||Object.defineProperty(i.prototype,"videoRenditions",{get(){return r(this)}});let r=n=>{let a=T(n).videoRenditions;return a||(a=new ji,T(a).media=n,T(n).videoRenditions=a),a};"audioRenditions"in i.prototype||Object.defineProperty(i.prototype,"audioRenditions",{get(){return o(this)}});let o=n=>{let a=T(n).audioRenditions;return a||(a=new er,T(a).media=n,T(n).audioRenditions=a),a};return i}function ml(i,e){var t;if(i!=null&&i.prototype)return(t=Object.getOwnPropertyDescriptor(i.prototype,`${e}Tracks`))==null?void 0:t.get}function IE(i){let e=T(i).videoTracks;if(!e&&(e=new Ji,T(i).videoTracks=e,nm)){let t=nm.call(i.nativeEl??i);for(let r of t)dl(i,r);t.addEventListener("change",()=>{e.dispatchEvent(new Event("change"))}),t.addEventListener("addtrack",r=>{if([...e].some(o=>o instanceof uo)){for(let o of t)cl(o);return}dl(i,r.track)}),t.addEventListener("removetrack",r=>{cl(r.track)})}return e}function ME(i){let e=T(i).audioTracks;if(!e&&(e=new tr,T(i).audioTracks=e,am)){let t=am.call(i.nativeEl??i);for(let r of t)hl(i,r);t.addEventListener("change",()=>{e.dispatchEvent(new Event("change"))}),t.addEventListener("addtrack",r=>{if([...e].some(o=>o instanceof fo)){for(let o of t)pl(o);return}hl(i,r.track)}),t.addEventListener("removetrack",r=>{pl(r.track)})}return e}import We from"hls.js";var RE=go(De),Bt,gi,Eo,it,sm,lm,Rc,Qn,dm,ir=class extends RE{constructor(){super();S(this,it);S(this,Bt,null);S(this,gi,null);S(this,Eo,!1);this.api=null;S(this,Qn,()=>{var r,o;let t=this.nativeEl;t!=null&&t.webkitCurrentPlaybackTargetIsWireless?(r=this.api)==null||r.stopLoad():(o=this.api)==null||o.startLoad()});U(this,it,dm).call(this,"config")}static getTemplateHTML(t,r={}){let{src:o,...n}=t;return`
2772
+ `}function zp(i,{tag:e,is:t}){var n,a,l,c,p,Fp,v,g,m,A,f,Zi,Ic,Kp,Cc,qp,Gp;let r=(a=(n=globalThis.document)==null?void 0:n.createElement)==null?void 0:a.call(n,e,{is:t}),o=r?SE(r):[];return l=class extends i{constructor(){super(...arguments);S(this,f);S(this,v,!1);S(this,g,null);S(this,m,new Map);S(this,A);H(this,"get");H(this,"set");H(this,"call")}static get observedAttributes(){var K,ne;return U(K=l,p,Fp).call(K),[...((ne=r==null?void 0:r.constructor)==null?void 0:ne.observedAttributes)??[],...Wp]}get nativeEl(){var k;return U(this,f,Zi).call(this),u(this,g)??this.querySelector(":scope > [slot=media]")??this.querySelector(e)??((k=this.shadowRoot)==null?void 0:k.querySelector(e))??null}set nativeEl(k){_(this,g,k)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(k){this.toggleAttribute("muted",k)}get src(){return this.getAttribute("src")}set src(k){this.setAttribute("src",`${k}`)}get preload(){var k;return this.getAttribute("preload")??((k=this.nativeEl)==null?void 0:k.preload)}set preload(k){this.setAttribute("preload",`${k}`)}init(){if(!this.shadowRoot){this.attachShadow({mode:"open"});let k=kE(this.attributes);t&&(k.is=t),e&&(k.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(k)}this.nativeEl.muted=this.hasAttribute("muted");for(let k of o)U(this,f,qp).call(this,k);_(this,A,new MutationObserver(U(this,f,Kp).bind(this))),this.shadowRoot.addEventListener("slotchange",()=>U(this,f,Ic).call(this)),U(this,f,Ic).call(this);for(let k of this.constructor.Events)this.shadowRoot.addEventListener(k,this,!0)}handleEvent(k){k.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(k.type,{detail:k.detail}))}attributeChangedCallback(k,K,ne){U(this,f,Zi).call(this),U(this,f,Gp).call(this,k,K,ne)}connectedCallback(){U(this,f,Zi).call(this)}},c=new WeakMap,p=new WeakSet,Fp=function(){if(u(this,c))return;_(this,c,!0);let k=new Set(this.observedAttributes);k.delete("muted");for(let K of o)if(!(K in this.prototype))if(typeof r[K]=="function")this.prototype[K]=function(...ne){return U(this,f,Zi).call(this),(()=>{var pe;if(this.call)return this.call(K,...ne);let G=(pe=this.nativeEl)==null?void 0:pe[K];return G==null?void 0:G.apply(this.nativeEl,ne)})()};else{let ne={get(){var G,pe;U(this,f,Zi).call(this);let te=K.toLowerCase();if(k.has(te)){let It=this.getAttribute(te);return It===null?!1:It===""?!0:It}return((G=this.get)==null?void 0:G.call(this,K))??((pe=this.nativeEl)==null?void 0:pe[K])}};K!==K.toUpperCase()&&(ne.set=function(te){U(this,f,Zi).call(this);let G=K.toLowerCase();if(k.has(G)){te===!0||te===!1||te==null?this.toggleAttribute(G,!!te):this.setAttribute(G,te);return}if(this.set){this.set(K,te);return}this.nativeEl&&(this.nativeEl[K]=te)}),Object.defineProperty(this.prototype,K,ne)}},v=new WeakMap,g=new WeakMap,m=new WeakMap,A=new WeakMap,f=new WeakSet,Zi=function(){u(this,v)||(_(this,v,!0),this.init())},Ic=function(){var te;let k=new Map(u(this,m)),K=(te=this.shadowRoot)==null?void 0:te.querySelector("slot:not([name])");(K==null?void 0:K.assignedElements({flatten:!0}).filter(G=>["track","source"].includes(G.localName))).forEach(G=>{var It,wo;k.delete(G);let pe=u(this,m).get(G);pe||(pe=G.cloneNode(),u(this,m).set(G,pe),(It=u(this,A))==null||It.observe(G,{attributes:!0})),(wo=this.nativeEl)==null||wo.append(pe),U(this,f,Cc).call(this,pe)}),k.forEach((G,pe)=>{G.remove(),u(this,m).delete(pe)})},Kp=function(k){for(let K of k)if(K.type==="attributes"){let{target:ne,attributeName:te}=K,G=u(this,m).get(ne);G&&te&&(G.setAttribute(te,ne.getAttribute(te)??""),U(this,f,Cc).call(this,G))}},Cc=function(k){k&&k.localName==="track"&&k.default&&(k.kind==="chapters"||k.kind==="metadata")&&k.track.mode==="disabled"&&(k.track.mode="hidden")},qp=function(k){if(Object.prototype.hasOwnProperty.call(this,k)){let K=this[k];delete this[k],this[k]=K}},Gp=function(k,K,ne){var te,G,pe;["id","class"].includes(k)||!l.observedAttributes.includes(k)&&this.constructor.observedAttributes.includes(k)||(ne===null?(te=this.nativeEl)==null||te.removeAttribute(k):((G=this.nativeEl)==null?void 0:G.getAttribute(k))!==ne&&((pe=this.nativeEl)==null||pe.setAttribute(k,ne)))},S(l,p),H(l,"getTemplateHTML",e.endsWith("audio")?TE:AE),H(l,"shadowRootOptions",{mode:"open"}),H(l,"Events",yE),S(l,c,!1),l}function SE(i){let e=[];for(let t=Object.getPrototypeOf(i);t&&t!==HTMLElement.prototype;t=Object.getPrototypeOf(t)){let r=Object.getOwnPropertyNames(t);e.push(...r)}return e}function Yp(i){let e="";for(let t in i){if(!Wp.includes(t))continue;let r=i[t];r===""?e+=` ${t}`:e+=` ${t}="${r}"`}return e}function kE(i){let e={};for(let t of i)e[t.name]=t.value;return e}var De=zp(globalThis.HTMLElement??class{},{tag:"video"}),QL=zp(globalThis.HTMLElement??class{},{tag:"audio"});var $t=class extends Event{constructor(t,r){super(t);H(this,"track");this.track=r.track}};var Mc=new WeakMap;function T(i){return Mc.get(i)??LE(i,{})}function LE(i,e){let t=Mc.get(i);return t||Mc.set(i,t={}),Object.assign(t,e)}function dl(i,e){let t=i.videoTracks;T(e).media=i,T(e).renditionSet||(T(e).renditionSet=new Set);let r=T(t).trackSet;r.add(e);let o=r.size-1;o in Ji.prototype||Object.defineProperty(Ji.prototype,o,{get(){return[...T(this).trackSet][o]}}),queueMicrotask(()=>{t.dispatchEvent(new $t("addtrack",{track:e}))})}function cl(i){var r;let e=(r=T(i).media)==null?void 0:r.videoTracks;if(!e)return;T(e).trackSet.delete(i),queueMicrotask(()=>{e.dispatchEvent(new $t("removetrack",{track:i}))})}function Qp(i){let e=T(i).media.videoTracks??[],t=!1;for(let r of e)r!==i&&(r.selected=!1,t=!0);if(t){if(T(e).changeRequested)return;T(e).changeRequested=!0,queueMicrotask(()=>{delete T(e).changeRequested,e.dispatchEvent(new Event("change"))})}}var ni,ai,si,Xi,Gn,Ji=class extends EventTarget{constructor(){super();S(this,Xi);S(this,ni);S(this,ai);S(this,si);T(this).trackSet=new Set}[Symbol.iterator](){return u(this,Xi,Gn).values()}get length(){return u(this,Xi,Gn).size}getTrackById(t){return[...u(this,Xi,Gn)].find(r=>r.id===t)??null}get selectedIndex(){return[...u(this,Xi,Gn)].findIndex(t=>t.selected)}get onaddtrack(){return u(this,ni)}set onaddtrack(t){u(this,ni)&&(this.removeEventListener("addtrack",u(this,ni)),_(this,ni,void 0)),typeof t=="function"&&(_(this,ni,t),this.addEventListener("addtrack",t))}get onremovetrack(){return u(this,ai)}set onremovetrack(t){u(this,ai)&&(this.removeEventListener("removetrack",u(this,ai)),_(this,ai,void 0)),typeof t=="function"&&(_(this,ai,t),this.addEventListener("removetrack",t))}get onchange(){return u(this,si)}set onchange(t){u(this,si)&&(this.removeEventListener("change",u(this,si)),_(this,si,void 0)),typeof t=="function"&&(_(this,si,t),this.addEventListener("change",t))}};ni=new WeakMap,ai=new WeakMap,si=new WeakMap,Xi=new WeakSet,Gn=function(){return T(this).trackSet};var Ht=class extends Event{constructor(t,r){super(t);H(this,"rendition");this.rendition=r.rendition}};function Zp(i,e){let t=T(i).media.videoRenditions;T(e).media=T(i).media,T(e).track=i;let r=T(i).renditionSet;r.add(e);let o=r.size-1;o in ji.prototype||Object.defineProperty(ji.prototype,o,{get(){return so(this)[o]}}),queueMicrotask(()=>{i.selected&&t.dispatchEvent(new Ht("addrendition",{rendition:e}))})}function Xp(i){let e=T(i).media.videoRenditions,t=T(i).track;T(t).renditionSet.delete(i),queueMicrotask(()=>{T(i).track.selected&&e.dispatchEvent(new Ht("removerendition",{rendition:i}))})}function Jp(i){let e=T(i).media.videoRenditions;!e||T(e).changeRequested||(T(e).changeRequested=!0,queueMicrotask(()=>{delete T(e).changeRequested,T(i).track.selected&&e.dispatchEvent(new Event("change"))}))}function so(i){return[...T(i).media.videoTracks].filter(t=>t.selected).flatMap(t=>[...T(t).renditionSet])}var li,di,ci,ji=class extends EventTarget{constructor(){super(...arguments);S(this,li);S(this,di);S(this,ci)}[Symbol.iterator](){return so(this).values()}get length(){return so(this).length}getRenditionById(t){return so(this).find(r=>`${r.id}`==`${t}`)??null}get selectedIndex(){return so(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[r,o]of so(this).entries())o.selected=r===t}get onaddrendition(){return u(this,li)}set onaddrendition(t){u(this,li)&&(this.removeEventListener("addrendition",u(this,li)),_(this,li,void 0)),typeof t=="function"&&(_(this,li,t),this.addEventListener("addrendition",t))}get onremoverendition(){return u(this,di)}set onremoverendition(t){u(this,di)&&(this.removeEventListener("removerendition",u(this,di)),_(this,di,void 0)),typeof t=="function"&&(_(this,di,t),this.addEventListener("removerendition",t))}get onchange(){return u(this,ci)}set onchange(t){u(this,ci)&&(this.removeEventListener("change",u(this,ci)),_(this,ci,void 0)),typeof t=="function"&&(_(this,ci,t),this.addEventListener("change",t))}};li=new WeakMap,di=new WeakMap,ci=new WeakMap;var lo,zn=class{constructor(){H(this,"src");H(this,"id");H(this,"width");H(this,"height");H(this,"bitrate");H(this,"frameRate");H(this,"codec");S(this,lo,!1)}get selected(){return u(this,lo)}set selected(e){u(this,lo)!==e&&(_(this,lo,e),Jp(this))}};lo=new WeakMap;var co,uo=class{constructor(){H(this,"id");H(this,"kind");H(this,"label","");H(this,"language","");H(this,"sourceBuffer");S(this,co,!1)}addRendition(e,t,r,o,n,a){let l=new zn;return l.src=e,l.width=t,l.height=r,l.frameRate=a,l.bitrate=n,l.codec=o,Zp(this,l),l}removeRendition(e){Xp(e)}get selected(){return u(this,co)}set selected(e){u(this,co)!==e&&(_(this,co,e),e===!0&&Qp(this))}};co=new WeakMap;function jp(i,e){let t=T(i).media.audioRenditions;T(e).media=T(i).media,T(e).track=i;let r=T(i).renditionSet;r.add(e);let o=r.size-1;o in er.prototype||Object.defineProperty(er.prototype,o,{get(){return ho(this)[o]}}),queueMicrotask(()=>{i.enabled&&t.dispatchEvent(new Ht("addrendition",{rendition:e}))})}function em(i){let e=T(i).media.audioRenditions,t=T(i).track;T(t).renditionSet.delete(i),queueMicrotask(()=>{T(i).track.enabled&&e.dispatchEvent(new Ht("removerendition",{rendition:i}))})}function tm(i){let e=T(i).media.audioRenditions;!e||T(e).changeRequested||(T(e).changeRequested=!0,queueMicrotask(()=>{delete T(e).changeRequested,T(i).track.enabled&&e.dispatchEvent(new Event("change"))}))}function ho(i){return[...T(i).media.audioTracks].filter(t=>t.enabled).flatMap(t=>[...T(t).renditionSet])}var ui,hi,pi,er=class extends EventTarget{constructor(){super(...arguments);S(this,ui);S(this,hi);S(this,pi)}[Symbol.iterator](){return ho(this).values()}get length(){return ho(this).length}getRenditionById(t){return ho(this).find(r=>`${r.id}`==`${t}`)??null}get selectedIndex(){return ho(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[r,o]of ho(this).entries())o.selected=r===t}get onaddrendition(){return u(this,ui)}set onaddrendition(t){u(this,ui)&&(this.removeEventListener("addrendition",u(this,ui)),_(this,ui,void 0)),typeof t=="function"&&(_(this,ui,t),this.addEventListener("addrendition",t))}get onremoverendition(){return u(this,hi)}set onremoverendition(t){u(this,hi)&&(this.removeEventListener("removerendition",u(this,hi)),_(this,hi,void 0)),typeof t=="function"&&(_(this,hi,t),this.addEventListener("removerendition",t))}get onchange(){return u(this,pi)}set onchange(t){u(this,pi)&&(this.removeEventListener("change",u(this,pi)),_(this,pi,void 0)),typeof t=="function"&&(_(this,pi,t),this.addEventListener("change",t))}};ui=new WeakMap,hi=new WeakMap,pi=new WeakMap;var po,Yn=class{constructor(){H(this,"src");H(this,"id");H(this,"bitrate");H(this,"codec");S(this,po,!1)}get selected(){return u(this,po)}set selected(e){u(this,po)!==e&&(_(this,po,e),tm(this))}};po=new WeakMap;function hl(i,e){let t=i.audioTracks;T(e).media=i,T(e).renditionSet||(T(e).renditionSet=new Set);let r=T(t).trackSet;r.add(e);let o=r.size-1;o in tr.prototype||Object.defineProperty(tr.prototype,o,{get(){return[...T(this).trackSet][o]}}),queueMicrotask(()=>{t.dispatchEvent(new $t("addtrack",{track:e}))})}function pl(i){var r;let e=(r=T(i).media)==null?void 0:r.audioTracks;if(!e)return;T(e).trackSet.delete(i),queueMicrotask(()=>{e.dispatchEvent(new $t("removetrack",{track:i}))})}function im(i){let e=T(i).media.audioTracks;!e||T(e).changeRequested||(T(e).changeRequested=!0,queueMicrotask(()=>{delete T(e).changeRequested,e.dispatchEvent(new Event("change"))}))}var mi,vi,fi,mo,ul,tr=class extends EventTarget{constructor(){super();S(this,mo);S(this,mi);S(this,vi);S(this,fi);T(this).trackSet=new Set}[Symbol.iterator](){return u(this,mo,ul).values()}get length(){return u(this,mo,ul).size}getTrackById(t){return[...u(this,mo,ul)].find(r=>r.id===t)??null}get onaddtrack(){return u(this,mi)}set onaddtrack(t){u(this,mi)&&(this.removeEventListener("addtrack",u(this,mi)),_(this,mi,void 0)),typeof t=="function"&&(_(this,mi,t),this.addEventListener("addtrack",t))}get onremovetrack(){return u(this,vi)}set onremovetrack(t){u(this,vi)&&(this.removeEventListener("removetrack",u(this,vi)),_(this,vi,void 0)),typeof t=="function"&&(_(this,vi,t),this.addEventListener("removetrack",t))}get onchange(){return u(this,fi)}set onchange(t){u(this,fi)&&(this.removeEventListener("change",u(this,fi)),_(this,fi,void 0)),typeof t=="function"&&(_(this,fi,t),this.addEventListener("change",t))}};mi=new WeakMap,vi=new WeakMap,fi=new WeakMap,mo=new WeakSet,ul=function(){return T(this).trackSet};var vo,fo=class{constructor(){H(this,"id");H(this,"kind");H(this,"label","");H(this,"language","");H(this,"sourceBuffer");S(this,vo,!1)}addRendition(e,t,r){let o=new Yn;return o.src=e,o.codec=t,o.bitrate=r,jp(this,o),o}removeRendition(e){em(e)}get enabled(){return u(this,vo)}set enabled(e){u(this,vo)!==e&&(_(this,vo,e),im(this))}};vo=new WeakMap;var rm=ml(globalThis.HTMLMediaElement,"video"),om=ml(globalThis.HTMLMediaElement,"audio");function go(i){if(!(i!=null&&i.prototype))return i;let e=ml(i,"video");(!e||`${e}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"videoTracks",{get(){return wE(this)}});let t=ml(i,"audio");(!t||`${t}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"audioTracks",{get(){return IE(this)}}),"addVideoTrack"in i.prototype||(i.prototype.addVideoTrack=function(n,a="",l=""){let c=new uo;return c.kind=n,c.label=a,c.language=l,dl(this,c),c}),"removeVideoTrack"in i.prototype||(i.prototype.removeVideoTrack=cl),"addAudioTrack"in i.prototype||(i.prototype.addAudioTrack=function(n,a="",l=""){let c=new fo;return c.kind=n,c.label=a,c.language=l,hl(this,c),c}),"removeAudioTrack"in i.prototype||(i.prototype.removeAudioTrack=pl),"videoRenditions"in i.prototype||Object.defineProperty(i.prototype,"videoRenditions",{get(){return r(this)}});let r=n=>{let a=T(n).videoRenditions;return a||(a=new ji,T(a).media=n,T(n).videoRenditions=a),a};"audioRenditions"in i.prototype||Object.defineProperty(i.prototype,"audioRenditions",{get(){return o(this)}});let o=n=>{let a=T(n).audioRenditions;return a||(a=new er,T(a).media=n,T(n).audioRenditions=a),a};return i}function ml(i,e){var t;if(i!=null&&i.prototype)return(t=Object.getOwnPropertyDescriptor(i.prototype,`${e}Tracks`))==null?void 0:t.get}function wE(i){let e=T(i).videoTracks;if(!e&&(e=new Ji,T(i).videoTracks=e,rm)){let t=rm.call(i.nativeEl??i);for(let r of t)dl(i,r);t.addEventListener("change",()=>{e.dispatchEvent(new Event("change"))}),t.addEventListener("addtrack",r=>{if([...e].some(o=>o instanceof uo)){for(let o of t)cl(o);return}dl(i,r.track)}),t.addEventListener("removetrack",r=>{cl(r.track)})}return e}function IE(i){let e=T(i).audioTracks;if(!e&&(e=new tr,T(i).audioTracks=e,om)){let t=om.call(i.nativeEl??i);for(let r of t)hl(i,r);t.addEventListener("change",()=>{e.dispatchEvent(new Event("change"))}),t.addEventListener("addtrack",r=>{if([...e].some(o=>o instanceof fo)){for(let o of t)pl(o);return}hl(i,r.track)}),t.addEventListener("removetrack",r=>{pl(r.track)})}return e}import We from"hls.js";var CE=go(De),Bt,gi,Eo,it,nm,am,Rc,Qn,sm,ir=class extends CE{constructor(){super();S(this,it);S(this,Bt,null);S(this,gi,null);S(this,Eo,!1);this.api=null;S(this,Qn,()=>{var r,o;let t=this.nativeEl;t!=null&&t.webkitCurrentPlaybackTargetIsWireless?(r=this.api)==null||r.stopLoad():(o=this.api)==null||o.startLoad()});U(this,it,sm).call(this,"config")}static getTemplateHTML(t,r={}){let{src:o,...n}=t;return`
2773
2773
  <script type="application/json" id="config">
2774
2774
  ${JSON.stringify(r.config||{})}
2775
2775
  <\/script>
2776
2776
  ${De.getTemplateHTML(n)}
2777
- `}get config(){return u(this,gi)}set config(t){_(this,gi,t)}attributeChangedCallback(t,r,o){t!=="src"&&super.attributeChangedCallback(t,r,o),t==="src"&&r!==o&&this.load()}async load(){var o,n,a;let t=!this.api&&!u(this,Eo);if(U(this,it,sm).call(this),!this.src)return;if(t&&!u(this,gi)&&_(this,gi,JSON.parse(((n=(o=this.shadowRoot)==null?void 0:o.getElementById("config"))==null?void 0:n.textContent)||"{}")),!U(this,it,lm).call(this,this.src)){await Promise.resolve(),_(this,Eo,!0),this.nativeEl.src=this.src;return}if(We.isSupported()){switch(await Promise.resolve(),this.api=new We({liveDurationInfinity:!0,autoStartLoad:!1,...u(this,gi)}),this.api.loadSource(this.src),this.api.attachMedia(this.nativeEl),this.nativeEl.preload){case"none":{let v=()=>{var g;return(g=this.api)==null?void 0:g.startLoad()};this.nativeEl.addEventListener("play",v,{once:!0}),this.api.on(We.Events.DESTROYING,()=>{this.nativeEl.removeEventListener("play",v)});break}case"metadata":{let v=this.api.config.maxBufferLength,g=this.api.config.maxBufferSize;this.api.config.maxBufferLength=1,this.api.config.maxBufferSize=1;let m=()=>{this.api&&(this.api.config.maxBufferLength=v,this.api.config.maxBufferSize=g)};this.nativeEl.addEventListener("play",m,{once:!0}),this.api.on(We.Events.DESTROYING,()=>{this.nativeEl.removeEventListener("play",m)}),this.api.startLoad();break}default:this.api.startLoad()}this.nativeEl.webkitCurrentPlaybackTargetIsWireless&&this.api.stopLoad(),this.nativeEl.addEventListener("webkitcurrentplaybacktargetiswirelesschanged",u(this,Qn)),_(this,Bt,document.createElement("source")),u(this,Bt).setAttribute("type","application/x-mpegURL"),u(this,Bt).setAttribute("src",this.src),this.nativeEl.disableRemotePlayback=!1,this.nativeEl.append(u(this,Bt));let c=new WeakMap;this.api.on(We.Events.MANIFEST_PARSED,(v,g)=>{this.nativeEl.autoplay&&this.nativeEl.paused&&this.nativeEl.play().catch(A=>{console.warn("Autoplay failed:",A)}),U(this,it,Rc).call(this);let m=this.videoTracks.getTrackById("main");m||(m=this.addVideoTrack("main"),m.id="main",m.selected=!0);for(let[A,f]of g.levels.entries()){let R=m.addRendition(f.url[0],f.width,f.height,f.videoCodec??void 0,f.bitrate);c.set(f,`${A}`),R.id=`${A}`}for(let[A,f]of g.audioTracks.entries()){let R=f.default?"main":"alternative",O=this.addAudioTrack(R,f.name,f.lang);O.id=`${A}`,f.default&&(O.enabled=!0)}}),this.audioTracks.addEventListener("change",()=>{var A,f;let v=[...this.audioTracks].find(R=>R.enabled),g=v?+v.id:void 0,m=((A=this.api)==null?void 0:A.audioTracks.map(R=>R.id))??[];g!==void 0&&g!==((f=this.api)==null?void 0:f.audioTrack)&&m.includes(g)&&this.api&&(this.api.audioTrack=g)}),this.api.on(We.Events.LEVELS_UPDATED,(v,g)=>{let m=[...this.videoTracks][this.videoTracks.selectedIndex??0];if(!m)return;let A=g.levels.map(f=>c.get(f));for(let f of this.videoRenditions)f.id&&!A.includes(f.id)&&m.removeRendition(f)});let p=null;this.api.on(We.Events.ERROR,(v,g)=>{var m;g.type===We.ErrorTypes.NETWORK_ERROR&&g.details===We.ErrorDetails.FRAG_LOAD_ERROR&&(p=((m=g.frag)==null?void 0:m.level)??null)}),this.api.on(We.Events.LEVEL_SWITCHED,(v,g)=>{let m=g.level;p!==null&&m<p&&(console.warn(`hls.js downgraded quality from level ${p} to ${m} due to fragment load failure.`),this.videoRenditions.selectedIndex=m,p=null)});let h=()=>{let v=this.videoRenditions.selectedIndex;this.api&&v!==this.api.nextLevel&&(this.api.nextLevel=v)};(a=this.videoRenditions)==null||a.addEventListener("change",h),this.api.once(We.Events.DESTROYING,()=>U(this,it,Rc).call(this));return}await Promise.resolve(),this.nativeEl.canPlayType("application/vnd.apple.mpegurl")&&(this.nativeEl.src=this.src)}};Bt=new WeakMap,gi=new WeakMap,Eo=new WeakMap,it=new WeakSet,sm=function(){var t,r;(t=u(this,Bt))==null||t.remove(),_(this,Bt,null),(r=this.nativeEl)==null||r.removeEventListener("webkitcurrentplaybacktargetiswirelesschanged",u(this,Qn)),this.api&&(this.api.detachMedia(),this.api.destroy(),this.api=null),_(this,Eo,!1)},lm=function(t){return t.includes(".m3u8")||t.includes("application/x-mpegURL")},Rc=function(){for(let t of this.videoTracks)this.removeVideoTrack(t);for(let t of this.audioTracks)this.removeAudioTrack(t)},Qn=new WeakMap,dm=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let r=this[t];delete this[t],this[t]=r}},ir.shadowRootOptions={...De.shadowRootOptions};globalThis.customElements&&!globalThis.customElements.get("hls-video")&&globalThis.customElements.define("hls-video",ir);var cm=ir;var xE="nanoplayer.4.min.js",PE="nanoplayer",Ae={loading:!1,loaded:!1,error:null,callbacks:[]};function DE(i){return new Promise((e,t)=>{if(window.NanoPlayer){Ae.loaded=!0,e();return}if(Ae.loaded){e();return}if(Ae.error){t(Ae.error);return}if(Ae.callbacks.push(a=>{a?t(a):e()}),Ae.loading)return;Ae.loading=!0;let o=`${i.endsWith("/")?i:`${i}/`}${PE}/${xE}`,n=document.createElement("script");n.src=o,n.async=!0,n.onload=()=>{Ae.loaded=!0,Ae.loading=!1,Ae.callbacks.forEach(a=>a()),Ae.callbacks=[]},n.onerror=()=>{let a=new Error(`Failed to load NanoPlayer script from ${o}`);Ae.error=a,Ae.loading=!1,Ae.callbacks.forEach(l=>l(a)),Ae.callbacks=[]},document.head.appendChild(n)})}var OE=go(De),Vt,Ei,de,rt,bo,Se,Zn,bi,rr,_o,_i,yo,ke,xc,um,hm,pm,vl,or=class extends OE{constructor(){super();S(this,ke);S(this,Vt,null);S(this,Ei,null);S(this,de,null);S(this,rt,null);S(this,bo,"");S(this,Se,null);S(this,Zn,!0);S(this,bi,[]);S(this,rr,[]);S(this,_o,null);S(this,_i,null);S(this,yo,!1);this.api=null;U(this,ke,vl).call(this,"config"),U(this,ke,vl).call(this,"streamid"),U(this,ke,vl).call(this,"sourceConfig")}static get observedAttributes(){return[...De.observedAttributes,"streamid","library-location"]}static getTemplateHTML(t,r={}){let{streamid:o,"library-location":n,...a}=t;return`
2777
+ `}get config(){return u(this,gi)}set config(t){_(this,gi,t)}attributeChangedCallback(t,r,o){t!=="src"&&super.attributeChangedCallback(t,r,o),t==="src"&&r!==o&&this.load()}async load(){var o,n,a;let t=!this.api&&!u(this,Eo);if(U(this,it,nm).call(this),!this.src)return;if(t&&!u(this,gi)&&_(this,gi,JSON.parse(((n=(o=this.shadowRoot)==null?void 0:o.getElementById("config"))==null?void 0:n.textContent)||"{}")),!U(this,it,am).call(this,this.src)){await Promise.resolve(),_(this,Eo,!0),this.nativeEl.src=this.src;return}if(We.isSupported()){switch(await Promise.resolve(),this.api=new We({liveDurationInfinity:!0,autoStartLoad:!1,...u(this,gi)}),this.api.loadSource(this.src),this.api.attachMedia(this.nativeEl),this.nativeEl.preload){case"none":{let v=()=>{var g;return(g=this.api)==null?void 0:g.startLoad()};this.nativeEl.addEventListener("play",v,{once:!0}),this.api.on(We.Events.DESTROYING,()=>{this.nativeEl.removeEventListener("play",v)});break}case"metadata":{let v=this.api.config.maxBufferLength,g=this.api.config.maxBufferSize;this.api.config.maxBufferLength=1,this.api.config.maxBufferSize=1;let m=()=>{this.api&&(this.api.config.maxBufferLength=v,this.api.config.maxBufferSize=g)};this.nativeEl.addEventListener("play",m,{once:!0}),this.api.on(We.Events.DESTROYING,()=>{this.nativeEl.removeEventListener("play",m)}),this.api.startLoad();break}default:this.api.startLoad()}this.nativeEl.webkitCurrentPlaybackTargetIsWireless&&this.api.stopLoad(),this.nativeEl.addEventListener("webkitcurrentplaybacktargetiswirelesschanged",u(this,Qn)),_(this,Bt,document.createElement("source")),u(this,Bt).setAttribute("type","application/x-mpegURL"),u(this,Bt).setAttribute("src",this.src),this.nativeEl.disableRemotePlayback=!1,this.nativeEl.append(u(this,Bt));let c=new WeakMap;this.api.on(We.Events.MANIFEST_PARSED,(v,g)=>{this.nativeEl.autoplay&&this.nativeEl.paused&&this.nativeEl.play().catch(A=>{console.warn("Autoplay failed:",A)}),U(this,it,Rc).call(this);let m=this.videoTracks.getTrackById("main");m||(m=this.addVideoTrack("main"),m.id="main",m.selected=!0);for(let[A,f]of g.levels.entries()){let R=m.addRendition(f.url[0],f.width,f.height,f.videoCodec??void 0,f.bitrate);c.set(f,`${A}`),R.id=`${A}`}for(let[A,f]of g.audioTracks.entries()){let R=f.default?"main":"alternative",O=this.addAudioTrack(R,f.name,f.lang);O.id=`${A}`,f.default&&(O.enabled=!0)}}),this.audioTracks.addEventListener("change",()=>{var A,f;let v=[...this.audioTracks].find(R=>R.enabled),g=v?+v.id:void 0,m=((A=this.api)==null?void 0:A.audioTracks.map(R=>R.id))??[];g!==void 0&&g!==((f=this.api)==null?void 0:f.audioTrack)&&m.includes(g)&&this.api&&(this.api.audioTrack=g)}),this.api.on(We.Events.LEVELS_UPDATED,(v,g)=>{let m=[...this.videoTracks][this.videoTracks.selectedIndex??0];if(!m)return;let A=g.levels.map(f=>c.get(f));for(let f of this.videoRenditions)f.id&&!A.includes(f.id)&&m.removeRendition(f)});let p=null;this.api.on(We.Events.ERROR,(v,g)=>{var m;g.type===We.ErrorTypes.NETWORK_ERROR&&g.details===We.ErrorDetails.FRAG_LOAD_ERROR&&(p=((m=g.frag)==null?void 0:m.level)??null)}),this.api.on(We.Events.LEVEL_SWITCHED,(v,g)=>{let m=g.level;p!==null&&m<p&&(console.warn(`hls.js downgraded quality from level ${p} to ${m} due to fragment load failure.`),this.videoRenditions.selectedIndex=m,p=null)});let h=()=>{let v=this.videoRenditions.selectedIndex;this.api&&v!==this.api.nextLevel&&(this.api.nextLevel=v)};(a=this.videoRenditions)==null||a.addEventListener("change",h),this.api.once(We.Events.DESTROYING,()=>U(this,it,Rc).call(this));return}await Promise.resolve(),this.nativeEl.canPlayType("application/vnd.apple.mpegurl")&&(this.nativeEl.src=this.src)}};Bt=new WeakMap,gi=new WeakMap,Eo=new WeakMap,it=new WeakSet,nm=function(){var t,r;(t=u(this,Bt))==null||t.remove(),_(this,Bt,null),(r=this.nativeEl)==null||r.removeEventListener("webkitcurrentplaybacktargetiswirelesschanged",u(this,Qn)),this.api&&(this.api.detachMedia(),this.api.destroy(),this.api=null),_(this,Eo,!1)},am=function(t){return t.includes(".m3u8")||t.includes("application/x-mpegURL")},Rc=function(){for(let t of this.videoTracks)this.removeVideoTrack(t);for(let t of this.audioTracks)this.removeAudioTrack(t)},Qn=new WeakMap,sm=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let r=this[t];delete this[t],this[t]=r}},ir.shadowRootOptions={...De.shadowRootOptions};globalThis.customElements&&!globalThis.customElements.get("hls-video")&&globalThis.customElements.define("hls-video",ir);var lm=ir;var ME="nanoplayer.4.min.js",RE="nanoplayer",Ae={loading:!1,loaded:!1,error:null,callbacks:[]};function xE(i){return new Promise((e,t)=>{if(window.NanoPlayer){Ae.loaded=!0,e();return}if(Ae.loaded){e();return}if(Ae.error){t(Ae.error);return}if(Ae.callbacks.push(a=>{a?t(a):e()}),Ae.loading)return;Ae.loading=!0;let o=`${i.endsWith("/")?i:`${i}/`}${RE}/${ME}`,n=document.createElement("script");n.src=o,n.async=!0,n.onload=()=>{Ae.loaded=!0,Ae.loading=!1,Ae.callbacks.forEach(a=>a()),Ae.callbacks=[]},n.onerror=()=>{let a=new Error(`Failed to load NanoPlayer script from ${o}`);Ae.error=a,Ae.loading=!1,Ae.callbacks.forEach(l=>l(a)),Ae.callbacks=[]},document.head.appendChild(n)})}var PE=go(De),Vt,Ei,de,rt,bo,Se,Zn,bi,rr,_o,_i,yo,ke,xc,dm,cm,um,vl,or=class extends PE{constructor(){super();S(this,ke);S(this,Vt,null);S(this,Ei,null);S(this,de,null);S(this,rt,null);S(this,bo,"");S(this,Se,null);S(this,Zn,!0);S(this,bi,[]);S(this,rr,[]);S(this,_o,null);S(this,_i,null);S(this,yo,!1);this.api=null;U(this,ke,vl).call(this,"config"),U(this,ke,vl).call(this,"streamid"),U(this,ke,vl).call(this,"sourceConfig")}static get observedAttributes(){return[...De.observedAttributes,"streamid","library-location"]}static getTemplateHTML(t,r={}){let{streamid:o,"library-location":n,...a}=t;return`
2778
2778
  <script type="application/json" id="config">
2779
2779
  ${JSON.stringify(r.config||{})}
2780
2780
  <\/script>
2781
2781
  ${De.getTemplateHTML(a)}
2782
- `}get config(){return u(this,Vt)}set config(t){_(this,Vt,t)}get sourceConfig(){return u(this,Ei)}set sourceConfig(t){let r=u(this,Ei)!==t;_(this,Ei,t),r&&t&&this.load()}get streamid(){return this.getAttribute("streamid")}set streamid(t){t?this.setAttribute("streamid",t):this.removeAttribute("streamid")}get libraryLocation(){return this.getAttribute("library-location")||"/vendor/bp-player"}set libraryLocation(t){this.setAttribute("library-location",t)}attributeChangedCallback(t,r,o){t==="streamid"&&r!==o?this.load():t!=="streamid"&&t!=="library-location"&&super.attributeChangedCallback(t,r,o)}async load(){var n,a,l,c,p;let t=!u(this,de);U(this,ke,xc).call(this);let r=this.streamid,o=!!u(this,Ei);if(!(!r&&!o)){_(this,_o,new Promise(h=>{_(this,_i,h)})),t&&!u(this,Vt)&&_(this,Vt,JSON.parse(((a=(n=this.shadowRoot)==null?void 0:n.getElementById("config"))==null?void 0:a.textContent)||"{}"));try{await DE(this.libraryLocation)}catch(h){console.error("[nano-video] Failed to load NanoPlayer script:",h),this.dispatchEvent(new ErrorEvent("error",{error:h,message:"Failed to load NanoPlayer script"})),(l=u(this,_i))==null||l.call(this);return}_(this,bo,`nano-video-${Date.now()}-${Math.random().toString(36).slice(2,9)}`),_(this,rt,document.createElement("div")),u(this,rt).id=u(this,bo),u(this,rt).style.cssText="width: 100%; height: 100%; position: absolute; top: 0; left: 0;",this.addEventListener("pause",h=>{var v;h.target!==this&&((v=u(this,rt))!=null&&v.contains(h.target))&&u(this,yo)&&h.stopImmediatePropagation()},!0),this.style.position="relative",this.nativeEl.style.display="none",this.appendChild(u(this,rt)),_(this,de,new window.NanoPlayer(u(this,bo))),this.api=u(this,de);try{let h=U(this,ke,um).call(this,r,o?u(this,Ei):void 0),v=await u(this,de).setup(h);_(this,rr,((c=v.source.entries)==null?void 0:c.map((g,m)=>({index:m,height:g.info.height??0,width:g.info.width??0,bitrate:g.info.bitrate??0,label:g.info.height?`${g.info.height}p`:m===0?"Source":`Stream ${m+1}`})))??[]),U(this,ke,pm).call(this)}catch(h){console.error("[nano-video] Failed to setup NanoPlayer:",h),this.dispatchEvent(new ErrorEvent("error",{error:h,message:"Failed to setup NanoPlayer"})),(p=u(this,_i))==null||p.call(this)}}}async play(){if(u(this,_o)&&await u(this,_o),u(this,de)){_(this,yo,!0),u(this,de).play();return}return super.play()}pause(){if(u(this,de)){u(this,de).pause();return}super.pause()}get currentTime(){var t;return((t=u(this,Se))==null?void 0:t.currentTime)??super.currentTime}set currentTime(t){u(this,de)||(super.currentTime=t)}get duration(){return 1/0}get paused(){var t;return((t=u(this,Se))==null?void 0:t.paused)??super.paused}get volume(){var t;return((t=u(this,Se))==null?void 0:t.volume)??super.volume}set volume(t){u(this,Se)?u(this,Se).volume=t:super.volume=t}get muted(){var t;return((t=u(this,Se))==null?void 0:t.muted)??super.muted}set muted(t){u(this,Se)&&(u(this,Se).muted=t),u(this,de)?t?u(this,de).mute():u(this,de).unmute():super.muted=t}get videoWidth(){var t;return((t=u(this,Se))==null?void 0:t.videoWidth)??super.videoWidth}get videoHeight(){var t;return((t=u(this,Se))==null?void 0:t.videoHeight)??super.videoHeight}disconnectedCallback(){var t;U(this,ke,xc).call(this),(t=super.disconnectedCallback)==null||t.call(this)}};Vt=new WeakMap,Ei=new WeakMap,de=new WeakMap,rt=new WeakMap,bo=new WeakMap,Se=new WeakMap,Zn=new WeakMap,bi=new WeakMap,rr=new WeakMap,_o=new WeakMap,_i=new WeakMap,yo=new WeakMap,ke=new WeakSet,xc=function(){u(this,bi).forEach(t=>t()),_(this,bi,[]),u(this,de)&&(u(this,de).destroy(),_(this,de,null),this.api=null),u(this,rt)&&(u(this,rt).remove(),_(this,rt,null)),_(this,Se,null),_(this,rr,[])},um=function(t,r){var n,a;return{source:r??{group:{id:t},options:{adaption:{rule:"deviationOfMean2"},switch:{method:"server",pauseOnError:!1,forcePlay:!0,timeout:10}}},playback:{autoplay:this.nativeEl.autoplay,muted:this.nativeEl.muted,reconnect:((n=u(this,Vt))==null?void 0:n.reconnect)??{minDelay:2,maxDelay:10,delaySteps:10,maxRetries:10},buffer:((a=u(this,Vt))==null?void 0:a.buffer)??{min:.1,max:2,target:.5}},style:{width:"100%",height:"100%",controls:!1,view:!1,interactive:!1},events:{onReady:()=>{var l;this.dispatchEvent(new Event("loadeddata",{bubbles:!0})),this.dispatchEvent(new Event("canplay",{bubbles:!0})),this.dispatchEvent(new Event("canplaythrough",{bubbles:!0})),(l=u(this,_i))==null||l.call(this)},onPlay:()=>{_(this,yo,!1),this.dispatchEvent(new Event("play",{bubbles:!0})),this.dispatchEvent(new Event("playing",{bubbles:!0}))},onPause:()=>{this.dispatchEvent(new Event("pause",{bubbles:!0}))},onLoading:()=>{this.dispatchEvent(new Event("waiting",{bubbles:!0}))},onStartBuffering:()=>{this.dispatchEvent(new Event("waiting",{bubbles:!0}))},onStopBuffering:()=>{this.dispatchEvent(new Event("canplaythrough",{bubbles:!0})),this.dispatchEvent(new Event("playing",{bubbles:!0}))},onError:l=>{var p;let c=new Error(l.data.message??"NanoPlayer error");this.dispatchEvent(new ErrorEvent("error",{error:c,message:l.data.message,bubbles:!0})),(p=u(this,_i))==null||p.call(this)},onActiveVideoElementChange:l=>{var p;let c=(p=l.data)==null?void 0:p.activeVideoElement;c&&(_(this,Se,c),U(this,ke,hm).call(this,c))}}}},hm=function(t){u(this,bi).forEach(o=>o()),_(this,bi,[]);let r=["timeupdate","volumechange","durationchange","resize"];for(let o of r){let n=()=>{this.dispatchEvent(new Event(o,{bubbles:!0}))};t.addEventListener(o,n),u(this,bi).push(()=>t.removeEventListener(o,n))}},pm=function(){for(let o of this.videoTracks)this.removeVideoTrack(o);if(u(this,rr).length===0)return;let t=this.addVideoTrack("main");t.id="main",t.selected=!0;for(let o of u(this,rr)){let n=t.addRendition("",o.width,o.height,void 0,o.bitrate);n.id=`${o.index}`}let r=()=>{var n,a,l;let o=this.videoRenditions.selectedIndex;o<0?(_(this,Zn,!0),(n=u(this,de))==null||n.setAdaption({rule:"deviationOfMean2"})):(_(this,Zn,!1),(a=u(this,de))==null||a.switchStream(o).catch(()=>{}),(l=u(this,de))==null||l.setAdaption({rule:"none"}))};this.videoRenditions.addEventListener("change",r)},vl=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let r=this[t];delete this[t],this[t]=r}},or.shadowRootOptions={...De.shadowRootOptions};globalThis.customElements&&!globalThis.customElements.get("nano-video")&&globalThis.customElements.define("nano-video",or);var mm=or;import{Room as UE,RoomEvent as To,Track as vm,VideoQuality as NE}from"livekit-client";var $E=go(De),Ye,_e,re,Lt,Ao,wt,So,ko,ce,Pc,fm,gm,fl,Em,bm,gl,nr=class extends $E{constructor(){super();S(this,ce);S(this,Ye,null);S(this,_e,null);S(this,re,null);S(this,Lt,[]);S(this,Ao,[]);S(this,wt,"disconnected");S(this,So,null);S(this,ko,null);this.room=null;U(this,ce,gl).call(this,"config"),U(this,ce,gl).call(this,"url"),U(this,ce,gl).call(this,"token")}static get observedAttributes(){return[...De.observedAttributes,"url","token"]}static getTemplateHTML(t,r={}){let{url:o,token:n,...a}=t;return`
2782
+ `}get config(){return u(this,Vt)}set config(t){_(this,Vt,t)}get sourceConfig(){return u(this,Ei)}set sourceConfig(t){let r=u(this,Ei)!==t;_(this,Ei,t),r&&t&&this.load()}get streamid(){return this.getAttribute("streamid")}set streamid(t){t?this.setAttribute("streamid",t):this.removeAttribute("streamid")}get libraryLocation(){return this.getAttribute("library-location")||"/vendor/bp-player"}set libraryLocation(t){this.setAttribute("library-location",t)}attributeChangedCallback(t,r,o){t==="streamid"&&r!==o?this.load():t!=="streamid"&&t!=="library-location"&&super.attributeChangedCallback(t,r,o)}async load(){var n,a,l,c,p;let t=!u(this,de);U(this,ke,xc).call(this);let r=this.streamid,o=!!u(this,Ei);if(!(!r&&!o)){_(this,_o,new Promise(h=>{_(this,_i,h)})),t&&!u(this,Vt)&&_(this,Vt,JSON.parse(((a=(n=this.shadowRoot)==null?void 0:n.getElementById("config"))==null?void 0:a.textContent)||"{}"));try{await xE(this.libraryLocation)}catch(h){console.error("[nano-video] Failed to load NanoPlayer script:",h),this.dispatchEvent(new ErrorEvent("error",{error:h,message:"Failed to load NanoPlayer script"})),(l=u(this,_i))==null||l.call(this);return}_(this,bo,`nano-video-${Date.now()}-${Math.random().toString(36).slice(2,9)}`),_(this,rt,document.createElement("div")),u(this,rt).id=u(this,bo),u(this,rt).style.cssText="width: 100%; height: 100%; position: absolute; top: 0; left: 0;",this.addEventListener("pause",h=>{var v;h.target!==this&&((v=u(this,rt))!=null&&v.contains(h.target))&&u(this,yo)&&h.stopImmediatePropagation()},!0),this.style.position="relative",this.nativeEl.style.display="none",this.appendChild(u(this,rt)),_(this,de,new window.NanoPlayer(u(this,bo))),this.api=u(this,de);try{let h=U(this,ke,dm).call(this,r,o?u(this,Ei):void 0),v=await u(this,de).setup(h);_(this,rr,((c=v.source.entries)==null?void 0:c.map((g,m)=>({index:m,height:g.info.height??0,width:g.info.width??0,bitrate:g.info.bitrate??0,label:g.info.height?`${g.info.height}p`:m===0?"Source":`Stream ${m+1}`})))??[]),U(this,ke,um).call(this)}catch(h){console.error("[nano-video] Failed to setup NanoPlayer:",h),this.dispatchEvent(new ErrorEvent("error",{error:h,message:"Failed to setup NanoPlayer"})),(p=u(this,_i))==null||p.call(this)}}}async play(){if(u(this,_o)&&await u(this,_o),u(this,de)){_(this,yo,!0),u(this,de).play();return}return super.play()}pause(){if(u(this,de)){u(this,de).pause();return}super.pause()}get currentTime(){var t;return((t=u(this,Se))==null?void 0:t.currentTime)??super.currentTime}set currentTime(t){u(this,de)||(super.currentTime=t)}get duration(){return 1/0}get paused(){var t;return((t=u(this,Se))==null?void 0:t.paused)??super.paused}get volume(){var t;return((t=u(this,Se))==null?void 0:t.volume)??super.volume}set volume(t){u(this,Se)?u(this,Se).volume=t:super.volume=t}get muted(){var t;return((t=u(this,Se))==null?void 0:t.muted)??super.muted}set muted(t){u(this,Se)&&(u(this,Se).muted=t),u(this,de)?t?u(this,de).mute():u(this,de).unmute():super.muted=t}get videoWidth(){var t;return((t=u(this,Se))==null?void 0:t.videoWidth)??super.videoWidth}get videoHeight(){var t;return((t=u(this,Se))==null?void 0:t.videoHeight)??super.videoHeight}disconnectedCallback(){var t;U(this,ke,xc).call(this),(t=super.disconnectedCallback)==null||t.call(this)}};Vt=new WeakMap,Ei=new WeakMap,de=new WeakMap,rt=new WeakMap,bo=new WeakMap,Se=new WeakMap,Zn=new WeakMap,bi=new WeakMap,rr=new WeakMap,_o=new WeakMap,_i=new WeakMap,yo=new WeakMap,ke=new WeakSet,xc=function(){u(this,bi).forEach(t=>t()),_(this,bi,[]),u(this,de)&&(u(this,de).destroy(),_(this,de,null),this.api=null),u(this,rt)&&(u(this,rt).remove(),_(this,rt,null)),_(this,Se,null),_(this,rr,[])},dm=function(t,r){var n,a;return{source:r??{group:{id:t},options:{adaption:{rule:"deviationOfMean2"},switch:{method:"server",pauseOnError:!1,forcePlay:!0,timeout:10}}},playback:{autoplay:this.nativeEl.autoplay,muted:this.nativeEl.muted,reconnect:((n=u(this,Vt))==null?void 0:n.reconnect)??{minDelay:2,maxDelay:10,delaySteps:10,maxRetries:10},buffer:((a=u(this,Vt))==null?void 0:a.buffer)??{min:.1,max:2,target:.5}},style:{width:"100%",height:"100%",controls:!1,view:!1,interactive:!1},events:{onReady:()=>{var l;this.dispatchEvent(new Event("loadeddata",{bubbles:!0})),this.dispatchEvent(new Event("canplay",{bubbles:!0})),this.dispatchEvent(new Event("canplaythrough",{bubbles:!0})),(l=u(this,_i))==null||l.call(this)},onPlay:()=>{_(this,yo,!1),this.dispatchEvent(new Event("play",{bubbles:!0})),this.dispatchEvent(new Event("playing",{bubbles:!0}))},onPause:()=>{this.dispatchEvent(new Event("pause",{bubbles:!0}))},onLoading:()=>{this.dispatchEvent(new Event("waiting",{bubbles:!0}))},onStartBuffering:()=>{this.dispatchEvent(new Event("waiting",{bubbles:!0}))},onStopBuffering:()=>{this.dispatchEvent(new Event("canplaythrough",{bubbles:!0})),this.dispatchEvent(new Event("playing",{bubbles:!0}))},onError:l=>{var p;let c=new Error(l.data.message??"NanoPlayer error");this.dispatchEvent(new ErrorEvent("error",{error:c,message:l.data.message,bubbles:!0})),(p=u(this,_i))==null||p.call(this)},onActiveVideoElementChange:l=>{var p;let c=(p=l.data)==null?void 0:p.activeVideoElement;c&&(_(this,Se,c),U(this,ke,cm).call(this,c))}}}},cm=function(t){u(this,bi).forEach(o=>o()),_(this,bi,[]);let r=["timeupdate","volumechange","durationchange","resize"];for(let o of r){let n=()=>{this.dispatchEvent(new Event(o,{bubbles:!0}))};t.addEventListener(o,n),u(this,bi).push(()=>t.removeEventListener(o,n))}},um=function(){for(let o of this.videoTracks)this.removeVideoTrack(o);if(u(this,rr).length===0)return;let t=this.addVideoTrack("main");t.id="main",t.selected=!0;for(let o of u(this,rr)){let n=t.addRendition("",o.width,o.height,void 0,o.bitrate);n.id=`${o.index}`}let r=()=>{var n,a,l;let o=this.videoRenditions.selectedIndex;o<0?(_(this,Zn,!0),(n=u(this,de))==null||n.setAdaption({rule:"deviationOfMean2"})):(_(this,Zn,!1),(a=u(this,de))==null||a.switchStream(o).catch(()=>{}),(l=u(this,de))==null||l.setAdaption({rule:"none"}))};this.videoRenditions.addEventListener("change",r)},vl=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let r=this[t];delete this[t],this[t]=r}},or.shadowRootOptions={...De.shadowRootOptions};globalThis.customElements&&!globalThis.customElements.get("nano-video")&&globalThis.customElements.define("nano-video",or);var hm=or;import{Room as DE,RoomEvent as To,Track as pm,VideoQuality as OE}from"livekit-client";var UE=go(De),Ye,_e,re,Lt,Ao,wt,So,ko,ce,Pc,mm,vm,fl,fm,gm,gl,nr=class extends UE{constructor(){super();S(this,ce);S(this,Ye,null);S(this,_e,null);S(this,re,null);S(this,Lt,[]);S(this,Ao,[]);S(this,wt,"disconnected");S(this,So,null);S(this,ko,null);this.room=null;U(this,ce,gl).call(this,"config"),U(this,ce,gl).call(this,"url"),U(this,ce,gl).call(this,"token")}static get observedAttributes(){return[...De.observedAttributes,"url","token"]}static getTemplateHTML(t,r={}){let{url:o,token:n,...a}=t;return`
2783
2783
  <script type="application/json" id="config">
2784
2784
  ${JSON.stringify(r.config||{})}
2785
2785
  <\/script>
2786
2786
  ${De.getTemplateHTML(a)}
2787
- `}get config(){return u(this,Ye)}set config(t){_(this,Ye,t)}get url(){return this.getAttribute("url")}set url(t){t?this.setAttribute("url",t):this.removeAttribute("url")}get token(){return this.getAttribute("token")}set token(t){t?this.setAttribute("token",t):this.removeAttribute("token")}attributeChangedCallback(t,r,o){(t==="url"||t==="token")&&r!==o?this.url&&this.token&&this.load():t!=="url"&&t!=="token"&&super.attributeChangedCallback(t,r,o)}async load(){var l,c,p;let t=!u(this,_e);U(this,ce,Pc).call(this);let r=this.url,o=this.token;if(!r||!o)return;_(this,So,new Promise(h=>{_(this,ko,h)})),t&&!u(this,Ye)&&_(this,Ye,JSON.parse(((c=(l=this.shadowRoot)==null?void 0:l.getElementById("config"))==null?void 0:c.textContent)||"{}"));let n=U(this,ce,Em).call(this),a=U(this,ce,bm).call(this);_(this,_e,new UE(n)),this.room=u(this,_e),u(this,_e).on(To.Connected,()=>{_(this,wt,"connected")}),u(this,_e).on(To.Disconnected,()=>{_(this,wt,"disconnected"),this.dispatchEvent(new Event("ended"))}),u(this,_e).on(To.Reconnecting,()=>{_(this,wt,"reconnecting"),this.dispatchEvent(new Event("waiting"))}),u(this,_e).on(To.Reconnected,()=>{_(this,wt,"connected"),this.dispatchEvent(new Event("playing"))}),u(this,_e).on(To.TrackSubscribed,(h,v,g)=>{var m,A;if(h.kind===vm.Kind.Video){let f=h.attach();f.style.width="100%",f.style.height="100%",f.style.objectFit="contain",f.style.position="absolute",f.style.top="0",f.style.left="0",this.nativeEl.muted&&(f.muted=!0),this.nativeEl.style.display="none",(m=this.shadowRoot)==null||m.appendChild(f),_(this,re,f),U(this,ce,fm).call(this,f),U(this,ce,gm).call(this,v),this.dispatchEvent(new Event("loadedmetadata")),this.dispatchEvent(new Event("resize")),this.dispatchEvent(new Event("canplay")),this.dispatchEvent(new Event("playing")),(A=u(this,ko))==null||A.call(this)}}),u(this,_e).on(To.TrackUnsubscribed,h=>{h.kind===vm.Kind.Video&&(h.detach(),U(this,ce,fl).call(this),u(this,re)&&(u(this,Lt).forEach(v=>v()),_(this,Lt,[]),u(this,re).remove(),_(this,re,null)))}),_(this,wt,"connecting"),this.dispatchEvent(new Event("loadstart"));try{await u(this,_e).connect(r,o,a)}catch(h){_(this,wt,"failed"),console.error("[livekit-video] Failed to connect:",h),this.dispatchEvent(new ErrorEvent("error",{error:h,message:h instanceof Error?h.message:"Failed to connect to LiveKit room"})),(p=u(this,ko))==null||p.call(this)}}async play(){return u(this,So)&&await u(this,So),u(this,re)?u(this,re).play():super.play()}pause(){if(u(this,re)){u(this,re).pause();return}super.pause()}get currentTime(){var t;return((t=u(this,re))==null?void 0:t.currentTime)??super.currentTime}set currentTime(t){u(this,_e)||(super.currentTime=t)}get duration(){return 1/0}get paused(){var t;return((t=u(this,re))==null?void 0:t.paused)??super.paused}get volume(){var t;return((t=u(this,re))==null?void 0:t.volume)??super.volume}set volume(t){u(this,re)?u(this,re).volume=t:super.volume=t}get muted(){var t;return((t=u(this,re))==null?void 0:t.muted)??super.muted}set muted(t){u(this,re)?u(this,re).muted=t:super.muted=t}get videoWidth(){var t;return((t=u(this,re))==null?void 0:t.videoWidth)??super.videoWidth}get videoHeight(){var t;return((t=u(this,re))==null?void 0:t.videoHeight)??super.videoHeight}disconnectedCallback(){var t;U(this,ce,Pc).call(this),(t=super.disconnectedCallback)==null||t.call(this)}};Ye=new WeakMap,_e=new WeakMap,re=new WeakMap,Lt=new WeakMap,Ao=new WeakMap,wt=new WeakMap,So=new WeakMap,ko=new WeakMap,ce=new WeakSet,Pc=function(){u(this,Lt).forEach(t=>t()),_(this,Lt,[]),U(this,ce,fl).call(this),u(this,_e)&&(u(this,_e).disconnect(),_(this,_e,null),this.room=null),u(this,re)&&(u(this,re).remove(),_(this,re,null)),_(this,wt,"disconnected")},fm=function(t){u(this,Lt).forEach(o=>o()),_(this,Lt,[]);let r=["timeupdate","volumechange","play","playing","pause","resize"];for(let o of r){let n=()=>{this.dispatchEvent(new Event(o))};t.addEventListener(o,n),u(this,Lt).push(()=>t.removeEventListener(o,n))}},gm=function(t){var l;U(this,ce,fl).call(this);let r=(l=t.trackInfo)==null?void 0:l.layers;if(!r||r.length===0)return;let o=this.addVideoTrack("main");o.id="main",o.selected=!0;let n=[...r].sort((c,p)=>c.quality-p.quality);for(let c of n){let p=o.addRendition("",c.width,c.height,void 0,c.bitrate);p.id=`${c.quality}`}let a=()=>{let c=this.videoRenditions.selectedIndex;if(c<0)t.setVideoQuality(NE.HIGH);else{let p=n[c];p&&t.setVideoQuality(p.quality)}};this.videoRenditions.addEventListener("change",a),u(this,Ao).push(()=>this.videoRenditions.removeEventListener("change",a))},fl=function(){u(this,Ao).forEach(t=>t()),_(this,Ao,[]);for(let t of this.videoTracks)this.removeVideoTrack(t)},Em=function(){var t,r,o;return{adaptiveStream:((t=u(this,Ye))==null?void 0:t.adaptiveStream)??!1,dynacast:((r=u(this,Ye))==null?void 0:r.dynacast)??!0,disconnectOnPageLeave:((o=u(this,Ye))==null?void 0:o.disconnectOnPageLeave)??!1}},bm=function(){var t,r;return{autoSubscribe:!0,peerConnectionTimeout:((t=u(this,Ye))==null?void 0:t.peerConnectionTimeout)??8e3,rtcConfig:{iceTransportPolicy:((r=u(this,Ye))==null?void 0:r.iceTransportPolicy)??"relay"}}},gl=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let r=this[t];delete this[t],this[t]=r}},nr.shadowRootOptions={...De.shadowRootOptions};globalThis.customElements&&!globalThis.customElements.get("livekit-video")&&globalThis.customElements.define("livekit-video",nr);var _m=nr;export{la as Attribute,Z as BPDefaultUI,oi as BPErrorDisplay,Mt as BPLiveError,Ho as BPLiveService,Nt as BPOverlay,Ee as BPPlayer,We as Hls,ir as HlsVideo,cm as HlsVideoElement,nr as LiveKitVideo,_m as LiveKitVideoElement,Fm as NANOPLAYER_NO_REPLAY_CODES,or as NanoVideo,mm as NanoVideoElement,na as PlayerCoreImpl,Qm as StateReceiverMixin,hr as StateReceiverProps,Bo as addGlobalStyles,Km as classifyNanoPlayerError,ra as createInitialState,Dl as createPlayerCore,jm as createTemplate,pr as forEachStateReceiverElement,ur as isBPLiveClipSource,qm as isBPLiveSource,oa as isBPLiveStreamSource,Ol as isStateReceiverElement,aa as propagateStateToReceiver,sa as removeStateFromReceiver,ev as templateWithStyles,Ce as toggleAttribute};
2787
+ `}get config(){return u(this,Ye)}set config(t){_(this,Ye,t)}get url(){return this.getAttribute("url")}set url(t){t?this.setAttribute("url",t):this.removeAttribute("url")}get token(){return this.getAttribute("token")}set token(t){t?this.setAttribute("token",t):this.removeAttribute("token")}attributeChangedCallback(t,r,o){(t==="url"||t==="token")&&r!==o?this.url&&this.token&&this.load():t!=="url"&&t!=="token"&&super.attributeChangedCallback(t,r,o)}async load(){var l,c,p;let t=!u(this,_e);U(this,ce,Pc).call(this);let r=this.url,o=this.token;if(!r||!o)return;_(this,So,new Promise(h=>{_(this,ko,h)})),t&&!u(this,Ye)&&_(this,Ye,JSON.parse(((c=(l=this.shadowRoot)==null?void 0:l.getElementById("config"))==null?void 0:c.textContent)||"{}"));let n=U(this,ce,fm).call(this),a=U(this,ce,gm).call(this);_(this,_e,new DE(n)),this.room=u(this,_e),u(this,_e).on(To.Connected,()=>{_(this,wt,"connected")}),u(this,_e).on(To.Disconnected,()=>{_(this,wt,"disconnected"),this.dispatchEvent(new Event("ended"))}),u(this,_e).on(To.Reconnecting,()=>{_(this,wt,"reconnecting"),this.dispatchEvent(new Event("waiting"))}),u(this,_e).on(To.Reconnected,()=>{_(this,wt,"connected"),this.dispatchEvent(new Event("playing"))}),u(this,_e).on(To.TrackSubscribed,(h,v,g)=>{var m,A;if(h.kind===pm.Kind.Video){let f=h.attach();f.style.width="100%",f.style.height="100%",f.style.objectFit="contain",f.style.position="absolute",f.style.top="0",f.style.left="0",this.nativeEl.muted&&(f.muted=!0),this.nativeEl.style.display="none",(m=this.shadowRoot)==null||m.appendChild(f),_(this,re,f),U(this,ce,mm).call(this,f),U(this,ce,vm).call(this,v),this.dispatchEvent(new Event("loadedmetadata")),this.dispatchEvent(new Event("resize")),this.dispatchEvent(new Event("canplay")),this.dispatchEvent(new Event("playing")),(A=u(this,ko))==null||A.call(this)}}),u(this,_e).on(To.TrackUnsubscribed,h=>{h.kind===pm.Kind.Video&&(h.detach(),U(this,ce,fl).call(this),u(this,re)&&(u(this,Lt).forEach(v=>v()),_(this,Lt,[]),u(this,re).remove(),_(this,re,null)))}),_(this,wt,"connecting"),this.dispatchEvent(new Event("loadstart"));try{await u(this,_e).connect(r,o,a)}catch(h){_(this,wt,"failed"),console.error("[livekit-video] Failed to connect:",h),this.dispatchEvent(new ErrorEvent("error",{error:h,message:h instanceof Error?h.message:"Failed to connect to LiveKit room"})),(p=u(this,ko))==null||p.call(this)}}async play(){return u(this,So)&&await u(this,So),u(this,re)?u(this,re).play():super.play()}pause(){if(u(this,re)){u(this,re).pause();return}super.pause()}get currentTime(){var t;return((t=u(this,re))==null?void 0:t.currentTime)??super.currentTime}set currentTime(t){u(this,_e)||(super.currentTime=t)}get duration(){return 1/0}get paused(){var t;return((t=u(this,re))==null?void 0:t.paused)??super.paused}get volume(){var t;return((t=u(this,re))==null?void 0:t.volume)??super.volume}set volume(t){u(this,re)?u(this,re).volume=t:super.volume=t}get muted(){var t;return((t=u(this,re))==null?void 0:t.muted)??super.muted}set muted(t){u(this,re)?u(this,re).muted=t:super.muted=t}get videoWidth(){var t;return((t=u(this,re))==null?void 0:t.videoWidth)??super.videoWidth}get videoHeight(){var t;return((t=u(this,re))==null?void 0:t.videoHeight)??super.videoHeight}disconnectedCallback(){var t;U(this,ce,Pc).call(this),(t=super.disconnectedCallback)==null||t.call(this)}};Ye=new WeakMap,_e=new WeakMap,re=new WeakMap,Lt=new WeakMap,Ao=new WeakMap,wt=new WeakMap,So=new WeakMap,ko=new WeakMap,ce=new WeakSet,Pc=function(){u(this,Lt).forEach(t=>t()),_(this,Lt,[]),U(this,ce,fl).call(this),u(this,_e)&&(u(this,_e).disconnect(),_(this,_e,null),this.room=null),u(this,re)&&(u(this,re).remove(),_(this,re,null)),_(this,wt,"disconnected")},mm=function(t){u(this,Lt).forEach(o=>o()),_(this,Lt,[]);let r=["timeupdate","volumechange","play","playing","pause","resize"];for(let o of r){let n=()=>{this.dispatchEvent(new Event(o))};t.addEventListener(o,n),u(this,Lt).push(()=>t.removeEventListener(o,n))}},vm=function(t){var l;U(this,ce,fl).call(this);let r=(l=t.trackInfo)==null?void 0:l.layers;if(!r||r.length===0)return;let o=this.addVideoTrack("main");o.id="main",o.selected=!0;let n=[...r].sort((c,p)=>c.quality-p.quality);for(let c of n){let p=o.addRendition("",c.width,c.height,void 0,c.bitrate);p.id=`${c.quality}`}let a=()=>{let c=this.videoRenditions.selectedIndex;if(c<0)t.setVideoQuality(OE.HIGH);else{let p=n[c];p&&t.setVideoQuality(p.quality)}};this.videoRenditions.addEventListener("change",a),u(this,Ao).push(()=>this.videoRenditions.removeEventListener("change",a))},fl=function(){u(this,Ao).forEach(t=>t()),_(this,Ao,[]);for(let t of this.videoTracks)this.removeVideoTrack(t)},fm=function(){var t,r,o;return{adaptiveStream:((t=u(this,Ye))==null?void 0:t.adaptiveStream)??!1,dynacast:((r=u(this,Ye))==null?void 0:r.dynacast)??!0,disconnectOnPageLeave:((o=u(this,Ye))==null?void 0:o.disconnectOnPageLeave)??!1}},gm=function(){var t,r;return{autoSubscribe:!0,peerConnectionTimeout:((t=u(this,Ye))==null?void 0:t.peerConnectionTimeout)??8e3,rtcConfig:{iceTransportPolicy:((r=u(this,Ye))==null?void 0:r.iceTransportPolicy)??"relay"}}},gl=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let r=this[t];delete this[t],this[t]=r}},nr.shadowRootOptions={...De.shadowRootOptions};globalThis.customElements&&!globalThis.customElements.get("livekit-video")&&globalThis.customElements.define("livekit-video",nr);var Em=nr;export{la as Attribute,Z as BPDefaultUI,oi as BPErrorDisplay,Mt as BPLiveError,Ho as BPLiveService,Nt as BPOverlay,Ee as BPPlayer,We as Hls,ir as HlsVideo,lm as HlsVideoElement,nr as LiveKitVideo,Em as LiveKitVideoElement,Vm as NANOPLAYER_NO_REPLAY_CODES,or as NanoVideo,hm as NanoVideoElement,na as PlayerCoreImpl,zm as StateReceiverMixin,hr as StateReceiverProps,Bo as addGlobalStyles,Wm as classifyNanoPlayerError,ra as createInitialState,Dl as createPlayerCore,Xm as createTemplate,pr as forEachStateReceiverElement,ur as isBPLiveClipSource,Fm as isBPLiveSource,oa as isBPLiveStreamSource,Ol as isStateReceiverElement,aa as propagateStateToReceiver,sa as removeStateFromReceiver,Jm as templateWithStyles,Ie as toggleAttribute};
2788
2788
  /*! Bundled license information:
2789
2789
 
2790
2790
  @lit/reactive-element/css-tag.js: