1var W=Object.defineProperty;var I=t=>{throw TypeError(t)};var F=(t,n,i)=>n in t?W(t,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[n]=i;var M=(t,n,i)=>F(t,typeof n!="symbol"?n+"":n,i),R=(t,n,i)=>n.has(t)||I("Cannot "+i);var p=(t,n,i)=>(R(t,n,"read from private field"),i?i.call(t):n.get(t)),L=(t,n,i)=>n.has(t)?I("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(t):n.set(t,i),w=(t,n,i,u)=>(R(t,n,"write to private field"),u?u.call(t,i):n.set(t,i),i),P=(t,n,i)=>(R(t,n,"access private method"),i);import{R as $}from"./index-CemBVJmb.js";import{C as j}from"./custom-media-element-BTc9lN-c.js";import{M as z,H as b}from"./hls-DMf95nPo.js";const G=t=>{var n,i,u,m,H,E,O;return n=class extends t{constructor(){super();L(this,m);L(this,i,null);L(this,u,null);L(this,E,()=>{var s,a,f;(s=this.nativeEl)!=null&&s.webkitCurrentPlaybackTargetIsWireless?(a=this.api)==null||a.stopLoad():(f=this.api)==null||f.startLoad()});P(this,m,O).call(this,"config")}get config(){return p(this,u)}set config(s){w(this,u,s)}attributeChangedCallback(s,a,f){s!=="src"&&super.attributeChangedCallback(s,a,f),s==="src"&&a!=f&&this.load()}async load(){var s,a;const f=!this.api;if(P(this,m,H).call(this),!!this.src){if(f&&!p(this,u)&&w(this,u,JSON.parse(((s=this.shadowRoot.getElementById("config"))==null?void 0:s.textContent)||"{}")),b.isSupported()){switch(this.api=new b({liveDurationInfinity:!0,autoStartLoad:!1,...this.config}),await Promise.resolve(),this.api.loadSource(this.src),this.api.attachMedia(this.nativeEl),this.nativeEl.preload){case"none":{const l=()=>this.api.startLoad();this.nativeEl.addEventListener("play",l,{once:!0}),this.api.on(b.Events.DESTROYING,()=>{this.nativeEl.removeEventListener("play",l)});break}case"metadata":{const l=this.api.config.maxBufferLength,h=this.api.config.maxBufferSize;this.api.config.maxBufferLength=1,this.api.config.maxBufferSize=1;const r=()=>{this.api.config.maxBufferLength=l,this.api.config.maxBufferSize=h};this.nativeEl.addEventListener("play",r,{once:!0}),this.api.on(b.Events.DESTROYING,()=>{this.nativeEl.removeEventListener("play",r)}),this.api.startLoad();break}default:this.api.startLoad()}this.nativeEl.webkitCurrentPlaybackTargetIsWireless&&this.api.stopLoad(),this.nativeEl.addEventListener("webkitcurrentplaybacktargetiswirelesschanged",p(this,E)),w(this,i,document.createElement("source")),p(this,i).setAttribute("type","application/x-mpegURL"),p(this,i).setAttribute("src",this.src),this.nativeEl.disableRemotePlayback=!1,this.nativeEl.append(p(this,i));const T=new WeakMap;this.api.on(b.Events.MANIFEST_PARSED,(l,h)=>{this.nativeEl.autoplay&&this.nativeEl.paused&&this.nativeEl.play().catch(c=>{console.warn("Autoplay failed:",c)}),k();let r=this.videoTracks.getTrackById("main");r||(r=this.addVideoTrack("main"),r.id="main",r.selected=!0);for(const[c,e]of h.levels.entries()){const o=r.addRendition(e.url[0],e.width,e.height,e.videoCodec,e.bitrate);T.set(e,`${c}`),o.id=`${c}`}for(let[c,e]of h.audioTracks.entries()){const o=e.default?"main":"alternative",d=this.addAudioTrack(o,e.name,e.lang);d.id=`${c}`,e.default&&(d.enabled=!0)}}),this.audioTracks.addEventListener("change",()=>{var l;const h=+((l=[...this.audioTracks].find(c=>c.enabled))==null?void 0:l.id),r=this.api.audioTracks.map(c=>c.id);h!=this.api.audioTrack&&r.includes(h)&&(this.api.audioTrack=h)}),this.api.on(b.Events.LEVELS_UPDATED,(l,h)=>{const r=this.videoTracks[this.videoTracks.selectedIndex??0];if(!r)return;const c=h.levels.map(e=>T.get(e));for(const e of this.videoRenditions)e.id&&!c.includes(e.id)&&r.removeRendition(e)});const v=l=>{const h=l.target.selectedIndex;h!=this.api.nextLevel&&(this.api.nextLevel=h)};(a=this.videoRenditions)==null||a.addEventListener("change",v);const k=()=>{for(const l of this.videoTracks)this.removeVideoTrack(l);for(const l of this.audioTracks)this.removeAudioTrack(l)};this.api.once(b.Events.DESTROYING,k);return}await Promise.resolve(),this.nativeEl.canPlayType("application/vnd.apple.mpegurl")&&(this.nativeEl.src=this.src)}}},i=new WeakMap,u=new WeakMap,m=new WeakSet,H=function(){var s,a;
1(s=p(this,i))==null||s.remove(),(a=this.nativeEl)==null||a.removeEventListener("webkitcurrentplaybacktargetiswirelesschanged",p(this,E)),this.api&&(this.api.detachMedia(),this.api.destroy(),this.api=null)},E=new WeakMap,O=function(s){if(Object.prototype.hasOwnProperty.call(this,s)){const a=this[s];delete this[s],this[s]=a}},M(n,"shadowRootOptions",{...t.shadowRootOptions}),M(n,"getTemplateHTML",(s,a={})=>{const{src:f,...T}=s;return` 2 <script type="application/json" id="config"> 3 ${JSON.stringify(a.config||{})} 4 <\/script> 5 ${t.getTemplateHTML(T)} 6 `}),n},N=G(z(j));globalThis.customElements&&!globalThis.customElements.get("hls-video")&&globalThis.customElements.define("hls-video",N);var V=N,Y=new Set(["style","children","ref","key","suppressContentEditableWarning","suppressHydrationWarning","dangerouslySetInnerHTML"]),J={className:"class",htmlFor:"for"};function C(t){return t.toLowerCase()}function x(t){if(typeof t=="boolean")return t?"":void 0;if(typeof t!="function"&&!(typeof t=="object"&&t!==null))return t}function U({react:t,tagName:n,elementClass:i,events:u,displayName:m,defaultProps:B,toAttributeName:E=C,toAttributeValue:D=x}){const _=Number.parseInt(t.version)>=19,S=t.forwardRef((s,a)=>{var f,T;const v=t.useRef(null),k=t.useRef(new Map),l={},h={},r={},c={};for(const[e,o]of Object.entries(s)){if(Y.has(e)){r[e]=o;continue}const d=E(J[e]??e);if(i.prototype&&e in i.prototype&&!(e in(((f=globalThis.HTMLElement)==null?void 0:f.prototype)??{}))&&!((T=i.observedAttributes)!=null&&T.some(y=>y===d))){c[e]=o;continue}if(e.startsWith("on")){l[e]=o;continue}const g=D(o);if(d&&g!=null&&(h[d]=String(g),_||(r[d]=g)),d&&_){const y=x(o);g!==y?r[d]=g:r[d]=o}}if(typeof window<"u"){for(const e in l){const o=l[e],d=e.endsWith("Capture"),g=((u==null?void 0:u[e])??e.slice(2).toLowerCase()).slice(0,d?-7:void 0);t.useLayoutEffect(()=>{const y=v==null?void 0:v.current;if(!(!y||typeof o!="function"))return y.addEventListener(g,o,d),()=>{y.removeEventListener(g,o,d)}},[v==null?void 0:v.current,o])}t.useLayoutEffect(()=>{if(v.current===null)return;const e=new Map;for(const o in c)A(v.current,o,c[o]),k.current.delete(o),e.set(o,c[o]);for(const[o,d]of k.current)A(v.current,o,void 0);k.current=e})}if(typeof window>"u"&&(i!=null&&i.getTemplateHTML)&&(i!=null&&i.shadowRootOptions)){const{mode:e,delegatesFocus:o}=i.shadowRootOptions,d=t.createElement("template",{shadowrootmode:e,shadowrootdelegatesfocus:o,dangerouslySetInnerHTML:{__html:i.getTemplateHTML(h,s)}});r.children=[d,r.children]}return t.createElement(n,{...B,...r,ref:t.useCallback(e=>{v.current=e,typeof a=="function"?a(e):a!==null&&(a.current=e)},[a])})});return S.displayName=m??i.name,S}function A(t,n,i){var u;t[n]=i,i==null&&n in(((u=globalThis.HTMLElement)==null?void 0:u.prototype)??{})&&t.removeAttribute(n)}var tt=U({react:$,tagName:"hls-video",elementClass:V,toAttributeName(t){return t==="muted"?"":t==="defaultMuted"?"muted":C(t)}});/*! Bundled license information: 7 8ce-la-react/dist/ce-la-react.js: 9 (** 10 * @license 11 * Copyright 2018 Google LLC 12 * SPDX-License-Identifier: BSD-3-Clause 13 * 14 * Modified version of `@lit/react` for vanilla custom elements with support for SSR. 15 *) 16*/export{tt as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.