@hanifhan1f/vidstack 1.12.24 → 1.12.25
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/cdn/chunks/vidstack-BBMfnVvt.js +1 -0
- package/cdn/chunks/vidstack-BkxGdzTJ.js +16 -0
- package/cdn/chunks/vidstack-Bzk6lVKb.js +1 -0
- package/cdn/chunks/vidstack-C0nMUcD9.js +1 -0
- package/cdn/chunks/vidstack-C51SKMUl.js +1 -0
- package/cdn/chunks/vidstack-CL95Hezv.js +1 -0
- package/cdn/chunks/vidstack-CkaxOIJb.js +1 -0
- package/cdn/chunks/vidstack-Cu8FqSS9.js +1 -0
- package/cdn/chunks/vidstack-DIPX97sJ.js +3 -0
- package/cdn/chunks/vidstack-DdAmWWBJ.js +1 -0
- package/cdn/chunks/vidstack-DhXI_0ND.js +1 -0
- package/cdn/chunks/vidstack-DiXE5sG8.js +1 -0
- package/cdn/chunks/vidstack-pFwe7gvT.js +3 -0
- package/cdn/providers/vidstack-audio-BAfEe7CJ.js +1 -0
- package/cdn/providers/vidstack-dash-CGZUJqdT.js +1 -0
- package/cdn/providers/vidstack-google-cast-Drb5Ncs5.js +1 -0
- package/cdn/providers/vidstack-hls-CVpa4usG.js +1 -0
- package/cdn/providers/vidstack-html-Bag27bH6.js +1 -0
- package/cdn/providers/vidstack-video-DXUiSn4B.js +1 -0
- package/cdn/providers/vidstack-vimeo-DD6HUOtJ.js +1 -0
- package/cdn/providers/vidstack-youtube-BVNE075s.js +1 -0
- package/cdn/vidstack.js +1 -1
- package/cdn/with-layouts/chunks/vidstack-2Rlth5Cf.js +1 -0
- package/cdn/with-layouts/chunks/vidstack-BP3ybDy9.js +912 -0
- package/cdn/with-layouts/chunks/vidstack-BaNApRCP.js +1 -0
- package/cdn/with-layouts/chunks/vidstack-BlWKO1g1.js +1 -0
- package/cdn/with-layouts/chunks/vidstack-BxJPOhv7.js +1 -0
- package/cdn/with-layouts/chunks/vidstack-BxdAdQ0H.js +1 -0
- package/cdn/with-layouts/chunks/vidstack-CROJF16Z.js +1 -0
- package/cdn/with-layouts/chunks/vidstack-CaW6KGwN.js +1 -0
- package/cdn/with-layouts/chunks/vidstack-CwzW7rJU.js +1 -0
- package/cdn/with-layouts/chunks/vidstack-DJyGEdCH.js +1 -0
- package/cdn/with-layouts/chunks/vidstack-DeLOZ-hK.js +3 -0
- package/cdn/with-layouts/chunks/vidstack-Dp3Ib32P.js +1 -0
- package/cdn/with-layouts/chunks/vidstack-Dy1Hfo7P.js +3 -0
- package/cdn/with-layouts/providers/vidstack-audio-cxaZF4jF.js +1 -0
- package/cdn/with-layouts/providers/vidstack-dash-DX1VjdTW.js +1 -0
- package/cdn/with-layouts/providers/vidstack-google-cast-DYJgNlvD.js +1 -0
- package/cdn/with-layouts/providers/vidstack-hls-2d6-2JAG.js +1 -0
- package/cdn/with-layouts/providers/vidstack-html-C9nnuK3r.js +1 -0
- package/cdn/with-layouts/providers/vidstack-video-EWE67g5i.js +1 -0
- package/cdn/with-layouts/providers/vidstack-vimeo-DqFeS0-d.js +1 -0
- package/cdn/with-layouts/providers/vidstack-youtube-eivIFfMV.js +1 -0
- package/cdn/with-layouts/vidstack.js +1 -1
- package/dev/chunks/vidstack-44ILR0Cb.js +1521 -0
- package/dev/chunks/vidstack-B4XOm7dP.js +104 -0
- package/dev/chunks/vidstack-CEjYxSqZ.js +297 -0
- package/dev/chunks/vidstack-CQdFhXSo.js +204 -0
- package/dev/chunks/vidstack-DWtK42Sh.js +1483 -0
- package/dev/chunks/vidstack-el2dbO0m.js +5181 -0
- package/dev/chunks/vidstack-rvhuswgi.js +2986 -0
- package/dev/define/plyr-layout.js +2 -2
- package/dev/define/templates/vidstack-audio-layout.js +1 -1
- package/dev/define/templates/vidstack-video-layout.js +1 -1
- package/dev/define/vidstack-player-default-layout.js +1 -1
- package/dev/define/vidstack-player-layouts.js +1 -1
- package/dev/define/vidstack-player-ui.js +4 -4
- package/dev/define/vidstack-player.js +2 -2
- package/dev/global/plyr.js +4 -4
- package/dev/global/vidstack-player.js +2 -2
- package/dev/vidstack-elements.js +7 -7
- package/dev/vidstack.js +4 -4
- package/package.json +1 -1
- package/prod/chunks/vidstack-C-yd_bAJ.js +4771 -0
- package/prod/chunks/vidstack-Cs0fH84E.js +1521 -0
- package/prod/chunks/vidstack-DDePVDjt.js +2976 -0
- package/prod/chunks/vidstack-DXfGRhxZ.js +201 -0
- package/prod/chunks/vidstack-DnRxQoqP.js +104 -0
- package/prod/chunks/vidstack-Ko2EJadT.js +1483 -0
- package/prod/chunks/vidstack-XA3zT5W9.js +297 -0
- package/prod/define/plyr-layout.js +2 -2
- package/prod/define/templates/vidstack-audio-layout.js +1 -1
- package/prod/define/templates/vidstack-video-layout.js +1 -1
- package/prod/define/vidstack-player-default-layout.js +1 -1
- package/prod/define/vidstack-player-layouts.js +1 -1
- package/prod/define/vidstack-player-ui.js +4 -4
- package/prod/define/vidstack-player.js +2 -2
- package/prod/global/plyr.js +4 -4
- package/prod/global/vidstack-player.js +2 -2
- package/prod/vidstack-elements.js +7 -7
- package/prod/vidstack.js +4 -4
- package/server/chunks/vidstack-BosyhF3p.js +207 -0
- package/server/chunks/vidstack-C8F1EUBn.js +104 -0
- package/server/chunks/vidstack-CWho6PlG.js +141 -0
- package/server/chunks/vidstack-DhF59-Up.js +4635 -0
- package/server/chunks/vidstack-DoHmOxNm.js +295 -0
- package/server/chunks/vidstack-DzWvfg1d.js +1503 -0
- package/server/chunks/vidstack-PnFpou7g.js +3035 -0
- package/server/chunks/vidstack-gEJMQpTE.js +2001 -0
- package/server/define/plyr-layout.js +2 -2
- package/server/define/vidstack-player-default-layout.js +1 -1
- package/server/define/vidstack-player-layouts.js +1 -1
- package/server/define/vidstack-player-ui.js +4 -4
- package/server/define/vidstack-player.js +2 -2
- package/server/global/plyr.js +4 -4
- package/server/global/vidstack-player.js +2 -2
- package/server/vidstack-elements.js +8 -8
- package/server/vidstack.js +4 -4
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
const I=Symbol(0);let Ut=!1,$e=!1,M=null,ft=null,L=null,k=0,ht=[],me={};const ts=()=>{},dt=0,Ze=1,qt=2,Xt=3;function es(){Ut=!0,queueMicrotask(Je)}function Je(){if(!ht.length){Ut=!1;return}$e=!0;for(let t=0;t<ht.length;t++)ht[t].$st!==dt&&ns(ht[t]);ht=[],Ut=!1,$e=!1}function ns(t){let e=[t];for(;t=t[I];)t.$e&&t.$st!==dt&&e.push(t);for(let n=e.length-1;n>=0;n--)Ce(e[n])}function ss(t){const e=Kt();return Ct(e,t.length?t.bind(null,pt.bind(e)):t,null)}function is(t){return Ct(M,t,null)}function Ge(t){return Ct(null,t,null)}function rs(){$e||Je()}function ve(){return M}function B(t,e){try{return Ct(e,t,null)}catch(n){ye(e,n);return}}function Qe(t,e=M){return e?.$cx[t]}function os(t,e,n=M){n&&(n.$cx={...n.$cx,[t]:e})}function xt(t){if(!t||!M)return t||ts;const e=M;return e.$d?Array.isArray(e.$d)?e.$d.push(t):e.$d=[e.$d,t]:e.$d=t,function(){e.$st!==Xt&&(t.call(null),Yt(e.$d)?e.$d=null:Array.isArray(e.$d)&&e.$d.splice(e.$d.indexOf(t),1))}}function pt(t=!0){if(this.$st!==Xt){if(this.$h)if(Array.isArray(this.$h))for(let e=this.$h.length-1;e>=0;e--)pt.call(this.$h[e]);else pt.call(this.$h);if(t){const e=this[I];e&&(Array.isArray(e.$h)?e.$h.splice(e.$h.indexOf(this),1):e.$h=null),ls(this)}}}function ls(t){t.$st=Xt,t.$d&&tn(t),t.$s&&Ee(t,0),t[I]=null,t.$s=null,t.$o=null,t.$h=null,t.$cx=me,t.$eh=null}function tn(t){try{if(Array.isArray(t.$d))for(let e=t.$d.length-1;e>=0;e--){const n=t.$d[e];n.call(n)}else t.$d.call(t.$d);t.$d=null}catch(e){ye(t,e)}}function Ct(t,e,n){const s=M,i=ft;M=t,ft=n;try{return e.call(t)}finally{M=s,ft=i}}function ye(t,e){if(!t||!t.$eh)throw e;let n=0,s=t.$eh.length,i=e;for(n=0;n<s;n++)try{t.$eh[n](i);break}catch(r){i=r}if(n===s)throw i}function be(){return this.$st===Xt?this.$v:(ft&&!this.$e&&(!L&&ft.$s&&ft.$s[k]==this?k++:L?L.push(this):L=[this]),this.$c&&Ce(this),this.$v)}function en(t){const e=Yt(t)?t(this.$v):t;if(this.$ch(this.$v,e)&&(this.$v=e,this.$o))for(let n=0;n<this.$o.length;n++)on(this.$o[n],qt);return this.$v}const we=function(){this[I]=null,this.$h=null,M&&M.append(this)},et=we.prototype;et.$cx=me,et.$eh=null,et.$c=null,et.$d=null,et.append=function(t){t[I]=this,this.$h?Array.isArray(this.$h)?this.$h.push(t):this.$h=[this.$h,t]:this.$h=t,t.$cx=t.$cx===me?this.$cx:{...this.$cx,...t.$cx},this.$eh&&(t.$eh=t.$eh?[...t.$eh,...this.$eh]:this.$eh)},et.dispose=function(){pt.call(this)};function Kt(){return new we}const nn=function(e,n,s){we.call(this),this.$st=n?qt:dt,this.$i=!1,this.$e=!1,this.$s=null,this.$o=null,this.$v=e,n&&(this.$c=n),s&&s.dirty&&(this.$ch=s.dirty)},Ae=nn.prototype;Object.setPrototypeOf(Ae,et),Ae.$ch=cs,Ae.call=be;function xe(t,e,n){return new nn(t,e,n)}function cs(t,e){return t!==e}function Yt(t){return typeof t=="function"}function Ce(t){if(t.$st===Ze)for(let e=0;e<t.$s.length&&(Ce(t.$s[e]),t.$st!==qt);e++);t.$st===qt?sn(t):t.$st=dt}function as(t){t.$h&&pt.call(t,!1),t.$d&&tn(t),t.$eh=t[I]?t[I].$eh:null}function sn(t){let e=L,n=k;L=null,k=0;try{as(t);const s=Ct(t,t.$c,t);rn(t),!t.$e&&t.$i?en.call(t,s):(t.$v=s,t.$i=!0)}catch(s){rn(t),ye(t,s)}finally{L=e,k=n,t.$st=dt}}function rn(t){if(L){if(t.$s&&Ee(t,k),t.$s&&k>0){t.$s.length=k+L.length;for(let n=0;n<L.length;n++)t.$s[k+n]=L[n]}else t.$s=L;let e;for(let n=k;n<t.$s.length;n++)e=t.$s[n],e.$o?e.$o.push(t):e.$o=[t]}else t.$s&&k<t.$s.length&&(Ee(t,k),t.$s.length=k)}function on(t,e){if(!(t.$st>=e)&&(t.$e&&t.$st===dt&&(ht.push(t),Ut||es()),t.$st=e,t.$o))for(let n=0;n<t.$o.length;n++)on(t.$o[n],Ze)}function Ee(t,e){let n,s;for(let i=e;i<t.$s.length;i++)n=t.$s[i],n.$o&&(s=n.$o.indexOf(t),n.$o[s]=n.$o[n.$o.length-1],n.$o.pop())}function Se(...t){}function ln(t){return t===null}function Zt(t){return typeof t>"u"}function us(t){return ln(t)||Zt(t)}function fs(t){return t?.constructor===Object}function hs(t){return typeof t=="number"&&!Number.isNaN(t)}function _e(t){return typeof t=="string"}function ds(t){return typeof t=="boolean"}function Oe(t){return typeof t=="function"}function Te(t){return Array.isArray(t)}const ps=Event,cn=Symbol("DOM_EVENT");class Re extends ps{[cn]=!0;detail;triggers=new gs;get trigger(){return this.triggers.source}get originEvent(){return this.triggers.origin}get isOriginTrusted(){return this.triggers.origin?.isTrusted??!1}constructor(e,...n){super(e,n[0]),this.detail=n[0]?.detail;const s=n[0]?.trigger;s&&this.triggers.add(s)}}class gs{chain=[];get source(){return this.chain[0]}get origin(){return this.chain[this.chain.length-1]}add(e){this.chain.push(e),$s(e)&&this.chain.push(...e.triggers)}remove(e){return this.chain.splice(this.chain.indexOf(e),1)[0]}has(e){return this.chain.some(n=>n===e)}hasType(e){return!!this.findType(e)}findType(e){return this.chain.find(n=>n.type===e)}walk(e){for(const n of this.chain){const s=e(n);if(s)return[n,s]}}[Symbol.iterator](){return this.chain.values()}}function $s(t){return!!t?.[cn]}class ms extends EventTarget{$ts__events;addEventListener(e,n,s){return super.addEventListener(e,n,s)}removeEventListener(e,n,s){return super.removeEventListener(e,n,s)}}function an(t,e,n,s){return t.addEventListener(e,n,s),xt(()=>t.removeEventListener(e,n,s))}class vs{#t;#e;get signal(){return this.#e.signal}constructor(e){this.#t=e,this.#e=new AbortController,xt(this.abort.bind(this))}add(e,n,s){if(this.signal.aborted)throw Error("aborted");return this.#t.addEventListener(e,n,{...s,signal:s?.signal?ys(this.signal,s.signal):this.signal}),this}remove(e,n){return this.#t.removeEventListener(e,n),this}abort(e){this.#e.abort(e)}}function ys(...t){const e=new AbortController,n={signal:e.signal};function s(i){e.abort(i.target.reason)}for(const i of t){if(i.aborted){e.abort(i.reason);break}i.addEventListener("abort",s,n)}return e.signal}function bs(t){return!!t?.type.startsWith("pointer")}function ws(t){return!!t?.type.startsWith("touch")}function As(t){return/^(click|mouse)/.test(t?.type??"")}function ke(t){return!!t?.type.startsWith("key")}function xs(t){return ke(t)&&t.key==="Enter"}function Cs(t){return ke(t)&&(t.key==="Enter"||t.key===" ")}function Es(t){return t instanceof Node}function Ne(t,e,n){if(t)if(!n&&n!==""&&n!==0)t.removeAttribute(e);else{const s=n===!0?"":n+"";t.getAttribute(e)!==s&&t.setAttribute(e,s)}else return}function Pe(t,e,n){if(t)!n&&n!==0?t.style.removeProperty(e):t.style.setProperty(e,n+"");else return}function Jt(t,e){const n=xe(t,null,e),s=be.bind(n);return s[I]=!0,s.set=en.bind(n),s}function Ss(t){return Yt(t)&&I in t}function un(t,e){const n=xe(e?.initial,t,e),s=be.bind(n);return s[I]=!0,s}function _s(t,e){const n=xe(null,function(){let i=t();return Yt(i)&&xt(i),null},void 0);return n.$e=!0,sn(n),pt.bind(n,!0)}function Os(t){return Ss(t)&&"set"in t}const Gt=_s;function Ts(t){return{id:Symbol(),provide:t}}function fn(t,e,n=ve()){const s=!Zt(e);os(t.id,s?e:t.provide?.(),n)}function hn(t){return Qe(t.id)}function Rs(t){return!Zt(Qe(t.id))}const Et=Symbol(0),St=Symbol(0),dn=Symbol(0),Le={};class ks{$ts__events;$ts__vars;[dn]=null;$el=Jt(null);el=null;scope=null;attachScope=null;connectScope=null;component=null;destroyed=!1;props=Le;attrs=null;styles=null;state;$state;#t=[];#e=[];#n=[];#s=[];constructor(e,n,s){this.scope=n,s?.scope&&s.scope.append(n);let i=e.state,r=e.props;if(i&&(this.$state=i.create(),this.state=new Proxy(this.$state,{get:(o,l)=>this.$state[l]()}),fn(i,this.$state)),r&&(this.props=Ns(r),s?.props))for(const o of Object.keys(s.props))this.props[o]?.set(s.props[o]);xt(this.destroy.bind(this))}setup(){B(()=>{for(const e of this.#t)e()},this.scope)}attach(e){this.el||(this.el=e,this.$el.set(e),B(()=>{this.attachScope=Kt(),B(()=>{for(const n of this.#e)n(this.el);this.#i(),this.#r()},this.attachScope)},this.scope),e.dispatchEvent(new Event("attached")))}detach(){this.attachScope?.dispose(),this.attachScope=null,this.connectScope=null,this.el=null,this.$el.set(null)}connect(){!this.el||!this.attachScope||!this.#n.length||B(()=>{this.connectScope=Kt(),B(()=>{for(const e of this.#n)e(this.el)},this.connectScope)},this.attachScope)}disconnect(){this.connectScope?.dispose(),this.connectScope=null}destroy(){if(this.destroyed)return;this.destroyed=!0,B(()=>{for(const n of this.#s)n(this.el)},this.scope);const e=this.el;this.detach(),this.scope.dispose(),this.#t.length=0,this.#e.length=0,this.#n.length=0,this.#s.length=0,this.component=null,this.attrs=null,this.styles=null,this.props=Le,this.scope=null,this.state=Le,this.$state=null,e&&delete e.$}addHooks(e){e.onSetup&&this.#t.push(e.onSetup.bind(e)),e.onAttach&&this.#e.push(e.onAttach.bind(e)),e.onConnect&&this.#n.push(e.onConnect.bind(e)),e.onDestroy&&this.#s.push(e.onDestroy.bind(e))}#i(){if(this.attrs)for(const e of Object.keys(this.attrs))Oe(this.attrs[e])?Gt(this.#o.bind(this,e)):Ne(this.el,e,this.attrs[e])}#r(){if(this.styles)for(const e of Object.keys(this.styles))Oe(this.styles[e])?Gt(this.#l.bind(this,e)):Pe(this.el,e,this.styles[e])}#o(e){Ne(this.el,e,this.attrs[e].call(this.component))}#l(e){Pe(this.el,e,this.styles[e].call(this.component))}}function Ns(t){const e={};for(const n of Object.keys(t)){const s=t[n];e[n]=Jt(s,s)}return e}let _t={$$:null};function Ps(t,e){return ss(()=>{_t.$$=new ks(t,ve(),e);const n=new t;return _t.$$.component=n,_t.$$=null,n})}class pn extends EventTarget{$$;get el(){return this.$$.el}get $el(){return this.$$.$el()}get scope(){return this.$$.scope}get attachScope(){return this.$$.attachScope}get connectScope(){return this.$$.connectScope}get $props(){return this.$$.props}get $state(){return this.$$.$state}get state(){return this.$$.state}constructor(){super(),_t.$$&&this.attach(_t)}attach({$$:e}){return this.$$=e,e.addHooks(this),this}addEventListener(e,n,s){this.listen(e,n,s)}removeEventListener(e,n,s){this.el?.removeEventListener(e,n,s)}setAttributes(e){this.$$.attrs||(this.$$.attrs={}),Object.assign(this.$$.attrs,e)}setStyles(e){this.$$.styles||(this.$$.styles={}),Object.assign(this.$$.styles,e)}setCSSVars(e){this.setStyles(e)}createEvent(e,...n){return new Re(e,n[0])}dispatch(e,...n){if(!this.el)return!1;const s=e instanceof Event?e:new Re(e,n[0]);return Object.defineProperty(s,"target",{get:()=>this.$$.component}),Ge(()=>(this.$$[dn]?.(s),this.el.dispatchEvent(s)))}dispatchEvent(e){return this.dispatch(e)}listen(e,n,s){return this.el?an(this.el,e,n,s):Se}}function Ls(t,e){for(const n of t)n(e)}function gn(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Hs(t){return t.replace(/-./g,e=>e[1].toUpperCase())}function Ms(t){return t.charAt(0).toUpperCase()+t.slice(1)}const He=t=>t===null?"":t+"",Fs=t=>t===null?null:t+"",Ds=t=>t===null?0:Number(t),$n=t=>t!==null,Ws=()=>null,Is=t=>t===null?[]:JSON.parse(t),Bs=t=>t===null?{}:JSON.parse(t);function Vs(t){if(t===null)return Fs;switch(typeof t){case"undefined":return He;case"string":return He;case"boolean":return $n;case"number":return Ds;case"function":return Ws;case"object":return Te(t)?Is:Bs;default:return He}}const Z=Symbol(0),mn=Symbol(0),nt=Symbol(0),Ot=Symbol(0);var U;(function(t){t[t.Idle=0]="Idle";const n=1;t[t.Pending=n]="Pending";const s=2;t[t.Ready=s]="Ready"})(U||(U={}));function js(t,e){class n extends t{static attrs;static[Z]=null;static get observedAttributes(){if(!this[Z]&&e.props){const i=new Map;for(const r of Object.keys(e.props)){let o=this.attrs?.[r],l=_e(o)?o:o&&o?.attr;l!==!1&&(l||(l=gn(r)),i.set(l,{prop:r,converter:o&&!_e(o)&&o?.converter||Vs(e.props[r])}))}this[Z]=i}return this[Z]?Array.from(this[Z].keys()):[]}$;[nt]=U.Idle;[Ot]=null;keepAlive=!1;forwardKeepAlive=!0;get scope(){return this.$.$$.scope}get attachScope(){return this.$.$$.attachScope}get connectScope(){return this.$.$$.connectScope}get $props(){return this.$.$$.props}get $state(){return this.$.$$.$state}get state(){return this.$.state}constructor(...i){if(super(...i),this.$=B(()=>Ps(e),null),this.$.$$.addHooks(this),e.props){const r=this.$props,o=Object.getOwnPropertyDescriptors(this);for(const l of Object.keys(o))l in e.props&&(r[l].set(this[l]),delete this[l])}}attributeChangedCallback(i,r,o){const l=this.constructor;if(!l[Z]){super.attributeChangedCallback?.(i,r,o);return}const c=l[Z].get(i);c&&(this[c.prop]=c.converter(o))}connectedCallback(){const i=this.$?.$$;if(!i||i.destroyed)return;if(this[nt]!==U.Ready){Us.call(this);return}if(!this.isConnected)return;this.hasAttribute("keep-alive")&&(this.keepAlive=!0),i.connect(),Te(this[Ot])&&Ls(this[Ot],this),this[Ot]=null;const r=super.connectedCallback;r&&B(()=>r.call(this),this.connectScope)}disconnectedCallback(){const i=this.$?.$$;if(!i||i.destroyed)return;i.disconnect();const r=super.disconnectedCallback;r&&r.call(this),!this.keepAlive&&!this.hasAttribute("keep-alive")&&setTimeout(()=>{requestAnimationFrame(()=>{this.isConnected||i.destroy()})},0)}[mn](){const i=this.$.$$,r=this.constructor;if(i.destroyed)return;const o=r[Z];if(o)for(const l of this.attributes){let c=o.get(l.name);c&&c.converter&&i.props[c.prop].set(c.converter(this.getAttribute(l.name)))}i.setup(),i.attach(this),this[nt]=U.Ready,this.connectedCallback()}subscribe(i){return this.$.subscribe(i)}destroy(){this.disconnectedCallback(),this.$.destroy()}}return zs(n,e),n}function zs(t,e){const n=t.prototype,s=e.prototype;if(e.props)for(const i of Object.keys(e.props))Object.defineProperty(n,i,{enumerable:!0,configurable:!0,get(){return this.$props[i]()},set(r){this.$props[i].set(r)}});if(s[Et])for(const i of s[Et])Object.defineProperty(n,i,{enumerable:!0,configurable:!0,get(){return this.$[i]},set(r){this.$[i]=r}});if(s[St])for(const i of s[St])n[i]=function(...r){return this.$[i](...r)}}function Us(){if(this[nt]!==U.Idle)return;this[nt]=U.Pending;const t=Xs(this),e=t&&window.customElements.get(t.localName),n=t&&t[nt]===U.Ready;if(t&&(!e||!n)){qs.call(this,t);return}vn.call(this,t)}async function qs(t){await window.customElements.whenDefined(t.localName),t[nt]!==U.Ready&&await new Promise(e=>(t[Ot]??=[]).push(e)),vn.call(this,t)}function vn(t){if(this.isConnected){if(t){t.keepAlive&&t.forwardKeepAlive&&(this.keepAlive=!0,this.setAttribute("keep-alive",""));const e=this.$.$$.scope;e&&t.$.$$.attachScope.append(e)}this[mn]()}}function Xs(t){let e=t.parentNode,n=t.localName.split("-",1)[0]+"-";for(;e;){if(e.nodeType===1&&e.localName.startsWith(n))return e;e=e.parentNode}return null}function Ks(t,e=!1){(e||!window.customElements.get(t.tagName))&&window.customElements.define(t.tagName,t)}class Ys extends pn{subscribe(e){return B(()=>Gt(()=>e(this.state)),this.$$.scope)}destroy(){this.$$.destroy()}}function Zs(t,e,n){t[Et]||(t[Et]=new Set),t[Et].add(e)}function Js(t,e,n){t[St]||(t[St]=new Set),t[St].add(e)}class Gs{id=Symbol(0);record;#t;constructor(e){this.record=e,this.#t=Object.getOwnPropertyDescriptors(e)}create(){const e={},n=new Proxy(e,{get:(s,i)=>e[i]()});for(const s of Object.keys(this.record)){const i=this.#t[s].get;e[s]=i?un(i.bind(n)):Jt(this.record[s])}return e}reset(e,n){for(const s of Object.keys(e))!this.#t[s].get&&(!n||n(s))&&e[s].set(this.record[s])}}function Qs(t){return hn(t)}function ti(t){return t?"true":"false"}function ei(t){return Object.keys(t)}function ni(){let t,e;return{promise:new Promise((s,i)=>{t=s,e=i}),resolve:t,reject:e}}function si(t){return new Promise(e=>setTimeout(e,t))}function ii(t){let e=-1,n;function s(...i){n=i,!(e>=0)&&(e=window.requestAnimationFrame(()=>{t.apply(this,n),e=-1,n=void 0}))}return s}const ri=typeof window<"u"?"requestIdleCallback"in window?window.requestIdleCallback:t=>window.setTimeout(t,1):Se;function oi(t,e){return new Promise(n=>{ri(s=>{t?.(s),n()},e)})}var N={fullscreenEnabled:0,fullscreenElement:1,requestFullscreen:2,exitFullscreen:3,fullscreenchange:4,fullscreenerror:5,fullscreen:6},yn=["webkitFullscreenEnabled","webkitFullscreenElement","webkitRequestFullscreen","webkitExitFullscreen","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],bn=["mozFullScreenEnabled","mozFullScreenElement","mozRequestFullScreen","mozCancelFullScreen","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],wn=["msFullscreenEnabled","msFullscreenElement","msRequestFullscreen","msExitFullscreen","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"],O=typeof window<"u"&&typeof window.document<"u"?window.document:{},H="fullscreenEnabled"in O&&Object.keys(N)||yn[0]in O&&yn||bn[0]in O&&bn||wn[0]in O&&wn||[],li={requestFullscreen:function(t){return t[H[N.requestFullscreen]]()},requestFullscreenFunction:function(t){return t[H[N.requestFullscreen]]},get exitFullscreen(){return O[H[N.exitFullscreen]].bind(O)},get fullscreenPseudoClass(){return":"+H[N.fullscreen]},addEventListener:function(t,e,n){return O.addEventListener(H[N[t]],e,n)},removeEventListener:function(t,e,n){return O.removeEventListener(H[N[t]],e,n)},get fullscreenEnabled(){return!!O[H[N.fullscreenEnabled]]},set fullscreenEnabled(t){},get fullscreenElement(){return O[H[N.fullscreenElement]]},set fullscreenElement(t){},get onfullscreenchange(){return O[("on"+H[N.fullscreenchange]).toLowerCase()]},set onfullscreenchange(t){return O[("on"+H[N.fullscreenchange]).toLowerCase()]=t},get onfullscreenerror(){return O[("on"+H[N.fullscreenerror]).toLowerCase()]},set onfullscreenerror(t){return O[("on"+H[N.fullscreenerror]).toLowerCase()]=t}};const Qt=Math.min,st=Math.max,te=Math.round,ee=Math.floor,V=t=>({x:t,y:t}),ci={left:"right",right:"left",bottom:"top",top:"bottom"};function An(t,e,n){return st(t,Qt(e,n))}function Me(t,e){return typeof t=="function"?t(e):t}function gt(t){return t.split("-")[0]}function Fe(t){return t.split("-")[1]}function xn(t){return t==="x"?"y":"x"}function Cn(t){return t==="y"?"height":"width"}function it(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function En(t){return xn(it(t))}function ai(t,e,n){n===void 0&&(n=!1);const s=Fe(t),i=En(t),r=Cn(i);let o=i==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(o=ne(o)),[o,ne(o)]}function ui(t){const e=ne(t);return[De(t),e,De(e)]}function De(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const Sn=["left","right"],_n=["right","left"],fi=["top","bottom"],hi=["bottom","top"];function di(t,e,n){switch(t){case"top":case"bottom":return n?e?_n:Sn:e?Sn:_n;case"left":case"right":return e?fi:hi;default:return[]}}function pi(t,e,n,s){const i=Fe(t);let r=di(gt(t),n==="start",s);return i&&(r=r.map(o=>o+"-"+i),e&&(r=r.concat(r.map(De)))),r}function ne(t){const e=gt(t);return ci[e]+t.slice(e.length)}function gi(t){return{top:0,right:0,bottom:0,left:0,...t}}function $i(t){return typeof t!="number"?gi(t):{top:t,right:t,bottom:t,left:t}}function se(t){const{x:e,y:n,width:s,height:i}=t;return{width:s,height:i,top:n,left:e,right:e+s,bottom:n+i,x:e,y:n}}function On(t,e,n){let{reference:s,floating:i}=t;const r=it(e),o=En(e),l=Cn(o),c=gt(e),a=r==="y",u=s.x+s.width/2-i.width/2,f=s.y+s.height/2-i.height/2,d=s[l]/2-i[l]/2;let h;switch(c){case"top":h={x:u,y:s.y-i.height};break;case"bottom":h={x:u,y:s.y+s.height};break;case"right":h={x:s.x+s.width,y:f};break;case"left":h={x:s.x-i.width,y:f};break;default:h={x:s.x,y:s.y}}switch(Fe(e)){case"start":h[o]-=d*(n&&a?-1:1);break;case"end":h[o]+=d*(n&&a?-1:1);break}return h}async function mi(t,e){var n;e===void 0&&(e={});const{x:s,y:i,platform:r,rects:o,elements:l,strategy:c}=t,{boundary:a="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:h=0}=Me(e,t),p=$i(h),v=l[d?f==="floating"?"reference":"floating":f],$=se(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(v)))==null||n?v:v.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(l.floating)),boundary:a,rootBoundary:u,strategy:c})),y=f==="floating"?{x:s,y:i,width:o.floating.width,height:o.floating.height}:o.reference,b=await(r.getOffsetParent==null?void 0:r.getOffsetParent(l.floating)),w=await(r.isElement==null?void 0:r.isElement(b))?await(r.getScale==null?void 0:r.getScale(b))||{x:1,y:1}:{x:1,y:1},C=se(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:b,strategy:c}):y);return{top:($.top-C.top+p.top)/w.y,bottom:(C.bottom-$.bottom+p.bottom)/w.y,left:($.left-C.left+p.left)/w.x,right:(C.right-$.right+p.right)/w.x}}const vi=50,yi=async(t,e,n)=>{const{placement:s="bottom",strategy:i="absolute",middleware:r=[],platform:o}=n,l=o.detectOverflow?o:{...o,detectOverflow:mi},c=await(o.isRTL==null?void 0:o.isRTL(e));let a=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:f}=On(a,s,c),d=s,h=0;const p={};for(let g=0;g<r.length;g++){const v=r[g];if(!v)continue;const{name:$,fn:y}=v,{x:b,y:w,data:C,reset:E}=await y({x:u,y:f,initialPlacement:s,placement:d,strategy:i,middlewareData:p,rects:a,platform:l,elements:{reference:t,floating:e}});u=b??u,f=w??f,p[$]={...p[$],...C},E&&h<vi&&(h++,typeof E=="object"&&(E.placement&&(d=E.placement),E.rects&&(a=E.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:i}):E.rects),{x:u,y:f}=On(a,d,c)),g=-1)}return{x:u,y:f,placement:d,strategy:i,middlewareData:p}},bi=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,s;const{placement:i,middlewareData:r,rects:o,initialPlacement:l,platform:c,elements:a}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...v}=Me(t,e);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const $=gt(i),y=it(l),b=gt(l)===l,w=await(c.isRTL==null?void 0:c.isRTL(a.floating)),C=d||(b||!g?[ne(l)]:ui(l)),E=p!=="none";!d&&E&&C.push(...pi(l,g,p,w));const W=[l,...C],X=await c.detectOverflow(e,v),Q=[];let z=((s=r.flip)==null?void 0:s.overflows)||[];if(u&&Q.push(X[$]),f){const A=ai(i,o,w);Q.push(X[A[0]],X[A[1]])}if(z=[...z,{placement:i,overflows:Q}],!Q.every(A=>A<=0)){var wt,At;const A=(((wt=r.flip)==null?void 0:wt.index)||0)+1,tt=W[A];if(tt&&(!(f==="alignment"?y!==it(tt):!1)||z.every(S=>it(S.placement)===y?S.overflows[0]>0:!0)))return{data:{index:A,overflows:z},reset:{placement:tt}};let T=(At=z.filter(m=>m.overflows[0]<=0).sort((m,S)=>m.overflows[1]-S.overflows[1])[0])==null?void 0:At.placement;if(!T)switch(h){case"bestFit":{var _;const m=(_=z.filter(S=>{if(E){const R=it(S.placement);return R===y||R==="y"}return!0}).map(S=>[S.placement,S.overflows.filter(R=>R>0).reduce((R,ut)=>R+ut,0)]).sort((S,R)=>S[1]-R[1])[0])==null?void 0:_[0];m&&(T=m);break}case"initialPlacement":T=l;break}if(i!==T)return{reset:{placement:T}}}return{}}}},wi=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:s,placement:i,platform:r}=e,{mainAxis:o=!0,crossAxis:l=!1,limiter:c={fn:$=>{let{x:y,y:b}=$;return{x:y,y:b}}},...a}=Me(t,e),u={x:n,y:s},f=await r.detectOverflow(e,a),d=it(gt(i)),h=xn(d);let p=u[h],g=u[d];if(o){const $=h==="y"?"top":"left",y=h==="y"?"bottom":"right",b=p+f[$],w=p-f[y];p=An(b,p,w)}if(l){const $=d==="y"?"top":"left",y=d==="y"?"bottom":"right",b=g+f[$],w=g-f[y];g=An(b,g,w)}const v=c.fn({...e,[h]:p,[d]:g});return{...v,data:{x:v.x-n,y:v.y-s,enabled:{[h]:o,[d]:l}}}}}};function ie(){return typeof window<"u"}function $t(t){return Tn(t)?(t.nodeName||"").toLowerCase():"#document"}function P(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function j(t){var e;return(e=(Tn(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Tn(t){return ie()?t instanceof Node||t instanceof P(t).Node:!1}function F(t){return ie()?t instanceof Element||t instanceof P(t).Element:!1}function q(t){return ie()?t instanceof HTMLElement||t instanceof P(t).HTMLElement:!1}function Rn(t){return!ie()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof P(t).ShadowRoot}function Tt(t){const{overflow:e,overflowX:n,overflowY:s,display:i}=D(t);return/auto|scroll|overlay|hidden|clip/.test(e+s+n)&&i!=="inline"&&i!=="contents"}function Ai(t){return/^(table|td|th)$/.test($t(t))}function re(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const xi=/transform|translate|scale|rotate|perspective|filter/,Ci=/paint|layout|strict|content/,rt=t=>!!t&&t!=="none";let We;function Ie(t){const e=F(t)?D(t):t;return rt(e.transform)||rt(e.translate)||rt(e.scale)||rt(e.rotate)||rt(e.perspective)||!Be()&&(rt(e.backdropFilter)||rt(e.filter))||xi.test(e.willChange||"")||Ci.test(e.contain||"")}function Ei(t){let e=J(t);for(;q(e)&&!mt(e);){if(Ie(e))return e;if(re(e))return null;e=J(e)}return null}function Be(){return We==null&&(We=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),We}function mt(t){return/^(html|body|#document)$/.test($t(t))}function D(t){return P(t).getComputedStyle(t)}function oe(t){return F(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function J(t){if($t(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Rn(t)&&t.host||j(t);return Rn(e)?e.host:e}function kn(t){const e=J(t);return mt(e)?t.ownerDocument?t.ownerDocument.body:t.body:q(e)&&Tt(e)?e:kn(e)}function Rt(t,e,n){var s;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=kn(t),r=i===((s=t.ownerDocument)==null?void 0:s.body),o=P(i);if(r){const l=Ve(o);return e.concat(o,o.visualViewport||[],Tt(i)?i:[],l&&n?Rt(l):[])}else return e.concat(i,Rt(i,[],n))}function Ve(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Nn(t){const e=D(t);let n=parseFloat(e.width)||0,s=parseFloat(e.height)||0;const i=q(t),r=i?t.offsetWidth:n,o=i?t.offsetHeight:s,l=te(n)!==r||te(s)!==o;return l&&(n=r,s=o),{width:n,height:s,$:l}}function je(t){return F(t)?t:t.contextElement}function vt(t){const e=je(t);if(!q(e))return V(1);const n=e.getBoundingClientRect(),{width:s,height:i,$:r}=Nn(e);let o=(r?te(n.width):n.width)/s,l=(r?te(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const Si=V(0);function Pn(t){const e=P(t);return!Be()||!e.visualViewport?Si:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function _i(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==P(t)?!1:e}function ot(t,e,n,s){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),r=je(t);let o=V(1);e&&(s?F(s)&&(o=vt(s)):o=vt(t));const l=_i(r,n,s)?Pn(r):V(0);let c=(i.left+l.x)/o.x,a=(i.top+l.y)/o.y,u=i.width/o.x,f=i.height/o.y;if(r){const d=P(r),h=s&&F(s)?P(s):s;let p=d,g=Ve(p);for(;g&&s&&h!==p;){const v=vt(g),$=g.getBoundingClientRect(),y=D(g),b=$.left+(g.clientLeft+parseFloat(y.paddingLeft))*v.x,w=$.top+(g.clientTop+parseFloat(y.paddingTop))*v.y;c*=v.x,a*=v.y,u*=v.x,f*=v.y,c+=b,a+=w,p=P(g),g=Ve(p)}}return se({width:u,height:f,x:c,y:a})}function le(t,e){const n=oe(t).scrollLeft;return e?e.left+n:ot(j(t)).left+n}function Ln(t,e){const n=t.getBoundingClientRect(),s=n.left+e.scrollLeft-le(t,n),i=n.top+e.scrollTop;return{x:s,y:i}}function Oi(t){let{elements:e,rect:n,offsetParent:s,strategy:i}=t;const r=i==="fixed",o=j(s),l=e?re(e.floating):!1;if(s===o||l&&r)return n;let c={scrollLeft:0,scrollTop:0},a=V(1);const u=V(0),f=q(s);if((f||!f&&!r)&&(($t(s)!=="body"||Tt(o))&&(c=oe(s)),f)){const h=ot(s);a=vt(s),u.x=h.x+s.clientLeft,u.y=h.y+s.clientTop}const d=o&&!f&&!r?Ln(o,c):V(0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-c.scrollLeft*a.x+u.x+d.x,y:n.y*a.y-c.scrollTop*a.y+u.y+d.y}}function Ti(t){return Array.from(t.getClientRects())}function Ri(t){const e=j(t),n=oe(t),s=t.ownerDocument.body,i=st(e.scrollWidth,e.clientWidth,s.scrollWidth,s.clientWidth),r=st(e.scrollHeight,e.clientHeight,s.scrollHeight,s.clientHeight);let o=-n.scrollLeft+le(t);const l=-n.scrollTop;return D(s).direction==="rtl"&&(o+=st(e.clientWidth,s.clientWidth)-i),{width:i,height:r,x:o,y:l}}const Hn=25;function ki(t,e){const n=P(t),s=j(t),i=n.visualViewport;let r=s.clientWidth,o=s.clientHeight,l=0,c=0;if(i){r=i.width,o=i.height;const u=Be();(!u||u&&e==="fixed")&&(l=i.offsetLeft,c=i.offsetTop)}const a=le(s);if(a<=0){const u=s.ownerDocument,f=u.body,d=getComputedStyle(f),h=u.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,p=Math.abs(s.clientWidth-f.clientWidth-h);p<=Hn&&(r-=p)}else a<=Hn&&(r+=a);return{width:r,height:o,x:l,y:c}}function Ni(t,e){const n=ot(t,!0,e==="fixed"),s=n.top+t.clientTop,i=n.left+t.clientLeft,r=q(t)?vt(t):V(1),o=t.clientWidth*r.x,l=t.clientHeight*r.y,c=i*r.x,a=s*r.y;return{width:o,height:l,x:c,y:a}}function Mn(t,e,n){let s;if(e==="viewport")s=ki(t,n);else if(e==="document")s=Ri(j(t));else if(F(e))s=Ni(e,n);else{const i=Pn(t);s={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return se(s)}function Fn(t,e){const n=J(t);return n===e||!F(n)||mt(n)?!1:D(n).position==="fixed"||Fn(n,e)}function Pi(t,e){const n=e.get(t);if(n)return n;let s=Rt(t,[],!1).filter(l=>F(l)&&$t(l)!=="body"),i=null;const r=D(t).position==="fixed";let o=r?J(t):t;for(;F(o)&&!mt(o);){const l=D(o),c=Ie(o);!c&&l.position==="fixed"&&(i=null),(r?!c&&!i:!c&&l.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||Tt(o)&&!c&&Fn(t,o))?s=s.filter(u=>u!==o):i=l,o=J(o)}return e.set(t,s),s}function Li(t){let{element:e,boundary:n,rootBoundary:s,strategy:i}=t;const o=[...n==="clippingAncestors"?re(e)?[]:Pi(e,this._c):[].concat(n),s],l=Mn(e,o[0],i);let c=l.top,a=l.right,u=l.bottom,f=l.left;for(let d=1;d<o.length;d++){const h=Mn(e,o[d],i);c=st(h.top,c),a=Qt(h.right,a),u=Qt(h.bottom,u),f=st(h.left,f)}return{width:a-f,height:u-c,x:f,y:c}}function Hi(t){const{width:e,height:n}=Nn(t);return{width:e,height:n}}function Mi(t,e,n){const s=q(e),i=j(e),r=n==="fixed",o=ot(t,!0,r,e);let l={scrollLeft:0,scrollTop:0};const c=V(0);function a(){c.x=le(i)}if(s||!s&&!r)if(($t(e)!=="body"||Tt(i))&&(l=oe(e)),s){const h=ot(e,!0,r,e);c.x=h.x+e.clientLeft,c.y=h.y+e.clientTop}else i&&a();r&&!s&&i&&a();const u=i&&!s&&!r?Ln(i,l):V(0),f=o.left+l.scrollLeft-c.x-u.x,d=o.top+l.scrollTop-c.y-u.y;return{x:f,y:d,width:o.width,height:o.height}}function ze(t){return D(t).position==="static"}function Dn(t,e){if(!q(t)||D(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return j(t)===n&&(n=n.ownerDocument.body),n}function Wn(t,e){const n=P(t);if(re(t))return n;if(!q(t)){let i=J(t);for(;i&&!mt(i);){if(F(i)&&!ze(i))return i;i=J(i)}return n}let s=Dn(t,e);for(;s&&Ai(s)&&ze(s);)s=Dn(s,e);return s&&mt(s)&&ze(s)&&!Ie(s)?n:s||Ei(t)||n}const Fi=async function(t){const e=this.getOffsetParent||Wn,n=this.getDimensions,s=await n(t.floating);return{reference:Mi(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function Di(t){return D(t).direction==="rtl"}const Wi={convertOffsetParentRelativeRectToViewportRelativeRect:Oi,getDocumentElement:j,getClippingRect:Li,getOffsetParent:Wn,getElementRects:Fi,getClientRects:Ti,getDimensions:Hi,getScale:vt,isElement:F,isRTL:Di};function In(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Ii(t,e){let n=null,s;const i=j(t);function r(){var l;clearTimeout(s),(l=n)==null||l.disconnect(),n=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),r();const a=t.getBoundingClientRect(),{left:u,top:f,width:d,height:h}=a;if(l||e(),!d||!h)return;const p=ee(f),g=ee(i.clientWidth-(u+d)),v=ee(i.clientHeight-(f+h)),$=ee(u),b={rootMargin:-p+"px "+-g+"px "+-v+"px "+-$+"px",threshold:st(0,Qt(1,c))||1};let w=!0;function C(E){const W=E[0].intersectionRatio;if(W!==c){if(!w)return o();W?o(!1,W):s=setTimeout(()=>{o(!1,1e-7)},1e3)}W===1&&!In(a,t.getBoundingClientRect())&&o(),w=!1}try{n=new IntersectionObserver(C,{...b,root:i.ownerDocument})}catch{n=new IntersectionObserver(C,b)}n.observe(t)}return o(!0),r}function Bi(t,e,n,s){s===void 0&&(s={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=s,a=je(t),u=i||r?[...a?Rt(a):[],...e?Rt(e):[]]:[];u.forEach($=>{i&&$.addEventListener("scroll",n,{passive:!0}),r&&$.addEventListener("resize",n)});const f=a&&l?Ii(a,n):null;let d=-1,h=null;o&&(h=new ResizeObserver($=>{let[y]=$;y&&y.target===a&&h&&e&&(h.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var b;(b=h)==null||b.observe(e)})),n()}),a&&!c&&h.observe(a),e&&h.observe(e));let p,g=c?ot(t):null;c&&v();function v(){const $=ot(t);g&&!In(g,$)&&n(),g=$,p=requestAnimationFrame(v)}return n(),()=>{var $;u.forEach(y=>{i&&y.removeEventListener("scroll",n),r&&y.removeEventListener("resize",n)}),f?.(),($=h)==null||$.disconnect(),h=null,c&&cancelAnimationFrame(p)}}const Vi=wi,ji=bi,zi=(t,e,n)=>{const s=new Map,i={platform:Wi,...n},r={...i.platform,_c:s};return yi(t,e,{...i,platform:r})};var Ui=qi;function qi(t,e,n){var s=null,i=null,r=function(){s&&(clearTimeout(s),i=null,s=null)},o=function(){var c=i;r(),c&&c()},l=function(){if(!e)return t.apply(this,arguments);var c=this,a=arguments,u=n&&!s;if(r(),i=function(){t.apply(c,a)},s=setTimeout(function(){if(s=null,!u){var f=i;return i=null,f()}},e),u)return i()};return l.cancel=r,l.flush=o,l}var Xi=Ki;function Ki(t,e,n){var s=null,i=null,r=n&&n.leading,o=n&&n.trailing;r==null&&(r=!0),o==null&&(o=!r),r==!0&&(o=!1);var l=function(){s&&(clearTimeout(s),s=null)},c=function(){var u=i;l(),u&&u()},a=function(){var u=r&&!s,f=this,d=arguments;if(i=function(){return t.apply(f,d)},s||(s=setTimeout(function(){if(s=null,o)return i()},e)),u)return u=!1,i()};return a.cancel=l,a.flush=c,a}const Bn=t=>typeof t=="object"&&t!=null&&t.nodeType===1,Vn=(t,e)=>(!e||t!=="hidden")&&t!=="visible"&&t!=="clip",ce=(t,e)=>{if(t.clientHeight<t.scrollHeight||t.clientWidth<t.scrollWidth){const n=getComputedStyle(t,null);return Vn(n.overflowY,e)||Vn(n.overflowX,e)||(s=>{const i=(r=>{if(!r.ownerDocument||!r.ownerDocument.defaultView)return null;try{return r.ownerDocument.defaultView.frameElement}catch{return null}})(s);return!!i&&(i.clientHeight<s.scrollHeight||i.clientWidth<s.scrollWidth)})(t)}return!1},ae=(t,e,n,s,i,r,o,l)=>r<t&&o>e||r>t&&o<e?0:r<=t&&l<=n||o>=e&&l>=n?r-t-s:o>e&&l<n||r<t&&l>n?o-e+i:0,Yi=t=>{const e=t.parentElement;return e??(t.getRootNode().host||null)},Zi=(t,e)=>{var n,s,i,r;if(typeof document>"u")return[];const{scrollMode:o,block:l,inline:c,boundary:a,skipOverflowHiddenElements:u}=e,f=typeof a=="function"?a:T=>T!==a;if(!Bn(t))throw new TypeError("Invalid target");const d=document.scrollingElement||document.documentElement,h=[];let p=t;for(;Bn(p)&&f(p);){if(p=Yi(p),p===d){h.push(p);break}p!=null&&p===document.body&&ce(p)&&!ce(document.documentElement)||p!=null&&ce(p,u)&&h.push(p)}const g=(s=(n=window.visualViewport)==null?void 0:n.width)!=null?s:innerWidth,v=(r=(i=window.visualViewport)==null?void 0:i.height)!=null?r:innerHeight,{scrollX:$,scrollY:y}=window,{height:b,width:w,top:C,right:E,bottom:W,left:X}=t.getBoundingClientRect(),{top:Q,right:z,bottom:wt,left:At}=(T=>{const m=window.getComputedStyle(T);return{top:parseFloat(m.scrollMarginTop)||0,right:parseFloat(m.scrollMarginRight)||0,bottom:parseFloat(m.scrollMarginBottom)||0,left:parseFloat(m.scrollMarginLeft)||0}})(t);let _=l==="start"||l==="nearest"?C-Q:l==="end"?W+wt:C+b/2-Q+wt,A=c==="center"?X+w/2-At+z:c==="end"?E+z:X-At;const tt=[];for(let T=0;T<h.length;T++){const m=h[T],{height:S,width:R,top:ut,right:he,bottom:de,left:Ft}=m.getBoundingClientRect();if(o==="if-needed"&&C>=0&&X>=0&&W<=v&&E<=g&&(m===d&&!ce(m)||C>=ut&&W<=de&&X>=Ft&&E<=he))return tt;const Dt=getComputedStyle(m),Wt=parseInt(Dt.borderLeftWidth,10),It=parseInt(Dt.borderTopWidth,10),Bt=parseInt(Dt.borderRightWidth,10),Vt=parseInt(Dt.borderBottomWidth,10);let K=0,Y=0;const jt="offsetWidth"in m?m.offsetWidth-m.clientWidth-Wt-Bt:0,zt="offsetHeight"in m?m.offsetHeight-m.clientHeight-It-Vt:0,pe="offsetWidth"in m?m.offsetWidth===0?0:R/m.offsetWidth:0,ge="offsetHeight"in m?m.offsetHeight===0?0:S/m.offsetHeight:0;if(d===m)K=l==="start"?_:l==="end"?_-v:l==="nearest"?ae(y,y+v,v,It,Vt,y+_,y+_+b,b):_-v/2,Y=c==="start"?A:c==="center"?A-g/2:c==="end"?A-g:ae($,$+g,g,Wt,Bt,$+A,$+A+w,w),K=Math.max(0,K+y),Y=Math.max(0,Y+$);else{K=l==="start"?_-ut-It:l==="end"?_-de+Vt+zt:l==="nearest"?ae(ut,de,S,It,Vt+zt,_,_+b,b):_-(ut+S/2)+zt/2,Y=c==="start"?A-Ft-Wt:c==="center"?A-(Ft+R/2)+jt/2:c==="end"?A-he+Bt+jt:ae(Ft,he,R,Wt,Bt+jt,A,A+w,w);const{scrollLeft:Ke,scrollTop:Ye}=m;K=ge===0?0:Math.max(0,Math.min(Ye+K/ge,m.scrollHeight-S/ge+zt)),Y=pe===0?0:Math.max(0,Math.min(Ke+Y/pe,m.scrollWidth-R/pe+jt)),_+=Ye-K,A+=Ke-Y}tt.push({el:m,top:K,left:Y})}return tt};var Ue;const ue=window,yt=ue.trustedTypes,jn=yt?yt.createPolicy("lit-html",{createHTML:t=>t}):void 0,qe="$lit$",G=`lit$${(Math.random()+"").slice(9)}$`,zn="?"+G,Ji=`<${zn}>`,lt=document,kt=()=>lt.createComment(""),Nt=t=>t===null||typeof t!="object"&&typeof t!="function",Un=Array.isArray,Gi=t=>Un(t)||typeof t?.[Symbol.iterator]=="function",Xe=`[
|
|
2
|
+
\f\r]`,Pt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,qn=/-->/g,Xn=/>/g,ct=RegExp(`>|${Xe}(?:([^\\s"'>=/]+)(${Xe}*=${Xe}*(?:[^
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Kn=/'/g,Yn=/"/g,Zn=/^(?:script|style|textarea|title)$/i,Qi=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),tr=Qi(1),Lt=Symbol.for("lit-noChange"),x=Symbol.for("lit-nothing"),Jn=new WeakMap,at=lt.createTreeWalker(lt,129,null,!1);function Gn(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return jn!==void 0?jn.createHTML(e):e}const er=(t,e)=>{const n=t.length-1,s=[];let i,r=e===2?"<svg>":"",o=Pt;for(let l=0;l<n;l++){const c=t[l];let a,u,f=-1,d=0;for(;d<c.length&&(o.lastIndex=d,u=o.exec(c),u!==null);)d=o.lastIndex,o===Pt?u[1]==="!--"?o=qn:u[1]!==void 0?o=Xn:u[2]!==void 0?(Zn.test(u[2])&&(i=RegExp("</"+u[2],"g")),o=ct):u[3]!==void 0&&(o=ct):o===ct?u[0]===">"?(o=i??Pt,f=-1):u[1]===void 0?f=-2:(f=o.lastIndex-u[2].length,a=u[1],o=u[3]===void 0?ct:u[3]==='"'?Yn:Kn):o===Yn||o===Kn?o=ct:o===qn||o===Xn?o=Pt:(o=ct,i=void 0);const h=o===ct&&t[l+1].startsWith("/>")?" ":"";r+=o===Pt?c+Ji:f>=0?(s.push(a),c.slice(0,f)+qe+c.slice(f)+G+h):c+G+(f===-2?(s.push(void 0),l):h)}return[Gn(t,r+(t[n]||"<?>")+(e===2?"</svg>":"")),s]};class Ht{constructor({strings:e,_$litType$:n},s){let i;this.parts=[];let r=0,o=0;const l=e.length-1,c=this.parts,[a,u]=er(e,n);if(this.el=Ht.createElement(a,s),at.currentNode=this.el.content,n===2){const f=this.el.content,d=f.firstChild;d.remove(),f.append(...d.childNodes)}for(;(i=at.nextNode())!==null&&c.length<l;){if(i.nodeType===1){if(i.hasAttributes()){const f=[];for(const d of i.getAttributeNames())if(d.endsWith(qe)||d.startsWith(G)){const h=u[o++];if(f.push(d),h!==void 0){const p=i.getAttribute(h.toLowerCase()+qe).split(G),g=/([.?@])?(.*)/.exec(h);c.push({type:1,index:r,name:g[2],strings:p,ctor:g[1]==="."?sr:g[1]==="?"?rr:g[1]==="@"?or:fe})}else c.push({type:6,index:r})}for(const d of f)i.removeAttribute(d)}if(Zn.test(i.tagName)){const f=i.textContent.split(G),d=f.length-1;if(d>0){i.textContent=yt?yt.emptyScript:"";for(let h=0;h<d;h++)i.append(f[h],kt()),at.nextNode(),c.push({type:2,index:++r});i.append(f[d],kt())}}}else if(i.nodeType===8)if(i.data===zn)c.push({type:2,index:r});else{let f=-1;for(;(f=i.data.indexOf(G,f+1))!==-1;)c.push({type:7,index:r}),f+=G.length-1}r++}}static createElement(e,n){const s=lt.createElement("template");return s.innerHTML=e,s}}function bt(t,e,n=t,s){var i,r,o,l;if(e===Lt)return e;let c=s!==void 0?(i=n._$Co)===null||i===void 0?void 0:i[s]:n._$Cl;const a=Nt(e)?void 0:e._$litDirective$;return c?.constructor!==a&&((r=c?._$AO)===null||r===void 0||r.call(c,!1),a===void 0?c=void 0:(c=new a(t),c._$AT(t,n,s)),s!==void 0?((o=(l=n)._$Co)!==null&&o!==void 0?o:l._$Co=[])[s]=c:n._$Cl=c),c!==void 0&&(e=bt(t,c._$AS(t,e.values),c,s)),e}class nr{constructor(e,n){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=n}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var n;const{el:{content:s},parts:i}=this._$AD,r=((n=e?.creationScope)!==null&&n!==void 0?n:lt).importNode(s,!0);at.currentNode=r;let o=at.nextNode(),l=0,c=0,a=i[0];for(;a!==void 0;){if(l===a.index){let u;a.type===2?u=new Mt(o,o.nextSibling,this,e):a.type===1?u=new a.ctor(o,a.name,a.strings,this,e):a.type===6&&(u=new lr(o,this,e)),this._$AV.push(u),a=i[++c]}l!==a?.index&&(o=at.nextNode(),l++)}return at.currentNode=lt,r}v(e){let n=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(e,s,n),n+=s.strings.length-2):s._$AI(e[n])),n++}}class Mt{constructor(e,n,s,i){var r;this.type=2,this._$AH=x,this._$AN=void 0,this._$AA=e,this._$AB=n,this._$AM=s,this.options=i,this._$Cp=(r=i?.isConnected)===null||r===void 0||r}get _$AU(){var e,n;return(n=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&n!==void 0?n:this._$Cp}get parentNode(){let e=this._$AA.parentNode;const n=this._$AM;return n!==void 0&&e?.nodeType===11&&(e=n.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,n=this){e=bt(this,e,n),Nt(e)?e===x||e==null||e===""?(this._$AH!==x&&this._$AR(),this._$AH=x):e!==this._$AH&&e!==Lt&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):Gi(e)?this.T(e):this._(e)}k(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}$(e){this._$AH!==e&&(this._$AR(),this._$AH=this.k(e))}_(e){this._$AH!==x&&Nt(this._$AH)?this._$AA.nextSibling.data=e:this.$(lt.createTextNode(e)),this._$AH=e}g(e){var n;const{values:s,_$litType$:i}=e,r=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=Ht.createElement(Gn(i.h,i.h[0]),this.options)),i);if(((n=this._$AH)===null||n===void 0?void 0:n._$AD)===r)this._$AH.v(s);else{const o=new nr(r,this),l=o.u(this.options);o.v(s),this.$(l),this._$AH=o}}_$AC(e){let n=Jn.get(e.strings);return n===void 0&&Jn.set(e.strings,n=new Ht(e)),n}T(e){Un(this._$AH)||(this._$AH=[],this._$AR());const n=this._$AH;let s,i=0;for(const r of e)i===n.length?n.push(s=new Mt(this.k(kt()),this.k(kt()),this,this.options)):s=n[i],s._$AI(r),i++;i<n.length&&(this._$AR(s&&s._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,n){var s;for((s=this._$AP)===null||s===void 0||s.call(this,!1,!0,n);e&&e!==this._$AB;){const i=e.nextSibling;e.remove(),e=i}}setConnected(e){var n;this._$AM===void 0&&(this._$Cp=e,(n=this._$AP)===null||n===void 0||n.call(this,e))}}class fe{constructor(e,n,s,i,r){this.type=1,this._$AH=x,this._$AN=void 0,this.element=e,this.name=n,this._$AM=i,this.options=r,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=x}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,n=this,s,i){const r=this.strings;let o=!1;if(r===void 0)e=bt(this,e,n,0),o=!Nt(e)||e!==this._$AH&&e!==Lt,o&&(this._$AH=e);else{const l=e;let c,a;for(e=r[0],c=0;c<r.length-1;c++)a=bt(this,l[s+c],n,c),a===Lt&&(a=this._$AH[c]),o||(o=!Nt(a)||a!==this._$AH[c]),a===x?e=x:e!==x&&(e+=(a??"")+r[c+1]),this._$AH[c]=a}o&&!i&&this.j(e)}j(e){e===x?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class sr extends fe{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===x?void 0:e}}const ir=yt?yt.emptyScript:"";class rr extends fe{constructor(){super(...arguments),this.type=4}j(e){e&&e!==x?this.element.setAttribute(this.name,ir):this.element.removeAttribute(this.name)}}class or extends fe{constructor(e,n,s,i,r){super(e,n,s,i,r),this.type=5}_$AI(e,n=this){var s;if((e=(s=bt(this,e,n,0))!==null&&s!==void 0?s:x)===Lt)return;const i=this._$AH,r=e===x&&i!==x||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,o=e!==x&&(i===x||r);r&&this.element.removeEventListener(this.name,this,i),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var n,s;typeof this._$AH=="function"?this._$AH.call((s=(n=this.options)===null||n===void 0?void 0:n.host)!==null&&s!==void 0?s:this.element,e):this._$AH.handleEvent(e)}}class lr{constructor(e,n,s){this.element=e,this.type=6,this._$AN=void 0,this._$AM=n,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(e){bt(this,e)}}const Qn=ue.litHtmlPolyfillSupport;Qn?.(Ht,Mt),((Ue=ue.litHtmlVersions)!==null&&Ue!==void 0?Ue:ue.litHtmlVersions=[]).push("2.8.0");const cr=(t,e,n)=>{var s,i;const r=(s=n?.renderBefore)!==null&&s!==void 0?s:e;let o=r._$litPart$;if(o===void 0){const l=(i=n?.renderBefore)!==null&&i!==void 0?i:null;r._$litPart$=o=new Mt(e.insertBefore(kt(),l),l,void 0,n??{})}return o._$AI(t),o};var ar='<path fill-rule="evenodd" clip-rule="evenodd" d="M6 7C5.63181 7 5.33333 7.29848 5.33333 7.66667V14.8667C5.33333 14.9403 5.39361 14.9999 5.46724 15.0009C10.8844 15.0719 15.2614 19.449 15.3325 24.8661C15.3334 24.9397 15.393 25 15.4667 25H26C26.3682 25 26.6667 24.7015 26.6667 24.3333V7.66667C26.6667 7.29848 26.3682 7 26 7H6ZM17.0119 22.2294C17.0263 22.29 17.0802 22.3333 17.1425 22.3333H23.3333C23.7015 22.3333 24 22.0349 24 21.6667V10.3333C24 9.96514 23.7015 9.66667 23.3333 9.66667H8.66667C8.29848 9.66667 8 9.96514 8 10.3333V13.1909C8 13.2531 8.04332 13.3071 8.10392 13.3214C12.5063 14.3618 15.9715 17.827 17.0119 22.2294Z" fill="currentColor"/> <path d="M13.2 25C13.2736 25 13.3334 24.9398 13.3322 24.8661C13.2615 20.5544 9.77889 17.0718 5.46718 17.0011C5.39356 16.9999 5.33333 17.0597 5.33333 17.1333V18.8667C5.33333 18.9403 5.39348 18.9999 5.4671 19.0015C8.67465 19.0716 11.2617 21.6587 11.3319 24.8662C11.3335 24.9399 11.393 25 11.4667 25H13.2Z" fill="currentColor"/> <path d="M5.33333 21.1333C5.33333 21.0597 5.39332 20.9998 5.46692 21.0022C7.57033 21.0712 9.26217 22.763 9.33114 24.8664C9.33356 24.94 9.27364 25 9.2 25H6C5.63181 25 5.33333 24.7015 5.33333 24.3333V21.1333Z" fill="currentColor"/>';export{ds as $,Vi as A,ke as B,Zt as C,Re as D,vs as E,Xi as F,Ui as G,hs as H,Ys as I,Zs as J,Js as K,fn as L,ii as M,Ms as N,gn as O,un as P,js as Q,Se as R,Gs as S,Ks as T,ln as U,pn as V,ti as W,Os as X,bs as Y,As as Z,Hs as _,Te as a,Rs as a0,Zi as a1,xs as a2,Qs as a3,Kt as a4,fs as a5,$n as a6,cr as a7,tr as a8,us as a9,si as aa,ei as ab,ar as ac,Cs as b,Ts as c,ms as d,Gt as e,li as f,Ge as g,ni as h,_e as i,Oe as j,Ne as k,an as l,ws as m,B as n,xt as o,is as p,ve as q,Es as r,Jt as s,rs as t,hn as u,Pe as v,oi as w,Bi as x,zi as y,ji as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as t}from"../chunks/vidstack-pFwe7gvT.js";import{HTMLMediaProvider as e}from"./vidstack-html-Bag27bH6.js";import{H as o}from"../chunks/vidstack-DdAmWWBJ.js";import"../chunks/vidstack-CL95Hezv.js";import"../chunks/vidstack-Cu8FqSS9.js";import"../chunks/vidstack-DiXE5sG8.js";import"../chunks/vidstack-C_AxqLKV.js";class s extends e{$$PROVIDER_TYPE="AUDIO";get type(){return"audio"}airPlay;constructor(r,i){super(r,i),t(()=>{this.airPlay=new o(this.media,i)},this.scope)}setup(){super.setup(),this.type==="audio"&&this.ctx.notify("provider-setup",this)}get audio(){return this.media}}export{s as AudioProvider};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{l as x,p as k}from"../chunks/vidstack-C51SKMUl.js";import{f as M,e as C,a as N,i as R}from"../chunks/vidstack-Cu8FqSS9.js";import{VideoProvider as F}from"./vidstack-video-DXUiSn4B.js";import{l as S,e as I,D as l,H as P,i as u,O as _,C as v,j as $,p as q}from"../chunks/vidstack-pFwe7gvT.js";import{Q as b}from"../chunks/vidstack-DRH_1tFW.js";import{T as m,a as H}from"../chunks/vidstack-DIPX97sJ.js";import{L as p}from"../chunks/vidstack-C_AxqLKV.js";import{R as j}from"../chunks/vidstack-DiXE5sG8.js";import{c as O}from"../chunks/vidstack-BfBBPhXV.js";import"./vidstack-html-Bag27bH6.js";import"../chunks/vidstack-CL95Hezv.js";import"../chunks/vidstack-DdAmWWBJ.js";function w(n){try{return new Intl.DisplayNames(navigator.languages,{type:"language"}).of(n)??null}catch{return null}}const Q=n=>`dash-${_(n)}`;class G{#e;#i;#t=null;#a=new Set;#r=null;config={};get instance(){return this.#t}constructor(t,i){this.#e=t,this.#i=i}setup(t){this.#t=t().create();const i=this.#m.bind(this);for(const s of Object.values(t.events))this.#t.on(s,i);this.#t.on(t.events.ERROR,this.#b.bind(this));for(const s of this.#a)s(this.#t);this.#i.player.dispatch("dash-instance",{detail:this.#t}),this.#t.initialize(this.#e,void 0,!1),this.#t.updateSettings({streaming:{text:{defaultEnabled:!1,dispatchForManualRendering:!0},buffer:{fastSwitchEnabled:!0}},...this.config}),this.#t.on(t.events.FRAGMENT_LOADING_STARTED,this.#w.bind(this)),this.#t.on(t.events.FRAGMENT_LOADING_COMPLETED,this.#E.bind(this)),this.#t.on(t.events.MANIFEST_LOADED,this.#v.bind(this)),this.#t.on(t.events.QUALITY_CHANGE_RENDERED,this.#S.bind(this)),this.#t.on(t.events.TEXT_TRACKS_ADDED,this.#y.bind(this)),this.#t.on(t.events.TRACK_CHANGE_RENDERED,this.#T.bind(this)),this.#i.qualities[b.enableAuto]=this.#A.bind(this),S(this.#i.qualities,"change",this.#D.bind(this)),S(this.#i.audioTracks,"change",this.#x.bind(this)),this.#r=I(this.#d.bind(this))}#s(t){return new l(Q(t.type),{detail:t})}#d(){if(!this.#i.$state.live())return;const t=new j(this.#f.bind(this));return t.start(),t.stop.bind(t)}#f(){if(!this.#t)return;const t=this.#t.duration()-this.#t.time();this.#i.$state.liveSyncPosition.set(isNaN(t)?1/0:t)}#m(t){this.#i.player?.dispatch(this.#s(t))}#n=null;#h={};#g(t){const i=this.#n?.[m.native],s=(i?.track).cues;if(!i||!s)return;const r=this.#n.id,a=this.#h[r]??0,o=this.#s(t);for(let c=a;c<s.length;c++){const h=s[c];h.positionAlign||(h.positionAlign="auto"),this.#n.addCue(h,o)}this.#h[r]=s.length}#y(t){if(!this.#t)return;const i=t.tracks,s=[...this.#e.textTracks].filter(a=>"manualMode"in a),r=this.#s(t);for(let a=0;a<s.length;a++){const o=i[a],c=s[a],h=`dash-${o.kind}-${a}`,d=new H({id:h,label:o?.label??o.labels.find(g=>g.text)?.text??(o?.lang&&w(o.lang))??o?.lang??void 0,language:o.lang??void 0,kind:o.kind,default:o.defaultTrack});d[m.native]={managed:!0,track:c},d[m.readyState]=2,d[m.onModeChange]=()=>{this.#t&&(d.mode==="showing"?(this.#t.setTextTrack(a),this.#n=d):(this.#t.setTextTrack(-1),this.#n=null))},this.#i.textTracks.add(d,r)}}#T(t){const{mediaType:i,newMediaInfo:s}=t;if(i==="audio"){const r=this.#i.audioTracks.getById(`dash-audio-${s.index}`);if(r){const a=this.#s(t);this.#i.audioTracks[p.select](r,!0,a)}}}#S(t){if(t.mediaType!=="video")return;const i=this.#i.qualities[t.newQuality];if(i){const s=this.#s(t);this.#i.qualities[p.select](i,!0,s)}}#v(t){if(this.#i.$state.canPlay()||!this.#t)return;const{type:i,mediaPresentationDuration:s}=t.data,r=this.#s(t);this.#i.notify("stream-type-change",i!=="static"?"live":"on-demand",r),this.#i.notify("duration-change",s,r),this.#i.qualities[b.setAuto](!0,r);const a=this.#t.getVideoElement(),o=this.#t.getTracksForTypeFromManifest("video",t.data),c=[...new Set(o.map(e=>e.mimeType))].find(e=>e&&M(a,e)),h=o.filter(e=>c===e.mimeType)[0];let d=this.#t.getTracksForTypeFromManifest("audio",t.data);const g=[...new Set(d.map(e=>e.mimeType))].find(e=>e&&C(a,e));if(d=d.filter(e=>g===e.mimeType),h.bitrateList.forEach((e,f)=>{const y={id:e.id?.toString()??`dash-bitrate-${f}`,width:e.width??0,height:e.height??0,bitrate:e.bandwidth??0,codec:h.codec,index:f};this.#i.qualities[p.add](y,r)}),P(h.index)){const e=this.#i.qualities[h.index];e&&this.#i.qualities[p.select](e,!0,r)}d.forEach((e,f)=>{const L=e.labels.find(T=>navigator.languages.some(D=>T.lang&&D.toLowerCase().startsWith(T.lang.toLowerCase())))||e.labels[0],A={id:`dash-audio-${e?.index}`,label:L?.text??(e.lang&&w(e.lang))??e.lang??"",language:e.lang??"",kind:"main",mimeType:e.mimeType,codec:e.codec,index:f};this.#i.audioTracks[p.add](A,r)}),a.dispatchEvent(new l("canplay",{trigger:r}))}#b(t){const{type:i,error:s}=t;switch(s.code){case 27:this.#L(s);break;default:this.#l(s);break}}#w(){this.#o>=0&&this.#c()}#E(t){t.mediaType==="text"&&requestAnimationFrame(this.#g.bind(this,t))}#o=-1;#L(t){this.#c(),this.#t?.play(),this.#o=window.setTimeout(()=>{this.#o=-1,this.#l(t)},5e3)}#c(){clearTimeout(this.#o),this.#o=-1}#l(t){this.#i.notify("error",{message:t.message??"",code:1,error:t})}#A(){this.#u("video",!0);const{qualities:t}=this.#i;this.#t?.setQualityFor("video",t.selectedIndex,!0)}#u(t,i){this.#t?.updateSettings({streaming:{abr:{autoSwitchBitrate:{[t]:i}}}})}#D(){const{qualities:t}=this.#i;!this.#t||t.auto||!t.selected||(this.#u("video",!1),this.#t.setQualityFor("video",t.selectedIndex,t.switch==="current"),N&&(this.#e.currentTime=this.#e.currentTime))}#x(){if(!this.#t)return;const{audioTracks:t}=this.#i,i=this.#t.getTracksFor("audio").find(s=>t.selected&&t.selected.id===`dash-audio-${s.index}`);i&&this.#t.setCurrentTrack(i)}#p(){this.#c(),this.#n=null,this.#h={}}onInstance(t){return this.#a.add(t),()=>this.#a.delete(t)}loadSource(t){this.#p(),u(t.src)&&this.#t?.attachSource(t.src)}destroy(){this.#p(),this.#t?.destroy(),this.#t=null,this.#r?.(),this.#r=null}}class V{#e;#i;#t;constructor(t,i,s){this.#e=t,this.#i=i,this.#t=s,this.#a()}async#a(){const t={onLoadStart:this.#r.bind(this),onLoaded:this.#s.bind(this),onLoadError:this.#d.bind(this)};let i=await B(this.#e,t);if(v(i)&&!u(this.#e)&&(i=await U(this.#e,t)),!i)return null;if(!window.dashjs.supportsMediaSource()){const s="[vidstack] `dash.js` is not supported in this environment";return this.#i.player.dispatch(new l("dash-unsupported")),this.#i.notify("error",{message:s,code:4}),null}return i}#r(){this.#i.player.dispatch(new l("dash-lib-load-start"))}#s(t){this.#i.player.dispatch(new l("dash-lib-loaded",{detail:t})),this.#t(t)}#d(t){const i=O(t);this.#i.player.dispatch(new l("dash-lib-load-error",{detail:i})),this.#i.notify("error",{message:i.message,code:4,error:i})}}async function U(n,t={}){if(!v(n)){if(t.onLoadStart?.(),K(n))return t.onLoaded?.(n),n;if(E(n)){const i=n.MediaPlayer;return t.onLoaded?.(i),i}try{const i=(await n())?.default;if(E(i))return t.onLoaded?.(i.MediaPlayer),i.MediaPlayer;if(i)t.onLoaded?.(i);else throw Error("");return i}catch(i){t.onLoadError?.(i)}}}async function B(n,t={}){if(u(n)){t.onLoadStart?.();try{if(await x(n),!$(window.dashjs.MediaPlayer))throw Error("");const i=window.dashjs.MediaPlayer;return t.onLoaded?.(i),i}catch(i){t.onLoadError?.(i)}}}function K(n){return n&&n.prototype&&n.prototype!==Function}function E(n){return n&&"MediaPlayer"in n}const Y="https://cdn.jsdelivr.net";class z extends F{$$PROVIDER_TYPE="DASH";#e=null;#i=new G(this.video,this.ctx);get ctor(){return this.#e}get instance(){return this.#i.instance}static supported=R();get type(){return"dash"}get canLiveSync(){return!0}#t=`${Y}/npm/dashjs@4.7.4/dist/dash.all.min.js`;get config(){return this.#i.config}set config(t){this.#i.config=t}get library(){return this.#t}set library(t){this.#t=t}preconnect(){u(this.#t)&&k(this.#t)}setup(){super.setup(),new V(this.#t,this.ctx,t=>{this.#e=t,this.#i.setup(t),this.ctx.notify("provider-setup",this);const i=q(this.ctx.$state.source);i&&this.loadSource(i)})}async loadSource(t,i){if(!u(t.src)){this.removeSource();return}this.media.preload=i||"",this.appendSource(t,"application/x-mpegurl"),this.#i.loadSource(t),this.currentSrc=t}onInstance(t){const i=this.#i.instance;return i&&t(i),this.#i.onInstance(t)}destroy(){this.#i.destroy()}}export{z as DASHProvider};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{l,e as g,g as k,a4 as y,ab as u,o as p,D as m,p as h}from"../chunks/vidstack-pFwe7gvT.js";import{T as o}from"../chunks/vidstack-C0nMUcD9.js";import{R as C}from"../chunks/vidstack-DiXE5sG8.js";import{L as E}from"../chunks/vidstack-C_AxqLKV.js";import{g as T,a as v,b as L,h as f,l as S,c as A}from"../chunks/vidstack-DhXI_0ND.js";class I{#t;constructor(t){this.#t=new chrome.cast.media.MediaInfo(t.src,t.type)}build(){return this.#t}setStreamType(t){return t.includes("live")?this.#t.streamType=chrome.cast.media.StreamType.LIVE:this.#t.streamType=chrome.cast.media.StreamType.BUFFERED,this}setTracks(t){return this.#t.tracks=t.map(this.#e),this}setMetadata(t,e){return this.#t.metadata=new chrome.cast.media.GenericMediaMetadata,this.#t.metadata.title=t,this.#t.metadata.images=[{url:e}],this}#e(t,e){const s=new chrome.cast.media.Track(e,chrome.cast.media.TrackType.TEXT);return s.name=t.label,s.trackContentId=t.src,s.trackContentType="text/vtt",s.language=t.language,s.subtype=t.kind.toUpperCase(),s}}class b{#t;#e;#i;constructor(t,e,s){this.#t=t,this.#e=e,this.#i=s}setup(){const t=this.syncRemoteActiveIds.bind(this);l(this.#e.audioTracks,"change",t),l(this.#e.textTracks,"mode-change",t),g(this.#n.bind(this))}getLocalTextTracks(){return this.#e.$state.textTracks().filter(t=>t.src&&t.type==="vtt")}#a(){return this.#e.$state.audioTracks()}#r(t){const e=this.#t.mediaInfo?.tracks??[];return t?e.filter(s=>s.type===t):e}#l(){const t=[],e=this.#a().find(i=>i.selected),s=this.getLocalTextTracks().filter(i=>i.mode==="showing");if(e){const i=this.#r(chrome.cast.media.TrackType.AUDIO),r=this.#d(i,e);r&&t.push(r.trackId)}if(s?.length){const i=this.#r(chrome.cast.media.TrackType.TEXT);if(i.length)for(const r of s){const a=this.#d(i,r);a&&t.push(a.trackId)}}return t}#n(){const t=this.getLocalTextTracks();if(!this.#t.isMediaLoaded)return;const e=this.#r(chrome.cast.media.TrackType.TEXT);for(const s of t)if(!this.#d(e,s)){k(()=>this.#i?.());break}}syncRemoteTracks(t){if(!this.#t.isMediaLoaded)return;const e=this.#a(),s=this.getLocalTextTracks(),i=this.#r(chrome.cast.media.TrackType.AUDIO),r=this.#r(chrome.cast.media.TrackType.TEXT);for(const a of i){if(this.#h(e,a))continue;const n={id:a.trackId.toString(),label:a.name,language:a.language,kind:a.subtype??"main",selected:!1};this.#e.audioTracks[E.add](n,t)}for(const a of r){if(this.#h(s,a))continue;const n={id:a.trackId.toString(),src:a.trackContentId,label:a.name,language:a.language,kind:a.subtype.toLowerCase()};this.#e.textTracks.add(n,t)}}syncRemoteActiveIds(t){if(!this.#t.isMediaLoaded)return;const e=this.#l(),s=new chrome.cast.media.EditTracksInfoRequest(e);this.#c(s).catch(i=>{})}#c(t){const e=T();return new Promise((s,i)=>e?.editTracksInfo(t,s,i))}#h(t,e){return t.find(s=>this.#s(s,e))}#d(t,e){return t.find(s=>this.#s(e,s))}#s(t,e){return e.name===t.label&&e.language===t.language&&e.subtype.toLowerCase()===t.kind.toLowerCase()}}class R{$$PROVIDER_TYPE="GOOGLE_CAST";scope=y();#t;#e;#i;#a=null;#r="disconnected";#l=0;#n=0;#c=new o(0,0);#h=new C(this.#b.bind(this));#d;#s=null;#u=!1;constructor(t,e){this.#t=t,this.#e=e,this.#i=new b(t,e,this.#G.bind(this))}get type(){return"google-cast"}get currentSrc(){return this.#a}get player(){return this.#t}get cast(){return v()}get session(){return L()}get media(){return T()}get hasActiveSession(){return f(this.#a)}setup(){this.#L(),this.#S(),this.#i.setup(),this.#e.notify("provider-setup",this)}#L(){S(cast.framework.CastContextEventType.CAST_STATE_CHANGED,this.#f.bind(this))}#S(){const t=cast.framework.RemotePlayerEventType,e={[t.IS_CONNECTED_CHANGED]:this.#f,[t.IS_MEDIA_LOADED_CHANGED]:this.#g,[t.CAN_CONTROL_VOLUME_CHANGED]:this.#k,[t.CAN_SEEK_CHANGED]:this.#y,[t.DURATION_CHANGED]:this.#D,[t.IS_MUTED_CHANGED]:this.#p,[t.VOLUME_LEVEL_CHANGED]:this.#p,[t.IS_PAUSED_CHANGED]:this.#N,[t.LIVE_SEEKABLE_RANGE_CHANGED]:this.#C,[t.PLAYER_STATE_CHANGED]:this.#P};this.#d=e;const s=this.#R.bind(this);for(const i of u(e))this.#t.controller.addEventListener(i,s);p(()=>{for(const i of u(e))this.#t.controller.removeEventListener(i,s)})}async play(){if(!(!this.#t.isPaused&&!this.#u)){if(this.#u){await this.#v(!1,0);return}this.#t.controller?.playOrPause()}}async pause(){this.#t.isPaused||this.#t.controller?.playOrPause()}getMediaStatus(t){return new Promise((e,s)=>{this.media?.getStatus(t,e,s)})}setMuted(t){(t&&!this.#t.isMuted||!t&&this.#t.isMuted)&&this.#t.controller?.muteOrUnmute()}setCurrentTime(t){this.#t.currentTime=t,this.#e.notify("seeking",t),this.#t.controller?.seek()}setVolume(t){this.#t.volumeLevel=t,this.#t.controller?.setVolumeLevel()}async loadSource(t){if(this.#s?.src!==t&&(this.#s=null),f(t)){this.#A(),this.#a=t;return}this.#e.notify("load-start");const e=this.#x(t),s=await this.session.loadMedia(e);if(s){this.#a=null,this.#e.notify("error",Error(A(s)));return}this.#a=t}destroy(){this.#m(),this.#T()}#m(){this.#s||(this.#n=0,this.#c=new o(0,0)),this.#h.stop(),this.#l=0,this.#s=null}#A(){const t=new m("resume-session",{detail:this.session});this.#g(t);const{muted:e,volume:s,savedState:i}=this.#e.$state,r=i();this.setCurrentTime(Math.max(this.#t.currentTime,r?.currentTime??0)),this.setMuted(e()),this.setVolume(s()),r?.paused===!1&&this.play()}#T(){this.cast.endCurrentSession(!0);const{remotePlaybackLoader:t}=this.#e.$state;t.set(null)}#I(){const{savedState:t}=this.#e.$state;t.set({paused:this.#t.isPaused,currentTime:this.#t.currentTime}),this.#T()}#b(){this.#M()}#R(t){this.#d[t.type].call(this,t)}#f(t){const e=this.cast.getCastState(),s=e===cast.framework.CastState.CONNECTED?"connected":e===cast.framework.CastState.CONNECTING?"connecting":"disconnected";if(this.#r===s)return;const i={type:"google-cast",state:s},r=this.#o(t);this.#r=s,this.#e.notify("remote-playback-change",i,r),s==="disconnected"&&this.#I()}#g(t){if(!!!this.#t.isMediaLoaded)return;const s=h(this.#e.$state.source);Promise.resolve().then(()=>{if(s!==h(this.#e.$state.source)||!this.#t.isMediaLoaded)return;this.#m();const i=this.#t.duration;this.#c=new o(0,i);const r={provider:this,duration:i,buffered:new o(0,0),seekable:this.#E()},a=this.#o(t);this.#e.notify("loaded-metadata",void 0,a),this.#e.notify("loaded-data",void 0,a),this.#e.notify("can-play",r,a),this.#k(),this.#y(t);const{volume:c,muted:n}=this.#e.$state;this.setVolume(c()),this.setMuted(n()),this.#h.start(),this.#i.syncRemoteTracks(a),this.#i.syncRemoteActiveIds(a)})}#k(){this.#e.$state.canSetVolume.set(this.#t.canControlVolume)}#y(t){const e=this.#o(t);this.#e.notify("stream-type-change",this.#w(),e)}#w(){return this.#t.mediaInfo?.streamType===chrome.cast.media.StreamType.LIVE?this.#t.canSeek?"live:dvr":"live":"on-demand"}#M(){if(this.#s)return;const t=this.#t.currentTime;t!==this.#l&&(this.#e.notify("time-change",t),t>this.#n&&(this.#n=t,this.#C()),this.#e.$state.seeking()&&this.#e.notify("seeked",t),this.#l=t)}#D(t){if(!this.#t.isMediaLoaded||this.#s)return;const e=this.#t.duration,s=this.#o(t);this.#c=new o(0,e),this.#e.notify("duration-change",e,s)}#p(t){if(!this.#t.isMediaLoaded)return;const e={muted:this.#t.isMuted,volume:this.#t.volumeLevel},s=this.#o(t);this.#e.notify("volume-change",e,s)}#N(t){const e=this.#o(t);this.#t.isPaused?this.#e.notify("pause",void 0,e):this.#e.notify("play",void 0,e)}#C(t){const e={seekable:this.#E(),buffered:new o(0,this.#n)},s=t?this.#o(t):void 0;this.#e.notify("progress",e,s)}#P(t){const e=this.#t.playerState,s=chrome.cast.media.PlayerState;if(this.#u=e===s.IDLE,e===s.PAUSED)return;const i=this.#o(t);switch(e){case s.PLAYING:this.#e.notify("playing",void 0,i);break;case s.BUFFERING:this.#e.notify("waiting",void 0,i);break;case s.IDLE:this.#h.stop(),this.#e.notify("pause"),this.#e.notify("end");break}}#E(){return this.#t.liveSeekableRange?new o(this.#t.liveSeekableRange.start,this.#t.liveSeekableRange.end):this.#c}#o(t){return t instanceof Event?t:new m(t.type,{detail:t})}#_(t){const{streamType:e,title:s,poster:i}=this.#e.$state;return new I(t).setMetadata(s(),i()).setStreamType(e()).setTracks(this.#i.getLocalTextTracks()).build()}#x(t){const e=this.#_(t),s=new chrome.cast.media.LoadRequest(e),i=this.#e.$state.savedState();return s.autoplay=(this.#s?.paused??i?.paused)===!1,s.currentTime=this.#s?.time??i?.currentTime??0,s}async#v(t,e){const s=h(this.#e.$state.source);this.#s={src:s,paused:t,time:e},await this.loadSource(s)}#G(){this.#v(this.#t.isPaused,this.#t.currentTime).catch(t=>{})}}export{R as GoogleCastProvider};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{l as L,p as S}from"../chunks/vidstack-C51SKMUl.js";import{a as E,g as T}from"../chunks/vidstack-Cu8FqSS9.js";import{VideoProvider as b}from"./vidstack-video-DXUiSn4B.js";import{p as f,l as v,e as k,D as d,i as l,O as w,C as y,j as x}from"../chunks/vidstack-pFwe7gvT.js";import{Q as g}from"../chunks/vidstack-DRH_1tFW.js";import{a as D,T as m}from"../chunks/vidstack-DIPX97sJ.js";import{L as u}from"../chunks/vidstack-C_AxqLKV.js";import{R as C}from"../chunks/vidstack-DiXE5sG8.js";import{c as I}from"../chunks/vidstack-BfBBPhXV.js";import"./vidstack-html-Bag27bH6.js";import"../chunks/vidstack-CL95Hezv.js";import"../chunks/vidstack-DdAmWWBJ.js";const A=r=>w(r);class H{#e;#t;#i=null;#n=null;config={};#r=new Set;get instance(){return this.#i}constructor(t,i){this.#e=t,this.#t=i}setup(t){const{streamType:i}=this.#t.$state,e=f(i).includes("live"),s=f(i).includes("ll-");this.#i=new t({lowLatencyMode:s,backBufferLength:s?4:e?8:void 0,renderTextTracksNatively:!1,...this.config});const o=this.#h.bind(this);for(const n of Object.values(t.Events))this.#i.on(n,o);this.#i.on(t.Events.ERROR,this.#v.bind(this));for(const n of this.#r)n(this.#i);this.#t.player.dispatch("hls-instance",{detail:this.#i}),this.#i.attachMedia(this.#e),this.#i.on(t.Events.AUDIO_TRACK_SWITCHED,this.#l.bind(this)),this.#i.on(t.Events.LEVEL_SWITCHED,this.#u.bind(this)),this.#i.on(t.Events.LEVEL_LOADED,this.#f.bind(this)),this.#i.on(t.Events.LEVEL_UPDATED,this.#p.bind(this)),this.#i.on(t.Events.NON_NATIVE_TEXT_TRACKS_FOUND,this.#c.bind(this)),this.#i.on(t.Events.CUES_PARSED,this.#d.bind(this)),this.#t.qualities[g.enableAuto]=this.#g.bind(this),v(this.#t.qualities,"change",this.#m.bind(this)),v(this.#t.audioTracks,"change",this.#L.bind(this)),this.#n=k(this.#o.bind(this))}#s(t,i){return new d(A(t),{detail:i})}#o(){if(!this.#t.$state.live())return;const t=new C(this.#a.bind(this));return t.start(),t.stop.bind(t)}#a(){this.#t.$state.liveSyncPosition.set(this.#i?.liveSyncPosition??1/0)}#h(t,i){this.#t.player?.dispatch(this.#s(t,i))}#c(t,i){const e=this.#s(t,i);let s=-1;for(let o=0;o<i.tracks.length;o++){const n=i.tracks[o],h=n.subtitleTrack??n.closedCaptions,c=new D({id:`hls-${n.kind}-${o}`,src:h?.url,label:n.label,language:h?.lang,kind:n.kind,default:n.default});c[m.readyState]=2,c[m.onModeChange]=()=>{c.mode==="showing"?(this.#i.subtitleTrack=o,s=o):s===o&&(this.#i.subtitleTrack=-1,s=-1)},this.#t.textTracks.add(c,e)}}#d(t,i){const e=this.#i?.subtitleTrack,s=this.#t.textTracks.getById(`hls-${i.type}-${e}`);if(!s)return;const o=this.#s(t,i);for(const n of i.cues)n.positionAlign="auto",s.addCue(n,o)}#l(t,i){const e=this.#t.audioTracks[i.id];if(e){const s=this.#s(t,i);this.#t.audioTracks[u.select](e,!0,s)}}#u(t,i){const e=this.#t.qualities[i.level];if(e){const s=this.#s(t,i);this.#t.qualities[u.select](e,!0,s)}}#p(t,i){i.details.totalduration>0&&this.#t.$state.inferredLiveDVRWindow.set(i.details.totalduration)}#f(t,i){if(this.#t.$state.canPlay())return;const{type:e,live:s,totalduration:o,targetduration:n}=i.details,h=this.#s(t,i);this.#t.notify("stream-type-change",s?e==="EVENT"&&Number.isFinite(o)&&n>=10?"live:dvr":"live":"on-demand",h),this.#t.notify("duration-change",o,h);const c=this.#i.media;this.#i.currentLevel===-1&&this.#t.qualities[g.setAuto](!0,h);for(const a of this.#i.audioTracks){const p={id:a.id.toString(),label:a.name,language:a.lang||"",kind:"main"};this.#t.audioTracks[u.add](p,h)}for(const a of this.#i.levels){const p={id:a.id?.toString()??a.height+"p",width:a.width,height:a.height,codec:a.codecSet,bitrate:a.bitrate};this.#t.qualities[u.add](p,h)}c.dispatchEvent(new d("canplay",{trigger:h}))}#v(t,i){if(i.fatal)switch(i.type){case"mediaError":this.#i?.recoverMediaError();break;default:this.#y(i.error);break}}#y(t){this.#t.notify("error",{message:t.message,code:1,error:t})}#g(){this.#i&&(this.#i.currentLevel=-1)}#m(){const{qualities:t}=this.#t;!this.#i||t.auto||(this.#i[t.switch+"Level"]=t.selectedIndex,E&&(this.#e.currentTime=this.#e.currentTime))}#L(){const{audioTracks:t}=this.#t;this.#i&&this.#i.audioTrack!==t.selectedIndex&&(this.#i.audioTrack=t.selectedIndex)}onInstance(t){return this.#r.add(t),()=>this.#r.delete(t)}loadSource(t){l(t.src)&&this.#i?.loadSource(t.src)}destroy(){this.#i?.destroy(),this.#i=null,this.#n?.(),this.#n=null}}class _{#e;#t;#i;constructor(t,i,e){this.#e=t,this.#t=i,this.#i=e,this.#n()}async#n(){const t={onLoadStart:this.#r.bind(this),onLoaded:this.#s.bind(this),onLoadError:this.#o.bind(this)};let i=await R(this.#e,t);if(y(i)&&!l(this.#e)&&(i=await $(this.#e,t)),!i)return null;if(!i.isSupported()){const e="[vidstack] `hls.js` is not supported in this environment";return this.#t.player.dispatch(new d("hls-unsupported")),this.#t.notify("error",{message:e,code:4}),null}return i}#r(){this.#t.player.dispatch(new d("hls-lib-load-start"))}#s(t){this.#t.player.dispatch(new d("hls-lib-loaded",{detail:t})),this.#i(t)}#o(t){const i=I(t);this.#t.player.dispatch(new d("hls-lib-load-error",{detail:i})),this.#t.notify("error",{message:i.message,code:4,error:i})}}async function $(r,t={}){if(!y(r)){if(t.onLoadStart?.(),r.prototype&&r.prototype!==Function)return t.onLoaded?.(r),r;try{const i=(await r())?.default;if(i&&i.isSupported)t.onLoaded?.(i);else throw Error("");return i}catch(i){t.onLoadError?.(i)}}}async function R(r,t={}){if(l(r)){t.onLoadStart?.();try{if(await L(r),!x(window.Hls))throw Error("");const i=window.Hls;return t.onLoaded?.(i),i}catch(i){t.onLoadError?.(i)}}}const O="https://cdn.jsdelivr.net";class P extends b{$$PROVIDER_TYPE="HLS";#e=null;#t=new H(this.video,this.ctx);get ctor(){return this.#e}get instance(){return this.#t.instance}static supported=T();get type(){return"hls"}get canLiveSync(){return!0}#i=`${O}/npm/hls.js@^1.5.0/dist/hls.min.js`;get config(){return this.#t.config}set config(t){this.#t.config=t}get library(){return this.#i}set library(t){this.#i=t}preconnect(){l(this.#i)&&S(this.#i)}setup(){super.setup(),new _(this.#i,this.ctx,t=>{this.#e=t,this.#t.setup(t),this.ctx.notify("provider-setup",this);const i=f(this.ctx.$state.source);i&&this.loadSource(i)})}async loadSource(t,i){if(!l(t.src)){this.removeSource();return}this.media.preload=i||"",this.appendSource(t,"application/x-mpegurl"),this.#t.loadSource(t),this.currentSrc=t}onInstance(t){const i=this.#t.instance;return i&&t(i),this.#t.onInstance(t)}destroy(){this.#t.destroy()}}export{P as HLSProvider};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as T,g as f,f as S}from"../chunks/vidstack-CL95Hezv.js";import{s as m,E as y,e as k,o as p,p as C,a9 as E,l as g,D as w,a4 as P,k as r,i as A}from"../chunks/vidstack-pFwe7gvT.js";import{l as h,b as L}from"../chunks/vidstack-Cu8FqSS9.js";import{R as x}from"../chunks/vidstack-DiXE5sG8.js";import{L as c}from"../chunks/vidstack-C_AxqLKV.js";let o=null,d=[],u=[];function l(){return o??=new AudioContext}function $(){const s=l(),t=s.createGain();return t.connect(s.destination),d.push(t),t}function G(s,t){const i=l(),e=i.createMediaElementSource(s);return t&&e.connect(t),u.push(e),e}function N(s){const t=d.indexOf(s);t!==-1&&(d.splice(t,1),s.disconnect(),v())}function M(s){const t=u.indexOf(s);t!==-1&&(u.splice(t,1),s.disconnect(),v())}function v(){o&&d.length===0&&u.length===0&&o.close().then(()=>{o=null})}class R{#n;#t;#e=null;#a=null;get currentGain(){return this.#e?.gain?.value??null}get supported(){return!0}constructor(t,i){this.#n=t,this.#t=i}setGain(t){const i=this.currentGain;if(t!==this.currentGain){if(t===1&&i!==1){this.removeGain();return}this.#e||(this.#e=$(),this.#a&&this.#a.connect(this.#e)),this.#a||(this.#a=G(this.#n,this.#e)),this.#e.gain.value=t,this.#t(t)}}removeGain(){this.#e&&(this.#a&&this.#a.connect(l().destination),this.#r(),this.#t(null))}destroy(){this.#h(),this.#r()}#h(){if(this.#a)try{M(this.#a)}catch{}finally{this.#a=null}}#r(){if(this.#e)try{N(this.#e)}catch{}finally{this.#e=null}}}const D=["focus","blur","visibilitychange","pageshow","pagehide"];class O{#n=m(b());#t=m(document.visibilityState);#e;connect(){const t=new y(window),i=this.#a.bind(this);for(const e of D)t.add(e,i);h&&t.add("beforeunload",e=>{this.#e=setTimeout(()=>{e.defaultPrevented||e.returnValue.length>0||(this.#n.set("hidden"),this.#t.set("hidden"))},0)})}get pageState(){return this.#n()}get visibility(){return this.#t()}#a(t){h&&window.clearTimeout(this.#e),(t.type!=="blur"||this.#n()==="active")&&(this.#n.set(b(t)),this.#t.set(document.visibilityState=="hidden"?"hidden":"visible"))}}function b(s){return s?.type==="blur"||document.visibilityState==="hidden"?"hidden":document.hasFocus()?"active":"passive"}class I{#n;#t;#e=!1;#a=!1;#h=!1;#r=new x(this.#p.bind(this));#d=new O;#u;get#i(){return this.#n.media}constructor(t,i){this.#n=t,this.#t=i,this.#u=new y(t.media),this.#g(),this.#d.connect(),k(this.#M.bind(this)),p(this.#y.bind(this))}#y(){this.#a=!1,this.#h=!1,this.#r.stop(),this.#u.abort(),this.#T?.clear()}#c=0;#l=-1;#p(){const t=this.#i.currentTime;!(h&&t-this.#l<.35)&&this.#c!==t&&(this.#o(t),this.#c=t)}#g(){this.#s("loadstart",this.#S),this.#s("abort",this.#m),this.#s("emptied",this.#k),this.#s("error",this.#j),this.#s("volumechange",this.#O)}#v(){this.#a||(this.#s("loadeddata",this.#C),this.#s("loadedmetadata",this.#E),this.#s("canplay",this.#A),this.#s("canplaythrough",this.#L),this.#s("durationchange",this.#D),this.#s("play",this.#w),this.#s("progress",this.#U),this.#s("stalled",this.#$),this.#s("suspend",this.#V),this.#s("ratechange",this.#H),this.#a=!0)}#b(){this.#h||(this.#s("pause",this.#P),this.#s("playing",this.#x),this.#s("seeked",this.#I),this.#s("seeking",this.#F),this.#s("ended",this.#N),this.#s("waiting",this.#G),this.#h=!0)}#T=void 0;#q=void 0;#s(t,i){this.#u.add(t,i.bind(this))}#B(t){}#o(t,i){const e=Math.min(t,this.#t.$state.seekableEnd());this.#t.notify("time-change",e,i)}#S(t){if(this.#i.networkState===3){this.#m(t);return}this.#v(),this.#t.notify("load-start",void 0,t)}#m(t){this.#t.notify("abort",void 0,t)}#k(){this.#t.notify("emptied",void 0,event)}#C(t){this.#t.notify("loaded-data",void 0,t)}#E(t){this.#c=0,this.#l=-1,this.#b(),this.#t.notify("loaded-metadata",void 0,t),(L||h&&T(this.#t.$state.source()))&&this.#t.delegate.ready(this.#f(),t)}#f(){return{provider:C(this.#t.$provider),duration:this.#i.duration,buffered:this.#i.buffered,seekable:this.#i.seekable}}#w(t){this.#t.$state.canPlay&&this.#t.notify("play",void 0,t)}#P(t){this.#i.readyState===1&&!this.#e||(this.#e=!1,this.#r.stop(),this.#t.notify("pause",void 0,t))}#A(t){this.#t.delegate.ready(this.#f(),t)}#L(t){this.#t.$state.started()||this.#t.notify("can-play-through",this.#f(),t)}#x(t){this.#i.paused||(this.#e=!1,this.#t.notify("playing",void 0,t),this.#r.start())}#$(t){this.#t.notify("stalled",void 0,t),this.#i.readyState<3&&(this.#e=!0,this.#t.notify("waiting",void 0,t))}#G(t){this.#i.readyState<3&&(this.#e=!0,this.#t.notify("waiting",void 0,t))}#N(t){this.#r.stop(),this.#o(this.#i.duration,t),this.#t.notify("end",void 0,t),this.#t.$state.loop()&&E(this.#i.controls)&&(this.#i.controls=!1)}#M(){const t=this.#t.$state.paused(),i=this.#d.visibility==="hidden";(t||i)&&g(this.#i,"timeupdate",this.#R.bind(this))}#R(t){this.#o(this.#i.currentTime,t)}#D(t){this.#t.$state.ended()&&this.#o(this.#i.duration,t),this.#t.notify("duration-change",this.#i.duration,t)}#O(t){const i={volume:this.#i.volume,muted:this.#i.muted};this.#t.notify("volume-change",i,t)}#I(t){this.#l=this.#i.currentTime,this.#o(this.#i.currentTime,t),this.#t.notify("seeked",this.#i.currentTime,t),Math.trunc(this.#i.currentTime)===Math.trunc(this.#i.duration)&&f(this.#i.duration)>f(this.#i.currentTime)&&(this.#o(this.#i.duration,t),this.#i.ended||this.#t.player.dispatch(new w("media-play-request",{trigger:t})))}#F(t){this.#t.notify("seeking",this.#i.currentTime,t)}#U(t){const i={buffered:this.#i.buffered,seekable:this.#i.seekable};this.#t.notify("progress",i,t)}#V(t){this.#t.notify("suspend",void 0,t)}#H(t){this.#t.notify("rate-change",this.#i.playbackRate,t)}#j(t){const i=this.#i.error;if(!i)return;const e={message:i.message,code:i.code,mediaError:i};this.#t.notify("error",e,t)}}class F{#n;#t;get#e(){return this.#n.media.audioTracks}constructor(t,i){this.#n=t,this.#t=i,this.#e.onaddtrack=this.#a.bind(this),this.#e.onremovetrack=this.#h.bind(this),this.#e.onchange=this.#r.bind(this),g(this.#t.audioTracks,"change",this.#u.bind(this))}#a(t){const i=t.track;if(i.label==="")return;const e=i.id.toString()||`native-audio-${this.#t.audioTracks.length}`,a={id:e,label:i.label,language:i.language,kind:i.kind,selected:!1};this.#t.audioTracks[c.add](a,t),i.enabled&&(a.selected=!0)}#h(t){const i=this.#t.audioTracks.getById(t.track.id);i&&this.#t.audioTracks[c.remove](i,t)}#r(t){let i=this.#d();if(!i)return;const e=this.#t.audioTracks.getById(i.id);e&&this.#t.audioTracks[c.select](e,!0,t)}#d(){return Array.from(this.#e).find(t=>t.enabled)}#u(t){const{current:i}=t.detail;if(!i)return;const e=this.#e.getTrackById(i.id);if(e){const a=this.#d();a&&(a.enabled=!1),e.enabled=!0}}}class U{constructor(t,i){this.media=t,this.ctx=i,this.audioGain=new R(t,e=>{this.ctx.notify("audio-gain-change",e)})}scope=P();currentSrc=null;audioGain;setup(){new I(this,this.ctx),"audioTracks"in this.media&&new F(this,this.ctx),p(()=>{this.audioGain.destroy(),this.media.srcObject=null,this.media.removeAttribute("src");for(const t of this.media.querySelectorAll("source"))t.remove();this.media.load()})}get type(){return""}setPlaybackRate(t){this.media.playbackRate=t}async play(){return this.media.play()}async pause(){return this.media.pause()}setMuted(t){this.media.muted=t}setVolume(t){this.media.volume=t}setCurrentTime(t){this.media.currentTime=t}setPlaysInline(t){r(this.media,"playsinline",t)}async loadSource({src:t,type:i},e){this.media.preload=e||"",S(t)?(this.removeSource(),this.media.srcObject=t):(this.media.srcObject=null,A(t)?i!=="?"?this.appendSource({src:t,type:i}):(this.removeSource(),this.media.src=this.#n(t)):(this.removeSource(),this.media.src=window.URL.createObjectURL(t))),this.media.load(),this.currentSrc={src:t,type:i}}appendSource(t,i){const e=this.media.querySelector("source[data-vds]"),a=e??document.createElement("source");r(a,"src",this.#n(t.src)),r(a,"type",t.type!=="?"?t.type:i),r(a,"data-vds",""),e||this.media.append(a)}removeSource(){this.media.querySelector("source[data-vds]")?.remove()}#n(t){const{clipStartTime:i,clipEndTime:e}=this.ctx.$state,a=i(),n=e();return a>0&&n>0?`${t}#t=${a},${n}`:a>0?`${t}#t=${a}`:n>0?`${t}#t=0,${n}`:t}}export{U as HTMLMediaProvider};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o,E as p,l,D as P,n as f}from"../chunks/vidstack-pFwe7gvT.js";import{h as u,j as h,k as m}from"../chunks/vidstack-Cu8FqSS9.js";import{HTMLMediaProvider as g}from"./vidstack-html-Bag27bH6.js";import{H as k}from"../chunks/vidstack-DdAmWWBJ.js";import{a as x,T as s}from"../chunks/vidstack-DIPX97sJ.js";import"../chunks/vidstack-CL95Hezv.js";import"../chunks/vidstack-DiXE5sG8.js";import"../chunks/vidstack-C_AxqLKV.js";import"../chunks/vidstack-C51SKMUl.js";class T{#t;#i;constructor(t,e){this.#t=t,this.#i=e,t.textTracks.onaddtrack=this.#e.bind(this),o(this.#r.bind(this))}#e(t){const e=t.track;if(!e||y(this.#t,e))return;const i=new x({id:e.id,kind:e.kind,label:e.label??"",language:e.language,type:"vtt"});i[s.native]={track:e},i[s.readyState]=2,i[s.nativeHLS]=!0;let a=0;const c=d=>{if(e.cues)for(let n=a;n<e.cues.length;n++)i.addCue(e.cues[n],d),a++};c(t),e.oncuechange=c,this.#i.textTracks.add(i,t),i.setMode(e.mode,t)}#r(){this.#t.textTracks.onaddtrack=null;for(const t of this.#i.textTracks){const e=t[s.native]?.track;e?.oncuechange&&(e.oncuechange=null)}}}function y(r,t){return Array.from(r.children).find(e=>e.track===t)}class v{#t;#i;constructor(t,e){this.#t=t,this.#i=e,new p(t).add("enterpictureinpicture",this.#e.bind(this)).add("leavepictureinpicture",this.#r.bind(this))}get active(){return document.pictureInPictureElement===this.#t}get supported(){return u(this.#t)}async enter(){return this.#t.requestPictureInPicture()}exit(){return document.exitPictureInPicture()}#e(t){this.#s(!0,t)}#r(t){this.#s(!1,t)}#s=(t,e)=>{this.#i.notify("picture-in-picture-change",t,e)}}class M{#t;#i;#e="inline";get mode(){return this.#e}constructor(t,e){this.#t=t,this.#i=e,l(t,"webkitpresentationmodechanged",this.#r.bind(this))}get supported(){return h(this.#t)}async setPresentationMode(t){this.#e!==t&&this.#t.webkitSetPresentationMode(t)}#r(t){const e=this.#e;this.#e=this.#t.webkitPresentationMode,this.#i.player?.dispatch(new P("video-presentation-change",{detail:this.#e,trigger:t})),["fullscreen","picture-in-picture"].forEach(i=>{(this.#e===i||e===i)&&this.#i.notify(`${i}-change`,this.#e===i,t)})}}class w{#t;get active(){return this.#t.mode==="fullscreen"}get supported(){return this.#t.supported}constructor(t){this.#t=t}async enter(){this.#t.setPresentationMode("fullscreen")}async exit(){this.#t.setPresentationMode("inline")}}class E{#t;get active(){return this.#t.mode==="picture-in-picture"}get supported(){return this.#t.supported}constructor(t){this.#t=t}async enter(){this.#t.setPresentationMode("picture-in-picture")}async exit(){this.#t.setPresentationMode("inline")}}class I extends g{$$PROVIDER_TYPE="VIDEO";get type(){return"video"}airPlay;fullscreen;pictureInPicture;constructor(t,e){super(t,e),f(()=>{if(this.airPlay=new k(t,e),h(t)){const i=new M(t,e);this.fullscreen=new w(i),this.pictureInPicture=new E(i)}else u(t)&&(this.pictureInPicture=new v(t,e))},this.scope)}setup(){super.setup(),m(this.video)&&new T(this.video,this.ctx),this.ctx.textRenderers.attachVideo(this.video),o(()=>{this.ctx.textRenderers.attachVideo(null)}),this.type==="video"&&this.ctx.notify("provider-setup",this)}get video(){return this.media}}export{I as VideoProvider};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a4 as y,s as l,e as c,p as u,i as b,h as d,l as m,a as k}from"../chunks/vidstack-pFwe7gvT.js";import{Q as f}from"../chunks/vidstack-DRH_1tFW.js";import{T as o}from"../chunks/vidstack-C0nMUcD9.js";import{a as v}from"../chunks/vidstack-DIPX97sJ.js";import{L as r}from"../chunks/vidstack-C_AxqLKV.js";import{R as w}from"../chunks/vidstack-DiXE5sG8.js";import{p as P}from"../chunks/vidstack-C51SKMUl.js";import{E as T}from"../chunks/vidstack-BBMfnVvt.js";import{resolveVimeoVideoId as g,getVimeoVideoInfo as C}from"../chunks/vidstack-2f5gzOW6.js";import"../chunks/vidstack-Cu8FqSS9.js";const $=["bufferend","bufferstart","durationchange","ended","enterpictureinpicture","error","fullscreenchange","leavepictureinpicture","loaded","playProgress","loadProgress","pause","play","playbackratechange","qualitychange","seeked","seeking","timeupdate","volumechange","waiting"];class E extends T{$$PROVIDER_TYPE="VIMEO";scope=y();fullscreen;#e;#s=l("");#i=l(!1);#o=null;#c=null;#d=!1;#n=new o(0,0);#u=new w(this.#C.bind(this));#w=null;#r=null;#a=new Map;#l=null;constructor(e,t){super(e),this.#e=t;const s=this;this.fullscreen={get active(){return s.#d},supported:!0,enter:()=>this.#t("requestFullscreen"),exit:()=>this.#t("exitFullscreen")}}cookies=!1;title=!0;byline=!0;portrait=!0;color="00ADEF";get type(){return"vimeo"}get currentSrc(){return this.#c}get videoId(){return this.#s()}get hash(){return this.#o}get isPro(){return this.#i()}preconnect(){P(this.getOrigin())}setup(){super.setup(),c(this.#P.bind(this)),c(this.#T.bind(this)),c(this.#g.bind(this)),this.#e.notify("provider-setup",this)}destroy(){this.#k(),this.fullscreen=void 0;const e="provider destroyed";for(const t of this.#a.values())for(const{reject:s}of t)s(e);this.#a.clear(),this.#t("destroy")}async play(){return this.#t("play")}async pause(){return this.#t("pause")}setMuted(e){this.#t("setMuted",e)}setCurrentTime(e){this.#t("seekTo",e),this.#e.notify("seeking",e)}setVolume(e){this.#t("setVolume",e),this.#t("setMuted",u(this.#e.$state.muted))}setPlaybackRate(e){this.#t("setPlaybackRate",e)}async loadSource(e){if(!b(e.src)){this.#c=null,this.#o=null,this.#s.set("");return}const{videoId:t,hash:s}=g(e.src);this.#s.set(t??""),this.#o=s??null,this.#c=e}#P(){this.#k();const e=this.#s();if(!e){this.src.set("");return}this.src.set(`${this.getOrigin()}/video/${e}`),this.#e.notify("load-start")}#T(){const e=this.#s();if(!e)return;const t=d(),s=new AbortController;return this.#l=t,C(e,s,this.#o).then(i=>{t.resolve(i)}).catch(i=>{t.reject()}),()=>{t.reject(),s.abort()}}#g(){const e=this.#i(),{$state:t,qualities:s}=this.#e;if(t.canSetPlaybackRate.set(e),s[r.setReadonly](!e),e)return m(s,"change",()=>{if(s.auto)return;const i=s.selected?.id;i&&this.#t("setQuality",i)})}getOrigin(){return"https://player.vimeo.com"}buildParams(){const{keyDisabled:e}=this.#e.$props,{playsInline:t,nativeControls:s}=this.#e.$state,i=s();return{title:this.title,byline:this.byline,color:this.color,portrait:this.portrait,controls:i,h:this.hash,keyboard:i&&!e(),transparent:!0,playsinline:t(),dnt:!this.cookies}}#C(){this.#t("getCurrentTime")}#h=!1;#$(e,t){if(this.#h&&e===0)return;const{realCurrentTime:s,paused:i,bufferedEnd:n,seekableEnd:a,live:h}=this.#e.$state;if(s()===e)return;const p=s();this.#e.notify("time-change",e,t),Math.abs(p-e)>1.5&&(this.#e.notify("seeking",e,t),!i()&&n()<e&&this.#e.notify("waiting",void 0,t)),!h()&&a()-e<.01&&(this.#e.notify("end",void 0,t),this.#h=!0,setTimeout(()=>{this.#h=!1},500))}#E(e,t){this.#e.notify("seeked",e,t)}#V(e){const t=this.#s();this.#l?.promise.then(s=>{if(!s)return;const{title:i,poster:n,duration:a,pro:h}=s;this.#i.set(h),this.#e.notify("title-change",i,e),this.#e.notify("poster-change",n,e),this.#e.notify("duration-change",a,e),this.#f(a,e)}).catch(()=>{t===this.#s()&&(this.#t("getVideoTitle"),this.#t("getDuration"))})}#f(e,t){const{nativeControls:s}=this.#e.$state,i=s();this.#n=new o(0,e);const n={buffered:new o(0,0),seekable:this.#n,duration:e};this.#e.delegate.ready(n,t),i||this.#t("_hideOverlay"),this.#t("getQualities"),this.#t("getChapters")}#I(e,t,s){switch(e){case"getVideoTitle":const i=t;this.#e.notify("title-change",i,s);break;case"getDuration":const n=t;this.#e.$state.canPlay()?this.#e.notify("duration-change",n,s):this.#f(n,s);break;case"getCurrentTime":this.#$(t,s);break;case"getBuffered":k(t)&&t.length&&this.#p(t[t.length-1][1],s);break;case"setMuted":case"getMuted":this.#y(u(this.#e.$state.volume),t,s);break;case"getChapters":this.#L(t);break;case"getQualities":this.#F(t,s);break}this.#v(e)?.resolve()}#R(){for(const e of $)this.#t("addEventListener",e)}#M(e){this.#u.stop(),this.#e.notify("pause",void 0,e)}async#A(e){this.#u.start(),await this.#t("getMuted"),this.#e.notify("play",void 0,e)}#S(e){const{paused:t}=this.#e.$state;!t()&&!this.#h&&this.#e.notify("playing",void 0,e)}#p(e,t){const s={buffered:new o(0,e),seekable:this.#n};this.#e.notify("progress",s,t)}#q(e){this.#e.notify("waiting",void 0,e)}#x(e){const{paused:t}=this.#e.$state;t()||this.#e.notify("playing",void 0,e)}async#Q(e){const{paused:t}=this.#e.$state;t()&&(await this.#t("getMuted"),this.#e.notify("play",void 0,e)),this.#e.notify("waiting",void 0,e)}#y(e,t,s){const i={volume:e,muted:t};this.#e.notify("volume-change",i,s)}#L(e){if(this.#b(),!e.length)return;const t=new v({kind:"chapters",default:!0}),{seekableEnd:s}=this.#e.$state;for(let i=0;i<e.length;i++){const n=e[i],a=e[i+1];t.addCue(new window.VTTCue(n.startTime,a?.startTime??s(),n.title))}this.#r=t,this.#e.textTracks.add(t)}#b(){this.#r&&(this.#e.textTracks.remove(this.#r),this.#r=null)}#F(e,t){this.#e.qualities[f.enableAuto]=e.some(s=>s.id==="auto")?()=>this.#t("setQuality","auto"):void 0;for(const s of e){if(s.id==="auto")continue;const i=+s.id.slice(0,-1);isNaN(i)||this.#e.qualities[r.add]({id:s.id,width:i*(16/9),height:i,codec:"avc1,h.264",bitrate:-1},t)}this.#m(e.find(s=>s.active),t)}#m({id:e}={},t){if(!e)return;const s=e==="auto",i=this.#e.qualities.getById(e);s?(this.#e.qualities[f.setAuto](s,t),this.#e.qualities[r.select](void 0,!0,t)):this.#e.qualities[r.select](i??void 0,!0,t)}#O(e,t,s){switch(e){case"ready":this.#R();break;case"loaded":this.#V(s);break;case"play":this.#A(s);break;case"playProgress":this.#S(s);break;case"pause":this.#M(s);break;case"loadProgress":this.#p(t.seconds,s);break;case"waiting":this.#Q(s);break;case"bufferstart":this.#q(s);break;case"bufferend":this.#x(s);break;case"volumechange":this.#y(t.volume,u(this.#e.$state.muted),s);break;case"durationchange":this.#n=new o(0,t.duration),this.#e.notify("duration-change",t.duration,s);break;case"playbackratechange":this.#e.notify("rate-change",t.playbackRate,s);break;case"qualitychange":this.#m(t,s);break;case"fullscreenchange":this.#d=t.fullscreen,this.#e.notify("fullscreen-change",t.fullscreen,s);break;case"enterpictureinpicture":this.#e.notify("picture-in-picture-change",!0,s);break;case"leavepictureinpicture":this.#e.notify("picture-in-picture-change",!1,s);break;case"ended":this.#e.notify("end",void 0,s);break;case"error":this.#D(t,s);break;case"seek":case"seeked":this.#E(t.seconds,s);break}}#D(e,t){const{message:s,method:i}=e;i==="setPlaybackRate"&&this.#i.set(!1),i&&this.#v(i)?.reject(s)}onMessage(e,t){e.event?this.#O(e.event,e.data,t):e.method&&this.#I(e.method,e.value,t)}onLoad(){}async#t(e,t){let s=d(),i=this.#a.get(e);return i||this.#a.set(e,i=[]),i.push(s),this.postMessage({method:e,value:t}),s.promise}#k(){this.#u.stop(),this.#n=new o(0,0),this.#l=null,this.#w=null,this.#i.set(!1),this.#b()}#v(e){return this.#a.get(e)?.shift()}}export{E as VimeoProvider};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a4 as p,s as y,e as m,i as f,h as g,a5 as b,H as d,$ as k}from"../chunks/vidstack-pFwe7gvT.js";import{T as u}from"../chunks/vidstack-C0nMUcD9.js";import{p as v}from"../chunks/vidstack-C51SKMUl.js";import{E as P}from"../chunks/vidstack-BBMfnVvt.js";import{resolveYouTubeVideoId as w}from"../chunks/vidstack-DiNS2Vx5.js";import"../chunks/vidstack-Cu8FqSS9.js";const r={Ended:0,Playing:1,Paused:2,Buffering:3,Cued:5};class T extends P{$$PROVIDER_TYPE="YOUTUBE";scope=p();#e;#a=y("");#o=-1;#d=null;#r=-1;#i=!1;#s=new Map;constructor(e,t){super(e),this.#e=t}language="en";color="red";cookies=!1;get currentSrc(){return this.#d}get type(){return"youtube"}get videoId(){return this.#a()}preconnect(){v(this.getOrigin())}setup(){super.setup(),m(this.#c.bind(this)),this.#e.notify("provider-setup",this)}destroy(){this.#l();const e="provider destroyed";for(const t of this.#s.values())for(const{reject:s}of t)s(e);this.#s.clear()}async play(){return this.#t("playVideo")}#k(e){this.#n("playVideo")?.reject(e)}async pause(){return this.#t("pauseVideo")}#v(e){this.#n("pauseVideo")?.reject(e)}setMuted(e){e?this.#t("mute"):this.#t("unMute")}setCurrentTime(e){this.#t("seekTo",[e,!0]),this.#e.notify("seeking",e)}setVolume(e){this.#t("setVolume",e*100)}setPlaybackRate(e){this.#t("setPlaybackRate",e)}async loadSource(e){if(!f(e.src)){this.#d=null,this.#a.set("");return}const t=w(e.src);this.#a.set(t??""),this.#d=e}getOrigin(){return this.cookies?"https://www.youtube.com":"https://www.youtube-nocookie.com"}#c(){this.#l();const e=this.#a();if(!e){this.src.set("");return}this.src.set(`${this.getOrigin()}/embed/${e}`),this.#e.notify("load-start")}buildParams(){const{keyDisabled:e}=this.#e.$props,{muted:t,playsInline:s,nativeControls:a}=this.#e.$state,i=a();return{rel:0,autoplay:0,cc_lang_pref:this.language,cc_load_policy:i?1:void 0,color:this.color,controls:i?1:0,disablekb:!i||e()?1:0,enablejsapi:1,fs:1,hl:this.language,iv_load_policy:i?1:3,mute:t()?1:0,playsinline:s()?1:0}}#t(e,t){let s=g(),a=this.#s.get(e);a||this.#s.set(e,a=[]),a.push(s);const i=Array.isArray(t)?t:t?[t]:void 0;return this.postMessage({event:"command",func:e,args:i}),s.promise}onLoad(){window.setTimeout(()=>this.postMessage({event:"listening"}),100)}#p(e){this.#e.notify("loaded-metadata"),this.#e.notify("loaded-data"),this.#e.delegate.ready(void 0,e)}#y(e){this.#n("pauseVideo")?.resolve(),this.#e.notify("pause",void 0,e)}#m(e,t){const{duration:s,realCurrentTime:a}=this.#e.$state,i=this.#o===r.Ended,o=i?s():e;this.#e.notify("time-change",o,t),!i&&Math.abs(o-a())>1&&this.#e.notify("seeking",o,t)}#u(e,t,s){const a={buffered:new u(0,e),seekable:t};this.#e.notify("progress",a,s);const{seeking:i,realCurrentTime:o}=this.#e.$state;i()&&e>o()&&this.#h(s)}#h(e){const{paused:t,realCurrentTime:s}=this.#e.$state;window.clearTimeout(this.#r),this.#r=window.setTimeout(()=>{this.#e.notify("seeked",s(),e),this.#r=-1},t()?100:0)}#f(e){const{seeking:t}=this.#e.$state;t()&&this.#h(e),this.#e.notify("pause",void 0,e),this.#e.notify("end",void 0,e)}#g(e,t){const{paused:s,seeking:a}=this.#e.$state,i=e===r.Playing,o=e===r.Buffering,n=this.#b("playVideo"),h=s()&&(o||i);if(o&&this.#e.notify("waiting",void 0,t),a()&&i&&this.#h(t),this.#i&&i){this.pause(),this.#i=!1,this.setMuted(this.#e.$state.muted());return}if(!n&&h){this.#i=!0,this.setMuted(!0);return}switch(h&&(this.#n("playVideo")?.resolve(),this.#e.notify("play",void 0,t)),e){case r.Cued:this.#p(t);break;case r.Playing:this.#e.notify("playing",void 0,t);break;case r.Paused:this.#y(t);break;case r.Ended:this.#f(t);break}this.#o=e}onMessage({info:e},t){if(!e)return;const{title:s,intrinsicDuration:a,playbackRate:i}=this.#e.$state;if(b(e.videoData)&&e.videoData.title!==s()&&this.#e.notify("title-change",e.videoData.title,t),d(e.duration)&&e.duration!==a()){if(d(e.videoLoadedFraction)){const o=e.progressState?.loaded??e.videoLoadedFraction*e.duration,n=new u(0,e.duration);this.#u(o,n,t)}this.#e.notify("duration-change",e.duration,t)}if(d(e.playbackRate)&&e.playbackRate!==i()&&this.#e.notify("rate-change",e.playbackRate,t),e.progressState){const{current:o,seekableStart:n,seekableEnd:h,loaded:c,duration:l}=e.progressState;this.#m(o,t),this.#u(c,new u(n,h),t),l!==a()&&this.#e.notify("duration-change",l,t)}if(d(e.volume)&&k(e.muted)&&!this.#i){const o={muted:e.muted,volume:e.volume/100};this.#e.notify("volume-change",o,t)}d(e.playerState)&&e.playerState!==this.#o&&this.#g(e.playerState,t)}#l(){this.#o=-1,this.#r=-1,this.#i=!1}#n(e){return this.#s.get(e)?.shift()}#b(e){return!!this.#s.get(e)?.length}}export{T as YouTubeProvider};
|
package/cdn/vidstack.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunks/vidstack-
|
|
1
|
+
import"./chunks/vidstack-BkxGdzTJ.js";import"https://cdn.vidstack.io/icons";import"./chunks/vidstack-pFwe7gvT.js";import"./chunks/vidstack-Cu8FqSS9.js";import"./chunks/vidstack-C0nMUcD9.js";import"./chunks/vidstack-DIPX97sJ.js";import"./chunks/vidstack-C51SKMUl.js";import"./chunks/vidstack-C_AxqLKV.js";import"./chunks/vidstack-DRH_1tFW.js";import"./chunks/vidstack-BfBBPhXV.js";import"./chunks/vidstack-CL95Hezv.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as e,l as r,e as a,p as o,i as n}from"./vidstack-Dy1Hfo7P.js";import{b as c}from"./vidstack-CROJF16Z.js";class h{#t;src=e("");referrerPolicy=null;get iframe(){return this.#t}constructor(t){this.#t=t,t.setAttribute("frameBorder","0"),t.setAttribute("aria-hidden","true"),t.setAttribute("allow","autoplay; fullscreen; encrypted-media; picture-in-picture; accelerometer; gyroscope"),this.referrerPolicy!==null&&t.setAttribute("referrerpolicy",this.referrerPolicy)}setup(){r(window,"message",this.#i.bind(this)),r(this.#t,"load",this.onLoad.bind(this)),a(this.#s.bind(this))}#s(){const t=this.src();if(!t.length){this.#t.setAttribute("src","");return}const s=o(()=>this.buildParams());this.#t.setAttribute("src",c(t,s))}postMessage(t,s){this.#t.contentWindow?.postMessage(JSON.stringify(t),s??"*")}#i(t){const s=this.getOrigin();if((t.source===null||t.source===this.#t?.contentWindow)&&(!n(s)||s===t.origin)){try{const i=JSON.parse(t.data);i&&this.onMessage(i,t);return}catch{}t.data&&this.onMessage(t.data,t)}}}export{h as E};
|