@glitchlab/vue-video-player 1.3.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,2 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),R=require("hls.js");function Q(n,a,r){const t=n==null?void 0:n.trim();if(t)return t;if(a){try{const p=new Intl.DisplayNames(void 0,{type:"language"}).of(a);if(p&&p!==a)return p}catch{}return a}return`Audio ${r+1}`}const ce=["muted","loop","controls","autoplay","playsinline","preload","poster"],te=e.defineComponent({__name:"HLSPlayer",props:{src:{},hlsConfig:{},isHls:{type:Boolean},muted:{type:Boolean,default:!0},loop:{type:Boolean,default:!1},controls:{type:Boolean,default:!1},autoPlay:{type:Boolean,default:!1},playsInline:{type:Boolean,default:!0},preload:{default:"metadata"},poster:{},class:{},audioTrackIndex:{default:-1}},emits:["play","pause","audio-tracks"],setup(n,{expose:a,emit:r}){const t=n,l=r,p=e.ref(null),f=e.ref(null);let d,b;const B=globalThis.window!==void 0&&R.isSupported(),C=s=>!!t.isHls||B&&s.endsWith(".m3u8");function y(){b==null||b(),b=void 0,d==null||d(),d=void 0,f.value&&(f.value.destroy(),f.value=null);const s=p.value;if(s){for(s.pause(),s.removeAttribute("src");s.firstChild;)s.firstChild.remove();s.load(),l("audio-tracks",[])}}function k(s){var M,V,L;const g=p.value;if(!g||!s)return;y();const E=()=>{t.autoPlay&&g.play().catch(()=>{})};if(C(s)){const h=new R(t.hlsConfig);f.value=h;const x=()=>{const P=h.audioTracks.map((N,S)=>({index:S,label:Q(N.name,N.lang,S),lang:N.lang||void 0}));l("audio-tracks",P)};h.on(R.Events.MANIFEST_PARSED,E),h.on(R.Events.AUDIO_TRACKS_UPDATED,x),h.on(R.Events.AUDIO_TRACK_SWITCHED,x),h.on(R.Events.ERROR,(P,N)=>{N.fatal&&(h.destroy(),f.value=null)}),h.attachMedia(g),h.loadSource(s)}else{g.src=s,g.load(),g.addEventListener("loadedmetadata",E,{once:!0}),b=()=>{g.removeEventListener("loadedmetadata",E)};const h=g.audioTracks;if(h){const x=()=>{const P=[];for(let N=0;N<h.length;N++){const S=h[N];P.push({index:N,label:Q(S.label,S.language,N),lang:S.language||void 0})}l("audio-tracks",P)};(M=h.addEventListener)==null||M.call(h,"addtrack",x),(V=h.addEventListener)==null||V.call(h,"removetrack",x),(L=h.addEventListener)==null||L.call(h,"change",x),h.length>0&&x(),d=()=>{var P,N,S;(P=h.removeEventListener)==null||P.call(h,"addtrack",x),(N=h.removeEventListener)==null||N.call(h,"removetrack",x),(S=h.removeEventListener)==null||S.call(h,"change",x)}}}}function m(s){var M;if(s==null||s<0)return;const g=f.value;if(g){g.audioTrack!==s&&(g.audioTrack=s);return}const E=(M=p.value)==null?void 0:M.audioTracks;if(E)for(let V=0;V<E.length;V++)E[V].enabled=V===s}return e.onMounted(()=>{t.src&&k(t.src)}),e.watch(()=>t.src,s=>{s&&k(s)}),e.watch(()=>t.audioTrackIndex,s=>m(s)),e.onBeforeUnmount(y),a({videoEl:p}),(s,g)=>(e.openBlock(),e.createElementBlock("video",{ref_key:"videoEl",ref:p,muted:n.muted,loop:n.loop,controls:n.controls,autoplay:n.autoPlay,playsinline:n.playsInline,preload:n.preload,poster:n.poster,class:e.normalizeClass(t.class),onPlay:g[0]||(g[0]=E=>l("play")),onPause:g[1]||(g[1]=E=>l("pause"))},[e.renderSlot(s.$slots,"default")],42,ce))}}),ue={name:"IconAudio"},de=e.defineComponent({...ue,props:{class:{}},setup(n){const a=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M3 14V10C3 9.44772 3.44772 9 4 9H6.58579C6.851 9 7.10536 8.89464 7.29289 8.70711L11.2929 4.70711C11.9229 4.07714 13 4.52331 13 5.41421V18.5858C13 19.4767 11.9229 19.9229 11.2929 19.2929L7.29289 15.2929C7.10536 15.1054 6.851 15 6.58579 15H4C3.44772 15 3 14.5523 3 14Z",stroke:"currentColor","stroke-width":"1.5","stroke-linejoin":"round"},null,-1),e.createElementVNode("path",{d:"M16.5 8C17.5 9 18 10.5 18 12C18 13.5 17.5 15 16.5 16M19 5.5C20.5 7 21.5 9.5 21.5 12C21.5 14.5 20.5 17 19 18.5",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])],2))}}),ve={name:"IconChevron"},ne=e.defineComponent({...ve,props:{class:{}},setup(n){const a=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M6 9L12 15L18 9",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],2))}}),pe=["aria-expanded"],me={class:"gvp-audio-label"},fe={key:0,class:"gvp-audio-menu",role:"listbox","aria-label":"Audio tracks"},ke=["aria-selected","onClick"],he=e.defineComponent({__name:"AudioTrackSwitcher",props:{tracks:{},activeIndex:{}},emits:["select"],setup(n,{emit:a}){const r=n,t=a,l=e.ref(!1),p=e.ref(null),f=e.computed(()=>r.tracks.find(C=>C.index===r.activeIndex)??r.tracks[0]);function d(C){p.value&&!p.value.contains(C.target)&&(l.value=!1)}function b(C){C.key==="Escape"&&(l.value=!1)}e.watch(l,C=>{C?(document.addEventListener("mousedown",d),document.addEventListener("keydown",b)):(document.removeEventListener("mousedown",d),document.removeEventListener("keydown",b))}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",d),document.removeEventListener("keydown",b)});function B(C){t("select",C),l.value=!1}return(C,y)=>{var k;return e.openBlock(),e.createElementBlock("div",{ref_key:"rootEl",ref:p,class:"gvp-audio"},[e.createElementVNode("button",{type:"button",class:"gvp-audio-btn","aria-haspopup":"listbox","aria-expanded":l.value,"aria-label":"Audio track",onClick:y[0]||(y[0]=m=>l.value=!l.value)},[e.createVNode(de),e.createElementVNode("span",me,e.toDisplayString((k=f.value)==null?void 0:k.label),1),e.createVNode(ne)],8,pe),l.value?(e.openBlock(),e.createElementBlock("ul",fe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.tracks,m=>(e.openBlock(),e.createElementBlock("li",{key:m.index},[e.createElementVNode("button",{type:"button",role:"option","aria-selected":m.index===n.activeIndex,class:e.normalizeClass(["gvp-audio-menu-item",{"is-active":m.index===n.activeIndex}]),onClick:s=>B(m.index)},e.toDisplayString(m.label),11,ke)]))),128))])):e.createCommentVNode("",!0)],512)}}}),ge={name:"IconSpeed"},oe=e.defineComponent({...ge,props:{class:{}},setup(n){const a=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2Z",stroke:"currentColor","stroke-width":"1.5"},null,-1),e.createElementVNode("path",{d:"M12 8V12L14.5 14.5",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],2))}}),Ce=["aria-expanded"],ye={class:"gvp-speed-label"},Ee={key:0,class:"gvp-speed-menu",role:"listbox","aria-label":"Playback speed"},we=["aria-selected","onClick"],be=e.defineComponent({__name:"SpeedSwitcher",props:{speed:{}},emits:["select"],setup(n,{emit:a}){const r=[.5,.75,1,1.25,1.5,2],t=a,l=e.ref(!1),p=e.ref(null);function f(B){p.value&&!p.value.contains(B.target)&&(l.value=!1)}function d(B){B.key==="Escape"&&(l.value=!1)}e.watch(l,B=>{B?(document.addEventListener("mousedown",f),document.addEventListener("keydown",d)):(document.removeEventListener("mousedown",f),document.removeEventListener("keydown",d))}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",f),document.removeEventListener("keydown",d)});function b(B){t("select",B),l.value=!1}return(B,C)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rootEl",ref:p,class:"gvp-speed"},[e.createElementVNode("button",{type:"button",class:"gvp-speed-btn","aria-haspopup":"listbox","aria-expanded":l.value,"aria-label":"`Playback speed: ${speed === 1 ? '1×' : speed + '×'}`",onClick:C[0]||(C[0]=y=>l.value=!l.value)},[e.createVNode(oe),e.createElementVNode("span",ye,e.toDisplayString(n.speed===1?"1×":`${n.speed}×`),1),e.createVNode(ne)],8,Ce),l.value?(e.openBlock(),e.createElementBlock("ul",Ee,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(r,y=>e.createElementVNode("li",{key:y},[e.createElementVNode("button",{type:"button",role:"option","aria-selected":y===n.speed,class:e.normalizeClass(["gvp-speed-menu-item",{"is-active":y===n.speed}]),onClick:k=>b(y)},e.toDisplayString(y===1?"Normal":`${y}×`),11,we)])),64))])):e.createCommentVNode("",!0)],512))}}),Be={name:"IconCaptions"},le=e.defineComponent({...Be,props:{class:{}},setup(n){const a=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("rect",{x:"2",y:"5",width:"20",height:"14",rx:"3",stroke:"currentColor","stroke-width":"1.5"},null,-1),e.createElementVNode("path",{d:"M7 12H11M13 12H17M7 15H9M11 15H13M15 15H17",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])],2))}}),xe=["aria-expanded","aria-pressed"],_e={key:0,class:"gvp-captions-menu",role:"listbox","aria-label":"Captions"},Ve=["aria-selected"],Ne=["aria-selected","onClick"],$e=e.defineComponent({__name:"CaptionsSwitcher",props:{video:{}},setup(n){const a=n,r=e.ref([]),t=e.ref(-1),l=e.ref(!1),p=e.ref(null);function f(k){const m=[];for(let g=0;g<k.length;g++){const E=k[g];(E.kind==="subtitles"||E.kind==="captions")&&m.push({index:g,label:E.label||E.language||`Track ${g+1}`})}r.value=m;let s=-1;for(let g=0;g<k.length;g++)if(k[g].mode==="showing"){s=g;break}t.value=s}let d=null;e.watch(()=>a.video,k=>{if(d==null||d(),d=null,!k){r.value=[],t.value=-1;return}const m=k.textTracks;f(m);const s=()=>f(m);typeof m.addEventListener=="function"&&(m.addEventListener("addtrack",s),m.addEventListener("removetrack",s),m.addEventListener("change",s),d=()=>{m.removeEventListener("addtrack",s),m.removeEventListener("removetrack",s),m.removeEventListener("change",s)})},{immediate:!0}),e.onBeforeUnmount(()=>{d==null||d(),document.removeEventListener("mousedown",b),document.removeEventListener("keydown",B)});function b(k){p.value&&!p.value.contains(k.target)&&(l.value=!1)}function B(k){k.key==="Escape"&&(l.value=!1)}e.watch(l,k=>{k?(document.addEventListener("mousedown",b),document.addEventListener("keydown",B)):(document.removeEventListener("mousedown",b),document.removeEventListener("keydown",B))});function C(){if(!a.video)return;const k=a.video.textTracks;for(let m=0;m<k.length;m++)k[m].mode="hidden";t.value=-1,l.value=!1}function y(k){if(!a.video)return;const m=a.video.textTracks;for(let s=0;s<m.length;s++)m[s].mode=s===k?"showing":"hidden";t.value=k,l.value=!1}return(k,m)=>r.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"rootEl",ref:p,class:"gvp-captions"},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["gvp-captions-btn",{"is-active":t.value>=0}]),"aria-haspopup":"listbox","aria-expanded":l.value,"aria-pressed":t.value>=0,"aria-label":"Captions",onClick:m[0]||(m[0]=s=>l.value=!l.value)},[e.createVNode(le)],10,xe),l.value?(e.openBlock(),e.createElementBlock("ul",_e,[e.createElementVNode("li",null,[e.createElementVNode("button",{type:"button",role:"option","aria-selected":t.value===-1,class:e.normalizeClass(["gvp-captions-menu-item",{"is-active":t.value===-1}]),onClick:C}," Off ",10,Ve)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,s=>(e.openBlock(),e.createElementBlock("li",{key:s.index},[e.createElementVNode("button",{type:"button",role:"option","aria-selected":s.index===t.value,class:e.normalizeClass(["gvp-captions-menu-item",{"is-active":s.index===t.value}]),onClick:g=>y(s.index)},e.toDisplayString(s.label),11,Ne)]))),128))])):e.createCommentVNode("",!0)],512)):e.createCommentVNode("",!0)}}),Le={name:"IconPause"},Pe=e.defineComponent({...Le,props:{class:{}},setup(n){const a=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("rect",{x:"6",y:"5",width:"4",height:"14",rx:"1",fill:"currentColor"},null,-1),e.createElementVNode("rect",{x:"14",y:"5",width:"4",height:"14",rx:"1",fill:"currentColor"},null,-1)])],2))}}),Me={name:"IconPlaySolid"},Se=e.defineComponent({...Me,props:{class:{}},setup(n){const a=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M7 5.5V18.5C7 19.2659 7.84856 19.7261 8.4899 19.3071L19.0801 12.4014C19.6644 12.0204 19.6644 11.9796 19.0801 11.5986L8.4899 4.69288C7.84856 4.27388 7 4.73408 7 5.5Z",fill:"currentColor"},null,-1)])],2))}}),Te={name:"IconVolumeHigh"},Ie=e.defineComponent({...Te,props:{class:{}},setup(n){const a=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M3 14V10C3 9.44772 3.44772 9 4 9H6.58579C6.851 9 7.10536 8.89464 7.29289 8.70711L11.2929 4.70711C11.9229 4.07714 13 4.52331 13 5.41421V18.5858C13 19.4767 11.9229 19.9229 11.2929 19.2929L7.29289 15.2929C7.10536 15.1054 6.851 15 6.58579 15H4C3.44772 15 3 14.5523 3 14Z",stroke:"currentColor","stroke-width":"1.5","stroke-linejoin":"round"},null,-1),e.createElementVNode("path",{d:"M16.5 8C17.5 9 18 10.5 18 12C18 13.5 17.5 15 16.5 16M19 5.5C20.5 7 21.5 9.5 21.5 12C21.5 14.5 20.5 17 19 18.5",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])],2))}}),He={name:"IconVolumeLow"},ze=e.defineComponent({...He,props:{class:{}},setup(n){const a=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M3 14V10C3 9.44772 3.44772 9 4 9H6.58579C6.851 9 7.10536 8.89464 7.29289 8.70711L11.2929 4.70711C11.9229 4.07714 13 4.52331 13 5.41421V18.5858C13 19.4767 11.9229 19.9229 11.2929 19.2929L7.29289 15.2929C7.10536 15.1054 6.851 15 6.58579 15H4C3.44772 15 3 14.5523 3 14Z",stroke:"currentColor","stroke-width":"1.5","stroke-linejoin":"round"},null,-1),e.createElementVNode("path",{d:"M16.5 8C17.5 9 18 10.5 18 12C18 13.5 17.5 15 16.5 16",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])],2))}}),De={name:"IconVolumeMuted"},Ae=e.defineComponent({...De,props:{class:{}},setup(n){const a=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M3 14V10C3 9.44772 3.44772 9 4 9H6.58579C6.851 9 7.10536 8.89464 7.29289 8.70711L11.2929 4.70711C11.9229 4.07714 13 4.52331 13 5.41421V18.5858C13 19.4767 11.9229 19.9229 11.2929 19.2929L7.29289 15.2929C7.10536 15.1054 6.851 15 6.58579 15H4C3.44772 15 3 14.5523 3 14Z",stroke:"currentColor","stroke-width":"1.5","stroke-linejoin":"round"},null,-1),e.createElementVNode("path",{d:"M16 9L22 15M22 9L16 15",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])],2))}}),Fe={name:"IconPiP"},ae=e.defineComponent({...Fe,props:{class:{}},setup(n){const a=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",stroke:"currentColor","stroke-width":"1.5"},null,-1),e.createElementVNode("rect",{x:"12",y:"12",width:"8",height:"5",rx:"1",fill:"currentColor"},null,-1)])],2))}}),Re={name:"IconFullscreen"},Ue=e.defineComponent({...Re,props:{class:{}},setup(n){const a=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M4 9V4H9M15 4H20V9M20 15V20H15M9 20H4V15",stroke:"currentColor","stroke-width":"1.75","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],2))}}),Oe={name:"IconFullscreenExit"},je=e.defineComponent({...Oe,props:{class:{}},setup(n){const a=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M9 4V9H4M15 9V4H20M15 20V15H20M9 15H4V20",stroke:"currentColor","stroke-width":"1.75","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],2))}});function ee(n){if(!Number.isFinite(n)||n<0)return"--:--";const a=Math.floor(n),r=Math.floor(a/3600),t=Math.floor(a%3600/60),p=(a%60).toString().padStart(2,"0");if(r>0){const f=t.toString().padStart(2,"0");return`${r}:${f}:${p}`}return`${t}:${p}`}const Ze={class:"gvp-controls-row"},qe=["aria-label","aria-pressed"],We={class:"gvp-seek"},Ye={class:"gvp-seek-track"},Ke=["value","disabled","aria-valuemax","aria-valuenow"],Je={class:"gvp-time","aria-live":"off"},Xe=["aria-expanded","aria-label"],Ge={class:"gvp-speed-label"},Qe={key:0,class:"gvp-speed-menu",role:"listbox","aria-label":"Playback speed"},et=["aria-selected","onClick"],tt=["aria-expanded","aria-pressed"],nt={key:0,class:"gvp-captions-menu",role:"listbox","aria-label":"Captions"},ot=["aria-selected"],lt=["aria-selected","onClick"],at=["aria-label","aria-pressed"],rt={key:0,class:"gvp-volume-slider-wrap"},st={class:"gvp-volume-track"},it=["value","aria-valuenow"],ct=["aria-label","aria-pressed"],ut=["aria-label","aria-pressed"],dt=3e3,vt=e.defineComponent({__name:"ControlBar",props:{video:{},isPlaying:{type:Boolean},container:{},onTogglePlay:{type:Function}},setup(n){const a=(()=>{if(typeof navigator>"u")return!1;const o=navigator.userAgent;return/iPad|iPhone|iPod/.test(o)||o.includes("Mac")&&navigator.maxTouchPoints>1})(),r=typeof navigator>"u"?!1:/iPhone|iPod/.test(navigator.userAgent),t=[.5,.75,1,1.25,1.5,2],l=n,p=e.ref(!0);let f=null;function d(){f!==null&&(clearTimeout(f),f=null)}function b(){d(),l.isPlaying&&(f=setTimeout(()=>{p.value=!1},dt))}function B(){p.value=!0,b()}e.watch(()=>l.isPlaying,o=>{o?b():(d(),p.value=!0)},{immediate:!0}),e.watch(()=>l.container,o=>{if(!o)return;const i=()=>B();o.addEventListener("mousemove",i),o.addEventListener("touchstart",i),o.addEventListener("focusin",i)},{immediate:!0});const C=e.ref(0),y=e.ref(0),k=e.ref(0);e.watch(()=>l.video,o=>{if(!o)return;const i=()=>{C.value=o.currentTime},v=()=>{y.value=Number.isFinite(o.duration)?o.duration:0},w=()=>{const $=o.buffered;if(!$||$.length===0){k.value=0;return}let G=$.end($.length-1);for(let O=0;O<$.length;O++)if($.start(O)<=o.currentTime&&o.currentTime<=$.end(O)){G=$.end(O);break}k.value=G};i(),v(),w(),o.addEventListener("timeupdate",i),o.addEventListener("durationchange",v),o.addEventListener("loadedmetadata",v),o.addEventListener("progress",w),o.addEventListener("timeupdate",w)},{immediate:!0});const m=()=>y.value>0,s=()=>m()?C.value/y.value*100:0,g=()=>m()?k.value/y.value*100:0;function E(o){const i=l.video;if(!i||!m())return;const v=Number(o.target.value)/100*y.value;i.currentTime=v,C.value=v}const M=e.ref(1),V=e.ref(!1);e.watch(()=>l.video,o=>{if(!o)return;const i=()=>{M.value=o.volume,V.value=o.muted};i(),o.addEventListener("volumechange",i)},{immediate:!0});function L(){l.video&&(l.video.muted=!l.video.muted)}function h(o){const i=l.video;if(!i)return;const v=Number(o.target.value)/100;i.volume=v,v>0&&i.muted&&(i.muted=!1)}const x=e.ref(1),P=e.ref(!1),N=e.ref(null);e.watch(()=>l.video,o=>{if(!o)return;const i=()=>{x.value=o.playbackRate};i(),o.addEventListener("ratechange",i)},{immediate:!0});function S(o){l.video&&(l.video.playbackRate=o),x.value=o,P.value=!1}const A=e.ref([]),_=e.ref(-1),I=e.ref(!1),U=e.ref(null);function j(o){const i=[];for(let w=0;w<o.length;w++){const $=o[w];($.kind==="subtitles"||$.kind==="captions")&&i.push({index:w,label:$.label||$.language||`Track ${w+1}`})}A.value=i;let v=-1;for(let w=0;w<o.length;w++)if(o[w].mode==="showing"){v=w;break}_.value=v}e.watch(()=>l.video,o=>{if(!o){A.value=[],_.value=-1;return}const i=o.textTracks;j(i);const v=()=>j(i);typeof i.addEventListener=="function"&&(i.addEventListener("addtrack",v),i.addEventListener("removetrack",v),i.addEventListener("change",v))},{immediate:!0});function K(o){var v;const i=(v=l.video)==null?void 0:v.textTracks;if(i){for(let w=0;w<i.length;w++)i[w].mode=w===o?"showing":"hidden";_.value=o,I.value=!1}}function F(){var i;const o=(i=l.video)==null?void 0:i.textTracks;if(o){for(let v=0;v<o.length;v++)o[v].mode="hidden";_.value=-1,I.value=!1}}const z=e.ref(!1),J=typeof document<"u"&&!!document.pictureInPictureEnabled;e.watch(()=>l.video,o=>{o&&(o.addEventListener("enterpictureinpicture",()=>{z.value=!0}),o.addEventListener("leavepictureinpicture",()=>{z.value=!1}))},{immediate:!0});function X(){l.video&&(document.pictureInPictureElement?document.exitPictureInPicture().catch(()=>{}):l.video.requestPictureInPicture().catch(()=>{}))}const H=e.ref(!1),Z=typeof document>"u"?!1:!!(document.fullscreenEnabled||document.webkitFullscreenEnabled);function u(){return document.fullscreenElement??document.webkitFullscreenElement??null}function c(o){const i=o.requestFullscreen??o.webkitRequestFullscreen;return i?i.call(o):Promise.reject(new Error("unsupported"))}function T(){const o=document.exitFullscreen??document.webkitExitFullscreen;return o?o.call(document):Promise.reject(new Error("unsupported"))}function D(){H.value=u()===l.container}e.onMounted(()=>{document.addEventListener("fullscreenchange",D),document.addEventListener("webkitfullscreenchange",D)}),e.onBeforeUnmount(()=>{d(),document.removeEventListener("fullscreenchange",D),document.removeEventListener("webkitfullscreenchange",D)});function q(){var o,i;if(r){(i=(o=l.video)==null?void 0:o.webkitEnterFullscreen)==null||i.call(o);return}H.value?T().catch(()=>{}):l.container&&c(l.container).catch(()=>{})}const W=Z||r&&l.video!==null&&typeof l.video.webkitEnterFullscreen=="function";function Y(o,i){function v($){i.value&&!i.value.contains($.target)&&(o.value=!1)}function w($){$.key==="Escape"&&(o.value=!1)}e.watch(o,$=>{$?(document.addEventListener("mousedown",v),document.addEventListener("keydown",w)):(document.removeEventListener("mousedown",v),document.removeEventListener("keydown",w))}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",v),document.removeEventListener("keydown",w)})}return Y(P,N),Y(I,U),(o,i)=>(e.openBlock(),e.createElementBlock("div",{role:"toolbar","aria-label":"Video controls",class:e.normalizeClass(["gvp-controls",!p.value&&"is-hidden"]),onMouseenter:d,onMouseleave:b},[e.createElementVNode("div",Ze,[e.createElementVNode("button",{type:"button",class:"gvp-ctrl-btn","aria-label":n.isPlaying?"Pause":"Play","aria-pressed":n.isPlaying,onClick:i[0]||(i[0]=(...v)=>n.onTogglePlay&&n.onTogglePlay(...v))},[n.isPlaying?(e.openBlock(),e.createBlock(Pe,{key:0})):(e.openBlock(),e.createBlock(Se,{key:1}))],8,qe),e.createElementVNode("div",We,[e.createElementVNode("div",Ye,[e.createElementVNode("div",{class:"gvp-seek-buffered",style:e.normalizeStyle({width:`${g()}%`})},null,4),e.createElementVNode("div",{class:"gvp-seek-progress",style:e.normalizeStyle({width:`${s()}%`})},null,4)]),e.createElementVNode("input",{type:"range",class:"gvp-seek-input",min:0,max:100,step:.1,value:s(),disabled:!m(),"aria-label":"Seek","aria-valuemin":0,"aria-valuemax":Math.floor(y.value),"aria-valuenow":Math.floor(C.value),onInput:E},null,40,Ke)]),e.createElementVNode("span",Je,e.toDisplayString(e.unref(ee)(C.value))+" / "+e.toDisplayString(e.unref(ee)(y.value)),1),e.createElementVNode("div",{ref_key:"speedRootEl",ref:N,class:"gvp-speed"},[e.createElementVNode("button",{type:"button",class:"gvp-ctrl-btn gvp-speed-btn","aria-haspopup":"listbox","aria-expanded":P.value,"aria-label":`Playback speed: ${x.value===1?"1×":x.value+"×"}`,onClick:i[1]||(i[1]=v=>P.value=!P.value)},[e.createVNode(oe),e.createElementVNode("span",Ge,e.toDisplayString(x.value===1?"1×":`${x.value}×`),1)],8,Xe),P.value?(e.openBlock(),e.createElementBlock("ul",Qe,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(t,v=>e.createElementVNode("li",{key:v},[e.createElementVNode("button",{type:"button",role:"option","aria-selected":v===x.value,class:e.normalizeClass(["gvp-speed-menu-item",{"is-active":v===x.value}]),onClick:w=>S(v)},e.toDisplayString(v===1?"Normal":`${v}×`),11,et)])),64))])):e.createCommentVNode("",!0)],512),A.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"captionsRootEl",ref:U,class:"gvp-captions"},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["gvp-ctrl-btn",_.value>=0&&"is-active"]),"aria-haspopup":"listbox","aria-expanded":I.value,"aria-label":"Captions","aria-pressed":_.value>=0,onClick:i[2]||(i[2]=v=>I.value=!I.value)},[e.createVNode(le)],10,tt),I.value?(e.openBlock(),e.createElementBlock("ul",nt,[e.createElementVNode("li",null,[e.createElementVNode("button",{type:"button",role:"option","aria-selected":_.value===-1,class:e.normalizeClass(["gvp-captions-menu-item",{"is-active":_.value===-1}]),onClick:F},"Off",10,ot)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(A.value,v=>(e.openBlock(),e.createElementBlock("li",{key:v.index},[e.createElementVNode("button",{type:"button",role:"option","aria-selected":v.index===_.value,class:e.normalizeClass(["gvp-captions-menu-item",{"is-active":v.index===_.value}]),onClick:w=>K(v.index)},e.toDisplayString(v.label),11,lt)]))),128))])):e.createCommentVNode("",!0)],512)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["gvp-volume",!e.unref(a)&&"is-expandable"])},[e.createElementVNode("button",{type:"button",class:"gvp-ctrl-btn","aria-label":V.value?"Unmute":"Mute","aria-pressed":V.value,onClick:L},[V.value||M.value===0?(e.openBlock(),e.createBlock(Ae,{key:0})):M.value<.5?(e.openBlock(),e.createBlock(ze,{key:1})):(e.openBlock(),e.createBlock(Ie,{key:2}))],8,at),e.unref(a)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",rt,[e.createElementVNode("div",st,[e.createElementVNode("div",{class:"gvp-volume-fill",style:e.normalizeStyle({width:`${V.value?0:Math.round(M.value*100)}%`})},null,4)]),e.createElementVNode("input",{type:"range",class:"gvp-volume-input",min:0,max:100,step:1,value:V.value?0:Math.round(M.value*100),"aria-label":"Volume","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":V.value?0:Math.round(M.value*100),onInput:h},null,40,it)]))],2),e.unref(J)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:e.normalizeClass(["gvp-ctrl-btn",z.value&&"is-active"]),"aria-label":z.value?"Exit picture-in-picture":"Picture-in-picture","aria-pressed":z.value,onClick:X},[e.createVNode(ae)],10,ct)):e.createCommentVNode("",!0),e.unref(W)?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:e.normalizeClass(["gvp-ctrl-btn",H.value&&"is-active"]),"aria-label":H.value?"Exit fullscreen":"Enter fullscreen","aria-pressed":H.value,onClick:q},[H.value?(e.openBlock(),e.createBlock(je,{key:0})):(e.openBlock(),e.createBlock(Ue,{key:1}))],10,ut)):e.createCommentVNode("",!0)])],34))}}),pt={name:"IconDesktop"},mt=e.defineComponent({...pt,props:{class:{}},setup(n){const a=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M14 2H10C6.72077 2 5.08116 2 3.91891 2.81382C3.48891 3.1149 3.1149 3.48891 2.81382 3.91891C2 5.08116 2 6.72077 2 10C2 13.2792 2 14.9188 2.81382 16.0811C3.1149 16.5111 3.48891 16.8851 3.91891 17.1862C5.08116 18 6.72077 18 10 18H14C17.2792 18 18.9188 18 20.0811 17.1862C20.5111 16.8851 20.8851 16.5111 21.1862 16.0811C22 14.9188 22 13.2792 22 10C22 6.72077 22 5.08116 21.1862 3.91891C20.8851 3.48891 20.5111 3.1149 20.0811 2.81382C18.9188 2 17.2792 2 14 2Z",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1),e.createElementVNode("path",{d:"M11 15H13",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),e.createElementVNode("path",{d:"M14.5 22L14.1845 21.5811C13.4733 20.6369 13.2969 19.1944 13.7468 18M9.5 22L9.8155 21.5811C10.5267 20.6369 10.7031 19.1944 10.2532 18",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1),e.createElementVNode("path",{d:"M7 22H17",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])],2))}}),ft={name:"IconMobile"},kt=e.defineComponent({...ft,props:{class:{}},setup(n){const a=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M5 9C5 5.70017 5 4.05025 6.02513 3.02513C7.05025 2 8.70017 2 12 2C15.2998 2 16.9497 2 17.9749 3.02513C19 4.05025 19 5.70017 19 9V15C19 18.2998 19 19.9497 17.9749 20.9749C16.9497 22 15.2998 22 12 22C8.70017 22 7.05025 22 6.02513 20.9749C5 19.9497 5 18.2998 5 15V9Z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},null,-1),e.createElementVNode("path",{d:"M11 19H13",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),e.createElementVNode("path",{d:"M9 2L9.089 2.53402C9.28188 3.69129 9.37832 4.26993 9.77519 4.62204C10.1892 4.98934 10.7761 5 12 5C13.2239 5 13.8108 4.98934 14.2248 4.62204C14.6217 4.26993 14.7181 3.69129 14.911 2.53402L15 2",stroke:"currentColor","stroke-width":"2","stroke-linejoin":"round"},null,-1)])],2))}}),ht={name:"IconPlay"},gt=e.defineComponent({...ht,props:{class:{}},setup(n){const a=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"22",height:"22",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M5.3335 11.45V4.54997C5.3335 4.36108 5.40016 4.20275 5.5335 4.07497C5.66683 3.94719 5.82238 3.8833 6.00016 3.8833C6.05572 3.8833 6.11405 3.89163 6.17516 3.9083C6.23627 3.92497 6.29461 3.94997 6.35016 3.9833L11.7835 7.4333C11.8835 7.49997 11.9585 7.5833 12.0085 7.6833C12.0585 7.7833 12.0835 7.88886 12.0835 7.99997C12.0835 8.11108 12.0585 8.21663 12.0085 8.31663C11.9585 8.41663 11.8835 8.49997 11.7835 8.56663L6.35016 12.0166C6.29461 12.05 6.23627 12.075 6.17516 12.0916C6.11405 12.1083 6.05572 12.1166 6.00016 12.1166C5.82238 12.1166 5.66683 12.0527 5.5335 11.925C5.40016 11.7972 5.3335 11.6389 5.3335 11.45Z",fill:"currentColor"},null,-1)])],2))}}),Ct={name:"IconX"},yt=e.defineComponent({...Ct,props:{class:{}},setup(n){const a=n;return(r,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M6.94994 5.53594L12.1929 0.292938C12.5834 -0.0975275 13.2165 -0.0975279 13.6069 0.292938C13.9974 0.683403 13.9974 1.31647 13.6069 1.70694L8.36394 6.94994L13.6069 12.1929C13.9974 12.5834 13.9974 13.2165 13.6069 13.6069C13.2165 13.9974 12.5834 13.9974 12.1929 13.6069L6.94994 8.36394L1.70694 13.6069C1.31647 13.9974 0.683403 13.9974 0.292938 13.6069C-0.0975279 13.2165 -0.0975277 12.5834 0.292938 12.1929L5.53594 6.94994L0.292938 1.70694C-0.0975279 1.31647 -0.0975279 0.683403 0.292938 0.292938C0.683403 -0.0975279 1.31647 -0.0975277 1.70694 0.292938L6.94994 5.53594Z",fill:"currentColor"},null,-1)])],2))}});function re(n){if(!n)return null;if(/^[A-Za-z0-9_-]{11}$/.test(n))return n;let a;try{a=new URL(n)}catch{return null}const r=a.hostname.replace(/^www\./,"");if(r==="youtu.be"){const t=a.pathname.slice(1).split("/")[0];return/^[A-Za-z0-9_-]{11}$/.test(t)?t:null}if(r==="youtube.com"||r==="m.youtube.com"||r==="music.youtube.com"||r==="youtube-nocookie.com"){const t=a.searchParams.get("v");if(t&&/^[A-Za-z0-9_-]{11}$/.test(t))return t;const l=/^\/(?:embed|shorts|v|live)\/([A-Za-z0-9_-]{11})/.exec(a.pathname);if(l)return l[1]}return null}function se(n){try{const a=new URL(n),r=a.searchParams.get("t")??a.searchParams.get("start");if(!r)return null;if(/^\d+s?$/.test(r))return Number.parseInt(r,10);const t=/^(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?$/.exec(r);if(t){const l=Number.parseInt(t[1]??"0",10),p=Number.parseInt(t[2]??"0",10),f=Number.parseInt(t[3]??"0",10),d=l*3600+p*60+f;return d>0?d:null}}catch{}return null}function ie(n,a={}){const{autoPlay:r=!1,muted:t=!0,loop:l=!1,controls:p=!0,startSeconds:f}=a,d=new URLSearchParams({rel:"0",modestbranding:"1",playsinline:"1",controls:p?"1":"0"});return r?(d.set("autoplay","1"),d.set("mute","1")):t&&d.set("mute","1"),l&&(d.set("loop","1"),d.set("playlist",n)),f&&f>0&&d.set("start",String(f)),`https://www.youtube-nocookie.com/embed/${n}?${d.toString()}`}const Et=["src"],wt={key:2,class:"gvp-vignette"},bt={key:3,class:"gvp-toggle"},Bt={class:"gvp-toggle-pill"},xt=["aria-pressed"],_t=["aria-pressed"],Vt=["aria-label","aria-pressed"],Nt=["aria-label"],$t={key:10,class:"gvp-play-wrap"},Lt={key:0,class:"gvp-tooltip",role:"tooltip"},Pt={key:12,class:"gvp-bottom-fade"},Mt=e.defineComponent({__name:"VideoPlayer",props:{src:{},poster:{},showDeviceToggle:{type:Boolean,default:!0},defaultDevice:{default:"desktop"},hoverPlay:{type:Boolean,default:!1},tooltipText:{},muted:{type:Boolean,default:!0},loop:{type:Boolean,default:!1},controls:{type:[Boolean,String],default:!0},autoPlay:{type:Boolean,default:!1},frameMaxWidth:{},aspectRatio:{},hlsConfig:{},isHls:{type:Boolean},class:{default:""},closable:{type:Boolean,default:!1}},emits:["close","play","pause"],setup(n,{emit:a}){const r=n,t=a,l=e.ref(null),p=e.ref(r.defaultDevice),f=e.ref(!1),d=e.ref(!1),b=e.ref(null),B=e.ref([]),C=e.ref(-1),y=e.ref(1),k=e.ref(!1),m=e.ref(!1),s=e.ref(null),g=typeof document<"u"&&!!document.pictureInPictureEnabled,E=e.computed(()=>r.controls===!0||r.controls==="custom"),M=e.computed(()=>r.controls==="native"),V=e.computed(()=>re(r.src)),L=e.computed(()=>V.value!==null),h=e.computed(()=>V.value?ie(V.value,{autoPlay:r.autoPlay,muted:r.muted,loop:r.loop,controls:E.value?!0:M.value,startSeconds:se(r.src)}):null);function x(u){B.value=u,C.value=-1}const P=e.computed(()=>!L.value&&B.value.length>1),N=e.computed(()=>{var u;return C.value>=0?C.value:((u=B.value[0])==null?void 0:u.index)??-1}),S=e.computed(()=>{var u,c;return p.value==="mobile"?((u=r.aspectRatio)==null?void 0:u.mobile)??"9/16":((c=r.aspectRatio)==null?void 0:c.desktop)??"16/9"}),A=e.computed(()=>{var u,c;return p.value==="mobile"?((u=r.frameMaxWidth)==null?void 0:u.mobile)??"420px":((c=r.frameMaxWidth)==null?void 0:c.desktop)??"960px"}),_=e.computed(()=>{var u;return((u=l.value)==null?void 0:u.videoEl)??null});async function I(){const u=_.value;if(u)try{u.readyState<2&&u.load();const c=u.play();b.value=c,await c,f.value=!0}catch{f.value=!1}finally{b.value=null}}async function U(){const u=_.value;if(u){if(b.value)try{await b.value}catch{}u.pause()}}async function j(){!r.hoverPlay||L.value||await I()}async function K(){!r.hoverPlay||L.value||(await U(),f.value=!1)}async function F(){const u=_.value;u&&(u.paused?await I():(await U(),f.value=!1))}function z(){d.value=!0,j()}function J(){d.value=!1,K()}function X(u){y.value=u;const c=_.value;c&&(c.playbackRate=u)}e.watch(_,u=>{u&&(u.addEventListener("ratechange",()=>{y.value=u.playbackRate}),u.addEventListener("enterpictureinpicture",()=>{k.value=!0}),u.addEventListener("leavepictureinpicture",()=>{k.value=!1}))});function H(){const u=_.value;u&&(document.pictureInPictureElement?document.exitPictureInPicture().catch(()=>{}):u.requestPictureInPicture().catch(()=>{}))}function Z(u){var D,q,W;const c=_.value;if(!(!c||!m.value&&!((D=s.value)!=null&&D.contains(document.activeElement))||u.target.tagName==="INPUT"&&u.key!==" "))switch(u.key){case" ":case"k":u.preventDefault(),F();break;case"ArrowLeft":u.preventDefault(),c.currentTime=Math.max(0,c.currentTime-5);break;case"ArrowRight":u.preventDefault(),c.currentTime=Math.min(c.duration||0,c.currentTime+5);break;case"ArrowUp":u.preventDefault(),c.volume=Math.min(1,c.volume+.1),c.muted&&(c.muted=!1);break;case"ArrowDown":u.preventDefault(),c.volume=Math.max(0,c.volume-.1);break;case"m":c.muted=!c.muted;break;case"f":{const Y=document.fullscreenElement??document.webkitFullscreenElement??null,o=((q=s.value)==null?void 0:q.requestFullscreen)??((W=s.value)==null?void 0:W.webkitRequestFullscreen),i=document.exitFullscreen??document.webkitExitFullscreen;Y===s.value?i==null||i.call(document).catch(()=>{}):o&&s.value&&o.call(s.value).catch(()=>{});break}case"p":g&&H();break}}return e.onMounted(()=>{document.addEventListener("keydown",Z)}),e.onBeforeUnmount(()=>{document.removeEventListener("keydown",Z)}),(u,c)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rootEl",ref:s,class:e.normalizeClass(["gvp-root",r.class]),style:e.normalizeStyle({width:A.value,aspectRatio:S.value}),onMouseenter:c[8]||(c[8]=T=>{m.value=!0,z()}),onMouseleave:c[9]||(c[9]=T=>{m.value=!1,J()})},[L.value?(e.openBlock(),e.createElementBlock("iframe",{key:0,class:"gvp-video gvp-youtube",src:h.value??void 0,title:"YouTube video player",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowfullscreen:"",referrerpolicy:"strict-origin-when-cross-origin"},null,8,Et)):(e.openBlock(),e.createBlock(te,{key:1,ref_key:"hlsPlayerRef",ref:l,controls:M.value,"hls-config":n.hlsConfig,"is-hls":n.isHls,loop:n.loop,muted:n.muted,"auto-play":n.autoPlay,"audio-track-index":C.value,"plays-inline":!0,poster:n.poster,src:n.src,class:"gvp-video",preload:"metadata",onAudioTracks:x,onPause:c[0]||(c[0]=T=>{f.value=!1,t("pause")}),onPlay:c[1]||(c[1]=T=>{f.value=!0,t("play")})},{default:e.withCtx(()=>[e.renderSlot(u.$slots,"default")]),_:3},8,["controls","hls-config","is-hls","loop","muted","auto-play","audio-track-index","poster","src"])),L.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",wt)),n.showDeviceToggle?(e.openBlock(),e.createElementBlock("div",bt,[e.createElementVNode("div",Bt,[e.createElementVNode("button",{"aria-pressed":p.value==="desktop",class:e.normalizeClass(["gvp-toggle-btn",{"is-active":p.value==="desktop"}]),"aria-label":"Desktop view",type:"button",onClick:c[2]||(c[2]=T=>p.value="desktop")},[e.createVNode(mt)],10,xt),c[10]||(c[10]=e.createElementVNode("div",{class:"gvp-toggle-divider"},null,-1)),e.createElementVNode("button",{"aria-pressed":p.value==="mobile",class:e.normalizeClass(["gvp-toggle-btn",{"is-active":p.value==="mobile"}]),"aria-label":"Mobile view",type:"button",onClick:c[3]||(c[3]=T=>p.value="mobile")},[e.createVNode(kt)],10,_t)])])):e.createCommentVNode("",!0),n.closable?(e.openBlock(),e.createElementBlock("button",{key:4,"aria-label":"Close",class:"gvp-close",type:"button",onClick:c[4]||(c[4]=T=>t("close"))},[e.createVNode(yt)])):e.createCommentVNode("",!0),P.value&&!E.value?(e.openBlock(),e.createBlock(he,{key:5,tracks:B.value,"active-index":N.value,onSelect:c[5]||(c[5]=T=>C.value=T)},null,8,["tracks","active-index"])):e.createCommentVNode("",!0),!L.value&&!E.value?(e.openBlock(),e.createBlock(be,{key:6,speed:y.value,onSelect:X},null,8,["speed"])):e.createCommentVNode("",!0),!L.value&&!E.value?(e.openBlock(),e.createBlock($e,{key:7,video:_.value},null,8,["video"])):e.createCommentVNode("",!0),!L.value&&e.unref(g)&&!E.value?(e.openBlock(),e.createElementBlock("button",{key:8,type:"button",class:e.normalizeClass(["gvp-pip-btn",{"is-active":k.value}]),"aria-label":k.value?"Exit picture-in-picture":"Picture-in-picture","aria-pressed":k.value,onClick:H},[e.createVNode(ae)],10,Vt)):e.createCommentVNode("",!0),!L.value&&E.value?(e.openBlock(),e.createElementBlock("button",{key:9,type:"button",class:"gvp-click-layer","aria-label":f.value?"Pause":"Play",onClick:F},null,8,Nt)):e.createCommentVNode("",!0),!L.value&&!E.value&&!f.value?(e.openBlock(),e.createElementBlock("div",$t,[e.createElementVNode("button",{"aria-label":"Play",class:"gvp-play",type:"button",onClick:F,onMouseenter:c[6]||(c[6]=T=>d.value=!0),onMouseleave:c[7]||(c[7]=T=>d.value=!1)},[e.createVNode(gt),n.tooltipText&&d.value?(e.openBlock(),e.createElementBlock("span",Lt,e.toDisplayString(n.tooltipText),1)):e.createCommentVNode("",!0)],32)])):e.createCommentVNode("",!0),!L.value&&E.value?(e.openBlock(),e.createBlock(vt,{key:11,video:_.value,"is-playing":f.value,container:s.value,"on-toggle-play":F},null,8,["video","is-playing","container"])):e.createCommentVNode("",!0),!L.value&&!E.value?(e.openBlock(),e.createElementBlock("div",Pt)):e.createCommentVNode("",!0)],38))}});exports.HLSPlayer=te;exports.VueVideoPlayer=Mt;exports.parseYouTubeId=re;exports.parseYouTubeStart=se;exports.youTubeEmbedUrl=ie;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),U=require("hls.js");function Ce(n,a,o){const t=n==null?void 0:n.trim();if(t)return t;if(a){try{const r=new Intl.DisplayNames(void 0,{type:"language"}).of(a);if(r&&r!==a)return r}catch{}return a}return`Audio ${o+1}`}const Se={index:-1,height:0,label:"Auto"};function Te(n,a){return n>0?`${n}p`:`Level ${a+1}`}const Ie=["muted","loop","controls","autoplay","playsinline","preload","poster"],be=e.defineComponent({__name:"HLSPlayer",props:{src:{},hlsConfig:{},isHls:{type:Boolean},muted:{type:Boolean,default:!0},loop:{type:Boolean,default:!1},controls:{type:Boolean,default:!1},autoPlay:{type:Boolean,default:!1},playsInline:{type:Boolean,default:!0},preload:{default:"metadata"},poster:{},class:{},audioTrackIndex:{default:-1},qualityLevelIndex:{default:-1}},emits:["play","pause","ended","audio-tracks","quality-levels","current-level"],setup(n,{expose:a,emit:o}){const t=n,u=o,r=e.ref(null),m=e.ref(null);let f,E;const w=globalThis.window!==void 0&&U.isSupported(),b=v=>!!t.isHls||w&&v.endsWith(".m3u8");function B(){E==null||E(),E=void 0,f==null||f(),f=void 0,m.value&&(m.value.destroy(),m.value=null);const v=r.value;if(v){for(v.pause(),v.removeAttribute("src");v.firstChild;)v.firstChild.remove();v.load(),u("audio-tracks",[]),u("quality-levels",[]),u("current-level",-1)}}function h(v){var D,V,q;const y=r.value;if(!y||!v)return;B();const _=()=>{t.autoPlay&&y.play().catch(()=>{})};if(b(v)){const k=new U(t.hlsConfig);m.value=k;const N=()=>{const L=k.audioTracks.map(($,T)=>({index:T,label:Ce($.name,$.lang,T),lang:$.lang||void 0}));u("audio-tracks",L)},M=()=>{const L=k.levels.map(($,T)=>({index:T,height:$.height||0,label:Te($.height||0,T)}));u("quality-levels",L)};k.on(U.Events.MANIFEST_PARSED,_),k.on(U.Events.MANIFEST_PARSED,M),k.on(U.Events.LEVELS_UPDATED,M),k.on(U.Events.LEVEL_SWITCHED,(L,$)=>{u("current-level",$.level)}),k.on(U.Events.AUDIO_TRACKS_UPDATED,N),k.on(U.Events.AUDIO_TRACK_SWITCHED,N),k.on(U.Events.ERROR,(L,$)=>{$.fatal&&(k.destroy(),m.value=null)}),k.attachMedia(y),k.loadSource(v)}else{y.src=v,y.load(),y.addEventListener("loadedmetadata",_,{once:!0}),E=()=>{y.removeEventListener("loadedmetadata",_)};const k=y.audioTracks;if(k){const N=()=>{const M=[];for(let L=0;L<k.length;L++){const $=k[L];M.push({index:L,label:Ce($.label,$.language,L),lang:$.language||void 0})}u("audio-tracks",M)};(D=k.addEventListener)==null||D.call(k,"addtrack",N),(V=k.addEventListener)==null||V.call(k,"removetrack",N),(q=k.addEventListener)==null||q.call(k,"change",N),k.length>0&&N(),f=()=>{var M,L,$;(M=k.removeEventListener)==null||M.call(k,"addtrack",N),(L=k.removeEventListener)==null||L.call(k,"removetrack",N),($=k.removeEventListener)==null||$.call(k,"change",N)}}}}function p(v){var D;if(v==null||v<0)return;const y=m.value;if(y){y.audioTrack!==v&&(y.audioTrack=v);return}const _=(D=r.value)==null?void 0:D.audioTracks;if(_)for(let V=0;V<_.length;V++)_[V].enabled=V===v}function g(v){if(v==null)return;const y=m.value;y&&y.currentLevel!==v&&(y.currentLevel=v)}return e.onMounted(()=>{t.src&&h(t.src)}),e.watch(()=>t.src,v=>{v&&h(v)}),e.watch(()=>t.audioTrackIndex,v=>p(v)),e.watch(()=>t.qualityLevelIndex,v=>g(v)),e.onBeforeUnmount(B),a({videoEl:r}),(v,y)=>(e.openBlock(),e.createElementBlock("video",{ref_key:"videoEl",ref:r,muted:n.muted,loop:n.loop,controls:n.controls,autoplay:n.autoPlay,playsinline:n.playsInline,preload:n.preload,poster:n.poster,class:e.normalizeClass(t.class),onPlay:y[0]||(y[0]=_=>u("play")),onPause:y[1]||(y[1]=_=>u("pause")),onEnded:y[2]||(y[2]=_=>u("ended"))},[e.renderSlot(v.$slots,"default")],42,Ie))}}),ze={name:"IconAudio"},Ae=e.defineComponent({...ze,props:{class:{}},setup(n){const a=n;return(o,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M3 14V10C3 9.44772 3.44772 9 4 9H6.58579C6.851 9 7.10536 8.89464 7.29289 8.70711L11.2929 4.70711C11.9229 4.07714 13 4.52331 13 5.41421V18.5858C13 19.4767 11.9229 19.9229 11.2929 19.2929L7.29289 15.2929C7.10536 15.1054 6.851 15 6.58579 15H4C3.44772 15 3 14.5523 3 14Z",stroke:"currentColor","stroke-width":"1.5","stroke-linejoin":"round"},null,-1),e.createElementVNode("path",{d:"M16.5 8C17.5 9 18 10.5 18 12C18 13.5 17.5 15 16.5 16M19 5.5C20.5 7 21.5 9.5 21.5 12C21.5 14.5 20.5 17 19 18.5",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])],2))}}),De={name:"IconChevron"},xe=e.defineComponent({...De,props:{class:{}},setup(n){const a=n;return(o,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M6 9L12 15L18 9",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],2))}}),He=["aria-expanded"],Fe={class:"gvp-audio-label"},qe={key:0,class:"gvp-audio-menu",role:"listbox","aria-label":"Audio tracks"},Re=["aria-selected","onClick"],Ue=e.defineComponent({__name:"AudioTrackSwitcher",props:{tracks:{},activeIndex:{}},emits:["select"],setup(n,{emit:a}){const o=n,t=a,u=e.ref(!1),r=e.ref(null),m=e.computed(()=>o.tracks.find(b=>b.index===o.activeIndex)??o.tracks[0]);function f(b){r.value&&!r.value.contains(b.target)&&(u.value=!1)}function E(b){b.key==="Escape"&&(u.value=!1)}e.watch(u,b=>{b?(document.addEventListener("mousedown",f),document.addEventListener("keydown",E)):(document.removeEventListener("mousedown",f),document.removeEventListener("keydown",E))}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",f),document.removeEventListener("keydown",E)});function w(b){t("select",b),u.value=!1}return(b,B)=>{var h;return e.openBlock(),e.createElementBlock("div",{ref_key:"rootEl",ref:r,class:"gvp-audio"},[e.createElementVNode("button",{type:"button",class:"gvp-audio-btn","aria-haspopup":"listbox","aria-expanded":u.value,"aria-label":"Audio track",onClick:B[0]||(B[0]=p=>u.value=!u.value)},[e.createVNode(Ae),e.createElementVNode("span",Fe,e.toDisplayString((h=m.value)==null?void 0:h.label),1),e.createVNode(xe)],8,He),u.value?(e.openBlock(),e.createElementBlock("ul",qe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.tracks,p=>(e.openBlock(),e.createElementBlock("li",{key:p.index},[e.createElementVNode("button",{type:"button",role:"option","aria-selected":p.index===n.activeIndex,class:e.normalizeClass(["gvp-audio-menu-item",{"is-active":p.index===n.activeIndex}]),onClick:g=>w(p.index)},e.toDisplayString(p.label),11,Re)]))),128))])):e.createCommentVNode("",!0)],512)}}}),Oe={name:"IconSpeed"},Be=e.defineComponent({...Oe,props:{class:{}},setup(n){const a=n;return(o,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2Z",stroke:"currentColor","stroke-width":"1.5"},null,-1),e.createElementVNode("path",{d:"M12 8V12L14.5 14.5",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],2))}}),je=["aria-expanded"],Ze={class:"gvp-speed-label"},Qe={key:0,class:"gvp-speed-menu",role:"listbox","aria-label":"Playback speed"},We=["aria-selected","onClick"],Ye=e.defineComponent({__name:"SpeedSwitcher",props:{speed:{}},emits:["select"],setup(n,{emit:a}){const o=[.5,.75,1,1.25,1.5,2],t=a,u=e.ref(!1),r=e.ref(null);function m(w){r.value&&!r.value.contains(w.target)&&(u.value=!1)}function f(w){w.key==="Escape"&&(u.value=!1)}e.watch(u,w=>{w?(document.addEventListener("mousedown",m),document.addEventListener("keydown",f)):(document.removeEventListener("mousedown",m),document.removeEventListener("keydown",f))}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",m),document.removeEventListener("keydown",f)});function E(w){t("select",w),u.value=!1}return(w,b)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rootEl",ref:r,class:"gvp-speed"},[e.createElementVNode("button",{type:"button",class:"gvp-speed-btn","aria-haspopup":"listbox","aria-expanded":u.value,"aria-label":"`Playback speed: ${speed === 1 ? '1×' : speed + '×'}`",onClick:b[0]||(b[0]=B=>u.value=!u.value)},[e.createVNode(Be),e.createElementVNode("span",Ze,e.toDisplayString(n.speed===1?"1×":`${n.speed}×`),1),e.createVNode(xe)],8,je),u.value?(e.openBlock(),e.createElementBlock("ul",Qe,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(o,B=>e.createElementVNode("li",{key:B},[e.createElementVNode("button",{type:"button",role:"option","aria-selected":B===n.speed,class:e.normalizeClass(["gvp-speed-menu-item",{"is-active":B===n.speed}]),onClick:h=>E(B)},e.toDisplayString(B===1?"Normal":`${B}×`),11,We)])),64))])):e.createCommentVNode("",!0)],512))}}),Ke={name:"IconCaptions"},Ne=e.defineComponent({...Ke,props:{class:{}},setup(n){const a=n;return(o,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("rect",{x:"2",y:"5",width:"20",height:"14",rx:"3",stroke:"currentColor","stroke-width":"1.5"},null,-1),e.createElementVNode("path",{d:"M7 12H11M13 12H17M7 15H9M11 15H13M15 15H17",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])],2))}}),Xe=["aria-expanded","aria-pressed"],Je={key:0,class:"gvp-captions-menu",role:"listbox","aria-label":"Captions"},Ge=["aria-selected"],et=["aria-selected","onClick"],tt=e.defineComponent({__name:"CaptionsSwitcher",props:{video:{}},setup(n){const a=n,o=e.ref([]),t=e.ref(-1),u=e.ref(!1),r=e.ref(null);function m(h){const p=[];for(let v=0;v<h.length;v++){const y=h[v];(y.kind==="subtitles"||y.kind==="captions")&&p.push({index:v,label:y.label||y.language||`Track ${v+1}`})}o.value=p;let g=-1;for(let v=0;v<h.length;v++)if(h[v].mode==="showing"){g=v;break}t.value=g}let f=null;e.watch(()=>a.video,h=>{if(f==null||f(),f=null,!h){o.value=[],t.value=-1;return}const p=h.textTracks;m(p);const g=()=>m(p);typeof p.addEventListener=="function"&&(p.addEventListener("addtrack",g),p.addEventListener("removetrack",g),p.addEventListener("change",g),f=()=>{p.removeEventListener("addtrack",g),p.removeEventListener("removetrack",g),p.removeEventListener("change",g)})},{immediate:!0}),e.onBeforeUnmount(()=>{f==null||f(),document.removeEventListener("mousedown",E),document.removeEventListener("keydown",w)});function E(h){r.value&&!r.value.contains(h.target)&&(u.value=!1)}function w(h){h.key==="Escape"&&(u.value=!1)}e.watch(u,h=>{h?(document.addEventListener("mousedown",E),document.addEventListener("keydown",w)):(document.removeEventListener("mousedown",E),document.removeEventListener("keydown",w))});function b(){if(!a.video)return;const h=a.video.textTracks;for(let p=0;p<h.length;p++)h[p].mode="hidden";t.value=-1,u.value=!1}function B(h){if(!a.video)return;const p=a.video.textTracks;for(let g=0;g<p.length;g++)p[g].mode=g===h?"showing":"hidden";t.value=h,u.value=!1}return(h,p)=>o.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"rootEl",ref:r,class:"gvp-captions"},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["gvp-captions-btn",{"is-active":t.value>=0}]),"aria-haspopup":"listbox","aria-expanded":u.value,"aria-pressed":t.value>=0,"aria-label":"Captions",onClick:p[0]||(p[0]=g=>u.value=!u.value)},[e.createVNode(Ne)],10,Xe),u.value?(e.openBlock(),e.createElementBlock("ul",Je,[e.createElementVNode("li",null,[e.createElementVNode("button",{type:"button",role:"option","aria-selected":t.value===-1,class:e.normalizeClass(["gvp-captions-menu-item",{"is-active":t.value===-1}]),onClick:b}," Off ",10,Ge)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,g=>(e.openBlock(),e.createElementBlock("li",{key:g.index},[e.createElementVNode("button",{type:"button",role:"option","aria-selected":g.index===t.value,class:e.normalizeClass(["gvp-captions-menu-item",{"is-active":g.index===t.value}]),onClick:v=>B(g.index)},e.toDisplayString(g.label),11,et)]))),128))])):e.createCommentVNode("",!0)],512)):e.createCommentVNode("",!0)}}),nt={name:"IconPause"},ot=e.defineComponent({...nt,props:{class:{}},setup(n){const a=n;return(o,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("rect",{x:"6",y:"5",width:"4",height:"14",rx:"1",fill:"currentColor"},null,-1),e.createElementVNode("rect",{x:"14",y:"5",width:"4",height:"14",rx:"1",fill:"currentColor"},null,-1)])],2))}}),lt={name:"IconPlaySolid"},at=e.defineComponent({...lt,props:{class:{}},setup(n){const a=n;return(o,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M7 5.5V18.5C7 19.2659 7.84856 19.7261 8.4899 19.3071L19.0801 12.4014C19.6644 12.0204 19.6644 11.9796 19.0801 11.5986L8.4899 4.69288C7.84856 4.27388 7 4.73408 7 5.5Z",fill:"currentColor"},null,-1)])],2))}}),rt={name:"IconPrev"},st=e.defineComponent({...rt,props:{class:{}},setup(n){const a=n;return(o,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M16.5 18.5V5.5C16.5 4.73408 15.6514 4.27388 15.0101 4.69288L6.91993 9.98432C6.33563 10.3653 6.33563 11.0347 6.91993 11.4157L15.0101 16.7071C15.6514 17.1261 16.5 16.6659 16.5 15.9V18.5Z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M6 5V19",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},null,-1)])],2))}}),it={name:"IconNext"},ct=e.defineComponent({...it,props:{class:{}},setup(n){const a=n;return(o,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M7.5 5.5V18.5C7.5 19.2659 8.34856 19.7261 8.98990 19.3071L17.0801 14.0157C17.6644 13.6347 17.6644 12.9653 17.0801 12.5843L8.98990 7.29288C8.34856 6.87388 7.5 7.33408 7.5 8.1V5.5Z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M18 5V19",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},null,-1)])],2))}}),ut={name:"IconVolumeHigh"},dt=e.defineComponent({...ut,props:{class:{}},setup(n){const a=n;return(o,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M3 14V10C3 9.44772 3.44772 9 4 9H6.58579C6.851 9 7.10536 8.89464 7.29289 8.70711L11.2929 4.70711C11.9229 4.07714 13 4.52331 13 5.41421V18.5858C13 19.4767 11.9229 19.9229 11.2929 19.2929L7.29289 15.2929C7.10536 15.1054 6.851 15 6.58579 15H4C3.44772 15 3 14.5523 3 14Z",stroke:"currentColor","stroke-width":"1.5","stroke-linejoin":"round"},null,-1),e.createElementVNode("path",{d:"M16.5 8C17.5 9 18 10.5 18 12C18 13.5 17.5 15 16.5 16M19 5.5C20.5 7 21.5 9.5 21.5 12C21.5 14.5 20.5 17 19 18.5",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])],2))}}),vt={name:"IconVolumeLow"},pt=e.defineComponent({...vt,props:{class:{}},setup(n){const a=n;return(o,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M3 14V10C3 9.44772 3.44772 9 4 9H6.58579C6.851 9 7.10536 8.89464 7.29289 8.70711L11.2929 4.70711C11.9229 4.07714 13 4.52331 13 5.41421V18.5858C13 19.4767 11.9229 19.9229 11.2929 19.2929L7.29289 15.2929C7.10536 15.1054 6.851 15 6.58579 15H4C3.44772 15 3 14.5523 3 14Z",stroke:"currentColor","stroke-width":"1.5","stroke-linejoin":"round"},null,-1),e.createElementVNode("path",{d:"M16.5 8C17.5 9 18 10.5 18 12C18 13.5 17.5 15 16.5 16",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])],2))}}),mt={name:"IconVolumeMuted"},ft=e.defineComponent({...mt,props:{class:{}},setup(n){const a=n;return(o,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M3 14V10C3 9.44772 3.44772 9 4 9H6.58579C6.851 9 7.10536 8.89464 7.29289 8.70711L11.2929 4.70711C11.9229 4.07714 13 4.52331 13 5.41421V18.5858C13 19.4767 11.9229 19.9229 11.2929 19.2929L7.29289 15.2929C7.10536 15.1054 6.851 15 6.58579 15H4C3.44772 15 3 14.5523 3 14Z",stroke:"currentColor","stroke-width":"1.5","stroke-linejoin":"round"},null,-1),e.createElementVNode("path",{d:"M16 9L22 15M22 9L16 15",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])],2))}}),kt={name:"IconQuality"},ht=e.defineComponent({...kt,props:{class:{}},setup(n){const a=n;return(o,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M12 15C13.6569 15 15 13.6569 15 12C15 10.3431 13.6569 9 12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15Z",stroke:"currentColor","stroke-width":"1.5"},null,-1),e.createElementVNode("path",{d:"M3 12C3 12.6 3.08 13.18 3.23 13.73L4.6 14.5C4.86 14.65 5.02 14.94 5 15.24C4.98 15.58 4.96 15.92 5.07 16.24C5.18 16.56 5.39 16.83 5.62 17.08C5.83 17.3 6.13 17.4 6.42 17.36L7.99 17.13C8.28 17.09 8.57 17.21 8.74 17.45C9.07 17.93 9.49 18.34 9.97 18.66C10.21 18.83 10.34 19.11 10.31 19.4L10.13 20.97C10.1 21.26 10.21 21.55 10.43 21.74C10.91 22.16 11.45 22 12 22C12.55 22 13.09 22.16 13.57 21.74C13.79 21.55 13.9 21.26 13.87 20.97L13.69 19.4C13.66 19.11 13.79 18.83 14.03 18.66",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])],2))}}),gt={name:"IconPiP"},Ve=e.defineComponent({...gt,props:{class:{}},setup(n){const a=n;return(o,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",stroke:"currentColor","stroke-width":"1.5"},null,-1),e.createElementVNode("rect",{x:"12",y:"12",width:"8",height:"5",rx:"1",fill:"currentColor"},null,-1)])],2))}}),yt={name:"IconFullscreen"},Ct=e.defineComponent({...yt,props:{class:{}},setup(n){const a=n;return(o,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M4 9V4H9M15 4H20V9M20 15V20H15M9 20H4V15",stroke:"currentColor","stroke-width":"1.75","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],2))}}),Et={name:"IconFullscreenExit"},wt=e.defineComponent({...Et,props:{class:{}},setup(n){const a=n;return(o,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M9 4V9H4M15 9V4H20M15 20V15H20M9 15H4V20",stroke:"currentColor","stroke-width":"1.75","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],2))}});function ge(n){if(!Number.isFinite(n)||n<0)return"--:--";const a=Math.floor(n),o=Math.floor(a/3600),t=Math.floor(a%3600/60),r=(a%60).toString().padStart(2,"0");if(o>0){const m=t.toString().padStart(2,"0");return`${o}:${m}:${r}`}return`${t}:${r}`}function Ee(n){const a=n.trim().split(":");if(a.length<2||a.length>3)return NaN;const o=a.map(Number);return o.some(t=>!Number.isFinite(t))?NaN:o.length===3?o[0]*3600+o[1]*60+o[2]:o[0]*60+o[1]}function bt(n,a){try{return new URL(n,a).href}catch{return n}}function xt(n,a){const o=[],t=n.replace(/\r/g,"").split(`
2
+ `);for(let u=0;u<t.length;u++){const r=t[u].indexOf("-->");if(r===-1)continue;const m=Ee(t[u].slice(0,r)),f=Ee(t[u].slice(r+3));if(!Number.isFinite(m)||!Number.isFinite(f))continue;const E=(t[u+1]??"").trim();if(!E)continue;const w=E.indexOf("#xywh=");let b=E,B=0,h=0,p=0,g=0;if(w!==-1){b=E.slice(0,w);const v=E.slice(w+6).split(",").map(Number);v.length===4&&v.every(Number.isFinite)&&([B,h,p,g]=v)}o.push({start:m,end:f,url:bt(b,a),x:B,y:h,w:p,h:g})}return o.sort((u,r)=>u.start-r.start),o}function Bt(n){return{cues:n,cueAt(a){if(n.length===0)return null;let o=0,t=n.length-1,u=n[0];for(;o<=t;){const r=o+t>>1,m=n[r];if(a<m.start)t=r-1;else if(a>m.end)u=m,o=r+1;else return m}return u}}}function we(n){const a=n.trim().split(":");if(a.length<2||a.length>3)return NaN;const o=a.map(Number);return o.some(t=>!Number.isFinite(t))?NaN:o.length===3?o[0]*3600+o[1]*60+o[2]:o[0]*60+o[1]}function Nt(n){const a=[],o=n.replace(/\r/g,"").split(`
3
+ `);for(let t=0;t<o.length;t++){const u=o[t].indexOf("-->");if(u===-1)continue;const r=we(o[t].slice(0,u)),m=we(o[t].slice(u+3));if(!Number.isFinite(r)||!Number.isFinite(m))continue;const f=(o[t+1]??"").trim();f&&a.push({start:r,end:m,title:f})}return a.sort((t,u)=>t.start-u.start),a}function Vt(n,a){const o=n.filter(t=>Number.isFinite(t.start)&&t.start>=0&&t.title).sort((t,u)=>t.start-u.start);return o.map((t,u)=>{var r;return{start:t.start,end:Number.isFinite(t.end)?t.end:((r=o[u+1])==null?void 0:r.start)??a,title:t.title}})}function Lt(n,a){for(const o of n)if(a>=o.start&&a<o.end)return o;return null}const _t={class:"gvp-controls-row"},$t=["disabled"],Pt=["aria-label","aria-pressed"],Mt=["disabled"],St={key:1,class:"gvp-seek-preview-chapter"},Tt={class:"gvp-seek-preview-time"},It=["value","disabled","aria-valuemax","aria-valuenow"],zt={class:"gvp-time","aria-live":"off"},At=["aria-expanded","aria-label"],Dt={class:"gvp-speed-label"},Ht={key:0,class:"gvp-speed-menu",role:"listbox","aria-label":"Playback speed"},Ft=["aria-selected","onClick"],qt=["aria-expanded","aria-label"],Rt={class:"gvp-quality-label"},Ut={key:0,class:"gvp-quality-menu",role:"listbox","aria-label":"Quality"},Ot=["aria-selected"],jt=["aria-selected","onClick"],Zt=["aria-expanded","aria-pressed"],Qt={key:0,class:"gvp-captions-menu",role:"listbox","aria-label":"Captions"},Wt=["aria-selected"],Yt=["aria-selected","onClick"],Kt=["aria-label","aria-pressed"],Xt={key:0,class:"gvp-volume-slider-wrap"},Jt={class:"gvp-volume-track"},Gt=["value","aria-valuenow"],en=["aria-label","aria-pressed"],tn=["aria-label","aria-pressed"],nn=3e3,on=e.defineComponent({__name:"ControlBar",props:{video:{},isPlaying:{type:Boolean},container:{},onTogglePlay:{},qualityLevels:{default:()=>[]},currentLevel:{default:-1},selectedLevel:{default:-1},thumbnails:{},chapters:{},hasPrev:{type:Boolean,default:!1},hasNext:{type:Boolean,default:!1}},emits:["select-level","prev","next"],setup(n,{emit:a}){const o=(()=>{if(typeof navigator>"u")return!1;const l=navigator.userAgent;return/iPad|iPhone|iPod/.test(l)||l.includes("Mac")&&navigator.maxTouchPoints>1})(),t=typeof navigator>"u"?!1:/iPhone|iPod/.test(navigator.userAgent),u=[.5,.75,1,1.25,1.5,2],r=n,m=a,f=e.ref(!0);let E=null;function w(){E!==null&&(clearTimeout(E),E=null)}function b(){w(),r.isPlaying&&(E=setTimeout(()=>{f.value=!1},nn))}function B(){f.value=!0,b()}e.watch(()=>r.isPlaying,l=>{l?b():(w(),f.value=!0)},{immediate:!0}),e.watch(()=>r.container,l=>{if(!l)return;const s=()=>B();l.addEventListener("mousemove",s),l.addEventListener("touchstart",s),l.addEventListener("focusin",s)},{immediate:!0});const h=e.ref(0),p=e.ref(0),g=e.ref(0);e.watch(()=>r.video,l=>{if(!l)return;const s=()=>{h.value=l.currentTime},i=()=>{p.value=Number.isFinite(l.duration)?l.duration:0},C=()=>{const S=l.buffered;if(!S||S.length===0){g.value=0;return}let ye=S.end(S.length-1);for(let oe=0;oe<S.length;oe++)if(S.start(oe)<=l.currentTime&&l.currentTime<=S.end(oe)){ye=S.end(oe);break}g.value=ye};s(),i(),C(),l.addEventListener("timeupdate",s),l.addEventListener("durationchange",i),l.addEventListener("loadedmetadata",i),l.addEventListener("progress",C),l.addEventListener("timeupdate",C)},{immediate:!0});const v=()=>p.value>0,y=()=>v()?h.value/p.value*100:0,_=()=>v()?g.value/p.value*100:0;function D(l){const s=r.video;if(!s||!v())return;const i=Number(l.target.value)/100*p.value;s.currentTime=i,h.value=i}const V=e.ref(null),q=e.ref(null),k=e.ref(0),N=e.ref(0),M=e.ref(!1);e.watch(()=>r.thumbnails,l=>{if(V.value=null,!l)return;let s=!1;fetch(l).then(i=>i.ok?i.text():Promise.reject(new Error("fetch failed"))).then(i=>{if(s)return;const C=xt(i,new URL(l,location.href).href);V.value=C.length>0?Bt(C):null}).catch(()=>{s||(V.value=null)}),e.onBeforeUnmount(()=>{s=!0})},{immediate:!0});function L(l){const s=q.value;if(!s||!v())return;const i=s.getBoundingClientRect(),C=Math.min(Math.max(l.clientX-i.left,0),i.width);N.value=C,k.value=C/i.width*p.value,M.value=!0}function $(){M.value=!1}const T=e.computed(()=>{var l;return M.value?((l=V.value)==null?void 0:l.cueAt(k.value))??null:null}),G=e.computed(()=>{const l=T.value;return l!==null&&l.w>0&&l.h>0}),ve=e.computed(()=>{var C;const l=T.value,s=((C=q.value)==null?void 0:C.clientWidth)??0;if(!G.value||!l||s===0)return N.value;const i=l.w/2;return Math.min(Math.max(N.value,i),s-i)}),Z=e.ref([]);e.watch(()=>r.chapters,l=>{if(Z.value=[],typeof l!="string"||!l)return;let s=!1;fetch(l).then(i=>i.ok?i.text():Promise.reject(new Error("fetch failed"))).then(i=>{s||(Z.value=Nt(i))}).catch(()=>{s||(Z.value=[])}),e.onBeforeUnmount(()=>{s=!0})},{immediate:!0});const W=e.computed(()=>typeof r.chapters=="string"?Z.value:Array.isArray(r.chapters)?Vt(r.chapters,p.value):[]),Y=e.computed(()=>M.value?Lt(W.value,k.value):null),H=e.ref(1),P=e.ref(!1);e.watch(()=>r.video,l=>{if(!l)return;const s=()=>{H.value=l.volume,P.value=l.muted};s(),l.addEventListener("volumechange",s)},{immediate:!0});function pe(){r.video&&(r.video.muted=!r.video.muted)}function me(l){const s=r.video;if(!s)return;const i=Number(l.target.value)/100;s.volume=i,i>0&&s.muted&&(s.muted=!1)}const F=e.ref(1),O=e.ref(!1),le=e.ref(null);e.watch(()=>r.video,l=>{if(!l)return;const s=()=>{F.value=l.playbackRate};s(),l.addEventListener("ratechange",s)},{immediate:!0});function fe(l){r.video&&(r.video.playbackRate=l),F.value=l,O.value=!1}const j=e.ref(!1),z=e.ref(null),ee=e.computed(()=>r.qualityLevels.length>=2),ae=e.computed(()=>[...r.qualityLevels].sort((l,s)=>s.height-l.height)),K=e.computed(()=>r.qualityLevels.find(l=>l.index===r.currentLevel)),re=e.computed(()=>{if(r.selectedLevel<0)return K.value?`Auto (${K.value.label})`:"Auto";const l=r.qualityLevels.find(s=>s.index===r.selectedLevel);return(l==null?void 0:l.label)??"Auto"});function Q(l){m("select-level",l),j.value=!1}const X=e.ref([]),A=e.ref(-1),R=e.ref(!1),se=e.ref(null);function te(l){const s=[];for(let C=0;C<l.length;C++){const S=l[C];(S.kind==="subtitles"||S.kind==="captions")&&s.push({index:C,label:S.label||S.language||`Track ${C+1}`})}X.value=s;let i=-1;for(let C=0;C<l.length;C++)if(l[C].mode==="showing"){i=C;break}A.value=i}e.watch(()=>r.video,l=>{if(!l){X.value=[],A.value=-1;return}const s=l.textTracks;te(s);const i=()=>te(s);typeof s.addEventListener=="function"&&(s.addEventListener("addtrack",i),s.addEventListener("removetrack",i),s.addEventListener("change",i))},{immediate:!0});function ie(l){var i;const s=(i=r.video)==null?void 0:i.textTracks;if(s){for(let C=0;C<s.length;C++)s[C].mode=C===l?"showing":"hidden";A.value=l,R.value=!1}}function c(){var s;const l=(s=r.video)==null?void 0:s.textTracks;if(l){for(let i=0;i<l.length;i++)l[i].mode="hidden";A.value=-1,R.value=!1}}const d=e.ref(!1),x=typeof document<"u"&&!!document.pictureInPictureEnabled;e.watch(()=>r.video,l=>{l&&(l.addEventListener("enterpictureinpicture",()=>{d.value=!0}),l.addEventListener("leavepictureinpicture",()=>{d.value=!1}))},{immediate:!0});function J(){r.video&&(document.pictureInPictureElement?document.exitPictureInPicture().catch(()=>{}):r.video.requestPictureInPicture().catch(()=>{}))}const I=e.ref(!1),ce=typeof document>"u"?!1:!!(document.fullscreenEnabled||document.webkitFullscreenEnabled);function ke(){return document.fullscreenElement??document.webkitFullscreenElement??null}function ue(l){const s=l.requestFullscreen??l.webkitRequestFullscreen;return s?s.call(l):Promise.reject(new Error("unsupported"))}function ne(){const l=document.exitFullscreen??document.webkitExitFullscreen;return l?l.call(document):Promise.reject(new Error("unsupported"))}function de(){I.value=ke()===r.container}e.onMounted(()=>{document.addEventListener("fullscreenchange",de),document.addEventListener("webkitfullscreenchange",de)}),e.onBeforeUnmount(()=>{w(),document.removeEventListener("fullscreenchange",de),document.removeEventListener("webkitfullscreenchange",de)});function Pe(){var l,s;if(t){(s=(l=r.video)==null?void 0:l.webkitEnterFullscreen)==null||s.call(l);return}I.value?ne().catch(()=>{}):r.container&&ue(r.container).catch(()=>{})}const Me=ce||t&&r.video!==null&&typeof r.video.webkitEnterFullscreen=="function";function he(l,s){function i(S){s.value&&!s.value.contains(S.target)&&(l.value=!1)}function C(S){S.key==="Escape"&&(l.value=!1)}e.watch(l,S=>{S?(document.addEventListener("mousedown",i),document.addEventListener("keydown",C)):(document.removeEventListener("mousedown",i),document.removeEventListener("keydown",C))}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",i),document.removeEventListener("keydown",C)})}return he(O,le),he(R,se),he(j,z),(l,s)=>(e.openBlock(),e.createElementBlock("div",{role:"toolbar","aria-label":"Video controls",class:e.normalizeClass(["gvp-controls",!f.value&&"is-hidden"]),onMouseenter:w,onMouseleave:b},[e.createElementVNode("div",_t,[n.hasPrev||n.hasNext?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"gvp-ctrl-btn","aria-label":"Previous video",disabled:!n.hasPrev,onClick:s[0]||(s[0]=i=>m("prev"))},[e.createVNode(st)],8,$t)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"gvp-ctrl-btn","aria-label":n.isPlaying?"Pause":"Play","aria-pressed":n.isPlaying,onClick:s[1]||(s[1]=(...i)=>n.onTogglePlay&&n.onTogglePlay(...i))},[n.isPlaying?(e.openBlock(),e.createBlock(ot,{key:0})):(e.openBlock(),e.createBlock(at,{key:1}))],8,Pt),n.hasPrev||n.hasNext?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"gvp-ctrl-btn","aria-label":"Next video",disabled:!n.hasNext,onClick:s[2]||(s[2]=i=>m("next"))},[e.createVNode(ct)],8,Mt)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"gvp-seek",onPointermove:L,onPointerleave:$},[e.createElementVNode("div",{ref_key:"seekTrackEl",ref:q,class:"gvp-seek-track"},[e.createElementVNode("div",{class:"gvp-seek-buffered",style:e.normalizeStyle({width:`${_()}%`})},null,4),e.createElementVNode("div",{class:"gvp-seek-progress",style:e.normalizeStyle({width:`${y()}%`})},null,4),v()?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(W.value,i=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:`${i.start}-${i.title}`,class:"gvp-seek-chapter-tick",style:e.normalizeStyle({left:`${i.start/p.value*100}%`})},null,4)),[[e.vShow,i.start>0&&i.start<p.value]])),128)):e.createCommentVNode("",!0)],512),M.value&&v()?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["gvp-seek-preview",{"has-thumb":G.value}]),style:e.normalizeStyle({left:`${ve.value}px`})},[G.value&&T.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"gvp-seek-preview-thumb",style:e.normalizeStyle({width:`${T.value.w}px`,height:`${T.value.h}px`,backgroundImage:`url(${JSON.stringify(T.value.url)})`,backgroundPosition:`-${T.value.x}px -${T.value.y}px`})},null,4)):e.createCommentVNode("",!0),Y.value?(e.openBlock(),e.createElementBlock("span",St,e.toDisplayString(Y.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("span",Tt,e.toDisplayString(e.unref(ge)(k.value)),1)],6)):e.createCommentVNode("",!0),e.createElementVNode("input",{type:"range",class:"gvp-seek-input",min:0,max:100,step:.1,value:y(),disabled:!v(),"aria-label":"Seek","aria-valuemin":0,"aria-valuemax":Math.floor(p.value),"aria-valuenow":Math.floor(h.value),onInput:D},null,40,It)],32),e.createElementVNode("span",zt,e.toDisplayString(e.unref(ge)(h.value))+" / "+e.toDisplayString(e.unref(ge)(p.value)),1),e.createElementVNode("div",{ref_key:"speedRootEl",ref:le,class:"gvp-speed"},[e.createElementVNode("button",{type:"button",class:"gvp-ctrl-btn gvp-speed-btn","aria-haspopup":"listbox","aria-expanded":O.value,"aria-label":`Playback speed: ${F.value===1?"1×":F.value+"×"}`,onClick:s[3]||(s[3]=i=>O.value=!O.value)},[e.createVNode(Be),e.createElementVNode("span",Dt,e.toDisplayString(F.value===1?"1×":`${F.value}×`),1)],8,At),O.value?(e.openBlock(),e.createElementBlock("ul",Ht,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(u,i=>e.createElementVNode("li",{key:i},[e.createElementVNode("button",{type:"button",role:"option","aria-selected":i===F.value,class:e.normalizeClass(["gvp-speed-menu-item",{"is-active":i===F.value}]),onClick:C=>fe(i)},e.toDisplayString(i===1?"Normal":`${i}×`),11,Ft)])),64))])):e.createCommentVNode("",!0)],512),ee.value?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"qualityRootEl",ref:z,class:"gvp-quality"},[e.createElementVNode("button",{type:"button",class:"gvp-ctrl-btn gvp-quality-btn","aria-haspopup":"listbox","aria-expanded":j.value,"aria-label":`Quality: ${re.value}`,onClick:s[4]||(s[4]=i=>j.value=!j.value)},[e.createVNode(ht),e.createElementVNode("span",Rt,e.toDisplayString(re.value),1)],8,qt),j.value?(e.openBlock(),e.createElementBlock("ul",Ut,[e.createElementVNode("li",null,[e.createElementVNode("button",{type:"button",role:"option","aria-selected":n.selectedLevel<0,class:e.normalizeClass(["gvp-quality-menu-item",{"is-active":n.selectedLevel<0}]),onClick:s[5]||(s[5]=i=>Q(e.unref(Se).index))},e.toDisplayString(K.value?`Auto (${K.value.label})`:"Auto"),11,Ot)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ae.value,i=>(e.openBlock(),e.createElementBlock("li",{key:i.index},[e.createElementVNode("button",{type:"button",role:"option","aria-selected":i.index===n.selectedLevel,class:e.normalizeClass(["gvp-quality-menu-item",{"is-active":i.index===n.selectedLevel}]),onClick:C=>Q(i.index)},e.toDisplayString(i.label),11,jt)]))),128))])):e.createCommentVNode("",!0)],512)):e.createCommentVNode("",!0),X.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:3,ref_key:"captionsRootEl",ref:se,class:"gvp-captions"},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["gvp-ctrl-btn",A.value>=0&&"is-active"]),"aria-haspopup":"listbox","aria-expanded":R.value,"aria-label":"Captions","aria-pressed":A.value>=0,onClick:s[6]||(s[6]=i=>R.value=!R.value)},[e.createVNode(Ne)],10,Zt),R.value?(e.openBlock(),e.createElementBlock("ul",Qt,[e.createElementVNode("li",null,[e.createElementVNode("button",{type:"button",role:"option","aria-selected":A.value===-1,class:e.normalizeClass(["gvp-captions-menu-item",{"is-active":A.value===-1}]),onClick:c},"Off",10,Wt)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(X.value,i=>(e.openBlock(),e.createElementBlock("li",{key:i.index},[e.createElementVNode("button",{type:"button",role:"option","aria-selected":i.index===A.value,class:e.normalizeClass(["gvp-captions-menu-item",{"is-active":i.index===A.value}]),onClick:C=>ie(i.index)},e.toDisplayString(i.label),11,Yt)]))),128))])):e.createCommentVNode("",!0)],512)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["gvp-volume",!e.unref(o)&&"is-expandable"])},[e.createElementVNode("button",{type:"button",class:"gvp-ctrl-btn","aria-label":P.value?"Unmute":"Mute","aria-pressed":P.value,onClick:pe},[P.value||H.value===0?(e.openBlock(),e.createBlock(ft,{key:0})):H.value<.5?(e.openBlock(),e.createBlock(pt,{key:1})):(e.openBlock(),e.createBlock(dt,{key:2}))],8,Kt),e.unref(o)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Xt,[e.createElementVNode("div",Jt,[e.createElementVNode("div",{class:"gvp-volume-fill",style:e.normalizeStyle({width:`${P.value?0:Math.round(H.value*100)}%`})},null,4)]),e.createElementVNode("input",{type:"range",class:"gvp-volume-input",min:0,max:100,step:1,value:P.value?0:Math.round(H.value*100),"aria-label":"Volume","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":P.value?0:Math.round(H.value*100),onInput:me},null,40,Gt)]))],2),e.unref(x)?(e.openBlock(),e.createElementBlock("button",{key:4,type:"button",class:e.normalizeClass(["gvp-ctrl-btn",d.value&&"is-active"]),"aria-label":d.value?"Exit picture-in-picture":"Picture-in-picture","aria-pressed":d.value,onClick:J},[e.createVNode(Ve)],10,en)):e.createCommentVNode("",!0),e.unref(Me)?(e.openBlock(),e.createElementBlock("button",{key:5,type:"button",class:e.normalizeClass(["gvp-ctrl-btn",I.value&&"is-active"]),"aria-label":I.value?"Exit fullscreen":"Enter fullscreen","aria-pressed":I.value,onClick:Pe},[I.value?(e.openBlock(),e.createBlock(wt,{key:0})):(e.openBlock(),e.createBlock(Ct,{key:1}))],10,tn)):e.createCommentVNode("",!0)])],34))}}),ln={name:"IconDesktop"},an=e.defineComponent({...ln,props:{class:{}},setup(n){const a=n;return(o,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M14 2H10C6.72077 2 5.08116 2 3.91891 2.81382C3.48891 3.1149 3.1149 3.48891 2.81382 3.91891C2 5.08116 2 6.72077 2 10C2 13.2792 2 14.9188 2.81382 16.0811C3.1149 16.5111 3.48891 16.8851 3.91891 17.1862C5.08116 18 6.72077 18 10 18H14C17.2792 18 18.9188 18 20.0811 17.1862C20.5111 16.8851 20.8851 16.5111 21.1862 16.0811C22 14.9188 22 13.2792 22 10C22 6.72077 22 5.08116 21.1862 3.91891C20.8851 3.48891 20.5111 3.1149 20.0811 2.81382C18.9188 2 17.2792 2 14 2Z",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1),e.createElementVNode("path",{d:"M11 15H13",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),e.createElementVNode("path",{d:"M14.5 22L14.1845 21.5811C13.4733 20.6369 13.2969 19.1944 13.7468 18M9.5 22L9.8155 21.5811C10.5267 20.6369 10.7031 19.1944 10.2532 18",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1),e.createElementVNode("path",{d:"M7 22H17",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])],2))}}),rn={name:"IconMobile"},sn=e.defineComponent({...rn,props:{class:{}},setup(n){const a=n;return(o,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M5 9C5 5.70017 5 4.05025 6.02513 3.02513C7.05025 2 8.70017 2 12 2C15.2998 2 16.9497 2 17.9749 3.02513C19 4.05025 19 5.70017 19 9V15C19 18.2998 19 19.9497 17.9749 20.9749C16.9497 22 15.2998 22 12 22C8.70017 22 7.05025 22 6.02513 20.9749C5 19.9497 5 18.2998 5 15V9Z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},null,-1),e.createElementVNode("path",{d:"M11 19H13",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),e.createElementVNode("path",{d:"M9 2L9.089 2.53402C9.28188 3.69129 9.37832 4.26993 9.77519 4.62204C10.1892 4.98934 10.7761 5 12 5C13.2239 5 13.8108 4.98934 14.2248 4.62204C14.6217 4.26993 14.7181 3.69129 14.911 2.53402L15 2",stroke:"currentColor","stroke-width":"2","stroke-linejoin":"round"},null,-1)])],2))}}),cn={name:"IconPlay"},un=e.defineComponent({...cn,props:{class:{}},setup(n){const a=n;return(o,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"22",height:"22",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M5.3335 11.45V4.54997C5.3335 4.36108 5.40016 4.20275 5.5335 4.07497C5.66683 3.94719 5.82238 3.8833 6.00016 3.8833C6.05572 3.8833 6.11405 3.89163 6.17516 3.9083C6.23627 3.92497 6.29461 3.94997 6.35016 3.9833L11.7835 7.4333C11.8835 7.49997 11.9585 7.5833 12.0085 7.6833C12.0585 7.7833 12.0835 7.88886 12.0835 7.99997C12.0835 8.11108 12.0585 8.21663 12.0085 8.31663C11.9585 8.41663 11.8835 8.49997 11.7835 8.56663L6.35016 12.0166C6.29461 12.05 6.23627 12.075 6.17516 12.0916C6.11405 12.1083 6.05572 12.1166 6.00016 12.1166C5.82238 12.1166 5.66683 12.0527 5.5335 11.925C5.40016 11.7972 5.3335 11.6389 5.3335 11.45Z",fill:"currentColor"},null,-1)])],2))}}),dn={name:"IconX"},vn=e.defineComponent({...dn,props:{class:{}},setup(n){const a=n;return(o,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["gvp-icon",a.class]),width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M6.94994 5.53594L12.1929 0.292938C12.5834 -0.0975275 13.2165 -0.0975279 13.6069 0.292938C13.9974 0.683403 13.9974 1.31647 13.6069 1.70694L8.36394 6.94994L13.6069 12.1929C13.9974 12.5834 13.9974 13.2165 13.6069 13.6069C13.2165 13.9974 12.5834 13.9974 12.1929 13.6069L6.94994 8.36394L1.70694 13.6069C1.31647 13.9974 0.683403 13.9974 0.292938 13.6069C-0.0975279 13.2165 -0.0975277 12.5834 0.292938 12.1929L5.53594 6.94994L0.292938 1.70694C-0.0975279 1.31647 -0.0975279 0.683403 0.292938 0.292938C0.683403 -0.0975279 1.31647 -0.0975277 1.70694 0.292938L6.94994 5.53594Z",fill:"currentColor"},null,-1)])],2))}});function Le(n){if(!n)return null;if(/^[A-Za-z0-9_-]{11}$/.test(n))return n;let a;try{a=new URL(n)}catch{return null}const o=a.hostname.replace(/^www\./,"");if(o==="youtu.be"){const t=a.pathname.slice(1).split("/")[0];return/^[A-Za-z0-9_-]{11}$/.test(t)?t:null}if(o==="youtube.com"||o==="m.youtube.com"||o==="music.youtube.com"||o==="youtube-nocookie.com"){const t=a.searchParams.get("v");if(t&&/^[A-Za-z0-9_-]{11}$/.test(t))return t;const u=/^\/(?:embed|shorts|v|live)\/([A-Za-z0-9_-]{11})/.exec(a.pathname);if(u)return u[1]}return null}function _e(n){try{const a=new URL(n),o=a.searchParams.get("t")??a.searchParams.get("start");if(!o)return null;if(/^\d+s?$/.test(o))return Number.parseInt(o,10);const t=/^(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?$/.exec(o);if(t){const u=Number.parseInt(t[1]??"0",10),r=Number.parseInt(t[2]??"0",10),m=Number.parseInt(t[3]??"0",10),f=u*3600+r*60+m;return f>0?f:null}}catch{}return null}function $e(n,a={}){const{autoPlay:o=!1,muted:t=!0,loop:u=!1,controls:r=!0,startSeconds:m}=a,f=new URLSearchParams({rel:"0",modestbranding:"1",playsinline:"1",controls:r?"1":"0"});return o?(f.set("autoplay","1"),f.set("mute","1")):t&&f.set("mute","1"),u&&(f.set("loop","1"),f.set("playlist",n)),m&&m>0&&f.set("start",String(m)),`https://www.youtube-nocookie.com/embed/${n}?${f.toString()}`}const pn=["src"],mn={key:2,class:"gvp-vignette"},fn={key:3,class:"gvp-toggle"},kn={class:"gvp-toggle-pill"},hn=["aria-pressed"],gn=["aria-pressed"],yn=["aria-label","aria-pressed"],Cn=["aria-label"],En={key:10,class:"gvp-play-wrap"},wn={key:0,class:"gvp-tooltip",role:"tooltip"},bn={key:12,class:"gvp-bottom-fade"},xn=e.defineComponent({__name:"VideoPlayer",props:{src:{},poster:{},playlist:{},defaultIndex:{default:0},autoAdvance:{type:Boolean,default:!0},showDeviceToggle:{type:Boolean,default:!0},defaultDevice:{default:"desktop"},hoverPlay:{type:Boolean,default:!1},tooltipText:{},muted:{type:Boolean,default:!0},loop:{type:Boolean,default:!1},controls:{type:[Boolean,String],default:!0},autoPlay:{type:Boolean,default:!1},frameMaxWidth:{},aspectRatio:{},hlsConfig:{},isHls:{type:Boolean},thumbnails:{},chapters:{},class:{default:""},closable:{type:Boolean,default:!1}},emits:["close","play","pause","ended","time-update","seeked","volume-change","milestone","error","playlist-change"],setup(n,{emit:a}){const o=n,t=a,u=e.ref(null),r=e.ref(o.defaultDevice),m=e.ref(!1),f=e.ref(!1),E=e.ref(null),w=e.ref([]),b=e.ref(-1),B=e.ref([]),h=e.ref(-1),p=e.ref(-1),g=e.ref(1),v=e.ref(!1),y=e.ref(!1),_=e.ref(null),D=typeof document<"u"&&!!document.pictureInPictureEnabled,V=e.computed(()=>o.controls===!0||o.controls==="custom"),q=e.computed(()=>o.controls==="native"),k=e.computed(()=>Array.isArray(o.playlist)&&o.playlist.length>0),N=e.ref(k.value?Math.min(Math.max(o.defaultIndex,0),o.playlist.length-1):0),M=e.computed(()=>k.value?o.playlist[Math.min(N.value,o.playlist.length-1)]:null),L=e.computed(()=>{var c;return((c=M.value)==null?void 0:c.src)??o.src??""}),$=e.computed(()=>{var c;return((c=M.value)==null?void 0:c.poster)??o.poster}),T=e.computed(()=>{var c;return((c=M.value)==null?void 0:c.thumbnails)??o.thumbnails}),G=e.computed(()=>{var c;return((c=M.value)==null?void 0:c.chapters)??o.chapters}),ve=e.computed(()=>k.value&&N.value>0),Z=e.computed(()=>k.value&&N.value<o.playlist.length-1);let W=!1;function Y(c,d=!1){if(!k.value)return;const x=Math.min(Math.max(c,0),o.playlist.length-1);x!==N.value&&(W=d,N.value=x,t("playlist-change",x,o.playlist[x]))}const H=e.computed(()=>Le(L.value)),P=e.computed(()=>H.value!==null),pe=e.computed(()=>H.value?$e(H.value,{autoPlay:o.autoPlay,muted:o.muted,loop:o.loop,controls:V.value?!0:q.value,startSeconds:_e(L.value)}):null);function me(c){w.value=c,b.value=-1}function F(c){B.value=c,p.value=-1}const O=e.computed(()=>!P.value&&w.value.length>1),le=e.computed(()=>{var c;return b.value>=0?b.value:((c=w.value[0])==null?void 0:c.index)??-1}),fe=e.computed(()=>{var c,d;return r.value==="mobile"?((c=o.aspectRatio)==null?void 0:c.mobile)??"9/16":((d=o.aspectRatio)==null?void 0:d.desktop)??"16/9"}),j=e.computed(()=>{var c,d;return r.value==="mobile"?((c=o.frameMaxWidth)==null?void 0:c.mobile)??"420px":((d=o.frameMaxWidth)==null?void 0:d.desktop)??"960px"}),z=e.computed(()=>{var c;return((c=u.value)==null?void 0:c.videoEl)??null});async function ee(){const c=z.value;if(c)try{c.readyState<2&&c.load();const d=c.play();E.value=d,await d,m.value=!0}catch{m.value=!1}finally{E.value=null}}async function ae(){const c=z.value;if(c){if(E.value)try{await E.value}catch{}c.pause()}}async function K(){!o.hoverPlay||P.value||await ee()}async function re(){!o.hoverPlay||P.value||(await ae(),m.value=!1)}async function Q(){const c=z.value;c&&(c.paused?await ee():(await ae(),m.value=!1))}function X(){m.value=!1,t("ended"),k.value&&o.autoAdvance&&Z.value&&Y(N.value+1,!0)}e.watch(L,()=>{W&&(W=!1,ee())});function A(){f.value=!0,K()}function R(){f.value=!1,re()}function se(c){g.value=c;const d=z.value;d&&(d.playbackRate=c)}e.watch(z,c=>{if(!c)return;c.addEventListener("ratechange",()=>{g.value=c.playbackRate}),c.addEventListener("enterpictureinpicture",()=>{v.value=!0}),c.addEventListener("leavepictureinpicture",()=>{v.value=!1});const d=new Set;c.addEventListener("timeupdate",()=>{const x=c.duration;if(t("time-update",c.currentTime,Number.isFinite(x)?x:0),!Number.isFinite(x)||x<=0)return;const J=c.currentTime/x*100;for(const I of[25,50,75,100])J>=I&&!d.has(I)&&(d.add(I),t("milestone",I))}),c.addEventListener("seeked",()=>{t("seeked",c.currentTime)}),c.addEventListener("volumechange",()=>{t("volume-change",c.volume,c.muted)}),c.addEventListener("error",()=>{t("error")})});function te(){const c=z.value;c&&(document.pictureInPictureElement?document.exitPictureInPicture().catch(()=>{}):c.requestPictureInPicture().catch(()=>{}))}function ie(c){var J,I,ce;const d=z.value;if(!(!d||!y.value&&!((J=_.value)!=null&&J.contains(document.activeElement))||c.target.tagName==="INPUT"&&c.key!==" "))switch(c.key){case" ":case"k":c.preventDefault(),Q();break;case"ArrowLeft":c.preventDefault(),d.currentTime=Math.max(0,d.currentTime-5);break;case"ArrowRight":c.preventDefault(),d.currentTime=Math.min(d.duration||0,d.currentTime+5);break;case"ArrowUp":c.preventDefault(),d.volume=Math.min(1,d.volume+.1),d.muted&&(d.muted=!1);break;case"ArrowDown":c.preventDefault(),d.volume=Math.max(0,d.volume-.1);break;case"m":d.muted=!d.muted;break;case"f":{const ke=document.fullscreenElement??document.webkitFullscreenElement??null,ue=((I=_.value)==null?void 0:I.requestFullscreen)??((ce=_.value)==null?void 0:ce.webkitRequestFullscreen),ne=document.exitFullscreen??document.webkitExitFullscreen;ke===_.value?ne==null||ne.call(document).catch(()=>{}):ue&&_.value&&ue.call(_.value).catch(()=>{});break}case"p":D&&te();break}}return e.onMounted(()=>{document.addEventListener("keydown",ie)}),e.onBeforeUnmount(()=>{document.removeEventListener("keydown",ie)}),(c,d)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rootEl",ref:_,class:e.normalizeClass(["gvp-root",o.class]),style:e.normalizeStyle({width:j.value,aspectRatio:fe.value}),onMouseenter:d[12]||(d[12]=x=>{y.value=!0,A()}),onMouseleave:d[13]||(d[13]=x=>{y.value=!1,R()})},[P.value?(e.openBlock(),e.createElementBlock("iframe",{key:0,class:"gvp-video gvp-youtube",src:pe.value??void 0,title:"YouTube video player",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowfullscreen:"",referrerpolicy:"strict-origin-when-cross-origin"},null,8,pn)):(e.openBlock(),e.createBlock(be,{ref_key:"hlsPlayerRef",ref:u,key:L.value,controls:q.value,"hls-config":n.hlsConfig,"is-hls":n.isHls,loop:n.loop,muted:n.muted,"auto-play":n.autoPlay,"audio-track-index":b.value,"quality-level-index":p.value,"plays-inline":!0,poster:$.value,src:L.value,class:"gvp-video",preload:"metadata",onAudioTracks:me,onQualityLevels:F,onCurrentLevel:d[0]||(d[0]=x=>h.value=x),onEnded:X,onPause:d[1]||(d[1]=x=>{m.value=!1,t("pause")}),onPlay:d[2]||(d[2]=x=>{m.value=!0,t("play")})},{default:e.withCtx(()=>[e.renderSlot(c.$slots,"default")]),_:3},8,["controls","hls-config","is-hls","loop","muted","auto-play","audio-track-index","quality-level-index","poster","src"])),P.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",mn)),n.showDeviceToggle?(e.openBlock(),e.createElementBlock("div",fn,[e.createElementVNode("div",kn,[e.createElementVNode("button",{"aria-pressed":r.value==="desktop",class:e.normalizeClass(["gvp-toggle-btn",{"is-active":r.value==="desktop"}]),"aria-label":"Desktop view",type:"button",onClick:d[3]||(d[3]=x=>r.value="desktop")},[e.createVNode(an)],10,hn),d[14]||(d[14]=e.createElementVNode("div",{class:"gvp-toggle-divider"},null,-1)),e.createElementVNode("button",{"aria-pressed":r.value==="mobile",class:e.normalizeClass(["gvp-toggle-btn",{"is-active":r.value==="mobile"}]),"aria-label":"Mobile view",type:"button",onClick:d[4]||(d[4]=x=>r.value="mobile")},[e.createVNode(sn)],10,gn)])])):e.createCommentVNode("",!0),n.closable?(e.openBlock(),e.createElementBlock("button",{key:4,"aria-label":"Close",class:"gvp-close",type:"button",onClick:d[5]||(d[5]=x=>t("close"))},[e.createVNode(vn)])):e.createCommentVNode("",!0),O.value&&!V.value?(e.openBlock(),e.createBlock(Ue,{key:5,tracks:w.value,"active-index":le.value,onSelect:d[6]||(d[6]=x=>b.value=x)},null,8,["tracks","active-index"])):e.createCommentVNode("",!0),!P.value&&!V.value?(e.openBlock(),e.createBlock(Ye,{key:6,speed:g.value,onSelect:se},null,8,["speed"])):e.createCommentVNode("",!0),!P.value&&!V.value?(e.openBlock(),e.createBlock(tt,{key:7,video:z.value},null,8,["video"])):e.createCommentVNode("",!0),!P.value&&e.unref(D)&&!V.value?(e.openBlock(),e.createElementBlock("button",{key:8,type:"button",class:e.normalizeClass(["gvp-pip-btn",{"is-active":v.value}]),"aria-label":v.value?"Exit picture-in-picture":"Picture-in-picture","aria-pressed":v.value,onClick:te},[e.createVNode(Ve)],10,yn)):e.createCommentVNode("",!0),!P.value&&V.value?(e.openBlock(),e.createElementBlock("button",{key:9,type:"button",class:"gvp-click-layer","aria-label":m.value?"Pause":"Play",onClick:Q},null,8,Cn)):e.createCommentVNode("",!0),!P.value&&!V.value&&!m.value?(e.openBlock(),e.createElementBlock("div",En,[e.createElementVNode("button",{"aria-label":"Play",class:"gvp-play",type:"button",onClick:Q,onMouseenter:d[7]||(d[7]=x=>f.value=!0),onMouseleave:d[8]||(d[8]=x=>f.value=!1)},[e.createVNode(un),n.tooltipText&&f.value?(e.openBlock(),e.createElementBlock("span",wn,e.toDisplayString(n.tooltipText),1)):e.createCommentVNode("",!0)],32)])):e.createCommentVNode("",!0),!P.value&&V.value?(e.openBlock(),e.createBlock(on,{key:11,video:z.value,"is-playing":m.value,container:_.value,"on-toggle-play":Q,"quality-levels":B.value,"current-level":h.value,"selected-level":p.value,thumbnails:T.value,chapters:G.value,"has-prev":ve.value,"has-next":Z.value,onSelectLevel:d[9]||(d[9]=x=>p.value=x),onPrev:d[10]||(d[10]=x=>Y(N.value-1,!0)),onNext:d[11]||(d[11]=x=>Y(N.value+1,!0))},null,8,["video","is-playing","container","quality-levels","current-level","selected-level","thumbnails","chapters","has-prev","has-next"])):e.createCommentVNode("",!0),!P.value&&!V.value?(e.openBlock(),e.createElementBlock("div",bn)):e.createCommentVNode("",!0)],38))}});exports.HLSPlayer=be;exports.VueVideoPlayer=xn;exports.parseYouTubeId=Le;exports.parseYouTubeStart=_e;exports.youTubeEmbedUrl=$e;
2
4
  //# sourceMappingURL=index.cjs.map