@broadcastingplatforms/player 0.0.0-dev.0c8c26d → 0.0.0-dev.292ef76
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/README.md +63 -0
- package/dist/bp-player.js +187 -174
- package/dist/bp-player.mjs +187 -174
- package/dist/bp-player.standalone.mjs +252 -239
- package/dist/components/bp-default-ui.d.ts +2 -4
- package/dist/components/bp-player.d.ts +2 -1
- package/dist/core/player-core.d.ts +3 -2
- package/dist/elements/hls-video.d.ts +1 -0
- package/dist/events/AddRenditionEvent.d.ts +6 -0
- package/dist/events/CanPlayEvent.d.ts +5 -0
- package/dist/events/CanPlayThroughEvent.d.ts +5 -0
- package/dist/events/ChangeEvent.d.ts +5 -0
- package/dist/events/DurationChangeEvent.d.ts +5 -0
- package/dist/events/EmptiedEvent.d.ts +5 -0
- package/dist/events/EndedEvent.d.ts +5 -0
- package/dist/events/ErrorEvent.d.ts +9 -0
- package/dist/events/EventUtils.d.ts +22 -0
- package/dist/events/LoadStartEvent.d.ts +5 -0
- package/dist/events/LoadedDataEvent.d.ts +5 -0
- package/dist/events/LoadedMetadataEvent.d.ts +5 -0
- package/dist/events/PauseEvent.d.ts +5 -0
- package/dist/events/PlayEvent.d.ts +5 -0
- package/dist/events/PlayingEvent.d.ts +5 -0
- package/dist/events/ProgressEvent.d.ts +5 -0
- package/dist/events/RateChangeEvent.d.ts +5 -0
- package/dist/events/ReadyEvent.d.ts +6 -0
- package/dist/events/ResizeEvent.d.ts +5 -0
- package/dist/events/SeekedEvent.d.ts +5 -0
- package/dist/events/SeekingEvent.d.ts +5 -0
- package/dist/events/TimeUpdateEvent.d.ts +5 -0
- package/dist/events/VolumeChangeEvent.d.ts +5 -0
- package/dist/events/WaitingEvent.d.ts +5 -0
- package/dist/events/index.d.ts +49 -0
- package/dist/util/converters.d.ts +14 -0
- package/dist/util/index.d.ts +1 -0
- package/package.json +2 -3
package/dist/bp-player.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* BP Player (v0.0.0-dev.
|
|
2
|
+
* BP Player (v0.0.0-dev.292ef76)
|
|
3
3
|
* Universal video player web component
|
|
4
4
|
*/
|
|
5
|
-
var
|
|
6
|
-
\f\r]`,
|
|
7
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),pu=/'/g,mu=/"/g,Eu=/^(?:script|style|textarea|title)$/i,Dl=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),Ve=Dl(1),zE=Dl(2),YE=Dl(3),Si=Symbol.for("lit-noChange"),ve=Symbol.for("lit-nothing"),vu=new WeakMap,Ti=Ai.createTreeWalker(Ai,129);function bu(i,e){if(!Pl(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return cu!==void 0?cu.createHTML(e):e}var Fm=(i,e)=>{let t=i.length-1,r=[],o,n=e===2?"<svg>":e===3?"<math>":"",a=Do;for(let l=0;l<t;l++){let c=i[l],v,h,p=-1,f=0;for(;f<c.length&&(a.lastIndex=f,h=a.exec(c),h!==null);)f=a.lastIndex,a===Do?h[1]==="!--"?a=uu:h[1]!==void 0?a=hu:h[2]!==void 0?(Eu.test(h[2])&&(o=RegExp("</"+h[2],"g")),a=yi):h[3]!==void 0&&(a=yi):a===yi?h[0]===">"?(a=o??Do,p=-1):h[1]===void 0?p=-2:(p=a.lastIndex-h[2].length,v=h[1],a=h[3]===void 0?yi:h[3]==='"'?mu:pu):a===mu||a===pu?a=yi:a===uu||a===hu?a=Do:(a=yi,o=void 0);let m=a===yi&&i[l+1].startsWith("/>")?" ":"";n+=a===Do?c+Vm:p>=0?(r.push(v),c.slice(0,p)+fu+c.slice(p)+Ft+m):c+Ft+(p===-2?l:m)}return[bu(i,n+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},Ho=class i{constructor({strings:e,_$litType$:t},r){let o;this.parts=[];let n=0,a=0,l=e.length-1,c=this.parts,[v,h]=Fm(e,t);if(this.el=i.createElement(v,r),Ti.currentNode=this.el.content,t===2||t===3){let p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(o=Ti.nextNode())!==null&&c.length<l;){if(o.nodeType===1){if(o.hasAttributes())for(let p of o.getAttributeNames())if(p.endsWith(fu)){let f=h[a++],m=o.getAttribute(p).split(Ft),A=/([.?@])?(.*)/.exec(f);c.push({type:1,index:n,name:A[2],strings:m,ctor:A[1]==="."?Il:A[1]==="?"?Ml:A[1]==="@"?Rl:cr}),o.removeAttribute(p)}else p.startsWith(Ft)&&(c.push({type:6,index:n}),o.removeAttribute(p));if(Eu.test(o.tagName)){let p=o.textContent.split(Ft),f=p.length-1;if(f>0){o.textContent=ia?ia.emptyScript:"";for(let m=0;m<f;m++)o.append(p[m],Uo()),Ti.nextNode(),c.push({type:2,index:++n});o.append(p[f],Uo())}}}else if(o.nodeType===8)if(o.data===gu)c.push({type:2,index:n});else{let p=-1;for(;(p=o.data.indexOf(Ft,p+1))!==-1;)c.push({type:7,index:n}),p+=Ft.length-1}n++}}static createElement(e,t){let r=Ai.createElement("template");return r.innerHTML=e,r}};function dr(i,e,t=i,r){var a,l;if(e===Si)return e;let o=r!==void 0?(a=t._$Co)==null?void 0:a[r]:t._$Cl,n=No(e)?void 0:e._$litDirective$;return(o==null?void 0:o.constructor)!==n&&((l=o==null?void 0:o._$AO)==null||l.call(o,!1),n===void 0?o=void 0:(o=new n(i),o._$AT(i,t,r)),r!==void 0?(t._$Co??(t._$Co=[]))[r]=o:t._$Cl=o),o!==void 0&&(e=dr(i,o._$AS(i,e.values),o,r)),e}var Cl=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:r}=this._$AD,o=((e==null?void 0:e.creationScope)??Ai).importNode(t,!0);Ti.currentNode=o;let n=Ti.nextNode(),a=0,l=0,c=r[0];for(;c!==void 0;){if(a===c.index){let v;c.type===2?v=new $o(n,n.nextSibling,this,e):c.type===1?v=new c.ctor(n,c.name,c.strings,this,e):c.type===6&&(v=new xl(n,this,e)),this._$AV.push(v),c=r[++l]}a!==(c==null?void 0:c.index)&&(n=Ti.nextNode(),a++)}return Ti.currentNode=Ai,o}p(e){let t=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}},$o=class i{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,r,o){this.type=2,this._$AH=ve,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=o,this._$Cv=(o==null?void 0:o.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=dr(this,e,t),No(e)?e===ve||e==null||e===""?(this._$AH!==ve&&this._$AR(),this._$AH=ve):e!==this._$AH&&e!==Si&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Wm(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!==ve&&No(this._$AH)?this._$AA.nextSibling.data=e:this.T(Ai.createTextNode(e)),this._$AH=e}$(e){var n;let{values:t,_$litType$:r}=e,o=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=Ho.createElement(bu(r.h,r.h[0]),this.options)),r);if(((n=this._$AH)==null?void 0:n._$AD)===o)this._$AH.p(t);else{let a=new Cl(o,this),l=a.u(this.options);a.p(t),this.T(l),this._$AH=a}}_$AC(e){let t=vu.get(e.strings);return t===void 0&&vu.set(e.strings,t=new Ho(e)),t}k(e){Pl(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,o=0;for(let n of e)o===t.length?t.push(r=new i(this.O(Uo()),this.O(Uo()),this,this.options)):r=t[o],r._$AI(n),o++;o<t.length&&(this._$AR(r&&r._$AB.nextSibling,o),t.length=o)}_$AR(e=this._$AA.nextSibling,t){var r;for((r=this._$AP)==null?void 0:r.call(this,!1,!0,t);e!==this._$AB;){let o=e.nextSibling;e.remove(),e=o}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}},cr=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,o,n){this.type=1,this._$AH=ve,this._$AN=void 0,this.element=e,this.name=t,this._$AM=o,this.options=n,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=ve}_$AI(e,t=this,r,o){let n=this.strings,a=!1;if(n===void 0)e=dr(this,e,t,0),a=!No(e)||e!==this._$AH&&e!==Si,a&&(this._$AH=e);else{let l=e,c,v;for(e=n[0],c=0;c<n.length-1;c++)v=dr(this,l[r+c],t,c),v===Si&&(v=this._$AH[c]),a||(a=!No(v)||v!==this._$AH[c]),v===ve?e=ve:e!==ve&&(e+=(v??"")+n[c+1]),this._$AH[c]=v}a&&!o&&this.j(e)}j(e){e===ve?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Il=class extends cr{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===ve?void 0:e}},Ml=class extends cr{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==ve)}},Rl=class extends cr{constructor(e,t,r,o,n){super(e,t,r,o,n),this.type=5}_$AI(e,t=this){if((e=dr(this,e,t,0)??ve)===Si)return;let r=this._$AH,o=e===ve&&r!==ve||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,n=e!==ve&&(r===ve||o);o&&this.element.removeEventListener(this.name,this,r),n&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t;typeof this._$AH=="function"?this._$AH.call(((t=this.options)==null?void 0:t.host)??this.element,e):this._$AH.handleEvent(e)}},xl=class{constructor(e,t,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){dr(this,e)}};var wl=Oo.litHtmlPolyfillSupport;wl==null||wl(Ho,$o),(Oo.litHtmlVersions??(Oo.litHtmlVersions=[])).push("3.3.1");var _u=(i,e,t)=>{let r=(t==null?void 0:t.renderBefore)??e,o=r._$litPart$;if(o===void 0){let n=(t==null?void 0:t.renderBefore)??null;r._$litPart$=o=new $o(e.insertBefore(Uo(),n),n,void 0,t??{})}return o._$AI(i),o};var ki=globalThis,Le=class extends Ct{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;let e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=_u(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return Si}},yu;Le._$litElement$=!0,Le.finalized=!0,(yu=ki.litElementHydrateSupport)==null||yu.call(ki,{LitElement:Le});var Ol=ki.litElementPolyfillSupport;Ol==null||Ol({LitElement:Le});(ki.litElementVersions??(ki.litElementVersions=[])).push("4.2.1");var Kt=i=>(e,t)=>{t!==void 0?t.addInitializer(()=>{customElements.define(i,e)}):customElements.define(i,e)};var Km={attribute:!0,type:String,converter:Po,reflect:!1,hasChanged:ta},qm=(i=Km,e,t)=>{let{kind:r,metadata:o}=t,n=globalThis.litPropertyMetadata.get(o);if(n===void 0&&globalThis.litPropertyMetadata.set(o,n=new Map),r==="setter"&&((i=Object.create(i)).wrapped=!0),n.set(t.name,i),r==="accessor"){let{name:a}=t;return{set(l){let c=e.get.call(this);e.set.call(this,l),this.requestUpdate(a,c,i)},init(l){return l!==void 0&&this.C(a,void 0,i,l),l}}}if(r==="setter"){let{name:a}=t;return function(l){let c=this[a];e.call(this,l),this.requestUpdate(a,c,i)}}throw Error("Unsupported decorator location: "+r)};function W(i){return(e,t)=>typeof t=="object"?qm(i,e,t):((r,o,n)=>{let a=o.hasOwnProperty(n);return o.constructor.createProperty(n,r),a?Object.getOwnPropertyDescriptor(o,n):void 0})(i,e,t)}function qt(i){return W({...i,state:!0,attribute:!1})}var Gm=[1005,1007,1008,1009,3001,3002,3003,3004,3005,3100,3101,3200,4003];function Ul(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 Nl(i){return i===4e3||i===4001?"network":"unknown"}function oa(){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 na(i){return typeof i=="object"&&i!==null&&"type"in i&&i.type==="bplive"&&"streamId"in i}function ur(i){return typeof i=="object"&&i!==null&&"type"in i&&i.type==="bplive"&&"clipId"in i}function zm(i){return na(i)||ur(i)}var It=class extends Error{constructor(t,r,o){super(t);this.code=r;this.status=o;this.name="BPLiveError"}},Bo=class{constructor(e){this._authToken=null;this._stream=null;this._clip=null;this._config=e,this._authToken=e.authToken??null}get config(){return this._config}get authToken(){return this._authToken}get stream(){return this._stream}get clip(){return this._clip}async fetch(e){if(!this._authToken)throw new It("No auth token provided. Ensure config.bpLive.authToken is set before loading a BPLive source.","AUTH_REQUIRED");let t=`${this._config.discoveryUrl}${e}`,r=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${this._authToken}`}});if(!r.ok)throw new It(`HTTP ${r.status}: ${r.statusText}`,"HTTP_ERROR",r.status);return r.json()}async getStream(e){return this.fetch(`/streams/${e}`)}async getClip(e){return this.fetch(`/clips/${e}`)}mapPlayerSourceToResolvedSource(e){if(e.provider==="livekit")return{type:"livekit",url:e.url,token:e.token,room:e.room};if(e.provider==="nanoplayer"){let{provider:t,...r}=e;return{type:"nano",source:r}}throw new It(`Unknown player source provider: ${e.provider}`,"UNKNOWN_PROVIDER")}selectClipMedia(e,t="landscape"){let r=e.filter(l=>l.type==="clip");if(r.length===0)return null;let o=r.find(l=>l.orientation===t);if(o)return o;let n=t==="landscape"?"portrait":"landscape",a=r.find(l=>l.orientation===n);return a||r[0]}mapClipMediaToPlayerSource(e){return{type:"video",url:e.url}}async resolveSource(e){if(this._stream=null,this._clip=null,na(e))return this.resolveStreamSource(e);if(ur(e))return this.resolveClipSource(e);throw new It("Invalid BPLive source","INVALID_SOURCE")}extractStreamPoster(e){var t;return e.cover_photo??((t=e.channel)==null?void 0:t.cover_image)??void 0}async resolveStreamSource(e){var a,l,c,v,h;let r=(await this.getStream(e.streamId)).data;this._stream=r;let o=r.player_source??((a=r.active_stream)==null?void 0:a.player_source),n=this.extractStreamPoster(r);if(o)return{source:this.mapPlayerSourceToResolvedSource(o),contentType:"stream",poster:n};if(((c=(l=r.media)==null?void 0:l.vod)==null?void 0:c.length)>0){let p=r.media.vod[0];return{source:{type:"video",url:p.original},contentType:"video",poster:n??p.thumb??void 0,videoWidth:(v=p.dimension)==null?void 0:v.width,videoHeight:(h=p.dimension)==null?void 0:h.height}}throw new It("Stream is not live and has no VOD content","STREAM_OFFLINE")}async resolveClipSource(e){let r=(await this.getClip(e.clipId)).data;this._clip=r;let o=this.selectClipMedia(r.media,e.preferredOrientation);if(!o)throw new It("No playable media found in clip","NO_MEDIA");return{source:this.mapClipMediaToPlayerSource(o),contentType:"clip",poster:o.thumbnail??void 0,videoWidth:o.width,videoHeight:o.height}}destroy(){this._authToken=null,this._stream=null,this._clip=null}};function Ym(i){if(typeof i=="string")return"video";switch(i.type){case"video":return"video";case"nano":return"nano";case"livekit":return"livekit";default:return"video"}}function Qm(i){return typeof i=="object"&&i!==null&&i.type==="bplive"}var Zm=["loadstart","loadedmetadata","loadeddata","canplay","canplaythrough","play","playing","pause","waiting","seeking","seeked","timeupdate","durationchange","ratechange","volumechange","ended","progress","error","resize"],aa=class{constructor(){this._mediaElement=null;this._container=null;this._listeners=new Map;this._eventCleanup=[];this._destroyed=!1;this._bpLive=null;this._currentProviderType=null;this._ready=!1;this._state=oa()}get state(){return this._state}get videoElement(){return this._mediaElement}get bpLive(){return this._bpLive}get ready(){return this._ready}get providerType(){return this._currentProviderType}addEventListener(e,t){let r=Array.isArray(e)?e:[e];for(let o of r)this._listeners.has(o)||this._listeners.set(o,new Set),this._listeners.get(o).add(t)}removeEventListener(e,t){let r=Array.isArray(e)?e:[e];for(let o of r){let n=this._listeners.get(o);n&&(n.delete(t),n.size===0&&this._listeners.delete(o))}}dispatch(e,t){let r=this._listeners.get(e);if(r)for(let o of r)try{o(t)}catch(n){console.error(`[PlayerCore] Error in event listener for "${e}":`,n)}}updateState(e){this._state={...this._state,...e},this.dispatch("statechange",{state:this._state})}attach(e,t){this._destroyed||(this._container=e,this._config=t,this._ready=!0)}async loadSource(e,t,r){if(this._destroyed)return;let o=t??this._container,n=r??this._config;if(!o){console.error("[PlayerCore] No container provided. Call attach() first or provide container to loadSource().");return}this._container=o,n&&(this._config=n),this.updateState({error:null,connectionState:"connecting",paused:!0,ended:!1,playing:!1,waiting:!1,seeking:!1,readyState:0,currentTime:0,duration:NaN,buffered:null}),this.dispatch("sourcechange",{source:e});try{let a=e,l=this._state.contentType,c,v,h;if(Qm(e)){if(n!=null&&n.bpLive&&(this._bpLive&&this._bpLive.destroy(),this._bpLive=new Bo(n.bpLive)),!this._bpLive)throw new Error("BPLive source requires config.bpLive configuration.");let L=await this._bpLive.resolveSource(e);a=L.source,l=L.contentType,c=L.poster,v=L.videoWidth,h=L.videoHeight}let p=Ym(a);(this._currentProviderType!==null&&this._currentProviderType!==p||this._mediaElement)&&this.destroyMediaElement();let g=p==="nano"||p==="livekit"||l==="stream"?"live":"vod";return this._currentProviderType=p,this.updateState({providerType:p,contentType:l,streamType:g}),this._mediaElement=this.createMediaElement(p,a,n),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),o.appendChild(this._mediaElement),this._ready=!0,this.dispatch("videoelementchange",{video:this._mediaElement}),{poster:c,videoWidth:v,videoHeight:h}}catch(a){console.error("[PlayerCore] loadSource error:",a);let l={code:-1,message:a instanceof Error?a.message:"Failed to load source",fatal:!0,category:"setup"};this.updateState({error:l,connectionState:"failed"}),this.dispatch("error",l)}}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._container)for(;this._container.firstChild;)this._container.removeChild(this._container.firstChild)}createMediaElement(e,t,r){switch(e){case"nano":{let o=document.createElement("nano-video"),n=t;return o.libraryLocation=(r==null?void 0:r.libraryLocation)??"/vendor/bp-player",n.source?o.sourceConfig=n.source:n.streamid&&(o.streamid=n.streamid),r!=null&&r.nano&&(o.config=r.nano),o}case"livekit":{let o=document.createElement("livekit-video"),n=t;return o.url=n.url,o.token=n.token,r!=null&&r.livekit&&(o.config=r.livekit),o}case"video":default:{let o=document.createElement("hls-video"),n=typeof t=="string"?t:t.url;return o.src=n,r!=null&&r.video&&(o.config=r.video),o}}}attachMediaElementListeners(e){for(let t of Zm){let r=o=>this.handleMediaEvent(t,e,o);e.addEventListener(t,r),this._eventCleanup.push(()=>e.removeEventListener(t,r))}}handleMediaEvent(e,t,r){switch(e){case"loadstart":this.updateState({readyState:1}),this.dispatch("loadstart",void 0);break;case"loadedmetadata":{let o=t.duration===1/0?"live":this._state.streamType;this.updateState({duration:t.duration,videoWidth:t.videoWidth,videoHeight:t.videoHeight,streamType:o}),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 o=t.duration===1/0?"live":this._state.streamType;this.updateState({duration:t.duration,streamType:o}),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 o=-1,n="Unknown error";r instanceof ErrorEvent&&r.error?(o=r.error.code??-1,n=r.error.message??r.message??"Unknown error"):t.error&&(o=t.error.code??-1,n=t.error.message??"Unknown error");let a="media",l=!0;this._state.providerType==="nano"&&o>0?(a=Ul(o),l=a!=="offline"&&a!=="autoplay"):this._state.providerType==="livekit"&&o>0&&(a=Nl(o),l=!0);let c={code:o,message:n,fatal:l,category:a};this.updateState({error:c}),this.dispatch("error",c);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({...oa(),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}),this.dispatch("play",void 0);try{await this._mediaElement.play()}catch(e){throw this.updateState({paused:!0}),this.dispatch("pause",void 0),e}}}pause(){this._mediaElement&&(this.updateState({paused:!0,playing:!1}),this.dispatch("pause",void 0),this._mediaElement.pause())}seek(e){this._mediaElement&&(this._mediaElement.currentTime=e)}setVolume(e){let t=Math.max(0,Math.min(1,e));this.updateState({volume:t}),this._mediaElement&&(this._mediaElement.volume=t),this.dispatch("volumechange",{volume:t,muted:this._state.muted})}setMuted(e){this.updateState({muted:e}),this._mediaElement&&(this._mediaElement.muted=e),this.dispatch("volumechange",{volume:this._state.volume,muted:e})}setLoop(e){this.updateState({loop:e}),this._mediaElement&&(this._mediaElement.loop=e)}setPlaybackRate(e){this.updateState({playbackRate:e}),this._mediaElement&&(this._mediaElement.playbackRate=e),this.dispatch("ratechange",{playbackRate:e})}setTargetQuality(e){this.updateState({targetQuality:e}),this.dispatch("targetqualitychanged",{quality:e});let t=this._mediaElement;t!=null&&t.videoRenditions&&(t.videoRenditions.selectedIndex=(e==null?void 0:e.index)??-1)}setQuality(e){this.setTargetQuality(e)}setFullscreen(e){this.updateState({fullscreen:e,presentationMode:e?"fullscreen":"inline"}),this.dispatch("fullscreenchange",{fullscreen:e}),this.dispatch("presentationmodechange",{mode:e?"fullscreen":"inline"})}setPresentationMode(e){this.updateState({presentationMode:e,fullscreen:e==="fullscreen"}),this.dispatch("presentationmodechange",{mode:e})}destroy(){this._destroyed||(this._destroyed=!0,this.unloadSource(),this._bpLive&&(this._bpLive.destroy(),this._bpLive=null),this._container=null,this._config=void 0,this._ready=!1,this.dispatch("destroy",void 0),this._listeners.clear())}};function Hl(){return new aa}var hr="bpPlayerObservedProperties";function $l(i){return hr in i&&Array.isArray(i[hr])}function Xm(i,e){class t extends i{get[hr](){return e}}return t}function Jm(i){if(i.shadowRoot)return Array.from(i.shadowRoot.children);if(i.localName==="slot"){let t=i.assignedNodes();if(t.length>0)return t.filter(r=>r.nodeType===Node.ELEMENT_NODE)}return Array.from(i.children)}async function pr(i,e,t){if(e!=null&&e.contains(i))return;i.nodeName.includes("-")&&!$l(i)&&(await Promise.resolve(),await customElements.whenDefined(i.nodeName.toLowerCase()),customElements.upgrade(i)),$l(i)&&t(i);let r=Jm(i);r.length>0&&await Promise.all(r.map(o=>pr(o,e,t)))}function sa(i,e,t){let r=i[hr];r.includes("player")&&(i.player=e),r.includes("paused")&&(i.paused=t.paused),r.includes("playing")&&(i.playing=t.playing),r.includes("ended")&&(i.ended=t.ended),r.includes("seeking")&&(i.seeking=t.seeking),r.includes("currentTime")&&(i.currentTime=t.currentTime),r.includes("duration")&&(i.duration=t.duration),r.includes("volume")&&(i.volume=t.volume),r.includes("muted")&&(i.muted=t.muted),r.includes("playbackRate")&&(i.playbackRate=t.playbackRate),r.includes("readyState")&&(i.readyState=t.readyState),r.includes("videoWidth")&&(i.videoWidth=t.videoWidth),r.includes("videoHeight")&&(i.videoHeight=t.videoHeight),r.includes("qualities")&&(i.qualities=t.qualities),r.includes("currentQuality")&&(i.currentQuality=t.currentQuality),r.includes("targetQuality")&&(i.targetQuality=t.targetQuality),r.includes("fullscreen")&&(i.fullscreen=t.fullscreen),r.includes("presentationMode")&&(i.presentationMode=t.presentationMode),r.includes("connectionState")&&(i.connectionState=t.connectionState),r.includes("streamType")&&(i.streamType=t.streamType),r.includes("error")&&(i.error=t.error)}function la(i){i[hr].includes("player")&&(i.player=void 0)}var Tu=`/**
|
|
5
|
+
var ku=Object.defineProperty;var Xm=Object.getOwnPropertyDescriptor;var Lu=i=>{throw TypeError(i)};var Jm=(i,e,t)=>e in i?ku(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var U=(i,e,t,r)=>{for(var o=r>1?void 0:r?Xm(e,t):e,n=i.length-1,a;n>=0;n--)(a=i[n])&&(o=(r?a(e,t,o):a(o))||o);return r&&o&&ku(e,t,o),o};var $=(i,e,t)=>Jm(i,typeof e!="symbol"?e+"":e,t),Hl=(i,e,t)=>e.has(i)||Lu("Cannot "+t);var u=(i,e,t)=>(Hl(i,e,"read from private field"),t?t.call(i):e.get(i)),S=(i,e,t)=>e.has(i)?Lu("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),_=(i,e,t,r)=>(Hl(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),O=(i,e,t)=>(Hl(i,e,"access private method"),t);var pa=globalThis,ma=pa.ShadowRoot&&(pa.ShadyCSS===void 0||pa.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,$l=Symbol(),Cu=new WeakMap,Ho=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==$l)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(ma&&e===void 0){let r=t!==void 0&&t.length===1;r&&(e=Cu.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&Cu.set(t,e))}return e}toString(){return this.cssText}},Iu=i=>new Ho(typeof i=="string"?i:i+"",void 0,$l),$o=(i,...e)=>{let t=i.length===1?i[0]:e.reduce((r,o,n)=>r+(a=>{if(a._$cssResult$===!0)return a.cssText;if(typeof a=="number")return a;throw Error("Value passed to 'css' function must be a 'css' function result: "+a+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+i[n+1],i[0]);return new Ho(t,i,$l)},wu=(i,e)=>{if(ma)i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let r=document.createElement("style"),o=pa.litNonce;o!==void 0&&r.setAttribute("nonce",o),r.textContent=t.cssText,i.appendChild(r)}},Bl=ma?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(let r of e.cssRules)t+=r.cssText;return Iu(t)})(i):i;var{is:jm,defineProperty:ev,getOwnPropertyDescriptor:tv,getOwnPropertyNames:iv,getOwnPropertySymbols:rv,getPrototypeOf:ov}=Object,Kt=globalThis,Mu=Kt.trustedTypes,nv=Mu?Mu.emptyScript:"",Vl=Kt.reactiveElementPolyfillSupport,Bo=(i,e)=>i,Vo={toAttribute(i,e){switch(e){case Boolean:i=i?nv: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}},va=(i,e)=>!jm(i,e),Ru={attribute:!0,type:String,converter:Vo,reflect:!1,useDefault:!1,hasChanged:va};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Kt.litPropertyMetadata??(Kt.litPropertyMetadata=new WeakMap);var wt=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=Ru){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let r=Symbol(),o=this.getPropertyDescriptor(e,r,t);o!==void 0&&ev(this.prototype,e,o)}}static getPropertyDescriptor(e,t,r){let{get:o,set:n}=tv(this.prototype,e)??{get(){return this[t]},set(a){this[t]=a}};return{get:o,set(a){let l=o==null?void 0:o.call(this);n==null||n.call(this,a),this.requestUpdate(e,l,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Ru}static _$Ei(){if(this.hasOwnProperty(Bo("elementProperties")))return;let e=ov(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Bo("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Bo("properties"))){let t=this.properties,r=[...iv(t),...rv(t)];for(let o of r)this.createProperty(o,t[o])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[r,o]of t)this.elementProperties.set(r,o)}this._$Eh=new Map;for(let[t,r]of this.elementProperties){let o=this._$Eu(t,r);o!==void 0&&this._$Eh.set(o,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let r=new Set(e.flat(1/0).reverse());for(let o of r)t.unshift(Bl(o))}else e!==void 0&&t.push(Bl(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 wu(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var r;return(r=t.hostConnected)==null?void 0:r.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var r;return(r=t.hostDisconnected)==null?void 0:r.call(t)})}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$ET(e,t){var n;let r=this.constructor.elementProperties.get(e),o=this.constructor._$Eu(e,r);if(o!==void 0&&r.reflect===!0){let a=(((n=r.converter)==null?void 0:n.toAttribute)!==void 0?r.converter:Vo).toAttribute(t,r.type);this._$Em=e,a==null?this.removeAttribute(o):this.setAttribute(o,a),this._$Em=null}}_$AK(e,t){var n,a;let r=this.constructor,o=r._$Eh.get(e);if(o!==void 0&&this._$Em!==o){let l=r.getPropertyOptions(o),d=typeof l.converter=="function"?{fromAttribute:l.converter}:((n=l.converter)==null?void 0:n.fromAttribute)!==void 0?l.converter:Vo;this._$Em=o;let v=d.fromAttribute(t,l.type);this[o]=v??((a=this._$Ej)==null?void 0:a.get(o))??v,this._$Em=null}}requestUpdate(e,t,r){var o;if(e!==void 0){let n=this.constructor,a=this[e];if(r??(r=n.getPropertyOptions(e)),!((r.hasChanged??va)(a,t)||r.useDefault&&r.reflect&&a===((o=this._$Ej)==null?void 0:o.get(e))&&!this.hasAttribute(n._$Eu(e,r))))return;this.C(e,t,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:r,reflect:o,wrapped:n},a){r&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,a??t??this[e]),n!==!0||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||r||(t=void 0),this._$AL.set(e,t)),o===!0&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var r;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[n,a]of this._$Ep)this[n]=a;this._$Ep=void 0}let o=this.constructor.elementProperties;if(o.size>0)for(let[n,a]of o){let{wrapped:l}=a,d=this[n];l!==!0||this._$AL.has(n)||d===void 0||this.C(n,void 0,a,d)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(r=this._$EO)==null||r.forEach(o=>{var n;return(n=o.hostUpdate)==null?void 0:n.call(o)}),this.update(t)):this._$EM()}catch(o){throw e=!1,this._$EM(),o}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(r=>{var o;return(o=r.hostUpdated)==null?void 0:o.call(r)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach(t=>this._$ET(t,this[t]))),this._$EM()}updated(e){}firstUpdated(e){}};wt.elementStyles=[],wt.shadowRootOptions={mode:"open"},wt[Bo("elementProperties")]=new Map,wt[Bo("finalized")]=new Map,Vl==null||Vl({ReactiveElement:wt}),(Kt.reactiveElementVersions??(Kt.reactiveElementVersions=[])).push("2.1.1");var Fo=globalThis,fa=Fo.trustedTypes,xu=fa?fa.createPolicy("lit-html",{createHTML:i=>i}):void 0,Hu="$lit$",Gt=`lit$${Math.random().toFixed(9).slice(2)}$`,$u="?"+Gt,av=`<${$u}>`,Ci=document,Ko=()=>Ci.createComment(""),Go=i=>i===null||typeof i!="object"&&typeof i!="function",Ql=Array.isArray,sv=i=>Ql(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",Wl=`[
|
|
6
|
+
\f\r]`,Wo=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Pu=/-->/g,Du=/>/g,ki=RegExp(`>|${Wl}(?:([^\\s"'>=/]+)(${Wl}*=${Wl}*(?:[^
|
|
7
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Ou=/'/g,Nu=/"/g,Bu=/^(?:script|style|textarea|title)$/i,Zl=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),We=Zl(1),hb=Zl(2),pb=Zl(3),Ii=Symbol.for("lit-noChange"),fe=Symbol.for("lit-nothing"),Uu=new WeakMap,Li=Ci.createTreeWalker(Ci,129);function Vu(i,e){if(!Ql(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return xu!==void 0?xu.createHTML(e):e}var lv=(i,e)=>{let t=i.length-1,r=[],o,n=e===2?"<svg>":e===3?"<math>":"",a=Wo;for(let l=0;l<t;l++){let d=i[l],v,h,p=-1,E=0;for(;E<d.length&&(a.lastIndex=E,h=a.exec(d),h!==null);)E=a.lastIndex,a===Wo?h[1]==="!--"?a=Pu:h[1]!==void 0?a=Du:h[2]!==void 0?(Bu.test(h[2])&&(o=RegExp("</"+h[2],"g")),a=ki):h[3]!==void 0&&(a=ki):a===ki?h[0]===">"?(a=o??Wo,p=-1):h[1]===void 0?p=-2:(p=a.lastIndex-h[2].length,v=h[1],a=h[3]===void 0?ki:h[3]==='"'?Nu:Ou):a===Nu||a===Ou?a=ki:a===Pu||a===Du?a=Wo:(a=ki,o=void 0);let m=a===ki&&i[l+1].startsWith("/>")?" ":"";n+=a===Wo?d+av:p>=0?(r.push(v),d.slice(0,p)+Hu+d.slice(p)+Gt+m):d+Gt+(p===-2?l:m)}return[Vu(i,n+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},qo=class i{constructor({strings:e,_$litType$:t},r){let o;this.parts=[];let n=0,a=0,l=e.length-1,d=this.parts,[v,h]=lv(e,t);if(this.el=i.createElement(v,r),Li.currentNode=this.el.content,t===2||t===3){let p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(o=Li.nextNode())!==null&&d.length<l;){if(o.nodeType===1){if(o.hasAttributes())for(let p of o.getAttributeNames())if(p.endsWith(Hu)){let E=h[a++],m=o.getAttribute(p).split(Gt),A=/([.?@])?(.*)/.exec(E);d.push({type:1,index:n,name:A[2],strings:m,ctor:A[1]==="."?Gl:A[1]==="?"?ql:A[1]==="@"?zl:fr}),o.removeAttribute(p)}else p.startsWith(Gt)&&(d.push({type:6,index:n}),o.removeAttribute(p));if(Bu.test(o.tagName)){let p=o.textContent.split(Gt),E=p.length-1;if(E>0){o.textContent=fa?fa.emptyScript:"";for(let m=0;m<E;m++)o.append(p[m],Ko()),Li.nextNode(),d.push({type:2,index:++n});o.append(p[E],Ko())}}}else if(o.nodeType===8)if(o.data===$u)d.push({type:2,index:n});else{let p=-1;for(;(p=o.data.indexOf(Gt,p+1))!==-1;)d.push({type:7,index:n}),p+=Gt.length-1}n++}}static createElement(e,t){let r=Ci.createElement("template");return r.innerHTML=e,r}};function vr(i,e,t=i,r){var a,l;if(e===Ii)return e;let o=r!==void 0?(a=t._$Co)==null?void 0:a[r]:t._$Cl,n=Go(e)?void 0:e._$litDirective$;return(o==null?void 0:o.constructor)!==n&&((l=o==null?void 0:o._$AO)==null||l.call(o,!1),n===void 0?o=void 0:(o=new n(i),o._$AT(i,t,r)),r!==void 0?(t._$Co??(t._$Co=[]))[r]=o:t._$Cl=o),o!==void 0&&(e=vr(i,o._$AS(i,e.values),o,r)),e}var Kl=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:r}=this._$AD,o=((e==null?void 0:e.creationScope)??Ci).importNode(t,!0);Li.currentNode=o;let n=Li.nextNode(),a=0,l=0,d=r[0];for(;d!==void 0;){if(a===d.index){let v;d.type===2?v=new zo(n,n.nextSibling,this,e):d.type===1?v=new d.ctor(n,d.name,d.strings,this,e):d.type===6&&(v=new Yl(n,this,e)),this._$AV.push(v),d=r[++l]}a!==(d==null?void 0:d.index)&&(n=Li.nextNode(),a++)}return Li.currentNode=Ci,o}p(e){let t=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}},zo=class i{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,r,o){this.type=2,this._$AH=fe,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=o,this._$Cv=(o==null?void 0:o.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=vr(this,e,t),Go(e)?e===fe||e==null||e===""?(this._$AH!==fe&&this._$AR(),this._$AH=fe):e!==this._$AH&&e!==Ii&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):sv(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!==fe&&Go(this._$AH)?this._$AA.nextSibling.data=e:this.T(Ci.createTextNode(e)),this._$AH=e}$(e){var n;let{values:t,_$litType$:r}=e,o=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=qo.createElement(Vu(r.h,r.h[0]),this.options)),r);if(((n=this._$AH)==null?void 0:n._$AD)===o)this._$AH.p(t);else{let a=new Kl(o,this),l=a.u(this.options);a.p(t),this.T(l),this._$AH=a}}_$AC(e){let t=Uu.get(e.strings);return t===void 0&&Uu.set(e.strings,t=new qo(e)),t}k(e){Ql(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,o=0;for(let n of e)o===t.length?t.push(r=new i(this.O(Ko()),this.O(Ko()),this,this.options)):r=t[o],r._$AI(n),o++;o<t.length&&(this._$AR(r&&r._$AB.nextSibling,o),t.length=o)}_$AR(e=this._$AA.nextSibling,t){var r;for((r=this._$AP)==null?void 0:r.call(this,!1,!0,t);e!==this._$AB;){let o=e.nextSibling;e.remove(),e=o}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}},fr=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,o,n){this.type=1,this._$AH=fe,this._$AN=void 0,this.element=e,this.name=t,this._$AM=o,this.options=n,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=fe}_$AI(e,t=this,r,o){let n=this.strings,a=!1;if(n===void 0)e=vr(this,e,t,0),a=!Go(e)||e!==this._$AH&&e!==Ii,a&&(this._$AH=e);else{let l=e,d,v;for(e=n[0],d=0;d<n.length-1;d++)v=vr(this,l[r+d],t,d),v===Ii&&(v=this._$AH[d]),a||(a=!Go(v)||v!==this._$AH[d]),v===fe?e=fe:e!==fe&&(e+=(v??"")+n[d+1]),this._$AH[d]=v}a&&!o&&this.j(e)}j(e){e===fe?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Gl=class extends fr{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===fe?void 0:e}},ql=class extends fr{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==fe)}},zl=class extends fr{constructor(e,t,r,o,n){super(e,t,r,o,n),this.type=5}_$AI(e,t=this){if((e=vr(this,e,t,0)??fe)===Ii)return;let r=this._$AH,o=e===fe&&r!==fe||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,n=e!==fe&&(r===fe||o);o&&this.element.removeEventListener(this.name,this,r),n&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t;typeof this._$AH=="function"?this._$AH.call(((t=this.options)==null?void 0:t.host)??this.element,e):this._$AH.handleEvent(e)}},Yl=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){vr(this,e)}};var Fl=Fo.litHtmlPolyfillSupport;Fl==null||Fl(qo,zo),(Fo.litHtmlVersions??(Fo.litHtmlVersions=[])).push("3.3.1");var Wu=(i,e,t)=>{let r=(t==null?void 0:t.renderBefore)??e,o=r._$litPart$;if(o===void 0){let n=(t==null?void 0:t.renderBefore)??null;r._$litPart$=o=new zo(e.insertBefore(Ko(),n),n,void 0,t??{})}return o._$AI(i),o};var wi=globalThis,Ce=class extends wt{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=Wu(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 Ii}},Fu;Ce._$litElement$=!0,Ce.finalized=!0,(Fu=wi.litElementHydrateSupport)==null||Fu.call(wi,{LitElement:Ce});var Xl=wi.litElementPolyfillSupport;Xl==null||Xl({LitElement:Ce});(wi.litElementVersions??(wi.litElementVersions=[])).push("4.2.1");var qt=i=>(e,t)=>{t!==void 0?t.addInitializer(()=>{customElements.define(i,e)}):customElements.define(i,e)};var dv={attribute:!0,type:String,converter:Vo,reflect:!1,hasChanged:va},cv=(i=dv,e,t)=>{let{kind:r,metadata:o}=t,n=globalThis.litPropertyMetadata.get(o);if(n===void 0&&globalThis.litPropertyMetadata.set(o,n=new Map),r==="setter"&&((i=Object.create(i)).wrapped=!0),n.set(t.name,i),r==="accessor"){let{name:a}=t;return{set(l){let d=e.get.call(this);e.set.call(this,l),this.requestUpdate(a,d,i)},init(l){return l!==void 0&&this.C(a,void 0,i,l),l}}}if(r==="setter"){let{name:a}=t;return function(l){let d=this[a];e.call(this,l),this.requestUpdate(a,d,i)}}throw Error("Unsupported decorator location: "+r)};function W(i){return(e,t)=>typeof t=="object"?cv(i,e,t):((r,o,n)=>{let a=o.hasOwnProperty(n);return o.constructor.createProperty(n,r),a?Object.getOwnPropertyDescriptor(o,n):void 0})(i,e,t)}function zt(i){return W({...i,state:!0,attribute:!1})}var uv=[1005,1007,1008,1009,3001,3002,3003,3004,3005,3100,3101,3200,4003];function Jl(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 jl(i){return i===4e3||i===4001?"network":"unknown"}function ga(){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 ba(i){return typeof i=="object"&&i!==null&&"type"in i&&i.type==="bplive"&&"streamId"in i}function Er(i){return typeof i=="object"&&i!==null&&"type"in i&&i.type==="bplive"&&"clipId"in i}function hv(i){return ba(i)||Er(i)}var Mt=class extends Error{constructor(t,r,o){super(t);this.code=r;this.status=o;this.name="BPLiveError"}},Yo=class{constructor(e){this._authToken=null;this._stream=null;this._clip=null;this._config=e,this._authToken=e.authToken??null}get config(){return this._config}get authToken(){return this._authToken}get stream(){return this._stream}get clip(){return this._clip}async fetch(e){if(!this._authToken)throw new Mt("No auth token provided. Ensure config.bpLive.authToken is set before loading a BPLive source.","AUTH_REQUIRED");let t=`${this._config.discoveryUrl}${e}`,r=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${this._authToken}`}});if(!r.ok)throw new Mt(`HTTP ${r.status}: ${r.statusText}`,"HTTP_ERROR",r.status);return r.json()}async getStream(e){return this.fetch(`/streams/${e}`)}async getClip(e){return this.fetch(`/clips/${e}`)}mapPlayerSourceToResolvedSource(e){if(e.provider==="livekit")return{type:"livekit",url:e.url,token:e.token,room:e.room};if(e.provider==="nanoplayer"){let{provider:t,...r}=e;return{type:"nano",source:r}}throw new Mt(`Unknown player source provider: ${e.provider}`,"UNKNOWN_PROVIDER")}selectClipMedia(e,t="landscape"){let r=e.filter(l=>l.type==="clip");if(r.length===0)return null;let o=r.find(l=>l.orientation===t);if(o)return o;let n=t==="landscape"?"portrait":"landscape",a=r.find(l=>l.orientation===n);return a||r[0]}mapClipMediaToPlayerSource(e){return{type:"video",url:e.url}}async resolveSource(e){if(this._stream=null,this._clip=null,ba(e))return this.resolveStreamSource(e);if(Er(e))return this.resolveClipSource(e);throw new Mt("Invalid BPLive source","INVALID_SOURCE")}extractStreamPoster(e){var t;return e.cover_photo??((t=e.channel)==null?void 0:t.cover_image)??void 0}async resolveStreamSource(e){var a,l,d,v,h;let r=(await this.getStream(e.streamId)).data;this._stream=r;let o=r.player_source??((a=r.active_stream)==null?void 0:a.player_source),n=this.extractStreamPoster(r);if(o)return{source:this.mapPlayerSourceToResolvedSource(o),contentType:"stream",poster:n};if(((d=(l=r.media)==null?void 0:l.vod)==null?void 0:d.length)>0){let p=r.media.vod[0];return{source:{type:"video",url:p.original},contentType:"video",poster:n??p.thumb??void 0,videoWidth:(v=p.dimension)==null?void 0:v.width,videoHeight:(h=p.dimension)==null?void 0:h.height}}throw new Mt("Stream is not live and has no VOD content","STREAM_OFFLINE")}async resolveClipSource(e){let r=(await this.getClip(e.clipId)).data;this._clip=r;let o=this.selectClipMedia(r.media,e.preferredOrientation);if(!o)throw new Mt("No playable media found in clip","NO_MEDIA");return{source:this.mapClipMediaToPlayerSource(o),contentType:"clip",poster:o.thumbnail??void 0,videoWidth:o.width,videoHeight:o.height}}destroy(){this._authToken=null,this._stream=null,this._clip=null}};function pv(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 mv(i){return typeof i=="object"&&i!==null&&i.type==="bplive"}var vv=["loadstart","loadedmetadata","loadeddata","canplay","canplaythrough","play","playing","pause","waiting","seeking","seeked","timeupdate","durationchange","ratechange","volumechange","ended","progress","error","resize"],_a=class{constructor(){this._mediaElement=null;this._container=null;this._listeners=new Map;this._eventCleanup=[];this._destroyed=!1;this._bpLive=null;this._currentProviderType=null;this._ready=!1;this._state=ga()}get state(){return this._state}get videoElement(){return this._mediaElement}get bpLive(){return this._bpLive}get ready(){return this._ready}get providerType(){return this._currentProviderType}addEventListener(e,t){let r=Array.isArray(e)?e:[e];for(let o of r)this._listeners.has(o)||this._listeners.set(o,new Set),this._listeners.get(o).add(t)}removeEventListener(e,t){let r=Array.isArray(e)?e:[e];for(let o of r){let n=this._listeners.get(o);n&&(n.delete(t),n.size===0&&this._listeners.delete(o))}}dispatch(e,t){let r=this._listeners.get(e);if(r)for(let o of r)try{o(t)}catch(n){console.error(`[PlayerCore] Error in event listener for "${e}":`,n)}}updateState(e){this._state={...this._state,...e},this.dispatch("statechange",{state:this._state})}attach(e,t){this._destroyed||(this._container=e,this._config=t,this._ready=!0)}async loadSource(e,t,r){if(this._destroyed)return;let o=t??this._container,n=r??this._config;if(!o){console.error("[PlayerCore] No container provided. Call attach() first or provide container to loadSource().");return}this._container=o,n&&(this._config=n),this.updateState({error:null,connectionState:"connecting",paused:!0,ended:!1,playing:!1,waiting:!1,seeking:!1,readyState:0,currentTime:0,duration:NaN,buffered:null}),this.dispatch("sourcechange",{source:e});try{let a=e,l=this._state.contentType,d,v,h;if(mv(e)){if(n!=null&&n.bpLive&&(this._bpLive&&this._bpLive.destroy(),this._bpLive=new Yo(n.bpLive)),!this._bpLive)throw new Error("BPLive source requires config.bpLive configuration.");let L=await this._bpLive.resolveSource(e);a=L.source,l=L.contentType,d=L.poster,v=L.videoWidth,h=L.videoHeight}let p=pv(a);(this._currentProviderType!==null&&this._currentProviderType!==p||this._mediaElement)&&this.destroyMediaElement();let f=p==="nano"||p==="livekit"||l==="stream"?"live":"vod";return this._currentProviderType=p,this.updateState({providerType:p,contentType:l,streamType:f}),this._mediaElement=this.createMediaElement(p,a,n),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),o.appendChild(this._mediaElement),this._ready=!0,this.dispatch("videoelementchange",{video:this._mediaElement}),{poster:d,videoWidth:v,videoHeight:h}}catch(a){console.error("[PlayerCore] loadSource error:",a);let l={code:-1,message:a instanceof Error?a.message:"Failed to load source",fatal:!0,category:"setup"};this.updateState({error:l,connectionState:"failed"}),this.dispatch("error",l)}}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._container)for(;this._container.firstChild;)this._container.removeChild(this._container.firstChild)}createMediaElement(e,t,r){switch(e){case"nano":{let o=document.createElement("nano-video"),n=t;return o.libraryLocation=(r==null?void 0:r.libraryLocation)??"/vendor/bp-player",n.source?o.sourceConfig=n.source:n.streamid&&(o.streamid=n.streamid),r!=null&&r.nano&&(o.config=r.nano),o}case"livekit":{let o=document.createElement("livekit-video"),n=t;return o.url=n.url,o.token=n.token,r!=null&&r.livekit&&(o.config=r.livekit),o}case"video":default:{let o=document.createElement("hls-video"),n=typeof t=="string"?t:t.url;return o.src=n,r!=null&&r.video&&(o.config=r.video),o}}}attachMediaElementListeners(e){for(let t of vv){let r=o=>this.handleMediaEvent(t,e,o);e.addEventListener(t,r),this._eventCleanup.push(()=>e.removeEventListener(t,r))}}handleMediaEvent(e,t,r){switch(e){case"loadstart":this.updateState({readyState:1}),this.dispatch("loadstart",void 0);break;case"loadedmetadata":{let o=t.duration===1/0?"live":this._state.streamType;this.updateState({duration:t.duration,videoWidth:t.videoWidth,videoHeight:t.videoHeight,streamType:o}),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 o=t.duration===1/0?"live":this._state.streamType;this.updateState({duration:t.duration,streamType:o}),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 o=-1,n="Unknown error";r instanceof ErrorEvent&&r.error?(o=r.error.code??-1,n=r.error.message??r.message??"Unknown error"):t.error&&(o=t.error.code??-1,n=t.error.message??"Unknown error");let a="media",l=!0;this._state.providerType==="nano"&&o>0?(a=Jl(o),l=a!=="offline"&&a!=="autoplay"):this._state.providerType==="livekit"&&o>0&&(a=jl(o),l=!0);let d={code:o,message:n,fatal:l,category:a};this.updateState({error:d}),this.dispatch("error",d);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({...ga(),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}),this.dispatch("play",void 0);try{await this._mediaElement.play()}catch(e){throw this.updateState({paused:!0}),this.dispatch("pause",void 0),e}}}pause(){this._mediaElement&&(this.updateState({paused:!0,playing:!1}),this.dispatch("pause",void 0),this._mediaElement.pause())}seek(e){this._mediaElement&&(this._mediaElement.currentTime=e)}setVolume(e){let t=Math.max(0,Math.min(1,e));this.updateState({volume:t}),this._mediaElement&&(this._mediaElement.volume=t),this.dispatch("volumechange",{volume:t,muted:this._state.muted})}setMuted(e){this.updateState({muted:e}),this._mediaElement&&(this._mediaElement.muted=e),this.dispatch("volumechange",{volume:this._state.volume,muted:e})}setLoop(e){this.updateState({loop:e}),this._mediaElement&&(this._mediaElement.loop=e)}setPlaybackRate(e){this.updateState({playbackRate:e}),this._mediaElement&&(this._mediaElement.playbackRate=e),this.dispatch("ratechange",{playbackRate:e})}setTargetQuality(e){this.updateState({targetQuality:e}),this.dispatch("targetqualitychanged",{quality:e});let t=this._mediaElement;t!=null&&t.videoRenditions&&(t.videoRenditions.selectedIndex=(e==null?void 0:e.index)??-1)}setQuality(e){this.setTargetQuality(e)}_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 ed(){return new _a}var gr="bpPlayerObservedProperties";function td(i){return gr in i&&Array.isArray(i[gr])}function fv(i,e){class t extends i{get[gr](){return e}}return t}function Ev(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 br(i,e,t){if(e!=null&&e.contains(i))return;i.nodeName.includes("-")&&!td(i)&&(await Promise.resolve(),await customElements.whenDefined(i.nodeName.toLowerCase()),customElements.upgrade(i)),td(i)&&t(i);let r=Ev(i);r.length>0&&await Promise.all(r.map(o=>br(o,e,t)))}function ya(i,e,t){let r=i[gr];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 Ta(i){i[gr].includes("player")&&(i.player=void 0)}var Ku=`/**
|
|
8
8
|
* BP Player CSS Custom Properties
|
|
9
9
|
*
|
|
10
10
|
* All styling can be customized by overriding these CSS variables.
|
|
@@ -116,7 +116,7 @@ var ru=Object.defineProperty;var xm=Object.getOwnPropertyDescriptor;var ou=i=>{t
|
|
|
116
116
|
/* Mobile */
|
|
117
117
|
--bp-mobile-control-backdrop-background: rgba(0, 0, 0, 0.5);
|
|
118
118
|
}
|
|
119
|
-
`;var
|
|
119
|
+
`;var Gu=`/**
|
|
120
120
|
* BP Player Global Styles
|
|
121
121
|
*
|
|
122
122
|
* Base styles and resets for the player components.
|
|
@@ -136,8 +136,8 @@ html.bp-player-full-window > body {
|
|
|
136
136
|
margin: 0 !important;
|
|
137
137
|
padding: 0 !important;
|
|
138
138
|
}
|
|
139
|
-
`;var
|
|
140
|
-
`+
|
|
139
|
+
`;var qu=!1;function Qo(){if(qu)return;let i=document.createElement("style");i.id="bp-player-global-styles",i.textContent=Ku+`
|
|
140
|
+
`+Gu,document.head.appendChild(i),qu=!0}function _v(i,e){let t;return()=>(t||(t=document.createElement("template"),t.innerHTML=e),t)}function yv(i,e){return`<style>${i}</style>${e}`}var Aa=(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))(Aa||{});function Ee(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 _r(){return{fromAttribute:i=>{if(i)try{return JSON.parse(i)}catch{return}},toAttribute:i=>i==null?null:JSON.stringify(i)}}var q=(i,e)=>new Event(i,{bubbles:!0,composed:!0,...e}),Mi=(i,e)=>new CustomEvent(i,{bubbles:!0,composed:!0,...e});function Yt(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 Zo="play";var Ri="pause";var Qt="playing";var yr="waiting";var Xo="ended";var Jo="timeupdate";var id="durationchange";var rd="loadstart";var od="loadedmetadata";var nd="loadeddata";var jo="canplay";var Sa="canplaythrough";var en="volumechange";var Zt="resize";var tn="ready";var ka="change";var ad="addrendition";var La=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(o=>o.id===String(t.index)):-1}set selectedIndex(t){var r,o,n;if(t<0)(r=this._host.player)==null||r.setQuality(null);else{let l=(((o=this._host.player)==null?void 0:o.state.qualities)??[])[t];l&&((n=this._host.player)==null||n.setQuality(l))}this._updateSelection(),this.dispatchEvent(q(ka))}_updateSelection(){let t=this.selectedIndex;this._renditions.forEach((r,o)=>{r.selected=o===t})}_syncFromPlayer(){var o,n;let t=((o=this._host.player)==null?void 0:o.state.qualities)??[];if(t.length===0){let a=(n=this._host.player)==null?void 0:n.videoElement;a!=null&&a.videoRenditions&&(t=[...a.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 a=0;a<r;a++)delete this[a];this._renditions=t.map(a=>({id:String(a.index),width:a.width,height:a.height,bitrate:a.bitrate,selected:!1})),this._renditions.forEach((a,l)=>{this[l]=a}),this._updateSelection();for(let a of this._renditions)this.dispatchEvent(Mi(ad,{detail:a}))}_setupListeners(){this._cleanup.forEach(a=>a()),this._cleanup=[];let t=this._host.player;if(!t)return;let r=()=>{this._syncFromPlayer()},o=()=>{this._updateSelection(),this.dispatchEvent(q(ka))};t.addEventListener("qualitieschange",r),t.addEventListener("qualitychange",o),t.addEventListener("targetqualitychanged",o),this._cleanup.push(()=>{t.removeEventListener("qualitieschange",r),t.removeEventListener("qualitychange",o),t.removeEventListener("targetqualitychanged",o)});let n=t.videoElement;n!=null&&n.videoRenditions&&(n.videoRenditions.addEventListener("addrendition",r),n.videoRenditions.addEventListener("removerendition",r),this._cleanup.push(()=>{var a,l;(a=n.videoRenditions)==null||a.removeEventListener("addrendition",r),(l=n.videoRenditions)==null||l.removeEventListener("removerendition",r)})),this._syncFromPlayer()}_destroy(){this._cleanup.forEach(r=>r()),this._cleanup=[];let t=this._renditions.length;this._renditions=[];for(let r=0;r<t;r++)delete this[r]}};var zu=`/**
|
|
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
|
|
230
|
+
`;var Yu=!1;function Av(){if(Yu)return;Qo();let i=document.createElement("style");i.id="bp-player-styles",i.textContent=zu,document.head.appendChild(i),Yu=!0}var Sv=["emptied","loadstart","play","playing","pause","waiting","seeking","seeked","timeupdate","durationchange","volumechange","ratechange","ended","loadedmetadata","loadeddata","canplay","canplaythrough","progress","error","resize"],Ie=class extends Ce{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 o of r.addedNodes)o.nodeType===Node.ELEMENT_NODE&&br(o,this.providerContainer,this.registerStateReceiver);for(let o of r.removedNodes)o.nodeType===Node.ELEMENT_NODE&&br(o,this.providerContainer,this.unregisterStateReceiver)}};this.registerStateReceiver=t=>{this.stateReceivers.includes(t)||(this.stateReceivers.push(t),this._playerCore&&ya(t,this._playerCore,this._playerCore.state))};this.unregisterStateReceiver=t=>{let r=this.stateReceivers.indexOf(t);r>=0&&(this.stateReceivers.splice(r,1),Ta(t))}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),Av(),this._mutationObserver=new MutationObserver(this.handleMutation),this._mutationObserver.observe(this,{childList:!0,subtree:!0})}get player(){return this._playerCore}get playerState(){var t;return((t=this._playerCore)==null?void 0:t.state)??null}get bpLive(){var t;return((t=this._playerCore)==null?void 0:t.bpLive)??null}async play(){var t;this.debug&&console.log("[BPPlayer] play() called"),await((t=this._playerCore)==null?void 0:t.play())}pause(){var t;this.debug&&console.log("[BPPlayer] pause() called"),(t=this._playerCore)==null||t.pause()}get paused(){var r;let t=((r=this._playerCore)==null?void 0:r.state.paused)??!0;return this.debug&&console.log("[BPPlayer] paused getter:",t),t}get ended(){var t;return((t=this._playerCore)==null?void 0:t.state.ended)??!1}get seeking(){var t;return((t=this._playerCore)==null?void 0:t.state.seeking)??!1}get waiting(){var t;return((t=this._playerCore)==null?void 0:t.state.waiting)??!1}get currentTime(){var t;return((t=this._playerCore)==null?void 0:t.state.currentTime)??0}set currentTime(t){var r;(r=this._playerCore)==null||r.seek(t)}get duration(){var t;return((t=this._playerCore)==null?void 0:t.state.duration)??NaN}get volume(){var t;return((t=this._playerCore)==null?void 0:t.state.volume)??1}set volume(t){var r;(r=this._playerCore)==null||r.setVolume(t)}get muted(){var t;return((t=this._playerCore)==null?void 0:t.state.muted)??this.defaultMuted}set muted(t){var r;(r=this._playerCore)==null||r.setMuted(t),this.defaultMuted=t}get playbackRate(){var t;return((t=this._playerCore)==null?void 0:t.state.playbackRate)??1}set playbackRate(t){var r;(r=this._playerCore)==null||r.setPlaybackRate(t)}get readyState(){var t;return((t=this._playerCore)==null?void 0:t.state.readyState)??0}get buffered(){var r;let t=(r=this._playerCore)==null?void 0:r.state.buffered;return t||{length:0,start:()=>0,end:()=>0}}get videoWidth(){var o,n,a;let t=(o=this._playerCore)==null?void 0:o.videoElement;if(t!=null&&t.videoWidth)return t.videoWidth;let r=(n=this._playerCore)==null?void 0:n.state.currentQuality;return r!=null&&r.width?r.width:((a=this._playerCore)==null?void 0:a.state.videoWidth)??0}get videoHeight(){var o,n,a;let t=(o=this._playerCore)==null?void 0:o.videoElement;if(t!=null&&t.videoHeight)return t.videoHeight;let r=(n=this._playerCore)==null?void 0:n.state.currentQuality;return r!=null&&r.height?r.height:((a=this._playerCore)==null?void 0:a.state.videoHeight)??0}get videoElement(){var t;return((t=this._playerCore)==null?void 0:t.videoElement)??null}get providerType(){var t;return((t=this._playerCore)==null?void 0:t.state.providerType)??null}get videoRenditions(){return this._videoRenditions}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._mutationObserver)==null||t.disconnect(),this.destroyPlayer()}firstUpdated(t){super.firstUpdated(t),this.containerRef=this.renderRoot.querySelector(".bp-player-container"),this.containerRef&&!this.providerContainer&&(this.providerContainer=document.createElement("div"),this.providerContainer.className="bp-player-provider",this.providerContainer.style.cssText="width: 100%; height: 100%; position: absolute; top: 0; left: 0;",this.containerRef.appendChild(this.providerContainer)),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(){this._playerCore||!this.providerContainer||(this._playerCore=ed(),this.defaultMuted&&this._playerCore.setMuted(!0),this.loop&&this._playerCore.setLoop(!0),this._playerCore.attach(this.providerContainer,this.config),this.setupEventForwarding(),this._videoRenditions=new La(this))}async loadSource(){var r,o,n,a,l,d,v;let t=(o=(r=this.source)==null?void 0:r.sources)==null?void 0:o[0];if(!t){(n=this._playerCore)!=null&&n.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})),(a=this._videoRenditions)==null||a._setupListeners(),this._hasDispatchedReady||(this._hasDispatchedReady=!0,br(this,this.providerContainer,this.registerStateReceiver),this.dispatchEvent(Mi(tn,{detail:this._playerCore})),this.debug&&console.log("[BPPlayer] Player ready",(l=this._playerCore)==null?void 0:l.state)),this.propagateStateToAllReceivers(),this.updateStateAttributes(),(v=(d=this._playerCore)==null?void 0:d.state)!=null&&v.paused&&this.dispatchEvent(q(Ri)),this.autoplay&&this._playerCore)try{await this._playerCore.play()}catch{}}catch(h){console.error("[BPPlayer] Failed to load source:",h)}}propagateStateToAllReceivers(){if(!this._playerCore)return;let t=this._playerCore.state;for(let r of this.stateReceivers)ya(r,this._playerCore,t)}setupEventForwarding(){if(!this._playerCore)return;for(let n of Sv){let a=()=>{var l;this.debug&&!["durationchange","timeupdate"].includes(n)&&console.log(`[BPPlayer] Forwarding event: ${n}`,(l=this._playerCore)==null?void 0:l.state),this.dispatchEvent(q(n))};this._playerCore.addEventListener(n,a),this.eventCleanup.push(()=>{var l;return(l=this._playerCore)==null?void 0:l.removeEventListener(n,a)})}let t=()=>{var a;let n=(a=this._playerCore)==null?void 0:a.videoElement;n&&this.updateVideoDimensions(n.videoWidth,n.videoHeight)};this._playerCore.addEventListener("resize",t),this._playerCore.addEventListener("loadedmetadata",t),this.eventCleanup.push(()=>{var n;return(n=this._playerCore)==null?void 0:n.removeEventListener("resize",t)}),this.eventCleanup.push(()=>{var n;return(n=this._playerCore)==null?void 0:n.removeEventListener("loadedmetadata",t)}),t();let r=()=>{this.dispatchEvent(q(Zt))};this._playerCore.addEventListener("qualitychange",r),this.eventCleanup.push(()=>{var n;return(n=this._playerCore)==null?void 0:n.removeEventListener("qualitychange",r)});let o=()=>{this.propagateStateToAllReceivers(),this.updateStateAttributes()};this._playerCore.addEventListener("statechange",o),this.eventCleanup.push(()=>{var n;return(n=this._playerCore)==null?void 0:n.removeEventListener("statechange",o)})}updateStateAttributes(){if(!this._playerCore)return;let t=this._playerCore.state;Ee(this,"paused",t.paused),Ee(this,"playing",t.playing),Ee(this,"ended",t.ended),Ee(this,"seeking",t.seeking),Ee(this,"waiting",t.waiting),Ee(this,"has-error",t.error!==null),Ee(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)Ta(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 We`
|
|
231
231
|
<div
|
|
232
232
|
class="${this.getContainerClasses()}"
|
|
233
233
|
style="${this.getContainerStyle()}"
|
|
234
234
|
>
|
|
235
235
|
</div>
|
|
236
|
-
`}};N([W({converter:Lu})],we.prototype,"source",2),N([W({type:Boolean})],we.prototype,"autoplay",2),N([W({type:Boolean,reflect:!0,attribute:"muted"})],we.prototype,"defaultMuted",2),N([W({type:Boolean})],we.prototype,"loop",2),N([W({type:String})],we.prototype,"scaling",2),N([W({type:String,attribute:"aspect-ratio"})],we.prototype,"aspectRatio",2),N([W({converter:Lu})],we.prototype,"config",2),N([W({type:Boolean})],we.prototype,"debug",2),N([qt()],we.prototype,"_playerCore",2),we=N([Kt("bp-player")],we);var b={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_LOOP_REQUEST:"medialooprequest",MEDIA_VOLUME_REQUEST:"mediavolumerequest",MEDIA_SEEK_REQUEST:"mediaseekrequest",MEDIA_AIRPLAY_REQUEST:"mediaairplayrequest",MEDIA_ENTER_FULLSCREEN_REQUEST:"mediaenterfullscreenrequest",MEDIA_EXIT_FULLSCREEN_REQUEST:"mediaexitfullscreenrequest",MEDIA_PREVIEW_REQUEST:"mediapreviewrequest",MEDIA_ENTER_PIP_REQUEST:"mediaenterpiprequest",MEDIA_EXIT_PIP_REQUEST:"mediaexitpiprequest",MEDIA_ENTER_CAST_REQUEST:"mediaentercastrequest",MEDIA_EXIT_CAST_REQUEST:"mediaexitcastrequest",MEDIA_SHOW_TEXT_TRACKS_REQUEST:"mediashowtexttracksrequest",MEDIA_HIDE_TEXT_TRACKS_REQUEST:"mediahidetexttracksrequest",MEDIA_SHOW_SUBTITLES_REQUEST:"mediashowsubtitlesrequest",MEDIA_DISABLE_SUBTITLES_REQUEST:"mediadisablesubtitlesrequest",MEDIA_TOGGLE_SUBTITLES_REQUEST:"mediatogglesubtitlesrequest",MEDIA_PLAYBACK_RATE_REQUEST:"mediaplaybackraterequest",MEDIA_RENDITION_REQUEST:"mediarenditionrequest",MEDIA_AUDIO_TRACK_REQUEST:"mediaaudiotrackrequest",MEDIA_SEEK_TO_LIVE_REQUEST:"mediaseektoliverequest",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},U={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},Bl={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"},Cu=Object.entries(Bl),s=Cu.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{}),av={USER_INACTIVE_CHANGE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},Li=Cu.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{...av}),a_=Object.entries(Li).reduce((i,[e,t])=>{let r=s[e];return r&&(i[t]=r),i},{userinactivechange:"userinactive"}),Iu=Object.entries(s).reduce((i,[e,t])=>{let r=Li[e];return r&&(i[t]=r),i},{userinactive:"userinactivechange"}),Ce={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},Gt={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var ua={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},Ie={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},Qe={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var Mu={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};function Ru(i){return i==null?void 0:i.map(lv).join(" ")}function xu(i){return i==null?void 0:i.split(/\s+/).map(dv)}function lv(i){if(i){let{id:e,width:t,height:r}=i;return[e,t,r].filter(o=>o!=null).join(":")}}function dv(i){if(i){let[e,t,r]=i.split(":");return{id:e,width:+t,height:+r}}}function Pu(i){return i==null?void 0:i.map(cv).join(" ")}function Du(i){return i==null?void 0:i.split(/\s+/).map(uv)}function cv(i){if(i){let{id:e,kind:t,language:r,label:o}=i;return[e,t,r,o].filter(n=>n!=null).join(":")}}function uv(i){if(i){let[e,t,r,o]=i.split(":");return{id:e,kind:t,language:r,label:o}}}function mr(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}var ha=i=>new Promise(e=>setTimeout(e,i));var Ou=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],hv=(i,e)=>{let t=i===1?Ou[e].singular:Ou[e].plural;return`${i} ${t}`},wi=i=>{if(!mr(i))return"";let e=Math.abs(i),t=e!==i,r=new Date(0,0,0,0,0,e,0);return`${[r.getHours(),r.getMinutes(),r.getSeconds()].map((l,c)=>l&&hv(l,c)).filter(l=>l).join(", ")}${t?" remaining":""}`};function Ze(i,e){let t=!1;i<0&&(t=!0,i=0-i),i=i<0?0:i;let r=Math.floor(i%60),o=Math.floor(i/60%60),n=Math.floor(i/3600),a=Math.floor(e/60%60),l=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(n=o=r="0"),n=n>0||l>0?n+":":"",o=((n||a>=10)&&o<10?"0"+o:o)+":",r=r<10?"0"+r:r,(t?"-":"")+n+o+r}var d_=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 Uu={"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 Nu,Vl={en:Uu},Wl=((Nu=globalThis.navigator)==null?void 0:Nu.language)||"en",Hu=i=>{Wl=i};var mv=i=>{var e,t,r;let[o]=Wl.split("-");return((e=Vl[Wl])==null?void 0:e[i])||((t=Vl[o])==null?void 0:t[i])||((r=Vl.en)==null?void 0:r[i])||i},E=(i,e={})=>mv(i).replace(/\{(\w+)\}/g,(t,r)=>r in e?String(e[r]):`{${r}}`);var pa=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},ma=class extends pa{},va=class extends ma{constructor(){super(...arguments),this.role=null}},Fl=class{observe(){}unobserve(){}disconnect(){}},$u={createElement:function(){return new Wo.HTMLElement},createElementNS:function(){return new Wo.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(i){return!1}},Wo={ResizeObserver:Fl,document:$u,Node:ma,Element:va,HTMLElement:class extends va{constructor(){super(...arguments),this.innerHTML=""}get content(){return new Wo.DocumentFragment}},DocumentFragment:class extends pa{},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}}}}},Bu="global"in globalThis&&(globalThis==null?void 0:globalThis.global)===globalThis||typeof window>"u"||typeof window.customElements>"u",Vu=Object.keys(Wo).every(i=>i in globalThis),d=Bu&&!Vu?Wo:globalThis,j=Bu&&!Vu?$u:globalThis.document;var Wu=new WeakMap,Kl=i=>{let e=Wu.get(i);return e||Wu.set(i,e=new Set),e},Fu=new d.ResizeObserver(i=>{for(let e of i)for(let t of Kl(e.target))t(e)});function Mt(i,e){Kl(i).add(e),Fu.observe(i)}function Rt(i,e){let t=Kl(i);t.delete(e),t.size||Fu.unobserve(i)}function J(i){let e={};for(let t of i)e[t.name]=t.value;return e}function Z(i){var e;return(e=fa(i))!=null?e:ot(i,"media-controller")}function fa(i){var e;let{MEDIA_CONTROLLER:t}=U,r=i.getAttribute(t);if(r)return(e=Ci(i))==null?void 0:e.getElementById(r)}var ga=(i,e,t=".value")=>{let r=i.querySelector(t);r&&(r.textContent=e)},vv=(i,e)=>{let t=`slot[name="${e}"]`,r=i.shadowRoot.querySelector(t);return r?r.children:[]},Ea=(i,e)=>vv(i,e)[0],Te=(i,e)=>!i||!e?!1:i!=null&&i.contains(e)?!0:Te(i,e.getRootNode().host),ot=(i,e)=>{if(!i)return null;let t=i.closest(e);return t||ot(i.getRootNode().host,e)};function Fo(i=document){var e;let t=i==null?void 0:i.activeElement;return t?(e=Fo(t.shadowRoot))!=null?e:t:null}function Ci(i){var e;let t=(e=i==null?void 0:i.getRootNode)==null?void 0:e.call(i);return t instanceof ShadowRoot||t instanceof Document?t:null}function ba(i,{depth:e=3,checkOpacity:t=!0,checkVisibilityCSS:r=!0}={}){if(i.checkVisibility)return i.checkVisibility({checkOpacity:t,checkVisibilityCSS:r});let o=i;for(;o&&e>0;){let n=getComputedStyle(o);if(t&&n.opacity==="0"||r&&n.visibility==="hidden"||n.display==="none")return!1;o=o.parentElement,e--}return!0}function Ku(i,e,t,r){let o=r.x-t.x,n=r.y-t.y,a=o*o+n*n;if(a===0)return 0;let l=((i-t.x)*o+(e-t.y)*n)/a;return Math.max(0,Math.min(1,l))}function X(i,e){let t=fv(i,r=>r===e);return t||Ko(i,e)}function fv(i,e){var t,r;let o;for(o of(t=i.querySelectorAll("style:not([media])"))!=null?t:[]){let n;try{n=(r=o.sheet)==null?void 0:r.cssRules}catch{continue}for(let a of n??[])if(e(a.selectorText))return a}}function Ko(i,e){var t,r;let o=(t=i.querySelectorAll("style:not([media])"))!=null?t:[],n=o==null?void 0:o[o.length-1];return n!=null&&n.sheet?(n==null||n.sheet.insertRule(`${e}{}`,n.sheet.cssRules.length),(r=n.sheet.cssRules)==null?void 0:r[n.sheet.cssRules.length-1]):(console.warn("Media Chrome: No style sheet found on style tag of",i),{style:{setProperty:()=>{},removeProperty:()=>"",getPropertyValue:()=>""}})}function H(i,e,t=Number.NaN){let r=i.getAttribute(e);return r!=null?+r:t}function B(i,e,t){let r=+t;if(t==null||Number.isNaN(r)){i.hasAttribute(e)&&i.removeAttribute(e);return}H(i,e,void 0)!==r&&i.setAttribute(e,`${r}`)}function C(i,e){return i.hasAttribute(e)}function I(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}C(i,e)!=t&&i.toggleAttribute(e,t)}function x(i,e,t=null){var r;return(r=i.getAttribute(e))!=null?r:t}function P(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}let r=`${t}`;x(i,e,void 0)!==r&&i.setAttribute(e,r)}var qu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},zt=(i,e,t)=>(qu(i,e,"read from private field"),t?t.call(i):e.get(i)),gv=(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)},_a=(i,e,t,r)=>(qu(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Me;function Ev(i){return`
|
|
236
|
+
`}};U([W({converter:_r()})],Ie.prototype,"source",2),U([W({type:Boolean})],Ie.prototype,"autoplay",2),U([W({type:Boolean,reflect:!0,attribute:"muted"})],Ie.prototype,"defaultMuted",2),U([W({type:Boolean})],Ie.prototype,"loop",2),U([W({type:String})],Ie.prototype,"scaling",2),U([W({type:String,attribute:"aspect-ratio"})],Ie.prototype,"aspectRatio",2),U([W({converter:_r()})],Ie.prototype,"config",2),U([W({type:Boolean})],Ie.prototype,"debug",2),U([zt()],Ie.prototype,"_playerCore",2),Ie=U([qt("bp-player")],Ie);var b={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_LOOP_REQUEST:"medialooprequest",MEDIA_VOLUME_REQUEST:"mediavolumerequest",MEDIA_SEEK_REQUEST:"mediaseekrequest",MEDIA_AIRPLAY_REQUEST:"mediaairplayrequest",MEDIA_ENTER_FULLSCREEN_REQUEST:"mediaenterfullscreenrequest",MEDIA_EXIT_FULLSCREEN_REQUEST:"mediaexitfullscreenrequest",MEDIA_PREVIEW_REQUEST:"mediapreviewrequest",MEDIA_ENTER_PIP_REQUEST:"mediaenterpiprequest",MEDIA_EXIT_PIP_REQUEST:"mediaexitpiprequest",MEDIA_ENTER_CAST_REQUEST:"mediaentercastrequest",MEDIA_EXIT_CAST_REQUEST:"mediaexitcastrequest",MEDIA_SHOW_TEXT_TRACKS_REQUEST:"mediashowtexttracksrequest",MEDIA_HIDE_TEXT_TRACKS_REQUEST:"mediahidetexttracksrequest",MEDIA_SHOW_SUBTITLES_REQUEST:"mediashowsubtitlesrequest",MEDIA_DISABLE_SUBTITLES_REQUEST:"mediadisablesubtitlesrequest",MEDIA_TOGGLE_SUBTITLES_REQUEST:"mediatogglesubtitlesrequest",MEDIA_PLAYBACK_RATE_REQUEST:"mediaplaybackraterequest",MEDIA_RENDITION_REQUEST:"mediarenditionrequest",MEDIA_AUDIO_TRACK_REQUEST:"mediaaudiotrackrequest",MEDIA_SEEK_TO_LIVE_REQUEST:"mediaseektoliverequest",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},N={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},sd={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"},Qu=Object.entries(sd),s=Qu.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{}),kv={USER_INACTIVE_CHANGE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},xi=Qu.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{...kv}),xy=Object.entries(xi).reduce((i,[e,t])=>{let r=s[e];return r&&(i[t]=r),i},{userinactivechange:"userinactive"}),Zu=Object.entries(s).reduce((i,[e,t])=>{let r=xi[e];return r&&(i[t]=r),i},{userinactive:"userinactivechange"}),we={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},Xt={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var Ca={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},Me={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},Xe={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var Xu={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};function Ju(i){return i==null?void 0:i.map(Cv).join(" ")}function ju(i){return i==null?void 0:i.split(/\s+/).map(Iv)}function Cv(i){if(i){let{id:e,width:t,height:r}=i;return[e,t,r].filter(o=>o!=null).join(":")}}function Iv(i){if(i){let[e,t,r]=i.split(":");return{id:e,width:+t,height:+r}}}function eh(i){return i==null?void 0:i.map(wv).join(" ")}function th(i){return i==null?void 0:i.split(/\s+/).map(Mv)}function wv(i){if(i){let{id:e,kind:t,language:r,label:o}=i;return[e,t,r,o].filter(n=>n!=null).join(":")}}function Mv(i){if(i){let[e,t,r,o]=i.split(":");return{id:e,kind:t,language:r,label:o}}}function Tr(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}var Ia=i=>new Promise(e=>setTimeout(e,i));var ih=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],Rv=(i,e)=>{let t=i===1?ih[e].singular:ih[e].plural;return`${i} ${t}`},Pi=i=>{if(!Tr(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&&Rv(l,d)).filter(l=>l).join(", ")}${t?" remaining":""}`};function Je(i,e){let t=!1;i<0&&(t=!0,i=0-i),i=i<0?0:i;let r=Math.floor(i%60),o=Math.floor(i/60%60),n=Math.floor(i/3600),a=Math.floor(e/60%60),l=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(n=o=r="0"),n=n>0||l>0?n+":":"",o=((n||a>=10)&&o<10?"0"+o:o)+":",r=r<10?"0"+r:r,(t?"-":"")+n+o+r}var Oy=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 rh={"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 oh,ld={en:rh},dd=((oh=globalThis.navigator)==null?void 0:oh.language)||"en",nh=i=>{dd=i};var Pv=i=>{var e,t,r;let[o]=dd.split("-");return((e=ld[dd])==null?void 0:e[i])||((t=ld[o])==null?void 0:t[i])||((r=ld.en)==null?void 0:r[i])||i},g=(i,e={})=>Pv(i).replace(/\{(\w+)\}/g,(t,r)=>r in e?String(e[r]):`{${r}}`);var wa=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},Ma=class extends wa{},Ra=class extends Ma{constructor(){super(...arguments),this.role=null}},cd=class{observe(){}unobserve(){}disconnect(){}},ah={createElement:function(){return new rn.HTMLElement},createElementNS:function(){return new rn.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(i){return!1}},rn={ResizeObserver:cd,document:ah,Node:Ma,Element:Ra,HTMLElement:class extends Ra{constructor(){super(...arguments),this.innerHTML=""}get content(){return new rn.DocumentFragment}},DocumentFragment:class extends wa{},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}}}}},sh="global"in globalThis&&(globalThis==null?void 0:globalThis.global)===globalThis||typeof window>"u"||typeof window.customElements>"u",lh=Object.keys(rn).every(i=>i in globalThis),c=sh&&!lh?rn:globalThis,ee=sh&&!lh?ah:globalThis.document;var dh=new WeakMap,ud=i=>{let e=dh.get(i);return e||dh.set(i,e=new Set),e},ch=new c.ResizeObserver(i=>{for(let e of i)for(let t of ud(e.target))t(e)});function Rt(i,e){ud(i).add(e),ch.observe(i)}function xt(i,e){let t=ud(i);t.delete(e),t.size||ch.unobserve(i)}function j(i){let e={};for(let t of i)e[t.name]=t.value;return e}function X(i){var e;return(e=xa(i))!=null?e:nt(i,"media-controller")}function xa(i){var e;let{MEDIA_CONTROLLER:t}=N,r=i.getAttribute(t);if(r)return(e=Di(i))==null?void 0:e.getElementById(r)}var Pa=(i,e,t=".value")=>{let r=i.querySelector(t);r&&(r.textContent=e)},Dv=(i,e)=>{let t=`slot[name="${e}"]`,r=i.shadowRoot.querySelector(t);return r?r.children:[]},Da=(i,e)=>Dv(i,e)[0],Ae=(i,e)=>!i||!e?!1:i!=null&&i.contains(e)?!0:Ae(i,e.getRootNode().host),nt=(i,e)=>{if(!i)return null;let t=i.closest(e);return t||nt(i.getRootNode().host,e)};function on(i=document){var e;let t=i==null?void 0:i.activeElement;return t?(e=on(t.shadowRoot))!=null?e:t:null}function Di(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 Oa(i,{depth:e=3,checkOpacity:t=!0,checkVisibilityCSS:r=!0}={}){if(i.checkVisibility)return i.checkVisibility({checkOpacity:t,checkVisibilityCSS:r});let o=i;for(;o&&e>0;){let n=getComputedStyle(o);if(t&&n.opacity==="0"||r&&n.visibility==="hidden"||n.display==="none")return!1;o=o.parentElement,e--}return!0}function uh(i,e,t,r){let o=r.x-t.x,n=r.y-t.y,a=o*o+n*n;if(a===0)return 0;let l=((i-t.x)*o+(e-t.y)*n)/a;return Math.max(0,Math.min(1,l))}function J(i,e){let t=Ov(i,r=>r===e);return t||nn(i,e)}function Ov(i,e){var t,r;let o;for(o of(t=i.querySelectorAll("style:not([media])"))!=null?t:[]){let n;try{n=(r=o.sheet)==null?void 0:r.cssRules}catch{continue}for(let a of n??[])if(e(a.selectorText))return a}}function nn(i,e){var t,r;let o=(t=i.querySelectorAll("style:not([media])"))!=null?t:[],n=o==null?void 0:o[o.length-1];return n!=null&&n.sheet?(n==null||n.sheet.insertRule(`${e}{}`,n.sheet.cssRules.length),(r=n.sheet.cssRules)==null?void 0:r[n.sheet.cssRules.length-1]):(console.warn("Media Chrome: No style sheet found on style tag of",i),{style:{setProperty:()=>{},removeProperty:()=>"",getPropertyValue:()=>""}})}function H(i,e,t=Number.NaN){let r=i.getAttribute(e);return r!=null?+r:t}function B(i,e,t){let r=+t;if(t==null||Number.isNaN(r)){i.hasAttribute(e)&&i.removeAttribute(e);return}H(i,e,void 0)!==r&&i.setAttribute(e,`${r}`)}function I(i,e){return i.hasAttribute(e)}function w(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}I(i,e)!=t&&i.toggleAttribute(e,t)}function x(i,e,t=null){var r;return(r=i.getAttribute(e))!=null?r:t}function P(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}let r=`${t}`;x(i,e,void 0)!==r&&i.setAttribute(e,r)}var hh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Jt=(i,e,t)=>(hh(i,e,"read from private field"),t?t.call(i):e.get(i)),Nv=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Na=(i,e,t,r)=>(hh(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Re;function Uv(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
|
|
243
|
+
`}var Ar=class extends c.HTMLElement{constructor(){if(super(),Nv(this,Re,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[N.MEDIA_CONTROLLER,s.MEDIA_PAUSED]}attributeChangedCallback(e,t,r){var o,n,a,l,d;e===N.MEDIA_CONTROLLER&&(t&&((n=(o=Jt(this,Re))==null?void 0:o.unassociateElement)==null||n.call(o,this),Na(this,Re,null)),r&&this.isConnected&&(Na(this,Re,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(d=(l=Jt(this,Re))==null?void 0:l.associateElement)==null||d.call(l,this)))}connectedCallback(){var e,t,r,o;this.tabIndex=-1,this.setAttribute("aria-hidden","true"),Na(this,Re,Hv(this)),this.getAttribute(N.MEDIA_CONTROLLER)&&((t=(e=Jt(this,Re))==null?void 0:e.associateElement)==null||t.call(e,this)),(r=Jt(this,Re))==null||r.addEventListener("pointerdown",this),(o=Jt(this,Re))==null||o.addEventListener("click",this)}disconnectedCallback(){var e,t,r,o;this.getAttribute(N.MEDIA_CONTROLLER)&&((t=(e=Jt(this,Re))==null?void 0:e.unassociateElement)==null||t.call(e,this)),(r=Jt(this,Re))==null||r.removeEventListener("pointerdown",this),(o=Jt(this,Re))==null||o.removeEventListener("click",this),Na(this,Re,null)}handleEvent(e){var t;let r=(t=e.composedPath())==null?void 0:t[0];if(["video","media-controller"].includes(r==null?void 0:r.localName)){if(e.type==="pointerdown")this._pointerType=e.pointerType;else if(e.type==="click"){let{clientX:n,clientY:a}=e,{left:l,top:d,width:v,height:h}=this.getBoundingClientRect(),p=n-l,E=a-d;if(p<0||E<0||p>v||E>h||v===0&&h===0)return;let m=this._pointerType||"mouse";if(this._pointerType=void 0,m===Ca.TOUCH){this.handleTap(e);return}else if(m===Ca.MOUSE||m===Ca.PEN){this.handleMouseClick(e);return}}}}get mediaPaused(){return I(this,s.MEDIA_PAUSED)}set mediaPaused(e){w(this,s.MEDIA_PAUSED,e)}handleTap(e){}handleMouseClick(e){let t=this.mediaPaused?b.MEDIA_PLAY_REQUEST:b.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new c.CustomEvent(t,{composed:!0,bubbles:!0}))}};Re=new WeakMap;Ar.shadowRootOptions={mode:"open"};Ar.getTemplateHTML=Uv;function Hv(i){var e;let t=i.getAttribute(N.MEDIA_CONTROLLER);return t?(e=i.getRootNode())==null?void 0:e.getElementById(t):nt(i,"media-controller")}c.customElements.get("media-gesture-receiver")||c.customElements.define("media-gesture-receiver",Ar);var Ua=Ar;var vd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},He=(i,e,t)=>(vd(i,e,"read from private field"),t?t.call(i):e.get(i)),Ue=(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)},Oi=(i,e,t,r)=>(vd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Fe=(i,e,t)=>(vd(i,e,"access private method"),t),Ba,Sr,sn,kr,Ha,hd,ph,an,$a,pd,mh,md,vh,ln,Va,Wa,fd,Lr,dn,R={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive",AUTOHIDE_OVER_CONTROLS:"autohideovercontrols"};function $v(i){return`
|
|
244
244
|
<style>
|
|
245
245
|
|
|
246
246
|
:host([${s.MEDIA_IS_FULLSCREEN}]) ::slotted([slot=media]) {
|
|
@@ -378,8 +378,8 @@ bp-player[has-error] {
|
|
|
378
378
|
<slot name="poster" part="layer poster-layer"></slot>
|
|
379
379
|
<slot name="gestures-chrome" part="layer gesture-layer">
|
|
380
380
|
<media-gesture-receiver slot="gestures-chrome">
|
|
381
|
-
<template shadowrootmode="${
|
|
382
|
-
${
|
|
381
|
+
<template shadowrootmode="${Ua.shadowRootOptions.mode}">
|
|
382
|
+
${Ua.getTemplateHTML({})}
|
|
383
383
|
</template>
|
|
384
384
|
</media-gesture-receiver>
|
|
385
385
|
</slot>
|
|
@@ -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 yv=Object.values(s),Tv="sm:384 md:576 lg:768 xl:960";function Av(i){Qu(i.target,i.contentRect.width)}function Qu(i,e){var t;if(!i.isConnected)return;let r=(t=i.getAttribute(R.BREAKPOINTS))!=null?t:Tv,o=Sv(r),n=kv(o,e),a=!1;if(Object.keys(o).forEach(l=>{if(n.includes(l)){i.hasAttribute(`breakpoint${l}`)||(i.setAttribute(`breakpoint${l}`,""),a=!0);return}i.hasAttribute(`breakpoint${l}`)&&(i.removeAttribute(`breakpoint${l}`),a=!0)}),a){let l=new CustomEvent(Li.BREAKPOINTS_CHANGE,{detail:n});i.dispatchEvent(l)}i.breakpointsComputed||(i.breakpointsComputed=!0,i.dispatchEvent(new CustomEvent(Li.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))}function Sv(i){let e=i.split(/\s+/);return Object.fromEntries(e.map(t=>t.split(":")))}function kv(i,e){return Object.keys(i).filter(t=>e>=parseInt(i[t]))}var Mi=class extends d.HTMLElement{constructor(){if(super(),Ue(this,ql),Ue(this,Gl),Ue(this,zl),Ue(this,zo),Ue(this,La),Ue(this,Er),Ue(this,Sa,0),Ue(this,fr,null),Ue(this,Go,null),Ue(this,gr,void 0),this.breakpointsComputed=!1,Ue(this,Ta,new MutationObserver(We(this,ql,Gu).bind(this))),Ue(this,qo,!1),Ue(this,Aa,t=>{Ne(this,qo)||(setTimeout(()=>{Av(t),Ii(this,qo,!1)},0),Ii(this,qo,!0))}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let t=J(this.attributes),r=this.constructor.getTemplateHTML(t);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(r):this.shadowRoot.innerHTML=r}let e=this.querySelector(":scope > slot[slot=media]");e&&e.addEventListener("slotchange",()=>{if(!e.assignedElements({flatten:!0}).length){Ne(this,fr)&&this.mediaUnsetCallback(Ne(this,fr));return}this.handleMediaUpdated(this.media)})}static get observedAttributes(){return[R.AUTOHIDE,R.GESTURES_DISABLED].concat(yv).filter(e=>![s.MEDIA_RENDITION_LIST,s.MEDIA_AUDIO_TRACK_LIST,s.MEDIA_CHAPTERS_CUES,s.MEDIA_WIDTH,s.MEDIA_HEIGHT,s.MEDIA_ERROR,s.MEDIA_ERROR_MESSAGE].includes(e))}attributeChangedCallback(e,t,r){e.toLowerCase()==R.AUTOHIDE&&(this.autohide=r)}get media(){let e=this.querySelector(":scope > [slot=media]");return(e==null?void 0:e.nodeName)=="SLOT"&&(e=e.assignedElements({flatten:!0})[0]),e}async handleMediaUpdated(e){e&&(Ii(this,fr,e),e.localName.includes("-")&&await d.customElements.whenDefined(e.localName),this.mediaSetCallback(e))}connectedCallback(){var e;Ne(this,Ta).observe(this,{childList:!0,subtree:!0}),Mt(this,Ne(this,Aa));let r=this.getAttribute(R.AUDIO)!=null?E("audio player"):E("video player");this.setAttribute("role","region"),this.setAttribute("aria-label",r),this.handleMediaUpdated(this.media),this.setAttribute(R.USER_INACTIVE,""),Qu(this,this.getBoundingClientRect().width),this.addEventListener("pointerdown",this),this.addEventListener("pointermove",this),this.addEventListener("pointerup",this),this.addEventListener("mouseleave",this),this.addEventListener("keyup",this),(e=d.window)==null||e.addEventListener("mouseup",this)}disconnectedCallback(){var e;Ne(this,Ta).disconnect(),Rt(this,Ne(this,Aa)),this.media&&this.mediaUnsetCallback(this.media),(e=d.window)==null||e.removeEventListener("mouseup",this)}mediaSetCallback(e){}mediaUnsetCallback(e){Ii(this,fr,null)}handleEvent(e){switch(e.type){case"pointerdown":Ii(this,Sa,e.timeStamp);break;case"pointermove":We(this,Gl,zu).call(this,e);break;case"pointerup":We(this,zl,Yu).call(this,e);break;case"mouseleave":We(this,zo,ka).call(this);break;case"mouseup":this.removeAttribute(R.KEYBOARD_CONTROL);break;case"keyup":We(this,Er,Yo).call(this),this.setAttribute(R.KEYBOARD_CONTROL,"");break}}set autohide(e){let t=Number(e);Ii(this,gr,isNaN(t)?0:t)}get autohide(){return(Ne(this,gr)===void 0?2:Ne(this,gr)).toString()}get breakpoints(){return x(this,R.BREAKPOINTS)}set breakpoints(e){P(this,R.BREAKPOINTS,e)}get audio(){return C(this,R.AUDIO)}set audio(e){I(this,R.AUDIO,e)}get gesturesDisabled(){return C(this,R.GESTURES_DISABLED)}set gesturesDisabled(e){I(this,R.GESTURES_DISABLED,e)}get keyboardControl(){return C(this,R.KEYBOARD_CONTROL)}set keyboardControl(e){I(this,R.KEYBOARD_CONTROL,e)}get noAutohide(){return C(this,R.NO_AUTOHIDE)}set noAutohide(e){I(this,R.NO_AUTOHIDE,e)}get autohideOverControls(){return C(this,R.AUTOHIDE_OVER_CONTROLS)}set autohideOverControls(e){I(this,R.AUTOHIDE_OVER_CONTROLS,e)}get userInteractive(){return C(this,R.USER_INACTIVE)}set userInteractive(e){I(this,R.USER_INACTIVE,e)}};Sa=new WeakMap;fr=new WeakMap;Go=new WeakMap;gr=new WeakMap;Ta=new WeakMap;ql=new WeakSet;Gu=function(i){let e=this.media;for(let t of i){if(t.type!=="childList")continue;let r=t.removedNodes;for(let o of r){if(o.slot!="media"||t.target!=this)continue;let n=t.previousSibling&&t.previousSibling.previousElementSibling;if(!n||!e)this.mediaUnsetCallback(o);else{let a=n.slot!=="media";for(;(n=n.previousSibling)!==null;)n.slot=="media"&&(a=!1);a&&this.mediaUnsetCallback(o)}}if(e)for(let o of t.addedNodes)o===e&&this.handleMediaUpdated(e)}};qo=new WeakMap;Aa=new WeakMap;Gl=new WeakSet;zu=function(i){if(i.pointerType!=="mouse"&&i.timeStamp-Ne(this,Sa)<250)return;We(this,La,Ql).call(this),clearTimeout(Ne(this,Go));let e=this.hasAttribute(R.AUTOHIDE_OVER_CONTROLS);([this,this.media].includes(i.target)||e)&&We(this,Er,Yo).call(this)};zl=new WeakSet;Yu=function(i){if(i.pointerType==="touch"){let e=!this.hasAttribute(R.USER_INACTIVE);[this,this.media].includes(i.target)&&e?We(this,zo,ka).call(this):We(this,Er,Yo).call(this)}else i.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e==null?void 0:e.localName))&&We(this,Er,Yo).call(this)};zo=new WeakSet;ka=function(){if(Ne(this,gr)<0||this.hasAttribute(R.USER_INACTIVE))return;this.setAttribute(R.USER_INACTIVE,"");let i=new d.CustomEvent(Li.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(i)};La=new WeakSet;Ql=function(){if(!this.hasAttribute(R.USER_INACTIVE))return;this.removeAttribute(R.USER_INACTIVE);let i=new d.CustomEvent(Li.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(i)};Er=new WeakSet;Yo=function(){We(this,La,Ql).call(this),clearTimeout(Ne(this,Go));let i=parseInt(this.autohide);i<0||Ii(this,Go,setTimeout(()=>{We(this,zo,ka).call(this)},i*1e3))};Mi.shadowRootOptions={mode:"open"};Mi.getTemplateHTML=_v;d.customElements.get("media-container")||d.customElements.define("media-container",Mi);var Zu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ge=(i,e,t)=>(Zu(i,e,"read from private field"),t?t.call(i):e.get(i)),Qo=(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)},wa=(i,e,t,r)=>(Zu(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),br,_r,Ca,Ri,xt,Yt,Qt=class{constructor(e,t,{defaultValue:r}={defaultValue:void 0}){Qo(this,xt),Qo(this,br,void 0),Qo(this,_r,void 0),Qo(this,Ca,void 0),Qo(this,Ri,new Set),wa(this,br,e),wa(this,_r,t),wa(this,Ca,new Set(r))}[Symbol.iterator](){return ge(this,xt,Yt).values()}get length(){return ge(this,xt,Yt).size}get value(){var e;return(e=[...ge(this,xt,Yt)].join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(wa(this,Ri,new Set),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return[...ge(this,xt,Yt)][e]}values(){return ge(this,xt,Yt).values()}forEach(e,t){ge(this,xt,Yt).forEach(e,t)}add(...e){var t,r;e.forEach(o=>ge(this,Ri).add(o)),!(this.value===""&&!((t=ge(this,br))!=null&&t.hasAttribute(`${ge(this,_r)}`)))&&((r=ge(this,br))==null||r.setAttribute(`${ge(this,_r)}`,`${this.value}`))}remove(...e){var t;e.forEach(r=>ge(this,Ri).delete(r)),(t=ge(this,br))==null||t.setAttribute(`${ge(this,_r)}`,`${this.value}`)}contains(e){return ge(this,xt,Yt).has(e)}toggle(e,t){return typeof t<"u"?t?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,t){return this.remove(e),this.add(t),e===t}};br=new WeakMap;_r=new WeakMap;Ca=new WeakMap;Ri=new WeakMap;xt=new WeakSet;Yt=function(){return ge(this,Ri).size?ge(this,Ri):ge(this,Ca)};var Lv=(i="")=>i.split(/\s+/),Xu=(i="")=>{let[e,t,r]=i.split(":"),o=r?decodeURIComponent(r):void 0;return{kind:e==="cc"?Ce.CAPTIONS:Ce.SUBTITLES,language:t,label:o}},xi=(i="",e={})=>Lv(i).map(t=>{let r=Xu(t);return{...e,...r}}),Zl=i=>i?Array.isArray(i)?i.map(e=>typeof e=="string"?Xu(e):e):typeof i=="string"?xi(i):[i]:[],Ia=({kind:i,label:e,language:t}={kind:"subtitles"})=>e?`${i==="captions"?"cc":"sb"}:${t}:${encodeURIComponent(e)}`:t,Pt=(i=[])=>Array.prototype.map.call(i,Ia).join(" "),wv=(i,e)=>t=>t[i]===e,Ju=i=>{let e=Object.entries(i).map(([t,r])=>wv(t,r));return t=>e.every(r=>r(t))},Pi=(i,e=[],t=[])=>{let r=Zl(t).map(Ju),o=n=>r.some(a=>a(n));Array.from(e).filter(o).forEach(n=>{n.mode=i})},Di=(i,e=()=>!0)=>{if(!(i!=null&&i.textTracks))return[];let t=typeof e=="function"?e:Ju(e);return Array.from(i.textTracks).filter(t)},Ma=i=>{var e;return!!((e=i.mediaSubtitlesShowing)!=null&&e.length)||i.hasAttribute(s.MEDIA_SUBTITLES_SHOWING)};var eh=i=>{var e;let{media:t,fullscreenElement:r}=i;try{let o=r&&"requestFullscreen"in r?"requestFullscreen":r&&"webkitRequestFullScreen"in r?"webkitRequestFullScreen":void 0;if(o){let n=(e=r[o])==null?void 0:e.call(r);if(n instanceof Promise)return n.catch(()=>{})}else t!=null&&t.webkitEnterFullscreen?t.webkitEnterFullscreen():t!=null&&t.requestFullscreen&&t.requestFullscreen()}catch(o){console.error(o)}},ju="exitFullscreen"in j?"exitFullscreen":"webkitExitFullscreen"in j?"webkitExitFullscreen":"webkitCancelFullScreen"in j?"webkitCancelFullScreen":void 0,th=i=>{var e;let{documentElement:t}=i;if(ju){let r=(e=t==null?void 0:t[ju])==null?void 0:e.call(t);if(r instanceof Promise)return r.catch(()=>{})}},Zo="fullscreenElement"in j?"fullscreenElement":"webkitFullscreenElement"in j?"webkitFullscreenElement":void 0,Cv=i=>{let{documentElement:e,media:t}=i,r=e==null?void 0:e[Zo];return!r&&"webkitDisplayingFullscreen"in t&&"webkitPresentationMode"in t&&t.webkitDisplayingFullscreen&&t.webkitPresentationMode===Mu.FULLSCREEN?t:r},ih=i=>{var e;let{media:t,documentElement:r,fullscreenElement:o=t}=i;if(!t||!r)return!1;let n=Cv(i);if(!n)return!1;if(n===o||n===t)return!0;if(n.localName.includes("-")){let a=n.shadowRoot;if(!(Zo in a))return Te(n,o);for(;a!=null&&a[Zo];){if(a[Zo]===o)return!0;a=(e=a[Zo])==null?void 0:e.shadowRoot}}return!1},Iv="fullscreenEnabled"in j?"fullscreenEnabled":"webkitFullscreenEnabled"in j?"webkitFullscreenEnabled":void 0,rh=i=>{let{documentElement:e,media:t}=i;return!!(e!=null&&e[Iv])||t&&"webkitSupportsFullscreen"in t};var Ra,Xl=()=>{var i,e;return Ra||(Ra=(e=(i=j)==null?void 0:i.createElement)==null?void 0:e.call(i,"video"),Ra)},oh=async(i=Xl())=>{if(!i)return!1;let e=i.volume;i.volume=e/2+.1;let t=new AbortController,r=await Promise.race([Mv(i,t.signal),Rv(i,e)]);return t.abort(),r},Mv=(i,e)=>new Promise(t=>{i.addEventListener("volumechange",()=>t(!0),{signal:e})}),Rv=async(i,e)=>{for(let t=0;t<10;t++){if(i.volume===e)return!1;await ha(10)}return i.volume!==e},xv=/.*Version\/.*Safari\/.*/.test(d.navigator.userAgent),Jl=(i=Xl())=>d.matchMedia("(display-mode: standalone)").matches&&xv?!1:typeof(i==null?void 0:i.requestPictureInPicture)=="function",jl=(i=Xl())=>rh({documentElement:j,media:i}),nh=jl(),ah=Jl(),sh=!!d.WebKitPlaybackTargetAvailabilityEvent,lh=!!d.chrome;var yr=i=>Di(i.media,e=>[Ce.SUBTITLES,Ce.CAPTIONS].includes(e.kind)).sort((e,t)=>e.kind>=t.kind?1:-1),ed=i=>Di(i.media,e=>e.mode===Gt.SHOWING&&[Ce.SUBTITLES,Ce.CAPTIONS].includes(e.kind)),xa=(i,e)=>{let t=yr(i),r=ed(i),o=!!r.length;if(t.length){if(e===!1||o&&e!==!0)Pi(Gt.DISABLED,t,r);else if(e===!0||!o&&e!==!1){let n=t[0],{options:a}=i;if(!(a!=null&&a.noSubtitlesLangPref)){let h=globalThis.localStorage.getItem("media-chrome-pref-subtitles-lang"),p=h?[h,...globalThis.navigator.languages]:globalThis.navigator.languages,f=t.filter(m=>p.some(A=>m.language.toLowerCase().startsWith(A.split("-")[0]))).sort((m,A)=>{let g=p.findIndex(D=>m.language.toLowerCase().startsWith(D.split("-")[0])),L=p.findIndex(D=>A.language.toLowerCase().startsWith(D.split("-")[0]));return g-L});f[0]&&(n=f[0])}let{language:l,label:c,kind:v}=n;Pi(Gt.DISABLED,t,r),Pi(Gt.SHOWING,t,[{language:l,label:c,kind:v}])}}},Pa=(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)?Pv(i,e):Object.entries(i).every(([t,r])=>t in e&&Pa(r,e[t])),Pv=(i,e)=>{let t=Array.isArray(i),r=Array.isArray(e);return t!==r?!1:t||r?i.length!==e.length?!1:i.every((o,n)=>Pa(o,e[n])):!0};var Dv=Object.values(Qe),Da,Ov=oh().then(i=>(Da=i,Da)),dh=async(...i)=>{await Promise.all(i.filter(e=>e).map(async e=>{if(!("localName"in e&&e instanceof d.HTMLElement))return;let t=e.localName;if(!t.includes("-"))return;let r=d.customElements.get(t);r&&e instanceof r||(await d.customElements.whenDefined(t),d.customElements.upgrade(e))}))},Uv=new d.DOMParser,Nv=i=>i&&(Uv.parseFromString(i,"text/html").body.textContent||i),Tr={mediaError:{get(i,e){let{media:t}=i;if((e==null?void 0:e.type)!=="playing")return t==null?void 0:t.error},mediaEvents:["emptied","error","playing"]},mediaErrorCode:{get(i,e){var t;let{media:r}=i;if((e==null?void 0:e.type)!=="playing")return(t=r==null?void 0:r.error)==null?void 0:t.code},mediaEvents:["emptied","error","playing"]},mediaErrorMessage:{get(i,e){var t,r;let{media:o}=i;if((e==null?void 0:e.type)!=="playing")return(r=(t=o==null?void 0:o.error)==null?void 0:t.message)!=null?r:""},mediaEvents:["emptied","error","playing"]},mediaWidth:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.videoWidth)!=null?e:0},mediaEvents:["resize"]},mediaHeight:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.videoHeight)!=null?e:0},mediaEvents:["resize"]},mediaPaused:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.paused)!=null?e:!0},set(i,e){var t;let{media:r}=e;r&&(i?r.pause():(t=r.play())==null||t.catch(()=>{}))},mediaEvents:["play","playing","pause","emptied"]},mediaHasPlayed:{get(i,e){let{media:t}=i;return t?e?e.type==="playing":!t.paused:!1},mediaEvents:["playing","emptied"]},mediaEnded:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.ended)!=null?e:!1},mediaEvents:["seeked","ended","emptied"]},mediaPlaybackRate:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.playbackRate)!=null?e:1},set(i,e){let{media:t}=e;t&&Number.isFinite(+i)&&(t.playbackRate=+i)},mediaEvents:["ratechange","loadstart"]},mediaMuted:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.muted)!=null?e:!1},set(i,e){let{media:t,options:{noMutedPref:r}={}}=e;if(t){t.muted=i;try{let o=d.localStorage.getItem("media-chrome-pref-muted")!==null,n=t.hasAttribute("muted");if(r){o&&d.localStorage.removeItem("media-chrome-pref-muted");return}if(n&&!o)return;d.localStorage.setItem("media-chrome-pref-muted",i?"true":"false")}catch(o){console.debug("Error setting muted pref",o)}}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(i,e)=>{let{options:{noMutedPref:t}}=e,{media:r}=e;if(!(!r||r.muted||t))try{let o=d.localStorage.getItem("media-chrome-pref-muted")==="true";Tr.mediaMuted.set(o,e),i(o)}catch(o){console.debug("Error getting muted pref",o)}}]},mediaLoop:{get(i){let{media:e}=i;return e==null?void 0:e.loop},set(i,e){let{media:t}=e;t&&(t.loop=i)},mediaEvents:["medialooprequest"]},mediaVolume:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.volume)!=null?e:1},set(i,e){let{media:t,options:{noVolumePref:r}={}}=e;if(t){try{i==null?d.localStorage.removeItem("media-chrome-pref-volume"):!t.hasAttribute("muted")&&!r&&d.localStorage.setItem("media-chrome-pref-volume",i.toString())}catch(o){console.debug("Error setting volume pref",o)}Number.isFinite(+i)&&(t.volume=+i)}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(i,e)=>{let{options:{noVolumePref:t}}=e;if(!t)try{let{media:r}=e;if(!r)return;let o=d.localStorage.getItem("media-chrome-pref-volume");if(o==null)return;Tr.mediaVolume.set(+o,e),i(+o)}catch(r){console.debug("Error getting volume pref",r)}}]},mediaVolumeLevel:{get(i){let{media:e}=i;return typeof(e==null?void 0:e.volume)>"u"?"high":e.muted||e.volume===0?"off":e.volume<.5?"low":e.volume<.75?"medium":"high"},mediaEvents:["volumechange"]},mediaCurrentTime:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.currentTime)!=null?e:0},set(i,e){let{media:t}=e;!t||!mr(i)||(t.currentTime=i)},mediaEvents:["timeupdate","loadedmetadata"]},mediaDuration:{get(i){let{media:e,options:{defaultDuration:t}={}}=i;return t&&(!e||!e.duration||Number.isNaN(e.duration)||!Number.isFinite(e.duration))?t:Number.isFinite(e==null?void 0:e.duration)?e.duration:Number.NaN},mediaEvents:["durationchange","loadedmetadata","emptied"]},mediaLoading:{get(i){let{media:e}=i;return(e==null?void 0:e.readyState)<3},mediaEvents:["waiting","playing","emptied"]},mediaSeekable:{get(i){var e;let{media:t}=i;if(!((e=t==null?void 0:t.seekable)!=null&&e.length))return;let r=t.seekable.start(0),o=t.seekable.end(t.seekable.length-1);if(!(!r&&!o))return[Number(r.toFixed(3)),Number(o.toFixed(3))]},mediaEvents:["loadedmetadata","emptied","progress","seekablechange"]},mediaBuffered:{get(i){var e;let{media:t}=i,r=(e=t==null?void 0:t.buffered)!=null?e:[];return Array.from(r).map((o,n)=>[Number(r.start(n).toFixed(3)),Number(r.end(n).toFixed(3))])},mediaEvents:["progress","emptied"]},mediaStreamType:{get(i){let{media:e,options:{defaultStreamType:t}={}}=i,r=[Qe.LIVE,Qe.ON_DEMAND].includes(t)?t:void 0;if(!e)return r;let{streamType:o}=e;if(Dv.includes(o))return o===Qe.UNKNOWN?r:o;let n=e.duration;return n===1/0?Qe.LIVE:Number.isFinite(n)?Qe.ON_DEMAND:r},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange"]},mediaTargetLiveWindow:{get(i){let{media:e}=i;if(!e)return Number.NaN;let{targetLiveWindow:t}=e,r=Tr.mediaStreamType.get(i);return(t==null||Number.isNaN(t))&&r===Qe.LIVE?0:t},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange","targetlivewindowchange"]},mediaTimeIsLive:{get(i){let{media:e,options:{liveEdgeOffset:t=10}={}}=i;if(!e)return!1;if(typeof e.liveEdgeStart=="number")return Number.isNaN(e.liveEdgeStart)?!1:e.currentTime>=e.liveEdgeStart;if(!(Tr.mediaStreamType.get(i)===Qe.LIVE))return!1;let o=e.seekable;if(!o)return!0;if(!o.length)return!1;let n=o.end(o.length-1)-t;return e.currentTime>=n},mediaEvents:["playing","timeupdate","progress","waiting","emptied"]},mediaSubtitlesList:{get(i){return yr(i).map(({kind:e,label:t,language:r})=>({kind:e,label:t,language:r}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},mediaSubtitlesShowing:{get(i){return ed(i).map(({kind:e,label:t,language:r})=>({kind:e,label:t,language:r}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(i,e)=>{var t,r;let{media:o,options:n}=e;if(!o)return;let a=l=>{var c;!n.defaultSubtitles||l&&![Ce.CAPTIONS,Ce.SUBTITLES].includes((c=l==null?void 0:l.track)==null?void 0:c.kind)||xa(e,!0)};return o.addEventListener("loadstart",a),(t=o.textTracks)==null||t.addEventListener("addtrack",a),(r=o.textTracks)==null||r.addEventListener("removetrack",a),()=>{var l,c;o.removeEventListener("loadstart",a),(l=o.textTracks)==null||l.removeEventListener("addtrack",a),(c=o.textTracks)==null||c.removeEventListener("removetrack",a)}}]},mediaChaptersCues:{get(i){var e;let{media:t}=i;if(!t)return[];let[r]=Di(t,{kind:Ce.CHAPTERS});return Array.from((e=r==null?void 0:r.cues)!=null?e:[]).map(({text:o,startTime:n,endTime:a})=>({text:Nv(o),startTime:n,endTime:a}))},mediaEvents:["loadstart","loadedmetadata"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:r}=e;if(!r)return;let o=r.querySelector('track[kind="chapters"][default][src]'),n=(t=r.shadowRoot)==null?void 0:t.querySelector(':is(video,audio) > track[kind="chapters"][default][src]');return o==null||o.addEventListener("load",i),n==null||n.addEventListener("load",i),()=>{o==null||o.removeEventListener("load",i),n==null||n.removeEventListener("load",i)}}]},mediaIsPip:{get(i){var e,t;let{media:r,documentElement:o}=i;if(!r||!o||!o.pictureInPictureElement)return!1;if(o.pictureInPictureElement===r)return!0;if(o.pictureInPictureElement instanceof HTMLMediaElement)return(e=r.localName)!=null&&e.includes("-")?Te(r,o.pictureInPictureElement):!1;if(o.pictureInPictureElement.localName.includes("-")){let n=o.pictureInPictureElement.shadowRoot;for(;n!=null&&n.pictureInPictureElement;){if(n.pictureInPictureElement===r)return!0;n=(t=n.pictureInPictureElement)==null?void 0:t.shadowRoot}}return!1},set(i,e){let{media:t}=e;if(t)if(i){if(!j.pictureInPictureEnabled){console.warn("MediaChrome: Picture-in-picture is not enabled");return}if(!t.requestPictureInPicture){console.warn("MediaChrome: The current media does not support picture-in-picture");return}let r=()=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};t.requestPictureInPicture().catch(o=>{if(o.code===11){if(!t.src){console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a src set.");return}if(t.readyState===0&&t.preload==="none"){let n=()=>{t.removeEventListener("loadedmetadata",a),t.preload="none"},a=()=>{t.requestPictureInPicture().catch(r),n()};t.addEventListener("loadedmetadata",a),t.preload="metadata",setTimeout(()=>{t.readyState===0&&r(),n()},1e3)}else throw o}else throw o})}else j.pictureInPictureElement&&j.exitPictureInPicture()},mediaEvents:["enterpictureinpicture","leavepictureinpicture"]},mediaRenditionList:{get(i){var e;let{media:t}=i;return[...(e=t==null?void 0:t.videoRenditions)!=null?e:[]].map(r=>({...r}))},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaRenditionSelected:{get(i){var e,t,r;let{media:o}=i;return(r=(t=o==null?void 0:o.videoRenditions)==null?void 0:t[(e=o.videoRenditions)==null?void 0:e.selectedIndex])==null?void 0:r.id},set(i,e){let{media:t}=e;if(!(t!=null&&t.videoRenditions)){console.warn("MediaController: Rendition selection not supported by this media.");return}let r=i,o=Array.prototype.findIndex.call(t.videoRenditions,n=>n.id==r);t.videoRenditions.selectedIndex!=o&&(t.videoRenditions.selectedIndex=o)},mediaEvents:["emptied"],videoRenditionsEvents:["addrendition","removerendition","change"]},mediaAudioTrackList:{get(i){var e;let{media:t}=i;return[...(e=t==null?void 0:t.audioTracks)!=null?e:[]]},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaAudioTrackEnabled:{get(i){var e,t;let{media:r}=i;return(t=[...(e=r==null?void 0:r.audioTracks)!=null?e:[]].find(o=>o.enabled))==null?void 0:t.id},set(i,e){let{media:t}=e;if(!(t!=null&&t.audioTracks)){console.warn("MediaChrome: Audio track selection not supported by this media.");return}let r=i;for(let o of t.audioTracks)o.enabled=r==o.id},mediaEvents:["emptied"],audioTracksEvents:["addtrack","removetrack","change"]},mediaIsFullscreen:{get(i){return ih(i)},set(i,e,t){var r;i?(eh(e),t.detail&&((r=e.media)==null||r.focus())):th(e)},rootEvents:["fullscreenchange","webkitfullscreenchange"],mediaEvents:["webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"]},mediaIsCasting:{get(i){var e;let{media:t}=i;return!(t!=null&&t.remote)||((e=t.remote)==null?void 0:e.state)==="disconnected"?!1:!!t.remote.state},set(i,e){var t,r;let{media:o}=e;if(o&&!(i&&((t=o.remote)==null?void 0:t.state)!=="disconnected")&&!(!i&&((r=o.remote)==null?void 0:r.state)!=="connected")){if(typeof o.remote.prompt!="function"){console.warn("MediaChrome: Casting is not supported in this environment");return}o.remote.prompt().catch(()=>{})}},remoteEvents:["connect","connecting","disconnect"]},mediaIsAirplaying:{get(){return!1},set(i,e){let{media:t}=e;if(t){if(!(t.webkitShowPlaybackTargetPicker&&d.WebKitPlaybackTargetAvailabilityEvent)){console.error("MediaChrome: received a request to select AirPlay but AirPlay is not supported in this environment");return}t.webkitShowPlaybackTargetPicker()}},mediaEvents:["webkitcurrentplaybacktargetiswirelesschanged"]},mediaFullscreenUnavailable:{get(i){let{media:e}=i;if(!nh||!jl(e))return Ie.UNSUPPORTED}},mediaPipUnavailable:{get(i){let{media:e}=i;if(!ah||!Jl(e))return Ie.UNSUPPORTED;if(e!=null&&e.disablePictureInPicture)return Ie.UNAVAILABLE}},mediaVolumeUnavailable:{get(i){let{media:e}=i;if(Da===!1||(e==null?void 0:e.volume)==null)return Ie.UNSUPPORTED},stateOwnersUpdateHandlers:[i=>{Da==null&&Ov.then(e=>i(e?void 0:Ie.UNSUPPORTED))}]},mediaCastUnavailable:{get(i,{availability:e="not-available"}={}){var t;let{media:r}=i;if(!lh||!((t=r==null?void 0:r.remote)!=null&&t.state))return Ie.UNSUPPORTED;if(!(e==null||e==="available"))return Ie.UNAVAILABLE},stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:r}=e;return r?(r.disableRemotePlayback||r.hasAttribute("disableremoteplayback")||(t=r==null?void 0:r.remote)==null||t.watchAvailability(n=>{i({availability:n?"available":"not-available"})}).catch(n=>{n.name==="NotSupportedError"?i({availability:null}):i({availability:"not-available"})}),()=>{var n;(n=r==null?void 0:r.remote)==null||n.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaAirplayUnavailable:{get(i,e){if(!sh)return Ie.UNSUPPORTED;if((e==null?void 0:e.availability)==="not-available")return Ie.UNAVAILABLE},mediaEvents:["webkitplaybacktargetavailabilitychanged"],stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:r}=e;return r?(r.disableRemotePlayback||r.hasAttribute("disableremoteplayback")||(t=r==null?void 0:r.remote)==null||t.watchAvailability(n=>{i({availability:n?"available":"not-available"})}).catch(n=>{n.name==="NotSupportedError"?i({availability:null}):i({availability:"not-available"})}),()=>{var n;(n=r==null?void 0:r.remote)==null||n.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaRenditionUnavailable:{get(i){var e;let{media:t}=i;if(!(t!=null&&t.videoRenditions))return Ie.UNSUPPORTED;if(!((e=t.videoRenditions)!=null&&e.length))return Ie.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaAudioTrackUnavailable:{get(i){var e,t;let{media:r}=i;if(!(r!=null&&r.audioTracks))return Ie.UNSUPPORTED;if(((t=(e=r.audioTracks)==null?void 0:e.length)!=null?t:0)<=1)return Ie.UNAVAILABLE},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaLang:{get(i){let{options:{mediaLang:e}={}}=i;return e??"en"}}};var ch={[b.MEDIA_PREVIEW_REQUEST](i,e,{detail:t}){var r,o,n;let{media:a}=e,l=t??void 0,c,v;if(a&&l!=null){let[m]=Di(a,{kind:Ce.METADATA,label:"thumbnails"}),A=Array.prototype.find.call((r=m==null?void 0:m.cues)!=null?r:[],(g,L,D)=>L===0?g.endTime>l:L===D.length-1?g.startTime<=l:g.startTime<=l&&g.endTime>l);if(A){let g=/'^(?:[a-z]+:)?\/\//i.test(A.text)||(o=a==null?void 0:a.querySelector('track[label="thumbnails"]'))==null?void 0:o.src,L=new URL(A.text,g);v=new URLSearchParams(L.hash).get("#xywh").split(",").map(De=>+De),c=L.href}}let h=i.mediaDuration.get(e),f=(n=i.mediaChaptersCues.get(e).find((m,A,g)=>A===g.length-1&&h===m.endTime?m.startTime<=l&&m.endTime>=l:m.startTime<=l&&m.endTime>l))==null?void 0:n.text;return t!=null&&f==null&&(f=""),{mediaPreviewTime:l,mediaPreviewImage:c,mediaPreviewCoords:v,mediaPreviewChapter:f}},[b.MEDIA_PAUSE_REQUEST](i,e){i["mediaPaused"].set(!0,e)},[b.MEDIA_PLAY_REQUEST](i,e){var t,r,o,n;let a="mediaPaused",c=i.mediaStreamType.get(e)===Qe.LIVE,v=!((t=e.options)!=null&&t.noAutoSeekToLive),h=i.mediaTargetLiveWindow.get(e)>0;if(c&&v&&!h){let p=(r=i.mediaSeekable.get(e))==null?void 0:r[1];if(p){let f=(n=(o=e.options)==null?void 0:o.seekToLiveOffset)!=null?n:0,m=p-f;i.mediaCurrentTime.set(m,e)}}i[a].set(!1,e)},[b.MEDIA_PLAYBACK_RATE_REQUEST](i,e,{detail:t}){let r="mediaPlaybackRate",o=t;i[r].set(o,e)},[b.MEDIA_MUTE_REQUEST](i,e){i["mediaMuted"].set(!0,e)},[b.MEDIA_UNMUTE_REQUEST](i,e){let t="mediaMuted";i.mediaVolume.get(e)||i.mediaVolume.set(.25,e),i[t].set(!1,e)},[b.MEDIA_LOOP_REQUEST](i,e,{detail:t}){let r="mediaLoop",o=!!t;return i[r].set(o,e),{mediaLoop:o}},[b.MEDIA_VOLUME_REQUEST](i,e,{detail:t}){let r="mediaVolume",o=t;o&&i.mediaMuted.get(e)&&i.mediaMuted.set(!1,e),i[r].set(o,e)},[b.MEDIA_SEEK_REQUEST](i,e,{detail:t}){let r="mediaCurrentTime",o=t;i[r].set(o,e)},[b.MEDIA_SEEK_TO_LIVE_REQUEST](i,e){var t,r,o;let n="mediaCurrentTime",a=(t=i.mediaSeekable.get(e))==null?void 0:t[1];if(Number.isNaN(Number(a)))return;let l=(o=(r=e.options)==null?void 0:r.seekToLiveOffset)!=null?o:0,c=a-l;i[n].set(c,e)},[b.MEDIA_SHOW_SUBTITLES_REQUEST](i,e,{detail:t}){var r;let{options:o}=e,n=yr(e),a=Zl(t),l=(r=a[0])==null?void 0:r.language;l&&!o.noSubtitlesLangPref&&d.localStorage.setItem("media-chrome-pref-subtitles-lang",l),Pi(Gt.SHOWING,n,a)},[b.MEDIA_DISABLE_SUBTITLES_REQUEST](i,e,{detail:t}){let r=yr(e),o=t??[];Pi(Gt.DISABLED,r,o)},[b.MEDIA_TOGGLE_SUBTITLES_REQUEST](i,e,{detail:t}){xa(e,t)},[b.MEDIA_RENDITION_REQUEST](i,e,{detail:t}){let r="mediaRenditionSelected",o=t;i[r].set(o,e)},[b.MEDIA_AUDIO_TRACK_REQUEST](i,e,{detail:t}){let r="mediaAudioTrackEnabled",o=t;i[r].set(o,e)},[b.MEDIA_ENTER_PIP_REQUEST](i,e){let t="mediaIsPip";i.mediaIsFullscreen.get(e)&&i.mediaIsFullscreen.set(!1,e),i[t].set(!0,e)},[b.MEDIA_EXIT_PIP_REQUEST](i,e){i["mediaIsPip"].set(!1,e)},[b.MEDIA_ENTER_FULLSCREEN_REQUEST](i,e,t){let r="mediaIsFullscreen";i.mediaIsPip.get(e)&&i.mediaIsPip.set(!1,e),i[r].set(!0,e,t)},[b.MEDIA_EXIT_FULLSCREEN_REQUEST](i,e){i["mediaIsFullscreen"].set(!1,e)},[b.MEDIA_ENTER_CAST_REQUEST](i,e){let t="mediaIsCasting";i.mediaIsFullscreen.get(e)&&i.mediaIsFullscreen.set(!1,e),i[t].set(!0,e)},[b.MEDIA_EXIT_CAST_REQUEST](i,e){i["mediaIsCasting"].set(!1,e)},[b.MEDIA_AIRPLAY_REQUEST](i,e){i["mediaIsAirplaying"].set(!0,e)}};var uh=({media:i,fullscreenElement:e,documentElement:t,stateMediator:r=Tr,requestMap:o=ch,options:n={},monitorStateOwnersOnlyWithSubscriptions:a=!0})=>{let l=[],c={options:{...n}},v=Object.freeze({mediaPreviewTime:void 0,mediaPreviewImage:void 0,mediaPreviewCoords:void 0,mediaPreviewChapter:void 0}),h=g=>{g!=null&&(Pa(g,v)||(v=Object.freeze({...v,...g}),l.forEach(L=>L(v))))},p=()=>{let g=Object.entries(r).reduce((L,[D,{get:De}])=>(L[D]=De(c),L),{});h(g)},f={},m,A=async(g,L)=>{var D,De,rt,wo,ar,Nc,_l,k,K,ne,ee,G,he,wt,Co,Hc;let Sm=!!m;if(m={...c,...m??{},...g},Sm)return;await dh(...Object.values(g));let sr=l.length>0&&L===0&&a,$c=c.media!==m.media,Bc=((D=c.media)==null?void 0:D.textTracks)!==((De=m.media)==null?void 0:De.textTracks),Vc=((rt=c.media)==null?void 0:rt.videoRenditions)!==((wo=m.media)==null?void 0:wo.videoRenditions),Wc=((ar=c.media)==null?void 0:ar.audioTracks)!==((Nc=m.media)==null?void 0:Nc.audioTracks),Fc=((_l=c.media)==null?void 0:_l.remote)!==((k=m.media)==null?void 0:k.remote),Kc=c.documentElement!==m.documentElement,qc=!!c.media&&($c||sr),Gc=!!((K=c.media)!=null&&K.textTracks)&&(Bc||sr),zc=!!((ne=c.media)!=null&&ne.videoRenditions)&&(Vc||sr),Yc=!!((ee=c.media)!=null&&ee.audioTracks)&&(Wc||sr),Qc=!!((G=c.media)!=null&&G.remote)&&(Fc||sr),Zc=!!c.documentElement&&(Kc||sr),yl=qc||Gc||zc||Yc||Qc||Zc,lr=l.length===0&&L===1&&a,w=!!m.media&&($c||lr),Xc=!!((he=m.media)!=null&&he.textTracks)&&(Bc||lr),Jc=!!((wt=m.media)!=null&&wt.videoRenditions)&&(Vc||lr),jc=!!((Co=m.media)!=null&&Co.audioTracks)&&(Wc||lr),eu=!!((Hc=m.media)!=null&&Hc.remote)&&(Fc||lr),tu=!!m.documentElement&&(Kc||lr),iu=w||Xc||Jc||jc||eu||tu;if(!(yl||iu)){Object.entries(m).forEach(([z,Io])=>{c[z]=Io}),p(),m=void 0;return}Object.entries(r).forEach(([z,{get:Io,mediaEvents:km=[],textTracksEvents:Lm=[],videoRenditionsEvents:wm=[],audioTracksEvents:Cm=[],remoteEvents:Im=[],rootEvents:Mm=[],stateOwnersUpdateHandlers:Rm=[]}])=>{f[z]||(f[z]={});let Oe=te=>{let ce=Io(c,te);h({[z]:ce})},me;me=f[z].mediaEvents,km.forEach(te=>{me&&qc&&(c.media.removeEventListener(te,me),f[z].mediaEvents=void 0),w&&(m.media.addEventListener(te,Oe),f[z].mediaEvents=Oe)}),me=f[z].textTracksEvents,Lm.forEach(te=>{var ce,Ye;me&&Gc&&((ce=c.media.textTracks)==null||ce.removeEventListener(te,me),f[z].textTracksEvents=void 0),Xc&&((Ye=m.media.textTracks)==null||Ye.addEventListener(te,Oe),f[z].textTracksEvents=Oe)}),me=f[z].videoRenditionsEvents,wm.forEach(te=>{var ce,Ye;me&&zc&&((ce=c.media.videoRenditions)==null||ce.removeEventListener(te,me),f[z].videoRenditionsEvents=void 0),Jc&&((Ye=m.media.videoRenditions)==null||Ye.addEventListener(te,Oe),f[z].videoRenditionsEvents=Oe)}),me=f[z].audioTracksEvents,Cm.forEach(te=>{var ce,Ye;me&&Yc&&((ce=c.media.audioTracks)==null||ce.removeEventListener(te,me),f[z].audioTracksEvents=void 0),jc&&((Ye=m.media.audioTracks)==null||Ye.addEventListener(te,Oe),f[z].audioTracksEvents=Oe)}),me=f[z].remoteEvents,Im.forEach(te=>{var ce,Ye;me&&Qc&&((ce=c.media.remote)==null||ce.removeEventListener(te,me),f[z].remoteEvents=void 0),eu&&((Ye=m.media.remote)==null||Ye.addEventListener(te,Oe),f[z].remoteEvents=Oe)}),me=f[z].rootEvents,Mm.forEach(te=>{me&&Zc&&(c.documentElement.removeEventListener(te,me),f[z].rootEvents=void 0),tu&&(m.documentElement.addEventListener(te,Oe),f[z].rootEvents=Oe)});let Jn=f[z].stateOwnersUpdateHandlers;if(Jn&&yl&&(Array.isArray(Jn)?Jn:[Jn]).forEach(ce=>{typeof ce=="function"&&ce()}),iu){let te=Rm.map(ce=>ce(Oe,m)).filter(ce=>typeof ce=="function");f[z].stateOwnersUpdateHandlers=te.length===1?te[0]:te}else yl&&(f[z].stateOwnersUpdateHandlers=void 0)}),Object.entries(m).forEach(([z,Io])=>{c[z]=Io}),p(),m=void 0};return A({media:i,fullscreenElement:e,documentElement:t,options:n}),{dispatch(g){let{type:L,detail:D}=g;if(o[L]&&v.mediaErrorCode==null){h(o[L](r,c,g));return}L==="mediaelementchangerequest"?A({media:D}):L==="fullscreenelementchangerequest"?A({fullscreenElement:D}):L==="documentelementchangerequest"?A({documentElement:D}):L==="optionschangerequest"&&(Object.entries(D??{}).forEach(([De,rt])=>{c.options[De]=rt}),p())},getState(){return v},subscribe(g){return A({},l.length+1),l.push(g),g(v),()=>{let L=l.indexOf(g);L>=0&&(A({},l.length-1),l.splice(L,1))}}}};var ad=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},M=(i,e,t)=>(ad(i,e,"read from private field"),t?t.call(i):e.get(i)),Fe=(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)},nt=(i,e,t,r)=>(ad(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),st=(i,e,t)=>(ad(i,e,"access private method"),t),Zt,Xo,V,Ui,Jo,at,Oa,jo,Ua,td,Ni,Ar,Na,id,rd,Eh,bh=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter"," ","f","m","k","c","l","j",">","<","p"],hh=10,ph=.025,mh=.25,Hv=.25,$v=2,y={DEFAULT_SUBTITLES:"defaultsubtitles",DEFAULT_STREAM_TYPE:"defaultstreamtype",DEFAULT_DURATION:"defaultduration",FULLSCREEN_ELEMENT:"fullscreenelement",HOTKEYS:"hotkeys",KEYBOARD_BACKWARD_SEEK_OFFSET:"keyboardbackwardseekoffset",KEYBOARD_FORWARD_SEEK_OFFSET:"keyboardforwardseekoffset",KEYBOARD_DOWN_VOLUME_STEP:"keyboarddownvolumestep",KEYBOARD_UP_VOLUME_STEP:"keyboardupvolumestep",KEYS_USED:"keysused",LANG:"lang",LOOP:"loop",LIVE_EDGE_OFFSET:"liveedgeoffset",NO_AUTO_SEEK_TO_LIVE:"noautoseektolive",NO_DEFAULT_STORE:"nodefaultstore",NO_HOTKEYS:"nohotkeys",NO_MUTED_PREF:"nomutedpref",NO_SUBTITLES_LANG_PREF:"nosubtitleslangpref",NO_VOLUME_PREF:"novolumepref",SEEK_TO_LIVE_OFFSET:"seektoliveoffset"},od=class extends Mi{constructor(){super(),Fe(this,Ua),Fe(this,Ni),Fe(this,Na),Fe(this,rd),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,Fe(this,Zt,new Qt(this,y.HOTKEYS)),Fe(this,Xo,void 0),Fe(this,V,void 0),Fe(this,Ui,null),Fe(this,Jo,void 0),Fe(this,at,void 0),Fe(this,Oa,t=>{var r;(r=M(this,V))==null||r.dispatch(t)}),Fe(this,jo,void 0),this.associateElement(this);let e={};nt(this,Jo,t=>{Object.entries(t).forEach(([r,o])=>{if(r in e&&e[r]===o)return;this.propagateMediaState(r,o);let n=r.toLowerCase(),a=new d.CustomEvent(Iu[n],{composed:!0,detail:o});this.dispatchEvent(a)}),e=t}),this.hasAttribute(y.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat(y.NO_HOTKEYS,y.HOTKEYS,y.DEFAULT_STREAM_TYPE,y.DEFAULT_SUBTITLES,y.DEFAULT_DURATION,y.NO_MUTED_PREF,y.NO_VOLUME_PREF,y.LANG,y.LOOP)}get mediaStore(){return M(this,V)}set mediaStore(e){var t,r;if(M(this,V)&&((t=M(this,at))==null||t.call(this),nt(this,at,void 0)),nt(this,V,e),!M(this,V)&&!this.hasAttribute(y.NO_DEFAULT_STORE)){st(this,Ua,td).call(this);return}nt(this,at,(r=M(this,V))==null?void 0:r.subscribe(M(this,Jo)))}get fullscreenElement(){var e;return(e=M(this,Xo))!=null?e:this}set fullscreenElement(e){var t;this.hasAttribute(y.FULLSCREEN_ELEMENT)&&this.removeAttribute(y.FULLSCREEN_ELEMENT),nt(this,Xo,e),(t=M(this,V))==null||t.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}get defaultSubtitles(){return C(this,y.DEFAULT_SUBTITLES)}set defaultSubtitles(e){I(this,y.DEFAULT_SUBTITLES,e)}get defaultStreamType(){return x(this,y.DEFAULT_STREAM_TYPE)}set defaultStreamType(e){P(this,y.DEFAULT_STREAM_TYPE,e)}get defaultDuration(){return H(this,y.DEFAULT_DURATION)}set defaultDuration(e){B(this,y.DEFAULT_DURATION,e)}get noHotkeys(){return C(this,y.NO_HOTKEYS)}set noHotkeys(e){I(this,y.NO_HOTKEYS,e)}get keysUsed(){return x(this,y.KEYS_USED)}set keysUsed(e){P(this,y.KEYS_USED,e)}get liveEdgeOffset(){return H(this,y.LIVE_EDGE_OFFSET)}set liveEdgeOffset(e){B(this,y.LIVE_EDGE_OFFSET,e)}get noAutoSeekToLive(){return C(this,y.NO_AUTO_SEEK_TO_LIVE)}set noAutoSeekToLive(e){I(this,y.NO_AUTO_SEEK_TO_LIVE,e)}get noVolumePref(){return C(this,y.NO_VOLUME_PREF)}set noVolumePref(e){I(this,y.NO_VOLUME_PREF,e)}get noMutedPref(){return C(this,y.NO_MUTED_PREF)}set noMutedPref(e){I(this,y.NO_MUTED_PREF,e)}get noSubtitlesLangPref(){return C(this,y.NO_SUBTITLES_LANG_PREF)}set noSubtitlesLangPref(e){I(this,y.NO_SUBTITLES_LANG_PREF,e)}get noDefaultStore(){return C(this,y.NO_DEFAULT_STORE)}set noDefaultStore(e){I(this,y.NO_DEFAULT_STORE,e)}attributeChangedCallback(e,t,r){var o,n,a,l,c,v,h,p,f,m,A,g;if(super.attributeChangedCallback(e,t,r),e===y.NO_HOTKEYS)r!==t&&r===""?(this.hasAttribute(y.HOTKEYS)&&console.warn("Media Chrome: Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):r!==t&&r===null&&this.enableHotkeys();else if(e===y.HOTKEYS)M(this,Zt).value=r;else if(e===y.DEFAULT_SUBTITLES&&r!==t)(o=M(this,V))==null||o.dispatch({type:"optionschangerequest",detail:{defaultSubtitles:this.hasAttribute(y.DEFAULT_SUBTITLES)}});else if(e===y.DEFAULT_STREAM_TYPE)(a=M(this,V))==null||a.dispatch({type:"optionschangerequest",detail:{defaultStreamType:(n=this.getAttribute(y.DEFAULT_STREAM_TYPE))!=null?n:void 0}});else if(e===y.LIVE_EDGE_OFFSET)(l=M(this,V))==null||l.dispatch({type:"optionschangerequest",detail:{liveEdgeOffset:this.hasAttribute(y.LIVE_EDGE_OFFSET)?+this.getAttribute(y.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(y.SEEK_TO_LIVE_OFFSET)?void 0:+this.getAttribute(y.LIVE_EDGE_OFFSET)}});else if(e===y.SEEK_TO_LIVE_OFFSET)(c=M(this,V))==null||c.dispatch({type:"optionschangerequest",detail:{seekToLiveOffset:this.hasAttribute(y.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(y.SEEK_TO_LIVE_OFFSET):void 0}});else if(e===y.NO_AUTO_SEEK_TO_LIVE)(v=M(this,V))==null||v.dispatch({type:"optionschangerequest",detail:{noAutoSeekToLive:this.hasAttribute(y.NO_AUTO_SEEK_TO_LIVE)}});else if(e===y.FULLSCREEN_ELEMENT){let L=r?(h=this.getRootNode())==null?void 0:h.getElementById(r):void 0;nt(this,Xo,L),(p=M(this,V))==null||p.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}else e===y.LANG&&r!==t?(Hu(r),(f=M(this,V))==null||f.dispatch({type:"optionschangerequest",detail:{mediaLang:r}})):e===y.LOOP&&r!==t?(m=M(this,V))==null||m.dispatch({type:b.MEDIA_LOOP_REQUEST,detail:r!=null}):e===y.NO_VOLUME_PREF&&r!==t?(A=M(this,V))==null||A.dispatch({type:"optionschangerequest",detail:{noVolumePref:this.hasAttribute(y.NO_VOLUME_PREF)}}):e===y.NO_MUTED_PREF&&r!==t&&((g=M(this,V))==null||g.dispatch({type:"optionschangerequest",detail:{noMutedPref:this.hasAttribute(y.NO_MUTED_PREF)}}))}connectedCallback(){var e,t;!M(this,V)&&!this.hasAttribute(y.NO_DEFAULT_STORE)&&st(this,Ua,td).call(this),(e=M(this,V))==null||e.dispatch({type:"documentelementchangerequest",detail:j}),super.connectedCallback(),M(this,V)&&!M(this,at)&&nt(this,at,(t=M(this,V))==null?void 0:t.subscribe(M(this,Jo))),M(this,jo)!==void 0&&M(this,V)&&this.media&&setTimeout(()=>{var r,o,n;(o=(r=this.media)==null?void 0:r.textTracks)!=null&&o.length&&((n=M(this,V))==null||n.dispatch({type:b.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:M(this,jo)}))},0),this.hasAttribute(y.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}disconnectedCallback(){var e,t,r,o,n;if((e=super.disconnectedCallback)==null||e.call(this),M(this,V)){let a=M(this,V).getState();nt(this,jo,!!((t=a.mediaSubtitlesShowing)!=null&&t.length)),(r=M(this,V))==null||r.dispatch({type:"documentelementchangerequest",detail:void 0}),(o=M(this,V))==null||o.dispatch({type:b.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:!1})}M(this,at)&&((n=M(this,at))==null||n.call(this),nt(this,at,void 0))}mediaSetCallback(e){var t;super.mediaSetCallback(e),(t=M(this,V))==null||t.dispatch({type:"mediaelementchangerequest",detail:e}),e.hasAttribute("tabindex")||(e.tabIndex=-1)}mediaUnsetCallback(e){var t;super.mediaUnsetCallback(e),(t=M(this,V))==null||t.dispatch({type:"mediaelementchangerequest",detail:void 0})}propagateMediaState(e,t){gh(this.mediaStateReceivers,e,t)}associateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(t.has(e))return;let r=this.registerMediaStateReceiver.bind(this),o=this.unregisterMediaStateReceiver.bind(this),n=qv(e,r,o);Object.values(b).forEach(a=>{e.addEventListener(a,M(this,Oa))}),t.set(e,n)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(!t.has(e))return;t.get(e)(),t.delete(e),Object.values(b).forEach(o=>{e.removeEventListener(o,M(this,Oa))})}registerMediaStateReceiver(e){if(!e)return;let t=this.mediaStateReceivers;t.indexOf(e)>-1||(t.push(e),M(this,V)&&Object.entries(M(this,V).getState()).forEach(([o,n])=>{gh([e],o,n)}))}unregisterMediaStateReceiver(e){let t=this.mediaStateReceivers,r=t.indexOf(e);r<0||t.splice(r,1)}enableHotkeys(){this.addEventListener("keydown",st(this,Na,id))}disableHotkeys(){this.removeEventListener("keydown",st(this,Na,id)),this.removeEventListener("keyup",st(this,Ni,Ar))}get hotkeys(){return x(this,y.HOTKEYS)}set hotkeys(e){P(this,y.HOTKEYS,e)}keyboardShortcutHandler(e){var t,r,o,n,a,l,c,v,h;let p=e.target;if(((o=(r=(t=p.getAttribute(y.KEYS_USED))==null?void 0:t.split(" "))!=null?r:p==null?void 0:p.keysUsed)!=null?o:[]).map(D=>D==="Space"?" ":D).filter(Boolean).includes(e.key))return;let m,A,g;if(!(M(this,Zt).contains(`no${e.key.toLowerCase()}`)||e.key===" "&&M(this,Zt).contains("nospace")||e.shiftKey&&(e.key==="/"||e.key==="?")&&M(this,Zt).contains("noshift+/")))switch(e.key){case" ":case"k":m=M(this,V).getState().mediaPaused?b.MEDIA_PLAY_REQUEST:b.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new d.CustomEvent(m,{composed:!0,bubbles:!0}));break;case"m":m=this.mediaStore.getState().mediaVolumeLevel==="off"?b.MEDIA_UNMUTE_REQUEST:b.MEDIA_MUTE_REQUEST,this.dispatchEvent(new d.CustomEvent(m,{composed:!0,bubbles:!0}));break;case"f":m=this.mediaStore.getState().mediaIsFullscreen?b.MEDIA_EXIT_FULLSCREEN_REQUEST:b.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new d.CustomEvent(m,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new d.CustomEvent(b.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}));break;case"ArrowLeft":case"j":{let D=this.hasAttribute(y.KEYBOARD_BACKWARD_SEEK_OFFSET)?+this.getAttribute(y.KEYBOARD_BACKWARD_SEEK_OFFSET):hh;A=Math.max(((n=this.mediaStore.getState().mediaCurrentTime)!=null?n:0)-D,0),g=new d.CustomEvent(b.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(g);break}case"ArrowRight":case"l":{let D=this.hasAttribute(y.KEYBOARD_FORWARD_SEEK_OFFSET)?+this.getAttribute(y.KEYBOARD_FORWARD_SEEK_OFFSET):hh;A=Math.max(((a=this.mediaStore.getState().mediaCurrentTime)!=null?a:0)+D,0),g=new d.CustomEvent(b.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(g);break}case"ArrowUp":{let D=this.hasAttribute(y.KEYBOARD_UP_VOLUME_STEP)?+this.getAttribute(y.KEYBOARD_UP_VOLUME_STEP):ph;A=Math.min(((l=this.mediaStore.getState().mediaVolume)!=null?l:1)+D,1),g=new d.CustomEvent(b.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(g);break}case"ArrowDown":{let D=this.hasAttribute(y.KEYBOARD_DOWN_VOLUME_STEP)?+this.getAttribute(y.KEYBOARD_DOWN_VOLUME_STEP):ph;A=Math.max(((c=this.mediaStore.getState().mediaVolume)!=null?c:1)-D,0),g=new d.CustomEvent(b.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(g);break}case"<":{let D=(v=this.mediaStore.getState().mediaPlaybackRate)!=null?v:1;A=Math.max(D-mh,Hv).toFixed(2),g=new d.CustomEvent(b.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(g);break}case">":{let D=(h=this.mediaStore.getState().mediaPlaybackRate)!=null?h:1;A=Math.min(D+mh,$v).toFixed(2),g=new d.CustomEvent(b.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(g);break}case"/":case"?":{e.shiftKey&&st(this,rd,Eh).call(this);break}case"p":{m=this.mediaStore.getState().mediaIsPip?b.MEDIA_EXIT_PIP_REQUEST:b.MEDIA_ENTER_PIP_REQUEST,g=new d.CustomEvent(m,{composed:!0,bubbles:!0}),this.dispatchEvent(g);break}default:break}}};Zt=new WeakMap;Xo=new WeakMap;V=new WeakMap;Ui=new WeakMap;Jo=new WeakMap;at=new WeakMap;Oa=new WeakMap;jo=new WeakMap;Ua=new WeakSet;td=function(){var i;this.mediaStore=uh({media:this.media,fullscreenElement:this.fullscreenElement,options:{defaultSubtitles:this.hasAttribute(y.DEFAULT_SUBTITLES),defaultDuration:this.hasAttribute(y.DEFAULT_DURATION)?+this.getAttribute(y.DEFAULT_DURATION):void 0,defaultStreamType:(i=this.getAttribute(y.DEFAULT_STREAM_TYPE))!=null?i:void 0,liveEdgeOffset:this.hasAttribute(y.LIVE_EDGE_OFFSET)?+this.getAttribute(y.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(y.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(y.SEEK_TO_LIVE_OFFSET):this.hasAttribute(y.LIVE_EDGE_OFFSET)?+this.getAttribute(y.LIVE_EDGE_OFFSET):void 0,noAutoSeekToLive:this.hasAttribute(y.NO_AUTO_SEEK_TO_LIVE),noVolumePref:this.hasAttribute(y.NO_VOLUME_PREF),noMutedPref:this.hasAttribute(y.NO_MUTED_PREF),noSubtitlesLangPref:this.hasAttribute(y.NO_SUBTITLES_LANG_PREF)}})};Ni=new WeakSet;Ar=function(i){let{key:e,shiftKey:t}=i;if(!(t&&(e==="/"||e==="?")||bh.includes(e))){this.removeEventListener("keyup",st(this,Ni,Ar));return}this.keyboardShortcutHandler(i)};Na=new WeakSet;id=function(i){var e;let{metaKey:t,altKey:r,key:o,shiftKey:n}=i,a=n&&(o==="/"||o==="?");if(a&&((e=M(this,Ui))!=null&&e.open)){this.removeEventListener("keyup",st(this,Ni,Ar));return}if(t||r||!a&&!bh.includes(o)){this.removeEventListener("keyup",st(this,Ni,Ar));return}let l=i.target,c=l instanceof HTMLElement&&(l.tagName.toLowerCase()==="media-volume-range"||l.tagName.toLowerCase()==="media-time-range");[" ","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(o)&&!(M(this,Zt).contains(`no${o.toLowerCase()}`)||o===" "&&M(this,Zt).contains("nospace"))&&!c&&i.preventDefault(),this.addEventListener("keyup",st(this,Ni,Ar),{once:!0})};rd=new WeakSet;Eh=function(){M(this,Ui)||(nt(this,Ui,j.createElement("media-keyboard-shortcuts-dialog")),this.appendChild(M(this,Ui))),M(this,Ui).open=!0};var Bv=Object.values(s),Vv=Object.values(Bl),_h=i=>{var e,t,r,o;let{observedAttributes:n}=i.constructor;!n&&((e=i.nodeName)!=null&&e.includes("-"))&&(d.customElements.upgrade(i),{observedAttributes:n}=i.constructor);let a=(o=(r=(t=i==null?void 0:i.getAttribute)==null?void 0:t.call(i,U.MEDIA_CHROME_ATTRIBUTES))==null?void 0:r.split)==null?void 0:o.call(r,/\s+/);return Array.isArray(n||a)?(n||a).filter(l=>Bv.includes(l)):[]},Wv=i=>{var e,t;return(e=i.nodeName)!=null&&e.includes("-")&&d.customElements.get((t=i.nodeName)==null?void 0:t.toLowerCase())&&!(i instanceof d.customElements.get(i.nodeName.toLowerCase()))&&d.customElements.upgrade(i),Vv.some(r=>r in i)},nd=i=>Wv(i)||!!_h(i).length,vh=i=>{var e;return(e=i==null?void 0:i.join)==null?void 0:e.call(i,":")},fh={[s.MEDIA_SUBTITLES_LIST]:Pt,[s.MEDIA_SUBTITLES_SHOWING]:Pt,[s.MEDIA_SEEKABLE]:vh,[s.MEDIA_BUFFERED]:i=>i==null?void 0:i.map(vh).join(" "),[s.MEDIA_PREVIEW_COORDS]:i=>i==null?void 0:i.join(" "),[s.MEDIA_RENDITION_LIST]:Ru,[s.MEDIA_AUDIO_TRACK_LIST]:Pu},Fv=async(i,e,t)=>{var r,o;if(i.isConnected||await ha(0),typeof t=="boolean"||t==null)return I(i,e,t);if(typeof t=="number")return B(i,e,t);if(typeof t=="string")return P(i,e,t);if(Array.isArray(t)&&!t.length)return i.removeAttribute(e);let n=(o=(r=fh[e])==null?void 0:r.call(fh,t))!=null?o:t;return i.setAttribute(e,n)},Kv=i=>{var e;return!!((e=i.closest)!=null&&e.call(i,'*[slot="media"]'))},Oi=(i,e)=>{if(Kv(i))return;let t=(o,n)=>{var a,l;nd(o)&&n(o);let{children:c=[]}=o??{},v=(l=(a=o==null?void 0:o.shadowRoot)==null?void 0:a.children)!=null?l:[];[...c,...v].forEach(p=>Oi(p,n))},r=i==null?void 0:i.nodeName.toLowerCase();if(r.includes("-")&&!nd(i)){d.customElements.whenDefined(r).then(()=>{t(i,e)});return}t(i,e)},gh=(i,e,t)=>{i.forEach(r=>{if(e in r){r[e]=t;return}let o=_h(r),n=e.toLowerCase();o.includes(n)&&Fv(r,n,t)})},qv=(i,e,t)=>{Oi(i,e);let r=h=>{var p;let f=(p=h==null?void 0:h.composedPath()[0])!=null?p:h.target;e(f)},o=h=>{var p;let f=(p=h==null?void 0:h.composedPath()[0])!=null?p:h.target;t(f)};i.addEventListener(b.REGISTER_MEDIA_STATE_RECEIVER,r),i.addEventListener(b.UNREGISTER_MEDIA_STATE_RECEIVER,o);let n=h=>{h.forEach(p=>{let{addedNodes:f=[],removedNodes:m=[],type:A,target:g,attributeName:L}=p;A==="childList"?(Array.prototype.forEach.call(f,D=>Oi(D,e)),Array.prototype.forEach.call(m,D=>Oi(D,t))):A==="attributes"&&L===U.MEDIA_CHROME_ATTRIBUTES&&(nd(g)?e(g):t(g))})},a=[],l=h=>{let p=h.target;p.name!=="media"&&(a.forEach(f=>Oi(f,t)),a=[...p.assignedElements({flatten:!0})],a.forEach(f=>Oi(f,e)))};i.addEventListener("slotchange",l);let c=new MutationObserver(n);return c.observe(i,{childList:!0,attributes:!0,subtree:!0}),()=>{Oi(i,t),i.removeEventListener("slotchange",l),c.disconnect(),i.removeEventListener(b.REGISTER_MEDIA_STATE_RECEIVER,r),i.removeEventListener(b.UNREGISTER_MEDIA_STATE_RECEIVER,o)}};d.customElements.get("media-controller")||d.customElements.define("media-controller",od);var Sr={PLACEMENT:"placement",BOUNDS:"bounds"};function Gv(i){return`
|
|
394
|
+
`}var Bv=Object.values(s),Vv="sm:384 md:576 lg:768 xl:960";function Wv(i){fh(i.target,i.contentRect.width)}function fh(i,e){var t;if(!i.isConnected)return;let r=(t=i.getAttribute(R.BREAKPOINTS))!=null?t:Vv,o=Fv(r),n=Kv(o,e),a=!1;if(Object.keys(o).forEach(l=>{if(n.includes(l)){i.hasAttribute(`breakpoint${l}`)||(i.setAttribute(`breakpoint${l}`,""),a=!0);return}i.hasAttribute(`breakpoint${l}`)&&(i.removeAttribute(`breakpoint${l}`),a=!0)}),a){let l=new CustomEvent(xi.BREAKPOINTS_CHANGE,{detail:n});i.dispatchEvent(l)}i.breakpointsComputed||(i.breakpointsComputed=!0,i.dispatchEvent(new CustomEvent(xi.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))}function Fv(i){let e=i.split(/\s+/);return Object.fromEntries(e.map(t=>t.split(":")))}function Kv(i,e){return Object.keys(i).filter(t=>e>=parseInt(i[t]))}var Ni=class extends c.HTMLElement{constructor(){if(super(),Ue(this,hd),Ue(this,pd),Ue(this,md),Ue(this,ln),Ue(this,Wa),Ue(this,Lr),Ue(this,Ba,0),Ue(this,Sr,null),Ue(this,sn,null),Ue(this,kr,void 0),this.breakpointsComputed=!1,Ue(this,Ha,new MutationObserver(Fe(this,hd,ph).bind(this))),Ue(this,an,!1),Ue(this,$a,t=>{He(this,an)||(setTimeout(()=>{Wv(t),Oi(this,an,!1)},0),Oi(this,an,!0))}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let t=j(this.attributes),r=this.constructor.getTemplateHTML(t);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(r):this.shadowRoot.innerHTML=r}let e=this.querySelector(":scope > slot[slot=media]");e&&e.addEventListener("slotchange",()=>{if(!e.assignedElements({flatten:!0}).length){He(this,Sr)&&this.mediaUnsetCallback(He(this,Sr));return}this.handleMediaUpdated(this.media)})}static get observedAttributes(){return[R.AUTOHIDE,R.GESTURES_DISABLED].concat(Bv).filter(e=>![s.MEDIA_RENDITION_LIST,s.MEDIA_AUDIO_TRACK_LIST,s.MEDIA_CHAPTERS_CUES,s.MEDIA_WIDTH,s.MEDIA_HEIGHT,s.MEDIA_ERROR,s.MEDIA_ERROR_MESSAGE].includes(e))}attributeChangedCallback(e,t,r){e.toLowerCase()==R.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&&(Oi(this,Sr,e),e.localName.includes("-")&&await c.customElements.whenDefined(e.localName),this.mediaSetCallback(e))}connectedCallback(){var e;He(this,Ha).observe(this,{childList:!0,subtree:!0}),Rt(this,He(this,$a));let r=this.getAttribute(R.AUDIO)!=null?g("audio player"):g("video player");this.setAttribute("role","region"),this.setAttribute("aria-label",r),this.handleMediaUpdated(this.media),this.setAttribute(R.USER_INACTIVE,""),fh(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;He(this,Ha).disconnect(),xt(this,He(this,$a)),this.media&&this.mediaUnsetCallback(this.media),(e=c.window)==null||e.removeEventListener("mouseup",this)}mediaSetCallback(e){}mediaUnsetCallback(e){Oi(this,Sr,null)}handleEvent(e){switch(e.type){case"pointerdown":Oi(this,Ba,e.timeStamp);break;case"pointermove":Fe(this,pd,mh).call(this,e);break;case"pointerup":Fe(this,md,vh).call(this,e);break;case"mouseleave":Fe(this,ln,Va).call(this);break;case"mouseup":this.removeAttribute(R.KEYBOARD_CONTROL);break;case"keyup":Fe(this,Lr,dn).call(this),this.setAttribute(R.KEYBOARD_CONTROL,"");break}}set autohide(e){let t=Number(e);Oi(this,kr,isNaN(t)?0:t)}get autohide(){return(He(this,kr)===void 0?2:He(this,kr)).toString()}get breakpoints(){return x(this,R.BREAKPOINTS)}set breakpoints(e){P(this,R.BREAKPOINTS,e)}get audio(){return I(this,R.AUDIO)}set audio(e){w(this,R.AUDIO,e)}get gesturesDisabled(){return I(this,R.GESTURES_DISABLED)}set gesturesDisabled(e){w(this,R.GESTURES_DISABLED,e)}get keyboardControl(){return I(this,R.KEYBOARD_CONTROL)}set keyboardControl(e){w(this,R.KEYBOARD_CONTROL,e)}get noAutohide(){return I(this,R.NO_AUTOHIDE)}set noAutohide(e){w(this,R.NO_AUTOHIDE,e)}get autohideOverControls(){return I(this,R.AUTOHIDE_OVER_CONTROLS)}set autohideOverControls(e){w(this,R.AUTOHIDE_OVER_CONTROLS,e)}get userInteractive(){return I(this,R.USER_INACTIVE)}set userInteractive(e){w(this,R.USER_INACTIVE,e)}};Ba=new WeakMap;Sr=new WeakMap;sn=new WeakMap;kr=new WeakMap;Ha=new WeakMap;hd=new WeakSet;ph=function(i){let e=this.media;for(let t of i){if(t.type!=="childList")continue;let r=t.removedNodes;for(let o of r){if(o.slot!="media"||t.target!=this)continue;let n=t.previousSibling&&t.previousSibling.previousElementSibling;if(!n||!e)this.mediaUnsetCallback(o);else{let a=n.slot!=="media";for(;(n=n.previousSibling)!==null;)n.slot=="media"&&(a=!1);a&&this.mediaUnsetCallback(o)}}if(e)for(let o of t.addedNodes)o===e&&this.handleMediaUpdated(e)}};an=new WeakMap;$a=new WeakMap;pd=new WeakSet;mh=function(i){if(i.pointerType!=="mouse"&&i.timeStamp-He(this,Ba)<250)return;Fe(this,Wa,fd).call(this),clearTimeout(He(this,sn));let e=this.hasAttribute(R.AUTOHIDE_OVER_CONTROLS);([this,this.media].includes(i.target)||e)&&Fe(this,Lr,dn).call(this)};md=new WeakSet;vh=function(i){if(i.pointerType==="touch"){let e=!this.hasAttribute(R.USER_INACTIVE);[this,this.media].includes(i.target)&&e?Fe(this,ln,Va).call(this):Fe(this,Lr,dn).call(this)}else i.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e==null?void 0:e.localName))&&Fe(this,Lr,dn).call(this)};ln=new WeakSet;Va=function(){if(He(this,kr)<0||this.hasAttribute(R.USER_INACTIVE))return;this.setAttribute(R.USER_INACTIVE,"");let i=new c.CustomEvent(xi.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(i)};Wa=new WeakSet;fd=function(){if(!this.hasAttribute(R.USER_INACTIVE))return;this.removeAttribute(R.USER_INACTIVE);let i=new c.CustomEvent(xi.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(i)};Lr=new WeakSet;dn=function(){Fe(this,Wa,fd).call(this),clearTimeout(He(this,sn));let i=parseInt(this.autohide);i<0||Oi(this,sn,setTimeout(()=>{Fe(this,ln,Va).call(this)},i*1e3))};Ni.shadowRootOptions={mode:"open"};Ni.getTemplateHTML=$v;c.customElements.get("media-container")||c.customElements.define("media-container",Ni);var Eh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ge=(i,e,t)=>(Eh(i,e,"read from private field"),t?t.call(i):e.get(i)),cn=(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)},Fa=(i,e,t,r)=>(Eh(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Cr,Ir,Ka,Ui,Pt,jt,ei=class{constructor(e,t,{defaultValue:r}={defaultValue:void 0}){cn(this,Pt),cn(this,Cr,void 0),cn(this,Ir,void 0),cn(this,Ka,void 0),cn(this,Ui,new Set),Fa(this,Cr,e),Fa(this,Ir,t),Fa(this,Ka,new Set(r))}[Symbol.iterator](){return ge(this,Pt,jt).values()}get length(){return ge(this,Pt,jt).size}get value(){var e;return(e=[...ge(this,Pt,jt)].join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(Fa(this,Ui,new Set),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return[...ge(this,Pt,jt)][e]}values(){return ge(this,Pt,jt).values()}forEach(e,t){ge(this,Pt,jt).forEach(e,t)}add(...e){var t,r;e.forEach(o=>ge(this,Ui).add(o)),!(this.value===""&&!((t=ge(this,Cr))!=null&&t.hasAttribute(`${ge(this,Ir)}`)))&&((r=ge(this,Cr))==null||r.setAttribute(`${ge(this,Ir)}`,`${this.value}`))}remove(...e){var t;e.forEach(r=>ge(this,Ui).delete(r)),(t=ge(this,Cr))==null||t.setAttribute(`${ge(this,Ir)}`,`${this.value}`)}contains(e){return ge(this,Pt,jt).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}};Cr=new WeakMap;Ir=new WeakMap;Ka=new WeakMap;Ui=new WeakMap;Pt=new WeakSet;jt=function(){return ge(this,Ui).size?ge(this,Ui):ge(this,Ka)};var Gv=(i="")=>i.split(/\s+/),gh=(i="")=>{let[e,t,r]=i.split(":"),o=r?decodeURIComponent(r):void 0;return{kind:e==="cc"?we.CAPTIONS:we.SUBTITLES,language:t,label:o}},Hi=(i="",e={})=>Gv(i).map(t=>{let r=gh(t);return{...e,...r}}),Ed=i=>i?Array.isArray(i)?i.map(e=>typeof e=="string"?gh(e):e):typeof i=="string"?Hi(i):[i]:[],Ga=({kind:i,label:e,language:t}={kind:"subtitles"})=>e?`${i==="captions"?"cc":"sb"}:${t}:${encodeURIComponent(e)}`:t,Dt=(i=[])=>Array.prototype.map.call(i,Ga).join(" "),qv=(i,e)=>t=>t[i]===e,bh=i=>{let e=Object.entries(i).map(([t,r])=>qv(t,r));return t=>e.every(r=>r(t))},$i=(i,e=[],t=[])=>{let r=Ed(t).map(bh),o=n=>r.some(a=>a(n));Array.from(e).filter(o).forEach(n=>{n.mode=i})},Bi=(i,e=()=>!0)=>{if(!(i!=null&&i.textTracks))return[];let t=typeof e=="function"?e:bh(e);return Array.from(i.textTracks).filter(t)},qa=i=>{var e;return!!((e=i.mediaSubtitlesShowing)!=null&&e.length)||i.hasAttribute(s.MEDIA_SUBTITLES_SHOWING)};var yh=i=>{var e;let{media:t,fullscreenElement:r}=i;try{let o=r&&"requestFullscreen"in r?"requestFullscreen":r&&"webkitRequestFullScreen"in r?"webkitRequestFullScreen":void 0;if(o){let n=(e=r[o])==null?void 0:e.call(r);if(n instanceof Promise)return n.catch(()=>{})}else t!=null&&t.webkitEnterFullscreen?t.webkitEnterFullscreen():t!=null&&t.requestFullscreen&&t.requestFullscreen()}catch(o){console.error(o)}},_h="exitFullscreen"in ee?"exitFullscreen":"webkitExitFullscreen"in ee?"webkitExitFullscreen":"webkitCancelFullScreen"in ee?"webkitCancelFullScreen":void 0,Th=i=>{var e;let{documentElement:t}=i;if(_h){let r=(e=t==null?void 0:t[_h])==null?void 0:e.call(t);if(r instanceof Promise)return r.catch(()=>{})}},un="fullscreenElement"in ee?"fullscreenElement":"webkitFullscreenElement"in ee?"webkitFullscreenElement":void 0,zv=i=>{let{documentElement:e,media:t}=i,r=e==null?void 0:e[un];return!r&&"webkitDisplayingFullscreen"in t&&"webkitPresentationMode"in t&&t.webkitDisplayingFullscreen&&t.webkitPresentationMode===Xu.FULLSCREEN?t:r},Ah=i=>{var e;let{media:t,documentElement:r,fullscreenElement:o=t}=i;if(!t||!r)return!1;let n=zv(i);if(!n)return!1;if(n===o||n===t)return!0;if(n.localName.includes("-")){let a=n.shadowRoot;if(!(un in a))return Ae(n,o);for(;a!=null&&a[un];){if(a[un]===o)return!0;a=(e=a[un])==null?void 0:e.shadowRoot}}return!1},Yv="fullscreenEnabled"in ee?"fullscreenEnabled":"webkitFullscreenEnabled"in ee?"webkitFullscreenEnabled":void 0,Sh=i=>{let{documentElement:e,media:t}=i;return!!(e!=null&&e[Yv])||t&&"webkitSupportsFullscreen"in t};var za,gd=()=>{var i,e;return za||(za=(e=(i=ee)==null?void 0:i.createElement)==null?void 0:e.call(i,"video"),za)},kh=async(i=gd())=>{if(!i)return!1;let e=i.volume;i.volume=e/2+.1;let t=new AbortController,r=await Promise.race([Qv(i,t.signal),Zv(i,e)]);return t.abort(),r},Qv=(i,e)=>new Promise(t=>{i.addEventListener("volumechange",()=>t(!0),{signal:e})}),Zv=async(i,e)=>{for(let t=0;t<10;t++){if(i.volume===e)return!1;await Ia(10)}return i.volume!==e},Xv=/.*Version\/.*Safari\/.*/.test(c.navigator.userAgent),bd=(i=gd())=>c.matchMedia("(display-mode: standalone)").matches&&Xv?!1:typeof(i==null?void 0:i.requestPictureInPicture)=="function",_d=(i=gd())=>Sh({documentElement:ee,media:i}),Lh=_d(),Ch=bd(),Ih=!!c.WebKitPlaybackTargetAvailabilityEvent,wh=!!c.chrome;var wr=i=>Bi(i.media,e=>[we.SUBTITLES,we.CAPTIONS].includes(e.kind)).sort((e,t)=>e.kind>=t.kind?1:-1),yd=i=>Bi(i.media,e=>e.mode===Xt.SHOWING&&[we.SUBTITLES,we.CAPTIONS].includes(e.kind)),Ya=(i,e)=>{let t=wr(i),r=yd(i),o=!!r.length;if(t.length){if(e===!1||o&&e!==!0)$i(Xt.DISABLED,t,r);else if(e===!0||!o&&e!==!1){let n=t[0],{options:a}=i;if(!(a!=null&&a.noSubtitlesLangPref)){let h=globalThis.localStorage.getItem("media-chrome-pref-subtitles-lang"),p=h?[h,...globalThis.navigator.languages]:globalThis.navigator.languages,E=t.filter(m=>p.some(A=>m.language.toLowerCase().startsWith(A.split("-")[0]))).sort((m,A)=>{let f=p.findIndex(D=>m.language.toLowerCase().startsWith(D.split("-")[0])),L=p.findIndex(D=>A.language.toLowerCase().startsWith(D.split("-")[0]));return f-L});E[0]&&(n=E[0])}let{language:l,label:d,kind:v}=n;$i(Xt.DISABLED,t,r),$i(Xt.SHOWING,t,[{language:l,label:d,kind:v}])}}},Qa=(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)?Jv(i,e):Object.entries(i).every(([t,r])=>t in e&&Qa(r,e[t])),Jv=(i,e)=>{let t=Array.isArray(i),r=Array.isArray(e);return t!==r?!1:t||r?i.length!==e.length?!1:i.every((o,n)=>Qa(o,e[n])):!0};var jv=Object.values(Xe),Za,ef=kh().then(i=>(Za=i,Za)),Mh=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))}))},tf=new c.DOMParser,rf=i=>i&&(tf.parseFromString(i,"text/html").body.textContent||i),Mr={mediaError:{get(i,e){let{media:t}=i;if((e==null?void 0:e.type)!=="playing")return t==null?void 0:t.error},mediaEvents:["emptied","error","playing"]},mediaErrorCode:{get(i,e){var t;let{media:r}=i;if((e==null?void 0:e.type)!=="playing")return(t=r==null?void 0:r.error)==null?void 0:t.code},mediaEvents:["emptied","error","playing"]},mediaErrorMessage:{get(i,e){var t,r;let{media:o}=i;if((e==null?void 0:e.type)!=="playing")return(r=(t=o==null?void 0:o.error)==null?void 0:t.message)!=null?r:""},mediaEvents:["emptied","error","playing"]},mediaWidth:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.videoWidth)!=null?e:0},mediaEvents:["resize"]},mediaHeight:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.videoHeight)!=null?e:0},mediaEvents:["resize"]},mediaPaused:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.paused)!=null?e:!0},set(i,e){var t;let{media:r}=e;r&&(i?r.pause():(t=r.play())==null||t.catch(()=>{}))},mediaEvents:["play","playing","pause","emptied"]},mediaHasPlayed:{get(i,e){let{media:t}=i;return t?e?e.type==="playing":!t.paused:!1},mediaEvents:["playing","emptied"]},mediaEnded:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.ended)!=null?e:!1},mediaEvents:["seeked","ended","emptied"]},mediaPlaybackRate:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.playbackRate)!=null?e:1},set(i,e){let{media:t}=e;t&&Number.isFinite(+i)&&(t.playbackRate=+i)},mediaEvents:["ratechange","loadstart"]},mediaMuted:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.muted)!=null?e:!1},set(i,e){let{media:t,options:{noMutedPref:r}={}}=e;if(t){t.muted=i;try{let o=c.localStorage.getItem("media-chrome-pref-muted")!==null,n=t.hasAttribute("muted");if(r){o&&c.localStorage.removeItem("media-chrome-pref-muted");return}if(n&&!o)return;c.localStorage.setItem("media-chrome-pref-muted",i?"true":"false")}catch(o){console.debug("Error setting muted pref",o)}}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(i,e)=>{let{options:{noMutedPref:t}}=e,{media:r}=e;if(!(!r||r.muted||t))try{let o=c.localStorage.getItem("media-chrome-pref-muted")==="true";Mr.mediaMuted.set(o,e),i(o)}catch(o){console.debug("Error getting muted pref",o)}}]},mediaLoop:{get(i){let{media:e}=i;return e==null?void 0:e.loop},set(i,e){let{media:t}=e;t&&(t.loop=i)},mediaEvents:["medialooprequest"]},mediaVolume:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.volume)!=null?e:1},set(i,e){let{media:t,options:{noVolumePref:r}={}}=e;if(t){try{i==null?c.localStorage.removeItem("media-chrome-pref-volume"):!t.hasAttribute("muted")&&!r&&c.localStorage.setItem("media-chrome-pref-volume",i.toString())}catch(o){console.debug("Error setting volume pref",o)}Number.isFinite(+i)&&(t.volume=+i)}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(i,e)=>{let{options:{noVolumePref:t}}=e;if(!t)try{let{media:r}=e;if(!r)return;let o=c.localStorage.getItem("media-chrome-pref-volume");if(o==null)return;Mr.mediaVolume.set(+o,e),i(+o)}catch(r){console.debug("Error getting volume pref",r)}}]},mediaVolumeLevel:{get(i){let{media:e}=i;return typeof(e==null?void 0:e.volume)>"u"?"high":e.muted||e.volume===0?"off":e.volume<.5?"low":e.volume<.75?"medium":"high"},mediaEvents:["volumechange"]},mediaCurrentTime:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.currentTime)!=null?e:0},set(i,e){let{media:t}=e;!t||!Tr(i)||(t.currentTime=i)},mediaEvents:["timeupdate","loadedmetadata"]},mediaDuration:{get(i){let{media:e,options:{defaultDuration:t}={}}=i;return t&&(!e||!e.duration||Number.isNaN(e.duration)||!Number.isFinite(e.duration))?t:Number.isFinite(e==null?void 0:e.duration)?e.duration:Number.NaN},mediaEvents:["durationchange","loadedmetadata","emptied"]},mediaLoading:{get(i){let{media:e}=i;return(e==null?void 0:e.readyState)<3},mediaEvents:["waiting","playing","emptied"]},mediaSeekable:{get(i){var e;let{media:t}=i;if(!((e=t==null?void 0:t.seekable)!=null&&e.length))return;let r=t.seekable.start(0),o=t.seekable.end(t.seekable.length-1);if(!(!r&&!o))return[Number(r.toFixed(3)),Number(o.toFixed(3))]},mediaEvents:["loadedmetadata","emptied","progress","seekablechange"]},mediaBuffered:{get(i){var e;let{media:t}=i,r=(e=t==null?void 0:t.buffered)!=null?e:[];return Array.from(r).map((o,n)=>[Number(r.start(n).toFixed(3)),Number(r.end(n).toFixed(3))])},mediaEvents:["progress","emptied"]},mediaStreamType:{get(i){let{media:e,options:{defaultStreamType:t}={}}=i,r=[Xe.LIVE,Xe.ON_DEMAND].includes(t)?t:void 0;if(!e)return r;let{streamType:o}=e;if(jv.includes(o))return o===Xe.UNKNOWN?r:o;let n=e.duration;return n===1/0?Xe.LIVE:Number.isFinite(n)?Xe.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=Mr.mediaStreamType.get(i);return(t==null||Number.isNaN(t))&&r===Xe.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(!(Mr.mediaStreamType.get(i)===Xe.LIVE))return!1;let o=e.seekable;if(!o)return!0;if(!o.length)return!1;let n=o.end(o.length-1)-t;return e.currentTime>=n},mediaEvents:["playing","timeupdate","progress","waiting","emptied"]},mediaSubtitlesList:{get(i){return wr(i).map(({kind:e,label:t,language:r})=>({kind:e,label:t,language:r}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},mediaSubtitlesShowing:{get(i){return yd(i).map(({kind:e,label:t,language:r})=>({kind:e,label:t,language:r}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(i,e)=>{var t,r;let{media:o,options:n}=e;if(!o)return;let a=l=>{var d;!n.defaultSubtitles||l&&![we.CAPTIONS,we.SUBTITLES].includes((d=l==null?void 0:l.track)==null?void 0:d.kind)||Ya(e,!0)};return o.addEventListener("loadstart",a),(t=o.textTracks)==null||t.addEventListener("addtrack",a),(r=o.textTracks)==null||r.addEventListener("removetrack",a),()=>{var l,d;o.removeEventListener("loadstart",a),(l=o.textTracks)==null||l.removeEventListener("addtrack",a),(d=o.textTracks)==null||d.removeEventListener("removetrack",a)}}]},mediaChaptersCues:{get(i){var e;let{media:t}=i;if(!t)return[];let[r]=Bi(t,{kind:we.CHAPTERS});return Array.from((e=r==null?void 0:r.cues)!=null?e:[]).map(({text:o,startTime:n,endTime:a})=>({text:rf(o),startTime:n,endTime:a}))},mediaEvents:["loadstart","loadedmetadata"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:r}=e;if(!r)return;let o=r.querySelector('track[kind="chapters"][default][src]'),n=(t=r.shadowRoot)==null?void 0:t.querySelector(':is(video,audio) > track[kind="chapters"][default][src]');return o==null||o.addEventListener("load",i),n==null||n.addEventListener("load",i),()=>{o==null||o.removeEventListener("load",i),n==null||n.removeEventListener("load",i)}}]},mediaIsPip:{get(i){var e,t;let{media:r,documentElement:o}=i;if(!r||!o||!o.pictureInPictureElement)return!1;if(o.pictureInPictureElement===r)return!0;if(o.pictureInPictureElement instanceof HTMLMediaElement)return(e=r.localName)!=null&&e.includes("-")?Ae(r,o.pictureInPictureElement):!1;if(o.pictureInPictureElement.localName.includes("-")){let n=o.pictureInPictureElement.shadowRoot;for(;n!=null&&n.pictureInPictureElement;){if(n.pictureInPictureElement===r)return!0;n=(t=n.pictureInPictureElement)==null?void 0:t.shadowRoot}}return!1},set(i,e){let{media:t}=e;if(t)if(i){if(!ee.pictureInPictureEnabled){console.warn("MediaChrome: Picture-in-picture is not enabled");return}if(!t.requestPictureInPicture){console.warn("MediaChrome: The current media does not support picture-in-picture");return}let r=()=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};t.requestPictureInPicture().catch(o=>{if(o.code===11){if(!t.src){console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a src set.");return}if(t.readyState===0&&t.preload==="none"){let n=()=>{t.removeEventListener("loadedmetadata",a),t.preload="none"},a=()=>{t.requestPictureInPicture().catch(r),n()};t.addEventListener("loadedmetadata",a),t.preload="metadata",setTimeout(()=>{t.readyState===0&&r(),n()},1e3)}else throw o}else throw o})}else ee.pictureInPictureElement&&ee.exitPictureInPicture()},mediaEvents:["enterpictureinpicture","leavepictureinpicture"]},mediaRenditionList:{get(i){var e;let{media:t}=i;return[...(e=t==null?void 0:t.videoRenditions)!=null?e:[]].map(r=>({...r}))},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaRenditionSelected:{get(i){var e,t,r;let{media:o}=i;return(r=(t=o==null?void 0:o.videoRenditions)==null?void 0:t[(e=o.videoRenditions)==null?void 0:e.selectedIndex])==null?void 0:r.id},set(i,e){let{media:t}=e;if(!(t!=null&&t.videoRenditions)){console.warn("MediaController: Rendition selection not supported by this media.");return}let r=i,o=Array.prototype.findIndex.call(t.videoRenditions,n=>n.id==r);t.videoRenditions.selectedIndex!=o&&(t.videoRenditions.selectedIndex=o)},mediaEvents:["emptied"],videoRenditionsEvents:["addrendition","removerendition","change"]},mediaAudioTrackList:{get(i){var e;let{media:t}=i;return[...(e=t==null?void 0:t.audioTracks)!=null?e:[]]},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaAudioTrackEnabled:{get(i){var e,t;let{media:r}=i;return(t=[...(e=r==null?void 0:r.audioTracks)!=null?e:[]].find(o=>o.enabled))==null?void 0:t.id},set(i,e){let{media:t}=e;if(!(t!=null&&t.audioTracks)){console.warn("MediaChrome: Audio track selection not supported by this media.");return}let r=i;for(let o of t.audioTracks)o.enabled=r==o.id},mediaEvents:["emptied"],audioTracksEvents:["addtrack","removetrack","change"]},mediaIsFullscreen:{get(i){return Ah(i)},set(i,e,t){var r;i?(yh(e),t.detail&&((r=e.media)==null||r.focus())):Th(e)},rootEvents:["fullscreenchange","webkitfullscreenchange"],mediaEvents:["webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"]},mediaIsCasting:{get(i){var e;let{media:t}=i;return!(t!=null&&t.remote)||((e=t.remote)==null?void 0:e.state)==="disconnected"?!1:!!t.remote.state},set(i,e){var t,r;let{media:o}=e;if(o&&!(i&&((t=o.remote)==null?void 0:t.state)!=="disconnected")&&!(!i&&((r=o.remote)==null?void 0:r.state)!=="connected")){if(typeof o.remote.prompt!="function"){console.warn("MediaChrome: Casting is not supported in this environment");return}o.remote.prompt().catch(()=>{})}},remoteEvents:["connect","connecting","disconnect"]},mediaIsAirplaying:{get(){return!1},set(i,e){let{media:t}=e;if(t){if(!(t.webkitShowPlaybackTargetPicker&&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(!Lh||!_d(e))return Me.UNSUPPORTED}},mediaPipUnavailable:{get(i){let{media:e}=i;if(!Ch||!bd(e))return Me.UNSUPPORTED;if(e!=null&&e.disablePictureInPicture)return Me.UNAVAILABLE}},mediaVolumeUnavailable:{get(i){let{media:e}=i;if(Za===!1||(e==null?void 0:e.volume)==null)return Me.UNSUPPORTED},stateOwnersUpdateHandlers:[i=>{Za==null&&ef.then(e=>i(e?void 0:Me.UNSUPPORTED))}]},mediaCastUnavailable:{get(i,{availability:e="not-available"}={}){var t;let{media:r}=i;if(!wh||!((t=r==null?void 0:r.remote)!=null&&t.state))return Me.UNSUPPORTED;if(!(e==null||e==="available"))return Me.UNAVAILABLE},stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:r}=e;return r?(r.disableRemotePlayback||r.hasAttribute("disableremoteplayback")||(t=r==null?void 0:r.remote)==null||t.watchAvailability(n=>{i({availability:n?"available":"not-available"})}).catch(n=>{n.name==="NotSupportedError"?i({availability:null}):i({availability:"not-available"})}),()=>{var n;(n=r==null?void 0:r.remote)==null||n.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaAirplayUnavailable:{get(i,e){if(!Ih)return Me.UNSUPPORTED;if((e==null?void 0:e.availability)==="not-available")return Me.UNAVAILABLE},mediaEvents:["webkitplaybacktargetavailabilitychanged"],stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:r}=e;return r?(r.disableRemotePlayback||r.hasAttribute("disableremoteplayback")||(t=r==null?void 0:r.remote)==null||t.watchAvailability(n=>{i({availability:n?"available":"not-available"})}).catch(n=>{n.name==="NotSupportedError"?i({availability:null}):i({availability:"not-available"})}),()=>{var n;(n=r==null?void 0:r.remote)==null||n.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaRenditionUnavailable:{get(i){var e;let{media:t}=i;if(!(t!=null&&t.videoRenditions))return Me.UNSUPPORTED;if(!((e=t.videoRenditions)!=null&&e.length))return Me.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaAudioTrackUnavailable:{get(i){var e,t;let{media:r}=i;if(!(r!=null&&r.audioTracks))return Me.UNSUPPORTED;if(((t=(e=r.audioTracks)==null?void 0:e.length)!=null?t:0)<=1)return Me.UNAVAILABLE},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaLang:{get(i){let{options:{mediaLang:e}={}}=i;return e??"en"}}};var Rh={[b.MEDIA_PREVIEW_REQUEST](i,e,{detail:t}){var r,o,n;let{media:a}=e,l=t??void 0,d,v;if(a&&l!=null){let[m]=Bi(a,{kind:we.METADATA,label:"thumbnails"}),A=Array.prototype.find.call((r=m==null?void 0:m.cues)!=null?r:[],(f,L,D)=>L===0?f.endTime>l:L===D.length-1?f.startTime<=l:f.startTime<=l&&f.endTime>l);if(A){let f=/'^(?:[a-z]+:)?\/\//i.test(A.text)||(o=a==null?void 0:a.querySelector('track[label="thumbnails"]'))==null?void 0:o.src,L=new URL(A.text,f);v=new URLSearchParams(L.hash).get("#xywh").split(",").map(Oe=>+Oe),d=L.href}}let h=i.mediaDuration.get(e),E=(n=i.mediaChaptersCues.get(e).find((m,A,f)=>A===f.length-1&&h===m.endTime?m.startTime<=l&&m.endTime>=l:m.startTime<=l&&m.endTime>l))==null?void 0:n.text;return t!=null&&E==null&&(E=""),{mediaPreviewTime:l,mediaPreviewImage:d,mediaPreviewCoords:v,mediaPreviewChapter:E}},[b.MEDIA_PAUSE_REQUEST](i,e){i["mediaPaused"].set(!0,e)},[b.MEDIA_PLAY_REQUEST](i,e){var t,r,o,n;let a="mediaPaused",d=i.mediaStreamType.get(e)===Xe.LIVE,v=!((t=e.options)!=null&&t.noAutoSeekToLive),h=i.mediaTargetLiveWindow.get(e)>0;if(d&&v&&!h){let p=(r=i.mediaSeekable.get(e))==null?void 0:r[1];if(p){let E=(n=(o=e.options)==null?void 0:o.seekToLiveOffset)!=null?n:0,m=p-E;i.mediaCurrentTime.set(m,e)}}i[a].set(!1,e)},[b.MEDIA_PLAYBACK_RATE_REQUEST](i,e,{detail:t}){let r="mediaPlaybackRate",o=t;i[r].set(o,e)},[b.MEDIA_MUTE_REQUEST](i,e){i["mediaMuted"].set(!0,e)},[b.MEDIA_UNMUTE_REQUEST](i,e){let t="mediaMuted";i.mediaVolume.get(e)||i.mediaVolume.set(.25,e),i[t].set(!1,e)},[b.MEDIA_LOOP_REQUEST](i,e,{detail:t}){let r="mediaLoop",o=!!t;return i[r].set(o,e),{mediaLoop:o}},[b.MEDIA_VOLUME_REQUEST](i,e,{detail:t}){let r="mediaVolume",o=t;o&&i.mediaMuted.get(e)&&i.mediaMuted.set(!1,e),i[r].set(o,e)},[b.MEDIA_SEEK_REQUEST](i,e,{detail:t}){let r="mediaCurrentTime",o=t;i[r].set(o,e)},[b.MEDIA_SEEK_TO_LIVE_REQUEST](i,e){var t,r,o;let n="mediaCurrentTime",a=(t=i.mediaSeekable.get(e))==null?void 0:t[1];if(Number.isNaN(Number(a)))return;let l=(o=(r=e.options)==null?void 0:r.seekToLiveOffset)!=null?o:0,d=a-l;i[n].set(d,e)},[b.MEDIA_SHOW_SUBTITLES_REQUEST](i,e,{detail:t}){var r;let{options:o}=e,n=wr(e),a=Ed(t),l=(r=a[0])==null?void 0:r.language;l&&!o.noSubtitlesLangPref&&c.localStorage.setItem("media-chrome-pref-subtitles-lang",l),$i(Xt.SHOWING,n,a)},[b.MEDIA_DISABLE_SUBTITLES_REQUEST](i,e,{detail:t}){let r=wr(e),o=t??[];$i(Xt.DISABLED,r,o)},[b.MEDIA_TOGGLE_SUBTITLES_REQUEST](i,e,{detail:t}){Ya(e,t)},[b.MEDIA_RENDITION_REQUEST](i,e,{detail:t}){let r="mediaRenditionSelected",o=t;i[r].set(o,e)},[b.MEDIA_AUDIO_TRACK_REQUEST](i,e,{detail:t}){let r="mediaAudioTrackEnabled",o=t;i[r].set(o,e)},[b.MEDIA_ENTER_PIP_REQUEST](i,e){let t="mediaIsPip";i.mediaIsFullscreen.get(e)&&i.mediaIsFullscreen.set(!1,e),i[t].set(!0,e)},[b.MEDIA_EXIT_PIP_REQUEST](i,e){i["mediaIsPip"].set(!1,e)},[b.MEDIA_ENTER_FULLSCREEN_REQUEST](i,e,t){let r="mediaIsFullscreen";i.mediaIsPip.get(e)&&i.mediaIsPip.set(!1,e),i[r].set(!0,e,t)},[b.MEDIA_EXIT_FULLSCREEN_REQUEST](i,e){i["mediaIsFullscreen"].set(!1,e)},[b.MEDIA_ENTER_CAST_REQUEST](i,e){let t="mediaIsCasting";i.mediaIsFullscreen.get(e)&&i.mediaIsFullscreen.set(!1,e),i[t].set(!0,e)},[b.MEDIA_EXIT_CAST_REQUEST](i,e){i["mediaIsCasting"].set(!1,e)},[b.MEDIA_AIRPLAY_REQUEST](i,e){i["mediaIsAirplaying"].set(!0,e)}};var xh=({media:i,fullscreenElement:e,documentElement:t,stateMediator:r=Mr,requestMap:o=Rh,options:n={},monitorStateOwnersOnlyWithSubscriptions:a=!0})=>{let l=[],d={options:{...n}},v=Object.freeze({mediaPreviewTime:void 0,mediaPreviewImage:void 0,mediaPreviewCoords:void 0,mediaPreviewChapter:void 0}),h=f=>{f!=null&&(Qa(f,v)||(v=Object.freeze({...v,...f}),l.forEach(L=>L(v))))},p=()=>{let f=Object.entries(r).reduce((L,[D,{get:Oe}])=>(L[D]=Oe(d),L),{});h(f)},E={},m,A=async(f,L)=>{var D,Oe,ot,Oo,hr,nu,Nl,k,K,ae,te,z,pe,It,No,au;let Fm=!!m;if(m={...d,...m??{},...f},Fm)return;await Mh(...Object.values(f));let pr=l.length>0&&L===0&&a,su=d.media!==m.media,lu=((D=d.media)==null?void 0:D.textTracks)!==((Oe=m.media)==null?void 0:Oe.textTracks),du=((ot=d.media)==null?void 0:ot.videoRenditions)!==((Oo=m.media)==null?void 0:Oo.videoRenditions),cu=((hr=d.media)==null?void 0:hr.audioTracks)!==((nu=m.media)==null?void 0:nu.audioTracks),uu=((Nl=d.media)==null?void 0:Nl.remote)!==((k=m.media)==null?void 0:k.remote),hu=d.documentElement!==m.documentElement,pu=!!d.media&&(su||pr),mu=!!((K=d.media)!=null&&K.textTracks)&&(lu||pr),vu=!!((ae=d.media)!=null&&ae.videoRenditions)&&(du||pr),fu=!!((te=d.media)!=null&&te.audioTracks)&&(cu||pr),Eu=!!((z=d.media)!=null&&z.remote)&&(uu||pr),gu=!!d.documentElement&&(hu||pr),Ul=pu||mu||vu||fu||Eu||gu,mr=l.length===0&&L===1&&a,C=!!m.media&&(su||mr),bu=!!((pe=m.media)!=null&&pe.textTracks)&&(lu||mr),_u=!!((It=m.media)!=null&&It.videoRenditions)&&(du||mr),yu=!!((No=m.media)!=null&&No.audioTracks)&&(cu||mr),Tu=!!((au=m.media)!=null&&au.remote)&&(uu||mr),Au=!!m.documentElement&&(hu||mr),Su=C||bu||_u||yu||Tu||Au;if(!(Ul||Su)){Object.entries(m).forEach(([Y,Uo])=>{d[Y]=Uo}),p(),m=void 0;return}Object.entries(r).forEach(([Y,{get:Uo,mediaEvents:Km=[],textTracksEvents:Gm=[],videoRenditionsEvents:qm=[],audioTracksEvents:zm=[],remoteEvents:Ym=[],rootEvents:Qm=[],stateOwnersUpdateHandlers:Zm=[]}])=>{E[Y]||(E[Y]={});let Ne=ie=>{let ue=Uo(d,ie);h({[Y]:ue})},ve;ve=E[Y].mediaEvents,Km.forEach(ie=>{ve&&pu&&(d.media.removeEventListener(ie,ve),E[Y].mediaEvents=void 0),C&&(m.media.addEventListener(ie,Ne),E[Y].mediaEvents=Ne)}),ve=E[Y].textTracksEvents,Gm.forEach(ie=>{var ue,Ze;ve&&mu&&((ue=d.media.textTracks)==null||ue.removeEventListener(ie,ve),E[Y].textTracksEvents=void 0),bu&&((Ze=m.media.textTracks)==null||Ze.addEventListener(ie,Ne),E[Y].textTracksEvents=Ne)}),ve=E[Y].videoRenditionsEvents,qm.forEach(ie=>{var ue,Ze;ve&&vu&&((ue=d.media.videoRenditions)==null||ue.removeEventListener(ie,ve),E[Y].videoRenditionsEvents=void 0),_u&&((Ze=m.media.videoRenditions)==null||Ze.addEventListener(ie,Ne),E[Y].videoRenditionsEvents=Ne)}),ve=E[Y].audioTracksEvents,zm.forEach(ie=>{var ue,Ze;ve&&fu&&((ue=d.media.audioTracks)==null||ue.removeEventListener(ie,ve),E[Y].audioTracksEvents=void 0),yu&&((Ze=m.media.audioTracks)==null||Ze.addEventListener(ie,Ne),E[Y].audioTracksEvents=Ne)}),ve=E[Y].remoteEvents,Ym.forEach(ie=>{var ue,Ze;ve&&Eu&&((ue=d.media.remote)==null||ue.removeEventListener(ie,ve),E[Y].remoteEvents=void 0),Tu&&((Ze=m.media.remote)==null||Ze.addEventListener(ie,Ne),E[Y].remoteEvents=Ne)}),ve=E[Y].rootEvents,Qm.forEach(ie=>{ve&&gu&&(d.documentElement.removeEventListener(ie,ve),E[Y].rootEvents=void 0),Au&&(m.documentElement.addEventListener(ie,Ne),E[Y].rootEvents=Ne)});let ha=E[Y].stateOwnersUpdateHandlers;if(ha&&Ul&&(Array.isArray(ha)?ha:[ha]).forEach(ue=>{typeof ue=="function"&&ue()}),Su){let ie=Zm.map(ue=>ue(Ne,m)).filter(ue=>typeof ue=="function");E[Y].stateOwnersUpdateHandlers=ie.length===1?ie[0]:ie}else Ul&&(E[Y].stateOwnersUpdateHandlers=void 0)}),Object.entries(m).forEach(([Y,Uo])=>{d[Y]=Uo}),p(),m=void 0};return A({media:i,fullscreenElement:e,documentElement:t,options:n}),{dispatch(f){let{type:L,detail:D}=f;if(o[L]&&v.mediaErrorCode==null){h(o[L](r,d,f));return}L==="mediaelementchangerequest"?A({media:D}):L==="fullscreenelementchangerequest"?A({fullscreenElement:D}):L==="documentelementchangerequest"?A({documentElement:D}):L==="optionschangerequest"&&(Object.entries(D??{}).forEach(([Oe,ot])=>{d.options[Oe]=ot}),p())},getState(){return v},subscribe(f){return A({},l.length+1),l.push(f),f(v),()=>{let L=l.indexOf(f);L>=0&&(A({},l.length-1),l.splice(L,1))}}}};var Cd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},M=(i,e,t)=>(Cd(i,e,"read from private field"),t?t.call(i):e.get(i)),Ke=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},at=(i,e,t,r)=>(Cd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),lt=(i,e,t)=>(Cd(i,e,"access private method"),t),ti,hn,V,Wi,pn,st,Xa,mn,Ja,Td,Fi,Rr,ja,Ad,Sd,$h,Bh=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter"," ","f","m","k","c","l","j",">","<","p"],Ph=10,Dh=.025,Oh=.25,of=.25,nf=2,y={DEFAULT_SUBTITLES:"defaultsubtitles",DEFAULT_STREAM_TYPE:"defaultstreamtype",DEFAULT_DURATION:"defaultduration",FULLSCREEN_ELEMENT:"fullscreenelement",HOTKEYS:"hotkeys",KEYBOARD_BACKWARD_SEEK_OFFSET:"keyboardbackwardseekoffset",KEYBOARD_FORWARD_SEEK_OFFSET:"keyboardforwardseekoffset",KEYBOARD_DOWN_VOLUME_STEP:"keyboarddownvolumestep",KEYBOARD_UP_VOLUME_STEP:"keyboardupvolumestep",KEYS_USED:"keysused",LANG:"lang",LOOP:"loop",LIVE_EDGE_OFFSET:"liveedgeoffset",NO_AUTO_SEEK_TO_LIVE:"noautoseektolive",NO_DEFAULT_STORE:"nodefaultstore",NO_HOTKEYS:"nohotkeys",NO_MUTED_PREF:"nomutedpref",NO_SUBTITLES_LANG_PREF:"nosubtitleslangpref",NO_VOLUME_PREF:"novolumepref",SEEK_TO_LIVE_OFFSET:"seektoliveoffset"},kd=class extends Ni{constructor(){super(),Ke(this,Ja),Ke(this,Fi),Ke(this,ja),Ke(this,Sd),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,Ke(this,ti,new ei(this,y.HOTKEYS)),Ke(this,hn,void 0),Ke(this,V,void 0),Ke(this,Wi,null),Ke(this,pn,void 0),Ke(this,st,void 0),Ke(this,Xa,t=>{var r;(r=M(this,V))==null||r.dispatch(t)}),Ke(this,mn,void 0),this.associateElement(this);let e={};at(this,pn,t=>{Object.entries(t).forEach(([r,o])=>{if(r in e&&e[r]===o)return;this.propagateMediaState(r,o);let n=r.toLowerCase(),a=new c.CustomEvent(Zu[n],{composed:!0,detail:o});this.dispatchEvent(a)}),e=t}),this.hasAttribute(y.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat(y.NO_HOTKEYS,y.HOTKEYS,y.DEFAULT_STREAM_TYPE,y.DEFAULT_SUBTITLES,y.DEFAULT_DURATION,y.NO_MUTED_PREF,y.NO_VOLUME_PREF,y.LANG,y.LOOP)}get mediaStore(){return M(this,V)}set mediaStore(e){var t,r;if(M(this,V)&&((t=M(this,st))==null||t.call(this),at(this,st,void 0)),at(this,V,e),!M(this,V)&&!this.hasAttribute(y.NO_DEFAULT_STORE)){lt(this,Ja,Td).call(this);return}at(this,st,(r=M(this,V))==null?void 0:r.subscribe(M(this,pn)))}get fullscreenElement(){var e;return(e=M(this,hn))!=null?e:this}set fullscreenElement(e){var t;this.hasAttribute(y.FULLSCREEN_ELEMENT)&&this.removeAttribute(y.FULLSCREEN_ELEMENT),at(this,hn,e),(t=M(this,V))==null||t.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}get defaultSubtitles(){return I(this,y.DEFAULT_SUBTITLES)}set defaultSubtitles(e){w(this,y.DEFAULT_SUBTITLES,e)}get defaultStreamType(){return x(this,y.DEFAULT_STREAM_TYPE)}set defaultStreamType(e){P(this,y.DEFAULT_STREAM_TYPE,e)}get defaultDuration(){return H(this,y.DEFAULT_DURATION)}set defaultDuration(e){B(this,y.DEFAULT_DURATION,e)}get noHotkeys(){return I(this,y.NO_HOTKEYS)}set noHotkeys(e){w(this,y.NO_HOTKEYS,e)}get keysUsed(){return x(this,y.KEYS_USED)}set keysUsed(e){P(this,y.KEYS_USED,e)}get liveEdgeOffset(){return H(this,y.LIVE_EDGE_OFFSET)}set liveEdgeOffset(e){B(this,y.LIVE_EDGE_OFFSET,e)}get noAutoSeekToLive(){return I(this,y.NO_AUTO_SEEK_TO_LIVE)}set noAutoSeekToLive(e){w(this,y.NO_AUTO_SEEK_TO_LIVE,e)}get noVolumePref(){return I(this,y.NO_VOLUME_PREF)}set noVolumePref(e){w(this,y.NO_VOLUME_PREF,e)}get noMutedPref(){return I(this,y.NO_MUTED_PREF)}set noMutedPref(e){w(this,y.NO_MUTED_PREF,e)}get noSubtitlesLangPref(){return I(this,y.NO_SUBTITLES_LANG_PREF)}set noSubtitlesLangPref(e){w(this,y.NO_SUBTITLES_LANG_PREF,e)}get noDefaultStore(){return I(this,y.NO_DEFAULT_STORE)}set noDefaultStore(e){w(this,y.NO_DEFAULT_STORE,e)}attributeChangedCallback(e,t,r){var o,n,a,l,d,v,h,p,E,m,A,f;if(super.attributeChangedCallback(e,t,r),e===y.NO_HOTKEYS)r!==t&&r===""?(this.hasAttribute(y.HOTKEYS)&&console.warn("Media Chrome: Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):r!==t&&r===null&&this.enableHotkeys();else if(e===y.HOTKEYS)M(this,ti).value=r;else if(e===y.DEFAULT_SUBTITLES&&r!==t)(o=M(this,V))==null||o.dispatch({type:"optionschangerequest",detail:{defaultSubtitles:this.hasAttribute(y.DEFAULT_SUBTITLES)}});else if(e===y.DEFAULT_STREAM_TYPE)(a=M(this,V))==null||a.dispatch({type:"optionschangerequest",detail:{defaultStreamType:(n=this.getAttribute(y.DEFAULT_STREAM_TYPE))!=null?n:void 0}});else if(e===y.LIVE_EDGE_OFFSET)(l=M(this,V))==null||l.dispatch({type:"optionschangerequest",detail:{liveEdgeOffset:this.hasAttribute(y.LIVE_EDGE_OFFSET)?+this.getAttribute(y.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(y.SEEK_TO_LIVE_OFFSET)?void 0:+this.getAttribute(y.LIVE_EDGE_OFFSET)}});else if(e===y.SEEK_TO_LIVE_OFFSET)(d=M(this,V))==null||d.dispatch({type:"optionschangerequest",detail:{seekToLiveOffset:this.hasAttribute(y.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(y.SEEK_TO_LIVE_OFFSET):void 0}});else if(e===y.NO_AUTO_SEEK_TO_LIVE)(v=M(this,V))==null||v.dispatch({type:"optionschangerequest",detail:{noAutoSeekToLive:this.hasAttribute(y.NO_AUTO_SEEK_TO_LIVE)}});else if(e===y.FULLSCREEN_ELEMENT){let L=r?(h=this.getRootNode())==null?void 0:h.getElementById(r):void 0;at(this,hn,L),(p=M(this,V))==null||p.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}else e===y.LANG&&r!==t?(nh(r),(E=M(this,V))==null||E.dispatch({type:"optionschangerequest",detail:{mediaLang:r}})):e===y.LOOP&&r!==t?(m=M(this,V))==null||m.dispatch({type:b.MEDIA_LOOP_REQUEST,detail:r!=null}):e===y.NO_VOLUME_PREF&&r!==t?(A=M(this,V))==null||A.dispatch({type:"optionschangerequest",detail:{noVolumePref:this.hasAttribute(y.NO_VOLUME_PREF)}}):e===y.NO_MUTED_PREF&&r!==t&&((f=M(this,V))==null||f.dispatch({type:"optionschangerequest",detail:{noMutedPref:this.hasAttribute(y.NO_MUTED_PREF)}}))}connectedCallback(){var e,t;!M(this,V)&&!this.hasAttribute(y.NO_DEFAULT_STORE)&<(this,Ja,Td).call(this),(e=M(this,V))==null||e.dispatch({type:"documentelementchangerequest",detail:ee}),super.connectedCallback(),M(this,V)&&!M(this,st)&&at(this,st,(t=M(this,V))==null?void 0:t.subscribe(M(this,pn))),M(this,mn)!==void 0&&M(this,V)&&this.media&&setTimeout(()=>{var r,o,n;(o=(r=this.media)==null?void 0:r.textTracks)!=null&&o.length&&((n=M(this,V))==null||n.dispatch({type:b.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:M(this,mn)}))},0),this.hasAttribute(y.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}disconnectedCallback(){var e,t,r,o,n;if((e=super.disconnectedCallback)==null||e.call(this),M(this,V)){let a=M(this,V).getState();at(this,mn,!!((t=a.mediaSubtitlesShowing)!=null&&t.length)),(r=M(this,V))==null||r.dispatch({type:"documentelementchangerequest",detail:void 0}),(o=M(this,V))==null||o.dispatch({type:b.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:!1})}M(this,st)&&((n=M(this,st))==null||n.call(this),at(this,st,void 0))}mediaSetCallback(e){var t;super.mediaSetCallback(e),(t=M(this,V))==null||t.dispatch({type:"mediaelementchangerequest",detail:e}),e.hasAttribute("tabindex")||(e.tabIndex=-1)}mediaUnsetCallback(e){var t;super.mediaUnsetCallback(e),(t=M(this,V))==null||t.dispatch({type:"mediaelementchangerequest",detail:void 0})}propagateMediaState(e,t){Hh(this.mediaStateReceivers,e,t)}associateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(t.has(e))return;let r=this.registerMediaStateReceiver.bind(this),o=this.unregisterMediaStateReceiver.bind(this),n=uf(e,r,o);Object.values(b).forEach(a=>{e.addEventListener(a,M(this,Xa))}),t.set(e,n)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(!t.has(e))return;t.get(e)(),t.delete(e),Object.values(b).forEach(o=>{e.removeEventListener(o,M(this,Xa))})}registerMediaStateReceiver(e){if(!e)return;let t=this.mediaStateReceivers;t.indexOf(e)>-1||(t.push(e),M(this,V)&&Object.entries(M(this,V).getState()).forEach(([o,n])=>{Hh([e],o,n)}))}unregisterMediaStateReceiver(e){let t=this.mediaStateReceivers,r=t.indexOf(e);r<0||t.splice(r,1)}enableHotkeys(){this.addEventListener("keydown",lt(this,ja,Ad))}disableHotkeys(){this.removeEventListener("keydown",lt(this,ja,Ad)),this.removeEventListener("keyup",lt(this,Fi,Rr))}get hotkeys(){return x(this,y.HOTKEYS)}set hotkeys(e){P(this,y.HOTKEYS,e)}keyboardShortcutHandler(e){var t,r,o,n,a,l,d,v,h;let p=e.target;if(((o=(r=(t=p.getAttribute(y.KEYS_USED))==null?void 0:t.split(" "))!=null?r:p==null?void 0:p.keysUsed)!=null?o:[]).map(D=>D==="Space"?" ":D).filter(Boolean).includes(e.key))return;let m,A,f;if(!(M(this,ti).contains(`no${e.key.toLowerCase()}`)||e.key===" "&&M(this,ti).contains("nospace")||e.shiftKey&&(e.key==="/"||e.key==="?")&&M(this,ti).contains("noshift+/")))switch(e.key){case" ":case"k":m=M(this,V).getState().mediaPaused?b.MEDIA_PLAY_REQUEST:b.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new c.CustomEvent(m,{composed:!0,bubbles:!0}));break;case"m":m=this.mediaStore.getState().mediaVolumeLevel==="off"?b.MEDIA_UNMUTE_REQUEST:b.MEDIA_MUTE_REQUEST,this.dispatchEvent(new c.CustomEvent(m,{composed:!0,bubbles:!0}));break;case"f":m=this.mediaStore.getState().mediaIsFullscreen?b.MEDIA_EXIT_FULLSCREEN_REQUEST:b.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new c.CustomEvent(m,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new c.CustomEvent(b.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}));break;case"ArrowLeft":case"j":{let D=this.hasAttribute(y.KEYBOARD_BACKWARD_SEEK_OFFSET)?+this.getAttribute(y.KEYBOARD_BACKWARD_SEEK_OFFSET):Ph;A=Math.max(((n=this.mediaStore.getState().mediaCurrentTime)!=null?n:0)-D,0),f=new c.CustomEvent(b.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(f);break}case"ArrowRight":case"l":{let D=this.hasAttribute(y.KEYBOARD_FORWARD_SEEK_OFFSET)?+this.getAttribute(y.KEYBOARD_FORWARD_SEEK_OFFSET):Ph;A=Math.max(((a=this.mediaStore.getState().mediaCurrentTime)!=null?a:0)+D,0),f=new c.CustomEvent(b.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(f);break}case"ArrowUp":{let D=this.hasAttribute(y.KEYBOARD_UP_VOLUME_STEP)?+this.getAttribute(y.KEYBOARD_UP_VOLUME_STEP):Dh;A=Math.min(((l=this.mediaStore.getState().mediaVolume)!=null?l:1)+D,1),f=new c.CustomEvent(b.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(f);break}case"ArrowDown":{let D=this.hasAttribute(y.KEYBOARD_DOWN_VOLUME_STEP)?+this.getAttribute(y.KEYBOARD_DOWN_VOLUME_STEP):Dh;A=Math.max(((d=this.mediaStore.getState().mediaVolume)!=null?d:1)-D,0),f=new c.CustomEvent(b.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(f);break}case"<":{let D=(v=this.mediaStore.getState().mediaPlaybackRate)!=null?v:1;A=Math.max(D-Oh,of).toFixed(2),f=new c.CustomEvent(b.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(f);break}case">":{let D=(h=this.mediaStore.getState().mediaPlaybackRate)!=null?h:1;A=Math.min(D+Oh,nf).toFixed(2),f=new c.CustomEvent(b.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(f);break}case"/":case"?":{e.shiftKey&<(this,Sd,$h).call(this);break}case"p":{m=this.mediaStore.getState().mediaIsPip?b.MEDIA_EXIT_PIP_REQUEST:b.MEDIA_ENTER_PIP_REQUEST,f=new c.CustomEvent(m,{composed:!0,bubbles:!0}),this.dispatchEvent(f);break}default:break}}};ti=new WeakMap;hn=new WeakMap;V=new WeakMap;Wi=new WeakMap;pn=new WeakMap;st=new WeakMap;Xa=new WeakMap;mn=new WeakMap;Ja=new WeakSet;Td=function(){var i;this.mediaStore=xh({media:this.media,fullscreenElement:this.fullscreenElement,options:{defaultSubtitles:this.hasAttribute(y.DEFAULT_SUBTITLES),defaultDuration:this.hasAttribute(y.DEFAULT_DURATION)?+this.getAttribute(y.DEFAULT_DURATION):void 0,defaultStreamType:(i=this.getAttribute(y.DEFAULT_STREAM_TYPE))!=null?i:void 0,liveEdgeOffset:this.hasAttribute(y.LIVE_EDGE_OFFSET)?+this.getAttribute(y.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(y.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(y.SEEK_TO_LIVE_OFFSET):this.hasAttribute(y.LIVE_EDGE_OFFSET)?+this.getAttribute(y.LIVE_EDGE_OFFSET):void 0,noAutoSeekToLive:this.hasAttribute(y.NO_AUTO_SEEK_TO_LIVE),noVolumePref:this.hasAttribute(y.NO_VOLUME_PREF),noMutedPref:this.hasAttribute(y.NO_MUTED_PREF),noSubtitlesLangPref:this.hasAttribute(y.NO_SUBTITLES_LANG_PREF)}})};Fi=new WeakSet;Rr=function(i){let{key:e,shiftKey:t}=i;if(!(t&&(e==="/"||e==="?")||Bh.includes(e))){this.removeEventListener("keyup",lt(this,Fi,Rr));return}this.keyboardShortcutHandler(i)};ja=new WeakSet;Ad=function(i){var e;let{metaKey:t,altKey:r,key:o,shiftKey:n}=i,a=n&&(o==="/"||o==="?");if(a&&((e=M(this,Wi))!=null&&e.open)){this.removeEventListener("keyup",lt(this,Fi,Rr));return}if(t||r||!a&&!Bh.includes(o)){this.removeEventListener("keyup",lt(this,Fi,Rr));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(o)&&!(M(this,ti).contains(`no${o.toLowerCase()}`)||o===" "&&M(this,ti).contains("nospace"))&&!d&&i.preventDefault(),this.addEventListener("keyup",lt(this,Fi,Rr),{once:!0})};Sd=new WeakSet;$h=function(){M(this,Wi)||(at(this,Wi,ee.createElement("media-keyboard-shortcuts-dialog")),this.appendChild(M(this,Wi))),M(this,Wi).open=!0};var af=Object.values(s),sf=Object.values(sd),Vh=i=>{var e,t,r,o;let{observedAttributes:n}=i.constructor;!n&&((e=i.nodeName)!=null&&e.includes("-"))&&(c.customElements.upgrade(i),{observedAttributes:n}=i.constructor);let a=(o=(r=(t=i==null?void 0:i.getAttribute)==null?void 0:t.call(i,N.MEDIA_CHROME_ATTRIBUTES))==null?void 0:r.split)==null?void 0:o.call(r,/\s+/);return Array.isArray(n||a)?(n||a).filter(l=>af.includes(l)):[]},lf=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),sf.some(r=>r in i)},Ld=i=>lf(i)||!!Vh(i).length,Nh=i=>{var e;return(e=i==null?void 0:i.join)==null?void 0:e.call(i,":")},Uh={[s.MEDIA_SUBTITLES_LIST]:Dt,[s.MEDIA_SUBTITLES_SHOWING]:Dt,[s.MEDIA_SEEKABLE]:Nh,[s.MEDIA_BUFFERED]:i=>i==null?void 0:i.map(Nh).join(" "),[s.MEDIA_PREVIEW_COORDS]:i=>i==null?void 0:i.join(" "),[s.MEDIA_RENDITION_LIST]:Ju,[s.MEDIA_AUDIO_TRACK_LIST]:eh},df=async(i,e,t)=>{var r,o;if(i.isConnected||await Ia(0),typeof t=="boolean"||t==null)return w(i,e,t);if(typeof t=="number")return B(i,e,t);if(typeof t=="string")return P(i,e,t);if(Array.isArray(t)&&!t.length)return i.removeAttribute(e);let n=(o=(r=Uh[e])==null?void 0:r.call(Uh,t))!=null?o:t;return i.setAttribute(e,n)},cf=i=>{var e;return!!((e=i.closest)!=null&&e.call(i,'*[slot="media"]'))},Vi=(i,e)=>{if(cf(i))return;let t=(o,n)=>{var a,l;Ld(o)&&n(o);let{children:d=[]}=o??{},v=(l=(a=o==null?void 0:o.shadowRoot)==null?void 0:a.children)!=null?l:[];[...d,...v].forEach(p=>Vi(p,n))},r=i==null?void 0:i.nodeName.toLowerCase();if(r.includes("-")&&!Ld(i)){c.customElements.whenDefined(r).then(()=>{t(i,e)});return}t(i,e)},Hh=(i,e,t)=>{i.forEach(r=>{if(e in r){r[e]=t;return}let o=Vh(r),n=e.toLowerCase();o.includes(n)&&df(r,n,t)})},uf=(i,e,t)=>{Vi(i,e);let r=h=>{var p;let E=(p=h==null?void 0:h.composedPath()[0])!=null?p:h.target;e(E)},o=h=>{var p;let E=(p=h==null?void 0:h.composedPath()[0])!=null?p:h.target;t(E)};i.addEventListener(b.REGISTER_MEDIA_STATE_RECEIVER,r),i.addEventListener(b.UNREGISTER_MEDIA_STATE_RECEIVER,o);let n=h=>{h.forEach(p=>{let{addedNodes:E=[],removedNodes:m=[],type:A,target:f,attributeName:L}=p;A==="childList"?(Array.prototype.forEach.call(E,D=>Vi(D,e)),Array.prototype.forEach.call(m,D=>Vi(D,t))):A==="attributes"&&L===N.MEDIA_CHROME_ATTRIBUTES&&(Ld(f)?e(f):t(f))})},a=[],l=h=>{let p=h.target;p.name!=="media"&&(a.forEach(E=>Vi(E,t)),a=[...p.assignedElements({flatten:!0})],a.forEach(E=>Vi(E,e)))};i.addEventListener("slotchange",l);let d=new MutationObserver(n);return d.observe(i,{childList:!0,attributes:!0,subtree:!0}),()=>{Vi(i,t),i.removeEventListener("slotchange",l),d.disconnect(),i.removeEventListener(b.REGISTER_MEDIA_STATE_RECEIVER,r),i.removeEventListener(b.UNREGISTER_MEDIA_STATE_RECEIVER,o)}};c.customElements.get("media-controller")||c.customElements.define("media-controller",kd);var xr={PLACEMENT:"placement",BOUNDS:"bounds"};function hf(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
|
|
503
|
+
`}var Pr=class extends c.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var e;if(!Oa(this,{checkOpacity:!1,checkVisibilityCSS:!1}))return;let t=this.placement;if(t==="left"||t==="right"){this.style.removeProperty("--media-tooltip-offset-x");return}let r=getComputedStyle(this),o=(e=nt(this,"#"+this.bounds))!=null?e:X(this);if(!o)return;let{x:n,width:a}=o.getBoundingClientRect(),{x:l,width:d}=this.getBoundingClientRect(),v=l+d,h=n+a,p=r.getPropertyValue("--media-tooltip-offset-x"),E=p?parseFloat(p.replace("px","")):0,m=r.getPropertyValue("--media-tooltip-container-margin"),A=m?parseFloat(m.replace("px","")):0,f=l-n+E-A,L=v-h+E+A;if(f<0){this.style.setProperty("--media-tooltip-offset-x",`${f}px`);return}if(L>0){this.style.setProperty("--media-tooltip-offset-x",`${L}px`);return}this.style.removeProperty("--media-tooltip-offset-x")},!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}if(this.arrowEl=this.shadowRoot.querySelector("#arrow"),Object.prototype.hasOwnProperty.call(this,"placement")){let e=this.placement;delete this.placement,this.placement=e}}static get observedAttributes(){return[xr.PLACEMENT,xr.BOUNDS]}get placement(){return x(this,xr.PLACEMENT)}set placement(e){P(this,xr.PLACEMENT,e)}get bounds(){return x(this,xr.BOUNDS)}set bounds(e){P(this,xr.BOUNDS,e)}};Pr.shadowRootOptions={mode:"open"};Pr.getTemplateHTML=hf;c.customElements.get("media-tooltip")||c.customElements.define("media-tooltip",Pr);var es=Pr;var wd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},he=(i,e,t)=>(wd(i,e,"read from private field"),t?t.call(i):e.get(i)),Dr=(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)},ts=(i,e,t,r)=>(wd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),pf=(i,e,t)=>(wd(i,e,"access private method"),t),dt,Nr,ri,Or,is,Id,Wh,ii={TOOLTIP_PLACEMENT:"tooltipplacement",DISABLED:"disabled",NO_TOOLTIP:"notooltip"};function mf(i,e={}){return`
|
|
504
504
|
<style>
|
|
505
505
|
:host {
|
|
506
506
|
position: relative;
|
|
@@ -574,20 +574,20 @@ bp-player[has-error] {
|
|
|
574
574
|
|
|
575
575
|
<slot name="tooltip">
|
|
576
576
|
<media-tooltip part="tooltip" aria-hidden="true">
|
|
577
|
-
<template shadowrootmode="${
|
|
578
|
-
${
|
|
577
|
+
<template shadowrootmode="${es.shadowRootOptions.mode}">
|
|
578
|
+
${es.getTemplateHTML({})}
|
|
579
579
|
</template>
|
|
580
580
|
<slot name="tooltip-content">
|
|
581
581
|
${this.getTooltipContentHTML(i)}
|
|
582
582
|
</slot>
|
|
583
583
|
</media-tooltip>
|
|
584
584
|
</slot>
|
|
585
|
-
`}function
|
|
585
|
+
`}function vf(i,e){return`
|
|
586
586
|
<slot></slot>
|
|
587
|
-
`}function
|
|
587
|
+
`}function ff(){return""}var F=class extends c.HTMLElement{constructor(){if(super(),Dr(this,Id),Dr(this,dt,void 0),this.preventClick=!1,this.tooltipEl=null,Dr(this,Nr,e=>{this.preventClick||this.handleClick(e),setTimeout(he(this,ri),0)}),Dr(this,ri,()=>{var e,t;(t=(e=this.tooltipEl)==null?void 0:e.updateXOffset)==null||t.call(e)}),Dr(this,Or,e=>{let{key:t}=e;if(!this.keysUsed.includes(t)){this.removeEventListener("keyup",he(this,Or));return}this.preventClick||this.handleClick(e)}),Dr(this,is,e=>{let{metaKey:t,altKey:r,key:o}=e;if(t||r||!this.keysUsed.includes(o)){this.removeEventListener("keyup",he(this,Or));return}this.addEventListener("keyup",he(this,Or),{once:!0})}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes),t=this.constructor.getTemplateHTML(e);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(t):this.shadowRoot.innerHTML=t}this.tooltipEl=this.shadowRoot.querySelector("media-tooltip")}static get observedAttributes(){return["disabled",ii.TOOLTIP_PLACEMENT,N.MEDIA_CONTROLLER,s.MEDIA_LANG]}enable(){this.addEventListener("click",he(this,Nr)),this.addEventListener("keydown",he(this,is)),this.tabIndex=0}disable(){this.removeEventListener("click",he(this,Nr)),this.removeEventListener("keydown",he(this,is)),this.removeEventListener("keyup",he(this,Or)),this.tabIndex=-1}attributeChangedCallback(e,t,r){var o,n,a,l,d;e===N.MEDIA_CONTROLLER?(t&&((n=(o=he(this,dt))==null?void 0:o.unassociateElement)==null||n.call(o,this),ts(this,dt,null)),r&&this.isConnected&&(ts(this,dt,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(d=(l=he(this,dt))==null?void 0:l.associateElement)==null||d.call(l,this))):e==="disabled"&&r!==t?r==null?this.enable():this.disable():e===ii.TOOLTIP_PLACEMENT&&this.tooltipEl&&r!==t?this.tooltipEl.placement=r:e===s.MEDIA_LANG&&(this.shadowRoot.querySelector('slot[name="tooltip-content"]').innerHTML=this.constructor.getTooltipContentHTML()),he(this,ri).call(this)}connectedCallback(){var e,t,r;let{style:o}=J(this.shadowRoot,":host");o.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),this.hasAttribute("disabled")?this.disable():this.enable(),this.setAttribute("role","button");let n=this.getAttribute(N.MEDIA_CONTROLLER);n&&(ts(this,dt,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(r=(t=he(this,dt))==null?void 0:t.associateElement)==null||r.call(t,this)),c.customElements.whenDefined("media-tooltip").then(()=>pf(this,Id,Wh).call(this))}disconnectedCallback(){var e,t;this.disable(),(t=(e=he(this,dt))==null?void 0:e.unassociateElement)==null||t.call(e,this),ts(this,dt,null),this.removeEventListener("mouseenter",he(this,ri)),this.removeEventListener("focus",he(this,ri)),this.removeEventListener("click",he(this,Nr))}get keysUsed(){return["Enter"," "]}get tooltipPlacement(){return x(this,ii.TOOLTIP_PLACEMENT)}set tooltipPlacement(e){P(this,ii.TOOLTIP_PLACEMENT,e)}get mediaController(){return x(this,N.MEDIA_CONTROLLER)}set mediaController(e){P(this,N.MEDIA_CONTROLLER,e)}get disabled(){return I(this,ii.DISABLED)}set disabled(e){w(this,ii.DISABLED,e)}get noTooltip(){return I(this,ii.NO_TOOLTIP)}set noTooltip(e){w(this,ii.NO_TOOLTIP,e)}handleClick(e){}};dt=new WeakMap;Nr=new WeakMap;ri=new WeakMap;Or=new WeakMap;is=new WeakMap;Id=new WeakSet;Wh=function(){this.addEventListener("mouseenter",he(this,ri)),this.addEventListener("focus",he(this,ri)),this.addEventListener("click",he(this,Nr));let i=this.tooltipPlacement;i&&this.tooltipEl&&(this.tooltipEl.placement=i)};F.shadowRootOptions={mode:"open"};F.getTemplateHTML=mf;F.getSlotTemplateHTML=vf;F.getTooltipContentHTML=ff;c.customElements.get("media-chrome-button")||c.customElements.define("media-chrome-button",F);var Fh=`<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
|
-
`;function
|
|
590
|
+
`;function Ef(i){return`
|
|
591
591
|
<style>
|
|
592
592
|
:host([${s.MEDIA_IS_AIRPLAYING}]) slot[name=icon] slot:not([name=exit]) {
|
|
593
593
|
display: none !important;
|
|
@@ -605,17 +605,17 @@ bp-player[has-error] {
|
|
|
605
605
|
</style>
|
|
606
606
|
|
|
607
607
|
<slot name="icon">
|
|
608
|
-
<slot name="enter">${
|
|
609
|
-
<slot name="exit">${
|
|
608
|
+
<slot name="enter">${Fh}</slot>
|
|
609
|
+
<slot name="exit">${Fh}</slot>
|
|
610
610
|
</slot>
|
|
611
|
-
`}function
|
|
612
|
-
<slot name="tooltip-enter">${
|
|
613
|
-
<slot name="tooltip-exit">${
|
|
614
|
-
`}var
|
|
611
|
+
`}function gf(){return`
|
|
612
|
+
<slot name="tooltip-enter">${g("start airplay")}</slot>
|
|
613
|
+
<slot name="tooltip-exit">${g("stop airplay")}</slot>
|
|
614
|
+
`}var Kh=i=>{let e=i.mediaIsAirplaying?g("stop airplay"):g("start airplay");i.setAttribute("aria-label",e)},vn=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_IS_AIRPLAYING,s.MEDIA_AIRPLAY_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Kh(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_IS_AIRPLAYING&&Kh(this)}get mediaIsAirplaying(){return I(this,s.MEDIA_IS_AIRPLAYING)}set mediaIsAirplaying(e){w(this,s.MEDIA_IS_AIRPLAYING,e)}get mediaAirplayUnavailable(){return x(this,s.MEDIA_AIRPLAY_UNAVAILABLE)}set mediaAirplayUnavailable(e){P(this,s.MEDIA_AIRPLAY_UNAVAILABLE,e)}handleClick(){let e=new c.CustomEvent(b.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}};vn.getSlotTemplateHTML=Ef;vn.getTooltipContentHTML=gf;c.customElements.get("media-airplay-button")||c.customElements.define("media-airplay-button",vn);var bf=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
615
615
|
<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"/>
|
|
616
|
-
</svg>`,
|
|
616
|
+
</svg>`,_f=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
617
617
|
<path d="M17.73 14.09a1.4 1.4 0 0 1-1 .37 1.579 1.579 0 0 1-1.27-.58A3 3 0 0 1 15 12a2.8 2.8 0 0 1 .5-1.85 1.63 1.63 0 0 1 1.29-.57 1.47 1.47 0 0 1 1.51 1.2l1.43-.34A2.89 2.89 0 0 0 19 9.07a3 3 0 0 0-2.14-.78 3.14 3.14 0 0 0-2.42 1 3.91 3.91 0 0 0-.93 2.78 3.74 3.74 0 0 0 .92 2.66 3.07 3.07 0 0 0 2.34 1 3.07 3.07 0 0 0 1.91-.57 3.17 3.17 0 0 0 1.07-1.74l-1.4-.45c-.083.43-.3.822-.62 1.12Zm-7.22 0a1.43 1.43 0 0 1-1 .37 1.58 1.58 0 0 1-1.27-.58A3 3 0 0 1 7.76 12a2.8 2.8 0 0 1 .5-1.85 1.63 1.63 0 0 1 1.29-.57 1.47 1.47 0 0 1 1.51 1.2l1.43-.34a2.81 2.81 0 0 0-.74-1.32 2.94 2.94 0 0 0-2.13-.78 3.18 3.18 0 0 0-2.43 1 4 4 0 0 0-.92 2.78 3.74 3.74 0 0 0 .92 2.66 3.07 3.07 0 0 0 2.34 1 3.07 3.07 0 0 0 1.91-.57 3.23 3.23 0 0 0 1.07-1.74l-1.4-.45a2.06 2.06 0 0 1-.6 1.07Zm12.32-8.41a2.59 2.59 0 0 0-2.3-2.51C18.72 3.05 15.86 3 13 3c-2.86 0-5.72.05-7.53.17a2.59 2.59 0 0 0-2.3 2.51c-.23 4.207-.23 8.423 0 12.63a2.57 2.57 0 0 0 2.3 2.5c1.81.13 4.67.19 7.53.19 2.86 0 5.72-.06 7.53-.19a2.57 2.57 0 0 0 2.3-2.5c.23-4.207.23-8.423 0-12.63Zm-1.49 12.53a1.11 1.11 0 0 1-.91 1.11c-1.67.11-4.45.18-7.43.18-2.98 0-5.76-.07-7.43-.18a1.11 1.11 0 0 1-.91-1.11c-.21-4.14-.21-8.29 0-12.43a1.11 1.11 0 0 1 .91-1.11C7.24 4.56 10 4.49 13 4.49s5.76.07 7.43.18a1.11 1.11 0 0 1 .91 1.11c.21 4.14.21 8.29 0 12.43Z"/>
|
|
618
|
-
</svg>`;function
|
|
618
|
+
</svg>`;function yf(i){return`
|
|
619
619
|
<style>
|
|
620
620
|
:host([aria-checked="true"]) slot[name=off] {
|
|
621
621
|
display: none !important;
|
|
@@ -633,13 +633,13 @@ bp-player[has-error] {
|
|
|
633
633
|
</style>
|
|
634
634
|
|
|
635
635
|
<slot name="icon">
|
|
636
|
-
<slot name="on">${
|
|
637
|
-
<slot name="off">${
|
|
636
|
+
<slot name="on">${bf}</slot>
|
|
637
|
+
<slot name="off">${_f}</slot>
|
|
638
638
|
</slot>
|
|
639
|
-
`}function
|
|
640
|
-
<slot name="tooltip-enable">${
|
|
641
|
-
<slot name="tooltip-disable">${
|
|
642
|
-
`}var
|
|
639
|
+
`}function Tf(){return`
|
|
640
|
+
<slot name="tooltip-enable">${g("Enable captions")}</slot>
|
|
641
|
+
<slot name="tooltip-disable">${g("Disable captions")}</slot>
|
|
642
|
+
`}var Gh=i=>{i.setAttribute("aria-checked",qa(i).toString())},fn=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_SUBTITLES_LIST,s.MEDIA_SUBTITLES_SHOWING]}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",g("closed captions")),Gh(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_SUBTITLES_SHOWING&&Gh(this)}get mediaSubtitlesList(){return qh(this,s.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){zh(this,s.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return qh(this,s.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){zh(this,s.MEDIA_SUBTITLES_SHOWING,e)}handleClick(){this.dispatchEvent(new c.CustomEvent(b.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}))}};fn.getSlotTemplateHTML=yf;fn.getTooltipContentHTML=Tf;var qh=(i,e)=>{let t=i.getAttribute(e);return t?Hi(t):[]},zh=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let r=Dt(t);i.getAttribute(e)!==r&&i.setAttribute(e,r)};c.customElements.get("media-captions-button")||c.customElements.define("media-captions-button",fn);var Af='<svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/></g></svg>',Sf='<svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/><path class="cast_caf_icon_boxfill" d="M5,7 L5,8.63 C8,8.6 13.37,14 13.37,17 L19,17 L19,7 Z"/></g></svg>';function kf(i){return`
|
|
643
643
|
<style>
|
|
644
644
|
:host([${s.MEDIA_IS_CASTING}]) slot[name=icon] slot:not([name=exit]) {
|
|
645
645
|
display: none !important;
|
|
@@ -657,13 +657,13 @@ bp-player[has-error] {
|
|
|
657
657
|
</style>
|
|
658
658
|
|
|
659
659
|
<slot name="icon">
|
|
660
|
-
<slot name="enter">${
|
|
661
|
-
<slot name="exit">${
|
|
660
|
+
<slot name="enter">${Af}</slot>
|
|
661
|
+
<slot name="exit">${Sf}</slot>
|
|
662
662
|
</slot>
|
|
663
|
-
`}function
|
|
664
|
-
<slot name="tooltip-enter">${
|
|
665
|
-
<slot name="tooltip-exit">${
|
|
666
|
-
`}var
|
|
663
|
+
`}function Lf(){return`
|
|
664
|
+
<slot name="tooltip-enter">${g("Start casting")}</slot>
|
|
665
|
+
<slot name="tooltip-exit">${g("Stop casting")}</slot>
|
|
666
|
+
`}var Yh=i=>{let e=i.mediaIsCasting?g("stop casting"):g("start casting");i.setAttribute("aria-label",e)},En=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_IS_CASTING,s.MEDIA_CAST_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Yh(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_IS_CASTING&&Yh(this)}get mediaIsCasting(){return I(this,s.MEDIA_IS_CASTING)}set mediaIsCasting(e){w(this,s.MEDIA_IS_CASTING,e)}get mediaCastUnavailable(){return x(this,s.MEDIA_CAST_UNAVAILABLE)}set mediaCastUnavailable(e){P(this,s.MEDIA_CAST_UNAVAILABLE,e)}handleClick(){let e=this.mediaIsCasting?b.MEDIA_EXIT_CAST_REQUEST:b.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new c.CustomEvent(e,{composed:!0,bubbles:!0}))}};En.getSlotTemplateHTML=kf;En.getTooltipContentHTML=Lf;c.customElements.get("media-cast-button")||c.customElements.define("media-cast-button",En);var Nd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Gi=(i,e,t)=>(Nd(i,e,"read from private field"),t?t.call(i):e.get(i)),Ot=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ud=(i,e,t,r)=>(Nd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ki=(i,e,t)=>(Nd(i,e,"access private method"),t),os,bn,qi,rs,Md,Rd,Qh,xd,Zh,Pd,Xh,Dd,Jh,Od,jh;function Cf(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 If(i){return`
|
|
708
708
|
<slot id="content"></slot>
|
|
709
|
-
`}var
|
|
709
|
+
`}var gn={OPEN:"open",ANCHOR:"anchor"},ct=class extends c.HTMLElement{constructor(){super(),Ot(this,rs),Ot(this,Rd),Ot(this,xd),Ot(this,Pd),Ot(this,Dd),Ot(this,Od),Ot(this,os,!1),Ot(this,bn,null),Ot(this,qi,null),this.addEventListener("invoke",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this)}static get observedAttributes(){return[gn.OPEN,gn.ANCHOR]}get open(){return I(this,gn.OPEN)}set open(e){w(this,gn.OPEN,e)}handleEvent(e){switch(e.type){case"invoke":Ki(this,Pd,Xh).call(this,e);break;case"focusout":Ki(this,Dd,Jh).call(this,e);break;case"keydown":Ki(this,Od,jh).call(this,e);break}}connectedCallback(){Ki(this,rs,Md).call(this),this.role||(this.role="dialog")}attributeChangedCallback(e,t,r){Ki(this,rs,Md).call(this),e===gn.OPEN&&r!==t&&(this.open?Ki(this,Rd,Qh).call(this):Ki(this,xd,Zh).call(this))}focus(){Ud(this,bn,on());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"]}};os=new WeakMap;bn=new WeakMap;qi=new WeakMap;rs=new WeakSet;Md=function(){if(!Gi(this,os)&&(Ud(this,os,!0),!this.shadowRoot)){this.attachShadow(this.constructor.shadowRootOptions);let i=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(i),queueMicrotask(()=>{let{style:e}=J(this.shadowRoot,":host");e.setProperty("transition","display .15s, visibility .15s, opacity .15s ease-in, transform .15s ease-in")})}};Rd=new WeakSet;Qh=function(){var i;(i=Gi(this,qi))==null||i.setAttribute("aria-expanded","true"),this.dispatchEvent(new Event("open",{composed:!0,bubbles:!0})),this.addEventListener("transitionend",()=>this.focus(),{once:!0})};xd=new WeakSet;Zh=function(){var i;(i=Gi(this,qi))==null||i.setAttribute("aria-expanded","false"),this.dispatchEvent(new Event("close",{composed:!0,bubbles:!0}))};Pd=new WeakSet;Xh=function(i){Ud(this,qi,i.relatedTarget),Ae(this,i.relatedTarget)||(this.open=!this.open)};Dd=new WeakSet;Jh=function(i){var e;Ae(this,i.relatedTarget)||((e=Gi(this,bn))==null||e.focus(),Gi(this,qi)&&Gi(this,qi)!==i.relatedTarget&&this.open&&(this.open=!1))};Od=new WeakSet;jh=function(i){var e,t,r,o,n;let{key:a,ctrlKey:l,altKey:d,metaKey:v}=i;l||d||v||this.keysUsed.includes(a)&&(i.preventDefault(),i.stopPropagation(),a==="Tab"?(i.shiftKey?(t=(e=this.previousElementSibling)==null?void 0:e.focus)==null||t.call(e):(o=(r=this.nextElementSibling)==null?void 0:r.focus)==null||o.call(r),this.blur()):a==="Escape"&&((n=Gi(this,bn))==null||n.focus(),this.open=!1))};ct.shadowRootOptions={mode:"open"};ct.getTemplateHTML=Cf;ct.getSlotTemplateHTML=If;c.customElements.get("media-chrome-dialog")||c.customElements.define("media-chrome-dialog",ct);var Kd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ne=(i,e,t)=>(Kd(i,e,"read from private field"),t?t.call(i):e.get(i)),_e=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},oi=(i,e,t,r)=>(Kd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),je=(i,e,t)=>(Kd(i,e,"access private method"),t),ut,ms,ns,as,et,hs,ss,ls,ds,Gd,ep,cs,Hd,us,$d,ps,qd,Bd,tp,Vd,ip,Wd,rp,Fd,op;function wf(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
|
|
939
|
+
`}function Mf(i){return""}var ht=class extends c.HTMLElement{constructor(){if(super(),_e(this,Gd),_e(this,cs),_e(this,us),_e(this,ps),_e(this,Bd),_e(this,Vd),_e(this,Wd),_e(this,Fd),_e(this,ut,void 0),_e(this,ms,void 0),_e(this,ns,void 0),_e(this,as,void 0),_e(this,et,{}),_e(this,hs,[]),_e(this,ss,()=>{if(this.range.matches(":focus-visible")){let{style:e}=J(this.shadowRoot,":host");e.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),_e(this,ls,()=>{let{style:e}=J(this.shadowRoot,":host");e.removeProperty("--_focus-visible-box-shadow")}),_e(this,ds,()=>{let e=this.shadowRoot.querySelector("#segments-clipping");e&&e.parentNode.append(e)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes),t=this.constructor.getTemplateHTML(e);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(t):this.shadowRoot.innerHTML=t}this.container=this.shadowRoot.querySelector("#container"),oi(this,ns,this.shadowRoot.querySelector("#startpoint")),oi(this,as,this.shadowRoot.querySelector("#endpoint")),this.range=this.shadowRoot.querySelector("#range"),this.appearance=this.shadowRoot.querySelector("#appearance")}static get observedAttributes(){return["disabled","aria-disabled",N.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,r){var o,n,a,l,d;e===N.MEDIA_CONTROLLER?(t&&((n=(o=ne(this,ut))==null?void 0:o.unassociateElement)==null||n.call(o,this),oi(this,ut,null)),r&&this.isConnected&&(oi(this,ut,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(d=(l=ne(this,ut))==null?void 0:l.associateElement)==null||d.call(l,this))):(e==="disabled"||e==="aria-disabled"&&t!==r)&&(r==null?(this.range.removeAttribute(e),je(this,cs,Hd).call(this)):(this.range.setAttribute(e,r),je(this,us,$d).call(this)))}connectedCallback(){var e,t,r;let{style:o}=J(this.shadowRoot,":host");o.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),ne(this,et).pointer=J(this.shadowRoot,"#pointer"),ne(this,et).progress=J(this.shadowRoot,"#progress"),ne(this,et).thumb=J(this.shadowRoot,'#thumb, ::slotted([slot="thumb"])'),ne(this,et).activeSegment=J(this.shadowRoot,"#segments-clipping rect:nth-child(0)");let n=this.getAttribute(N.MEDIA_CONTROLLER);n&&(oi(this,ut,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(r=(t=ne(this,ut))==null?void 0:t.associateElement)==null||r.call(t,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",ne(this,ss)),this.shadowRoot.addEventListener("focusout",ne(this,ls)),je(this,cs,Hd).call(this),Rt(this.container,ne(this,ds))}disconnectedCallback(){var e,t;je(this,us,$d).call(this),(t=(e=ne(this,ut))==null?void 0:e.unassociateElement)==null||t.call(e,this),oi(this,ut,null),this.shadowRoot.removeEventListener("focusin",ne(this,ss)),this.shadowRoot.removeEventListener("focusout",ne(this,ls)),xt(this.container,ne(this,ds))}updatePointerBar(e){var t;(t=ne(this,et).pointer)==null||t.style.setProperty("width",`${this.getPointerRatio(e)*100}%`)}updateBar(){var e,t;let r=this.range.valueAsNumber*100;(e=ne(this,et).progress)==null||e.style.setProperty("width",`${r}%`),(t=ne(this,et).thumb)==null||t.style.setProperty("left",`${r}%`)}updateSegments(e){let t=this.shadowRoot.querySelector("#segments-clipping");if(t.textContent="",this.container.classList.toggle("segments",!!(e!=null&&e.length)),!(e!=null&&e.length))return;let r=[...new Set([+this.range.min,...e.flatMap(n=>[n.start,n.end]),+this.range.max])];oi(this,hs,[...r]);let o=r.pop();for(let[n,a]of r.entries()){let[l,d]=[n===0,n===r.length-1],v=l?"calc(var(--segments-gap) / -1)":`${a*100}%`,p=`calc(${((d?o:r[n+1])-a)*100}%${l||d?"":" - var(--segments-gap)"})`,E=ee.createElementNS("http://www.w3.org/2000/svg","rect"),m=nn(this.shadowRoot,`#segments-clipping rect:nth-child(${n+1})`);m.style.setProperty("x",v),m.style.setProperty("width",p),t.append(E)}}getPointerRatio(e){return uh(e.clientX,e.clientY,ne(this,ns).getBoundingClientRect(),ne(this,as).getBoundingClientRect())}get dragging(){return this.hasAttribute("dragging")}handleEvent(e){switch(e.type){case"pointermove":je(this,Fd,op).call(this,e);break;case"input":this.updateBar();break;case"pointerenter":je(this,Bd,tp).call(this,e);break;case"pointerdown":je(this,ps,qd).call(this,e);break;case"pointerup":je(this,Vd,ip).call(this);break;case"pointerleave":je(this,Wd,rp).call(this);break}}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};ut=new WeakMap;ms=new WeakMap;ns=new WeakMap;as=new WeakMap;et=new WeakMap;hs=new WeakMap;ss=new WeakMap;ls=new WeakMap;ds=new WeakMap;Gd=new WeakSet;ep=function(i){let e=ne(this,et).activeSegment;if(!e)return;let t=this.getPointerRatio(i),o=`#segments-clipping rect:nth-child(${ne(this,hs).findIndex((n,a,l)=>{let d=l[a+1];return d!=null&&t>=n&&t<=d})+1})`;(e.selectorText!=o||!e.style.transform)&&(e.selectorText=o,e.style.setProperty("transform","var(--media-range-segment-hover-transform, scaleY(2))"))};cs=new WeakSet;Hd=function(){this.hasAttribute("disabled")||(this.addEventListener("input",this),this.addEventListener("pointerdown",this),this.addEventListener("pointerenter",this))};us=new WeakSet;$d=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)};ps=new WeakSet;qd=function(i){var e;oi(this,ms,i.composedPath().includes(this.range)),(e=c.window)==null||e.addEventListener("pointerup",this)};Bd=new WeakSet;tp=function(i){var e;i.pointerType!=="mouse"&&je(this,ps,qd).call(this,i),this.addEventListener("pointerleave",this),(e=c.window)==null||e.addEventListener("pointermove",this)};Vd=new WeakSet;ip=function(){var i;(i=c.window)==null||i.removeEventListener("pointerup",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled")};Wd=new WeakSet;rp=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=ne(this,et).activeSegment)==null||e.style.removeProperty("transform")};Fd=new WeakSet;op=function(i){i.pointerType==="pen"&&i.buttons===0||(this.toggleAttribute("dragging",i.buttons===1||i.pointerType!=="mouse"),this.updatePointerBar(i),je(this,Gd,ep).call(this,i),this.dragging&&(i.pointerType!=="mouse"||!ne(this,ms))&&(this.range.disabled=!0,this.range.valueAsNumber=this.getPointerRatio(i),this.range.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))))};ht.shadowRootOptions={mode:"open"};ht.getTemplateHTML=wf;ht.getContainerTemplateHTML=Mf;c.customElements.get("media-chrome-range")||c.customElements.define("media-chrome-range",ht);var np=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},vs=(i,e,t)=>(np(i,e,"read from private field"),t?t.call(i):e.get(i)),Rf=(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)},fs=(i,e,t,r)=>(np(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),pt;function xf(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 _n=class extends c.HTMLElement{constructor(){if(super(),Rf(this,pt,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[N.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,r){var o,n,a,l,d;e===N.MEDIA_CONTROLLER&&(t&&((n=(o=vs(this,pt))==null?void 0:o.unassociateElement)==null||n.call(o,this),fs(this,pt,null)),r&&this.isConnected&&(fs(this,pt,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(d=(l=vs(this,pt))==null?void 0:l.associateElement)==null||d.call(l,this)))}connectedCallback(){var e,t,r;let o=this.getAttribute(N.MEDIA_CONTROLLER);o&&(fs(this,pt,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=vs(this,pt))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=vs(this,pt))==null?void 0:e.unassociateElement)==null||t.call(e,this),fs(this,pt,null)}};pt=new WeakMap;_n.shadowRootOptions={mode:"open"};_n.getTemplateHTML=xf;c.customElements.get("media-control-bar")||c.customElements.define("media-control-bar",_n);var ap=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Es=(i,e,t)=>(ap(i,e,"read from private field"),t?t.call(i):e.get(i)),Pf=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},gs=(i,e,t,r)=>(ap(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),mt;function Df(i,e={}){return`
|
|
966
966
|
<style>
|
|
967
967
|
:host {
|
|
968
968
|
font: var(--media-font,
|
|
@@ -996,11 +996,11 @@ bp-player[has-error] {
|
|
|
996
996
|
</style>
|
|
997
997
|
|
|
998
998
|
${this.getSlotTemplateHTML(i,e)}
|
|
999
|
-
`}function
|
|
999
|
+
`}function Of(i,e){return`
|
|
1000
1000
|
<slot></slot>
|
|
1001
|
-
`}var
|
|
1002
|
-
<slot>${
|
|
1003
|
-
`}var
|
|
1001
|
+
`}var xe=class extends c.HTMLElement{constructor(){if(super(),Pf(this,mt,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[N.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,r){var o,n,a,l,d;e===N.MEDIA_CONTROLLER&&(t&&((n=(o=Es(this,mt))==null?void 0:o.unassociateElement)==null||n.call(o,this),gs(this,mt,null)),r&&this.isConnected&&(gs(this,mt,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(d=(l=Es(this,mt))==null?void 0:l.associateElement)==null||d.call(l,this)))}connectedCallback(){var e,t,r;let{style:o}=J(this.shadowRoot,":host");o.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`);let n=this.getAttribute(N.MEDIA_CONTROLLER);n&&(gs(this,mt,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(r=(t=Es(this,mt))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Es(this,mt))==null?void 0:e.unassociateElement)==null||t.call(e,this),gs(this,mt,null)}};mt=new WeakMap;xe.shadowRootOptions={mode:"open"};xe.getTemplateHTML=Df;xe.getSlotTemplateHTML=Of;c.customElements.get("media-text-display")||c.customElements.define("media-text-display",xe);var lp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},sp=(i,e,t)=>(lp(i,e,"read from private field"),t?t.call(i):e.get(i)),Nf=(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)},Uf=(i,e,t,r)=>(lp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),yn;function Hf(i,e){return`
|
|
1002
|
+
<slot>${Je(e.mediaDuration)}</slot>
|
|
1003
|
+
`}var bs=class extends xe{constructor(){var e;super(),Nf(this,yn,void 0),Uf(this,yn,this.shadowRoot.querySelector("slot")),sp(this,yn).textContent=Je((e=this.mediaDuration)!=null?e:0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_DURATION]}attributeChangedCallback(e,t,r){e===s.MEDIA_DURATION&&(sp(this,yn).textContent=Je(+r)),super.attributeChangedCallback(e,t,r)}get mediaDuration(){return H(this,s.MEDIA_DURATION)}set mediaDuration(e){B(this,s.MEDIA_DURATION,e)}};yn=new WeakMap;bs.getSlotTemplateHTML=Hf;c.customElements.get("media-duration-display")||c.customElements.define("media-duration-display",bs);var $f={2:g("Network Error"),3:g("Decode Error"),4:g("Source Not Supported"),5:g("Encryption Error")},Bf={2:g("A network error caused the media download to fail."),3:g("A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format."),4:g("An unsupported error occurred. The server or network failed, or your browser does not support this format."),5:g("The media is encrypted and there are no keys to decrypt it.")},zd=i=>{var e,t;return i.code===1?null:{title:(e=$f[i.code])!=null?e:`Error ${i.code}`,message:(t=Bf[i.code])!=null?t:i.message}};var cp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Vf=(i,e,t)=>(cp(i,e,"read from private field"),t?t.call(i):e.get(i)),Wf=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ff=(i,e,t,r)=>(cp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),_s;function Kf(i){return`
|
|
1004
1004
|
<style>
|
|
1005
1005
|
:host {
|
|
1006
1006
|
background: rgb(20 20 30 / .8);
|
|
@@ -1017,9 +1017,9 @@ bp-player[has-error] {
|
|
|
1017
1017
|
}
|
|
1018
1018
|
</style>
|
|
1019
1019
|
<slot name="error-${i.mediaerrorcode}" id="content">
|
|
1020
|
-
${
|
|
1020
|
+
${up({code:+i.mediaerrorcode,message:i.mediaerrormessage})}
|
|
1021
1021
|
</slot>
|
|
1022
|
-
`}function
|
|
1022
|
+
`}function Gf(i){return i.code&&zd(i)!==null}function up(i){var e;let{title:t,message:r}=(e=zd(i))!=null?e:{},o="";return t&&(o+=`<slot name="error-${i.code}-title"><h3>${t}</h3></slot>`),r&&(o+=`<slot name="error-${i.code}-message"><p>${r}</p></slot>`),o}var dp=[s.MEDIA_ERROR_CODE,s.MEDIA_ERROR_MESSAGE],Tn=class extends ct{constructor(){super(...arguments),Wf(this,_s,null)}static get observedAttributes(){return[...super.observedAttributes,...dp]}formatErrorMessage(e){return this.constructor.formatErrorMessage(e)}attributeChangedCallback(e,t,r){var o;if(super.attributeChangedCallback(e,t,r),!dp.includes(e))return;let n=(o=this.mediaError)!=null?o:{code:this.mediaErrorCode,message:this.mediaErrorMessage};this.open=Gf(n),this.open&&(this.shadowRoot.querySelector("slot").name=`error-${this.mediaErrorCode}`,this.shadowRoot.querySelector("#content").innerHTML=this.formatErrorMessage(n))}get mediaError(){return Vf(this,_s)}set mediaError(e){Ff(this,_s,e)}get mediaErrorCode(){return H(this,"mediaerrorcode")}set mediaErrorCode(e){B(this,"mediaerrorcode",e)}get mediaErrorMessage(){return x(this,"mediaerrormessage")}set mediaErrorMessage(e){P(this,"mediaerrormessage",e)}};_s=new WeakMap;Tn.getSlotTemplateHTML=Kf;Tn.formatErrorMessage=up;c.customElements.get("media-error-dialog")||c.customElements.define("media-error-dialog",Tn);var qf=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ni=(i,e,t)=>(qf(i,e,"read from private field"),t?t.call(i):e.get(i)),hp=(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)},Ur,Hr;function zf(i){return`
|
|
1023
1023
|
<style>
|
|
1024
1024
|
:host {
|
|
1025
1025
|
position: fixed;
|
|
@@ -1104,9 +1104,9 @@ bp-player[has-error] {
|
|
|
1104
1104
|
}
|
|
1105
1105
|
</style>
|
|
1106
1106
|
<slot id="content">
|
|
1107
|
-
${
|
|
1107
|
+
${Yf()}
|
|
1108
1108
|
</slot>
|
|
1109
|
-
`}function
|
|
1109
|
+
`}function Yf(){return`
|
|
1110
1110
|
<h2>Keyboard Shortcuts</h2>
|
|
1111
1111
|
<table class="shortcuts-table">${[{keys:["Space","k"],description:"Toggle Playback"},{keys:["m"],description:"Toggle mute"},{keys:["f"],description:"Toggle fullscreen"},{keys:["c"],description:"Toggle captions or subtitles, if available"},{keys:["p"],description:"Toggle Picture in Picture"},{keys:["\u2190","j"],description:"Seek back 10s"},{keys:["\u2192","l"],description:"Seek forward 10s"},{keys:["\u2191"],description:"Turn volume up"},{keys:["\u2193"],description:"Turn volume down"},{keys:["< (SHIFT+,)"],description:"Decrease playback rate"},{keys:["> (SHIFT+.)"],description:"Increase playback rate"}].map(({keys:t,description:r})=>`
|
|
1112
1112
|
<tr>
|
|
@@ -1116,11 +1116,11 @@ bp-player[has-error] {
|
|
|
1116
1116
|
<td class="description">${r}</td>
|
|
1117
1117
|
</tr>
|
|
1118
1118
|
`).join("")}</table>
|
|
1119
|
-
`}var
|
|
1119
|
+
`}var ys=class extends ct{constructor(){super(...arguments),hp(this,Ur,e=>{var t;if(!this.open)return;let r=(t=this.shadowRoot)==null?void 0:t.querySelector("#content");if(!r)return;let o=e.composedPath(),n=o[0]===this||o.includes(this),a=o.includes(r);n&&!a&&(this.open=!1)}),hp(this,Hr,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",ni(this,Ur)),document.addEventListener("keydown",ni(this,Hr)))}disconnectedCallback(){this.removeEventListener("click",ni(this,Ur)),document.removeEventListener("keydown",ni(this,Hr))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e==="open"&&(this.open?(this.addEventListener("click",ni(this,Ur)),document.addEventListener("keydown",ni(this,Hr))):(this.removeEventListener("click",ni(this,Ur)),document.removeEventListener("keydown",ni(this,Hr))))}};Ur=new WeakMap;Hr=new WeakMap;ys.getSlotTemplateHTML=zf;c.customElements.get("media-keyboard-shortcuts-dialog")||c.customElements.define("media-keyboard-shortcuts-dialog",ys);var mp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Qf=(i,e,t)=>(mp(i,e,"read from private field"),t?t.call(i):e.get(i)),Zf=(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)},Xf=(i,e,t,r)=>(mp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ts,Jf=`<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
|
-
</svg>`,
|
|
1121
|
+
</svg>`,jf=`<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"/>
|
|
1123
|
-
</svg>`;function
|
|
1123
|
+
</svg>`;function eE(i){return`
|
|
1124
1124
|
<style>
|
|
1125
1125
|
:host([${s.MEDIA_IS_FULLSCREEN}]) slot[name=icon] slot:not([name=exit]) {
|
|
1126
1126
|
display: none !important;
|
|
@@ -1138,13 +1138,13 @@ bp-player[has-error] {
|
|
|
1138
1138
|
</style>
|
|
1139
1139
|
|
|
1140
1140
|
<slot name="icon">
|
|
1141
|
-
<slot name="enter">${
|
|
1142
|
-
<slot name="exit">${
|
|
1141
|
+
<slot name="enter">${Jf}</slot>
|
|
1142
|
+
<slot name="exit">${jf}</slot>
|
|
1143
1143
|
</slot>
|
|
1144
|
-
`}function
|
|
1145
|
-
<slot name="tooltip-enter">${
|
|
1146
|
-
<slot name="tooltip-exit">${
|
|
1147
|
-
`}var
|
|
1144
|
+
`}function tE(){return`
|
|
1145
|
+
<slot name="tooltip-enter">${g("Enter fullscreen mode")}</slot>
|
|
1146
|
+
<slot name="tooltip-exit">${g("Exit fullscreen mode")}</slot>
|
|
1147
|
+
`}var pp=i=>{let e=i.mediaIsFullscreen?g("exit fullscreen mode"):g("enter fullscreen mode");i.setAttribute("aria-label",e)},An=class extends F{constructor(){super(...arguments),Zf(this,Ts,null)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_IS_FULLSCREEN,s.MEDIA_FULLSCREEN_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),pp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_IS_FULLSCREEN&&pp(this)}get mediaFullscreenUnavailable(){return x(this,s.MEDIA_FULLSCREEN_UNAVAILABLE)}set mediaFullscreenUnavailable(e){P(this,s.MEDIA_FULLSCREEN_UNAVAILABLE,e)}get mediaIsFullscreen(){return I(this,s.MEDIA_IS_FULLSCREEN)}set mediaIsFullscreen(e){w(this,s.MEDIA_IS_FULLSCREEN,e)}handleClick(e){Xf(this,Ts,e);let t=Qf(this,Ts)instanceof PointerEvent,r=this.mediaIsFullscreen?new c.CustomEvent(b.MEDIA_EXIT_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0}):new c.CustomEvent(b.MEDIA_ENTER_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(r)}};Ts=new WeakMap;An.getSlotTemplateHTML=eE;An.getTooltipContentHTML=tE;c.customElements.get("media-fullscreen-button")||c.customElements.define("media-fullscreen-button",An);var{MEDIA_TIME_IS_LIVE:As,MEDIA_PAUSED:Sn}=s,{MEDIA_SEEK_TO_LIVE_REQUEST:iE,MEDIA_PLAY_REQUEST:rE}=b,oE='<svg viewBox="0 0 6 12"><circle cx="3" cy="6" r="2"></circle></svg>';function nE(i){return`
|
|
1148
1148
|
<style>
|
|
1149
1149
|
:host { --media-tooltip-display: none; }
|
|
1150
1150
|
|
|
@@ -1156,13 +1156,13 @@ bp-player[has-error] {
|
|
|
1156
1156
|
color: var(--media-live-button-icon-color, rgb(140, 140, 140));
|
|
1157
1157
|
}
|
|
1158
1158
|
|
|
1159
|
-
:host([${
|
|
1160
|
-
:host([${
|
|
1159
|
+
:host([${As}]:not([${Sn}])) slot[name=indicator] > *,
|
|
1160
|
+
:host([${As}]:not([${Sn}])) ::slotted([slot=indicator]) {
|
|
1161
1161
|
fill: var(--media-live-button-indicator-color, rgb(255, 0, 0));
|
|
1162
1162
|
color: var(--media-live-button-indicator-color, rgb(255, 0, 0));
|
|
1163
1163
|
}
|
|
1164
1164
|
|
|
1165
|
-
:host([${
|
|
1165
|
+
:host([${As}]:not([${Sn}])) {
|
|
1166
1166
|
cursor: var(--media-cursor, not-allowed);
|
|
1167
1167
|
}
|
|
1168
1168
|
|
|
@@ -1172,10 +1172,10 @@ bp-player[has-error] {
|
|
|
1172
1172
|
|
|
1173
1173
|
</style>
|
|
1174
1174
|
|
|
1175
|
-
<slot name="indicator">${
|
|
1175
|
+
<slot name="indicator">${oE}</slot>
|
|
1176
1176
|
|
|
1177
|
-
<slot name="spacer"> </slot><slot name="text">${
|
|
1178
|
-
`}var
|
|
1177
|
+
<slot name="spacer"> </slot><slot name="text">${g("live")}</slot>
|
|
1178
|
+
`}var vp=i=>{var e;let t=i.mediaPaused||!i.mediaTimeIsLive,r=t?g("seek to live"):g("playing live");i.setAttribute("aria-label",r);let o=(e=i.shadowRoot)==null?void 0:e.querySelector('slot[name="text"]');o&&(o.textContent=g("live")),t?i.removeAttribute("aria-disabled"):i.setAttribute("aria-disabled","true")},Ss=class extends F{static get observedAttributes(){return[...super.observedAttributes,As,Sn]}connectedCallback(){super.connectedCallback(),vp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),vp(this)}get mediaPaused(){return I(this,s.MEDIA_PAUSED)}set mediaPaused(e){w(this,s.MEDIA_PAUSED,e)}get mediaTimeIsLive(){return I(this,s.MEDIA_TIME_IS_LIVE)}set mediaTimeIsLive(e){w(this,s.MEDIA_TIME_IS_LIVE,e)}handleClick(){!this.mediaPaused&&this.mediaTimeIsLive||(this.dispatchEvent(new c.CustomEvent(iE,{composed:!0,bubbles:!0})),this.hasAttribute(Sn)&&this.dispatchEvent(new c.CustomEvent(rE,{composed:!0,bubbles:!0})))}};Ss.getSlotTemplateHTML=nE;c.customElements.get("media-live-button")||c.customElements.define("media-live-button",Ss);var Ep=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},kn=(i,e,t)=>(Ep(i,e,"read from private field"),t?t.call(i):e.get(i)),fp=(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)},Ln=(i,e,t,r)=>(Ep(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),vt,Ls,ks={LOADING_DELAY:"loadingdelay",NO_AUTOHIDE:"noautohide"},gp=500,aE=`
|
|
1179
1179
|
<svg aria-hidden="true" viewBox="0 0 100 100">
|
|
1180
1180
|
<path d="M73,50c0-12.7-10.3-23-23-23S27,37.3,27,50 M30.9,50c0-10.5,8.5-19.1,19.1-19.1S69.1,39.5,69.1,50">
|
|
1181
1181
|
<animateTransform
|
|
@@ -1188,13 +1188,13 @@ bp-player[has-error] {
|
|
|
1188
1188
|
repeatCount="indefinite" />
|
|
1189
1189
|
</path>
|
|
1190
1190
|
</svg>
|
|
1191
|
-
`;function
|
|
1191
|
+
`;function sE(i){return`
|
|
1192
1192
|
<style>
|
|
1193
1193
|
:host {
|
|
1194
1194
|
display: var(--media-control-display, var(--media-loading-indicator-display, inline-block));
|
|
1195
1195
|
vertical-align: middle;
|
|
1196
1196
|
box-sizing: border-box;
|
|
1197
|
-
--_loading-indicator-delay: var(--media-loading-indicator-transition-delay, ${
|
|
1197
|
+
--_loading-indicator-delay: var(--media-loading-indicator-transition-delay, ${gp}ms);
|
|
1198
1198
|
}
|
|
1199
1199
|
|
|
1200
1200
|
#status {
|
|
@@ -1233,15 +1233,15 @@ bp-player[has-error] {
|
|
|
1233
1233
|
}
|
|
1234
1234
|
</style>
|
|
1235
1235
|
|
|
1236
|
-
<slot name="icon">${
|
|
1237
|
-
<div id="status" role="status" aria-live="polite">${
|
|
1238
|
-
`}var
|
|
1236
|
+
<slot name="icon">${aE}</slot>
|
|
1237
|
+
<div id="status" role="status" aria-live="polite">${g("media loading")}</div>
|
|
1238
|
+
`}var Cn=class extends c.HTMLElement{constructor(){if(super(),fp(this,vt,void 0),fp(this,Ls,gp),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[N.MEDIA_CONTROLLER,s.MEDIA_PAUSED,s.MEDIA_LOADING,ks.LOADING_DELAY]}attributeChangedCallback(e,t,r){var o,n,a,l,d;e===ks.LOADING_DELAY&&t!==r?this.loadingDelay=Number(r):e===N.MEDIA_CONTROLLER&&(t&&((n=(o=kn(this,vt))==null?void 0:o.unassociateElement)==null||n.call(o,this),Ln(this,vt,null)),r&&this.isConnected&&(Ln(this,vt,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(d=(l=kn(this,vt))==null?void 0:l.associateElement)==null||d.call(l,this)))}connectedCallback(){var e,t,r;let o=this.getAttribute(N.MEDIA_CONTROLLER);o&&(Ln(this,vt,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=kn(this,vt))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=kn(this,vt))==null?void 0:e.unassociateElement)==null||t.call(e,this),Ln(this,vt,null)}get loadingDelay(){return kn(this,Ls)}set loadingDelay(e){Ln(this,Ls,e);let{style:t}=J(this.shadowRoot,":host");t.setProperty("--_loading-indicator-delay",`var(--media-loading-indicator-transition-delay, ${e}ms)`)}get mediaPaused(){return I(this,s.MEDIA_PAUSED)}set mediaPaused(e){w(this,s.MEDIA_PAUSED,e)}get mediaLoading(){return I(this,s.MEDIA_LOADING)}set mediaLoading(e){w(this,s.MEDIA_LOADING,e)}get mediaController(){return x(this,N.MEDIA_CONTROLLER)}set mediaController(e){P(this,N.MEDIA_CONTROLLER,e)}get noAutohide(){return I(this,ks.NO_AUTOHIDE)}set noAutohide(e){w(this,ks.NO_AUTOHIDE,e)}};vt=new WeakMap;Ls=new WeakMap;Cn.shadowRootOptions={mode:"open"};Cn.getTemplateHTML=sE;c.customElements.get("media-loading-indicator")||c.customElements.define("media-loading-indicator",Cn);var lE=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
1239
1239
|
<path d="M16.5 12A4.5 4.5 0 0 0 14 8v2.18l2.45 2.45a4.22 4.22 0 0 0 .05-.63Zm2.5 0a6.84 6.84 0 0 1-.54 2.64L20 16.15A8.8 8.8 0 0 0 21 12a9 9 0 0 0-7-8.77v2.06A7 7 0 0 1 19 12ZM4.27 3 3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25A6.92 6.92 0 0 1 14 18.7v2.06A9 9 0 0 0 17.69 19l2 2.05L21 19.73l-9-9L4.27 3ZM12 4 9.91 6.09 12 8.18V4Z"/>
|
|
1240
|
-
</svg>`,
|
|
1240
|
+
</svg>`,bp=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
1241
1241
|
<path d="M3 9v6h4l5 5V4L7 9H3Zm13.5 3A4.5 4.5 0 0 0 14 8v8a4.47 4.47 0 0 0 2.5-4Z"/>
|
|
1242
|
-
</svg>`,
|
|
1242
|
+
</svg>`,dE=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
1243
1243
|
<path d="M3 9v6h4l5 5V4L7 9H3Zm13.5 3A4.5 4.5 0 0 0 14 8v8a4.47 4.47 0 0 0 2.5-4ZM14 3.23v2.06a7 7 0 0 1 0 13.42v2.06a9 9 0 0 0 0-17.54Z"/>
|
|
1244
|
-
</svg>`;function
|
|
1244
|
+
</svg>`;function cE(i){return`
|
|
1245
1245
|
<style>
|
|
1246
1246
|
:host(:not([${s.MEDIA_VOLUME_LEVEL}])) slot[name=icon] slot:not([name=high]),
|
|
1247
1247
|
:host([${s.MEDIA_VOLUME_LEVEL}=high]) slot[name=icon] slot:not([name=high]) {
|
|
@@ -1267,17 +1267,17 @@ bp-player[has-error] {
|
|
|
1267
1267
|
</style>
|
|
1268
1268
|
|
|
1269
1269
|
<slot name="icon">
|
|
1270
|
-
<slot name="off">${
|
|
1271
|
-
<slot name="low">${
|
|
1272
|
-
<slot name="medium">${
|
|
1273
|
-
<slot name="high">${
|
|
1270
|
+
<slot name="off">${lE}</slot>
|
|
1271
|
+
<slot name="low">${bp}</slot>
|
|
1272
|
+
<slot name="medium">${bp}</slot>
|
|
1273
|
+
<slot name="high">${dE}</slot>
|
|
1274
1274
|
</slot>
|
|
1275
|
-
`}function
|
|
1276
|
-
<slot name="tooltip-mute">${
|
|
1277
|
-
<slot name="tooltip-unmute">${
|
|
1278
|
-
`}var
|
|
1275
|
+
`}function uE(){return`
|
|
1276
|
+
<slot name="tooltip-mute">${g("Mute")}</slot>
|
|
1277
|
+
<slot name="tooltip-unmute">${g("Unmute")}</slot>
|
|
1278
|
+
`}var _p=i=>{let t=i.mediaVolumeLevel==="off"?g("unmute"):g("mute");i.setAttribute("aria-label",t)},In=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_VOLUME_LEVEL]}connectedCallback(){super.connectedCallback(),_p(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_VOLUME_LEVEL&&_p(this)}get mediaVolumeLevel(){return x(this,s.MEDIA_VOLUME_LEVEL)}set mediaVolumeLevel(e){P(this,s.MEDIA_VOLUME_LEVEL,e)}handleClick(){let e=this.mediaVolumeLevel==="off"?b.MEDIA_UNMUTE_REQUEST:b.MEDIA_MUTE_REQUEST;this.dispatchEvent(new c.CustomEvent(e,{composed:!0,bubbles:!0}))}};In.getSlotTemplateHTML=cE;In.getTooltipContentHTML=uE;c.customElements.get("media-mute-button")||c.customElements.define("media-mute-button",In);var yp=`<svg aria-hidden="true" viewBox="0 0 28 24">
|
|
1279
1279
|
<path d="M24 3H4a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h20a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1Zm-1 16H5V5h18v14Zm-3-8h-7v5h7v-5Z"/>
|
|
1280
|
-
</svg>`;function
|
|
1280
|
+
</svg>`;function hE(i){return`
|
|
1281
1281
|
<style>
|
|
1282
1282
|
:host([${s.MEDIA_IS_PIP}]) slot[name=icon] slot:not([name=exit]) {
|
|
1283
1283
|
display: none !important;
|
|
@@ -1294,25 +1294,25 @@ bp-player[has-error] {
|
|
|
1294
1294
|
</style>
|
|
1295
1295
|
|
|
1296
1296
|
<slot name="icon">
|
|
1297
|
-
<slot name="enter">${
|
|
1298
|
-
<slot name="exit">${
|
|
1297
|
+
<slot name="enter">${yp}</slot>
|
|
1298
|
+
<slot name="exit">${yp}</slot>
|
|
1299
1299
|
</slot>
|
|
1300
|
-
`}function
|
|
1301
|
-
<slot name="tooltip-enter">${
|
|
1302
|
-
<slot name="tooltip-exit">${
|
|
1303
|
-
`}var
|
|
1300
|
+
`}function pE(){return`
|
|
1301
|
+
<slot name="tooltip-enter">${g("Enter picture in picture mode")}</slot>
|
|
1302
|
+
<slot name="tooltip-exit">${g("Exit picture in picture mode")}</slot>
|
|
1303
|
+
`}var Tp=i=>{let e=i.mediaIsPip?g("exit picture in picture mode"):g("enter picture in picture mode");i.setAttribute("aria-label",e)},wn=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_IS_PIP,s.MEDIA_PIP_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Tp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_IS_PIP&&Tp(this)}get mediaPipUnavailable(){return x(this,s.MEDIA_PIP_UNAVAILABLE)}set mediaPipUnavailable(e){P(this,s.MEDIA_PIP_UNAVAILABLE,e)}get mediaIsPip(){return I(this,s.MEDIA_IS_PIP)}set mediaIsPip(e){w(this,s.MEDIA_IS_PIP,e)}handleClick(){let e=this.mediaIsPip?b.MEDIA_EXIT_PIP_REQUEST:b.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new c.CustomEvent(e,{composed:!0,bubbles:!0}))}};wn.getSlotTemplateHTML=hE;wn.getTooltipContentHTML=pE;c.customElements.get("media-pip-button")||c.customElements.define("media-pip-button",wn);var mE=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},$r=(i,e,t)=>(mE(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)},ai,Yd={RATES:"rates"},Qd=[1,1.2,1.5,1.7,2],zi=1;function fE(i){return`
|
|
1304
1304
|
<style>
|
|
1305
1305
|
:host {
|
|
1306
1306
|
min-width: 5ch;
|
|
1307
1307
|
padding: var(--media-button-padding, var(--media-control-padding, 10px 5px));
|
|
1308
1308
|
}
|
|
1309
1309
|
</style>
|
|
1310
|
-
<slot name="icon">${i.mediaplaybackrate||
|
|
1311
|
-
`}function
|
|
1310
|
+
<slot name="icon">${i.mediaplaybackrate||zi}x</slot>
|
|
1311
|
+
`}function EE(){return g("Playback rate")}var Mn=class extends F{constructor(){var e;super(),vE(this,ai,new ei(this,Yd.RATES,{defaultValue:Qd})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${(e=this.mediaPlaybackRate)!=null?e:zi}x`}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PLAYBACK_RATE,Yd.RATES]}attributeChangedCallback(e,t,r){if(super.attributeChangedCallback(e,t,r),e===Yd.RATES&&($r(this,ai).value=r),e===s.MEDIA_PLAYBACK_RATE){let o=r?+r:Number.NaN,n=Number.isNaN(o)?zi:o;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",g("Playback rate {playbackRate}",{playbackRate:n}))}}get rates(){return $r(this,ai)}set rates(e){e?Array.isArray(e)?$r(this,ai).value=e.join(" "):typeof e=="string"&&($r(this,ai).value=e):$r(this,ai).value=""}get mediaPlaybackRate(){return H(this,s.MEDIA_PLAYBACK_RATE,zi)}set mediaPlaybackRate(e){B(this,s.MEDIA_PLAYBACK_RATE,e)}handleClick(){var e,t;let r=Array.from($r(this,ai).values(),a=>+a).sort((a,l)=>a-l),o=(t=(e=r.find(a=>a>this.mediaPlaybackRate))!=null?e:r[0])!=null?t:zi,n=new c.CustomEvent(b.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:o});this.dispatchEvent(n)}};ai=new WeakMap;Mn.getSlotTemplateHTML=fE;Mn.getTooltipContentHTML=EE;c.customElements.get("media-playback-rate-button")||c.customElements.define("media-playback-rate-button",Mn);var gE=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
1312
1312
|
<path d="m6 21 15-9L6 3v18Z"/>
|
|
1313
|
-
</svg>`,
|
|
1313
|
+
</svg>`,bE=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
1314
1314
|
<path d="M6 20h4V4H6v16Zm8-16v16h4V4h-4Z"/>
|
|
1315
|
-
</svg>`;function
|
|
1315
|
+
</svg>`;function _E(i){return`
|
|
1316
1316
|
<style>
|
|
1317
1317
|
:host([${s.MEDIA_PAUSED}]) slot[name=pause],
|
|
1318
1318
|
:host(:not([${s.MEDIA_PAUSED}])) slot[name=play] {
|
|
@@ -1326,13 +1326,13 @@ bp-player[has-error] {
|
|
|
1326
1326
|
</style>
|
|
1327
1327
|
|
|
1328
1328
|
<slot name="icon">
|
|
1329
|
-
<slot name="play">${
|
|
1330
|
-
<slot name="pause">${
|
|
1329
|
+
<slot name="play">${gE}</slot>
|
|
1330
|
+
<slot name="pause">${bE}</slot>
|
|
1331
1331
|
</slot>
|
|
1332
|
-
`}function
|
|
1333
|
-
<slot name="tooltip-play">${
|
|
1334
|
-
<slot name="tooltip-pause">${
|
|
1335
|
-
`}var
|
|
1332
|
+
`}function yE(){return`
|
|
1333
|
+
<slot name="tooltip-play">${g("Play")}</slot>
|
|
1334
|
+
<slot name="tooltip-pause">${g("Pause")}</slot>
|
|
1335
|
+
`}var Ap=i=>{let e=i.mediaPaused?g("play"):g("pause");i.setAttribute("aria-label",e)},Rn=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PAUSED,s.MEDIA_ENDED]}connectedCallback(){super.connectedCallback(),Ap(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),(e===s.MEDIA_PAUSED||e===s.MEDIA_LANG)&&Ap(this)}get mediaPaused(){return I(this,s.MEDIA_PAUSED)}set mediaPaused(e){w(this,s.MEDIA_PAUSED,e)}handleClick(){let e=this.mediaPaused?b.MEDIA_PLAY_REQUEST:b.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new c.CustomEvent(e,{composed:!0,bubbles:!0}))}};Rn.getSlotTemplateHTML=_E;Rn.getTooltipContentHTML=yE;c.customElements.get("media-play-button")||c.customElements.define("media-play-button",Rn);var ft={PLACEHOLDER_SRC:"placeholdersrc",SRC:"src"};function TE(i){return`
|
|
1336
1336
|
<style>
|
|
1337
1337
|
:host {
|
|
1338
1338
|
pointer-events: none;
|
|
@@ -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
|
|
1357
|
+
`}var AE=i=>{i.style.removeProperty("background-image")},SE=(i,e)=>{i.style["background-image"]=`url('${e}')`},xn=class extends c.HTMLElement{static get observedAttributes(){return[ft.PLACEHOLDER_SRC,ft.SRC]}constructor(){if(super(),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,t,r){e===ft.SRC&&(r==null?this.image.removeAttribute(ft.SRC):this.image.setAttribute(ft.SRC,r)),e===ft.PLACEHOLDER_SRC&&(r==null?AE(this.image):SE(this.image,r))}get placeholderSrc(){return x(this,ft.PLACEHOLDER_SRC)}set placeholderSrc(e){P(this,ft.SRC,e)}get src(){return x(this,ft.SRC)}set src(e){P(this,ft.SRC,e)}};xn.shadowRootOptions={mode:"open"};xn.getTemplateHTML=TE;c.customElements.get("media-poster-image")||c.customElements.define("media-poster-image",xn);var Sp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},kE=(i,e,t)=>(Sp(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)},CE=(i,e,t,r)=>(Sp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Cs,Zd=class extends xe{constructor(){super(),LE(this,Cs,void 0),CE(this,Cs,this.shadowRoot.querySelector("slot"))}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PREVIEW_CHAPTER,s.MEDIA_LANG]}attributeChangedCallback(e,t,r){if(super.attributeChangedCallback(e,t,r),(e===s.MEDIA_PREVIEW_CHAPTER||e===s.MEDIA_LANG)&&r!==t&&r!=null)if(kE(this,Cs).textContent=r,r!==""){let o=g("chapter: {chapterName}",{chapterName:r});this.setAttribute("aria-valuetext",o)}else this.removeAttribute("aria-valuetext")}get mediaPreviewChapter(){return x(this,s.MEDIA_PREVIEW_CHAPTER)}set mediaPreviewChapter(e){P(this,s.MEDIA_PREVIEW_CHAPTER,e)}};Cs=new WeakMap;c.customElements.get("media-preview-chapter-display")||c.customElements.define("media-preview-chapter-display",Zd);var kp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Is=(i,e,t)=>(kp(i,e,"read from private field"),t?t.call(i):e.get(i)),IE=(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)},ws=(i,e,t,r)=>(kp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Et;function wE(i){return`
|
|
1358
1358
|
<style>
|
|
1359
1359
|
:host {
|
|
1360
1360
|
box-sizing: border-box;
|
|
@@ -1368,27 +1368,27 @@ bp-player[has-error] {
|
|
|
1368
1368
|
}
|
|
1369
1369
|
</style>
|
|
1370
1370
|
<img crossorigin loading="eager" decoding="async">
|
|
1371
|
-
`}var
|
|
1371
|
+
`}var Br=class extends c.HTMLElement{constructor(){if(super(),IE(this,Et,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[N.MEDIA_CONTROLLER,s.MEDIA_PREVIEW_IMAGE,s.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,t,r;let o=this.getAttribute(N.MEDIA_CONTROLLER);o&&(ws(this,Et,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=Is(this,Et))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Is(this,Et))==null?void 0:e.unassociateElement)==null||t.call(e,this),ws(this,Et,null)}attributeChangedCallback(e,t,r){var o,n,a,l,d;[s.MEDIA_PREVIEW_IMAGE,s.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===N.MEDIA_CONTROLLER&&(t&&((n=(o=Is(this,Et))==null?void 0:o.unassociateElement)==null||n.call(o,this),ws(this,Et,null)),r&&this.isConnected&&(ws(this,Et,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(d=(l=Is(this,Et))==null?void 0:l.associateElement)==null||d.call(l,this)))}get mediaPreviewImage(){return x(this,s.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){P(this,s.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewCoords(){let e=this.getAttribute(s.MEDIA_PREVIEW_COORDS);if(e)return e.split(/\s+/).map(t=>+t)}set mediaPreviewCoords(e){if(!e){this.removeAttribute(s.MEDIA_PREVIEW_COORDS);return}this.setAttribute(s.MEDIA_PREVIEW_COORDS,e.join(" "))}update(){let e=this.mediaPreviewCoords,t=this.mediaPreviewImage;if(!(e&&t))return;let[r,o,n,a]=e,l=t.split("#")[0],d=getComputedStyle(this),{maxWidth:v,maxHeight:h,minWidth:p,minHeight:E}=d,m=Math.min(parseInt(v)/n,parseInt(h)/a),A=Math.max(parseInt(p)/n,parseInt(E)/a),f=m<1,L=f?m:A>1?A:1,{style:D}=J(this.shadowRoot,":host"),Oe=J(this.shadowRoot,"img").style,ot=this.shadowRoot.querySelector("img"),Oo=f?"min":"max";D.setProperty(`${Oo}-width`,"initial","important"),D.setProperty(`${Oo}-height`,"initial","important"),D.width=`${n*L}px`,D.height=`${a*L}px`;let hr=()=>{Oe.width=`${this.imgWidth*L}px`,Oe.height=`${this.imgHeight*L}px`,Oe.display="block"};ot.src!==l&&(ot.onload=()=>{this.imgWidth=ot.naturalWidth,this.imgHeight=ot.naturalHeight,hr()},ot.src=l,hr()),hr(),Oe.transform=`translate(-${r*L}px, -${o*L}px)`}};Et=new WeakMap;Br.shadowRootOptions={mode:"open"};Br.getTemplateHTML=wE;c.customElements.get("media-preview-thumbnail")||c.customElements.define("media-preview-thumbnail",Br);var Ms=Br;var Cp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Lp=(i,e,t)=>(Cp(i,e,"read from private field"),t?t.call(i):e.get(i)),ME=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},RE=(i,e,t,r)=>(Cp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Pn,Xd=class extends xe{constructor(){super(),ME(this,Pn,void 0),RE(this,Pn,this.shadowRoot.querySelector("slot")),Lp(this,Pn).textContent=Je(0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PREVIEW_TIME]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_PREVIEW_TIME&&r!=null&&(Lp(this,Pn).textContent=Je(parseFloat(r)))}get mediaPreviewTime(){return H(this,s.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){B(this,s.MEDIA_PREVIEW_TIME,e)}};Pn=new WeakMap;c.customElements.get("media-preview-time-display")||c.customElements.define("media-preview-time-display",Xd);var Vr={SEEK_OFFSET:"seekoffset"},Jd=30,xE=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>
|
|
1375
1375
|
</defs>
|
|
1376
1376
|
<text class="text value" transform="translate(2.18 19.87)">${i}</text>
|
|
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
|
-
</svg>`;function
|
|
1379
|
-
<slot name="icon">${
|
|
1380
|
-
`}function
|
|
1378
|
+
</svg>`;function PE(i,e){return`
|
|
1379
|
+
<slot name="icon">${xE(e.seekOffset)}</slot>
|
|
1380
|
+
`}function DE(){return g("Seek backward")}var OE=0,Dn=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_CURRENT_TIME,Vr.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this.seekOffset=H(this,Vr.SEEK_OFFSET,Jd)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===Vr.SEEK_OFFSET&&(this.seekOffset=H(this,Vr.SEEK_OFFSET,Jd))}get seekOffset(){return H(this,Vr.SEEK_OFFSET,Jd)}set seekOffset(e){B(this,Vr.SEEK_OFFSET,e),this.setAttribute("aria-label",g("seek back {seekOffset} seconds",{seekOffset:this.seekOffset})),Pa(Da(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return H(this,s.MEDIA_CURRENT_TIME,OE)}set mediaCurrentTime(e){B(this,s.MEDIA_CURRENT_TIME,e)}handleClick(){let e=Math.max(this.mediaCurrentTime-this.seekOffset,0),t=new c.CustomEvent(b.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};Dn.getSlotTemplateHTML=PE;Dn.getTooltipContentHTML=DE;c.customElements.get("media-seek-backward-button")||c.customElements.define("media-seek-backward-button",Dn);var Wr={SEEK_OFFSET:"seekoffset"},jd=30,NE=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>
|
|
1384
1384
|
</defs>
|
|
1385
1385
|
<text class="text value" transform="translate(8.9 19.87)">${i}</text>
|
|
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
|
-
</svg>`;function
|
|
1388
|
-
<slot name="icon">${
|
|
1389
|
-
`}function
|
|
1390
|
-
<slot>${
|
|
1391
|
-
`}var
|
|
1387
|
+
</svg>`;function UE(i,e){return`
|
|
1388
|
+
<slot name="icon">${NE(e.seekOffset)}</slot>
|
|
1389
|
+
`}function HE(){return g("Seek forward")}var $E=0,On=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_CURRENT_TIME,Wr.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this.seekOffset=H(this,Wr.SEEK_OFFSET,jd)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===Wr.SEEK_OFFSET&&(this.seekOffset=H(this,Wr.SEEK_OFFSET,jd))}get seekOffset(){return H(this,Wr.SEEK_OFFSET,jd)}set seekOffset(e){B(this,Wr.SEEK_OFFSET,e),this.setAttribute("aria-label",g("seek forward {seekOffset} seconds",{seekOffset:this.seekOffset})),Pa(Da(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return H(this,s.MEDIA_CURRENT_TIME,$E)}set mediaCurrentTime(e){B(this,s.MEDIA_CURRENT_TIME,e)}handleClick(){let e=this.mediaCurrentTime+this.seekOffset,t=new c.CustomEvent(b.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};On.getSlotTemplateHTML=UE;On.getTooltipContentHTML=HE;c.customElements.get("media-seek-forward-button")||c.customElements.define("media-seek-forward-button",On);var Mp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ec=(i,e,t)=>(Mp(i,e,"read from private field"),t?t.call(i):e.get(i)),BE=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},VE=(i,e,t,r)=>(Mp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Fr,Yi={REMAINING:"remaining",SHOW_DURATION:"showduration",NO_TOGGLE:"notoggle"},Ip=[...Object.values(Yi),s.MEDIA_CURRENT_TIME,s.MEDIA_DURATION,s.MEDIA_SEEKABLE],wp=["Enter"," "],WE=" / ",tc=(i,{timesSep:e=WE}={})=>{var t,r;let o=(t=i.mediaCurrentTime)!=null?t:0,[,n]=(r=i.mediaSeekable)!=null?r:[],a=0;Number.isFinite(i.mediaDuration)?a=i.mediaDuration:Number.isFinite(n)&&(a=n);let l=i.remaining?Je(0-(a-o)):Je(o);return i.showDuration?`${l}${e}${Je(a)}`:l},FE="video not loaded, unknown time.",KE=i=>{var e;let t=i.mediaCurrentTime,[,r]=(e=i.mediaSeekable)!=null?e:[],o=null;if(Number.isFinite(i.mediaDuration)?o=i.mediaDuration:Number.isFinite(r)&&(o=r),t==null||o===null){i.setAttribute("aria-valuetext",FE);return}let n=i.remaining?Pi(0-(o-t)):Pi(t);if(!i.showDuration){i.setAttribute("aria-valuetext",n);return}let a=Pi(o),l=`${n} of ${a}`;i.setAttribute("aria-valuetext",l)};function GE(i,e){return`
|
|
1390
|
+
<slot>${tc(e)}</slot>
|
|
1391
|
+
`}var Rs=class extends xe{constructor(){super(),BE(this,Fr,void 0),VE(this,Fr,this.shadowRoot.querySelector("slot")),ec(this,Fr).innerHTML=`${tc(this)}`}static get observedAttributes(){return[...super.observedAttributes,...Ip,"disabled"]}connectedCallback(){let{style:e}=J(this.shadowRoot,":host(:hover:not([notoggle]))");e.setProperty("cursor","var(--media-cursor, pointer)"),e.setProperty("background","var(--media-control-hover-background, rgba(50 50 70 / .7))"),this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","progressbar"),this.setAttribute("aria-label",g("playback time"));let t=r=>{let{key:o}=r;if(!wp.includes(o)){this.removeEventListener("keyup",t);return}this.toggleTimeDisplay()};this.addEventListener("keydown",r=>{let{metaKey:o,altKey:n,key:a}=r;if(o||n||!wp.includes(a)){this.removeEventListener("keyup",t);return}this.addEventListener("keyup",t)}),this.addEventListener("click",this.toggleTimeDisplay),super.connectedCallback()}toggleTimeDisplay(){this.noToggle||(this.hasAttribute("remaining")?this.removeAttribute("remaining"):this.setAttribute("remaining",""))}disconnectedCallback(){this.disable(),super.disconnectedCallback()}attributeChangedCallback(e,t,r){Ip.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 I(this,Yi.REMAINING)}set remaining(e){w(this,Yi.REMAINING,e)}get showDuration(){return I(this,Yi.SHOW_DURATION)}set showDuration(e){w(this,Yi.SHOW_DURATION,e)}get noToggle(){return I(this,Yi.NO_TOGGLE)}set noToggle(e){w(this,Yi.NO_TOGGLE,e)}get mediaDuration(){return H(this,s.MEDIA_DURATION)}set mediaDuration(e){B(this,s.MEDIA_DURATION,e)}get mediaCurrentTime(){return H(this,s.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){B(this,s.MEDIA_CURRENT_TIME,e)}get mediaSeekable(){let e=this.getAttribute(s.MEDIA_SEEKABLE);if(e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(s.MEDIA_SEEKABLE);return}this.setAttribute(s.MEDIA_SEEKABLE,e.join(":"))}update(){let e=tc(this);KE(this),e!==ec(this,Fr).innerHTML&&(ec(this,Fr).innerHTML=e)}};Fr=new WeakMap;Rs.getSlotTemplateHTML=GE;c.customElements.get("media-time-display")||c.customElements.define("media-time-display",Rs);var Rp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},be=(i,e,t)=>(Rp(i,e,"read from private field"),t?t.call(i):e.get(i)),gt=(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)=>(Rp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),qE=(i,e,t,r)=>({set _(o){$e(i,e,o,t)},get _(){return be(i,e,r)}}),Kr,xs,Gr,Nn,Ps,Ds,Os,qr,Qi,Ns,Us=class{constructor(e,t,r){gt(this,Kr,void 0),gt(this,xs,void 0),gt(this,Gr,void 0),gt(this,Nn,void 0),gt(this,Ps,void 0),gt(this,Ds,void 0),gt(this,Os,void 0),gt(this,qr,void 0),gt(this,Qi,0),gt(this,Ns,(o=performance.now())=>{$e(this,Qi,requestAnimationFrame(be(this,Ns))),$e(this,Nn,performance.now()-be(this,Gr));let n=1e3/this.fps;if(be(this,Nn)>n){$e(this,Gr,o-be(this,Nn)%n);let a=1e3/((o-be(this,xs))/++qE(this,Ps)._),l=(o-be(this,Ds))/1e3/this.duration,d=be(this,Os)+l*this.playbackRate;d-be(this,Kr).valueAsNumber>0?$e(this,qr,this.playbackRate/this.duration/a):($e(this,qr,.995*be(this,qr)),d=be(this,Kr).valueAsNumber+be(this,qr)),this.callback(d)}}),$e(this,Kr,e),this.callback=t,this.fps=r}start(){be(this,Qi)===0&&($e(this,Gr,performance.now()),$e(this,xs,be(this,Gr)),$e(this,Ps,0),be(this,Ns).call(this))}stop(){be(this,Qi)!==0&&(cancelAnimationFrame(be(this,Qi)),$e(this,Qi,0))}update({start:e,duration:t,playbackRate:r}){let o=e-be(this,Kr).valueAsNumber,n=Math.abs(t-this.duration);(o>0||o<-.03||n>=.5)&&this.callback(e),$e(this,Os,e),$e(this,Ds,performance.now()),this.duration=t,this.playbackRate=r}};Kr=new WeakMap;xs=new WeakMap;Gr=new WeakMap;Nn=new WeakMap;Ps=new WeakMap;Ds=new WeakMap;Os=new WeakMap;qr=new WeakMap;Qi=new WeakMap;Ns=new WeakMap;var nc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},se=(i,e,t)=>(nc(i,e,"read from private field"),t?t.call(i):e.get(i)),me=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ge=(i,e,t,r)=>(nc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Te=(i,e,t)=>(nc(i,e,"access private method"),t),zr,Zi,Bs,Hn,Vs,$s,$n,Bn,Yr,Qr,Zr,Un,ac,xp,ic,Ws,sc,Fs,lc,Ks,dc,rc,Pp,Vn,Gs,oc,Dp,zE="video not loaded, unknown time.",YE=i=>{let e=i.range,t=Pi(+Op(i)),r=Pi(+i.mediaSeekableEnd),o=t&&r?`${t} of ${r}`:zE;e.setAttribute("aria-valuetext",o)};function QE(i){return`
|
|
1392
1392
|
<style>
|
|
1393
1393
|
:host {
|
|
1394
1394
|
--media-box-border-radius: 4px;
|
|
@@ -1591,8 +1591,8 @@ bp-player[has-error] {
|
|
|
1591
1591
|
<div id="preview-rail">
|
|
1592
1592
|
<slot name="preview" part="box preview-box">
|
|
1593
1593
|
<media-preview-thumbnail>
|
|
1594
|
-
<template shadowrootmode="${
|
|
1595
|
-
${
|
|
1594
|
+
<template shadowrootmode="${Ms.shadowRootOptions.mode}">
|
|
1595
|
+
${Ms.getTemplateHTML({})}
|
|
1596
1596
|
</template>
|
|
1597
1597
|
</media-preview-thumbnail>
|
|
1598
1598
|
<media-preview-chapter-display></media-preview-chapter-display>
|
|
@@ -1605,7 +1605,7 @@ bp-player[has-error] {
|
|
|
1605
1605
|
|
|
1606
1606
|
</slot>
|
|
1607
1607
|
</div>
|
|
1608
|
-
`}var
|
|
1608
|
+
`}var Hs=(i,e=i.mediaCurrentTime)=>{let t=Number.isFinite(i.mediaSeekableStart)?i.mediaSeekableStart:0,r=Number.isFinite(i.mediaDuration)?i.mediaDuration:i.mediaSeekableEnd;if(Number.isNaN(r))return 0;let o=(e-t)/(r-t);return Math.max(0,Math.min(o,1))},Op=(i,e=i.range.valueAsNumber)=>{let t=Number.isFinite(i.mediaSeekableStart)?i.mediaSeekableStart:0,r=Number.isFinite(i.mediaDuration)?i.mediaDuration:i.mediaSeekableEnd;return Number.isNaN(r)?0:e*(r-t)+t},Wn=class extends ht{constructor(){super(),me(this,Zr),me(this,ac),me(this,Ws),me(this,Fs),me(this,Ks),me(this,rc),me(this,Vn),me(this,oc),me(this,zr,void 0),me(this,Zi,void 0),me(this,Bs,void 0),me(this,Hn,void 0),me(this,Vs,void 0),me(this,$s,void 0),me(this,$n,void 0),me(this,Bn,void 0),me(this,Yr,void 0),me(this,Qr,void 0),me(this,ic,r=>{this.dragging||(Tr(r)&&(this.range.valueAsNumber=r),se(this,Qr)||this.updateBar())}),this.shadowRoot.querySelector("#track").insertAdjacentHTML("afterbegin",'<div id="buffered" part="buffered"></div>'),Ge(this,Bs,this.shadowRoot.querySelectorAll('[part~="box"]')),Ge(this,Vs,this.shadowRoot.querySelector('[part~="preview-box"]')),Ge(this,$s,this.shadowRoot.querySelector('[part~="current-box"]'));let t=getComputedStyle(this);Ge(this,$n,parseInt(t.getPropertyValue("--media-box-padding-left"))),Ge(this,Bn,parseInt(t.getPropertyValue("--media-box-padding-right"))),Ge(this,Zi,new Us(this.range,se(this,ic),60))}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PAUSED,s.MEDIA_DURATION,s.MEDIA_SEEKABLE,s.MEDIA_CURRENT_TIME,s.MEDIA_PREVIEW_IMAGE,s.MEDIA_PREVIEW_TIME,s.MEDIA_PREVIEW_CHAPTER,s.MEDIA_BUFFERED,s.MEDIA_PLAYBACK_RATE,s.MEDIA_LOADING,s.MEDIA_ENDED]}connectedCallback(){var e;super.connectedCallback(),this.range.setAttribute("aria-label",g("seek")),Te(this,Zr,Un).call(this),Ge(this,zr,this.getRootNode()),(e=se(this,zr))==null||e.addEventListener("transitionstart",this)}disconnectedCallback(){var e;super.disconnectedCallback(),Te(this,Zr,Un).call(this),(e=se(this,zr))==null||e.removeEventListener("transitionstart",this),Ge(this,zr,null)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),t!=r&&(e===s.MEDIA_CURRENT_TIME||e===s.MEDIA_PAUSED||e===s.MEDIA_ENDED||e===s.MEDIA_LOADING||e===s.MEDIA_DURATION||e===s.MEDIA_SEEKABLE?(se(this,Zi).update({start:Hs(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),Te(this,Zr,Un).call(this),YE(this)):e===s.MEDIA_BUFFERED&&this.updateBufferedBar(),(e===s.MEDIA_DURATION||e===s.MEDIA_SEEKABLE)&&(this.mediaChaptersCues=se(this,Yr),this.updateBar()))}get mediaChaptersCues(){return se(this,Yr)}set mediaChaptersCues(e){var t;Ge(this,Yr,e),this.updateSegments((t=se(this,Yr))==null?void 0:t.map(r=>({start:Hs(this,r.startTime),end:Hs(this,r.endTime)})))}get mediaPaused(){return I(this,s.MEDIA_PAUSED)}set mediaPaused(e){w(this,s.MEDIA_PAUSED,e)}get mediaLoading(){return I(this,s.MEDIA_LOADING)}set mediaLoading(e){w(this,s.MEDIA_LOADING,e)}get mediaDuration(){return H(this,s.MEDIA_DURATION)}set mediaDuration(e){B(this,s.MEDIA_DURATION,e)}get mediaCurrentTime(){return H(this,s.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){B(this,s.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return H(this,s.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){B(this,s.MEDIA_PLAYBACK_RATE,e)}get mediaBuffered(){let e=this.getAttribute(s.MEDIA_BUFFERED);return e?e.split(" ").map(t=>t.split(":").map(r=>+r)):[]}set mediaBuffered(e){if(!e){this.removeAttribute(s.MEDIA_BUFFERED);return}let t=e.map(r=>r.join(":")).join(" ");this.setAttribute(s.MEDIA_BUFFERED,t)}get mediaSeekable(){let e=this.getAttribute(s.MEDIA_SEEKABLE);if(e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(s.MEDIA_SEEKABLE);return}this.setAttribute(s.MEDIA_SEEKABLE,e.join(":"))}get mediaSeekableEnd(){var e;let[,t=this.mediaDuration]=(e=this.mediaSeekable)!=null?e:[];return t}get mediaSeekableStart(){var e;let[t=0]=(e=this.mediaSeekable)!=null?e:[];return t}get mediaPreviewImage(){return x(this,s.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){P(this,s.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return H(this,s.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){B(this,s.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return I(this,s.MEDIA_ENDED)}set mediaEnded(e){w(this,s.MEDIA_ENDED,e)}updateBar(){super.updateBar(),this.updateBufferedBar(),this.updateCurrentBox()}updateBufferedBar(){var e;let t=this.mediaBuffered;if(!t.length)return;let r;if(this.mediaEnded)r=1;else{let n=this.mediaCurrentTime,[,a=this.mediaSeekableStart]=(e=t.find(([l,d])=>l<=n&&n<=d))!=null?e:[];r=Hs(this,a)}let{style:o}=J(this.shadowRoot,"#buffered");o.setProperty("width",`${r*100}%`)}updateCurrentBox(){if(!this.shadowRoot.querySelector('slot[name="current"]').assignedElements().length)return;let t=J(this.shadowRoot,"#current-rail"),r=J(this.shadowRoot,'[part~="current-box"]'),o=Te(this,Ws,sc).call(this,se(this,$s)),n=Te(this,Fs,lc).call(this,o,this.range.valueAsNumber),a=Te(this,Ks,dc).call(this,o,this.range.valueAsNumber);t.style.transform=`translateX(${n})`,t.style.setProperty("--_range-width",`${o.range.width}`),r.style.setProperty("--_box-shift",`${a}`),r.style.setProperty("--_box-width",`${o.box.width}px`),r.style.setProperty("visibility","initial")}handleEvent(e){switch(super.handleEvent(e),e.type){case"input":Te(this,oc,Dp).call(this);break;case"pointermove":Te(this,rc,Pp).call(this,e);break;case"pointerup":se(this,Qr)&&Ge(this,Qr,!1);break;case"pointerdown":Ge(this,Qr,!0);break;case"pointerleave":Te(this,Vn,Gs).call(this,null);break;case"transitionstart":Ae(e.target,this)&&setTimeout(()=>Te(this,Zr,Un).call(this),0);break}}};zr=new WeakMap;Zi=new WeakMap;Bs=new WeakMap;Hn=new WeakMap;Vs=new WeakMap;$s=new WeakMap;$n=new WeakMap;Bn=new WeakMap;Yr=new WeakMap;Qr=new WeakMap;Zr=new WeakSet;Un=function(){Te(this,ac,xp).call(this)?se(this,Zi).start():se(this,Zi).stop()};ac=new WeakSet;xp=function(){return this.isConnected&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded&&this.mediaSeekableEnd>0&&Oa(this)};ic=new WeakMap;Ws=new WeakSet;sc=function(i){var e;let r=((e=this.getAttribute("bounds")?nt(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?e:this).getBoundingClientRect(),o=this.range.getBoundingClientRect(),n=i.offsetWidth,a=-(o.left-r.left-n/2),l=r.right-o.left-n/2;return{box:{width:n,min:a,max:l},bounds:r,range:o}};Fs=new WeakSet;lc=function(i,e){let t=`${e*100}%`,{width:r,min:o,max:n}=i.box;if(!r)return t;if(Number.isNaN(o)||(t=`max(${`calc(1 / var(--_range-width) * 100 * ${o}% + var(--media-box-padding-left))`}, ${t})`),!Number.isNaN(n)){let l=`calc(1 / var(--_range-width) * 100 * ${n}% - var(--media-box-padding-right))`;t=`min(${t}, ${l})`}return t};Ks=new WeakSet;dc=function(i,e){let{width:t,min:r,max:o}=i.box,n=e*i.range.width;if(n<r+se(this,$n)){let a=i.range.left-i.bounds.left-se(this,$n);return`${n-t/2+a}px`}if(n>o-se(this,Bn)){let a=i.bounds.right-i.range.right-se(this,Bn);return`${n+t/2-a-i.range.width}px`}return 0};rc=new WeakSet;Pp=function(i){let e=[...se(this,Bs)].some(h=>i.composedPath().includes(h));if(!this.dragging&&(e||!i.composedPath().includes(this))){Te(this,Vn,Gs).call(this,null);return}let t=this.mediaSeekableEnd;if(!t)return;let r=J(this.shadowRoot,"#preview-rail"),o=J(this.shadowRoot,'[part~="preview-box"]'),n=Te(this,Ws,sc).call(this,se(this,Vs)),a=(i.clientX-n.range.left)/n.range.width;a=Math.max(0,Math.min(1,a));let l=Te(this,Fs,lc).call(this,n,a),d=Te(this,Ks,dc).call(this,n,a);r.style.transform=`translateX(${l})`,r.style.setProperty("--_range-width",`${n.range.width}`),o.style.setProperty("--_box-shift",`${d}`),o.style.setProperty("--_box-width",`${n.box.width}px`);let v=Math.round(se(this,Hn))-Math.round(a*t);Math.abs(v)<1&&a>.01&&a<.99||(Ge(this,Hn,a*t),Te(this,Vn,Gs).call(this,se(this,Hn)))};Vn=new WeakSet;Gs=function(i){this.dispatchEvent(new c.CustomEvent(b.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:i}))};oc=new WeakSet;Dp=function(){se(this,Zi).stop();let i=Op(this);this.dispatchEvent(new c.CustomEvent(b.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:i}))};Wn.shadowRootOptions={mode:"open"};Wn.getContainerTemplateHTML=QE;c.customElements.get("media-time-range")||c.customElements.define("media-time-range",Wn);var ZE=1,XE=i=>i.mediaMuted?0:i.mediaVolume,JE=i=>`${Math.round(i*100)}%`,cc=class extends ht{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_VOLUME,s.MEDIA_MUTED,s.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.addEventListener("input",()=>{let e=this.range.value,t=new c.CustomEvent(b.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)})}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",g("volume"))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),(e===s.MEDIA_VOLUME||e===s.MEDIA_MUTED)&&(this.range.valueAsNumber=XE(this),this.range.setAttribute("aria-valuetext",JE(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return H(this,s.MEDIA_VOLUME,ZE)}set mediaVolume(e){B(this,s.MEDIA_VOLUME,e)}get mediaMuted(){return I(this,s.MEDIA_MUTED)}set mediaMuted(e){w(this,s.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return x(this,s.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){P(this,s.MEDIA_VOLUME_UNAVAILABLE,e)}};c.customElements.get("media-volume-range")||c.customElements.define("media-volume-range",cc);function jE(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
|
|
1637
|
+
`}function eg(){return g("Loop")}var Fn=class extends F{constructor(){super(...arguments),this.container=null}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_LOOP]}connectedCallback(){var e;super.connectedCallback(),this.container=((e=this.shadowRoot)==null?void 0:e.querySelector("#icon"))||null,this.container&&(this.container.textContent=g("Loop"))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_LOOP&&this.container&&this.setAttribute("aria-checked",this.mediaLoop?"true":"false")}get mediaLoop(){return I(this,s.MEDIA_LOOP)}set mediaLoop(e){w(this,s.MEDIA_LOOP,e)}handleClick(){let e=!this.mediaLoop,t=new c.CustomEvent(b.MEDIA_LOOP_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};Fn.getSlotTemplateHTML=jE;Fn.getTooltipContentHTML=eg;c.customElements.get("media-loop-button")||c.customElements.define("media-loop-button",Fn);function Np({anchor:i,floating:e,placement:t}){let r=tg({anchor:i,floating:e}),{x:o,y:n}=rg(r,t);return{x:o,y:n}}function tg({anchor:i,floating:e}){return{anchor:ig(i,e.offsetParent),floating:{x:0,y:0,width:e.offsetWidth,height:e.offsetHeight}}}function ig(i,e){var t;let r=i.getBoundingClientRect(),o=(t=e==null?void 0:e.getBoundingClientRect())!=null?t:{x:0,y:0};return{x:r.x-o.x,y:r.y-o.y,width:r.width,height:r.height}}function rg({anchor:i,floating:e},t){let r=og(t)==="x"?"y":"x",o=r==="y"?"height":"width",n=Up(t),a=i.x+i.width/2-e.width/2,l=i.y+i.height/2-e.height/2,d=i[o]/2-e[o]/2,v;switch(n){case"top":v={x:a,y:i.y-e.height};break;case"bottom":v={x:a,y:i.y+i.height};break;case"right":v={x:i.x+i.width,y:l};break;case"left":v={x:i.x-e.width,y:l};break;default:v={x:i.x,y:i.y}}switch(t.split("-")[1]){case"start":v[r]-=d;break;case"end":v[r]+=d;break}return v}function Up(i){return i.split("-")[0]}function og(i){return["top","bottom"].includes(Up(i))?"y":"x"}var si=class extends Event{constructor({action:e="auto",relatedTarget:t,...r}){super("invoke",r),this.action=e,this.relatedTarget=t}},qs=class extends Event{constructor({newState:e,oldState:t,...r}){super("toggle",r),this.newState=e,this.oldState=t}};var Tc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},G=(i,e,t)=>(Tc(i,e,"read from private field"),t?t.call(i):e.get(i)),Q=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},bt=(i,e,t,r)=>(Tc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Z=(i,e,t)=>(Tc(i,e,"access private method"),t),_t,Ji,li,zs,Ys,ji,qn,uc,Hp,Xs,Ac,Js,Qs,hc,pc,$p,mc,Bp,vc,Vp,Xr,Jr,jr,zn,js,Sc,fc,Wp,kc,Fp,Ec,Kp,Lc,Gp,gc,qp,bc,zp,Kn,el,_c,Yp,Gn,tl,Zs,yc;function yt({type:i,text:e,value:t,checked:r}){let o=ee.createElement("media-chrome-menu-item");o.type=i??"",o.part.add("menu-item"),i&&o.part.add(i),o.value=t,o.checked=r;let n=ee.createElement("span");return n.textContent=e,o.append(n),o}function tt(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 ng(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 qi={STYLE:"style",HIDDEN:"hidden",DISABLED:"disabled",ANCHOR:"anchor"},se=class extends d.HTMLElement{constructor(){if(super(),Y(this,Kd),Y(this,Os),Y(this,Ps),Y(this,Gd),Y(this,zd),Y(this,Yd),Y(this,qr),Y(this,Ns),Y(this,Qd),Y(this,oc),Y(this,Zd),Y(this,nc),Y(this,Xd),Y(this,Jd),Y(this,Mn),Y(this,jd),Y(this,Rn),Y(this,Ds),Y(this,bt,null),Y(this,Gi,null),Y(this,ri,null),Y(this,Rs,new Set),Y(this,xs,void 0),Y(this,zi,!1),Y(this,xn,null),Y(this,Us,()=>{let e=q(this,Rs),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}));Et(this,Rs,t)}),Y(this,Fr,()=>{Q(this,qr,Pn).call(this),Q(this,Ns,rc).call(this,!1)}),Y(this,Kr,()=>{Q(this,qr,Pn).call(this)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=J(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.container=this.shadowRoot.querySelector("#container"),this.defaultSlot=this.shadowRoot.querySelector("slot:not([name])"),this.shadowRoot.addEventListener("slotchange",this),Et(this,xs,new MutationObserver(q(this,Us))),q(this,xs).observe(this.defaultSlot,{childList:!0})}static get observedAttributes(){return[qi.DISABLED,qi.HIDDEN,qi.STYLE,qi.ANCHOR,U.MEDIA_CONTROLLER]}static formatMenuItemText(e,t){return e}enable(){this.addEventListener("click",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this),this.addEventListener("invoke",this),this.addEventListener("toggle",this)}disable(){this.removeEventListener("click",this),this.removeEventListener("focusout",this),this.removeEventListener("keyup",this),this.removeEventListener("invoke",this),this.removeEventListener("toggle",this)}handleEvent(e){switch(e.type){case"slotchange":Q(this,Kd,gp).call(this,e);break;case"invoke":Q(this,Gd,Ep).call(this,e);break;case"click":Q(this,Qd,yp).call(this,e);break;case"toggle":Q(this,Zd,Ap).call(this,e);break;case"focusout":Q(this,Xd,kp).call(this,e);break;case"keydown":Q(this,Jd,Lp).call(this,e);break}}connectedCallback(){var e,t;Et(this,xn,Ko(this.shadowRoot,":host")),Q(this,Ps,qd).call(this),this.hasAttribute("disabled")||this.enable(),this.role||(this.role="menu"),Et(this,bt,fa(this)),(t=(e=q(this,bt))==null?void 0:e.associateElement)==null||t.call(e,this),this.hidden||(Mt(Dn(this),q(this,Fr)),Mt(this,q(this,Kr))),Q(this,Os,ic).call(this)}disconnectedCallback(){var e,t;Rt(Dn(this),q(this,Fr)),Rt(this,q(this,Kr)),this.disable(),(t=(e=q(this,bt))==null?void 0:e.unassociateElement)==null||t.call(e,this),Et(this,bt,null)}attributeChangedCallback(e,t,r){var o,n,a,l;e===qi.HIDDEN&&r!==t?(q(this,zi)||Et(this,zi,!0),this.hidden?Q(this,Yd,_p).call(this):Q(this,zd,bp).call(this),this.dispatchEvent(new Ms({oldState:this.hidden?"open":"closed",newState:this.hidden?"closed":"open",bubbles:!0}))):e===U.MEDIA_CONTROLLER?(t&&((n=(o=q(this,bt))==null?void 0:o.unassociateElement)==null||n.call(o,this),Et(this,bt,null)),r&&this.isConnected&&(Et(this,bt,fa(this)),(l=(a=q(this,bt))==null?void 0:a.associateElement)==null||l.call(a,this))):e===qi.DISABLED&&r!==t?r==null?this.enable():this.disable():e===qi.STYLE&&r!==t&&Q(this,Ps,qd).call(this)}formatMenuItemText(e,t){return this.constructor.formatMenuItemText(e,t)}get anchor(){return this.getAttribute("anchor")}set anchor(e){this.setAttribute("anchor",`${e}`)}get anchorElement(){var e;return this.anchor?(e=Ci(this))==null?void 0:e.querySelector(`#${this.anchor}`):null}get items(){return this.defaultSlot.assignedElements({flatten:!0}).filter(Vg)}get radioGroupItems(){return this.items.filter(e=>e.role==="menuitemradio")}get checkedItems(){return this.items.filter(e=>e.checked)}get value(){var e,t;return(t=(e=this.checkedItems[0])==null?void 0:e.value)!=null?t:""}set value(e){let t=this.items.find(r=>r.value===e);t&&Q(this,Ds,ec).call(this,t)}focus(){if(Et(this,Gi,Fo()),this.items.length){Q(this,Rn,$s).call(this,this.items[0]),this.items[0].focus();return}let e=this.querySelector('[autofocus], [tabindex]:not([tabindex="-1"]), [role="menu"]');e==null||e.focus()}handleSelect(e){var t;let r=Q(this,Mn,Hs).call(this,e);r&&(Q(this,Ds,ec).call(this,r,r.type==="checkbox"),q(this,ri)&&!this.hidden&&((t=q(this,Gi))==null||t.focus(),this.hidden=!0))}get keysUsed(){return["Enter","Escape","Tab"," ","ArrowDown","ArrowUp","Home","End"]}handleMove(e){var t,r;let{key:o}=e,n=this.items,a=(r=(t=Q(this,Mn,Hs).call(this,e))!=null?t:Q(this,jd,wp).call(this))!=null?r:n[0],l=n.indexOf(a),c=Math.max(0,l);o==="ArrowDown"?c++:o==="ArrowUp"?c--:e.key==="Home"?c=0:e.key==="End"&&(c=n.length-1),c<0&&(c=n.length-1),c>n.length-1&&(c=0),Q(this,Rn,$s).call(this,n[c]),n[c].focus()}};bt=new WeakMap;Gi=new WeakMap;ri=new WeakMap;Rs=new WeakMap;xs=new WeakMap;zi=new WeakMap;xn=new WeakMap;Kd=new WeakSet;gp=function(i){let e=i.target;for(let t of e.assignedNodes({flatten:!0}))t.nodeType===3&&t.textContent.trim()===""&&t.remove();["header","title"].includes(e.name)&&Q(this,Os,ic).call(this),e.name||q(this,Us).call(this)};Os=new WeakSet;ic=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};Us=new WeakMap;Ps=new WeakSet;qd=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")};Gd=new WeakSet;Ep=function(i){Et(this,ri,i.relatedTarget),Te(this,i.relatedTarget)||(this.hidden=!this.hidden)};zd=new WeakSet;bp=function(){var i;(i=q(this,ri))==null||i.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",()=>this.focus(),{once:!0}),Mt(Dn(this),q(this,Fr)),Mt(this,q(this,Kr))};Yd=new WeakSet;_p=function(){var i;(i=q(this,ri))==null||i.setAttribute("aria-expanded","false"),Rt(Dn(this),q(this,Fr)),Rt(this,q(this,Kr))};Fr=new WeakMap;Kr=new WeakMap;qr=new WeakSet;Pn=function(i){if(this.hasAttribute("mediacontroller")&&!this.anchor||this.hidden||!this.anchorElement)return;let{x:e,y:t}=vp({anchor:this.anchorElement,floating:this,placement:"top-start"});i??(i=this.offsetWidth);let o=Dn(this).getBoundingClientRect(),n=o.width-e-i,a=o.height-t-this.offsetHeight,{style:l}=q(this,xn);l.setProperty("position","absolute"),l.setProperty("right",`${Math.max(0,n)}px`),l.setProperty("--_menu-bottom",`${a}px`);let c=getComputedStyle(this),h=l.getPropertyValue("--_menu-bottom")===c.bottom?a:parseFloat(c.bottom),p=o.height-h-parseFloat(c.marginBottom);this.style.setProperty("--_menu-max-height",`${p}px`)};Ns=new WeakSet;rc=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,xn);if(i||r.setProperty("--media-menu-transition-in","none"),t){let o=t.offsetHeight,n=Math.max(t.offsetWidth,e.offsetWidth);this.style.setProperty("min-width",`${n}px`),this.style.setProperty("min-height",`${o}px`),Q(this,qr,Pn).call(this,n)}else this.style.removeProperty("min-width"),this.style.removeProperty("min-height"),Q(this,qr,Pn).call(this);r.removeProperty("--media-menu-transition-in")};Qd=new WeakSet;yp=function(i){var e;if(i.stopPropagation(),i.composedPath().includes(q(this,oc,Tp))){(e=q(this,Gi))==null||e.focus(),this.hidden=!0;return}let t=Q(this,Mn,Hs).call(this,i);!t||t.hasAttribute("disabled")||(Q(this,Rn,$s).call(this,t),this.handleSelect(i))};oc=new WeakSet;Tp=function(){var i;return(i=this.shadowRoot.querySelector('slot[name="header"]').assignedElements({flatten:!0}))==null?void 0:i.find(t=>t.matches('button[part~="back"]'))};Zd=new WeakSet;Ap=function(i){if(i.target===this)return;Q(this,nc,Sp).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 ii({relatedTarget:t}));for(let t of e)t.setAttribute("aria-expanded",`${!t.submenuElement.hidden}`);Q(this,Ns,rc).call(this,!0)};nc=new WeakSet;Sp=function(){let e=this.querySelector('[role="menuitem"] > [role="menu"]:not([hidden])');this.container.classList.toggle("has-expanded",!!e)};Xd=new WeakSet;kp=function(i){var e;Te(this,i.relatedTarget)||(q(this,zi)&&((e=q(this,Gi))==null||e.focus()),q(this,ri)&&q(this,ri)!==i.relatedTarget&&!this.hidden&&(this.hidden=!0))};Jd=new WeakSet;Lp=function(i){var e,t,r,o,n;let{key:a,ctrlKey:l,altKey:c,metaKey:v}=i;if(!(l||c||v)&&this.keysUsed.includes(a))if(i.preventDefault(),i.stopPropagation(),a==="Tab"){if(q(this,zi)){this.hidden=!0;return}i.shiftKey?(t=(e=this.previousElementSibling)==null?void 0:e.focus)==null||t.call(e):(o=(r=this.nextElementSibling)==null?void 0:r.focus)==null||o.call(r),this.blur()}else a==="Escape"?((n=q(this,Gi))==null||n.focus(),q(this,zi)&&(this.hidden=!0)):a==="Enter"||a===" "?this.handleSelect(i):this.handleMove(i)};Mn=new WeakSet;Hs=function(i){return i.composedPath().find(e=>["menuitemradio","menuitemcheckbox"].includes(e.role))};jd=new WeakSet;wp=function(){return this.items.find(i=>i.tabIndex===0)};Rn=new WeakSet;$s=function(i){for(let e of this.items)e.tabIndex=e===i?0:-1};Ds=new WeakSet;ec=function(i,e){let t=[...this.checkedItems];i.type==="radio"&&this.radioGroupItems.forEach(r=>r.checked=!1),e?i.checked=!i.checked:i.checked=!0,this.checkedItems.some((r,o)=>r!=t[o])&&this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))};se.shadowRootOptions={mode:"open"};se.getTemplateHTML=Bg;function Vg(i){return["menuitem","menuitemradio","menuitemcheckbox"].includes(i==null?void 0:i.role)}function Dn(i){var e;return(e=i.getAttribute("bounds")?ot(i,`#${i.getAttribute("bounds")}`):Z(i)||i.parentElement)!=null?e:i}d.customElements.get("media-chrome-menu")||d.customElements.define("media-chrome-menu",se);var uc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},yt=(i,e,t)=>(uc(i,e,"read from private field"),t?t.call(i):e.get(i)),Ot=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ac=(i,e,t,r)=>(uc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),et=(i,e,t)=>(uc(i,e,"access private method"),t),Bs,Un,sc,Cp,Ws,hc,pc,Ip,Tt,Gr,Nn,lc,Mp,Vs,dc;function Wg(i){return`
|
|
1812
|
+
`}var Xi={STYLE:"style",HIDDEN:"hidden",DISABLED:"disabled",ANCHOR:"anchor"},le=class extends c.HTMLElement{constructor(){if(super(),Q(this,uc),Q(this,Xs),Q(this,Qs),Q(this,pc),Q(this,mc),Q(this,vc),Q(this,jr),Q(this,js),Q(this,fc),Q(this,kc),Q(this,Ec),Q(this,Lc),Q(this,gc),Q(this,bc),Q(this,Kn),Q(this,_c),Q(this,Gn),Q(this,Zs),Q(this,_t,null),Q(this,Ji,null),Q(this,li,null),Q(this,zs,new Set),Q(this,Ys,void 0),Q(this,ji,!1),Q(this,qn,null),Q(this,Js,()=>{let e=G(this,zs),t=new Set(this.items);for(let r of e)t.has(r)||this.dispatchEvent(new CustomEvent("removemenuitem",{detail:r}));for(let r of t)e.has(r)||this.dispatchEvent(new CustomEvent("addmenuitem",{detail:r}));bt(this,zs,t)}),Q(this,Xr,()=>{Z(this,jr,zn).call(this),Z(this,js,Sc).call(this,!1)}),Q(this,Jr,()=>{Z(this,jr,zn).call(this)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.container=this.shadowRoot.querySelector("#container"),this.defaultSlot=this.shadowRoot.querySelector("slot:not([name])"),this.shadowRoot.addEventListener("slotchange",this),bt(this,Ys,new MutationObserver(G(this,Js))),G(this,Ys).observe(this.defaultSlot,{childList:!0})}static get observedAttributes(){return[Xi.DISABLED,Xi.HIDDEN,Xi.STYLE,Xi.ANCHOR,N.MEDIA_CONTROLLER]}static formatMenuItemText(e,t){return e}enable(){this.addEventListener("click",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this),this.addEventListener("invoke",this),this.addEventListener("toggle",this)}disable(){this.removeEventListener("click",this),this.removeEventListener("focusout",this),this.removeEventListener("keyup",this),this.removeEventListener("invoke",this),this.removeEventListener("toggle",this)}handleEvent(e){switch(e.type){case"slotchange":Z(this,uc,Hp).call(this,e);break;case"invoke":Z(this,pc,$p).call(this,e);break;case"click":Z(this,fc,Wp).call(this,e);break;case"toggle":Z(this,Ec,Kp).call(this,e);break;case"focusout":Z(this,gc,qp).call(this,e);break;case"keydown":Z(this,bc,zp).call(this,e);break}}connectedCallback(){var e,t;bt(this,qn,nn(this.shadowRoot,":host")),Z(this,Qs,hc).call(this),this.hasAttribute("disabled")||this.enable(),this.role||(this.role="menu"),bt(this,_t,xa(this)),(t=(e=G(this,_t))==null?void 0:e.associateElement)==null||t.call(e,this),this.hidden||(Rt(Yn(this),G(this,Xr)),Rt(this,G(this,Jr))),Z(this,Xs,Ac).call(this)}disconnectedCallback(){var e,t;xt(Yn(this),G(this,Xr)),xt(this,G(this,Jr)),this.disable(),(t=(e=G(this,_t))==null?void 0:e.unassociateElement)==null||t.call(e,this),bt(this,_t,null)}attributeChangedCallback(e,t,r){var o,n,a,l;e===Xi.HIDDEN&&r!==t?(G(this,ji)||bt(this,ji,!0),this.hidden?Z(this,vc,Vp).call(this):Z(this,mc,Bp).call(this),this.dispatchEvent(new qs({oldState:this.hidden?"open":"closed",newState:this.hidden?"closed":"open",bubbles:!0}))):e===N.MEDIA_CONTROLLER?(t&&((n=(o=G(this,_t))==null?void 0:o.unassociateElement)==null||n.call(o,this),bt(this,_t,null)),r&&this.isConnected&&(bt(this,_t,xa(this)),(l=(a=G(this,_t))==null?void 0:a.associateElement)==null||l.call(a,this))):e===Xi.DISABLED&&r!==t?r==null?this.enable():this.disable():e===Xi.STYLE&&r!==t&&Z(this,Qs,hc).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=Di(this))==null?void 0:e.querySelector(`#${this.anchor}`):null}get items(){return this.defaultSlot.assignedElements({flatten:!0}).filter(ag)}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&&Z(this,Zs,yc).call(this,t)}focus(){if(bt(this,Ji,on()),this.items.length){Z(this,Gn,tl).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=Z(this,Kn,el).call(this,e);r&&(Z(this,Zs,yc).call(this,r,r.type==="checkbox"),G(this,li)&&!this.hidden&&((t=G(this,Ji))==null||t.focus(),this.hidden=!0))}get keysUsed(){return["Enter","Escape","Tab"," ","ArrowDown","ArrowUp","Home","End"]}handleMove(e){var t,r;let{key:o}=e,n=this.items,a=(r=(t=Z(this,Kn,el).call(this,e))!=null?t:Z(this,_c,Yp).call(this))!=null?r:n[0],l=n.indexOf(a),d=Math.max(0,l);o==="ArrowDown"?d++:o==="ArrowUp"?d--:e.key==="Home"?d=0:e.key==="End"&&(d=n.length-1),d<0&&(d=n.length-1),d>n.length-1&&(d=0),Z(this,Gn,tl).call(this,n[d]),n[d].focus()}};_t=new WeakMap;Ji=new WeakMap;li=new WeakMap;zs=new WeakMap;Ys=new WeakMap;ji=new WeakMap;qn=new WeakMap;uc=new WeakSet;Hp=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)&&Z(this,Xs,Ac).call(this),e.name||G(this,Js).call(this)};Xs=new WeakSet;Ac=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};Js=new WeakMap;Qs=new WeakSet;hc=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")};pc=new WeakSet;$p=function(i){bt(this,li,i.relatedTarget),Ae(this,i.relatedTarget)||(this.hidden=!this.hidden)};mc=new WeakSet;Bp=function(){var i;(i=G(this,li))==null||i.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",()=>this.focus(),{once:!0}),Rt(Yn(this),G(this,Xr)),Rt(this,G(this,Jr))};vc=new WeakSet;Vp=function(){var i;(i=G(this,li))==null||i.setAttribute("aria-expanded","false"),xt(Yn(this),G(this,Xr)),xt(this,G(this,Jr))};Xr=new WeakMap;Jr=new WeakMap;jr=new WeakSet;zn=function(i){if(this.hasAttribute("mediacontroller")&&!this.anchor||this.hidden||!this.anchorElement)return;let{x:e,y:t}=Np({anchor:this.anchorElement,floating:this,placement:"top-start"});i??(i=this.offsetWidth);let o=Yn(this).getBoundingClientRect(),n=o.width-e-i,a=o.height-t-this.offsetHeight,{style:l}=G(this,qn);l.setProperty("position","absolute"),l.setProperty("right",`${Math.max(0,n)}px`),l.setProperty("--_menu-bottom",`${a}px`);let d=getComputedStyle(this),h=l.getPropertyValue("--_menu-bottom")===d.bottom?a:parseFloat(d.bottom),p=o.height-h-parseFloat(d.marginBottom);this.style.setProperty("--_menu-max-height",`${p}px`)};js=new WeakSet;Sc=function(i){let e=this.querySelector('[role="menuitem"][aria-haspopup][aria-expanded="true"]'),t=e==null?void 0:e.querySelector('[role="menu"]'),{style:r}=G(this,qn);if(i||r.setProperty("--media-menu-transition-in","none"),t){let o=t.offsetHeight,n=Math.max(t.offsetWidth,e.offsetWidth);this.style.setProperty("min-width",`${n}px`),this.style.setProperty("min-height",`${o}px`),Z(this,jr,zn).call(this,n)}else this.style.removeProperty("min-width"),this.style.removeProperty("min-height"),Z(this,jr,zn).call(this);r.removeProperty("--media-menu-transition-in")};fc=new WeakSet;Wp=function(i){var e;if(i.stopPropagation(),i.composedPath().includes(G(this,kc,Fp))){(e=G(this,Ji))==null||e.focus(),this.hidden=!0;return}let t=Z(this,Kn,el).call(this,i);!t||t.hasAttribute("disabled")||(Z(this,Gn,tl).call(this,t),this.handleSelect(i))};kc=new WeakSet;Fp=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"]'))};Ec=new WeakSet;Kp=function(i){if(i.target===this)return;Z(this,Lc,Gp).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 si({relatedTarget:t}));for(let t of e)t.setAttribute("aria-expanded",`${!t.submenuElement.hidden}`);Z(this,js,Sc).call(this,!0)};Lc=new WeakSet;Gp=function(){let e=this.querySelector('[role="menuitem"] > [role="menu"]:not([hidden])');this.container.classList.toggle("has-expanded",!!e)};gc=new WeakSet;qp=function(i){var e;Ae(this,i.relatedTarget)||(G(this,ji)&&((e=G(this,Ji))==null||e.focus()),G(this,li)&&G(this,li)!==i.relatedTarget&&!this.hidden&&(this.hidden=!0))};bc=new WeakSet;zp=function(i){var e,t,r,o,n;let{key:a,ctrlKey:l,altKey:d,metaKey:v}=i;if(!(l||d||v)&&this.keysUsed.includes(a))if(i.preventDefault(),i.stopPropagation(),a==="Tab"){if(G(this,ji)){this.hidden=!0;return}i.shiftKey?(t=(e=this.previousElementSibling)==null?void 0:e.focus)==null||t.call(e):(o=(r=this.nextElementSibling)==null?void 0:r.focus)==null||o.call(r),this.blur()}else a==="Escape"?((n=G(this,Ji))==null||n.focus(),G(this,ji)&&(this.hidden=!0)):a==="Enter"||a===" "?this.handleSelect(i):this.handleMove(i)};Kn=new WeakSet;el=function(i){return i.composedPath().find(e=>["menuitemradio","menuitemcheckbox"].includes(e.role))};_c=new WeakSet;Yp=function(){return this.items.find(i=>i.tabIndex===0)};Gn=new WeakSet;tl=function(i){for(let e of this.items)e.tabIndex=e===i?0:-1};Zs=new WeakSet;yc=function(i,e){let t=[...this.checkedItems];i.type==="radio"&&this.radioGroupItems.forEach(r=>r.checked=!1),e?i.checked=!i.checked:i.checked=!0,this.checkedItems.some((r,o)=>r!=t[o])&&this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))};le.shadowRootOptions={mode:"open"};le.getTemplateHTML=ng;function ag(i){return["menuitem","menuitemradio","menuitemcheckbox"].includes(i==null?void 0:i.role)}function Yn(i){var e;return(e=i.getAttribute("bounds")?nt(i,`#${i.getAttribute("bounds")}`):X(i)||i.parentElement)!=null?e:i}c.customElements.get("media-chrome-menu")||c.customElements.define("media-chrome-menu",le);var xc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Tt=(i,e,t)=>(xc(i,e,"read from private field"),t?t.call(i):e.get(i)),Nt=(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)},Cc=(i,e,t,r)=>(xc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),it=(i,e,t)=>(xc(i,e,"access private method"),t),il,Zn,Ic,Qp,ol,Pc,Dc,Zp,At,eo,Xn,wc,Xp,rl,Mc;function sg(i){return`
|
|
1813
1813
|
<style>
|
|
1814
1814
|
:host {
|
|
1815
1815
|
transition: var(--media-menu-item-transition,
|
|
@@ -1927,8 +1927,8 @@ bp-player[has-error] {
|
|
|
1927
1927
|
${this.getSuffixSlotInnerHTML(i)}
|
|
1928
1928
|
</slot>
|
|
1929
1929
|
<slot name="submenu"></slot>
|
|
1930
|
-
`}function
|
|
1931
|
-
${
|
|
1930
|
+
`}function lg(i){return""}var qe={TYPE:"type",VALUE:"value",CHECKED:"checked",DISABLED:"disabled"},Be=class extends c.HTMLElement{constructor(){if(super(),Nt(this,Ic),Nt(this,ol),Nt(this,Dc),Nt(this,eo),Nt(this,wc),Nt(this,rl),Nt(this,il,!1),Nt(this,Zn,void 0),Nt(this,At,()=>{var e,t;this.submenuElement.items&&this.setAttribute("submenusize",`${this.submenuElement.items.length}`);let r=this.shadowRoot.querySelector('slot[name="description"]'),o=(e=this.submenuElement.checkedItems)==null?void 0:e[0],n=(t=o==null?void 0:o.dataset.description)!=null?t:o==null?void 0:o.text,a=ee.createElement("span");a.textContent=n??"",r.replaceChildren(a)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.shadowRoot.addEventListener("slotchange",this)}static get observedAttributes(){return[qe.TYPE,qe.DISABLED,qe.CHECKED,qe.VALUE]}enable(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","-1"),Qn(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":it(this,Ic,Qp).call(this,e);break;case"click":this.handleClick(e);break;case"keydown":it(this,wc,Xp).call(this,e);break;case"keyup":it(this,eo,Xn).call(this,e);break}}attributeChangedCallback(e,t,r){e===qe.CHECKED&&Qn(this)&&!Tt(this,il)?this.setAttribute("aria-checked",r!=null?"true":"false"):e===qe.TYPE&&r!==t?this.role="menuitem"+r:e===qe.DISABLED&&r!==t&&(r==null?this.enable():this.disable())}connectedCallback(){this.hasAttribute(qe.DISABLED)||this.enable(),this.role="menuitem"+this.type,Cc(this,Zn,Rc(this,this.parentNode)),it(this,rl,Mc).call(this),this.submenuElement&&it(this,ol,Pc).call(this)}disconnectedCallback(){this.disable(),it(this,rl,Mc).call(this),Cc(this,Zn,null)}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=Di(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(qe.TYPE))!=null?e:""}set type(e){this.setAttribute(qe.TYPE,`${e}`)}get value(){var e;return(e=this.getAttribute(qe.VALUE))!=null?e:this.text}set value(e){this.setAttribute(qe.VALUE,e)}get text(){var e;return((e=this.textContent)!=null?e:"").trim()}get checked(){if(Qn(this))return this.getAttribute("aria-checked")==="true"}set checked(e){Qn(this)&&(Cc(this,il,!0),this.setAttribute("aria-checked",e?"true":"false"),e?this.part.add("checked"):this.part.remove("checked"))}handleClick(e){Qn(this)||this.invokeTargetElement&&Ae(this,e.target)&&this.invokeTargetElement.dispatchEvent(new si({relatedTarget:this}))}get keysUsed(){return["Enter"," "]}};il=new WeakMap;Zn=new WeakMap;Ic=new WeakSet;Qp=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?it(this,ol,Pc).call(this):it(this,Dc,Zp).call(this))};ol=new WeakSet;Pc=async function(){this.setAttribute("aria-haspopup","menu"),this.setAttribute("aria-expanded",`${!this.submenuElement.hidden}`),this.submenuElement.addEventListener("change",Tt(this,At)),this.submenuElement.addEventListener("addmenuitem",Tt(this,At)),this.submenuElement.addEventListener("removemenuitem",Tt(this,At)),Tt(this,At).call(this)};Dc=new WeakSet;Zp=function(){this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.submenuElement.removeEventListener("change",Tt(this,At)),this.submenuElement.removeEventListener("addmenuitem",Tt(this,At)),this.submenuElement.removeEventListener("removemenuitem",Tt(this,At)),Tt(this,At).call(this)};At=new WeakMap;eo=new WeakSet;Xn=function(i){let{key:e}=i;if(!this.keysUsed.includes(e)){this.removeEventListener("keyup",it(this,eo,Xn));return}this.handleClick(i)};wc=new WeakSet;Xp=function(i){let{metaKey:e,altKey:t,key:r}=i;if(e||t||!this.keysUsed.includes(r)){this.removeEventListener("keyup",it(this,eo,Xn));return}this.addEventListener("keyup",it(this,eo,Xn),{once:!0})};rl=new WeakSet;Mc=function(){var i;let e=(i=Tt(this,Zn))==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")};Be.shadowRootOptions={mode:"open"};Be.getTemplateHTML=sg;Be.getSuffixSlotInnerHTML=lg;function Qn(i){return i.type==="radio"||i.type==="checkbox"}function Rc(i,e){if(!i)return null;let{host:t}=i.getRootNode();return!e&&t?Rc(i,t):e!=null&&e.items?e:Rc(e,e==null?void 0:e.parentNode)}c.customElements.get("media-chrome-menu-item")||c.customElements.define("media-chrome-menu-item",Be);function dg(i){return`
|
|
1931
|
+
${le.getTemplateHTML(i)}
|
|
1932
1932
|
<style>
|
|
1933
1933
|
:host {
|
|
1934
1934
|
--_menu-bg: rgb(20 20 30 / .8);
|
|
@@ -1962,8 +1962,8 @@ bp-player[has-error] {
|
|
|
1962
1962
|
--media-settings-menu-item-opacity: 0;
|
|
1963
1963
|
}
|
|
1964
1964
|
</style>
|
|
1965
|
-
`}var
|
|
1966
|
-
${
|
|
1965
|
+
`}var Jn=class extends le{get anchorElement(){return this.anchor!=="auto"?super.anchorElement:X(this).querySelector("media-settings-menu-button")}};Jn.getTemplateHTML=dg;c.customElements.get("media-settings-menu")||c.customElements.define("media-settings-menu",Jn);function cg(i){return`
|
|
1966
|
+
${Be.getTemplateHTML.call(this,i)}
|
|
1967
1967
|
<style>
|
|
1968
1968
|
slot:not([name="submenu"]) {
|
|
1969
1969
|
opacity: var(--media-settings-menu-item-opacity, var(--media-menu-item-opacity));
|
|
@@ -1973,11 +1973,11 @@ bp-player[has-error] {
|
|
|
1973
1973
|
background: transparent;
|
|
1974
1974
|
}
|
|
1975
1975
|
</style>
|
|
1976
|
-
`}function
|
|
1976
|
+
`}function ug(i){return`
|
|
1977
1977
|
<svg aria-hidden="true" viewBox="0 0 20 24">
|
|
1978
1978
|
<path d="m8.12 17.585-.742-.669 4.2-4.665-4.2-4.666.743-.669 4.803 5.335-4.803 5.334Z"/>
|
|
1979
1979
|
</svg>
|
|
1980
|
-
`}var
|
|
1980
|
+
`}var er=class extends Be{};er.shadowRootOptions={mode:"open"};er.getTemplateHTML=cg;er.getSuffixSlotInnerHTML=ug;c.customElements.get("media-settings-menu-item")||c.customElements.define("media-settings-menu-item",er);var Pe=class extends F{connectedCallback(){super.connectedCallback(),this.invokeTargetElement&&this.setAttribute("aria-haspopup","menu")}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=Di(this))==null?void 0:e.querySelector(`#${this.invokeTarget}`):null}handleClick(){var e;(e=this.invokeTargetElement)==null||e.dispatchEvent(new si({relatedTarget:this}))}};c.customElements.get("media-chrome-menu-button")||c.customElements.define("media-chrome-menu-button",Pe);function hg(){return`
|
|
1981
1981
|
<style>
|
|
1982
1982
|
:host([aria-expanded="true"]) slot[name=tooltip] {
|
|
1983
1983
|
display: none;
|
|
@@ -1988,27 +1988,27 @@ bp-player[has-error] {
|
|
|
1988
1988
|
<path d="M4.5 14.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Zm7.5 0a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Zm7.5 0a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z"/>
|
|
1989
1989
|
</svg>
|
|
1990
1990
|
</slot>
|
|
1991
|
-
`}function
|
|
1991
|
+
`}function pg(){return g("Settings")}var to=class extends Pe{static get observedAttributes(){return[...super.observedAttributes,"target"]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",g("settings"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:X(this).querySelector("media-settings-menu")}};to.getSlotTemplateHTML=hg;to.getTooltipContentHTML=pg;c.customElements.get("media-settings-menu-button")||c.customElements.define("media-settings-menu-button",to);var Hc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Jp=(i,e,t)=>(Hc(i,e,"read from private field"),t?t.call(i):e.get(i)),nl=(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)},Oc=(i,e,t,r)=>(Hc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),al=(i,e,t)=>(Hc(i,e,"access private method"),t),jn,dl,sl,Nc,ll,Uc,cl=class extends le{constructor(){super(...arguments),nl(this,sl),nl(this,ll),nl(this,jn,[]),nl(this,dl,void 0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_AUDIO_TRACK_LIST,s.MEDIA_AUDIO_TRACK_ENABLED,s.MEDIA_AUDIO_TRACK_UNAVAILABLE]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_AUDIO_TRACK_ENABLED&&t!==r?this.value=r:e===s.MEDIA_AUDIO_TRACK_LIST&&t!==r&&(Oc(this,jn,th(r??"")),al(this,sl,Nc).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",al(this,ll,Uc))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",al(this,ll,Uc))}get anchorElement(){var e;return this.anchor!=="auto"?super.anchorElement:(e=X(this))==null?void 0:e.querySelector("media-audio-track-menu-button")}get mediaAudioTrackList(){return Jp(this,jn)}set mediaAudioTrackList(e){Oc(this,jn,e),al(this,sl,Nc).call(this)}get mediaAudioTrackEnabled(){var e;return(e=x(this,s.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){P(this,s.MEDIA_AUDIO_TRACK_ENABLED,e)}};jn=new WeakMap;dl=new WeakMap;sl=new WeakSet;Nc=function(){if(Jp(this,dl)===JSON.stringify(this.mediaAudioTrackList))return;Oc(this,dl,JSON.stringify(this.mediaAudioTrackList));let i=this.mediaAudioTrackList;this.defaultSlot.textContent="",i.sort((e,t)=>e.id.localeCompare(t.id,void 0,{numeric:!0}));for(let e of i){let t=this.formatMenuItemText(e.label,e),r=yt({type:"radio",text:t,value:`${e.id}`,checked:e.enabled});r.prepend(tt(this,"checked-indicator")),this.defaultSlot.append(r)}};ll=new WeakSet;Uc=function(){if(this.value==null)return;let i=new c.CustomEvent(b.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",cl);var mg=`<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 vg(){return`
|
|
1995
1995
|
<style>
|
|
1996
1996
|
:host([aria-expanded="true"]) slot[name=tooltip] {
|
|
1997
1997
|
display: none;
|
|
1998
1998
|
}
|
|
1999
1999
|
</style>
|
|
2000
|
-
<slot name="icon">${
|
|
2001
|
-
`}function
|
|
2000
|
+
<slot name="icon">${mg}</slot>
|
|
2001
|
+
`}function fg(){return g("Audio")}var jp=i=>{let e=g("Audio");i.setAttribute("aria-label",e)},io=class extends Pe{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_AUDIO_TRACK_ENABLED,s.MEDIA_AUDIO_TRACK_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),jp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_LANG&&jp(this)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=X(this))==null?void 0:e.querySelector("media-audio-track-menu")}get mediaAudioTrackEnabled(){var e;return(e=x(this,s.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){P(this,s.MEDIA_AUDIO_TRACK_ENABLED,e)}};io.getSlotTemplateHTML=vg;io.getTooltipContentHTML=fg;c.customElements.get("media-audio-track-menu-button")||c.customElements.define("media-audio-track-menu-button",io);var Wc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Eg=(i,e,t)=>(Wc(i,e,"read from private field"),t?t.call(i):e.get(i)),$c=(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)},gg=(i,e,t,r)=>(Wc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ul=(i,e,t)=>(Wc(i,e,"access private method"),t),ml,hl,Bc,pl,Vc,bg=`
|
|
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
|
-
</svg>`;function
|
|
2005
|
-
${
|
|
2006
|
-
<slot name="captions-indicator" hidden>${
|
|
2007
|
-
`}var
|
|
2004
|
+
</svg>`;function _g(i){return`
|
|
2005
|
+
${le.getTemplateHTML(i)}
|
|
2006
|
+
<slot name="captions-indicator" hidden>${bg}</slot>
|
|
2007
|
+
`}var ea=class extends le{constructor(){super(...arguments),$c(this,hl),$c(this,pl),$c(this,ml,void 0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_SUBTITLES_LIST,s.MEDIA_SUBTITLES_SHOWING]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_SUBTITLES_LIST&&t!==r?ul(this,hl,Bc).call(this):e===s.MEDIA_SUBTITLES_SHOWING&&t!==r&&(this.value=r||"",ul(this,hl,Bc).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",ul(this,pl,Vc))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",ul(this,pl,Vc))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:X(this).querySelector("media-captions-menu-button")}get mediaSubtitlesList(){return em(this,s.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){tm(this,s.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return em(this,s.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){tm(this,s.MEDIA_SUBTITLES_SHOWING,e)}};ml=new WeakMap;hl=new WeakSet;Bc=function(){var i;let e=Eg(this,ml)!==JSON.stringify(this.mediaSubtitlesList),t=this.value!==this.getAttribute(s.MEDIA_SUBTITLES_SHOWING);if(!e&&!t)return;gg(this,ml,JSON.stringify(this.mediaSubtitlesList)),this.defaultSlot.textContent="";let r=!this.value,o=yt({type:"radio",text:this.formatMenuItemText(g("Off")),value:"off",checked:r});o.prepend(tt(this,"checked-indicator")),this.defaultSlot.append(o);let n=this.mediaSubtitlesList;for(let a of n){let l=yt({type:"radio",text:this.formatMenuItemText(a.label,a),value:Ga(a),checked:this.value==Ga(a)});l.prepend(tt(this,"checked-indicator")),((i=a.kind)!=null?i:"subs")==="captions"&&l.append(tt(this,"captions-indicator")),this.defaultSlot.append(l)}};pl=new WeakSet;Vc=function(){let i=this.mediaSubtitlesShowing,e=this.getAttribute(s.MEDIA_SUBTITLES_SHOWING),t=this.value!==e;if(i!=null&&i.length&&t&&this.dispatchEvent(new c.CustomEvent(b.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:i})),!this.value||!t)return;let r=new c.CustomEvent(b.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(r)};ea.getTemplateHTML=_g;var em=(i,e)=>{let t=i.getAttribute(e);return t?Hi(t):[]},tm=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let r=Dt(t);i.getAttribute(e)!==r&&i.setAttribute(e,r)};c.customElements.get("media-captions-menu")||c.customElements.define("media-captions-menu",ea);var yg=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
2008
2008
|
<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"/>
|
|
2009
|
-
</svg>`,
|
|
2009
|
+
</svg>`,Tg=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
2010
2010
|
<path d="M17.73 14.09a1.4 1.4 0 0 1-1 .37 1.579 1.579 0 0 1-1.27-.58A3 3 0 0 1 15 12a2.8 2.8 0 0 1 .5-1.85 1.63 1.63 0 0 1 1.29-.57 1.47 1.47 0 0 1 1.51 1.2l1.43-.34A2.89 2.89 0 0 0 19 9.07a3 3 0 0 0-2.14-.78 3.14 3.14 0 0 0-2.42 1 3.91 3.91 0 0 0-.93 2.78 3.74 3.74 0 0 0 .92 2.66 3.07 3.07 0 0 0 2.34 1 3.07 3.07 0 0 0 1.91-.57 3.17 3.17 0 0 0 1.07-1.74l-1.4-.45c-.083.43-.3.822-.62 1.12Zm-7.22 0a1.43 1.43 0 0 1-1 .37 1.58 1.58 0 0 1-1.27-.58A3 3 0 0 1 7.76 12a2.8 2.8 0 0 1 .5-1.85 1.63 1.63 0 0 1 1.29-.57 1.47 1.47 0 0 1 1.51 1.2l1.43-.34a2.81 2.81 0 0 0-.74-1.32 2.94 2.94 0 0 0-2.13-.78 3.18 3.18 0 0 0-2.43 1 4 4 0 0 0-.92 2.78 3.74 3.74 0 0 0 .92 2.66 3.07 3.07 0 0 0 2.34 1 3.07 3.07 0 0 0 1.91-.57 3.23 3.23 0 0 0 1.07-1.74l-1.4-.45a2.06 2.06 0 0 1-.6 1.07Zm12.32-8.41a2.59 2.59 0 0 0-2.3-2.51C18.72 3.05 15.86 3 13 3c-2.86 0-5.72.05-7.53.17a2.59 2.59 0 0 0-2.3 2.51c-.23 4.207-.23 8.423 0 12.63a2.57 2.57 0 0 0 2.3 2.5c1.81.13 4.67.19 7.53.19 2.86 0 5.72-.06 7.53-.19a2.57 2.57 0 0 0 2.3-2.5c.23-4.207.23-8.423 0-12.63Zm-1.49 12.53a1.11 1.11 0 0 1-.91 1.11c-1.67.11-4.45.18-7.43.18-2.98 0-5.76-.07-7.43-.18a1.11 1.11 0 0 1-.91-1.11c-.21-4.14-.21-8.29 0-12.43a1.11 1.11 0 0 1 .91-1.11C7.24 4.56 10 4.49 13 4.49s5.76.07 7.43.18a1.11 1.11 0 0 1 .91 1.11c.21 4.14.21 8.29 0 12.43Z"/>
|
|
2011
|
-
</svg>`;function
|
|
2011
|
+
</svg>`;function Ag(){return`
|
|
2012
2012
|
<style>
|
|
2013
2013
|
:host([data-captions-enabled="true"]) slot[name=off] {
|
|
2014
2014
|
display: none !important;
|
|
@@ -2025,10 +2025,10 @@ bp-player[has-error] {
|
|
|
2025
2025
|
</style>
|
|
2026
2026
|
|
|
2027
2027
|
<slot name="icon">
|
|
2028
|
-
<slot name="on">${
|
|
2029
|
-
<slot name="off">${
|
|
2028
|
+
<slot name="on">${yg}</slot>
|
|
2029
|
+
<slot name="off">${Tg}</slot>
|
|
2030
2030
|
</slot>
|
|
2031
|
-
`}function
|
|
2031
|
+
`}function Sg(){return g("Captions")}var im=i=>{i.setAttribute("data-captions-enabled",qa(i).toString())},rm=i=>{i.setAttribute("aria-label",g("closed captions"))},ro=class extends Pe{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_SUBTITLES_LIST,s.MEDIA_SUBTITLES_SHOWING,s.MEDIA_LANG]}connectedCallback(){super.connectedCallback(),rm(this),im(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_SUBTITLES_SHOWING?im(this):e===s.MEDIA_LANG&&rm(this)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=X(this))==null?void 0:e.querySelector("media-captions-menu")}get mediaSubtitlesList(){return om(this,s.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){nm(this,s.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return om(this,s.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){nm(this,s.MEDIA_SUBTITLES_SHOWING,e)}};ro.getSlotTemplateHTML=Ag;ro.getTooltipContentHTML=Sg;var om=(i,e)=>{let t=i.getAttribute(e);return t?Hi(t):[]},nm=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let r=Dt(t);i.getAttribute(e)!==r&&i.setAttribute(e,r)};c.customElements.get("media-captions-menu-button")||c.customElements.define("media-captions-menu-button",ro);var am=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},no=(i,e,t)=>(am(i,e,"read from private field"),t?t.call(i):e.get(i)),Fc=(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)},oo=(i,e,t)=>(am(i,e,"access private method"),t),di,ao,ta,vl,Gc,Kc={RATES:"rates"},fl=class extends le{constructor(){super(),Fc(this,ao),Fc(this,vl),Fc(this,di,new ei(this,Kc.RATES,{defaultValue:Qd})),oo(this,ao,ta).call(this)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PLAYBACK_RATE,Kc.RATES]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_PLAYBACK_RATE&&t!=r?(this.value=r,oo(this,ao,ta).call(this)):e===Kc.RATES&&t!=r&&(no(this,di).value=r,oo(this,ao,ta).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",oo(this,vl,Gc))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",oo(this,vl,Gc))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:X(this).querySelector("media-playback-rate-menu-button")}get rates(){return no(this,di)}set rates(e){e?Array.isArray(e)?no(this,di).value=e.join(" "):typeof e=="string"&&(no(this,di).value=e):no(this,di).value="",oo(this,ao,ta).call(this)}get mediaPlaybackRate(){return H(this,s.MEDIA_PLAYBACK_RATE,zi)}set mediaPlaybackRate(e){B(this,s.MEDIA_PLAYBACK_RATE,e)}};di=new WeakMap;ao=new WeakSet;ta=function(){this.defaultSlot.textContent="";let i=this.mediaPlaybackRate,e=new Set(Array.from(no(this,di)).map(r=>Number(r)));i>0&&!e.has(i)&&e.add(i);let t=Array.from(e).sort((r,o)=>r-o);for(let r of t){let o=yt({type:"radio",text:this.formatMenuItemText(`${r}x`,r),value:r.toString(),checked:i===r});o.prepend(tt(this,"checked-indicator")),this.defaultSlot.append(o)}};vl=new WeakSet;Gc=function(){if(!this.value)return;let i=new c.CustomEvent(b.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",fl);var El=1;function kg(i){return`
|
|
2032
2032
|
<style>
|
|
2033
2033
|
:host {
|
|
2034
2034
|
min-width: 5ch;
|
|
@@ -2043,18 +2043,18 @@ bp-player[has-error] {
|
|
|
2043
2043
|
display: none;
|
|
2044
2044
|
}
|
|
2045
2045
|
</style>
|
|
2046
|
-
<slot name="icon">${i.mediaplaybackrate||
|
|
2047
|
-
`}function
|
|
2046
|
+
<slot name="icon">${i.mediaplaybackrate||El}x</slot>
|
|
2047
|
+
`}function Lg(){return g("Playback rate")}var so=class extends Pe{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PLAYBACK_RATE]}constructor(){var e;super(),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${(e=this.mediaPlaybackRate)!=null?e:El}x`}attributeChangedCallback(e,t,r){if(super.attributeChangedCallback(e,t,r),e===s.MEDIA_PLAYBACK_RATE){let o=r?+r:Number.NaN,n=Number.isNaN(o)?El:o;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",g("Playback rate {playbackRate}",{playbackRate:n}))}}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:X(this).querySelector("media-playback-rate-menu")}get mediaPlaybackRate(){return H(this,s.MEDIA_PLAYBACK_RATE,El)}set mediaPlaybackRate(e){B(this,s.MEDIA_PLAYBACK_RATE,e)}};so.getSlotTemplateHTML=kg;so.getTooltipContentHTML=Lg;c.customElements.get("media-playback-rate-menu-button")||c.customElements.define("media-playback-rate-menu-button",so);var zc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ia=(i,e,t)=>(zc(i,e,"read from private field"),t?t.call(i):e.get(i)),gl=(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)},sm=(i,e,t,r)=>(zc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),lo=(i,e,t)=>(zc(i,e,"access private method"),t),ra,uo,co,oa,bl,qc,_l=class extends le{constructor(){super(...arguments),gl(this,co),gl(this,bl),gl(this,ra,[]),gl(this,uo,{})}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_RENDITION_LIST,s.MEDIA_RENDITION_SELECTED,s.MEDIA_RENDITION_UNAVAILABLE,s.MEDIA_HEIGHT]}static formatMenuItemText(e,t){return super.formatMenuItemText(e,t)}static formatRendition(e,{showBitrate:t=!1}={}){let r=`${Math.min(e.width,e.height)}p`;if(t&&e.bitrate){let o=e.bitrate/1e6,n=`${o.toFixed(o<1?1:0)} Mbps`;return`${r} (${n})`}return this.formatMenuItemText(r,e)}static compareRendition(e,t){var r,o;return t.height===e.height?((r=t.bitrate)!=null?r:0)-((o=e.bitrate)!=null?o:0):t.height-e.height}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_RENDITION_SELECTED&&t!==r?(this.value=r??"auto",lo(this,co,oa).call(this)):e===s.MEDIA_RENDITION_LIST&&t!==r?(sm(this,ra,ju(r)),lo(this,co,oa).call(this)):e===s.MEDIA_HEIGHT&&t!==r&&lo(this,co,oa).call(this)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",lo(this,bl,qc))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",lo(this,bl,qc))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:X(this).querySelector("media-rendition-menu-button")}get mediaRenditionList(){return ia(this,ra)}set mediaRenditionList(e){sm(this,ra,e),lo(this,co,oa).call(this)}get mediaRenditionSelected(){return x(this,s.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){P(this,s.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return H(this,s.MEDIA_HEIGHT)}set mediaHeight(e){B(this,s.MEDIA_HEIGHT,e)}compareRendition(e,t){return this.constructor.compareRendition(e,t)}formatMenuItemText(e,t){return this.constructor.formatMenuItemText(e,t)}formatRendition(e,t){return this.constructor.formatRendition(e,t)}showRenditionBitrate(e){return this.mediaRenditionList.some(t=>t!==e&&t.height===e.height&&t.bitrate!==e.bitrate)}};ra=new WeakMap;uo=new WeakMap;co=new WeakSet;oa=function(){if(ia(this,uo).mediaRenditionList===JSON.stringify(this.mediaRenditionList)&&ia(this,uo).mediaHeight===this.mediaHeight)return;ia(this,uo).mediaRenditionList=JSON.stringify(this.mediaRenditionList),ia(this,uo).mediaHeight=this.mediaHeight;let i=this.mediaRenditionList.sort(this.compareRendition.bind(this)),e=i.find(a=>a.id===this.mediaRenditionSelected);for(let a of i)a.selected=a===e;this.defaultSlot.textContent="";let t=!this.mediaRenditionSelected;for(let a of i){let l=this.formatRendition(a,{showBitrate:this.showRenditionBitrate(a)}),d=yt({type:"radio",text:l,value:`${a.id}`,checked:a.selected&&!t});d.prepend(tt(this,"checked-indicator")),this.defaultSlot.append(d)}let r=e&&this.showRenditionBitrate(e),o=t?e?this.formatMenuItemText(`${g("Auto")} \u2022 ${this.formatRendition(e,{showBitrate:r})}`,e):this.formatMenuItemText(`${g("Auto")} (${this.mediaHeight}p)`):this.formatMenuItemText(g("Auto")),n=yt({type:"radio",text:o,value:"auto",checked:t});n.dataset.description=o,n.prepend(tt(this,"checked-indicator")),this.defaultSlot.append(n)};bl=new WeakSet;qc=function(){if(this.value==null)return;let i=new c.CustomEvent(b.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",_l);var Cg=`<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 Ig(){return`
|
|
2050
2050
|
<style>
|
|
2051
2051
|
:host([aria-expanded="true"]) slot[name=tooltip] {
|
|
2052
2052
|
display: none;
|
|
2053
2053
|
}
|
|
2054
2054
|
</style>
|
|
2055
|
-
<slot name="icon">${
|
|
2056
|
-
`}function
|
|
2057
|
-
${
|
|
2055
|
+
<slot name="icon">${Cg}</slot>
|
|
2056
|
+
`}function wg(){return g("Quality")}var ho=class extends Pe{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_RENDITION_SELECTED,s.MEDIA_RENDITION_UNAVAILABLE,s.MEDIA_HEIGHT]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",g("quality"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:X(this).querySelector("media-rendition-menu")}get mediaRenditionSelected(){return x(this,s.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){P(this,s.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return H(this,s.MEDIA_HEIGHT)}set mediaHeight(e){B(this,s.MEDIA_HEIGHT,e)}};ho.getSlotTemplateHTML=Ig;ho.getTooltipContentHTML=wg;c.customElements.get("media-rendition-menu-button")||c.customElements.define("media-rendition-menu-button",ho);var Zc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},kt=(i,e,t)=>(Zc(i,e,"read from private field"),t?t.call(i):e.get(i)),St=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},lm=(i,e,t,r)=>(Zc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ze=(i,e,t)=>(Zc(i,e,"access private method"),t),mo,na,Ll,tr,po,Xc,dm,yl,Yc,Tl,Qc,cm,Sl,kl,Al;function Mg(i){return`
|
|
2057
|
+
${le.getTemplateHTML(i)}
|
|
2058
2058
|
<style>
|
|
2059
2059
|
:host {
|
|
2060
2060
|
--_menu-bg: rgb(20 20 30 / .8);
|
|
@@ -2067,8 +2067,8 @@ bp-player[has-error] {
|
|
|
2067
2067
|
overflow: hidden;
|
|
2068
2068
|
}
|
|
2069
2069
|
</style>
|
|
2070
|
-
`}var
|
|
2071
|
-
${
|
|
2070
|
+
`}var aa=class extends le{constructor(){super(),St(this,na),St(this,tr),St(this,Xc),St(this,yl),St(this,Qc),St(this,mo,!1),St(this,Tl,e=>{let t=e.target,r=(t==null?void 0:t.nodeName)==="VIDEO",o=ze(this,yl,Yc).call(this,t);(r||o)&&(kt(this,mo)?ze(this,tr,po).call(this):ze(this,Qc,cm).call(this,e))}),St(this,Sl,e=>{let t=e.target,r=this.contains(t),o=e.button===2,n=(t==null?void 0:t.nodeName)==="VIDEO",a=ze(this,yl,Yc).call(this,t);r||o&&(n||a)||ze(this,tr,po).call(this)}),St(this,kl,e=>{e.key==="Escape"&&ze(this,tr,po).call(this)}),St(this,Al,e=>{var t,r;let o=e.target;if((t=o.matches)!=null&&t.call(o,'button[invoke="copy"]')){let n=(r=o.closest("media-context-menu-item"))==null?void 0:r.querySelector('input[slot="copy"]');n&&navigator.clipboard.writeText(n.value)}ze(this,tr,po).call(this)}),this.setAttribute("noautohide",""),ze(this,na,Ll).call(this)}connectedCallback(){super.connectedCallback(),X(this).addEventListener("contextmenu",kt(this,Tl)),this.addEventListener("click",kt(this,Al))}disconnectedCallback(){super.disconnectedCallback(),X(this).removeEventListener("contextmenu",kt(this,Tl)),this.removeEventListener("click",kt(this,Al)),document.removeEventListener("mousedown",kt(this,Sl)),document.removeEventListener("keydown",kt(this,kl))}};mo=new WeakMap;na=new WeakSet;Ll=function(){this.hidden=!kt(this,mo)};tr=new WeakSet;po=function(){lm(this,mo,!1),ze(this,na,Ll).call(this)};Xc=new WeakSet;dm=function(){document.querySelectorAll("media-context-menu").forEach(e=>{var t;e!==this&&ze(t=e,tr,po).call(t)})};yl=new WeakSet;Yc=function(i){return i?i.hasAttribute("slot")&&i.getAttribute("slot")==="media"?!0:i.nodeName.includes("-")&&i.tagName.includes("-")?i.hasAttribute("src")||i.hasAttribute("poster")||i.hasAttribute("preload")||i.hasAttribute("playsinline"):!1:!1};Tl=new WeakMap;Qc=new WeakSet;cm=function(i){i.preventDefault(),ze(this,Xc,dm).call(this),lm(this,mo,!0),this.style.position="fixed",this.style.left=`${i.clientX}px`,this.style.top=`${i.clientY}px`,ze(this,na,Ll).call(this),document.addEventListener("mousedown",kt(this,Sl),{once:!0}),document.addEventListener("keydown",kt(this,kl),{once:!0})};Sl=new WeakMap;kl=new WeakMap;Al=new WeakMap;aa.getTemplateHTML=Mg;c.customElements.get("media-context-menu")||c.customElements.define("media-context-menu",aa);function Rg(i){return`
|
|
2071
|
+
${Be.getTemplateHTML.call(this,i)}
|
|
2072
2072
|
<style>
|
|
2073
2073
|
::slotted(*) {
|
|
2074
2074
|
color: var(--media-text-color, white);
|
|
@@ -2080,16 +2080,16 @@ bp-player[has-error] {
|
|
|
2080
2080
|
min-height: var(--media-control-height, 24px);
|
|
2081
2081
|
}
|
|
2082
2082
|
</style>
|
|
2083
|
-
`}var
|
|
2083
|
+
`}var vo=class extends Be{};vo.shadowRootOptions={mode:"open"};vo.getTemplateHTML=Rg;c.customElements.get("media-context-menu-item")||c.customElements.define("media-context-menu-item",vo);var xg=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
|
2084
2084
|
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"/>
|
|
2085
|
-
</svg>`,
|
|
2085
|
+
</svg>`,Pg=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
|
2086
2086
|
<path d="M21 6H3c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 10H3V8h18v8zM9 10v4c0 .55-.45 1-1 1H5v-2h2v-2H5v-2h3c.55 0 1 .45 1 1zm4 4h2v1h-4v-6h2v2h2v1h-2v2zm6-3v1h-2v3h-2v-6h4v2h-2z"/>
|
|
2087
|
-
</svg>`,
|
|
2087
|
+
</svg>`,Dg=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
|
2088
2088
|
<path d="M24 8.98C20.93 5.9 16.69 4 12 4S3.07 5.9 0 8.98L12 21 24 8.98zM2.92 9.07C5.51 7.08 8.67 6 12 6s6.49 1.08 9.08 3.07l-1.43 1.43C17.5 8.94 14.86 8 12 8s-5.5.94-7.65 2.51L2.92 9.07zM12 18l-6.36-6.36C7.34 10.27 9.58 9.5 12 9.5s4.66.77 6.36 2.14L12 18z"/>
|
|
2089
2089
|
<line x1="2" y1="2" x2="22" y2="22" stroke="currentColor" stroke-width="2"/>
|
|
2090
|
-
</svg>`,
|
|
2090
|
+
</svg>`,Og=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
|
2091
2091
|
<path d="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z"/>
|
|
2092
|
-
</svg>`;function
|
|
2092
|
+
</svg>`;function Ng(i){switch(i){case"offline":return Pg;case"network":return Dg;case"security":return Og;default:return xg}}function Ug(i){switch(i){case"offline":return"Stream Unavailable";case"network":return"Connection Error";case"security":return"Access Denied";case"autoplay":return"Playback Blocked";case"media":return"Playback Error";case"setup":return"Configuration Error";default:return"An error occurred"}}var ci=class extends Ce{constructor(){super(...arguments);this.error=null;this.showCode=!1}render(){if(!this.error)return null;let t=this.error.category,r=Ng(t),o=Ug(t);return We`
|
|
2093
2093
|
<div part="icon">
|
|
2094
2094
|
<slot name="icon">${this.renderIcon(r)}</slot>
|
|
2095
2095
|
</div>
|
|
@@ -2099,7 +2099,7 @@ bp-player[has-error] {
|
|
|
2099
2099
|
<p part="message">
|
|
2100
2100
|
<slot name="message">${this.error.message}</slot>
|
|
2101
2101
|
</p>
|
|
2102
|
-
${this.showCode?
|
|
2102
|
+
${this.showCode?We`
|
|
2103
2103
|
<span part="code">
|
|
2104
2104
|
<slot name="code">Error ${this.error.code}</slot>
|
|
2105
2105
|
</span>
|
|
@@ -2107,7 +2107,7 @@ bp-player[has-error] {
|
|
|
2107
2107
|
<div part="actions">
|
|
2108
2108
|
<slot name="actions"></slot>
|
|
2109
2109
|
</div>
|
|
2110
|
-
`}renderIcon(t){let r=document.createElement("template");return r.innerHTML=t.trim(),r.content.cloneNode(!0)}};
|
|
2110
|
+
`}renderIcon(t){let r=document.createElement("template");return r.innerHTML=t.trim(),r.content.cloneNode(!0)}};ci.styles=$o`
|
|
2111
2111
|
:host {
|
|
2112
2112
|
display: flex;
|
|
2113
2113
|
flex-direction: column;
|
|
@@ -2168,7 +2168,7 @@ bp-player[has-error] {
|
|
|
2168
2168
|
[part="actions"] button {
|
|
2169
2169
|
cursor: pointer;
|
|
2170
2170
|
}
|
|
2171
|
-
`,
|
|
2171
|
+
`,U([W({type:Object})],ci.prototype,"error",2),U([W({type:Boolean})],ci.prototype,"showCode",2),ci=U([qt("bp-error-display")],ci);var um=`/**
|
|
2172
2172
|
* BP Default UI Styles
|
|
2173
2173
|
*
|
|
2174
2174
|
* Layer-based architecture.
|
|
@@ -2449,16 +2449,29 @@ bp-default-ui media-play-button.bp-center-play:active {
|
|
|
2449
2449
|
============================================
|
|
2450
2450
|
|
|
2451
2451
|
Hide default controls when user provides custom chrome.
|
|
2452
|
-
|
|
2452
|
+
|
|
2453
|
+
IMPORTANT: We use marker attributes (has-custom-*) instead of
|
|
2454
|
+
CSS :has(> [slot="..."]) selectors because:
|
|
2455
|
+
|
|
2456
|
+
1. _moveSlottedContent() moves slotted elements from direct children
|
|
2457
|
+
of bp-default-ui INTO media-controller
|
|
2458
|
+
2. For bottom-chrome, the slot attribute is also removed
|
|
2459
|
+
|
|
2460
|
+
After this DOM manipulation, :has(> [slot="..."]) no longer matches
|
|
2461
|
+
because the elements are no longer direct children of bp-default-ui.
|
|
2462
|
+
|
|
2463
|
+
The marker attributes are set by _moveSlottedContent() BEFORE moving
|
|
2464
|
+
elements, ensuring CSS can reliably detect custom chrome presence.
|
|
2453
2465
|
============================================ */
|
|
2454
2466
|
|
|
2455
|
-
/* Hide default
|
|
2456
|
-
bp-default-ui
|
|
2467
|
+
/* Hide default centered chrome (loading indicator + play button) when custom centered-chrome is provided */
|
|
2468
|
+
bp-default-ui[has-custom-centered-chrome] .bp-center-play,
|
|
2469
|
+
bp-default-ui[has-custom-centered-chrome] media-loading-indicator {
|
|
2457
2470
|
display: none !important;
|
|
2458
2471
|
}
|
|
2459
2472
|
|
|
2460
2473
|
/* Hide default control bar when custom bottom-chrome is provided */
|
|
2461
|
-
bp-default-ui
|
|
2474
|
+
bp-default-ui[has-custom-bottom-chrome] media-control-bar {
|
|
2462
2475
|
display: none !important;
|
|
2463
2476
|
}
|
|
2464
2477
|
|
|
@@ -2649,7 +2662,7 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
|
|
|
2649
2662
|
outline: 2px solid rgba(0, 255, 0, 1) !important;
|
|
2650
2663
|
background: rgba(0, 255, 0, 0.3) !important;
|
|
2651
2664
|
}
|
|
2652
|
-
`;var
|
|
2665
|
+
`;var hm=!1;function $g(){if(hm)return;Qo();let i=document.createElement("style");i.id="bp-default-ui-styles",i.textContent=um,document.head.appendChild(i),hm=!0}var re=class extends Ce{constructor(){super(...arguments);this.autoplay=!1;this.muted=!1;this.loop=!1;this.scaling="letterbox";this.debug=!1;this.autohide=2;this.hotkeys=!0;this.mobile=!1;this.live=!1;this.fluid=!1;this._player=null;this._providerType=null;this._error=null;this._connectionState="idle";this._showEndedOverlay=!1;this._cleanupListeners=[]}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),$g(),this.detectMobile()}disconnectedCallback(){super.disconnectedCallback(),this._cleanupListeners.forEach(t=>t()),this._cleanupListeners=[]}get player(){return this._player}get mediaController(){return this.querySelector("media-controller")}get bpLive(){var t;return((t=this._player)==null?void 0:t.bpLive)??null}detectMobile(){let t=/Android|iPhone|iPad|iPod|webOS|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);this.mobile=t}_getPoster(){var t;return((t=this.source)==null?void 0:t.poster)??this.poster??null}firstUpdated(t){super.firstUpdated(t),this.setupPlayer(),this._moveSlottedContent(),this.fluid&&this._setInitialVideoDimensionsFromSources()}updated(t){super.updated(t),this._moveSlottedContent(),t.has("debug")&&this.toggleAttribute("debug-hitboxes",this.debug),t.has("source")&&(this._error=null,this._showEndedOverlay=!1,Ee(this,"has-error",!1),this.fluid&&this._setInitialVideoDimensionsFromSources())}_setInitialVideoDimensionsFromSources(){var r;let t=(r=this.source)==null?void 0:r.sources;if(t){for(let o of t)if(Er(o)&&o.preferredOrientation){o.preferredOrientation==="portrait"?(this.style.setProperty("--bp-video-width","9"),this.style.setProperty("--bp-video-height","16")):(this.style.setProperty("--bp-video-width","16"),this.style.setProperty("--bp-video-height","9")),this.debug&&console.log("[BPDefaultUI] Set initial video dimensions from preferredOrientation:",o.preferredOrientation);break}}}_updateVideoDimensions(t,r){t>0&&r>0?(this.style.setProperty("--bp-video-width",String(t)),this.style.setProperty("--bp-video-height",String(r))):(this.style.removeProperty("--bp-video-width"),this.style.removeProperty("--bp-video-height"))}_clearVideoDimensions(){this.style.removeProperty("--bp-video-width"),this.style.removeProperty("--bp-video-height")}_moveSlottedContent(){let t=this.querySelector("media-controller");if(!t)return;let r=[{from:"top-chrome",to:"top-chrome",marker:"has-custom-top-chrome"},{from:"centered-chrome",to:"centered-chrome",marker:"has-custom-centered-chrome"},{from:"middle-chrome",to:"middle-chrome",marker:"has-custom-middle-chrome"},{from:"bottom-chrome",to:null,marker:"has-custom-bottom-chrome"}];for(let{from:o,to:n,marker:a}of r){let l=this.querySelectorAll(`:scope > [slot="${o}"]`);l.length>0&&this.setAttribute(a,""),l.forEach(d=>{d.parentElement!==t&&(n?d.setAttribute("slot",n):d.removeAttribute("slot"),t.appendChild(d))})}}setupPlayer(){let t=this.querySelector("bp-player");t&&t.addEventListener("ready",r=>{r.stopPropagation(),this._player=r.detail,this._providerType=t.providerType,this.live=this._player.state.streamType==="live",this.setupPlayerListeners(),this.dispatchEvent(Mi(tn,{detail:this._player})),this.requestUpdate()})}setupPlayerListeners(){if(!this._player)return;let t=()=>{var E;let h=((E=this._player)==null?void 0:E.state.error)??null;this._error=h;let p=h!==null&&h.fatal&&h.category!=="offline";Ee(this,"has-error",p)},r=()=>{var p;let h=(p=this._player)==null?void 0:p.state;if(h&&(this._connectionState=h.connectionState,this.live=h.streamType==="live",this.setAttribute("content-type",h.contentType),this.setAttribute("stream-type",h.streamType),Ee(this,"paused",h.paused),Ee(this,"ended",h.ended),Ee(this,"waiting",h.waiting),h.error!==this._error)){this._error=h.error;let E=h.error!==null&&h.error.fatal&&h.error.category!=="offline";Ee(this,"has-error",E)}},o=()=>{this._error=null,this._showEndedOverlay=!1,Ee(this,"has-error",!1)},n=()=>{this.live&&(this._showEndedOverlay=!0)},a=()=>{this._error=null,this._showEndedOverlay=!1,Ee(this,"has-error",!1)},l=h=>{this.debug&&console.log("[BPDefaultUI] updateVideoDimensions called",{fluid:this.fluid,...h}),this.fluid&&(this._updateVideoDimensions(h.videoWidth,h.videoHeight),this.debug&&console.log("[BPDefaultUI] Set video dimensions:",{width:h.videoWidth,height:h.videoHeight}))};this._player.addEventListener("error",t),this._player.addEventListener("statechange",r),this._player.addEventListener("playing",o),this._player.addEventListener("ended",n),this._player.addEventListener("sourcechange",a),this._player.addEventListener("resize",l),this._player.addEventListener("loadedmetadata",l);let{videoWidth:d,videoHeight:v}=this._player.state;this.debug&&console.log("[BPDefaultUI] Initial dimensions check",{videoWidth:d,videoHeight:v,fluid:this.fluid}),d>0&&v>0&&l({videoWidth:d,videoHeight:v}),this._cleanupListeners.push(()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("error",t)},()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("statechange",r)},()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("playing",o)},()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("ended",n)},()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("sourcechange",a)},()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("resize",l)},()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("loadedmetadata",l)})}renderDefaultControls(){return this._providerType==="nano"||this._providerType==="livekit"?We`
|
|
2653
2666
|
<media-control-bar>
|
|
2654
2667
|
<media-play-button notooltip clip-hidden></media-play-button>
|
|
2655
2668
|
<media-live-button notooltip vod-hidden clip-hidden></media-live-button>
|
|
@@ -2659,7 +2672,7 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
|
|
|
2659
2672
|
<media-rendition-menu-button notooltip clip-hidden></media-rendition-menu-button>
|
|
2660
2673
|
<media-fullscreen-button notooltip clip-hidden></media-fullscreen-button>
|
|
2661
2674
|
</media-control-bar>
|
|
2662
|
-
`:
|
|
2675
|
+
`:We`
|
|
2663
2676
|
<media-control-bar>
|
|
2664
2677
|
<media-play-button notooltip clip-hidden></media-play-button>
|
|
2665
2678
|
<media-live-button notooltip vod-hidden clip-hidden></media-live-button>
|
|
@@ -2675,7 +2688,7 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
|
|
|
2675
2688
|
<media-pip-button notooltip clip-hidden></media-pip-button>
|
|
2676
2689
|
<media-fullscreen-button notooltip clip-hidden></media-fullscreen-button>
|
|
2677
2690
|
</media-control-bar>
|
|
2678
|
-
`}render(){return
|
|
2691
|
+
`}render(){return We`
|
|
2679
2692
|
<!-- Chrome Layer: media-controller with all controls -->
|
|
2680
2693
|
<div class="bp-layer bp-chrome-layer">
|
|
2681
2694
|
<media-controller autohide="${this.autohide}" ?hotkeys="${this.hotkeys}">
|
|
@@ -2691,7 +2704,7 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
|
|
|
2691
2704
|
?debug="${this.debug}"
|
|
2692
2705
|
></bp-player>
|
|
2693
2706
|
|
|
2694
|
-
${this._getPoster()?
|
|
2707
|
+
${this._getPoster()?We`
|
|
2695
2708
|
<media-poster-image slot="poster" src="${this._getPoster()}"></media-poster-image>
|
|
2696
2709
|
`:null}
|
|
2697
2710
|
|
|
@@ -2724,19 +2737,19 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
|
|
|
2724
2737
|
<div class="bp-layer bp-error-layer">
|
|
2725
2738
|
<bp-error-display .error="${this._error}" ?showCode="${this.debug}"></bp-error-display>
|
|
2726
2739
|
</div>
|
|
2727
|
-
`}};
|
|
2740
|
+
`}};U([W({converter:_r()})],re.prototype,"source",2),U([W({type:Boolean})],re.prototype,"autoplay",2),U([W({type:Boolean})],re.prototype,"muted",2),U([W({type:Boolean})],re.prototype,"loop",2),U([W({type:String})],re.prototype,"poster",2),U([W({type:String})],re.prototype,"scaling",2),U([W({type:String,attribute:"aspect-ratio"})],re.prototype,"aspectRatio",2),U([W({converter:_r()})],re.prototype,"config",2),U([W({type:Boolean})],re.prototype,"debug",2),U([W({type:Number})],re.prototype,"autohide",2),U([W({type:Boolean})],re.prototype,"hotkeys",2),U([W({type:Boolean,reflect:!0})],re.prototype,"mobile",2),U([W({type:Boolean,reflect:!0})],re.prototype,"live",2),U([W({type:Boolean,reflect:!0})],re.prototype,"fluid",2),U([zt()],re.prototype,"_player",2),U([zt()],re.prototype,"_providerType",2),U([zt()],re.prototype,"_error",2),U([zt()],re.prototype,"_connectionState",2),U([zt()],re.prototype,"_showEndedOverlay",2),re=U([qt("bp-default-ui")],re);var Bg=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
2728
2741
|
<circle cx="12" cy="12" r="10" stroke-opacity="0.25"/>
|
|
2729
2742
|
<path d="M12 2a10 10 0 0 1 10 10" stroke-linecap="round">
|
|
2730
2743
|
<animateTransform attributeName="transform" type="rotate" from="0 12 12" to="360 12 12" dur="1s" repeatCount="indefinite"/>
|
|
2731
2744
|
</path>
|
|
2732
|
-
</svg>`,
|
|
2745
|
+
</svg>`,Vg=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
|
2733
2746
|
<path d="M21 6H3c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 10H3V8h18v8z"/>
|
|
2734
2747
|
<circle cx="12" cy="12" r="3" fill="currentColor"/>
|
|
2735
|
-
</svg>`,
|
|
2748
|
+
</svg>`,Wg=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
|
2736
2749
|
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/>
|
|
2737
|
-
</svg>`,
|
|
2750
|
+
</svg>`,Fg=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
|
2738
2751
|
<path d="M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z"/>
|
|
2739
|
-
</svg>`,Ut=class extends
|
|
2752
|
+
</svg>`,Ut=class extends Ce{constructor(){super(...arguments);this.type="none";this.live=!1;this.buttonMode=!1}getIcon(){switch(this.type){case"loading":return Bg;case"offline":return Vg;case"ended":return this.live?Wg:Fg;default:return""}}getDefaultMessage(){switch(this.type){case"loading":return"Loading...";case"offline":return"The live stream hasn't started yet";case"ended":return this.live?"Stream has ended":"Replay";default:return""}}render(){if(this.type==="none")return null;let t=this.getIcon(),r=this.getDefaultMessage();return We`
|
|
2740
2753
|
<div part="icon">
|
|
2741
2754
|
<slot name="icon">${this.renderIcon(t)}</slot>
|
|
2742
2755
|
</div>
|
|
@@ -2746,7 +2759,7 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
|
|
|
2746
2759
|
<p part="submessage">
|
|
2747
2760
|
<slot name="submessage"></slot>
|
|
2748
2761
|
</p>
|
|
2749
|
-
`}renderIcon(t){if(!t)return null;let r=document.createElement("template");return r.innerHTML=t.trim(),r.content.cloneNode(!0)}};Ut.styles
|
|
2762
|
+
`}renderIcon(t){if(!t)return null;let r=document.createElement("template");return r.innerHTML=t.trim(),r.content.cloneNode(!0)}};Ut.styles=$o`
|
|
2750
2763
|
:host {
|
|
2751
2764
|
display: flex;
|
|
2752
2765
|
flex-direction: column;
|
|
@@ -2817,7 +2830,7 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
|
|
|
2817
2830
|
:host([button-mode]) [part="submessage"] {
|
|
2818
2831
|
display: none;
|
|
2819
2832
|
}
|
|
2820
|
-
`,
|
|
2833
|
+
`,U([W({type:String,reflect:!0})],Ut.prototype,"type",2),U([W({type:Boolean,reflect:!0})],Ut.prototype,"live",2),U([W({type:Boolean,reflect:!0,attribute:"button-mode"})],Ut.prototype,"buttonMode",2),Ut=U([qt("bp-overlay")],Ut);var Kg=["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"],pm=["autopictureinpicture","disablepictureinpicture","disableremoteplayback","autoplay","controls","controlslist","crossorigin","loop","muted","playsinline","poster","preload","src"];function Gg(i){return`
|
|
2821
2834
|
<style>
|
|
2822
2835
|
:host {
|
|
2823
2836
|
display: inline-flex;
|
|
@@ -2831,10 +2844,10 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
|
|
|
2831
2844
|
}
|
|
2832
2845
|
</style>
|
|
2833
2846
|
<slot name="media">
|
|
2834
|
-
<audio${
|
|
2847
|
+
<audio${bm(i)}></audio>
|
|
2835
2848
|
</slot>
|
|
2836
2849
|
<slot></slot>
|
|
2837
|
-
`}function
|
|
2850
|
+
`}function qg(i){return`
|
|
2838
2851
|
<style>
|
|
2839
2852
|
:host {
|
|
2840
2853
|
display: inline-block;
|
|
@@ -2856,25 +2869,25 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
|
|
|
2856
2869
|
}
|
|
2857
2870
|
</style>
|
|
2858
2871
|
<slot name="media">
|
|
2859
|
-
<video${
|
|
2872
|
+
<video${bm(i)}></video>
|
|
2860
2873
|
</slot>
|
|
2861
2874
|
<slot></slot>
|
|
2862
|
-
`}function Jp(i,{tag:e,is:t}){var n,a,l,c,v,Yp,p,f,m,A,g,Zi,Rc,Qp,xc,Zp,Xp;let r=(a=(n=globalThis.document)==null?void 0:n.createElement)==null?void 0:a.call(n,e,{is:t}),o=r?CE(r):[];return l=class extends i{constructor(){super(...arguments);S(this,g);S(this,p,!1);S(this,f,null);S(this,m,new Map);S(this,A);$(this,"get");$(this,"set");$(this,"call")}static get observedAttributes(){var K,ne;return O(K=l,v,Yp).call(K),[...((ne=r==null?void 0:r.constructor)==null?void 0:ne.observedAttributes)??[],...zp]}get nativeEl(){var k;return O(this,g,Zi).call(this),u(this,f)??this.querySelector(":scope > [slot=media]")??this.querySelector(e)??((k=this.shadowRoot)==null?void 0:k.querySelector(e))??null}set nativeEl(k){_(this,f,k)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(k){this.toggleAttribute("muted",k)}get src(){return this.getAttribute("src")}set src(k){this.setAttribute("src",`${k}`)}get preload(){var k;return this.getAttribute("preload")??((k=this.nativeEl)==null?void 0:k.preload)}set preload(k){this.setAttribute("preload",`${k}`)}init(){if(!this.shadowRoot){this.attachShadow({mode:"open"});let k=IE(this.attributes);t&&(k.is=t),e&&(k.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(k)}this.nativeEl.muted=this.hasAttribute("muted");for(let k of o)O(this,g,Zp).call(this,k);_(this,A,new MutationObserver(O(this,g,Qp).bind(this))),this.shadowRoot.addEventListener("slotchange",()=>O(this,g,Rc).call(this)),O(this,g,Rc).call(this);for(let k of this.constructor.Events)this.shadowRoot.addEventListener(k,this,!0)}handleEvent(k){k.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(k.type,{detail:k.detail}))}attributeChangedCallback(k,K,ne){O(this,g,Zi).call(this),O(this,g,Xp).call(this,k,K,ne)}connectedCallback(){O(this,g,Zi).call(this)}},c=new WeakMap,v=new WeakSet,Yp=function(){if(u(this,c))return;_(this,c,!0);let k=new Set(this.observedAttributes);k.delete("muted");for(let K of o)if(!(K in this.prototype))if(typeof r[K]=="function")this.prototype[K]=function(...ne){return O(this,g,Zi).call(this),(()=>{var he;if(this.call)return this.call(K,...ne);let G=(he=this.nativeEl)==null?void 0:he[K];return G==null?void 0:G.apply(this.nativeEl,ne)})()};else{let ne={get(){var G,he;O(this,g,Zi).call(this);let ee=K.toLowerCase();if(k.has(ee)){let wt=this.getAttribute(ee);return wt===null?!1:wt===""?!0:wt}return((G=this.get)==null?void 0:G.call(this,K))??((he=this.nativeEl)==null?void 0:he[K])}};K!==K.toUpperCase()&&(ne.set=function(ee){O(this,g,Zi).call(this);let G=K.toLowerCase();if(k.has(G)){ee===!0||ee===!1||ee==null?this.toggleAttribute(G,!!ee):this.setAttribute(G,ee);return}if(this.set){this.set(K,ee);return}this.nativeEl&&(this.nativeEl[K]=ee)}),Object.defineProperty(this.prototype,K,ne)}},p=new WeakMap,f=new WeakMap,m=new WeakMap,A=new WeakMap,g=new WeakSet,Zi=function(){u(this,p)||(_(this,p,!0),this.init())},Rc=function(){var ee;let k=new Map(u(this,m)),K=(ee=this.shadowRoot)==null?void 0:ee.querySelector("slot:not([name])");(K==null?void 0:K.assignedElements({flatten:!0}).filter(G=>["track","source"].includes(G.localName))).forEach(G=>{var wt,Co;k.delete(G);let he=u(this,m).get(G);he||(he=G.cloneNode(),u(this,m).set(G,he),(wt=u(this,A))==null||wt.observe(G,{attributes:!0})),(Co=this.nativeEl)==null||Co.append(he),O(this,g,xc).call(this,he)}),k.forEach((G,he)=>{G.remove(),u(this,m).delete(he)})},Qp=function(k){for(let K of k)if(K.type==="attributes"){let{target:ne,attributeName:ee}=K,G=u(this,m).get(ne);G&&ee&&(G.setAttribute(ee,ne.getAttribute(ee)??""),O(this,g,xc).call(this,G))}},xc=function(k){k&&k.localName==="track"&&k.default&&(k.kind==="chapters"||k.kind==="metadata")&&k.track.mode==="disabled"&&(k.track.mode="hidden")},Zp=function(k){if(Object.prototype.hasOwnProperty.call(this,k)){let K=this[k];delete this[k],this[k]=K}},Xp=function(k,K,ne){var ee,G,he;["id","class"].includes(k)||!l.observedAttributes.includes(k)&&this.constructor.observedAttributes.includes(k)||(ne===null?(ee=this.nativeEl)==null||ee.removeAttribute(k):((G=this.nativeEl)==null?void 0:G.getAttribute(k))!==ne&&((he=this.nativeEl)==null||he.setAttribute(k,ne)))},S(l,v),$(l,"getTemplateHTML",e.endsWith("audio")?LE:wE),$(l,"shadowRootOptions",{mode:"open"}),$(l,"Events",kE),S(l,c,!1),l}function CE(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 jp(i){let e="";for(let t in i){if(!zp.includes(t))continue;let r=i[t];r===""?e+=` ${t}`:e+=` ${t}="${r}"`}return e}function IE(i){let e={};for(let t of i)e[t.name]=t.value;return e}var Pe=Jp(globalThis.HTMLElement??class{},{tag:"video"}),ew=Jp(globalThis.HTMLElement??class{},{tag:"audio"});var Nt=class extends Event{constructor(t,r){super(t);$(this,"track");this.track=r.track}};var Pc=new WeakMap;function T(i){return Pc.get(i)??ME(i,{})}function ME(i,e){let t=Pc.get(i);return t||Pc.set(i,t={}),Object.assign(t,e)}function ul(i,e){let t=i.videoTracks;T(e).media=i,T(e).renditionSet||(T(e).renditionSet=new Set);let r=T(t).trackSet;r.add(e);let o=r.size-1;o in Ji.prototype||Object.defineProperty(Ji.prototype,o,{get(){return[...T(this).trackSet][o]}}),queueMicrotask(()=>{t.dispatchEvent(new Nt("addtrack",{track:e}))})}function hl(i){var r;let e=(r=T(i).media)==null?void 0:r.videoTracks;if(!e)return;T(e).trackSet.delete(i),queueMicrotask(()=>{e.dispatchEvent(new Nt("removetrack",{track:i}))})}function em(i){let e=T(i).media.videoTracks??[],t=!1;for(let r of e)r!==i&&(r.selected=!1,t=!0);if(t){if(T(e).changeRequested)return;T(e).changeRequested=!0,queueMicrotask(()=>{delete T(e).changeRequested,e.dispatchEvent(new Event("change"))})}}var ai,si,li,Xi,zn,Ji=class extends EventTarget{constructor(){super();S(this,Xi);S(this,ai);S(this,si);S(this,li);T(this).trackSet=new Set}[Symbol.iterator](){return u(this,Xi,zn).values()}get length(){return u(this,Xi,zn).size}getTrackById(t){return[...u(this,Xi,zn)].find(r=>r.id===t)??null}get selectedIndex(){return[...u(this,Xi,zn)].findIndex(t=>t.selected)}get onaddtrack(){return u(this,ai)}set onaddtrack(t){u(this,ai)&&(this.removeEventListener("addtrack",u(this,ai)),_(this,ai,void 0)),typeof t=="function"&&(_(this,ai,t),this.addEventListener("addtrack",t))}get onremovetrack(){return u(this,si)}set onremovetrack(t){u(this,si)&&(this.removeEventListener("removetrack",u(this,si)),_(this,si,void 0)),typeof t=="function"&&(_(this,si,t),this.addEventListener("removetrack",t))}get onchange(){return u(this,li)}set onchange(t){u(this,li)&&(this.removeEventListener("change",u(this,li)),_(this,li,void 0)),typeof t=="function"&&(_(this,li,t),this.addEventListener("change",t))}};ai=new WeakMap,si=new WeakMap,li=new WeakMap,Xi=new WeakSet,zn=function(){return T(this).trackSet};var Ht=class extends Event{constructor(t,r){super(t);$(this,"rendition");this.rendition=r.rendition}};function tm(i,e){let t=T(i).media.videoRenditions;T(e).media=T(i).media,T(e).track=i;let r=T(i).renditionSet;r.add(e);let o=r.size-1;o in ji.prototype||Object.defineProperty(ji.prototype,o,{get(){return so(this)[o]}}),queueMicrotask(()=>{i.selected&&t.dispatchEvent(new Ht("addrendition",{rendition:e}))})}function im(i){let e=T(i).media.videoRenditions,t=T(i).track;T(t).renditionSet.delete(i),queueMicrotask(()=>{T(i).track.selected&&e.dispatchEvent(new Ht("removerendition",{rendition:i}))})}function rm(i){let e=T(i).media.videoRenditions;!e||T(e).changeRequested||(T(e).changeRequested=!0,queueMicrotask(()=>{delete T(e).changeRequested,T(i).track.selected&&e.dispatchEvent(new Event("change"))}))}function so(i){return[...T(i).media.videoTracks].filter(t=>t.selected).flatMap(t=>[...T(t).renditionSet])}var di,ci,ui,ji=class extends EventTarget{constructor(){super(...arguments);S(this,di);S(this,ci);S(this,ui)}[Symbol.iterator](){return so(this).values()}get length(){return so(this).length}getRenditionById(t){return so(this).find(r=>`${r.id}`==`${t}`)??null}get selectedIndex(){return so(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[r,o]of so(this).entries())o.selected=r===t}get onaddrendition(){return u(this,di)}set onaddrendition(t){u(this,di)&&(this.removeEventListener("addrendition",u(this,di)),_(this,di,void 0)),typeof t=="function"&&(_(this,di,t),this.addEventListener("addrendition",t))}get onremoverendition(){return u(this,ci)}set onremoverendition(t){u(this,ci)&&(this.removeEventListener("removerendition",u(this,ci)),_(this,ci,void 0)),typeof t=="function"&&(_(this,ci,t),this.addEventListener("removerendition",t))}get onchange(){return u(this,ui)}set onchange(t){u(this,ui)&&(this.removeEventListener("change",u(this,ui)),_(this,ui,void 0)),typeof t=="function"&&(_(this,ui,t),this.addEventListener("change",t))}};di=new WeakMap,ci=new WeakMap,ui=new WeakMap;var lo,Yn=class{constructor(){$(this,"src");$(this,"id");$(this,"width");$(this,"height");$(this,"bitrate");$(this,"frameRate");$(this,"codec");S(this,lo,!1)}get selected(){return u(this,lo)}set selected(e){u(this,lo)!==e&&(_(this,lo,e),rm(this))}};lo=new WeakMap;var co,uo=class{constructor(){$(this,"id");$(this,"kind");$(this,"label","");$(this,"language","");$(this,"sourceBuffer");S(this,co,!1)}addRendition(e,t,r,o,n,a){let l=new Yn;return l.src=e,l.width=t,l.height=r,l.frameRate=a,l.bitrate=n,l.codec=o,tm(this,l),l}removeRendition(e){im(e)}get selected(){return u(this,co)}set selected(e){u(this,co)!==e&&(_(this,co,e),e===!0&&em(this))}};co=new WeakMap;function om(i,e){let t=T(i).media.audioRenditions;T(e).media=T(i).media,T(e).track=i;let r=T(i).renditionSet;r.add(e);let o=r.size-1;o in er.prototype||Object.defineProperty(er.prototype,o,{get(){return ho(this)[o]}}),queueMicrotask(()=>{i.enabled&&t.dispatchEvent(new Ht("addrendition",{rendition:e}))})}function nm(i){let e=T(i).media.audioRenditions,t=T(i).track;T(t).renditionSet.delete(i),queueMicrotask(()=>{T(i).track.enabled&&e.dispatchEvent(new Ht("removerendition",{rendition:i}))})}function am(i){let e=T(i).media.audioRenditions;!e||T(e).changeRequested||(T(e).changeRequested=!0,queueMicrotask(()=>{delete T(e).changeRequested,T(i).track.enabled&&e.dispatchEvent(new Event("change"))}))}function ho(i){return[...T(i).media.audioTracks].filter(t=>t.enabled).flatMap(t=>[...T(t).renditionSet])}var hi,pi,mi,er=class extends EventTarget{constructor(){super(...arguments);S(this,hi);S(this,pi);S(this,mi)}[Symbol.iterator](){return ho(this).values()}get length(){return ho(this).length}getRenditionById(t){return ho(this).find(r=>`${r.id}`==`${t}`)??null}get selectedIndex(){return ho(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[r,o]of ho(this).entries())o.selected=r===t}get onaddrendition(){return u(this,hi)}set onaddrendition(t){u(this,hi)&&(this.removeEventListener("addrendition",u(this,hi)),_(this,hi,void 0)),typeof t=="function"&&(_(this,hi,t),this.addEventListener("addrendition",t))}get onremoverendition(){return u(this,pi)}set onremoverendition(t){u(this,pi)&&(this.removeEventListener("removerendition",u(this,pi)),_(this,pi,void 0)),typeof t=="function"&&(_(this,pi,t),this.addEventListener("removerendition",t))}get onchange(){return u(this,mi)}set onchange(t){u(this,mi)&&(this.removeEventListener("change",u(this,mi)),_(this,mi,void 0)),typeof t=="function"&&(_(this,mi,t),this.addEventListener("change",t))}};hi=new WeakMap,pi=new WeakMap,mi=new WeakMap;var po,Qn=class{constructor(){$(this,"src");$(this,"id");$(this,"bitrate");$(this,"codec");S(this,po,!1)}get selected(){return u(this,po)}set selected(e){u(this,po)!==e&&(_(this,po,e),am(this))}};po=new WeakMap;function ml(i,e){let t=i.audioTracks;T(e).media=i,T(e).renditionSet||(T(e).renditionSet=new Set);let r=T(t).trackSet;r.add(e);let o=r.size-1;o in tr.prototype||Object.defineProperty(tr.prototype,o,{get(){return[...T(this).trackSet][o]}}),queueMicrotask(()=>{t.dispatchEvent(new Nt("addtrack",{track:e}))})}function vl(i){var r;let e=(r=T(i).media)==null?void 0:r.audioTracks;if(!e)return;T(e).trackSet.delete(i),queueMicrotask(()=>{e.dispatchEvent(new Nt("removetrack",{track:i}))})}function sm(i){let e=T(i).media.audioTracks;!e||T(e).changeRequested||(T(e).changeRequested=!0,queueMicrotask(()=>{delete T(e).changeRequested,e.dispatchEvent(new Event("change"))}))}var vi,fi,gi,mo,pl,tr=class extends EventTarget{constructor(){super();S(this,mo);S(this,vi);S(this,fi);S(this,gi);T(this).trackSet=new Set}[Symbol.iterator](){return u(this,mo,pl).values()}get length(){return u(this,mo,pl).size}getTrackById(t){return[...u(this,mo,pl)].find(r=>r.id===t)??null}get onaddtrack(){return u(this,vi)}set onaddtrack(t){u(this,vi)&&(this.removeEventListener("addtrack",u(this,vi)),_(this,vi,void 0)),typeof t=="function"&&(_(this,vi,t),this.addEventListener("addtrack",t))}get onremovetrack(){return u(this,fi)}set onremovetrack(t){u(this,fi)&&(this.removeEventListener("removetrack",u(this,fi)),_(this,fi,void 0)),typeof t=="function"&&(_(this,fi,t),this.addEventListener("removetrack",t))}get onchange(){return u(this,gi)}set onchange(t){u(this,gi)&&(this.removeEventListener("change",u(this,gi)),_(this,gi,void 0)),typeof t=="function"&&(_(this,gi,t),this.addEventListener("change",t))}};vi=new WeakMap,fi=new WeakMap,gi=new WeakMap,mo=new WeakSet,pl=function(){return T(this).trackSet};var vo,fo=class{constructor(){$(this,"id");$(this,"kind");$(this,"label","");$(this,"language","");$(this,"sourceBuffer");S(this,vo,!1)}addRendition(e,t,r){let o=new Qn;return o.src=e,o.codec=t,o.bitrate=r,om(this,o),o}removeRendition(e){nm(e)}get enabled(){return u(this,vo)}set enabled(e){u(this,vo)!==e&&(_(this,vo,e),sm(this))}};vo=new WeakMap;var lm=fl(globalThis.HTMLMediaElement,"video"),dm=fl(globalThis.HTMLMediaElement,"audio");function go(i){if(!(i!=null&&i.prototype))return i;let e=fl(i,"video");(!e||`${e}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"videoTracks",{get(){return RE(this)}});let t=fl(i,"audio");(!t||`${t}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"audioTracks",{get(){return xE(this)}}),"addVideoTrack"in i.prototype||(i.prototype.addVideoTrack=function(n,a="",l=""){let c=new uo;return c.kind=n,c.label=a,c.language=l,ul(this,c),c}),"removeVideoTrack"in i.prototype||(i.prototype.removeVideoTrack=hl),"addAudioTrack"in i.prototype||(i.prototype.addAudioTrack=function(n,a="",l=""){let c=new fo;return c.kind=n,c.label=a,c.language=l,ml(this,c),c}),"removeAudioTrack"in i.prototype||(i.prototype.removeAudioTrack=vl),"videoRenditions"in i.prototype||Object.defineProperty(i.prototype,"videoRenditions",{get(){return r(this)}});let r=n=>{let a=T(n).videoRenditions;return a||(a=new ji,T(a).media=n,T(n).videoRenditions=a),a};"audioRenditions"in i.prototype||Object.defineProperty(i.prototype,"audioRenditions",{get(){return o(this)}});let o=n=>{let a=T(n).audioRenditions;return a||(a=new er,T(a).media=n,T(n).audioRenditions=a),a};return i}function fl(i,e){var t;if(i!=null&&i.prototype)return(t=Object.getOwnPropertyDescriptor(i.prototype,`${e}Tracks`))==null?void 0:t.get}function RE(i){let e=T(i).videoTracks;if(!e&&(e=new Ji,T(i).videoTracks=e,lm)){let t=lm.call(i.nativeEl??i);for(let r of t)ul(i,r);t.addEventListener("change",()=>{e.dispatchEvent(new Event("change"))}),t.addEventListener("addtrack",r=>{if([...e].some(o=>o instanceof uo)){for(let o of t)hl(o);return}ul(i,r.track)}),t.addEventListener("removetrack",r=>{hl(r.track)})}return e}function xE(i){let e=T(i).audioTracks;if(!e&&(e=new tr,T(i).audioTracks=e,dm)){let t=dm.call(i.nativeEl??i);for(let r of t)ml(i,r);t.addEventListener("change",()=>{e.dispatchEvent(new Event("change"))}),t.addEventListener("addtrack",r=>{if([...e].some(o=>o instanceof fo)){for(let o of t)vl(o);return}ml(i,r.track)}),t.addEventListener("removetrack",r=>{vl(r.track)})}return e}import Be from"hls.js";var PE=go(Pe),$t,Ei,Eo,tt,cm,um,Dc,Zn,hm,ir=class extends PE{constructor(){super();S(this,tt);S(this,$t,null);S(this,Ei,null);S(this,Eo,!1);this.api=null;S(this,Zn,()=>{var r,o;let t=this.nativeEl;t!=null&&t.webkitCurrentPlaybackTargetIsWireless?(r=this.api)==null||r.stopLoad():(o=this.api)==null||o.startLoad()});O(this,tt,hm).call(this,"config")}static getTemplateHTML(t,r={}){let{src:o,...n}=t;return`
|
|
2875
|
+
`}function gm(i,{tag:e,is:t}){var n,a,l,d,v,mm,p,E,m,A,f,ir,Jc,vm,jc,fm,Em;let r=(a=(n=globalThis.document)==null?void 0:n.createElement)==null?void 0:a.call(n,e,{is:t}),o=r?zg(r):[];return l=class extends i{constructor(){super(...arguments);S(this,f);S(this,p,!1);S(this,E,null);S(this,m,new Map);S(this,A);$(this,"get");$(this,"set");$(this,"call")}static get observedAttributes(){var K,ae;return O(K=l,v,mm).call(K),[...((ae=r==null?void 0:r.constructor)==null?void 0:ae.observedAttributes)??[],...pm]}get nativeEl(){var k;return O(this,f,ir).call(this),u(this,E)??this.querySelector(":scope > [slot=media]")??this.querySelector(e)??((k=this.shadowRoot)==null?void 0:k.querySelector(e))??null}set nativeEl(k){_(this,E,k)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(k){this.toggleAttribute("muted",k)}get src(){return this.getAttribute("src")}set src(k){this.setAttribute("src",`${k}`)}get preload(){var k;return this.getAttribute("preload")??((k=this.nativeEl)==null?void 0:k.preload)}set preload(k){this.setAttribute("preload",`${k}`)}init(){if(!this.shadowRoot){this.attachShadow({mode:"open"});let k=Yg(this.attributes);t&&(k.is=t),e&&(k.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(k)}this.nativeEl.muted=this.hasAttribute("muted");for(let k of o)O(this,f,fm).call(this,k);_(this,A,new MutationObserver(O(this,f,vm).bind(this))),this.shadowRoot.addEventListener("slotchange",()=>O(this,f,Jc).call(this)),O(this,f,Jc).call(this);for(let k of this.constructor.Events)this.shadowRoot.addEventListener(k,this,!0)}handleEvent(k){k.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(k.type,{detail:k.detail}))}attributeChangedCallback(k,K,ae){O(this,f,ir).call(this),O(this,f,Em).call(this,k,K,ae)}connectedCallback(){O(this,f,ir).call(this)}},d=new WeakMap,v=new WeakSet,mm=function(){if(u(this,d))return;_(this,d,!0);let k=new Set(this.observedAttributes);k.delete("muted");for(let K of o)if(!(K in this.prototype))if(typeof r[K]=="function")this.prototype[K]=function(...ae){return O(this,f,ir).call(this),(()=>{var pe;if(this.call)return this.call(K,...ae);let z=(pe=this.nativeEl)==null?void 0:pe[K];return z==null?void 0:z.apply(this.nativeEl,ae)})()};else{let ae={get(){var z,pe;O(this,f,ir).call(this);let te=K.toLowerCase();if(k.has(te)){let It=this.getAttribute(te);return It===null?!1:It===""?!0:It}return((z=this.get)==null?void 0:z.call(this,K))??((pe=this.nativeEl)==null?void 0:pe[K])}};K!==K.toUpperCase()&&(ae.set=function(te){O(this,f,ir).call(this);let z=K.toLowerCase();if(k.has(z)){te===!0||te===!1||te==null?this.toggleAttribute(z,!!te):this.setAttribute(z,te);return}if(this.set){this.set(K,te);return}this.nativeEl&&(this.nativeEl[K]=te)}),Object.defineProperty(this.prototype,K,ae)}},p=new WeakMap,E=new WeakMap,m=new WeakMap,A=new WeakMap,f=new WeakSet,ir=function(){u(this,p)||(_(this,p,!0),this.init())},Jc=function(){var te;let k=new Map(u(this,m)),K=(te=this.shadowRoot)==null?void 0:te.querySelector("slot:not([name])");(K==null?void 0:K.assignedElements({flatten:!0}).filter(z=>["track","source"].includes(z.localName))).forEach(z=>{var It,No;k.delete(z);let pe=u(this,m).get(z);pe||(pe=z.cloneNode(),u(this,m).set(z,pe),(It=u(this,A))==null||It.observe(z,{attributes:!0})),(No=this.nativeEl)==null||No.append(pe),O(this,f,jc).call(this,pe)}),k.forEach((z,pe)=>{z.remove(),u(this,m).delete(pe)})},vm=function(k){for(let K of k)if(K.type==="attributes"){let{target:ae,attributeName:te}=K,z=u(this,m).get(ae);z&&te&&(z.setAttribute(te,ae.getAttribute(te)??""),O(this,f,jc).call(this,z))}},jc=function(k){k&&k.localName==="track"&&k.default&&(k.kind==="chapters"||k.kind==="metadata")&&k.track.mode==="disabled"&&(k.track.mode="hidden")},fm=function(k){if(Object.prototype.hasOwnProperty.call(this,k)){let K=this[k];delete this[k],this[k]=K}},Em=function(k,K,ae){var te,z,pe;["id","class"].includes(k)||!l.observedAttributes.includes(k)&&this.constructor.observedAttributes.includes(k)||(ae===null?(te=this.nativeEl)==null||te.removeAttribute(k):((z=this.nativeEl)==null?void 0:z.getAttribute(k))!==ae&&((pe=this.nativeEl)==null||pe.setAttribute(k,ae)))},S(l,v),$(l,"getTemplateHTML",e.endsWith("audio")?Gg:qg),$(l,"shadowRootOptions",{mode:"open"}),$(l,"Events",Kg),S(l,d,!1),l}function zg(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 bm(i){let e="";for(let t in i){if(!pm.includes(t))continue;let r=i[t];r===""?e+=` ${t}`:e+=` ${t}="${r}"`}return e}function Yg(i){let e={};for(let t of i)e[t.name]=t.value;return e}var De=gm(globalThis.HTMLElement??class{},{tag:"video"}),CI=gm(globalThis.HTMLElement??class{},{tag:"audio"});var Ht=class extends Event{constructor(t,r){super(t);$(this,"track");this.track=r.track}};var eu=new WeakMap;function T(i){return eu.get(i)??Qg(i,{})}function Qg(i,e){let t=eu.get(i);return t||eu.set(i,t={}),Object.assign(t,e)}function Cl(i,e){let t=i.videoTracks;T(e).media=i,T(e).renditionSet||(T(e).renditionSet=new Set);let r=T(t).trackSet;r.add(e);let o=r.size-1;o in or.prototype||Object.defineProperty(or.prototype,o,{get(){return[...T(this).trackSet][o]}}),queueMicrotask(()=>{t.dispatchEvent(new Ht("addtrack",{track:e}))})}function Il(i){var r;let e=(r=T(i).media)==null?void 0:r.videoTracks;if(!e)return;T(e).trackSet.delete(i),queueMicrotask(()=>{e.dispatchEvent(new Ht("removetrack",{track:i}))})}function _m(i){let e=T(i).media.videoTracks??[],t=!1;for(let r of e)r!==i&&(r.selected=!1,t=!0);if(t){if(T(e).changeRequested)return;T(e).changeRequested=!0,queueMicrotask(()=>{delete T(e).changeRequested,e.dispatchEvent(new Event("change"))})}}var ui,hi,pi,rr,sa,or=class extends EventTarget{constructor(){super();S(this,rr);S(this,ui);S(this,hi);S(this,pi);T(this).trackSet=new Set}[Symbol.iterator](){return u(this,rr,sa).values()}get length(){return u(this,rr,sa).size}getTrackById(t){return[...u(this,rr,sa)].find(r=>r.id===t)??null}get selectedIndex(){return[...u(this,rr,sa)].findIndex(t=>t.selected)}get onaddtrack(){return u(this,ui)}set onaddtrack(t){u(this,ui)&&(this.removeEventListener("addtrack",u(this,ui)),_(this,ui,void 0)),typeof t=="function"&&(_(this,ui,t),this.addEventListener("addtrack",t))}get onremovetrack(){return u(this,hi)}set onremovetrack(t){u(this,hi)&&(this.removeEventListener("removetrack",u(this,hi)),_(this,hi,void 0)),typeof t=="function"&&(_(this,hi,t),this.addEventListener("removetrack",t))}get onchange(){return u(this,pi)}set onchange(t){u(this,pi)&&(this.removeEventListener("change",u(this,pi)),_(this,pi,void 0)),typeof t=="function"&&(_(this,pi,t),this.addEventListener("change",t))}};ui=new WeakMap,hi=new WeakMap,pi=new WeakMap,rr=new WeakSet,sa=function(){return T(this).trackSet};var $t=class extends Event{constructor(t,r){super(t);$(this,"rendition");this.rendition=r.rendition}};function ym(i,e){let t=T(i).media.videoRenditions;T(e).media=T(i).media,T(e).track=i;let r=T(i).renditionSet;r.add(e);let o=r.size-1;o in nr.prototype||Object.defineProperty(nr.prototype,o,{get(){return fo(this)[o]}}),queueMicrotask(()=>{i.selected&&t.dispatchEvent(new $t("addrendition",{rendition:e}))})}function Tm(i){let e=T(i).media.videoRenditions,t=T(i).track;T(t).renditionSet.delete(i),queueMicrotask(()=>{T(i).track.selected&&e.dispatchEvent(new $t("removerendition",{rendition:i}))})}function Am(i){let e=T(i).media.videoRenditions;!e||T(e).changeRequested||(T(e).changeRequested=!0,queueMicrotask(()=>{delete T(e).changeRequested,T(i).track.selected&&e.dispatchEvent(new Event("change"))}))}function fo(i){return[...T(i).media.videoTracks].filter(t=>t.selected).flatMap(t=>[...T(t).renditionSet])}var mi,vi,fi,nr=class extends EventTarget{constructor(){super(...arguments);S(this,mi);S(this,vi);S(this,fi)}[Symbol.iterator](){return fo(this).values()}get length(){return fo(this).length}getRenditionById(t){return fo(this).find(r=>`${r.id}`==`${t}`)??null}get selectedIndex(){return fo(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[r,o]of fo(this).entries())o.selected=r===t}get onaddrendition(){return u(this,mi)}set onaddrendition(t){u(this,mi)&&(this.removeEventListener("addrendition",u(this,mi)),_(this,mi,void 0)),typeof t=="function"&&(_(this,mi,t),this.addEventListener("addrendition",t))}get onremoverendition(){return u(this,vi)}set onremoverendition(t){u(this,vi)&&(this.removeEventListener("removerendition",u(this,vi)),_(this,vi,void 0)),typeof t=="function"&&(_(this,vi,t),this.addEventListener("removerendition",t))}get onchange(){return u(this,fi)}set onchange(t){u(this,fi)&&(this.removeEventListener("change",u(this,fi)),_(this,fi,void 0)),typeof t=="function"&&(_(this,fi,t),this.addEventListener("change",t))}};mi=new WeakMap,vi=new WeakMap,fi=new WeakMap;var Eo,la=class{constructor(){$(this,"src");$(this,"id");$(this,"width");$(this,"height");$(this,"bitrate");$(this,"frameRate");$(this,"codec");S(this,Eo,!1)}get selected(){return u(this,Eo)}set selected(e){u(this,Eo)!==e&&(_(this,Eo,e),Am(this))}};Eo=new WeakMap;var go,bo=class{constructor(){$(this,"id");$(this,"kind");$(this,"label","");$(this,"language","");$(this,"sourceBuffer");S(this,go,!1)}addRendition(e,t,r,o,n,a){let l=new la;return l.src=e,l.width=t,l.height=r,l.frameRate=a,l.bitrate=n,l.codec=o,ym(this,l),l}removeRendition(e){Tm(e)}get selected(){return u(this,go)}set selected(e){u(this,go)!==e&&(_(this,go,e),e===!0&&_m(this))}};go=new WeakMap;function Sm(i,e){let t=T(i).media.audioRenditions;T(e).media=T(i).media,T(e).track=i;let r=T(i).renditionSet;r.add(e);let o=r.size-1;o in ar.prototype||Object.defineProperty(ar.prototype,o,{get(){return _o(this)[o]}}),queueMicrotask(()=>{i.enabled&&t.dispatchEvent(new $t("addrendition",{rendition:e}))})}function km(i){let e=T(i).media.audioRenditions,t=T(i).track;T(t).renditionSet.delete(i),queueMicrotask(()=>{T(i).track.enabled&&e.dispatchEvent(new $t("removerendition",{rendition:i}))})}function Lm(i){let e=T(i).media.audioRenditions;!e||T(e).changeRequested||(T(e).changeRequested=!0,queueMicrotask(()=>{delete T(e).changeRequested,T(i).track.enabled&&e.dispatchEvent(new Event("change"))}))}function _o(i){return[...T(i).media.audioTracks].filter(t=>t.enabled).flatMap(t=>[...T(t).renditionSet])}var Ei,gi,bi,ar=class extends EventTarget{constructor(){super(...arguments);S(this,Ei);S(this,gi);S(this,bi)}[Symbol.iterator](){return _o(this).values()}get length(){return _o(this).length}getRenditionById(t){return _o(this).find(r=>`${r.id}`==`${t}`)??null}get selectedIndex(){return _o(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[r,o]of _o(this).entries())o.selected=r===t}get onaddrendition(){return u(this,Ei)}set onaddrendition(t){u(this,Ei)&&(this.removeEventListener("addrendition",u(this,Ei)),_(this,Ei,void 0)),typeof t=="function"&&(_(this,Ei,t),this.addEventListener("addrendition",t))}get onremoverendition(){return u(this,gi)}set onremoverendition(t){u(this,gi)&&(this.removeEventListener("removerendition",u(this,gi)),_(this,gi,void 0)),typeof t=="function"&&(_(this,gi,t),this.addEventListener("removerendition",t))}get onchange(){return u(this,bi)}set onchange(t){u(this,bi)&&(this.removeEventListener("change",u(this,bi)),_(this,bi,void 0)),typeof t=="function"&&(_(this,bi,t),this.addEventListener("change",t))}};Ei=new WeakMap,gi=new WeakMap,bi=new WeakMap;var yo,da=class{constructor(){$(this,"src");$(this,"id");$(this,"bitrate");$(this,"codec");S(this,yo,!1)}get selected(){return u(this,yo)}set selected(e){u(this,yo)!==e&&(_(this,yo,e),Lm(this))}};yo=new WeakMap;function Ml(i,e){let t=i.audioTracks;T(e).media=i,T(e).renditionSet||(T(e).renditionSet=new Set);let r=T(t).trackSet;r.add(e);let o=r.size-1;o in sr.prototype||Object.defineProperty(sr.prototype,o,{get(){return[...T(this).trackSet][o]}}),queueMicrotask(()=>{t.dispatchEvent(new Ht("addtrack",{track:e}))})}function Rl(i){var r;let e=(r=T(i).media)==null?void 0:r.audioTracks;if(!e)return;T(e).trackSet.delete(i),queueMicrotask(()=>{e.dispatchEvent(new Ht("removetrack",{track:i}))})}function Cm(i){let e=T(i).media.audioTracks;!e||T(e).changeRequested||(T(e).changeRequested=!0,queueMicrotask(()=>{delete T(e).changeRequested,e.dispatchEvent(new Event("change"))}))}var _i,yi,Ti,To,wl,sr=class extends EventTarget{constructor(){super();S(this,To);S(this,_i);S(this,yi);S(this,Ti);T(this).trackSet=new Set}[Symbol.iterator](){return u(this,To,wl).values()}get length(){return u(this,To,wl).size}getTrackById(t){return[...u(this,To,wl)].find(r=>r.id===t)??null}get onaddtrack(){return u(this,_i)}set onaddtrack(t){u(this,_i)&&(this.removeEventListener("addtrack",u(this,_i)),_(this,_i,void 0)),typeof t=="function"&&(_(this,_i,t),this.addEventListener("addtrack",t))}get onremovetrack(){return u(this,yi)}set onremovetrack(t){u(this,yi)&&(this.removeEventListener("removetrack",u(this,yi)),_(this,yi,void 0)),typeof t=="function"&&(_(this,yi,t),this.addEventListener("removetrack",t))}get onchange(){return u(this,Ti)}set onchange(t){u(this,Ti)&&(this.removeEventListener("change",u(this,Ti)),_(this,Ti,void 0)),typeof t=="function"&&(_(this,Ti,t),this.addEventListener("change",t))}};_i=new WeakMap,yi=new WeakMap,Ti=new WeakMap,To=new WeakSet,wl=function(){return T(this).trackSet};var Ao,So=class{constructor(){$(this,"id");$(this,"kind");$(this,"label","");$(this,"language","");$(this,"sourceBuffer");S(this,Ao,!1)}addRendition(e,t,r){let o=new da;return o.src=e,o.codec=t,o.bitrate=r,Sm(this,o),o}removeRendition(e){km(e)}get enabled(){return u(this,Ao)}set enabled(e){u(this,Ao)!==e&&(_(this,Ao,e),Cm(this))}};Ao=new WeakMap;var Im=xl(globalThis.HTMLMediaElement,"video"),wm=xl(globalThis.HTMLMediaElement,"audio");function ko(i){if(!(i!=null&&i.prototype))return i;let e=xl(i,"video");(!e||`${e}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"videoTracks",{get(){return Zg(this)}});let t=xl(i,"audio");(!t||`${t}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"audioTracks",{get(){return Xg(this)}}),"addVideoTrack"in i.prototype||(i.prototype.addVideoTrack=function(n,a="",l=""){let d=new bo;return d.kind=n,d.label=a,d.language=l,Cl(this,d),d}),"removeVideoTrack"in i.prototype||(i.prototype.removeVideoTrack=Il),"addAudioTrack"in i.prototype||(i.prototype.addAudioTrack=function(n,a="",l=""){let d=new So;return d.kind=n,d.label=a,d.language=l,Ml(this,d),d}),"removeAudioTrack"in i.prototype||(i.prototype.removeAudioTrack=Rl),"videoRenditions"in i.prototype||Object.defineProperty(i.prototype,"videoRenditions",{get(){return r(this)}});let r=n=>{let a=T(n).videoRenditions;return a||(a=new nr,T(a).media=n,T(n).videoRenditions=a),a};"audioRenditions"in i.prototype||Object.defineProperty(i.prototype,"audioRenditions",{get(){return o(this)}});let o=n=>{let a=T(n).audioRenditions;return a||(a=new ar,T(a).media=n,T(n).audioRenditions=a),a};return i}function xl(i,e){var t;if(i!=null&&i.prototype)return(t=Object.getOwnPropertyDescriptor(i.prototype,`${e}Tracks`))==null?void 0:t.get}function Zg(i){let e=T(i).videoTracks;if(!e&&(e=new or,T(i).videoTracks=e,Im)){let t=Im.call(i.nativeEl??i);for(let r of t)Cl(i,r);t.addEventListener("change",()=>{e.dispatchEvent(new Event("change"))}),t.addEventListener("addtrack",r=>{if([...e].some(o=>o instanceof bo)){for(let o of t)Il(o);return}Cl(i,r.track)}),t.addEventListener("removetrack",r=>{Il(r.track)})}return e}function Xg(i){let e=T(i).audioTracks;if(!e&&(e=new sr,T(i).audioTracks=e,wm)){let t=wm.call(i.nativeEl??i);for(let r of t)Ml(i,r);t.addEventListener("change",()=>{e.dispatchEvent(new Event("change"))}),t.addEventListener("addtrack",r=>{if([...e].some(o=>o instanceof So)){for(let o of t)Rl(o);return}Ml(i,r.track)}),t.addEventListener("removetrack",r=>{Rl(r.track)})}return e}import Ve from"hls.js";var Jg=ko(De),Bt,Ai,Lo,Ye,tu,Mm,iu,ca,Rm,lr=class extends Jg{constructor(){super();S(this,Ye);S(this,Bt,null);S(this,Ai,null);S(this,Lo,!1);this.api=null;S(this,ca,()=>{var r,o;let t=this.nativeEl;t!=null&&t.webkitCurrentPlaybackTargetIsWireless?(r=this.api)==null||r.stopLoad():(o=this.api)==null||o.startLoad()});O(this,Ye,Rm).call(this,"config")}static getTemplateHTML(t,r={}){let{src:o,...n}=t;return`
|
|
2863
2876
|
<script type="application/json" id="config">
|
|
2864
2877
|
${JSON.stringify(r.config||{})}
|
|
2865
2878
|
<\/script>
|
|
2866
|
-
${
|
|
2867
|
-
`}get config(){return u(this,
|
|
2879
|
+
${De.getTemplateHTML(n)}
|
|
2880
|
+
`}get config(){return u(this,Ai)}set config(t){_(this,Ai,t)}attributeChangedCallback(t,r,o){t!=="src"&&super.attributeChangedCallback(t,r,o),t==="src"&&r!==o&&this.load()}disconnectedCallback(){var t;O(this,Ye,tu).call(this),(t=super.disconnectedCallback)==null||t.call(this)}async load(){var o,n,a;let t=!this.api&&!u(this,Lo);if(O(this,Ye,tu).call(this),!this.src)return;if(t&&!u(this,Ai)&&_(this,Ai,JSON.parse(((n=(o=this.shadowRoot)==null?void 0:o.getElementById("config"))==null?void 0:n.textContent)||"{}")),!O(this,Ye,Mm).call(this,this.src)){await Promise.resolve(),_(this,Lo,!0),this.nativeEl.src=this.src;return}if(Ve.isSupported()){switch(await Promise.resolve(),this.api=new Ve({liveDurationInfinity:!0,autoStartLoad:!1,...u(this,Ai)}),this.api.loadSource(this.src),this.api.attachMedia(this.nativeEl),this.nativeEl.preload){case"none":{let p=()=>{var E;return(E=this.api)==null?void 0:E.startLoad()};this.nativeEl.addEventListener("play",p,{once:!0}),this.api.on(Ve.Events.DESTROYING,()=>{this.nativeEl.removeEventListener("play",p)});break}case"metadata":{let p=this.api.config.maxBufferLength,E=this.api.config.maxBufferSize;this.api.config.maxBufferLength=1,this.api.config.maxBufferSize=1;let m=()=>{this.api&&(this.api.config.maxBufferLength=p,this.api.config.maxBufferSize=E)};this.nativeEl.addEventListener("play",m,{once:!0}),this.api.on(Ve.Events.DESTROYING,()=>{this.nativeEl.removeEventListener("play",m)}),this.api.startLoad();break}default:this.api.startLoad()}this.nativeEl.webkitCurrentPlaybackTargetIsWireless&&this.api.stopLoad(),this.nativeEl.addEventListener("webkitcurrentplaybacktargetiswirelesschanged",u(this,ca)),_(this,Bt,document.createElement("source")),u(this,Bt).setAttribute("type","application/x-mpegURL"),u(this,Bt).setAttribute("src",this.src),this.nativeEl.disableRemotePlayback=!1,this.nativeEl.append(u(this,Bt));let d=new WeakMap;this.api.on(Ve.Events.MANIFEST_PARSED,(p,E)=>{this.nativeEl.autoplay&&this.nativeEl.paused&&this.nativeEl.play().catch(A=>{console.warn("Autoplay failed:",A)}),O(this,Ye,iu).call(this);let m=this.videoTracks.getTrackById("main");m||(m=this.addVideoTrack("main"),m.id="main",m.selected=!0);for(let[A,f]of E.levels.entries()){let L=m.addRendition(f.url[0],f.width,f.height,f.videoCodec??void 0,f.bitrate);d.set(f,`${A}`),L.id=`${A}`}for(let[A,f]of E.audioTracks.entries()){let L=f.default?"main":"alternative",D=this.addAudioTrack(L,f.name,f.lang);D.id=`${A}`,f.default&&(D.enabled=!0)}}),this.audioTracks.addEventListener("change",()=>{var A,f;let p=[...this.audioTracks].find(L=>L.enabled),E=p?+p.id:void 0,m=((A=this.api)==null?void 0:A.audioTracks.map(L=>L.id))??[];E!==void 0&&E!==((f=this.api)==null?void 0:f.audioTrack)&&m.includes(E)&&this.api&&(this.api.audioTrack=E)}),this.api.on(Ve.Events.LEVELS_UPDATED,(p,E)=>{let m=[...this.videoTracks][this.videoTracks.selectedIndex??0];if(!m)return;let A=E.levels.map(f=>d.get(f));for(let f of this.videoRenditions)f.id&&!A.includes(f.id)&&m.removeRendition(f)});let v=null;this.api.on(Ve.Events.ERROR,(p,E)=>{var m;E.type===Ve.ErrorTypes.NETWORK_ERROR&&E.details===Ve.ErrorDetails.FRAG_LOAD_ERROR&&(v=((m=E.frag)==null?void 0:m.level)??null)}),this.api.on(Ve.Events.LEVEL_SWITCHED,(p,E)=>{let m=E.level;v!==null&&m<v&&(console.warn(`hls.js downgraded quality from level ${v} to ${m} due to fragment load failure.`),this.videoRenditions.selectedIndex=m,v=null)});let h=()=>{let p=this.videoRenditions.selectedIndex;this.api&&p!==this.api.nextLevel&&(this.api.nextLevel=p)};(a=this.videoRenditions)==null||a.addEventListener("change",h),this.api.once(Ve.Events.DESTROYING,()=>{var p;O(this,Ye,iu).call(this),(p=this.videoRenditions)==null||p.removeEventListener("change",h)});return}await Promise.resolve(),this.nativeEl.canPlayType("application/vnd.apple.mpegurl")&&(this.nativeEl.src=this.src)}};Bt=new WeakMap,Ai=new WeakMap,Lo=new WeakMap,Ye=new WeakSet,tu=function(){var t,r;(t=u(this,Bt))==null||t.remove(),_(this,Bt,null),(r=this.nativeEl)==null||r.removeEventListener("webkitcurrentplaybacktargetiswirelesschanged",u(this,ca)),this.api&&(this.api.detachMedia(),this.api.destroy(),this.api=null),_(this,Lo,!1)},Mm=function(t){return t.includes(".m3u8")||t.includes("application/x-mpegURL")},iu=function(){for(let t of this.videoTracks)this.removeVideoTrack(t);for(let t of this.audioTracks)this.removeAudioTrack(t)},ca=new WeakMap,Rm=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let r=this[t];delete this[t],this[t]=r}},lr.shadowRootOptions={...De.shadowRootOptions};globalThis.customElements&&!globalThis.customElements.get("hls-video")&&globalThis.customElements.define("hls-video",lr);var xm=lr;var jg="nanoplayer.4.min.js",eb="nanoplayer",Se={loading:!1,loaded:!1,error:null,callbacks:[]};function tb(i){return new Promise((e,t)=>{if(window.NanoPlayer){Se.loaded=!0,e();return}if(Se.loaded){e();return}if(Se.error){t(Se.error);return}if(Se.callbacks.push(a=>{a?t(a):e()}),Se.loading)return;Se.loading=!0;let o=`${i.endsWith("/")?i:`${i}/`}${eb}/${jg}`,n=document.createElement("script");n.src=o,n.async=!0,n.onload=()=>{Se.loaded=!0,Se.loading=!1,Se.callbacks.forEach(a=>a()),Se.callbacks=[]},n.onerror=()=>{let a=new Error(`Failed to load NanoPlayer script from ${o}`);Se.error=a,Se.loading=!1,Se.callbacks.forEach(l=>l(a)),Se.callbacks=[]},document.head.appendChild(n)})}var ib=ko(De),Vt,Si,de,rt,Co,ke,ua,Wt,dr,Io,Ft,wo,Mo,Le,ru,Pm,Dm,Om,Pl,cr=class extends ib{constructor(){super();S(this,Le);S(this,Vt,null);S(this,Si,null);S(this,de,null);S(this,rt,null);S(this,Co,"");S(this,ke,null);S(this,ua,!0);S(this,Wt,[]);S(this,dr,[]);S(this,Io,null);S(this,Ft,null);S(this,wo,!1);S(this,Mo,!1);this.api=null;O(this,Le,Pl).call(this,"config"),O(this,Le,Pl).call(this,"streamid"),O(this,Le,Pl).call(this,"sourceConfig")}static get observedAttributes(){return[...De.observedAttributes,"streamid","library-location"]}static getTemplateHTML(t,r={}){let{streamid:o,"library-location":n,...a}=t;return`
|
|
2868
2881
|
<script type="application/json" id="config">
|
|
2869
2882
|
${JSON.stringify(r.config||{})}
|
|
2870
2883
|
<\/script>
|
|
2871
|
-
${
|
|
2872
|
-
`}get config(){return u(this,
|
|
2884
|
+
${De.getTemplateHTML(a)}
|
|
2885
|
+
`}get config(){return u(this,Vt)}set config(t){_(this,Vt,t)}get sourceConfig(){return u(this,Si)}set sourceConfig(t){let r=u(this,Si)!==t;_(this,Si,t),r&&t&&this.load()}get streamid(){return this.getAttribute("streamid")}set streamid(t){t?this.setAttribute("streamid",t):this.removeAttribute("streamid")}get libraryLocation(){return this.getAttribute("library-location")||"/vendor/bp-player"}set libraryLocation(t){this.setAttribute("library-location",t)}attributeChangedCallback(t,r,o){t==="streamid"&&r!==o?this.load():t!=="streamid"&&t!=="library-location"&&super.attributeChangedCallback(t,r,o)}async load(){var n,a,l,d,v;let t=!u(this,de);O(this,Le,ru).call(this);let r=this.streamid,o=!!u(this,Si);if(!(!r&&!o)){_(this,Io,new Promise(h=>{_(this,Ft,h)})),t&&!u(this,Vt)&&_(this,Vt,JSON.parse(((a=(n=this.shadowRoot)==null?void 0:n.getElementById("config"))==null?void 0:a.textContent)||"{}"));try{await tb(this.libraryLocation)}catch(h){console.error("[nano-video] Failed to load NanoPlayer script:",h),this.dispatchEvent(Yt(h)),(l=u(this,Ft))==null||l.call(this);return}_(this,Co,`nano-video-${Date.now()}-${Math.random().toString(36).slice(2,9)}`),_(this,rt,document.createElement("div")),u(this,rt).id=u(this,Co),u(this,rt).style.cssText="width: 100%; height: 100%; position: absolute; top: 0; left: 0;",this.addEventListener("pause",h=>{var p;h.target!==this&&((p=u(this,rt))!=null&&p.contains(h.target))&&u(this,wo)&&h.stopImmediatePropagation()},!0),this.style.position="relative",this.nativeEl.style.display="none",this.appendChild(u(this,rt)),_(this,de,new window.NanoPlayer(u(this,Co))),this.api=u(this,de);try{let h=O(this,Le,Pm).call(this,r,o?u(this,Si):void 0),p=await u(this,de).setup(h);_(this,dr,((d=p.source.entries)==null?void 0:d.map((E,m)=>({index:m,height:E.info.height??0,width:E.info.width??0,bitrate:E.info.bitrate??0,label:E.info.height?`${E.info.height}p`:m===0?"Source":`Stream ${m+1}`})))??[]),O(this,Le,Om).call(this)}catch(h){console.error("[nano-video] Failed to setup NanoPlayer:",h),this.dispatchEvent(Yt(h)),(v=u(this,Ft))==null||v.call(this)}}}async play(){if(u(this,Io)&&await u(this,Io),u(this,de)){_(this,wo,!0),u(this,de).play();return}return super.play()}pause(){if(u(this,de)){u(this,de).pause();return}super.pause()}get currentTime(){var t;return((t=u(this,ke))==null?void 0:t.currentTime)??super.currentTime}set currentTime(t){u(this,de)||(super.currentTime=t)}get duration(){return 1/0}get paused(){var t;return((t=u(this,ke))==null?void 0:t.paused)??super.paused}get volume(){var t;return((t=u(this,ke))==null?void 0:t.volume)??super.volume}set volume(t){u(this,ke)?u(this,ke).volume=t:super.volume=t}get muted(){var t;return((t=u(this,ke))==null?void 0:t.muted)??super.muted}set muted(t){u(this,ke)&&(u(this,ke).muted=t),u(this,de)?t?u(this,de).mute():u(this,de).unmute():super.muted=t}get videoWidth(){var t;return((t=u(this,ke))==null?void 0:t.videoWidth)??super.videoWidth}get videoHeight(){var t;return((t=u(this,ke))==null?void 0:t.videoHeight)??super.videoHeight}disconnectedCallback(){var t;O(this,Le,ru).call(this),(t=super.disconnectedCallback)==null||t.call(this)}};Vt=new WeakMap,Si=new WeakMap,de=new WeakMap,rt=new WeakMap,Co=new WeakMap,ke=new WeakMap,ua=new WeakMap,Wt=new WeakMap,dr=new WeakMap,Io=new WeakMap,Ft=new WeakMap,wo=new WeakMap,Mo=new WeakMap,Le=new WeakSet,ru=function(){u(this,Wt).forEach(t=>t()),_(this,Wt,[]);for(let t of this.videoTracks)this.removeVideoTrack(t);for(let t of this.audioTracks)this.removeAudioTrack(t);u(this,de)&&(u(this,de).destroy(),_(this,de,null),this.api=null),u(this,rt)&&(u(this,rt).remove(),_(this,rt,null)),_(this,ke,null),_(this,Mo,!1),_(this,dr,[])},Pm=function(t,r){var n,a;return{source:r??{group:{id:t},options:{adaption:{rule:"deviationOfMean2"},switch:{method:"server",pauseOnError:!1,forcePlay:!0,timeout:10}}},playback:{autoplay:this.nativeEl.autoplay,muted:this.nativeEl.muted,reconnect:((n=u(this,Vt))==null?void 0:n.reconnect)??{minDelay:2,maxDelay:10,delaySteps:10,maxRetries:10},buffer:((a=u(this,Vt))==null?void 0:a.buffer)??{min:.1,max:2,target:.5}},style:{width:"100%",height:"100%",controls:!1,view:!1,interactive:!1},events:{onReady:()=>{var l;this.dispatchEvent(q(nd)),this.dispatchEvent(q(jo)),this.dispatchEvent(q(Sa)),(l=u(this,Ft))==null||l.call(this)},onPlay:()=>{_(this,wo,!1),_(this,Mo,!0),this.dispatchEvent(q(Zo)),this.dispatchEvent(q(Qt))},onPause:()=>{this.dispatchEvent(q(Ri))},onLoading:()=>{this.dispatchEvent(q(yr))},onStartBuffering:()=>{this.dispatchEvent(q(yr))},onStopBuffering:()=>{this.dispatchEvent(q(Sa)),this.dispatchEvent(q(Qt))},onError:l=>{var h,p;let d=l.data.code??-1,v=l.data.message??"NanoPlayer error";if(d===2004&&u(this,Mo)){this.dispatchEvent(q(Xo)),(h=u(this,Ft))==null||h.call(this);return}this.dispatchEvent(Yt(new Error(v),d)),(p=u(this,Ft))==null||p.call(this)},onActiveVideoElementChange:l=>{var v;let d=(v=l.data)==null?void 0:v.activeVideoElement;d&&(_(this,ke,d),O(this,Le,Dm).call(this,d))}}}},Dm=function(t){u(this,Wt).forEach(o=>o()),_(this,Wt,[]);let r=[Jo,en,id,Zt];for(let o of r){let n=()=>{this.dispatchEvent(q(o))};t.addEventListener(o,n),u(this,Wt).push(()=>t.removeEventListener(o,n))}},Om=function(){for(let o of this.videoTracks)this.removeVideoTrack(o);for(let o of this.audioTracks)this.removeAudioTrack(o);if(u(this,dr).length===0)return;let t=this.addVideoTrack("main");t.id="main",t.selected=!0;for(let o of u(this,dr)){let n=t.addRendition("",o.width,o.height,void 0,o.bitrate);n.id=`${o.index}`}let r=()=>{var n,a,l;let o=this.videoRenditions.selectedIndex;o<0?(_(this,ua,!0),(n=u(this,de))==null||n.setAdaption({rule:"deviationOfMean2"})):(_(this,ua,!1),(a=u(this,de))==null||a.switchStream(o).catch(()=>{}),(l=u(this,de))==null||l.setAdaption({rule:"none"}))};this.videoRenditions.addEventListener("change",r),u(this,Wt).push(()=>{this.videoRenditions.removeEventListener("change",r)})},Pl=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let r=this[t];delete this[t],this[t]=r}},cr.shadowRootOptions={...De.shadowRootOptions};globalThis.customElements&&!globalThis.customElements.get("nano-video")&&globalThis.customElements.define("nano-video",cr);var Nm=cr;import{Room as rb,RoomEvent as Ro,Track as Um,VideoQuality as ob}from"livekit-client";var nb=ko(De),Qe,ye,oe,Lt,xo,Ct,Po,Do,ce,ou,Hm,$m,Dl,Bm,Vm,Ol,ur=class extends nb{constructor(){super();S(this,ce);S(this,Qe,null);S(this,ye,null);S(this,oe,null);S(this,Lt,[]);S(this,xo,[]);S(this,Ct,"disconnected");S(this,Po,null);S(this,Do,null);this.room=null;O(this,ce,Ol).call(this,"config"),O(this,ce,Ol).call(this,"url"),O(this,ce,Ol).call(this,"token")}static get observedAttributes(){return[...De.observedAttributes,"url","token"]}static getTemplateHTML(t,r={}){let{url:o,token:n,...a}=t;return`
|
|
2873
2886
|
<script type="application/json" id="config">
|
|
2874
2887
|
${JSON.stringify(r.config||{})}
|
|
2875
2888
|
<\/script>
|
|
2876
|
-
${
|
|
2877
|
-
`}get config(){return u(this,
|
|
2889
|
+
${De.getTemplateHTML(a)}
|
|
2890
|
+
`}get config(){return u(this,Qe)}set config(t){_(this,Qe,t)}get url(){return this.getAttribute("url")}set url(t){t?this.setAttribute("url",t):this.removeAttribute("url")}get token(){return this.getAttribute("token")}set token(t){t?this.setAttribute("token",t):this.removeAttribute("token")}attributeChangedCallback(t,r,o){(t==="url"||t==="token")&&r!==o?this.url&&this.token&&this.load():t!=="url"&&t!=="token"&&super.attributeChangedCallback(t,r,o)}async load(){var l,d,v;let t=!u(this,ye);O(this,ce,ou).call(this);let r=this.url,o=this.token;if(!r||!o)return;_(this,Po,new Promise(h=>{_(this,Do,h)})),t&&!u(this,Qe)&&_(this,Qe,JSON.parse(((d=(l=this.shadowRoot)==null?void 0:l.getElementById("config"))==null?void 0:d.textContent)||"{}"));let n=O(this,ce,Bm).call(this),a=O(this,ce,Vm).call(this);_(this,ye,new rb(n)),this.room=u(this,ye),u(this,ye).on(Ro.Connected,()=>{_(this,Ct,"connected")}),u(this,ye).on(Ro.Disconnected,h=>{_(this,Ct,"disconnected"),h?this.dispatchEvent(Yt(new Error(`LiveKit disconnected: ${h}`),4001)):this.dispatchEvent(q(Xo))}),u(this,ye).on(Ro.Reconnecting,()=>{_(this,Ct,"reconnecting"),this.dispatchEvent(q(yr))}),u(this,ye).on(Ro.Reconnected,()=>{_(this,Ct,"connected"),this.dispatchEvent(q(Qt))}),u(this,ye).on(Ro.TrackSubscribed,(h,p,E)=>{var m,A;if(h.kind===Um.Kind.Video){let f=h.attach();f.style.width="100%",f.style.height="100%",f.style.objectFit="contain",f.style.position="absolute",f.style.top="0",f.style.left="0",this.nativeEl.muted&&(f.muted=!0),this.nativeEl.style.display="none",(m=this.shadowRoot)==null||m.appendChild(f),_(this,oe,f),O(this,ce,Hm).call(this,f),O(this,ce,$m).call(this,p),this.dispatchEvent(q(od)),this.dispatchEvent(q(Zt)),this.dispatchEvent(q(jo)),this.dispatchEvent(q(Qt)),(A=u(this,Do))==null||A.call(this)}}),u(this,ye).on(Ro.TrackUnsubscribed,h=>{h.kind===Um.Kind.Video&&(h.detach(),O(this,ce,Dl).call(this),u(this,oe)&&(u(this,Lt).forEach(p=>p()),_(this,Lt,[]),u(this,oe).remove(),_(this,oe,null)))}),_(this,Ct,"connecting"),this.dispatchEvent(q(rd));try{await u(this,ye).connect(r,o,a)}catch(h){_(this,Ct,"failed"),console.error("[livekit-video] Failed to connect:",h);let p=h instanceof Error?h.message:"Failed to connect to LiveKit room";this.dispatchEvent(Yt(new Error(p),4e3)),(v=u(this,Do))==null||v.call(this)}}async play(){return u(this,Po)&&await u(this,Po),u(this,oe)?u(this,oe).play():super.play()}pause(){if(u(this,oe)){u(this,oe).pause();return}super.pause()}get currentTime(){var t;return((t=u(this,oe))==null?void 0:t.currentTime)??super.currentTime}set currentTime(t){u(this,ye)||(super.currentTime=t)}get duration(){return 1/0}get paused(){var t;return((t=u(this,oe))==null?void 0:t.paused)??super.paused}get volume(){var t;return((t=u(this,oe))==null?void 0:t.volume)??super.volume}set volume(t){u(this,oe)?u(this,oe).volume=t:super.volume=t}get muted(){var t;return((t=u(this,oe))==null?void 0:t.muted)??super.muted}set muted(t){u(this,oe)?u(this,oe).muted=t:super.muted=t}get videoWidth(){var t;return((t=u(this,oe))==null?void 0:t.videoWidth)??super.videoWidth}get videoHeight(){var t;return((t=u(this,oe))==null?void 0:t.videoHeight)??super.videoHeight}disconnectedCallback(){var t;O(this,ce,ou).call(this),(t=super.disconnectedCallback)==null||t.call(this)}};Qe=new WeakMap,ye=new WeakMap,oe=new WeakMap,Lt=new WeakMap,xo=new WeakMap,Ct=new WeakMap,Po=new WeakMap,Do=new WeakMap,ce=new WeakSet,ou=function(){u(this,Lt).forEach(t=>t()),_(this,Lt,[]),O(this,ce,Dl).call(this),u(this,ye)&&(u(this,ye).disconnect(),_(this,ye,null),this.room=null),u(this,oe)&&(u(this,oe).remove(),_(this,oe,null)),_(this,Ct,"disconnected")},Hm=function(t){u(this,Lt).forEach(o=>o()),_(this,Lt,[]);let r=[Jo,en,Zo,Qt,Ri,Zt];for(let o of r){let n=()=>{this.dispatchEvent(q(o))};t.addEventListener(o,n),u(this,Lt).push(()=>t.removeEventListener(o,n))}},$m=function(t){var l;O(this,ce,Dl).call(this);let r=(l=t.trackInfo)==null?void 0:l.layers;if(!r||r.length===0)return;let o=this.addVideoTrack("main");o.id="main",o.selected=!0;let n=[...r].sort((d,v)=>d.quality-v.quality);for(let d of n){let v=o.addRendition("",d.width,d.height,void 0,d.bitrate);v.id=`${d.quality}`}let a=()=>{let d=this.videoRenditions.selectedIndex;if(d<0)t.setVideoQuality(ob.HIGH);else{let v=n[d];v&&t.setVideoQuality(v.quality)}};this.videoRenditions.addEventListener("change",a),u(this,xo).push(()=>this.videoRenditions.removeEventListener("change",a))},Dl=function(){u(this,xo).forEach(t=>t()),_(this,xo,[]);for(let t of this.videoTracks)this.removeVideoTrack(t);for(let t of this.audioTracks)this.removeAudioTrack(t)},Bm=function(){var t,r,o;return{adaptiveStream:((t=u(this,Qe))==null?void 0:t.adaptiveStream)??!1,dynacast:((r=u(this,Qe))==null?void 0:r.dynacast)??!0,disconnectOnPageLeave:((o=u(this,Qe))==null?void 0:o.disconnectOnPageLeave)??!1}},Vm=function(){var t,r;return{autoSubscribe:!0,peerConnectionTimeout:((t=u(this,Qe))==null?void 0:t.peerConnectionTimeout)??8e3,rtcConfig:{iceTransportPolicy:((r=u(this,Qe))==null?void 0:r.iceTransportPolicy)??"relay"}}},Ol=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let r=this[t];delete this[t],this[t]=r}},ur.shadowRootOptions={...De.shadowRootOptions};globalThis.customElements&&!globalThis.customElements.get("livekit-video")&&globalThis.customElements.define("livekit-video",ur);var Wm=ur;export{Aa as Attribute,re as BPDefaultUI,ci as BPErrorDisplay,Mt as BPLiveError,Yo as BPLiveService,Ut as BPOverlay,Ie as BPPlayer,Ve as Hls,lr as HlsVideo,xm as HlsVideoElement,ur as LiveKitVideo,Wm as LiveKitVideoElement,uv as NANOPLAYER_NO_REPLAY_CODES,cr as NanoVideo,Nm as NanoVideoElement,_a as PlayerCoreImpl,fv as StateReceiverMixin,gr as StateReceiverProps,Qo as addGlobalStyles,jl as classifyLiveKitError,Jl as classifyNanoPlayerError,ga as createInitialState,ed as createPlayerCore,_v as createTemplate,br as forEachStateReceiverElement,Er as isBPLiveClipSource,hv as isBPLiveSource,ba as isBPLiveStreamSource,td as isStateReceiverElement,ya as propagateStateToReceiver,Ta as removeStateFromReceiver,yv as templateWithStyles,Ee as toggleAttribute};
|
|
2878
2891
|
/*! Bundled license information:
|
|
2879
2892
|
|
|
2880
2893
|
@lit/reactive-element/css-tag.js:
|