PageSourceSearch

https://www.muse.site/_nuxt/BQA1p5UA.js

js muse.site collected 2026-10-02 15:55:36 UTC 112,690 bytes, 2 lines download raw bytes

1var gt=Object.defineProperty;var bt=(e,t,i)=>t in e?gt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var m=(e,t,i)=>bt(e,typeof t!="symbol"?t+"":t,i);import{g as yt}from"./D4-eYBf9.js";function wt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Oe(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function vt(e,t,i){return t&&Oe(e.prototype,t),i&&Oe(e,i),e}function kt(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function _e(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),i.push.apply(i,n)}return i}function je(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?_e(Object(i),!0).forEach(function(n){kt(e,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):_e(Object(i)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(i,n))})}return e}var De={addCSS:!0,thumbWidth:15,watch:!0};function Tt(e,t){return(function(){return Array.from(document.querySelectorAll(t)).includes(this)}).call(e,t)}function Ct(e,t){if(e&&t){var i=new Event(t,{bubbles:!0});e.dispatchEvent(i)}}var ie=function(e){return e!=null?e.constructor:null},Me=function(e,t){return!!(e&&t&&e instanceof t)},Be=function(e){return e==null},We=function(e){return ie(e)===Object},At=function(e){return ie(e)===Number&&!Number.isNaN(e)},ze=function(e){return ie(e)===String},Et=function(e){return ie(e)===Boolean},St=function(e){return ie(e)===Function},Ke=function(e){return Array.isArray(e)},Ye=function(e){return Me(e,NodeList)},Pt=function(e){return Me(e,Element)},Mt=function(e){return Me(e,Event)},Nt=function(e){return Be(e)||(ze(e)||Ke(e)||Ye(e))&&!e.length||We(e)&&!Object.keys(e).length},D={nullOrUndefined:Be,object:We,number:At,string:ze,boolean:Et,function:St,array:Ke,nodeList:Ye,element:Pt,event:Mt,empty:Nt};function xt(e){var t="".concat(e).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return t?Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0)):0}function Lt(e,t){if(1>t){var i=xt(t);return parseFloat(e.toFixed(i))}return Math.round(e/t)*t}var $t=function(){function e(t,i){wt(this,e),D.element(t)?this.element=t:D.string(t)&&(this.element=document.querySelector(t)),D.element(this.element)&&D.empty(this.element.rangeTouch)&&(this.config=je({},De,{},i),this.init())}return vt(e,[{key:"init",value:function(){e.enabled&&(this.config.addCSS&&(this.element.style.userSelect="none",this.element.style.webKitUserSelect="none",this.element.style.touchAction="manipulation"),this.listeners(!0),this.element.rangeTouch=this)}},{key:"destroy",value:function(){e.enabled&&(this.config.addCSS&&(this.element.style.userSelect="",this.element.style.webKitUserSelect="",this.element.style.touchAction=""),this.listeners(!1),this.element.rangeTouch=null)}},{key:"listeners",value:function(t){var i=this,n=t?"addEventListener":"removeEventListener";["touchstart","touchmove","touchend"].forEach(function(s){i.element[n](s,function(a){return i.set(a)},!1)})}},{key:"get",value:function(t){if(!e.enabled||!D.event(t))return null;var i,n=t.target,s=t.changedTouches[0],a=parseFloat(n.getAttribute("min"))||0,l=parseFloat(n.getAttribute("max"))||100,o=parseFloat(n.getAttribute("step"))||1,c=n.getBoundingClientRect(),u=100/c.width*(this.config.thumbWidth/2)/100;return 0>(i=100/c.width*(s.clientX-c.left))?i=0:100<i&&(i=100),50>i?i-=(100-2*i)*u:50<i&&(i+=2*(i-50)*u),a+Lt(i/100*(l-a),o)}},{key:"set",value:function(t){e.enabled&&D.event(t)&&!t.target.disabled&&(t.preventDefault(),t.target.value=this.get(t),Ct(t.target,t.type==="touchend"?"change":"input"))}}],[{key:"setup",value:function(t){var i=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{},n=null;if(D.empty(t)||D.string(t)?n=Array.from(document.querySelectorAll(D.string(t)?t:'input[type="range"]')):D.element
1(t)?n=[t]:D.nodeList(t)?n=Array.from(t):D.array(t)&&(n=t.filter(D.element)),D.empty(n))return null;var s=je({},De,{},i);if(D.string(t)&&s.watch){var a=new MutationObserver(function(l){Array.from(l).forEach(function(o){Array.from(o.addedNodes).forEach(function(c){D.element(c)&&Tt(c,t)&&new e(c,s)})})});a.observe(document.body,{childList:!0,subtree:!0})}return n.map(function(l){return new e(l,i)})}},{key:"enabled",get:function(){return"ontouchstart"in document.documentElement}}]),e}();const se=e=>e!==null&&typeof e<"u"?e.constructor:null,B=(e,t)=>!!(e&&t&&e instanceof t),Ne=e=>e===null||typeof e>"u",Xe=e=>se(e)===Object,It=e=>se(e)===Number&&!Number.isNaN(e),pe=e=>se(e)===String,Ot=e=>se(e)===Boolean,Qe=e=>typeof e=="function",Je=e=>Array.isArray(e),_t=e=>B(e,WeakMap),Ge=e=>B(e,NodeList),jt=e=>se(e)===Text,Dt=e=>B(e,Event),Rt=e=>B(e,KeyboardEvent),Ht=e=>B(e,window.TextTrackCue)||B(e,window.VTTCue),qt=e=>B(e,TextTrack)||!Ne(e)&&pe(e.kind),Vt=e=>B(e,Promise)&&Qe(e.then);function Ft(e){return e!==null&&typeof e=="object"&&e.nodeType===1&&typeof e.style=="object"&&typeof e.ownerDocument=="object"}function Ze(e){return Ne(e)||(pe(e)||Je(e)||Ge(e))&&!e.length||Xe(e)&&!Object.keys(e).length}function Ut(e){if(B(e,window.URL))return!0;if(!pe(e))return!1;let t=e;(!e.startsWith("http://")||!e.startsWith("https://"))&&(t=`http://${e}`);try{return!Ze(new URL(t).hostname)}catch{return!1}}const r={nullOrUndefined:Ne,object:Xe,number:It,string:pe,boolean:Ot,function:Qe,array:Je,weakMap:_t,nodeList:Ge,element:Ft,textNode:jt,event:Dt,keyboardEvent:Rt,cue:Ht,track:qt,promise:Vt,url:Ut,empty:Ze},ke=(()=>{const e=document.createElement("span"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},i=Object.keys(t).find(n=>e.style[n]!==void 0);return r.string(i)?t[i]:!1})();function et(e,t){setTimeout(()=>{try{e.hidden=!0,e.offsetHeight,e.hidden=!1}catch{}},t)}function Bt(e){return JSON.parse(JSON.stringify(e))}function tt(e,t){return t.split(".").reduce((i,n)=>i&&i[n],e)}function L(e={},...t){if(!t.length)return e;const i=t.shift();
1return r.object(i)?(Object.keys(i).forEach(n=>{r.object(i[n])?(Object.keys(e).includes(n)||Object.assign(e,{[n]:{}}),L(e[n],i[n])):Object.assign(e,{[n]:i[n]})}),L(e,...t)):e}function it(e,t){const i=e.length?e:[e];Array.from(i).reverse().forEach((n,s)=>{const a=s>0?t.cloneNode(!0):t,l=n.parentNode,o=n.nextSibling;a.appendChild(n),o?l.insertBefore(a,o):l.appendChild(a)})}function Te(e,t){!r.element(e)||r.empty(t)||Object.entries(t).filter(([,i])=>!r.nullOrUndefined(i)).forEach(([i,n])=>e.setAttribute(i,n))}function b(e,t,i){const n=document.createElement(e);return r.object(t)&&Te(n,t),r.string(i)&&(n.textContent=i),n}function Wt(e,t){!r.element(e)||!r.element(t)||t.parentNode.insertBefore(e,t.nextSibling)}function Re(e,t,i,n){r.element(t)&&t.appendChild(b(e,i,n))}function U(e){if(r.nodeList(e)||r.array(e)){Array.from(e).forEach(U);return}!r.element(e)||!r.element(e.parentNode)||e.parentNode.removeChild(e)}function ae(e){if(!r.element(e))return;let{length:t}=e.childNodes;for(;t>0;)e.removeChild(e.lastChild),t-=1}function ue(e,t){return!r.element(t)||!r.element(t.parentNode)||!r.element(e)?null:(t.parentNode.replaceChild(e,t),e)}function V(e,t){if(!r.string(e)||r.empty(e))return{};const i={},n=L({},t);return e.split(",").forEach(s=>{const a=s.trim(),l=a.replace(".",""),c=a.replace(/[[\]]/g,"").split("="),[u]=c,f=c.length>1?c[1].replace(/["']/g,""):"";switch(a.charAt(0)){case".":r.string(n.class)?i.class=`${n.class} ${l}`:i.class=l;break;case"#":i.id=a.replace("#","");break;case"[":i[u]=f;break}}),L(n,i)}function K(e,t){if(!r.element(e))return;let i=t;r.boolean(i)||(i=!e.hidden),e.hidden=i}function E(e,t,i){if(r.nodeList(e))return Array.from(e).map(n=>E(n,t,i));if(r.element(e)){let n="toggle";return typeof i<"u"&&(n=i?"add":"remove"),e.classList[n](t),e.classList.contains(t)}return!1}function he(e,t){return r.element(e)&&e.classList.contains(t)}function Y(e,t){const{prototype:i}=Element;function n(){return Array.from(document.querySelectorAll(t)).includes(this)}return(i.matches||i.webkitMatchesSelector||i.mozMatchesSelector||i.msMatchesSelector||n).call(e,t)}function zt(e,t){const{prototype:i}=Element;function n(){let a=this;do{if(Y.matches(a,t))return a;a=a.parentElement||a.parentNode}while(a!==null&&a.nodeType===1);return null}return(i.closest||n).call(e,t)}function Z(e){return this.elements.container.querySelectorAll(e)}function I(e){return this.elements.container.querySelector(e)}function be(e=null,t=!1){r.element(e)&&e.focus({preventScroll:!0,focusVisible:t})}const He={"audio/ogg":"vorbis","audio/wav":"1","video/webm":"vp8, vorbis","video/mp4":"avc1.42E01E, mp4a.40.2","video/ogg":"theora"},$={audio:"canPlayType"in document.createElement("audio"),video:"canPlayType"in document.createElement("video"),check(e,t){const i=$[e]||t!=="html5",n=i&&$.rangeInput;return{api:i,ui:n}},pip:document.pictureInPictureEnabled&&!b("video").disablePictureInPicture,airplay:r.function(window.WebKitPlaybackTargetAvailabilityEvent),playsinline:"playsInline"in document.createElement("video"),mime(e){if(r.empty(e))return!1;const[t]=e.split("/");let i=e;if(!this.isHTML5||t!==this.type)return!1;Object.keys(He).includes(i)&&(i+=`; codecs="${He[e]}"`);try{return!!(i&&this.media.canPlayType(i).replace(/no/,""))}catch{return!1}},textTracks:"textTracks"in document.createElement("video"),rangeInput:(()=>{const e=document.createElement("input");return e.type="range",e.type==="range"})(),touch:"ontouchstart"in document.documentElement,transitions:ke!==!1,reducedMotion:"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches},Kt=(()=>{let e=!1;try{const t=Object.defineProperty({},"passive",{get(){return e=!0,null}});window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch{}return e})();function ee(e,t,i,n=!1,s=!0,a=!1){if(!e||!("addEventListener"in e)||r.empty(t)||!r.function(i))return;const l=t.split(" ");let o=a;Kt&&(o={passive:s,capture:a}),l.forEach(c=>{this&&this.eventListeners&&n&&this.eventListeners.push({element:e,type:c,callback:i,options:o}),e[n?"addEventListener":"removeEventListener"](c,i,o)})}function T(e,t="",i,n=!0,s=!1){ee.call(this,e,t,i,!0,n,s)}
1function fe(e,t="",i,n=!0,s=!1){ee.call(this,e,t,i,!1,n,s)}function xe(e,t="",i,n=!0,s=!1){const a=(...l)=>{fe(e,t,a,n,s),i.apply(this,l)};ee.call(this,e,t,a,!0,n,s)}function y(e,t="",i=!1,n={}){if(!r.element(e)||r.empty(t))return;const s=new CustomEvent(t,{bubbles:i,detail:{...n,plyr:this}});e.dispatchEvent(s)}function Yt(){this&&this.eventListeners&&(this.eventListeners.forEach(e=>{const{element:t,type:i,callback:n,options:s}=e;t.removeEventListener(i,n,s)}),this.eventListeners=[])}function Xt(){return new Promise(e=>this.ready?setTimeout(e,0):T.call(this,this.elements.container,"ready",e)).then(()=>{})}function F(e){r.promise(e)&&e.then(null,()=>{})}function Ce(e){return r.array(e)?e.filter((t,i)=>e.indexOf(t)===i):e}function st(e,t){return!r.array(e)||!e.length?null:e.reduce((i,n)=>Math.abs(n-t)<Math.abs(i-t)?n:i)}function nt(e){return!window||!window.CSS?!1:window.CSS.supports(e)}const qe=[[1,1],[4,3],[3,4],[5,4],[4,5],[3,2],[2,3],[16,10],[10,16],[16,9],[9,16],[21,9],[9,21],[32,9],[9,32]].reduce((e,[t,i])=>({...e,[t/i]:[t,i]}),{});function rt(e){return!r.array(e)&&(!r.string(e)||!e.includes(":"))?!1:(r.array(e)?e:e.split(":")).map(Number).every(r.number)}function de(e){if(!r.array(e)||!e.every(r.number))return null;const[t,i]=e,n=(a,l)=>l===0?a:n(l,a%l),s=n(t,i);return[t/s,i/s]}function Le(e){const t=n=>rt(n)?n.split(":").map(Number):null;let i=t(e);if(i===null&&(i=t(this.config.ratio)),i===null&&!r.empty(this.embed)&&r.array(this.embed.ratio)&&({ratio:i}=this.embed),i===null&&this.isHTML5){const{videoWidth:n,videoHeight:s}=this.media;i=[n,s]}return de(i)}function X(e){if(!this.isVideo)return{};const{wrapper:t}=this.elements,i=Le.call(this,e);if(!r.array(i))return{};const[n,s]=de(i),a=nt(`aspect-ratio: ${n}/${s}`),l=100/n*s;if(a?t.style.aspectRatio=`${n}/${s}`:t.style.paddingBottom=`${l}%`,this.isVimeo&&!this.config.vimeo.premium&&this.supported.ui){const o=100/this.media.offsetWidth*Number.parseInt(window.getComputedStyle(this.media).paddingBottom,10),c=(o-l)/(o/50);this.fullscreen.active?t.style.paddingBottom=null:this.media.style.transform=`translateY(-${c}%)`}else this.isHTML5&&t.classList.add(this.config.classNames.videoFixedRatio);return{padding:l,ratio:i}}function at(e,t,i=.05){const n=e/t,s=st(Object.keys(qe),n);return Math.abs(s-n)<=i?qe[s]:[e,t]}function Qt(){const e=Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),t=Math.max(document.documentElement.clientHeight||0,window.innerHeight||0);return[e,t]}const z={getSources(){return this.isHTML5?Array.from(this.media.querySelectorAll("source")).filter(t=>{const i=t.getAttribute("type");return r.empty(i)?!0:$.mime.call(this,i)}):[]},getQualityOptions(){return this.config.quality.forced?this.config.quality.options:z.getSources.call(this).map(e=>Number(e.getAttribute("size"))).filter(Boolean)},setup(){if(!this.isHTML5)return;const e=this;e.options.speed=e.config.speed.options,r.empty(this.config.ratio)||X.call(e),Object.defineProperty(e.media,"quality",{get(){const i=z.getSources.call(e).find(n=>n.getAttribute("src")===e.source);return i&&Number(i.getAttribute("size"))},set(t){if(e.quality!==t){if(e.config.quality.forced&&r.function(e.config.quality.onChange))e.config.quality.onChange(t);else{const n=z.getSources.call(e).find(u=>Number(u.getAttribute("size"))===t);if(!n)return;const{currentTime:s,paused:a,preload:l,readyState:o,playbackRate:c}=e.media;e.media.src=n.getAttribute("src"),(l!=="none"||o)&&(e.once("loadedmetadata",()=>{e.speed=c,e.currentTime=s,a||F(e.play())}),e.media.load())}y.call(e,e.media,"qualitychange",!1,{quality:t})}}})},cancelRequests(){this.isHTML5&&(U(z.getSources.call(this)),this.media.setAttribute("src",this.config.blankVideo),this.media.load(),this.debug.log("Cancelled network requests"))}},Jt=!!window.document.documentMode,Gt=/Edge/.test(navigator.userAgent),Zt="WebkitAppearance"in document.documentElement.style&&!/Edge/.test(navigator.userAgent),ei=navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1,ti=/iPad|iPhone|iPod/i.test(navigator.userAgent)&&navigator.maxTouchPoints>1,_={isIE:Jt,isEdge:Gt,isWebKit:Zt,isIPadOS:ei,isIos:ti};function ii(e){return`${e}-${Math.floor(Math.random()*1e4)}`}function Ae(e,...t){return r.empty(e)?e:e.toString().replace(/\{(\d+)\}/g,(i,n)=>t[n].toString())}function si(e,t){return e===0||t===0||Number.isNaN(e)||Number.isNaN(t)?0:(e/t*100).toFixed(2)}function G(e="",t="",i=""){return e.replace(new RegExp(t.toString().replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1"),"g"),i.toString())}function lt(e=""){return e.toString().replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase())}function ni(e=""){let t=e.toString();return t=G(t,"-"," "),t=G(t,"_"," "),t=lt(t),G(t," ","")}function ri(e=""){let t=e.toString();return t=ni(t),t.charAt(0).toLowerCase()+t.slice(1)}function ai(e){const t=document.createDocumentFragment(),i=document.createElement("div");return t.appendChild(i),i.innerHTML=e,t.firstChild.textContent}function li(e){const t=document.createElement("div");return t.appendChild(e),t.innerHTML}const Ve={pip:"PIP",airplay:"AirPlay",html5:"HTML5",vimeo:"Vimeo",youtube:"YouTube"},O={get(e="",t={}){if(r.empty(e)||r.empty(t))return"";let i=tt(t.i18n,e);if(r.empty(i))return Object.keys(Ve).includes(e)?Ve[e]:"";const n={"{seektime}":t.seekTime,"{title}":t.title};
1return Object.entries(n).forEach(([s,a])=>{i=G(i,s,a)}),i}};class te{constructor(t){m(this,"get",t=>{if(!te.supported||!this.enabled)return null;const i=window.localStorage.getItem(this.key);if(r.empty(i))return null;const n=JSON.parse(i);return r.string(t)&&t.length?n[t]:n});m(this,"set",t=>{if(!te.supported||!this.enabled||!r.object(t))return;let i=this.get();r.empty(i)&&(i={}),L(i,t);try{window.localStorage.setItem(this.key,JSON.stringify(i))}catch{}});this.enabled=t.config.storage.enabled,this.key=t.config.storage.key}static get supported(){try{if(!("localStorage"in window))return!1;const t="___test";return window.localStorage.setItem(t,t),window.localStorage.removeItem(t),!0}catch{return!1}}}function ne(e,t="text",i=!1){return new Promise((n,s)=>{try{const a=new XMLHttpRequest;if(!("withCredentials"in a))return;i&&(a.withCredentials=!0),a.addEventListener("load",()=>{if(t==="text")try{n(JSON.parse(a.responseText))}catch{n(a.responseText)}else n(a.response)}),a.addEventListener("error",()=>{throw new Error(a.status)}),a.open("GET",e,!0),a.responseType=t,a.send()}catch(a){s(a)}})}function ot(e,t){if(!r.string(e))return;const i="cache",n=r.string(t);let s=!1;const a=()=>document.getElementById(t)!==null,l=(o,c)=>{o.innerHTML=c,!(n&&a())&&document.body.insertAdjacentElement("afterbegin",o)};if(!n||!a()){const o=te.supported,c=document.createElement("div");if(c.setAttribute("hidden",""),n&&c.setAttribute("id",t),o){const u=window.localStorage.getItem(`${i}-${t}`);if(s=u!==null,s){const f=JSON.parse(u);l(c,f.content)}}ne(e).then(u=>{if(!r.empty(u)){if(o)try{window.localStorage.setItem(`${i}-${t}`,JSON.stringify({content:u}))}catch{}l(c,u)}}).catch(()=>{})}}const ct=e=>Math.trunc(e/60/60%60,10),oi=e=>Math.trunc(e/60%60,10),ci=e=>Math.trunc(e%60,10);function ge(e=0,t=!1,i=!1){if(!r.number(e))return ge(void 0,t,i);const n=o=>`0${o}`.slice(-2);let s=ct(e);const a=oi(e),l=ci(e);return t||s>0?s=`${s}:`:s="",`${i&&e>0?"-":""}${s}${n(a)}:${n(l)}`}const d={getIconUrl(){const e=new URL(this.config.iconUrl,window.location),t=window.location.host?window.location.host:window.top.location.host,i=e.host!==t||_.isIE&&!window.svg4everybody;return{url:this.config.iconUrl,cors:i}},findElements(){try{return this.elements.controls=I.call(this,this.config.selectors.controls.wrapper),this.elements.buttons={play:Z.call(this,this.config.selectors.buttons.play),pause:I.call(this,this.config.selectors.buttons.pause),restart:I.call(this,this.config.selectors.buttons.restart),rewind:I.call(this,this.config.selectors.buttons.rewind),fastForward:I.call(this,this.config.selectors.buttons.fastForward),mute:I.call(this,this.config.selectors.buttons.mute),pip:I.call(this,this.config.selectors.buttons.pip),airplay:I.call(this,this.config.selectors.buttons.airplay),settings:I.call(this,this.config.selectors.buttons.settings),captions:I.call(this,this.config.selectors.buttons.captions),fullscreen:I.call(this,this.config.selectors.buttons.fullscreen)},this.elements.progress=I.call(this,this.config.selectors.progress),this.elements.inputs={seek:I.call(this,this.config.selectors.inputs.seek),volume:I.call(this,this.config.selectors.inputs.volume)},this.elements.display={buffer:I.call(this,this.config.selectors.display.buffer),currentTime:I.call(this,this.config.selectors.display.currentTime),duration:I.call(this,this.config.selectors.display.duration)},r.element(this.elements.progress)&&(this.elements.display.seekTooltip=this.elements.progress.querySelector(`.${this.config.classNames.tooltip}`)),!0}catch(e){return this.debug.warn("It looks like there is a problem with your custom controls HTML",e),this.toggleNativeControls(!0),!1}},createIcon(e,t){const i="http://www.w3.org/2000/svg",n=d.getIconUrl.call(this),s=`${n.cors?"":n.url}#${this.config.iconPrefix}`,a=document.createElementNS(i,"svg");Te(a,L(t,{"aria-hidden":"true",focusable:"false"}));const l=document.createElementNS(i,"use"),o=`${s}-${e}`;return"href"in l&&l.setAttributeNS("http://www.w3.org/1999/xlink","href",o),l.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o),a.appendChild(l),a},createLabel(e,t={}){const i=O.get(e,this.config),n={...t,class:[t.class,this.config.classNames.hidden].filter(
1Boolean).join(" ")};return b("span",n,i)},createBadge(e){if(r.empty(e))return null;const t=b("span",{class:this.config.classNames.menu.value});return t.appendChild(b("span",{class:this.config.classNames.menu.badge},e)),t},createButton(e,t){const i=L({},t);let n=ri(e);const s={element:"button",toggle:!1,label:null,icon:null,labelPressed:null,iconPressed:null};switch(["element","icon","label"].forEach(l=>{Object.keys(i).includes(l)&&(s[l]=i[l],delete i[l])}),s.element==="button"&&!Object.keys(i).includes("type")&&(i.type="button"),Object.keys(i).includes("class")?i.class.split(" ").includes(this.config.classNames.control)||L(i,{class:`${i.class} ${this.config.classNames.control}`}):i.class=this.config.classNames.control,e){case"play":s.toggle=!0,s.label="play",s.labelPressed="pause",s.icon="play",s.iconPressed="pause";break;case"mute":s.toggle=!0,s.label="mute",s.labelPressed="unmute",s.icon="volume",s.iconPressed="muted";break;case"captions":s.toggle=!0,s.label="enableCaptions",s.labelPressed="disableCaptions",s.icon="captions-off",s.iconPressed="captions-on";break;case"fullscreen":s.toggle=!0,s.label="enterFullscreen",s.labelPressed="exitFullscreen",s.icon="enter-fullscreen",s.iconPressed="exit-fullscreen";break;case"play-large":i.class+=` ${this.config.classNames.control}--overlaid`,n="play",s.label="play",s.icon="play";break;default:r.empty(s.label)&&(s.label=n),r.empty(s.icon)&&(s.icon=e)}const a=b(s.element);return s.toggle?(a.appendChild(d.createIcon.call(this,s.iconPressed,{class:"icon--pressed"})),a.appendChild(d.createIcon.call(this,s.icon,{class:"icon--not-pressed"})),a.appendChild(d.createLabel.call(this,s.labelPressed,{class:"label--pressed"})),a.appendChild(d.createLabel.call(this,s.label,{class:"label--not-pressed"}))):(a.appendChild(d.createIcon.call(this,s.icon)),a.appendChild(d.createLabel.call(this,s.label))),L(i,V(this.config.selectors.buttons[n],i)),Te(a,i),n==="play"?(r.array(this.elements.buttons[n])||(this.elements.buttons[n]=[]),this.elements.buttons[n].push(a)):this.elements.buttons[n]=a,a},createRange(e,t){const i=b("input",L(V(this.config.selectors.inputs[e]),{type:"range",min:0,max:100,step:.01,value:0,autocomplete:"off",role:"slider","aria-label":O.get(e,this.config),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":0},t));return this.elements.inputs[e]=i,d.updateRangeFill.call(this,i),$t.setup(i),i},createProgress(e,t){const i=b("progress",L(V(this.config.selectors.display[e]),{min:0,max:100,value:0,role:"progressbar","aria-hidden":!0},t));if(e!=="volume"){i.appendChild(b("span",null,"0"));const n={played:"played",buffer:"buffered"}[e],s=n?O.get(n,this.config):"";i.textContent=`% ${s.toLowerCase()}`}return this.elements.display[e]=i,i},createTime(e,t){const i=V(this.config.selectors.display[e],t),n=b("div",L(i,{class:`${i.class?i.class:""} ${this.config.classNames.display.time} `.trim(),"aria-label":O.get(e,this.config),role:"timer"}),"00:00");return this.elements.display[e]=n,n},bindMenuItemShortcuts(e,t){T.call(this,e,"keydown keyup",i=>{if(![" ","ArrowUp","ArrowDown","ArrowRight"].includes(i.key)||(i.preventDefault(),i.stopPropagation(),i.type==="keydown"))return;const n=Y(e,'[role="menuitemradio"]');if(!n&&[" ","ArrowRight"].includes(i.key))d.showMenuPanel.call(this,t,!0);else{let s;i.key!==" "&&(i.key==="ArrowDown"||n&&i.key==="ArrowRight"?(s=e.nextElementSibling,r.element(s)||(s=e.parentNode.firstElementChild)):(s=e.previousElementSibling,r.element(s)||(s=e.parentNode.lastElementChild)),be.call(this,s,!0))}},!1),T.call(this,e,"keyup",i=>{i.key==="Return"&&d.focusFirstMenuItem.call(this,null,!0)})},createMenuItem({value:e,list:t,type:i,title:n,badge:s=null,checked:a=!1}){const l=V(this.config.selectors.inputs[i]),o=b("button",L(l,{type:"button",role:"menuitemradio",class:`${this.config.classNames.control} ${l.class?l.class:""}`.trim(),"aria-checked":a,value:e})),c=b("span");c.innerHTML=n,r.element(s)&&c.appendChild(s),o.appendChild(c),Object.defineProperty(o,"checked",{enumerable:!0,get(){return o.getAttribute("aria-checked")==="true"},set(u){u&&Array.from(o.parentNode.children).filter(f=>
1Y(f,'[role="menuitemradio"]')).forEach(f=>f.setAttribute("aria-checked","false")),o.setAttribute("aria-checked",u?"true":"false")}}),this.listeners.bind(o,"click keyup",u=>{if(!(r.keyboardEvent(u)&&u.key!==" ")){switch(u.preventDefault(),u.stopPropagation(),o.checked=!0,i){case"language":this.currentTrack=Number(e);break;case"quality":this.quality=e;break;case"speed":this.speed=Number.parseFloat(e);break}d.showMenuPanel.call(this,"home",r.keyboardEvent(u))}},i,!1),d.bindMenuItemShortcuts.call(this,o,i),t.appendChild(o)},formatTime(e=0,t=!1){if(!r.number(e))return e;const i=ct(this.duration)>0;return ge(e,i,t)},updateTimeDisplay(e=null,t=0,i=!1){!r.element(e)||!r.number(t)||(e.textContent=d.formatTime(t,i))},updateVolume(){this.supported.ui&&(r.element(this.elements.inputs.volume)&&d.setRange.call(this,this.elements.inputs.volume,this.muted?0:this.volume),r.element(this.elements.buttons.mute)&&(this.elements.buttons.mute.pressed=this.muted||this.volume===0))},setRange(e,t=0){r.element(e)&&(e.value=t,d.updateRangeFill.call(this,e))},updateProgress(e){if(!this.supported.ui||!r.event(e))return;let t=0;const i=(n,s)=>{const a=r.number(s)?s:0,l=r.element(n)?n:this.elements.display.buffer;if(r.element(l)){l.value=a;const o=l.getElementsByTagName("span")[0];r.element(o)&&(o.childNodes[0].nodeValue=a)}};if(e)switch(e.type){case"timeupdate":case"seeking":case"seeked":t=si(this.currentTime,this.duration),e.type==="timeupdate"&&d.setRange.call(this,this.elements.inputs.seek,t);break;case"playing":case"progress":i(this.elements.display.buffer,this.buffered*100);break}},updateRangeFill(e){const t=r.event(e)?e.target:e;if(!(!r.element(t)||t.getAttribute("type")!=="range")){if(Y(t,this.config.selectors.inputs.seek)){t.setAttribute("aria-valuenow",this.currentTime);const i=d.formatTime(this.currentTime),n=d.formatTime(this.duration),s=O.get("seekLabel",this.config);t.setAttribute("aria-valuetext",s.replace("{currentTime}",i).replace("{duration}",n))}else if(Y(t,this.config.selectors.inputs.volume)){const i=t.value*100;t.setAttribute("aria-valuenow",i),t.setAttribute("aria-valuetext",`${i.toFixed(1)}%`)}else t.setAttribute("aria-valuenow",t.value);!_.isWebKit&&!_.isIPadOS||t.style.setProperty("--value",`${t.value/t.max*100}%`)}},updateSeekTooltip(e){var c,u;if(!this.config.tooltips.seek||!r.element(this.elements.inputs.seek)||!r.element(this.elements.display.seekTooltip)||this.duration===0)return;const t=this.elements.display.seekTooltip,i=`${this.config.classNames.tooltip}--visible`,n=f=>E(t,i,f);if(this.touch){n(!1);return}let s=0;const a=this.elements.progress.getBoundingClientRect();if(r.event(e)){const f=e.pageX-e.clientX;s=100/a.width*(e.pageX-a.left-f)}else if(he(t,i))s=Number.parseFloat(t.style.left,10);else return;s<0?s=0:s>100&&(s=100);const l=this.duration/100*s;t.textContent=d.formatTime(l);const o=(u=(c=this.config.markers)==null?void 0:c.points)==null?void 0:u.find(({time:f})=>f===Math.round(l));o&&t.insertAdjacentHTML("afterbegin",`${o.label}<br>`),t.style.left=`${s}%`,r.event(e)&&["mouseenter","mouseleave"].includes(e.type)&&n(e.type==="mouseenter")},timeUpdate(e){const t=!r.element(this.elements.display.duration)&&this.config.invertTime;d.updateTimeDisplay.call(this,this.elements.display.currentTime,t?this.duration-this.currentTime:this.currentTime,t),!(e&&e.type==="timeupdate"&&this.media.seeking)&&d.updateProgress.call(this,e)},durationUpdate(){if(!this.supported.ui||!this.config.invertTime&&this.currentTime)return;if(this.duration>=2**32){K(this.elements.display.currentTime,!0),K(this.elements.progress,!0);return}r.element(this.elements.inputs.seek)&&this.elements.inputs.seek.setAttribute("aria-valuemax",this.duration);const e=r.element(this.elements.display.duration);!e&&this.config.displayDuration&&this.paused&&d.updateTimeDisplay.call(this,this.elements.display.currentTime,this.duration),e&&d.updateTimeDisplay.call(this,this.elements.display.duration,this.duration),this.config.markers.enabled&&d.setMarkers.call(this),d.updateSeekTooltip.call(this)},toggleMenuButton(e,t){K(this.elements.settings.buttons[e],!t)},updateSetting(e,t,i){const n=this.elements.settings.panels[e];let s=null,a=t;if(e==="captions")s=this.currentTrack;else{if(s=r.empty(i)?this[e]:i,r.empty(s)&&(s=this.config[e].default),!r.empty(this.options[e])&&!this.options[e].includes(s)){this.debug.warn(`Unsupported value of '${s}' for ${e}`);return}if(!this.config[e].options.includes(s)){this.debug.warn(`Disabled value of '${s}' for ${e}`);return}}if(r.element(a)||(a=n&&n.querySelector('[role="menu"]')),!r.element(a))return;const l=this.elements.settings.buttons[e].querySelector(`.${this.config.classNames.menu.value}`);l.innerHTML=d.getLabel.call(this,e,s);const o=a&&a.querySelector(`[value="${s}"]`);r.element(o)&&(o.checked=!0)},getLabel(e,t){switch(e){case"speed":return t===1?O.get("normal",this.config):`${t}&times;`;case"quality":if(r.number(t)){const i=O.get(`qualityLabel.${t}`,this.config);return i.length?i:`${t}p`}return lt(t);case"captions":return C.getLabel.call(this);default:return null}},setQualityMenu(e){if(!r.element(this.elements.settings.panels.quality))return;const t="quality",i=this.elements.settings.panels.quality.querySelector('[role="menu"]');r.array(e)&&(this.options.quality=Ce(e).filter(a=>this.config.quality.options.includes(a)));const n=!r.empty(this.options.quality)&&this.options.quality.length>1;if(d.toggleMenuButton.call(this,t,n),ae(i),d.checkMenu.call(this),!n)return;const s=a=>{const l=O.get(`qualityBadge.${a}`,this.config);return l.length?d.createBadge.call(this,l):null};this.options.quality.sort((a,l)=>{const o=this.config.quality.options;return o.indexOf(a)>o.indexOf(l)?1:-1}
1).forEach(a=>{d.createMenuItem.call(this,{value:a,list:i,type:t,title:d.getLabel.call(this,"quality",a),badge:s(a)})}),d.updateSetting.call(this,t,i)},setCaptionsMenu(){if(!r.element(this.elements.settings.panels.captions))return;const e="captions",t=this.elements.settings.panels.captions.querySelector('[role="menu"]'),i=C.getTracks.call(this),n=!!i.length;if(d.toggleMenuButton.call(this,e,n),ae(t),d.checkMenu.call(this),!n)return;const s=i.map((a,l)=>({value:l,checked:this.captions.toggled&&this.currentTrack===l,title:C.getLabel.call(this,a),badge:a.language&&d.createBadge.call(this,a.language.toUpperCase()),list:t,type:"language"}));s.unshift({value:-1,checked:!this.captions.toggled,title:O.get("disabled",this.config),list:t,type:"language"}),s.forEach(d.createMenuItem.bind(this)),d.updateSetting.call(this,e,t)},setSpeedMenu(){if(!r.element(this.elements.settings.panels.speed))return;const e="speed",t=this.elements.settings.panels.speed.querySelector('[role="menu"]');this.options.speed=this.options.speed.filter(n=>n>=this.minimumSpeed&&n<=this.maximumSpeed);const i=!r.empty(this.options.speed)&&this.options.speed.length>1;d.toggleMenuButton.call(this,e,i),ae(t),d.checkMenu.call(this),i&&(this.options.speed.forEach(n=>{d.createMenuItem.call(this,{value:n,list:t,type:e,title:d.getLabel.call(this,"speed",n)})}),d.updateSetting.call(this,e,t))},checkMenu(){const{buttons:e}=this.elements.settings,t=!r.empty(e)&&Object.values(e).some(i=>!i.hidden);K(this.elements.settings.menu,!t)},focusFirstMenuItem(e,t=!1){if(this.elements.settings.popup.hidden)return;let i=e;r.element(i)||(i=Object.values(this.elements.settings.panels).find(s=>!s.hidden));const n=i.querySelector('[role^="menuitem"]');be.call(this,n,t)},toggleMenu(e){const{popup:t}=this.elements.settings,i=this.elements.buttons.settings;if(!r.element(t)||!r.element(i))return;const{hidden:n}=t;let s=n;if(r.boolean(e))s=e;else if(r.keyboardEvent(e)&&e.key==="Escape")s=!1;else if(r.event(e)){const a=r.function(e.composedPath)?e.composedPath()[0]:e.target,l=t.contains(a);if(l||!l&&e.target!==i&&s)return}i.setAttribute("aria-expanded",s),K(t,!s),E(this.elements.container,this.config.classNames.menu.open,s),s&&r.keyboardEvent(e)?d.focusFirstMenuItem.call(this,null,!0):!s&&!n&&be.call(this,i,r.keyboardEvent(e))},getMenuSize(e){const t=e.cloneNode(!0);t.style.position="absolute",t.style.opacity=0,t.removeAttribute("hidden"),e.parentNode.appendChild(t);const i=t.scrollWidth,n=t.scrollHeight;return U(t),{width:i,height:n}},showMenuPanel(e="",t=!1){const i=this.elements.container.querySelector(`#plyr-settings-${this.id}-${e}`);if(!r.element(i))return;const n=i.parentNode,s=Array.from(n.children).find(a=>!a.hidden);if($.transitions&&!$.reducedMotion){n.style.width=`${s.scrollWidth}px`,n.style.height=`${s.scrollHeight}px`;const a=d.getMenuSize.call(this,i),l=o=>{o.target!==n||!["width","height"].includes(o.propertyName)||(n.style.width="",n.style.height="",fe.call(this,n,ke,l))};T.call(this,n,ke,l),n.style.width=`${a.width}px`,n.style.height=`${a.height}px`}K(s,!0),K(i,!1),d.focusFirstMenuItem.call(this,i,t)}
1,setDownloadUrl(){const e=this.elements.buttons.download;r.element(e)&&e.setAttribute("href",this.download)},create(e){const{bindMenuItemShortcuts:t,createButton:i,createProgress:n,createRange:s,createTime:a,setQualityMenu:l,setSpeedMenu:o,showMenuPanel:c}=d;this.elements.controls=null,r.array(this.config.controls)&&this.config.controls.includes("play-large")&&this.elements.container.appendChild(i.call(this,"play-large"));const u=b("div",V(this.config.selectors.controls.wrapper));this.elements.controls=u;const f={class:"plyr__controls__item"};return Ce(r.array(this.config.controls)?this.config.controls:[]).forEach(w=>{if(w==="restart"&&u.appendChild(i.call(this,"restart",f)),w==="rewind"&&u.appendChild(i.call(this,"rewind",f)),w==="play"&&u.appendChild(i.call(this,"play",f)),w==="fast-forward"&&u.appendChild(i.call(this,"fast-forward",f)),w==="progress"){const h=b("div",{class:`${f.class} plyr__progress__container`}),g=b("div",V(this.config.selectors.progress));if(g.appendChild(s.call(this,"seek",{id:`plyr-seek-${e.id}`})),g.appendChild(n.call(this,"buffer")),this.config.tooltips.seek){const v=b("span",{class:this.config.classNames.tooltip},"00:00");g.appendChild(v),this.elements.display.seekTooltip=v}this.elements.progress=g,h.appendChild(this.elements.progress),u.appendChild(h)}if(w==="current-time"&&u.appendChild(a.call(this,"currentTime",f)),w==="duration"&&u.appendChild(a.call(this,"duration",f)),w==="mute"||w==="volume"){let{volume:h}=this.elements;if((!r.element(h)||!u.contains(h))&&(h=b("div",L({},f,{class:`${f.class} plyr__volume`.trim()})),this.elements.volume=h,u.appendChild(h)),w==="mute"&&h.appendChild(i.call(this,"mute")),w==="volume"&&!_.isIos&&!_.isIPadOS){const g={max:1,step:.05,value:this.config.volume};h.appendChild(s.call(this,"volume",L(g,{id:`plyr-volume-${e.id}`})))}}if(w==="captions"&&u.appendChild(i.call(this,"captions",f)),w==="settings"&&!r.empty(this.config.settings)){const h=b("div",L({},f,{class:`${f.class} plyr__menu`.trim(),hidden:""}));h.appendChild(i.call(this,"settings",{"aria-haspopup":!0,"aria-controls":`plyr-settings-${e.id}`,"aria-expanded":!1}));const g=b("div",{class:"plyr__menu__container",id:`plyr-settings-${e.id}`,hidden:""}),v=b("div"),A=b("div",{id:`plyr-settings-${e.id}-home`}),x=b("div",{role:"menu"});A.appendChild(x),v.appendChild(A),this.elements.settings.panels.home=A,this.config.settings.forEach(P=>{const p=b("button",L(V(this.config.selectors.buttons.settings),{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--forward`,role:"menuitem","aria-haspopup":!0,hidden:""}));t.call(this,p,P),T.call(this,p,"click",()=>{c.call(this,P,!1)});const k=b("span",null,O.get(P,this.config)),M=b("span",{class:this.config.classNames.menu.value});M.innerHTML=e[P],k.appendChild(M),p.appendChild(k),x.appendChild(p);const j=b("div",{id:`plyr-settings-${e.id}-${P}`,hidden:""}),R=b("button",{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--back`});R.appendChild(b("span",{"aria-hidden":!0},O.get(P,this.config))),R.appendChild(b("span",{class:this.config.classNames.hidden},O.get("menuBack",this.config))),T.call(this,j,"keydown",H=>{H.key==="ArrowLeft"&&(H.preventDefault(),H.stopPropagation(),c.call(this,"home",!0))},!1),T.call(this,R,"click",()=>{c.call(this,"home",!1)}),j.appendChild(R),j.appendChild(b("div",{role:"menu"})),v.appendChild(j),this.elements.settings.buttons[P]=p,this.elements.settings.panels[P]=j}),g.appendChild(v),h.appendChild(g),u.appendChild(h),this.elements.settings.popup=g,this.elements.settings.menu=h}if(w==="pip"&&$.pip&&u.appendChild(i.call(this,"pip",f)),w==="airplay"&&$.airplay&&u.appendChild(i.call(this,"airplay",f)),w==="download"){const h=L({},f,{element:"a",href:this.download,target:"_blank"});this.isHTML5&&(h.download="");const{download:g}=this.config.urls;!r.url(g)&&this.isEmbed&&L(h,{icon:`logo-${this.provider}`,label:this.provider}),u.appendChild(i.call(this,"download",h))}w==="fullscreen"&&u.appendChild(i.call(this,"fullscreen",f))}),this.isHTML5&&l.call(this,z.getQualityOptions.call(this)),o.call(this),u},inject(){if(this.config.loadSprite){const l=d.getIconUrl.call(this);l.cors&&ot(l.url,"sprite-plyr")}this.id=Math.floor(Math.random()*1e4);let e=null;this.elements.controls=null;const t={id:this.id,seektime:this.config.seekTime,title:this.config.title};let i=!0;
1r.function(this.config.controls)&&(this.config.controls=this.config.controls.call(this,t)),this.config.controls||(this.config.controls=[]),r.element(this.config.controls)||r.string(this.config.controls)?e=this.config.controls:(e=d.create.call(this,{id:this.id,seektime:this.config.seekTime,speed:this.speed,quality:this.quality,captions:C.getLabel.call(this)}),i=!1);const n=l=>{let o=l;return Object.entries(t).forEach(([c,u])=>{o=G(o,`{${c}}`,u)}),o};i&&r.string(this.config.controls)&&(e=n(e));let s;r.string(this.config.selectors.controls.container)&&(s=document.querySelector(this.config.selectors.controls.container)),r.element(s)||(s=this.elements.container);const a=r.element(e)?"insertAdjacentElement":"insertAdjacentHTML";if(s[a]("afterbegin",e),r.element(this.elements.controls)||d.findElements.call(this),!r.empty(this.elements.buttons)){const l=o=>{const c=this.config.classNames.controlPressed;o.setAttribute("aria-pressed","false"),Object.defineProperty(o,"pressed",{configurable:!0,enumerable:!0,get(){return he(o,c)},set(u=!1){E(o,c,u),o.setAttribute("aria-pressed",u?"true":"false")}})};Object.values(this.elements.buttons).filter(Boolean).forEach(o=>{r.array(o)||r.nodeList(o)?Array.from(o).filter(Boolean).forEach(l):l(o)})}if(_.isEdge&&et(s),this.config.tooltips.controls){const{classNames:l,selectors:o}=this.config,c=`${o.controls.wrapper} ${o.labels} .${l.hidden}`,u=Z.call(this,c);Array.from(u).forEach(f=>{E(f,this.config.classNames.hidden,!1),E(f,this.config.classNames.tooltip,!0)})}},setMediaMetadata(){try{"mediaSession"in navigator&&(navigator.mediaSession.metadata=new window.MediaMetadata({title:this.config.mediaMetadata.title,artist:this.config.mediaMetadata.artist,album:this.config.mediaMetadata.album,artwork:this.config.mediaMetadata.artwork}))}catch{}},setMarkers(){var l,o;if(!this.duration||this.elements.markers)return;const e=(o=(l=this.config.markers)==null?void 0:l.points)==null?void 0:o.filter(({time:c})=>c>0&&c<this.duration);if(!(e!=null&&e.length))return;const t=document.createDocumentFragment(),i=document.createDocumentFragment();let n=null;const s=`${this.config.classNames.tooltip}--visible`,a=c=>E(n,s,c);e.forEach(c=>{const u=b("span",{class:this.config.classNames.marker},""),f=`${c.time/this.duration*100}%`;n&&(u.addEventListener("mouseenter",()=>{c.label||(n.style.left=f,n.innerHTML=c.label,a(!0))}),u.addEventListener("mouseleave",()=>{a(!1)})),u.addEventListener("click",()=>{this.currentTime=c.time}),u.style.left=f,i.appendChild(u)}),t.appendChild(i),this.config.tooltips.seek||(n=b("span",{class:this.config.classNames.tooltip},""),t.appendChild(n)),this.elements.markers={points:i,tip:n},this.elements.progress.appendChild(t)}};function ut(e,t=!0){let i=e;if(t){const n=document.createElement("a");n.href=i,i=n.href}try{return new URL(i)}catch{return null}}function ht(e){const t=new URLSearchParams;return r.object(e)&&Object.entries(e).forEach(([i,n])=>{t.set(i,n)}),t}const C={setup(){if(!this.supported.ui)return;if(!this.isVideo||this.isYouTube||this.isHTML5&&!$.textTracks){r.array(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&d.setCaptionsMenu.call(this);return}if(r.element(this.elements.captions)||(this.elements.captions=b("div",V(this.config.selectors.captions)),this.elements.captions.setAttribute("dir","auto"),Wt(this.elements.captions,this.elements.wrapper)),_.isIE&&window.URL){const s=this.media.querySelectorAll("track");Array.from(s).forEach(a=>{const l=a.getAttribute("src"),o=ut(l);o!==null&&o.hostname!==window.location.href.hostname&&["http:","https:"].includes(o.protocol)&&ne(l,"blob").then(c=>{a.setAttribute("src",window.URL.createObjectURL(c))}).catch(()=>{U(a)})})}const e=navigator.languages||[navigator.language||navigator.userLanguage||"en"],t=Ce(e.map(s=>s.split("-")[0]));let i=(this.storage.get("language")||this.captions.language||this.config.captions.language||"auto").toLowerCase();i==="auto"&&([i]=t);let n=this.storage.get("captions")||this.captions.active;if(r.boolean(n)||({active:n}=this.config.captions),Object.assign(this.captions,{toggled:!1,active:n,language:i,languages:t}),this.isHTML5){const s=this.config.captions.update?"addtrack removetrack":"removetrack";T.call(this,this.media.textTracks,s,C.update.bind(this))}setTimeout(C.update.bind(this),0)},update(){const e=C.getTracks.call(this,!0),{active:t,language:i,meta:n,currentTrackNode:s}=this.captions,a=!!e.find(l=>l.language===i);this.isHTML5&&this.isVideo&&e.filter(l=>
1!n.get(l)).forEach(l=>{this.debug.log("Track added",l),n.set(l,{default:l.mode==="showing"}),l.mode==="showing"&&(l.mode="hidden"),T.call(this,l,"cuechange",()=>C.updateCues.call(this))}),(a&&this.language!==i||!e.includes(s))&&(C.setLanguage.call(this,i),C.toggle.call(this,t&&a)),this.elements&&E(this.elements.container,this.config.classNames.captions.enabled,!r.empty(e)),r.array(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&d.setCaptionsMenu.call(this)},toggle(e,t=!0){if(!this.supported.ui)return;const{toggled:i}=this.captions,n=this.config.classNames.captions.active,s=r.nullOrUndefined(e)?!i:e;if(s!==i){if(t||(this.captions.active=s,this.storage.set({captions:s})),!this.language&&s&&!t){const a=C.getTracks.call(this),l=C.findTrack.call(this,[this.captions.language,...this.captions.languages],!0);this.captions.language=l.language,C.set.call(this,a.indexOf(l));return}this.elements.buttons.captions&&(this.elements.buttons.captions.pressed=s),E(this.elements.container,n,s),this.captions.toggled=s,d.updateSetting.call(this,"captions"),y.call(this,this.media,s?"captionsenabled":"captionsdisabled")}setTimeout(()=>{s&&this.captions.toggled&&(this.captions.currentTrackNode.mode="hidden")})},set(e,t=!0){const i=C.getTracks.call(this);if(e===-1){C.toggle.call(this,!1,t);return}if(!r.number(e)){this.debug.warn("Invalid caption argument",e);return}if(!(e in i)){this.debug.warn("Track not found",e);return}if(this.captions.currentTrack!==e){this.captions.currentTrack=e;const n=i[e],{language:s}=n||{};this.captions.currentTrackNode=n,d.updateSetting.call(this,"captions"),t||(this.captions.language=s,this.storage.set({language:s})),this.isVimeo&&this.embed.enableTextTrack(s),y.call(this,this.media,"languagechange")}C.toggle.call(this,!0,t),this.isHTML5&&this.isVideo&&C.updateCues.call(this)},setLanguage(e,t=!0){if(!r.string(e)){this.debug.warn("Invalid language argument",e);return}const i=e.toLowerCase();this.captions.language=i;const n=C.getTracks.call(this),s=C.findTrack.call(this,[i]);C.set.call(this,n.indexOf(s),t)},getTracks(e=!1){return Array.from((this.media||{}).textTracks||[]).filter(i=>!this.isHTML5||e||this.captions.meta.has(i)).filter(i=>["captions","subtitles"].includes(i.kind))},findTrack(e,t=!1){const i=C.getTracks.call(this),n=l=>Number((this.captions.meta.get(l)||{}).default),s=Array.from(i).sort((l,o)=>n(o)-n(l));let a;return e.every(l=>(a=s.find(o=>o.language===l),!a)),a||(t?s[0]:void 0)},getCurrentTrack(){return C.getTracks.call(this)[this.currentTrack]},getLabel(e){let t=e;return!r.track(t)&&$.textTracks&&this.captions.toggled&&(t=C.getCurrentTrack.call(this)),r.track(t)?r.empty(t.label)?r.empty(t.language)?O.get("enabled",this.config):e.language.toUpperCase():t.label:O.get("disabled",this.config)},updateCues(e){if(!this.supported.ui)return;if(!r.element(this.elements.captions)){this.debug.warn("No captions element to render to");return}if(!r.nullOrUndefined(e)&&!Array.isArray(e)){this.debug.warn("updateCues: Invalid input",e);return}let t=e;if(!t){const s=C.getCurrentTrack.call(this);t=Array.from((s||{}).activeCues||[]).map(a=>a.getCueAsHTML()).map(li)}const i=t.map(s=>s.trim()).join(`
2`);if(i!==this.elements.captions.innerHTML){ae(this.elements.captions);const s=b("span",V(this.config.selectors.caption));s.innerHTML=i,this.elements.captions.appendChild(s),y.call(this,this.media,"cuechange")}}},dt={enabled:!0,title:"",debug:!1,autoplay:!1,autopause:!0,playsinline:!0,seekTime:10,volume:1,muted:!1,duration:null,displayDuration:!0,invertTime:!0,toggleInvert:!0,ratio:null,clickToPlay:!0,hideControls:!0,resetOnEnd:!1,disableContextMenu:!0,loadSprite:!0,iconPrefix:"plyr",iconUrl:"https://cdn.plyr.io/3.8.3/plyr.svg",blankVideo:"https://cdn.plyr.io/static/blank.mp4",quality:{default:576,options:[4320,2880,2160,1440,1080,720,576,480,360,240],forced:!1,onChange:null},loop:{active:!1},speed:{selected:1,options:[.5,.75,1,1.25,1.5,1.75,2,4]},keyboard:{focused:!0,global:!1},tooltips:{controls:!1,seek:!0},captions:{active:!1,language:"auto",update:!1},fullscreen:{enabled:!0,fallback:!0,iosNative:!1},storage:{enabled:!0,key:"plyr"},controls:["play-large","play","progress","current-time","mute","volume","captions","settings","pip","airplay","fullscreen"],settings:["captions","quality","speed"],i18n:{restart:"Restart",rewind:"Rewind {seektime}s",play:"Play",pause:"Pause",fastForward:"Forward {seektime}s",seek:"Seek",seekLabel:"{currentTime} of {duration}",played:"Played",buffered:"Buffered",currentTime:"Current time",duration:"Duration",volume:"Volume",mute:"Mute",unmute:"Unmute",enableCaptions:"Enable captions",disableCaptions:"Disable captions",download:"Download",enterFullscreen:"Enter fullscreen",exitFullscreen:"Exit fullscreen",frameTitle:"Player for {title}",captions:"Captions",settings:"Settings",pip:"PIP",menuBack:"Go back to previous menu",speed:"Speed",normal:"Normal",quality:"Quality",loop:"Loop",start:"Start",end:"End",all:"All",reset:"Reset",disabled:"Disabled",enabled:"Enabled",advertisement:"Ad",qualityBadge:{2160:"4K",1440:"HD",1080:"HD",720:"HD",576:"SD",480:"S
2D"}},urls:{download:null,vimeo:{sdk:"https://player.vimeo.com/api/player.js",iframe:"https://player.vimeo.com/video/{0}?{1}",api:"https://vimeo.com/api/oembed.json?url={0}"},youtube:{sdk:"https://www.youtube.com/iframe_api",api:"https://noembed.com/embed?url=https://www.youtube.com/watch?v={0}"},googleIMA:{sdk:"https://imasdk.googleapis.com/js/sdkloader/ima3.js"}},listeners:{seek:null,play:null,pause:null,restart:null,rewind:null,fastForward:null,mute:null,volume:null,captions:null,download:null,fullscreen:null,pip:null,airplay:null,speed:null,quality:null,loop:null,language:null},events:["ended","progress","stalled","playing","waiting","canplay","canplaythrough","loadstart","loadeddata","loadedmetadata","timeupdate","volumechange","play","pause","error","seeking","seeked","emptied","ratechange","cuechange","download","enterfullscreen","exitfullscreen","captionsenabled","captionsdisabled","languagechange","controlshidden","controlsshown","ready","statechange","qualitychange","adsloaded","adscontentpause","adscontentresume","adstarted","adsmidpoint","adscomplete","adsallcomplete","adsimpression","adsclick"],selectors:{editable:"input, textarea, select, [contenteditable]",container:".plyr",controls:{container:null,wrapper:".plyr__controls"},labels:"[data-plyr]",buttons:{play:'[data-plyr="play"]',pause:'[data-plyr="pause"]',restart:'[data-plyr="restart"]',rewind:'[data-plyr="rewind"]',fastForward:'[data-plyr="fast-forward"]',mute:'[data-plyr="mute"]',captions:'[data-plyr="captions"]',download:'[data-plyr="download"]',fullscreen:'[data-plyr="fullscreen"]',pip:'[data-plyr="pip"]',airplay:'[data-plyr="airplay"]',settings:'[data-plyr="settings"]',loop:'[data-plyr="loop"]'},inputs:{seek:'[data-plyr="seek"]',volume:'[data-plyr="volume"]',speed:'[data-plyr="speed"]',language:'[data-plyr="language"]',quality:'[data-plyr="quality"]'},display:{currentTime:".plyr__time--current",duration:".plyr__time--duration",buffer:".plyr__progress__buffer",loop:".plyr__progress__loop",volume:".plyr__volume--display"},progress:".plyr__progress",captions:".plyr__captions",caption:".plyr__caption"},classNames:{type:"plyr--{0}",provider:"plyr--{0}",video:"plyr__video-wrapper",embed:"plyr__video-embed",videoFixedRatio:"plyr__video-wrapper--fixed-ratio",embedContainer:"plyr__video-embed__container",poster:"plyr__poster",posterEnabled:"plyr__poster-enabled",ads:"plyr__ads",control:"plyr__control",controlPressed:"plyr__control--pressed",playing:"plyr--playing",paused:"plyr--paused",stopped:"plyr--stopped",loading:"plyr--loading",hover:"plyr--hover",tooltip:"plyr__tooltip",cues:"plyr__cues",marker:"plyr__progress__marker",hidden:"plyr__sr-only",hideControls:"plyr--hide-controls",isTouch:"plyr--is-touch",uiSupported:"plyr--full-ui",noTransition:"plyr--no-transition",display:{time:"plyr__time"},menu:{value:"plyr__menu__value",badge:"plyr__badge",open:"plyr--menu-open"},captions:{enabled:"plyr--captions-enabled",active:"plyr--captions-active"},fullscreen:{enabled:"plyr--fullscreen-enabled",fallback:"plyr--fullscreen-fallback"},pip:{supported:"plyr--pip-supported",active:"plyr--pip-active"},airplay:{supported:"plyr--airplay-supported",active:"plyr--airplay-active"},previewThumbnails:{thumbContainer:"plyr__preview-thumb",thumbContainerShown:"plyr__preview-thumb--is-shown",imageContainer:"plyr__preview-thumb__image-container",timeContainer:"plyr__preview-thumb__time-container",scrubbingContainer:"plyr__preview-scrubbing",scrubbingContainerShown:"plyr__preview-scrubbing--is-shown"}},attributes:{embed:{provider:"data-plyr-provider",id:"data-plyr-embed-id",hash:"data-plyr-embed-hash"}},ads:{enabled:!1,publisherId:"",tagUrl:""},previewThumbnails:{enabled:!1,src:"",withCredentials:!1},vimeo:{byline:!1,portrait:!1,title:!1,speed:!0,transparent:!1,customControls:!0,referrerPolicy:null,premium:!1},youtube:{rel:0,showinfo:0,iv_load_policy:3,modestbranding:1,customControls:!0,noCookie:!1},mediaMetadata:{title:"",artist:"",album:"",artwork:[]},markers:{enabled:!1,points:[]}},ye={active:"picture-in-picture",inactive:"inline"},W={html5:"html5",youtube:"youtube",vimeo:"vimeo"},we={audio:"audio",video:"video"};function ui(e){return/^(?:https?:\/\/)?(?:www\.)?(?:youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(e)?W.youtube:/^https?:\/\/player.vimeo.com\/video\/\d{0,9}(?=\b|\/)/.test(e)?W.vimeo:null}function ve(){}class hi{constructor(t=!1){this.enabled=window.console&&t,this.enabled&&this.log("Debugging enabled")}get log(){return this.enabled?Function.prototype.bind.call(console.log,console):ve}get warn(){return this.enabled?Function.prototype.bind.call(console.warn,console):ve}get error(){return this.enabled?Function.prototype.bind.call(console.error,console):ve}}class q{constructor(t){m(this,"onChange",()=>{if(!this.supported)return;const t=this.player.elements.buttons.fullscreen;r.element(t)&&(t.pressed=this.active);const i=this.target===this.player.media?this.target:this.player.elements.container;y.call(this.player,i,this.active?"enterfullscreen":"exitfullscreen",!0)});
2m(this,"toggleFallback",(t=!1)=>{if(t?this.scrollPosition={x:window.scrollX??0,y:window.scrollY??0}:window.scrollTo(this.scrollPosition.x,this.scrollPosition.y),document.body.style.overflow=t?"hidden":"",E(this.target,this.player.config.classNames.fullscreen.fallback,t),_.isIos){let i=document.head.querySelector('meta[name="viewport"]');const n="viewport-fit=cover";i||(i=document.createElement("meta"),i.setAttribute("name","viewport"));const s=r.string(i.content)&&i.content.includes(n);t?(this.cleanupViewport=!s,s||(i.content+=`,${n}`)):this.cleanupViewport&&(i.content=i.content.split(",").filter(a=>a.trim()!==n).join(","))}this.onChange()});m(this,"trapFocus",t=>{if(_.isIos||_.isIPadOS||!this.active||t.key!=="Tab")return;const i=document.activeElement,n=Z.call(this.player,"a[href], button:not(:disabled), input:not(:disabled), [tabindex]"),[s]=n,a=n[n.length-1];i===a&&!t.shiftKey?(s.focus(),t.preventDefault()):i===s&&t.shiftKey&&(a.focus(),t.preventDefault())});m(this,"update",()=>{if(this.supported){let t;this.forceFallback?t="Fallback (forced)":q.nativeSupported?t="Native":t="Fallback",this.player.debug.log(`${t} fullscreen enabled`)}else this.player.debug.log("Fullscreen not supported and fallback disabled");E(this.player.elements.container,this.player.config.classNames.fullscreen.enabled,this.supported)});m(this,"enter",()=>{this.supported&&(_.isIos&&this.player.config.fullscreen.iosNative?this.player.isVimeo?this.player.embed.requestFullscreen():this.target.webkitEnterFullscreen():!q.nativeSupported||this.forceFallback?this.toggleFallback(!0):this.prefix?r.empty(this.prefix)||this.target[`${this.prefix}Request${this.property}`]():this.target.requestFullscreen({navigationUI:"hide"}))});m(this,"exit",()=>{if(this.supported){if(_.isIos&&this.player.config.fullscreen.iosNative)this.player.isVimeo?this.player.embed.exitFullscreen():this.target.webkitEnterFullscreen(),F(this.player.play());else if(!q.nativeSupported||this.forceFallback)this.toggleFallback(!1);else if(!this.prefix)(document.cancelFullScreen||document.exitFullscreen).call(document);else if(!r.empty(this.prefix)){const t=this.prefix==="moz"?"Cancel":"Exit";document[`${this.prefix}${t}${this.property}`]()}}});m(this,"toggle",()=>{this.active?this.exit():this.enter()});this.player=t,this.prefix=q.prefix,this.property=q.property,this.scrollPosition={x:0,y:0},this.forceFallback=t.config.fullscreen.fallback==="force",this.player.elements.fullscreen=t.config.fullscreen.container&&zt(this.player.elements.container,t.config.fullscreen.container),T.call(this.player,document,this.prefix==="ms"?"MSFullscreenChange":`${this.prefix}fullscreenchange`,()=>{this.onChange()}),T.call(this.player,this.player.elements.container,"dblclick",i=>{r.element(this.player.elements.controls)&&this.player.elements.controls.contains(i.target)||this.player.listeners.proxy(i,this.toggle,"fullscreen")}),T.call(this,this.player.elements.container,"keydown",i=>this.trapFocus(i)),this.update()}static get nativeSupported(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}get useNative(){return q.nativeSupported&&!this.forceFallback}static get prefix(){if(r.function(document.exitFullscreen))return"";let t="";return["webkit","moz","ms"].some(n=>r.function(document[`${n}ExitFullscreen`])||r.function(document[`${n}CancelFullScreen`])?(t=n,!0):!1),t}static get property(){return this.prefix==="moz"?"FullScreen":"Fullscreen"}get supported(){return[this.player.config.fullscreen.enabled,this.player.isVideo,q.nativeSupported||this.player.config.fullscreen.fallback,!this.player.isYouTube||q.nativeSupported||!_.isIos||this.player.config.playsinline&&!this.player.config.fullscreen.iosNative].every(Boolean)}get active(){if(!this.supported)return!1;if(!q.nativeSupported||this.forceFallback)return he(this.target,this.player.config.classNames.fullscreen.fallback);const t=this.prefix?this.target.getRootNode()[`${this.prefix}${this.property}Element`]:this.target.getRootNode().fullscreenElement;return t&&t.shadowRoot?t===this.target.getRootNode().host:t===this.target}get target(){return _.isIos&&this.player.config.fullscreen.iosNative?this.player.media:this.player.elements.fullscreen??this.player.elements.container}}
vendor: 4,729 bytes, line 2
2function le(e,t=1){return new Promise((i,n)=>{const s=new Image,a=()=>{delete s.onload,delete s.onerror,(s.naturalWidth>=t?i:n)(s)};Object.assign(s,{onload:a,onerror:a,src:e})})}const S={addStyleHook(){E(this.elements.container,this.config.selectors.container.replace(".",""),!0),E(this.elements.container,this.config.classNames.uiSupported,this.supported.ui)},toggleNativeControls(e=!1){e&&this.isHTML5?this.media.setAttribute("controls",""):this.media.removeAttribute("controls")},build(){if(this.listeners.media(),!this.supported.ui){this.debug.warn(`Basic support only for ${this.provider} ${this.type}`),S.toggleNativeControls.call(this,!0);return}r.element(this.elements.controls)||(d.inject.call(this),this.listeners.controls()),S.toggleNativeControls.call(this),this.isHTML5&&C.setup.call(this),this.volume=null,this.muted=null,this.loop=null,this.quality=null,this.speed=null,d.updateVolume.call(this),d.timeUpdate.call(this),d.durationUpdate.call(this),S.checkPlaying.call(this),E(this.elements.container,this.config.classNames.pip.supported,$.pip&&this.isHTML5&&this.isVideo),E(this.elements.container,this.config.classNames.airplay.supported,$.airplay&&this.isHTML5),E(this.elements.container,this.config.classNames.isTouch,this.touch),this.ready=!0,setTimeout(()=>{y.call(this,this.media,"ready")},0),S.setTitle.call(this),this.poster&&S.setPoster.call(this,this.poster,!1).catch(()=>{}),this.config.duration&&d.durationUpdate.call(this),this.config.mediaMetadata&&d.setMediaMetadata.call(this)},setTitle(){let e=O.get("play",this.config);if(r.string(this.config.title)&&!r.empty(this.config.title)&&(e+=`, ${this.config.title}`),Array.from(this.elements.buttons.play||[]).forEach(t=>{t.setAttribute("aria-label",e)}),this.isEmbed){const t=I.call(this,"iframe");if(!r.element(t))return;const i=r.empty(this.config.title)?"video":this.config.title,n=O.get("frameTitle",this.config);t.setAttribute("title",n.replace("{title}",i))}},togglePoster(e){E(this.elements.container,this.config.classNames.posterEnabled,e)},setPoster(e,t=!0){return t&&this.poster?Promise.reject(new Error("Poster already set")):(this.media.setAttribute("data-poster",e),this.elements.poster.removeAttribute("hidden"),Xt.call(this).then(()=>le(e)).catch(i=>{throw e===this.poster&&S.togglePoster.call(this,!1),i}).then(()=>{if(e!==this.poster)throw new Error("setPoster cancelled by later call to setPoster")}).then(()=>(Object.assign(this.elements.poster.style,{backgroundImage:`url('${e}')`,backgroundSize:""}),S.togglePoster.call(this,!0),e)))},checkPlaying(e){E(this.elements.container,this.config.classNames.playing,this.playing),E(this.elements.container,this.config.classNames.paused,this.paused),E(this.elements.container,this.config.classNames.stopped,this.stopped),Array.from(this.elements.buttons.play||[]).forEach(t=>{Object.assign(t,{pressed:this.playing}),t.setAttribute("aria-label",O.get(this.playing?"pause":"play",this.config))}),!(r.event(e)&&e.type==="timeupdate")&&S.toggleControls.call(this)},checkLoading(e){this.loading=["stalled","waiting"].includes(e.type),clearTimeout(this.timers.loading),this.timers.loading=setTimeout(()=>{E(this.elements.container,this.config.classNames.loading,this.loading),S.toggleControls.call(this)},this.loading?250:0)},toggleControls(e){const{controls:t}=this.elements;if(t&&this.config.hideControls){const i=this.touch&&this.lastSeekTime+2e3>Date.now();this.toggleControls(!!(e||this.loading||this.paused||t.pressed||t.hover||i))}},migrateStyles(){Object.values({...this.media.style}).filter(e=>!r.empty(e)&&r.string(e)&&e.startsWith("--plyr")).forEach(e=>{this.elements.container.style.setProperty(e,this.media.style.getPropertyValue(e)),this.media.style.removeProperty(e)}),r.empty(this.media.style)&&this.media.removeAttribute("style")}};class di{constructor(t){m(this,"firstTouch",()=>{const{player:t}=this,{elements:i}=t;t.touch=!0,E(i.container,t.config.classNames.isTouch,!0)});m(this,"global",(t=!0)=>{const{player:i}=this;i.config.keyboard.global&&ee.call(i,window,"keydown keyup",this.handleKey,t,!1),ee.call(i,document.body,"click",this.toggleMenu,t),xe.call(i,document.body,"touchstart",this.firstTouch)});m(this,"container",()=>{const{player:t}=this,{config:i,elements:n,timers:s}=t;!i.keyboard.global&&i.keyboard.focused&&T.call(t,n.container,"keydown keyup",this.handleKey,!1),T.call(t,n.container,"mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen",o=>{const{controls:c}=n;c&&o.type==="enterfullscreen"&&(c.pressed=!1,c.hover=!1);const u=["touchstart","touchmove","mousemove"].includes(o.type);let f=0;u&&(S.toggleControls.call(t,!0),f=t.touch?3e3:2e3),clearTimeout(s.controls),s.controls=setTimeout(()=>S.toggleControls.call(t,!1),f)});const a=()=>
2{if(!t.isVimeo||t.config.vimeo.premium)return;const o=n.wrapper,{active:c}=t.fullscreen,[u,f]=Le.call(t),w=nt(`aspect-ratio: ${u} / ${f}`);if(!c){w?(o.style.width=null,o.style.height=null):(o.style.maxWidth=null,o.style.margin=null);return}const[h,g]=Qt(),v=h/g>u/f;w?(o.style.width=v?"auto":"100%",o.style.height=v?"100%":"auto"):(o.style.maxWidth=v?`${g/f*u}px`:null,o.style.margin=v?"0 auto":null)},l=()=>{clearTimeout(s.resized),s.resized=setTimeout(a,50)};T.call(t,n.container,"enterfullscreen exitfullscreen",o=>{const{target:c}=t.fullscreen;if(c!==n.container||!t.isEmbed&&r.empty(t.config.ratio))return;a(),(o.type==="enterfullscreen"?T:fe).call(t,window,"resize",l)})});m(this,"media",()=>{const{player:t}=this,{elements:i}=t;if(T.call(t,t.media,"timeupdate seeking seeked",s=>d.timeUpdate.call(t,s)),T.call(t,t.media,"durationchange loadeddata loadedmetadata",s=>d.durationUpdate.call(t,s)),T.call(t,t.media,"ended",()=>{t.isHTML5&&t.isVideo&&t.config.resetOnEnd&&(t.restart(),t.pause())}),T.call(t,t.media,"progress playing seeking seeked",s=>d.updateProgress.call(t,s)),T.call(t,t.media,"volumechange",s=>d.updateVolume.call(t,s)),T.call(t,t.media,"playing play pause ended emptied timeupdate",s=>S.checkPlaying.call(t,s)),T.call(t,t.media,"waiting canplay seeked playing",s=>S.checkLoading.call(t,s)),t.supported.ui&&t.config.clickToPlay&&!t.isAudio){const s=I.call(t,`.${t.config.classNames.video}`);
2if(!r.element(s))return;T.call(t,i.container,"click",a=>{![i.container,s].includes(a.target)&&!s.contains(a.target)||t.touch&&t.config.hideControls||(t.ended?(this.proxy(a,t.restart,"restart"),this.proxy(a,()=>{F(t.play())},"play")):this.proxy(a,()=>{F(t.togglePlay())},"play"))})}t.supported.ui&&t.config.disableContextMenu&&T.call(t,i.wrapper,"contextmenu",s=>{s.preventDefault()},!1),T.call(t,t.media,"volumechange",()=>{t.storage.set({volume:t.volume,muted:t.muted})}),T.call(t,t.media,"ratechange",()=>{d.updateSetting.call(t,"speed"),t.storage.set({speed:t.speed})}),T.call(t,t.media,"qualitychange",s=>{d.updateSetting.call(t,"quality",null,s.detail.quality)}),T.call(t,t.media,"ready qualitychange",()=>{d.setDownloadUrl.call(t)});const n=t.config.events.concat(["keyup","keydown"]).join(" ");T.call(t,t.media,n,s=>{let{detail:a={}}=s;s.type==="error"&&(a=t.media.error),y.call(t,i.container,s.type,!0,a)})});m(this,"proxy",(t,i,n)=>{const{player:s}=this,a=s.config.listeners[n],l=r.function(a);let o=!0;l&&(o=a.call(s,t)),o!==!1&&r.function(i)&&i.call(s,t)});m(this,"bind",(t,i,n,s,a=!0)=>{const{player:l}=this,o=l.config.listeners[s],c=r.function(o);T.call(l,t,i,u=>this.proxy(u,n,s),a&&!c)});m(this,"controls",()=>{const{player:t}=this,{elements:i}=t,n=_.isIE?"change":"input";if(i.buttons.play&&Array.from(i.buttons.play).forEach(s=>{this.bind(s,"click",()=>{F(t.togglePlay())},"play")}),this.bind(i.buttons.restart,"click",t.restart,"restart"),this.bind(i.buttons.rewind,"click",()=>{t.lastSeekTime=Date.now(),t.rewind()},"rewind"),this.bind(i.buttons.fastForward,"click",()=>{t.lastSeekTime=Date.now(),t.forward()},"fastForward"),this.bind(i.buttons.mute,"click",()=>{t.muted=!t.muted},"mute"),this.bind(i.buttons.captions,"click",()=>t.toggleCaptions()),this.bind(i.buttons.download,"click",()=>{y.call(t,t.media,"download")},"download"),this.bind(i.buttons.fullscreen,"click",()=>{t.fullscreen.toggle()},"fullscreen"),this.bind(i.buttons.pip,"click",()=>{t.pip="toggle"},"pip"),this.bind(i.buttons.airplay,"click",t.airplay,"airplay"),this.bind(i.buttons.settings,"click",s=>{s.stopPropagation(),s.preventDefault(),d.toggleMenu.call(t,s)}
2,null,!1),this.bind(i.buttons.settings,"keyup",s=>{if([" ","Enter"].includes(s.key)){if(s.key==="Enter"){d.focusFirstMenuItem.call(t,null,!0);return}s.preventDefault(),s.stopPropagation(),d.toggleMenu.call(t,s)}},null,!1),this.bind(i.settings.menu,"keydown",s=>{s.key==="Escape"&&d.toggleMenu.call(t,s)}),this.bind(i.inputs.seek,"mousedown mousemove",s=>{const a=i.progress.getBoundingClientRect(),l=s.pageX-s.clientX,o=100/a.width*(s.pageX-a.left-l);s.currentTarget.setAttribute("seek-value",o)}),this.bind(i.inputs.seek,"mousedown mouseup keydown keyup touchstart touchend",s=>{const a=s.currentTarget,l="play-on-seeked";if(r.keyboardEvent(s)&&!["ArrowLeft","ArrowRight"].includes(s.key))return;t.lastSeekTime=Date.now();const o=a.hasAttribute(l),c=["mouseup","touchend","keyup"].includes(s.type);o&&c?(a.removeAttribute(l),F(t.play())):!c&&t.playing&&(a.setAttribute(l,""),t.pause())}),_.isIos){const s=Z.call(t,'input[type="range"]');Array.from(s).forEach(a=>this.bind(a,n,l=>et(l.target)))}this.bind(i.inputs.seek,n,s=>{const a=s.currentTarget;let l=a.getAttribute("seek-value");r.empty(l)&&(l=a.value),a.removeAttribute("seek-value"),t.currentTime=l/a.max*t.duration},"seek"),this.bind(i.progress,"mouseenter mouseleave mousemove",s=>d.updateSeekTooltip.call(t,s)),this.bind(i.progress,"mousemove touchmove",s=>{const{previewThumbnails:a}=t;a&&a.loaded&&a.startMove(s)}),this.bind(i.progress,"mouseleave touchend click",()=>{const{previewThumbnails:s}=t;s&&s.loaded&&s.endMove(!1,!0)}),this.bind(i.progress,"mousedown touchstart",s=>{const{previewThumbnails:a}=t;a&&a.loaded&&a.startScrubbing(s)}),this.bind(i.progress,"mouseup touchend",s=>{const{previewThumbnails:a}=t;a&&a.loaded&&a.endScrubbing(s)}),_.isWebKit&&Array.from(Z.call(t,'input[type="range"]')).forEach(s=>{this.bind(s,"input",a=>d.updateRangeFill.call(t,a.target))}),t.config.toggleInvert&&!r.element(i.display.duration)&&this.bind(i.display.currentTime,"click",()=>{t.currentTime!==0&&(t.config.invertTime=!t.config.invertTime,d.timeUpdate.call(t))}),this.bind(i.inputs.volume,n,s=>{t.volume=s.target.value},"volume"),this.bind(i.controls,"mouseenter mouseleave",s=>{i.controls.hover=!t.touch&&s.type==="mouseenter"}),i.fullscreen&&Array.from(i.fullscreen.children).filter(s=>
2!s.contains(i.container)).forEach(s=>{this.bind(s,"mouseenter mouseleave",a=>{i.controls&&(i.controls.hover=!t.touch&&a.type==="mouseenter")})}),this.bind(i.controls,"mousedown mouseup touchstart touchend touchcancel",s=>{i.controls.pressed=["mousedown","touchstart"].includes(s.type)}),this.bind(i.controls,"focusin",()=>{const{config:s,timers:a}=t;E(i.controls,s.classNames.noTransition,!0),S.toggleControls.call(t,!0),setTimeout(()=>{E(i.controls,s.classNames.noTransition,!1)},0);const l=this.touch?3e3:4e3;clearTimeout(a.controls),a.controls=setTimeout(()=>S.toggleControls.call(t,!1),l)}),this.bind(i.inputs.volume,"wheel",s=>{const a=s.webkitDirectionInvertedFromDevice,[l,o]=[s.deltaX,-s.deltaY].map(f=>a?-f:f),c=Math.sign(Math.abs(l)>Math.abs(o)?l:o);t.increaseVolume(c/50);const{volume:u}=t.media;(c===1&&u<1||c===-1&&u>0)&&s.preventDefault()},"volume",!1)});this.player=t,this.lastKey=null,this.focusTimer=null,this.lastKeyDown=null,this.handleKey=this.handleKey.bind(this),this.toggleMenu=this.toggleMenu.bind(this),this.firstTouch=this.firstTouch.bind(this)}handleKey(t){const{player:i}=this,{elements:n}=i,{key:s,type:a,altKey:l,ctrlKey:o,metaKey:c,shiftKey:u}=t,f=a==="keydown",w=f&&s===this.lastKey;if(l||o||c||u||!s)return;const h=g=>{i.currentTime=i.duration/10*g};if(f){const g=document.activeElement;if(r.element(g)){const{editable:A}=i.config.selectors,{seek:x}=n.inputs;if(g!==x&&Y(g,A)||t.key===" "&&Y(g,'button, [role^="menuitem"]'))return}switch([" ","ArrowLeft","ArrowUp","ArrowRight","ArrowDown","0","1","2","3","4","5","6","7","8","9","c","f","k","l","m"].includes(s)&&(t.preventDefault(),t.stopPropagation()),s){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":w||h(Number.parseInt(s,10));break;case" ":case"k":w||F(i.togglePlay());break;case"ArrowUp":i.increaseVolume(.1);break;case"ArrowDown":i.decreaseVolume(.1);break;case"m":w||(i.muted=!i.muted);break;case"ArrowRight":i.forward();break;case"ArrowLeft":i.rewind();break;case"f":i.fullscreen.toggle();break;case"c":w||i.toggleCaptions();break;case"l":i.loop=!i.loop;break}s==="Escape"&&!i.fullscreen.usingNative&&i.fullscreen.active&&i.fullscreen.toggle(),this.lastKey=s}else this.lastKey=null}toggleMenu(t){d.toggleMenu.call(this.player,t)}}var oe={exports:{}},mi=oe.exports,Fe;function pi(){return Fe||(Fe=1,function(e,t){(function(i,n){e.exports=n()})(mi,function(){var i=function(){},n={},s={},a={};function l(h,g){h=h.push?h:[h];var v=[],A=h.length,x=A,P,p,k,M;for(P=function(j,R){R.length&&v.push(j),x--,x||g(v)};A--;){if(p=h[A],k=s[p],k){P(p,k);continue}M=a[p]=a[p]||[],M.push(P)}}function o(h,g){if(h){var v=a[h];if(s[h]=g,!!v)for(;v.length;)v[0](h,g),v.splice(0,1)}}function c(h,g){h.call&&(h={success:h}),g.length?(h.error||i)(g):(h.success||i)(h)}function u(h,g,v,A){var x=document,P=v.async,p=(v.numRetries||0)+1,k=v.before||i,M=h.replace(/[\?|#].*$/,""),j=h.replace(/^(css|img|module|nomodule)!/,""),R,H,N;if(A=A||0,/(^css!|\.css$)/.test(M))N=x.createElement("link"),N.rel="stylesheet",N.href=j,R="hideFocus"in N,R&&N.relList&&(R=0,N.rel="preload",N.as="style");else if(/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(M))N=x.createElement("img"),N.src=j;else if(N=x.createElement("script"),N.src=j,N.async=P===void 0?!0:P,H="noModule"in N,/^module!/.test(M)){if(!H)return g(h,"l");N.type="module"}else if(/^nomodule!/.test(M)&&H)return g(h,"l");N.onload=N.onerror=N.onbeforeload=function(Ie){var re=Ie.type[0];if(R)try{N.sheet.cssText.length||(re="e")}catch(ft){ft.code!=18&&(re="e")}if(re=="e"){if(A+=1,A<p)return u(h,g,v,A)}else if(N.rel=="preload"&&N.as=="style")return N.rel="stylesheet";g(h,re,Ie.defaultPrevented)},k(h,N)!==!1&&x.head.appendChild(N)}function f(h,g,v){h=h.push?h:[h];var A=h.length,x=A,P=[],p,k;for(p=function(M,j,R){if(j=="e"&&P.push(M),j=="b")if(R)P.push(M);else return;A--,A||g(P)},k=0;k<x;k++)u(h[k],p,v)}function w(h,g,v){var A,x;if(g&&g.trim&&(A=g),x=(A?v:g)||{},A){if(A in n)throw"LoadJS";n[A]=!0}function P(p,k){f(h,function(M){c(x,M),p&&c({success:p,error:k},M),o(A,M)},x)}if(x.returnPromise)return new Promise(P);P()}return w.ready=function(g,v){return l(g,function(A){c(v,A)}),w},w.done=function(g){o(g,[])},w.reset=function(){n={},s={},a={}},w.isDefined=function(g){return g in n},w})}(oe)),oe.exports}var fi=pi();const gi=yt(fi);function $e(e){return new Promise((t,i)=>{gi(e,{success:t,error:i})})}function bi(e){if(r.empty(e))return null;if(r.number(Number(e)))return e;const t=/^.*(vimeo.com\/|video\/)(\d+).*/,i=e.match(t);return i?i[2]:e}function yi(e){const t=/^.*(vimeo.com\/|video\/)(\d+)(\?.*h=|\/)+([\d,a-f]+)/,i=e.match(t);return i&&i.length===5?i[4]:null}function Q(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,y.call(this,this.media,e?"play":"pause"))}const Ee={setup(){const e=this;E(e.elements.wrapper,e.config.classNames.embed,!0),e.options.speed=e.config.speed.options,X.call(e),r.object(window.Vimeo)?Ee.ready.call(e):$e(e.config.urls.vimeo.sdk).then(()=>{Ee.ready.call(e)}).catch(t=>{e.debug.warn("Vimeo SDK (player.js) failed to load",t)})},ready(){const e=this,t=e.config.vimeo,{premium:i,referrerPolicy:n,...s}=t;let a=e.media.getAttribute("src"),l="";r.empty(a)?(a=e.media.getAttribute(e.config.attributes.embed.id),l=e.media.getAttribute(e.config.attributes.embed.hash)):l=yi(a);const o=l?{h:l}:{};i&&Object.assign(s,{controls:!1,sidedock:!1});const c=ht({loop:e.config.loop.active,autoplay:e.autoplay,muted:e.muted,gesture:"media",playsinline:e.config.playsinline,...o,...s}),u=bi(a),f=b("iframe"),w=Ae(e.config.urls.vimeo.iframe,u,c);
2if(f.setAttribute("src",w),f.setAttribute("allowfullscreen",""),f.setAttribute("allow",["autoplay","fullscreen","picture-in-picture","encrypted-media","accelerometer","gyroscope"].join("; ")),r.empty(n)||f.setAttribute("referrerPolicy",n),i||!t.customControls)f.setAttribute("data-poster",e.poster),e.media=ue(f,e.media);else{const p=b("div",{class:e.config.classNames.embedContainer,"data-poster":e.poster});p.appendChild(f),e.media=ue(p,e.media)}t.customControls||ne(Ae(e.config.urls.vimeo.api,w)).then(p=>{r.empty(p)||!p.thumbnail_url||S.setPoster.call(e,p.thumbnail_url).catch(()=>{})}),e.embed=new window.Vimeo.Player(f,{autopause:e.config.autopause,muted:e.muted}),e.media.paused=!0,e.media.currentTime=0,e.supported.ui&&e.embed.disableTextTrack(),e.media.play=()=>(Q.call(e,!0),e.embed.play()),e.media.pause=()=>(Q.call(e,!1),e.embed.pause()),e.media.stop=()=>{e.pause(),e.currentTime=0};let{currentTime:h}=e.media;Object.defineProperty(e.media,"currentTime",{get(){return h},set(p){const{embed:k,media:M,paused:j,volume:R}=e,H=j&&!k.hasPlayed;M.seeking=!0,y.call(e,M,"seeking"),Promise.resolve(H&&k.setVolume(0)).then(()=>k.setCurrentTime(p)).then(()=>H&&k.pause()).then(()=>H&&k.setVolume(R)).catch(()=>{})}});let g=e.config.speed.selected;Object.defineProperty(e.media,"playbackRate",{get(){return g},set(p){e.embed.setPlaybackRate(p).then(()=>{g=p,y.call(e,e.media,"ratechange")}).catch(()=>{e.options.speed=[1]})}});let{volume:v}=e.config;Object.defineProperty(e.media,"volume",{get(){return v},set(p){e.embed.setVolume(p).then(()=>{v=p,y.call(e,e.media,"volumechange")})}});let{muted:A}=e.config;Object.defineProperty(e.media,"muted",{get(){return A},set(p){const k=r.boolean(p)?p:!1;e.embed.setMuted(k?!0:e.config.muted).then(()=>{A=k,y.call(e,e.media,"volumechange")})}});let{loop:x}=e.config;Object.defineProperty(e.media,"loop",{get(){return x},set(p){const k=r.boolean(p)?p:e.config.loop.active;e.embed.setLoop(k).then(()=>{x=k})}});let P;e.embed.getVideoUrl().then(p=>{P=p,d.setDownloadUrl.call(e)}).catch(p=>{this.debug.warn(p)}),Object.defineProperty(e.media,"currentSrc",{get(){return P}}),Object.defineProperty(e.media,"ended",{get(){return e.currentTime===e.duration}}),Promise.all([e.embed.getVideoWidth(),e.embed.getVideoHeight()]).then(p=>{const[k,M]=p;e.embed.ratio=at(k,M),X.call(this)}),e.embed.setAutopause(e.config.autopause).then(p=>{e.config.autopause=p}),e.embed.getVideoTitle().then(p=>{e.config.title=p,S.setTitle.call(this)}),e.embed.getCurrentTime().then(p=>{h=p,y.call(e,e.media,"timeupdate")}),e.embed.getDuration().then(p=>{e.media.duration=p,y.call(e,e.media,"durationchange")}),e.embed.getTextTracks().then(p=>{e.media.textTracks=p,C.setup.call(e)}),e.embed.on("cuechange",({cues:p=[]})=>{const k=p.map(M=>ai(M.text));C.updateCues.call(e,k)}),e.embed.on("loaded",()=>{e.embed.getPaused().then(p=>{Q.call(e,!p),p||y.call(e,e.media,"playing")}),r.element(e.embed.element)&&e.supported.ui&&e.embed.element.setAttribute("tabindex",-1)}),e.embed.on("bufferstart",()=>{y.call(e,e.media,"waiting")}),e.embed.on("bufferend",()=>{y.call(e,e.media,"playing")}),e.embed.on("play",()=>{Q.call(e,!0),y.call(e,e.media,"playing")}),e.embed.on("pause",()=>{Q.call(e,!1)}),e.embed.on("timeupdate",p=>{e.media.seeking=!1,h=p.seconds,y.call(e,e.media,"timeupdate")}),e.embed.on("progress",p=>{e.media.buffered=p.percent,y.call(e,e.media,"progress"),Number.parseInt(p.percent,10)===1&&y.call(e,e.media,"canplaythrough"),e.embed.getDuration().then(k=>{k!==e.media.duration&&(e.media.duration=k,y.call(e,e.media,"durationchange"))})}),e.embed.on("seeked",()=>{e.media.seeking=!1,y.call(e,e.media,"seeked")}),e.embed.on("ended",()=>{e.media.paused=!0,y.call(e,e.media,"ended")}),e.embed.on("error",p=>{e.media.error=p,y.call(e,e.media,"error")}),t.customControls&&setTimeout(()=>S.build.call(e),0)}};function wi(e){if(r.empty(e))return null;const t=/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/,i=e.match(t);return i&&i[2]?i[2]:e}function J(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,y.call(this,this.media,e?"play":"pause"))}function vi(e){if(e.noCookie)return"https://www.youtube-nocookie.com";if(window.location.protocol==="http:")return"http://www.youtube.com"}const ce={setup(){if(E(this.elements.wrapper,this.config.classNames.embed,!0),r.object(window.YT)&&r.function(window.YT.Player))ce.ready.call(this);else{const e=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=()=>{r.function(e)&&e(),ce.ready.call(this)},$e(this.config.urls.youtube.sdk).catch(t=>{this.debug.warn("YouTube API failed to load",t)})}},getTitle(e){const t=Ae(this.config.urls.youtube.api,e);ne(t).then(i=>{if(r.object(i)){const{title:n,height:s,width:a}=i;this.config.title=n,S.setTitle.call(this),this.embed.ratio=at(a,s)}X.call(this)}).catch(()=>{X.call(this)})},ready(){const e=this,t=e.config.youtube,i=e.media&&e.media.getAttribute("id");if(!r.empty(i)&&i.startsWith("youtube-"))return;let n=e.media.getAttribute("src");r.empty(n)&&(n=e.media.getAttribute(this.config.attributes.embed.id));const s=wi(n),a=ii(e.provider),l=b("div",{id:a,"data-poster":t.customControls?e.poster:void 0});if(e.media=ue(l,e.media),t.customControls){const o=c=>`https://i.ytimg.com/vi/${s}/${c}default.jpg`;le(o("maxres"),121).catch(()=>
2le(o("sd"),121)).catch(()=>le(o("hq"))).then(c=>S.setPoster.call(e,c.src)).then(c=>{c.includes("maxres")||(e.elements.poster.style.backgroundSize="cover")}).catch(()=>{})}e.embed=new window.YT.Player(e.media,{videoId:s,host:vi(t),playerVars:L({},{autoplay:e.config.autoplay?1:0,hl:e.config.hl,controls:e.supported.ui&&t.customControls?0:1,disablekb:1,playsinline:e.config.playsinline&&!e.config.fullscreen.iosNative?1:0,cc_load_policy:e.captions.active?1:0,cc_lang_pref:e.config.captions.language,widget_referrer:window?window.location.href:null},t),events:{onError(o){if(!e.media.error){const c=o.data,u={2:"The request contains an invalid parameter value. For example, this error occurs if you specify a video ID that does not have 11 characters, or if the video ID contains invalid characters, such as exclamation points or asterisks.",5:"The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.",100:"The video requested was not found. This error occurs when a video has been removed (for any reason) or has been marked as private.",101:"The owner of the requested video does not allow it to be played in embedded players.",150:"The owner of the requested video does not allow it to be played in embedded players."}[c]||"An unknown error occurred";e.media.error={code:c,message:u},y.call(e,e.media,"error")}},onPlaybackRateChange(o){const c=o.target;e.media.playbackRate=c.getPlaybackRate(),y.call(e,e.media,"ratechange")},onReady(o){if(r.function(e.media.play))return;const c=o.target;ce.getTitle.call(e,s),e.media.play=()=>{J.call(e,!0),c.playVideo()},e.media.pause=()=>{J.call(e,!1),c.pauseVideo()},e.media.stop=()=>{c.stopVideo()},e.media.duration=c.getDuration(),e.media.paused=!0,e.media.currentTime=0,Object.defineProperty(e.media,"currentTime",{get(){return Number(c.getCurrentTime())},set(h){e.paused&&!e.embed.hasPlayed&&e.embed.mute(),e.media.seeking=!0,y.call(e,e.media,"seeking"),c.seekTo(h)}}),Object.defineProperty(e.media,"playbackRate",{get(){return c.getPlaybackRate()},set(h){c.setPlaybackRate(h)}});let{volume:u}=e.config;Object.defineProperty(e.media,"volume",{get(){return u},set(h){u=h,c.setVolume(u*100),y.call(e,e.media,"volumechange")}});let{muted:f}=e.config;Object.defineProperty(e.media,"muted",{get(){return f},set(h){const g=r.boolean(h)?h:f;f=g,c[g?"mute":"unMute"](),c.setVolume(u*100),y.call(e,e.media,"volumechange")}}),Object.defineProperty(e.media,"currentSrc",{get(){return c.getVideoUrl()}}),Object.defineProperty(e.media,"ended",{get(){return e.currentTime===e.duration}});const w=c.getAvailablePlaybackRates();e.options.speed=w.filter(h=>e.config.speed.options.includes(h)),e.supported.ui&&t.customControls&&e.media.setAttribute("tabindex",-1),y.call(e,e.media,"timeupdate"),y.call(e,e.media,"durationchange"),clearInterval(e.timers.buffering),e.timers.buffering=setInterval(()=>{e.media.buffered=c.getVideoLoadedFraction(),(e.media.lastBuffered===null||e.media.lastBuffered<e.media.buffered)&&y.call(e,e.media,"progress"),e.media.lastBuffered=e.media.buffered,e.media.buffered===1&&(clearInterval(e.timers.buffering),y.call(e,e.media,"canplaythrough"))},200),t.customControls&&setTimeout(()=>S.build.call(e),50)},onStateChange(o){const c=o.target;switch(clearInterval(e.timers.playing),e.media.seeking&&[1,2].includes(o.data)&&(e.media.seeking=!1,y.call(e,e.media,"seeked")),o.data){case-1:y.call(e,e.media,"timeupdate"),e.media.buffered=c.getVideoLoadedFraction(),y.call(e,e.media,"progress");break;case 0:J.call(e,!1),e.media.loop?(c.stopVideo(),c.playVideo()):y.call(e,e.media,"ended");break;case 1:t.customControls&&!e.config.autoplay&&e.media.paused&&!e.embed.hasPlayed?e.media.pause():(J.call(e,!0),y.call(e,e.media,"playing"),e.timers.playing=setInterval(()=>{y.call(e,e.media,"timeupdate")},50),e.media.duration!==c.getDuration()&&(e.media.duration=c.getDuration(),y.call(e,e.media,"durationchange")));break;case 2:e.muted||e.embed.unMute(),J.call(e,!1);break;case 3:y.call(e,e.media,"waiting");break}y.call(e,e.elements.container,"statechange",!1,{code:o.data})}}})}},mt={setup(){if(!this.media){this.debug.warn("No media element found!");return}E(this.elements.container,this.config.classNames.type.replace("{0}",this.type),!0),E(this.elements.container,this.config.classNames.provider.replace("{0}",this.provider),!0),this.isEmbed&&E(this.elements.container,this.config.classNames.type.replace("{0}","video"),!0),this.isVideo&&(this.elements.wrapper=b("div",{class:this.config.classNames.video}),it(this.media,this.elements.wrapper),this.elements.poster=b("div",{class:this.config.classNames.poster}),this.elements.wrapper.appendChild(this.elements.poster)),this.isHTML5?z.setup.call(this):this.isYouTube?ce.setup.call(this):this.isVimeo&&Ee.setup.call(this)}};function ki(e){e.manager&&e.manager.destroy(),e.elements.displayContainer&&e.elements.displayContainer.destroy(),e.elements.container.remove()}class Ti{constructor(t){m(this,"load",()=>{this.enabled&&(!r.object(window.google)||!r.object(window.google.ima)?$e(this.player.config.urls.googleIMA.sdk).then(()=>{this.ready()}).catch(()=>{this.trigger("error",new Error("Google IMA SDK failed to load"))}):this.ready())});m(this,"ready",()=>{this.enabled||ki(this),this.startSafetyTimer(12e3,"ready()"),this.managerPromise.then(()=>{this.clearSafetyTimer("onAdsManagerLoaded()")}),this.listeners(),this.setupIMA()});m(this,"setupIMA",()=>{this.elements.container=b("div",{class:this.player.config.classNames.ads}),this.player.elements.container.appendChild(this.elements.container),google.ima.settings.setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.ENABLED),google.ima.settings.setLocale(this.player.config.ads.language),google.ima.settings.setDisableCustomPlaybackForIOS10Plus(this.player.config.playsinline),this.elements.displayContainer=new google.ima.AdDisplayContainer(this.elements.container,this.player.media),this.loader=new google.ima.AdsLoader(this.elements.displayContainer),this.loader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,t=>this.onAdsManagerLoaded(t),!1),this.loader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,t=>this.onAdError(t),!1),this.requestAds()});m(this,"requestAds",()=>{const{container:t}=this.player.elements;try{const i=new google.ima.AdsRequest;i.adTagUrl=this.tagUrl,i.linearAdSlotWidth=t.offsetWidth,i.linearAdSlotHeight=t.offsetHeight,i.nonLinearAdSlotWidth=t.offsetWidth,i.nonLinearAdSlotHeight=t.offsetHeight,i.forceNonLinearFullSlot=!1,i.setAdWillPlayMuted(!this.player.muted),this.loader.requestAds(i)}catch(i){this.onAdError(i)}});m(this,"pollCountdown",(t=!1)=>
2{if(!t){clearInterval(this.countdownTimer),this.elements.container.removeAttribute("data-badge-text");return}const i=()=>{const n=ge(Math.max(this.manager.getRemainingTime(),0)),s=`${O.get("advertisement",this.player.config)} - ${n}`;this.elements.container.setAttribute("data-badge-text",s)};this.countdownTimer=setInterval(i,100)});m(this,"onAdsManagerLoaded",t=>{if(!this.enabled)return;const i=new google.ima.AdsRenderingSettings;i.restoreCustomPlaybackStateOnAdBreakComplete=!0,i.enablePreloading=!0,this.manager=t.getAdsManager(this.player,i),this.cuePoints=this.manager.getCuePoints(),this.manager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,n=>this.onAdError(n)),Object.keys(google.ima.AdEvent.Type).forEach(n=>{this.manager.addEventListener(google.ima.AdEvent.Type[n],s=>this.onAdEvent(s))}),this.trigger("loaded")});m(this,"addCuePoints",()=>{r.empty(this.cuePoints)||this.cuePoints.forEach(t=>{if(t!==0&&t!==-1&&t<this.player.duration){const i=this.player.elements.progress;if(r.element(i)){const n=100/this.player.duration*t,s=b("span",{class:this.player.config.classNames.cues});s.style.left=`${n.toString()}%`,i.appendChild(s)}}})});m(this,"onAdEvent",t=>{const{container:i}=this.player.elements,n=t.getAd(),s=t.getAdData();switch((l=>{y.call(this.player,this.player.media,`ads${l.replace(/_/g,"").toLowerCase()}`)})(t.type),t.type){case google.ima.AdEvent.Type.LOADED:this.trigger("loaded"),this.pollCountdown(!0),n.isLinear()||(n.width=i.offsetWidth,n.height=i.offsetHeight);break;case google.ima.AdEvent.Type.STARTED:this.manager.setVolume(this.player.volume);break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:this.player.ended?this.loadAds():this.loader.contentComplete();break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:this.pauseContent();break;case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:this.pollCountdown(),this.resumeContent();break;case google.ima.AdEvent.Type.LOG:s.adError&&this.player.debug.warn(`Non-fatal ad error: ${s.adError.getMessage()}`);break}});m(this,"onAdError",t=>{this.cancel(),this.player.debug.warn("Ads error",t)});m(this,"listeners",()=>{const{container:t}=this.player.elements;let i;this.player.on("canplay",()=>{this.addCuePoints()}),this.player.on("ended",()=>{this.loader.contentComplete()}),this.player.on("timeupdate",()=>{i=this.player.currentTime}),this.player.on("seeked",()=>{const n=this.player.currentTime;r.empty(this.cuePoints)||this.cuePoints.forEach((s,a)=>{i<s&&s<n&&(this.manager.discardAdBreak(),this.cuePoints.splice(a,1))})}),window.addEventListener("resize",()=>{this.manager&&this.manager.resize(t.offsetWidth,t.offsetHeight,google.ima.ViewMode.NORMAL)})});m(this,"play",()=>{const{container:t}=this.player.elements;this.managerPromise||this.resumeContent(),this.managerPromise.then(()=>{this.manager.setVolume(this.player.volume),this.elements.displayContainer.initialize();try{this.initialized||(this.manager.init(t.offsetWidth,t.offsetHeight,google.ima.ViewMode.NORMAL),this.manager.start()),this.initialized=!0}catch(i){this.onAdError(i)}}).catch(()=>{})});m(this,"resumeContent",()=>{this.elements.container.style.zIndex="",this.playing=!1,F(this.player.media.play())});m(this,"pauseContent",()=>{this.elements.container.style.zIndex=3,this.playing=!0,this.player.media.pause()});m(this,"cancel",()=>{this.initialized&&this.resumeContent(),this.trigger("error"),this.loadAds()});m(this,"loadAds",()=>{this.managerPromise.then(()=>{this.manager&&this.manager.destroy(),this.managerPromise=new Promise(t=>{this.on("loaded",t),this.player.debug.log(this.manager)}),this.initialized=!1,this.requestAds()}).catch(()=>{})});m(this,"trigger",(t,...i)=>{const n=this.events[t];r.array(n)&&n.forEach(s=>{r.function(s)&&s.apply(this,i)})});m(this,"on",(t,i)=>(r.array(this.events[t])||(this.events[t]=[]),this.events[t].push(i),this));m(this,"startSafetyTimer",(t,i)=>{this.player.debug.log(`Safety timer invoked from: ${i}`),this.safetyTimer=setTimeout(()=>{this.cancel(),this.clearSafetyTimer("startSafetyTimer()")},t)});m(this,"clearSafetyTimer",t=>{r.nullOrUndefined(this.safetyTimer)||(this.player.debug.log(`Safety timer cleared from: ${t}`),clearTimeout(this.safetyTimer),this.safetyTimer=null)});this.player=t,this.config=t.config.ads,this.playing=!1,this.initialized=!1,this.elements={container:null,displayContainer:null},this.manager=null,this.loader=null,this.cuePoints=null,this.events={},this.safetyTimer=null,this.countdownTimer=null,this.managerPromise=new Promise((i,n)=>{this.on("loaded",i),this.on("error",n)}),this.load()}get enabled(){const{config:t}=this;return this.player.isHTML5&&this.player.isVideo&&t.enabled&&(!r.empty(t.publisherId)||r.url(t.tagUrl))}get tagUrl(){const{config:t}=this;if(r.url(t.tagUrl))return t.tagUrl;const i={AV_PUBLISHERID:"58c25bb0073ef448b1087ad6",AV_CHANNELID:"5a0458dc28a06145e4519d21",AV_URL:window.location.hostname,cb:Date.now(),AV_WIDTH:640,AV_HEIGHT:480,AV_CDIM2:t.publisherId};return`https://go.aniview.com/api/adserver6/vast/?${ht(i)}`}}function pt(e=0,t=0,i=255){return Math.min(Math.max(e,t),i)}function Ci(e){const t=[];
2return e.split(/\r\n\r\n|\n\n|\r\r/).forEach(n=>{const s={};n.split(/\r\n|\n|\r/).forEach(l=>{if(r.number(s.startTime)){if(!r.empty(l.trim())&&r.empty(s.text)){const o=l.trim().split("#xywh=");[s.text]=o,o[1]&&([s.x,s.y,s.w,s.h]=o[1].split(","))}}else{const o=l.match(/(\d{2})?:?(\d{2}):(\d{2}).(\d{2,3})( ?--> ?)(\d{2})?:?(\d{2}):(\d{2}).(\d{2,3})/);o&&(s.startTime=Number(o[1]||0)*60*60+Number(o[2])*60+Number(o[3])+ +`0.${o[4]}`,s.endTime=Number(o[6]||0)*60*60+Number(o[7])*60+Number(o[8])+ +`0.${o[9]}`)}}),s.text&&t.push(s)}),t}function Ue(e,t){const i=t.width/t.height,n={};return e>i?(n.width=t.width,n.height=1/e*t.width):(n.height=t.height,n.width=e*t.height),n}class Se{constructor(t){m(this,"load",()=>{this.player.elements.display.seekTooltip&&(this.player.elements.display.seekTooltip.hidden=this.enabled),this.enabled&&this.getThumbnails().then(()=>{this.enabled&&(this.render(),this.determineContainerAutoSizing(),this.listeners(),this.loaded=!0)})});m(this,"getThumbnails",()=>new Promise(t=>{const{src:i}=this.player.config.previewThumbnails;if(r.empty(i))throw new Error("Missing previewThumbnails.src config attribute");const n=()=>{this.thumbnails.sort((s,a)=>s.height-a.height),this.player.debug.log("Preview thumbnails",this.thumbnails),t()};if(r.function(i))i(s=>{this.thumbnails=s,n()});else{const a=(r.string(i)?[i]:i).map(l=>this.getThumbnail(l));Promise.all(a).then(n)}}));m(this,"getThumbnail",t=>new Promise(i=>{ne(t,void 0,this.player.config.previewThumbnails.withCredentials).then(n=>{const s={frames:Ci(n),height:null,urlPrefix:""};!s.frames[0].text.startsWith("/")&&!s.frames[0].text.startsWith("http://")&&!s.frames[0].text.startsWith("https://")&&(s.urlPrefix=t.substring(0,t.lastIndexOf("/")+1));const a=new Image;a.onload=()=>{s.height=a.naturalHeight,s.width=a.naturalWidth,this.thumbnails.push(s),i()},a.src=s.urlPrefix+s.frames[0].text})}));m(this,"startMove",t=>{var i,n;if(this.loaded&&!(!r.event(t)||!["touchmove","mousemove"].includes(t.type))&&this.player.media.duration){if(t.type==="touchmove")this.seekTime=this.player.media.duration*(this.player.elements.inputs.seek.value/100);else{const s=this.player.elements.progress.getBoundingClientRect(),a=100/s.width*(t.pageX-s.left);this.seekTime=this.player.media.duration*(a/100),this.seekTime<0&&(this.seekTime=0),this.seekTime>this.player.media.duration-1&&(this.seekTime=this.player.media.duration-1),this.mousePosX=t.pageX,this.elements.thumb.time.textContent=ge(this.seekTime);const l=(n=(i=this.player.config.markers)==null?void 0:i.points)==null?void 0:n.find(({time:o})=>o===Math.round(this.seekTime));l&&this.elements.thumb.time.insertAdjacentHTML("afterbegin",`${l.label}<br>`)}this.showImageAtCurrentTime()}});m(this,"endMove",()=>{this.toggleThumbContainer(!1,!0)});m(this,"startScrubbing",t=>{(r.nullOrUndefined(t.button)||t.button===!1||t.button===0)&&(this.mouseDown=!0,this.player.media.duration&&(this.toggleScrubbingContainer(!0),this.toggleThumbContainer(!1,!0),this.showImageAtCurrentTime()))});m(this,"endScrubbing",()=>{this.mouseDown=!1,Math.ceil(this.lastTime)===Math.ceil(this.player.media.currentTime)?this.toggleScrubbingContainer(!1):xe.call(this.player,this.player.media,"timeupdate",()=>{this.mouseDown||this.toggleScrubbingContainer(!1)})});m(this,"listeners",()=>{this.player.on("play",()=>{this.toggleThumbContainer(!1,!0)}),this.player.on("seeked",()=>{this.toggleThumbContainer(!1)}),this.player.on("timeupdate",()=>{this.lastTime=this.player.media.currentTime})});m(this,"render",()=>{this.elements.thumb.container=b("div",{class:this.player.config.classNames.previewThumbnails.thumbContainer}),this.elements.thumb.imageContainer=b("div",{class:this.player.config.classNames.previewThumbnails.imageContainer}),this.elements.thumb.container.appendChild(this.elements.thumb.imageContainer);const t=b("div",{class:this.player.config.classNames.previewThumbnails.timeContainer});this.elements.thumb.time=b("span",{},"00:00"),t.appendChild(this.elements.thumb.time),this.elements.thumb.imageContainer.appendChild(t),r.element(this.player.elements.progress)&&this.player.elements.progress.appendChild(this.elements.thumb.container),this.elements.scrubbing.container=b("div",{class:this.player.config.classNames.previewThumbnails.scrubbingContainer}),this.player.elements.wrapper.appendChild(this.elements.scrubbing.container)});m(this,"destroy",()=>{this.elements.thumb.container&&this.elements.thumb.container.remove(),this.elements.scrubbing.container&&this.elements.scrubbing.container.remove()});m(this,"showImageAtCurrentTime",()=>{this.mouseDown?this.setScrubbingContainerSize():this.setThumbContainerSizeAndPos();
2const t=this.thumbnails[0].frames.findIndex(s=>this.seekTime>=s.startTime&&this.seekTime<=s.endTime),i=t>=0;let n=0;this.mouseDown||this.toggleThumbContainer(i),i&&(this.thumbnails.forEach((s,a)=>{this.loadedImages.includes(s.frames[t].text)&&(n=a)}),t!==this.showingThumb&&(this.showingThumb=t,this.loadImage(n)))});m(this,"loadImage",(t=0)=>{const i=this.showingThumb,n=this.thumbnails[t],{urlPrefix:s}=n,a=n.frames[i],l=n.frames[i].text,o=s+l;if(!this.currentImageElement||this.currentImageElement.dataset.filename!==l){this.loadingImage&&this.usingSprites&&(this.loadingImage.onload=null);const c=new Image;c.src=o,c.dataset.index=i,c.dataset.filename=l,this.showingThumbFilename=l,this.player.debug.log(`Loading image: ${o}`),c.onload=()=>this.showImage(c,a,t,i,l,!0),this.loadingImage=c,this.removeOldImages(c)}else this.showImage(this.currentImageElement,a,t,i,l,!1),this.currentImageElement.dataset.index=i,this.removeOldImages(this.currentImageElement)});m(this,"showImage",(t,i,n,s,a,l=!0)=>{this.player.debug.log(`Showing thumb: ${a}. num: ${s}. qual: ${n}. newimg: ${l}`),this.setImageSizeAndOffset(t,i),l&&(this.currentImageContainer.appendChild(t),this.currentImageElement=t,this.loadedImages.includes(a)||this.loadedImages.push(a)),this.preloadNearby(s,!0).then(this.preloadNearby(s,!1)).then(this.getHigherQuality(n,t,i,a))});m(this,"removeOldImages",t=>{Array.from(this.currentImageContainer.children).forEach(i=>{if(i.tagName.toLowerCase()!=="img")return;const n=this.usingSprites?500:1e3;if(i.dataset.index!==t.dataset.index&&!i.dataset.deleting){i.dataset.deleting=!0;const{currentImageContainer:s}=this;setTimeout(()=>{s.removeChild(i),this.player.debug.log(`Removing thumb: ${i.dataset.filename}`)},n)}})});m(this,"preloadNearby",(t,i=!0)=>new Promise(n=>{setTimeout(()=>{const s=this.thumbnails[0].frames[t].text;if(this.showingThumbFilename===s){let a;i?a=this.thumbnails[0].frames.slice(t):a=this.thumbnails[0].frames.slice(0,t).reverse();let l=!1;a.forEach(o=>{const c=o.text;if(c!==s&&!this.loadedImages.includes(c)){l=!0,this.player.debug.log(`Preloading thumb filename: ${c}`);const{urlPrefix:u}=this.thumbnails[0],f=u+c,w=new Image;w.src=f,w.onload=()=>{this.player.debug.log(`Preloaded thumb filename: ${c}`),this.loadedImages.includes(c)||this.loadedImages.push(c),n()}}}),l||n()}},300)}));m(this,"getHigherQuality",(t,i,n,s)=>{if(t<this.thumbnails.length-1){let a=i.naturalHeight;this.usingSprites&&(a=n.h),a<this.thumbContainerHeight&&setTimeout(()=>{this.showingThumbFilename===s&&(this.player.debug.log(`Showing higher quality thumb for: ${s}`),this.loadImage(t+1))},300)}});m(this,"toggleThumbContainer",(t=!1,i=!1)=>{const n=this.player.config.classNames.previewThumbnails.thumbContainerShown;this.elements.thumb.container.classList.toggle(n,t),!t&&i&&(this.showingThumb=null,this.showingThumbFilename=null)});m(this,"toggleScrubbingContainer",(t=!1)=>{const i=this.player.config.classNames.previewThumbnails.scrubbingContainerShown;this.elements.scrubbing.container.classList.toggle(i,t),t||(this.showingThumb=null,this.showingThumbFilename=null)});m(this,"determineContainerAutoSizing",()=>{(this.elements.thumb.imageContainer.clientHeight>20||this.elements.thumb.imageContainer.clientWidth>20)&&(this.sizeSpecifiedInCSS=!0)});m(this,"setThumbContainerSizeAndPos",()=>{const{imageContainer:t}=this.elements.thumb;if(this.sizeSpecifiedInCSS){if(t.clientHeight>20&&t.clientWidth<20){const i=Math.floor(t.clientHeight*this.thumbAspectRatio);t.style.width=`${i}px`}else if(t.clientHeight<20&&t.clientWidth>20){const i=Math.floor(t.clientWidth/this.thumbAspectRatio);t.style.height=`${i}px`}}else{const i=Math.floor(this.thumbContainerHeight*this.thumbAspectRatio);t.style.height=`${this.thumbContainerHeight}px`,t.style.width=`${i}px`}this.setThumbContainerPos()});m(this,"setThumbContainerPos",()=>{const t=this.player.elements.progress.getBoundingClientRect(),i=this.player.elements.container.getBoundingClientRect(),{container:n}=this.elements.thumb,s=i.left-t.left+10,a=i.right-t.left-n.clientWidth-10,l=this.mousePosX-t.left-n.clientWidth/2,o=pt(l,s,a);n.style.left=`${o}px`,n.style.setProperty("--preview-arrow-offset",`${l-o}px`)});m(this,"setScrubbingContainerSize",()=>{const{width:t,height:i}=Ue(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight});this.elements.scrubbing.container.style.width=`${t}px`,this.elements.scrubbing.container.style.height=`${i}px`});m(this,"setImageSizeAndOffset",(t,i)=>{if(!this.usingSprites)return;const n=this.thumbContainerHeight/i.h;t.style.height=`${t.naturalHeight*n}
2px`,t.style.width=`${t.naturalWidth*n}px`,t.style.left=`-${i.x*n}px`,t.style.top=`-${i.y*n}px`});this.player=t,this.thumbnails=[],this.loaded=!1,this.lastMouseMoveTime=Date.now(),this.mouseDown=!1,this.loadedImages=[],this.elements={thumb:{},scrubbing:{}},this.load()}get enabled(){return this.player.isHTML5&&this.player.isVideo&&this.player.config.previewThumbnails.enabled}get currentImageContainer(){return this.mouseDown?this.elements.scrubbing.container:this.elements.thumb.imageContainer}get usingSprites(){return Object.keys(this.thumbnails[0].frames[0]).includes("w")}get thumbAspectRatio(){return this.usingSprites?this.thumbnails[0].frames[0].w/this.thumbnails[0].frames[0].h:this.thumbnails[0].width/this.thumbnails[0].height}get thumbContainerHeight(){if(this.mouseDown){const{height:t}=Ue(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight});return t}return this.sizeSpecifiedInCSS?this.elements.thumb.imageContainer.clientHeight:Math.floor(this.player.media.clientWidth/this.thumbAspectRatio/4)}get currentImageElement(){return this.mouseDown?this.currentScrubbingImageElement:this.currentThumbnailImageElement}set currentImageElement(t){this.mouseDown?this.currentScrubbingImageElement=t:this.currentThumbnailImageElement=t}}const Pe={insertElements(e,t){r.string(t)?Re(e,this.media,{src:t}):r.array(t)&&t.forEach(i=>{Re(e,this.media,i)})},change(e){if(!tt(e,"sources.length")){this.debug.warn("Invalid source format");return}z.cancelRequests.call(this),this.destroy(()=>{this.options.quality=[],U(this.media),this.media=null,r.element(this.elements.container)&&this.elements.container.removeAttribute("class");const{sources:t,type:i}=e,[{provider:n=W.html5,src:s}]=t,a=n==="html5"?i:"div",l=n==="html5"?{}:{src:s};Object.assign(this,{provider:n,type:i,supported:$.check(i,n,this.config.playsinline),media:b(a,l)}),this.elements.container.appendChild(this.media),r.boolean(e.autoplay)&&(this.config.autoplay=e.autoplay),this.isHTML5&&(this.config.crossorigin&&this.media.setAttribute("crossorigin",""),this.config.autoplay&&this.media.setAttribute("autoplay",""),r.empty(e.poster)||(this.poster=e.poster),this.config.loop.active&&this.media.setAttribute("loop",""),this.config.muted&&this.media.setAttribute("muted",""),this.config.playsinline&&this.media.setAttribute("playsinline","")),S.addStyleHook.call(this),this.isHTML5&&Pe.insertElements.call(this,"source",t),this.config.title=e.title,mt.setup.call(this),this.isHTML5&&Object.keys(e).includes("tracks")&&Pe.insertElements.call(this,"track",e.tracks),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&S.build.call(this),this.isHTML5&&this.media.load(),r.empty(e.previewThumbnails)||(Object.assign(this.config.previewThumbnails,e.previewThumbnails),this.previewThumbnails&&this.previewThumbnails.loaded&&(this.previewThumbnails.destroy(),this.previewThumbnails=null),this.config.previewThumbnails.enabled&&(this.previewThumbnails=new Se(this))),this.fullscreen.update()},!0)}};class me{constructor(t,i){m(this,"play",()=>r.function(this.media.play)?(this.ads&&this.ads.enabled&&this.ads.managerPromise.then(()=>this.ads.play()).catch(()=>F(this.media.play())),this.media.play()):null);m(this,"pause",()=>!this.playing||!r.function(this.media.pause)?null:this.media.pause());m(this,"togglePlay",t=>(r.boolean(t)?t:!this.playing)?this.play():this.pause());m(this,"stop",()=>{this.isHTML5?(this.pause(),this.restart()):r.function(this.media.stop)&&this.media.stop()});m(this,"restart",()=>{this.currentTime=0});m(this,"rewind",t=>{this.currentTime-=r.number(t)?t:this.config.seekTime});m(this,"forward",t=>{this.currentTime+=r.number(t)?t:this.config.seekTime});m(this,"increaseVolume",t=>{const i=this.media.muted?0:this.volume;this.volume=i+(r.number(t)?t:0)});m(this,"decreaseVolume",t=>{this.increaseVolume(-t)});m(this,"airplay",()=>{$.airplay&&this.media.webkitShowPlaybackTargetPicker()});m(this,"toggleControls",t=>{if(this.supported.ui&&!this.isAudio){const i=he(this.elements.container,this.config.classNames.hideControls),n=typeof t>"u"?void 0:!t,s=E(this.elements.container,this.config.classNames.hideControls,n);if(s&&r.array(this.config.controls)&&this.config.controls.includes("settings")&&!r.empty(this.config.settings)&&d.toggleMenu.call(this,!1),s!==i){const a=s?"controlshidden":"controlsshown";y.call(this,this.media,a)}return!s}return!1});m(this,"on",(t,i)=>{T.call(this,this.elements.container,t,i)});m(this,"once",(t,i)=>{xe.call(this,this.elements.container,t,i)});m(this,"off",(t,i)=>{fe(this.elements.container,t,i)});m(this,"destroy",(t,i=!1)=>
2{if(!this.ready)return;const n=()=>{document.body.style.overflow="",this.embed=null,i?(Object.keys(this.elements).length&&(U(this.elements.buttons.play),U(this.elements.captions),U(this.elements.controls),U(this.elements.wrapper),this.elements.buttons.play=null,this.elements.captions=null,this.elements.controls=null,this.elements.wrapper=null),r.function(t)&&t()):(Yt.call(this),z.cancelRequests.call(this),ue(this.elements.original,this.elements.container),y.call(this,this.elements.original,"destroyed",!0),r.function(t)&&t.call(this.elements.original),this.ready=!1,setTimeout(()=>{this.elements=null,this.media=null},200))};this.stop(),clearTimeout(this.timers.loading),clearTimeout(this.timers.controls),clearTimeout(this.timers.resized),this.isHTML5?(S.toggleNativeControls.call(this,!0),n()):this.isYouTube?(clearInterval(this.timers.buffering),clearInterval(this.timers.playing),this.embed!==null&&r.function(this.embed.destroy)&&this.embed.destroy(),n()):this.isVimeo&&(this.embed!==null&&this.embed.unload().then(n),setTimeout(n,200))});m(this,"supports",t=>$.mime.call(this,t));if(this.timers={},this.ready=!1,this.loading=!1,this.failed=!1,this.touch=$.touch,this.media=t,r.string(this.media)&&(this.media=document.querySelectorAll(this.media)),(window.jQuery&&this.media instanceof jQuery||r.nodeList(this.media)||r.array(this.media))&&(this.media=this.media[0]),this.config=L({},dt,me.defaults,i||{},(()=>{try{return JSON.parse(this.media.getAttribute("data-plyr-config"))}catch{return{}}})()),this.elements={container:null,fullscreen:null,captions:null,buttons:{},display:{},progress:{},inputs:{},settings:{popup:null,menu:null,panels:{},buttons:{}}},this.captions={active:null,currentTrack:-1,meta:new WeakMap},this.fullscreen={active:!1},this.options={speed:[],quality:[]},this.debug=new hi(this.config.debug),this.debug.log("Config",this.config),this.debug.log("Support",$),r.nullOrUndefined(this.media)||!r.element(this.media)){this.debug.error("Setup failed: no suitable element passed");return}if(this.media.plyr){this.debug.warn("Target already setup");return}if(!this.config.enabled){this.debug.error("Setup failed: disabled by config");return}if(!$.check().api){this.debug.error("Setup failed: no support");return}const n=this.media.cloneNode(!0);n.autoplay=!1,this.elements.original=n;const s=this.media.tagName.toLowerCase();let a=null,l=null;switch(s){case"div":if(a=this.media.querySelector("iframe"),r.element(a)){if(l=ut(a.getAttribute("src")),this.provider=ui(l.toString()),this.elements.container=this.media,this.media=a,this.elements.container.className="",l.search.length){const o=["1","true"];o.includes(l.searchParams.get("autoplay"))&&(this.config.autoplay=!0),o.includes(l.searchParams.get("loop"))&&(this.config.loop.active=!0),this.isYouTube?(this.config.playsinline=o.includes(l.searchParams.get("playsinline")),this.config.youtube.hl=l.searchParams.get("hl")):this.config.playsinline=!0}}else this.provider=this.media.getAttribute(this.config.attributes.embed.provider),this.media.removeAttribute(this.config.attributes.embed.provider);if(r.empty(this.provider)||!Object.values(W).includes(this.provider)){this.debug.error("Setup failed: Invalid provider");return}this.type=we.video;break;case"video":case"audio":this.type=s,this.provider=W.html5,this.media.hasAttribute("crossorigin")&&(this.config.crossorigin=!0),this.media.hasAttribute("autoplay")&&(this.config.autoplay=!0),(this.media.hasAttribute("playsinline")||this.media.hasAttribute("webkit-playsinline"))&&(this.config.playsinline=!0),this.media.hasAttribute("muted")&&(this.config.muted=!0),this.media.hasAttribute("loop")&&(this.config.loop.active=!0);break;default:this.debug.error("Setup failed: unsupported type");return}if(this.supported=$.check(this.type,this.provider),!this.supported.api){this.debug.error("Setup failed: no support");return}this.eventListeners=[],this.listeners=new di(this),this.storage=new te(this),this.media.plyr=this,r.element(this.elements.container)||(this.elements.container=b("div"),it(this.media,this.elements.container)),S.migrateStyles.call(this),S.addStyleHook.call(this),mt.setup.call(this),this.config.debug&&T.call(this,this.elements.container,this.config.events.join(" "),o=>{this.debug.log(`event: ${o.type}`)}),this.fullscreen=new q(this),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&S.build.call(this),this.listeners.container(),this.listeners.global(),this.config.ads.enabled&&(this.ads=new Ti(this)),this.isHTML5&&this.config.auto
2play&&this.once("canplay",()=>F(this.play())),this.lastSeekTime=0,this.config.previewThumbnails.enabled&&(this.previewThumbnails=new Se(this))}get isHTML5(){return this.provider===W.html5}get isEmbed(){return this.isYouTube||this.isVimeo}get isYouTube(){return this.provider===W.youtube}get isVimeo(){return this.provider===W.vimeo}get isVideo(){return this.type===we.video}get isAudio(){return this.type===we.audio}get playing(){return!!(this.ready&&!this.paused&&!this.ended)}get paused(){return!!this.media.paused}get stopped(){return!!(this.paused&&this.currentTime===0)}get ended(){return!!this.media.ended}set currentTime(t){if(!this.duration)return;const i=r.number(t)&&t>0;this.media.currentTime=i?Math.min(t,this.duration):0,this.debug.log(`Seeking to ${this.currentTime} seconds`)}get currentTime(){return Number(this.media.currentTime)}get buffered(){const{buffered:t}=this.media;return r.number(t)?t:t&&t.length&&this.duration>0?t.end(0)/this.duration:0}get seeking(){return!!this.media.seeking}get duration(){const t=Number.parseFloat(this.config.duration),i=(this.media||{}).duration,n=!r.number(i)||i===1/0?0:i;return t||n}set volume(t){let i=t;const n=1,s=0;r.string(i)&&(i=Number(i)),r.number(i)||(i=this.storage.get("volume")),r.number(i)||({volume:i}=this.config),i>n&&(i=n),i<s&&(i=s),this.config.volume=i,this.media.volume=i,!r.empty(t)&&this.muted&&i>0&&(this.muted=!1)}get volume(){return Number(this.media.volume)}set muted(t){let i=t;r.boolean(i)||(i=this.storage.get("muted")),r.boolean(i)||(i=this.config.muted),this.config.muted=i,this.media.muted=i}get muted(){return!!this.media.muted}get hasAudio(){return!this.isHTML5||this.isAudio?!0:!!this.media.mozHasAudio||!!this.media.webkitAudioDecodedByteCount||!!(this.media.audioTracks&&this.media.audioTracks.length)}set speed(t){let i=null;r.number(t)&&(i=t),r.number(i)||(i=this.storage.get("speed")),r.number(i)||(i=this.config.speed.selected);const{minimumSpeed:n,maximumSpeed:s}=this;i=pt(i,n,s),this.config.speed.selected=i,setTimeout(()=>{this.media&&(this.media.playbackRate=i)},0)}get speed(){return Number(this.media.playbackRate)}get minimumSpeed(){return this.isYouTube?Math.min(...this.options.speed):this.isVimeo?.5:.0625}get maximumSpeed(){return this.isYouTube?Math.max(...this.options.speed):this.isVimeo?2:16}set quality(t){const i=this.config.quality,n=this.options.quality;if(!n.length)return;let s=[!r.empty(t)&&Number(t),this.storage.get("quality"),i.selected,i.default].find(r.number),a=!0;if(!n.includes(s)){const l=st(n,s);this.debug.warn(`Unsupported quality option: ${s}, using ${l} instead`),s=l,a=!1}i.selected=s,this.media.quality=s,a&&this.storage.set({quality:s})}get quality(){return this.media.quality}set loop(t){const i=r.boolean(t)?t:this.config.loop.active;this.config.loop.active=i,this.media.loop=i}get loop(){return!!this.media.loop}set source(t){Pe.change.call(this,t)}get source(){return this.media.currentSrc}get download(){const{download:t}=this.config.urls;return r.url(t)?t:this.source}set download(t){r.url(t)&&(this.config.urls.download=t,d.setDownloadUrl.call(this))}set poster(t){if(!this.isVideo){this.debug.warn("Poster can only be set for video");return}S.setPoster.call(this,t,!1).catch(()=>{})}get poster(){return this.isVideo?this.media.getAttribute("poster")||this.media.getAttribute("data-poster"):null}get ratio(){if(!this.isVideo)return null;const t=de(Le.call(this));return r.array(t)?t.join(":"):t}set ratio(t){if(!this.isVideo){this.debug.warn("Aspect ratio can only be set for video");return}if(!r.string(t)||!rt(t)){this.debug.error(`Invalid aspect ratio specified (${t})`);return}this.config.ratio=de(t),X.call(this)}set autoplay(t){this.config.autoplay=r.boolean(t)?t:this.config.autoplay}get autoplay(){return!!this.config.autoplay}toggleCaptions(t){C.toggle.call(this,t,!1)}set currentTrack(t){C.set.call(this,t,!1),C.setup.call(this)}get currentTrack(){const{toggled:t,currentTrack:i}=this.captions;return t?i:-1}set language(t){C.setLanguage.call(this,t,!1)}get language(){return(C.getCurrentTrack.call(this)||{}).language}set pip(t){if(!$.pip)return;const i=r.boolean(t)?t:!this.pip;r.function(this.media.webkitSetPresentationMode)&&this.media.webkitSetPresentationMode(i?ye.active:ye.inactive),r.function(this.media.requestPictureInPicture)&&(!this.pip&&i?this.media.requestPictureInPicture():this.pip&&!i&&document.exitPictureInPicture())}get pip(){return $.pip?r.empty(this.media.webkitPresentationMode)?this.media===document.pictureInPictureElement:this.media.webkitPresentationMode===ye.active:null}setPreviewThumbnails(t){this.previewThumbnails&&this.previewThumbnails.loaded&&(this.previewThumbnails.destroy(),this.previewThumbnails=null),Object.assign(this.config.previewThumbnails,t),this.config.previewThumbnails.enabled&&(this.previewThumbnails=new Se(this))}
vendor: 321 bytes, line 2
2static supported(t,i){return $.check(t,i)}static loadSprite(t,i){return ot(t,i)}static setup(t,i={}){let n=null;return r.string(t)?n=Array.from(document.querySelectorAll(t)):r.nodeList(t)?n=Array.from(t):r.array(t)&&(n=t.filter(r.element)),r.empty(n)?null:n.map(s=>new me(s,i))}}me.defaults=Bt(dt);export{me as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.