@broadcastingplatforms/player 1.4.7 → 1.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bp-player.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* BP Player (v1.4.
|
|
2
|
+
* BP Player (v1.4.8)
|
|
3
3
|
* Universal video player web component
|
|
4
4
|
*/
|
|
5
|
-
var Nu=Object.defineProperty;var uv=Object.getOwnPropertyDescriptor;var Uu=i=>{throw TypeError(i)};var hv=(i,e,t)=>e in i?Nu(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var $=(i,e,t,r)=>{for(var n=r>1?void 0:r?uv(e,t):e,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(r?s(e,t,n):s(n))||n);return r&&n&&Nu(e,t,n),n};var W=(i,e,t)=>hv(i,typeof e!="symbol"?e+"":e,t),zl=(i,e,t)=>e.has(i)||Uu("Cannot "+t);var u=(i,e,t)=>(zl(i,e,"read from private field"),t?t.call(i):e.get(i)),L=(i,e,t)=>e.has(i)?Uu("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),E=(i,e,t,r)=>(zl(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),D=(i,e,t)=>(zl(i,e,"access private method"),t);var ys=globalThis,Ts=ys.ShadowRoot&&(ys.ShadyCSS===void 0||ys.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Yl=Symbol(),Hu=new WeakMap,Kn=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(Ts&&e===void 0){let r=t!==void 0&&t.length===1;r&&(e=Hu.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&Hu.set(t,e))}return e}toString(){return this.cssText}},$u=i=>new Kn(typeof i=="string"?i:i+"",void 0,Yl),qn=(i,...e)=>{let t=i.length===1?i[0]:e.reduce((r,n,o)=>r+(s=>{if(s._$cssResult$===!0)return s.cssText;if(typeof s=="number")return s;throw Error("Value passed to 'css' function must be a 'css' function result: "+s+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+i[o+1],i[0]);return new Kn(t,i,Yl)},
|
|
5
|
+
var Nu=Object.defineProperty;var uv=Object.getOwnPropertyDescriptor;var Uu=i=>{throw TypeError(i)};var hv=(i,e,t)=>e in i?Nu(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var $=(i,e,t,r)=>{for(var n=r>1?void 0:r?uv(e,t):e,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(r?s(e,t,n):s(n))||n);return r&&n&&Nu(e,t,n),n};var W=(i,e,t)=>hv(i,typeof e!="symbol"?e+"":e,t),zl=(i,e,t)=>e.has(i)||Uu("Cannot "+t);var u=(i,e,t)=>(zl(i,e,"read from private field"),t?t.call(i):e.get(i)),L=(i,e,t)=>e.has(i)?Uu("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),E=(i,e,t,r)=>(zl(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),D=(i,e,t)=>(zl(i,e,"access private method"),t);var ys=globalThis,Ts=ys.ShadowRoot&&(ys.ShadyCSS===void 0||ys.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Yl=Symbol(),Hu=new WeakMap,Kn=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(Ts&&e===void 0){let r=t!==void 0&&t.length===1;r&&(e=Hu.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&Hu.set(t,e))}return e}toString(){return this.cssText}},$u=i=>new Kn(typeof i=="string"?i:i+"",void 0,Yl),qn=(i,...e)=>{let t=i.length===1?i[0]:e.reduce((r,n,o)=>r+(s=>{if(s._$cssResult$===!0)return s.cssText;if(typeof s=="number")return s;throw Error("Value passed to 'css' function must be a 'css' function result: "+s+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+i[o+1],i[0]);return new Kn(t,i,Yl)},Vu=(i,e)=>{if(Ts)i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let r=document.createElement("style"),n=ys.litNonce;n!==void 0&&r.setAttribute("nonce",n),r.textContent=t.cssText,i.appendChild(r)}},Ql=Ts?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(let r of e.cssRules)t+=r.cssText;return $u(t)})(i):i;var{is:pv,defineProperty:mv,getOwnPropertyDescriptor:vv,getOwnPropertyNames:fv,getOwnPropertySymbols:Ev,getPrototypeOf:gv}=Object,jt=globalThis,Bu=jt.trustedTypes,bv=Bu?Bu.emptyScript:"",Zl=jt.reactiveElementPolyfillSupport,Gn=(i,e)=>i,zn={toAttribute(i,e){switch(e){case Boolean:i=i?bv: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}},As=(i,e)=>!pv(i,e),Wu={attribute:!0,type:String,converter:zn,reflect:!1,useDefault:!1,hasChanged:As};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),jt.litPropertyMetadata??(jt.litPropertyMetadata=new WeakMap);var Ht=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=Wu){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(),n=this.getPropertyDescriptor(e,r,t);n!==void 0&&mv(this.prototype,e,n)}}static getPropertyDescriptor(e,t,r){let{get:n,set:o}=vv(this.prototype,e)??{get(){return this[t]},set(s){this[t]=s}};return{get:n,set(s){let l=n==null?void 0:n.call(this);o==null||o.call(this,s),this.requestUpdate(e,l,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Wu}static _$Ei(){if(this.hasOwnProperty(Gn("elementProperties")))return;let e=gv(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Gn("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Gn("properties"))){let t=this.properties,r=[...fv(t),...Ev(t)];for(let n of r)this.createProperty(n,t[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[r,n]of t)this.elementProperties.set(r,n)}this._$Eh=new Map;for(let[t,r]of this.elementProperties){let n=this._$Eu(t,r);n!==void 0&&this._$Eh.set(n,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 n of r)t.unshift(Ql(n))}else e!==void 0&&t.push(Ql(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 Vu(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 o;let r=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,r);if(n!==void 0&&r.reflect===!0){let s=(((o=r.converter)==null?void 0:o.toAttribute)!==void 0?r.converter:zn).toAttribute(t,r.type);this._$Em=e,s==null?this.removeAttribute(n):this.setAttribute(n,s),this._$Em=null}}_$AK(e,t){var o,s;let r=this.constructor,n=r._$Eh.get(e);if(n!==void 0&&this._$Em!==n){let l=r.getPropertyOptions(n),d=typeof l.converter=="function"?{fromAttribute:l.converter}:((o=l.converter)==null?void 0:o.fromAttribute)!==void 0?l.converter:zn;this._$Em=n;let h=d.fromAttribute(t,l.type);this[n]=h??((s=this._$Ej)==null?void 0:s.get(n))??h,this._$Em=null}}requestUpdate(e,t,r,n=!1,o){var s;if(e!==void 0){let l=this.constructor;if(n===!1&&(o=this[e]),r??(r=l.getPropertyOptions(e)),!((r.hasChanged??As)(o,t)||r.useDefault&&r.reflect&&o===((s=this._$Ej)==null?void 0:s.get(e))&&!this.hasAttribute(l._$Eu(e,r))))return;this.C(e,t,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:r,reflect:n,wrapped:o},s){r&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,s??t??this[e]),o!==!0||s!==void 0)||(this._$AL.has(e)||(this.hasUpdated||r||(t=void 0),this._$AL.set(e,t)),n===!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[o,s]of this._$Ep)this[o]=s;this._$Ep=void 0}let n=this.constructor.elementProperties;if(n.size>0)for(let[o,s]of n){let{wrapped:l}=s,d=this[o];l!==!0||this._$AL.has(o)||d===void 0||this.C(o,void 0,s,d)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(r=this._$EO)==null||r.forEach(n=>{var o;return(o=n.hostUpdate)==null?void 0:o.call(n)}),this.update(t)):this._$EM()}catch(n){throw e=!1,this._$EM(),n}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(r=>{var n;return(n=r.hostUpdated)==null?void 0:n.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){}};Ht.elementStyles=[],Ht.shadowRootOptions={mode:"open"},Ht[Gn("elementProperties")]=new Map,Ht[Gn("finalized")]=new Map,Zl==null||Zl({ReactiveElement:Ht}),(jt.reactiveElementVersions??(jt.reactiveElementVersions=[])).push("2.1.2");var Qn=globalThis,Fu=i=>i,Ss=Qn.trustedTypes,Ku=Ss?Ss.createPolicy("lit-html",{createHTML:i=>i}):void 0,Zu="$lit$",Jt=`lit$${Math.random().toFixed(9).slice(2)}$`,Xu="?"+Jt,_v=`<${Xu}>`,Ni=document,Zn=()=>Ni.createComment(""),Xn=i=>i===null||typeof i!="object"&&typeof i!="function",nd=Array.isArray,yv=i=>nd(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",Xl=`[
|
|
6
6
|
\f\r]`,Yn=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,qu=/-->/g,Gu=/>/g,Di=RegExp(`>|${Xl}(?:([^\\s"'>=/]+)(${Xl}*=${Xl}*(?:[^
|
|
7
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),zu=/'/g,Yu=/"/g,ju=/^(?:script|style|textarea|title)$/i,od=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),Ye=od(1),kb=od(2),Lb=od(3),Ui=Symbol.for("lit-noChange"),_e=Symbol.for("lit-nothing"),Qu=new WeakMap,Oi=Ni.createTreeWalker(Ni,129);function Ju(i,e){if(!nd(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ku!==void 0?Ku.createHTML(e):e}var Tv=(i,e)=>{let t=i.length-1,r=[],n,o=e===2?"<svg>":e===3?"<math>":"",s=Yn;for(let l=0;l<t;l++){let d=i[l],h,p,v=-1,f=0;for(;f<d.length&&(s.lastIndex=f,p=s.exec(d),p!==null);)f=s.lastIndex,s===Yn?p[1]==="!--"?s=qu:p[1]!==void 0?s=Gu:p[2]!==void 0?(ju.test(p[2])&&(n=RegExp("</"+p[2],"g")),s=Di):p[3]!==void 0&&(s=Di):s===Di?p[0]===">"?(s=n??Yn,v=-1):p[1]===void 0?v=-2:(v=s.lastIndex-p[2].length,h=p[1],s=p[3]===void 0?Di:p[3]==='"'?Yu:zu):s===Yu||s===zu?s=Di:s===qu||s===Gu?s=Yn:(s=Di,n=void 0);let m=s===Di&&i[l+1].startsWith("/>")?" ":"";o+=s===Yn?d+_v:v>=0?(r.push(h),d.slice(0,v)+Zu+d.slice(v)+Jt+m):d+Jt+(v===-2?l:m)}return[Ju(i,o+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},jn=class i{constructor({strings:e,_$litType$:t},r){let n;this.parts=[];let o=0,s=0,l=e.length-1,d=this.parts,[h,p]=Tv(e,t);if(this.el=i.createElement(h,r),Oi.currentNode=this.el.content,t===2||t===3){let v=this.el.content.firstChild;v.replaceWith(...v.childNodes)}for(;(n=Oi.nextNode())!==null&&d.length<l;){if(n.nodeType===1){if(n.hasAttributes())for(let v of n.getAttributeNames())if(v.endsWith(Zu)){let f=p[s++],m=n.getAttribute(v).split(Jt),_=/([.?@])?(.*)/.exec(f);d.push({type:1,index:o,name:_[2],strings:m,ctor:_[1]==="."?ed:_[1]==="?"?td:_[1]==="@"?id:Ir}),n.removeAttribute(v)}else v.startsWith(Jt)&&(d.push({type:6,index:o}),n.removeAttribute(v));if(ju.test(n.tagName)){let v=n.textContent.split(Jt),f=v.length-1;if(f>0){n.textContent=Ss?Ss.emptyScript:"";for(let m=0;m<f;m++)n.append(v[m],Zn()),Oi.nextNode(),d.push({type:2,index:++o});n.append(v[f],Zn())}}}else if(n.nodeType===8)if(n.data===Xu)d.push({type:2,index:o});else{let v=-1;for(;(v=n.data.indexOf(Jt,v+1))!==-1;)d.push({type:7,index:o}),v+=Jt.length-1}o++}}static createElement(e,t){let r=Ni.createElement("template");return r.innerHTML=e,r}};function Lr(i,e,t=i,r){var s,l;if(e===Ui)return e;let n=r!==void 0?(s=t._$Co)==null?void 0:s[r]:t._$Cl,o=Xn(e)?void 0:e._$litDirective$;return(n==null?void 0:n.constructor)!==o&&((l=n==null?void 0:n._$AO)==null||l.call(n,!1),o===void 0?n=void 0:(n=new o(i),n._$AT(i,t,r)),r!==void 0?(t._$Co??(t._$Co=[]))[r]=n:t._$Cl=n),n!==void 0&&(e=Lr(i,n._$AS(i,e.values),n,r)),e}var Jl=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,n=((e==null?void 0:e.creationScope)??Ni).importNode(t,!0);Oi.currentNode=n;let o=Oi.nextNode(),s=0,l=0,d=r[0];for(;d!==void 0;){if(s===d.index){let h;d.type===2?h=new Jn(o,o.nextSibling,this,e):d.type===1?h=new d.ctor(o,d.name,d.strings,this,e):d.type===6&&(h=new rd(o,this,e)),this._$AV.push(h),d=r[++l]}s!==(d==null?void 0:d.index)&&(o=Oi.nextNode(),s++)}return Oi.currentNode=Ni,n}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++}},Jn=class i{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,r,n){this.type=2,this._$AH=_e,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=n,this._$Cv=(n==null?void 0:n.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=Lr(this,e,t),Xn(e)?e===_e||e==null||e===""?(this._$AH!==_e&&this._$AR(),this._$AH=_e):e!==this._$AH&&e!==Ui&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):yv(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!==_e&&Xn(this._$AH)?this._$AA.nextSibling.data=e:this.T(Ni.createTextNode(e)),this._$AH=e}$(e){var o;let{values:t,_$litType$:r}=e,n=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=jn.createElement(Ju(r.h,r.h[0]),this.options)),r);if(((o=this._$AH)==null?void 0:o._$AD)===n)this._$AH.p(t);else{let s=new Jl(n,this),l=s.u(this.options);s.p(t),this.T(l),this._$AH=s}}_$AC(e){let t=Qu.get(e.strings);return t===void 0&&Qu.set(e.strings,t=new jn(e)),t}k(e){nd(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,n=0;for(let o of e)n===t.length?t.push(r=new i(this.O(Zn()),this.O(Zn()),this,this.options)):r=t[n],r._$AI(o),n++;n<t.length&&(this._$AR(r&&r._$AB.nextSibling,n),t.length=n)}_$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 n=Fu(e).nextSibling;Fu(e).remove(),e=n}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}},Ir=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,n,o){this.type=1,this._$AH=_e,this._$AN=void 0,this.element=e,this.name=t,this._$AM=n,this.options=o,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=_e}_$AI(e,t=this,r,n){let o=this.strings,s=!1;if(o===void 0)e=Lr(this,e,t,0),s=!Xn(e)||e!==this._$AH&&e!==Ui,s&&(this._$AH=e);else{let l=e,d,h;for(e=o[0],d=0;d<o.length-1;d++)h=Lr(this,l[r+d],t,d),h===Ui&&(h=this._$AH[d]),s||(s=!Xn(h)||h!==this._$AH[d]),h===_e?e=_e:e!==_e&&(e+=(h??"")+o[d+1]),this._$AH[d]=h}s&&!n&&this.j(e)}j(e){e===_e?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},ed=class extends Ir{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===_e?void 0:e}},td=class extends Ir{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==_e)}},id=class extends Ir{constructor(e,t,r,n,o){super(e,t,r,n,o),this.type=5}_$AI(e,t=this){if((e=Lr(this,e,t,0)??_e)===Ui)return;let r=this._$AH,n=e===_e&&r!==_e||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,o=e!==_e&&(r===_e||n);n&&this.element.removeEventListener(this.name,this,r),o&&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)}},rd=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){Lr(this,e)}};var jl=Qn.litHtmlPolyfillSupport;jl==null||jl(jn,Jn),(Qn.litHtmlVersions??(Qn.litHtmlVersions=[])).push("3.3.2");var eh=(i,e,t)=>{let r=(t==null?void 0:t.renderBefore)??e,n=r._$litPart$;if(n===void 0){let o=(t==null?void 0:t.renderBefore)??null;r._$litPart$=n=new Jn(e.insertBefore(Zn(),o),o,void 0,t??{})}return n._$AI(i),n};var Hi=globalThis,Me=class extends Ht{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=eh(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 Ui}},th;Me._$litElement$=!0,Me.finalized=!0,(th=Hi.litElementHydrateSupport)==null||th.call(Hi,{LitElement:Me});var sd=Hi.litElementPolyfillSupport;sd==null||sd({LitElement:Me});(Hi.litElementVersions??(Hi.litElementVersions=[])).push("4.2.2");var ei=i=>(e,t)=>{t!==void 0?t.addInitializer(()=>{customElements.define(i,e)}):customElements.define(i,e)};var Av={attribute:!0,type:String,converter:zn,reflect:!1,hasChanged:As},Sv=(i=Av,e,t)=>{let{kind:r,metadata:n}=t,o=globalThis.litPropertyMetadata.get(n);if(o===void 0&&globalThis.litPropertyMetadata.set(n,o=new Map),r==="setter"&&((i=Object.create(i)).wrapped=!0),o.set(t.name,i),r==="accessor"){let{name:s}=t;return{set(l){let d=e.get.call(this);e.set.call(this,l),this.requestUpdate(s,d,i,!0,l)},init(l){return l!==void 0&&this.C(s,void 0,i,l),l}}}if(r==="setter"){let{name:s}=t;return function(l){let d=this[s];e.call(this,l),this.requestUpdate(s,d,i,!0,l)}}throw Error("Unsupported decorator location: "+r)};function z(i){return(e,t)=>typeof t=="object"?Sv(i,e,t):((r,n,o)=>{let s=n.hasOwnProperty(o);return n.constructor.createProperty(o,r),s?Object.getOwnPropertyDescriptor(n,o):void 0})(i,e,t)}function ti(i){return z({...i,state:!0,attribute:!1})}var kv=[1005,1007,1008,1009,3001,3002,3003,3004,3005,3100,3101,3200,4003];function ad(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 ld(i){return i===4e3||i===4001?"network":"unknown"}function Ls(){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 Is(i){return typeof i=="object"&&i!==null&&"type"in i&&i.type==="bplive"&&"streamId"in i}function ws(i){return typeof i=="object"&&i!==null&&"type"in i&&i.type==="bplive"&&"clipId"in i}function dd(i){return Is(i)||ws(i)}var pt=class extends Error{constructor(t,r,n){super(t);this.code=r;this.status=n;this.name="BPLiveError"}},eo=class{constructor(e,t){this._authToken=null;this._stream=null;this._clip=null;this._config=e,this._authToken=e.authToken??null,this._network=t??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 pt("No auth token provided. Ensure config.bpLive.authToken is set before loading a BPLive source.","AUTH_REQUIRED");let t=`${this._config.discoveryUrl}${e}`,r={"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${this._authToken}`};if(this._network){let s=await this._network.intercept({url:t,method:"GET",type:"api",headers:r});if(s.response)return s.response.body;t=s.url,r=s.headers}let n=new AbortController,o=setTimeout(()=>n.abort(),3e4);try{let s=await fetch(t,{method:"GET",headers:r,signal:n.signal});if(!s.ok)throw new pt(`HTTP ${s.status}: ${s.statusText}`,"HTTP_ERROR",s.status);let l=await s.json();return this._network&&(l=(await this._network.interceptResponse({url:t,status:s.status,headers:Object.fromEntries(s.headers),body:l})).body),l}catch(s){throw s instanceof Error&&s.name==="AbortError"?new pt("Request timeout after 30s","TIMEOUT"):s}finally{clearTimeout(o)}}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 pt(`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 n=r.find(l=>l.orientation===t);if(n)return n;let o=t==="landscape"?"portrait":"landscape",s=r.find(l=>l.orientation===o);return s||r[0]}mapClipMediaToPlayerSource(e){return{type:"video",url:e.url}}async resolveSource(e){if(this._stream=null,this._clip=null,Is(e))return this.resolveStreamSource(e);if(ws(e))return this.resolveClipSource(e);throw new pt("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 l,d,h,p,v,f,m,_,g;let r=(await this.getStream(e.streamId)).data;this._stream=r;let n=this.extractStreamPoster(r);if(!!r.ended_at&&((d=(l=r.media)==null?void 0:l.vod)==null?void 0:d.length)>0){let I=r.media.vod[0];return{source:{type:"video",url:I.original},contentType:"video",poster:n??I.thumb??void 0,videoWidth:(h=I.dimension)==null?void 0:h.width,videoHeight:(p=I.dimension)==null?void 0:p.height}}let s=r.player_source??((v=r.active_stream)==null?void 0:v.player_source);if(s)return{source:this.mapPlayerSourceToResolvedSource(s),contentType:"stream",poster:n};if(((m=(f=r.media)==null?void 0:f.vod)==null?void 0:m.length)>0){let I=r.media.vod[0];return{source:{type:"video",url:I.original},contentType:"video",poster:n??I.thumb??void 0,videoWidth:(_=I.dimension)==null?void 0:_.width,videoHeight:(g=I.dimension)==null?void 0:g.height}}throw new pt("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 n=this.selectClipMedia(r.media,e.preferredOrientation);if(!n)throw new pt("No playable media found in clip","NO_MEDIA");return{source:this.mapClipMediaToPlayerSource(n),contentType:"clip",poster:n.thumbnail??void 0,videoWidth:n.width,videoHeight:n.height}}destroy(){this._authToken=null,this._stream=null,this._clip=null}};function to(i){return i!=null&&typeof i.then=="function"}function ih(i){return new Promise((e,t)=>{let r=!1,n=o=>{r||(r=!0,o?t(o):e())};try{let o=i(n);to(o)&&(r=!0,o.then(()=>e(),t))}catch(o){n(o)}})}var cd=class{constructor(e,t,r){this._closed=!1;this._pendingCount=0;this._firstError=null;this._redirectResult=null;this._responseResult=null;this.promise=new Promise((n,o)=>{this._resolve=n,this._reject=o}),this._state=e,this._interceptor=t,this._canModify=r,this._start()}get redirectResult(){return this._redirectResult}get responseResult(){return this._responseResult}get _open(){return this._canModify&&!this._closed}_close(){this._closed=!0,this._resolve()}_error(e){this._closed=!0,this._reject(e)}_start(){try{let e=this._interceptor(this._createFacade());to(e)?this._handleWaitUntil(e):!this._pendingCount&&!this._closed&&this._close()}catch(e){this._error(e)}}_createFacade(){let e=this;return{get url(){return e._state.url},get method(){return e._state.method},get type(){return e._state.type},get headers(){return{...e._state.headers}},get closed(){return!e._open},redirect(t){e._redirect(t)},respondWith(t){e._respondWith(t)},waitUntil(t){e._waitUntil(t)}}}_redirect(e){if(!this._open)throw new Error("Request is closed");let t=typeof e=="string"?{url:e}:e;this._redirectResult={url:t.url??this._state.url,method:t.method??this._state.method,type:this._state.type,headers:t.headers??{...this._state.headers}},this._close()}_respondWith(e){if(!this._open)throw new Error("Request is closed");this._responseResult=e,this._close()}_waitUntil(e){if(!this._open)throw new Error("Request is closed");to(e)?this._handleWaitUntil(e):typeof e=="function"&&this._handleWaitUntil(ih(e))}async _handleWaitUntil(e){this._pendingCount++;try{await e}catch(t){this._firstError||(this._firstError=t)}this._pendingCount--,!this._pendingCount&&!this._closed&&(this._firstError?this._error(this._firstError):this._close())}},ud=class{constructor(e,t){this._closed=!1;this._pendingCount=0;this._firstError=null;this._responseResult=null;this.promise=new Promise((r,n)=>{this._resolve=r,this._reject=n}),this._state=e,this._interceptor=t,this._start()}get responseResult(){return this._responseResult}_close(){this._closed=!0,this._resolve()}_error(e){this._closed=!0,this._reject(e)}_start(){try{let e=this._interceptor(this._createFacade());to(e)?this._handleWaitUntil(e):!this._pendingCount&&!this._closed&&this._close()}catch(e){this._error(e)}}_createFacade(){let e=this;return{get url(){return e._state.url},get status(){return e._state.status},get headers(){return{...e._state.headers}},get body(){return e._state.body},get closed(){return e._closed},respondWith(t){e._respondWith(t)},waitUntil(t){e._waitUntil(t)}}}_respondWith(e){if(this._closed)throw new Error("Response is closed");this._responseResult=e,this._close()}_waitUntil(e){if(this._closed)throw new Error("Response is closed");to(e)?this._handleWaitUntil(e):typeof e=="function"&&this._handleWaitUntil(ih(e))}async _handleWaitUntil(e){this._pendingCount++;try{await e}catch(t){this._firstError||(this._firstError=t)}this._pendingCount--,!this._pendingCount&&!this._closed&&(this._firstError?this._error(this._firstError):this._close())}},io=class{constructor(){this._requestInterceptors=[];this._responseInterceptors=[]}addRequestInterceptor(e){this._requestInterceptors.unshift(e)}removeRequestInterceptor(e){let t=this._requestInterceptors.indexOf(e);t>=0&&this._requestInterceptors.splice(t,1)}addResponseInterceptor(e){this._responseInterceptors.unshift(e)}removeResponseInterceptor(e){let t=this._responseInterceptors.indexOf(e);t>=0&&this._responseInterceptors.splice(t,1)}async intercept(e){let t={...e,headers:{...e.headers}},r=!1,n=null;for(let o of this._requestInterceptors.slice()){let s=new cd(t,o,!r);try{await s.promise}catch{continue}s.responseResult&&!r&&(r=!0,n=s.responseResult),s.redirectResult&&!r&&(t=s.redirectResult)}return{url:t.url,headers:t.headers,response:n}}async interceptResponse(e){let t={...e,headers:{...e.headers}};for(let r of this._responseInterceptors.slice()){let n=new ud(t,r);try{await n.promise}catch{continue}n.responseResult&&(t={...t,status:n.responseResult.status!==void 0?n.responseResult.status:t.status,headers:n.responseResult.headers!==void 0?n.responseResult.headers:t.headers,body:"body"in n.responseResult?n.responseResult.body:t.body})}return{status:t.status,headers:t.headers,body:t.body}}};function Lv(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 rh(i){return typeof i=="object"&&i!==null&&i.type==="bplive"}var Iv=["loadstart","loadedmetadata","loadeddata","canplay","canplaythrough","play","playing","pause","waiting","seeking","seeked","timeupdate","durationchange","ratechange","volumechange","ended","progress","error","resize"],hd=class{constructor(){this._mediaElement=null;this._container=null;this._listeners=new Map;this._eventCleanup=[];this._destroyed=!1;this._bpLive=null;this._network=new io;this._currentProviderType=null;this._ready=!1;this._loadGeneration=0;this._state=Ls()}get state(){return this._state}get videoElement(){return this._mediaElement}get activeVideoElement(){let e=this._mediaElement;return(e==null?void 0:e.activeVideoElement)??null}get bpLive(){return this._bpLive}get network(){return this._network}get ready(){return this._ready}get providerType(){return this._currentProviderType}addEventListener(e,t){let r=Array.isArray(e)?e:[e];for(let n of r)this._listeners.has(n)||this._listeners.set(n,new Set),this._listeners.get(n).add(t)}removeEventListener(e,t){let r=Array.isArray(e)?e:[e];for(let n of r){let o=this._listeners.get(n);o&&(o.delete(t),o.size===0&&this._listeners.delete(n))}}dispatch(e,t){let r=this._listeners.get(e);if(r)for(let n of r)try{n(t)}catch(o){console.error(`[PlayerCore] Error in event listener for "${e}":`,o)}}updateState(e){this._state={...this._state,...e},this.dispatch("statechange",{state:this._state})}attach(e,t){this._destroyed||(this._container=e,this._config=t,this._ready=!0)}async loadSource(e,t,r){if(this._destroyed)return;let n=++this._loadGeneration,o=t??this._container,s=r??this._config;if(!o){console.error("[PlayerCore] No container provided. Call attach() first or provide container to loadSource().");return}this._container=o,s&&(this._config=s);let l=rh(e)?"clipId"in e?"clip":"stream":void 0;this.updateState({error:null,connectionState:"connecting",ended:!1,...l&&{contentType:l}}),this.dispatch("sourcechange",{source:e});try{let d=e,h=this._state.contentType,p,v,f;if(rh(e)){if(s!=null&&s.bpLive&&(this._bpLive&&this._bpLive.destroy(),this._bpLive=new eo(s.bpLive,this._network)),!this._bpLive)throw new Error("BPLive source requires config.bpLive configuration.");let k=await this._bpLive.resolveSource(e);if(n!==this._loadGeneration)return;d=k.source,h=k.contentType,p=k.poster,v=k.videoWidth,f=k.videoHeight}let m=Lv(d),I=m==="nano"||m==="livekit"||h==="stream"?"live":"vod";return this._mediaElement&&this.destroyMediaElement(),this._currentProviderType=m,this.updateState({providerType:m,contentType:h,streamType:I,paused:!0,playing:!1,waiting:!1,seeking:!1,readyState:0,currentTime:0,duration:NaN,buffered:null}),this._mediaElement=this.createMediaElement(m,d,s),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),this.attachActiveVideoElementForwarding(this._mediaElement),o.appendChild(this._mediaElement),this._ready=!0,this.dispatch("videoelementchange",{video:this._mediaElement}),this.dispatch("activevideoelementchange",{video:this.activeVideoElement}),{poster:p,videoWidth:v,videoHeight:f}}catch(d){if(n!==this._loadGeneration)return;console.error("[PlayerCore] loadSource error:",d);let h={code:-1,message:d instanceof Error?d.message:"Failed to load source",fatal:!0,category:"setup"};this.updateState({error:h,connectionState:"failed"}),this.dispatch("error",h)}}destroyMediaElement(){if(this._eventCleanup.forEach(e=>e()),this._eventCleanup=[],this._mediaElement&&(this._mediaElement.remove(),this._mediaElement=null,this.dispatch("emptied",void 0),this.dispatch("videoelementchange",{video:null}),this.dispatch("activevideoelementchange",{video:null})),this._container)for(;this._container.firstChild;)this._container.removeChild(this._container.firstChild)}createMediaElement(e,t,r){switch(e){case"nano":{let n=document.createElement("nano-video"),o=t;return n.libraryLocation=(r==null?void 0:r.libraryLocation)??"/vendor/bp-player",o.source?n.sourceConfig=o.source:o.streamid&&(n.streamid=o.streamid),r!=null&&r.nano&&(n.config=r.nano),n}case"livekit":{let n=document.createElement("livekit-video"),o=t;return n.url=o.url,n.token=o.token,r!=null&&r.livekit&&(n.config=r.livekit),n}case"video":default:{let n=document.createElement("hls-video"),o=typeof t=="string"?t:t.url;n.src=o;let s={...r==null?void 0:r.video},l=this._network,d=s.xhrSetup;return s.xhrSetup=async(h,p)=>{let v=p.includes(".m3u8")?"manifest":p.includes(".ts")||p.includes(".m4s")||p.includes(".fmp4")?"segment":"other",f=await l.intercept({url:p,method:"GET",type:v,headers:{}});f.url!==p&&h.open("GET",f.url,!0);for(let[m,_]of Object.entries(f.headers))h.setRequestHeader(m,_);d&&await d(h,f.url)},n.config=s,n}}}attachMediaElementListeners(e){for(let t of Iv){let r=n=>this.handleMediaEvent(t,e,n);e.addEventListener(t,r),this._eventCleanup.push(()=>e.removeEventListener(t,r))}}attachActiveVideoElementForwarding(e){let t=r=>{let n=r.detail;this.dispatch("activevideoelementchange",{video:(n==null?void 0:n.video)??null})};e.addEventListener("activevideoelementchange",t),this._eventCleanup.push(()=>e.removeEventListener("activevideoelementchange",t))}handleMediaEvent(e,t,r){var n,o,s,l;switch(e){case"loadstart":this.updateState({readyState:1}),this.dispatch("loadstart",void 0);break;case"loadedmetadata":{let d=t.duration===1/0?"live":this._state.streamType;this.updateState({duration:t.duration,videoWidth:t.videoWidth,videoHeight:t.videoHeight,streamType:d}),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 d=t.duration===1/0?"live":this._state.streamType;this.updateState({duration:t.duration,streamType:d}),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 d=-1,h="Unknown error",p="none";r instanceof ErrorEvent&&r.error?(d=r.error.code??-1,h=r.error.message??r.message??"Unknown error",p="ErrorEvent"):t.error&&(d=t.error.code??-1,h=t.error.message??"Unknown error",p="element.error");let v=t.nativeEl;console.error("[PlayerCore] error event",{providerType:this._state.providerType,elementTag:t.tagName,eventTarget:(n=r.target)==null?void 0:n.tagName,source:p,code:d,message:h,eventIsErrorEvent:r instanceof ErrorEvent,eventErrorCode:r instanceof ErrorEvent?(o=r.error)==null?void 0:o.code:void 0,elementErrorCode:(s=t.error)==null?void 0:s.code,nativeElTag:v==null?void 0:v.tagName,nativeElErrorCode:(l=v==null?void 0:v.error)==null?void 0:l.code,nativeElSrc:v==null?void 0:v.currentSrc,documentHidden:document.hidden,documentHasFocus:document.hasFocus(),visibilityState:document.visibilityState});let f="media",m=!0;this._state.providerType==="nano"&&d>0?(f=ad(d),m=f!=="offline"&&f!=="autoplay"):this._state.providerType==="livekit"&&d>0&&(f=ld(d),m=!0);let _={code:d,message:h,fatal:m,category:f};this.updateState({error:_}),this.dispatch("error",_);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.destroyMediaElement(),this._currentProviderType=null,this.updateState({...Ls(),volume:this._state.volume,muted:this._state.muted,loop:this._state.loop,playbackRate:this._state.playbackRate}),this.dispatch("sourcechange",{source:null})}async play(){if(this._mediaElement){this.updateState({paused:!1});try{await this._mediaElement.play()}catch(e){throw this.updateState({paused:!0}),e}}}pause(){this._mediaElement&&(this.updateState({paused:!0,playing:!1}),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)}_getFullscreenTarget(){return this._container?this._container.closest("media-controller")??this._container.parentElement:null}async setFullscreen(e){this.updateState({fullscreen:e,presentationMode:e?"fullscreen":"inline"}),this.dispatch("fullscreenchange",{fullscreen:e}),this.dispatch("presentationmodechange",{mode:e?"fullscreen":"inline"});let t=this._getFullscreenTarget();t&&(e&&!document.fullscreenElement?await t.requestFullscreen():!e&&document.fullscreenElement&&await document.exitFullscreen())}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._container=null,this._config=void 0,this._ready=!1,this.dispatch("destroy",void 0),this._listeners.clear())}};function pd(){return new hd}var wr="bpPlayerObservedProperties";function md(i){return wr in i&&Array.isArray(i[wr])}function wv(i,e){class t extends i{get[wr](){return e}}return t}function Cv(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 Cr(i,e,t){if(e!=null&&e.contains(i))return;i.nodeName.includes("-")&&!md(i)&&(await Promise.resolve(),await customElements.whenDefined(i.nodeName.toLowerCase()),customElements.upgrade(i)),md(i)&&t(i);let r=Cv(i);r.length>0&&await Promise.all(r.map(n=>Cr(n,e,t)))}function Cs(i,e,t){let r=i[wr];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 Rs(i){i[wr].includes("player")&&(i.player=void 0)}var nh=`/**
|
|
7
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),zu=/'/g,Yu=/"/g,ju=/^(?:script|style|textarea|title)$/i,od=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),Ye=od(1),kb=od(2),Lb=od(3),Ui=Symbol.for("lit-noChange"),_e=Symbol.for("lit-nothing"),Qu=new WeakMap,Oi=Ni.createTreeWalker(Ni,129);function Ju(i,e){if(!nd(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ku!==void 0?Ku.createHTML(e):e}var Tv=(i,e)=>{let t=i.length-1,r=[],n,o=e===2?"<svg>":e===3?"<math>":"",s=Yn;for(let l=0;l<t;l++){let d=i[l],h,p,v=-1,f=0;for(;f<d.length&&(s.lastIndex=f,p=s.exec(d),p!==null);)f=s.lastIndex,s===Yn?p[1]==="!--"?s=qu:p[1]!==void 0?s=Gu:p[2]!==void 0?(ju.test(p[2])&&(n=RegExp("</"+p[2],"g")),s=Di):p[3]!==void 0&&(s=Di):s===Di?p[0]===">"?(s=n??Yn,v=-1):p[1]===void 0?v=-2:(v=s.lastIndex-p[2].length,h=p[1],s=p[3]===void 0?Di:p[3]==='"'?Yu:zu):s===Yu||s===zu?s=Di:s===qu||s===Gu?s=Yn:(s=Di,n=void 0);let m=s===Di&&i[l+1].startsWith("/>")?" ":"";o+=s===Yn?d+_v:v>=0?(r.push(h),d.slice(0,v)+Zu+d.slice(v)+Jt+m):d+Jt+(v===-2?l:m)}return[Ju(i,o+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},jn=class i{constructor({strings:e,_$litType$:t},r){let n;this.parts=[];let o=0,s=0,l=e.length-1,d=this.parts,[h,p]=Tv(e,t);if(this.el=i.createElement(h,r),Oi.currentNode=this.el.content,t===2||t===3){let v=this.el.content.firstChild;v.replaceWith(...v.childNodes)}for(;(n=Oi.nextNode())!==null&&d.length<l;){if(n.nodeType===1){if(n.hasAttributes())for(let v of n.getAttributeNames())if(v.endsWith(Zu)){let f=p[s++],m=n.getAttribute(v).split(Jt),_=/([.?@])?(.*)/.exec(f);d.push({type:1,index:o,name:_[2],strings:m,ctor:_[1]==="."?ed:_[1]==="?"?td:_[1]==="@"?id:wr}),n.removeAttribute(v)}else v.startsWith(Jt)&&(d.push({type:6,index:o}),n.removeAttribute(v));if(ju.test(n.tagName)){let v=n.textContent.split(Jt),f=v.length-1;if(f>0){n.textContent=Ss?Ss.emptyScript:"";for(let m=0;m<f;m++)n.append(v[m],Zn()),Oi.nextNode(),d.push({type:2,index:++o});n.append(v[f],Zn())}}}else if(n.nodeType===8)if(n.data===Xu)d.push({type:2,index:o});else{let v=-1;for(;(v=n.data.indexOf(Jt,v+1))!==-1;)d.push({type:7,index:o}),v+=Jt.length-1}o++}}static createElement(e,t){let r=Ni.createElement("template");return r.innerHTML=e,r}};function Lr(i,e,t=i,r){var s,l;if(e===Ui)return e;let n=r!==void 0?(s=t._$Co)==null?void 0:s[r]:t._$Cl,o=Xn(e)?void 0:e._$litDirective$;return(n==null?void 0:n.constructor)!==o&&((l=n==null?void 0:n._$AO)==null||l.call(n,!1),o===void 0?n=void 0:(n=new o(i),n._$AT(i,t,r)),r!==void 0?(t._$Co??(t._$Co=[]))[r]=n:t._$Cl=n),n!==void 0&&(e=Lr(i,n._$AS(i,e.values),n,r)),e}var Jl=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,n=((e==null?void 0:e.creationScope)??Ni).importNode(t,!0);Oi.currentNode=n;let o=Oi.nextNode(),s=0,l=0,d=r[0];for(;d!==void 0;){if(s===d.index){let h;d.type===2?h=new Jn(o,o.nextSibling,this,e):d.type===1?h=new d.ctor(o,d.name,d.strings,this,e):d.type===6&&(h=new rd(o,this,e)),this._$AV.push(h),d=r[++l]}s!==(d==null?void 0:d.index)&&(o=Oi.nextNode(),s++)}return Oi.currentNode=Ni,n}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++}},Jn=class i{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,r,n){this.type=2,this._$AH=_e,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=n,this._$Cv=(n==null?void 0:n.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=Lr(this,e,t),Xn(e)?e===_e||e==null||e===""?(this._$AH!==_e&&this._$AR(),this._$AH=_e):e!==this._$AH&&e!==Ui&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):yv(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!==_e&&Xn(this._$AH)?this._$AA.nextSibling.data=e:this.T(Ni.createTextNode(e)),this._$AH=e}$(e){var o;let{values:t,_$litType$:r}=e,n=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=jn.createElement(Ju(r.h,r.h[0]),this.options)),r);if(((o=this._$AH)==null?void 0:o._$AD)===n)this._$AH.p(t);else{let s=new Jl(n,this),l=s.u(this.options);s.p(t),this.T(l),this._$AH=s}}_$AC(e){let t=Qu.get(e.strings);return t===void 0&&Qu.set(e.strings,t=new jn(e)),t}k(e){nd(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,n=0;for(let o of e)n===t.length?t.push(r=new i(this.O(Zn()),this.O(Zn()),this,this.options)):r=t[n],r._$AI(o),n++;n<t.length&&(this._$AR(r&&r._$AB.nextSibling,n),t.length=n)}_$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 n=Fu(e).nextSibling;Fu(e).remove(),e=n}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}},wr=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,n,o){this.type=1,this._$AH=_e,this._$AN=void 0,this.element=e,this.name=t,this._$AM=n,this.options=o,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=_e}_$AI(e,t=this,r,n){let o=this.strings,s=!1;if(o===void 0)e=Lr(this,e,t,0),s=!Xn(e)||e!==this._$AH&&e!==Ui,s&&(this._$AH=e);else{let l=e,d,h;for(e=o[0],d=0;d<o.length-1;d++)h=Lr(this,l[r+d],t,d),h===Ui&&(h=this._$AH[d]),s||(s=!Xn(h)||h!==this._$AH[d]),h===_e?e=_e:e!==_e&&(e+=(h??"")+o[d+1]),this._$AH[d]=h}s&&!n&&this.j(e)}j(e){e===_e?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},ed=class extends wr{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===_e?void 0:e}},td=class extends wr{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==_e)}},id=class extends wr{constructor(e,t,r,n,o){super(e,t,r,n,o),this.type=5}_$AI(e,t=this){if((e=Lr(this,e,t,0)??_e)===Ui)return;let r=this._$AH,n=e===_e&&r!==_e||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,o=e!==_e&&(r===_e||n);n&&this.element.removeEventListener(this.name,this,r),o&&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)}},rd=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){Lr(this,e)}};var jl=Qn.litHtmlPolyfillSupport;jl==null||jl(jn,Jn),(Qn.litHtmlVersions??(Qn.litHtmlVersions=[])).push("3.3.2");var eh=(i,e,t)=>{let r=(t==null?void 0:t.renderBefore)??e,n=r._$litPart$;if(n===void 0){let o=(t==null?void 0:t.renderBefore)??null;r._$litPart$=n=new Jn(e.insertBefore(Zn(),o),o,void 0,t??{})}return n._$AI(i),n};var Hi=globalThis,Me=class extends Ht{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=eh(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 Ui}},th;Me._$litElement$=!0,Me.finalized=!0,(th=Hi.litElementHydrateSupport)==null||th.call(Hi,{LitElement:Me});var sd=Hi.litElementPolyfillSupport;sd==null||sd({LitElement:Me});(Hi.litElementVersions??(Hi.litElementVersions=[])).push("4.2.2");var ei=i=>(e,t)=>{t!==void 0?t.addInitializer(()=>{customElements.define(i,e)}):customElements.define(i,e)};var Av={attribute:!0,type:String,converter:zn,reflect:!1,hasChanged:As},Sv=(i=Av,e,t)=>{let{kind:r,metadata:n}=t,o=globalThis.litPropertyMetadata.get(n);if(o===void 0&&globalThis.litPropertyMetadata.set(n,o=new Map),r==="setter"&&((i=Object.create(i)).wrapped=!0),o.set(t.name,i),r==="accessor"){let{name:s}=t;return{set(l){let d=e.get.call(this);e.set.call(this,l),this.requestUpdate(s,d,i,!0,l)},init(l){return l!==void 0&&this.C(s,void 0,i,l),l}}}if(r==="setter"){let{name:s}=t;return function(l){let d=this[s];e.call(this,l),this.requestUpdate(s,d,i,!0,l)}}throw Error("Unsupported decorator location: "+r)};function z(i){return(e,t)=>typeof t=="object"?Sv(i,e,t):((r,n,o)=>{let s=n.hasOwnProperty(o);return n.constructor.createProperty(o,r),s?Object.getOwnPropertyDescriptor(n,o):void 0})(i,e,t)}function ti(i){return z({...i,state:!0,attribute:!1})}var kv=[1005,1007,1008,1009,3001,3002,3003,3004,3005,3100,3101,3200,4003];function ad(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 ld(i){return i===4e3||i===4001?"network":"unknown"}function Ls(){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 ws(i){return typeof i=="object"&&i!==null&&"type"in i&&i.type==="bplive"&&"streamId"in i}function Is(i){return typeof i=="object"&&i!==null&&"type"in i&&i.type==="bplive"&&"clipId"in i}function dd(i){return ws(i)||Is(i)}var pt=class extends Error{constructor(t,r,n){super(t);this.code=r;this.status=n;this.name="BPLiveError"}},eo=class{constructor(e,t){this._authToken=null;this._stream=null;this._clip=null;this._config=e,this._authToken=e.authToken??null,this._network=t??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 pt("No auth token provided. Ensure config.bpLive.authToken is set before loading a BPLive source.","AUTH_REQUIRED");let t=`${this._config.discoveryUrl}${e}`,r={"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${this._authToken}`};if(this._network){let s=await this._network.intercept({url:t,method:"GET",type:"api",headers:r});if(s.response)return s.response.body;t=s.url,r=s.headers}let n=new AbortController,o=setTimeout(()=>n.abort(),3e4);try{let s=await fetch(t,{method:"GET",headers:r,signal:n.signal});if(!s.ok)throw new pt(`HTTP ${s.status}: ${s.statusText}`,"HTTP_ERROR",s.status);let l=await s.json();return this._network&&(l=(await this._network.interceptResponse({url:t,status:s.status,headers:Object.fromEntries(s.headers),body:l})).body),l}catch(s){throw s instanceof Error&&s.name==="AbortError"?new pt("Request timeout after 30s","TIMEOUT"):s}finally{clearTimeout(o)}}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 pt(`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 n=r.find(l=>l.orientation===t);if(n)return n;let o=t==="landscape"?"portrait":"landscape",s=r.find(l=>l.orientation===o);return s||r[0]}mapClipMediaToPlayerSource(e){return{type:"video",url:e.url}}async resolveSource(e){if(this._stream=null,this._clip=null,ws(e))return this.resolveStreamSource(e);if(Is(e))return this.resolveClipSource(e);throw new pt("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 l,d,h,p,v,f,m,_,g;let r=(await this.getStream(e.streamId)).data;this._stream=r;let n=this.extractStreamPoster(r);if(!!r.ended_at&&((d=(l=r.media)==null?void 0:l.vod)==null?void 0:d.length)>0){let w=r.media.vod[0];return{source:{type:"video",url:w.original},contentType:"video",poster:n??w.thumb??void 0,videoWidth:(h=w.dimension)==null?void 0:h.width,videoHeight:(p=w.dimension)==null?void 0:p.height}}let s=r.player_source??((v=r.active_stream)==null?void 0:v.player_source);if(s)return{source:this.mapPlayerSourceToResolvedSource(s),contentType:"stream",poster:n};if(((m=(f=r.media)==null?void 0:f.vod)==null?void 0:m.length)>0){let w=r.media.vod[0];return{source:{type:"video",url:w.original},contentType:"video",poster:n??w.thumb??void 0,videoWidth:(_=w.dimension)==null?void 0:_.width,videoHeight:(g=w.dimension)==null?void 0:g.height}}throw new pt("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 n=this.selectClipMedia(r.media,e.preferredOrientation);if(!n)throw new pt("No playable media found in clip","NO_MEDIA");return{source:this.mapClipMediaToPlayerSource(n),contentType:"clip",poster:n.thumbnail??void 0,videoWidth:n.width,videoHeight:n.height}}destroy(){this._authToken=null,this._stream=null,this._clip=null}};function to(i){return i!=null&&typeof i.then=="function"}function ih(i){return new Promise((e,t)=>{let r=!1,n=o=>{r||(r=!0,o?t(o):e())};try{let o=i(n);to(o)&&(r=!0,o.then(()=>e(),t))}catch(o){n(o)}})}var cd=class{constructor(e,t,r){this._closed=!1;this._pendingCount=0;this._firstError=null;this._redirectResult=null;this._responseResult=null;this.promise=new Promise((n,o)=>{this._resolve=n,this._reject=o}),this._state=e,this._interceptor=t,this._canModify=r,this._start()}get redirectResult(){return this._redirectResult}get responseResult(){return this._responseResult}get _open(){return this._canModify&&!this._closed}_close(){this._closed=!0,this._resolve()}_error(e){this._closed=!0,this._reject(e)}_start(){try{let e=this._interceptor(this._createFacade());to(e)?this._handleWaitUntil(e):!this._pendingCount&&!this._closed&&this._close()}catch(e){this._error(e)}}_createFacade(){let e=this;return{get url(){return e._state.url},get method(){return e._state.method},get type(){return e._state.type},get headers(){return{...e._state.headers}},get closed(){return!e._open},redirect(t){e._redirect(t)},respondWith(t){e._respondWith(t)},waitUntil(t){e._waitUntil(t)}}}_redirect(e){if(!this._open)throw new Error("Request is closed");let t=typeof e=="string"?{url:e}:e;this._redirectResult={url:t.url??this._state.url,method:t.method??this._state.method,type:this._state.type,headers:t.headers??{...this._state.headers}},this._close()}_respondWith(e){if(!this._open)throw new Error("Request is closed");this._responseResult=e,this._close()}_waitUntil(e){if(!this._open)throw new Error("Request is closed");to(e)?this._handleWaitUntil(e):typeof e=="function"&&this._handleWaitUntil(ih(e))}async _handleWaitUntil(e){this._pendingCount++;try{await e}catch(t){this._firstError||(this._firstError=t)}this._pendingCount--,!this._pendingCount&&!this._closed&&(this._firstError?this._error(this._firstError):this._close())}},ud=class{constructor(e,t){this._closed=!1;this._pendingCount=0;this._firstError=null;this._responseResult=null;this.promise=new Promise((r,n)=>{this._resolve=r,this._reject=n}),this._state=e,this._interceptor=t,this._start()}get responseResult(){return this._responseResult}_close(){this._closed=!0,this._resolve()}_error(e){this._closed=!0,this._reject(e)}_start(){try{let e=this._interceptor(this._createFacade());to(e)?this._handleWaitUntil(e):!this._pendingCount&&!this._closed&&this._close()}catch(e){this._error(e)}}_createFacade(){let e=this;return{get url(){return e._state.url},get status(){return e._state.status},get headers(){return{...e._state.headers}},get body(){return e._state.body},get closed(){return e._closed},respondWith(t){e._respondWith(t)},waitUntil(t){e._waitUntil(t)}}}_respondWith(e){if(this._closed)throw new Error("Response is closed");this._responseResult=e,this._close()}_waitUntil(e){if(this._closed)throw new Error("Response is closed");to(e)?this._handleWaitUntil(e):typeof e=="function"&&this._handleWaitUntil(ih(e))}async _handleWaitUntil(e){this._pendingCount++;try{await e}catch(t){this._firstError||(this._firstError=t)}this._pendingCount--,!this._pendingCount&&!this._closed&&(this._firstError?this._error(this._firstError):this._close())}},io=class{constructor(){this._requestInterceptors=[];this._responseInterceptors=[]}addRequestInterceptor(e){this._requestInterceptors.unshift(e)}removeRequestInterceptor(e){let t=this._requestInterceptors.indexOf(e);t>=0&&this._requestInterceptors.splice(t,1)}addResponseInterceptor(e){this._responseInterceptors.unshift(e)}removeResponseInterceptor(e){let t=this._responseInterceptors.indexOf(e);t>=0&&this._responseInterceptors.splice(t,1)}async intercept(e){let t={...e,headers:{...e.headers}},r=!1,n=null;for(let o of this._requestInterceptors.slice()){let s=new cd(t,o,!r);try{await s.promise}catch{continue}s.responseResult&&!r&&(r=!0,n=s.responseResult),s.redirectResult&&!r&&(t=s.redirectResult)}return{url:t.url,headers:t.headers,response:n}}async interceptResponse(e){let t={...e,headers:{...e.headers}};for(let r of this._responseInterceptors.slice()){let n=new ud(t,r);try{await n.promise}catch{continue}n.responseResult&&(t={...t,status:n.responseResult.status!==void 0?n.responseResult.status:t.status,headers:n.responseResult.headers!==void 0?n.responseResult.headers:t.headers,body:"body"in n.responseResult?n.responseResult.body:t.body})}return{status:t.status,headers:t.headers,body:t.body}}};function Lv(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 rh(i){return typeof i=="object"&&i!==null&&i.type==="bplive"}var wv=["loadstart","loadedmetadata","loadeddata","canplay","canplaythrough","play","playing","pause","waiting","seeking","seeked","timeupdate","durationchange","ratechange","volumechange","ended","progress","error","resize"],hd=class{constructor(){this._mediaElement=null;this._container=null;this._listeners=new Map;this._eventCleanup=[];this._destroyed=!1;this._bpLive=null;this._network=new io;this._currentProviderType=null;this._ready=!1;this._loadGeneration=0;this._state=Ls()}get state(){return this._state}get videoElement(){return this._mediaElement}get activeVideoElement(){let e=this._mediaElement;return(e==null?void 0:e.activeVideoElement)??null}get bpLive(){return this._bpLive}get network(){return this._network}get ready(){return this._ready}get providerType(){return this._currentProviderType}addEventListener(e,t){let r=Array.isArray(e)?e:[e];for(let n of r)this._listeners.has(n)||this._listeners.set(n,new Set),this._listeners.get(n).add(t)}removeEventListener(e,t){let r=Array.isArray(e)?e:[e];for(let n of r){let o=this._listeners.get(n);o&&(o.delete(t),o.size===0&&this._listeners.delete(n))}}dispatch(e,t){let r=this._listeners.get(e);if(r)for(let n of r)try{n(t)}catch(o){console.error(`[PlayerCore] Error in event listener for "${e}":`,o)}}updateState(e){this._state={...this._state,...e},this.dispatch("statechange",{state:this._state})}attach(e,t){this._destroyed||(this._container=e,this._config=t,this._ready=!0)}async loadSource(e,t,r){if(this._destroyed)return;let n=++this._loadGeneration,o=t??this._container,s=r??this._config;if(!o){console.error("[PlayerCore] No container provided. Call attach() first or provide container to loadSource().");return}this._container=o,s&&(this._config=s);let l=rh(e)?"clipId"in e?"clip":"stream":void 0;this.updateState({error:null,connectionState:"connecting",ended:!1,...l&&{contentType:l}}),this.dispatch("sourcechange",{source:e});try{let d=e,h=this._state.contentType,p,v,f;if(rh(e)){if(s!=null&&s.bpLive&&(this._bpLive&&this._bpLive.destroy(),this._bpLive=new eo(s.bpLive,this._network)),!this._bpLive)throw new Error("BPLive source requires config.bpLive configuration.");let k=await this._bpLive.resolveSource(e);if(n!==this._loadGeneration)return;d=k.source,h=k.contentType,p=k.poster,v=k.videoWidth,f=k.videoHeight}let m=Lv(d),w=m==="nano"||m==="livekit"||h==="stream"?"live":"vod";return this._mediaElement&&this.destroyMediaElement(),this._currentProviderType=m,this.updateState({providerType:m,contentType:h,streamType:w,paused:!0,playing:!1,waiting:!1,seeking:!1,readyState:0,currentTime:0,duration:NaN,buffered:null}),this._mediaElement=this.createMediaElement(m,d,s),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),this.attachActiveVideoElementForwarding(this._mediaElement),o.appendChild(this._mediaElement),this._ready=!0,this.dispatch("videoelementchange",{video:this._mediaElement}),this.dispatch("activevideoelementchange",{video:this.activeVideoElement}),{poster:p,videoWidth:v,videoHeight:f}}catch(d){if(n!==this._loadGeneration)return;console.error("[PlayerCore] loadSource error:",d);let h={code:-1,message:d instanceof Error?d.message:"Failed to load source",fatal:!0,category:"setup"};this.updateState({error:h,connectionState:"failed"}),this.dispatch("error",h)}}destroyMediaElement(){if(this._eventCleanup.forEach(e=>e()),this._eventCleanup=[],this._mediaElement&&(this._mediaElement.remove(),this._mediaElement=null,this.dispatch("emptied",void 0),this.dispatch("videoelementchange",{video:null}),this.dispatch("activevideoelementchange",{video:null})),this._container)for(;this._container.firstChild;)this._container.removeChild(this._container.firstChild)}createMediaElement(e,t,r){switch(e){case"nano":{let n=document.createElement("nano-video");n.setAttribute("playsinline",""),n.setAttribute("webkit-playsinline","");let o=t;return n.libraryLocation=(r==null?void 0:r.libraryLocation)??"/vendor/bp-player",o.source?n.sourceConfig=o.source:o.streamid&&(n.streamid=o.streamid),r!=null&&r.nano&&(n.config=r.nano),n}case"livekit":{let n=document.createElement("livekit-video");n.setAttribute("playsinline",""),n.setAttribute("webkit-playsinline","");let o=t;return n.url=o.url,n.token=o.token,r!=null&&r.livekit&&(n.config=r.livekit),n}case"video":default:{let n=document.createElement("hls-video");n.setAttribute("playsinline",""),n.setAttribute("webkit-playsinline","");let o=typeof t=="string"?t:t.url;n.src=o;let s={...r==null?void 0:r.video},l=this._network,d=s.xhrSetup;return s.xhrSetup=async(h,p)=>{let v=p.includes(".m3u8")?"manifest":p.includes(".ts")||p.includes(".m4s")||p.includes(".fmp4")?"segment":"other",f=await l.intercept({url:p,method:"GET",type:v,headers:{}});f.url!==p&&h.open("GET",f.url,!0);for(let[m,_]of Object.entries(f.headers))h.setRequestHeader(m,_);d&&await d(h,f.url)},n.config=s,n}}}attachMediaElementListeners(e){for(let t of wv){let r=n=>this.handleMediaEvent(t,e,n);e.addEventListener(t,r),this._eventCleanup.push(()=>e.removeEventListener(t,r))}}attachActiveVideoElementForwarding(e){let t=r=>{let n=r.detail;this.dispatch("activevideoelementchange",{video:(n==null?void 0:n.video)??null})};e.addEventListener("activevideoelementchange",t),this._eventCleanup.push(()=>e.removeEventListener("activevideoelementchange",t))}handleMediaEvent(e,t,r){var n,o,s,l;switch(e){case"loadstart":this.updateState({readyState:1}),this.dispatch("loadstart",void 0);break;case"loadedmetadata":{let d=t.duration===1/0?"live":this._state.streamType;this.updateState({duration:t.duration,videoWidth:t.videoWidth,videoHeight:t.videoHeight,streamType:d}),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 d=t.duration===1/0?"live":this._state.streamType;this.updateState({duration:t.duration,streamType:d}),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 d=-1,h="Unknown error",p="none";r instanceof ErrorEvent&&r.error?(d=r.error.code??-1,h=r.error.message??r.message??"Unknown error",p="ErrorEvent"):t.error&&(d=t.error.code??-1,h=t.error.message??"Unknown error",p="element.error");let v=t.nativeEl;console.error("[PlayerCore] error event",{providerType:this._state.providerType,elementTag:t.tagName,eventTarget:(n=r.target)==null?void 0:n.tagName,source:p,code:d,message:h,eventIsErrorEvent:r instanceof ErrorEvent,eventErrorCode:r instanceof ErrorEvent?(o=r.error)==null?void 0:o.code:void 0,elementErrorCode:(s=t.error)==null?void 0:s.code,nativeElTag:v==null?void 0:v.tagName,nativeElErrorCode:(l=v==null?void 0:v.error)==null?void 0:l.code,nativeElSrc:v==null?void 0:v.currentSrc,documentHidden:document.hidden,documentHasFocus:document.hasFocus(),visibilityState:document.visibilityState});let f="media",m=!0;this._state.providerType==="nano"&&d>0?(f=ad(d),m=f!=="offline"&&f!=="autoplay"):this._state.providerType==="livekit"&&d>0&&(f=ld(d),m=!0);let _={code:d,message:h,fatal:m,category:f};this.updateState({error:_}),this.dispatch("error",_);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.destroyMediaElement(),this._currentProviderType=null,this.updateState({...Ls(),volume:this._state.volume,muted:this._state.muted,loop:this._state.loop,playbackRate:this._state.playbackRate}),this.dispatch("sourcechange",{source:null})}async play(){if(this._mediaElement){this.updateState({paused:!1});try{await this._mediaElement.play()}catch(e){throw this.updateState({paused:!0}),e}}}pause(){this._mediaElement&&(this.updateState({paused:!0,playing:!1}),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)}_getFullscreenTarget(){return this._container?this._container.closest("media-controller")??this._container.parentElement:null}async setFullscreen(e){this.updateState({fullscreen:e,presentationMode:e?"fullscreen":"inline"}),this.dispatch("fullscreenchange",{fullscreen:e}),this.dispatch("presentationmodechange",{mode:e?"fullscreen":"inline"});let t=this._getFullscreenTarget();t&&(e&&!document.fullscreenElement?await t.requestFullscreen():!e&&document.fullscreenElement&&await document.exitFullscreen())}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._container=null,this._config=void 0,this._ready=!1,this.dispatch("destroy",void 0),this._listeners.clear())}};function pd(){return new hd}var Ir="bpPlayerObservedProperties";function md(i){return Ir in i&&Array.isArray(i[Ir])}function Iv(i,e){class t extends i{get[Ir](){return e}}return t}function Cv(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 Cr(i,e,t){if(e!=null&&e.contains(i))return;i.nodeName.includes("-")&&!md(i)&&(await Promise.resolve(),await customElements.whenDefined(i.nodeName.toLowerCase()),customElements.upgrade(i)),md(i)&&t(i);let r=Cv(i);r.length>0&&await Promise.all(r.map(n=>Cr(n,e,t)))}function Cs(i,e,t){let r=i[Ir];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 Rs(i){i[Ir].includes("player")&&(i.player=void 0)}var nh=`/**
|
|
8
8
|
* BP Player CSS Custom Properties
|
|
9
9
|
*
|
|
10
10
|
* All styling can be customized by overriding these CSS variables.
|
|
@@ -137,7 +137,7 @@ html.bp-player-full-window > body {
|
|
|
137
137
|
padding: 0 !important;
|
|
138
138
|
}
|
|
139
139
|
`;var sh=!1;function ro(){if(sh)return;let i=document.createElement("style");i.id="bp-player-global-styles",i.textContent=nh+`
|
|
140
|
-
`+oh,document.head.appendChild(i),sh=!0}function xv(i,e){let t;return()=>(t||(t=document.createElement("template"),t.innerHTML=e),t)}function Pv(i,e){return`<style>${i}</style>${e}`}var Ms=(C=>(C.CONFIGURATION="configuration",C.SOURCE="source",C.SOURCES="sources",C.AUTOPLAY="autoplay",C.MUTED="muted",C.LOOP="loop",C.SCALING="scaling",C.ASPECT_RATIO="aspect-ratio",C.DEBUG="debug",C.AUTOHIDE="autohide",C.HOTKEYS="hotkeys",C.PAUSED="paused",C.PLAYING="playing",C.ENDED="ended",C.SEEKING="seeking",C.WAITING="waiting",C.LOADING="loading",C.READY="ready",C.HAS_ERROR="has-error",C.HAS_FIRST_PLAY="has-first-play",C.FULLSCREEN="fullscreen",C.FULLWINDOW="fullwindow",C.DEVICE_TYPE="device-type",C.MOBILE="mobile",C.TV="tv",C.STREAM_TYPE="stream-type",C.LIVE="live",C.CONTENT_TYPE="content-type",C.USER_IDLE="user-idle",C.USER_IDLE_TIMEOUT="user-idle-timeout",C.MOBILE_ONLY="mobile-only",C.MOBILE_HIDDEN="mobile-hidden",C.TV_ONLY="tv-only",C.TV_HIDDEN="tv-hidden",C.LIVE_ONLY="live-only",C.LIVE_HIDDEN="live-hidden",C.VOD_HIDDEN="vod-hidden",C.CLIP_HIDDEN="clip-hidden",C.NO_AUTO_HIDE="no-auto-hide",C.DISABLED="disabled",C.HIDDEN="hidden",C.NOTOOLTIP="notooltip",C.MENU="menu",C.MENU_OPENED="menu-opened",C.ARIA_LABEL="aria-label",C.ARIA_LIVE="aria-live",C.ARIA_CHECKED="aria-checked",C.VOLUME_LEVEL="volume-level",C.PROVIDER_TYPE="provider-type",C))(Ms||{});function ye(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)}function Rr(){return{fromAttribute:i=>{if(i)try{return JSON.parse(i)}catch{return}},toAttribute:i=>i==null?null:JSON.stringify(i)}}var Z=(i,e)=>new Event(i,{bubbles:!0,composed:!0,...e}),$i=(i,e)=>new CustomEvent(i,{bubbles:!0,composed:!0,...e});function rt(i,e){let t=e!==void 0?Object.assign(i,{code:e}):i;return new ErrorEvent("error",{error:t,message:i.message,bubbles:!0,composed:!0})}var no="play";var
|
|
140
|
+
`+oh,document.head.appendChild(i),sh=!0}function xv(i,e){let t;return()=>(t||(t=document.createElement("template"),t.innerHTML=e),t)}function Pv(i,e){return`<style>${i}</style>${e}`}var Ms=(C=>(C.CONFIGURATION="configuration",C.SOURCE="source",C.SOURCES="sources",C.AUTOPLAY="autoplay",C.MUTED="muted",C.LOOP="loop",C.SCALING="scaling",C.ASPECT_RATIO="aspect-ratio",C.DEBUG="debug",C.AUTOHIDE="autohide",C.HOTKEYS="hotkeys",C.PAUSED="paused",C.PLAYING="playing",C.ENDED="ended",C.SEEKING="seeking",C.WAITING="waiting",C.LOADING="loading",C.READY="ready",C.HAS_ERROR="has-error",C.HAS_FIRST_PLAY="has-first-play",C.FULLSCREEN="fullscreen",C.FULLWINDOW="fullwindow",C.DEVICE_TYPE="device-type",C.MOBILE="mobile",C.TV="tv",C.STREAM_TYPE="stream-type",C.LIVE="live",C.CONTENT_TYPE="content-type",C.USER_IDLE="user-idle",C.USER_IDLE_TIMEOUT="user-idle-timeout",C.MOBILE_ONLY="mobile-only",C.MOBILE_HIDDEN="mobile-hidden",C.TV_ONLY="tv-only",C.TV_HIDDEN="tv-hidden",C.LIVE_ONLY="live-only",C.LIVE_HIDDEN="live-hidden",C.VOD_HIDDEN="vod-hidden",C.CLIP_HIDDEN="clip-hidden",C.NO_AUTO_HIDE="no-auto-hide",C.DISABLED="disabled",C.HIDDEN="hidden",C.NOTOOLTIP="notooltip",C.MENU="menu",C.MENU_OPENED="menu-opened",C.ARIA_LABEL="aria-label",C.ARIA_LIVE="aria-live",C.ARIA_CHECKED="aria-checked",C.VOLUME_LEVEL="volume-level",C.PROVIDER_TYPE="provider-type",C))(Ms||{});function ye(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)}function Rr(){return{fromAttribute:i=>{if(i)try{return JSON.parse(i)}catch{return}},toAttribute:i=>i==null?null:JSON.stringify(i)}}var Z=(i,e)=>new Event(i,{bubbles:!0,composed:!0,...e}),$i=(i,e)=>new CustomEvent(i,{bubbles:!0,composed:!0,...e});function rt(i,e){let t=e!==void 0?Object.assign(i,{code:e}):i;return new ErrorEvent("error",{error:t,message:i.message,bubbles:!0,composed:!0})}var no="play";var Vi="pause";var ii="playing";var Mr="waiting";var oo="ended";var so="timeupdate";var vd="durationchange";var fd="loadstart";var Ed="loadedmetadata";var gd="loadeddata";var ao="canplay";var xs="canplaythrough";var lo="volumechange";var ri="resize";var co="ready";var Ps="change";var bd="addrendition";var Ds=class extends EventTarget{constructor(t){super();this._renditions=[];this._cleanup=[];this._host=t}get length(){return this._renditions.length}[Symbol.iterator](){return this._renditions[Symbol.iterator]()}get selectedIndex(){var r;let t=(r=this._host.player)==null?void 0:r.state.targetQuality;return t?this._renditions.findIndex(n=>n.id===String(t.index)):-1}set selectedIndex(t){var r,n,o;if(t<0)(r=this._host.player)==null||r.setQuality(null);else{let l=(((n=this._host.player)==null?void 0:n.state.qualities)??[])[t];l&&((o=this._host.player)==null||o.setQuality(l))}this._updateSelection(),this.dispatchEvent(Z(Ps))}_updateSelection(){let t=this.selectedIndex;this._renditions.forEach((r,n)=>{r.selected=n===t})}_syncFromPlayer(){var n,o;let t=((n=this._host.player)==null?void 0:n.state.qualities)??[];if(t.length===0){let s=(o=this._host.player)==null?void 0:o.videoElement;s!=null&&s.videoRenditions&&(t=[...s.videoRenditions].map((l,d)=>({index:d,width:l.width??0,height:l.height??0,bitrate:l.bitrate??0})))}let r=this._renditions.length;for(let s=0;s<r;s++)delete this[s];this._renditions=t.map(s=>({id:String(s.index),width:s.width,height:s.height,bitrate:s.bitrate,selected:!1})),this._renditions.forEach((s,l)=>{this[l]=s}),this._updateSelection();for(let s of this._renditions)this.dispatchEvent($i(bd,{detail:s}))}_setupListeners(){this._cleanup.forEach(s=>s()),this._cleanup=[];let t=this._host.player;if(!t)return;let r=()=>{this._syncFromPlayer()},n=()=>{this._updateSelection(),this.dispatchEvent(Z(Ps))};t.addEventListener("qualitieschange",r),t.addEventListener("qualitychange",n),t.addEventListener("targetqualitychanged",n),this._cleanup.push(()=>{t.removeEventListener("qualitieschange",r),t.removeEventListener("qualitychange",n),t.removeEventListener("targetqualitychanged",n)});let o=t.videoElement;o!=null&&o.videoRenditions&&(o.videoRenditions.addEventListener("addrendition",r),o.videoRenditions.addEventListener("removerendition",r),this._cleanup.push(()=>{var s,l;(s=o.videoRenditions)==null||s.removeEventListener("addrendition",r),(l=o.videoRenditions)==null||l.removeEventListener("removerendition",r)})),this._syncFromPlayer()}_destroy(){this._cleanup.forEach(r=>r()),this._cleanup=[];let t=this._renditions.length;this._renditions=[];for(let r=0;r<t;r++)delete this[r]}};var ah=`/**
|
|
141
141
|
* BP Player Styles
|
|
142
142
|
*
|
|
143
143
|
* Core player component styles using CSS custom properties.
|
|
@@ -227,20 +227,20 @@ bp-player[waiting] {
|
|
|
227
227
|
bp-player[has-error] {
|
|
228
228
|
/* Styles when player has an error */
|
|
229
229
|
}
|
|
230
|
-
`;var lh=!1;function Ov(){if(lh||(lh=!0,document.getElementById("bp-player-styles")))return;ro();let i=document.createElement("style");i.id="bp-player-styles",i.textContent=ah,document.head.appendChild(i)}var Nv=["emptied","loadstart","play","playing","pause","waiting","seeking","seeked","timeupdate","durationchange","volumechange","ratechange","ended","loadedmetadata","loadeddata","canplay","canplaythrough","progress","error","resize"],xe=class extends Me{constructor(){super(...arguments);this.autoplay=!1;this.defaultMuted=!1;this.loop=!1;this.scaling="letterbox";this.debug=!1;this._playerCore=null;this.containerRef=null;this.providerContainer=null;this.eventCleanup=[];this.stateReceivers=[];this._mutationObserver=null;this._videoRenditions=null;this._hasDispatchedReady=!1;this.handleMutation=t=>{for(let r of t)if(r.type==="childList"){for(let n of r.addedNodes)n.nodeType===Node.ELEMENT_NODE&&Cr(n,this.providerContainer,this.registerStateReceiver);for(let n of r.removedNodes)n.nodeType===Node.ELEMENT_NODE&&Cr(n,this.providerContainer,this.unregisterStateReceiver)}};this.registerStateReceiver=t=>{this.stateReceivers.includes(t)||(this.stateReceivers.push(t),this._playerCore&&Cs(t,this._playerCore,this._playerCore.state))};this.unregisterStateReceiver=t=>{let r=this.stateReceivers.indexOf(t);r>=0&&(this.stateReceivers.splice(r,1),Rs(t))}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),Ov(),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)}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:n=>{throw new DOMException(`Index ${n} is out of bounds`,"IndexSizeError")},end:n=>{throw new DOMException(`Index ${n} is out of bounds`,"IndexSizeError")}}}get videoWidth(){var n,o,s;let t=(n=this._playerCore)==null?void 0:n.videoElement;if(t!=null&&t.videoWidth)return t.videoWidth;let r=(o=this._playerCore)==null?void 0:o.state.currentQuality;return r!=null&&r.width?r.width:((s=this._playerCore)==null?void 0:s.state.videoWidth)??0}get videoHeight(){var n,o,s;let t=(n=this._playerCore)==null?void 0:n.videoElement;if(t!=null&&t.videoHeight)return t.videoHeight;let r=(o=this._playerCore)==null?void 0:o.state.currentQuality;return r!=null&&r.height?r.height:((s=this._playerCore)==null?void 0:s.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)),this.initPlayerCore()}updated(t){super.updated(t),t.has("source")&&this.loadSource(),t.has("defaultMuted")&&this._playerCore&&this._playerCore.setMuted(this.defaultMuted),t.has("loop")&&this._playerCore&&this._playerCore.setLoop(this.loop)}initPlayerCore(){var t;if(!(this._playerCore||!this.providerContainer))try{this._playerCore=pd(),this.defaultMuted&&this._playerCore.setMuted(!0),this.loop&&this._playerCore.setLoop(!0),this._playerCore.attach(this.providerContainer,this.config),this.setupEventForwarding(),this._videoRenditions=new Ds(this),this._hasDispatchedReady||(this._hasDispatchedReady=!0,Cr(this,this.providerContainer,this.registerStateReceiver),this.dispatchEvent($i(co,{detail:this._playerCore})),this.debug&&console.log("[BPPlayer] Player ready",(t=this._playerCore)==null?void 0:t.state))}catch(r){console.error("[BPPlayer] Failed to initialize player:",r),this.dispatchEvent(rt(r instanceof Error?r:new Error(String(r))))}}async loadSource(){var r,n,o,s,l,d;let t=(n=(r=this.source)==null?void 0:r.sources)==null?void 0:n[0];if(!t){(o=this._playerCore)!=null&&o.ready&&this._playerCore.unloadSource();return}if(!this._playerCore||!this.providerContainer){this.debug&&console.log("[BPPlayer] loadSource skipped - player not initialized");return}this.debug&&console.log("[BPPlayer] loadSource:",t);try{let h=await this._playerCore.loadSource(t);if(!this._playerCore)return;if(h!=null&&h.videoWidth&&(h!=null&&h.videoHeight)&&(this.updateVideoDimensions(h.videoWidth,h.videoHeight),this.debug&&console.log("[BPPlayer] Source video dimensions:",{width:h.videoWidth,height:h.videoHeight})),(s=this._videoRenditions)==null||s._setupListeners(),this.propagateStateToAllReceivers(),this.updateStateAttributes(),(d=(l=this._playerCore)==null?void 0:l.state)!=null&&d.paused&&this.dispatchEvent(Z(Bi)),this.autoplay&&this._playerCore)try{await this._playerCore.play()}catch{}}catch(h){console.error("[BPPlayer] Failed to load source:",h),this.dispatchEvent(rt(h instanceof Error?h:new Error(String(h))))}}propagateStateToAllReceivers(){if(!this._playerCore)return;let t=this._playerCore.state;for(let r of this.stateReceivers)Cs(r,this._playerCore,t)}setupEventForwarding(){if(!this._playerCore)return;let t=this._playerCore;for(let s of Nv){let l=()=>{this.debug&&!["durationchange","timeupdate"].includes(s)&&console.log(`[BPPlayer] Forwarding event: ${s}`,t.state),this.dispatchEvent(Z(s))};t.addEventListener(s,l),this.eventCleanup.push(()=>t.removeEventListener(s,l))}let r=()=>{let s=t.videoElement;s&&this.updateVideoDimensions(s.videoWidth,s.videoHeight)};t.addEventListener("resize",r),t.addEventListener("loadedmetadata",r),this.eventCleanup.push(()=>t.removeEventListener("resize",r)),this.eventCleanup.push(()=>t.removeEventListener("loadedmetadata",r)),r();let n=()=>{this.dispatchEvent(Z(ri))};t.addEventListener("qualitychange",n),this.eventCleanup.push(()=>t.removeEventListener("qualitychange",n));let o=()=>{this.propagateStateToAllReceivers(),this.updateStateAttributes()};t.addEventListener("statechange",o),this.eventCleanup.push(()=>t.removeEventListener("statechange",o))}updateStateAttributes(){if(!this._playerCore)return;let t=this._playerCore.state;ye(this,"paused",t.paused),ye(this,"playing",t.playing),ye(this,"ended",t.ended),ye(this,"seeking",t.seeking),ye(this,"waiting",t.waiting),ye(this,"has-error",t.error!==null),ye(this,"ready",this._playerCore.ready),this.setAttribute("stream-type",t.streamType),this.setAttribute("content-type",t.contentType),t.providerType&&this.setAttribute("provider-type",t.providerType)}destroyPlayer(){var t;this.eventCleanup.forEach(r=>r()),this.eventCleanup=[],(t=this._videoRenditions)==null||t._destroy(),this._videoRenditions=null;for(let r of this.stateReceivers)Rs(r);if(this.stateReceivers=[],this._playerCore&&(this._playerCore.destroy(),this._playerCore=null),this.providerContainer)for(;this.providerContainer.firstChild;)this.providerContainer.removeChild(this.providerContainer.firstChild);this.clearVideoDimensions(),this._hasDispatchedReady=!1}updateVideoDimensions(t,r){t>0&&r>0?(this.style.setProperty("--bp-video-width",String(t)),this.style.setProperty("--bp-video-height",String(r)),this.debug&&console.log("[BPPlayer] Set video dimensions:",{width:t,height:r})):(this.style.removeProperty("--bp-video-width"),this.style.removeProperty("--bp-video-height"),this.debug&&console.log("[BPPlayer] Cleared video dimensions"))}clearVideoDimensions(){this.style.removeProperty("--bp-video-width"),this.style.removeProperty("--bp-video-height")}getContainerClasses(){return["bp-player-container",`bp-player-container--${this.scaling}`].join(" ")}getContainerStyle(){return this.aspectRatio?`aspect-ratio: ${this.aspectRatio}`:""}render(){return Ye`
|
|
230
|
+
`;var lh=!1;function Ov(){if(lh||(lh=!0,document.getElementById("bp-player-styles")))return;ro();let i=document.createElement("style");i.id="bp-player-styles",i.textContent=ah,document.head.appendChild(i)}var Nv=["emptied","loadstart","play","playing","pause","waiting","seeking","seeked","timeupdate","durationchange","volumechange","ratechange","ended","loadedmetadata","loadeddata","canplay","canplaythrough","progress","error","resize"],xe=class extends Me{constructor(){super(...arguments);this.autoplay=!1;this.defaultMuted=!1;this.loop=!1;this.scaling="letterbox";this.debug=!1;this._playerCore=null;this.containerRef=null;this.providerContainer=null;this.eventCleanup=[];this.stateReceivers=[];this._mutationObserver=null;this._videoRenditions=null;this._hasDispatchedReady=!1;this.handleMutation=t=>{for(let r of t)if(r.type==="childList"){for(let n of r.addedNodes)n.nodeType===Node.ELEMENT_NODE&&Cr(n,this.providerContainer,this.registerStateReceiver);for(let n of r.removedNodes)n.nodeType===Node.ELEMENT_NODE&&Cr(n,this.providerContainer,this.unregisterStateReceiver)}};this.registerStateReceiver=t=>{this.stateReceivers.includes(t)||(this.stateReceivers.push(t),this._playerCore&&Cs(t,this._playerCore,this._playerCore.state))};this.unregisterStateReceiver=t=>{let r=this.stateReceivers.indexOf(t);r>=0&&(this.stateReceivers.splice(r,1),Rs(t))}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),Ov(),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)}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:n=>{throw new DOMException(`Index ${n} is out of bounds`,"IndexSizeError")},end:n=>{throw new DOMException(`Index ${n} is out of bounds`,"IndexSizeError")}}}get videoWidth(){var n,o,s;let t=(n=this._playerCore)==null?void 0:n.videoElement;if(t!=null&&t.videoWidth)return t.videoWidth;let r=(o=this._playerCore)==null?void 0:o.state.currentQuality;return r!=null&&r.width?r.width:((s=this._playerCore)==null?void 0:s.state.videoWidth)??0}get videoHeight(){var n,o,s;let t=(n=this._playerCore)==null?void 0:n.videoElement;if(t!=null&&t.videoHeight)return t.videoHeight;let r=(o=this._playerCore)==null?void 0:o.state.currentQuality;return r!=null&&r.height?r.height:((s=this._playerCore)==null?void 0:s.state.videoHeight)??0}get videoElement(){var t;return((t=this._playerCore)==null?void 0:t.videoElement)??null}webkitEnterFullscreen(){var r,n;let t=(r=this._playerCore)==null?void 0:r.activeVideoElement;(n=t==null?void 0:t.webkitEnterFullscreen)==null||n.call(t)}get webkitDisplayingFullscreen(){var r;let t=(r=this._playerCore)==null?void 0:r.activeVideoElement;return(t==null?void 0:t.webkitDisplayingFullscreen)??!1}get webkitPresentationMode(){var r;let t=(r=this._playerCore)==null?void 0:r.activeVideoElement;return(t==null?void 0:t.webkitPresentationMode)??"inline"}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)),this.initPlayerCore()}updated(t){super.updated(t),t.has("source")&&this.loadSource(),t.has("defaultMuted")&&this._playerCore&&this._playerCore.setMuted(this.defaultMuted),t.has("loop")&&this._playerCore&&this._playerCore.setLoop(this.loop)}initPlayerCore(){var t;if(!(this._playerCore||!this.providerContainer))try{this._playerCore=pd(),this.defaultMuted&&this._playerCore.setMuted(!0),this.loop&&this._playerCore.setLoop(!0),this._playerCore.attach(this.providerContainer,this.config),this.setupEventForwarding(),this._videoRenditions=new Ds(this),this._hasDispatchedReady||(this._hasDispatchedReady=!0,Cr(this,this.providerContainer,this.registerStateReceiver),this.dispatchEvent($i(co,{detail:this._playerCore})),this.debug&&console.log("[BPPlayer] Player ready",(t=this._playerCore)==null?void 0:t.state))}catch(r){console.error("[BPPlayer] Failed to initialize player:",r),this.dispatchEvent(rt(r instanceof Error?r:new Error(String(r))))}}async loadSource(){var r,n,o,s,l,d;let t=(n=(r=this.source)==null?void 0:r.sources)==null?void 0:n[0];if(!t){(o=this._playerCore)!=null&&o.ready&&this._playerCore.unloadSource();return}if(!this._playerCore||!this.providerContainer){this.debug&&console.log("[BPPlayer] loadSource skipped - player not initialized");return}this.debug&&console.log("[BPPlayer] loadSource:",t);try{let h=await this._playerCore.loadSource(t);if(!this._playerCore)return;if(h!=null&&h.videoWidth&&(h!=null&&h.videoHeight)&&(this.updateVideoDimensions(h.videoWidth,h.videoHeight),this.debug&&console.log("[BPPlayer] Source video dimensions:",{width:h.videoWidth,height:h.videoHeight})),(s=this._videoRenditions)==null||s._setupListeners(),this.propagateStateToAllReceivers(),this.updateStateAttributes(),(d=(l=this._playerCore)==null?void 0:l.state)!=null&&d.paused&&this.dispatchEvent(Z(Vi)),this.autoplay&&this._playerCore)try{await this._playerCore.play()}catch{}}catch(h){console.error("[BPPlayer] Failed to load source:",h),this.dispatchEvent(rt(h instanceof Error?h:new Error(String(h))))}}propagateStateToAllReceivers(){if(!this._playerCore)return;let t=this._playerCore.state;for(let r of this.stateReceivers)Cs(r,this._playerCore,t)}setupEventForwarding(){if(!this._playerCore)return;let t=this._playerCore;for(let d of Nv){let h=()=>{this.debug&&!["durationchange","timeupdate"].includes(d)&&console.log(`[BPPlayer] Forwarding event: ${d}`,t.state),this.dispatchEvent(Z(d))};t.addEventListener(d,h),this.eventCleanup.push(()=>t.removeEventListener(d,h))}let r=()=>{let d=t.videoElement;d&&this.updateVideoDimensions(d.videoWidth,d.videoHeight)};t.addEventListener("resize",r),t.addEventListener("loadedmetadata",r),this.eventCleanup.push(()=>t.removeEventListener("resize",r)),this.eventCleanup.push(()=>t.removeEventListener("loadedmetadata",r)),r();let n=()=>{this.dispatchEvent(Z(ri))};t.addEventListener("qualitychange",n),this.eventCleanup.push(()=>t.removeEventListener("qualitychange",n));let o=()=>{this.propagateStateToAllReceivers(),this.updateStateAttributes()};t.addEventListener("statechange",o),this.eventCleanup.push(()=>t.removeEventListener("statechange",o));let s=[],l=()=>{s.forEach(h=>h()),s=[];let d=t.activeVideoElement;if(d)for(let h of["webkitbeginfullscreen","webkitendfullscreen"]){let p=()=>this.dispatchEvent(new Event(h));d.addEventListener(h,p),s.push(()=>d.removeEventListener(h,p))}};l(),t.addEventListener("activevideoelementchange",l),this.eventCleanup.push(()=>t.removeEventListener("activevideoelementchange",l)),this.eventCleanup.push(()=>s.forEach(d=>d()))}updateStateAttributes(){if(!this._playerCore)return;let t=this._playerCore.state;ye(this,"paused",t.paused),ye(this,"playing",t.playing),ye(this,"ended",t.ended),ye(this,"seeking",t.seeking),ye(this,"waiting",t.waiting),ye(this,"has-error",t.error!==null),ye(this,"ready",this._playerCore.ready),this.setAttribute("stream-type",t.streamType),this.setAttribute("content-type",t.contentType),t.providerType&&this.setAttribute("provider-type",t.providerType)}destroyPlayer(){var t;this.eventCleanup.forEach(r=>r()),this.eventCleanup=[],(t=this._videoRenditions)==null||t._destroy(),this._videoRenditions=null;for(let r of this.stateReceivers)Rs(r);if(this.stateReceivers=[],this._playerCore&&(this._playerCore.destroy(),this._playerCore=null),this.providerContainer)for(;this.providerContainer.firstChild;)this.providerContainer.removeChild(this.providerContainer.firstChild);this.clearVideoDimensions(),this._hasDispatchedReady=!1}updateVideoDimensions(t,r){t>0&&r>0?(this.style.setProperty("--bp-video-width",String(t)),this.style.setProperty("--bp-video-height",String(r)),this.debug&&console.log("[BPPlayer] Set video dimensions:",{width:t,height:r})):(this.style.removeProperty("--bp-video-width"),this.style.removeProperty("--bp-video-height"),this.debug&&console.log("[BPPlayer] Cleared video dimensions"))}clearVideoDimensions(){this.style.removeProperty("--bp-video-width"),this.style.removeProperty("--bp-video-height")}getContainerClasses(){return["bp-player-container",`bp-player-container--${this.scaling}`].join(" ")}getContainerStyle(){return this.aspectRatio?`aspect-ratio: ${this.aspectRatio}`:""}render(){return Ye`
|
|
231
231
|
<div
|
|
232
232
|
class="${this.getContainerClasses()}"
|
|
233
233
|
style="${this.getContainerStyle()}"
|
|
234
234
|
>
|
|
235
235
|
</div>
|
|
236
|
-
`}};$([z({converter:Rr()})],xe.prototype,"source",2),$([z({type:Boolean})],xe.prototype,"autoplay",2),$([z({type:Boolean,reflect:!0,attribute:"muted"})],xe.prototype,"defaultMuted",2),$([z({type:Boolean})],xe.prototype,"loop",2),$([z({type:String})],xe.prototype,"scaling",2),$([z({type:String,attribute:"aspect-ratio"})],xe.prototype,"aspectRatio",2),$([z({converter:Rr()})],xe.prototype,"config",2),$([z({type:Boolean})],xe.prototype,"debug",2),$([ti()],xe.prototype,"_playerCore",2),xe=$([ei("bp-player")],xe);var y={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"},H={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},_d={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"},dh=Object.entries(_d),a=dh.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{}),Uv={USER_INACTIVE_CHANGE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},Vi=dh.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{...Uv}),Qy=Object.entries(Vi).reduce((i,[e,t])=>{let r=a[e];return r&&(i[t]=r),i},{userinactivechange:"userinactive"}),ch=Object.entries(a).reduce((i,[e,t])=>{let r=Vi[e];return r&&(i[t]=r),i},{userinactive:"userinactivechange"}),Pe={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},ni={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var Os={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},De={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},nt={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var uh={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};function hh(i){return i==null?void 0:i.map($v).join(" ")}function ph(i){return i==null?void 0:i.split(/\s+/).map(Bv)}function $v(i){if(i){let{id:e,width:t,height:r}=i;return[e,t,r].filter(n=>n!=null).join(":")}}function Bv(i){if(i){let[e,t,r]=i.split(":");return{id:e,width:+t,height:+r}}}function mh(i){return i==null?void 0:i.map(Vv).join(" ")}function vh(i){return i==null?void 0:i.split(/\s+/).map(Wv)}function Vv(i){if(i){let{id:e,kind:t,language:r,label:n}=i;return[e,t,r,n].filter(o=>o!=null).join(":")}}function Wv(i){if(i){let[e,t,r,n]=i.split(":");return{id:e,kind:t,language:r,label:n}}}function xr(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}var Ns=i=>new Promise(e=>setTimeout(e,i));var fh=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],Fv=(i,e)=>{let t=i===1?fh[e].singular:fh[e].plural;return`${i} ${t}`},Wi=i=>{if(!xr(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,d)=>l&&Fv(l,d)).filter(l=>l).join(", ")}${t?" remaining":""}`};function ot(i,e){let t=!1;i<0&&(t=!0,i=0-i),i=i<0?0:i;let r=Math.floor(i%60),n=Math.floor(i/60%60),o=Math.floor(i/3600),s=Math.floor(e/60%60),l=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(o=n=r="0"),o=o>0||l>0?o+":":"",n=((o||s>=10)&&n<10?"0"+n:n)+":",r=r<10?"0"+r:r,(t?"-":"")+o+n+r}var jy=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 Eh={"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 gh,yd={en:Eh},Td=((gh=globalThis.navigator)==null?void 0:gh.language)||"en",bh=i=>{Td=i};var qv=i=>{var e,t,r;let[n]=Td.split("-");return((e=yd[Td])==null?void 0:e[i])||((t=yd[n])==null?void 0:t[i])||((r=yd.en)==null?void 0:r[i])||i},b=(i,e={})=>qv(i).replace(/\{(\w+)\}/g,(t,r)=>r in e?String(e[r]):`{${r}}`);var Us=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},Hs=class extends Us{},$s=class extends Hs{constructor(){super(...arguments),this.role=null}},Ad=class{observe(){}unobserve(){}disconnect(){}},_h={createElement:function(){return new uo.HTMLElement},createElementNS:function(){return new uo.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(i){return!1}},uo={ResizeObserver:Ad,document:_h,Node:Hs,Element:$s,HTMLElement:class extends $s{constructor(){super(...arguments),this.innerHTML=""}get content(){return new uo.DocumentFragment}},DocumentFragment:class extends Us{},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}}}}},yh="global"in globalThis&&(globalThis==null?void 0:globalThis.global)===globalThis||typeof window>"u"||typeof window.customElements>"u",Th=Object.keys(uo).every(i=>i in globalThis),c=yh&&!Th?uo:globalThis,ne=yh&&!Th?_h:globalThis.document;var Ah=new WeakMap,Sd=i=>{let e=Ah.get(i);return e||Ah.set(i,e=new Set),e},Sh=new c.ResizeObserver(i=>{for(let e of i)for(let t of Sd(e.target))t(e)});function $t(i,e){Sd(i).add(e),Sh.observe(i)}function Bt(i,e){let t=Sd(i);t.delete(e),t.size||Sh.unobserve(i)}function ie(i){let e={};for(let t of i)e[t.name]=t.value;return e}function ee(i){var e;return(e=Bs(i))!=null?e:mt(i,"media-controller")}function Bs(i){var e;let{MEDIA_CONTROLLER:t}=H,r=i.getAttribute(t);if(r)return(e=Fi(i))==null?void 0:e.getElementById(r)}var Vs=(i,e,t=".value")=>{let r=i.querySelector(t);r&&(r.textContent=e)},Gv=(i,e)=>{let t=`slot[name="${e}"]`,r=i.shadowRoot.querySelector(t);return r?r.children:[]},Ws=(i,e)=>Gv(i,e)[0],Ce=(i,e)=>!i||!e?!1:i!=null&&i.contains(e)?!0:Ce(i,e.getRootNode().host),mt=(i,e)=>{if(!i)return null;let t=i.closest(e);return t||mt(i.getRootNode().host,e)};function ho(i=document){var e;let t=i==null?void 0:i.activeElement;return t?(e=ho(t.shadowRoot))!=null?e:t:null}function Fi(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 Fs(i,{depth:e=3,checkOpacity:t=!0,checkVisibilityCSS:r=!0}={}){if(i.checkVisibility)return i.checkVisibility({checkOpacity:t,checkVisibilityCSS:r});let n=i;for(;n&&e>0;){let o=getComputedStyle(n);if(t&&o.opacity==="0"||r&&o.visibility==="hidden"||o.display==="none")return!1;n=n.parentElement,e--}return!0}function kh(i,e,t,r){let n=r.x-t.x,o=r.y-t.y,s=n*n+o*o;if(s===0)return 0;let l=((i-t.x)*n+(e-t.y)*o)/s;return Math.max(0,Math.min(1,l))}function te(i,e){let t=zv(i,r=>r===e);return t||po(i,e)}function zv(i,e){var t,r;let n;for(n of(t=i.querySelectorAll("style:not([media])"))!=null?t:[]){let o;try{o=(r=n.sheet)==null?void 0:r.cssRules}catch{continue}for(let s of o??[])if(e(s.selectorText))return s}}function po(i,e){var t,r;let n=(t=i.querySelectorAll("style:not([media])"))!=null?t:[],o=n==null?void 0:n[n.length-1];return o!=null&&o.sheet?(o==null||o.sheet.insertRule(`${e}{}`,o.sheet.cssRules.length),(r=o.sheet.cssRules)==null?void 0:r[o.sheet.cssRules.length-1]):(console.warn("Media Chrome: No style sheet found on style tag of",i),{style:{setProperty:()=>{},removeProperty:()=>"",getPropertyValue:()=>""}})}function B(i,e,t=Number.NaN){let r=i.getAttribute(e);return r!=null?+r:t}function F(i,e,t){let r=+t;if(t==null||Number.isNaN(r)){i.hasAttribute(e)&&i.removeAttribute(e);return}B(i,e,void 0)!==r&&i.setAttribute(e,`${r}`)}function R(i,e){return i.hasAttribute(e)}function M(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}R(i,e)!=t&&i.toggleAttribute(e,t)}function O(i,e,t=null){var r;return(r=i.getAttribute(e))!=null?r:t}function N(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}let r=`${t}`;O(i,e,void 0)!==r&&i.setAttribute(e,r)}var Lh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},oi=(i,e,t)=>(Lh(i,e,"read from private field"),t?t.call(i):e.get(i)),Yv=(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)},Ks=(i,e,t,r)=>(Lh(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Oe;function Qv(i){return`
|
|
236
|
+
`}};$([z({converter:Rr()})],xe.prototype,"source",2),$([z({type:Boolean})],xe.prototype,"autoplay",2),$([z({type:Boolean,reflect:!0,attribute:"muted"})],xe.prototype,"defaultMuted",2),$([z({type:Boolean})],xe.prototype,"loop",2),$([z({type:String})],xe.prototype,"scaling",2),$([z({type:String,attribute:"aspect-ratio"})],xe.prototype,"aspectRatio",2),$([z({converter:Rr()})],xe.prototype,"config",2),$([z({type:Boolean})],xe.prototype,"debug",2),$([ti()],xe.prototype,"_playerCore",2),xe=$([ei("bp-player")],xe);var y={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"},H={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},_d={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"},dh=Object.entries(_d),a=dh.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{}),Uv={USER_INACTIVE_CHANGE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},Bi=dh.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{...Uv}),Qy=Object.entries(Bi).reduce((i,[e,t])=>{let r=a[e];return r&&(i[t]=r),i},{userinactivechange:"userinactive"}),ch=Object.entries(a).reduce((i,[e,t])=>{let r=Bi[e];return r&&(i[t]=r),i},{userinactive:"userinactivechange"}),Pe={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},ni={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var Os={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},De={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},nt={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var uh={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};function hh(i){return i==null?void 0:i.map($v).join(" ")}function ph(i){return i==null?void 0:i.split(/\s+/).map(Vv)}function $v(i){if(i){let{id:e,width:t,height:r}=i;return[e,t,r].filter(n=>n!=null).join(":")}}function Vv(i){if(i){let[e,t,r]=i.split(":");return{id:e,width:+t,height:+r}}}function mh(i){return i==null?void 0:i.map(Bv).join(" ")}function vh(i){return i==null?void 0:i.split(/\s+/).map(Wv)}function Bv(i){if(i){let{id:e,kind:t,language:r,label:n}=i;return[e,t,r,n].filter(o=>o!=null).join(":")}}function Wv(i){if(i){let[e,t,r,n]=i.split(":");return{id:e,kind:t,language:r,label:n}}}function xr(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}var Ns=i=>new Promise(e=>setTimeout(e,i));var fh=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],Fv=(i,e)=>{let t=i===1?fh[e].singular:fh[e].plural;return`${i} ${t}`},Wi=i=>{if(!xr(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,d)=>l&&Fv(l,d)).filter(l=>l).join(", ")}${t?" remaining":""}`};function ot(i,e){let t=!1;i<0&&(t=!0,i=0-i),i=i<0?0:i;let r=Math.floor(i%60),n=Math.floor(i/60%60),o=Math.floor(i/3600),s=Math.floor(e/60%60),l=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(o=n=r="0"),o=o>0||l>0?o+":":"",n=((o||s>=10)&&n<10?"0"+n:n)+":",r=r<10?"0"+r:r,(t?"-":"")+o+n+r}var jy=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 Eh={"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 gh,yd={en:Eh},Td=((gh=globalThis.navigator)==null?void 0:gh.language)||"en",bh=i=>{Td=i};var qv=i=>{var e,t,r;let[n]=Td.split("-");return((e=yd[Td])==null?void 0:e[i])||((t=yd[n])==null?void 0:t[i])||((r=yd.en)==null?void 0:r[i])||i},b=(i,e={})=>qv(i).replace(/\{(\w+)\}/g,(t,r)=>r in e?String(e[r]):`{${r}}`);var Us=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},Hs=class extends Us{},$s=class extends Hs{constructor(){super(...arguments),this.role=null}},Ad=class{observe(){}unobserve(){}disconnect(){}},_h={createElement:function(){return new uo.HTMLElement},createElementNS:function(){return new uo.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(i){return!1}},uo={ResizeObserver:Ad,document:_h,Node:Hs,Element:$s,HTMLElement:class extends $s{constructor(){super(...arguments),this.innerHTML=""}get content(){return new uo.DocumentFragment}},DocumentFragment:class extends Us{},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}}}}},yh="global"in globalThis&&(globalThis==null?void 0:globalThis.global)===globalThis||typeof window>"u"||typeof window.customElements>"u",Th=Object.keys(uo).every(i=>i in globalThis),c=yh&&!Th?uo:globalThis,ne=yh&&!Th?_h:globalThis.document;var Ah=new WeakMap,Sd=i=>{let e=Ah.get(i);return e||Ah.set(i,e=new Set),e},Sh=new c.ResizeObserver(i=>{for(let e of i)for(let t of Sd(e.target))t(e)});function $t(i,e){Sd(i).add(e),Sh.observe(i)}function Vt(i,e){let t=Sd(i);t.delete(e),t.size||Sh.unobserve(i)}function ie(i){let e={};for(let t of i)e[t.name]=t.value;return e}function ee(i){var e;return(e=Vs(i))!=null?e:mt(i,"media-controller")}function Vs(i){var e;let{MEDIA_CONTROLLER:t}=H,r=i.getAttribute(t);if(r)return(e=Fi(i))==null?void 0:e.getElementById(r)}var Bs=(i,e,t=".value")=>{let r=i.querySelector(t);r&&(r.textContent=e)},Gv=(i,e)=>{let t=`slot[name="${e}"]`,r=i.shadowRoot.querySelector(t);return r?r.children:[]},Ws=(i,e)=>Gv(i,e)[0],Ce=(i,e)=>!i||!e?!1:i!=null&&i.contains(e)?!0:Ce(i,e.getRootNode().host),mt=(i,e)=>{if(!i)return null;let t=i.closest(e);return t||mt(i.getRootNode().host,e)};function ho(i=document){var e;let t=i==null?void 0:i.activeElement;return t?(e=ho(t.shadowRoot))!=null?e:t:null}function Fi(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 Fs(i,{depth:e=3,checkOpacity:t=!0,checkVisibilityCSS:r=!0}={}){if(i.checkVisibility)return i.checkVisibility({checkOpacity:t,checkVisibilityCSS:r});let n=i;for(;n&&e>0;){let o=getComputedStyle(n);if(t&&o.opacity==="0"||r&&o.visibility==="hidden"||o.display==="none")return!1;n=n.parentElement,e--}return!0}function kh(i,e,t,r){let n=r.x-t.x,o=r.y-t.y,s=n*n+o*o;if(s===0)return 0;let l=((i-t.x)*n+(e-t.y)*o)/s;return Math.max(0,Math.min(1,l))}function te(i,e){let t=zv(i,r=>r===e);return t||po(i,e)}function zv(i,e){var t,r;let n;for(n of(t=i.querySelectorAll("style:not([media])"))!=null?t:[]){let o;try{o=(r=n.sheet)==null?void 0:r.cssRules}catch{continue}for(let s of o??[])if(e(s.selectorText))return s}}function po(i,e){var t,r;let n=(t=i.querySelectorAll("style:not([media])"))!=null?t:[],o=n==null?void 0:n[n.length-1];return o!=null&&o.sheet?(o==null||o.sheet.insertRule(`${e}{}`,o.sheet.cssRules.length),(r=o.sheet.cssRules)==null?void 0:r[o.sheet.cssRules.length-1]):(console.warn("Media Chrome: No style sheet found on style tag of",i),{style:{setProperty:()=>{},removeProperty:()=>"",getPropertyValue:()=>""}})}function V(i,e,t=Number.NaN){let r=i.getAttribute(e);return r!=null?+r:t}function F(i,e,t){let r=+t;if(t==null||Number.isNaN(r)){i.hasAttribute(e)&&i.removeAttribute(e);return}V(i,e,void 0)!==r&&i.setAttribute(e,`${r}`)}function R(i,e){return i.hasAttribute(e)}function M(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}R(i,e)!=t&&i.toggleAttribute(e,t)}function O(i,e,t=null){var r;return(r=i.getAttribute(e))!=null?r:t}function N(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}let r=`${t}`;O(i,e,void 0)!==r&&i.setAttribute(e,r)}var Lh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},oi=(i,e,t)=>(Lh(i,e,"read from private field"),t?t.call(i):e.get(i)),Yv=(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)},Ks=(i,e,t,r)=>(Lh(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Oe;function Qv(i){return`
|
|
237
237
|
<style>
|
|
238
238
|
:host {
|
|
239
239
|
display: var(--media-control-display, var(--media-gesture-receiver-display, inline-block));
|
|
240
240
|
box-sizing: border-box;
|
|
241
241
|
}
|
|
242
242
|
</style>
|
|
243
|
-
`}var Pr=class extends c.HTMLElement{constructor(){if(super(),Yv(this,Oe,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=ie(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[H.MEDIA_CONTROLLER,a.MEDIA_PAUSED]}attributeChangedCallback(e,t,r){var n,o,s,l,d;e===H.MEDIA_CONTROLLER&&(t&&((o=(n=oi(this,Oe))==null?void 0:n.unassociateElement)==null||o.call(n,this),Ks(this,Oe,null)),r&&this.isConnected&&(Ks(this,Oe,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=oi(this,Oe))==null?void 0:l.associateElement)==null||d.call(l,this)))}connectedCallback(){var e,t,r,n;this.tabIndex=-1,this.setAttribute("aria-hidden","true"),Ks(this,Oe,Zv(this)),this.getAttribute(H.MEDIA_CONTROLLER)&&((t=(e=oi(this,Oe))==null?void 0:e.associateElement)==null||t.call(e,this)),(r=oi(this,Oe))==null||r.addEventListener("pointerdown",this),(n=oi(this,Oe))==null||n.addEventListener("click",this)}disconnectedCallback(){var e,t,r,n;this.getAttribute(H.MEDIA_CONTROLLER)&&((t=(e=oi(this,Oe))==null?void 0:e.unassociateElement)==null||t.call(e,this)),(r=oi(this,Oe))==null||r.removeEventListener("pointerdown",this),(n=oi(this,Oe))==null||n.removeEventListener("click",this),Ks(this,Oe,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:o,clientY:s}=e,{left:l,top:d,width:h,height:p}=this.getBoundingClientRect(),v=o-l,f=s-d;if(v<0||f<0||v>h||f>p||h===0&&p===0)return;let m=this._pointerType||"mouse";if(this._pointerType=void 0,m===Os.TOUCH){this.handleTap(e);return}else if(m===Os.MOUSE||m===Os.PEN){this.handleMouseClick(e);return}}}}get mediaPaused(){return R(this,a.MEDIA_PAUSED)}set mediaPaused(e){M(this,a.MEDIA_PAUSED,e)}handleTap(e){}handleMouseClick(e){let t=this.mediaPaused?y.MEDIA_PLAY_REQUEST:y.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new c.CustomEvent(t,{composed:!0,bubbles:!0}))}};Oe=new WeakMap;Pr.shadowRootOptions={mode:"open"};Pr.getTemplateHTML=Qv;function Zv(i){var e;let t=i.getAttribute(H.MEDIA_CONTROLLER);return t?(e=i.getRootNode())==null?void 0:e.getElementById(t):mt(i,"media-controller")}c.customElements.get("media-gesture-receiver")||c.customElements.define("media-gesture-receiver",Pr);var qs=Pr;var
|
|
243
|
+
`}var Pr=class extends c.HTMLElement{constructor(){if(super(),Yv(this,Oe,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=ie(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[H.MEDIA_CONTROLLER,a.MEDIA_PAUSED]}attributeChangedCallback(e,t,r){var n,o,s,l,d;e===H.MEDIA_CONTROLLER&&(t&&((o=(n=oi(this,Oe))==null?void 0:n.unassociateElement)==null||o.call(n,this),Ks(this,Oe,null)),r&&this.isConnected&&(Ks(this,Oe,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=oi(this,Oe))==null?void 0:l.associateElement)==null||d.call(l,this)))}connectedCallback(){var e,t,r,n;this.tabIndex=-1,this.setAttribute("aria-hidden","true"),Ks(this,Oe,Zv(this)),this.getAttribute(H.MEDIA_CONTROLLER)&&((t=(e=oi(this,Oe))==null?void 0:e.associateElement)==null||t.call(e,this)),(r=oi(this,Oe))==null||r.addEventListener("pointerdown",this),(n=oi(this,Oe))==null||n.addEventListener("click",this)}disconnectedCallback(){var e,t,r,n;this.getAttribute(H.MEDIA_CONTROLLER)&&((t=(e=oi(this,Oe))==null?void 0:e.unassociateElement)==null||t.call(e,this)),(r=oi(this,Oe))==null||r.removeEventListener("pointerdown",this),(n=oi(this,Oe))==null||n.removeEventListener("click",this),Ks(this,Oe,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:o,clientY:s}=e,{left:l,top:d,width:h,height:p}=this.getBoundingClientRect(),v=o-l,f=s-d;if(v<0||f<0||v>h||f>p||h===0&&p===0)return;let m=this._pointerType||"mouse";if(this._pointerType=void 0,m===Os.TOUCH){this.handleTap(e);return}else if(m===Os.MOUSE||m===Os.PEN){this.handleMouseClick(e);return}}}}get mediaPaused(){return R(this,a.MEDIA_PAUSED)}set mediaPaused(e){M(this,a.MEDIA_PAUSED,e)}handleTap(e){}handleMouseClick(e){let t=this.mediaPaused?y.MEDIA_PLAY_REQUEST:y.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new c.CustomEvent(t,{composed:!0,bubbles:!0}))}};Oe=new WeakMap;Pr.shadowRootOptions={mode:"open"};Pr.getTemplateHTML=Qv;function Zv(i){var e;let t=i.getAttribute(H.MEDIA_CONTROLLER);return t?(e=i.getRootNode())==null?void 0:e.getElementById(t):mt(i,"media-controller")}c.customElements.get("media-gesture-receiver")||c.customElements.define("media-gesture-receiver",Pr);var qs=Pr;var Id=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Fe=(i,e,t)=>(Id(i,e,"read from private field"),t?t.call(i):e.get(i)),We=(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)},Ki=(i,e,t,r)=>(Id(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Qe=(i,e,t)=>(Id(i,e,"access private method"),t),Ys,Dr,vo,Or,Gs,kd,wh,mo,zs,Ld,Ih,wd,Ch,fo,Qs,Zs,Cd,Nr,Eo,P={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive",AUTOHIDE_OVER_CONTROLS:"autohideovercontrols"};function Xv(i){return`
|
|
244
244
|
<style>
|
|
245
245
|
|
|
246
246
|
:host([${a.MEDIA_IS_FULLSCREEN}]) ::slotted([slot=media]) {
|
|
@@ -391,7 +391,7 @@ bp-player[has-error] {
|
|
|
391
391
|
<slot part="bottom chrome"></slot>
|
|
392
392
|
</span>
|
|
393
393
|
<slot name="dialog" part="layer dialog-layer"></slot>
|
|
394
|
-
`}var jv=Object.values(a),Jv="sm:384 md:576 lg:768 xl:960";function ef(i){Rh(i.target,i.contentRect.width)}function Rh(i,e){var t;if(!i.isConnected)return;let r=(t=i.getAttribute(P.BREAKPOINTS))!=null?t:Jv,n=tf(r),o=rf(n,e),s=!1;if(Object.keys(n).forEach(l=>{if(o.includes(l)){i.hasAttribute(`breakpoint${l}`)||(i.setAttribute(`breakpoint${l}`,""),s=!0);return}i.hasAttribute(`breakpoint${l}`)&&(i.removeAttribute(`breakpoint${l}`),s=!0)}),s){let l=new CustomEvent(Vi.BREAKPOINTS_CHANGE,{detail:o});i.dispatchEvent(l)}i.breakpointsComputed||(i.breakpointsComputed=!0,i.dispatchEvent(new CustomEvent(Vi.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))}function tf(i){let e=i.split(/\s+/);return Object.fromEntries(e.map(t=>t.split(":")))}function rf(i,e){return Object.keys(i).filter(t=>e>=parseInt(i[t]))}var qi=class extends c.HTMLElement{constructor(){if(super(),We(this,kd),We(this,Ld),We(this,Id),We(this,fo),We(this,Zs),We(this,Nr),We(this,Ys,0),We(this,Dr,null),We(this,vo,null),We(this,Or,void 0),this.breakpointsComputed=!1,We(this,Gs,new MutationObserver(Qe(this,kd,Ih).bind(this))),We(this,mo,!1),We(this,zs,t=>{Fe(this,mo)||(setTimeout(()=>{ef(t),Ki(this,mo,!1)},0),Ki(this,mo,!0))}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let t=ie(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){Fe(this,Dr)&&this.mediaUnsetCallback(Fe(this,Dr));return}this.handleMediaUpdated(this.media)})}static get observedAttributes(){return[P.AUTOHIDE,P.GESTURES_DISABLED].concat(jv).filter(e=>![a.MEDIA_RENDITION_LIST,a.MEDIA_AUDIO_TRACK_LIST,a.MEDIA_CHAPTERS_CUES,a.MEDIA_WIDTH,a.MEDIA_HEIGHT,a.MEDIA_ERROR,a.MEDIA_ERROR_MESSAGE].includes(e))}attributeChangedCallback(e,t,r){e.toLowerCase()==P.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&&(Ki(this,Dr,e),e.localName.includes("-")&&await c.customElements.whenDefined(e.localName),this.mediaSetCallback(e))}connectedCallback(){var e;Fe(this,Gs).observe(this,{childList:!0,subtree:!0}),$t(this,Fe(this,zs));let r=this.getAttribute(P.AUDIO)!=null?b("audio player"):b("video player");this.setAttribute("role","region"),this.setAttribute("aria-label",r),this.handleMediaUpdated(this.media),this.setAttribute(P.USER_INACTIVE,""),Rh(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=c.window)==null||e.addEventListener("mouseup",this)}disconnectedCallback(){var e;Fe(this,Gs).disconnect(),Bt(this,Fe(this,zs)),this.media&&this.mediaUnsetCallback(this.media),(e=c.window)==null||e.removeEventListener("mouseup",this)}mediaSetCallback(e){}mediaUnsetCallback(e){Ki(this,Dr,null)}handleEvent(e){switch(e.type){case"pointerdown":Ki(this,Ys,e.timeStamp);break;case"pointermove":Qe(this,Ld,wh).call(this,e);break;case"pointerup":Qe(this,Id,Ch).call(this,e);break;case"mouseleave":Qe(this,fo,Qs).call(this);break;case"mouseup":this.removeAttribute(P.KEYBOARD_CONTROL);break;case"keyup":Qe(this,Nr,Eo).call(this),this.setAttribute(P.KEYBOARD_CONTROL,"");break}}set autohide(e){let t=Number(e);Ki(this,Or,isNaN(t)?0:t)}get autohide(){return(Fe(this,Or)===void 0?2:Fe(this,Or)).toString()}get breakpoints(){return O(this,P.BREAKPOINTS)}set breakpoints(e){N(this,P.BREAKPOINTS,e)}get audio(){return R(this,P.AUDIO)}set audio(e){M(this,P.AUDIO,e)}get gesturesDisabled(){return R(this,P.GESTURES_DISABLED)}set gesturesDisabled(e){M(this,P.GESTURES_DISABLED,e)}get keyboardControl(){return R(this,P.KEYBOARD_CONTROL)}set keyboardControl(e){M(this,P.KEYBOARD_CONTROL,e)}get noAutohide(){return R(this,P.NO_AUTOHIDE)}set noAutohide(e){M(this,P.NO_AUTOHIDE,e)}get autohideOverControls(){return R(this,P.AUTOHIDE_OVER_CONTROLS)}set autohideOverControls(e){M(this,P.AUTOHIDE_OVER_CONTROLS,e)}get userInteractive(){return R(this,P.USER_INACTIVE)}set userInteractive(e){M(this,P.USER_INACTIVE,e)}};Ys=new WeakMap;Dr=new WeakMap;vo=new WeakMap;Or=new WeakMap;Gs=new WeakMap;kd=new WeakSet;Ih=function(i){let e=this.media;for(let t of i){if(t.type!=="childList")continue;let r=t.removedNodes;for(let n of r){if(n.slot!="media"||t.target!=this)continue;let o=t.previousSibling&&t.previousSibling.previousElementSibling;if(!o||!e)this.mediaUnsetCallback(n);else{let s=o.slot!=="media";for(;(o=o.previousSibling)!==null;)o.slot=="media"&&(s=!1);s&&this.mediaUnsetCallback(n)}}if(e)for(let n of t.addedNodes)n===e&&this.handleMediaUpdated(e)}};mo=new WeakMap;zs=new WeakMap;Ld=new WeakSet;wh=function(i){if(i.pointerType!=="mouse"&&i.timeStamp-Fe(this,Ys)<250)return;Qe(this,Zs,Cd).call(this),clearTimeout(Fe(this,vo));let e=this.hasAttribute(P.AUTOHIDE_OVER_CONTROLS);([this,this.media].includes(i.target)||e)&&Qe(this,Nr,Eo).call(this)};Id=new WeakSet;Ch=function(i){if(i.pointerType==="touch"){let e=!this.hasAttribute(P.USER_INACTIVE);[this,this.media].includes(i.target)&&e?Qe(this,fo,Qs).call(this):Qe(this,Nr,Eo).call(this)}else i.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e==null?void 0:e.localName))&&Qe(this,Nr,Eo).call(this)};fo=new WeakSet;Qs=function(){if(Fe(this,Or)<0||this.hasAttribute(P.USER_INACTIVE))return;this.setAttribute(P.USER_INACTIVE,"");let i=new c.CustomEvent(Vi.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(i)};Zs=new WeakSet;Cd=function(){if(!this.hasAttribute(P.USER_INACTIVE))return;this.removeAttribute(P.USER_INACTIVE);let i=new c.CustomEvent(Vi.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(i)};Nr=new WeakSet;Eo=function(){Qe(this,Zs,Cd).call(this),clearTimeout(Fe(this,vo));let i=parseInt(this.autohide);i<0||Ki(this,vo,setTimeout(()=>{Qe(this,fo,Qs).call(this)},i*1e3))};qi.shadowRootOptions={mode:"open"};qi.getTemplateHTML=Xv;c.customElements.get("media-container")||c.customElements.define("media-container",qi);var Mh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Te=(i,e,t)=>(Mh(i,e,"read from private field"),t?t.call(i):e.get(i)),go=(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)},Xs=(i,e,t,r)=>(Mh(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ur,Hr,js,Gi,Vt,si,ai=class{constructor(e,t,{defaultValue:r}={defaultValue:void 0}){go(this,Vt),go(this,Ur,void 0),go(this,Hr,void 0),go(this,js,void 0),go(this,Gi,new Set),Xs(this,Ur,e),Xs(this,Hr,t),Xs(this,js,new Set(r))}[Symbol.iterator](){return Te(this,Vt,si).values()}get length(){return Te(this,Vt,si).size}get value(){var e;return(e=[...Te(this,Vt,si)].join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(Xs(this,Gi,new Set),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return[...Te(this,Vt,si)][e]}values(){return Te(this,Vt,si).values()}forEach(e,t){Te(this,Vt,si).forEach(e,t)}add(...e){var t,r;e.forEach(n=>Te(this,Gi).add(n)),!(this.value===""&&!((t=Te(this,Ur))!=null&&t.hasAttribute(`${Te(this,Hr)}`)))&&((r=Te(this,Ur))==null||r.setAttribute(`${Te(this,Hr)}`,`${this.value}`))}remove(...e){var t;e.forEach(r=>Te(this,Gi).delete(r)),(t=Te(this,Ur))==null||t.setAttribute(`${Te(this,Hr)}`,`${this.value}`)}contains(e){return Te(this,Vt,si).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}};Ur=new WeakMap;Hr=new WeakMap;js=new WeakMap;Gi=new WeakMap;Vt=new WeakSet;si=function(){return Te(this,Gi).size?Te(this,Gi):Te(this,js)};var nf=(i="")=>i.split(/\s+/),xh=(i="")=>{let[e,t,r]=i.split(":"),n=r?decodeURIComponent(r):void 0;return{kind:e==="cc"?Pe.CAPTIONS:Pe.SUBTITLES,language:t,label:n}},zi=(i="",e={})=>nf(i).map(t=>{let r=xh(t);return{...e,...r}}),Rd=i=>i?Array.isArray(i)?i.map(e=>typeof e=="string"?xh(e):e):typeof i=="string"?zi(i):[i]:[],Js=({kind:i,label:e,language:t}={kind:"subtitles"})=>e?`${i==="captions"?"cc":"sb"}:${t}:${encodeURIComponent(e)}`:t,Wt=(i=[])=>Array.prototype.map.call(i,Js).join(" "),of=(i,e)=>t=>t[i]===e,Ph=i=>{let e=Object.entries(i).map(([t,r])=>of(t,r));return t=>e.every(r=>r(t))},Yi=(i,e=[],t=[])=>{let r=Rd(t).map(Ph),n=o=>r.some(s=>s(o));Array.from(e).filter(n).forEach(o=>{o.mode=i})},Qi=(i,e=()=>!0)=>{if(!(i!=null&&i.textTracks))return[];let t=typeof e=="function"?e:Ph(e);return Array.from(i.textTracks).filter(t)},ea=i=>{var e;return!!((e=i.mediaSubtitlesShowing)!=null&&e.length)||i.hasAttribute(a.MEDIA_SUBTITLES_SHOWING)};var Oh=i=>{var e;let{media:t,fullscreenElement:r}=i;try{let n=r&&"requestFullscreen"in r?"requestFullscreen":r&&"webkitRequestFullScreen"in r?"webkitRequestFullScreen":void 0;if(n){let o=(e=r[n])==null?void 0:e.call(r);if(o instanceof Promise)return o.catch(()=>{})}else t!=null&&t.webkitEnterFullscreen?t.webkitEnterFullscreen():t!=null&&t.requestFullscreen&&t.requestFullscreen()}catch(n){console.error(n)}},Dh="exitFullscreen"in ne?"exitFullscreen":"webkitExitFullscreen"in ne?"webkitExitFullscreen":"webkitCancelFullScreen"in ne?"webkitCancelFullScreen":void 0,Nh=i=>{var e;let{documentElement:t}=i;if(Dh){let r=(e=t==null?void 0:t[Dh])==null?void 0:e.call(t);if(r instanceof Promise)return r.catch(()=>{})}},bo="fullscreenElement"in ne?"fullscreenElement":"webkitFullscreenElement"in ne?"webkitFullscreenElement":void 0,sf=i=>{let{documentElement:e,media:t}=i,r=e==null?void 0:e[bo];return!r&&"webkitDisplayingFullscreen"in t&&"webkitPresentationMode"in t&&t.webkitDisplayingFullscreen&&t.webkitPresentationMode===uh.FULLSCREEN?t:r},Uh=i=>{var e;let{media:t,documentElement:r,fullscreenElement:n=t}=i;if(!t||!r)return!1;let o=sf(i);if(!o)return!1;if(o===n||o===t)return!0;if(o.localName.includes("-")){let s=o.shadowRoot;if(!(bo in s))return Ce(o,n);for(;s!=null&&s[bo];){if(s[bo]===n)return!0;s=(e=s[bo])==null?void 0:e.shadowRoot}}return!1},af="fullscreenEnabled"in ne?"fullscreenEnabled":"webkitFullscreenEnabled"in ne?"webkitFullscreenEnabled":void 0,Hh=i=>{let{documentElement:e,media:t}=i;return!!(e!=null&&e[af])||t&&"webkitSupportsFullscreen"in t};var ta,Md=()=>{var i,e;return ta||(ta=(e=(i=ne)==null?void 0:i.createElement)==null?void 0:e.call(i,"video"),ta)},$h=async(i=Md())=>{if(!i)return!1;let e=i.volume;i.volume=e/2+.1;let t=new AbortController,r=await Promise.race([lf(i,t.signal),df(i,e)]);return t.abort(),r},lf=(i,e)=>new Promise(t=>{i.addEventListener("volumechange",()=>t(!0),{signal:e})}),df=async(i,e)=>{for(let t=0;t<10;t++){if(i.volume===e)return!1;await Ns(10)}return i.volume!==e},cf=/.*Version\/.*Safari\/.*/.test(c.navigator.userAgent),xd=(i=Md())=>c.matchMedia("(display-mode: standalone)").matches&&cf?!1:typeof(i==null?void 0:i.requestPictureInPicture)=="function",Pd=(i=Md())=>Hh({documentElement:ne,media:i}),Bh=Pd(),Vh=xd(),Wh=!!c.WebKitPlaybackTargetAvailabilityEvent,Fh=!!c.chrome;var $r=i=>Qi(i.media,e=>[Pe.SUBTITLES,Pe.CAPTIONS].includes(e.kind)).sort((e,t)=>e.kind>=t.kind?1:-1),Dd=i=>Qi(i.media,e=>e.mode===ni.SHOWING&&[Pe.SUBTITLES,Pe.CAPTIONS].includes(e.kind)),ia=(i,e)=>{let t=$r(i),r=Dd(i),n=!!r.length;if(t.length){if(e===!1||n&&e!==!0)Yi(ni.DISABLED,t,r);else if(e===!0||!n&&e!==!1){let o=t[0],{options:s}=i;if(!(s!=null&&s.noSubtitlesLangPref)){let p=globalThis.localStorage.getItem("media-chrome-pref-subtitles-lang"),v=p?[p,...globalThis.navigator.languages]:globalThis.navigator.languages,f=t.filter(m=>v.some(_=>m.language.toLowerCase().startsWith(_.split("-")[0]))).sort((m,_)=>{let g=v.findIndex(k=>m.language.toLowerCase().startsWith(k.split("-")[0])),I=v.findIndex(k=>_.language.toLowerCase().startsWith(k.split("-")[0]));return g-I});f[0]&&(o=f[0])}let{language:l,label:d,kind:h}=o;Yi(ni.DISABLED,t,r),Yi(ni.SHOWING,t,[{language:l,label:d,kind:h}])}}},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)?uf(i,e):Object.entries(i).every(([t,r])=>t in e&&ra(r,e[t])),uf=(i,e)=>{let t=Array.isArray(i),r=Array.isArray(e);return t!==r?!1:t||r?i.length!==e.length?!1:i.every((n,o)=>ra(n,e[o])):!0};var hf=Object.values(nt),na,pf=$h().then(i=>(na=i,na)),Kh=async(...i)=>{await Promise.all(i.filter(e=>e).map(async e=>{if(!("localName"in e&&e instanceof c.HTMLElement))return;let t=e.localName;if(!t.includes("-"))return;let r=c.customElements.get(t);r&&e instanceof r||(await c.customElements.whenDefined(t),c.customElements.upgrade(e))}))},mf=new c.DOMParser,vf=i=>i&&(mf.parseFromString(i,"text/html").body.textContent||i),Br={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:n}=i;if((e==null?void 0:e.type)!=="playing")return(r=(t=n==null?void 0:n.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 n=c.localStorage.getItem("media-chrome-pref-muted")!==null,o=t.hasAttribute("muted");if(r){n&&c.localStorage.removeItem("media-chrome-pref-muted");return}if(o&&!n)return;c.localStorage.setItem("media-chrome-pref-muted",i?"true":"false")}catch(n){console.debug("Error setting muted pref",n)}}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(i,e)=>{let{options:{noMutedPref:t}}=e,{media:r}=e;if(!(!r||r.muted||t))try{let n=c.localStorage.getItem("media-chrome-pref-muted")==="true";Br.mediaMuted.set(n,e),i(n)}catch(n){console.debug("Error getting muted pref",n)}}]},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?c.localStorage.removeItem("media-chrome-pref-volume"):!t.hasAttribute("muted")&&!r&&c.localStorage.setItem("media-chrome-pref-volume",i.toString())}catch(n){console.debug("Error setting volume pref",n)}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 n=c.localStorage.getItem("media-chrome-pref-volume");if(n==null)return;Br.mediaVolume.set(+n,e),i(+n)}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||!xr(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),n=t.seekable.end(t.seekable.length-1);if(!(!r&&!n))return[Number(r.toFixed(3)),Number(n.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((n,o)=>[Number(r.start(o).toFixed(3)),Number(r.end(o).toFixed(3))])},mediaEvents:["progress","emptied"]},mediaStreamType:{get(i){let{media:e,options:{defaultStreamType:t}={}}=i,r=[nt.LIVE,nt.ON_DEMAND].includes(t)?t:void 0;if(!e)return r;let{streamType:n}=e;if(hf.includes(n))return n===nt.UNKNOWN?r:n;let o=e.duration;return o===1/0?nt.LIVE:Number.isFinite(o)?nt.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=Br.mediaStreamType.get(i);return(t==null||Number.isNaN(t))&&r===nt.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(!(Br.mediaStreamType.get(i)===nt.LIVE))return!1;let n=e.seekable;if(!n)return!0;if(!n.length)return!1;let o=n.end(n.length-1)-t;return e.currentTime>=o},mediaEvents:["playing","timeupdate","progress","waiting","emptied"]},mediaSubtitlesList:{get(i){return $r(i).map(({kind:e,label:t,language:r})=>({kind:e,label:t,language:r}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},mediaSubtitlesShowing:{get(i){return Dd(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:n,options:o}=e;if(!n)return;let s=l=>{var d;!o.defaultSubtitles||l&&![Pe.CAPTIONS,Pe.SUBTITLES].includes((d=l==null?void 0:l.track)==null?void 0:d.kind)||ia(e,!0)};return n.addEventListener("loadstart",s),(t=n.textTracks)==null||t.addEventListener("addtrack",s),(r=n.textTracks)==null||r.addEventListener("removetrack",s),()=>{var l,d;n.removeEventListener("loadstart",s),(l=n.textTracks)==null||l.removeEventListener("addtrack",s),(d=n.textTracks)==null||d.removeEventListener("removetrack",s)}}]},mediaChaptersCues:{get(i){var e;let{media:t}=i;if(!t)return[];let[r]=Qi(t,{kind:Pe.CHAPTERS});return Array.from((e=r==null?void 0:r.cues)!=null?e:[]).map(({text:n,startTime:o,endTime:s})=>({text:vf(n),startTime:o,endTime:s}))},mediaEvents:["loadstart","loadedmetadata"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:r}=e;if(!r)return;let n=r.querySelector('track[kind="chapters"][default][src]'),o=(t=r.shadowRoot)==null?void 0:t.querySelector(':is(video,audio) > track[kind="chapters"][default][src]');return n==null||n.addEventListener("load",i),o==null||o.addEventListener("load",i),()=>{n==null||n.removeEventListener("load",i),o==null||o.removeEventListener("load",i)}}]},mediaIsPip:{get(i){var e,t;let{media:r,documentElement:n}=i;if(!r||!n||!n.pictureInPictureElement)return!1;if(n.pictureInPictureElement===r)return!0;if(n.pictureInPictureElement instanceof HTMLMediaElement)return(e=r.localName)!=null&&e.includes("-")?Ce(r,n.pictureInPictureElement):!1;if(n.pictureInPictureElement.localName.includes("-")){let o=n.pictureInPictureElement.shadowRoot;for(;o!=null&&o.pictureInPictureElement;){if(o.pictureInPictureElement===r)return!0;o=(t=o.pictureInPictureElement)==null?void 0:t.shadowRoot}}return!1},set(i,e){let{media:t}=e;if(t)if(i){if(!ne.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(n=>{if(n.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 o=()=>{t.removeEventListener("loadedmetadata",s),t.preload="none"},s=()=>{t.requestPictureInPicture().catch(r),o()};t.addEventListener("loadedmetadata",s),t.preload="metadata",setTimeout(()=>{t.readyState===0&&r(),o()},1e3)}else throw n}else throw n})}else ne.pictureInPictureElement&&ne.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:n}=i;return(r=(t=n==null?void 0:n.videoRenditions)==null?void 0:t[(e=n.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,n=Array.prototype.findIndex.call(t.videoRenditions,o=>o.id==r);t.videoRenditions.selectedIndex!=n&&(t.videoRenditions.selectedIndex=n)},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(n=>n.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 n of t.audioTracks)n.enabled=r==n.id},mediaEvents:["emptied"],audioTracksEvents:["addtrack","removetrack","change"]},mediaIsFullscreen:{get(i){return Uh(i)},set(i,e,t){var r;i?(Oh(e),t.detail&&((r=e.media)==null||r.focus())):Nh(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:n}=e;if(n&&!(i&&((t=n.remote)==null?void 0:t.state)!=="disconnected")&&!(!i&&((r=n.remote)==null?void 0:r.state)!=="connected")){if(typeof n.remote.prompt!="function"){console.warn("MediaChrome: Casting is not supported in this environment");return}n.remote.prompt().catch(()=>{})}},remoteEvents:["connect","connecting","disconnect"]},mediaIsAirplaying:{get(){return!1},set(i,e){let{media:t}=e;if(t){if(!(t.webkitShowPlaybackTargetPicker&&c.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(!Bh||!Pd(e))return De.UNSUPPORTED}},mediaPipUnavailable:{get(i){let{media:e}=i;if(!Vh||!xd(e))return De.UNSUPPORTED;if(e!=null&&e.disablePictureInPicture)return De.UNAVAILABLE}},mediaVolumeUnavailable:{get(i){let{media:e}=i;if(na===!1||(e==null?void 0:e.volume)==null)return De.UNSUPPORTED},stateOwnersUpdateHandlers:[i=>{na==null&&pf.then(e=>i(e?void 0:De.UNSUPPORTED))}]},mediaCastUnavailable:{get(i,{availability:e="not-available"}={}){var t;let{media:r}=i;if(!Fh||!((t=r==null?void 0:r.remote)!=null&&t.state))return De.UNSUPPORTED;if(!(e==null||e==="available"))return De.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(o=>{i({availability:o?"available":"not-available"})}).catch(o=>{o.name==="NotSupportedError"?i({availability:null}):i({availability:"not-available"})}),()=>{var o;(o=r==null?void 0:r.remote)==null||o.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaAirplayUnavailable:{get(i,e){if(!Wh)return De.UNSUPPORTED;if((e==null?void 0:e.availability)==="not-available")return De.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(o=>{i({availability:o?"available":"not-available"})}).catch(o=>{o.name==="NotSupportedError"?i({availability:null}):i({availability:"not-available"})}),()=>{var o;(o=r==null?void 0:r.remote)==null||o.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaRenditionUnavailable:{get(i){var e;let{media:t}=i;if(!(t!=null&&t.videoRenditions))return De.UNSUPPORTED;if(!((e=t.videoRenditions)!=null&&e.length))return De.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaAudioTrackUnavailable:{get(i){var e,t;let{media:r}=i;if(!(r!=null&&r.audioTracks))return De.UNSUPPORTED;if(((t=(e=r.audioTracks)==null?void 0:e.length)!=null?t:0)<=1)return De.UNAVAILABLE},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaLang:{get(i){let{options:{mediaLang:e}={}}=i;return e??"en"}}};var qh={[y.MEDIA_PREVIEW_REQUEST](i,e,{detail:t}){var r,n,o;let{media:s}=e,l=t??void 0,d,h;if(s&&l!=null){let[m]=Qi(s,{kind:Pe.METADATA,label:"thumbnails"}),_=Array.prototype.find.call((r=m==null?void 0:m.cues)!=null?r:[],(g,I,k)=>I===0?g.endTime>l:I===k.length-1?g.startTime<=l:g.startTime<=l&&g.endTime>l);if(_){let g=/'^(?:[a-z]+:)?\/\//i.test(_.text)||(n=s==null?void 0:s.querySelector('track[label="thumbnails"]'))==null?void 0:n.src,I=new URL(_.text,g);h=new URLSearchParams(I.hash).get("#xywh").split(",").map(oe=>+oe),d=I.href}}let p=i.mediaDuration.get(e),f=(o=i.mediaChaptersCues.get(e).find((m,_,g)=>_===g.length-1&&p===m.endTime?m.startTime<=l&&m.endTime>=l:m.startTime<=l&&m.endTime>l))==null?void 0:o.text;return t!=null&&f==null&&(f=""),{mediaPreviewTime:l,mediaPreviewImage:d,mediaPreviewCoords:h,mediaPreviewChapter:f}},[y.MEDIA_PAUSE_REQUEST](i,e){i["mediaPaused"].set(!0,e)},[y.MEDIA_PLAY_REQUEST](i,e){var t,r,n,o;let s="mediaPaused",d=i.mediaStreamType.get(e)===nt.LIVE,h=!((t=e.options)!=null&&t.noAutoSeekToLive),p=i.mediaTargetLiveWindow.get(e)>0;if(d&&h&&!p){let v=(r=i.mediaSeekable.get(e))==null?void 0:r[1];if(v){let f=(o=(n=e.options)==null?void 0:n.seekToLiveOffset)!=null?o:0,m=v-f;i.mediaCurrentTime.set(m,e)}}i[s].set(!1,e)},[y.MEDIA_PLAYBACK_RATE_REQUEST](i,e,{detail:t}){let r="mediaPlaybackRate",n=t;i[r].set(n,e)},[y.MEDIA_MUTE_REQUEST](i,e){i["mediaMuted"].set(!0,e)},[y.MEDIA_UNMUTE_REQUEST](i,e){let t="mediaMuted";i.mediaVolume.get(e)||i.mediaVolume.set(.25,e),i[t].set(!1,e)},[y.MEDIA_LOOP_REQUEST](i,e,{detail:t}){let r="mediaLoop",n=!!t;return i[r].set(n,e),{mediaLoop:n}},[y.MEDIA_VOLUME_REQUEST](i,e,{detail:t}){let r="mediaVolume",n=t;n&&i.mediaMuted.get(e)&&i.mediaMuted.set(!1,e),i[r].set(n,e)},[y.MEDIA_SEEK_REQUEST](i,e,{detail:t}){let r="mediaCurrentTime",n=t;i[r].set(n,e)},[y.MEDIA_SEEK_TO_LIVE_REQUEST](i,e){var t,r,n;let o="mediaCurrentTime",s=(t=i.mediaSeekable.get(e))==null?void 0:t[1];if(Number.isNaN(Number(s)))return;let l=(n=(r=e.options)==null?void 0:r.seekToLiveOffset)!=null?n:0,d=s-l;i[o].set(d,e)},[y.MEDIA_SHOW_SUBTITLES_REQUEST](i,e,{detail:t}){var r;let{options:n}=e,o=$r(e),s=Rd(t),l=(r=s[0])==null?void 0:r.language;l&&!n.noSubtitlesLangPref&&c.localStorage.setItem("media-chrome-pref-subtitles-lang",l),Yi(ni.SHOWING,o,s)},[y.MEDIA_DISABLE_SUBTITLES_REQUEST](i,e,{detail:t}){let r=$r(e),n=t??[];Yi(ni.DISABLED,r,n)},[y.MEDIA_TOGGLE_SUBTITLES_REQUEST](i,e,{detail:t}){ia(e,t)},[y.MEDIA_RENDITION_REQUEST](i,e,{detail:t}){let r="mediaRenditionSelected",n=t;i[r].set(n,e)},[y.MEDIA_AUDIO_TRACK_REQUEST](i,e,{detail:t}){let r="mediaAudioTrackEnabled",n=t;i[r].set(n,e)},[y.MEDIA_ENTER_PIP_REQUEST](i,e){let t="mediaIsPip";i.mediaIsFullscreen.get(e)&&i.mediaIsFullscreen.set(!1,e),i[t].set(!0,e)},[y.MEDIA_EXIT_PIP_REQUEST](i,e){i["mediaIsPip"].set(!1,e)},[y.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)},[y.MEDIA_EXIT_FULLSCREEN_REQUEST](i,e){i["mediaIsFullscreen"].set(!1,e)},[y.MEDIA_ENTER_CAST_REQUEST](i,e){let t="mediaIsCasting";i.mediaIsFullscreen.get(e)&&i.mediaIsFullscreen.set(!1,e),i[t].set(!0,e)},[y.MEDIA_EXIT_CAST_REQUEST](i,e){i["mediaIsCasting"].set(!1,e)},[y.MEDIA_AIRPLAY_REQUEST](i,e){i["mediaIsAirplaying"].set(!0,e)}};var Gh=({media:i,fullscreenElement:e,documentElement:t,stateMediator:r=Br,requestMap:n=qh,options:o={},monitorStateOwnersOnlyWithSubscriptions:s=!0})=>{let l=[],d={options:{...o}},h=Object.freeze({mediaPreviewTime:void 0,mediaPreviewImage:void 0,mediaPreviewCoords:void 0,mediaPreviewChapter:void 0}),p=g=>{g!=null&&(ra(g,h)||(h=Object.freeze({...h,...g}),l.forEach(I=>I(h))))},v=()=>{let g=Object.entries(r).reduce((I,[k,{get:oe}])=>(I[k]=oe(d),I),{});p(g)},f={},m,_=async(g,I)=>{var k,oe,Ie,Xt,Nt,A,Be,w,K,se,U,G,Ee,Ut,Wn,Eu;let rv=!!m;if(m={...d,...m??{},...g},rv)return;await Kh(...Object.values(g));let Sr=l.length>0&&I===0&&s,gu=d.media!==m.media,bu=((k=d.media)==null?void 0:k.textTracks)!==((oe=m.media)==null?void 0:oe.textTracks),_u=((Ie=d.media)==null?void 0:Ie.videoRenditions)!==((Xt=m.media)==null?void 0:Xt.videoRenditions),yu=((Nt=d.media)==null?void 0:Nt.audioTracks)!==((A=m.media)==null?void 0:A.audioTracks),Tu=((Be=d.media)==null?void 0:Be.remote)!==((w=m.media)==null?void 0:w.remote),Au=d.documentElement!==m.documentElement,Su=!!d.media&&(gu||Sr),ku=!!((K=d.media)!=null&&K.textTracks)&&(bu||Sr),Lu=!!((se=d.media)!=null&&se.videoRenditions)&&(_u||Sr),Iu=!!((U=d.media)!=null&&U.audioTracks)&&(yu||Sr),wu=!!((G=d.media)!=null&&G.remote)&&(Tu||Sr),Cu=!!d.documentElement&&(Au||Sr),Gl=Su||ku||Lu||Iu||wu||Cu,kr=l.length===0&&I===1&&s,C=!!m.media&&(gu||kr),Ru=!!((Ee=m.media)!=null&&Ee.textTracks)&&(bu||kr),Mu=!!((Ut=m.media)!=null&&Ut.videoRenditions)&&(_u||kr),xu=!!((Wn=m.media)!=null&&Wn.audioTracks)&&(yu||kr),Pu=!!((Eu=m.media)!=null&&Eu.remote)&&(Tu||kr),Du=!!m.documentElement&&(Au||kr),Ou=C||Ru||Mu||xu||Pu||Du;if(!(Gl||Ou)){Object.entries(m).forEach(([X,Fn])=>{d[X]=Fn}),v(),m=void 0;return}Object.entries(r).forEach(([X,{get:Fn,mediaEvents:nv=[],textTracksEvents:ov=[],videoRenditionsEvents:sv=[],audioTracksEvents:av=[],remoteEvents:lv=[],rootEvents:dv=[],stateOwnersUpdateHandlers:cv=[]}])=>{f[X]||(f[X]={});let Ve=ae=>{let ve=Fn(d,ae);p({[X]:ve})},be;be=f[X].mediaEvents,nv.forEach(ae=>{be&&Su&&(d.media.removeEventListener(ae,be),f[X].mediaEvents=void 0),C&&(m.media.addEventListener(ae,Ve),f[X].mediaEvents=Ve)}),be=f[X].textTracksEvents,ov.forEach(ae=>{var ve,it;be&&ku&&((ve=d.media.textTracks)==null||ve.removeEventListener(ae,be),f[X].textTracksEvents=void 0),Ru&&((it=m.media.textTracks)==null||it.addEventListener(ae,Ve),f[X].textTracksEvents=Ve)}),be=f[X].videoRenditionsEvents,sv.forEach(ae=>{var ve,it;be&&Lu&&((ve=d.media.videoRenditions)==null||ve.removeEventListener(ae,be),f[X].videoRenditionsEvents=void 0),Mu&&((it=m.media.videoRenditions)==null||it.addEventListener(ae,Ve),f[X].videoRenditionsEvents=Ve)}),be=f[X].audioTracksEvents,av.forEach(ae=>{var ve,it;be&&Iu&&((ve=d.media.audioTracks)==null||ve.removeEventListener(ae,be),f[X].audioTracksEvents=void 0),xu&&((it=m.media.audioTracks)==null||it.addEventListener(ae,Ve),f[X].audioTracksEvents=Ve)}),be=f[X].remoteEvents,lv.forEach(ae=>{var ve,it;be&&wu&&((ve=d.media.remote)==null||ve.removeEventListener(ae,be),f[X].remoteEvents=void 0),Pu&&((it=m.media.remote)==null||it.addEventListener(ae,Ve),f[X].remoteEvents=Ve)}),be=f[X].rootEvents,dv.forEach(ae=>{be&&Cu&&(d.documentElement.removeEventListener(ae,be),f[X].rootEvents=void 0),Du&&(m.documentElement.addEventListener(ae,Ve),f[X].rootEvents=Ve)});let _s=f[X].stateOwnersUpdateHandlers;if(_s&&Gl&&(Array.isArray(_s)?_s:[_s]).forEach(ve=>{typeof ve=="function"&&ve()}),Ou){let ae=cv.map(ve=>ve(Ve,m)).filter(ve=>typeof ve=="function");f[X].stateOwnersUpdateHandlers=ae.length===1?ae[0]:ae}else Gl&&(f[X].stateOwnersUpdateHandlers=void 0)}),Object.entries(m).forEach(([X,Fn])=>{d[X]=Fn}),v(),m=void 0};return _({media:i,fullscreenElement:e,documentElement:t,options:o}),{dispatch(g){let{type:I,detail:k}=g;if(n[I]&&h.mediaErrorCode==null){p(n[I](r,d,g));return}I==="mediaelementchangerequest"?_({media:k}):I==="fullscreenelementchangerequest"?_({fullscreenElement:k}):I==="documentelementchangerequest"?_({documentElement:k}):I==="optionschangerequest"&&(Object.entries(k??{}).forEach(([oe,Ie])=>{d.options[oe]=Ie}),v())},getState(){return h},subscribe(g){return _({},l.length+1),l.push(g),g(h),()=>{let I=l.indexOf(g);I>=0&&(_({},l.length-1),l.splice(I,1))}}}};var Bd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},x=(i,e,t)=>(Bd(i,e,"read from private field"),t?t.call(i):e.get(i)),Ze=(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)},vt=(i,e,t,r)=>(Bd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Et=(i,e,t)=>(Bd(i,e,"access private method"),t),li,_o,q,Xi,yo,ft,oa,To,sa,Od,ji,Vr,aa,Nd,Ud,Jh,ep=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter"," ","f","m","k","c","l","j",">","<","p"],zh=10,Yh=.025,Qh=.25,ff=.25,Ef=2,T={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"},Hd=class extends qi{constructor(){super(),Ze(this,sa),Ze(this,ji),Ze(this,aa),Ze(this,Ud),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,Ze(this,li,new ai(this,T.HOTKEYS)),Ze(this,_o,void 0),Ze(this,q,void 0),Ze(this,Xi,null),Ze(this,yo,void 0),Ze(this,ft,void 0),Ze(this,oa,t=>{var r;(r=x(this,q))==null||r.dispatch(t)}),Ze(this,To,void 0),this.associateElement(this);let e={};vt(this,yo,t=>{Object.entries(t).forEach(([r,n])=>{if(r in e&&e[r]===n)return;this.propagateMediaState(r,n);let o=r.toLowerCase(),s=new c.CustomEvent(ch[o],{composed:!0,detail:n});this.dispatchEvent(s)}),e=t}),this.hasAttribute(T.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat(T.NO_HOTKEYS,T.HOTKEYS,T.DEFAULT_STREAM_TYPE,T.DEFAULT_SUBTITLES,T.DEFAULT_DURATION,T.NO_MUTED_PREF,T.NO_VOLUME_PREF,T.LANG,T.LOOP)}get mediaStore(){return x(this,q)}set mediaStore(e){var t,r;if(x(this,q)&&((t=x(this,ft))==null||t.call(this),vt(this,ft,void 0)),vt(this,q,e),!x(this,q)&&!this.hasAttribute(T.NO_DEFAULT_STORE)){Et(this,sa,Od).call(this);return}vt(this,ft,(r=x(this,q))==null?void 0:r.subscribe(x(this,yo)))}get fullscreenElement(){var e;return(e=x(this,_o))!=null?e:this}set fullscreenElement(e){var t;this.hasAttribute(T.FULLSCREEN_ELEMENT)&&this.removeAttribute(T.FULLSCREEN_ELEMENT),vt(this,_o,e),(t=x(this,q))==null||t.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}get defaultSubtitles(){return R(this,T.DEFAULT_SUBTITLES)}set defaultSubtitles(e){M(this,T.DEFAULT_SUBTITLES,e)}get defaultStreamType(){return O(this,T.DEFAULT_STREAM_TYPE)}set defaultStreamType(e){N(this,T.DEFAULT_STREAM_TYPE,e)}get defaultDuration(){return B(this,T.DEFAULT_DURATION)}set defaultDuration(e){F(this,T.DEFAULT_DURATION,e)}get noHotkeys(){return R(this,T.NO_HOTKEYS)}set noHotkeys(e){M(this,T.NO_HOTKEYS,e)}get keysUsed(){return O(this,T.KEYS_USED)}set keysUsed(e){N(this,T.KEYS_USED,e)}get liveEdgeOffset(){return B(this,T.LIVE_EDGE_OFFSET)}set liveEdgeOffset(e){F(this,T.LIVE_EDGE_OFFSET,e)}get noAutoSeekToLive(){return R(this,T.NO_AUTO_SEEK_TO_LIVE)}set noAutoSeekToLive(e){M(this,T.NO_AUTO_SEEK_TO_LIVE,e)}get noVolumePref(){return R(this,T.NO_VOLUME_PREF)}set noVolumePref(e){M(this,T.NO_VOLUME_PREF,e)}get noMutedPref(){return R(this,T.NO_MUTED_PREF)}set noMutedPref(e){M(this,T.NO_MUTED_PREF,e)}get noSubtitlesLangPref(){return R(this,T.NO_SUBTITLES_LANG_PREF)}set noSubtitlesLangPref(e){M(this,T.NO_SUBTITLES_LANG_PREF,e)}get noDefaultStore(){return R(this,T.NO_DEFAULT_STORE)}set noDefaultStore(e){M(this,T.NO_DEFAULT_STORE,e)}attributeChangedCallback(e,t,r){var n,o,s,l,d,h,p,v,f,m,_,g;if(super.attributeChangedCallback(e,t,r),e===T.NO_HOTKEYS)r!==t&&r===""?(this.hasAttribute(T.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===T.HOTKEYS)x(this,li).value=r;else if(e===T.DEFAULT_SUBTITLES&&r!==t)(n=x(this,q))==null||n.dispatch({type:"optionschangerequest",detail:{defaultSubtitles:this.hasAttribute(T.DEFAULT_SUBTITLES)}});else if(e===T.DEFAULT_STREAM_TYPE)(s=x(this,q))==null||s.dispatch({type:"optionschangerequest",detail:{defaultStreamType:(o=this.getAttribute(T.DEFAULT_STREAM_TYPE))!=null?o:void 0}});else if(e===T.LIVE_EDGE_OFFSET)(l=x(this,q))==null||l.dispatch({type:"optionschangerequest",detail:{liveEdgeOffset:this.hasAttribute(T.LIVE_EDGE_OFFSET)?+this.getAttribute(T.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(T.SEEK_TO_LIVE_OFFSET)?void 0:+this.getAttribute(T.LIVE_EDGE_OFFSET)}});else if(e===T.SEEK_TO_LIVE_OFFSET)(d=x(this,q))==null||d.dispatch({type:"optionschangerequest",detail:{seekToLiveOffset:this.hasAttribute(T.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(T.SEEK_TO_LIVE_OFFSET):void 0}});else if(e===T.NO_AUTO_SEEK_TO_LIVE)(h=x(this,q))==null||h.dispatch({type:"optionschangerequest",detail:{noAutoSeekToLive:this.hasAttribute(T.NO_AUTO_SEEK_TO_LIVE)}});else if(e===T.FULLSCREEN_ELEMENT){let I=r?(p=this.getRootNode())==null?void 0:p.getElementById(r):void 0;vt(this,_o,I),(v=x(this,q))==null||v.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}else e===T.LANG&&r!==t?(bh(r),(f=x(this,q))==null||f.dispatch({type:"optionschangerequest",detail:{mediaLang:r}})):e===T.LOOP&&r!==t?(m=x(this,q))==null||m.dispatch({type:y.MEDIA_LOOP_REQUEST,detail:r!=null}):e===T.NO_VOLUME_PREF&&r!==t?(_=x(this,q))==null||_.dispatch({type:"optionschangerequest",detail:{noVolumePref:this.hasAttribute(T.NO_VOLUME_PREF)}}):e===T.NO_MUTED_PREF&&r!==t&&((g=x(this,q))==null||g.dispatch({type:"optionschangerequest",detail:{noMutedPref:this.hasAttribute(T.NO_MUTED_PREF)}}))}connectedCallback(){var e,t;!x(this,q)&&!this.hasAttribute(T.NO_DEFAULT_STORE)&&Et(this,sa,Od).call(this),(e=x(this,q))==null||e.dispatch({type:"documentelementchangerequest",detail:ne}),super.connectedCallback(),x(this,q)&&!x(this,ft)&&vt(this,ft,(t=x(this,q))==null?void 0:t.subscribe(x(this,yo))),x(this,To)!==void 0&&x(this,q)&&this.media&&setTimeout(()=>{var r,n,o;(n=(r=this.media)==null?void 0:r.textTracks)!=null&&n.length&&((o=x(this,q))==null||o.dispatch({type:y.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:x(this,To)}))},0),this.hasAttribute(T.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}disconnectedCallback(){var e,t,r,n,o;if((e=super.disconnectedCallback)==null||e.call(this),x(this,q)){let s=x(this,q).getState();vt(this,To,!!((t=s.mediaSubtitlesShowing)!=null&&t.length)),(r=x(this,q))==null||r.dispatch({type:"documentelementchangerequest",detail:void 0}),(n=x(this,q))==null||n.dispatch({type:y.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:!1})}x(this,ft)&&((o=x(this,ft))==null||o.call(this),vt(this,ft,void 0))}mediaSetCallback(e){var t;super.mediaSetCallback(e),(t=x(this,q))==null||t.dispatch({type:"mediaelementchangerequest",detail:e}),e.hasAttribute("tabindex")||(e.tabIndex=-1)}mediaUnsetCallback(e){var t;super.mediaUnsetCallback(e),(t=x(this,q))==null||t.dispatch({type:"mediaelementchangerequest",detail:void 0})}propagateMediaState(e,t){jh(this.mediaStateReceivers,e,t)}associateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(t.has(e))return;let r=this.registerMediaStateReceiver.bind(this),n=this.unregisterMediaStateReceiver.bind(this),o=Af(e,r,n);Object.values(y).forEach(s=>{e.addEventListener(s,x(this,oa))}),t.set(e,o)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(!t.has(e))return;t.get(e)(),t.delete(e),Object.values(y).forEach(n=>{e.removeEventListener(n,x(this,oa))})}registerMediaStateReceiver(e){if(!e)return;let t=this.mediaStateReceivers;t.indexOf(e)>-1||(t.push(e),x(this,q)&&Object.entries(x(this,q).getState()).forEach(([n,o])=>{jh([e],n,o)}))}unregisterMediaStateReceiver(e){let t=this.mediaStateReceivers,r=t.indexOf(e);r<0||t.splice(r,1)}enableHotkeys(){this.addEventListener("keydown",Et(this,aa,Nd))}disableHotkeys(){this.removeEventListener("keydown",Et(this,aa,Nd)),this.removeEventListener("keyup",Et(this,ji,Vr))}get hotkeys(){return O(this,T.HOTKEYS)}set hotkeys(e){N(this,T.HOTKEYS,e)}keyboardShortcutHandler(e){var t,r,n,o,s,l,d,h,p;let v=e.target;if(((n=(r=(t=v.getAttribute(T.KEYS_USED))==null?void 0:t.split(" "))!=null?r:v==null?void 0:v.keysUsed)!=null?n:[]).map(k=>k==="Space"?" ":k).filter(Boolean).includes(e.key))return;let m,_,g;if(!(x(this,li).contains(`no${e.key.toLowerCase()}`)||e.key===" "&&x(this,li).contains("nospace")||e.shiftKey&&(e.key==="/"||e.key==="?")&&x(this,li).contains("noshift+/")))switch(e.key){case" ":case"k":m=x(this,q).getState().mediaPaused?y.MEDIA_PLAY_REQUEST:y.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new c.CustomEvent(m,{composed:!0,bubbles:!0}));break;case"m":m=this.mediaStore.getState().mediaVolumeLevel==="off"?y.MEDIA_UNMUTE_REQUEST:y.MEDIA_MUTE_REQUEST,this.dispatchEvent(new c.CustomEvent(m,{composed:!0,bubbles:!0}));break;case"f":m=this.mediaStore.getState().mediaIsFullscreen?y.MEDIA_EXIT_FULLSCREEN_REQUEST:y.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new c.CustomEvent(m,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new c.CustomEvent(y.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}));break;case"ArrowLeft":case"j":{let k=this.hasAttribute(T.KEYBOARD_BACKWARD_SEEK_OFFSET)?+this.getAttribute(T.KEYBOARD_BACKWARD_SEEK_OFFSET):zh;_=Math.max(((o=this.mediaStore.getState().mediaCurrentTime)!=null?o:0)-k,0),g=new c.CustomEvent(y.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:_}),this.dispatchEvent(g);break}case"ArrowRight":case"l":{let k=this.hasAttribute(T.KEYBOARD_FORWARD_SEEK_OFFSET)?+this.getAttribute(T.KEYBOARD_FORWARD_SEEK_OFFSET):zh;_=Math.max(((s=this.mediaStore.getState().mediaCurrentTime)!=null?s:0)+k,0),g=new c.CustomEvent(y.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:_}),this.dispatchEvent(g);break}case"ArrowUp":{let k=this.hasAttribute(T.KEYBOARD_UP_VOLUME_STEP)?+this.getAttribute(T.KEYBOARD_UP_VOLUME_STEP):Yh;_=Math.min(((l=this.mediaStore.getState().mediaVolume)!=null?l:1)+k,1),g=new c.CustomEvent(y.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:_}),this.dispatchEvent(g);break}case"ArrowDown":{let k=this.hasAttribute(T.KEYBOARD_DOWN_VOLUME_STEP)?+this.getAttribute(T.KEYBOARD_DOWN_VOLUME_STEP):Yh;_=Math.max(((d=this.mediaStore.getState().mediaVolume)!=null?d:1)-k,0),g=new c.CustomEvent(y.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:_}),this.dispatchEvent(g);break}case"<":{let k=(h=this.mediaStore.getState().mediaPlaybackRate)!=null?h:1;_=Math.max(k-Qh,ff).toFixed(2),g=new c.CustomEvent(y.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:_}),this.dispatchEvent(g);break}case">":{let k=(p=this.mediaStore.getState().mediaPlaybackRate)!=null?p:1;_=Math.min(k+Qh,Ef).toFixed(2),g=new c.CustomEvent(y.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:_}),this.dispatchEvent(g);break}case"/":case"?":{e.shiftKey&&Et(this,Ud,Jh).call(this);break}case"p":{m=this.mediaStore.getState().mediaIsPip?y.MEDIA_EXIT_PIP_REQUEST:y.MEDIA_ENTER_PIP_REQUEST,g=new c.CustomEvent(m,{composed:!0,bubbles:!0}),this.dispatchEvent(g);break}default:break}}};li=new WeakMap;_o=new WeakMap;q=new WeakMap;Xi=new WeakMap;yo=new WeakMap;ft=new WeakMap;oa=new WeakMap;To=new WeakMap;sa=new WeakSet;Od=function(){var i;this.mediaStore=Gh({media:this.media,fullscreenElement:this.fullscreenElement,options:{defaultSubtitles:this.hasAttribute(T.DEFAULT_SUBTITLES),defaultDuration:this.hasAttribute(T.DEFAULT_DURATION)?+this.getAttribute(T.DEFAULT_DURATION):void 0,defaultStreamType:(i=this.getAttribute(T.DEFAULT_STREAM_TYPE))!=null?i:void 0,liveEdgeOffset:this.hasAttribute(T.LIVE_EDGE_OFFSET)?+this.getAttribute(T.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(T.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(T.SEEK_TO_LIVE_OFFSET):this.hasAttribute(T.LIVE_EDGE_OFFSET)?+this.getAttribute(T.LIVE_EDGE_OFFSET):void 0,noAutoSeekToLive:this.hasAttribute(T.NO_AUTO_SEEK_TO_LIVE),noVolumePref:this.hasAttribute(T.NO_VOLUME_PREF),noMutedPref:this.hasAttribute(T.NO_MUTED_PREF),noSubtitlesLangPref:this.hasAttribute(T.NO_SUBTITLES_LANG_PREF)}})};ji=new WeakSet;Vr=function(i){let{key:e,shiftKey:t}=i;if(!(t&&(e==="/"||e==="?")||ep.includes(e))){this.removeEventListener("keyup",Et(this,ji,Vr));return}this.keyboardShortcutHandler(i)};aa=new WeakSet;Nd=function(i){var e;let{metaKey:t,altKey:r,key:n,shiftKey:o}=i,s=o&&(n==="/"||n==="?");if(s&&((e=x(this,Xi))!=null&&e.open)){this.removeEventListener("keyup",Et(this,ji,Vr));return}if(t||r||!s&&!ep.includes(n)){this.removeEventListener("keyup",Et(this,ji,Vr));return}let l=i.target,d=l instanceof HTMLElement&&(l.tagName.toLowerCase()==="media-volume-range"||l.tagName.toLowerCase()==="media-time-range");[" ","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(n)&&!(x(this,li).contains(`no${n.toLowerCase()}`)||n===" "&&x(this,li).contains("nospace"))&&!d&&i.preventDefault(),this.addEventListener("keyup",Et(this,ji,Vr),{once:!0})};Ud=new WeakSet;Jh=function(){x(this,Xi)||(vt(this,Xi,ne.createElement("media-keyboard-shortcuts-dialog")),this.appendChild(x(this,Xi))),x(this,Xi).open=!0};var gf=Object.values(a),bf=Object.values(_d),tp=i=>{var e,t,r,n;let{observedAttributes:o}=i.constructor;!o&&((e=i.nodeName)!=null&&e.includes("-"))&&(c.customElements.upgrade(i),{observedAttributes:o}=i.constructor);let s=(n=(r=(t=i==null?void 0:i.getAttribute)==null?void 0:t.call(i,H.MEDIA_CHROME_ATTRIBUTES))==null?void 0:r.split)==null?void 0:n.call(r,/\s+/);return Array.isArray(o||s)?(o||s).filter(l=>gf.includes(l)):[]},_f=i=>{var e,t;return(e=i.nodeName)!=null&&e.includes("-")&&c.customElements.get((t=i.nodeName)==null?void 0:t.toLowerCase())&&!(i instanceof c.customElements.get(i.nodeName.toLowerCase()))&&c.customElements.upgrade(i),bf.some(r=>r in i)},$d=i=>_f(i)||!!tp(i).length,Zh=i=>{var e;return(e=i==null?void 0:i.join)==null?void 0:e.call(i,":")},Xh={[a.MEDIA_SUBTITLES_LIST]:Wt,[a.MEDIA_SUBTITLES_SHOWING]:Wt,[a.MEDIA_SEEKABLE]:Zh,[a.MEDIA_BUFFERED]:i=>i==null?void 0:i.map(Zh).join(" "),[a.MEDIA_PREVIEW_COORDS]:i=>i==null?void 0:i.join(" "),[a.MEDIA_RENDITION_LIST]:hh,[a.MEDIA_AUDIO_TRACK_LIST]:mh},yf=async(i,e,t)=>{var r,n;if(i.isConnected||await Ns(0),typeof t=="boolean"||t==null)return M(i,e,t);if(typeof t=="number")return F(i,e,t);if(typeof t=="string")return N(i,e,t);if(Array.isArray(t)&&!t.length)return i.removeAttribute(e);let o=(n=(r=Xh[e])==null?void 0:r.call(Xh,t))!=null?n:t;return i.setAttribute(e,o)},Tf=i=>{var e;return!!((e=i.closest)!=null&&e.call(i,'*[slot="media"]'))},Zi=(i,e)=>{if(Tf(i))return;let t=(n,o)=>{var s,l;$d(n)&&o(n);let{children:d=[]}=n??{},h=(l=(s=n==null?void 0:n.shadowRoot)==null?void 0:s.children)!=null?l:[];[...d,...h].forEach(v=>Zi(v,o))},r=i==null?void 0:i.nodeName.toLowerCase();if(r.includes("-")&&!$d(i)){c.customElements.whenDefined(r).then(()=>{t(i,e)});return}t(i,e)},jh=(i,e,t)=>{i.forEach(r=>{if(e in r){r[e]=t;return}let n=tp(r),o=e.toLowerCase();n.includes(o)&&yf(r,o,t)})},Af=(i,e,t)=>{Zi(i,e);let r=p=>{var v;let f=(v=p==null?void 0:p.composedPath()[0])!=null?v:p.target;e(f)},n=p=>{var v;let f=(v=p==null?void 0:p.composedPath()[0])!=null?v:p.target;t(f)};i.addEventListener(y.REGISTER_MEDIA_STATE_RECEIVER,r),i.addEventListener(y.UNREGISTER_MEDIA_STATE_RECEIVER,n);let o=p=>{p.forEach(v=>{let{addedNodes:f=[],removedNodes:m=[],type:_,target:g,attributeName:I}=v;_==="childList"?(Array.prototype.forEach.call(f,k=>Zi(k,e)),Array.prototype.forEach.call(m,k=>Zi(k,t))):_==="attributes"&&I===H.MEDIA_CHROME_ATTRIBUTES&&($d(g)?e(g):t(g))})},s=[],l=p=>{let v=p.target;v.name!=="media"&&(s.forEach(f=>Zi(f,t)),s=[...v.assignedElements({flatten:!0})],s.forEach(f=>Zi(f,e)))};i.addEventListener("slotchange",l);let d=new MutationObserver(o);return d.observe(i,{childList:!0,attributes:!0,subtree:!0}),()=>{Zi(i,t),i.removeEventListener("slotchange",l),d.disconnect(),i.removeEventListener(y.REGISTER_MEDIA_STATE_RECEIVER,r),i.removeEventListener(y.UNREGISTER_MEDIA_STATE_RECEIVER,n)}};c.customElements.get("media-controller")||c.customElements.define("media-controller",Hd);var Wr={PLACEMENT:"placement",BOUNDS:"bounds"};function Sf(i){return`
|
|
394
|
+
`}var jv=Object.values(a),Jv="sm:384 md:576 lg:768 xl:960";function ef(i){Rh(i.target,i.contentRect.width)}function Rh(i,e){var t;if(!i.isConnected)return;let r=(t=i.getAttribute(P.BREAKPOINTS))!=null?t:Jv,n=tf(r),o=rf(n,e),s=!1;if(Object.keys(n).forEach(l=>{if(o.includes(l)){i.hasAttribute(`breakpoint${l}`)||(i.setAttribute(`breakpoint${l}`,""),s=!0);return}i.hasAttribute(`breakpoint${l}`)&&(i.removeAttribute(`breakpoint${l}`),s=!0)}),s){let l=new CustomEvent(Bi.BREAKPOINTS_CHANGE,{detail:o});i.dispatchEvent(l)}i.breakpointsComputed||(i.breakpointsComputed=!0,i.dispatchEvent(new CustomEvent(Bi.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))}function tf(i){let e=i.split(/\s+/);return Object.fromEntries(e.map(t=>t.split(":")))}function rf(i,e){return Object.keys(i).filter(t=>e>=parseInt(i[t]))}var qi=class extends c.HTMLElement{constructor(){if(super(),We(this,kd),We(this,Ld),We(this,wd),We(this,fo),We(this,Zs),We(this,Nr),We(this,Ys,0),We(this,Dr,null),We(this,vo,null),We(this,Or,void 0),this.breakpointsComputed=!1,We(this,Gs,new MutationObserver(Qe(this,kd,wh).bind(this))),We(this,mo,!1),We(this,zs,t=>{Fe(this,mo)||(setTimeout(()=>{ef(t),Ki(this,mo,!1)},0),Ki(this,mo,!0))}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let t=ie(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){Fe(this,Dr)&&this.mediaUnsetCallback(Fe(this,Dr));return}this.handleMediaUpdated(this.media)})}static get observedAttributes(){return[P.AUTOHIDE,P.GESTURES_DISABLED].concat(jv).filter(e=>![a.MEDIA_RENDITION_LIST,a.MEDIA_AUDIO_TRACK_LIST,a.MEDIA_CHAPTERS_CUES,a.MEDIA_WIDTH,a.MEDIA_HEIGHT,a.MEDIA_ERROR,a.MEDIA_ERROR_MESSAGE].includes(e))}attributeChangedCallback(e,t,r){e.toLowerCase()==P.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&&(Ki(this,Dr,e),e.localName.includes("-")&&await c.customElements.whenDefined(e.localName),this.mediaSetCallback(e))}connectedCallback(){var e;Fe(this,Gs).observe(this,{childList:!0,subtree:!0}),$t(this,Fe(this,zs));let r=this.getAttribute(P.AUDIO)!=null?b("audio player"):b("video player");this.setAttribute("role","region"),this.setAttribute("aria-label",r),this.handleMediaUpdated(this.media),this.setAttribute(P.USER_INACTIVE,""),Rh(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=c.window)==null||e.addEventListener("mouseup",this)}disconnectedCallback(){var e;Fe(this,Gs).disconnect(),Vt(this,Fe(this,zs)),this.media&&this.mediaUnsetCallback(this.media),(e=c.window)==null||e.removeEventListener("mouseup",this)}mediaSetCallback(e){}mediaUnsetCallback(e){Ki(this,Dr,null)}handleEvent(e){switch(e.type){case"pointerdown":Ki(this,Ys,e.timeStamp);break;case"pointermove":Qe(this,Ld,Ih).call(this,e);break;case"pointerup":Qe(this,wd,Ch).call(this,e);break;case"mouseleave":Qe(this,fo,Qs).call(this);break;case"mouseup":this.removeAttribute(P.KEYBOARD_CONTROL);break;case"keyup":Qe(this,Nr,Eo).call(this),this.setAttribute(P.KEYBOARD_CONTROL,"");break}}set autohide(e){let t=Number(e);Ki(this,Or,isNaN(t)?0:t)}get autohide(){return(Fe(this,Or)===void 0?2:Fe(this,Or)).toString()}get breakpoints(){return O(this,P.BREAKPOINTS)}set breakpoints(e){N(this,P.BREAKPOINTS,e)}get audio(){return R(this,P.AUDIO)}set audio(e){M(this,P.AUDIO,e)}get gesturesDisabled(){return R(this,P.GESTURES_DISABLED)}set gesturesDisabled(e){M(this,P.GESTURES_DISABLED,e)}get keyboardControl(){return R(this,P.KEYBOARD_CONTROL)}set keyboardControl(e){M(this,P.KEYBOARD_CONTROL,e)}get noAutohide(){return R(this,P.NO_AUTOHIDE)}set noAutohide(e){M(this,P.NO_AUTOHIDE,e)}get autohideOverControls(){return R(this,P.AUTOHIDE_OVER_CONTROLS)}set autohideOverControls(e){M(this,P.AUTOHIDE_OVER_CONTROLS,e)}get userInteractive(){return R(this,P.USER_INACTIVE)}set userInteractive(e){M(this,P.USER_INACTIVE,e)}};Ys=new WeakMap;Dr=new WeakMap;vo=new WeakMap;Or=new WeakMap;Gs=new WeakMap;kd=new WeakSet;wh=function(i){let e=this.media;for(let t of i){if(t.type!=="childList")continue;let r=t.removedNodes;for(let n of r){if(n.slot!="media"||t.target!=this)continue;let o=t.previousSibling&&t.previousSibling.previousElementSibling;if(!o||!e)this.mediaUnsetCallback(n);else{let s=o.slot!=="media";for(;(o=o.previousSibling)!==null;)o.slot=="media"&&(s=!1);s&&this.mediaUnsetCallback(n)}}if(e)for(let n of t.addedNodes)n===e&&this.handleMediaUpdated(e)}};mo=new WeakMap;zs=new WeakMap;Ld=new WeakSet;Ih=function(i){if(i.pointerType!=="mouse"&&i.timeStamp-Fe(this,Ys)<250)return;Qe(this,Zs,Cd).call(this),clearTimeout(Fe(this,vo));let e=this.hasAttribute(P.AUTOHIDE_OVER_CONTROLS);([this,this.media].includes(i.target)||e)&&Qe(this,Nr,Eo).call(this)};wd=new WeakSet;Ch=function(i){if(i.pointerType==="touch"){let e=!this.hasAttribute(P.USER_INACTIVE);[this,this.media].includes(i.target)&&e?Qe(this,fo,Qs).call(this):Qe(this,Nr,Eo).call(this)}else i.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e==null?void 0:e.localName))&&Qe(this,Nr,Eo).call(this)};fo=new WeakSet;Qs=function(){if(Fe(this,Or)<0||this.hasAttribute(P.USER_INACTIVE))return;this.setAttribute(P.USER_INACTIVE,"");let i=new c.CustomEvent(Bi.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(i)};Zs=new WeakSet;Cd=function(){if(!this.hasAttribute(P.USER_INACTIVE))return;this.removeAttribute(P.USER_INACTIVE);let i=new c.CustomEvent(Bi.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(i)};Nr=new WeakSet;Eo=function(){Qe(this,Zs,Cd).call(this),clearTimeout(Fe(this,vo));let i=parseInt(this.autohide);i<0||Ki(this,vo,setTimeout(()=>{Qe(this,fo,Qs).call(this)},i*1e3))};qi.shadowRootOptions={mode:"open"};qi.getTemplateHTML=Xv;c.customElements.get("media-container")||c.customElements.define("media-container",qi);var Mh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Te=(i,e,t)=>(Mh(i,e,"read from private field"),t?t.call(i):e.get(i)),go=(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)},Xs=(i,e,t,r)=>(Mh(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ur,Hr,js,Gi,Bt,si,ai=class{constructor(e,t,{defaultValue:r}={defaultValue:void 0}){go(this,Bt),go(this,Ur,void 0),go(this,Hr,void 0),go(this,js,void 0),go(this,Gi,new Set),Xs(this,Ur,e),Xs(this,Hr,t),Xs(this,js,new Set(r))}[Symbol.iterator](){return Te(this,Bt,si).values()}get length(){return Te(this,Bt,si).size}get value(){var e;return(e=[...Te(this,Bt,si)].join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(Xs(this,Gi,new Set),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return[...Te(this,Bt,si)][e]}values(){return Te(this,Bt,si).values()}forEach(e,t){Te(this,Bt,si).forEach(e,t)}add(...e){var t,r;e.forEach(n=>Te(this,Gi).add(n)),!(this.value===""&&!((t=Te(this,Ur))!=null&&t.hasAttribute(`${Te(this,Hr)}`)))&&((r=Te(this,Ur))==null||r.setAttribute(`${Te(this,Hr)}`,`${this.value}`))}remove(...e){var t;e.forEach(r=>Te(this,Gi).delete(r)),(t=Te(this,Ur))==null||t.setAttribute(`${Te(this,Hr)}`,`${this.value}`)}contains(e){return Te(this,Bt,si).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}};Ur=new WeakMap;Hr=new WeakMap;js=new WeakMap;Gi=new WeakMap;Bt=new WeakSet;si=function(){return Te(this,Gi).size?Te(this,Gi):Te(this,js)};var nf=(i="")=>i.split(/\s+/),xh=(i="")=>{let[e,t,r]=i.split(":"),n=r?decodeURIComponent(r):void 0;return{kind:e==="cc"?Pe.CAPTIONS:Pe.SUBTITLES,language:t,label:n}},zi=(i="",e={})=>nf(i).map(t=>{let r=xh(t);return{...e,...r}}),Rd=i=>i?Array.isArray(i)?i.map(e=>typeof e=="string"?xh(e):e):typeof i=="string"?zi(i):[i]:[],Js=({kind:i,label:e,language:t}={kind:"subtitles"})=>e?`${i==="captions"?"cc":"sb"}:${t}:${encodeURIComponent(e)}`:t,Wt=(i=[])=>Array.prototype.map.call(i,Js).join(" "),of=(i,e)=>t=>t[i]===e,Ph=i=>{let e=Object.entries(i).map(([t,r])=>of(t,r));return t=>e.every(r=>r(t))},Yi=(i,e=[],t=[])=>{let r=Rd(t).map(Ph),n=o=>r.some(s=>s(o));Array.from(e).filter(n).forEach(o=>{o.mode=i})},Qi=(i,e=()=>!0)=>{if(!(i!=null&&i.textTracks))return[];let t=typeof e=="function"?e:Ph(e);return Array.from(i.textTracks).filter(t)},ea=i=>{var e;return!!((e=i.mediaSubtitlesShowing)!=null&&e.length)||i.hasAttribute(a.MEDIA_SUBTITLES_SHOWING)};var Oh=i=>{var e;let{media:t,fullscreenElement:r}=i;try{let n=r&&"requestFullscreen"in r?"requestFullscreen":r&&"webkitRequestFullScreen"in r?"webkitRequestFullScreen":void 0;if(n){let o=(e=r[n])==null?void 0:e.call(r);if(o instanceof Promise)return o.catch(()=>{})}else t!=null&&t.webkitEnterFullscreen?t.webkitEnterFullscreen():t!=null&&t.requestFullscreen&&t.requestFullscreen()}catch(n){console.error(n)}},Dh="exitFullscreen"in ne?"exitFullscreen":"webkitExitFullscreen"in ne?"webkitExitFullscreen":"webkitCancelFullScreen"in ne?"webkitCancelFullScreen":void 0,Nh=i=>{var e;let{documentElement:t}=i;if(Dh){let r=(e=t==null?void 0:t[Dh])==null?void 0:e.call(t);if(r instanceof Promise)return r.catch(()=>{})}},bo="fullscreenElement"in ne?"fullscreenElement":"webkitFullscreenElement"in ne?"webkitFullscreenElement":void 0,sf=i=>{let{documentElement:e,media:t}=i,r=e==null?void 0:e[bo];return!r&&"webkitDisplayingFullscreen"in t&&"webkitPresentationMode"in t&&t.webkitDisplayingFullscreen&&t.webkitPresentationMode===uh.FULLSCREEN?t:r},Uh=i=>{var e;let{media:t,documentElement:r,fullscreenElement:n=t}=i;if(!t||!r)return!1;let o=sf(i);if(!o)return!1;if(o===n||o===t)return!0;if(o.localName.includes("-")){let s=o.shadowRoot;if(!(bo in s))return Ce(o,n);for(;s!=null&&s[bo];){if(s[bo]===n)return!0;s=(e=s[bo])==null?void 0:e.shadowRoot}}return!1},af="fullscreenEnabled"in ne?"fullscreenEnabled":"webkitFullscreenEnabled"in ne?"webkitFullscreenEnabled":void 0,Hh=i=>{let{documentElement:e,media:t}=i;return!!(e!=null&&e[af])||t&&"webkitSupportsFullscreen"in t};var ta,Md=()=>{var i,e;return ta||(ta=(e=(i=ne)==null?void 0:i.createElement)==null?void 0:e.call(i,"video"),ta)},$h=async(i=Md())=>{if(!i)return!1;let e=i.volume;i.volume=e/2+.1;let t=new AbortController,r=await Promise.race([lf(i,t.signal),df(i,e)]);return t.abort(),r},lf=(i,e)=>new Promise(t=>{i.addEventListener("volumechange",()=>t(!0),{signal:e})}),df=async(i,e)=>{for(let t=0;t<10;t++){if(i.volume===e)return!1;await Ns(10)}return i.volume!==e},cf=/.*Version\/.*Safari\/.*/.test(c.navigator.userAgent),xd=(i=Md())=>c.matchMedia("(display-mode: standalone)").matches&&cf?!1:typeof(i==null?void 0:i.requestPictureInPicture)=="function",Pd=(i=Md())=>Hh({documentElement:ne,media:i}),Vh=Pd(),Bh=xd(),Wh=!!c.WebKitPlaybackTargetAvailabilityEvent,Fh=!!c.chrome;var $r=i=>Qi(i.media,e=>[Pe.SUBTITLES,Pe.CAPTIONS].includes(e.kind)).sort((e,t)=>e.kind>=t.kind?1:-1),Dd=i=>Qi(i.media,e=>e.mode===ni.SHOWING&&[Pe.SUBTITLES,Pe.CAPTIONS].includes(e.kind)),ia=(i,e)=>{let t=$r(i),r=Dd(i),n=!!r.length;if(t.length){if(e===!1||n&&e!==!0)Yi(ni.DISABLED,t,r);else if(e===!0||!n&&e!==!1){let o=t[0],{options:s}=i;if(!(s!=null&&s.noSubtitlesLangPref)){let p=globalThis.localStorage.getItem("media-chrome-pref-subtitles-lang"),v=p?[p,...globalThis.navigator.languages]:globalThis.navigator.languages,f=t.filter(m=>v.some(_=>m.language.toLowerCase().startsWith(_.split("-")[0]))).sort((m,_)=>{let g=v.findIndex(k=>m.language.toLowerCase().startsWith(k.split("-")[0])),w=v.findIndex(k=>_.language.toLowerCase().startsWith(k.split("-")[0]));return g-w});f[0]&&(o=f[0])}let{language:l,label:d,kind:h}=o;Yi(ni.DISABLED,t,r),Yi(ni.SHOWING,t,[{language:l,label:d,kind:h}])}}},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)?uf(i,e):Object.entries(i).every(([t,r])=>t in e&&ra(r,e[t])),uf=(i,e)=>{let t=Array.isArray(i),r=Array.isArray(e);return t!==r?!1:t||r?i.length!==e.length?!1:i.every((n,o)=>ra(n,e[o])):!0};var hf=Object.values(nt),na,pf=$h().then(i=>(na=i,na)),Kh=async(...i)=>{await Promise.all(i.filter(e=>e).map(async e=>{if(!("localName"in e&&e instanceof c.HTMLElement))return;let t=e.localName;if(!t.includes("-"))return;let r=c.customElements.get(t);r&&e instanceof r||(await c.customElements.whenDefined(t),c.customElements.upgrade(e))}))},mf=new c.DOMParser,vf=i=>i&&(mf.parseFromString(i,"text/html").body.textContent||i),Vr={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:n}=i;if((e==null?void 0:e.type)!=="playing")return(r=(t=n==null?void 0:n.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 n=c.localStorage.getItem("media-chrome-pref-muted")!==null,o=t.hasAttribute("muted");if(r){n&&c.localStorage.removeItem("media-chrome-pref-muted");return}if(o&&!n)return;c.localStorage.setItem("media-chrome-pref-muted",i?"true":"false")}catch(n){console.debug("Error setting muted pref",n)}}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(i,e)=>{let{options:{noMutedPref:t}}=e,{media:r}=e;if(!(!r||r.muted||t))try{let n=c.localStorage.getItem("media-chrome-pref-muted")==="true";Vr.mediaMuted.set(n,e),i(n)}catch(n){console.debug("Error getting muted pref",n)}}]},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?c.localStorage.removeItem("media-chrome-pref-volume"):!t.hasAttribute("muted")&&!r&&c.localStorage.setItem("media-chrome-pref-volume",i.toString())}catch(n){console.debug("Error setting volume pref",n)}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 n=c.localStorage.getItem("media-chrome-pref-volume");if(n==null)return;Vr.mediaVolume.set(+n,e),i(+n)}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||!xr(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),n=t.seekable.end(t.seekable.length-1);if(!(!r&&!n))return[Number(r.toFixed(3)),Number(n.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((n,o)=>[Number(r.start(o).toFixed(3)),Number(r.end(o).toFixed(3))])},mediaEvents:["progress","emptied"]},mediaStreamType:{get(i){let{media:e,options:{defaultStreamType:t}={}}=i,r=[nt.LIVE,nt.ON_DEMAND].includes(t)?t:void 0;if(!e)return r;let{streamType:n}=e;if(hf.includes(n))return n===nt.UNKNOWN?r:n;let o=e.duration;return o===1/0?nt.LIVE:Number.isFinite(o)?nt.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=Vr.mediaStreamType.get(i);return(t==null||Number.isNaN(t))&&r===nt.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(!(Vr.mediaStreamType.get(i)===nt.LIVE))return!1;let n=e.seekable;if(!n)return!0;if(!n.length)return!1;let o=n.end(n.length-1)-t;return e.currentTime>=o},mediaEvents:["playing","timeupdate","progress","waiting","emptied"]},mediaSubtitlesList:{get(i){return $r(i).map(({kind:e,label:t,language:r})=>({kind:e,label:t,language:r}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},mediaSubtitlesShowing:{get(i){return Dd(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:n,options:o}=e;if(!n)return;let s=l=>{var d;!o.defaultSubtitles||l&&![Pe.CAPTIONS,Pe.SUBTITLES].includes((d=l==null?void 0:l.track)==null?void 0:d.kind)||ia(e,!0)};return n.addEventListener("loadstart",s),(t=n.textTracks)==null||t.addEventListener("addtrack",s),(r=n.textTracks)==null||r.addEventListener("removetrack",s),()=>{var l,d;n.removeEventListener("loadstart",s),(l=n.textTracks)==null||l.removeEventListener("addtrack",s),(d=n.textTracks)==null||d.removeEventListener("removetrack",s)}}]},mediaChaptersCues:{get(i){var e;let{media:t}=i;if(!t)return[];let[r]=Qi(t,{kind:Pe.CHAPTERS});return Array.from((e=r==null?void 0:r.cues)!=null?e:[]).map(({text:n,startTime:o,endTime:s})=>({text:vf(n),startTime:o,endTime:s}))},mediaEvents:["loadstart","loadedmetadata"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:r}=e;if(!r)return;let n=r.querySelector('track[kind="chapters"][default][src]'),o=(t=r.shadowRoot)==null?void 0:t.querySelector(':is(video,audio) > track[kind="chapters"][default][src]');return n==null||n.addEventListener("load",i),o==null||o.addEventListener("load",i),()=>{n==null||n.removeEventListener("load",i),o==null||o.removeEventListener("load",i)}}]},mediaIsPip:{get(i){var e,t;let{media:r,documentElement:n}=i;if(!r||!n||!n.pictureInPictureElement)return!1;if(n.pictureInPictureElement===r)return!0;if(n.pictureInPictureElement instanceof HTMLMediaElement)return(e=r.localName)!=null&&e.includes("-")?Ce(r,n.pictureInPictureElement):!1;if(n.pictureInPictureElement.localName.includes("-")){let o=n.pictureInPictureElement.shadowRoot;for(;o!=null&&o.pictureInPictureElement;){if(o.pictureInPictureElement===r)return!0;o=(t=o.pictureInPictureElement)==null?void 0:t.shadowRoot}}return!1},set(i,e){let{media:t}=e;if(t)if(i){if(!ne.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(n=>{if(n.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 o=()=>{t.removeEventListener("loadedmetadata",s),t.preload="none"},s=()=>{t.requestPictureInPicture().catch(r),o()};t.addEventListener("loadedmetadata",s),t.preload="metadata",setTimeout(()=>{t.readyState===0&&r(),o()},1e3)}else throw n}else throw n})}else ne.pictureInPictureElement&&ne.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:n}=i;return(r=(t=n==null?void 0:n.videoRenditions)==null?void 0:t[(e=n.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,n=Array.prototype.findIndex.call(t.videoRenditions,o=>o.id==r);t.videoRenditions.selectedIndex!=n&&(t.videoRenditions.selectedIndex=n)},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(n=>n.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 n of t.audioTracks)n.enabled=r==n.id},mediaEvents:["emptied"],audioTracksEvents:["addtrack","removetrack","change"]},mediaIsFullscreen:{get(i){return Uh(i)},set(i,e,t){var r;i?(Oh(e),t.detail&&((r=e.media)==null||r.focus())):Nh(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:n}=e;if(n&&!(i&&((t=n.remote)==null?void 0:t.state)!=="disconnected")&&!(!i&&((r=n.remote)==null?void 0:r.state)!=="connected")){if(typeof n.remote.prompt!="function"){console.warn("MediaChrome: Casting is not supported in this environment");return}n.remote.prompt().catch(()=>{})}},remoteEvents:["connect","connecting","disconnect"]},mediaIsAirplaying:{get(){return!1},set(i,e){let{media:t}=e;if(t){if(!(t.webkitShowPlaybackTargetPicker&&c.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(!Vh||!Pd(e))return De.UNSUPPORTED}},mediaPipUnavailable:{get(i){let{media:e}=i;if(!Bh||!xd(e))return De.UNSUPPORTED;if(e!=null&&e.disablePictureInPicture)return De.UNAVAILABLE}},mediaVolumeUnavailable:{get(i){let{media:e}=i;if(na===!1||(e==null?void 0:e.volume)==null)return De.UNSUPPORTED},stateOwnersUpdateHandlers:[i=>{na==null&&pf.then(e=>i(e?void 0:De.UNSUPPORTED))}]},mediaCastUnavailable:{get(i,{availability:e="not-available"}={}){var t;let{media:r}=i;if(!Fh||!((t=r==null?void 0:r.remote)!=null&&t.state))return De.UNSUPPORTED;if(!(e==null||e==="available"))return De.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(o=>{i({availability:o?"available":"not-available"})}).catch(o=>{o.name==="NotSupportedError"?i({availability:null}):i({availability:"not-available"})}),()=>{var o;(o=r==null?void 0:r.remote)==null||o.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaAirplayUnavailable:{get(i,e){if(!Wh)return De.UNSUPPORTED;if((e==null?void 0:e.availability)==="not-available")return De.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(o=>{i({availability:o?"available":"not-available"})}).catch(o=>{o.name==="NotSupportedError"?i({availability:null}):i({availability:"not-available"})}),()=>{var o;(o=r==null?void 0:r.remote)==null||o.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaRenditionUnavailable:{get(i){var e;let{media:t}=i;if(!(t!=null&&t.videoRenditions))return De.UNSUPPORTED;if(!((e=t.videoRenditions)!=null&&e.length))return De.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaAudioTrackUnavailable:{get(i){var e,t;let{media:r}=i;if(!(r!=null&&r.audioTracks))return De.UNSUPPORTED;if(((t=(e=r.audioTracks)==null?void 0:e.length)!=null?t:0)<=1)return De.UNAVAILABLE},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaLang:{get(i){let{options:{mediaLang:e}={}}=i;return e??"en"}}};var qh={[y.MEDIA_PREVIEW_REQUEST](i,e,{detail:t}){var r,n,o;let{media:s}=e,l=t??void 0,d,h;if(s&&l!=null){let[m]=Qi(s,{kind:Pe.METADATA,label:"thumbnails"}),_=Array.prototype.find.call((r=m==null?void 0:m.cues)!=null?r:[],(g,w,k)=>w===0?g.endTime>l:w===k.length-1?g.startTime<=l:g.startTime<=l&&g.endTime>l);if(_){let g=/'^(?:[a-z]+:)?\/\//i.test(_.text)||(n=s==null?void 0:s.querySelector('track[label="thumbnails"]'))==null?void 0:n.src,w=new URL(_.text,g);h=new URLSearchParams(w.hash).get("#xywh").split(",").map(oe=>+oe),d=w.href}}let p=i.mediaDuration.get(e),f=(o=i.mediaChaptersCues.get(e).find((m,_,g)=>_===g.length-1&&p===m.endTime?m.startTime<=l&&m.endTime>=l:m.startTime<=l&&m.endTime>l))==null?void 0:o.text;return t!=null&&f==null&&(f=""),{mediaPreviewTime:l,mediaPreviewImage:d,mediaPreviewCoords:h,mediaPreviewChapter:f}},[y.MEDIA_PAUSE_REQUEST](i,e){i["mediaPaused"].set(!0,e)},[y.MEDIA_PLAY_REQUEST](i,e){var t,r,n,o;let s="mediaPaused",d=i.mediaStreamType.get(e)===nt.LIVE,h=!((t=e.options)!=null&&t.noAutoSeekToLive),p=i.mediaTargetLiveWindow.get(e)>0;if(d&&h&&!p){let v=(r=i.mediaSeekable.get(e))==null?void 0:r[1];if(v){let f=(o=(n=e.options)==null?void 0:n.seekToLiveOffset)!=null?o:0,m=v-f;i.mediaCurrentTime.set(m,e)}}i[s].set(!1,e)},[y.MEDIA_PLAYBACK_RATE_REQUEST](i,e,{detail:t}){let r="mediaPlaybackRate",n=t;i[r].set(n,e)},[y.MEDIA_MUTE_REQUEST](i,e){i["mediaMuted"].set(!0,e)},[y.MEDIA_UNMUTE_REQUEST](i,e){let t="mediaMuted";i.mediaVolume.get(e)||i.mediaVolume.set(.25,e),i[t].set(!1,e)},[y.MEDIA_LOOP_REQUEST](i,e,{detail:t}){let r="mediaLoop",n=!!t;return i[r].set(n,e),{mediaLoop:n}},[y.MEDIA_VOLUME_REQUEST](i,e,{detail:t}){let r="mediaVolume",n=t;n&&i.mediaMuted.get(e)&&i.mediaMuted.set(!1,e),i[r].set(n,e)},[y.MEDIA_SEEK_REQUEST](i,e,{detail:t}){let r="mediaCurrentTime",n=t;i[r].set(n,e)},[y.MEDIA_SEEK_TO_LIVE_REQUEST](i,e){var t,r,n;let o="mediaCurrentTime",s=(t=i.mediaSeekable.get(e))==null?void 0:t[1];if(Number.isNaN(Number(s)))return;let l=(n=(r=e.options)==null?void 0:r.seekToLiveOffset)!=null?n:0,d=s-l;i[o].set(d,e)},[y.MEDIA_SHOW_SUBTITLES_REQUEST](i,e,{detail:t}){var r;let{options:n}=e,o=$r(e),s=Rd(t),l=(r=s[0])==null?void 0:r.language;l&&!n.noSubtitlesLangPref&&c.localStorage.setItem("media-chrome-pref-subtitles-lang",l),Yi(ni.SHOWING,o,s)},[y.MEDIA_DISABLE_SUBTITLES_REQUEST](i,e,{detail:t}){let r=$r(e),n=t??[];Yi(ni.DISABLED,r,n)},[y.MEDIA_TOGGLE_SUBTITLES_REQUEST](i,e,{detail:t}){ia(e,t)},[y.MEDIA_RENDITION_REQUEST](i,e,{detail:t}){let r="mediaRenditionSelected",n=t;i[r].set(n,e)},[y.MEDIA_AUDIO_TRACK_REQUEST](i,e,{detail:t}){let r="mediaAudioTrackEnabled",n=t;i[r].set(n,e)},[y.MEDIA_ENTER_PIP_REQUEST](i,e){let t="mediaIsPip";i.mediaIsFullscreen.get(e)&&i.mediaIsFullscreen.set(!1,e),i[t].set(!0,e)},[y.MEDIA_EXIT_PIP_REQUEST](i,e){i["mediaIsPip"].set(!1,e)},[y.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)},[y.MEDIA_EXIT_FULLSCREEN_REQUEST](i,e){i["mediaIsFullscreen"].set(!1,e)},[y.MEDIA_ENTER_CAST_REQUEST](i,e){let t="mediaIsCasting";i.mediaIsFullscreen.get(e)&&i.mediaIsFullscreen.set(!1,e),i[t].set(!0,e)},[y.MEDIA_EXIT_CAST_REQUEST](i,e){i["mediaIsCasting"].set(!1,e)},[y.MEDIA_AIRPLAY_REQUEST](i,e){i["mediaIsAirplaying"].set(!0,e)}};var Gh=({media:i,fullscreenElement:e,documentElement:t,stateMediator:r=Vr,requestMap:n=qh,options:o={},monitorStateOwnersOnlyWithSubscriptions:s=!0})=>{let l=[],d={options:{...o}},h=Object.freeze({mediaPreviewTime:void 0,mediaPreviewImage:void 0,mediaPreviewCoords:void 0,mediaPreviewChapter:void 0}),p=g=>{g!=null&&(ra(g,h)||(h=Object.freeze({...h,...g}),l.forEach(w=>w(h))))},v=()=>{let g=Object.entries(r).reduce((w,[k,{get:oe}])=>(w[k]=oe(d),w),{});p(g)},f={},m,_=async(g,w)=>{var k,oe,we,Xt,Nt,A,Ve,I,K,se,U,G,Ee,Ut,Wn,Eu;let rv=!!m;if(m={...d,...m??{},...g},rv)return;await Kh(...Object.values(g));let Sr=l.length>0&&w===0&&s,gu=d.media!==m.media,bu=((k=d.media)==null?void 0:k.textTracks)!==((oe=m.media)==null?void 0:oe.textTracks),_u=((we=d.media)==null?void 0:we.videoRenditions)!==((Xt=m.media)==null?void 0:Xt.videoRenditions),yu=((Nt=d.media)==null?void 0:Nt.audioTracks)!==((A=m.media)==null?void 0:A.audioTracks),Tu=((Ve=d.media)==null?void 0:Ve.remote)!==((I=m.media)==null?void 0:I.remote),Au=d.documentElement!==m.documentElement,Su=!!d.media&&(gu||Sr),ku=!!((K=d.media)!=null&&K.textTracks)&&(bu||Sr),Lu=!!((se=d.media)!=null&&se.videoRenditions)&&(_u||Sr),wu=!!((U=d.media)!=null&&U.audioTracks)&&(yu||Sr),Iu=!!((G=d.media)!=null&&G.remote)&&(Tu||Sr),Cu=!!d.documentElement&&(Au||Sr),Gl=Su||ku||Lu||wu||Iu||Cu,kr=l.length===0&&w===1&&s,C=!!m.media&&(gu||kr),Ru=!!((Ee=m.media)!=null&&Ee.textTracks)&&(bu||kr),Mu=!!((Ut=m.media)!=null&&Ut.videoRenditions)&&(_u||kr),xu=!!((Wn=m.media)!=null&&Wn.audioTracks)&&(yu||kr),Pu=!!((Eu=m.media)!=null&&Eu.remote)&&(Tu||kr),Du=!!m.documentElement&&(Au||kr),Ou=C||Ru||Mu||xu||Pu||Du;if(!(Gl||Ou)){Object.entries(m).forEach(([X,Fn])=>{d[X]=Fn}),v(),m=void 0;return}Object.entries(r).forEach(([X,{get:Fn,mediaEvents:nv=[],textTracksEvents:ov=[],videoRenditionsEvents:sv=[],audioTracksEvents:av=[],remoteEvents:lv=[],rootEvents:dv=[],stateOwnersUpdateHandlers:cv=[]}])=>{f[X]||(f[X]={});let Be=ae=>{let ve=Fn(d,ae);p({[X]:ve})},be;be=f[X].mediaEvents,nv.forEach(ae=>{be&&Su&&(d.media.removeEventListener(ae,be),f[X].mediaEvents=void 0),C&&(m.media.addEventListener(ae,Be),f[X].mediaEvents=Be)}),be=f[X].textTracksEvents,ov.forEach(ae=>{var ve,it;be&&ku&&((ve=d.media.textTracks)==null||ve.removeEventListener(ae,be),f[X].textTracksEvents=void 0),Ru&&((it=m.media.textTracks)==null||it.addEventListener(ae,Be),f[X].textTracksEvents=Be)}),be=f[X].videoRenditionsEvents,sv.forEach(ae=>{var ve,it;be&&Lu&&((ve=d.media.videoRenditions)==null||ve.removeEventListener(ae,be),f[X].videoRenditionsEvents=void 0),Mu&&((it=m.media.videoRenditions)==null||it.addEventListener(ae,Be),f[X].videoRenditionsEvents=Be)}),be=f[X].audioTracksEvents,av.forEach(ae=>{var ve,it;be&&wu&&((ve=d.media.audioTracks)==null||ve.removeEventListener(ae,be),f[X].audioTracksEvents=void 0),xu&&((it=m.media.audioTracks)==null||it.addEventListener(ae,Be),f[X].audioTracksEvents=Be)}),be=f[X].remoteEvents,lv.forEach(ae=>{var ve,it;be&&Iu&&((ve=d.media.remote)==null||ve.removeEventListener(ae,be),f[X].remoteEvents=void 0),Pu&&((it=m.media.remote)==null||it.addEventListener(ae,Be),f[X].remoteEvents=Be)}),be=f[X].rootEvents,dv.forEach(ae=>{be&&Cu&&(d.documentElement.removeEventListener(ae,be),f[X].rootEvents=void 0),Du&&(m.documentElement.addEventListener(ae,Be),f[X].rootEvents=Be)});let _s=f[X].stateOwnersUpdateHandlers;if(_s&&Gl&&(Array.isArray(_s)?_s:[_s]).forEach(ve=>{typeof ve=="function"&&ve()}),Ou){let ae=cv.map(ve=>ve(Be,m)).filter(ve=>typeof ve=="function");f[X].stateOwnersUpdateHandlers=ae.length===1?ae[0]:ae}else Gl&&(f[X].stateOwnersUpdateHandlers=void 0)}),Object.entries(m).forEach(([X,Fn])=>{d[X]=Fn}),v(),m=void 0};return _({media:i,fullscreenElement:e,documentElement:t,options:o}),{dispatch(g){let{type:w,detail:k}=g;if(n[w]&&h.mediaErrorCode==null){p(n[w](r,d,g));return}w==="mediaelementchangerequest"?_({media:k}):w==="fullscreenelementchangerequest"?_({fullscreenElement:k}):w==="documentelementchangerequest"?_({documentElement:k}):w==="optionschangerequest"&&(Object.entries(k??{}).forEach(([oe,we])=>{d.options[oe]=we}),v())},getState(){return h},subscribe(g){return _({},l.length+1),l.push(g),g(h),()=>{let w=l.indexOf(g);w>=0&&(_({},l.length-1),l.splice(w,1))}}}};var Vd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},x=(i,e,t)=>(Vd(i,e,"read from private field"),t?t.call(i):e.get(i)),Ze=(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)},vt=(i,e,t,r)=>(Vd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Et=(i,e,t)=>(Vd(i,e,"access private method"),t),li,_o,q,Xi,yo,ft,oa,To,sa,Od,ji,Br,aa,Nd,Ud,Jh,ep=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter"," ","f","m","k","c","l","j",">","<","p"],zh=10,Yh=.025,Qh=.25,ff=.25,Ef=2,T={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"},Hd=class extends qi{constructor(){super(),Ze(this,sa),Ze(this,ji),Ze(this,aa),Ze(this,Ud),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,Ze(this,li,new ai(this,T.HOTKEYS)),Ze(this,_o,void 0),Ze(this,q,void 0),Ze(this,Xi,null),Ze(this,yo,void 0),Ze(this,ft,void 0),Ze(this,oa,t=>{var r;(r=x(this,q))==null||r.dispatch(t)}),Ze(this,To,void 0),this.associateElement(this);let e={};vt(this,yo,t=>{Object.entries(t).forEach(([r,n])=>{if(r in e&&e[r]===n)return;this.propagateMediaState(r,n);let o=r.toLowerCase(),s=new c.CustomEvent(ch[o],{composed:!0,detail:n});this.dispatchEvent(s)}),e=t}),this.hasAttribute(T.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat(T.NO_HOTKEYS,T.HOTKEYS,T.DEFAULT_STREAM_TYPE,T.DEFAULT_SUBTITLES,T.DEFAULT_DURATION,T.NO_MUTED_PREF,T.NO_VOLUME_PREF,T.LANG,T.LOOP)}get mediaStore(){return x(this,q)}set mediaStore(e){var t,r;if(x(this,q)&&((t=x(this,ft))==null||t.call(this),vt(this,ft,void 0)),vt(this,q,e),!x(this,q)&&!this.hasAttribute(T.NO_DEFAULT_STORE)){Et(this,sa,Od).call(this);return}vt(this,ft,(r=x(this,q))==null?void 0:r.subscribe(x(this,yo)))}get fullscreenElement(){var e;return(e=x(this,_o))!=null?e:this}set fullscreenElement(e){var t;this.hasAttribute(T.FULLSCREEN_ELEMENT)&&this.removeAttribute(T.FULLSCREEN_ELEMENT),vt(this,_o,e),(t=x(this,q))==null||t.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}get defaultSubtitles(){return R(this,T.DEFAULT_SUBTITLES)}set defaultSubtitles(e){M(this,T.DEFAULT_SUBTITLES,e)}get defaultStreamType(){return O(this,T.DEFAULT_STREAM_TYPE)}set defaultStreamType(e){N(this,T.DEFAULT_STREAM_TYPE,e)}get defaultDuration(){return V(this,T.DEFAULT_DURATION)}set defaultDuration(e){F(this,T.DEFAULT_DURATION,e)}get noHotkeys(){return R(this,T.NO_HOTKEYS)}set noHotkeys(e){M(this,T.NO_HOTKEYS,e)}get keysUsed(){return O(this,T.KEYS_USED)}set keysUsed(e){N(this,T.KEYS_USED,e)}get liveEdgeOffset(){return V(this,T.LIVE_EDGE_OFFSET)}set liveEdgeOffset(e){F(this,T.LIVE_EDGE_OFFSET,e)}get noAutoSeekToLive(){return R(this,T.NO_AUTO_SEEK_TO_LIVE)}set noAutoSeekToLive(e){M(this,T.NO_AUTO_SEEK_TO_LIVE,e)}get noVolumePref(){return R(this,T.NO_VOLUME_PREF)}set noVolumePref(e){M(this,T.NO_VOLUME_PREF,e)}get noMutedPref(){return R(this,T.NO_MUTED_PREF)}set noMutedPref(e){M(this,T.NO_MUTED_PREF,e)}get noSubtitlesLangPref(){return R(this,T.NO_SUBTITLES_LANG_PREF)}set noSubtitlesLangPref(e){M(this,T.NO_SUBTITLES_LANG_PREF,e)}get noDefaultStore(){return R(this,T.NO_DEFAULT_STORE)}set noDefaultStore(e){M(this,T.NO_DEFAULT_STORE,e)}attributeChangedCallback(e,t,r){var n,o,s,l,d,h,p,v,f,m,_,g;if(super.attributeChangedCallback(e,t,r),e===T.NO_HOTKEYS)r!==t&&r===""?(this.hasAttribute(T.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===T.HOTKEYS)x(this,li).value=r;else if(e===T.DEFAULT_SUBTITLES&&r!==t)(n=x(this,q))==null||n.dispatch({type:"optionschangerequest",detail:{defaultSubtitles:this.hasAttribute(T.DEFAULT_SUBTITLES)}});else if(e===T.DEFAULT_STREAM_TYPE)(s=x(this,q))==null||s.dispatch({type:"optionschangerequest",detail:{defaultStreamType:(o=this.getAttribute(T.DEFAULT_STREAM_TYPE))!=null?o:void 0}});else if(e===T.LIVE_EDGE_OFFSET)(l=x(this,q))==null||l.dispatch({type:"optionschangerequest",detail:{liveEdgeOffset:this.hasAttribute(T.LIVE_EDGE_OFFSET)?+this.getAttribute(T.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(T.SEEK_TO_LIVE_OFFSET)?void 0:+this.getAttribute(T.LIVE_EDGE_OFFSET)}});else if(e===T.SEEK_TO_LIVE_OFFSET)(d=x(this,q))==null||d.dispatch({type:"optionschangerequest",detail:{seekToLiveOffset:this.hasAttribute(T.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(T.SEEK_TO_LIVE_OFFSET):void 0}});else if(e===T.NO_AUTO_SEEK_TO_LIVE)(h=x(this,q))==null||h.dispatch({type:"optionschangerequest",detail:{noAutoSeekToLive:this.hasAttribute(T.NO_AUTO_SEEK_TO_LIVE)}});else if(e===T.FULLSCREEN_ELEMENT){let w=r?(p=this.getRootNode())==null?void 0:p.getElementById(r):void 0;vt(this,_o,w),(v=x(this,q))==null||v.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}else e===T.LANG&&r!==t?(bh(r),(f=x(this,q))==null||f.dispatch({type:"optionschangerequest",detail:{mediaLang:r}})):e===T.LOOP&&r!==t?(m=x(this,q))==null||m.dispatch({type:y.MEDIA_LOOP_REQUEST,detail:r!=null}):e===T.NO_VOLUME_PREF&&r!==t?(_=x(this,q))==null||_.dispatch({type:"optionschangerequest",detail:{noVolumePref:this.hasAttribute(T.NO_VOLUME_PREF)}}):e===T.NO_MUTED_PREF&&r!==t&&((g=x(this,q))==null||g.dispatch({type:"optionschangerequest",detail:{noMutedPref:this.hasAttribute(T.NO_MUTED_PREF)}}))}connectedCallback(){var e,t;!x(this,q)&&!this.hasAttribute(T.NO_DEFAULT_STORE)&&Et(this,sa,Od).call(this),(e=x(this,q))==null||e.dispatch({type:"documentelementchangerequest",detail:ne}),super.connectedCallback(),x(this,q)&&!x(this,ft)&&vt(this,ft,(t=x(this,q))==null?void 0:t.subscribe(x(this,yo))),x(this,To)!==void 0&&x(this,q)&&this.media&&setTimeout(()=>{var r,n,o;(n=(r=this.media)==null?void 0:r.textTracks)!=null&&n.length&&((o=x(this,q))==null||o.dispatch({type:y.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:x(this,To)}))},0),this.hasAttribute(T.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}disconnectedCallback(){var e,t,r,n,o;if((e=super.disconnectedCallback)==null||e.call(this),x(this,q)){let s=x(this,q).getState();vt(this,To,!!((t=s.mediaSubtitlesShowing)!=null&&t.length)),(r=x(this,q))==null||r.dispatch({type:"documentelementchangerequest",detail:void 0}),(n=x(this,q))==null||n.dispatch({type:y.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:!1})}x(this,ft)&&((o=x(this,ft))==null||o.call(this),vt(this,ft,void 0))}mediaSetCallback(e){var t;super.mediaSetCallback(e),(t=x(this,q))==null||t.dispatch({type:"mediaelementchangerequest",detail:e}),e.hasAttribute("tabindex")||(e.tabIndex=-1)}mediaUnsetCallback(e){var t;super.mediaUnsetCallback(e),(t=x(this,q))==null||t.dispatch({type:"mediaelementchangerequest",detail:void 0})}propagateMediaState(e,t){jh(this.mediaStateReceivers,e,t)}associateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(t.has(e))return;let r=this.registerMediaStateReceiver.bind(this),n=this.unregisterMediaStateReceiver.bind(this),o=Af(e,r,n);Object.values(y).forEach(s=>{e.addEventListener(s,x(this,oa))}),t.set(e,o)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(!t.has(e))return;t.get(e)(),t.delete(e),Object.values(y).forEach(n=>{e.removeEventListener(n,x(this,oa))})}registerMediaStateReceiver(e){if(!e)return;let t=this.mediaStateReceivers;t.indexOf(e)>-1||(t.push(e),x(this,q)&&Object.entries(x(this,q).getState()).forEach(([n,o])=>{jh([e],n,o)}))}unregisterMediaStateReceiver(e){let t=this.mediaStateReceivers,r=t.indexOf(e);r<0||t.splice(r,1)}enableHotkeys(){this.addEventListener("keydown",Et(this,aa,Nd))}disableHotkeys(){this.removeEventListener("keydown",Et(this,aa,Nd)),this.removeEventListener("keyup",Et(this,ji,Br))}get hotkeys(){return O(this,T.HOTKEYS)}set hotkeys(e){N(this,T.HOTKEYS,e)}keyboardShortcutHandler(e){var t,r,n,o,s,l,d,h,p;let v=e.target;if(((n=(r=(t=v.getAttribute(T.KEYS_USED))==null?void 0:t.split(" "))!=null?r:v==null?void 0:v.keysUsed)!=null?n:[]).map(k=>k==="Space"?" ":k).filter(Boolean).includes(e.key))return;let m,_,g;if(!(x(this,li).contains(`no${e.key.toLowerCase()}`)||e.key===" "&&x(this,li).contains("nospace")||e.shiftKey&&(e.key==="/"||e.key==="?")&&x(this,li).contains("noshift+/")))switch(e.key){case" ":case"k":m=x(this,q).getState().mediaPaused?y.MEDIA_PLAY_REQUEST:y.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new c.CustomEvent(m,{composed:!0,bubbles:!0}));break;case"m":m=this.mediaStore.getState().mediaVolumeLevel==="off"?y.MEDIA_UNMUTE_REQUEST:y.MEDIA_MUTE_REQUEST,this.dispatchEvent(new c.CustomEvent(m,{composed:!0,bubbles:!0}));break;case"f":m=this.mediaStore.getState().mediaIsFullscreen?y.MEDIA_EXIT_FULLSCREEN_REQUEST:y.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new c.CustomEvent(m,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new c.CustomEvent(y.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}));break;case"ArrowLeft":case"j":{let k=this.hasAttribute(T.KEYBOARD_BACKWARD_SEEK_OFFSET)?+this.getAttribute(T.KEYBOARD_BACKWARD_SEEK_OFFSET):zh;_=Math.max(((o=this.mediaStore.getState().mediaCurrentTime)!=null?o:0)-k,0),g=new c.CustomEvent(y.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:_}),this.dispatchEvent(g);break}case"ArrowRight":case"l":{let k=this.hasAttribute(T.KEYBOARD_FORWARD_SEEK_OFFSET)?+this.getAttribute(T.KEYBOARD_FORWARD_SEEK_OFFSET):zh;_=Math.max(((s=this.mediaStore.getState().mediaCurrentTime)!=null?s:0)+k,0),g=new c.CustomEvent(y.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:_}),this.dispatchEvent(g);break}case"ArrowUp":{let k=this.hasAttribute(T.KEYBOARD_UP_VOLUME_STEP)?+this.getAttribute(T.KEYBOARD_UP_VOLUME_STEP):Yh;_=Math.min(((l=this.mediaStore.getState().mediaVolume)!=null?l:1)+k,1),g=new c.CustomEvent(y.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:_}),this.dispatchEvent(g);break}case"ArrowDown":{let k=this.hasAttribute(T.KEYBOARD_DOWN_VOLUME_STEP)?+this.getAttribute(T.KEYBOARD_DOWN_VOLUME_STEP):Yh;_=Math.max(((d=this.mediaStore.getState().mediaVolume)!=null?d:1)-k,0),g=new c.CustomEvent(y.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:_}),this.dispatchEvent(g);break}case"<":{let k=(h=this.mediaStore.getState().mediaPlaybackRate)!=null?h:1;_=Math.max(k-Qh,ff).toFixed(2),g=new c.CustomEvent(y.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:_}),this.dispatchEvent(g);break}case">":{let k=(p=this.mediaStore.getState().mediaPlaybackRate)!=null?p:1;_=Math.min(k+Qh,Ef).toFixed(2),g=new c.CustomEvent(y.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:_}),this.dispatchEvent(g);break}case"/":case"?":{e.shiftKey&&Et(this,Ud,Jh).call(this);break}case"p":{m=this.mediaStore.getState().mediaIsPip?y.MEDIA_EXIT_PIP_REQUEST:y.MEDIA_ENTER_PIP_REQUEST,g=new c.CustomEvent(m,{composed:!0,bubbles:!0}),this.dispatchEvent(g);break}default:break}}};li=new WeakMap;_o=new WeakMap;q=new WeakMap;Xi=new WeakMap;yo=new WeakMap;ft=new WeakMap;oa=new WeakMap;To=new WeakMap;sa=new WeakSet;Od=function(){var i;this.mediaStore=Gh({media:this.media,fullscreenElement:this.fullscreenElement,options:{defaultSubtitles:this.hasAttribute(T.DEFAULT_SUBTITLES),defaultDuration:this.hasAttribute(T.DEFAULT_DURATION)?+this.getAttribute(T.DEFAULT_DURATION):void 0,defaultStreamType:(i=this.getAttribute(T.DEFAULT_STREAM_TYPE))!=null?i:void 0,liveEdgeOffset:this.hasAttribute(T.LIVE_EDGE_OFFSET)?+this.getAttribute(T.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(T.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(T.SEEK_TO_LIVE_OFFSET):this.hasAttribute(T.LIVE_EDGE_OFFSET)?+this.getAttribute(T.LIVE_EDGE_OFFSET):void 0,noAutoSeekToLive:this.hasAttribute(T.NO_AUTO_SEEK_TO_LIVE),noVolumePref:this.hasAttribute(T.NO_VOLUME_PREF),noMutedPref:this.hasAttribute(T.NO_MUTED_PREF),noSubtitlesLangPref:this.hasAttribute(T.NO_SUBTITLES_LANG_PREF)}})};ji=new WeakSet;Br=function(i){let{key:e,shiftKey:t}=i;if(!(t&&(e==="/"||e==="?")||ep.includes(e))){this.removeEventListener("keyup",Et(this,ji,Br));return}this.keyboardShortcutHandler(i)};aa=new WeakSet;Nd=function(i){var e;let{metaKey:t,altKey:r,key:n,shiftKey:o}=i,s=o&&(n==="/"||n==="?");if(s&&((e=x(this,Xi))!=null&&e.open)){this.removeEventListener("keyup",Et(this,ji,Br));return}if(t||r||!s&&!ep.includes(n)){this.removeEventListener("keyup",Et(this,ji,Br));return}let l=i.target,d=l instanceof HTMLElement&&(l.tagName.toLowerCase()==="media-volume-range"||l.tagName.toLowerCase()==="media-time-range");[" ","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(n)&&!(x(this,li).contains(`no${n.toLowerCase()}`)||n===" "&&x(this,li).contains("nospace"))&&!d&&i.preventDefault(),this.addEventListener("keyup",Et(this,ji,Br),{once:!0})};Ud=new WeakSet;Jh=function(){x(this,Xi)||(vt(this,Xi,ne.createElement("media-keyboard-shortcuts-dialog")),this.appendChild(x(this,Xi))),x(this,Xi).open=!0};var gf=Object.values(a),bf=Object.values(_d),tp=i=>{var e,t,r,n;let{observedAttributes:o}=i.constructor;!o&&((e=i.nodeName)!=null&&e.includes("-"))&&(c.customElements.upgrade(i),{observedAttributes:o}=i.constructor);let s=(n=(r=(t=i==null?void 0:i.getAttribute)==null?void 0:t.call(i,H.MEDIA_CHROME_ATTRIBUTES))==null?void 0:r.split)==null?void 0:n.call(r,/\s+/);return Array.isArray(o||s)?(o||s).filter(l=>gf.includes(l)):[]},_f=i=>{var e,t;return(e=i.nodeName)!=null&&e.includes("-")&&c.customElements.get((t=i.nodeName)==null?void 0:t.toLowerCase())&&!(i instanceof c.customElements.get(i.nodeName.toLowerCase()))&&c.customElements.upgrade(i),bf.some(r=>r in i)},$d=i=>_f(i)||!!tp(i).length,Zh=i=>{var e;return(e=i==null?void 0:i.join)==null?void 0:e.call(i,":")},Xh={[a.MEDIA_SUBTITLES_LIST]:Wt,[a.MEDIA_SUBTITLES_SHOWING]:Wt,[a.MEDIA_SEEKABLE]:Zh,[a.MEDIA_BUFFERED]:i=>i==null?void 0:i.map(Zh).join(" "),[a.MEDIA_PREVIEW_COORDS]:i=>i==null?void 0:i.join(" "),[a.MEDIA_RENDITION_LIST]:hh,[a.MEDIA_AUDIO_TRACK_LIST]:mh},yf=async(i,e,t)=>{var r,n;if(i.isConnected||await Ns(0),typeof t=="boolean"||t==null)return M(i,e,t);if(typeof t=="number")return F(i,e,t);if(typeof t=="string")return N(i,e,t);if(Array.isArray(t)&&!t.length)return i.removeAttribute(e);let o=(n=(r=Xh[e])==null?void 0:r.call(Xh,t))!=null?n:t;return i.setAttribute(e,o)},Tf=i=>{var e;return!!((e=i.closest)!=null&&e.call(i,'*[slot="media"]'))},Zi=(i,e)=>{if(Tf(i))return;let t=(n,o)=>{var s,l;$d(n)&&o(n);let{children:d=[]}=n??{},h=(l=(s=n==null?void 0:n.shadowRoot)==null?void 0:s.children)!=null?l:[];[...d,...h].forEach(v=>Zi(v,o))},r=i==null?void 0:i.nodeName.toLowerCase();if(r.includes("-")&&!$d(i)){c.customElements.whenDefined(r).then(()=>{t(i,e)});return}t(i,e)},jh=(i,e,t)=>{i.forEach(r=>{if(e in r){r[e]=t;return}let n=tp(r),o=e.toLowerCase();n.includes(o)&&yf(r,o,t)})},Af=(i,e,t)=>{Zi(i,e);let r=p=>{var v;let f=(v=p==null?void 0:p.composedPath()[0])!=null?v:p.target;e(f)},n=p=>{var v;let f=(v=p==null?void 0:p.composedPath()[0])!=null?v:p.target;t(f)};i.addEventListener(y.REGISTER_MEDIA_STATE_RECEIVER,r),i.addEventListener(y.UNREGISTER_MEDIA_STATE_RECEIVER,n);let o=p=>{p.forEach(v=>{let{addedNodes:f=[],removedNodes:m=[],type:_,target:g,attributeName:w}=v;_==="childList"?(Array.prototype.forEach.call(f,k=>Zi(k,e)),Array.prototype.forEach.call(m,k=>Zi(k,t))):_==="attributes"&&w===H.MEDIA_CHROME_ATTRIBUTES&&($d(g)?e(g):t(g))})},s=[],l=p=>{let v=p.target;v.name!=="media"&&(s.forEach(f=>Zi(f,t)),s=[...v.assignedElements({flatten:!0})],s.forEach(f=>Zi(f,e)))};i.addEventListener("slotchange",l);let d=new MutationObserver(o);return d.observe(i,{childList:!0,attributes:!0,subtree:!0}),()=>{Zi(i,t),i.removeEventListener("slotchange",l),d.disconnect(),i.removeEventListener(y.REGISTER_MEDIA_STATE_RECEIVER,r),i.removeEventListener(y.UNREGISTER_MEDIA_STATE_RECEIVER,n)}};c.customElements.get("media-controller")||c.customElements.define("media-controller",Hd);var Wr={PLACEMENT:"placement",BOUNDS:"bounds"};function Sf(i){return`
|
|
395
395
|
<style>
|
|
396
396
|
:host {
|
|
397
397
|
--_tooltip-background-color: var(--media-tooltip-background-color, var(--media-secondary-color, rgba(20, 20, 30, .7)));
|
|
@@ -500,7 +500,7 @@ bp-player[has-error] {
|
|
|
500
500
|
</style>
|
|
501
501
|
<slot></slot>
|
|
502
502
|
<div id="arrow"></div>
|
|
503
|
-
`}var Fr=class extends c.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var e;if(!Fs(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),n=(e=mt(this,"#"+this.bounds))!=null?e:ee(this);if(!n)return;let{x:o,width:s}=n.getBoundingClientRect(),{x:l,width:d}=this.getBoundingClientRect(),h=l+d,p=o+s,v=r.getPropertyValue("--media-tooltip-offset-x"),f=v?parseFloat(v.replace("px","")):0,m=r.getPropertyValue("--media-tooltip-container-margin"),_=m?parseFloat(m.replace("px","")):0,g=l-o+f-_,
|
|
503
|
+
`}var Fr=class extends c.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var e;if(!Fs(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),n=(e=mt(this,"#"+this.bounds))!=null?e:ee(this);if(!n)return;let{x:o,width:s}=n.getBoundingClientRect(),{x:l,width:d}=this.getBoundingClientRect(),h=l+d,p=o+s,v=r.getPropertyValue("--media-tooltip-offset-x"),f=v?parseFloat(v.replace("px","")):0,m=r.getPropertyValue("--media-tooltip-container-margin"),_=m?parseFloat(m.replace("px","")):0,g=l-o+f-_,w=h-p+f+_;if(g<0){this.style.setProperty("--media-tooltip-offset-x",`${g}px`);return}if(w>0){this.style.setProperty("--media-tooltip-offset-x",`${w}px`);return}this.style.removeProperty("--media-tooltip-offset-x")},!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=ie(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[Wr.PLACEMENT,Wr.BOUNDS]}get placement(){return O(this,Wr.PLACEMENT)}set placement(e){N(this,Wr.PLACEMENT,e)}get bounds(){return O(this,Wr.BOUNDS)}set bounds(e){N(this,Wr.BOUNDS,e)}};Fr.shadowRootOptions={mode:"open"};Fr.getTemplateHTML=Sf;c.customElements.get("media-tooltip")||c.customElements.define("media-tooltip",Fr);var la=Fr;var Wd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},fe=(i,e,t)=>(Wd(i,e,"read from private field"),t?t.call(i):e.get(i)),Kr=(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)},da=(i,e,t,r)=>(Wd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),kf=(i,e,t)=>(Wd(i,e,"access private method"),t),gt,Gr,ci,qr,ca,Bd,ip,di={TOOLTIP_PLACEMENT:"tooltipplacement",DISABLED:"disabled",NO_TOOLTIP:"notooltip"};function Lf(i,e={}){return`
|
|
504
504
|
<style>
|
|
505
505
|
:host {
|
|
506
506
|
position: relative;
|
|
@@ -582,9 +582,9 @@ bp-player[has-error] {
|
|
|
582
582
|
</slot>
|
|
583
583
|
</media-tooltip>
|
|
584
584
|
</slot>
|
|
585
|
-
`}function
|
|
585
|
+
`}function wf(i,e){return`
|
|
586
586
|
<slot></slot>
|
|
587
|
-
`}function
|
|
587
|
+
`}function If(){return""}var Y=class extends c.HTMLElement{constructor(){if(super(),Kr(this,Bd),Kr(this,gt,void 0),this.preventClick=!1,this.tooltipEl=null,Kr(this,Gr,e=>{this.preventClick||this.handleClick(e),setTimeout(fe(this,ci),0)}),Kr(this,ci,()=>{var e,t;(t=(e=this.tooltipEl)==null?void 0:e.updateXOffset)==null||t.call(e)}),Kr(this,qr,e=>{let{key:t}=e;if(!this.keysUsed.includes(t)){this.removeEventListener("keyup",fe(this,qr));return}this.preventClick||this.handleClick(e)}),Kr(this,ca,e=>{let{metaKey:t,altKey:r,key:n}=e;if(t||r||!this.keysUsed.includes(n)){this.removeEventListener("keyup",fe(this,qr));return}this.addEventListener("keyup",fe(this,qr),{once:!0})}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=ie(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",di.TOOLTIP_PLACEMENT,H.MEDIA_CONTROLLER,a.MEDIA_LANG]}enable(){this.addEventListener("click",fe(this,Gr)),this.addEventListener("keydown",fe(this,ca)),this.tabIndex=0}disable(){this.removeEventListener("click",fe(this,Gr)),this.removeEventListener("keydown",fe(this,ca)),this.removeEventListener("keyup",fe(this,qr)),this.tabIndex=-1}attributeChangedCallback(e,t,r){var n,o,s,l,d;e===H.MEDIA_CONTROLLER?(t&&((o=(n=fe(this,gt))==null?void 0:n.unassociateElement)==null||o.call(n,this),da(this,gt,null)),r&&this.isConnected&&(da(this,gt,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=fe(this,gt))==null?void 0:l.associateElement)==null||d.call(l,this))):e==="disabled"&&r!==t?r==null?this.enable():this.disable():e===di.TOOLTIP_PLACEMENT&&this.tooltipEl&&r!==t?this.tooltipEl.placement=r:e===a.MEDIA_LANG&&(this.shadowRoot.querySelector('slot[name="tooltip-content"]').innerHTML=this.constructor.getTooltipContentHTML()),fe(this,ci).call(this)}connectedCallback(){var e,t,r;let{style:n}=te(this.shadowRoot,":host");n.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),this.hasAttribute("disabled")?this.disable():this.enable(),this.setAttribute("role","button");let o=this.getAttribute(H.MEDIA_CONTROLLER);o&&(da(this,gt,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=fe(this,gt))==null?void 0:t.associateElement)==null||r.call(t,this)),c.customElements.whenDefined("media-tooltip").then(()=>kf(this,Bd,ip).call(this))}disconnectedCallback(){var e,t;this.disable(),(t=(e=fe(this,gt))==null?void 0:e.unassociateElement)==null||t.call(e,this),da(this,gt,null),this.removeEventListener("mouseenter",fe(this,ci)),this.removeEventListener("focus",fe(this,ci)),this.removeEventListener("click",fe(this,Gr))}get keysUsed(){return["Enter"," "]}get tooltipPlacement(){return O(this,di.TOOLTIP_PLACEMENT)}set tooltipPlacement(e){N(this,di.TOOLTIP_PLACEMENT,e)}get mediaController(){return O(this,H.MEDIA_CONTROLLER)}set mediaController(e){N(this,H.MEDIA_CONTROLLER,e)}get disabled(){return R(this,di.DISABLED)}set disabled(e){M(this,di.DISABLED,e)}get noTooltip(){return R(this,di.NO_TOOLTIP)}set noTooltip(e){M(this,di.NO_TOOLTIP,e)}handleClick(e){}};gt=new WeakMap;Gr=new WeakMap;ci=new WeakMap;qr=new WeakMap;ca=new WeakMap;Bd=new WeakSet;ip=function(){this.addEventListener("mouseenter",fe(this,ci)),this.addEventListener("focus",fe(this,ci)),this.addEventListener("click",fe(this,Gr));let i=this.tooltipPlacement;i&&this.tooltipEl&&(this.tooltipEl.placement=i)};Y.shadowRootOptions={mode:"open"};Y.getTemplateHTML=Lf;Y.getSlotTemplateHTML=wf;Y.getTooltipContentHTML=If;c.customElements.get("media-chrome-button")||c.customElements.define("media-chrome-button",Y);var rp=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
588
588
|
<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"/>
|
|
589
589
|
</svg>
|
|
590
590
|
`;function Cf(i){return`
|
|
@@ -663,7 +663,7 @@ bp-player[has-error] {
|
|
|
663
663
|
`}function Hf(){return`
|
|
664
664
|
<slot name="tooltip-enter">${b("Start casting")}</slot>
|
|
665
665
|
<slot name="tooltip-exit">${b("Stop casting")}</slot>
|
|
666
|
-
`}var lp=i=>{let e=i.mediaIsCasting?b("stop casting"):b("start casting");i.setAttribute("aria-label",e)},ko=class extends Y{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_IS_CASTING,a.MEDIA_CAST_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),lp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_IS_CASTING&&lp(this)}get mediaIsCasting(){return R(this,a.MEDIA_IS_CASTING)}set mediaIsCasting(e){M(this,a.MEDIA_IS_CASTING,e)}get mediaCastUnavailable(){return O(this,a.MEDIA_CAST_UNAVAILABLE)}set mediaCastUnavailable(e){N(this,a.MEDIA_CAST_UNAVAILABLE,e)}handleClick(){let e=this.mediaIsCasting?y.MEDIA_EXIT_CAST_REQUEST:y.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new c.CustomEvent(e,{composed:!0,bubbles:!0}))}};ko.getSlotTemplateHTML=Uf;ko.getTooltipContentHTML=Hf;c.customElements.get("media-cast-button")||c.customElements.define("media-cast-button",ko);var Qd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},er=(i,e,t)=>(Qd(i,e,"read from private field"),t?t.call(i):e.get(i)),Ft=(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)},Zd=(i,e,t,r)=>(Qd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ji=(i,e,t)=>(Qd(i,e,"access private method"),t),ha,
|
|
666
|
+
`}var lp=i=>{let e=i.mediaIsCasting?b("stop casting"):b("start casting");i.setAttribute("aria-label",e)},ko=class extends Y{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_IS_CASTING,a.MEDIA_CAST_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),lp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_IS_CASTING&&lp(this)}get mediaIsCasting(){return R(this,a.MEDIA_IS_CASTING)}set mediaIsCasting(e){M(this,a.MEDIA_IS_CASTING,e)}get mediaCastUnavailable(){return O(this,a.MEDIA_CAST_UNAVAILABLE)}set mediaCastUnavailable(e){N(this,a.MEDIA_CAST_UNAVAILABLE,e)}handleClick(){let e=this.mediaIsCasting?y.MEDIA_EXIT_CAST_REQUEST:y.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new c.CustomEvent(e,{composed:!0,bubbles:!0}))}};ko.getSlotTemplateHTML=Uf;ko.getTooltipContentHTML=Hf;c.customElements.get("media-cast-button")||c.customElements.define("media-cast-button",ko);var Qd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},er=(i,e,t)=>(Qd(i,e,"read from private field"),t?t.call(i):e.get(i)),Ft=(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)},Zd=(i,e,t,r)=>(Qd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ji=(i,e,t)=>(Qd(i,e,"access private method"),t),ha,wo,tr,ua,Fd,Kd,dp,qd,cp,Gd,up,zd,hp,Yd,pp;function $f(i){return`
|
|
667
667
|
<style>
|
|
668
668
|
:host {
|
|
669
669
|
font: var(--media-font,
|
|
@@ -704,9 +704,9 @@ bp-player[has-error] {
|
|
|
704
704
|
}
|
|
705
705
|
</style>
|
|
706
706
|
${this.getSlotTemplateHTML(i)}
|
|
707
|
-
`}function
|
|
707
|
+
`}function Vf(i){return`
|
|
708
708
|
<slot id="content"></slot>
|
|
709
|
-
`}var Lo={OPEN:"open",ANCHOR:"anchor"},bt=class extends c.HTMLElement{constructor(){super(),Ft(this,ua),Ft(this,Kd),Ft(this,qd),Ft(this,Gd),Ft(this,zd),Ft(this,Yd),Ft(this,ha,!1),Ft(this,
|
|
709
|
+
`}var Lo={OPEN:"open",ANCHOR:"anchor"},bt=class extends c.HTMLElement{constructor(){super(),Ft(this,ua),Ft(this,Kd),Ft(this,qd),Ft(this,Gd),Ft(this,zd),Ft(this,Yd),Ft(this,ha,!1),Ft(this,wo,null),Ft(this,tr,null),this.addEventListener("invoke",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this)}static get observedAttributes(){return[Lo.OPEN,Lo.ANCHOR]}get open(){return R(this,Lo.OPEN)}set open(e){M(this,Lo.OPEN,e)}handleEvent(e){switch(e.type){case"invoke":Ji(this,Gd,up).call(this,e);break;case"focusout":Ji(this,zd,hp).call(this,e);break;case"keydown":Ji(this,Yd,pp).call(this,e);break}}connectedCallback(){Ji(this,ua,Fd).call(this),this.role||(this.role="dialog")}attributeChangedCallback(e,t,r){Ji(this,ua,Fd).call(this),e===Lo.OPEN&&r!==t&&(this.open?Ji(this,Kd,dp).call(this):Ji(this,qd,cp).call(this))}focus(){Zd(this,wo,ho());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"]}};ha=new WeakMap;wo=new WeakMap;tr=new WeakMap;ua=new WeakSet;Fd=function(){if(!er(this,ha)&&(Zd(this,ha,!0),!this.shadowRoot)){this.attachShadow(this.constructor.shadowRootOptions);let i=ie(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(i),queueMicrotask(()=>{let{style:e}=te(this.shadowRoot,":host");e.setProperty("transition","display .15s, visibility .15s, opacity .15s ease-in, transform .15s ease-in")})}};Kd=new WeakSet;dp=function(){var i;(i=er(this,tr))==null||i.setAttribute("aria-expanded","true"),this.dispatchEvent(new Event("open",{composed:!0,bubbles:!0})),this.addEventListener("transitionend",()=>this.focus(),{once:!0})};qd=new WeakSet;cp=function(){var i;(i=er(this,tr))==null||i.setAttribute("aria-expanded","false"),this.dispatchEvent(new Event("close",{composed:!0,bubbles:!0}))};Gd=new WeakSet;up=function(i){Zd(this,tr,i.relatedTarget),Ce(this,i.relatedTarget)||(this.open=!this.open)};zd=new WeakSet;hp=function(i){var e;Ce(this,i.relatedTarget)||((e=er(this,wo))==null||e.focus(),er(this,tr)&&er(this,tr)!==i.relatedTarget&&this.open&&(this.open=!1))};Yd=new WeakSet;pp=function(i){var e,t,r,n,o;let{key:s,ctrlKey:l,altKey:d,metaKey:h}=i;l||d||h||this.keysUsed.includes(s)&&(i.preventDefault(),i.stopPropagation(),s==="Tab"?(i.shiftKey?(t=(e=this.previousElementSibling)==null?void 0:e.focus)==null||t.call(e):(n=(r=this.nextElementSibling)==null?void 0:r.focus)==null||n.call(r),this.blur()):s==="Escape"&&((o=er(this,wo))==null||o.focus(),this.open=!1))};bt.shadowRootOptions={mode:"open"};bt.getTemplateHTML=$f;bt.getSlotTemplateHTML=Vf;c.customElements.get("media-chrome-dialog")||c.customElements.define("media-chrome-dialog",bt);var rc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ce=(i,e,t)=>(rc(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)},ui=(i,e,t,r)=>(rc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),st=(i,e,t)=>(rc(i,e,"access private method"),t),_t,Ta,pa,ma,at,_a,va,fa,Ea,nc,mp,ga,Xd,ba,jd,ya,oc,Jd,vp,ec,fp,tc,Ep,ic,gp;function Bf(i){return`
|
|
710
710
|
<style>
|
|
711
711
|
:host {
|
|
712
712
|
--_focus-box-shadow: var(--media-focus-box-shadow, inset 0 0 0 2px rgb(27 127 204 / .9));
|
|
@@ -936,7 +936,7 @@ bp-player[has-error] {
|
|
|
936
936
|
${this.getContainerTemplateHTML(i)}
|
|
937
937
|
</div>
|
|
938
938
|
<div id="rightgap"></div>
|
|
939
|
-
`}function Wf(i){return""}var yt=class extends c.HTMLElement{constructor(){if(super(),ke(this,nc),ke(this,ga),ke(this,ba),ke(this,ya),ke(this,Jd),ke(this,ec),ke(this,tc),ke(this,ic),ke(this,_t,void 0),ke(this,Ta,void 0),ke(this,pa,void 0),ke(this,ma,void 0),ke(this,at,{}),ke(this,_a,[]),ke(this,va,()=>{if(this.range.matches(":focus-visible")){let{style:e}=te(this.shadowRoot,":host");e.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),ke(this,fa,()=>{let{style:e}=te(this.shadowRoot,":host");e.removeProperty("--_focus-visible-box-shadow")}),ke(this,Ea,()=>{let e=this.shadowRoot.querySelector("#segments-clipping");e&&e.parentNode.append(e)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=ie(this.attributes),t=this.constructor.getTemplateHTML(e);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(t):this.shadowRoot.innerHTML=t}this.container=this.shadowRoot.querySelector("#container"),ui(this,pa,this.shadowRoot.querySelector("#startpoint")),ui(this,ma,this.shadowRoot.querySelector("#endpoint")),this.range=this.shadowRoot.querySelector("#range"),this.appearance=this.shadowRoot.querySelector("#appearance")}static get observedAttributes(){return["disabled","aria-disabled",H.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,r){var n,o,s,l,d;e===H.MEDIA_CONTROLLER?(t&&((o=(n=ce(this,_t))==null?void 0:n.unassociateElement)==null||o.call(n,this),ui(this,_t,null)),r&&this.isConnected&&(ui(this,_t,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=ce(this,_t))==null?void 0:l.associateElement)==null||d.call(l,this))):(e==="disabled"||e==="aria-disabled"&&t!==r)&&(r==null?(this.range.removeAttribute(e),st(this,ga,Xd).call(this)):(this.range.setAttribute(e,r),st(this,ba,jd).call(this)))}connectedCallback(){var e,t,r;let{style:n}=te(this.shadowRoot,":host");n.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),ce(this,at).pointer=te(this.shadowRoot,"#pointer"),ce(this,at).progress=te(this.shadowRoot,"#progress"),ce(this,at).thumb=te(this.shadowRoot,'#thumb, ::slotted([slot="thumb"])'),ce(this,at).activeSegment=te(this.shadowRoot,"#segments-clipping rect:nth-child(0)");let o=this.getAttribute(H.MEDIA_CONTROLLER);o&&(ui(this,_t,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=ce(this,_t))==null?void 0:t.associateElement)==null||r.call(t,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",ce(this,va)),this.shadowRoot.addEventListener("focusout",ce(this,fa)),st(this,ga,Xd).call(this),$t(this.container,ce(this,Ea))}disconnectedCallback(){var e,t;st(this,ba,jd).call(this),(t=(e=ce(this,_t))==null?void 0:e.unassociateElement)==null||t.call(e,this),ui(this,_t,null),this.shadowRoot.removeEventListener("focusin",ce(this,va)),this.shadowRoot.removeEventListener("focusout",ce(this,fa)),
|
|
939
|
+
`}function Wf(i){return""}var yt=class extends c.HTMLElement{constructor(){if(super(),ke(this,nc),ke(this,ga),ke(this,ba),ke(this,ya),ke(this,Jd),ke(this,ec),ke(this,tc),ke(this,ic),ke(this,_t,void 0),ke(this,Ta,void 0),ke(this,pa,void 0),ke(this,ma,void 0),ke(this,at,{}),ke(this,_a,[]),ke(this,va,()=>{if(this.range.matches(":focus-visible")){let{style:e}=te(this.shadowRoot,":host");e.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),ke(this,fa,()=>{let{style:e}=te(this.shadowRoot,":host");e.removeProperty("--_focus-visible-box-shadow")}),ke(this,Ea,()=>{let e=this.shadowRoot.querySelector("#segments-clipping");e&&e.parentNode.append(e)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=ie(this.attributes),t=this.constructor.getTemplateHTML(e);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(t):this.shadowRoot.innerHTML=t}this.container=this.shadowRoot.querySelector("#container"),ui(this,pa,this.shadowRoot.querySelector("#startpoint")),ui(this,ma,this.shadowRoot.querySelector("#endpoint")),this.range=this.shadowRoot.querySelector("#range"),this.appearance=this.shadowRoot.querySelector("#appearance")}static get observedAttributes(){return["disabled","aria-disabled",H.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,r){var n,o,s,l,d;e===H.MEDIA_CONTROLLER?(t&&((o=(n=ce(this,_t))==null?void 0:n.unassociateElement)==null||o.call(n,this),ui(this,_t,null)),r&&this.isConnected&&(ui(this,_t,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=ce(this,_t))==null?void 0:l.associateElement)==null||d.call(l,this))):(e==="disabled"||e==="aria-disabled"&&t!==r)&&(r==null?(this.range.removeAttribute(e),st(this,ga,Xd).call(this)):(this.range.setAttribute(e,r),st(this,ba,jd).call(this)))}connectedCallback(){var e,t,r;let{style:n}=te(this.shadowRoot,":host");n.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),ce(this,at).pointer=te(this.shadowRoot,"#pointer"),ce(this,at).progress=te(this.shadowRoot,"#progress"),ce(this,at).thumb=te(this.shadowRoot,'#thumb, ::slotted([slot="thumb"])'),ce(this,at).activeSegment=te(this.shadowRoot,"#segments-clipping rect:nth-child(0)");let o=this.getAttribute(H.MEDIA_CONTROLLER);o&&(ui(this,_t,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=ce(this,_t))==null?void 0:t.associateElement)==null||r.call(t,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",ce(this,va)),this.shadowRoot.addEventListener("focusout",ce(this,fa)),st(this,ga,Xd).call(this),$t(this.container,ce(this,Ea))}disconnectedCallback(){var e,t;st(this,ba,jd).call(this),(t=(e=ce(this,_t))==null?void 0:e.unassociateElement)==null||t.call(e,this),ui(this,_t,null),this.shadowRoot.removeEventListener("focusin",ce(this,va)),this.shadowRoot.removeEventListener("focusout",ce(this,fa)),Vt(this.container,ce(this,Ea))}updatePointerBar(e){var t;(t=ce(this,at).pointer)==null||t.style.setProperty("width",`${this.getPointerRatio(e)*100}%`)}updateBar(){var e,t;let r=this.range.valueAsNumber*100;(e=ce(this,at).progress)==null||e.style.setProperty("width",`${r}%`),(t=ce(this,at).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(o=>[o.start,o.end]),+this.range.max])];ui(this,_a,[...r]);let n=r.pop();for(let[o,s]of r.entries()){let[l,d]=[o===0,o===r.length-1],h=l?"calc(var(--segments-gap) / -1)":`${s*100}%`,v=`calc(${((d?n:r[o+1])-s)*100}%${l||d?"":" - var(--segments-gap)"})`,f=ne.createElementNS("http://www.w3.org/2000/svg","rect"),m=po(this.shadowRoot,`#segments-clipping rect:nth-child(${o+1})`);m.style.setProperty("x",h),m.style.setProperty("width",v),t.append(f)}}getPointerRatio(e){return kh(e.clientX,e.clientY,ce(this,pa).getBoundingClientRect(),ce(this,ma).getBoundingClientRect())}get dragging(){return this.hasAttribute("dragging")}handleEvent(e){switch(e.type){case"pointermove":st(this,ic,gp).call(this,e);break;case"input":this.updateBar();break;case"pointerenter":st(this,Jd,vp).call(this,e);break;case"pointerdown":st(this,ya,oc).call(this,e);break;case"pointerup":st(this,ec,fp).call(this);break;case"pointerleave":st(this,tc,Ep).call(this);break}}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};_t=new WeakMap;Ta=new WeakMap;pa=new WeakMap;ma=new WeakMap;at=new WeakMap;_a=new WeakMap;va=new WeakMap;fa=new WeakMap;Ea=new WeakMap;nc=new WeakSet;mp=function(i){let e=ce(this,at).activeSegment;if(!e)return;let t=this.getPointerRatio(i),n=`#segments-clipping rect:nth-child(${ce(this,_a).findIndex((o,s,l)=>{let d=l[s+1];return d!=null&&t>=o&&t<=d})+1})`;(e.selectorText!=n||!e.style.transform)&&(e.selectorText=n,e.style.setProperty("transform","var(--media-range-segment-hover-transform, scaleY(2))"))};ga=new WeakSet;Xd=function(){this.hasAttribute("disabled")||(this.addEventListener("input",this),this.addEventListener("pointerdown",this),this.addEventListener("pointerenter",this))};ba=new WeakSet;jd=function(){var i,e;this.removeEventListener("input",this),this.removeEventListener("pointerdown",this),this.removeEventListener("pointerenter",this),(i=c.window)==null||i.removeEventListener("pointerup",this),(e=c.window)==null||e.removeEventListener("pointermove",this)};ya=new WeakSet;oc=function(i){var e;ui(this,Ta,i.composedPath().includes(this.range)),(e=c.window)==null||e.addEventListener("pointerup",this)};Jd=new WeakSet;vp=function(i){var e;i.pointerType!=="mouse"&&st(this,ya,oc).call(this,i),this.addEventListener("pointerleave",this),(e=c.window)==null||e.addEventListener("pointermove",this)};ec=new WeakSet;fp=function(){var i;(i=c.window)==null||i.removeEventListener("pointerup",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled")};tc=new WeakSet;Ep=function(){var i,e;this.removeEventListener("pointerleave",this),(i=c.window)==null||i.removeEventListener("pointermove",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled"),(e=ce(this,at).activeSegment)==null||e.style.removeProperty("transform")};ic=new WeakSet;gp=function(i){i.pointerType==="pen"&&i.buttons===0||(this.toggleAttribute("dragging",i.buttons===1||i.pointerType!=="mouse"),this.updatePointerBar(i),st(this,nc,mp).call(this,i),this.dragging&&(i.pointerType!=="mouse"||!ce(this,Ta))&&(this.range.disabled=!0,this.range.valueAsNumber=this.getPointerRatio(i),this.range.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))))};yt.shadowRootOptions={mode:"open"};yt.getTemplateHTML=Bf;yt.getContainerTemplateHTML=Wf;c.customElements.get("media-chrome-range")||c.customElements.define("media-chrome-range",yt);var bp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Aa=(i,e,t)=>(bp(i,e,"read from private field"),t?t.call(i):e.get(i)),Ff=(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)},Sa=(i,e,t,r)=>(bp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Tt;function Kf(i){return`
|
|
940
940
|
<style>
|
|
941
941
|
:host {
|
|
942
942
|
|
|
@@ -962,7 +962,7 @@ bp-player[has-error] {
|
|
|
962
962
|
</style>
|
|
963
963
|
|
|
964
964
|
<slot></slot>
|
|
965
|
-
`}var
|
|
965
|
+
`}var Io=class extends c.HTMLElement{constructor(){if(super(),Ff(this,Tt,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=ie(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[H.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,r){var n,o,s,l,d;e===H.MEDIA_CONTROLLER&&(t&&((o=(n=Aa(this,Tt))==null?void 0:n.unassociateElement)==null||o.call(n,this),Sa(this,Tt,null)),r&&this.isConnected&&(Sa(this,Tt,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=Aa(this,Tt))==null?void 0:l.associateElement)==null||d.call(l,this)))}connectedCallback(){var e,t,r;let n=this.getAttribute(H.MEDIA_CONTROLLER);n&&(Sa(this,Tt,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(r=(t=Aa(this,Tt))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Aa(this,Tt))==null?void 0:e.unassociateElement)==null||t.call(e,this),Sa(this,Tt,null)}};Tt=new WeakMap;Io.shadowRootOptions={mode:"open"};Io.getTemplateHTML=Kf;c.customElements.get("media-control-bar")||c.customElements.define("media-control-bar",Io);var _p=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ka=(i,e,t)=>(_p(i,e,"read from private field"),t?t.call(i):e.get(i)),qf=(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)},La=(i,e,t,r)=>(_p(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),At;function Gf(i,e={}){return`
|
|
966
966
|
<style>
|
|
967
967
|
:host {
|
|
968
968
|
font: var(--media-font,
|
|
@@ -1000,7 +1000,7 @@ bp-player[has-error] {
|
|
|
1000
1000
|
<slot></slot>
|
|
1001
1001
|
`}var Ne=class extends c.HTMLElement{constructor(){if(super(),qf(this,At,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=ie(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[H.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,r){var n,o,s,l,d;e===H.MEDIA_CONTROLLER&&(t&&((o=(n=ka(this,At))==null?void 0:n.unassociateElement)==null||o.call(n,this),La(this,At,null)),r&&this.isConnected&&(La(this,At,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=ka(this,At))==null?void 0:l.associateElement)==null||d.call(l,this)))}connectedCallback(){var e,t,r;let{style:n}=te(this.shadowRoot,":host");n.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`);let o=this.getAttribute(H.MEDIA_CONTROLLER);o&&(La(this,At,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=ka(this,At))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=ka(this,At))==null?void 0:e.unassociateElement)==null||t.call(e,this),La(this,At,null)}};At=new WeakMap;Ne.shadowRootOptions={mode:"open"};Ne.getTemplateHTML=Gf;Ne.getSlotTemplateHTML=zf;c.customElements.get("media-text-display")||c.customElements.define("media-text-display",Ne);var Tp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},yp=(i,e,t)=>(Tp(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)},Qf=(i,e,t,r)=>(Tp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Co;function Zf(i,e){return`
|
|
1002
1002
|
<slot>${ot(e.mediaDuration)}</slot>
|
|
1003
|
-
`}var
|
|
1003
|
+
`}var wa=class extends Ne{constructor(){var e;super(),Yf(this,Co,void 0),Qf(this,Co,this.shadowRoot.querySelector("slot")),yp(this,Co).textContent=ot((e=this.mediaDuration)!=null?e:0)}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_DURATION]}attributeChangedCallback(e,t,r){e===a.MEDIA_DURATION&&(yp(this,Co).textContent=ot(+r)),super.attributeChangedCallback(e,t,r)}get mediaDuration(){return V(this,a.MEDIA_DURATION)}set mediaDuration(e){F(this,a.MEDIA_DURATION,e)}};Co=new WeakMap;wa.getSlotTemplateHTML=Zf;c.customElements.get("media-duration-display")||c.customElements.define("media-duration-display",wa);var Xf={2:b("Network Error"),3:b("Decode Error"),4:b("Source Not Supported"),5:b("Encryption Error")},jf={2:b("A network error caused the media download to fail."),3:b("A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format."),4:b("An unsupported error occurred. The server or network failed, or your browser does not support this format."),5:b("The media is encrypted and there are no keys to decrypt it.")},sc=i=>{var e,t;return i.code===1?null:{title:(e=Xf[i.code])!=null?e:`Error ${i.code}`,message:(t=jf[i.code])!=null?t:i.message}};var Sp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Jf=(i,e,t)=>(Sp(i,e,"read from private field"),t?t.call(i):e.get(i)),eE=(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)},tE=(i,e,t,r)=>(Sp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ia;function iE(i){return`
|
|
1004
1004
|
<style>
|
|
1005
1005
|
:host {
|
|
1006
1006
|
background: rgb(20 20 30 / .8);
|
|
@@ -1019,7 +1019,7 @@ bp-player[has-error] {
|
|
|
1019
1019
|
<slot name="error-${i.mediaerrorcode}" id="content">
|
|
1020
1020
|
${kp({code:+i.mediaerrorcode,message:i.mediaerrormessage})}
|
|
1021
1021
|
</slot>
|
|
1022
|
-
`}function rE(i){return i.code&&sc(i)!==null}function kp(i){var e;let{title:t,message:r}=(e=sc(i))!=null?e:{},n="";return t&&(n+=`<slot name="error-${i.code}-title"><h3>${t}</h3></slot>`),r&&(n+=`<slot name="error-${i.code}-message"><p>${r}</p></slot>`),n}var Ap=[a.MEDIA_ERROR_CODE,a.MEDIA_ERROR_MESSAGE],Ro=class extends bt{constructor(){super(...arguments),eE(this,
|
|
1022
|
+
`}function rE(i){return i.code&&sc(i)!==null}function kp(i){var e;let{title:t,message:r}=(e=sc(i))!=null?e:{},n="";return t&&(n+=`<slot name="error-${i.code}-title"><h3>${t}</h3></slot>`),r&&(n+=`<slot name="error-${i.code}-message"><p>${r}</p></slot>`),n}var Ap=[a.MEDIA_ERROR_CODE,a.MEDIA_ERROR_MESSAGE],Ro=class extends bt{constructor(){super(...arguments),eE(this,Ia,null)}static get observedAttributes(){return[...super.observedAttributes,...Ap]}formatErrorMessage(e){return this.constructor.formatErrorMessage(e)}attributeChangedCallback(e,t,r){var n;if(super.attributeChangedCallback(e,t,r),!Ap.includes(e))return;let o=(n=this.mediaError)!=null?n:{code:this.mediaErrorCode,message:this.mediaErrorMessage};this.open=rE(o),this.open&&(this.shadowRoot.querySelector("slot").name=`error-${this.mediaErrorCode}`,this.shadowRoot.querySelector("#content").innerHTML=this.formatErrorMessage(o))}get mediaError(){return Jf(this,Ia)}set mediaError(e){tE(this,Ia,e)}get mediaErrorCode(){return V(this,"mediaerrorcode")}set mediaErrorCode(e){F(this,"mediaerrorcode",e)}get mediaErrorMessage(){return O(this,"mediaerrormessage")}set mediaErrorMessage(e){N(this,"mediaerrormessage",e)}};Ia=new WeakMap;Ro.getSlotTemplateHTML=iE;Ro.formatErrorMessage=kp;c.customElements.get("media-error-dialog")||c.customElements.define("media-error-dialog",Ro);var nE=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},hi=(i,e,t)=>(nE(i,e,"read from private field"),t?t.call(i):e.get(i)),Lp=(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,Yr;function oE(i){return`
|
|
1023
1023
|
<style>
|
|
1024
1024
|
:host {
|
|
1025
1025
|
position: fixed;
|
|
@@ -1116,7 +1116,7 @@ bp-player[has-error] {
|
|
|
1116
1116
|
<td class="description">${r}</td>
|
|
1117
1117
|
</tr>
|
|
1118
1118
|
`).join("")}</table>
|
|
1119
|
-
`}var Ca=class extends bt{constructor(){super(...arguments),Lp(this,zr,e=>{var t;if(!this.open)return;let r=(t=this.shadowRoot)==null?void 0:t.querySelector("#content");if(!r)return;let n=e.composedPath(),o=n[0]===this||n.includes(this),s=n.includes(r);o&&!s&&(this.open=!1)}),Lp(this,Yr,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",hi(this,zr)),document.addEventListener("keydown",hi(this,Yr)))}disconnectedCallback(){this.removeEventListener("click",hi(this,zr)),document.removeEventListener("keydown",hi(this,Yr))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e==="open"&&(this.open?(this.addEventListener("click",hi(this,zr)),document.addEventListener("keydown",hi(this,Yr))):(this.removeEventListener("click",hi(this,zr)),document.removeEventListener("keydown",hi(this,Yr))))}};zr=new WeakMap;Yr=new WeakMap;Ca.getSlotTemplateHTML=oE;c.customElements.get("media-keyboard-shortcuts-dialog")||c.customElements.define("media-keyboard-shortcuts-dialog",Ca);var
|
|
1119
|
+
`}var Ca=class extends bt{constructor(){super(...arguments),Lp(this,zr,e=>{var t;if(!this.open)return;let r=(t=this.shadowRoot)==null?void 0:t.querySelector("#content");if(!r)return;let n=e.composedPath(),o=n[0]===this||n.includes(this),s=n.includes(r);o&&!s&&(this.open=!1)}),Lp(this,Yr,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",hi(this,zr)),document.addEventListener("keydown",hi(this,Yr)))}disconnectedCallback(){this.removeEventListener("click",hi(this,zr)),document.removeEventListener("keydown",hi(this,Yr))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e==="open"&&(this.open?(this.addEventListener("click",hi(this,zr)),document.addEventListener("keydown",hi(this,Yr))):(this.removeEventListener("click",hi(this,zr)),document.removeEventListener("keydown",hi(this,Yr))))}};zr=new WeakMap;Yr=new WeakMap;Ca.getSlotTemplateHTML=oE;c.customElements.get("media-keyboard-shortcuts-dialog")||c.customElements.define("media-keyboard-shortcuts-dialog",Ca);var Ip=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},aE=(i,e,t)=>(Ip(i,e,"read from private field"),t?t.call(i):e.get(i)),lE=(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)},dE=(i,e,t,r)=>(Ip(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ra,cE=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
1120
1120
|
<path d="M16 3v2.5h3.5V9H22V3h-6ZM4 9h2.5V5.5H10V3H4v6Zm15.5 9.5H16V21h6v-6h-2.5v3.5ZM6.5 15H4v6h6v-2.5H6.5V15Z"/>
|
|
1121
1121
|
</svg>`,uE=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
1122
1122
|
<path d="M18.5 6.5V3H16v6h6V6.5h-3.5ZM16 21h2.5v-3.5H22V15h-6v6ZM4 17.5h3.5V21H10v-6H4v2.5Zm3.5-11H4V9h6V3H7.5v3.5Z"/>
|
|
@@ -1144,7 +1144,7 @@ bp-player[has-error] {
|
|
|
1144
1144
|
`}function pE(){return`
|
|
1145
1145
|
<slot name="tooltip-enter">${b("Enter fullscreen mode")}</slot>
|
|
1146
1146
|
<slot name="tooltip-exit">${b("Exit fullscreen mode")}</slot>
|
|
1147
|
-
`}var
|
|
1147
|
+
`}var wp=i=>{let e=i.mediaIsFullscreen?b("exit fullscreen mode"):b("enter fullscreen mode");i.setAttribute("aria-label",e)},Mo=class extends Y{constructor(){super(...arguments),lE(this,Ra,null)}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_IS_FULLSCREEN,a.MEDIA_FULLSCREEN_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),wp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_IS_FULLSCREEN&&wp(this)}get mediaFullscreenUnavailable(){return O(this,a.MEDIA_FULLSCREEN_UNAVAILABLE)}set mediaFullscreenUnavailable(e){N(this,a.MEDIA_FULLSCREEN_UNAVAILABLE,e)}get mediaIsFullscreen(){return R(this,a.MEDIA_IS_FULLSCREEN)}set mediaIsFullscreen(e){M(this,a.MEDIA_IS_FULLSCREEN,e)}handleClick(e){dE(this,Ra,e);let t=aE(this,Ra)instanceof PointerEvent,r=this.mediaIsFullscreen?new c.CustomEvent(y.MEDIA_EXIT_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0}):new c.CustomEvent(y.MEDIA_ENTER_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(r)}};Ra=new WeakMap;Mo.getSlotTemplateHTML=hE;Mo.getTooltipContentHTML=pE;c.customElements.get("media-fullscreen-button")||c.customElements.define("media-fullscreen-button",Mo);var{MEDIA_TIME_IS_LIVE:Ma,MEDIA_PAUSED:xo}=a,{MEDIA_SEEK_TO_LIVE_REQUEST:mE,MEDIA_PLAY_REQUEST:vE}=y,fE='<svg viewBox="0 0 6 12"><circle cx="3" cy="6" r="2"></circle></svg>';function EE(i){return`
|
|
1148
1148
|
<style>
|
|
1149
1149
|
:host { --media-tooltip-display: none; }
|
|
1150
1150
|
|
|
@@ -1300,7 +1300,7 @@ bp-player[has-error] {
|
|
|
1300
1300
|
`}function kE(){return`
|
|
1301
1301
|
<slot name="tooltip-enter">${b("Enter picture in picture mode")}</slot>
|
|
1302
1302
|
<slot name="tooltip-exit">${b("Exit picture in picture mode")}</slot>
|
|
1303
|
-
`}var Np=i=>{let e=i.mediaIsPip?b("exit picture in picture mode"):b("enter picture in picture mode");i.setAttribute("aria-label",e)},Uo=class extends Y{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_IS_PIP,a.MEDIA_PIP_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Np(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_IS_PIP&&Np(this)}get mediaPipUnavailable(){return O(this,a.MEDIA_PIP_UNAVAILABLE)}set mediaPipUnavailable(e){N(this,a.MEDIA_PIP_UNAVAILABLE,e)}get mediaIsPip(){return R(this,a.MEDIA_IS_PIP)}set mediaIsPip(e){M(this,a.MEDIA_IS_PIP,e)}handleClick(){let e=this.mediaIsPip?y.MEDIA_EXIT_PIP_REQUEST:y.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new c.CustomEvent(e,{composed:!0,bubbles:!0}))}};Uo.getSlotTemplateHTML=SE;Uo.getTooltipContentHTML=kE;c.customElements.get("media-pip-button")||c.customElements.define("media-pip-button",Uo);var LE=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Qr=(i,e,t)=>(LE(i,e,"read from private field"),t?t.call(i):e.get(i)),
|
|
1303
|
+
`}var Np=i=>{let e=i.mediaIsPip?b("exit picture in picture mode"):b("enter picture in picture mode");i.setAttribute("aria-label",e)},Uo=class extends Y{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_IS_PIP,a.MEDIA_PIP_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Np(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_IS_PIP&&Np(this)}get mediaPipUnavailable(){return O(this,a.MEDIA_PIP_UNAVAILABLE)}set mediaPipUnavailable(e){N(this,a.MEDIA_PIP_UNAVAILABLE,e)}get mediaIsPip(){return R(this,a.MEDIA_IS_PIP)}set mediaIsPip(e){M(this,a.MEDIA_IS_PIP,e)}handleClick(){let e=this.mediaIsPip?y.MEDIA_EXIT_PIP_REQUEST:y.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new c.CustomEvent(e,{composed:!0,bubbles:!0}))}};Uo.getSlotTemplateHTML=SE;Uo.getTooltipContentHTML=kE;c.customElements.get("media-pip-button")||c.customElements.define("media-pip-button",Uo);var LE=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Qr=(i,e,t)=>(LE(i,e,"read from private field"),t?t.call(i):e.get(i)),wE=(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)},pi,ac={RATES:"rates"},lc=[1,1.2,1.5,1.7,2],ir=1;function IE(i){return`
|
|
1304
1304
|
<style>
|
|
1305
1305
|
:host {
|
|
1306
1306
|
min-width: 5ch;
|
|
@@ -1308,7 +1308,7 @@ bp-player[has-error] {
|
|
|
1308
1308
|
}
|
|
1309
1309
|
</style>
|
|
1310
1310
|
<slot name="icon">${i.mediaplaybackrate||ir}x</slot>
|
|
1311
|
-
`}function CE(){return b("Playback rate")}var Ho=class extends Y{constructor(){var e;super(),
|
|
1311
|
+
`}function CE(){return b("Playback rate")}var Ho=class extends Y{constructor(){var e;super(),wE(this,pi,new ai(this,ac.RATES,{defaultValue:lc})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${(e=this.mediaPlaybackRate)!=null?e:ir}x`}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PLAYBACK_RATE,ac.RATES]}attributeChangedCallback(e,t,r){if(super.attributeChangedCallback(e,t,r),e===ac.RATES&&(Qr(this,pi).value=r),e===a.MEDIA_PLAYBACK_RATE){let n=r?+r:Number.NaN,o=Number.isNaN(n)?ir:n;this.container.innerHTML=`${o}x`,this.setAttribute("aria-label",b("Playback rate {playbackRate}",{playbackRate:o}))}}get rates(){return Qr(this,pi)}set rates(e){e?Array.isArray(e)?Qr(this,pi).value=e.join(" "):typeof e=="string"&&(Qr(this,pi).value=e):Qr(this,pi).value=""}get mediaPlaybackRate(){return V(this,a.MEDIA_PLAYBACK_RATE,ir)}set mediaPlaybackRate(e){F(this,a.MEDIA_PLAYBACK_RATE,e)}handleClick(){var e,t;let r=Array.from(Qr(this,pi).values(),s=>+s).sort((s,l)=>s-l),n=(t=(e=r.find(s=>s>this.mediaPlaybackRate))!=null?e:r[0])!=null?t:ir,o=new c.CustomEvent(y.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:n});this.dispatchEvent(o)}};pi=new WeakMap;Ho.getSlotTemplateHTML=IE;Ho.getTooltipContentHTML=CE;c.customElements.get("media-playback-rate-button")||c.customElements.define("media-playback-rate-button",Ho);var RE=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
1312
1312
|
<path d="m6 21 15-9L6 3v18Z"/>
|
|
1313
1313
|
</svg>`,ME=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
1314
1314
|
<path d="M6 20h4V4H6v16Zm8-16v16h4V4h-4Z"/>
|
|
@@ -1354,7 +1354,7 @@ bp-player[has-error] {
|
|
|
1354
1354
|
</style>
|
|
1355
1355
|
|
|
1356
1356
|
<img part="poster img" aria-hidden="true" id="image"/>
|
|
1357
|
-
`}var OE=i=>{i.style.removeProperty("background-image")},NE=(i,e)=>{i.style["background-image"]=`url('${e}')`},
|
|
1357
|
+
`}var OE=i=>{i.style.removeProperty("background-image")},NE=(i,e)=>{i.style["background-image"]=`url('${e}')`},Vo=class extends c.HTMLElement{static get observedAttributes(){return[kt.PLACEHOLDER_SRC,kt.SRC]}constructor(){if(super(),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=ie(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,t,r){e===kt.SRC&&(r==null?this.image.removeAttribute(kt.SRC):this.image.setAttribute(kt.SRC,r)),e===kt.PLACEHOLDER_SRC&&(r==null?OE(this.image):NE(this.image,r))}get placeholderSrc(){return O(this,kt.PLACEHOLDER_SRC)}set placeholderSrc(e){N(this,kt.SRC,e)}get src(){return O(this,kt.SRC)}set src(e){N(this,kt.SRC,e)}};Vo.shadowRootOptions={mode:"open"};Vo.getTemplateHTML=DE;c.customElements.get("media-poster-image")||c.customElements.define("media-poster-image",Vo);var Hp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},UE=(i,e,t)=>(Hp(i,e,"read from private field"),t?t.call(i):e.get(i)),HE=(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)},$E=(i,e,t,r)=>(Hp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Oa,dc=class extends Ne{constructor(){super(),HE(this,Oa,void 0),$E(this,Oa,this.shadowRoot.querySelector("slot"))}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PREVIEW_CHAPTER,a.MEDIA_LANG]}attributeChangedCallback(e,t,r){if(super.attributeChangedCallback(e,t,r),(e===a.MEDIA_PREVIEW_CHAPTER||e===a.MEDIA_LANG)&&r!==t&&r!=null)if(UE(this,Oa).textContent=r,r!==""){let n=b("chapter: {chapterName}",{chapterName:r});this.setAttribute("aria-valuetext",n)}else this.removeAttribute("aria-valuetext")}get mediaPreviewChapter(){return O(this,a.MEDIA_PREVIEW_CHAPTER)}set mediaPreviewChapter(e){N(this,a.MEDIA_PREVIEW_CHAPTER,e)}};Oa=new WeakMap;c.customElements.get("media-preview-chapter-display")||c.customElements.define("media-preview-chapter-display",dc);var $p=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Na=(i,e,t)=>($p(i,e,"read from private field"),t?t.call(i):e.get(i)),VE=(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)},Ua=(i,e,t,r)=>($p(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Lt;function BE(i){return`
|
|
1358
1358
|
<style>
|
|
1359
1359
|
:host {
|
|
1360
1360
|
box-sizing: border-box;
|
|
@@ -1368,7 +1368,7 @@ bp-player[has-error] {
|
|
|
1368
1368
|
}
|
|
1369
1369
|
</style>
|
|
1370
1370
|
<img crossorigin loading="eager" decoding="async">
|
|
1371
|
-
`}var Zr=class extends c.HTMLElement{constructor(){if(super(),
|
|
1371
|
+
`}var Zr=class extends c.HTMLElement{constructor(){if(super(),VE(this,Lt,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=ie(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[H.MEDIA_CONTROLLER,a.MEDIA_PREVIEW_IMAGE,a.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,t,r;let n=this.getAttribute(H.MEDIA_CONTROLLER);n&&(Ua(this,Lt,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(r=(t=Na(this,Lt))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Na(this,Lt))==null?void 0:e.unassociateElement)==null||t.call(e,this),Ua(this,Lt,null)}attributeChangedCallback(e,t,r){var n,o,s,l,d;[a.MEDIA_PREVIEW_IMAGE,a.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===H.MEDIA_CONTROLLER&&(t&&((o=(n=Na(this,Lt))==null?void 0:n.unassociateElement)==null||o.call(n,this),Ua(this,Lt,null)),r&&this.isConnected&&(Ua(this,Lt,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=Na(this,Lt))==null?void 0:l.associateElement)==null||d.call(l,this)))}get mediaPreviewImage(){return O(this,a.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){N(this,a.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewCoords(){let e=this.getAttribute(a.MEDIA_PREVIEW_COORDS);if(e)return e.split(/\s+/).map(t=>+t)}set mediaPreviewCoords(e){if(!e){this.removeAttribute(a.MEDIA_PREVIEW_COORDS);return}this.setAttribute(a.MEDIA_PREVIEW_COORDS,e.join(" "))}update(){let e=this.mediaPreviewCoords,t=this.mediaPreviewImage;if(!(e&&t))return;let[r,n,o,s]=e,l=t.split("#")[0],d=getComputedStyle(this),{maxWidth:h,maxHeight:p,minWidth:v,minHeight:f}=d,m=Math.min(parseInt(h)/o,parseInt(p)/s),_=Math.max(parseInt(v)/o,parseInt(f)/s),g=m<1,w=g?m:_>1?_:1,{style:k}=te(this.shadowRoot,":host"),oe=te(this.shadowRoot,"img").style,we=this.shadowRoot.querySelector("img"),Xt=g?"min":"max";k.setProperty(`${Xt}-width`,"initial","important"),k.setProperty(`${Xt}-height`,"initial","important"),k.width=`${o*w}px`,k.height=`${s*w}px`;let Nt=()=>{oe.width=`${this.imgWidth*w}px`,oe.height=`${this.imgHeight*w}px`,oe.display="block"};we.src!==l&&(we.onload=()=>{this.imgWidth=we.naturalWidth,this.imgHeight=we.naturalHeight,Nt()},we.src=l,Nt()),Nt(),oe.transform=`translate(-${r*w}px, -${n*w}px)`}};Lt=new WeakMap;Zr.shadowRootOptions={mode:"open"};Zr.getTemplateHTML=BE;c.customElements.get("media-preview-thumbnail")||c.customElements.define("media-preview-thumbnail",Zr);var Ha=Zr;var Bp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Vp=(i,e,t)=>(Bp(i,e,"read from private field"),t?t.call(i):e.get(i)),WE=(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)},FE=(i,e,t,r)=>(Bp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Bo,cc=class extends Ne{constructor(){super(),WE(this,Bo,void 0),FE(this,Bo,this.shadowRoot.querySelector("slot")),Vp(this,Bo).textContent=ot(0)}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PREVIEW_TIME]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_PREVIEW_TIME&&r!=null&&(Vp(this,Bo).textContent=ot(parseFloat(r)))}get mediaPreviewTime(){return V(this,a.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){F(this,a.MEDIA_PREVIEW_TIME,e)}};Bo=new WeakMap;c.customElements.get("media-preview-time-display")||c.customElements.define("media-preview-time-display",cc);var Xr={SEEK_OFFSET:"seekoffset"},uc=30,KE=i=>`
|
|
1372
1372
|
<svg aria-hidden="true" viewBox="0 0 20 24">
|
|
1373
1373
|
<defs>
|
|
1374
1374
|
<style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style>
|
|
@@ -1377,7 +1377,7 @@ bp-player[has-error] {
|
|
|
1377
1377
|
<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"/>
|
|
1378
1378
|
</svg>`;function qE(i,e){return`
|
|
1379
1379
|
<slot name="icon">${KE(e.seekOffset)}</slot>
|
|
1380
|
-
`}function GE(){return b("Seek backward")}var zE=0,Wo=class extends Y{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_CURRENT_TIME,Xr.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this.seekOffset=
|
|
1380
|
+
`}function GE(){return b("Seek backward")}var zE=0,Wo=class extends Y{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_CURRENT_TIME,Xr.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this.seekOffset=V(this,Xr.SEEK_OFFSET,uc)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===Xr.SEEK_OFFSET&&(this.seekOffset=V(this,Xr.SEEK_OFFSET,uc))}get seekOffset(){return V(this,Xr.SEEK_OFFSET,uc)}set seekOffset(e){F(this,Xr.SEEK_OFFSET,e),this.setAttribute("aria-label",b("seek back {seekOffset} seconds",{seekOffset:this.seekOffset})),Bs(Ws(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return V(this,a.MEDIA_CURRENT_TIME,zE)}set mediaCurrentTime(e){F(this,a.MEDIA_CURRENT_TIME,e)}handleClick(){let e=Math.max(this.mediaCurrentTime-this.seekOffset,0),t=new c.CustomEvent(y.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};Wo.getSlotTemplateHTML=qE;Wo.getTooltipContentHTML=GE;c.customElements.get("media-seek-backward-button")||c.customElements.define("media-seek-backward-button",Wo);var jr={SEEK_OFFSET:"seekoffset"},hc=30,YE=i=>`
|
|
1381
1381
|
<svg aria-hidden="true" viewBox="0 0 20 24">
|
|
1382
1382
|
<defs>
|
|
1383
1383
|
<style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style>
|
|
@@ -1386,9 +1386,9 @@ bp-player[has-error] {
|
|
|
1386
1386
|
<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"/>
|
|
1387
1387
|
</svg>`;function QE(i,e){return`
|
|
1388
1388
|
<slot name="icon">${YE(e.seekOffset)}</slot>
|
|
1389
|
-
`}function ZE(){return b("Seek forward")}var XE=0,Fo=class extends Y{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_CURRENT_TIME,jr.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this.seekOffset=
|
|
1389
|
+
`}function ZE(){return b("Seek forward")}var XE=0,Fo=class extends Y{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_CURRENT_TIME,jr.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this.seekOffset=V(this,jr.SEEK_OFFSET,hc)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===jr.SEEK_OFFSET&&(this.seekOffset=V(this,jr.SEEK_OFFSET,hc))}get seekOffset(){return V(this,jr.SEEK_OFFSET,hc)}set seekOffset(e){F(this,jr.SEEK_OFFSET,e),this.setAttribute("aria-label",b("seek forward {seekOffset} seconds",{seekOffset:this.seekOffset})),Bs(Ws(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return V(this,a.MEDIA_CURRENT_TIME,XE)}set mediaCurrentTime(e){F(this,a.MEDIA_CURRENT_TIME,e)}handleClick(){let e=this.mediaCurrentTime+this.seekOffset,t=new c.CustomEvent(y.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};Fo.getSlotTemplateHTML=QE;Fo.getTooltipContentHTML=ZE;c.customElements.get("media-seek-forward-button")||c.customElements.define("media-seek-forward-button",Fo);var Kp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},pc=(i,e,t)=>(Kp(i,e,"read from private field"),t?t.call(i):e.get(i)),jE=(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)},JE=(i,e,t,r)=>(Kp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Jr,rr={REMAINING:"remaining",SHOW_DURATION:"showduration",NO_TOGGLE:"notoggle"},Wp=[...Object.values(rr),a.MEDIA_CURRENT_TIME,a.MEDIA_DURATION,a.MEDIA_SEEKABLE],Fp=["Enter"," "],eg=" / ",mc=(i,{timesSep:e=eg}={})=>{var t,r;let n=(t=i.mediaCurrentTime)!=null?t:0,[,o]=(r=i.mediaSeekable)!=null?r:[],s=0;Number.isFinite(i.mediaDuration)?s=i.mediaDuration:Number.isFinite(o)&&(s=o);let l=i.remaining?ot(0-(s-n)):ot(n);return i.showDuration?`${l}${e}${ot(s)}`:l},tg="video not loaded, unknown time.",ig=i=>{var e;let t=i.mediaCurrentTime,[,r]=(e=i.mediaSeekable)!=null?e:[],n=null;if(Number.isFinite(i.mediaDuration)?n=i.mediaDuration:Number.isFinite(r)&&(n=r),t==null||n===null){i.setAttribute("aria-valuetext",tg);return}let o=i.remaining?Wi(0-(n-t)):Wi(t);if(!i.showDuration){i.setAttribute("aria-valuetext",o);return}let s=Wi(n),l=`${o} of ${s}`;i.setAttribute("aria-valuetext",l)};function rg(i,e){return`
|
|
1390
1390
|
<slot>${mc(e)}</slot>
|
|
1391
|
-
`}var $a=class extends Ne{constructor(){super(),jE(this,Jr,void 0),JE(this,Jr,this.shadowRoot.querySelector("slot")),pc(this,Jr).innerHTML=`${mc(this)}`}static get observedAttributes(){return[...super.observedAttributes,...Wp,"disabled"]}connectedCallback(){let{style:e}=te(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",b("playback time"));let t=r=>{let{key:n}=r;if(!Fp.includes(n)){this.removeEventListener("keyup",t);return}this.toggleTimeDisplay()};this.addEventListener("keydown",r=>{let{metaKey:n,altKey:o,key:s}=r;if(n||o||!Fp.includes(s)){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){Wp.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 R(this,rr.REMAINING)}set remaining(e){M(this,rr.REMAINING,e)}get showDuration(){return R(this,rr.SHOW_DURATION)}set showDuration(e){M(this,rr.SHOW_DURATION,e)}get noToggle(){return R(this,rr.NO_TOGGLE)}set noToggle(e){M(this,rr.NO_TOGGLE,e)}get mediaDuration(){return
|
|
1391
|
+
`}var $a=class extends Ne{constructor(){super(),jE(this,Jr,void 0),JE(this,Jr,this.shadowRoot.querySelector("slot")),pc(this,Jr).innerHTML=`${mc(this)}`}static get observedAttributes(){return[...super.observedAttributes,...Wp,"disabled"]}connectedCallback(){let{style:e}=te(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",b("playback time"));let t=r=>{let{key:n}=r;if(!Fp.includes(n)){this.removeEventListener("keyup",t);return}this.toggleTimeDisplay()};this.addEventListener("keydown",r=>{let{metaKey:n,altKey:o,key:s}=r;if(n||o||!Fp.includes(s)){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){Wp.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 R(this,rr.REMAINING)}set remaining(e){M(this,rr.REMAINING,e)}get showDuration(){return R(this,rr.SHOW_DURATION)}set showDuration(e){M(this,rr.SHOW_DURATION,e)}get noToggle(){return R(this,rr.NO_TOGGLE)}set noToggle(e){M(this,rr.NO_TOGGLE,e)}get mediaDuration(){return V(this,a.MEDIA_DURATION)}set mediaDuration(e){F(this,a.MEDIA_DURATION,e)}get mediaCurrentTime(){return V(this,a.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){F(this,a.MEDIA_CURRENT_TIME,e)}get mediaSeekable(){let e=this.getAttribute(a.MEDIA_SEEKABLE);if(e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(a.MEDIA_SEEKABLE);return}this.setAttribute(a.MEDIA_SEEKABLE,e.join(":"))}update(){let e=mc(this);ig(this),e!==pc(this,Jr).innerHTML&&(pc(this,Jr).innerHTML=e)}};Jr=new WeakMap;$a.getSlotTemplateHTML=rg;c.customElements.get("media-time-display")||c.customElements.define("media-time-display",$a);var qp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ae=(i,e,t)=>(qp(i,e,"read from private field"),t?t.call(i):e.get(i)),wt=(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)},Ke=(i,e,t,r)=>(qp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ng=(i,e,t,r)=>({set _(n){Ke(i,e,n,t)},get _(){return Ae(i,e,r)}}),en,Va,tn,Ko,Ba,Wa,Fa,rn,nr,Ka,qa=class{constructor(e,t,r){wt(this,en,void 0),wt(this,Va,void 0),wt(this,tn,void 0),wt(this,Ko,void 0),wt(this,Ba,void 0),wt(this,Wa,void 0),wt(this,Fa,void 0),wt(this,rn,void 0),wt(this,nr,0),wt(this,Ka,(n=performance.now())=>{Ke(this,nr,requestAnimationFrame(Ae(this,Ka))),Ke(this,Ko,performance.now()-Ae(this,tn));let o=1e3/this.fps;if(Ae(this,Ko)>o){Ke(this,tn,n-Ae(this,Ko)%o);let s=1e3/((n-Ae(this,Va))/++ng(this,Ba)._),l=(n-Ae(this,Wa))/1e3/this.duration,d=Ae(this,Fa)+l*this.playbackRate;d-Ae(this,en).valueAsNumber>0?Ke(this,rn,this.playbackRate/this.duration/s):(Ke(this,rn,.995*Ae(this,rn)),d=Ae(this,en).valueAsNumber+Ae(this,rn)),this.callback(d)}}),Ke(this,en,e),this.callback=t,this.fps=r}start(){Ae(this,nr)===0&&(Ke(this,tn,performance.now()),Ke(this,Va,Ae(this,tn)),Ke(this,Ba,0),Ae(this,Ka).call(this))}stop(){Ae(this,nr)!==0&&(cancelAnimationFrame(Ae(this,nr)),Ke(this,nr,0))}update({start:e,duration:t,playbackRate:r}){let n=e-Ae(this,en).valueAsNumber,o=Math.abs(t-this.duration);(n>0||n<-.03||o>=.5)&&this.callback(e),Ke(this,Fa,e),Ke(this,Wa,performance.now()),this.duration=t,this.playbackRate=r}};en=new WeakMap;Va=new WeakMap;tn=new WeakMap;Ko=new WeakMap;Ba=new WeakMap;Wa=new WeakMap;Fa=new WeakMap;rn=new WeakMap;nr=new WeakMap;Ka=new WeakMap;var gc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},he=(i,e,t)=>(gc(i,e,"read from private field"),t?t.call(i):e.get(i)),ge=(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)},Xe=(i,e,t,r)=>(gc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ie=(i,e,t)=>(gc(i,e,"access private method"),t),nn,or,Ya,Go,Qa,za,zo,Yo,on,sn,an,qo,bc,Gp,vc,Za,_c,Xa,yc,ja,Tc,fc,zp,Qo,Ja,Ec,Yp,og="video not loaded, unknown time.",sg=i=>{let e=i.range,t=Wi(+Qp(i)),r=Wi(+i.mediaSeekableEnd),n=t&&r?`${t} of ${r}`:og;e.setAttribute("aria-valuetext",n)};function ag(i){return`
|
|
1392
1392
|
<style>
|
|
1393
1393
|
:host {
|
|
1394
1394
|
--media-box-border-radius: 4px;
|
|
@@ -1605,7 +1605,7 @@ bp-player[has-error] {
|
|
|
1605
1605
|
|
|
1606
1606
|
</slot>
|
|
1607
1607
|
</div>
|
|
1608
|
-
`}var Ga=(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 n=(e-t)/(r-t);return Math.max(0,Math.min(n,1))},Qp=(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},Zo=class extends yt{constructor(){super(),ge(this,an),ge(this,bc),ge(this,Za),ge(this,Xa),ge(this,ja),ge(this,fc),ge(this,Qo),ge(this,Ec),ge(this,nn,void 0),ge(this,or,void 0),ge(this,Ya,void 0),ge(this,Go,void 0),ge(this,Qa,void 0),ge(this,za,void 0),ge(this,zo,void 0),ge(this,Yo,void 0),ge(this,on,void 0),ge(this,sn,void 0),ge(this,vc,r=>{this.dragging||(xr(r)&&(this.range.valueAsNumber=r),he(this,sn)||this.updateBar())}),this.shadowRoot.querySelector("#track").insertAdjacentHTML("afterbegin",'<div id="buffered" part="buffered"></div>'),Xe(this,Ya,this.shadowRoot.querySelectorAll('[part~="box"]')),Xe(this,Qa,this.shadowRoot.querySelector('[part~="preview-box"]')),Xe(this,za,this.shadowRoot.querySelector('[part~="current-box"]'));let t=getComputedStyle(this);Xe(this,zo,parseInt(t.getPropertyValue("--media-box-padding-left"))),Xe(this,Yo,parseInt(t.getPropertyValue("--media-box-padding-right"))),Xe(this,or,new qa(this.range,he(this,vc),60))}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PAUSED,a.MEDIA_DURATION,a.MEDIA_SEEKABLE,a.MEDIA_CURRENT_TIME,a.MEDIA_PREVIEW_IMAGE,a.MEDIA_PREVIEW_TIME,a.MEDIA_PREVIEW_CHAPTER,a.MEDIA_BUFFERED,a.MEDIA_PLAYBACK_RATE,a.MEDIA_LOADING,a.MEDIA_ENDED]}connectedCallback(){var e;super.connectedCallback(),this.range.setAttribute("aria-label",b("seek")),
|
|
1608
|
+
`}var Ga=(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 n=(e-t)/(r-t);return Math.max(0,Math.min(n,1))},Qp=(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},Zo=class extends yt{constructor(){super(),ge(this,an),ge(this,bc),ge(this,Za),ge(this,Xa),ge(this,ja),ge(this,fc),ge(this,Qo),ge(this,Ec),ge(this,nn,void 0),ge(this,or,void 0),ge(this,Ya,void 0),ge(this,Go,void 0),ge(this,Qa,void 0),ge(this,za,void 0),ge(this,zo,void 0),ge(this,Yo,void 0),ge(this,on,void 0),ge(this,sn,void 0),ge(this,vc,r=>{this.dragging||(xr(r)&&(this.range.valueAsNumber=r),he(this,sn)||this.updateBar())}),this.shadowRoot.querySelector("#track").insertAdjacentHTML("afterbegin",'<div id="buffered" part="buffered"></div>'),Xe(this,Ya,this.shadowRoot.querySelectorAll('[part~="box"]')),Xe(this,Qa,this.shadowRoot.querySelector('[part~="preview-box"]')),Xe(this,za,this.shadowRoot.querySelector('[part~="current-box"]'));let t=getComputedStyle(this);Xe(this,zo,parseInt(t.getPropertyValue("--media-box-padding-left"))),Xe(this,Yo,parseInt(t.getPropertyValue("--media-box-padding-right"))),Xe(this,or,new qa(this.range,he(this,vc),60))}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PAUSED,a.MEDIA_DURATION,a.MEDIA_SEEKABLE,a.MEDIA_CURRENT_TIME,a.MEDIA_PREVIEW_IMAGE,a.MEDIA_PREVIEW_TIME,a.MEDIA_PREVIEW_CHAPTER,a.MEDIA_BUFFERED,a.MEDIA_PLAYBACK_RATE,a.MEDIA_LOADING,a.MEDIA_ENDED]}connectedCallback(){var e;super.connectedCallback(),this.range.setAttribute("aria-label",b("seek")),Ie(this,an,qo).call(this),Xe(this,nn,this.getRootNode()),(e=he(this,nn))==null||e.addEventListener("transitionstart",this)}disconnectedCallback(){var e;super.disconnectedCallback(),Ie(this,an,qo).call(this),(e=he(this,nn))==null||e.removeEventListener("transitionstart",this),Xe(this,nn,null)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),t!=r&&(e===a.MEDIA_CURRENT_TIME||e===a.MEDIA_PAUSED||e===a.MEDIA_ENDED||e===a.MEDIA_LOADING||e===a.MEDIA_DURATION||e===a.MEDIA_SEEKABLE?(he(this,or).update({start:Ga(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),Ie(this,an,qo).call(this),sg(this)):e===a.MEDIA_BUFFERED&&this.updateBufferedBar(),(e===a.MEDIA_DURATION||e===a.MEDIA_SEEKABLE)&&(this.mediaChaptersCues=he(this,on),this.updateBar()))}get mediaChaptersCues(){return he(this,on)}set mediaChaptersCues(e){var t;Xe(this,on,e),this.updateSegments((t=he(this,on))==null?void 0:t.map(r=>({start:Ga(this,r.startTime),end:Ga(this,r.endTime)})))}get mediaPaused(){return R(this,a.MEDIA_PAUSED)}set mediaPaused(e){M(this,a.MEDIA_PAUSED,e)}get mediaLoading(){return R(this,a.MEDIA_LOADING)}set mediaLoading(e){M(this,a.MEDIA_LOADING,e)}get mediaDuration(){return V(this,a.MEDIA_DURATION)}set mediaDuration(e){F(this,a.MEDIA_DURATION,e)}get mediaCurrentTime(){return V(this,a.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){F(this,a.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return V(this,a.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){F(this,a.MEDIA_PLAYBACK_RATE,e)}get mediaBuffered(){let e=this.getAttribute(a.MEDIA_BUFFERED);return e?e.split(" ").map(t=>t.split(":").map(r=>+r)):[]}set mediaBuffered(e){if(!e){this.removeAttribute(a.MEDIA_BUFFERED);return}let t=e.map(r=>r.join(":")).join(" ");this.setAttribute(a.MEDIA_BUFFERED,t)}get mediaSeekable(){let e=this.getAttribute(a.MEDIA_SEEKABLE);if(e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(a.MEDIA_SEEKABLE);return}this.setAttribute(a.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 O(this,a.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){N(this,a.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return V(this,a.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){F(this,a.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return R(this,a.MEDIA_ENDED)}set mediaEnded(e){M(this,a.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 o=this.mediaCurrentTime,[,s=this.mediaSeekableStart]=(e=t.find(([l,d])=>l<=o&&o<=d))!=null?e:[];r=Ga(this,s)}let{style:n}=te(this.shadowRoot,"#buffered");n.setProperty("width",`${r*100}%`)}updateCurrentBox(){if(!this.shadowRoot.querySelector('slot[name="current"]').assignedElements().length)return;let t=te(this.shadowRoot,"#current-rail"),r=te(this.shadowRoot,'[part~="current-box"]'),n=Ie(this,Za,_c).call(this,he(this,za)),o=Ie(this,Xa,yc).call(this,n,this.range.valueAsNumber),s=Ie(this,ja,Tc).call(this,n,this.range.valueAsNumber);t.style.transform=`translateX(${o})`,t.style.setProperty("--_range-width",`${n.range.width}`),r.style.setProperty("--_box-shift",`${s}`),r.style.setProperty("--_box-width",`${n.box.width}px`),r.style.setProperty("visibility","initial")}handleEvent(e){switch(super.handleEvent(e),e.type){case"input":Ie(this,Ec,Yp).call(this);break;case"pointermove":Ie(this,fc,zp).call(this,e);break;case"pointerup":he(this,sn)&&Xe(this,sn,!1);break;case"pointerdown":Xe(this,sn,!0);break;case"pointerleave":Ie(this,Qo,Ja).call(this,null);break;case"transitionstart":Ce(e.target,this)&&setTimeout(()=>Ie(this,an,qo).call(this),0);break}}};nn=new WeakMap;or=new WeakMap;Ya=new WeakMap;Go=new WeakMap;Qa=new WeakMap;za=new WeakMap;zo=new WeakMap;Yo=new WeakMap;on=new WeakMap;sn=new WeakMap;an=new WeakSet;qo=function(){Ie(this,bc,Gp).call(this)?he(this,or).start():he(this,or).stop()};bc=new WeakSet;Gp=function(){return this.isConnected&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded&&this.mediaSeekableEnd>0&&Fs(this)};vc=new WeakMap;Za=new WeakSet;_c=function(i){var e;let r=((e=this.getAttribute("bounds")?mt(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?e:this).getBoundingClientRect(),n=this.range.getBoundingClientRect(),o=i.offsetWidth,s=-(n.left-r.left-o/2),l=r.right-n.left-o/2;return{box:{width:o,min:s,max:l},bounds:r,range:n}};Xa=new WeakSet;yc=function(i,e){let t=`${e*100}%`,{width:r,min:n,max:o}=i.box;if(!r)return t;if(Number.isNaN(n)||(t=`max(${`calc(1 / var(--_range-width) * 100 * ${n}% + var(--media-box-padding-left))`}, ${t})`),!Number.isNaN(o)){let l=`calc(1 / var(--_range-width) * 100 * ${o}% - var(--media-box-padding-right))`;t=`min(${t}, ${l})`}return t};ja=new WeakSet;Tc=function(i,e){let{width:t,min:r,max:n}=i.box,o=e*i.range.width;if(o<r+he(this,zo)){let s=i.range.left-i.bounds.left-he(this,zo);return`${o-t/2+s}px`}if(o>n-he(this,Yo)){let s=i.bounds.right-i.range.right-he(this,Yo);return`${o+t/2-s-i.range.width}px`}return 0};fc=new WeakSet;zp=function(i){let e=[...he(this,Ya)].some(p=>i.composedPath().includes(p));if(!this.dragging&&(e||!i.composedPath().includes(this))){Ie(this,Qo,Ja).call(this,null);return}let t=this.mediaSeekableEnd;if(!t)return;let r=te(this.shadowRoot,"#preview-rail"),n=te(this.shadowRoot,'[part~="preview-box"]'),o=Ie(this,Za,_c).call(this,he(this,Qa)),s=(i.clientX-o.range.left)/o.range.width;s=Math.max(0,Math.min(1,s));let l=Ie(this,Xa,yc).call(this,o,s),d=Ie(this,ja,Tc).call(this,o,s);r.style.transform=`translateX(${l})`,r.style.setProperty("--_range-width",`${o.range.width}`),n.style.setProperty("--_box-shift",`${d}`),n.style.setProperty("--_box-width",`${o.box.width}px`);let h=Math.round(he(this,Go))-Math.round(s*t);Math.abs(h)<1&&s>.01&&s<.99||(Xe(this,Go,s*t),Ie(this,Qo,Ja).call(this,he(this,Go)))};Qo=new WeakSet;Ja=function(i){this.dispatchEvent(new c.CustomEvent(y.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:i}))};Ec=new WeakSet;Yp=function(){he(this,or).stop();let i=Qp(this);this.dispatchEvent(new c.CustomEvent(y.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:i}))};Zo.shadowRootOptions={mode:"open"};Zo.getContainerTemplateHTML=ag;c.customElements.get("media-time-range")||c.customElements.define("media-time-range",Zo);var lg=1,dg=i=>i.mediaMuted?0:i.mediaVolume,cg=i=>`${Math.round(i*100)}%`,Ac=class extends yt{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_VOLUME,a.MEDIA_MUTED,a.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.addEventListener("input",()=>{let e=this.range.value,t=new c.CustomEvent(y.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)})}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",b("volume"))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),(e===a.MEDIA_VOLUME||e===a.MEDIA_MUTED)&&(this.range.valueAsNumber=dg(this),this.range.setAttribute("aria-valuetext",cg(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return V(this,a.MEDIA_VOLUME,lg)}set mediaVolume(e){F(this,a.MEDIA_VOLUME,e)}get mediaMuted(){return R(this,a.MEDIA_MUTED)}set mediaMuted(e){M(this,a.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return O(this,a.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){N(this,a.MEDIA_VOLUME_UNAVAILABLE,e)}};c.customElements.get("media-volume-range")||c.customElements.define("media-volume-range",Ac);function ug(i){return`
|
|
1609
1609
|
<style>
|
|
1610
1610
|
:host {
|
|
1611
1611
|
min-width: 4ch;
|
|
@@ -1634,7 +1634,7 @@ bp-player[has-error] {
|
|
|
1634
1634
|
<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"/>
|
|
1635
1635
|
</svg>
|
|
1636
1636
|
</div>
|
|
1637
|
-
`}function hg(){return b("Loop")}var Xo=class extends Y{constructor(){super(...arguments),this.container=null}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_LOOP]}connectedCallback(){var e;super.connectedCallback(),this.container=((e=this.shadowRoot)==null?void 0:e.querySelector("#icon"))||null,this.container&&(this.container.textContent=b("Loop"))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_LOOP&&this.container&&this.setAttribute("aria-checked",this.mediaLoop?"true":"false")}get mediaLoop(){return R(this,a.MEDIA_LOOP)}set mediaLoop(e){M(this,a.MEDIA_LOOP,e)}handleClick(){let e=!this.mediaLoop,t=new c.CustomEvent(y.MEDIA_LOOP_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};Xo.getSlotTemplateHTML=ug;Xo.getTooltipContentHTML=hg;c.customElements.get("media-loop-button")||c.customElements.define("media-loop-button",Xo);function Zp({anchor:i,floating:e,placement:t}){let r=pg({anchor:i,floating:e}),{x:n,y:o}=vg(r,t);return{x:n,y:o}}function pg({anchor:i,floating:e}){return{anchor:mg(i,e.offsetParent),floating:{x:0,y:0,width:e.offsetWidth,height:e.offsetHeight}}}function mg(i,e){var t;let r=i.getBoundingClientRect(),n=(t=e==null?void 0:e.getBoundingClientRect())!=null?t:{x:0,y:0};return{x:r.x-n.x,y:r.y-n.y,width:r.width,height:r.height}}function vg({anchor:i,floating:e},t){let r=fg(t)==="x"?"y":"x",n=r==="y"?"height":"width",o=Xp(t),s=i.x+i.width/2-e.width/2,l=i.y+i.height/2-e.height/2,d=i[n]/2-e[n]/2,h;switch(o){case"top":h={x:s,y:i.y-e.height};break;case"bottom":h={x:s,y:i.y+i.height};break;case"right":h={x:i.x+i.width,y:l};break;case"left":h={x:i.x-e.width,y:l};break;default:h={x:i.x,y:i.y}}switch(t.split("-")[1]){case"start":h[r]-=d;break;case"end":h[r]+=d;break}return h}function Xp(i){return i.split("-")[0]}function fg(i){return["top","bottom"].includes(Xp(i))?"y":"x"}var mi=class extends Event{constructor({action:e="auto",relatedTarget:t,...r}){super("invoke",r),this.action=e,this.relatedTarget=t}},el=class extends Event{constructor({newState:e,oldState:t,...r}){super("toggle",r),this.newState=e,this.oldState=t}};var Oc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Q=(i,e,t)=>(Oc(i,e,"read from private field"),t?t.call(i):e.get(i)),j=(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)},
|
|
1637
|
+
`}function hg(){return b("Loop")}var Xo=class extends Y{constructor(){super(...arguments),this.container=null}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_LOOP]}connectedCallback(){var e;super.connectedCallback(),this.container=((e=this.shadowRoot)==null?void 0:e.querySelector("#icon"))||null,this.container&&(this.container.textContent=b("Loop"))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_LOOP&&this.container&&this.setAttribute("aria-checked",this.mediaLoop?"true":"false")}get mediaLoop(){return R(this,a.MEDIA_LOOP)}set mediaLoop(e){M(this,a.MEDIA_LOOP,e)}handleClick(){let e=!this.mediaLoop,t=new c.CustomEvent(y.MEDIA_LOOP_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};Xo.getSlotTemplateHTML=ug;Xo.getTooltipContentHTML=hg;c.customElements.get("media-loop-button")||c.customElements.define("media-loop-button",Xo);function Zp({anchor:i,floating:e,placement:t}){let r=pg({anchor:i,floating:e}),{x:n,y:o}=vg(r,t);return{x:n,y:o}}function pg({anchor:i,floating:e}){return{anchor:mg(i,e.offsetParent),floating:{x:0,y:0,width:e.offsetWidth,height:e.offsetHeight}}}function mg(i,e){var t;let r=i.getBoundingClientRect(),n=(t=e==null?void 0:e.getBoundingClientRect())!=null?t:{x:0,y:0};return{x:r.x-n.x,y:r.y-n.y,width:r.width,height:r.height}}function vg({anchor:i,floating:e},t){let r=fg(t)==="x"?"y":"x",n=r==="y"?"height":"width",o=Xp(t),s=i.x+i.width/2-e.width/2,l=i.y+i.height/2-e.height/2,d=i[n]/2-e[n]/2,h;switch(o){case"top":h={x:s,y:i.y-e.height};break;case"bottom":h={x:s,y:i.y+i.height};break;case"right":h={x:i.x+i.width,y:l};break;case"left":h={x:i.x-e.width,y:l};break;default:h={x:i.x,y:i.y}}switch(t.split("-")[1]){case"start":h[r]-=d;break;case"end":h[r]+=d;break}return h}function Xp(i){return i.split("-")[0]}function fg(i){return["top","bottom"].includes(Xp(i))?"y":"x"}var mi=class extends Event{constructor({action:e="auto",relatedTarget:t,...r}){super("invoke",r),this.action=e,this.relatedTarget=t}},el=class extends Event{constructor({newState:e,oldState:t,...r}){super("toggle",r),this.newState=e,this.oldState=t}};var Oc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Q=(i,e,t)=>(Oc(i,e,"read from private field"),t?t.call(i):e.get(i)),j=(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)},It=(i,e,t,r)=>(Oc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),J=(i,e,t)=>(Oc(i,e,"access private method"),t),Ct,ar,vi,tl,il,lr,es,Sc,jp,ol,Nc,sl,rl,kc,Lc,Jp,wc,em,Ic,tm,ln,dn,cn,ts,al,Uc,Cc,im,Hc,rm,Rc,nm,$c,om,Mc,sm,xc,am,jo,ll,Pc,lm,Jo,dl,nl,Dc;function Rt({type:i,text:e,value:t,checked:r}){let n=ne.createElement("media-chrome-menu-item");n.type=i??"",n.part.add("menu-item"),i&&n.part.add(i),n.value=t,n.checked=r;let o=ne.createElement("span");return o.textContent=e,n.append(o),n}function lt(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 Eg(i){return`
|
|
1638
1638
|
<style>
|
|
1639
1639
|
:host {
|
|
1640
1640
|
font: var(--media-font,
|
|
@@ -1809,7 +1809,7 @@ bp-player[has-error] {
|
|
|
1809
1809
|
<slot></slot>
|
|
1810
1810
|
</div>
|
|
1811
1811
|
<slot name="checked-indicator" hidden></slot>
|
|
1812
|
-
`}var sr={STYLE:"style",HIDDEN:"hidden",DISABLED:"disabled",ANCHOR:"anchor"},pe=class extends c.HTMLElement{constructor(){if(super(),j(this,Sc),j(this,ol),j(this,rl),j(this,Lc),j(this,Ic),j(this,wc),j(this,cn),j(this,al),j(this,Cc),j(this,Hc),j(this,Rc),j(this,$c),j(this,Mc),j(this,xc),j(this,jo),j(this,Pc),j(this,Jo),j(this,nl),j(this,Ct,null),j(this,ar,null),j(this,vi,null),j(this,tl,new Set),j(this,il,void 0),j(this,lr,!1),j(this,es,null),j(this,sl,()=>{let e=Q(this,tl),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}));wt(this,tl,t)}),j(this,ln,()=>{J(this,cn,ts).call(this),J(this,al,Uc).call(this,!1)}),j(this,dn,()=>{J(this,cn,ts).call(this)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=ie(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),wt(this,il,new MutationObserver(Q(this,sl))),Q(this,il).observe(this.defaultSlot,{childList:!0})}static get observedAttributes(){return[sr.DISABLED,sr.HIDDEN,sr.STYLE,sr.ANCHOR,H.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":J(this,Sc,jp).call(this,e);break;case"invoke":J(this,Lc,Jp).call(this,e);break;case"click":J(this,Cc,im).call(this,e);break;case"toggle":J(this,Rc,nm).call(this,e);break;case"focusout":J(this,Mc,sm).call(this,e);break;case"keydown":J(this,xc,am).call(this,e);break}}connectedCallback(){var e,t;wt(this,es,po(this.shadowRoot,":host")),J(this,rl,kc).call(this),this.hasAttribute("disabled")||this.enable(),this.role||(this.role="menu"),wt(this,Ct,Bs(this)),(t=(e=Q(this,Ct))==null?void 0:e.associateElement)==null||t.call(e,this),this.hidden||($t(is(this),Q(this,ln)),$t(this,Q(this,dn))),J(this,ol,Nc).call(this)}disconnectedCallback(){var e,t;Bt(is(this),Q(this,ln)),Bt(this,Q(this,dn)),this.disable(),(t=(e=Q(this,Ct))==null?void 0:e.unassociateElement)==null||t.call(e,this),wt(this,Ct,null)}attributeChangedCallback(e,t,r){var n,o,s,l;e===sr.HIDDEN&&r!==t?(Q(this,lr)||wt(this,lr,!0),this.hidden?J(this,wc,tm).call(this):J(this,Ic,em).call(this),this.dispatchEvent(new el({oldState:this.hidden?"open":"closed",newState:this.hidden?"closed":"open",bubbles:!0}))):e===H.MEDIA_CONTROLLER?(t&&((o=(n=Q(this,Ct))==null?void 0:n.unassociateElement)==null||o.call(n,this),wt(this,Ct,null)),r&&this.isConnected&&(wt(this,Ct,Bs(this)),(l=(s=Q(this,Ct))==null?void 0:s.associateElement)==null||l.call(s,this))):e===sr.DISABLED&&r!==t?r==null?this.enable():this.disable():e===sr.STYLE&&r!==t&&J(this,rl,kc).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=Fi(this))==null?void 0:e.querySelector(`#${this.anchor}`):null}get items(){return this.defaultSlot.assignedElements({flatten:!0}).filter(gg)}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&&J(this,nl,Dc).call(this,t)}focus(){if(wt(this,ar,ho()),this.items.length){J(this,Jo,dl).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=J(this,jo,ll).call(this,e);r&&(J(this,nl,Dc).call(this,r,r.type==="checkbox"),Q(this,vi)&&!this.hidden&&((t=Q(this,ar))==null||t.focus(),this.hidden=!0))}get keysUsed(){return["Enter","Escape","Tab"," ","ArrowDown","ArrowUp","Home","End"]}handleMove(e){var t,r;let{key:n}=e,o=this.items,s=(r=(t=J(this,jo,ll).call(this,e))!=null?t:J(this,Pc,lm).call(this))!=null?r:o[0],l=o.indexOf(s),d=Math.max(0,l);n==="ArrowDown"?d++:n==="ArrowUp"?d--:e.key==="Home"?d=0:e.key==="End"&&(d=o.length-1),d<0&&(d=o.length-1),d>o.length-1&&(d=0),J(this,Jo,dl).call(this,o[d]),o[d].focus()}};Ct=new WeakMap;ar=new WeakMap;vi=new WeakMap;tl=new WeakMap;il=new WeakMap;lr=new WeakMap;es=new WeakMap;Sc=new WeakSet;jp=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)&&J(this,ol,Nc).call(this),e.name||Q(this,sl).call(this)};ol=new WeakSet;Nc=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};sl=new WeakMap;rl=new WeakSet;kc=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")};Lc=new WeakSet;Jp=function(i){wt(this,vi,i.relatedTarget),Ce(this,i.relatedTarget)||(this.hidden=!this.hidden)};Ic=new WeakSet;em=function(){var i;(i=Q(this,vi))==null||i.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",()=>this.focus(),{once:!0}),$t(is(this),Q(this,ln)),$t(this,Q(this,dn))};wc=new WeakSet;tm=function(){var i;(i=Q(this,vi))==null||i.setAttribute("aria-expanded","false"),Bt(is(this),Q(this,ln)),Bt(this,Q(this,dn))};ln=new WeakMap;dn=new WeakMap;cn=new WeakSet;ts=function(i){if(this.hasAttribute("mediacontroller")&&!this.anchor||this.hidden||!this.anchorElement)return;let{x:e,y:t}=Zp({anchor:this.anchorElement,floating:this,placement:"top-start"});i??(i=this.offsetWidth);let n=is(this).getBoundingClientRect(),o=n.width-e-i,s=n.height-t-this.offsetHeight,{style:l}=Q(this,es);l.setProperty("position","absolute"),l.setProperty("right",`${Math.max(0,o)}px`),l.setProperty("--_menu-bottom",`${s}px`);let d=getComputedStyle(this),p=l.getPropertyValue("--_menu-bottom")===d.bottom?s:parseFloat(d.bottom),v=n.height-p-parseFloat(d.marginBottom);this.style.setProperty("--_menu-max-height",`${v}px`)};al=new WeakSet;Uc=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,es);if(i||r.setProperty("--media-menu-transition-in","none"),t){let n=t.offsetHeight,o=Math.max(t.offsetWidth,e.offsetWidth);this.style.setProperty("min-width",`${o}px`),this.style.setProperty("min-height",`${n}px`),J(this,cn,ts).call(this,o)}else this.style.removeProperty("min-width"),this.style.removeProperty("min-height"),J(this,cn,ts).call(this);r.removeProperty("--media-menu-transition-in")};Cc=new WeakSet;im=function(i){var e;if(i.stopPropagation(),i.composedPath().includes(Q(this,Hc,rm))){(e=Q(this,ar))==null||e.focus(),this.hidden=!0;return}let t=J(this,jo,ll).call(this,i);!t||t.hasAttribute("disabled")||(J(this,Jo,dl).call(this,t),this.handleSelect(i))};Hc=new WeakSet;rm=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"]'))};Rc=new WeakSet;nm=function(i){if(i.target===this)return;J(this,$c,om).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 mi({relatedTarget:t}));for(let t of e)t.setAttribute("aria-expanded",`${!t.submenuElement.hidden}`);J(this,al,Uc).call(this,!0)};$c=new WeakSet;om=function(){let e=this.querySelector('[role="menuitem"] > [role="menu"]:not([hidden])');this.container.classList.toggle("has-expanded",!!e)};Mc=new WeakSet;sm=function(i){var e;Ce(this,i.relatedTarget)||(Q(this,lr)&&((e=Q(this,ar))==null||e.focus()),Q(this,vi)&&Q(this,vi)!==i.relatedTarget&&!this.hidden&&(this.hidden=!0))};xc=new WeakSet;am=function(i){var e,t,r,n,o;let{key:s,ctrlKey:l,altKey:d,metaKey:h}=i;if(!(l||d||h)&&this.keysUsed.includes(s))if(i.preventDefault(),i.stopPropagation(),s==="Tab"){if(Q(this,lr)){this.hidden=!0;return}i.shiftKey?(t=(e=this.previousElementSibling)==null?void 0:e.focus)==null||t.call(e):(n=(r=this.nextElementSibling)==null?void 0:r.focus)==null||n.call(r),this.blur()}else s==="Escape"?((o=Q(this,ar))==null||o.focus(),Q(this,lr)&&(this.hidden=!0)):s==="Enter"||s===" "?this.handleSelect(i):this.handleMove(i)};jo=new WeakSet;ll=function(i){return i.composedPath().find(e=>["menuitemradio","menuitemcheckbox"].includes(e.role))};Pc=new WeakSet;lm=function(){return this.items.find(i=>i.tabIndex===0)};Jo=new WeakSet;dl=function(i){for(let e of this.items)e.tabIndex=e===i?0:-1};nl=new WeakSet;Dc=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,n)=>r!=t[n])&&this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))};pe.shadowRootOptions={mode:"open"};pe.getTemplateHTML=Eg;function gg(i){return["menuitem","menuitemradio","menuitemcheckbox"].includes(i==null?void 0:i.role)}function is(i){var e;return(e=i.getAttribute("bounds")?mt(i,`#${i.getAttribute("bounds")}`):ee(i)||i.parentElement)!=null?e:i}c.customElements.get("media-chrome-menu")||c.customElements.define("media-chrome-menu",pe);var qc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Mt=(i,e,t)=>(qc(i,e,"read from private field"),t?t.call(i):e.get(i)),Kt=(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)},Bc=(i,e,t,r)=>(qc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),dt=(i,e,t)=>(qc(i,e,"access private method"),t),cl,ns,Vc,dm,hl,Gc,zc,cm,xt,un,os,Wc,um,ul,Fc;function bg(i){return`
|
|
1812
|
+
`}var sr={STYLE:"style",HIDDEN:"hidden",DISABLED:"disabled",ANCHOR:"anchor"},pe=class extends c.HTMLElement{constructor(){if(super(),j(this,Sc),j(this,ol),j(this,rl),j(this,Lc),j(this,wc),j(this,Ic),j(this,cn),j(this,al),j(this,Cc),j(this,Hc),j(this,Rc),j(this,$c),j(this,Mc),j(this,xc),j(this,jo),j(this,Pc),j(this,Jo),j(this,nl),j(this,Ct,null),j(this,ar,null),j(this,vi,null),j(this,tl,new Set),j(this,il,void 0),j(this,lr,!1),j(this,es,null),j(this,sl,()=>{let e=Q(this,tl),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}));It(this,tl,t)}),j(this,ln,()=>{J(this,cn,ts).call(this),J(this,al,Uc).call(this,!1)}),j(this,dn,()=>{J(this,cn,ts).call(this)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=ie(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),It(this,il,new MutationObserver(Q(this,sl))),Q(this,il).observe(this.defaultSlot,{childList:!0})}static get observedAttributes(){return[sr.DISABLED,sr.HIDDEN,sr.STYLE,sr.ANCHOR,H.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":J(this,Sc,jp).call(this,e);break;case"invoke":J(this,Lc,Jp).call(this,e);break;case"click":J(this,Cc,im).call(this,e);break;case"toggle":J(this,Rc,nm).call(this,e);break;case"focusout":J(this,Mc,sm).call(this,e);break;case"keydown":J(this,xc,am).call(this,e);break}}connectedCallback(){var e,t;It(this,es,po(this.shadowRoot,":host")),J(this,rl,kc).call(this),this.hasAttribute("disabled")||this.enable(),this.role||(this.role="menu"),It(this,Ct,Vs(this)),(t=(e=Q(this,Ct))==null?void 0:e.associateElement)==null||t.call(e,this),this.hidden||($t(is(this),Q(this,ln)),$t(this,Q(this,dn))),J(this,ol,Nc).call(this)}disconnectedCallback(){var e,t;Vt(is(this),Q(this,ln)),Vt(this,Q(this,dn)),this.disable(),(t=(e=Q(this,Ct))==null?void 0:e.unassociateElement)==null||t.call(e,this),It(this,Ct,null)}attributeChangedCallback(e,t,r){var n,o,s,l;e===sr.HIDDEN&&r!==t?(Q(this,lr)||It(this,lr,!0),this.hidden?J(this,Ic,tm).call(this):J(this,wc,em).call(this),this.dispatchEvent(new el({oldState:this.hidden?"open":"closed",newState:this.hidden?"closed":"open",bubbles:!0}))):e===H.MEDIA_CONTROLLER?(t&&((o=(n=Q(this,Ct))==null?void 0:n.unassociateElement)==null||o.call(n,this),It(this,Ct,null)),r&&this.isConnected&&(It(this,Ct,Vs(this)),(l=(s=Q(this,Ct))==null?void 0:s.associateElement)==null||l.call(s,this))):e===sr.DISABLED&&r!==t?r==null?this.enable():this.disable():e===sr.STYLE&&r!==t&&J(this,rl,kc).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=Fi(this))==null?void 0:e.querySelector(`#${this.anchor}`):null}get items(){return this.defaultSlot.assignedElements({flatten:!0}).filter(gg)}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&&J(this,nl,Dc).call(this,t)}focus(){if(It(this,ar,ho()),this.items.length){J(this,Jo,dl).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=J(this,jo,ll).call(this,e);r&&(J(this,nl,Dc).call(this,r,r.type==="checkbox"),Q(this,vi)&&!this.hidden&&((t=Q(this,ar))==null||t.focus(),this.hidden=!0))}get keysUsed(){return["Enter","Escape","Tab"," ","ArrowDown","ArrowUp","Home","End"]}handleMove(e){var t,r;let{key:n}=e,o=this.items,s=(r=(t=J(this,jo,ll).call(this,e))!=null?t:J(this,Pc,lm).call(this))!=null?r:o[0],l=o.indexOf(s),d=Math.max(0,l);n==="ArrowDown"?d++:n==="ArrowUp"?d--:e.key==="Home"?d=0:e.key==="End"&&(d=o.length-1),d<0&&(d=o.length-1),d>o.length-1&&(d=0),J(this,Jo,dl).call(this,o[d]),o[d].focus()}};Ct=new WeakMap;ar=new WeakMap;vi=new WeakMap;tl=new WeakMap;il=new WeakMap;lr=new WeakMap;es=new WeakMap;Sc=new WeakSet;jp=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)&&J(this,ol,Nc).call(this),e.name||Q(this,sl).call(this)};ol=new WeakSet;Nc=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};sl=new WeakMap;rl=new WeakSet;kc=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")};Lc=new WeakSet;Jp=function(i){It(this,vi,i.relatedTarget),Ce(this,i.relatedTarget)||(this.hidden=!this.hidden)};wc=new WeakSet;em=function(){var i;(i=Q(this,vi))==null||i.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",()=>this.focus(),{once:!0}),$t(is(this),Q(this,ln)),$t(this,Q(this,dn))};Ic=new WeakSet;tm=function(){var i;(i=Q(this,vi))==null||i.setAttribute("aria-expanded","false"),Vt(is(this),Q(this,ln)),Vt(this,Q(this,dn))};ln=new WeakMap;dn=new WeakMap;cn=new WeakSet;ts=function(i){if(this.hasAttribute("mediacontroller")&&!this.anchor||this.hidden||!this.anchorElement)return;let{x:e,y:t}=Zp({anchor:this.anchorElement,floating:this,placement:"top-start"});i??(i=this.offsetWidth);let n=is(this).getBoundingClientRect(),o=n.width-e-i,s=n.height-t-this.offsetHeight,{style:l}=Q(this,es);l.setProperty("position","absolute"),l.setProperty("right",`${Math.max(0,o)}px`),l.setProperty("--_menu-bottom",`${s}px`);let d=getComputedStyle(this),p=l.getPropertyValue("--_menu-bottom")===d.bottom?s:parseFloat(d.bottom),v=n.height-p-parseFloat(d.marginBottom);this.style.setProperty("--_menu-max-height",`${v}px`)};al=new WeakSet;Uc=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,es);if(i||r.setProperty("--media-menu-transition-in","none"),t){let n=t.offsetHeight,o=Math.max(t.offsetWidth,e.offsetWidth);this.style.setProperty("min-width",`${o}px`),this.style.setProperty("min-height",`${n}px`),J(this,cn,ts).call(this,o)}else this.style.removeProperty("min-width"),this.style.removeProperty("min-height"),J(this,cn,ts).call(this);r.removeProperty("--media-menu-transition-in")};Cc=new WeakSet;im=function(i){var e;if(i.stopPropagation(),i.composedPath().includes(Q(this,Hc,rm))){(e=Q(this,ar))==null||e.focus(),this.hidden=!0;return}let t=J(this,jo,ll).call(this,i);!t||t.hasAttribute("disabled")||(J(this,Jo,dl).call(this,t),this.handleSelect(i))};Hc=new WeakSet;rm=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"]'))};Rc=new WeakSet;nm=function(i){if(i.target===this)return;J(this,$c,om).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 mi({relatedTarget:t}));for(let t of e)t.setAttribute("aria-expanded",`${!t.submenuElement.hidden}`);J(this,al,Uc).call(this,!0)};$c=new WeakSet;om=function(){let e=this.querySelector('[role="menuitem"] > [role="menu"]:not([hidden])');this.container.classList.toggle("has-expanded",!!e)};Mc=new WeakSet;sm=function(i){var e;Ce(this,i.relatedTarget)||(Q(this,lr)&&((e=Q(this,ar))==null||e.focus()),Q(this,vi)&&Q(this,vi)!==i.relatedTarget&&!this.hidden&&(this.hidden=!0))};xc=new WeakSet;am=function(i){var e,t,r,n,o;let{key:s,ctrlKey:l,altKey:d,metaKey:h}=i;if(!(l||d||h)&&this.keysUsed.includes(s))if(i.preventDefault(),i.stopPropagation(),s==="Tab"){if(Q(this,lr)){this.hidden=!0;return}i.shiftKey?(t=(e=this.previousElementSibling)==null?void 0:e.focus)==null||t.call(e):(n=(r=this.nextElementSibling)==null?void 0:r.focus)==null||n.call(r),this.blur()}else s==="Escape"?((o=Q(this,ar))==null||o.focus(),Q(this,lr)&&(this.hidden=!0)):s==="Enter"||s===" "?this.handleSelect(i):this.handleMove(i)};jo=new WeakSet;ll=function(i){return i.composedPath().find(e=>["menuitemradio","menuitemcheckbox"].includes(e.role))};Pc=new WeakSet;lm=function(){return this.items.find(i=>i.tabIndex===0)};Jo=new WeakSet;dl=function(i){for(let e of this.items)e.tabIndex=e===i?0:-1};nl=new WeakSet;Dc=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,n)=>r!=t[n])&&this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))};pe.shadowRootOptions={mode:"open"};pe.getTemplateHTML=Eg;function gg(i){return["menuitem","menuitemradio","menuitemcheckbox"].includes(i==null?void 0:i.role)}function is(i){var e;return(e=i.getAttribute("bounds")?mt(i,`#${i.getAttribute("bounds")}`):ee(i)||i.parentElement)!=null?e:i}c.customElements.get("media-chrome-menu")||c.customElements.define("media-chrome-menu",pe);var qc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Mt=(i,e,t)=>(qc(i,e,"read from private field"),t?t.call(i):e.get(i)),Kt=(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)},Vc=(i,e,t,r)=>(qc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),dt=(i,e,t)=>(qc(i,e,"access private method"),t),cl,ns,Bc,dm,hl,Gc,zc,cm,xt,un,os,Wc,um,ul,Fc;function bg(i){return`
|
|
1813
1813
|
<style>
|
|
1814
1814
|
:host {
|
|
1815
1815
|
transition: var(--media-menu-item-transition,
|
|
@@ -1927,7 +1927,7 @@ bp-player[has-error] {
|
|
|
1927
1927
|
${this.getSuffixSlotInnerHTML(i)}
|
|
1928
1928
|
</slot>
|
|
1929
1929
|
<slot name="submenu"></slot>
|
|
1930
|
-
`}function _g(i){return""}var je={TYPE:"type",VALUE:"value",CHECKED:"checked",DISABLED:"disabled"},qe=class extends c.HTMLElement{constructor(){if(super(),Kt(this,
|
|
1930
|
+
`}function _g(i){return""}var je={TYPE:"type",VALUE:"value",CHECKED:"checked",DISABLED:"disabled"},qe=class extends c.HTMLElement{constructor(){if(super(),Kt(this,Bc),Kt(this,hl),Kt(this,zc),Kt(this,un),Kt(this,Wc),Kt(this,ul),Kt(this,cl,!1),Kt(this,ns,void 0),Kt(this,xt,()=>{var e,t;this.submenuElement.items&&this.setAttribute("submenusize",`${this.submenuElement.items.length}`);let r=this.shadowRoot.querySelector('slot[name="description"]'),n=(e=this.submenuElement.checkedItems)==null?void 0:e[0],o=(t=n==null?void 0:n.dataset.description)!=null?t:n==null?void 0:n.text,s=ne.createElement("span");s.textContent=o??"",r.replaceChildren(s)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=ie(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.shadowRoot.addEventListener("slotchange",this)}static get observedAttributes(){return[je.TYPE,je.DISABLED,je.CHECKED,je.VALUE]}enable(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","-1"),rs(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":dt(this,Bc,dm).call(this,e);break;case"click":this.handleClick(e);break;case"keydown":dt(this,Wc,um).call(this,e);break;case"keyup":dt(this,un,os).call(this,e);break}}attributeChangedCallback(e,t,r){e===je.CHECKED&&rs(this)&&!Mt(this,cl)?this.setAttribute("aria-checked",r!=null?"true":"false"):e===je.TYPE&&r!==t?this.role="menuitem"+r:e===je.DISABLED&&r!==t&&(r==null?this.enable():this.disable())}connectedCallback(){this.hasAttribute(je.DISABLED)||this.enable(),this.role="menuitem"+this.type,Vc(this,ns,Kc(this,this.parentNode)),dt(this,ul,Fc).call(this),this.submenuElement&&dt(this,hl,Gc).call(this)}disconnectedCallback(){this.disable(),dt(this,ul,Fc).call(this),Vc(this,ns,null)}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=Fi(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(je.TYPE))!=null?e:""}set type(e){this.setAttribute(je.TYPE,`${e}`)}get value(){var e;return(e=this.getAttribute(je.VALUE))!=null?e:this.text}set value(e){this.setAttribute(je.VALUE,e)}get text(){var e;return((e=this.textContent)!=null?e:"").trim()}get checked(){if(rs(this))return this.getAttribute("aria-checked")==="true"}set checked(e){rs(this)&&(Vc(this,cl,!0),this.setAttribute("aria-checked",e?"true":"false"),e?this.part.add("checked"):this.part.remove("checked"))}handleClick(e){rs(this)||this.invokeTargetElement&&Ce(this,e.target)&&this.invokeTargetElement.dispatchEvent(new mi({relatedTarget:this}))}get keysUsed(){return["Enter"," "]}};cl=new WeakMap;ns=new WeakMap;Bc=new WeakSet;dm=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?dt(this,hl,Gc).call(this):dt(this,zc,cm).call(this))};hl=new WeakSet;Gc=async function(){this.setAttribute("aria-haspopup","menu"),this.setAttribute("aria-expanded",`${!this.submenuElement.hidden}`),this.submenuElement.addEventListener("change",Mt(this,xt)),this.submenuElement.addEventListener("addmenuitem",Mt(this,xt)),this.submenuElement.addEventListener("removemenuitem",Mt(this,xt)),Mt(this,xt).call(this)};zc=new WeakSet;cm=function(){this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.submenuElement.removeEventListener("change",Mt(this,xt)),this.submenuElement.removeEventListener("addmenuitem",Mt(this,xt)),this.submenuElement.removeEventListener("removemenuitem",Mt(this,xt)),Mt(this,xt).call(this)};xt=new WeakMap;un=new WeakSet;os=function(i){let{key:e}=i;if(!this.keysUsed.includes(e)){this.removeEventListener("keyup",dt(this,un,os));return}this.handleClick(i)};Wc=new WeakSet;um=function(i){let{metaKey:e,altKey:t,key:r}=i;if(e||t||!this.keysUsed.includes(r)){this.removeEventListener("keyup",dt(this,un,os));return}this.addEventListener("keyup",dt(this,un,os),{once:!0})};ul=new WeakSet;Fc=function(){var i;let e=(i=Mt(this,ns))==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")};qe.shadowRootOptions={mode:"open"};qe.getTemplateHTML=bg;qe.getSuffixSlotInnerHTML=_g;function rs(i){return i.type==="radio"||i.type==="checkbox"}function Kc(i,e){if(!i)return null;let{host:t}=i.getRootNode();return!e&&t?Kc(i,t):e!=null&&e.items?e:Kc(e,e==null?void 0:e.parentNode)}c.customElements.get("media-chrome-menu-item")||c.customElements.define("media-chrome-menu-item",qe);function yg(i){return`
|
|
1931
1931
|
${pe.getTemplateHTML(i)}
|
|
1932
1932
|
<style>
|
|
1933
1933
|
:host {
|
|
@@ -1991,14 +1991,14 @@ bp-player[has-error] {
|
|
|
1991
1991
|
`}function kg(){return b("Settings")}var hn=class extends Ue{static get observedAttributes(){return[...super.observedAttributes,"target"]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",b("settings"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:ee(this).querySelector("media-settings-menu")}};hn.getSlotTemplateHTML=Sg;hn.getTooltipContentHTML=kg;c.customElements.get("media-settings-menu-button")||c.customElements.define("media-settings-menu-button",hn);var Xc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},hm=(i,e,t)=>(Xc(i,e,"read from private field"),t?t.call(i):e.get(i)),pl=(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)},Yc=(i,e,t,r)=>(Xc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ml=(i,e,t)=>(Xc(i,e,"access private method"),t),as,El,vl,Qc,fl,Zc,gl=class extends pe{constructor(){super(...arguments),pl(this,vl),pl(this,fl),pl(this,as,[]),pl(this,El,void 0)}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_AUDIO_TRACK_LIST,a.MEDIA_AUDIO_TRACK_ENABLED,a.MEDIA_AUDIO_TRACK_UNAVAILABLE]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_AUDIO_TRACK_ENABLED&&t!==r?this.value=r:e===a.MEDIA_AUDIO_TRACK_LIST&&t!==r&&(Yc(this,as,vh(r??"")),ml(this,vl,Qc).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",ml(this,fl,Zc))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",ml(this,fl,Zc))}get anchorElement(){var e;return this.anchor!=="auto"?super.anchorElement:(e=ee(this))==null?void 0:e.querySelector("media-audio-track-menu-button")}get mediaAudioTrackList(){return hm(this,as)}set mediaAudioTrackList(e){Yc(this,as,e),ml(this,vl,Qc).call(this)}get mediaAudioTrackEnabled(){var e;return(e=O(this,a.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){N(this,a.MEDIA_AUDIO_TRACK_ENABLED,e)}};as=new WeakMap;El=new WeakMap;vl=new WeakSet;Qc=function(){if(hm(this,El)===JSON.stringify(this.mediaAudioTrackList))return;Yc(this,El,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=Rt({type:"radio",text:t,value:`${e.id}`,checked:e.enabled});r.prepend(lt(this,"checked-indicator")),this.defaultSlot.append(r)}};fl=new WeakSet;Zc=function(){if(this.value==null)return;let i=new c.CustomEvent(y.MEDIA_AUDIO_TRACK_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};c.customElements.get("media-audio-track-menu")||c.customElements.define("media-audio-track-menu",gl);var Lg=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
1992
1992
|
<path d="M11 17H9.5V7H11v10Zm-3-3H6.5v-4H8v4Zm6-5h-1.5v6H14V9Zm3 7h-1.5V8H17v8Z"/>
|
|
1993
1993
|
<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"/>
|
|
1994
|
-
</svg>`;function
|
|
1994
|
+
</svg>`;function wg(){return`
|
|
1995
1995
|
<style>
|
|
1996
1996
|
:host([aria-expanded="true"]) slot[name=tooltip] {
|
|
1997
1997
|
display: none;
|
|
1998
1998
|
}
|
|
1999
1999
|
</style>
|
|
2000
2000
|
<slot name="icon">${Lg}</slot>
|
|
2001
|
-
`}function
|
|
2001
|
+
`}function Ig(){return b("Audio")}var pm=i=>{let e=b("Audio");i.setAttribute("aria-label",e)},pn=class extends Ue{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_AUDIO_TRACK_ENABLED,a.MEDIA_AUDIO_TRACK_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),pm(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_LANG&&pm(this)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=ee(this))==null?void 0:e.querySelector("media-audio-track-menu")}get mediaAudioTrackEnabled(){var e;return(e=O(this,a.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){N(this,a.MEDIA_AUDIO_TRACK_ENABLED,e)}};pn.getSlotTemplateHTML=wg;pn.getTooltipContentHTML=Ig;c.customElements.get("media-audio-track-menu-button")||c.customElements.define("media-audio-track-menu-button",pn);var tu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Cg=(i,e,t)=>(tu(i,e,"read from private field"),t?t.call(i):e.get(i)),jc=(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)},Rg=(i,e,t,r)=>(tu(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),bl=(i,e,t)=>(tu(i,e,"access private method"),t),Tl,_l,Jc,yl,eu,Mg=`
|
|
2002
2002
|
<svg aria-hidden="true" viewBox="0 0 26 24" part="captions-indicator indicator">
|
|
2003
2003
|
<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"/>
|
|
2004
2004
|
</svg>`;function xg(i){return`
|
|
@@ -2028,7 +2028,7 @@ bp-player[has-error] {
|
|
|
2028
2028
|
<slot name="on">${Pg}</slot>
|
|
2029
2029
|
<slot name="off">${Dg}</slot>
|
|
2030
2030
|
</slot>
|
|
2031
|
-
`}function Ng(){return b("Captions")}var fm=i=>{i.setAttribute("data-captions-enabled",ea(i).toString())},Em=i=>{i.setAttribute("aria-label",b("closed captions"))},mn=class extends Ue{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_SUBTITLES_LIST,a.MEDIA_SUBTITLES_SHOWING,a.MEDIA_LANG]}connectedCallback(){super.connectedCallback(),Em(this),fm(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_SUBTITLES_SHOWING?fm(this):e===a.MEDIA_LANG&&Em(this)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=ee(this))==null?void 0:e.querySelector("media-captions-menu")}get mediaSubtitlesList(){return gm(this,a.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){bm(this,a.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return gm(this,a.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){bm(this,a.MEDIA_SUBTITLES_SHOWING,e)}};mn.getSlotTemplateHTML=Og;mn.getTooltipContentHTML=Ng;var gm=(i,e)=>{let t=i.getAttribute(e);return t?zi(t):[]},bm=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let r=Wt(t);i.getAttribute(e)!==r&&i.setAttribute(e,r)};c.customElements.get("media-captions-menu-button")||c.customElements.define("media-captions-menu-button",mn);var _m=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},fn=(i,e,t)=>(_m(i,e,"read from private field"),t?t.call(i):e.get(i)),iu=(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)},vn=(i,e,t)=>(_m(i,e,"access private method"),t),fi,En,ds,Al,nu,ru={RATES:"rates"},Sl=class extends pe{constructor(){super(),iu(this,En),iu(this,Al),iu(this,fi,new ai(this,ru.RATES,{defaultValue:lc})),vn(this,En,ds).call(this)}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PLAYBACK_RATE,ru.RATES]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_PLAYBACK_RATE&&t!=r?(this.value=r,vn(this,En,ds).call(this)):e===ru.RATES&&t!=r&&(fn(this,fi).value=r,vn(this,En,ds).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",vn(this,Al,nu))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",vn(this,Al,nu))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:ee(this).querySelector("media-playback-rate-menu-button")}get rates(){return fn(this,fi)}set rates(e){e?Array.isArray(e)?fn(this,fi).value=e.join(" "):typeof e=="string"&&(fn(this,fi).value=e):fn(this,fi).value="",vn(this,En,ds).call(this)}get mediaPlaybackRate(){return
|
|
2031
|
+
`}function Ng(){return b("Captions")}var fm=i=>{i.setAttribute("data-captions-enabled",ea(i).toString())},Em=i=>{i.setAttribute("aria-label",b("closed captions"))},mn=class extends Ue{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_SUBTITLES_LIST,a.MEDIA_SUBTITLES_SHOWING,a.MEDIA_LANG]}connectedCallback(){super.connectedCallback(),Em(this),fm(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_SUBTITLES_SHOWING?fm(this):e===a.MEDIA_LANG&&Em(this)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=ee(this))==null?void 0:e.querySelector("media-captions-menu")}get mediaSubtitlesList(){return gm(this,a.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){bm(this,a.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return gm(this,a.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){bm(this,a.MEDIA_SUBTITLES_SHOWING,e)}};mn.getSlotTemplateHTML=Og;mn.getTooltipContentHTML=Ng;var gm=(i,e)=>{let t=i.getAttribute(e);return t?zi(t):[]},bm=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let r=Wt(t);i.getAttribute(e)!==r&&i.setAttribute(e,r)};c.customElements.get("media-captions-menu-button")||c.customElements.define("media-captions-menu-button",mn);var _m=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},fn=(i,e,t)=>(_m(i,e,"read from private field"),t?t.call(i):e.get(i)),iu=(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)},vn=(i,e,t)=>(_m(i,e,"access private method"),t),fi,En,ds,Al,nu,ru={RATES:"rates"},Sl=class extends pe{constructor(){super(),iu(this,En),iu(this,Al),iu(this,fi,new ai(this,ru.RATES,{defaultValue:lc})),vn(this,En,ds).call(this)}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PLAYBACK_RATE,ru.RATES]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_PLAYBACK_RATE&&t!=r?(this.value=r,vn(this,En,ds).call(this)):e===ru.RATES&&t!=r&&(fn(this,fi).value=r,vn(this,En,ds).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",vn(this,Al,nu))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",vn(this,Al,nu))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:ee(this).querySelector("media-playback-rate-menu-button")}get rates(){return fn(this,fi)}set rates(e){e?Array.isArray(e)?fn(this,fi).value=e.join(" "):typeof e=="string"&&(fn(this,fi).value=e):fn(this,fi).value="",vn(this,En,ds).call(this)}get mediaPlaybackRate(){return V(this,a.MEDIA_PLAYBACK_RATE,ir)}set mediaPlaybackRate(e){F(this,a.MEDIA_PLAYBACK_RATE,e)}};fi=new WeakMap;En=new WeakSet;ds=function(){this.defaultSlot.textContent="";let i=this.mediaPlaybackRate,e=new Set(Array.from(fn(this,fi)).map(r=>Number(r)));i>0&&!e.has(i)&&e.add(i);let t=Array.from(e).sort((r,n)=>r-n);for(let r of t){let n=Rt({type:"radio",text:this.formatMenuItemText(`${r}x`,r),value:r.toString(),checked:i===r});n.prepend(lt(this,"checked-indicator")),this.defaultSlot.append(n)}};Al=new WeakSet;nu=function(){if(!this.value)return;let i=new c.CustomEvent(y.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};c.customElements.get("media-playback-rate-menu")||c.customElements.define("media-playback-rate-menu",Sl);var kl=1;function Ug(i){return`
|
|
2032
2032
|
<style>
|
|
2033
2033
|
:host {
|
|
2034
2034
|
min-width: 5ch;
|
|
@@ -2044,16 +2044,16 @@ bp-player[has-error] {
|
|
|
2044
2044
|
}
|
|
2045
2045
|
</style>
|
|
2046
2046
|
<slot name="icon">${i.mediaplaybackrate||kl}x</slot>
|
|
2047
|
-
`}function Hg(){return b("Playback rate")}var gn=class extends Ue{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PLAYBACK_RATE]}constructor(){var e;super(),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${(e=this.mediaPlaybackRate)!=null?e:kl}x`}attributeChangedCallback(e,t,r){if(super.attributeChangedCallback(e,t,r),e===a.MEDIA_PLAYBACK_RATE){let n=r?+r:Number.NaN,o=Number.isNaN(n)?kl:n;this.container.innerHTML=`${o}x`,this.setAttribute("aria-label",b("Playback rate {playbackRate}",{playbackRate:o}))}}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:ee(this).querySelector("media-playback-rate-menu")}get mediaPlaybackRate(){return
|
|
2047
|
+
`}function Hg(){return b("Playback rate")}var gn=class extends Ue{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PLAYBACK_RATE]}constructor(){var e;super(),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${(e=this.mediaPlaybackRate)!=null?e:kl}x`}attributeChangedCallback(e,t,r){if(super.attributeChangedCallback(e,t,r),e===a.MEDIA_PLAYBACK_RATE){let n=r?+r:Number.NaN,o=Number.isNaN(n)?kl:n;this.container.innerHTML=`${o}x`,this.setAttribute("aria-label",b("Playback rate {playbackRate}",{playbackRate:o}))}}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:ee(this).querySelector("media-playback-rate-menu")}get mediaPlaybackRate(){return V(this,a.MEDIA_PLAYBACK_RATE,kl)}set mediaPlaybackRate(e){F(this,a.MEDIA_PLAYBACK_RATE,e)}};gn.getSlotTemplateHTML=Ug;gn.getTooltipContentHTML=Hg;c.customElements.get("media-playback-rate-menu-button")||c.customElements.define("media-playback-rate-menu-button",gn);var su=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},cs=(i,e,t)=>(su(i,e,"read from private field"),t?t.call(i):e.get(i)),Ll=(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)},ym=(i,e,t,r)=>(su(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),bn=(i,e,t)=>(su(i,e,"access private method"),t),us,yn,_n,hs,wl,ou,Il=class extends pe{constructor(){super(...arguments),Ll(this,_n),Ll(this,wl),Ll(this,us,[]),Ll(this,yn,{})}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_RENDITION_LIST,a.MEDIA_RENDITION_SELECTED,a.MEDIA_RENDITION_UNAVAILABLE,a.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 n=e.bitrate/1e6,o=`${n.toFixed(n<1?1:0)} Mbps`;return`${r} (${o})`}return this.formatMenuItemText(r,e)}static compareRendition(e,t){var r,n;return t.height===e.height?((r=t.bitrate)!=null?r:0)-((n=e.bitrate)!=null?n:0):t.height-e.height}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_RENDITION_SELECTED&&t!==r?(this.value=r??"auto",bn(this,_n,hs).call(this)):e===a.MEDIA_RENDITION_LIST&&t!==r?(ym(this,us,ph(r)),bn(this,_n,hs).call(this)):e===a.MEDIA_HEIGHT&&t!==r&&bn(this,_n,hs).call(this)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",bn(this,wl,ou))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",bn(this,wl,ou))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:ee(this).querySelector("media-rendition-menu-button")}get mediaRenditionList(){return cs(this,us)}set mediaRenditionList(e){ym(this,us,e),bn(this,_n,hs).call(this)}get mediaRenditionSelected(){return O(this,a.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){N(this,a.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return V(this,a.MEDIA_HEIGHT)}set mediaHeight(e){F(this,a.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)}};us=new WeakMap;yn=new WeakMap;_n=new WeakSet;hs=function(){if(cs(this,yn).mediaRenditionList===JSON.stringify(this.mediaRenditionList)&&cs(this,yn).mediaHeight===this.mediaHeight)return;cs(this,yn).mediaRenditionList=JSON.stringify(this.mediaRenditionList),cs(this,yn).mediaHeight=this.mediaHeight;let i=this.mediaRenditionList.sort(this.compareRendition.bind(this)),e=i.find(s=>s.id===this.mediaRenditionSelected);for(let s of i)s.selected=s===e;this.defaultSlot.textContent="";let t=!this.mediaRenditionSelected;for(let s of i){let l=this.formatRendition(s,{showBitrate:this.showRenditionBitrate(s)}),d=Rt({type:"radio",text:l,value:`${s.id}`,checked:s.selected&&!t});d.prepend(lt(this,"checked-indicator")),this.defaultSlot.append(d)}let r=e&&this.showRenditionBitrate(e),n=t?e?this.formatMenuItemText(`${b("Auto")} \u2022 ${this.formatRendition(e,{showBitrate:r})}`,e):this.formatMenuItemText(`${b("Auto")} (${this.mediaHeight}p)`):this.formatMenuItemText(b("Auto")),o=Rt({type:"radio",text:n,value:"auto",checked:t});o.dataset.description=n,o.prepend(lt(this,"checked-indicator")),this.defaultSlot.append(o)};wl=new WeakSet;ou=function(){if(this.value==null)return;let i=new c.CustomEvent(y.MEDIA_RENDITION_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};c.customElements.get("media-rendition-menu")||c.customElements.define("media-rendition-menu",Il);var $g=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
2048
2048
|
<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" />
|
|
2049
|
-
</svg>`;function
|
|
2049
|
+
</svg>`;function Vg(){return`
|
|
2050
2050
|
<style>
|
|
2051
2051
|
:host([aria-expanded="true"]) slot[name=tooltip] {
|
|
2052
2052
|
display: none;
|
|
2053
2053
|
}
|
|
2054
2054
|
</style>
|
|
2055
2055
|
<slot name="icon">${$g}</slot>
|
|
2056
|
-
`}function
|
|
2056
|
+
`}function Bg(){return b("Quality")}var Tn=class extends Ue{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_RENDITION_SELECTED,a.MEDIA_RENDITION_UNAVAILABLE,a.MEDIA_HEIGHT]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",b("quality"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:ee(this).querySelector("media-rendition-menu")}get mediaRenditionSelected(){return O(this,a.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){N(this,a.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return V(this,a.MEDIA_HEIGHT)}set mediaHeight(e){F(this,a.MEDIA_HEIGHT,e)}};Tn.getSlotTemplateHTML=Vg;Tn.getTooltipContentHTML=Bg;c.customElements.get("media-rendition-menu-button")||c.customElements.define("media-rendition-menu-button",Tn);var du=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Dt=(i,e,t)=>(du(i,e,"read from private field"),t?t.call(i):e.get(i)),Pt=(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)},Tm=(i,e,t,r)=>(du(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Je=(i,e,t)=>(du(i,e,"access private method"),t),Sn,ps,Dl,cr,An,cu,Am,Cl,au,Rl,lu,Sm,xl,Pl,Ml;function Wg(i){return`
|
|
2057
2057
|
${pe.getTemplateHTML(i)}
|
|
2058
2058
|
<style>
|
|
2059
2059
|
:host {
|
|
@@ -2857,7 +2857,7 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
|
|
|
2857
2857
|
:host([button-mode]) [part="submessage"] {
|
|
2858
2858
|
display: none;
|
|
2859
2859
|
}
|
|
2860
|
-
`,$([z({type:String,reflect:!0})],qt.prototype,"type",2),$([z({type:Boolean,reflect:!0})],qt.prototype,"live",2),$([z({type:Boolean,reflect:!0,attribute:"button-mode"})],qt.prototype,"buttonMode",2),qt=$([ei("bp-overlay")],qt);var ib=["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"],
|
|
2860
|
+
`,$([z({type:String,reflect:!0})],qt.prototype,"type",2),$([z({type:Boolean,reflect:!0})],qt.prototype,"live",2),$([z({type:Boolean,reflect:!0,attribute:"button-mode"})],qt.prototype,"buttonMode",2),qt=$([ei("bp-overlay")],qt);var ib=["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"],wm=["autopictureinpicture","disablepictureinpicture","disableremoteplayback","autoplay","controls","controlslist","crossorigin","loop","muted","playsinline","poster","preload","src"];function rb(i){return`
|
|
2861
2861
|
<style>
|
|
2862
2862
|
:host {
|
|
2863
2863
|
display: inline-flex;
|
|
@@ -2899,22 +2899,22 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
|
|
|
2899
2899
|
<video${Pm(i)}></video>
|
|
2900
2900
|
</slot>
|
|
2901
2901
|
<slot></slot>
|
|
2902
|
-
`}function xm(i,{tag:e,is:t}){var o,s,l,d,h,wm,v,f,m,_,g,ur,uu,Cm,hu,Rm,Mm;let r=(s=(o=globalThis.document)==null?void 0:o.createElement)==null?void 0:s.call(o,e,{is:t}),n=r?ob(r):[];return l=class extends i{constructor(){super(...arguments);L(this,g);L(this,v,!1);L(this,f,null);L(this,m,new Map);L(this,_);W(this,"get");W(this,"set");W(this,"call")}static get observedAttributes(){var K,se;return D(K=l,h,wm).call(K),[...((se=r==null?void 0:r.constructor)==null?void 0:se.observedAttributes)??[],...Im]}get nativeEl(){var w;return D(this,g,ur).call(this),u(this,f)??this.querySelector(":scope > [slot=media]")??this.querySelector(e)??((w=this.shadowRoot)==null?void 0:w.querySelector(e))??null}set nativeEl(w){E(this,f,w)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(w){this.toggleAttribute("muted",w)}get src(){return this.getAttribute("src")}set src(w){this.setAttribute("src",`${w}`)}get preload(){var w;return this.getAttribute("preload")??((w=this.nativeEl)==null?void 0:w.preload)}set preload(w){this.setAttribute("preload",`${w}`)}init(){if(!this.shadowRoot){this.attachShadow({mode:"open"});let w=sb(this.attributes);t&&(w.is=t),e&&(w.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(w)}this.nativeEl.muted=this.hasAttribute("muted");for(let w of n)D(this,g,Rm).call(this,w);E(this,_,new MutationObserver(D(this,g,Cm).bind(this))),this.shadowRoot.addEventListener("slotchange",()=>D(this,g,uu).call(this)),D(this,g,uu).call(this);for(let w of this.constructor.Events)this.shadowRoot.addEventListener(w,this,!0)}handleEvent(w){w.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(w.type,{detail:w.detail}))}attributeChangedCallback(w,K,se){D(this,g,ur).call(this),D(this,g,Mm).call(this,w,K,se)}connectedCallback(){D(this,g,ur).call(this)}},d=new WeakMap,h=new WeakSet,wm=function(){if(u(this,d))return;E(this,d,!0);let w=new Set(this.observedAttributes);w.delete("muted");for(let K of n)if(!(K in this.prototype))if(typeof r[K]=="function")this.prototype[K]=function(...se){return D(this,g,ur).call(this),(()=>{var Ee;if(this.call)return this.call(K,...se);let G=(Ee=this.nativeEl)==null?void 0:Ee[K];return G==null?void 0:G.apply(this.nativeEl,se)})()};else{let se={get(){var G,Ee;D(this,g,ur).call(this);let U=K.toLowerCase();if(w.has(U)){let Ut=this.getAttribute(U);return Ut===null?!1:Ut===""?!0:Ut}return((G=this.get)==null?void 0:G.call(this,K))??((Ee=this.nativeEl)==null?void 0:Ee[K])}};K!==K.toUpperCase()&&(se.set=function(U){D(this,g,ur).call(this);let G=K.toLowerCase();if(w.has(G)){U===!0||U===!1||U==null?this.toggleAttribute(G,!!U):this.setAttribute(G,U);return}if(this.set){this.set(K,U);return}this.nativeEl&&(this.nativeEl[K]=U)}),Object.defineProperty(this.prototype,K,se)}},v=new WeakMap,f=new WeakMap,m=new WeakMap,_=new WeakMap,g=new WeakSet,ur=function(){u(this,v)||(E(this,v,!0),this.init())},uu=function(){var U;let w=new Map(u(this,m)),K=(U=this.shadowRoot)==null?void 0:U.querySelector("slot:not([name])");(K==null?void 0:K.assignedElements({flatten:!0}).filter(G=>["track","source"].includes(G.localName))).forEach(G=>{var Ut,Wn;w.delete(G);let Ee=u(this,m).get(G);Ee||(Ee=G.cloneNode(),u(this,m).set(G,Ee),(Ut=u(this,_))==null||Ut.observe(G,{attributes:!0})),(Wn=this.nativeEl)==null||Wn.append(Ee),D(this,g,hu).call(this,Ee)}),w.forEach((G,Ee)=>{G.remove(),u(this,m).delete(Ee)})},Cm=function(w){for(let K of w)if(K.type==="attributes"){let{target:se,attributeName:U}=K,G=u(this,m).get(se);G&&U&&(G.setAttribute(U,se.getAttribute(U)??""),D(this,g,hu).call(this,G))}},hu=function(w){w&&w.localName==="track"&&w.default&&(w.kind==="chapters"||w.kind==="metadata")&&w.track.mode==="disabled"&&(w.track.mode="hidden")},Rm=function(w){if(Object.prototype.hasOwnProperty.call(this,w)){let K=this[w];delete this[w],this[w]=K}},Mm=function(w,K,se){var U,G,Ee;["id","class"].includes(w)||!l.observedAttributes.includes(w)&&this.constructor.observedAttributes.includes(w)||(se===null?(U=this.nativeEl)==null||U.removeAttribute(w):((G=this.nativeEl)==null?void 0:G.getAttribute(w))!==se&&((Ee=this.nativeEl)==null||Ee.setAttribute(w,se)))},L(l,h),W(l,"getTemplateHTML",e.endsWith("audio")?rb:nb),W(l,"shadowRootOptions",{mode:"open"}),W(l,"Events",ib),L(l,d,!1),l}function ob(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 Pm(i){let e="";for(let t in i){if(!Im.includes(t))continue;let r=i[t];r===""?e+=` ${t}`:e+=` ${t}="${r}"`}return e}function sb(i){let e={};for(let t of i)e[t.name]=t.value;return e}var He=xm(globalThis.HTMLElement??class{},{tag:"video"}),Kw=xm(globalThis.HTMLElement??class{},{tag:"audio"});var Gt=class extends Event{constructor(t,r){super(t);W(this,"track");this.track=r.track}};var pu=new WeakMap;function S(i){return pu.get(i)??ab(i,{})}function ab(i,e){let t=pu.get(i);return t||pu.set(i,t={}),Object.assign(t,e)}function Ol(i,e){let t=i.videoTracks;S(e).media=i,S(e).renditionSet||(S(e).renditionSet=new Set);let r=S(t).trackSet;r.add(e);let n=r.size-1;n in pr.prototype||Object.defineProperty(pr.prototype,n,{get(){return[...S(this).trackSet][n]}}),queueMicrotask(()=>{t.dispatchEvent(new Gt("addtrack",{track:e}))})}function Nl(i){var r;let e=(r=S(i).media)==null?void 0:r.videoTracks;if(!e)return;S(e).trackSet.delete(i),queueMicrotask(()=>{e.dispatchEvent(new Gt("removetrack",{track:i}))})}function Dm(i){let e=S(i).media.videoTracks??[],t=!1;for(let r of e)r!==i&&(r.selected=!1,t=!0);if(t){if(S(e).changeRequested)return;S(e).changeRequested=!0,queueMicrotask(()=>{delete S(e).changeRequested,e.dispatchEvent(new Event("change"))})}}var gi,bi,_i,hr,vs,pr=class extends EventTarget{constructor(){super();L(this,hr);L(this,gi);L(this,bi);L(this,_i);S(this).trackSet=new Set}[Symbol.iterator](){return u(this,hr,vs).values()}get length(){return u(this,hr,vs).size}getTrackById(t){return[...u(this,hr,vs)].find(r=>r.id===t)??null}get selectedIndex(){return[...u(this,hr,vs)].findIndex(t=>t.selected)}get onaddtrack(){return u(this,gi)}set onaddtrack(t){u(this,gi)&&(this.removeEventListener("addtrack",u(this,gi)),E(this,gi,void 0)),typeof t=="function"&&(E(this,gi,t),this.addEventListener("addtrack",t))}get onremovetrack(){return u(this,bi)}set onremovetrack(t){u(this,bi)&&(this.removeEventListener("removetrack",u(this,bi)),E(this,bi,void 0)),typeof t=="function"&&(E(this,bi,t),this.addEventListener("removetrack",t))}get onchange(){return u(this,_i)}set onchange(t){u(this,_i)&&(this.removeEventListener("change",u(this,_i)),E(this,_i,void 0)),typeof t=="function"&&(E(this,_i,t),this.addEventListener("change",t))}};gi=new WeakMap,bi=new WeakMap,_i=new WeakMap,hr=new WeakSet,vs=function(){return S(this).trackSet};var zt=class extends Event{constructor(t,r){super(t);W(this,"rendition");this.rendition=r.rendition}};function Om(i,e){let t=S(i).media.videoRenditions;S(e).media=S(i).media,S(e).track=i;let r=S(i).renditionSet;r.add(e);let n=r.size-1;n in mr.prototype||Object.defineProperty(mr.prototype,n,{get(){return Ln(this)[n]}}),queueMicrotask(()=>{i.selected&&t.dispatchEvent(new zt("addrendition",{rendition:e}))})}function Nm(i){let e=S(i).media.videoRenditions,t=S(i).track;S(t).renditionSet.delete(i),queueMicrotask(()=>{S(i).track.selected&&e.dispatchEvent(new zt("removerendition",{rendition:i}))})}function Um(i){let e=S(i).media.videoRenditions;!e||S(e).changeRequested||(S(e).changeRequested=!0,queueMicrotask(()=>{delete S(e).changeRequested,S(i).track.selected&&e.dispatchEvent(new Event("change"))}))}function Ln(i){return[...S(i).media.videoTracks].filter(t=>t.selected).flatMap(t=>[...S(t).renditionSet])}var yi,Ti,Ai,mr=class extends EventTarget{constructor(){super(...arguments);L(this,yi);L(this,Ti);L(this,Ai)}[Symbol.iterator](){return Ln(this).values()}get length(){return Ln(this).length}getRenditionById(t){return Ln(this).find(r=>`${r.id}`==`${t}`)??null}get selectedIndex(){return Ln(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[r,n]of Ln(this).entries())n.selected=r===t}get onaddrendition(){return u(this,yi)}set onaddrendition(t){u(this,yi)&&(this.removeEventListener("addrendition",u(this,yi)),E(this,yi,void 0)),typeof t=="function"&&(E(this,yi,t),this.addEventListener("addrendition",t))}get onremoverendition(){return u(this,Ti)}set onremoverendition(t){u(this,Ti)&&(this.removeEventListener("removerendition",u(this,Ti)),E(this,Ti,void 0)),typeof t=="function"&&(E(this,Ti,t),this.addEventListener("removerendition",t))}get onchange(){return u(this,Ai)}set onchange(t){u(this,Ai)&&(this.removeEventListener("change",u(this,Ai)),E(this,Ai,void 0)),typeof t=="function"&&(E(this,Ai,t),this.addEventListener("change",t))}};yi=new WeakMap,Ti=new WeakMap,Ai=new WeakMap;var In,fs=class{constructor(){W(this,"src");W(this,"id");W(this,"width");W(this,"height");W(this,"bitrate");W(this,"frameRate");W(this,"codec");L(this,In,!1)}get selected(){return u(this,In)}set selected(e){u(this,In)!==e&&(E(this,In,e),Um(this))}};In=new WeakMap;var wn,Cn=class{constructor(){W(this,"id");W(this,"kind");W(this,"label","");W(this,"language","");W(this,"sourceBuffer");L(this,wn,!1)}addRendition(e,t,r,n,o,s){let l=new fs;return l.src=e,l.width=t,l.height=r,l.frameRate=s,l.bitrate=o,l.codec=n,Om(this,l),l}removeRendition(e){Nm(e)}get selected(){return u(this,wn)}set selected(e){u(this,wn)!==e&&(E(this,wn,e),e===!0&&Dm(this))}};wn=new WeakMap;function Hm(i,e){let t=S(i).media.audioRenditions;S(e).media=S(i).media,S(e).track=i;let r=S(i).renditionSet;r.add(e);let n=r.size-1;n in vr.prototype||Object.defineProperty(vr.prototype,n,{get(){return Rn(this)[n]}}),queueMicrotask(()=>{i.enabled&&t.dispatchEvent(new zt("addrendition",{rendition:e}))})}function $m(i){let e=S(i).media.audioRenditions,t=S(i).track;S(t).renditionSet.delete(i),queueMicrotask(()=>{S(i).track.enabled&&e.dispatchEvent(new zt("removerendition",{rendition:i}))})}function Bm(i){let e=S(i).media.audioRenditions;!e||S(e).changeRequested||(S(e).changeRequested=!0,queueMicrotask(()=>{delete S(e).changeRequested,S(i).track.enabled&&e.dispatchEvent(new Event("change"))}))}function Rn(i){return[...S(i).media.audioTracks].filter(t=>t.enabled).flatMap(t=>[...S(t).renditionSet])}var Si,ki,Li,vr=class extends EventTarget{constructor(){super(...arguments);L(this,Si);L(this,ki);L(this,Li)}[Symbol.iterator](){return Rn(this).values()}get length(){return Rn(this).length}getRenditionById(t){return Rn(this).find(r=>`${r.id}`==`${t}`)??null}get selectedIndex(){return Rn(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[r,n]of Rn(this).entries())n.selected=r===t}get onaddrendition(){return u(this,Si)}set onaddrendition(t){u(this,Si)&&(this.removeEventListener("addrendition",u(this,Si)),E(this,Si,void 0)),typeof t=="function"&&(E(this,Si,t),this.addEventListener("addrendition",t))}get onremoverendition(){return u(this,ki)}set onremoverendition(t){u(this,ki)&&(this.removeEventListener("removerendition",u(this,ki)),E(this,ki,void 0)),typeof t=="function"&&(E(this,ki,t),this.addEventListener("removerendition",t))}get onchange(){return u(this,Li)}set onchange(t){u(this,Li)&&(this.removeEventListener("change",u(this,Li)),E(this,Li,void 0)),typeof t=="function"&&(E(this,Li,t),this.addEventListener("change",t))}};Si=new WeakMap,ki=new WeakMap,Li=new WeakMap;var Mn,Es=class{constructor(){W(this,"src");W(this,"id");W(this,"bitrate");W(this,"codec");L(this,Mn,!1)}get selected(){return u(this,Mn)}set selected(e){u(this,Mn)!==e&&(E(this,Mn,e),Bm(this))}};Mn=new WeakMap;function Hl(i,e){let t=i.audioTracks;S(e).media=i,S(e).renditionSet||(S(e).renditionSet=new Set);let r=S(t).trackSet;r.add(e);let n=r.size-1;n in fr.prototype||Object.defineProperty(fr.prototype,n,{get(){return[...S(this).trackSet][n]}}),queueMicrotask(()=>{t.dispatchEvent(new Gt("addtrack",{track:e}))})}function $l(i){var r;let e=(r=S(i).media)==null?void 0:r.audioTracks;if(!e)return;S(e).trackSet.delete(i),queueMicrotask(()=>{e.dispatchEvent(new Gt("removetrack",{track:i}))})}function Vm(i){let e=S(i).media.audioTracks;!e||S(e).changeRequested||(S(e).changeRequested=!0,queueMicrotask(()=>{delete S(e).changeRequested,e.dispatchEvent(new Event("change"))}))}var Ii,wi,Ci,xn,Ul,fr=class extends EventTarget{constructor(){super();L(this,xn);L(this,Ii);L(this,wi);L(this,Ci);S(this).trackSet=new Set}[Symbol.iterator](){return u(this,xn,Ul).values()}get length(){return u(this,xn,Ul).size}getTrackById(t){return[...u(this,xn,Ul)].find(r=>r.id===t)??null}get onaddtrack(){return u(this,Ii)}set onaddtrack(t){u(this,Ii)&&(this.removeEventListener("addtrack",u(this,Ii)),E(this,Ii,void 0)),typeof t=="function"&&(E(this,Ii,t),this.addEventListener("addtrack",t))}get onremovetrack(){return u(this,wi)}set onremovetrack(t){u(this,wi)&&(this.removeEventListener("removetrack",u(this,wi)),E(this,wi,void 0)),typeof t=="function"&&(E(this,wi,t),this.addEventListener("removetrack",t))}get onchange(){return u(this,Ci)}set onchange(t){u(this,Ci)&&(this.removeEventListener("change",u(this,Ci)),E(this,Ci,void 0)),typeof t=="function"&&(E(this,Ci,t),this.addEventListener("change",t))}};Ii=new WeakMap,wi=new WeakMap,Ci=new WeakMap,xn=new WeakSet,Ul=function(){return S(this).trackSet};var Pn,Dn=class{constructor(){W(this,"id");W(this,"kind");W(this,"label","");W(this,"language","");W(this,"sourceBuffer");L(this,Pn,!1)}addRendition(e,t,r){let n=new Es;return n.src=e,n.codec=t,n.bitrate=r,Hm(this,n),n}removeRendition(e){$m(e)}get enabled(){return u(this,Pn)}set enabled(e){u(this,Pn)!==e&&(E(this,Pn,e),Vm(this))}};Pn=new WeakMap;var Wm=Bl(globalThis.HTMLMediaElement,"video"),Fm=Bl(globalThis.HTMLMediaElement,"audio");function On(i){if(!(i!=null&&i.prototype))return i;let e=Bl(i,"video");(!e||`${e}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"videoTracks",{get(){return lb(this)}});let t=Bl(i,"audio");(!t||`${t}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"audioTracks",{get(){return db(this)}}),"addVideoTrack"in i.prototype||(i.prototype.addVideoTrack=function(o,s="",l=""){let d=new Cn;return d.kind=o,d.label=s,d.language=l,Ol(this,d),d}),"removeVideoTrack"in i.prototype||(i.prototype.removeVideoTrack=Nl),"addAudioTrack"in i.prototype||(i.prototype.addAudioTrack=function(o,s="",l=""){let d=new Dn;return d.kind=o,d.label=s,d.language=l,Hl(this,d),d}),"removeAudioTrack"in i.prototype||(i.prototype.removeAudioTrack=$l),"videoRenditions"in i.prototype||Object.defineProperty(i.prototype,"videoRenditions",{get(){return r(this)}});let r=o=>{let s=S(o).videoRenditions;return s||(s=new mr,S(s).media=o,S(o).videoRenditions=s),s};"audioRenditions"in i.prototype||Object.defineProperty(i.prototype,"audioRenditions",{get(){return n(this)}});let n=o=>{let s=S(o).audioRenditions;return s||(s=new vr,S(s).media=o,S(o).audioRenditions=s),s};return i}function Bl(i,e){var t;if(i!=null&&i.prototype)return(t=Object.getOwnPropertyDescriptor(i.prototype,`${e}Tracks`))==null?void 0:t.get}function lb(i){let e=S(i).videoTracks;if(!e&&(e=new pr,S(i).videoTracks=e,Wm)){let t=Wm.call(i.nativeEl??i);for(let r of t)Ol(i,r);t.addEventListener("change",()=>{e.dispatchEvent(new Event("change"))}),t.addEventListener("addtrack",r=>{if([...e].some(n=>n instanceof Cn)){for(let n of t)Nl(n);return}Ol(i,r.track)}),t.addEventListener("removetrack",r=>{Nl(r.track)})}return e}function db(i){let e=S(i).audioTracks;if(!e&&(e=new fr,S(i).audioTracks=e,Fm)){let t=Fm.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(n=>n instanceof Dn)){for(let n of t)$l(n);return}Hl(i,r.track)}),t.addEventListener("removetrack",r=>{$l(r.track)})}return e}import Ge from"hls.js";var cb=On(He),Yt,Qt,Zt,Nn,et,mu,Km,vu,gs,qm,Er=class extends cb{constructor(){super();L(this,et);L(this,Yt,null);L(this,Qt,null);L(this,Zt,null);L(this,Nn,!1);this.api=null;L(this,gs,()=>{var r,n;let t=this.nativeEl;t!=null&&t.webkitCurrentPlaybackTargetIsWireless?(r=this.api)==null||r.stopLoad():(n=this.api)==null||n.startLoad()});D(this,et,qm).call(this,"config")}static getTemplateHTML(t,r={}){let{src:n,...o}=t;return`
|
|
2902
|
+
`}function xm(i,{tag:e,is:t}){var o,s,l,d,h,Im,v,f,m,_,g,ur,uu,Cm,hu,Rm,Mm;let r=(s=(o=globalThis.document)==null?void 0:o.createElement)==null?void 0:s.call(o,e,{is:t}),n=r?ob(r):[];return l=class extends i{constructor(){super(...arguments);L(this,g);L(this,v,!1);L(this,f,null);L(this,m,new Map);L(this,_);W(this,"get");W(this,"set");W(this,"call")}static get observedAttributes(){var K,se;return D(K=l,h,Im).call(K),[...((se=r==null?void 0:r.constructor)==null?void 0:se.observedAttributes)??[],...wm]}get nativeEl(){var I;return D(this,g,ur).call(this),u(this,f)??this.querySelector(":scope > [slot=media]")??this.querySelector(e)??((I=this.shadowRoot)==null?void 0:I.querySelector(e))??null}set nativeEl(I){E(this,f,I)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(I){this.toggleAttribute("muted",I)}get src(){return this.getAttribute("src")}set src(I){this.setAttribute("src",`${I}`)}get preload(){var I;return this.getAttribute("preload")??((I=this.nativeEl)==null?void 0:I.preload)}set preload(I){this.setAttribute("preload",`${I}`)}init(){if(!this.shadowRoot){this.attachShadow({mode:"open"});let I=sb(this.attributes);t&&(I.is=t),e&&(I.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(I)}this.nativeEl.muted=this.hasAttribute("muted");for(let I of n)D(this,g,Rm).call(this,I);E(this,_,new MutationObserver(D(this,g,Cm).bind(this))),this.shadowRoot.addEventListener("slotchange",()=>D(this,g,uu).call(this)),D(this,g,uu).call(this);for(let I of this.constructor.Events)this.shadowRoot.addEventListener(I,this,!0)}handleEvent(I){I.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(I.type,{detail:I.detail}))}attributeChangedCallback(I,K,se){D(this,g,ur).call(this),D(this,g,Mm).call(this,I,K,se)}connectedCallback(){D(this,g,ur).call(this)}},d=new WeakMap,h=new WeakSet,Im=function(){if(u(this,d))return;E(this,d,!0);let I=new Set(this.observedAttributes);I.delete("muted");for(let K of n)if(!(K in this.prototype))if(typeof r[K]=="function")this.prototype[K]=function(...se){return D(this,g,ur).call(this),(()=>{var Ee;if(this.call)return this.call(K,...se);let G=(Ee=this.nativeEl)==null?void 0:Ee[K];return G==null?void 0:G.apply(this.nativeEl,se)})()};else{let se={get(){var G,Ee;D(this,g,ur).call(this);let U=K.toLowerCase();if(I.has(U)){let Ut=this.getAttribute(U);return Ut===null?!1:Ut===""?!0:Ut}return((G=this.get)==null?void 0:G.call(this,K))??((Ee=this.nativeEl)==null?void 0:Ee[K])}};K!==K.toUpperCase()&&(se.set=function(U){D(this,g,ur).call(this);let G=K.toLowerCase();if(I.has(G)){U===!0||U===!1||U==null?this.toggleAttribute(G,!!U):this.setAttribute(G,U);return}if(this.set){this.set(K,U);return}this.nativeEl&&(this.nativeEl[K]=U)}),Object.defineProperty(this.prototype,K,se)}},v=new WeakMap,f=new WeakMap,m=new WeakMap,_=new WeakMap,g=new WeakSet,ur=function(){u(this,v)||(E(this,v,!0),this.init())},uu=function(){var U;let I=new Map(u(this,m)),K=(U=this.shadowRoot)==null?void 0:U.querySelector("slot:not([name])");(K==null?void 0:K.assignedElements({flatten:!0}).filter(G=>["track","source"].includes(G.localName))).forEach(G=>{var Ut,Wn;I.delete(G);let Ee=u(this,m).get(G);Ee||(Ee=G.cloneNode(),u(this,m).set(G,Ee),(Ut=u(this,_))==null||Ut.observe(G,{attributes:!0})),(Wn=this.nativeEl)==null||Wn.append(Ee),D(this,g,hu).call(this,Ee)}),I.forEach((G,Ee)=>{G.remove(),u(this,m).delete(Ee)})},Cm=function(I){for(let K of I)if(K.type==="attributes"){let{target:se,attributeName:U}=K,G=u(this,m).get(se);G&&U&&(G.setAttribute(U,se.getAttribute(U)??""),D(this,g,hu).call(this,G))}},hu=function(I){I&&I.localName==="track"&&I.default&&(I.kind==="chapters"||I.kind==="metadata")&&I.track.mode==="disabled"&&(I.track.mode="hidden")},Rm=function(I){if(Object.prototype.hasOwnProperty.call(this,I)){let K=this[I];delete this[I],this[I]=K}},Mm=function(I,K,se){var U,G,Ee;["id","class"].includes(I)||!l.observedAttributes.includes(I)&&this.constructor.observedAttributes.includes(I)||(se===null?(U=this.nativeEl)==null||U.removeAttribute(I):((G=this.nativeEl)==null?void 0:G.getAttribute(I))!==se&&((Ee=this.nativeEl)==null||Ee.setAttribute(I,se)))},L(l,h),W(l,"getTemplateHTML",e.endsWith("audio")?rb:nb),W(l,"shadowRootOptions",{mode:"open"}),W(l,"Events",ib),L(l,d,!1),l}function ob(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 Pm(i){let e="";for(let t in i){if(!wm.includes(t))continue;let r=i[t];r===""?e+=` ${t}`:e+=` ${t}="${r}"`}return e}function sb(i){let e={};for(let t of i)e[t.name]=t.value;return e}var He=xm(globalThis.HTMLElement??class{},{tag:"video"}),KI=xm(globalThis.HTMLElement??class{},{tag:"audio"});var Gt=class extends Event{constructor(t,r){super(t);W(this,"track");this.track=r.track}};var pu=new WeakMap;function S(i){return pu.get(i)??ab(i,{})}function ab(i,e){let t=pu.get(i);return t||pu.set(i,t={}),Object.assign(t,e)}function Ol(i,e){let t=i.videoTracks;S(e).media=i,S(e).renditionSet||(S(e).renditionSet=new Set);let r=S(t).trackSet;r.add(e);let n=r.size-1;n in pr.prototype||Object.defineProperty(pr.prototype,n,{get(){return[...S(this).trackSet][n]}}),queueMicrotask(()=>{t.dispatchEvent(new Gt("addtrack",{track:e}))})}function Nl(i){var r;let e=(r=S(i).media)==null?void 0:r.videoTracks;if(!e)return;S(e).trackSet.delete(i),queueMicrotask(()=>{e.dispatchEvent(new Gt("removetrack",{track:i}))})}function Dm(i){let e=S(i).media.videoTracks??[],t=!1;for(let r of e)r!==i&&(r.selected=!1,t=!0);if(t){if(S(e).changeRequested)return;S(e).changeRequested=!0,queueMicrotask(()=>{delete S(e).changeRequested,e.dispatchEvent(new Event("change"))})}}var gi,bi,_i,hr,vs,pr=class extends EventTarget{constructor(){super();L(this,hr);L(this,gi);L(this,bi);L(this,_i);S(this).trackSet=new Set}[Symbol.iterator](){return u(this,hr,vs).values()}get length(){return u(this,hr,vs).size}getTrackById(t){return[...u(this,hr,vs)].find(r=>r.id===t)??null}get selectedIndex(){return[...u(this,hr,vs)].findIndex(t=>t.selected)}get onaddtrack(){return u(this,gi)}set onaddtrack(t){u(this,gi)&&(this.removeEventListener("addtrack",u(this,gi)),E(this,gi,void 0)),typeof t=="function"&&(E(this,gi,t),this.addEventListener("addtrack",t))}get onremovetrack(){return u(this,bi)}set onremovetrack(t){u(this,bi)&&(this.removeEventListener("removetrack",u(this,bi)),E(this,bi,void 0)),typeof t=="function"&&(E(this,bi,t),this.addEventListener("removetrack",t))}get onchange(){return u(this,_i)}set onchange(t){u(this,_i)&&(this.removeEventListener("change",u(this,_i)),E(this,_i,void 0)),typeof t=="function"&&(E(this,_i,t),this.addEventListener("change",t))}};gi=new WeakMap,bi=new WeakMap,_i=new WeakMap,hr=new WeakSet,vs=function(){return S(this).trackSet};var zt=class extends Event{constructor(t,r){super(t);W(this,"rendition");this.rendition=r.rendition}};function Om(i,e){let t=S(i).media.videoRenditions;S(e).media=S(i).media,S(e).track=i;let r=S(i).renditionSet;r.add(e);let n=r.size-1;n in mr.prototype||Object.defineProperty(mr.prototype,n,{get(){return Ln(this)[n]}}),queueMicrotask(()=>{i.selected&&t.dispatchEvent(new zt("addrendition",{rendition:e}))})}function Nm(i){let e=S(i).media.videoRenditions,t=S(i).track;S(t).renditionSet.delete(i),queueMicrotask(()=>{S(i).track.selected&&e.dispatchEvent(new zt("removerendition",{rendition:i}))})}function Um(i){let e=S(i).media.videoRenditions;!e||S(e).changeRequested||(S(e).changeRequested=!0,queueMicrotask(()=>{delete S(e).changeRequested,S(i).track.selected&&e.dispatchEvent(new Event("change"))}))}function Ln(i){return[...S(i).media.videoTracks].filter(t=>t.selected).flatMap(t=>[...S(t).renditionSet])}var yi,Ti,Ai,mr=class extends EventTarget{constructor(){super(...arguments);L(this,yi);L(this,Ti);L(this,Ai)}[Symbol.iterator](){return Ln(this).values()}get length(){return Ln(this).length}getRenditionById(t){return Ln(this).find(r=>`${r.id}`==`${t}`)??null}get selectedIndex(){return Ln(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[r,n]of Ln(this).entries())n.selected=r===t}get onaddrendition(){return u(this,yi)}set onaddrendition(t){u(this,yi)&&(this.removeEventListener("addrendition",u(this,yi)),E(this,yi,void 0)),typeof t=="function"&&(E(this,yi,t),this.addEventListener("addrendition",t))}get onremoverendition(){return u(this,Ti)}set onremoverendition(t){u(this,Ti)&&(this.removeEventListener("removerendition",u(this,Ti)),E(this,Ti,void 0)),typeof t=="function"&&(E(this,Ti,t),this.addEventListener("removerendition",t))}get onchange(){return u(this,Ai)}set onchange(t){u(this,Ai)&&(this.removeEventListener("change",u(this,Ai)),E(this,Ai,void 0)),typeof t=="function"&&(E(this,Ai,t),this.addEventListener("change",t))}};yi=new WeakMap,Ti=new WeakMap,Ai=new WeakMap;var wn,fs=class{constructor(){W(this,"src");W(this,"id");W(this,"width");W(this,"height");W(this,"bitrate");W(this,"frameRate");W(this,"codec");L(this,wn,!1)}get selected(){return u(this,wn)}set selected(e){u(this,wn)!==e&&(E(this,wn,e),Um(this))}};wn=new WeakMap;var In,Cn=class{constructor(){W(this,"id");W(this,"kind");W(this,"label","");W(this,"language","");W(this,"sourceBuffer");L(this,In,!1)}addRendition(e,t,r,n,o,s){let l=new fs;return l.src=e,l.width=t,l.height=r,l.frameRate=s,l.bitrate=o,l.codec=n,Om(this,l),l}removeRendition(e){Nm(e)}get selected(){return u(this,In)}set selected(e){u(this,In)!==e&&(E(this,In,e),e===!0&&Dm(this))}};In=new WeakMap;function Hm(i,e){let t=S(i).media.audioRenditions;S(e).media=S(i).media,S(e).track=i;let r=S(i).renditionSet;r.add(e);let n=r.size-1;n in vr.prototype||Object.defineProperty(vr.prototype,n,{get(){return Rn(this)[n]}}),queueMicrotask(()=>{i.enabled&&t.dispatchEvent(new zt("addrendition",{rendition:e}))})}function $m(i){let e=S(i).media.audioRenditions,t=S(i).track;S(t).renditionSet.delete(i),queueMicrotask(()=>{S(i).track.enabled&&e.dispatchEvent(new zt("removerendition",{rendition:i}))})}function Vm(i){let e=S(i).media.audioRenditions;!e||S(e).changeRequested||(S(e).changeRequested=!0,queueMicrotask(()=>{delete S(e).changeRequested,S(i).track.enabled&&e.dispatchEvent(new Event("change"))}))}function Rn(i){return[...S(i).media.audioTracks].filter(t=>t.enabled).flatMap(t=>[...S(t).renditionSet])}var Si,ki,Li,vr=class extends EventTarget{constructor(){super(...arguments);L(this,Si);L(this,ki);L(this,Li)}[Symbol.iterator](){return Rn(this).values()}get length(){return Rn(this).length}getRenditionById(t){return Rn(this).find(r=>`${r.id}`==`${t}`)??null}get selectedIndex(){return Rn(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[r,n]of Rn(this).entries())n.selected=r===t}get onaddrendition(){return u(this,Si)}set onaddrendition(t){u(this,Si)&&(this.removeEventListener("addrendition",u(this,Si)),E(this,Si,void 0)),typeof t=="function"&&(E(this,Si,t),this.addEventListener("addrendition",t))}get onremoverendition(){return u(this,ki)}set onremoverendition(t){u(this,ki)&&(this.removeEventListener("removerendition",u(this,ki)),E(this,ki,void 0)),typeof t=="function"&&(E(this,ki,t),this.addEventListener("removerendition",t))}get onchange(){return u(this,Li)}set onchange(t){u(this,Li)&&(this.removeEventListener("change",u(this,Li)),E(this,Li,void 0)),typeof t=="function"&&(E(this,Li,t),this.addEventListener("change",t))}};Si=new WeakMap,ki=new WeakMap,Li=new WeakMap;var Mn,Es=class{constructor(){W(this,"src");W(this,"id");W(this,"bitrate");W(this,"codec");L(this,Mn,!1)}get selected(){return u(this,Mn)}set selected(e){u(this,Mn)!==e&&(E(this,Mn,e),Vm(this))}};Mn=new WeakMap;function Hl(i,e){let t=i.audioTracks;S(e).media=i,S(e).renditionSet||(S(e).renditionSet=new Set);let r=S(t).trackSet;r.add(e);let n=r.size-1;n in fr.prototype||Object.defineProperty(fr.prototype,n,{get(){return[...S(this).trackSet][n]}}),queueMicrotask(()=>{t.dispatchEvent(new Gt("addtrack",{track:e}))})}function $l(i){var r;let e=(r=S(i).media)==null?void 0:r.audioTracks;if(!e)return;S(e).trackSet.delete(i),queueMicrotask(()=>{e.dispatchEvent(new Gt("removetrack",{track:i}))})}function Bm(i){let e=S(i).media.audioTracks;!e||S(e).changeRequested||(S(e).changeRequested=!0,queueMicrotask(()=>{delete S(e).changeRequested,e.dispatchEvent(new Event("change"))}))}var wi,Ii,Ci,xn,Ul,fr=class extends EventTarget{constructor(){super();L(this,xn);L(this,wi);L(this,Ii);L(this,Ci);S(this).trackSet=new Set}[Symbol.iterator](){return u(this,xn,Ul).values()}get length(){return u(this,xn,Ul).size}getTrackById(t){return[...u(this,xn,Ul)].find(r=>r.id===t)??null}get onaddtrack(){return u(this,wi)}set onaddtrack(t){u(this,wi)&&(this.removeEventListener("addtrack",u(this,wi)),E(this,wi,void 0)),typeof t=="function"&&(E(this,wi,t),this.addEventListener("addtrack",t))}get onremovetrack(){return u(this,Ii)}set onremovetrack(t){u(this,Ii)&&(this.removeEventListener("removetrack",u(this,Ii)),E(this,Ii,void 0)),typeof t=="function"&&(E(this,Ii,t),this.addEventListener("removetrack",t))}get onchange(){return u(this,Ci)}set onchange(t){u(this,Ci)&&(this.removeEventListener("change",u(this,Ci)),E(this,Ci,void 0)),typeof t=="function"&&(E(this,Ci,t),this.addEventListener("change",t))}};wi=new WeakMap,Ii=new WeakMap,Ci=new WeakMap,xn=new WeakSet,Ul=function(){return S(this).trackSet};var Pn,Dn=class{constructor(){W(this,"id");W(this,"kind");W(this,"label","");W(this,"language","");W(this,"sourceBuffer");L(this,Pn,!1)}addRendition(e,t,r){let n=new Es;return n.src=e,n.codec=t,n.bitrate=r,Hm(this,n),n}removeRendition(e){$m(e)}get enabled(){return u(this,Pn)}set enabled(e){u(this,Pn)!==e&&(E(this,Pn,e),Bm(this))}};Pn=new WeakMap;var Wm=Vl(globalThis.HTMLMediaElement,"video"),Fm=Vl(globalThis.HTMLMediaElement,"audio");function On(i){if(!(i!=null&&i.prototype))return i;let e=Vl(i,"video");(!e||`${e}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"videoTracks",{get(){return lb(this)}});let t=Vl(i,"audio");(!t||`${t}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"audioTracks",{get(){return db(this)}}),"addVideoTrack"in i.prototype||(i.prototype.addVideoTrack=function(o,s="",l=""){let d=new Cn;return d.kind=o,d.label=s,d.language=l,Ol(this,d),d}),"removeVideoTrack"in i.prototype||(i.prototype.removeVideoTrack=Nl),"addAudioTrack"in i.prototype||(i.prototype.addAudioTrack=function(o,s="",l=""){let d=new Dn;return d.kind=o,d.label=s,d.language=l,Hl(this,d),d}),"removeAudioTrack"in i.prototype||(i.prototype.removeAudioTrack=$l),"videoRenditions"in i.prototype||Object.defineProperty(i.prototype,"videoRenditions",{get(){return r(this)}});let r=o=>{let s=S(o).videoRenditions;return s||(s=new mr,S(s).media=o,S(o).videoRenditions=s),s};"audioRenditions"in i.prototype||Object.defineProperty(i.prototype,"audioRenditions",{get(){return n(this)}});let n=o=>{let s=S(o).audioRenditions;return s||(s=new vr,S(s).media=o,S(o).audioRenditions=s),s};return i}function Vl(i,e){var t;if(i!=null&&i.prototype)return(t=Object.getOwnPropertyDescriptor(i.prototype,`${e}Tracks`))==null?void 0:t.get}function lb(i){let e=S(i).videoTracks;if(!e&&(e=new pr,S(i).videoTracks=e,Wm)){let t=Wm.call(i.nativeEl??i);for(let r of t)Ol(i,r);t.addEventListener("change",()=>{e.dispatchEvent(new Event("change"))}),t.addEventListener("addtrack",r=>{if([...e].some(n=>n instanceof Cn)){for(let n of t)Nl(n);return}Ol(i,r.track)}),t.addEventListener("removetrack",r=>{Nl(r.track)})}return e}function db(i){let e=S(i).audioTracks;if(!e&&(e=new fr,S(i).audioTracks=e,Fm)){let t=Fm.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(n=>n instanceof Dn)){for(let n of t)$l(n);return}Hl(i,r.track)}),t.addEventListener("removetrack",r=>{$l(r.track)})}return e}import Ge from"hls.js";var cb=On(He),Yt,Qt,Zt,Nn,et,mu,Km,vu,gs,qm,Er=class extends cb{constructor(){super();L(this,et);L(this,Yt,null);L(this,Qt,null);L(this,Zt,null);L(this,Nn,!1);this.api=null;L(this,gs,()=>{var r,n;let t=this.nativeEl;t!=null&&t.webkitCurrentPlaybackTargetIsWireless?(r=this.api)==null||r.stopLoad():(n=this.api)==null||n.startLoad()});D(this,et,qm).call(this,"config")}static getTemplateHTML(t,r={}){let{src:n,...o}=t;return`
|
|
2903
2903
|
<script type="application/json" id="config">
|
|
2904
2904
|
${JSON.stringify(r.config||{})}
|
|
2905
2905
|
<\/script>
|
|
2906
2906
|
${He.getTemplateHTML(o)}
|
|
2907
|
-
`}get config(){return u(this,Zt)}set config(t){E(this,Zt,t)}get activeVideoElement(){return this.nativeEl??null}attributeChangedCallback(t,r,n){t!=="src"&&super.attributeChangedCallback(t,r,n),t==="src"&&r!==n&&this.load()}disconnectedCallback(){var t;D(this,et,mu).call(this),(t=super.disconnectedCallback)==null||t.call(this)}async load(){var n,o,s,l;let t=!this.api&&!u(this,Nn);if(D(this,et,mu).call(this),!this.src)return;if(t&&!u(this,Zt))try{E(this,Zt,JSON.parse(((o=(n=this.shadowRoot)==null?void 0:n.getElementById("config"))==null?void 0:o.textContent)||"{}"))}catch(d){console.error("[hls-video] Failed to parse config:",d),E(this,Zt,{})}if(!D(this,et,Km).call(this,this.src)){await Promise.resolve(),E(this,Nn,!0),this.nativeEl.src=this.src;return}if(Ge.isSupported()){switch(await Promise.resolve(),this.api=new Ge({liveDurationInfinity:!0,autoStartLoad:!1,...u(this,Zt)}),this.api.loadSource(this.src),this.api.attachMedia(this.nativeEl),this.nativeEl.preload){case"none":{let m=()=>{var _;return(_=this.api)==null?void 0:_.startLoad()};this.nativeEl.addEventListener("play",m,{once:!0}),this.api.on(Ge.Events.DESTROYING,()=>{this.nativeEl.removeEventListener("play",m)});break}case"metadata":{let m=this.api.config.maxBufferLength,_=this.api.config.maxBufferSize;this.api.config.maxBufferLength=1,this.api.config.maxBufferSize=1;let g=()=>{this.api&&(this.api.config.maxBufferLength=m,this.api.config.maxBufferSize=_)};this.nativeEl.addEventListener("play",g,{once:!0}),this.api.on(Ge.Events.DESTROYING,()=>{this.nativeEl.removeEventListener("play",g)}),this.api.startLoad();break}default:this.api.startLoad()}this.nativeEl.webkitCurrentPlaybackTargetIsWireless&&this.api.stopLoad(),this.nativeEl.addEventListener("webkitcurrentplaybacktargetiswirelesschanged",u(this,gs)),E(this,Yt,document.createElement("source")),u(this,Yt).setAttribute("type","application/x-mpegURL"),u(this,Yt).setAttribute("src",this.src),this.nativeEl.disableRemotePlayback=!1,this.nativeEl.append(u(this,Yt));let h=new WeakMap;this.api.on(Ge.Events.MANIFEST_PARSED,(m,_)=>{this.nativeEl.autoplay&&this.nativeEl.paused&&this.nativeEl.play().catch(
|
|
2907
|
+
`}get config(){return u(this,Zt)}set config(t){E(this,Zt,t)}get activeVideoElement(){return this.nativeEl??null}attributeChangedCallback(t,r,n){t!=="src"&&super.attributeChangedCallback(t,r,n),t==="src"&&r!==n&&this.load()}disconnectedCallback(){var t;D(this,et,mu).call(this),(t=super.disconnectedCallback)==null||t.call(this)}async load(){var n,o,s,l;let t=!this.api&&!u(this,Nn);if(D(this,et,mu).call(this),!this.src)return;if(t&&!u(this,Zt))try{E(this,Zt,JSON.parse(((o=(n=this.shadowRoot)==null?void 0:n.getElementById("config"))==null?void 0:o.textContent)||"{}"))}catch(d){console.error("[hls-video] Failed to parse config:",d),E(this,Zt,{})}if(!D(this,et,Km).call(this,this.src)){await Promise.resolve(),E(this,Nn,!0),this.nativeEl.src=this.src;return}if(Ge.isSupported()){switch(await Promise.resolve(),this.api=new Ge({liveDurationInfinity:!0,autoStartLoad:!1,...u(this,Zt)}),this.api.loadSource(this.src),this.api.attachMedia(this.nativeEl),this.nativeEl.preload){case"none":{let m=()=>{var _;return(_=this.api)==null?void 0:_.startLoad()};this.nativeEl.addEventListener("play",m,{once:!0}),this.api.on(Ge.Events.DESTROYING,()=>{this.nativeEl.removeEventListener("play",m)});break}case"metadata":{let m=this.api.config.maxBufferLength,_=this.api.config.maxBufferSize;this.api.config.maxBufferLength=1,this.api.config.maxBufferSize=1;let g=()=>{this.api&&(this.api.config.maxBufferLength=m,this.api.config.maxBufferSize=_)};this.nativeEl.addEventListener("play",g,{once:!0}),this.api.on(Ge.Events.DESTROYING,()=>{this.nativeEl.removeEventListener("play",g)}),this.api.startLoad();break}default:this.api.startLoad()}this.nativeEl.webkitCurrentPlaybackTargetIsWireless&&this.api.stopLoad(),this.nativeEl.addEventListener("webkitcurrentplaybacktargetiswirelesschanged",u(this,gs)),E(this,Yt,document.createElement("source")),u(this,Yt).setAttribute("type","application/x-mpegURL"),u(this,Yt).setAttribute("src",this.src),this.nativeEl.disableRemotePlayback=!1,this.nativeEl.append(u(this,Yt));let h=new WeakMap;this.api.on(Ge.Events.MANIFEST_PARSED,(m,_)=>{this.nativeEl.autoplay&&this.nativeEl.paused&&this.nativeEl.play().catch(w=>{console.warn("Autoplay failed:",w)}),D(this,et,vu).call(this);let g=this.videoTracks.getTrackById("main");g||(g=this.addVideoTrack("main"),g.id="main",g.selected=!0);for(let[w,k]of _.levels.entries()){let oe=g.addRendition(k.url[0],k.width,k.height,k.videoCodec??void 0,k.bitrate);h.set(k,`${w}`),oe.id=`${w}`}for(let[w,k]of _.audioTracks.entries()){let oe=k.default?"main":"alternative",we=this.addAudioTrack(oe,k.name,k.lang);we.id=`${w}`,k.default&&(we.enabled=!0)}}),(s=u(this,Qt))==null||s.call(this);let p=()=>{var w,k;let m=[...this.audioTracks].find(oe=>oe.enabled),_=m?+m.id:void 0,g=((w=this.api)==null?void 0:w.audioTracks.map(oe=>oe.id))??[];_!==void 0&&_!==((k=this.api)==null?void 0:k.audioTrack)&&g.includes(_)&&this.api&&(this.api.audioTrack=_)};this.audioTracks.addEventListener("change",p),E(this,Qt,()=>{this.audioTracks.removeEventListener("change",p)}),this.api.on(Ge.Events.LEVELS_UPDATED,(m,_)=>{let g=[...this.videoTracks][this.videoTracks.selectedIndex??0];if(!g)return;let w=_.levels.map(k=>h.get(k));for(let k of this.videoRenditions)k.id&&!w.includes(k.id)&&g.removeRendition(k)});let v=null;this.api.on(Ge.Events.ERROR,(m,_)=>{var g;_.type===Ge.ErrorTypes.NETWORK_ERROR&&_.details===Ge.ErrorDetails.FRAG_LOAD_ERROR&&(v=((g=_.frag)==null?void 0:g.level)??null)}),this.api.on(Ge.Events.LEVEL_SWITCHED,(m,_)=>{let g=_.level;v!==null&&g<v&&(console.warn(`hls.js downgraded quality from level ${v} to ${g} due to fragment load failure.`),this.videoRenditions.selectedIndex=g,v=null)});let f=()=>{let m=this.videoRenditions.selectedIndex;this.api&&m!==this.api.nextLevel&&(this.api.nextLevel=m)};(l=this.videoRenditions)==null||l.addEventListener("change",f),this.api.once(Ge.Events.DESTROYING,()=>{var m,_;D(this,et,vu).call(this),(m=this.videoRenditions)==null||m.removeEventListener("change",f),(_=u(this,Qt))==null||_.call(this),E(this,Qt,null)});return}await Promise.resolve(),this.nativeEl.canPlayType("application/vnd.apple.mpegurl")&&(this.nativeEl.src=this.src)}};Yt=new WeakMap,Qt=new WeakMap,Zt=new WeakMap,Nn=new WeakMap,et=new WeakSet,mu=function(){var t,r,n;(t=u(this,Yt))==null||t.remove(),E(this,Yt,null),(r=u(this,Qt))==null||r.call(this),E(this,Qt,null),(n=this.nativeEl)==null||n.removeEventListener("webkitcurrentplaybacktargetiswirelesschanged",u(this,gs)),this.api&&(this.api.detachMedia(),this.api.destroy(),this.api=null),E(this,Nn,!1)},Km=function(t){return t.includes(".m3u8")||t.includes("application/x-mpegURL")},vu=function(){for(let t of this.videoTracks)this.removeVideoTrack(t);for(let t of this.audioTracks)this.removeAudioTrack(t)},gs=new WeakMap,qm=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let r=this[t];delete this[t],this[t]=r}},Er.shadowRootOptions={...He.shadowRootOptions};globalThis.customElements&&!globalThis.customElements.get("hls-video")&&globalThis.customElements.define("hls-video",Er);var Gm=Er;var ub="nanoplayer.4.min.js",hb="nanoplayer",Re={loading:!1,loaded:!1,error:null,callbacks:[]};function pb(i,e){return new Promise((t,r)=>{if(window.NanoPlayer){Re.loaded=!0,t();return}if(Re.loaded){t();return}if(Re.error){r(Re.error);return}if(Re.callbacks.push(s=>{s?r(s):t()}),Re.loading)return;Re.loading=!0;let n;e?n=e:n=`${i.endsWith("/")?i:`${i}/`}${hb}/${ub}`;let o=document.createElement("script");o.src=n,o.async=!0,o.onload=()=>{Re.loaded=!0,Re.loading=!1,Re.callbacks.forEach(s=>s()),Re.callbacks=[]},o.onerror=()=>{let s=new Error(`Failed to load NanoPlayer script from ${n}`);Re.error=s,Re.loading=!1,Re.callbacks.forEach(l=>l(s)),Re.callbacks=[]},document.head.appendChild(o)})}var mb=On(He),ct,Ri,me,ut,Un,Se,bs,Mi,xi,gr,br,ht,_r,Hn,$n,Le,zm,fu,Ym,Qm,Zm,Bl,yr=class extends mb{constructor(){super();L(this,Le);L(this,ct,null);L(this,Ri,null);L(this,me,null);L(this,ut,null);L(this,Un,"");L(this,Se,null);L(this,bs,!0);L(this,Mi,[]);L(this,xi,[]);L(this,gr,[]);L(this,br,null);L(this,ht,null);L(this,_r,!1);L(this,Hn,!1);L(this,$n,null);this.api=null;D(this,Le,Bl).call(this,"config"),D(this,Le,Bl).call(this,"streamid"),D(this,Le,Bl).call(this,"sourceConfig"),D(this,Le,zm).call(this)}static get observedAttributes(){return[...He.observedAttributes,"streamid","library-location"]}static getTemplateHTML(t,r={}){let{streamid:n,"library-location":o,...s}=t;return`
|
|
2908
2908
|
<script type="application/json" id="config">
|
|
2909
2909
|
${JSON.stringify(r.config||{})}
|
|
2910
2910
|
<\/script>
|
|
2911
2911
|
${He.getTemplateHTML(s)}
|
|
2912
|
-
`}get activeVideoElement(){return u(this,Se)}get config(){return u(this,ct)}set config(t){E(this,ct,t)}get sourceConfig(){return u(this,Ri)}set sourceConfig(t){let r=u(this,Ri)!==t;E(this,Ri,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,n){t==="streamid"&&r!==n?this.load():t!=="streamid"&&t!=="library-location"&&super.attributeChangedCallback(t,r,n)}async load(){var s,l,d,h,p,v;let t=!u(this,me);D(this,Le,fu).call(this);let r=this.streamid,n=!!u(this,Ri);if(!r&&!n)return;if(E(this,br,new Promise(f=>{E(this,ht,f)})),t&&!u(this,ct))try{E(this,ct,JSON.parse(((l=(s=this.shadowRoot)==null?void 0:s.getElementById("config"))==null?void 0:l.textContent)||"{}"))}catch(f){console.error("[nano-video] Failed to parse config:",f),E(this,ct,{})}try{await pb(this.libraryLocation,(d=u(this,ct))==null?void 0:d.scriptUrl)}catch(f){console.error("[nano-video] Failed to load NanoPlayer script:",f),this.dispatchEvent(rt(f)),(h=u(this,ht))==null||h.call(this);return}E(this,Un,`nano-video-${Date.now()}-${Math.random().toString(36).slice(2,9)}`),E(this,ut,document.createElement("div")),u(this,ut).id=u(this,Un),u(this,ut).style.cssText="width: 100%; height: 100%; position: absolute; top: 0; left: 0;",getComputedStyle(this).position==="static"&&(this.style.position="relative"),this.nativeEl.style.display="none",this.appendChild(u(this,ut)),E(this,me,new window.NanoPlayer(u(this,Un))),this.api=u(this,me);try{let f=D(this,Le,Ym).call(this,r,n?u(this,Ri):void 0),m=await u(this,me).setup(f);E(this,gr,((p=m.source.entries)==null?void 0:p.map((_,g)=>({index:g,height:_.info.height??0,width:_.info.width??0,bitrate:_.info.bitrate??0,label:_.info.height?`${_.info.height}p`:g===0?"Source":`Stream ${g+1}`})))??[]),D(this,Le,Zm).call(this)}catch(f){console.error("[nano-video] Failed to setup NanoPlayer:",f),this.dispatchEvent(rt(f)),(v=u(this,ht))==null||v.call(this)}}async play(){if(u(this,br)&&await u(this,br),u(this,me)){E(this,_r,!0),u(this,me).play();return}return super.play()}pause(){if(u(this,me)){u(this,me).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,me)||(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,me)?t?u(this,me).mute():u(this,me).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,r;D(this,Le,fu).call(this),(t=u(this,$n))==null||t.call(this),E(this,$n,null),(r=super.disconnectedCallback)==null||r.call(this)}};ct=new WeakMap,Ri=new WeakMap,me=new WeakMap,ut=new WeakMap,Un=new WeakMap,Se=new WeakMap,bs=new WeakMap,Mi=new WeakMap,xi=new WeakMap,gr=new WeakMap,br=new WeakMap,ht=new WeakMap,_r=new WeakMap,Hn=new WeakMap,$n=new WeakMap,Le=new WeakSet,zm=function(){let t=r=>{var n;r.target!==this&&((n=u(this,ut))!=null&&n.contains(r.target))&&u(this,_r)&&r.stopImmediatePropagation()};this.addEventListener("pause",t,!0),E(this,$n,()=>this.removeEventListener("pause",t,!0))},fu=function(){var t;(t=u(this,ht))==null||t.call(this),E(this,br,null),E(this,ht,null),u(this,Mi).forEach(r=>r()),E(this,Mi,[]),u(this,xi).forEach(r=>r()),E(this,xi,[]);for(let r of this.videoTracks)this.removeVideoTrack(r);for(let r of this.audioTracks)this.removeAudioTrack(r);u(this,me)&&(u(this,me).destroy(),E(this,me,null),this.api=null),u(this,ut)&&(u(this,ut).remove(),E(this,ut,null)),u(this,Se)&&(E(this,Se,null),this.dispatchEvent(new CustomEvent("activevideoelementchange",{detail:{video:null}}))),E(this,Hn,!1),E(this,gr,[])},Ym=function(t,r){var o,s;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:((o=u(this,ct))==null?void 0:o.reconnect)??{minDelay:2,maxDelay:10,delaySteps:10,maxRetries:10},buffer:((s=u(this,ct))==null?void 0:s.buffer)??{min:.1,max:2,target:.5}},style:{width:"100%",height:"100%",controls:!1,view:!1,interactive:!1},events:{onReady:()=>{var l;this.dispatchEvent(Z(gd)),this.dispatchEvent(Z(ao)),this.dispatchEvent(Z(xs)),(l=u(this,ht))==null||l.call(this)},onPlay:()=>{E(this,_r,!1),E(this,Hn,!0),this.dispatchEvent(Z(no)),this.dispatchEvent(Z(ii))},onPause:()=>{this.dispatchEvent(Z(
|
|
2912
|
+
`}get activeVideoElement(){return u(this,Se)}get config(){return u(this,ct)}set config(t){E(this,ct,t)}get sourceConfig(){return u(this,Ri)}set sourceConfig(t){let r=u(this,Ri)!==t;E(this,Ri,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,n){t==="streamid"&&r!==n?this.load():t!=="streamid"&&t!=="library-location"&&super.attributeChangedCallback(t,r,n)}async load(){var s,l,d,h,p,v;let t=!u(this,me);D(this,Le,fu).call(this);let r=this.streamid,n=!!u(this,Ri);if(!r&&!n)return;if(E(this,br,new Promise(f=>{E(this,ht,f)})),t&&!u(this,ct))try{E(this,ct,JSON.parse(((l=(s=this.shadowRoot)==null?void 0:s.getElementById("config"))==null?void 0:l.textContent)||"{}"))}catch(f){console.error("[nano-video] Failed to parse config:",f),E(this,ct,{})}try{await pb(this.libraryLocation,(d=u(this,ct))==null?void 0:d.scriptUrl)}catch(f){console.error("[nano-video] Failed to load NanoPlayer script:",f),this.dispatchEvent(rt(f)),(h=u(this,ht))==null||h.call(this);return}E(this,Un,`nano-video-${Date.now()}-${Math.random().toString(36).slice(2,9)}`),E(this,ut,document.createElement("div")),u(this,ut).id=u(this,Un),u(this,ut).style.cssText="width: 100%; height: 100%; position: absolute; top: 0; left: 0;",getComputedStyle(this).position==="static"&&(this.style.position="relative"),this.nativeEl.style.display="none",this.appendChild(u(this,ut)),E(this,me,new window.NanoPlayer(u(this,Un))),this.api=u(this,me);try{let f=D(this,Le,Ym).call(this,r,n?u(this,Ri):void 0),m=await u(this,me).setup(f);E(this,gr,((p=m.source.entries)==null?void 0:p.map((_,g)=>({index:g,height:_.info.height??0,width:_.info.width??0,bitrate:_.info.bitrate??0,label:_.info.height?`${_.info.height}p`:g===0?"Source":`Stream ${g+1}`})))??[]),D(this,Le,Zm).call(this)}catch(f){console.error("[nano-video] Failed to setup NanoPlayer:",f),this.dispatchEvent(rt(f)),(v=u(this,ht))==null||v.call(this)}}async play(){if(u(this,br)&&await u(this,br),u(this,me)){E(this,_r,!0),u(this,me).play();return}return super.play()}pause(){if(u(this,me)){u(this,me).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,me)||(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,me)?t?u(this,me).mute():u(this,me).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,r;D(this,Le,fu).call(this),(t=u(this,$n))==null||t.call(this),E(this,$n,null),(r=super.disconnectedCallback)==null||r.call(this)}};ct=new WeakMap,Ri=new WeakMap,me=new WeakMap,ut=new WeakMap,Un=new WeakMap,Se=new WeakMap,bs=new WeakMap,Mi=new WeakMap,xi=new WeakMap,gr=new WeakMap,br=new WeakMap,ht=new WeakMap,_r=new WeakMap,Hn=new WeakMap,$n=new WeakMap,Le=new WeakSet,zm=function(){let t=r=>{var n;r.target!==this&&((n=u(this,ut))!=null&&n.contains(r.target))&&u(this,_r)&&r.stopImmediatePropagation()};this.addEventListener("pause",t,!0),E(this,$n,()=>this.removeEventListener("pause",t,!0))},fu=function(){var t;(t=u(this,ht))==null||t.call(this),E(this,br,null),E(this,ht,null),u(this,Mi).forEach(r=>r()),E(this,Mi,[]),u(this,xi).forEach(r=>r()),E(this,xi,[]);for(let r of this.videoTracks)this.removeVideoTrack(r);for(let r of this.audioTracks)this.removeAudioTrack(r);u(this,me)&&(u(this,me).destroy(),E(this,me,null),this.api=null),u(this,ut)&&(u(this,ut).remove(),E(this,ut,null)),u(this,Se)&&(E(this,Se,null),this.dispatchEvent(new CustomEvent("activevideoelementchange",{detail:{video:null}}))),E(this,Hn,!1),E(this,gr,[])},Ym=function(t,r){var o,s;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:((o=u(this,ct))==null?void 0:o.reconnect)??{minDelay:2,maxDelay:10,delaySteps:10,maxRetries:10},buffer:((s=u(this,ct))==null?void 0:s.buffer)??{min:.1,max:2,target:.5}},style:{width:"100%",height:"100%",controls:!1,view:!1,interactive:!1},events:{onReady:()=>{var l;this.dispatchEvent(Z(gd)),this.dispatchEvent(Z(ao)),this.dispatchEvent(Z(xs)),(l=u(this,ht))==null||l.call(this)},onPlay:()=>{E(this,_r,!1),E(this,Hn,!0),this.dispatchEvent(Z(no)),this.dispatchEvent(Z(ii))},onPause:()=>{this.dispatchEvent(Z(Vi))},onLoading:()=>{this.dispatchEvent(Z(Mr))},onStartBuffering:()=>{this.dispatchEvent(Z(Mr))},onStopBuffering:()=>{this.dispatchEvent(Z(xs)),this.dispatchEvent(Z(ii))},onError:l=>{var p,v;E(this,_r,!1);let d=l.data.code??-1,h=l.data.message??"NanoPlayer error";if(d===2004&&u(this,Hn)){this.dispatchEvent(Z(oo)),(p=u(this,ht))==null||p.call(this);return}this.dispatchEvent(rt(new Error(h),d)),(v=u(this,ht))==null||v.call(this)},onActiveVideoElementChange:l=>{var h;let d=(h=l.data)==null?void 0:h.activeVideoElement;d&&d!==u(this,Se)&&(E(this,Se,d),D(this,Le,Qm).call(this,d),this.dispatchEvent(new CustomEvent("activevideoelementchange",{detail:{video:d}})))}}}},Qm=function(t){u(this,Mi).forEach(n=>n()),E(this,Mi,[]);let r=[so,lo,vd,ri];for(let n of r){let o=()=>{this.dispatchEvent(Z(n))};t.addEventListener(n,o),u(this,Mi).push(()=>t.removeEventListener(n,o))}},Zm=function(){u(this,xi).forEach(n=>n()),E(this,xi,[]);for(let n of this.videoTracks)this.removeVideoTrack(n);for(let n of this.audioTracks)this.removeAudioTrack(n);if(u(this,gr).length===0)return;let t=this.addVideoTrack("main");t.id="main",t.selected=!0;for(let n of u(this,gr)){let o=t.addRendition("",n.width,n.height,void 0,n.bitrate);o.id=`${n.index}`}let r=()=>{var o,s,l;let n=this.videoRenditions.selectedIndex;n<0?(E(this,bs,!0),(o=u(this,me))==null||o.setAdaption({rule:"deviationOfMean2"})):(E(this,bs,!1),(s=u(this,me))==null||s.switchStream(n).catch(d=>{console.warn("[nano-video] Quality switch failed:",d)}),(l=u(this,me))==null||l.setAdaption({rule:"none"}))};this.videoRenditions.addEventListener("change",r),u(this,xi).push(()=>{this.videoRenditions.removeEventListener("change",r)})},Bl=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let r=this[t];delete this[t],this[t]=r}},yr.shadowRootOptions={...He.shadowRootOptions};globalThis.customElements&&!globalThis.customElements.get("nano-video")&&globalThis.customElements.define("nano-video",yr);var Xm=yr;import{DisconnectReason as vb,Room as fb,RoomEvent as de,Track as Wl,VideoQuality as Eb}from"livekit-client";var gb=On(He),ze,B,re,$e,tt,Vn,Bn,Ot,Tr,Pi,ue,Fl,jm,Jm,Kl,ev,tv,ql,Ar=class extends gb{constructor(){super();L(this,ue);L(this,ze,null);L(this,B,null);L(this,re,null);L(this,$e,null);L(this,tt,[]);L(this,Vn,[]);L(this,Bn,[]);L(this,Ot,"disconnected");L(this,Tr,null);L(this,Pi,null);this.room=null;D(this,ue,ql).call(this,"config"),D(this,ue,ql).call(this,"url"),D(this,ue,ql).call(this,"token")}static get observedAttributes(){return[...He.observedAttributes,"url","token"]}static getTemplateHTML(t,r={}){let{url:n,token:o,...s}=t;return`
|
|
2913
2913
|
<script type="application/json" id="config">
|
|
2914
2914
|
${JSON.stringify(r.config||{})}
|
|
2915
2915
|
<\/script>
|
|
2916
2916
|
${He.getTemplateHTML(s)}
|
|
2917
|
-
`}get activeVideoElement(){return u(this,re)}get config(){return u(this,ze)}set config(t){E(this,ze,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,n){(t==="url"||t==="token")&&r!==n?this.url&&this.token?this.load():u(this,
|
|
2917
|
+
`}get activeVideoElement(){return u(this,re)}get config(){return u(this,ze)}set config(t){E(this,ze,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,n){(t==="url"||t==="token")&&r!==n?this.url&&this.token?this.load():u(this,B)&&D(this,ue,Fl).call(this):t!=="url"&&t!=="token"&&super.attributeChangedCallback(t,r,n)}async load(){var we,Xt,Nt;let t=!u(this,B);D(this,ue,Fl).call(this);let r=this.url,n=this.token;if(!r||!n)return;if(E(this,Tr,new Promise(A=>{E(this,Pi,A)})),t&&!u(this,ze))try{E(this,ze,JSON.parse(((Xt=(we=this.shadowRoot)==null?void 0:we.getElementById("config"))==null?void 0:Xt.textContent)||"{}"))}catch(A){console.error("[livekit-video] Failed to parse config:",A),E(this,ze,{})}let o=D(this,ue,ev).call(this),s=D(this,ue,tv).call(this);E(this,B,new fb(o)),this.room=u(this,B);let l=()=>{E(this,Ot,"connected")},d=A=>{let Ve=A!=null?vb[A]??String(A):"undefined";console.log("[livekit-video] Disconnected",{reason:A,reasonName:Ve,documentHidden:document.hidden,documentHasFocus:document.hasFocus(),visibilityState:document.visibilityState}),E(this,Ot,"disconnected"),A?this.dispatchEvent(rt(new Error(`LiveKit disconnected: ${Ve} (${A})`),4001)):this.dispatchEvent(Z(oo))},h=()=>{console.log("[livekit-video] Reconnecting",{documentHidden:document.hidden,documentHasFocus:document.hasFocus()}),E(this,Ot,"reconnecting"),this.dispatchEvent(Z(Mr))},p=()=>{console.log("[livekit-video] Reconnected"),E(this,Ot,"connected"),this.dispatchEvent(Z(ii))},v=()=>{console.log("[livekit-video] SignalReconnecting")},f=A=>{console.log("[livekit-video] ConnectionStateChanged",A)},m=A=>{console.error("[livekit-video] MediaDevicesError",A)},_=(A,Ve,I)=>{console.error("[livekit-video] TrackSubscriptionFailed",{trackSid:A,reason:I})},g=A=>{console.log("[livekit-video] TrackMuted",{sid:A.trackSid,kind:A.kind})},w=A=>{console.log("[livekit-video] TrackUnmuted",{sid:A.trackSid,kind:A.kind})},k=(A,Ve)=>{var I,K,se;if(A.kind===Wl.Kind.Video){let U=A.attach();U.style.width="100%",U.style.height="100%",U.style.objectFit="contain",U.style.position="absolute",U.style.top="0",U.style.left="0",U.playsInline=!0,U.setAttribute("playsinline",""),U.setAttribute("webkit-playsinline",""),this.nativeEl.muted&&(U.muted=!0),this.nativeEl.style.display="none",(I=this.shadowRoot)==null||I.appendChild(U),E(this,re,U),D(this,ue,jm).call(this,U),D(this,ue,Jm).call(this,Ve),this.dispatchEvent(new CustomEvent("activevideoelementchange",{detail:{video:U}})),this.dispatchEvent(Z(Ed)),this.dispatchEvent(Z(ri)),this.dispatchEvent(Z(ao)),this.dispatchEvent(Z(ii)),(K=u(this,Pi))==null||K.call(this)}else if(A.kind===Wl.Kind.Audio){let U=A.attach();U.style.display="none";let G=u(this,re)??this.nativeEl;U.muted=G.muted,U.volume=G.volume,(se=this.shadowRoot)==null||se.appendChild(U),E(this,$e,U)}},oe=A=>{A.kind===Wl.Kind.Video?(A.detach(),D(this,ue,Kl).call(this),u(this,re)&&(u(this,tt).forEach(Ve=>Ve()),E(this,tt,[]),u(this,re).remove(),E(this,re,null),this.dispatchEvent(new CustomEvent("activevideoelementchange",{detail:{video:null}})))):A.kind===Wl.Kind.Audio&&(A.detach(),u(this,$e)&&(u(this,$e).remove(),E(this,$e,null)))};u(this,B).on(de.Connected,l),u(this,B).on(de.Disconnected,d),u(this,B).on(de.Reconnecting,h),u(this,B).on(de.Reconnected,p),u(this,B).on(de.SignalReconnecting,v),u(this,B).on(de.ConnectionStateChanged,f),u(this,B).on(de.MediaDevicesError,m),u(this,B).on(de.TrackSubscribed,k),u(this,B).on(de.TrackUnsubscribed,oe),u(this,B).on(de.TrackSubscriptionFailed,_),u(this,B).on(de.TrackMuted,g),u(this,B).on(de.TrackUnmuted,w),E(this,Bn,[()=>{var A;return(A=u(this,B))==null?void 0:A.off(de.Connected,l)},()=>{var A;return(A=u(this,B))==null?void 0:A.off(de.Disconnected,d)},()=>{var A;return(A=u(this,B))==null?void 0:A.off(de.Reconnecting,h)},()=>{var A;return(A=u(this,B))==null?void 0:A.off(de.Reconnected,p)},()=>{var A;return(A=u(this,B))==null?void 0:A.off(de.SignalReconnecting,v)},()=>{var A;return(A=u(this,B))==null?void 0:A.off(de.ConnectionStateChanged,f)},()=>{var A;return(A=u(this,B))==null?void 0:A.off(de.MediaDevicesError,m)},()=>{var A;return(A=u(this,B))==null?void 0:A.off(de.TrackSubscribed,k)},()=>{var A;return(A=u(this,B))==null?void 0:A.off(de.TrackUnsubscribed,oe)},()=>{var A;return(A=u(this,B))==null?void 0:A.off(de.TrackSubscriptionFailed,_)},()=>{var A;return(A=u(this,B))==null?void 0:A.off(de.TrackMuted,g)},()=>{var A;return(A=u(this,B))==null?void 0:A.off(de.TrackUnmuted,w)}]),E(this,Ot,"connecting"),this.dispatchEvent(Z(fd));try{await u(this,B).connect(r,n,s)}catch(A){E(this,Ot,"failed"),console.error("[livekit-video] Failed to connect:",A);let Ve=A instanceof Error?A.message:"Failed to connect to LiveKit room";this.dispatchEvent(rt(new Error(Ve),4e3)),(Nt=u(this,Pi))==null||Nt.call(this)}}async play(){return u(this,Tr)&&await u(this,Tr),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,B)||(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,u(this,$e)&&(u(this,$e).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,u(this,$e)&&(u(this,$e).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;D(this,ue,Fl).call(this),(t=super.disconnectedCallback)==null||t.call(this)}};ze=new WeakMap,B=new WeakMap,re=new WeakMap,$e=new WeakMap,tt=new WeakMap,Vn=new WeakMap,Bn=new WeakMap,Ot=new WeakMap,Tr=new WeakMap,Pi=new WeakMap,ue=new WeakSet,Fl=function(){var t;(t=u(this,Pi))==null||t.call(this),E(this,Tr,null),E(this,Pi,null),u(this,tt).forEach(r=>r()),E(this,tt,[]),D(this,ue,Kl).call(this),u(this,Bn).forEach(r=>r()),E(this,Bn,[]),u(this,B)&&(u(this,B).disconnect(),E(this,B,null),this.room=null),u(this,re)&&(u(this,re).remove(),E(this,re,null),this.dispatchEvent(new CustomEvent("activevideoelementchange",{detail:{video:null}}))),u(this,$e)&&(u(this,$e).remove(),E(this,$e,null)),E(this,Ot,"disconnected")},jm=function(t){u(this,tt).forEach(s=>s()),E(this,tt,[]);let r=[so,lo,no,ii,Vi,ri];for(let s of r){let l=()=>{this.dispatchEvent(Z(s))};t.addEventListener(s,l),u(this,tt).push(()=>t.removeEventListener(s,l))}let n=()=>{var l,d,h;let s=t.srcObject;console.error("[livekit-video] attached <video> error",{code:(l=t.error)==null?void 0:l.code,message:(d=t.error)==null?void 0:d.message,readyState:t.readyState,networkState:t.networkState,paused:t.paused,srcObjectActive:s==null?void 0:s.active,tracks:s==null?void 0:s.getTracks().map(p=>({kind:p.kind,readyState:p.readyState,muted:p.muted,enabled:p.enabled})),documentHidden:document.hidden,documentHasFocus:document.hasFocus(),visibilityState:document.visibilityState,roomState:(h=u(this,B))==null?void 0:h.state})};t.addEventListener("error",n),u(this,tt).push(()=>t.removeEventListener("error",n));let o=()=>{console.warn("[livekit-video] attached <video> stalled",{readyState:t.readyState,networkState:t.networkState,documentHidden:document.hidden})};t.addEventListener("stalled",o),u(this,tt).push(()=>t.removeEventListener("stalled",o))},Jm=function(t){var l;D(this,ue,Kl).call(this);let r=(l=t.trackInfo)==null?void 0:l.layers;if(!r||r.length===0)return;let n=this.addVideoTrack("main");n.id="main",n.selected=!0;let o=[...r].sort((d,h)=>d.quality-h.quality);for(let d of o){let h=n.addRendition("",d.width,d.height,void 0,d.bitrate);h.id=`${d.quality}`}let s=()=>{let d=this.videoRenditions.selectedIndex;if(d<0)t.setVideoQuality(Eb.HIGH);else{let h=o[d];h&&t.setVideoQuality(h.quality)}};this.videoRenditions.addEventListener("change",s),u(this,Vn).push(()=>this.videoRenditions.removeEventListener("change",s))},Kl=function(){u(this,Vn).forEach(t=>t()),E(this,Vn,[]);for(let t of this.videoTracks)this.removeVideoTrack(t);for(let t of this.audioTracks)this.removeAudioTrack(t)},ev=function(){var t,r,n;return{adaptiveStream:((t=u(this,ze))==null?void 0:t.adaptiveStream)??!1,dynacast:((r=u(this,ze))==null?void 0:r.dynacast)??!0,disconnectOnPageLeave:((n=u(this,ze))==null?void 0:n.disconnectOnPageLeave)??!1}},tv=function(){var t,r;return{autoSubscribe:!0,peerConnectionTimeout:((t=u(this,ze))==null?void 0:t.peerConnectionTimeout)??8e3,rtcConfig:{iceTransportPolicy:((r=u(this,ze))==null?void 0:r.iceTransportPolicy)??"all"}}},ql=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let r=this[t];delete this[t],this[t]=r}},Ar.shadowRootOptions={...He.shadowRootOptions};globalThis.customElements&&!globalThis.customElements.get("livekit-video")&&globalThis.customElements.define("livekit-video",Ar);var iv=Ar;export{Ms as Attribute,le as BPDefaultUI,Ei as BPErrorDisplay,pt as BPLiveError,eo as BPLiveService,qt as BPOverlay,xe as BPPlayer,Ge as Hls,Er as HlsVideo,Gm as HlsVideoElement,Ar as LiveKitVideo,iv as LiveKitVideoElement,kv as NANOPLAYER_NO_REPLAY_CODES,yr as NanoVideo,Xm as NanoVideoElement,Iv as StateReceiverMixin,Ir as StateReceiverProps,ro as addGlobalStyles,ld as classifyLiveKitError,ad as classifyNanoPlayerError,Ls as createInitialState,pd as createPlayerCore,xv as createTemplate,Cr as forEachStateReceiverElement,Is as isBPLiveClipSource,dd as isBPLiveSource,ws as isBPLiveStreamSource,md as isStateReceiverElement,Cs as propagateStateToReceiver,Rs as removeStateFromReceiver,Pv as templateWithStyles,ye as toggleAttribute};
|
|
2918
2918
|
/*! Bundled license information:
|
|
2919
2919
|
|
|
2920
2920
|
@lit/reactive-element/css-tag.js:
|