|
2
|
|
-(()=>{var e={1020:(e,t,i)=>{"use strict";var s=i(1609),n=Symbol.for("react.element"),a=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),r=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};t.jsx=function(e,t,i){var s,l={},c=null,u=null;for(s in void 0!==i&&(c=""+i),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)a.call(t,s)&&!o.hasOwnProperty(s)&&(l[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps)void 0===l[s]&&(l[s]=t[s]);return{$$typeof:n,type:e,key:c,ref:u,props:l,_owner:r.current}}},1609:e=>{"use strict";e.exports=window.React},2694:(e,t,i)=>{"use strict";var s=i(6925);function n(){}function a(){}a.resetWarningCache=n,e.exports=function(){function e(e,t,i,n,a,r){if(r!==s){var o=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw o.name="Invariant Violation",o}}function t(){return e}e.isRequired=e;var i={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:n};return i.PropTypes=i,i}},4848:(e,t,i)=>{"use strict";e.exports=i(1020)},5338:(e,t,i)=>{"use strict";var s=i(5795);t.H=s.createRoot,s.hydrateRoot},5556:(e,t,i)=>{e.exports=i(2694)()},5795:e=>{"use strict";e.exports=window.ReactDOM},6925:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}},t={};function i(s){var n=t[s];if(void 0!==n)return n.exports;var a=t[s]={exports:{}};return e[s](a,a.exports,i),a.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var s in t)i.o(t,s)&&!i.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";var e=i(1609),t=i(5338);const s=e=>!(null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length||"string"==typeof e&&""===e.trim()||"number"==typeof e&&0===e),n=e=>{try{const t=new URL(e);return["http:","https:"].includes(t.protocol)?t.toString():null}catch(t){return"string"==typeof e&&e.startsWith("/")&&!e.startsWith("//")?e:null}},a=e=>{const t=(new DOMParser).parseFromString(e,"text/html"),i=["b","strong","i","em","span","a","br"],s=["style","href","target","rel","class"];return t.body.querySelectorAll("*").forEach((e=>{i.includes(e.tagName.toLowerCase())?[...e.attributes].forEach((t=>{if(s.includes(t.name)||e.removeAttribute(t.name),"href"===t.name){const i=n(t.value);i?e.setAttribute("href",i):e.removeAttribute("href")}})):e.remove()})),t.body.innerHTML},r=t=>{const{data:i=null,isLoading:s}=((t,i={},s=!0)=>{const[n,a]=(0,e.useState)(!1),[r,o]=(0,e.useState)(!1),[l,c]=(0,e.useState)(null),[u,d]=(0,e.useState)(null);if(!wp.ajax)return void console.error("Please use wp-util as a dependency");const h=(e={})=>{a(!0),o(!1),c(null),wp.ajax.post(t,{...i,...e}).done((e=>{a(!1),d(e)})).fail((e=>{a(!1),o(!0),c(e)}))},p=(e={})=>{h(e)};return(0,e.useEffect)((()=>{s&&h(i)}),[]),{data:u,saveData:p,refetch:p,isLoading:n,isError:r,error:l}})("bBlocksPipeChecker",{_wpnonce:t});return{isPremium:!s&&i?.isPipe||!1,isLoading:s}},o="bBlocksButton",l=(e,t="none",i,s,a=!1)=>{const{actionType:r="link",url:l,tooltip:c,tooltipPos:u="top",target:d,attrs:h={rel:"noreferrer",referrerpolicy:"no-referrer"},isDownload:p,downloadFileName:m="",animationType:g,animationDuration:f,addID:y}=e,b=h?.referrerpolicy||"no-referrer",v=h?.rel||"noreferrer",w=l&&(i||"none"===t)?{href:n(l)}:{},k="popup"===r||a?{}:{...w,target:d,...s?{referrerPolicy:b,rel:v}:{},...p?{download:s?m:""}:{}};return{className:a?`${o} btnEditor`:o,...k,tooltip:c,"tooltip-pos":s?u:"top","data-aos":g,"data-aos-duration":1e3*f,id:y}},c=({attributes:t})=>{const{isUpIcon:i,icon:s,upIcon:n}=t;return(0,e.createElement)(e.Fragment,null,i&&n?.url&&(0,e.createElement)("img",{src:n?.url,alt:n?.alt}),!i&&s?.class&&(0,e.createElement)("i",{className:s?.class}))};var u=i(4848);function d(e,t,i){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var s=i.call(e,t);if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function h(e,t){for(var i=0;i<t.length;i++){var s=t[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}function p(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function m(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,s)}return i}function g(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?m(Object(i),!0).forEach((function(t){p(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):m(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var f={addCSS:!0,thumbWidth:15,watch:!0},y=function(e){return null!=e?e.constructor:null},b=function(e,t){return!!(e&&t&&e instanceof t)},v=function(e){return y(e)===String},w=function(e){return Array.isArray(e)},k=function(e){return b(e,NodeList)},T=v,E=w,C=k,S=function(e){return b(e,Element)},P=function(e){return b(e,Event)},A=function(e){return function(e){return null==e}(e)||(v(e)||w(e)||k(e))&&!e.length||function(e){return y(e)===Object}(e)&&!Object.keys(e).length};var x=function(){function e(t,i){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),S(t)?this.element=t:T(t)&&(this.element=document.querySelector(t)),S(this.element)&&A(this.element.rangeTouch)&&(this.config=g({},f,{},i),this.init())}return function(e,t,i){t&&h(e.prototype,t),i&&h(e,i)}(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(e){var t=this,i=e?"addEventListener":"removeEventListener";["touchstart","touchmove","touchend"].forEach((function(e){t.element[i](e,(function(e){return t.set(e)}),!1)}))}},{key:"get",value:function(t){if(!e.enabled||!P(t))return null;var i,s=t.target,n=t.changedTouches[0],a=parseFloat(s.getAttribute("min"))||0,r=parseFloat(s.getAttribute("max"))||100,o=parseFloat(s.getAttribute("step"))||1,l=s.getBoundingClientRect(),c=100/l.width*(this.config.thumbWidth/2)/100;return 0>(i=100/l.width*(n.clientX-l.left))?i=0:100<i&&(i=100),50>i?i-=(100-2*i)*c:50<i&&(i+=2*(i-50)*c),a+function(e,t){if(1>t){var i=function(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}(t);return parseFloat(e.toFixed(i))}return Math.round(e/t)*t}(i/100*(r-a),o)}},{key:"set",value:function(t){e.enabled&&P(t)&&!t.target.disabled&&(t.preventDefault(),t.target.value=this.get(t),function(e,t){if(e&&t){var i=new Event(t,{bubbles:!0});e.dispatchEvent(i)}}(t.target,"touchend"===t.type?"change":"input"))}}],[{key:"setup",value:function(t){var i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},s=null;if(A(t)||T(t)?s=Array.from(document.querySelectorAll(T(t)?t:'input[type="range"]')):S(t)?s=[t]:C(t)?s=Array.from(t):E(t)&&(s=t.filter(S)),A(s))return null;var n=g({},f,{},i);if(T(t)&&n.watch){var a=new MutationObserver((function(i){Array.from(i).forEach((function(i){Array.from(i.addedNodes).forEach((function(i){S(i)&&function(e,t){return function(){return Array.from(document.querySelectorAll(t)).includes(this)}.call(e,t)}(i,t)&&new e(i,n)}))}))}));a.observe(document.body,{childList:!0,subtree:!0})}return s.map((function(t){return new e(t,i)}))}},{key:"enabled",get:function(){return"ontouchstart"in document.documentElement}}]),e}();const $=e=>null!=e?e.constructor:null,N=(e,t)=>Boolean(e&&t&&e instanceof t),M=e=>null==e,L=e=>$(e)===Object,I=e=>$(e)===String,_=e=>"function"==typeof e,O=e=>Array.isArray(e),j=e=>N(e,NodeList);function R(e){return M(e)||(I(e)||O(e)||j(e))&&!e.length||L(e)&&!Object.keys(e).length}var D={nullOrUndefined:M,object:L,number:e=>$(e)===Number&&!Number.isNaN(e),string:I,boolean:e=>$(e)===Boolean,function:_,array:O,weakMap:e=>N(e,WeakMap),nodeList:j,element:function(e){return null!==e&&"object"==typeof e&&1===e.nodeType&&"object"==typeof e.style&&"object"==typeof e.ownerDocument},textNode:e=>$(e)===Text,event:e=>N(e,Event),keyboardEvent:e=>N(e,KeyboardEvent),cue:e=>N(e,window.TextTrackCue)||N(e,window.VTTCue),track:e=>N(e,TextTrack)||!M(e)&&I(e.kind),promise:e=>N(e,Promise)&&_(e.then),url:function(e){if(N(e,window.URL))return!0;if(!I(e))return!1;let t=e;e.startsWith("http://")&&e.startsWith("https://")||(t=`http://${e}`);try{return!R(new URL(t).hostname)}catch{return!1}},empty:R};const F=(()=>{const e=document.createElement("span"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},i=Object.keys(t).find((t=>void 0!==e.style[t]));return!!D.string(i)&&t[i]})();function H(e,t){setTimeout((()=>{try{e.hidden=!0,e.offsetHeight,e.hidden=!1}catch{}}),t)}function q(e,t){return t.split(".").reduce(((e,t)=>e&&e[t]),e)}function V(e={},...t){if(!t.length)return e;const i=t.shift();return D.object(i)?(Object.keys(i).forEach((t=>{D.object(i[t])?(Object.keys(e).includes(t)||Object.assign(e,{[t]:{}}),V(e[t],i[t])):Object.assign(e,{[t]:i[t]})})),V(e,...t)):e}function B(e,t){const i=e.length?e:[e];Array.from(i).reverse().forEach(((e,i)=>{const s=i>0?t.cloneNode(!0):t,n=e.parentNode,a=e.nextSibling;s.appendChild(e),a?n.insertBefore(s,a):n.appendChild(s)}))}function U(e,t){D.element(e)&&!D.empty(t)&&Object.entries(t).filter((([,e])=>!D.nullOrUndefined(e))).forEach((([t,i])=>e.setAttribute(t,i)))}function W(e,t,i){const s=document.createElement(e);return D.object(t)&&U(s,t),D.string(i)&&(s.textContent=i),s}function z(e,t,i,s){D.element(t)&&t.appendChild(W(e,i,s))}function K(e){D.nodeList(e)||D.array(e)?Array.from(e).forEach(K):D.element(e)&&D.element(e.parentNode)&&e.parentNode.removeChild(e)}function Y(e){if(!D.element(e))return;let{length:t}=e.childNodes;for(;t>0;)e.removeChild(e.lastChild),t-=1}function Q(e,t){return D.element(t)&&D.element(t.parentNode)&&D.element(e)?(t.parentNode.replaceChild(e,t),e):null}function X(e,t){if(!D.string(e)||D.empty(e))return{};const i={},s=V({},t);return e.split(",").forEach((e=>{const t=e.trim(),n=t.replace(".",""),a=t.replace(/[[\]]/g,"").split("="),[r]=a,o=a.length>1?a[1].replace(/["']/g,""):"";switch(t.charAt(0)){case".":D.string(s.class)?i.class=`${s.class} ${n}`:i.class=n;break;case"#":i.id=t.replace("#","");break;case"[":i[r]=o}})),V(s,i)}function J(e,t){if(!D.element(e))return;let i=t;D.boolean(i)||(i=!e.hidden),e.hidden=i}function G(e,t,i){if(D.nodeList(e))return Array.from(e).map((e=>G(e,t,i)));if(D.element(e)){let s="toggle";return void 0!==i&&(s=i?"add":"remove"),e.classList[s](t),e.classList.contains(t)}return!1}function Z(e,t){return D.element(e)&&e.classList.contains(t)}function ee(e,t){const{prototype:i}=Element;return(i.matches||i.webkitMatchesSelector||i.mozMatchesSelector||i.msMatchesSelector||function(){return Array.from(document.querySelectorAll(t)).includes(this)}).call(e,t)}function te(e){return this.elements.container.querySelectorAll(e)}function ie(e){return this.elements.container.querySelector(e)}function se(e=null,t=!1){D.element(e)&&e.focus({preventScroll:!0,focusVisible:t})}const ne={"audio/ogg":"vorbis","audio/wav":"1","video/webm":"vp8, vorbis","video/mp4":"avc1.42E01E, mp4a.40.2","video/ogg":"theora"},ae={audio:"canPlayType"in document.createElement("audio"),video:"canPlayType"in document.createElement("video"),check(e,t){const i=ae[e]||"html5"!==t;return{api:i,ui:i&&ae.rangeInput}},pip:document.pictureInPictureEnabled&&!W("video").disablePictureInPicture,airplay:D.function(window.WebKitPlaybackTargetAvailabilityEvent),playsinline:"playsInline"in document.createElement("video"),mime(e){if(D.empty(e))return!1;const[t]=e.split("/");let i=e;if(!this.isHTML5||t!==this.type)return!1;Object.keys(ne).includes(i)&&(i+=`; codecs="${ne[e]}"`);try{return Boolean(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","range"===e.type})(),touch:"ontouchstart"in document.documentElement,transitions:!1!==F,reducedMotion:"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches},re=(()=>{let e=!1;try{const t=Object.defineProperty({},"passive",{get:()=>(e=!0,null)});window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch{}return e})();function oe(e,t,i,s=!1,n=!0,a=!1){if(!e||!("addEventListener"in e)||D.empty(t)||!D.function(i))return;const r=t.split(" ");let o=a;re&&(o={passive:n,capture:a}),r.forEach((t=>{this&&this.eventListeners&&s&&this.eventListeners.push({element:e,type:t,callback:i,options:o}),e[s?"addEventListener":"removeEventListener"](t,i,o)}))}function le(e,t="",i,s=!0,n=!1){oe.call(this,e,t,i,!0,s,n)}function ce(e,t="",i,s=!0,n=!1){oe.call(this,e,t,i,!1,s,n)}function ue(e,t="",i,s=!0,n=!1){const a=(...r)=>{ce(e,t,a,s,n),i.apply(this,r)};oe.call(this,e,t,a,!0,s,n)}function de(e,t="",i=!1,s={}){if(!D.element(e)||D.empty(t))return;const n=new CustomEvent(t,{bubbles:i,detail:{...s,plyr:this}});e.dispatchEvent(n)}function he(){this&&this.eventListeners&&(this.eventListeners.forEach((e=>{const{element:t,type:i,callback:s,options:n}=e;t.removeEventListener(i,s,n)})),this.eventListeners=[])}function pe(){return new Promise((e=>this.ready?setTimeout(e,0):le.call(this,this.elements.container,"ready",e))).then((()=>{}))}function me(e){D.promise(e)&&e.then(null,(()=>{}))}function ge(e){return D.array(e)?e.filter(((t,i)=>e.indexOf(t)===i)):e}function fe(e,t){return D.array(e)&&e.length?e.reduce(((e,i)=>Math.abs(i-t)<Math.abs(e-t)?i:e)):null}function ye(e){return!(!window||!window.CSS)&&window.CSS.supports(e)}const be=[[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 ve(e){return!!(D.array(e)||D.string(e)&&e.includes(":"))&&(D.array(e)?e:e.split(":")).map(Number).every(D.number)}function we(e){if(!D.array(e)||!e.every(D.number))return null;const[t,i]=e,s=(e,t)=>0===t?e:s(t,e%t),n=s(t,i);return[t/n,i/n]}function ke(e){const t=e=>ve(e)?e.split(":").map(Number):null;let i=t(e);if(null===i&&(i=t(this.config.ratio)),null===i&&!D.empty(this.embed)&&D.array(this.embed.ratio)&&({ratio:i}=this.embed),null===i&&this.isHTML5){const{videoWidth:e,videoHeight:t}=this.media;i=[e,t]}return we(i)}function Te(e){if(!this.isVideo)return{};const{wrapper:t}=this.elements,i=ke.call(this,e);if(!D.array(i))return{};const[s,n]=we(i),a=100/s*n;if(ye(`aspect-ratio: ${s}/${n}`)?t.style.aspectRatio=`${s}/${n}`:t.style.paddingBottom=`${a}%`,this.isVimeo&&!this.config.vimeo.premium&&this.supported.ui){const e=100/this.media.offsetWidth*Number.parseInt(window.getComputedStyle(this.media).paddingBottom,10),i=(e-a)/(e/50);this.fullscreen.active?t.style.paddingBottom=null:this.media.style.transform=`translateY(-${i}%)`}else this.isHTML5&&t.classList.add(this.config.classNames.videoFixedRatio);return{padding:a,ratio:i}}function Ee(e,t,i=.05){const s=e/t,n=fe(Object.keys(be),s);return Math.abs(n-s)<=i?be[n]:[e,t]}const Ce={getSources(){return this.isHTML5?Array.from(this.media.querySelectorAll("source")).filter((e=>{const t=e.getAttribute("type");return!!D.empty(t)||ae.mime.call(this,t)})):[]},getQualityOptions(){return this.config.quality.forced?this.config.quality.options:Ce.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,D.empty(this.config.ratio)||Te.call(e),Object.defineProperty(e.media,"quality",{get(){const t=Ce.getSources.call(e).find((t=>t.getAttribute("src")===e.source));return t&&Number(t.getAttribute("size"))},set(t){if(e.quality!==t){if(e.config.quality.forced&&D.function(e.config.quality.onChange))e.config.quality.onChange(t);else{const i=Ce.getSources.call(e).find((e=>Number(e.getAttribute("size"))===t));if(!i)return;const{currentTime:s,paused:n,preload:a,readyState:r,playbackRate:o}=e.media;e.media.src=i.getAttribute("src"),("none"!==a||r)&&(e.once("loadedmetadata",(()=>{e.speed=o,e.currentTime=s,n||me(e.play())})),e.media.load())}de.call(e,e.media,"qualitychange",!1,{quality:t})}}})},cancelRequests(){this.isHTML5&&(K(Ce.getSources.call(this)),this.media.setAttribute("src",this.config.blankVideo),this.media.load(),this.debug.log("Cancelled network requests"))}};var Se={isIE:Boolean(window.document.documentMode),isEdge:/Edge/.test(navigator.userAgent),isWebKit:"WebkitAppearance"in document.documentElement.style&&!/Edge/.test(navigator.userAgent),isIPadOS:"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1,isIos:/iPad|iPhone|iPod/i.test(navigator.userAgent)&&navigator.maxTouchPoints>1};function Pe(e,...t){return D.empty(e)?e:e.toString().replace(/\{(\d+)\}/g,((e,i)=>t[i].toString()))}function Ae(e="",t="",i=""){return e.replace(new RegExp(t.toString().replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1"),"g"),i.toString())}function xe(e=""){return e.toString().replace(/\w\S*/g,(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()))}function $e(e){const t=document.createElement("div");return t.appendChild(e),t.innerHTML}const Ne={pip:"PIP",airplay:"AirPlay",html5:"HTML5",vimeo:"Vimeo",youtube:"YouTube"},Me={get(e="",t={}){if(D.empty(e)||D.empty(t))return"";let i=q(t.i18n,e);if(D.empty(i))return Object.keys(Ne).includes(e)?Ne[e]:"";const s={"{seektime}":t.seekTime,"{title}":t.title};return Object.entries(s).forEach((([e,t])=>{i=Ae(i,e,t)})),i}};class Le{constructor(e){d(this,"get",(e=>{if(!Le.supported||!this.enabled)return null;const t=window.localStorage.getItem(this.key);if(D.empty(t))return null;const i=JSON.parse(t);return D.string(e)&&e.length?i[e]:i})),d(this,"set",(e=>{if(!Le.supported||!this.enabled)return;if(!D.object(e))return;let t=this.get();D.empty(t)&&(t={}),V(t,e);try{window.localStorage.setItem(this.key,JSON.stringify(t))}catch{}})),this.enabled=e.config.storage.enabled,this.key=e.config.storage.key}static get supported(){try{if(!("localStorage"in window))return!1;const e="___test";return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch{return!1}}}function Ie(e,t="text",i=!1){return new Promise(((s,n)=>{try{const n=new XMLHttpRequest;if(!("withCredentials"in n))return;i&&(n.withCredentials=!0),n.addEventListener("load",(()=>{if("text"===t)try{s(JSON.parse(n.responseText))}catch{s(n.responseText)}else s(n.response)})),n.addEventListener("error",(()=>{throw new Error(n.status)})),n.open("GET",e,!0),n.responseType=t,n.send()}catch(e){n(e)}}))}function _e(e,t){if(!D.string(e))return;const i="cache",s=D.string(t);let n=!1;const a=()=>null!==document.getElementById(t),r=(e,t)=>{e.innerHTML=t,s&&a()||document.body.insertAdjacentElement("afterbegin",e)};if(!s||!a()){const a=Le.supported,o=document.createElement("div");if(o.setAttribute("hidden",""),s&&o.setAttribute("id",t),a){const e=window.localStorage.getItem(`${i}-${t}`);if(n=null!==e,n){const t=JSON.parse(e);r(o,t.content)}}Ie(e).then((e=>{if(!D.empty(e)){if(a)try{window.localStorage.setItem(`${i}-${t}`,JSON.stringify({content:e}))}catch{}r(o,e)}})).catch((()=>{}))}}const Oe=e=>Math.trunc(e/60/60%60,10);function je(e=0,t=!1,i=!1){if(!D.number(e))return je(void 0,t,i);const s=e=>`0${e}`.slice(-2);let n=Oe(e);const a=(r=e,Math.trunc(r/60%60,10));var r;const o=(e=>Math.trunc(e%60,10))(e);return n=t||n>0?`${n}:`:"",`${i&&e>0?"-":""}${n}${s(a)}:${s(o)}`}const Re={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||Se.isIE&&!window.svg4everybody;return{url:this.config.iconUrl,cors:i}},findElements(){try{return this.elements.controls=ie.call(this,this.config.selectors.controls.wrapper),this.elements.buttons={play:te.call(this,this.config.selectors.buttons.play),pause:ie.call(this,this.config.selectors.buttons.pause),restart:ie.call(this,this.config.selectors.buttons.restart),rewind:ie.call(this,this.config.selectors.buttons.rewind),fastForward:ie.call(this,this.config.selectors.buttons.fastForward),mute:ie.call(this,this.config.selectors.buttons.mute),pip:ie.call(this,this.config.selectors.buttons.pip),airplay:ie.call(this,this.config.selectors.buttons.airplay),settings:ie.call(this,this.config.selectors.buttons.settings),captions:ie.call(this,this.config.selectors.buttons.captions),fullscreen:ie.call(this,this.config.selectors.buttons.fullscreen)},this.elements.progress=ie.call(this,this.config.selectors.progress),this.elements.inputs={seek:ie.call(this,this.config.selectors.inputs.seek),volume:ie.call(this,this.config.selectors.inputs.volume)},this.elements.display={buffer:ie.call(this,this.config.selectors.display.buffer),currentTime:ie.call(this,this.config.selectors.display.currentTime),duration:ie.call(this,this.config.selectors.display.duration)},D.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",s=Re.getIconUrl.call(this),n=`${s.cors?"":s.url}#${this.config.iconPrefix}`,a=document.createElementNS(i,"svg");U(a,V(t,{"aria-hidden":"true",focusable:"false"}));const r=document.createElementNS(i,"use"),o=`${n}-${e}`;return"href"in r&&r.setAttributeNS("http://www.w3.org/1999/xlink","href",o),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o),a.appendChild(r),a},createLabel(e,t={}){const i=Me.get(e,this.config);return W("span",{...t,class:[t.class,this.config.classNames.hidden].filter(Boolean).join(" ")},i)},createBadge(e){if(D.empty(e))return null;const t=W("span",{class:this.config.classNames.menu.value});return t.appendChild(W("span",{class:this.config.classNames.menu.badge},e)),t},createButton(e,t){const i=V({},t);let s=function(e=""){let t=e.toString();return t=function(e=""){let t=e.toString();return t=Ae(t,"-"," "),t=Ae(t,"_"," "),t=xe(t),Ae(t," ","")}(t),t.charAt(0).toLowerCase()+t.slice(1)}(e);const n={element:"button",toggle:!1,label:null,icon:null,labelPressed:null,iconPressed:null};switch(["element","icon","label"].forEach((e=>{Object.keys(i).includes(e)&&(n[e]=i[e],delete i[e])})),"button"!==n.element||Object.keys(i).includes("type")||(i.type="button"),Object.keys(i).includes("class")?i.class.split(" ").includes(this.config.classNames.control)||V(i,{class:`${i.class} ${this.config.classNames.control}`}):i.class=this.config.classNames.control,e){case"play":n.toggle=!0,n.label="play",n.labelPressed="pause",n.icon="play",n.iconPressed="pause";break;case"mute":n.toggle=!0,n.label="mute",n.labelPressed="unmute",n.icon="volume",n.iconPressed="muted";break;case"captions":n.toggle=!0,n.label="enableCaptions",n.labelPressed="disableCaptions",n.icon="captions-off",n.iconPressed="captions-on";break;case"fullscreen":n.toggle=!0,n.label="enterFullscreen",n.labelPressed="exitFullscreen",n.icon="enter-fullscreen",n.iconPressed="exit-fullscreen";break;case"play-large":i.class+=` ${this.config.classNames.control}--overlaid`,s="play",n.label="play",n.icon="play";break;default:D.empty(n.label)&&(n.label=s),D.empty(n.icon)&&(n.icon=e)}const a=W(n.element);return n.toggle?(a.appendChild(Re.createIcon.call(this,n.iconPressed,{class:"icon--pressed"})),a.appendChild(Re.createIcon.call(this,n.icon,{class:"icon--not-pressed"})),a.appendChild(Re.createLabel.call(this,n.labelPressed,{class:"label--pressed"})),a.appendChild(Re.createLabel.call(this,n.label,{class:"label--not-pressed"}))):(a.appendChild(Re.createIcon.call(this,n.icon)),a.appendChild(Re.createLabel.call(this,n.label))),V(i,X(this.config.selectors.buttons[s],i)),U(a,i),"play"===s?(D.array(this.elements.buttons[s])||(this.elements.buttons[s]=[]),this.elements.buttons[s].push(a)):this.elements.buttons[s]=a,a},createRange(e,t){const i=W("input",V(X(this.config.selectors.inputs[e]),{type:"range",min:0,max:100,step:.01,value:0,autocomplete:"off",role:"slider","aria-label":Me.get(e,this.config),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":0},t));return this.elements.inputs[e]=i,Re.updateRangeFill.call(this,i),x.setup(i),i},createProgress(e,t){const i=W("progress",V(X(this.config.selectors.display[e]),{min:0,max:100,value:0,role:"progressbar","aria-hidden":!0},t));if("volume"!==e){i.appendChild(W("span",null,"0"));const t={played:"played",buffer:"buffered"}[e],s=t?Me.get(t,this.config):"";i.textContent=`% ${s.toLowerCase()}`}return this.elements.display[e]=i,i},createTime(e,t){const i=X(this.config.selectors.display[e],t),s=W("div",V(i,{class:`${i.class?i.class:""} ${this.config.classNames.display.time} `.trim(),"aria-label":Me.get(e,this.config),role:"timer"}),"00:00");return this.elements.display[e]=s,s},bindMenuItemShortcuts(e,t){le.call(this,e,"keydown keyup",(i=>{if(![" ","ArrowUp","ArrowDown","ArrowRight"].includes(i.key))return;if(i.preventDefault(),i.stopPropagation(),"keydown"===i.type)return;const s=ee(e,'[role="menuitemradio"]');if(!s&&[" ","ArrowRight"].includes(i.key))Re.showMenuPanel.call(this,t,!0);else{let t;" "!==i.key&&("ArrowDown"===i.key||s&&"ArrowRight"===i.key?(t=e.nextElementSibling,D.element(t)||(t=e.parentNode.firstElementChild)):(t=e.previousElementSibling,D.element(t)||(t=e.parentNode.lastElementChild)),se.call(this,t,!0))}}),!1),le.call(this,e,"keyup",(e=>{"Return"===e.key&&Re.focusFirstMenuItem.call(this,null,!0)}))},createMenuItem({value:e,list:t,type:i,title:s,badge:n=null,checked:a=!1}){const r=X(this.config.selectors.inputs[i]),o=W("button",V(r,{type:"button",role:"menuitemradio",class:`${this.config.classNames.control} ${r.class?r.class:""}`.trim(),"aria-checked":a,value:e})),l=W("span");l.innerHTML=s,D.element(n)&&l.appendChild(n),o.appendChild(l),Object.defineProperty(o,"checked",{enumerable:!0,get:()=>"true"===o.getAttribute("aria-checked"),set(e){e&&Array.from(o.parentNode.children).filter((e=>ee(e,'[role="menuitemradio"]'))).forEach((e=>e.setAttribute("aria-checked","false"))),o.setAttribute("aria-checked",e?"true":"false")}}),this.listeners.bind(o,"click keyup",(t=>{if(!D.keyboardEvent(t)||" "===t.key){switch(t.preventDefault(),t.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)}Re.showMenuPanel.call(this,"home",D.keyboardEvent(t))}}),i,!1),Re.bindMenuItemShortcuts.call(this,o,i),t.appendChild(o)},formatTime(e=0,t=!1){return D.number(e)?je(e,Oe(this.duration)>0,t):e},updateTimeDisplay(e=null,t=0,i=!1){D.element(e)&&D.number(t)&&(e.textContent=Re.formatTime(t,i))},updateVolume(){this.supported.ui&&(D.element(this.elements.inputs.volume)&&Re.setRange.call(this,this.elements.inputs.volume,this.muted?0:this.volume),D.element(this.elements.buttons.mute)&&(this.elements.buttons.mute.pressed=this.muted||0===this.volume))},setRange(e,t=0){D.element(e)&&(e.value=t,Re.updateRangeFill.call(this,e))},updateProgress(e){if(!this.supported.ui||!D.event(e))return;let t=0;const i=(e,t)=>{const i=D.number(t)?t:0,s=D.element(e)?e:this.elements.display.buffer;if(D.element(s)){s.value=i;const e=s.getElementsByTagName("span")[0];D.element(e)&&(e.childNodes[0].nodeValue=i)}};if(e)switch(e.type){case"timeupdate":case"seeking":case"seeked":s=this.currentTime,n=this.duration,t=0===s||0===n||Number.isNaN(s)||Number.isNaN(n)?0:(s/n*100).toFixed(2),"timeupdate"===e.type&&Re.setRange.call(this,this.elements.inputs.seek,t);break;case"playing":case"progress":i(this.elements.display.buffer,100*this.buffered)}var s,n},updateRangeFill(e){const t=D.event(e)?e.target:e;if(D.element(t)&&"range"===t.getAttribute("type")){if(ee(t,this.config.selectors.inputs.seek)){t.setAttribute("aria-valuenow",this.currentTime);const e=Re.formatTime(this.currentTime),i=Re.formatTime(this.duration),s=Me.get("seekLabel",this.config);t.setAttribute("aria-valuetext",s.replace("{currentTime}",e).replace("{duration}",i))}else if(ee(t,this.config.selectors.inputs.volume)){const e=100*t.value;t.setAttribute("aria-valuenow",e),t.setAttribute("aria-valuetext",`${e.toFixed(1)}%`)}else t.setAttribute("aria-valuenow",t.value);(Se.isWebKit||Se.isIPadOS)&&t.style.setProperty("--value",t.value/t.max*100+"%")}},updateSeekTooltip(e){var t,i;if(!this.config.tooltips.seek||!D.element(this.elements.inputs.seek)||!D.element(this.elements.display.seekTooltip)||0===this.duration)return;const s=this.elements.display.seekTooltip,n=`${this.config.classNames.tooltip}--visible`,a=e=>G(s,n,e);if(this.touch)return void a(!1);let r=0;const o=this.elements.progress.getBoundingClientRect();if(D.event(e)){const t=e.pageX-e.clientX;r=100/o.width*(e.pageX-o.left-t)}else{if(!Z(s,n))return;r=Number.parseFloat(s.style.left,10)}r<0?r=0:r>100&&(r=100);const l=this.duration/100*r;s.textContent=Re.formatTime(l);const c=null===(t=this.config.markers)||void 0===t||null===(i=t.points)||void 0===i?void 0:i.find((({time:e})=>e===Math.round(l)));c&&s.insertAdjacentHTML("afterbegin",`${c.label}<br>`),s.style.left=`${r}%`,D.event(e)&&["mouseenter","mouseleave"].includes(e.type)&&a("mouseenter"===e.type)},timeUpdate(e){const t=!D.element(this.elements.display.duration)&&this.config.invertTime;Re.updateTimeDisplay.call(this,this.elements.display.currentTime,t?this.duration-this.currentTime:this.currentTime,t),e&&"timeupdate"===e.type&&this.media.seeking||Re.updateProgress.call(this,e)},durationUpdate(){if(!this.supported.ui||!this.config.invertTime&&this.currentTime)return;if(this.duration>=2**32)return J(this.elements.display.currentTime,!0),void J(this.elements.progress,!0);D.element(this.elements.inputs.seek)&&this.elements.inputs.seek.setAttribute("aria-valuemax",this.duration);const e=D.element(this.elements.display.duration);!e&&this.config.displayDuration&&this.paused&&Re.updateTimeDisplay.call(this,this.elements.display.currentTime,this.duration),e&&Re.updateTimeDisplay.call(this,this.elements.display.duration,this.duration),this.config.markers.enabled&&Re.setMarkers.call(this),Re.updateSeekTooltip.call(this)},toggleMenuButton(e,t){J(this.elements.settings.buttons[e],!t)},updateSetting(e,t,i){const s=this.elements.settings.panels[e];let n=null,a=t;if("captions"===e)n=this.currentTrack;else{if(n=D.empty(i)?this[e]:i,D.empty(n)&&(n=this.config[e].default),!D.empty(this.options[e])&&!this.options[e].includes(n))return void this.debug.warn(`Unsupported value of '${n}' for ${e}`);if(!this.config[e].options.includes(n))return void this.debug.warn(`Disabled value of '${n}' for ${e}`)}if(D.element(a)||(a=s&&s.querySelector('[role="menu"]')),!D.element(a))return;this.elements.settings.buttons[e].querySelector(`.${this.config.classNames.menu.value}`).innerHTML=Re.getLabel.call(this,e,n);const r=a&&a.querySelector(`[value="${n}"]`);D.element(r)&&(r.checked=!0)},getLabel(e,t){switch(e){case"speed":return 1===t?Me.get("normal",this.config):`${t}×`;case"quality":if(D.number(t)){const e=Me.get(`qualityLabel.${t}`,this.config);return e.length?e:`${t}p`}return xe(t);case"captions":return He.getLabel.call(this);default:return null}},setQualityMenu(e){if(!D.element(this.elements.settings.panels.quality))return;const t="quality",i=this.elements.settings.panels.quality.querySelector('[role="menu"]');D.array(e)&&(this.options.quality=ge(e).filter((e=>this.config.quality.options.includes(e))));const s=!D.empty(this.options.quality)&&this.options.quality.length>1;if(Re.toggleMenuButton.call(this,t,s),Y(i),Re.checkMenu.call(this),!s)return;const n=e=>{const t=Me.get(`qualityBadge.${e}`,this.config);return t.length?Re.createBadge.call(this,t):null};this.options.quality.sort(((e,t)=>{const i=this.config.quality.options;return i.indexOf(e)>i.indexOf(t)?1:-1})).forEach((e=>{Re.createMenuItem.call(this,{value:e,list:i,type:t,title:Re.getLabel.call(this,"quality",e),badge:n(e)})})),Re.updateSetting.call(this,t,i)},setCaptionsMenu(){if(!D.element(this.elements.settings.panels.captions))return;const e="captions",t=this.elements.settings.panels.captions.querySelector('[role="menu"]'),i=He.getTracks.call(this),s=Boolean(i.length);if(Re.toggleMenuButton.call(this,e,s),Y(t),Re.checkMenu.call(this),!s)return;const n=i.map(((e,i)=>({value:i,checked:this.captions.toggled&&this.currentTrack===i,title:He.getLabel.call(this,e),badge:e.language&&Re.createBadge.call(this,e.language.toUpperCase()),list:t,type:"language"})));n.unshift({value:-1,checked:!this.captions.toggled,title:Me.get("disabled",this.config),list:t,type:"language"}),n.forEach(Re.createMenuItem.bind(this)),Re.updateSetting.call(this,e,t)},setSpeedMenu(){if(!D.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((e=>e>=this.minimumSpeed&&e<=this.maximumSpeed));const i=!D.empty(this.options.speed)&&this.options.speed.length>1;Re.toggleMenuButton.call(this,e,i),Y(t),Re.checkMenu.call(this),i&&(this.options.speed.forEach((i=>{Re.createMenuItem.call(this,{value:i,list:t,type:e,title:Re.getLabel.call(this,"speed",i)})})),Re.updateSetting.call(this,e,t))},checkMenu(){const{buttons:e}=this.elements.settings,t=!D.empty(e)&&Object.values(e).some((e=>!e.hidden));J(this.elements.settings.menu,!t)},focusFirstMenuItem(e,t=!1){if(this.elements.settings.popup.hidden)return;let i=e;D.element(i)||(i=Object.values(this.elements.settings.panels).find((e=>!e.hidden)));const s=i.querySelector('[role^="menuitem"]');se.call(this,s,t)},toggleMenu(e){const{popup:t}=this.elements.settings,i=this.elements.buttons.settings;if(!D.element(t)||!D.element(i))return;const{hidden:s}=t;let n=s;if(D.boolean(e))n=e;else if(D.keyboardEvent(e)&&"Escape"===e.key)n=!1;else if(D.event(e)){const s=D.function(e.composedPath)?e.composedPath()[0]:e.target,a=t.contains(s);if(a||!a&&e.target!==i&&n)return}i.setAttribute("aria-expanded",n),J(t,!n),G(this.elements.container,this.config.classNames.menu.open,n),n&&D.keyboardEvent(e)?Re.focusFirstMenuItem.call(this,null,!0):n||s||se.call(this,i,D.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,s=t.scrollHeight;return K(t),{width:i,height:s}},showMenuPanel(e="",t=!1){const i=this.elements.container.querySelector(`#plyr-settings-${this.id}-${e}`);if(!D.element(i))return;const s=i.parentNode,n=Array.from(s.children).find((e=>!e.hidden));if(ae.transitions&&!ae.reducedMotion){s.style.width=`${n.scrollWidth}px`,s.style.height=`${n.scrollHeight}px`;const e=Re.getMenuSize.call(this,i),t=e=>{e.target===s&&["width","height"].includes(e.propertyName)&&(s.style.width="",s.style.height="",ce.call(this,s,F,t))};le.call(this,s,F,t),s.style.width=`${e.width}px`,s.style.height=`${e.height}px`}J(n,!0),J(i,!1),Re.focusFirstMenuItem.call(this,i,t)},setDownloadUrl(){const e=this.elements.buttons.download;D.element(e)&&e.setAttribute("href",this.download)},create(e){const{bindMenuItemShortcuts:t,createButton:i,createProgress:s,createRange:n,createTime:a,setQualityMenu:r,setSpeedMenu:o,showMenuPanel:l}=Re;this.elements.controls=null,D.array(this.config.controls)&&this.config.controls.includes("play-large")&&this.elements.container.appendChild(i.call(this,"play-large"));const c=W("div",X(this.config.selectors.controls.wrapper));this.elements.controls=c;const u={class:"plyr__controls__item"};return ge(D.array(this.config.controls)?this.config.controls:[]).forEach((r=>{if("restart"===r&&c.appendChild(i.call(this,"restart",u)),"rewind"===r&&c.appendChild(i.call(this,"rewind",u)),"play"===r&&c.appendChild(i.call(this,"play",u)),"fast-forward"===r&&c.appendChild(i.call(this,"fast-forward",u)),"progress"===r){const t=W("div",{class:`${u.class} plyr__progress__container`}),i=W("div",X(this.config.selectors.progress));if(i.appendChild(n.call(this,"seek",{id:`plyr-seek-${e.id}`})),i.appendChild(s.call(this,"buffer")),this.config.tooltips.seek){const e=W("span",{class:this.config.classNames.tooltip},"00:00");i.appendChild(e),this.elements.display.seekTooltip=e}this.elements.progress=i,t.appendChild(this.elements.progress),c.appendChild(t)}if("current-time"===r&&c.appendChild(a.call(this,"currentTime",u)),"duration"===r&&c.appendChild(a.call(this,"duration",u)),"mute"===r||"volume"===r){let{volume:t}=this.elements;if(D.element(t)&&c.contains(t)||(t=W("div",V({},u,{class:`${u.class} plyr__volume`.trim()})),this.elements.volume=t,c.appendChild(t)),"mute"===r&&t.appendChild(i.call(this,"mute")),"volume"===r&&!Se.isIos&&!Se.isIPadOS){const i={max:1,step:.05,value:this.config.volume};t.appendChild(n.call(this,"volume",V(i,{id:`plyr-volume-${e.id}`})))}}if("captions"===r&&c.appendChild(i.call(this,"captions",u)),"settings"===r&&!D.empty(this.config.settings)){const s=W("div",V({},u,{class:`${u.class} plyr__menu`.trim(),hidden:""}));s.appendChild(i.call(this,"settings",{"aria-haspopup":!0,"aria-controls":`plyr-settings-${e.id}`,"aria-expanded":!1}));const n=W("div",{class:"plyr__menu__container",id:`plyr-settings-${e.id}`,hidden:""}),a=W("div"),r=W("div",{id:`plyr-settings-${e.id}-home`}),o=W("div",{role:"menu"});r.appendChild(o),a.appendChild(r),this.elements.settings.panels.home=r,this.config.settings.forEach((i=>{const s=W("button",V(X(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,s,i),le.call(this,s,"click",(()=>{l.call(this,i,!1)}));const n=W("span",null,Me.get(i,this.config)),r=W("span",{class:this.config.classNames.menu.value});r.innerHTML=e[i],n.appendChild(r),s.appendChild(n),o.appendChild(s);const c=W("div",{id:`plyr-settings-${e.id}-${i}`,hidden:""}),u=W("button",{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--back`});u.appendChild(W("span",{"aria-hidden":!0},Me.get(i,this.config))),u.appendChild(W("span",{class:this.config.classNames.hidden},Me.get("menuBack",this.config))),le.call(this,c,"keydown",(e=>{"ArrowLeft"===e.key&&(e.preventDefault(),e.stopPropagation(),l.call(this,"home",!0))}),!1),le.call(this,u,"click",(()=>{l.call(this,"home",!1)})),c.appendChild(u),c.appendChild(W("div",{role:"menu"})),a.appendChild(c),this.elements.settings.buttons[i]=s,this.elements.settings.panels[i]=c})),n.appendChild(a),s.appendChild(n),c.appendChild(s),this.elements.settings.popup=n,this.elements.settings.menu=s}if("pip"===r&&ae.pip&&c.appendChild(i.call(this,"pip",u)),"airplay"===r&&ae.airplay&&c.appendChild(i.call(this,"airplay",u)),"download"===r){const e=V({},u,{element:"a",href:this.download,target:"_blank"});this.isHTML5&&(e.download="");const{download:t}=this.config.urls;!D.url(t)&&this.isEmbed&&V(e,{icon:`logo-${this.provider}`,label:this.provider}),c.appendChild(i.call(this,"download",e))}"fullscreen"===r&&c.appendChild(i.call(this,"fullscreen",u))})),this.isHTML5&&r.call(this,Ce.getQualityOptions.call(this)),o.call(this),c},inject(){if(this.config.loadSprite){const e=Re.getIconUrl.call(this);e.cors&&_e(e.url,"sprite-plyr")}this.id=Math.floor(1e4*Math.random());let e=null;this.elements.controls=null;const t={id:this.id,seektime:this.config.seekTime,title:this.config.title};let i,s=!0;if(D.function(this.config.controls)&&(this.config.controls=this.config.controls.call(this,t)),this.config.controls||(this.config.controls=[]),D.element(this.config.controls)||D.string(this.config.controls)?e=this.config.controls:(e=Re.create.call(this,{id:this.id,seektime:this.config.seekTime,speed:this.speed,quality:this.quality,captions:He.getLabel.call(this)}),s=!1),s&&D.string(this.config.controls)&&(e=(e=>{let i=e;return Object.entries(t).forEach((([e,t])=>{i=Ae(i,`{${e}}`,t)})),i})(e)),D.string(this.config.selectors.controls.container)&&(i=document.querySelector(this.config.selectors.controls.container)),D.element(i)||(i=this.elements.container),i[D.element(e)?"insertAdjacentElement":"insertAdjacentHTML"]("afterbegin",e),D.element(this.elements.controls)||Re.findElements.call(this),!D.empty(this.elements.buttons)){const e=e=>{const t=this.config.classNames.controlPressed;e.setAttribute("aria-pressed","false"),Object.defineProperty(e,"pressed",{configurable:!0,enumerable:!0,get:()=>Z(e,t),set(i=!1){G(e,t,i),e.setAttribute("aria-pressed",i?"true":"false")}})};Object.values(this.elements.buttons).filter(Boolean).forEach((t=>{D.array(t)||D.nodeList(t)?Array.from(t).filter(Boolean).forEach(e):e(t)}))}if(Se.isEdge&&H(i),this.config.tooltips.controls){const{classNames:e,selectors:t}=this.config,i=`${t.controls.wrapper} ${t.labels} .${e.hidden}`,s=te.call(this,i);Array.from(s).forEach((e=>{G(e,this.config.classNames.hidden,!1),G(e,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 e,t;if(!this.duration||this.elements.markers)return;const i=null===(e=this.config.markers)||void 0===e||null===(t=e.points)||void 0===t?void 0:t.filter((({time:e})=>e>0&&e<this.duration));if(null==i||!i.length)return;const s=document.createDocumentFragment(),n=document.createDocumentFragment();let a=null;const r=`${this.config.classNames.tooltip}--visible`,o=e=>G(a,r,e);i.forEach((e=>{const t=W("span",{class:this.config.classNames.marker},""),i=e.time/this.duration*100+"%";a&&(t.addEventListener("mouseenter",(()=>{e.label||(a.style.left=i,a.innerHTML=e.label,o(!0))})),t.addEventListener("mouseleave",(()=>{o(!1)}))),t.addEventListener("click",(()=>{this.currentTime=e.time})),t.style.left=i,n.appendChild(t)})),s.appendChild(n),this.config.tooltips.seek||(a=W("span",{class:this.config.classNames.tooltip},""),s.appendChild(a)),this.elements.markers={points:n,tip:a},this.elements.progress.appendChild(s)}};function De(e,t=!0){let i=e;if(t){const e=document.createElement("a");e.href=i,i=e.href}try{return new URL(i)}catch{return null}}function Fe(e){const t=new URLSearchParams;return D.object(e)&&Object.entries(e).forEach((([e,i])=>{t.set(e,i)})),t}const He={setup(){if(!this.supported.ui)return;if(!this.isVideo||this.isYouTube||this.isHTML5&&!ae.textTracks)return void(D.array(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&Re.setCaptionsMenu.call(this));var e,t;if(D.element(this.elements.captions)||(this.elements.captions=W("div",X(this.config.selectors.captions)),this.elements.captions.setAttribute("dir","auto"),e=this.elements.captions,t=this.elements.wrapper,D.element(e)&&D.element(t)&&t.parentNode.insertBefore(e,t.nextSibling)),Se.isIE&&window.URL){const e=this.media.querySelectorAll("track");Array.from(e).forEach((e=>{const t=e.getAttribute("src"),i=De(t);null!==i&&i.hostname!==window.location.href.hostname&&["http:","https:"].includes(i.protocol)&&Ie(t,"blob").then((t=>{e.setAttribute("src",window.URL.createObjectURL(t))})).catch((()=>{K(e)}))}))}const i=ge((navigator.languages||[navigator.language||navigator.userLanguage||"en"]).map((e=>e.split("-")[0])));let s=(this.storage.get("language")||this.captions.language||this.config.captions.language||"auto").toLowerCase();"auto"===s&&([s]=i);let n=this.storage.get("captions")||this.captions.active;if(D.boolean(n)||({active:n}=this.config.captions),Object.assign(this.captions,{toggled:!1,active:n,language:s,languages:i}),this.isHTML5){const e=this.config.captions.update?"addtrack removetrack":"removetrack";le.call(this,this.media.textTracks,e,He.update.bind(this))}setTimeout(He.update.bind(this),0)},update(){const e=He.getTracks.call(this,!0),{active:t,language:i,meta:s,currentTrackNode:n}=this.captions,a=Boolean(e.find((e=>e.language===i)));this.isHTML5&&this.isVideo&&e.filter((e=>!s.get(e))).forEach((e=>{this.debug.log("Track added",e),s.set(e,{default:"showing"===e.mode}),"showing"===e.mode&&(e.mode="hidden"),le.call(this,e,"cuechange",(()=>He.updateCues.call(this)))})),(a&&this.language!==i||!e.includes(n))&&(He.setLanguage.call(this,i),He.toggle.call(this,t&&a)),this.elements&&G(this.elements.container,this.config.classNames.captions.enabled,!D.empty(e)),D.array(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&Re.setCaptionsMenu.call(this)},toggle(e,t=!0){if(!this.supported.ui)return;const{toggled:i}=this.captions,s=this.config.classNames.captions.active,n=D.nullOrUndefined(e)?!i:e;if(n!==i){if(t||(this.captions.active=n,this.storage.set({captions:n})),!this.language&&n&&!t){const e=He.getTracks.call(this),t=He.findTrack.call(this,[this.captions.language,...this.captions.languages],!0);return this.captions.language=t.language,void He.set.call(this,e.indexOf(t))}this.elements.buttons.captions&&(this.elements.buttons.captions.pressed=n),G(this.elements.container,s,n),this.captions.toggled=n,Re.updateSetting.call(this,"captions"),de.call(this,this.media,n?"captionsenabled":"captionsdisabled")}setTimeout((()=>{n&&this.captions.toggled&&(this.captions.currentTrackNode.mode="hidden")}))},set(e,t=!0){const i=He.getTracks.call(this);if(-1!==e)if(D.number(e))if(e in i){if(this.captions.currentTrack!==e){this.captions.currentTrack=e;const s=i[e],{language:n}=s||{};this.captions.currentTrackNode=s,Re.updateSetting.call(this,"captions"),t||(this.captions.language=n,this.storage.set({language:n})),this.isVimeo&&this.embed.enableTextTrack(n,null,!1),de.call(this,this.media,"languagechange")}He.toggle.call(this,!0,t),this.isHTML5&&this.isVideo&&He.updateCues.call(this)}else this.debug.warn("Track not found",e);else this.debug.warn("Invalid caption argument",e);else He.toggle.call(this,!1,t)},setLanguage(e,t=!0){if(!D.string(e))return void this.debug.warn("Invalid language argument",e);const i=e.toLowerCase();this.captions.language=i;const s=He.getTracks.call(this),n=He.findTrack.call(this,[i]);He.set.call(this,s.indexOf(n),t)},getTracks(e=!1){return Array.from((this.media||{}).textTracks||[]).filter((t=>!this.isHTML5||e||this.captions.meta.has(t))).filter((e=>["captions","subtitles"].includes(e.kind)))},findTrack(e,t=!1){const i=He.getTracks.call(this),s=e=>Number((this.captions.meta.get(e)||{}).default),n=Array.from(i).sort(((e,t)=>s(t)-s(e)));let a;return e.every((e=>(a=n.find((t=>t.language===e)),!a))),a||(t?n[0]:void 0)},getCurrentTrack(){return He.getTracks.call(this)[this.currentTrack]},getLabel(e){let t=e;return!D.track(t)&&ae.textTracks&&this.captions.toggled&&(t=He.getCurrentTrack.call(this)),D.track(t)?D.empty(t.label)?D.empty(t.language)?Me.get("enabled",this.config):e.language.toUpperCase():t.label:Me.get("disabled",this.config)},updateCues(e){if(!this.supported.ui)return;if(!D.element(this.elements.captions))return void this.debug.warn("No captions element to render to");if(!D.nullOrUndefined(e)&&!Array.isArray(e))return void this.debug.warn("updateCues: Invalid input",e);let t=e;if(!t){const e=He.getCurrentTrack.call(this);t=Array.from((e||{}).activeCues||[]).map((e=>e.getCueAsHTML())).map($e)}const i=t.map((e=>e.trim())).join("\n");if(i!==this.elements.captions.innerHTML){Y(this.elements.captions);const e=W("span",X(this.config.selectors.caption));e.innerHTML=i,this.elements.captions.appendChild(e),de.call(this,this.media,"cuechange")}}},qe={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.4/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:"SD"}},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:[]}},Ve="picture-in-picture",Be={html5:"html5",youtube:"youtube",vimeo:"vimeo"},Ue="video";function We(){}class ze{constructor(e=!1){this.enabled=window.console&&e,this.enabled&&this.log("Debugging enabled")}get log(){return this.enabled?Function.prototype.bind.call(console.log,console):We}get warn(){return this.enabled?Function.prototype.bind.call(console.warn,console):We}get error(){return this.enabled?Function.prototype.bind.call(console.error,console):We}}class Ke{constructor(e){d(this,"onChange",(()=>{if(!this.supported)return;const e=this.player.elements.buttons.fullscreen;D.element(e)&&(e.pressed=this.active);const t=this.target===this.player.media?this.target:this.player.elements.container;de.call(this.player,t,this.active?"enterfullscreen":"exitfullscreen",!0)})),d(this,"toggleFallback",((e=!1)=>{var t,i;if(e?this.scrollPosition={x:null!==(t=window.scrollX)&&void 0!==t?t:0,y:null!==(i=window.scrollY)&&void 0!==i?i:0}:window.scrollTo(this.scrollPosition.x,this.scrollPosition.y),document.body.style.overflow=e?"hidden":"",G(this.target,this.player.config.classNames.fullscreen.fallback,e),Se.isIos){let t=document.head.querySelector('meta[name="viewport"]');const i="viewport-fit=cover";t||(t=document.createElement("meta"),t.setAttribute("name","viewport"));const s=D.string(t.content)&&t.content.includes(i);e?(this.cleanupViewport=!s,s||(t.content+=`,${i}`)):this.cleanupViewport&&(t.content=t.content.split(",").filter((e=>e.trim()!==i)).join(","))}this.onChange()})),d(this,"trapFocus",(e=>{if(Se.isIos||Se.isIPadOS||!this.active||"Tab"!==e.key)return;const t=document.activeElement,i=te.call(this.player,"a[href], button:not(:disabled), input:not(:disabled), [tabindex]"),[s]=i,n=i[i.length-1];t!==n||e.shiftKey?t===s&&e.shiftKey&&(n.focus(),e.preventDefault()):(s.focus(),e.preventDefault())})),d(this,"update",(()=>{if(this.supported){let e;e=this.forceFallback?"Fallback (forced)":Ke.nativeSupported?"Native":"Fallback",this.player.debug.log(`${e} fullscreen enabled`)}else this.player.debug.log("Fullscreen not supported and fallback disabled");G(this.player.elements.container,this.player.config.classNames.fullscreen.enabled,this.supported)})),d(this,"enter",(()=>{this.supported&&(Se.isIos&&this.player.config.fullscreen.iosNative?this.player.isVimeo?this.player.embed.requestFullscreen():this.target.webkitEnterFullscreen():!Ke.nativeSupported||this.forceFallback?this.toggleFallback(!0):this.prefix?D.empty(this.prefix)||this.target[`${this.prefix}Request${this.property}`]():this.target.requestFullscreen({navigationUI:"hide"}))})),d(this,"exit",(()=>{if(this.supported)if(Se.isIos&&this.player.config.fullscreen.iosNative)this.player.isVimeo?this.player.embed.exitFullscreen():this.target.webkitEnterFullscreen(),me(this.player.play());else if(!Ke.nativeSupported||this.forceFallback)this.toggleFallback(!1);else if(this.prefix){if(!D.empty(this.prefix)){const e="moz"===this.prefix?"Cancel":"Exit";document[`${this.prefix}${e}${this.property}`]()}}else(document.cancelFullScreen||document.exitFullscreen).call(document)})),d(this,"toggle",(()=>{this.active?this.exit():this.enter()})),this.player=e,this.prefix=Ke.prefix,this.property=Ke.property,this.scrollPosition={x:0,y:0},this.forceFallback="force"===e.config.fullscreen.fallback,this.player.elements.fullscreen=e.config.fullscreen.container&&function(e,t){const{prototype:i}=Element;return(i.closest||function(){let e=this;do{if(ee.matches(e,t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null}).call(e,t)}(this.player.elements.container,e.config.fullscreen.container),le.call(this.player,document,"ms"===this.prefix?"MSFullscreenChange":`${this.prefix}fullscreenchange`,(()=>{this.onChange()})),le.call(this.player,this.player.elements.container,"dblclick",(e=>{D.element(this.player.elements.controls)&&this.player.elements.controls.contains(e.target)||this.player.listeners.proxy(e,this.toggle,"fullscreen")})),le.call(this,this.player.elements.container,"keydown",(e=>this.trapFocus(e))),this.update()}static get nativeSupported(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}get useNative(){return Ke.nativeSupported&&!this.forceFallback}static get prefix(){if(D.function(document.exitFullscreen))return"";let e="";return["webkit","moz","ms"].some((t=>!(!D.function(document[`${t}ExitFullscreen`])&&!D.function(document[`${t}CancelFullScreen`])||(e=t,0)))),e}static get property(){return"moz"===this.prefix?"FullScreen":"Fullscreen"}get supported(){return[this.player.config.fullscreen.enabled,this.player.isVideo,Ke.nativeSupported||this.player.config.fullscreen.fallback,!this.player.isYouTube||Ke.nativeSupported||!Se.isIos||this.player.config.playsinline&&!this.player.config.fullscreen.iosNative].every(Boolean)}get active(){if(!this.supported)return!1;if(!Ke.nativeSupported||this.forceFallback)return Z(this.target,this.player.config.classNames.fullscreen.fallback);const e=this.prefix?this.target.getRootNode()[`${this.prefix}${this.property}Element`]:this.target.getRootNode().fullscreenElement;return e&&e.shadowRoot?e===this.target.getRootNode().host:e===this.target}get target(){var e;return Se.isIos&&this.player.config.fullscreen.iosNative?this.player.media:null!==(e=this.player.elements.fullscreen)&&void 0!==e?e:this.player.elements.container}}function Ye(e,t=1){return new Promise(((i,s)=>{const n=new Image,a=()=>{delete n.onload,delete n.onerror,(n.naturalWidth>=t?i:s)(n)};Object.assign(n,{onload:a,onerror:a,src:e})}))}const Qe={addStyleHook(){G(this.elements.container,this.config.selectors.container.replace(".",""),!0),G(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)return this.debug.warn(`Basic support only for ${this.provider} ${this.type}`),void Qe.toggleNativeControls.call(this,!0);D.element(this.elements.controls)||(Re.inject.call(this),this.listeners.controls()),Qe.toggleNativeControls.call(this),this.isHTML5&&He.setup.call(this),this.volume=null,this.muted=null,this.loop=null,this.quality=null,this.speed=null,Re.updateVolume.call(this),Re.timeUpdate.call(this),Re.durationUpdate.call(this),Qe.checkPlaying.call(this),G(this.elements.container,this.config.classNames.pip.supported,ae.pip&&this.isHTML5&&this.isVideo),G(this.elements.container,this.config.classNames.airplay.supported,ae.airplay&&this.isHTML5),G(this.elements.container,this.config.classNames.isTouch,this.touch),this.ready=!0,setTimeout((()=>{de.call(this,this.media,"ready")}),0),Qe.setTitle.call(this),this.poster&&Qe.setPoster.call(this,this.poster,!1).catch((()=>{})),this.config.duration&&Re.durationUpdate.call(this),this.config.mediaMetadata&&Re.setMediaMetadata.call(this)},setTitle(){let e=Me.get("play",this.config);if(D.string(this.config.title)&&!D.empty(this.config.title)&&(e+=`, ${this.config.title}`),Array.from(this.elements.buttons.play||[]).forEach((t=>{t.setAttribute("aria-label",e)})),this.isEmbed){const e=ie.call(this,"iframe");if(!D.element(e))return;const t=D.empty(this.config.title)?"video":this.config.title,i=Me.get("frameTitle",this.config);e.setAttribute("title",i.replace("{title}",t))}},togglePoster(e){G(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"),pe.call(this).then((()=>Ye(e))).catch((t=>{throw e===this.poster&&Qe.togglePoster.call(this,!1),t})).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:""}),Qe.togglePoster.call(this,!0),e))))},checkPlaying(e){G(this.elements.container,this.config.classNames.playing,this.playing),G(this.elements.container,this.config.classNames.paused,this.paused),G(this.elements.container,this.config.classNames.stopped,this.stopped),Array.from(this.elements.buttons.play||[]).forEach((e=>{Object.assign(e,{pressed:this.playing}),e.setAttribute("aria-label",Me.get(this.playing?"pause":"play",this.config))})),D.event(e)&&"timeupdate"===e.type||Qe.toggleControls.call(this)},checkLoading(e){this.loading=["stalled","waiting"].includes(e.type),clearTimeout(this.timers.loading),this.timers.loading=setTimeout((()=>{G(this.elements.container,this.config.classNames.loading,this.loading),Qe.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(Boolean(e||this.loading||this.paused||t.pressed||t.hover||i))}},migrateStyles(){Object.values({...this.media.style}).filter((e=>!D.empty(e)&&D.string(e)&&e.startsWith("--plyr"))).forEach((e=>{this.elements.container.style.setProperty(e,this.media.style.getPropertyValue(e)),this.media.style.removeProperty(e)})),D.empty(this.media.style)&&this.media.removeAttribute("style")}};class Xe{constructor(e){d(this,"firstTouch",(()=>{const{player:e}=this,{elements:t}=e;e.touch=!0,G(t.container,e.config.classNames.isTouch,!0)})),d(this,"global",((e=!0)=>{const{player:t}=this;t.config.keyboard.global&&oe.call(t,window,"keydown keyup",this.handleKey,e,!1),oe.call(t,document.body,"click",this.toggleMenu,e),ue.call(t,document.body,"touchstart",this.firstTouch)})),d(this,"container",(()=>{const{player:e}=this,{config:t,elements:i,timers:s}=e;!t.keyboard.global&&t.keyboard.focused&&le.call(e,i.container,"keydown keyup",this.handleKey,!1),le.call(e,i.container,"mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen",(t=>{const{controls:n}=i;n&&"enterfullscreen"===t.type&&(n.pressed=!1,n.hover=!1);let a=0;["touchstart","touchmove","mousemove"].includes(t.type)&&(Qe.toggleControls.call(e,!0),a=e.touch?3e3:2e3),clearTimeout(s.controls),s.controls=setTimeout((()=>Qe.toggleControls.call(e,!1)),a)}));const n=()=>{if(!e.isVimeo||e.config.vimeo.premium)return;const t=i.wrapper,{active:s}=e.fullscreen,[n,a]=ke.call(e),r=ye(`aspect-ratio: ${n} / ${a}`);if(!s)return void(r?(t.style.width=null,t.style.height=null):(t.style.maxWidth=null,t.style.margin=null));const[o,l]=[Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)],c=o/l>n/a;r?(t.style.width=c?"auto":"100%",t.style.height=c?"100%":"auto"):(t.style.maxWidth=c?l/a*n+"px":null,t.style.margin=c?"0 auto":null)},a=()=>{clearTimeout(s.resized),s.resized=setTimeout(n,50)};le.call(e,i.container,"enterfullscreen exitfullscreen",(t=>{const{target:s}=e.fullscreen;s===i.container&&(!e.isEmbed&&D.empty(e.config.ratio)||(n(),("enterfullscreen"===t.type?le:ce).call(e,window,"resize",a)))}))})),d(this,"media",(()=>{const{player:e}=this,{elements:t}=e;if(le.call(e,e.media,"timeupdate seeking seeked",(t=>Re.timeUpdate.call(e,t))),le.call(e,e.media,"durationchange loadeddata loadedmetadata",(t=>Re.durationUpdate.call(e,t))),le.call(e,e.media,"ended",(()=>{e.isHTML5&&e.isVideo&&e.config.resetOnEnd&&(e.restart(),e.pause())})),le.call(e,e.media,"progress playing seeking seeked",(t=>Re.updateProgress.call(e,t))),le.call(e,e.media,"volumechange",(t=>Re.updateVolume.call(e,t))),le.call(e,e.media,"playing play pause ended emptied timeupdate",(t=>Qe.checkPlaying.call(e,t))),le.call(e,e.media,"waiting canplay seeked playing",(t=>Qe.checkLoading.call(e,t))),e.supported.ui&&e.config.clickToPlay&&!e.isAudio){const i=ie.call(e,`.${e.config.classNames.video}`);if(!D.element(i))return;le.call(e,t.container,"click",(s=>{([t.container,i].includes(s.target)||i.contains(s.target))&&(e.touch&&e.config.hideControls||(e.ended?(this.proxy(s,e.restart,"restart"),this.proxy(s,(()=>{me(e.play())}),"play")):this.proxy(s,(()=>{me(e.togglePlay())}),"play")))}))}e.supported.ui&&e.config.disableContextMenu&&le.call(e,t.wrapper,"contextmenu",(e=>{e.preventDefault()}),!1),le.call(e,e.media,"volumechange",(()=>{e.storage.set({volume:e.volume,muted:e.muted})})),le.call(e,e.media,"ratechange",(()=>{Re.updateSetting.call(e,"speed"),e.storage.set({speed:e.speed})})),le.call(e,e.media,"qualitychange",(t=>{Re.updateSetting.call(e,"quality",null,t.detail.quality)})),le.call(e,e.media,"ready qualitychange",(()=>{Re.setDownloadUrl.call(e)}));const i=e.config.events.concat(["keyup","keydown"]).join(" ");le.call(e,e.media,i,(i=>{let{detail:s={}}=i;"error"===i.type&&(s=e.media.error),de.call(e,t.container,i.type,!0,s)}))})),d(this,"proxy",((e,t,i)=>{const{player:s}=this,n=s.config.listeners[i];let a=!0;D.function(n)&&(a=n.call(s,e)),!1!==a&&D.function(t)&&t.call(s,e)})),d(this,"bind",((e,t,i,s,n=!0)=>{const{player:a}=this,r=a.config.listeners[s],o=D.function(r);le.call(a,e,t,(e=>this.proxy(e,i,s)),n&&!o)})),d(this,"controls",(()=>{const{player:e}=this,{elements:t}=e,i=Se.isIE?"change":"input";if(t.buttons.play&&Array.from(t.buttons.play).forEach((t=>{this.bind(t,"click",(()=>{me(e.togglePlay())}),"play")})),this.bind(t.buttons.restart,"click",e.restart,"restart"),this.bind(t.buttons.rewind,"click",(()=>{e.lastSeekTime=Date.now(),e.rewind()}),"rewind"),this.bind(t.buttons.fastForward,"click",(()=>{e.lastSeekTime=Date.now(),e.forward()}),"fastForward"),this.bind(t.buttons.mute,"click",(()=>{e.muted=!e.muted}),"mute"),this.bind(t.buttons.captions,"click",(()=>e.toggleCaptions())),this.bind(t.buttons.download,"click",(()=>{de.call(e,e.media,"download")}),"download"),this.bind(t.buttons.fullscreen,"click",(()=>{e.fullscreen.toggle()}),"fullscreen"),this.bind(t.buttons.pip,"click",(()=>{e.pip="toggle"}),"pip"),this.bind(t.buttons.airplay,"click",e.airplay,"airplay"),this.bind(t.buttons.settings,"click",(t=>{t.stopPropagation(),t.preventDefault(),Re.toggleMenu.call(e,t)}),null,!1),this.bind(t.buttons.settings,"keyup",(t=>{[" ","Enter"].includes(t.key)&&("Enter"!==t.key?(t.preventDefault(),t.stopPropagation(),Re.toggleMenu.call(e,t)):Re.focusFirstMenuItem.call(e,null,!0))}),null,!1),this.bind(t.settings.menu,"keydown",(t=>{"Escape"===t.key&&Re.toggleMenu.call(e,t)})),this.bind(t.inputs.seek,"mousedown mousemove",(e=>{const i=t.progress.getBoundingClientRect(),s=e.pageX-e.clientX,n=100/i.width*(e.pageX-i.left-s);e.currentTarget.setAttribute("seek-value",n)})),this.bind(t.inputs.seek,"mousedown mouseup keydown keyup touchstart touchend",(t=>{const i=t.currentTarget,s="play-on-seeked";if(D.keyboardEvent(t)&&!["ArrowLeft","ArrowRight"].includes(t.key))return;e.lastSeekTime=Date.now();const n=i.hasAttribute(s),a=["mouseup","touchend","keyup"].includes(t.type);n&&a?(i.removeAttribute(s),me(e.play())):!a&&e.playing&&(i.setAttribute(s,""),e.pause())})),Se.isIos){const t=te.call(e,'input[type="range"]');Array.from(t).forEach((e=>this.bind(e,i,(e=>H(e.target)))))}this.bind(t.inputs.seek,i,(t=>{const i=t.currentTarget;let s=i.getAttribute("seek-value");D.empty(s)&&(s=i.value),i.removeAttribute("seek-value"),e.currentTime=s/i.max*e.duration}),"seek"),this.bind(t.progress,"mouseenter mouseleave mousemove",(t=>Re.updateSeekTooltip.call(e,t))),this.bind(t.progress,"mousemove touchmove",(t=>{const{previewThumbnails:i}=e;i&&i.loaded&&i.startMove(t)})),this.bind(t.progress,"mouseleave touchend click",(()=>{const{previewThumbnails:t}=e;t&&t.loaded&&t.endMove(!1,!0)})),this.bind(t.progress,"mousedown touchstart",(t=>{const{previewThumbnails:i}=e;i&&i.loaded&&i.startScrubbing(t)})),this.bind(t.progress,"mouseup touchend",(t=>{const{previewThumbnails:i}=e;i&&i.loaded&&i.endScrubbing(t)})),Se.isWebKit&&Array.from(te.call(e,'input[type="range"]')).forEach((t=>{this.bind(t,"input",(t=>Re.updateRangeFill.call(e,t.target)))})),e.config.toggleInvert&&!D.element(t.display.duration)&&this.bind(t.display.currentTime,"click",(()=>{0!==e.currentTime&&(e.config.invertTime=!e.config.invertTime,Re.timeUpdate.call(e))})),this.bind(t.inputs.volume,i,(t=>{e.volume=t.target.value}),"volume"),this.bind(t.controls,"mouseenter mouseleave",(i=>{t.controls.hover=!e.touch&&"mouseenter"===i.type})),t.fullscreen&&Array.from(t.fullscreen.children).filter((e=>!e.contains(t.container))).forEach((i=>{this.bind(i,"mouseenter mouseleave",(i=>{t.controls&&(t.controls.hover=!e.touch&&"mouseenter"===i.type)}))})),this.bind(t.controls,"mousedown mouseup touchstart touchend touchcancel",(e=>{t.controls.pressed=["mousedown","touchstart"].includes(e.type)})),this.bind(t.controls,"focusin",(()=>{const{config:i,timers:s}=e;G(t.controls,i.classNames.noTransition,!0),Qe.toggleControls.call(e,!0),setTimeout((()=>{G(t.controls,i.classNames.noTransition,!1)}),0);const n=this.touch?3e3:4e3;clearTimeout(s.controls),s.controls=setTimeout((()=>Qe.toggleControls.call(e,!1)),n)})),this.bind(t.inputs.volume,"wheel",(t=>{const i=t.webkitDirectionInvertedFromDevice,[s,n]=[t.deltaX,-t.deltaY].map((e=>i?-e:e)),a=Math.sign(Math.abs(s)>Math.abs(n)?s:n);e.increaseVolume(a/50);const{volume:r}=e.media;(1===a&&r<1||-1===a&&r>0)&&t.preventDefault()}),"volume",!1)})),this.player=e,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(e){const{player:t}=this,{elements:i}=t,{key:s,type:n,altKey:a,ctrlKey:r,metaKey:o,shiftKey:l}=e,c="keydown"===n,u=c&&s===this.lastKey;var d;if(!(a||r||o||l)&&s)if(c){const n=document.activeElement;if(D.element(n)){const{editable:s}=t.config.selectors,{seek:a}=i.inputs;if(n!==a&&ee(n,s))return;if(" "===e.key&&ee(n,'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)&&(e.preventDefault(),e.stopPropagation()),s){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":u||(d=Number.parseInt(s,10),t.currentTime=t.duration/10*d);break;case" ":case"k":u||me(t.togglePlay());break;case"ArrowUp":t.increaseVolume(.1);break;case"ArrowDown":t.decreaseVolume(.1);break;case"m":u||(t.muted=!t.muted);break;case"ArrowRight":t.forward();break;case"ArrowLeft":t.rewind();break;case"f":t.fullscreen.toggle();break;case"c":u||t.toggleCaptions();break;case"l":t.loop=!t.loop}"Escape"===s&&!t.fullscreen.usingNative&&t.fullscreen.active&&t.fullscreen.toggle(),this.lastKey=s}else this.lastKey=null}toggleMenu(e){Re.toggleMenu.call(this.player,e)}}function Je(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ge,Ze={exports:{}},et=(Ge||(Ge=1,Ze.exports=function(){var e=function(){},t={},i={},s={};function n(e,t){if(e){var n=s[e];if(i[e]=t,n)for(;n.length;)n[0](e,t),n.splice(0,1)}}function a(t,i){t.call&&(t={success:t}),i.length?(t.error||e)(i):(t.success||e)(t)}function r(t,i,s,n){var a,o,l,c=document,u=s.async,d=(s.numRetries||0)+1,h=s.before||e,p=t.replace(/[\?|#].*$/,""),m=t.replace(/^(css|img|module|nomodule)!/,"");if(n=n||0,/(^css!|\.css$)/.test(p))(l=c.createElement("link")).rel="stylesheet",l.href=m,(a="hideFocus"in l)&&l.relList&&(a=0,l.rel="preload",l.as="style");else if(/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(p))(l=c.createElement("img")).src=m;else if((l=c.createElement("script")).src=m,l.async=void 0===u||u,o="noModule"in l,/^module!/.test(p)){if(!o)return i(t,"l");l.type="module"}else if(/^nomodule!/.test(p)&&o)return i(t,"l");l.onload=l.onerror=l.onbeforeload=function(e){var o=e.type[0];if(a)try{l.sheet.cssText.length||(o="e")}catch(e){18!=e.code&&(o="e")}if("e"==o){if((n+=1)<d)return r(t,i,s,n)}else if("preload"==l.rel&&"style"==l.as)return l.rel="stylesheet";i(t,o,e.defaultPrevented)},!1!==h(t,l)&&c.head.appendChild(l)}function o(e,i,s){var o,l;if(i&&i.trim&&(o=i),l=(o?s:i)||{},o){if(o in t)throw"LoadJS";t[o]=!0}function c(t,i){!function(e,t,i){var s,n,a=(e=e.push?e:[e]).length,o=a,l=[];for(s=function(e,i,s){if("e"==i&&l.push(e),"b"==i){if(!s)return;l.push(e)}--a||t(l)},n=0;n<o;n++)r(e[n],s,i)}(e,(function(e){a(l,e),t&&a({success:t,error:i},e),n(o,e)}),l)}if(l.returnPromise)return new Promise(c);c()}return o.ready=function(e,t){return function(e,t){e=e.push?e:[e];var n,a,r,o=[],l=e.length,c=l;for(n=function(e,i){i.length&&o.push(e),--c||t(o)};l--;)a=e[l],(r=i[a])?n(a,r):(s[a]=s[a]||[]).push(n)}(e,(function(e){a(t,e)})),o},o.done=function(e){n(e,[])},o.reset=function(){t={},i={},s={}},o.isDefined=function(e){return e in t},o}()),Ze.exports),tt=Je(et);function it(e){return new Promise(((t,i)=>{tt(e,{success:t,error:i})}))}function st(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,de.call(this,this.media,e?"play":"pause"))}const nt={setup(){const e=this;G(e.elements.wrapper,e.config.classNames.embed,!0),e.options.speed=e.config.speed.options,Te.call(e),D.object(window.Vimeo)?nt.ready.call(e):it(e.config.urls.vimeo.sdk).then((()=>{nt.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:s,...n}=t;let a=e.media.getAttribute("src"),r="";D.empty(a)?(a=e.media.getAttribute(e.config.attributes.embed.id),r=e.media.getAttribute(e.config.attributes.embed.hash)):r=function(e){const t=e.match(/^.*(vimeo.com\/|video\/)(\d+)(\?.*h=|\/)+([\d,a-f]+)/);return t&&5===t.length?t[4]:null}(a);const o=r?{h:r}:{};i&&Object.assign(n,{controls:!1,sidedock:!1});const l=Fe({loop:e.config.loop.active,autoplay:e.autoplay,muted:e.muted,gesture:"media",playsinline:e.config.playsinline,...o,...n}),c=function(e){if(D.empty(e))return null;if(D.number(Number(e)))return e;const t=e.match(/^.*(vimeo.com\/|video\/)(\d+).*/);return t?t[2]:e}(a),u=W("iframe"),d=Pe(e.config.urls.vimeo.iframe,c,l);if(u.setAttribute("src",d),u.setAttribute("allowfullscreen",""),u.setAttribute("allow",["autoplay","fullscreen","picture-in-picture","encrypted-media","accelerometer","gyroscope"].join("; ")),D.empty(s)||u.setAttribute("referrerPolicy",s),i||!t.customControls)u.setAttribute("data-poster",e.poster),e.media=Q(u,e.media);else{const t=W("div",{class:e.config.classNames.embedContainer,"data-poster":e.poster});t.appendChild(u),e.media=Q(t,e.media)}t.customControls||Ie(Pe(e.config.urls.vimeo.api,d)).then((t=>{!D.empty(t)&&t.thumbnail_url&&Qe.setPoster.call(e,t.thumbnail_url).catch((()=>{}))})),e.embed=new window.Vimeo.Player(u,{autopause:e.config.autopause,muted:e.muted}),e.media.paused=!0,e.media.currentTime=0,e.supported.ui&&e.embed.disableTextTrack(),e.media.play=()=>(st.call(e,!0),e.embed.play()),e.media.pause=()=>(st.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:()=>h,set(t){const{embed:i,media:s,paused:n,volume:a}=e,r=n&&!i.hasPlayed;s.seeking=!0,de.call(e,s,"seeking"),Promise.resolve(r&&i.setVolume(0)).then((()=>i.setCurrentTime(t))).then((()=>r&&i.pause())).then((()=>r&&i.setVolume(a))).catch((()=>{}))}});let p=e.config.speed.selected;Object.defineProperty(e.media,"playbackRate",{get:()=>p,set(t){e.embed.setPlaybackRate(t).then((()=>{p=t,de.call(e,e.media,"ratechange")})).catch((()=>{e.options.speed=[1]}))}});let{volume:m}=e.config;Object.defineProperty(e.media,"volume",{get:()=>m,set(t){e.embed.setVolume(t).then((()=>{m=t,de.call(e,e.media,"volumechange")}))}});let{muted:g}=e.config;Object.defineProperty(e.media,"muted",{get:()=>g,set(t){const i=!!D.boolean(t)&&t;e.embed.setMuted(!!i||e.config.muted).then((()=>{g=i,de.call(e,e.media,"volumechange")}))}});let f,{loop:y}=e.config;Object.defineProperty(e.media,"loop",{get:()=>y,set(t){const i=D.boolean(t)?t:e.config.loop.active;e.embed.setLoop(i).then((()=>{y=i}))}}),e.embed.getVideoUrl().then((t=>{f=t,Re.setDownloadUrl.call(e)})).catch((e=>{this.debug.warn(e)})),Object.defineProperty(e.media,"currentSrc",{get:()=>f}),Object.defineProperty(e.media,"ended",{get:()=>e.currentTime===e.duration}),Promise.all([e.embed.getVideoWidth(),e.embed.getVideoHeight()]).then((t=>{const[i,s]=t;e.embed.ratio=Ee(i,s),Te.call(this)})),e.embed.setAutopause(e.config.autopause).then((t=>{e.config.autopause=t})),e.embed.getVideoTitle().then((t=>{e.config.title=t,Qe.setTitle.call(this)})),e.embed.getCurrentTime().then((t=>{h=t,de.call(e,e.media,"timeupdate")})),e.embed.getDuration().then((t=>{e.media.duration=t,de.call(e,e.media,"durationchange")})),e.embed.getTextTracks().then((t=>{e.media.textTracks=t,He.setup.call(e)})),e.embed.on("cuechange",(({cues:t=[]})=>{const i=t.map((e=>function(e){const t=document.createDocumentFragment(),i=document.createElement("div");return t.appendChild(i),i.innerHTML=e,t.firstChild.textContent}(e.text)));He.updateCues.call(e,i)})),e.embed.on("loaded",(()=>{e.embed.getPaused().then((t=>{st.call(e,!t),t||de.call(e,e.media,"playing")})),D.element(e.embed.element)&&e.supported.ui&&e.embed.element.setAttribute("tabindex",-1)})),e.embed.on("bufferstart",(()=>{de.call(e,e.media,"waiting")})),e.embed.on("bufferend",(()=>{de.call(e,e.media,"playing")})),e.embed.on("play",(()=>{st.call(e,!0),de.call(e,e.media,"playing")})),e.embed.on("pause",(()=>{st.call(e,!1)})),e.embed.on("timeupdate",(t=>{e.media.seeking=!1,h=t.seconds,de.call(e,e.media,"timeupdate")})),e.embed.on("progress",(t=>{e.media.buffered=t.percent,de.call(e,e.media,"progress"),1===Number.parseInt(t.percent,10)&&de.call(e,e.media,"canplaythrough"),e.embed.getDuration().then((t=>{t!==e.media.duration&&(e.media.duration=t,de.call(e,e.media,"durationchange"))}))})),e.embed.on("seeked",(()=>{e.media.seeking=!1,de.call(e,e.media,"seeked")})),e.embed.on("ended",(()=>{e.media.paused=!0,de.call(e,e.media,"ended")})),e.embed.on("error",(t=>{e.media.error=t,de.call(e,e.media,"error")})),t.customControls&&setTimeout((()=>Qe.build.call(e)),0)}};function at(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,de.call(this,this.media,e?"play":"pause"))}function rt(e){return e.noCookie?"https://www.youtube-nocookie.com":"http:"===window.location.protocol?"http://www.youtube.com":void 0}const ot={setup(){if(G(this.elements.wrapper,this.config.classNames.embed,!0),D.object(window.YT)&&D.function(window.YT.Player))ot.ready.call(this);else{const e=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=()=>{D.function(e)&&e(),ot.ready.call(this)},it(this.config.urls.youtube.sdk).catch((e=>{this.debug.warn("YouTube API failed to load",e)}))}},getTitle(e){Ie(Pe(this.config.urls.youtube.api,e)).then((e=>{if(D.object(e)){const{title:t,height:i,width:s}=e;this.config.title=t,Qe.setTitle.call(this),this.embed.ratio=Ee(s,i)}Te.call(this)})).catch((()=>{Te.call(this)}))},ready(){const e=this,t=e.config.youtube,i=e.media&&e.media.getAttribute("id");if(!D.empty(i)&&i.startsWith("youtube-"))return;let s=e.media.getAttribute("src");D.empty(s)&&(s=e.media.getAttribute(this.config.attributes.embed.id));const n=function(e){if(D.empty(e))return null;const t=e.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/);return t&&t[2]?t[2]:e}(s),a=function(e){return`${e}-${Math.floor(1e4*Math.random())}`}(e.provider),r=W("div",{id:a,"data-poster":t.customControls?e.poster:void 0});if(e.media=Q(r,e.media),t.customControls){const t=e=>`https://i.ytimg.com/vi/${n}/${e}default.jpg`;Ye(t("maxres"),121).catch((()=>Ye(t("sd"),121))).catch((()=>Ye(t("hq")))).then((t=>Qe.setPoster.call(e,t.src))).then((t=>{t.includes("maxres")||(e.elements.poster.style.backgroundSize="cover")})).catch((()=>{}))}e.embed=new window.YT.Player(e.media,{videoId:n,host:rt(t),playerVars:V({},{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(t){if(!e.media.error){const i=t.data,s={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."}[i]||"An unknown error occurred";e.media.error={code:i,message:s},de.call(e,e.media,"error")}},onPlaybackRateChange(t){const i=t.target;e.media.playbackRate=i.getPlaybackRate(),de.call(e,e.media,"ratechange")},onReady(i){if(D.function(e.media.play))return;const s=i.target;ot.getTitle.call(e,n),e.media.play=()=>{at.call(e,!0),s.playVideo()},e.media.pause=()=>{at.call(e,!1),s.pauseVideo()},e.media.stop=()=>{s.stopVideo()},e.media.duration=s.getDuration(),e.media.paused=!0,e.media.currentTime=0,Object.defineProperty(e.media,"currentTime",{get:()=>Number(s.getCurrentTime()),set(t){e.paused&&!e.embed.hasPlayed&&e.embed.mute(),e.media.seeking=!0,de.call(e,e.media,"seeking"),s.seekTo(t)}}),Object.defineProperty(e.media,"playbackRate",{get:()=>s.getPlaybackRate(),set(e){s.setPlaybackRate(e)}});let{volume:a}=e.config;Object.defineProperty(e.media,"volume",{get:()=>a,set(t){a=t,s.setVolume(100*a),de.call(e,e.media,"volumechange")}});let{muted:r}=e.config;Object.defineProperty(e.media,"muted",{get:()=>r,set(t){const i=D.boolean(t)?t:r;r=i,s[i?"mute":"unMute"](),s.setVolume(100*a),de.call(e,e.media,"volumechange")}}),Object.defineProperty(e.media,"currentSrc",{get:()=>s.getVideoUrl()}),Object.defineProperty(e.media,"ended",{get:()=>e.currentTime===e.duration});const o=s.getAvailablePlaybackRates();e.options.speed=o.filter((t=>e.config.speed.options.includes(t))),e.supported.ui&&t.customControls&&e.media.setAttribute("tabindex",-1),de.call(e,e.media,"timeupdate"),de.call(e,e.media,"durationchange"),clearInterval(e.timers.buffering),e.timers.buffering=setInterval((()=>{e.media.buffered=s.getVideoLoadedFraction(),(null===e.media.lastBuffered||e.media.lastBuffered<e.media.buffered)&&de.call(e,e.media,"progress"),e.media.lastBuffered=e.media.buffered,1===e.media.buffered&&(clearInterval(e.timers.buffering),de.call(e,e.media,"canplaythrough"))}),200),t.customControls&&setTimeout((()=>Qe.build.call(e)),50)},onStateChange(i){const s=i.target;switch(clearInterval(e.timers.playing),e.media.seeking&&[1,2].includes(i.data)&&(e.media.seeking=!1,de.call(e,e.media,"seeked")),i.data){case-1:de.call(e,e.media,"timeupdate"),e.media.buffered=s.getVideoLoadedFraction(),de.call(e,e.media,"progress");break;case 0:at.call(e,!1),e.media.loop?(s.stopVideo(),s.playVideo()):de.call(e,e.media,"ended");break;case 1:t.customControls&&!e.config.autoplay&&e.media.paused&&!e.embed.hasPlayed?e.media.pause():(at.call(e,!0),de.call(e,e.media,"playing"),e.timers.playing=setInterval((()=>{de.call(e,e.media,"timeupdate")}),50),e.media.duration!==s.getDuration()&&(e.media.duration=s.getDuration(),de.call(e,e.media,"durationchange")));break;case 2:e.muted||e.embed.unMute(),at.call(e,!1);break;case 3:de.call(e,e.media,"waiting")}de.call(e,e.elements.container,"statechange",!1,{code:i.data})}}})}},lt={setup(){this.media?(G(this.elements.container,this.config.classNames.type.replace("{0}",this.type),!0),G(this.elements.container,this.config.classNames.provider.replace("{0}",this.provider),!0),this.isEmbed&&G(this.elements.container,this.config.classNames.type.replace("{0}","video"),!0),this.isVideo&&(this.elements.wrapper=W("div",{class:this.config.classNames.video}),B(this.media,this.elements.wrapper),this.elements.poster=W("div",{class:this.config.classNames.poster}),this.elements.wrapper.appendChild(this.elements.poster)),this.isHTML5?Ce.setup.call(this):this.isYouTube?ot.setup.call(this):this.isVimeo&&nt.setup.call(this)):this.debug.warn("No media element found!")}};class ct{constructor(e){d(this,"load",(()=>{this.enabled&&(D.object(window.google)&&D.object(window.google.ima)?this.ready():it(this.player.config.urls.googleIMA.sdk).then((()=>{this.ready()})).catch((()=>{this.trigger("error",new Error("Google IMA SDK failed to load"))})))})),d(this,"ready",(()=>{var e;this.enabled||((e=this).manager&&e.manager.destroy(),e.elements.displayContainer&&e.elements.displayContainer.destroy(),e.elements.container.remove()),this.startSafetyTimer(12e3,"ready()"),this.managerPromise.then((()=>{this.clearSafetyTimer("onAdsManagerLoaded()")})),this.listeners(),this.setupIMA()})),d(this,"setupIMA",(()=>{this.elements.container=W("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,(e=>this.onAdsManagerLoaded(e)),!1),this.loader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,(e=>this.onAdError(e)),!1),this.requestAds()})),d(this,"requestAds",(()=>{const{container:e}=this.player.elements;try{const t=new google.ima.AdsRequest;t.adTagUrl=this.tagUrl,t.linearAdSlotWidth=e.offsetWidth,t.linearAdSlotHeight=e.offsetHeight,t.nonLinearAdSlotWidth=e.offsetWidth,t.nonLinearAdSlotHeight=e.offsetHeight,t.forceNonLinearFullSlot=!1,t.setAdWillPlayMuted(!this.player.muted),this.loader.requestAds(t)}catch(e){this.onAdError(e)}})),d(this,"pollCountdown",((e=!1)=>{if(!e)return clearInterval(this.countdownTimer),void this.elements.container.removeAttribute("data-badge-text");this.countdownTimer=setInterval((()=>{const e=je(Math.max(this.manager.getRemainingTime(),0)),t=`${Me.get("advertisement",this.player.config)} - ${e}`;this.elements.container.setAttribute("data-badge-text",t)}),100)})),d(this,"onAdsManagerLoaded",(e=>{if(!this.enabled)return;const t=new google.ima.AdsRenderingSettings;t.restoreCustomPlaybackStateOnAdBreakComplete=!0,t.enablePreloading=!0,this.manager=e.getAdsManager(this.player,t),this.cuePoints=this.manager.getCuePoints(),this.manager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,(e=>this.onAdError(e))),Object.keys(google.ima.AdEvent.Type).forEach((e=>{this.manager.addEventListener(google.ima.AdEvent.Type[e],(e=>this.onAdEvent(e)))})),this.trigger("loaded")})),d(this,"addCuePoints",(()=>{D.empty(this.cuePoints)||this.cuePoints.forEach((e=>{if(0!==e&&-1!==e&&e<this.player.duration){const t=this.player.elements.progress;if(D.element(t)){const i=100/this.player.duration*e,s=W("span",{class:this.player.config.classNames.cues});s.style.left=`${i.toString()}%`,t.appendChild(s)}}}))})),d(this,"onAdEvent",(e=>{const{container:t}=this.player.elements,i=e.getAd(),s=e.getAdData();switch((e=>{de.call(this.player,this.player.media,`ads${e.replace(/_/g,"").toLowerCase()}`)})(e.type),e.type){case google.ima.AdEvent.Type.LOADED:this.trigger("loaded"),this.pollCountdown(!0),i.isLinear()||(i.width=t.offsetWidth,i.height=t.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()}`)}})),d(this,"onAdError",(e=>{this.cancel(),this.player.debug.warn("Ads error",e)})),d(this,"listeners",(()=>{const{container:e}=this.player.elements;let t;this.player.on("canplay",(()=>{this.addCuePoints()})),this.player.on("ended",(()=>{this.loader.contentComplete()})),this.player.on("timeupdate",(()=>{t=this.player.currentTime})),this.player.on("seeked",(()=>{const e=this.player.currentTime;D.empty(this.cuePoints)||this.cuePoints.forEach(((i,s)=>{t<i&&i<e&&(this.manager.discardAdBreak(),this.cuePoints.splice(s,1))}))})),window.addEventListener("resize",(()=>{this.manager&&this.manager.resize(e.offsetWidth,e.offsetHeight,google.ima.ViewMode.NORMAL)}))})),d(this,"play",(()=>{const{container:e}=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(e.offsetWidth,e.offsetHeight,google.ima.ViewMode.NORMAL),this.manager.start()),this.initialized=!0}catch(e){this.onAdError(e)}})).catch((()=>{}))})),d(this,"resumeContent",(()=>{this.elements.container.style.zIndex="",this.playing=!1,me(this.player.media.play())})),d(this,"pauseContent",(()=>{this.elements.container.style.zIndex=3,this.playing=!0,this.player.media.pause()})),d(this,"cancel",(()=>{this.initialized&&this.resumeContent(),this.trigger("error"),this.loadAds()})),d(this,"loadAds",(()=>{this.managerPromise.then((()=>{this.manager&&this.manager.destroy(),this.managerPromise=new Promise((e=>{this.on("loaded",e),this.player.debug.log(this.manager)})),this.initialized=!1,this.requestAds()})).catch((()=>{}))})),d(this,"trigger",((e,...t)=>{const i=this.events[e];D.array(i)&&i.forEach((e=>{D.function(e)&&e.apply(this,t)}))})),d(this,"on",((e,t)=>(D.array(this.events[e])||(this.events[e]=[]),this.events[e].push(t),this))),d(this,"startSafetyTimer",((e,t)=>{this.player.debug.log(`Safety timer invoked from: ${t}`),this.safetyTimer=setTimeout((()=>{this.cancel(),this.clearSafetyTimer("startSafetyTimer()")}),e)})),d(this,"clearSafetyTimer",(e=>{D.nullOrUndefined(this.safetyTimer)||(this.player.debug.log(`Safety timer cleared from: ${e}`),clearTimeout(this.safetyTimer),this.safetyTimer=null)})),this.player=e,this.config=e.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(((e,t)=>{this.on("loaded",e),this.on("error",t)})),this.load()}get enabled(){const{config:e}=this;return this.player.isHTML5&&this.player.isVideo&&e.enabled&&(!D.empty(e.publisherId)||D.url(e.tagUrl))}get tagUrl(){const{config:e}=this;return D.url(e.tagUrl)?e.tagUrl:`https://go.aniview.com/api/adserver6/vast/?${Fe({AV_PUBLISHERID:"58c25bb0073ef448b1087ad6",AV_CHANNELID:"5a0458dc28a06145e4519d21",AV_URL:window.location.hostname,cb:Date.now(),AV_WIDTH:640,AV_HEIGHT:480,AV_CDIM2:e.publisherId})}`}}function ut(e=0,t=0,i=255){return Math.min(Math.max(e,t),i)}function dt(e){const t=[];return e.split(/\r\n\r\n|\n\n|\r\r/).forEach((e=>{const i={};e.split(/\r\n|\n|\r/).forEach((e=>{if(D.number(i.startTime)){if(!D.empty(e.trim())&&D.empty(i.text)){const t=e.trim().split("#xywh=");[i.text]=t,t[1]&&([i.x,i.y,i.w,i.h]=t[1].split(","))}}else{const t=e.match(/(\d{2})?:?(\d{2}):(\d{2}).(\d{2,3})( ?--> ?)(\d{2})?:?(\d{2}):(\d{2}).(\d{2,3})/);t&&(i.startTime=60*Number(t[1]||0)*60+60*Number(t[2])+Number(t[3])+Number(`0.${t[4]}`),i.endTime=60*Number(t[6]||0)*60+60*Number(t[7])+Number(t[8])+Number(`0.${t[9]}`))}})),i.text&&t.push(i)})),t}function ht(e,t){const i={};return e>t.width/t.height?(i.width=t.width,i.height=1/e*t.width):(i.height=t.height,i.width=e*t.height),i}class pt{constructor(e){d(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)}))})),d(this,"getThumbnails",(()=>new Promise((e=>{const{src:t}=this.player.config.previewThumbnails;if(D.empty(t))throw new Error("Missing previewThumbnails.src config attribute");const i=()=>{this.thumbnails.sort(((e,t)=>e.height-t.height)),this.player.debug.log("Preview thumbnails",this.thumbnails),e()};if(D.function(t))t((e=>{this.thumbnails=e,i()}));else{const e=(D.string(t)?[t]:t).map((e=>this.getThumbnail(e)));Promise.all(e).then(i)}})))),d(this,"getThumbnail",(e=>new Promise((t=>{Ie(e,void 0,this.player.config.previewThumbnails.withCredentials).then((i=>{const s={frames:dt(i),height:null,urlPrefix:""};s.frames[0].text.startsWith("/")||s.frames[0].text.startsWith("http://")||s.frames[0].text.startsWith("https://")||(s.urlPrefix=e.substring(0,e.lastIndexOf("/")+1));const n=new Image;n.onload=()=>{s.height=n.naturalHeight,s.width=n.naturalWidth,this.thumbnails.push(s),t()},n.src=s.urlPrefix+s.frames[0].text}))})))),d(this,"startMove",(e=>{if(this.loaded&&D.event(e)&&["touchmove","mousemove"].includes(e.type)&&this.player.media.duration){if("touchmove"===e.type)this.seekTime=this.player.media.duration*(this.player.elements.inputs.seek.value/100);else{var t,i;const s=this.player.elements.progress.getBoundingClientRect(),n=100/s.width*(e.pageX-s.left);this.seekTime=this.player.media.duration*(n/100),this.seekTime<0&&(this.seekTime=0),this.seekTime>this.player.media.duration-1&&(this.seekTime=this.player.media.duration-1),this.mousePosX=e.pageX,this.elements.thumb.time.textContent=je(this.seekTime);const a=null===(t=this.player.config.markers)||void 0===t||null===(i=t.points)||void 0===i?void 0:i.find((({time:e})=>e===Math.round(this.seekTime)));a&&this.elements.thumb.time.insertAdjacentHTML("afterbegin",`${a.label}<br>`)}this.showImageAtCurrentTime()}})),d(this,"endMove",(()=>{this.toggleThumbContainer(!1,!0)})),d(this,"startScrubbing",(e=>{(D.nullOrUndefined(e.button)||!1===e.button||0===e.button)&&(this.mouseDown=!0,this.player.media.duration&&(this.toggleScrubbingContainer(!0),this.toggleThumbContainer(!1,!0),this.showImageAtCurrentTime()))})),d(this,"endScrubbing",(()=>{this.mouseDown=!1,Math.ceil(this.lastTime)===Math.ceil(this.player.media.currentTime)?this.toggleScrubbingContainer(!1):ue.call(this.player,this.player.media,"timeupdate",(()=>{this.mouseDown||this.toggleScrubbingContainer(!1)}))})),d(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}))})),d(this,"render",(()=>{this.elements.thumb.container=W("div",{class:this.player.config.classNames.previewThumbnails.thumbContainer}),this.elements.thumb.imageContainer=W("div",{class:this.player.config.classNames.previewThumbnails.imageContainer}),this.elements.thumb.container.appendChild(this.elements.thumb.imageContainer);const e=W("div",{class:this.player.config.classNames.previewThumbnails.timeContainer});this.elements.thumb.time=W("span",{},"00:00"),e.appendChild(this.elements.thumb.time),this.elements.thumb.imageContainer.appendChild(e),D.element(this.player.elements.progress)&&this.player.elements.progress.appendChild(this.elements.thumb.container),this.elements.scrubbing.container=W("div",{class:this.player.config.classNames.previewThumbnails.scrubbingContainer}),this.player.elements.wrapper.appendChild(this.elements.scrubbing.container)})),d(this,"destroy",(()=>{this.elements.thumb.container&&this.elements.thumb.container.remove(),this.elements.scrubbing.container&&this.elements.scrubbing.container.remove()})),d(this,"showImageAtCurrentTime",(()=>{this.mouseDown?this.setScrubbingContainerSize():this.setThumbContainerSizeAndPos();const e=this.thumbnails[0].frames.findIndex((e=>this.seekTime>=e.startTime&&this.seekTime<=e.endTime)),t=e>=0;let i=0;this.mouseDown||this.toggleThumbContainer(t),t&&(this.thumbnails.forEach(((t,s)=>{this.loadedImages.includes(t.frames[e].text)&&(i=s)})),e!==this.showingThumb&&(this.showingThumb=e,this.loadImage(i)))})),d(this,"loadImage",((e=0)=>{const t=this.showingThumb,i=this.thumbnails[e],{urlPrefix:s}=i,n=i.frames[t],a=i.frames[t].text,r=s+a;if(this.currentImageElement&&this.currentImageElement.dataset.filename===a)this.showImage(this.currentImageElement,n,e,t,a,!1),this.currentImageElement.dataset.index=t,this.removeOldImages(this.currentImageElement);else{this.loadingImage&&this.usingSprites&&(this.loadingImage.onload=null);const i=new Image;i.src=r,i.dataset.index=t,i.dataset.filename=a,this.showingThumbFilename=a,this.player.debug.log(`Loading image: ${r}`),i.onload=()=>this.showImage(i,n,e,t,a,!0),this.loadingImage=i,this.removeOldImages(i)}})),d(this,"showImage",((e,t,i,s,n,a=!0)=>{this.player.debug.log(`Showing thumb: ${n}. num: ${s}. qual: ${i}. newimg: ${a}`),this.setImageSizeAndOffset(e,t),a&&(this.currentImageContainer.appendChild(e),this.currentImageElement=e,this.loadedImages.includes(n)||this.loadedImages.push(n)),this.preloadNearby(s,!0).then(this.preloadNearby(s,!1)).then(this.getHigherQuality(i,e,t,n))})),d(this,"removeOldImages",(e=>{Array.from(this.currentImageContainer.children).forEach((t=>{if("img"!==t.tagName.toLowerCase())return;const i=this.usingSprites?500:1e3;if(t.dataset.index!==e.dataset.index&&!t.dataset.deleting){t.dataset.deleting=!0;const{currentImageContainer:e}=this;setTimeout((()=>{e.removeChild(t),this.player.debug.log(`Removing thumb: ${t.dataset.filename}`)}),i)}}))})),d(this,"preloadNearby",((e,t=!0)=>new Promise((i=>{setTimeout((()=>{const s=this.thumbnails[0].frames[e].text;if(this.showingThumbFilename===s){let n;n=t?this.thumbnails[0].frames.slice(e):this.thumbnails[0].frames.slice(0,e).reverse();let a=!1;n.forEach((e=>{const t=e.text;if(t!==s&&!this.loadedImages.includes(t)){a=!0,this.player.debug.log(`Preloading thumb filename: ${t}`);const{urlPrefix:e}=this.thumbnails[0],s=e+t,n=new Image;n.src=s,n.onload=()=>{this.player.debug.log(`Preloaded thumb filename: ${t}`),this.loadedImages.includes(t)||this.loadedImages.push(t),i()}}})),a||i()}}),300)})))),d(this,"getHigherQuality",((e,t,i,s)=>{if(e<this.thumbnails.length-1){let n=t.naturalHeight;this.usingSprites&&(n=i.h),n<this.thumbContainerHeight&&setTimeout((()=>{this.showingThumbFilename===s&&(this.player.debug.log(`Showing higher quality thumb for: ${s}`),this.loadImage(e+1))}),300)}})),d(this,"toggleThumbContainer",((e=!1,t=!1)=>{const i=this.player.config.classNames.previewThumbnails.thumbContainerShown;this.elements.thumb.container.classList.toggle(i,e),!e&&t&&(this.showingThumb=null,this.showingThumbFilename=null)})),d(this,"toggleScrubbingContainer",((e=!1)=>{const t=this.player.config.classNames.previewThumbnails.scrubbingContainerShown;this.elements.scrubbing.container.classList.toggle(t,e),e||(this.showingThumb=null,this.showingThumbFilename=null)})),d(this,"determineContainerAutoSizing",(()=>{(this.elements.thumb.imageContainer.clientHeight>20||this.elements.thumb.imageContainer.clientWidth>20)&&(this.sizeSpecifiedInCSS=!0)})),d(this,"setThumbContainerSizeAndPos",(()=>{const{imageContainer:e}=this.elements.thumb;if(this.sizeSpecifiedInCSS){if(e.clientHeight>20&&e.clientWidth<20){const t=Math.floor(e.clientHeight*this.thumbAspectRatio);e.style.width=`${t}px`}else if(e.clientHeight<20&&e.clientWidth>20){const t=Math.floor(e.clientWidth/this.thumbAspectRatio);e.style.height=`${t}px`}}else{const t=Math.floor(this.thumbContainerHeight*this.thumbAspectRatio);e.style.height=`${this.thumbContainerHeight}px`,e.style.width=`${t}px`}this.setThumbContainerPos()})),d(this,"setThumbContainerPos",(()=>{const e=this.player.elements.progress.getBoundingClientRect(),t=this.player.elements.container.getBoundingClientRect(),{container:i}=this.elements.thumb,s=t.left-e.left+10,n=t.right-e.left-i.clientWidth-10,a=this.mousePosX-e.left-i.clientWidth/2,r=ut(a,s,n);i.style.left=`${r}px`,i.style.setProperty("--preview-arrow-offset",a-r+"px")})),d(this,"setScrubbingContainerSize",(()=>{const{width:e,height:t}=ht(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight});this.elements.scrubbing.container.style.width=`${e}px`,this.elements.scrubbing.container.style.height=`${t}px`})),d(this,"setImageSizeAndOffset",((e,t)=>{if(!this.usingSprites)return;const i=this.thumbContainerHeight/t.h;e.style.height=e.naturalHeight*i+"px",e.style.width=e.naturalWidth*i+"px",e.style.left=`-${t.x*i}px`,e.style.top=`-${t.y*i}px`})),this.player=e,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:e}=ht(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight});return e}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(e){this.mouseDown?this.currentScrubbingImageElement=e:this.currentThumbnailImageElement=e}}const mt={insertElements(e,t){D.string(t)?z(e,this.media,{src:t}):D.array(t)&&t.forEach((t=>{z(e,this.media,t)}))},change(e){q(e,"sources.length")?(Ce.cancelRequests.call(this),this.destroy((()=>{this.options.quality=[],K(this.media),this.media=null,D.element(this.elements.container)&&this.elements.container.removeAttribute("class");const{sources:t,type:i}=e,[{provider:s=Be.html5,src:n}]=t,a="html5"===s?i:"div",r="html5"===s?{}:{src:n};Object.assign(this,{provider:s,type:i,supported:ae.check(i,s,this.config.playsinline),media:W(a,r)}),this.elements.container.appendChild(this.media),D.boolean(e.autoplay)&&(this.config.autoplay=e.autoplay),this.isHTML5&&(this.config.crossorigin&&this.media.setAttribute("crossorigin",""),this.config.autoplay&&this.media.setAttribute("autoplay",""),D.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","")),Qe.addStyleHook.call(this),this.isHTML5&&mt.insertElements.call(this,"source",t),this.config.title=e.title,lt.setup.call(this),this.isHTML5&&Object.keys(e).includes("tracks")&&mt.insertElements.call(this,"track",e.tracks),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&Qe.build.call(this),this.isHTML5&&this.media.load(),D.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 pt(this))),this.fullscreen.update()}),!0)):this.debug.warn("Invalid source format")}};class gt{constructor(e,t){if(d(this,"play",(()=>D.function(this.media.play)?(this.ads&&this.ads.enabled&&this.ads.managerPromise.then((()=>this.ads.play())).catch((()=>me(this.media.play()))),this.media.play()):null)),d(this,"pause",(()=>this.playing&&D.function(this.media.pause)?this.media.pause():null)),d(this,"togglePlay",(e=>(D.boolean(e)?e:!this.playing)?this.play():this.pause())),d(this,"stop",(()=>{this.isHTML5?(this.pause(),this.restart()):D.function(this.media.stop)&&this.media.stop()})),d(this,"restart",(()=>{this.currentTime=0})),d(this,"rewind",(e=>{this.currentTime-=D.number(e)?e:this.config.seekTime})),d(this,"forward",(e=>{this.currentTime+=D.number(e)?e:this.config.seekTime})),d(this,"increaseVolume",(e=>{const t=this.media.muted?0:this.volume;this.volume=t+(D.number(e)?e:0)})),d(this,"decreaseVolume",(e=>{this.increaseVolume(-e)})),d(this,"airplay",(()=>{ae.airplay&&this.media.webkitShowPlaybackTargetPicker()})),d(this,"toggleControls",(e=>{if(this.supported.ui&&!this.isAudio){const t=Z(this.elements.container,this.config.classNames.hideControls),i=void 0===e?void 0:!e,s=G(this.elements.container,this.config.classNames.hideControls,i);if(s&&D.array(this.config.controls)&&this.config.controls.includes("settings")&&!D.empty(this.config.settings)&&Re.toggleMenu.call(this,!1),s!==t){const e=s?"controlshidden":"controlsshown";de.call(this,this.media,e)}return!s}return!1})),d(this,"on",((e,t)=>{le.call(this,this.elements.container,e,t)})),d(this,"once",((e,t)=>{ue.call(this,this.elements.container,e,t)})),d(this,"off",((e,t)=>{ce(this.elements.container,e,t)})),d(this,"destroy",((e,t=!1)=>{if(!this.ready)return;const i=()=>{document.body.style.overflow="",this.embed=null,t?(Object.keys(this.elements).length&&(K(this.elements.buttons.play),K(this.elements.captions),K(this.elements.controls),K(this.elements.wrapper),this.elements.buttons.play=null,this.elements.captions=null,this.elements.controls=null,this.elements.wrapper=null),D.function(e)&&e()):(he.call(this),Ce.cancelRequests.call(this),Q(this.elements.original,this.elements.container),de.call(this,this.elements.original,"destroyed",!0),D.function(e)&&e.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?(Qe.toggleNativeControls.call(this,!0),i()):this.isYouTube?(clearInterval(this.timers.buffering),clearInterval(this.timers.playing),null!==this.embed&&D.function(this.embed.destroy)&&this.embed.destroy(),i()):this.isVimeo&&(null!==this.embed&&this.embed.unload().then(i),setTimeout(i,200))})),d(this,"supports",(e=>ae.mime.call(this,e))),this.timers={},this.ready=!1,this.loading=!1,this.failed=!1,this.touch=ae.touch,this.media=e,D.string(this.media)&&(this.media=document.querySelectorAll(this.media)),(window.jQuery&&this.media instanceof jQuery||D.nodeList(this.media)||D.array(this.media))&&(this.media=this.media[0]),this.config=V({},qe,gt.defaults,t||{},(()=>{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 ze(this.config.debug),this.debug.log("Config",this.config),this.debug.log("Support",ae),D.nullOrUndefined(this.media)||!D.element(this.media))return void this.debug.error("Setup failed: no suitable element passed");if(this.media.plyr)return void this.debug.warn("Target already setup");if(!this.config.enabled)return void this.debug.error("Setup failed: disabled by config");if(!ae.check().api)return void this.debug.error("Setup failed: no support");const i=this.media.cloneNode(!0);i.autoplay=!1,this.elements.original=i;const s=this.media.tagName.toLowerCase();let n=null,a=null;switch(s){case"div":if(n=this.media.querySelector("iframe"),D.element(n)){if(a=De(n.getAttribute("src")),this.provider=function(e){return/^(?:https?:\/\/)?(?:www\.)?(?:youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(e)?Be.youtube:/^https?:\/\/player.vimeo.com\/video\/\d{0,9}(?=\b|\/)/.test(e)?Be.vimeo:null}(a.toString()),this.elements.container=this.media,this.media=n,this.elements.container.className="",a.search.length){const e=["1","true"];e.includes(a.searchParams.get("autoplay"))&&(this.config.autoplay=!0),e.includes(a.searchParams.get("loop"))&&(this.config.loop.active=!0),this.isYouTube?(this.config.playsinline=e.includes(a.searchParams.get("playsinline")),this.config.youtube.hl=a.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(D.empty(this.provider)||!Object.values(Be).includes(this.provider))return void this.debug.error("Setup failed: Invalid provider");this.type=Ue;break;case"video":case"audio":this.type=s,this.provider=Be.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:return void this.debug.error("Setup failed: unsupported type")}this.supported=ae.check(this.type,this.provider),this.supported.api?(this.eventListeners=[],this.listeners=new Xe(this),this.storage=new Le(this),this.media.plyr=this,D.element(this.elements.container)||(this.elements.container=W("div"),B(this.media,this.elements.container)),Qe.migrateStyles.call(this),Qe.addStyleHook.call(this),lt.setup.call(this),this.config.debug&&le.call(this,this.elements.container,this.config.events.join(" "),(e=>{this.debug.log(`event: ${e.type}`)})),this.fullscreen=new Ke(this),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&Qe.build.call(this),this.listeners.container(),this.listeners.global(),this.config.ads.enabled&&(this.ads=new ct(this)),this.isHTML5&&this.config.autoplay&&this.once("canplay",(()=>me(this.play()))),this.lastSeekTime=0,this.config.previewThumbnails.enabled&&(this.previewThumbnails=new pt(this))):this.debug.error("Setup failed: no support")}get isHTML5(){return this.provider===Be.html5}get isEmbed(){return this.isYouTube||this.isVimeo}get isYouTube(){return this.provider===Be.youtube}get isVimeo(){return this.provider===Be.vimeo}get isVideo(){return this.type===Ue}get isAudio(){return"audio"===this.type}get playing(){return Boolean(this.ready&&!this.paused&&!this.ended)}get paused(){return Boolean(this.media.paused)}get stopped(){return Boolean(this.paused&&0===this.currentTime)}get ended(){return Boolean(this.media.ended)}set currentTime(e){if(!this.duration)return;const t=D.number(e)&&e>0;this.media.currentTime=t?Math.min(e,this.duration):0,this.debug.log(`Seeking to ${this.currentTime} seconds`)}get currentTime(){return Number(this.media.currentTime)}get buffered(){const{buffered:e}=this.media;return D.number(e)?e:e&&e.length&&this.duration>0?e.end(0)/this.duration:0}get seeking(){return Boolean(this.media.seeking)}get duration(){const e=Number.parseFloat(this.config.duration),t=(this.media||{}).duration,i=D.number(t)&&t!==1/0?t:0;return e||i}set volume(e){let t=e;D.string(t)&&(t=Number(t)),D.number(t)||(t=this.storage.get("volume")),D.number(t)||({volume:t}=this.config),t>1&&(t=1),t<0&&(t=0),this.config.volume=t,this.media.volume=t,!D.empty(e)&&this.muted&&t>0&&(this.muted=!1)}get volume(){return Number(this.media.volume)}set muted(e){let t=e;D.boolean(t)||(t=this.storage.get("muted")),D.boolean(t)||(t=this.config.muted),this.config.muted=t,this.media.muted=t}get muted(){return Boolean(this.media.muted)}get hasAudio(){return!this.isHTML5||!!this.isAudio||Boolean(this.media.mozHasAudio)||Boolean(this.media.webkitAudioDecodedByteCount)||Boolean(this.media.audioTracks&&this.media.audioTracks.length)}set speed(e){let t=null;D.number(e)&&(t=e),D.number(t)||(t=this.storage.get("speed")),D.number(t)||(t=this.config.speed.selected);const{minimumSpeed:i,maximumSpeed:s}=this;t=ut(t,i,s),this.config.speed.selected=t,setTimeout((()=>{this.media&&(this.media.playbackRate=t)}),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(e){const t=this.config.quality,i=this.options.quality;if(!i.length)return;let s=[!D.empty(e)&&Number(e),this.storage.get("quality"),t.selected,t.default].find(D.number),n=!0;if(!i.includes(s)){const e=fe(i,s);this.debug.warn(`Unsupported quality option: ${s}, using ${e} instead`),s=e,n=!1}t.selected=s,this.media.quality=s,n&&this.storage.set({quality:s})}get quality(){return this.media.quality}set loop(e){const t=D.boolean(e)?e:this.config.loop.active;this.config.loop.active=t,this.media.loop=t}get loop(){return Boolean(this.media.loop)}set source(e){mt.change.call(this,e)}get source(){return this.media.currentSrc}get download(){const{download:e}=this.config.urls;return D.url(e)?e:this.source}set download(e){D.url(e)&&(this.config.urls.download=e,Re.setDownloadUrl.call(this))}set poster(e){this.isVideo?Qe.setPoster.call(this,e,!1).catch((()=>{})):this.debug.warn("Poster can only be set for video")}get poster(){return this.isVideo?this.media.getAttribute("poster")||this.media.getAttribute("data-poster"):null}get ratio(){if(!this.isVideo)return null;const e=we(ke.call(this));return D.array(e)?e.join(":"):e}set ratio(e){this.isVideo?D.string(e)&&ve(e)?(this.config.ratio=we(e),Te.call(this)):this.debug.error(`Invalid aspect ratio specified (${e})`):this.debug.warn("Aspect ratio can only be set for video")}set autoplay(e){this.config.autoplay=D.boolean(e)?e:this.config.autoplay}get autoplay(){return Boolean(this.config.autoplay)}toggleCaptions(e){He.toggle.call(this,e,!1)}set currentTrack(e){He.set.call(this,e,!1),He.setup.call(this)}get currentTrack(){const{toggled:e,currentTrack:t}=this.captions;return e?t:-1}set language(e){He.setLanguage.call(this,e,!1)}get language(){return(He.getCurrentTrack.call(this)||{}).language}set pip(e){if(!ae.pip)return;const t=D.boolean(e)?e:!this.pip;D.function(this.media.webkitSetPresentationMode)&&this.media.webkitSetPresentationMode(t?Ve:"inline"),D.function(this.media.requestPictureInPicture)&&(!this.pip&&t?this.media.requestPictureInPicture():this.pip&&!t&&document.exitPictureInPicture())}get pip(){return ae.pip?D.empty(this.media.webkitPresentationMode)?this.media===document.pictureInPictureElement:this.media.webkitPresentationMode===Ve:null}setPreviewThumbnails(e){this.previewThumbnails&&this.previewThumbnails.loaded&&(this.previewThumbnails.destroy(),this.previewThumbnails=null),Object.assign(this.config.previewThumbnails,e),this.config.previewThumbnails.enabled&&(this.previewThumbnails=new pt(this))}static supported(e,t){return ae.check(e,t)}static loadSprite(e,t){return _e(e,t)}static setup(e,t={}){let i=null;return D.string(e)?i=Array.from(document.querySelectorAll(e)):D.nodeList(e)?i=Array.from(e):D.array(e)&&(i=e.filter(D.element)),D.empty(i)?null:i.map((e=>new gt(e,t)))}}var ft;gt.defaults=(ft=qe,JSON.parse(JSON.stringify(ft)));var yt=i(5556),bt=i.n(yt);const vt=(e,t)=>{const i=new gt(".plyr-react",t.options||{});return t.source&&(i.source=t.source),i},wt=e=>{e&&e.destroy()},kt=()=>{},Tt=e=>e?()=>({plyr:e}):()=>new Proxy({plyr:{source:null}},{get:(e,t)=>"plyr"===t?e[t]:kt});const Et=e.forwardRef(((t,i)=>{const{source:s,options:n=null,...a}=t,r=function(t,i,s=null){return function(t,i,s=[]){const[n,a]=(0,e.useState)(null),r=(0,e.useRef)(null),{instantiate:o,destroy:l,getAPI:c,params:u}=i;(0,e.useEffect)((()=>{const e=o(r.current,u);return a(e),()=>{l&&l(e,u)}}),s);const d=(0,e.useMemo)((()=>c(n,u)),[n]);return(0,e.useImperativeHandle)(t,d,[d]),r}(t,{instantiate:vt,getAPI:Tt,destroy:wt,params:i},s||[i.options,i.source])}(i,{source:s,options:n});return(0,u.jsx)("video",{ref:r,className:"plyr-react plyr",...a})}));Et.displayName="Plyr",Et.defaultProps={options:{controls:["rewind","play","fast-forward","progress","current-time","duration","mute","volume","settings","fullscreen"],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",menuBack:"Go back to previous menu",speed:"Speed",normal:"Normal",quality:"Quality",loop:"Loop"}},source:{type:"video",sources:[{src:"https://cdn.plyr.io/static/blank.mp4",type:"video/mp4",size:720},{src:"https://cdn.plyr.io/static/blank.mp4",type:"video/mp4",size:1080}]}},Et.propTypes={options:bt().object,source:bt().any};const Ct=({popup:t})=>{const{type:i="video",content:s="",videoOptions:n={}}=t,{autoplay:a=!1}=n||{};return(0,e.createElement)(Et,{source:{type:i,sources:[{src:s,provider:s.includes("youtube")?"youtube":s.includes("vimeo")?"vimeo":"html5"}]},options:{autoplay:a}})},St=(0,e.forwardRef)((({attributes:t,securityPass:i=!0,setSecurityPass:s,isPremium:n,Popup:a,popupContent:r,isBackend:o=!1,children:u,onClick:d=()=>{}},h)=>{const{actionType:p="link",iconPos:m="left"}=t;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("a",{ref:h,...l(t,i,n,o),onClick:()=>d(!0)},"right"!==m&&(0,e.createElement)(c,{attributes:t}),u,"right"===m&&(0,e.createElement)(c,{attributes:t})),n&&"popup"===p&&i&&!o&&(0,e.createElement)(Pt,{attributes:t,Popup:a,popupContent:r,securityPop:i,setSecurityPass:s,btnRef:h}))})),Pt=({attributes:t,Popup:i,popupContent:s,securityPop:n,setSecurityPass:a})=>{const{actionType:r="link",popup:o={}}=t,{caption:l=""}=o,[c,u]=(0,e.useState)(n);return(0,e.useEffect)((()=>{}),[r]),(0,e.createElement)(i,{isOpen:c,onClose:()=>{u(!1),a(!1)},caption:l},(0,e.createElement)(At,{popup:o,popupContent:s}))},At=({popup:t,popupContent:i})=>{const{type:s="image",content:n="",caption:a=""}=t;if(!n)return(0,e.createElement)("p",{className:"warning"},"Sorry! No ","iframe"===s?"Iframe Source":s," Found. Please Insert...");switch(s){case"image":return(0,e.createElement)("img",{className:"image",src:n,alt:a});case"audio":case"video":return(0,e.createElement)(Ct,{popup:t});case"content":return i;case"document":return(0,e.createElement)("div",{className:"document"},(0,e.createElement)("iframe",{src:`//docs.google.com/viewer?embedded=true&url=${n}`}));case"iframe":return(0,e.createElement)("div",{className:"iframe"},(0,e.createElement)("iframe",{src:n}));default:return null}},xt="linear-gradient(135deg, #0040E3, #18D4FD)",$t=(e,t,i=!1)=>s(t)?`${e}: ${t}${i?" !important":""};`:"",Nt=e=>{const{width:t="",style:i="solid",color:s="",side:n="all",radius:a=""}=e||{},r=e=>{const t=n?.toLowerCase();return t?.includes("all")||t?.includes(e)},o=`${t} ${i} ${s}`,l=`\n\t\t${t&&0!==parseInt(t)?["top","right","bottom","left"].map((e=>r(e)?`border-${e}: ${o};`:"")).join(""):""}\n\t\t${$t("border-radius",a)}\n\t`;return l},Mt=e=>{const{color:t="",bgType:i="solid",bg:s="",gradient:n=xt}=e||{};return`\n\t\t${$t("color",t)}\n\t\t${n||s?$t("background","gradient"===i?n:s):""}\n\t`},Lt=(e,t="box")=>{let i="";return e?.map(((s,n)=>{const{hOffset:a="0px",vOffset:r="0px",blur:o="0px",spreed:l="0px",color:c="#e7f0fe",isInset:u=!1}=s||{},d=u?"inset":"",h=`${a} ${r} ${o}`,p=n+1>=e.length?"":", ";i+="text"===t?`${h} ${c}${p}`:`${h} ${l} ${c} ${d}${p}`})),i||""},It=e=>{const{side:t=2,vertical:i="0px",horizontal:s="0px",top:n="0px",right:a="0px",bottom:r="0px",left:o="0px"}=e||{};return 2===t?`${i} ${s}`:`${n} ${a} ${r} ${o}`},_t=(e,t,i=!0)=>{const{fontFamily:s="Default",fontCategory:n="sans-serif",fontVariant:a=400,fontWeight:r,isUploadFont:o=!0,fontSize:l={desktop:null,tablet:null,mobile:null},fontStyle:c,textTransform:u,textDecoration:d,lineHeight:h,letterSpace:p}=t||{},m=!i||!s||"Default"===s,g=l?.desktop||l,f=l?.tablet||g,y=l?.mobile||f,b=e=>{const t=String(e);return["px","em","rem","%","vh","vw"].some((e=>t.endsWith(e)))?t:"number"==typeof e?`${t}px`:""},v=`\n\t\t${m?"":`font-family: '${s}', ${n};`}\n\t\t${$t("font-weight",r)}\n\t\t${$t("font-size",b(g))}\n\t\t${$t("font-style",c)}\n\t\t${$t("text-transform",u)}\n\t\t${$t("text-decoration",d)}\n\t\t${$t("line-height",h)}\n\t\t${$t("letter-spacing",p)}\n\t`,w=a&&400!==a?"400i"===a?":ital@1":a?.includes("00i")?`: ital, wght@1, ${a?.replace("00i","00")} `:`: wght@${a} `:"",k=m?"":`https://fonts.googleapis.com/css2?family=${s?.split(" ").join("+")}${w.replace(/ /g,"")}&display=swap`;return{googleFontLink:!o||m?"":`@import url(${k});`,styles:`${e}{\n\t\t\t${v}\n\t\t}\n\t\t@media only screen and (max-width: 1024px) {\n\t\t\t${e}{\n\t\t\t\t${$t("font-size",b(f))}\n\t\t\t}\n\t\t}\n\t\t@media only screen and (max-width: 640px) {\n\t\t\t${e}{\n\t\t\t\t${$t("font-size",b(y))}\n\t\t\t}\n\t\t}`.replace(/\s+/g," ").trim()}},Ot=({attributes:t,id:i})=>{const{hideOn:n={desktop:!1,tablet:!1,mobile:!1},isFullWidth:a,addCSS:r,alignment:l,typography:c,colors:u,hovColors:d,padding:h,border:p,shadow:m,buttonHover:g}=t,f=`#${i}`,y=`${f} .${o}`;return(0,e.createElement)("style",{dangerouslySetInnerHTML:{__html:`\n\t\t${_t("",c)?.googleFontLink}\n\t\t${_t(y,c)?.styles}\n\n\t\t${f}{\n\t\t\ttext-align: ${l};\n\t\t}\n\t\t${y}:not(.btnEditor){\n\t\t\tdisplay: ${n?.desktop?"none":"inline-flex"};\n\t\t}\n\t\t${y}.btnEditor{\n\t\t\topacity: ${n?.desktop?.8:1};\n\t\t}\n\t\t@media only screen and (max-width: 1024px) {\n\t\t\t${y}:not(.btnEditor){\n\t\t\t\tdisplay: ${n?.tablet?"none":"inline-flex"};\n\t\t\t}\n\t\t\t${y}.btnEditor{\n\t\t\t\topacity: ${n?.tablet?.8:1};\n\t\t\t}\n\t\t}\n\t\t@media only screen and (max-width: 640px) {\n\t\t\t${y}:not(.btnEditor){\n\t\t\t\tdisplay: ${n?.mobile?"none":"inline-flex"};\n\t\t\t}\n\t\t\t${y}.btnEditor{\n\t\t\t\topacity: ${n?.mobile?.8:1};\n\t\t\t}\n\t\t}\n\t\t${y}{\n\t\t\t${Mt(u)||"color: #fff; background-color: #146EF5;"}\n\t\t\twidth: ${a?"100%":"auto"};\n\t\t\tpadding: ${It(h)||"10px 20px"};\n\t\t\t${Nt(p)||"border-radius: 5px;"}\n\t\t\tbox-shadow: ${Lt(m?.shadow||m)||"none"};\n\t\t}\n\t\t${y}:hover{\n\t\t\t${Mt(d)||"color: #fff; background-color: #FF7A00;"}\n\t\t\t${s(g?.shadow)?`box-shadow: ${Lt(g?.shadow)};`:""}\n\t\t\t${s(g?.border)?Nt(g?.border):""}\n\t\t\t${s(g?.padding)?`padding: ${It(g?.padding)}`:""}\n\t\t}\n\t\t${r}\n\t\t`.replace(/\s+/g," ")}})},jt=({isOpen:t,onClose:i,caption:s,children:n})=>t?(0,e.createElement)("div",{className:"btnPopupWrap",onClick:()=>i()},(0,e.createElement)("button",{className:"popupCloseBtn",onClick:()=>i()},(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"#fff",width:24,height:24,viewBox:"0 0 32 32"},(0,e.createElement)("path",{d:"M17.769 16l9.016-9.016c0.226-0.226 0.366-0.539 0.366-0.884 0-0.691-0.56-1.251-1.251-1.251-0.346 0-0.658 0.14-0.885 0.367v0l-9.015 9.015-9.016-9.015c-0.226-0.226-0.539-0.366-0.884-0.366-0.69 0-1.25 0.56-1.25 1.25 0 0.345 0.14 0.658 0.366 0.884v0l9.015 9.016-9.015 9.015c-0.227 0.226-0.367 0.539-0.367 0.885 0 0.691 0.56 1.251 1.251 1.251 0.345 0 0.658-0.14 0.884-0.366v0l9.016-9.016 9.015 9.016c0.227 0.228 0.541 0.369 0.888 0.369 0.691 0 1.251-0.56 1.251-1.251 0-0.347-0.141-0.661-0.369-0.887l-0-0z"}))),(0,e.createElement)("div",{className:"popupContent",onClick:e=>e.stopPropagation()},n,s&&(0,e.createElement)("p",{className:"popupCaption",dangerouslySetInnerHTML:{__html:a(s)}}))):null;document.addEventListener("DOMContentLoaded",(()=>{document.querySelectorAll(".wp-block-b-blocks-button").forEach((i=>{const s=JSON.parse(i.dataset.nonce),n=JSON.parse(i.dataset.attributes),a=JSON.parse(i.dataset.info),{popup:r={}}=n,{content:o=""}=r;(0,t.H)(i).render((0,e.createElement)(e.Fragment,null,(0,e.createElement)(Ot,{attributes:n,id:i.id}),(0,e.createElement)(Rt,{nonce:s,attributes:n,info:a,popupContent:(0,e.createElement)("div",{className:"content",dangerouslySetInnerHTML:{__html:o}})}))),i?.removeAttribute("data-attributes"),i?.removeAttribute("data-nonce"),i?.removeAttribute("data-info")}))}));const Rt=({nonce:t,attributes:i,info:s,popupContent:o})=>{const{text:l,actionType:c,security:u="none",target:d,url:h,securityRole:p}=i,m=(0,e.useRef)(null),[g,f]=(0,e.useState)(!1),[y,b]=(0,e.useState)(!1),{isPremium:v}=r(t);return(0,e.useEffect)((()=>{window.AOS?.init()}),[]),(0,e.createElement)(e.Fragment,null,(0,e.createElement)(St,{attributes:i,security:u,securityPass:g,setSecurityPass:f,securityPop:y,isPremium:v,Popup:g?jt:null,popupContent:o,ref:m,onClick:e=>{"none"===u?"popup"===c?f(!0):(window.open(n(h),d),f(!1)):"login"==u?s.userRoles[0]===p||"default"===p?f(!0):b(e):("password"==u||"email"==u)&&b(e)}},l&&(0,e.createElement)("span",{className:"btnText",dangerouslySetInnerHTML:{__html:a(l)}})),y&&(0,e.createElement)(Dt,{attributes:i,info:s,setSecurityPop:b,setSecurityPass:f}))},Dt=({attributes:t,info:i,setSecurityPass:s,setSecurityPop:a})=>{const{actionType:r,security:o="none",target:l,url:c,securityRole:u,securityPassword:d}=t,[h,p]=(0,e.useState)("Enter Password for Show Content"),[m,g]=(0,e.useState)(!0),[f,y]=(0,e.useState)(""),[b,v]=(0,e.useState)("");return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"securityPopup"},"password"==o&&(0,e.createElement)("h2",{className:"popup_h2"},m?h:(0,e.createElement)("span",null,"Incorrect Password")),"login"==o&&(0,e.createElement)("h2",{className:"popup_h2"},"You have to login as ",(0,e.createElement)("span",null,u)),"email"==o&&(0,e.createElement)("h2",{className:"popup_h2"},m?"Enter Your Email here":(0,e.createElement)("span",null,"We got an error try with a new email")),"password"==o&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"form-control"},(0,e.createElement)("label",{htmlFor:"passwordLabel"},"Enter Password"),(0,e.createElement)("input",{value:f,onChange:e=>{y(e.target.value)},type:"password",name:"password",id:"passwordLabel"})),(0,e.createElement)("button",{type:"button",onClick:()=>{f==d?("popup"===r?s(!0):(window.open(n(c),l),s(!1)),p("Correct Password"),g(!0)):(s(!1),p("Incorrect Password"),g(!1))},className:"button_ok password_button"},"OK")),"email"==o&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"form-control"},(0,e.createElement)("label",{htmlFor:"emailLabel"},"Enter Email"),(0,e.createElement)("input",{value:b,onChange:e=>{v(e.target.value)},type:"email",name:"email",id:"emailLabel"})),(0,e.createElement)("button",{type:"button",onClick:()=>{jQuery("#submitButton").prop("disabled",!0),g(!0),jQuery.ajax({type:"POST",url:RestScriptVars.endpoint,data:{action:"email_submit_from_user",email:b,postId:i.currentPostId},success(e){1==e.data.status?("popup"===r?s(!0):(window.open(n(c),l),s(!1)),a(!1),jQuery("#submitButton").prop("disabled",!1)):g(!1)},error(e,t,i){g(!1),jQuery("#submitButton").prop("disabled",!1)}})},id:"submitButton",className:"button_ok password_button"},"Submit")),"login"==o&&(0,e.createElement)("a",{href:i.loginURL,target:"_blank",className:"button_login",rel:"noreferrer"},"Login"),(0,e.createElement)("button",{type:"button",onClick:()=>a(!1),className:"close-overlay"},(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"15",height:"15",viewBox:"0 0 384 512",fill:"currentColor"},(0,e.createElement)("path",{d:"M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"})))))}})()})(); |
|
1
|
+(()=>{var e={2694(e,t,i){"use strict";var s=i(6925);function n(){}function a(){}a.resetWarningCache=n,e.exports=function(){function e(e,t,i,n,a,r){if(r!==s){var o=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw o.name="Invariant Violation",o}}function t(){return e}e.isRequired=e;var i={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:n};return i.PropTypes=i,i}},5556(e,t,i){e.exports=i(2694)()},6925(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}},t={};function i(s){var n=t[s];if(void 0!==n)return n.exports;var a=t[s]={exports:{}};return e[s](a,a.exports,i),a.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var s in t)i.o(t,s)&&!i.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.React,t=window.ReactDOM,s=e=>!(null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length||"string"==typeof e&&""===e.trim()||"number"==typeof e&&0===e),n=e=>{try{const t=new URL(e);return["http:","https:"].includes(t.protocol)?t.toString():null}catch(t){return"string"==typeof e&&e.startsWith("/")&&!e.startsWith("//")?e:null}},a=e=>{const t=(new DOMParser).parseFromString(e,"text/html"),i=["b","strong","i","em","span","a","br"],s=["style","href","target","rel","class"];return t.body.querySelectorAll("*").forEach((e=>{i.includes(e.tagName.toLowerCase())?[...e.attributes].forEach((t=>{if(s.includes(t.name)||e.removeAttribute(t.name),"href"===t.name){const i=n(t.value);i?e.setAttribute("href",i):e.removeAttribute("href")}})):e.remove()})),t.body.innerHTML},r=t=>{const{data:i=null,isLoading:s}=((t,i={},s=!0)=>{const[n,a]=(0,e.useState)(!1),[r,o]=(0,e.useState)(!1),[l,c]=(0,e.useState)(null),[u,d]=(0,e.useState)(null);if(!wp.ajax)return void console.error("Please use wp-util as a dependency");const h=(e={})=>{a(!0),o(!1),c(null),wp.ajax.post(t,{...i,...e}).done((e=>{a(!1),d(e)})).fail((e=>{a(!1),o(!0),c(e)}))},p=(e={})=>{h(e)};return(0,e.useEffect)((()=>{s&&h(i)}),[]),{data:u,saveData:p,refetch:p,isLoading:n,isError:r,error:l}})("bBlocksPipeChecker",{_wpnonce:t});return{isPremium:!s&&i?.isPipe||!1,isLoading:s}},o="bBlocksButton",l=(e,t="none",i,s,a=!1)=>{const{actionType:r="link",url:l,tooltip:c,tooltipPos:u="top",target:d,attrs:h={rel:"noreferrer",referrerpolicy:"no-referrer"},isDownload:p,downloadFileName:m="",animationType:g,animationDuration:f,addID:y}=e,b=h?.referrerpolicy||"no-referrer",v=h?.rel||"noreferrer",w=l&&(i||"none"===t)?{href:n(l)}:{},k="popup"===r||a?{}:{...w,target:d,...s?{referrerPolicy:b,rel:v}:{},...p?{download:s?m:""}:{}};return{className:a?`${o} btnEditor`:o,...k,tooltip:c,"tooltip-pos":s?u:"top","data-aos":g,"data-aos-duration":1e3*f,id:y}},c=window.ReactJSXRuntime,u=({attributes:e})=>{const{isUpIcon:t,icon:i,upIcon:s}=e;return(0,c.jsxs)(c.Fragment,{children:[t&&s?.url&&(0,c.jsx)("img",{src:s?.url,alt:s?.alt}),!t&&i?.class&&(0,c.jsx)("i",{className:i?.class})]})};function d(e,t,i){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var s=i.call(e,t);if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function h(e,t){for(var i=0;i<t.length;i++){var s=t[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}function p(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function m(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,s)}return i}function g(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?m(Object(i),!0).forEach((function(t){p(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):m(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var f={addCSS:!0,thumbWidth:15,watch:!0},y=function(e){return null!=e?e.constructor:null},b=function(e,t){return!!(e&&t&&e instanceof t)},v=function(e){return y(e)===String},w=function(e){return Array.isArray(e)},k=function(e){return b(e,NodeList)},T=v,C=w,S=k,x=function(e){return b(e,Element)},P=function(e){return b(e,Event)},A=function(e){return function(e){return null==e}(e)||(v(e)||w(e)||k(e))&&!e.length||function(e){return y(e)===Object}(e)&&!Object.keys(e).length};var E=function(){function e(t,i){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),x(t)?this.element=t:T(t)&&(this.element=document.querySelector(t)),x(this.element)&&A(this.element.rangeTouch)&&(this.config=g({},f,{},i),this.init())}return function(e,t,i){t&&h(e.prototype,t),i&&h(e,i)}(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(e){var t=this,i=e?"addEventListener":"removeEventListener";["touchstart","touchmove","touchend"].forEach((function(e){t.element[i](e,(function(e){return t.set(e)}),!1)}))}},{key:"get",value:function(t){if(!e.enabled||!P(t))return null;var i,s=t.target,n=t.changedTouches[0],a=parseFloat(s.getAttribute("min"))||0,r=parseFloat(s.getAttribute("max"))||100,o=parseFloat(s.getAttribute("step"))||1,l=s.getBoundingClientRect(),c=100/l.width*(this.config.thumbWidth/2)/100;return 0>(i=100/l.width*(n.clientX-l.left))?i=0:100<i&&(i=100),50>i?i-=(100-2*i)*c:50<i&&(i+=2*(i-50)*c),a+function(e,t){if(1>t){var i=function(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}(t);return parseFloat(e.toFixed(i))}return Math.round(e/t)*t}(i/100*(r-a),o)}},{key:"set",value:function(t){e.enabled&&P(t)&&!t.target.disabled&&(t.preventDefault(),t.target.value=this.get(t),function(e,t){if(e&&t){var i=new Event(t,{bubbles:!0});e.dispatchEvent(i)}}(t.target,"touchend"===t.type?"change":"input"))}}],[{key:"setup",value:function(t){var i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},s=null;if(A(t)||T(t)?s=Array.from(document.querySelectorAll(T(t)?t:'input[type="range"]')):x(t)?s=[t]:S(t)?s=Array.from(t):C(t)&&(s=t.filter(x)),A(s))return null;var n=g({},f,{},i);if(T(t)&&n.watch){var a=new MutationObserver((function(i){Array.from(i).forEach((function(i){Array.from(i.addedNodes).forEach((function(i){x(i)&&function(e,t){return function(){return Array.from(document.querySelectorAll(t)).includes(this)}.call(e,t)}(i,t)&&new e(i,n)}))}))}));a.observe(document.body,{childList:!0,subtree:!0})}return s.map((function(t){return new e(t,i)}))}},{key:"enabled",get:function(){return"ontouchstart"in document.documentElement}}]),e}();const $=e=>null!=e?e.constructor:null,N=(e,t)=>Boolean(e&&t&&e instanceof t),M=e=>null==e,L=e=>$(e)===Object,j=e=>$(e)===String,I=e=>"function"==typeof e,_=e=>Array.isArray(e),O=e=>N(e,NodeList);function D(e){return M(e)||(j(e)||_(e)||O(e))&&!e.length||L(e)&&!Object.keys(e).length}var R={nullOrUndefined:M,object:L,number:e=>$(e)===Number&&!Number.isNaN(e),string:j,boolean:e=>$(e)===Boolean,function:I,array:_,weakMap:e=>N(e,WeakMap),nodeList:O,element:function(e){return null!==e&&"object"==typeof e&&1===e.nodeType&&"object"==typeof e.style&&"object"==typeof e.ownerDocument},textNode:e=>$(e)===Text,event:e=>N(e,Event),keyboardEvent:e=>N(e,KeyboardEvent),cue:e=>N(e,window.TextTrackCue)||N(e,window.VTTCue),track:e=>N(e,TextTrack)||!M(e)&&j(e.kind),promise:e=>N(e,Promise)&&I(e.then),url:function(e){if(N(e,window.URL))return!0;if(!j(e))return!1;let t=e;e.startsWith("http://")&&e.startsWith("https://")||(t=`http://${e}`);try{return!D(new URL(t).hostname)}catch{return!1}},empty:D};const F=(()=>{const e=document.createElement("span"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},i=Object.keys(t).find((t=>void 0!==e.style[t]));return!!R.string(i)&&t[i]})();function H(e,t){setTimeout((()=>{try{e.hidden=!0,e.offsetHeight,e.hidden=!1}catch{}}),t)}function q(e,t){return t.split(".").reduce(((e,t)=>e&&e[t]),e)}function V(e={},...t){if(!t.length)return e;const i=t.shift();return R.object(i)?(Object.keys(i).forEach((t=>{R.object(i[t])?(Object.keys(e).includes(t)||Object.assign(e,{[t]:{}}),V(e[t],i[t])):Object.assign(e,{[t]:i[t]})})),V(e,...t)):e}function B(e,t){const i=e.length?e:[e];Array.from(i).reverse().forEach(((e,i)=>{const s=i>0?t.cloneNode(!0):t,n=e.parentNode,a=e.nextSibling;s.appendChild(e),a?n.insertBefore(s,a):n.appendChild(s)}))}function U(e,t){R.element(e)&&!R.empty(t)&&Object.entries(t).filter((([,e])=>!R.nullOrUndefined(e))).forEach((([t,i])=>e.setAttribute(t,i)))}function W(e,t,i){const s=document.createElement(e);return R.object(t)&&U(s,t),R.string(i)&&(s.textContent=i),s}function z(e,t,i,s){R.element(t)&&t.appendChild(W(e,i,s))}function K(e){R.nodeList(e)||R.array(e)?Array.from(e).forEach(K):R.element(e)&&R.element(e.parentNode)&&e.parentNode.removeChild(e)}function Y(e){if(!R.element(e))return;let{length:t}=e.childNodes;for(;t>0;)e.removeChild(e.lastChild),t-=1}function Q(e,t){return R.element(t)&&R.element(t.parentNode)&&R.element(e)?(t.parentNode.replaceChild(e,t),e):null}function X(e,t){if(!R.string(e)||R.empty(e))return{};const i={},s=V({},t);return e.split(",").forEach((e=>{const t=e.trim(),n=t.replace(".",""),a=t.replace(/[[\]]/g,"").split("="),[r]=a,o=a.length>1?a[1].replace(/["']/g,""):"";switch(t.charAt(0)){case".":R.string(s.class)?i.class=`${s.class} ${n}`:i.class=n;break;case"#":i.id=t.replace("#","");break;case"[":i[r]=o}})),V(s,i)}function J(e,t){if(!R.element(e))return;let i=t;R.boolean(i)||(i=!e.hidden),e.hidden=i}function G(e,t,i){if(R.nodeList(e))return Array.from(e).map((e=>G(e,t,i)));if(R.element(e)){let s="toggle";return void 0!==i&&(s=i?"add":"remove"),e.classList[s](t),e.classList.contains(t)}return!1}function Z(e,t){return R.element(e)&&e.classList.contains(t)}function ee(e,t){const{prototype:i}=Element;return(i.matches||i.webkitMatchesSelector||i.mozMatchesSelector||i.msMatchesSelector||function(){return Array.from(document.querySelectorAll(t)).includes(this)}).call(e,t)}function te(e){return this.elements.container.querySelectorAll(e)}function ie(e){return this.elements.container.querySelector(e)}function se(e=null,t=!1){R.element(e)&&e.focus({preventScroll:!0,focusVisible:t})}const ne={"audio/ogg":"vorbis","audio/wav":"1","video/webm":"vp8, vorbis","video/mp4":"avc1.42E01E, mp4a.40.2","video/ogg":"theora"},ae={audio:"canPlayType"in document.createElement("audio"),video:"canPlayType"in document.createElement("video"),check(e,t){const i=ae[e]||"html5"!==t;return{api:i,ui:i&&ae.rangeInput}},pip:document.pictureInPictureEnabled&&!W("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(ne).includes(i)&&(i+=`; codecs="${ne[e]}"`);try{return Boolean(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","range"===e.type})(),touch:"ontouchstart"in document.documentElement,transitions:!1!==F,reducedMotion:"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches},re=(()=>{let e=!1;try{const t=Object.defineProperty({},"passive",{get:()=>(e=!0,null)});window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch{}return e})();function oe(e,t,i,s=!1,n=!0,a=!1){if(!e||!("addEventListener"in e)||R.empty(t)||!R.function(i))return;const r=t.split(" ");let o=a;re&&(o={passive:n,capture:a}),r.forEach((t=>{this&&this.eventListeners&&s&&this.eventListeners.push({element:e,type:t,callback:i,options:o}),e[s?"addEventListener":"removeEventListener"](t,i,o)}))}function le(e,t="",i,s=!0,n=!1){oe.call(this,e,t,i,!0,s,n)}function ce(e,t="",i,s=!0,n=!1){oe.call(this,e,t,i,!1,s,n)}function ue(e,t="",i,s=!0,n=!1){const a=(...r)=>{ce(e,t,a,s,n),i.apply(this,r)};oe.call(this,e,t,a,!0,s,n)}function de(e,t="",i=!1,s={}){if(!R.element(e)||R.empty(t))return;const n=new CustomEvent(t,{bubbles:i,detail:{...s,plyr:this}});e.dispatchEvent(n)}function he(){this&&this.eventListeners&&(this.eventListeners.forEach((e=>{const{element:t,type:i,callback:s,options:n}=e;t.removeEventListener(i,s,n)})),this.eventListeners=[])}function pe(){return new Promise((e=>this.ready?setTimeout(e,0):le.call(this,this.elements.container,"ready",e))).then((()=>{}))}function me(e){R.promise(e)&&e.then(null,(()=>{}))}function ge(e){return R.array(e)?e.filter(((t,i)=>e.indexOf(t)===i)):e}function fe(e,t){return R.array(e)&&e.length?e.reduce(((e,i)=>Math.abs(i-t)<Math.abs(e-t)?i:e)):null}function ye(e){return!(!window||!window.CSS)&&window.CSS.supports(e)}const be=[[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 ve(e){return!!(R.array(e)||R.string(e)&&e.includes(":"))&&(R.array(e)?e:e.split(":")).map(Number).every(R.number)}function we(e){if(!R.array(e)||!e.every(R.number))return null;const[t,i]=e,s=(e,t)=>0===t?e:s(t,e%t),n=s(t,i);return[t/n,i/n]}function ke(e){const t=e=>ve(e)?e.split(":").map(Number):null;let i=t(e);if(null===i&&(i=t(this.config.ratio)),null===i&&!R.empty(this.embed)&&R.array(this.embed.ratio)&&({ratio:i}=this.embed),null===i&&this.isHTML5){const{videoWidth:e,videoHeight:t}=this.media;i=[e,t]}return we(i)}function Te(e){if(!this.isVideo)return{};const{wrapper:t}=this.elements,i=ke.call(this,e);if(!R.array(i))return{};const[s,n]=we(i),a=100/s*n;if(ye(`aspect-ratio: ${s}/${n}`)?t.style.aspectRatio=`${s}/${n}`:t.style.paddingBottom=`${a}%`,this.isVimeo&&!this.config.vimeo.premium&&this.supported.ui){const e=100/this.media.offsetWidth*Number.parseInt(window.getComputedStyle(this.media).paddingBottom,10),i=(e-a)/(e/50);this.fullscreen.active?t.style.paddingBottom=null:this.media.style.transform=`translateY(-${i}%)`}else this.isHTML5&&t.classList.add(this.config.classNames.videoFixedRatio);return{padding:a,ratio:i}}function Ce(e,t,i=.05){const s=e/t,n=fe(Object.keys(be),s);return Math.abs(n-s)<=i?be[n]:[e,t]}const Se={getSources(){return this.isHTML5?Array.from(this.media.querySelectorAll("source")).filter((e=>{const t=e.getAttribute("type");return!!R.empty(t)||ae.mime.call(this,t)})):[]},getQualityOptions(){return this.config.quality.forced?this.config.quality.options:Se.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)||Te.call(e),Object.defineProperty(e.media,"quality",{get(){const t=Se.getSources.call(e).find((t=>t.getAttribute("src")===e.source));return t&&Number(t.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 i=Se.getSources.call(e).find((e=>Number(e.getAttribute("size"))===t));if(!i)return;const{currentTime:s,paused:n,preload:a,readyState:r,playbackRate:o}=e.media;e.media.src=i.getAttribute("src"),("none"!==a||r)&&(e.once("loadedmetadata",(()=>{e.speed=o,e.currentTime=s,n||me(e.play())})),e.media.load())}de.call(e,e.media,"qualitychange",!1,{quality:t})}}})},cancelRequests(){this.isHTML5&&(K(Se.getSources.call(this)),this.media.setAttribute("src",this.config.blankVideo),this.media.load(),this.debug.log("Cancelled network requests"))}};var xe={isIE:Boolean(window.document.documentMode),isEdge:/Edge/.test(navigator.userAgent),isWebKit:"WebkitAppearance"in document.documentElement.style&&!/Edge/.test(navigator.userAgent),isIPadOS:"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1,isIos:/iPad|iPhone|iPod/i.test(navigator.userAgent)&&navigator.maxTouchPoints>1};function Pe(e,...t){return R.empty(e)?e:e.toString().replace(/\{(\d+)\}/g,((e,i)=>t[i].toString()))}function Ae(e="",t="",i=""){return e.replace(new RegExp(t.toString().replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1"),"g"),i.toString())}function Ee(e=""){return e.toString().replace(/\w\S*/g,(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()))}function $e(e){const t=document.createElement("div");return t.appendChild(e),t.innerHTML}const Ne={pip:"PIP",airplay:"AirPlay",html5:"HTML5",vimeo:"Vimeo",youtube:"YouTube"},Me={get(e="",t={}){if(R.empty(e)||R.empty(t))return"";let i=q(t.i18n,e);if(R.empty(i))return Object.keys(Ne).includes(e)?Ne[e]:"";const s={"{seektime}":t.seekTime,"{title}":t.title};return Object.entries(s).forEach((([e,t])=>{i=Ae(i,e,t)})),i}};class Le{constructor(e){d(this,"get",(e=>{if(!Le.supported||!this.enabled)return null;const t=window.localStorage.getItem(this.key);if(R.empty(t))return null;const i=JSON.parse(t);return R.string(e)&&e.length?i[e]:i})),d(this,"set",(e=>{if(!Le.supported||!this.enabled)return;if(!R.object(e))return;let t=this.get();R.empty(t)&&(t={}),V(t,e);try{window.localStorage.setItem(this.key,JSON.stringify(t))}catch{}})),this.enabled=e.config.storage.enabled,this.key=e.config.storage.key}static get supported(){try{if(!("localStorage"in window))return!1;const e="___test";return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch{return!1}}}function je(e,t="text",i=!1){return new Promise(((s,n)=>{try{const n=new XMLHttpRequest;if(!("withCredentials"in n))return;i&&(n.withCredentials=!0),n.addEventListener("load",(()=>{if("text"===t)try{s(JSON.parse(n.responseText))}catch{s(n.responseText)}else s(n.response)})),n.addEventListener("error",(()=>{throw new Error(n.status)})),n.open("GET",e,!0),n.responseType=t,n.send()}catch(e){n(e)}}))}function Ie(e,t){if(!R.string(e))return;const i="cache",s=R.string(t);let n=!1;const a=()=>null!==document.getElementById(t),r=(e,t)=>{e.innerHTML=t,s&&a()||document.body.insertAdjacentElement("afterbegin",e)};if(!s||!a()){const a=Le.supported,o=document.createElement("div");if(o.setAttribute("hidden",""),s&&o.setAttribute("id",t),a){const e=window.localStorage.getItem(`${i}-${t}`);if(n=null!==e,n){const t=JSON.parse(e);r(o,t.content)}}je(e).then((e=>{if(!R.empty(e)){if(a)try{window.localStorage.setItem(`${i}-${t}`,JSON.stringify({content:e}))}catch{}r(o,e)}})).catch((()=>{}))}}const _e=e=>Math.trunc(e/60/60%60,10);function Oe(e=0,t=!1,i=!1){if(!R.number(e))return Oe(void 0,t,i);const s=e=>`0${e}`.slice(-2);let n=_e(e);const a=(r=e,Math.trunc(r/60%60,10));var r;const o=(e=>Math.trunc(e%60,10))(e);return n=t||n>0?`${n}:`:"",`${i&&e>0?"-":""}${n}${s(a)}:${s(o)}`}const De={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||xe.isIE&&!window.svg4everybody;return{url:this.config.iconUrl,cors:i}},findElements(){try{return this.elements.controls=ie.call(this,this.config.selectors.controls.wrapper),this.elements.buttons={play:te.call(this,this.config.selectors.buttons.play),pause:ie.call(this,this.config.selectors.buttons.pause),restart:ie.call(this,this.config.selectors.buttons.restart),rewind:ie.call(this,this.config.selectors.buttons.rewind),fastForward:ie.call(this,this.config.selectors.buttons.fastForward),mute:ie.call(this,this.config.selectors.buttons.mute),pip:ie.call(this,this.config.selectors.buttons.pip),airplay:ie.call(this,this.config.selectors.buttons.airplay),settings:ie.call(this,this.config.selectors.buttons.settings),captions:ie.call(this,this.config.selectors.buttons.captions),fullscreen:ie.call(this,this.config.selectors.buttons.fullscreen)},this.elements.progress=ie.call(this,this.config.selectors.progress),this.elements.inputs={seek:ie.call(this,this.config.selectors.inputs.seek),volume:ie.call(this,this.config.selectors.inputs.volume)},this.elements.display={buffer:ie.call(this,this.config.selectors.display.buffer),currentTime:ie.call(this,this.config.selectors.display.currentTime),duration:ie.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",s=De.getIconUrl.call(this),n=`${s.cors?"":s.url}#${this.config.iconPrefix}`,a=document.createElementNS(i,"svg");U(a,V(t,{"aria-hidden":"true",focusable:"false"}));const r=document.createElementNS(i,"use"),o=`${n}-${e}`;return"href"in r&&r.setAttributeNS("http://www.w3.org/1999/xlink","href",o),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o),a.appendChild(r),a},createLabel(e,t={}){const i=Me.get(e,this.config);return W("span",{...t,class:[t.class,this.config.classNames.hidden].filter(Boolean).join(" ")},i)},createBadge(e){if(R.empty(e))return null;const t=W("span",{class:this.config.classNames.menu.value});return t.appendChild(W("span",{class:this.config.classNames.menu.badge},e)),t},createButton(e,t){const i=V({},t);let s=function(e=""){let t=e.toString();return t=function(e=""){let t=e.toString();return t=Ae(t,"-"," "),t=Ae(t,"_"," "),t=Ee(t),Ae(t," ","")}(t),t.charAt(0).toLowerCase()+t.slice(1)}(e);const n={element:"button",toggle:!1,label:null,icon:null,labelPressed:null,iconPressed:null};switch(["element","icon","label"].forEach((e=>{Object.keys(i).includes(e)&&(n[e]=i[e],delete i[e])})),"button"!==n.element||Object.keys(i).includes("type")||(i.type="button"),Object.keys(i).includes("class")?i.class.split(" ").includes(this.config.classNames.control)||V(i,{class:`${i.class} ${this.config.classNames.control}`}):i.class=this.config.classNames.control,e){case"play":n.toggle=!0,n.label="play",n.labelPressed="pause",n.icon="play",n.iconPressed="pause";break;case"mute":n.toggle=!0,n.label="mute",n.labelPressed="unmute",n.icon="volume",n.iconPressed="muted";break;case"captions":n.toggle=!0,n.label="enableCaptions",n.labelPressed="disableCaptions",n.icon="captions-off",n.iconPressed="captions-on";break;case"fullscreen":n.toggle=!0,n.label="enterFullscreen",n.labelPressed="exitFullscreen",n.icon="enter-fullscreen",n.iconPressed="exit-fullscreen";break;case"play-large":i.class+=` ${this.config.classNames.control}--overlaid`,s="play",n.label="play",n.icon="play";break;default:R.empty(n.label)&&(n.label=s),R.empty(n.icon)&&(n.icon=e)}const a=W(n.element);return n.toggle?(a.appendChild(De.createIcon.call(this,n.iconPressed,{class:"icon--pressed"})),a.appendChild(De.createIcon.call(this,n.icon,{class:"icon--not-pressed"})),a.appendChild(De.createLabel.call(this,n.labelPressed,{class:"label--pressed"})),a.appendChild(De.createLabel.call(this,n.label,{class:"label--not-pressed"}))):(a.appendChild(De.createIcon.call(this,n.icon)),a.appendChild(De.createLabel.call(this,n.label))),V(i,X(this.config.selectors.buttons[s],i)),U(a,i),"play"===s?(R.array(this.elements.buttons[s])||(this.elements.buttons[s]=[]),this.elements.buttons[s].push(a)):this.elements.buttons[s]=a,a},createRange(e,t){const i=W("input",V(X(this.config.selectors.inputs[e]),{type:"range",min:0,max:100,step:.01,value:0,autocomplete:"off",role:"slider","aria-label":Me.get(e,this.config),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":0},t));return this.elements.inputs[e]=i,De.updateRangeFill.call(this,i),E.setup(i),i},createProgress(e,t){const i=W("progress",V(X(this.config.selectors.display[e]),{min:0,max:100,value:0,role:"progressbar","aria-hidden":!0},t));if("volume"!==e){i.appendChild(W("span",null,"0"));const t={played:"played",buffer:"buffered"}[e],s=t?Me.get(t,this.config):"";i.textContent=`% ${s.toLowerCase()}`}return this.elements.display[e]=i,i},createTime(e,t){const i=X(this.config.selectors.display[e],t),s=W("div",V(i,{class:`${i.class?i.class:""} ${this.config.classNames.display.time} `.trim(),"aria-label":Me.get(e,this.config),role:"timer"}),"00:00");return this.elements.display[e]=s,s},bindMenuItemShortcuts(e,t){le.call(this,e,"keydown keyup",(i=>{if(![" ","ArrowUp","ArrowDown","ArrowRight"].includes(i.key))return;if(i.preventDefault(),i.stopPropagation(),"keydown"===i.type)return;const s=ee(e,'[role="menuitemradio"]');if(!s&&[" ","ArrowRight"].includes(i.key))De.showMenuPanel.call(this,t,!0);else{let t;" "!==i.key&&("ArrowDown"===i.key||s&&"ArrowRight"===i.key?(t=e.nextElementSibling,R.element(t)||(t=e.parentNode.firstElementChild)):(t=e.previousElementSibling,R.element(t)||(t=e.parentNode.lastElementChild)),se.call(this,t,!0))}}),!1),le.call(this,e,"keyup",(e=>{"Return"===e.key&&De.focusFirstMenuItem.call(this,null,!0)}))},createMenuItem({value:e,list:t,type:i,title:s,badge:n=null,checked:a=!1}){const r=X(this.config.selectors.inputs[i]),o=W("button",V(r,{type:"button",role:"menuitemradio",class:`${this.config.classNames.control} ${r.class?r.class:""}`.trim(),"aria-checked":a,value:e})),l=W("span");l.innerHTML=s,R.element(n)&&l.appendChild(n),o.appendChild(l),Object.defineProperty(o,"checked",{enumerable:!0,get:()=>"true"===o.getAttribute("aria-checked"),set(e){e&&Array.from(o.parentNode.children).filter((e=>ee(e,'[role="menuitemradio"]'))).forEach((e=>e.setAttribute("aria-checked","false"))),o.setAttribute("aria-checked",e?"true":"false")}}),this.listeners.bind(o,"click keyup",(t=>{if(!R.keyboardEvent(t)||" "===t.key){switch(t.preventDefault(),t.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)}De.showMenuPanel.call(this,"home",R.keyboardEvent(t))}}),i,!1),De.bindMenuItemShortcuts.call(this,o,i),t.appendChild(o)},formatTime(e=0,t=!1){return R.number(e)?Oe(e,_e(this.duration)>0,t):e},updateTimeDisplay(e=null,t=0,i=!1){R.element(e)&&R.number(t)&&(e.textContent=De.formatTime(t,i))},updateVolume(){this.supported.ui&&(R.element(this.elements.inputs.volume)&&De.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||0===this.volume))},setRange(e,t=0){R.element(e)&&(e.value=t,De.updateRangeFill.call(this,e))},updateProgress(e){if(!this.supported.ui||!R.event(e))return;let t=0;const i=(e,t)=>{const i=R.number(t)?t:0,s=R.element(e)?e:this.elements.display.buffer;if(R.element(s)){s.value=i;const e=s.getElementsByTagName("span")[0];R.element(e)&&(e.childNodes[0].nodeValue=i)}};if(e)switch(e.type){case"timeupdate":case"seeking":case"seeked":s=this.currentTime,n=this.duration,t=0===s||0===n||Number.isNaN(s)||Number.isNaN(n)?0:(s/n*100).toFixed(2),"timeupdate"===e.type&&De.setRange.call(this,this.elements.inputs.seek,t);break;case"playing":case"progress":i(this.elements.display.buffer,100*this.buffered)}var s,n},updateRangeFill(e){const t=R.event(e)?e.target:e;if(R.element(t)&&"range"===t.getAttribute("type")){if(ee(t,this.config.selectors.inputs.seek)){t.setAttribute("aria-valuenow",this.currentTime);const e=De.formatTime(this.currentTime),i=De.formatTime(this.duration),s=Me.get("seekLabel",this.config);t.setAttribute("aria-valuetext",s.replace("{currentTime}",e).replace("{duration}",i))}else if(ee(t,this.config.selectors.inputs.volume)){const e=100*t.value;t.setAttribute("aria-valuenow",e),t.setAttribute("aria-valuetext",`${e.toFixed(1)}%`)}else t.setAttribute("aria-valuenow",t.value);(xe.isWebKit||xe.isIPadOS)&&t.style.setProperty("--value",t.value/t.max*100+"%")}},updateSeekTooltip(e){var t,i;if(!this.config.tooltips.seek||!R.element(this.elements.inputs.seek)||!R.element(this.elements.display.seekTooltip)||0===this.duration)return;const s=this.elements.display.seekTooltip,n=`${this.config.classNames.tooltip}--visible`,a=e=>G(s,n,e);if(this.touch)return void a(!1);let r=0;const o=this.elements.progress.getBoundingClientRect();if(R.event(e)){const t=e.pageX-e.clientX;r=100/o.width*(e.pageX-o.left-t)}else{if(!Z(s,n))return;r=Number.parseFloat(s.style.left,10)}r<0?r=0:r>100&&(r=100);const l=this.duration/100*r;s.textContent=De.formatTime(l);const c=null===(t=this.config.markers)||void 0===t||null===(i=t.points)||void 0===i?void 0:i.find((({time:e})=>e===Math.round(l)));c&&s.insertAdjacentHTML("afterbegin",`${c.label}<br>`),s.style.left=`${r}%`,R.event(e)&&["mouseenter","mouseleave"].includes(e.type)&&a("mouseenter"===e.type)},timeUpdate(e){const t=!R.element(this.elements.display.duration)&&this.config.invertTime;De.updateTimeDisplay.call(this,this.elements.display.currentTime,t?this.duration-this.currentTime:this.currentTime,t),e&&"timeupdate"===e.type&&this.media.seeking||De.updateProgress.call(this,e)},durationUpdate(){if(!this.supported.ui||!this.config.invertTime&&this.currentTime)return;if(this.duration>=2**32)return J(this.elements.display.currentTime,!0),void J(this.elements.progress,!0);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&&De.updateTimeDisplay.call(this,this.elements.display.currentTime,this.duration),e&&De.updateTimeDisplay.call(this,this.elements.display.duration,this.duration),this.config.markers.enabled&&De.setMarkers.call(this),De.updateSeekTooltip.call(this)},toggleMenuButton(e,t){J(this.elements.settings.buttons[e],!t)},updateSetting(e,t,i){const s=this.elements.settings.panels[e];let n=null,a=t;if("captions"===e)n=this.currentTrack;else{if(n=R.empty(i)?this[e]:i,R.empty(n)&&(n=this.config[e].default),!R.empty(this.options[e])&&!this.options[e].includes(n))return void this.debug.warn(`Unsupported value of '${n}' for ${e}`);if(!this.config[e].options.includes(n))return void this.debug.warn(`Disabled value of '${n}' for ${e}`)}if(R.element(a)||(a=s&&s.querySelector('[role="menu"]')),!R.element(a))return;this.elements.settings.buttons[e].querySelector(`.${this.config.classNames.menu.value}`).innerHTML=De.getLabel.call(this,e,n);const r=a&&a.querySelector(`[value="${n}"]`);R.element(r)&&(r.checked=!0)},getLabel(e,t){switch(e){case"speed":return 1===t?Me.get("normal",this.config):`${t}×`;case"quality":if(R.number(t)){const e=Me.get(`qualityLabel.${t}`,this.config);return e.length?e:`${t}p`}return Ee(t);case"captions":return He.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=ge(e).filter((e=>this.config.quality.options.includes(e))));const s=!R.empty(this.options.quality)&&this.options.quality.length>1;if(De.toggleMenuButton.call(this,t,s),Y(i),De.checkMenu.call(this),!s)return;const n=e=>{const t=Me.get(`qualityBadge.${e}`,this.config);return t.length?De.createBadge.call(this,t):null};this.options.quality.sort(((e,t)=>{const i=this.config.quality.options;return i.indexOf(e)>i.indexOf(t)?1:-1})).forEach((e=>{De.createMenuItem.call(this,{value:e,list:i,type:t,title:De.getLabel.call(this,"quality",e),badge:n(e)})})),De.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=He.getTracks.call(this),s=Boolean(i.length);if(De.toggleMenuButton.call(this,e,s),Y(t),De.checkMenu.call(this),!s)return;const n=i.map(((e,i)=>({value:i,checked:this.captions.toggled&&this.currentTrack===i,title:He.getLabel.call(this,e),badge:e.language&&De.createBadge.call(this,e.language.toUpperCase()),list:t,type:"language"})));n.unshift({value:-1,checked:!this.captions.toggled,title:Me.get("disabled",this.config),list:t,type:"language"}),n.forEach(De.createMenuItem.bind(this)),De.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((e=>e>=this.minimumSpeed&&e<=this.maximumSpeed));const i=!R.empty(this.options.speed)&&this.options.speed.length>1;De.toggleMenuButton.call(this,e,i),Y(t),De.checkMenu.call(this),i&&(this.options.speed.forEach((i=>{De.createMenuItem.call(this,{value:i,list:t,type:e,title:De.getLabel.call(this,"speed",i)})})),De.updateSetting.call(this,e,t))},checkMenu(){const{buttons:e}=this.elements.settings,t=!R.empty(e)&&Object.values(e).some((e=>!e.hidden));J(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((e=>!e.hidden)));const s=i.querySelector('[role^="menuitem"]');se.call(this,s,t)},toggleMenu(e){const{popup:t}=this.elements.settings,i=this.elements.buttons.settings;if(!R.element(t)||!R.element(i))return;const{hidden:s}=t;let n=s;if(R.boolean(e))n=e;else if(R.keyboardEvent(e)&&"Escape"===e.key)n=!1;else if(R.event(e)){const s=R.function(e.composedPath)?e.composedPath()[0]:e.target,a=t.contains(s);if(a||!a&&e.target!==i&&n)return}i.setAttribute("aria-expanded",n),J(t,!n),G(this.elements.container,this.config.classNames.menu.open,n),n&&R.keyboardEvent(e)?De.focusFirstMenuItem.call(this,null,!0):n||s||se.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,s=t.scrollHeight;return K(t),{width:i,height:s}},showMenuPanel(e="",t=!1){const i=this.elements.container.querySelector(`#plyr-settings-${this.id}-${e}`);if(!R.element(i))return;const s=i.parentNode,n=Array.from(s.children).find((e=>!e.hidden));if(ae.transitions&&!ae.reducedMotion){s.style.width=`${n.scrollWidth}px`,s.style.height=`${n.scrollHeight}px`;const e=De.getMenuSize.call(this,i),t=e=>{e.target===s&&["width","height"].includes(e.propertyName)&&(s.style.width="",s.style.height="",ce.call(this,s,F,t))};le.call(this,s,F,t),s.style.width=`${e.width}px`,s.style.height=`${e.height}px`}J(n,!0),J(i,!1),De.focusFirstMenuItem.call(this,i,t)},setDownloadUrl(){const e=this.elements.buttons.download;R.element(e)&&e.setAttribute("href",this.download)},create(e){const{bindMenuItemShortcuts:t,createButton:i,createProgress:s,createRange:n,createTime:a,setQualityMenu:r,setSpeedMenu:o,showMenuPanel:l}=De;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 c=W("div",X(this.config.selectors.controls.wrapper));this.elements.controls=c;const u={class:"plyr__controls__item"};return ge(R.array(this.config.controls)?this.config.controls:[]).forEach((r=>{if("restart"===r&&c.appendChild(i.call(this,"restart",u)),"rewind"===r&&c.appendChild(i.call(this,"rewind",u)),"play"===r&&c.appendChild(i.call(this,"play",u)),"fast-forward"===r&&c.appendChild(i.call(this,"fast-forward",u)),"progress"===r){const t=W("div",{class:`${u.class} plyr__progress__container`}),i=W("div",X(this.config.selectors.progress));if(i.appendChild(n.call(this,"seek",{id:`plyr-seek-${e.id}`})),i.appendChild(s.call(this,"buffer")),this.config.tooltips.seek){const e=W("span",{class:this.config.classNames.tooltip},"00:00");i.appendChild(e),this.elements.display.seekTooltip=e}this.elements.progress=i,t.appendChild(this.elements.progress),c.appendChild(t)}if("current-time"===r&&c.appendChild(a.call(this,"currentTime",u)),"duration"===r&&c.appendChild(a.call(this,"duration",u)),"mute"===r||"volume"===r){let{volume:t}=this.elements;if(R.element(t)&&c.contains(t)||(t=W("div",V({},u,{class:`${u.class} plyr__volume`.trim()})),this.elements.volume=t,c.appendChild(t)),"mute"===r&&t.appendChild(i.call(this,"mute")),"volume"===r&&!xe.isIos&&!xe.isIPadOS){const i={max:1,step:.05,value:this.config.volume};t.appendChild(n.call(this,"volume",V(i,{id:`plyr-volume-${e.id}`})))}}if("captions"===r&&c.appendChild(i.call(this,"captions",u)),"settings"===r&&!R.empty(this.config.settings)){const s=W("div",V({},u,{class:`${u.class} plyr__menu`.trim(),hidden:""}));s.appendChild(i.call(this,"settings",{"aria-haspopup":!0,"aria-controls":`plyr-settings-${e.id}`,"aria-expanded":!1}));const n=W("div",{class:"plyr__menu__container",id:`plyr-settings-${e.id}`,hidden:""}),a=W("div"),r=W("div",{id:`plyr-settings-${e.id}-home`}),o=W("div",{role:"menu"});r.appendChild(o),a.appendChild(r),this.elements.settings.panels.home=r,this.config.settings.forEach((i=>{const s=W("button",V(X(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,s,i),le.call(this,s,"click",(()=>{l.call(this,i,!1)}));const n=W("span",null,Me.get(i,this.config)),r=W("span",{class:this.config.classNames.menu.value});r.innerHTML=e[i],n.appendChild(r),s.appendChild(n),o.appendChild(s);const c=W("div",{id:`plyr-settings-${e.id}-${i}`,hidden:""}),u=W("button",{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--back`});u.appendChild(W("span",{"aria-hidden":!0},Me.get(i,this.config))),u.appendChild(W("span",{class:this.config.classNames.hidden},Me.get("menuBack",this.config))),le.call(this,c,"keydown",(e=>{"ArrowLeft"===e.key&&(e.preventDefault(),e.stopPropagation(),l.call(this,"home",!0))}),!1),le.call(this,u,"click",(()=>{l.call(this,"home",!1)})),c.appendChild(u),c.appendChild(W("div",{role:"menu"})),a.appendChild(c),this.elements.settings.buttons[i]=s,this.elements.settings.panels[i]=c})),n.appendChild(a),s.appendChild(n),c.appendChild(s),this.elements.settings.popup=n,this.elements.settings.menu=s}if("pip"===r&&ae.pip&&c.appendChild(i.call(this,"pip",u)),"airplay"===r&&ae.airplay&&c.appendChild(i.call(this,"airplay",u)),"download"===r){const e=V({},u,{element:"a",href:this.download,target:"_blank"});this.isHTML5&&(e.download="");const{download:t}=this.config.urls;!R.url(t)&&this.isEmbed&&V(e,{icon:`logo-${this.provider}`,label:this.provider}),c.appendChild(i.call(this,"download",e))}"fullscreen"===r&&c.appendChild(i.call(this,"fullscreen",u))})),this.isHTML5&&r.call(this,Se.getQualityOptions.call(this)),o.call(this),c},inject(){if(this.config.loadSprite){const e=De.getIconUrl.call(this);e.cors&&Ie(e.url,"sprite-plyr")}this.id=Math.floor(1e4*Math.random());let e=null;this.elements.controls=null;const t={id:this.id,seektime:this.config.seekTime,title:this.config.title};let i,s=!0;if(R.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=De.create.call(this,{id:this.id,seektime:this.config.seekTime,speed:this.speed,quality:this.quality,captions:He.getLabel.call(this)}),s=!1),s&&R.string(this.config.controls)&&(e=(e=>{let i=e;return Object.entries(t).forEach((([e,t])=>{i=Ae(i,`{${e}}`,t)})),i})(e)),R.string(this.config.selectors.controls.container)&&(i=document.querySelector(this.config.selectors.controls.container)),R.element(i)||(i=this.elements.container),i[R.element(e)?"insertAdjacentElement":"insertAdjacentHTML"]("afterbegin",e),R.element(this.elements.controls)||De.findElements.call(this),!R.empty(this.elements.buttons)){const e=e=>{const t=this.config.classNames.controlPressed;e.setAttribute("aria-pressed","false"),Object.defineProperty(e,"pressed",{configurable:!0,enumerable:!0,get:()=>Z(e,t),set(i=!1){G(e,t,i),e.setAttribute("aria-pressed",i?"true":"false")}})};Object.values(this.elements.buttons).filter(Boolean).forEach((t=>{R.array(t)||R.nodeList(t)?Array.from(t).filter(Boolean).forEach(e):e(t)}))}if(xe.isEdge&&H(i),this.config.tooltips.controls){const{classNames:e,selectors:t}=this.config,i=`${t.controls.wrapper} ${t.labels} .${e.hidden}`,s=te.call(this,i);Array.from(s).forEach((e=>{G(e,this.config.classNames.hidden,!1),G(e,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 e,t;if(!this.duration||this.elements.markers)return;const i=null===(e=this.config.markers)||void 0===e||null===(t=e.points)||void 0===t?void 0:t.filter((({time:e})=>e>0&&e<this.duration));if(null==i||!i.length)return;const s=document.createDocumentFragment(),n=document.createDocumentFragment();let a=null;const r=`${this.config.classNames.tooltip}--visible`,o=e=>G(a,r,e);i.forEach((e=>{const t=W("span",{class:this.config.classNames.marker},""),i=e.time/this.duration*100+"%";a&&(t.addEventListener("mouseenter",(()=>{e.label||(a.style.left=i,a.innerHTML=e.label,o(!0))})),t.addEventListener("mouseleave",(()=>{o(!1)}))),t.addEventListener("click",(()=>{this.currentTime=e.time})),t.style.left=i,n.appendChild(t)})),s.appendChild(n),this.config.tooltips.seek||(a=W("span",{class:this.config.classNames.tooltip},""),s.appendChild(a)),this.elements.markers={points:n,tip:a},this.elements.progress.appendChild(s)}};function Re(e,t=!0){let i=e;if(t){const e=document.createElement("a");e.href=i,i=e.href}try{return new URL(i)}catch{return null}}function Fe(e){const t=new URLSearchParams;return R.object(e)&&Object.entries(e).forEach((([e,i])=>{t.set(e,i)})),t}const He={setup(){if(!this.supported.ui)return;if(!this.isVideo||this.isYouTube||this.isHTML5&&!ae.textTracks)return void(R.array(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&De.setCaptionsMenu.call(this));var e,t;if(R.element(this.elements.captions)||(this.elements.captions=W("div",X(this.config.selectors.captions)),this.elements.captions.setAttribute("dir","auto"),e=this.elements.captions,t=this.elements.wrapper,R.element(e)&&R.element(t)&&t.parentNode.insertBefore(e,t.nextSibling)),xe.isIE&&window.URL){const e=this.media.querySelectorAll("track");Array.from(e).forEach((e=>{const t=e.getAttribute("src"),i=Re(t);null!==i&&i.hostname!==window.location.href.hostname&&["http:","https:"].includes(i.protocol)&&je(t,"blob").then((t=>{e.setAttribute("src",window.URL.createObjectURL(t))})).catch((()=>{K(e)}))}))}const i=ge((navigator.languages||[navigator.language||navigator.userLanguage||"en"]).map((e=>e.split("-")[0])));let s=(this.storage.get("language")||this.captions.language||this.config.captions.language||"auto").toLowerCase();"auto"===s&&([s]=i);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:s,languages:i}),this.isHTML5){const e=this.config.captions.update?"addtrack removetrack":"removetrack";le.call(this,this.media.textTracks,e,He.update.bind(this))}setTimeout(He.update.bind(this),0)},update(){const e=He.getTracks.call(this,!0),{active:t,language:i,meta:s,currentTrackNode:n}=this.captions,a=Boolean(e.find((e=>e.language===i)));this.isHTML5&&this.isVideo&&e.filter((e=>!s.get(e))).forEach((e=>{this.debug.log("Track added",e),s.set(e,{default:"showing"===e.mode}),"showing"===e.mode&&(e.mode="hidden"),le.call(this,e,"cuechange",(()=>He.updateCues.call(this)))})),(a&&this.language!==i||!e.includes(n))&&(He.setLanguage.call(this,i),He.toggle.call(this,t&&a)),this.elements&&G(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")&&De.setCaptionsMenu.call(this)},toggle(e,t=!0){if(!this.supported.ui)return;const{toggled:i}=this.captions,s=this.config.classNames.captions.active,n=R.nullOrUndefined(e)?!i:e;if(n!==i){if(t||(this.captions.active=n,this.storage.set({captions:n})),!this.language&&n&&!t){const e=He.getTracks.call(this),t=He.findTrack.call(this,[this.captions.language,...this.captions.languages],!0);return this.captions.language=t.language,void He.set.call(this,e.indexOf(t))}this.elements.buttons.captions&&(this.elements.buttons.captions.pressed=n),G(this.elements.container,s,n),this.captions.toggled=n,De.updateSetting.call(this,"captions"),de.call(this,this.media,n?"captionsenabled":"captionsdisabled")}setTimeout((()=>{n&&this.captions.toggled&&(this.captions.currentTrackNode.mode="hidden")}))},set(e,t=!0){const i=He.getTracks.call(this);if(-1!==e)if(R.number(e))if(e in i){if(this.captions.currentTrack!==e){this.captions.currentTrack=e;const s=i[e],{language:n}=s||{};this.captions.currentTrackNode=s,De.updateSetting.call(this,"captions"),t||(this.captions.language=n,this.storage.set({language:n})),this.isVimeo&&this.embed.enableTextTrack(n,null,!1),de.call(this,this.media,"languagechange")}He.toggle.call(this,!0,t),this.isHTML5&&this.isVideo&&He.updateCues.call(this)}else this.debug.warn("Track not found",e);else this.debug.warn("Invalid caption argument",e);else He.toggle.call(this,!1,t)},setLanguage(e,t=!0){if(!R.string(e))return void this.debug.warn("Invalid language argument",e);const i=e.toLowerCase();this.captions.language=i;const s=He.getTracks.call(this),n=He.findTrack.call(this,[i]);He.set.call(this,s.indexOf(n),t)},getTracks(e=!1){return Array.from((this.media||{}).textTracks||[]).filter((t=>!this.isHTML5||e||this.captions.meta.has(t))).filter((e=>["captions","subtitles"].includes(e.kind)))},findTrack(e,t=!1){const i=He.getTracks.call(this),s=e=>Number((this.captions.meta.get(e)||{}).default),n=Array.from(i).sort(((e,t)=>s(t)-s(e)));let a;return e.every((e=>(a=n.find((t=>t.language===e)),!a))),a||(t?n[0]:void 0)},getCurrentTrack(){return He.getTracks.call(this)[this.currentTrack]},getLabel(e){let t=e;return!R.track(t)&&ae.textTracks&&this.captions.toggled&&(t=He.getCurrentTrack.call(this)),R.track(t)?R.empty(t.label)?R.empty(t.language)?Me.get("enabled",this.config):e.language.toUpperCase():t.label:Me.get("disabled",this.config)},updateCues(e){if(!this.supported.ui)return;if(!R.element(this.elements.captions))return void this.debug.warn("No captions element to render to");if(!R.nullOrUndefined(e)&&!Array.isArray(e))return void this.debug.warn("updateCues: Invalid input",e);let t=e;if(!t){const e=He.getCurrentTrack.call(this);t=Array.from((e||{}).activeCues||[]).map((e=>e.getCueAsHTML())).map($e)}const i=t.map((e=>e.trim())).join("\n");if(i!==this.elements.captions.innerHTML){Y(this.elements.captions);const e=W("span",X(this.config.selectors.caption));e.innerHTML=i,this.elements.captions.appendChild(e),de.call(this,this.media,"cuechange")}}},qe={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.4/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:"SD"}},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:[]}},Ve="picture-in-picture",Be={html5:"html5",youtube:"youtube",vimeo:"vimeo"},Ue="video";function We(){}class ze{constructor(e=!1){this.enabled=window.console&&e,this.enabled&&this.log("Debugging enabled")}get log(){return this.enabled?Function.prototype.bind.call(console.log,console):We}get warn(){return this.enabled?Function.prototype.bind.call(console.warn,console):We}get error(){return this.enabled?Function.prototype.bind.call(console.error,console):We}}class Ke{constructor(e){d(this,"onChange",(()=>{if(!this.supported)return;const e=this.player.elements.buttons.fullscreen;R.element(e)&&(e.pressed=this.active);const t=this.target===this.player.media?this.target:this.player.elements.container;de.call(this.player,t,this.active?"enterfullscreen":"exitfullscreen",!0)})),d(this,"toggleFallback",((e=!1)=>{var t,i;if(e?this.scrollPosition={x:null!==(t=window.scrollX)&&void 0!==t?t:0,y:null!==(i=window.scrollY)&&void 0!==i?i:0}:window.scrollTo(this.scrollPosition.x,this.scrollPosition.y),document.body.style.overflow=e?"hidden":"",G(this.target,this.player.config.classNames.fullscreen.fallback,e),xe.isIos){let t=document.head.querySelector('meta[name="viewport"]');const i="viewport-fit=cover";t||(t=document.createElement("meta"),t.setAttribute("name","viewport"));const s=R.string(t.content)&&t.content.includes(i);e?(this.cleanupViewport=!s,s||(t.content+=`,${i}`)):this.cleanupViewport&&(t.content=t.content.split(",").filter((e=>e.trim()!==i)).join(","))}this.onChange()})),d(this,"trapFocus",(e=>{if(xe.isIos||xe.isIPadOS||!this.active||"Tab"!==e.key)return;const t=document.activeElement,i=te.call(this.player,"a[href], button:not(:disabled), input:not(:disabled), [tabindex]"),[s]=i,n=i[i.length-1];t!==n||e.shiftKey?t===s&&e.shiftKey&&(n.focus(),e.preventDefault()):(s.focus(),e.preventDefault())})),d(this,"update",(()=>{if(this.supported){let e;e=this.forceFallback?"Fallback (forced)":Ke.nativeSupported?"Native":"Fallback",this.player.debug.log(`${e} fullscreen enabled`)}else this.player.debug.log("Fullscreen not supported and fallback disabled");G(this.player.elements.container,this.player.config.classNames.fullscreen.enabled,this.supported)})),d(this,"enter",(()=>{this.supported&&(xe.isIos&&this.player.config.fullscreen.iosNative?this.player.isVimeo?this.player.embed.requestFullscreen():this.target.webkitEnterFullscreen():!Ke.nativeSupported||this.forceFallback?this.toggleFallback(!0):this.prefix?R.empty(this.prefix)||this.target[`${this.prefix}Request${this.property}`]():this.target.requestFullscreen({navigationUI:"hide"}))})),d(this,"exit",(()=>{if(this.supported)if(xe.isIos&&this.player.config.fullscreen.iosNative)this.player.isVimeo?this.player.embed.exitFullscreen():this.target.webkitEnterFullscreen(),me(this.player.play());else if(!Ke.nativeSupported||this.forceFallback)this.toggleFallback(!1);else if(this.prefix){if(!R.empty(this.prefix)){const e="moz"===this.prefix?"Cancel":"Exit";document[`${this.prefix}${e}${this.property}`]()}}else(document.cancelFullScreen||document.exitFullscreen).call(document)})),d(this,"toggle",(()=>{this.active?this.exit():this.enter()})),this.player=e,this.prefix=Ke.prefix,this.property=Ke.property,this.scrollPosition={x:0,y:0},this.forceFallback="force"===e.config.fullscreen.fallback,this.player.elements.fullscreen=e.config.fullscreen.container&&function(e,t){const{prototype:i}=Element;return(i.closest||function(){let e=this;do{if(ee.matches(e,t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null}).call(e,t)}(this.player.elements.container,e.config.fullscreen.container),le.call(this.player,document,"ms"===this.prefix?"MSFullscreenChange":`${this.prefix}fullscreenchange`,(()=>{this.onChange()})),le.call(this.player,this.player.elements.container,"dblclick",(e=>{R.element(this.player.elements.controls)&&this.player.elements.controls.contains(e.target)||this.player.listeners.proxy(e,this.toggle,"fullscreen")})),le.call(this,this.player.elements.container,"keydown",(e=>this.trapFocus(e))),this.update()}static get nativeSupported(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}get useNative(){return Ke.nativeSupported&&!this.forceFallback}static get prefix(){if(R.function(document.exitFullscreen))return"";let e="";return["webkit","moz","ms"].some((t=>!(!R.function(document[`${t}ExitFullscreen`])&&!R.function(document[`${t}CancelFullScreen`])||(e=t,0)))),e}static get property(){return"moz"===this.prefix?"FullScreen":"Fullscreen"}get supported(){return[this.player.config.fullscreen.enabled,this.player.isVideo,Ke.nativeSupported||this.player.config.fullscreen.fallback,!this.player.isYouTube||Ke.nativeSupported||!xe.isIos||this.player.config.playsinline&&!this.player.config.fullscreen.iosNative].every(Boolean)}get active(){if(!this.supported)return!1;if(!Ke.nativeSupported||this.forceFallback)return Z(this.target,this.player.config.classNames.fullscreen.fallback);const e=this.prefix?this.target.getRootNode()[`${this.prefix}${this.property}Element`]:this.target.getRootNode().fullscreenElement;return e&&e.shadowRoot?e===this.target.getRootNode().host:e===this.target}get target(){var e;return xe.isIos&&this.player.config.fullscreen.iosNative?this.player.media:null!==(e=this.player.elements.fullscreen)&&void 0!==e?e:this.player.elements.container}}function Ye(e,t=1){return new Promise(((i,s)=>{const n=new Image,a=()=>{delete n.onload,delete n.onerror,(n.naturalWidth>=t?i:s)(n)};Object.assign(n,{onload:a,onerror:a,src:e})}))}const Qe={addStyleHook(){G(this.elements.container,this.config.selectors.container.replace(".",""),!0),G(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)return this.debug.warn(`Basic support only for ${this.provider} ${this.type}`),void Qe.toggleNativeControls.call(this,!0);R.element(this.elements.controls)||(De.inject.call(this),this.listeners.controls()),Qe.toggleNativeControls.call(this),this.isHTML5&&He.setup.call(this),this.volume=null,this.muted=null,this.loop=null,this.quality=null,this.speed=null,De.updateVolume.call(this),De.timeUpdate.call(this),De.durationUpdate.call(this),Qe.checkPlaying.call(this),G(this.elements.container,this.config.classNames.pip.supported,ae.pip&&this.isHTML5&&this.isVideo),G(this.elements.container,this.config.classNames.airplay.supported,ae.airplay&&this.isHTML5),G(this.elements.container,this.config.classNames.isTouch,this.touch),this.ready=!0,setTimeout((()=>{de.call(this,this.media,"ready")}),0),Qe.setTitle.call(this),this.poster&&Qe.setPoster.call(this,this.poster,!1).catch((()=>{})),this.config.duration&&De.durationUpdate.call(this),this.config.mediaMetadata&&De.setMediaMetadata.call(this)},setTitle(){let e=Me.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 e=ie.call(this,"iframe");if(!R.element(e))return;const t=R.empty(this.config.title)?"video":this.config.title,i=Me.get("frameTitle",this.config);e.setAttribute("title",i.replace("{title}",t))}},togglePoster(e){G(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"),pe.call(this).then((()=>Ye(e))).catch((t=>{throw e===this.poster&&Qe.togglePoster.call(this,!1),t})).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:""}),Qe.togglePoster.call(this,!0),e))))},checkPlaying(e){G(this.elements.container,this.config.classNames.playing,this.playing),G(this.elements.container,this.config.classNames.paused,this.paused),G(this.elements.container,this.config.classNames.stopped,this.stopped),Array.from(this.elements.buttons.play||[]).forEach((e=>{Object.assign(e,{pressed:this.playing}),e.setAttribute("aria-label",Me.get(this.playing?"pause":"play",this.config))})),R.event(e)&&"timeupdate"===e.type||Qe.toggleControls.call(this)},checkLoading(e){this.loading=["stalled","waiting"].includes(e.type),clearTimeout(this.timers.loading),this.timers.loading=setTimeout((()=>{G(this.elements.container,this.config.classNames.loading,this.loading),Qe.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(Boolean(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 Xe{constructor(e){d(this,"firstTouch",(()=>{const{player:e}=this,{elements:t}=e;e.touch=!0,G(t.container,e.config.classNames.isTouch,!0)})),d(this,"global",((e=!0)=>{const{player:t}=this;t.config.keyboard.global&&oe.call(t,window,"keydown keyup",this.handleKey,e,!1),oe.call(t,document.body,"click",this.toggleMenu,e),ue.call(t,document.body,"touchstart",this.firstTouch)})),d(this,"container",(()=>{const{player:e}=this,{config:t,elements:i,timers:s}=e;!t.keyboard.global&&t.keyboard.focused&&le.call(e,i.container,"keydown keyup",this.handleKey,!1),le.call(e,i.container,"mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen",(t=>{const{controls:n}=i;n&&"enterfullscreen"===t.type&&(n.pressed=!1,n.hover=!1);let a=0;["touchstart","touchmove","mousemove"].includes(t.type)&&(Qe.toggleControls.call(e,!0),a=e.touch?3e3:2e3),clearTimeout(s.controls),s.controls=setTimeout((()=>Qe.toggleControls.call(e,!1)),a)}));const n=()=>{if(!e.isVimeo||e.config.vimeo.premium)return;const t=i.wrapper,{active:s}=e.fullscreen,[n,a]=ke.call(e),r=ye(`aspect-ratio: ${n} / ${a}`);if(!s)return void(r?(t.style.width=null,t.style.height=null):(t.style.maxWidth=null,t.style.margin=null));const[o,l]=[Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)],c=o/l>n/a;r?(t.style.width=c?"auto":"100%",t.style.height=c?"100%":"auto"):(t.style.maxWidth=c?l/a*n+"px":null,t.style.margin=c?"0 auto":null)},a=()=>{clearTimeout(s.resized),s.resized=setTimeout(n,50)};le.call(e,i.container,"enterfullscreen exitfullscreen",(t=>{const{target:s}=e.fullscreen;s===i.container&&(!e.isEmbed&&R.empty(e.config.ratio)||(n(),("enterfullscreen"===t.type?le:ce).call(e,window,"resize",a)))}))})),d(this,"media",(()=>{const{player:e}=this,{elements:t}=e;if(le.call(e,e.media,"timeupdate seeking seeked",(t=>De.timeUpdate.call(e,t))),le.call(e,e.media,"durationchange loadeddata loadedmetadata",(t=>De.durationUpdate.call(e,t))),le.call(e,e.media,"ended",(()=>{e.isHTML5&&e.isVideo&&e.config.resetOnEnd&&(e.restart(),e.pause())})),le.call(e,e.media,"progress playing seeking seeked",(t=>De.updateProgress.call(e,t))),le.call(e,e.media,"volumechange",(t=>De.updateVolume.call(e,t))),le.call(e,e.media,"playing play pause ended emptied timeupdate",(t=>Qe.checkPlaying.call(e,t))),le.call(e,e.media,"waiting canplay seeked playing",(t=>Qe.checkLoading.call(e,t))),e.supported.ui&&e.config.clickToPlay&&!e.isAudio){const i=ie.call(e,`.${e.config.classNames.video}`);if(!R.element(i))return;le.call(e,t.container,"click",(s=>{([t.container,i].includes(s.target)||i.contains(s.target))&&(e.touch&&e.config.hideControls||(e.ended?(this.proxy(s,e.restart,"restart"),this.proxy(s,(()=>{me(e.play())}),"play")):this.proxy(s,(()=>{me(e.togglePlay())}),"play")))}))}e.supported.ui&&e.config.disableContextMenu&&le.call(e,t.wrapper,"contextmenu",(e=>{e.preventDefault()}),!1),le.call(e,e.media,"volumechange",(()=>{e.storage.set({volume:e.volume,muted:e.muted})})),le.call(e,e.media,"ratechange",(()=>{De.updateSetting.call(e,"speed"),e.storage.set({speed:e.speed})})),le.call(e,e.media,"qualitychange",(t=>{De.updateSetting.call(e,"quality",null,t.detail.quality)})),le.call(e,e.media,"ready qualitychange",(()=>{De.setDownloadUrl.call(e)}));const i=e.config.events.concat(["keyup","keydown"]).join(" ");le.call(e,e.media,i,(i=>{let{detail:s={}}=i;"error"===i.type&&(s=e.media.error),de.call(e,t.container,i.type,!0,s)}))})),d(this,"proxy",((e,t,i)=>{const{player:s}=this,n=s.config.listeners[i];let a=!0;R.function(n)&&(a=n.call(s,e)),!1!==a&&R.function(t)&&t.call(s,e)})),d(this,"bind",((e,t,i,s,n=!0)=>{const{player:a}=this,r=a.config.listeners[s],o=R.function(r);le.call(a,e,t,(e=>this.proxy(e,i,s)),n&&!o)})),d(this,"controls",(()=>{const{player:e}=this,{elements:t}=e,i=xe.isIE?"change":"input";if(t.buttons.play&&Array.from(t.buttons.play).forEach((t=>{this.bind(t,"click",(()=>{me(e.togglePlay())}),"play")})),this.bind(t.buttons.restart,"click",e.restart,"restart"),this.bind(t.buttons.rewind,"click",(()=>{e.lastSeekTime=Date.now(),e.rewind()}),"rewind"),this.bind(t.buttons.fastForward,"click",(()=>{e.lastSeekTime=Date.now(),e.forward()}),"fastForward"),this.bind(t.buttons.mute,"click",(()=>{e.muted=!e.muted}),"mute"),this.bind(t.buttons.captions,"click",(()=>e.toggleCaptions())),this.bind(t.buttons.download,"click",(()=>{de.call(e,e.media,"download")}),"download"),this.bind(t.buttons.fullscreen,"click",(()=>{e.fullscreen.toggle()}),"fullscreen"),this.bind(t.buttons.pip,"click",(()=>{e.pip="toggle"}),"pip"),this.bind(t.buttons.airplay,"click",e.airplay,"airplay"),this.bind(t.buttons.settings,"click",(t=>{t.stopPropagation(),t.preventDefault(),De.toggleMenu.call(e,t)}),null,!1),this.bind(t.buttons.settings,"keyup",(t=>{[" ","Enter"].includes(t.key)&&("Enter"!==t.key?(t.preventDefault(),t.stopPropagation(),De.toggleMenu.call(e,t)):De.focusFirstMenuItem.call(e,null,!0))}),null,!1),this.bind(t.settings.menu,"keydown",(t=>{"Escape"===t.key&&De.toggleMenu.call(e,t)})),this.bind(t.inputs.seek,"mousedown mousemove",(e=>{const i=t.progress.getBoundingClientRect(),s=e.pageX-e.clientX,n=100/i.width*(e.pageX-i.left-s);e.currentTarget.setAttribute("seek-value",n)})),this.bind(t.inputs.seek,"mousedown mouseup keydown keyup touchstart touchend",(t=>{const i=t.currentTarget,s="play-on-seeked";if(R.keyboardEvent(t)&&!["ArrowLeft","ArrowRight"].includes(t.key))return;e.lastSeekTime=Date.now();const n=i.hasAttribute(s),a=["mouseup","touchend","keyup"].includes(t.type);n&&a?(i.removeAttribute(s),me(e.play())):!a&&e.playing&&(i.setAttribute(s,""),e.pause())})),xe.isIos){const t=te.call(e,'input[type="range"]');Array.from(t).forEach((e=>this.bind(e,i,(e=>H(e.target)))))}this.bind(t.inputs.seek,i,(t=>{const i=t.currentTarget;let s=i.getAttribute("seek-value");R.empty(s)&&(s=i.value),i.removeAttribute("seek-value"),e.currentTime=s/i.max*e.duration}),"seek"),this.bind(t.progress,"mouseenter mouseleave mousemove",(t=>De.updateSeekTooltip.call(e,t))),this.bind(t.progress,"mousemove touchmove",(t=>{const{previewThumbnails:i}=e;i&&i.loaded&&i.startMove(t)})),this.bind(t.progress,"mouseleave touchend click",(()=>{const{previewThumbnails:t}=e;t&&t.loaded&&t.endMove(!1,!0)})),this.bind(t.progress,"mousedown touchstart",(t=>{const{previewThumbnails:i}=e;i&&i.loaded&&i.startScrubbing(t)})),this.bind(t.progress,"mouseup touchend",(t=>{const{previewThumbnails:i}=e;i&&i.loaded&&i.endScrubbing(t)})),xe.isWebKit&&Array.from(te.call(e,'input[type="range"]')).forEach((t=>{this.bind(t,"input",(t=>De.updateRangeFill.call(e,t.target)))})),e.config.toggleInvert&&!R.element(t.display.duration)&&this.bind(t.display.currentTime,"click",(()=>{0!==e.currentTime&&(e.config.invertTime=!e.config.invertTime,De.timeUpdate.call(e))})),this.bind(t.inputs.volume,i,(t=>{e.volume=t.target.value}),"volume"),this.bind(t.controls,"mouseenter mouseleave",(i=>{t.controls.hover=!e.touch&&"mouseenter"===i.type})),t.fullscreen&&Array.from(t.fullscreen.children).filter((e=>!e.contains(t.container))).forEach((i=>{this.bind(i,"mouseenter mouseleave",(i=>{t.controls&&(t.controls.hover=!e.touch&&"mouseenter"===i.type)}))})),this.bind(t.controls,"mousedown mouseup touchstart touchend touchcancel",(e=>{t.controls.pressed=["mousedown","touchstart"].includes(e.type)})),this.bind(t.controls,"focusin",(()=>{const{config:i,timers:s}=e;G(t.controls,i.classNames.noTransition,!0),Qe.toggleControls.call(e,!0),setTimeout((()=>{G(t.controls,i.classNames.noTransition,!1)}),0);const n=this.touch?3e3:4e3;clearTimeout(s.controls),s.controls=setTimeout((()=>Qe.toggleControls.call(e,!1)),n)})),this.bind(t.inputs.volume,"wheel",(t=>{const i=t.webkitDirectionInvertedFromDevice,[s,n]=[t.deltaX,-t.deltaY].map((e=>i?-e:e)),a=Math.sign(Math.abs(s)>Math.abs(n)?s:n);e.increaseVolume(a/50);const{volume:r}=e.media;(1===a&&r<1||-1===a&&r>0)&&t.preventDefault()}),"volume",!1)})),this.player=e,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(e){const{player:t}=this,{elements:i}=t,{key:s,type:n,altKey:a,ctrlKey:r,metaKey:o,shiftKey:l}=e,c="keydown"===n,u=c&&s===this.lastKey;var d;if(!(a||r||o||l)&&s)if(c){const n=document.activeElement;if(R.element(n)){const{editable:s}=t.config.selectors,{seek:a}=i.inputs;if(n!==a&&ee(n,s))return;if(" "===e.key&&ee(n,'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)&&(e.preventDefault(),e.stopPropagation()),s){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":u||(d=Number.parseInt(s,10),t.currentTime=t.duration/10*d);break;case" ":case"k":u||me(t.togglePlay());break;case"ArrowUp":t.increaseVolume(.1);break;case"ArrowDown":t.decreaseVolume(.1);break;case"m":u||(t.muted=!t.muted);break;case"ArrowRight":t.forward();break;case"ArrowLeft":t.rewind();break;case"f":t.fullscreen.toggle();break;case"c":u||t.toggleCaptions();break;case"l":t.loop=!t.loop}"Escape"===s&&!t.fullscreen.usingNative&&t.fullscreen.active&&t.fullscreen.toggle(),this.lastKey=s}else this.lastKey=null}toggleMenu(e){De.toggleMenu.call(this.player,e)}}function Je(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ge,Ze={exports:{}},et=(Ge||(Ge=1,Ze.exports=function(){var e=function(){},t={},i={},s={};function n(e,t){if(e){var n=s[e];if(i[e]=t,n)for(;n.length;)n[0](e,t),n.splice(0,1)}}function a(t,i){t.call&&(t={success:t}),i.length?(t.error||e)(i):(t.success||e)(t)}function r(t,i,s,n){var a,o,l,c=document,u=s.async,d=(s.numRetries||0)+1,h=s.before||e,p=t.replace(/[\?|#].*$/,""),m=t.replace(/^(css|img|module|nomodule)!/,"");if(n=n||0,/(^css!|\.css$)/.test(p))(l=c.createElement("link")).rel="stylesheet",l.href=m,(a="hideFocus"in l)&&l.relList&&(a=0,l.rel="preload",l.as="style");else if(/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(p))(l=c.createElement("img")).src=m;else if((l=c.createElement("script")).src=m,l.async=void 0===u||u,o="noModule"in l,/^module!/.test(p)){if(!o)return i(t,"l");l.type="module"}else if(/^nomodule!/.test(p)&&o)return i(t,"l");l.onload=l.onerror=l.onbeforeload=function(e){var o=e.type[0];if(a)try{l.sheet.cssText.length||(o="e")}catch(e){18!=e.code&&(o="e")}if("e"==o){if((n+=1)<d)return r(t,i,s,n)}else if("preload"==l.rel&&"style"==l.as)return l.rel="stylesheet";i(t,o,e.defaultPrevented)},!1!==h(t,l)&&c.head.appendChild(l)}function o(e,i,s){var o,l;if(i&&i.trim&&(o=i),l=(o?s:i)||{},o){if(o in t)throw"LoadJS";t[o]=!0}function c(t,i){!function(e,t,i){var s,n,a=(e=e.push?e:[e]).length,o=a,l=[];for(s=function(e,i,s){if("e"==i&&l.push(e),"b"==i){if(!s)return;l.push(e)}--a||t(l)},n=0;n<o;n++)r(e[n],s,i)}(e,(function(e){a(l,e),t&&a({success:t,error:i},e),n(o,e)}),l)}if(l.returnPromise)return new Promise(c);c()}return o.ready=function(e,t){return function(e,t){e=e.push?e:[e];var n,a,r,o=[],l=e.length,c=l;for(n=function(e,i){i.length&&o.push(e),--c||t(o)};l--;)a=e[l],(r=i[a])?n(a,r):(s[a]=s[a]||[]).push(n)}(e,(function(e){a(t,e)})),o},o.done=function(e){n(e,[])},o.reset=function(){t={},i={},s={}},o.isDefined=function(e){return e in t},o}()),Ze.exports),tt=Je(et);function it(e){return new Promise(((t,i)=>{tt(e,{success:t,error:i})}))}function st(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,de.call(this,this.media,e?"play":"pause"))}const nt={setup(){const e=this;G(e.elements.wrapper,e.config.classNames.embed,!0),e.options.speed=e.config.speed.options,Te.call(e),R.object(window.Vimeo)?nt.ready.call(e):it(e.config.urls.vimeo.sdk).then((()=>{nt.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:s,...n}=t;let a=e.media.getAttribute("src"),r="";R.empty(a)?(a=e.media.getAttribute(e.config.attributes.embed.id),r=e.media.getAttribute(e.config.attributes.embed.hash)):r=function(e){const t=e.match(/^.*(vimeo.com\/|video\/)(\d+)(\?.*h=|\/)+([\d,a-f]+)/);return t&&5===t.length?t[4]:null}(a);const o=r?{h:r}:{};i&&Object.assign(n,{controls:!1,sidedock:!1});const l=Fe({loop:e.config.loop.active,autoplay:e.autoplay,muted:e.muted,gesture:"media",playsinline:e.config.playsinline,...o,...n}),c=function(e){if(R.empty(e))return null;if(R.number(Number(e)))return e;const t=e.match(/^.*(vimeo.com\/|video\/)(\d+).*/);return t?t[2]:e}(a),u=W("iframe"),d=Pe(e.config.urls.vimeo.iframe,c,l);if(u.setAttribute("src",d),u.setAttribute("allowfullscreen",""),u.setAttribute("allow",["autoplay","fullscreen","picture-in-picture","encrypted-media","accelerometer","gyroscope"].join("; ")),R.empty(s)||u.setAttribute("referrerPolicy",s),i||!t.customControls)u.setAttribute("data-poster",e.poster),e.media=Q(u,e.media);else{const t=W("div",{class:e.config.classNames.embedContainer,"data-poster":e.poster});t.appendChild(u),e.media=Q(t,e.media)}t.customControls||je(Pe(e.config.urls.vimeo.api,d)).then((t=>{!R.empty(t)&&t.thumbnail_url&&Qe.setPoster.call(e,t.thumbnail_url).catch((()=>{}))})),e.embed=new window.Vimeo.Player(u,{autopause:e.config.autopause,muted:e.muted}),e.media.paused=!0,e.media.currentTime=0,e.supported.ui&&e.embed.disableTextTrack(),e.media.play=()=>(st.call(e,!0),e.embed.play()),e.media.pause=()=>(st.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:()=>h,set(t){const{embed:i,media:s,paused:n,volume:a}=e,r=n&&!i.hasPlayed;s.seeking=!0,de.call(e,s,"seeking"),Promise.resolve(r&&i.setVolume(0)).then((()=>i.setCurrentTime(t))).then((()=>r&&i.pause())).then((()=>r&&i.setVolume(a))).catch((()=>{}))}});let p=e.config.speed.selected;Object.defineProperty(e.media,"playbackRate",{get:()=>p,set(t){e.embed.setPlaybackRate(t).then((()=>{p=t,de.call(e,e.media,"ratechange")})).catch((()=>{e.options.speed=[1]}))}});let{volume:m}=e.config;Object.defineProperty(e.media,"volume",{get:()=>m,set(t){e.embed.setVolume(t).then((()=>{m=t,de.call(e,e.media,"volumechange")}))}});let{muted:g}=e.config;Object.defineProperty(e.media,"muted",{get:()=>g,set(t){const i=!!R.boolean(t)&&t;e.embed.setMuted(!!i||e.config.muted).then((()=>{g=i,de.call(e,e.media,"volumechange")}))}});let f,{loop:y}=e.config;Object.defineProperty(e.media,"loop",{get:()=>y,set(t){const i=R.boolean(t)?t:e.config.loop.active;e.embed.setLoop(i).then((()=>{y=i}))}}),e.embed.getVideoUrl().then((t=>{f=t,De.setDownloadUrl.call(e)})).catch((e=>{this.debug.warn(e)})),Object.defineProperty(e.media,"currentSrc",{get:()=>f}),Object.defineProperty(e.media,"ended",{get:()=>e.currentTime===e.duration}),Promise.all([e.embed.getVideoWidth(),e.embed.getVideoHeight()]).then((t=>{const[i,s]=t;e.embed.ratio=Ce(i,s),Te.call(this)})),e.embed.setAutopause(e.config.autopause).then((t=>{e.config.autopause=t})),e.embed.getVideoTitle().then((t=>{e.config.title=t,Qe.setTitle.call(this)})),e.embed.getCurrentTime().then((t=>{h=t,de.call(e,e.media,"timeupdate")})),e.embed.getDuration().then((t=>{e.media.duration=t,de.call(e,e.media,"durationchange")})),e.embed.getTextTracks().then((t=>{e.media.textTracks=t,He.setup.call(e)})),e.embed.on("cuechange",(({cues:t=[]})=>{const i=t.map((e=>function(e){const t=document.createDocumentFragment(),i=document.createElement("div");return t.appendChild(i),i.innerHTML=e,t.firstChild.textContent}(e.text)));He.updateCues.call(e,i)})),e.embed.on("loaded",(()=>{e.embed.getPaused().then((t=>{st.call(e,!t),t||de.call(e,e.media,"playing")})),R.element(e.embed.element)&&e.supported.ui&&e.embed.element.setAttribute("tabindex",-1)})),e.embed.on("bufferstart",(()=>{de.call(e,e.media,"waiting")})),e.embed.on("bufferend",(()=>{de.call(e,e.media,"playing")})),e.embed.on("play",(()=>{st.call(e,!0),de.call(e,e.media,"playing")})),e.embed.on("pause",(()=>{st.call(e,!1)})),e.embed.on("timeupdate",(t=>{e.media.seeking=!1,h=t.seconds,de.call(e,e.media,"timeupdate")})),e.embed.on("progress",(t=>{e.media.buffered=t.percent,de.call(e,e.media,"progress"),1===Number.parseInt(t.percent,10)&&de.call(e,e.media,"canplaythrough"),e.embed.getDuration().then((t=>{t!==e.media.duration&&(e.media.duration=t,de.call(e,e.media,"durationchange"))}))})),e.embed.on("seeked",(()=>{e.media.seeking=!1,de.call(e,e.media,"seeked")})),e.embed.on("ended",(()=>{e.media.paused=!0,de.call(e,e.media,"ended")})),e.embed.on("error",(t=>{e.media.error=t,de.call(e,e.media,"error")})),t.customControls&&setTimeout((()=>Qe.build.call(e)),0)}};function at(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,de.call(this,this.media,e?"play":"pause"))}function rt(e){return e.noCookie?"https://www.youtube-nocookie.com":"http:"===window.location.protocol?"http://www.youtube.com":void 0}const ot={setup(){if(G(this.elements.wrapper,this.config.classNames.embed,!0),R.object(window.YT)&&R.function(window.YT.Player))ot.ready.call(this);else{const e=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=()=>{R.function(e)&&e(),ot.ready.call(this)},it(this.config.urls.youtube.sdk).catch((e=>{this.debug.warn("YouTube API failed to load",e)}))}},getTitle(e){je(Pe(this.config.urls.youtube.api,e)).then((e=>{if(R.object(e)){const{title:t,height:i,width:s}=e;this.config.title=t,Qe.setTitle.call(this),this.embed.ratio=Ce(s,i)}Te.call(this)})).catch((()=>{Te.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 s=e.media.getAttribute("src");R.empty(s)&&(s=e.media.getAttribute(this.config.attributes.embed.id));const n=function(e){if(R.empty(e))return null;const t=e.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/);return t&&t[2]?t[2]:e}(s),a=function(e){return`${e}-${Math.floor(1e4*Math.random())}`}(e.provider),r=W("div",{id:a,"data-poster":t.customControls?e.poster:void 0});if(e.media=Q(r,e.media),t.customControls){const t=e=>`https://i.ytimg.com/vi/${n}/${e}default.jpg`;Ye(t("maxres"),121).catch((()=>Ye(t("sd"),121))).catch((()=>Ye(t("hq")))).then((t=>Qe.setPoster.call(e,t.src))).then((t=>{t.includes("maxres")||(e.elements.poster.style.backgroundSize="cover")})).catch((()=>{}))}e.embed=new window.YT.Player(e.media,{videoId:n,host:rt(t),playerVars:V({},{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(t){if(!e.media.error){const i=t.data,s={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."}[i]||"An unknown error occurred";e.media.error={code:i,message:s},de.call(e,e.media,"error")}},onPlaybackRateChange(t){const i=t.target;e.media.playbackRate=i.getPlaybackRate(),de.call(e,e.media,"ratechange")},onReady(i){if(R.function(e.media.play))return;const s=i.target;ot.getTitle.call(e,n),e.media.play=()=>{at.call(e,!0),s.playVideo()},e.media.pause=()=>{at.call(e,!1),s.pauseVideo()},e.media.stop=()=>{s.stopVideo()},e.media.duration=s.getDuration(),e.media.paused=!0,e.media.currentTime=0,Object.defineProperty(e.media,"currentTime",{get:()=>Number(s.getCurrentTime()),set(t){e.paused&&!e.embed.hasPlayed&&e.embed.mute(),e.media.seeking=!0,de.call(e,e.media,"seeking"),s.seekTo(t)}}),Object.defineProperty(e.media,"playbackRate",{get:()=>s.getPlaybackRate(),set(e){s.setPlaybackRate(e)}});let{volume:a}=e.config;Object.defineProperty(e.media,"volume",{get:()=>a,set(t){a=t,s.setVolume(100*a),de.call(e,e.media,"volumechange")}});let{muted:r}=e.config;Object.defineProperty(e.media,"muted",{get:()=>r,set(t){const i=R.boolean(t)?t:r;r=i,s[i?"mute":"unMute"](),s.setVolume(100*a),de.call(e,e.media,"volumechange")}}),Object.defineProperty(e.media,"currentSrc",{get:()=>s.getVideoUrl()}),Object.defineProperty(e.media,"ended",{get:()=>e.currentTime===e.duration});const o=s.getAvailablePlaybackRates();e.options.speed=o.filter((t=>e.config.speed.options.includes(t))),e.supported.ui&&t.customControls&&e.media.setAttribute("tabindex",-1),de.call(e,e.media,"timeupdate"),de.call(e,e.media,"durationchange"),clearInterval(e.timers.buffering),e.timers.buffering=setInterval((()=>{e.media.buffered=s.getVideoLoadedFraction(),(null===e.media.lastBuffered||e.media.lastBuffered<e.media.buffered)&&de.call(e,e.media,"progress"),e.media.lastBuffered=e.media.buffered,1===e.media.buffered&&(clearInterval(e.timers.buffering),de.call(e,e.media,"canplaythrough"))}),200),t.customControls&&setTimeout((()=>Qe.build.call(e)),50)},onStateChange(i){const s=i.target;switch(clearInterval(e.timers.playing),e.media.seeking&&[1,2].includes(i.data)&&(e.media.seeking=!1,de.call(e,e.media,"seeked")),i.data){case-1:de.call(e,e.media,"timeupdate"),e.media.buffered=s.getVideoLoadedFraction(),de.call(e,e.media,"progress");break;case 0:at.call(e,!1),e.media.loop?(s.stopVideo(),s.playVideo()):de.call(e,e.media,"ended");break;case 1:t.customControls&&!e.config.autoplay&&e.media.paused&&!e.embed.hasPlayed?e.media.pause():(at.call(e,!0),de.call(e,e.media,"playing"),e.timers.playing=setInterval((()=>{de.call(e,e.media,"timeupdate")}),50),e.media.duration!==s.getDuration()&&(e.media.duration=s.getDuration(),de.call(e,e.media,"durationchange")));break;case 2:e.muted||e.embed.unMute(),at.call(e,!1);break;case 3:de.call(e,e.media,"waiting")}de.call(e,e.elements.container,"statechange",!1,{code:i.data})}}})}},lt={setup(){this.media?(G(this.elements.container,this.config.classNames.type.replace("{0}",this.type),!0),G(this.elements.container,this.config.classNames.provider.replace("{0}",this.provider),!0),this.isEmbed&&G(this.elements.container,this.config.classNames.type.replace("{0}","video"),!0),this.isVideo&&(this.elements.wrapper=W("div",{class:this.config.classNames.video}),B(this.media,this.elements.wrapper),this.elements.poster=W("div",{class:this.config.classNames.poster}),this.elements.wrapper.appendChild(this.elements.poster)),this.isHTML5?Se.setup.call(this):this.isYouTube?ot.setup.call(this):this.isVimeo&&nt.setup.call(this)):this.debug.warn("No media element found!")}};class ct{constructor(e){d(this,"load",(()=>{this.enabled&&(R.object(window.google)&&R.object(window.google.ima)?this.ready():it(this.player.config.urls.googleIMA.sdk).then((()=>{this.ready()})).catch((()=>{this.trigger("error",new Error("Google IMA SDK failed to load"))})))})),d(this,"ready",(()=>{var e;this.enabled||((e=this).manager&&e.manager.destroy(),e.elements.displayContainer&&e.elements.displayContainer.destroy(),e.elements.container.remove()),this.startSafetyTimer(12e3,"ready()"),this.managerPromise.then((()=>{this.clearSafetyTimer("onAdsManagerLoaded()")})),this.listeners(),this.setupIMA()})),d(this,"setupIMA",(()=>{this.elements.container=W("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,(e=>this.onAdsManagerLoaded(e)),!1),this.loader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,(e=>this.onAdError(e)),!1),this.requestAds()})),d(this,"requestAds",(()=>{const{container:e}=this.player.elements;try{const t=new google.ima.AdsRequest;t.adTagUrl=this.tagUrl,t.linearAdSlotWidth=e.offsetWidth,t.linearAdSlotHeight=e.offsetHeight,t.nonLinearAdSlotWidth=e.offsetWidth,t.nonLinearAdSlotHeight=e.offsetHeight,t.forceNonLinearFullSlot=!1,t.setAdWillPlayMuted(!this.player.muted),this.loader.requestAds(t)}catch(e){this.onAdError(e)}})),d(this,"pollCountdown",((e=!1)=>{if(!e)return clearInterval(this.countdownTimer),void this.elements.container.removeAttribute("data-badge-text");this.countdownTimer=setInterval((()=>{const e=Oe(Math.max(this.manager.getRemainingTime(),0)),t=`${Me.get("advertisement",this.player.config)} - ${e}`;this.elements.container.setAttribute("data-badge-text",t)}),100)})),d(this,"onAdsManagerLoaded",(e=>{if(!this.enabled)return;const t=new google.ima.AdsRenderingSettings;t.restoreCustomPlaybackStateOnAdBreakComplete=!0,t.enablePreloading=!0,this.manager=e.getAdsManager(this.player,t),this.cuePoints=this.manager.getCuePoints(),this.manager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,(e=>this.onAdError(e))),Object.keys(google.ima.AdEvent.Type).forEach((e=>{this.manager.addEventListener(google.ima.AdEvent.Type[e],(e=>this.onAdEvent(e)))})),this.trigger("loaded")})),d(this,"addCuePoints",(()=>{R.empty(this.cuePoints)||this.cuePoints.forEach((e=>{if(0!==e&&-1!==e&&e<this.player.duration){const t=this.player.elements.progress;if(R.element(t)){const i=100/this.player.duration*e,s=W("span",{class:this.player.config.classNames.cues});s.style.left=`${i.toString()}%`,t.appendChild(s)}}}))})),d(this,"onAdEvent",(e=>{const{container:t}=this.player.elements,i=e.getAd(),s=e.getAdData();switch((e=>{de.call(this.player,this.player.media,`ads${e.replace(/_/g,"").toLowerCase()}`)})(e.type),e.type){case google.ima.AdEvent.Type.LOADED:this.trigger("loaded"),this.pollCountdown(!0),i.isLinear()||(i.width=t.offsetWidth,i.height=t.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()}`)}})),d(this,"onAdError",(e=>{this.cancel(),this.player.debug.warn("Ads error",e)})),d(this,"listeners",(()=>{const{container:e}=this.player.elements;let t;this.player.on("canplay",(()=>{this.addCuePoints()})),this.player.on("ended",(()=>{this.loader.contentComplete()})),this.player.on("timeupdate",(()=>{t=this.player.currentTime})),this.player.on("seeked",(()=>{const e=this.player.currentTime;R.empty(this.cuePoints)||this.cuePoints.forEach(((i,s)=>{t<i&&i<e&&(this.manager.discardAdBreak(),this.cuePoints.splice(s,1))}))})),window.addEventListener("resize",(()=>{this.manager&&this.manager.resize(e.offsetWidth,e.offsetHeight,google.ima.ViewMode.NORMAL)}))})),d(this,"play",(()=>{const{container:e}=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(e.offsetWidth,e.offsetHeight,google.ima.ViewMode.NORMAL),this.manager.start()),this.initialized=!0}catch(e){this.onAdError(e)}})).catch((()=>{}))})),d(this,"resumeContent",(()=>{this.elements.container.style.zIndex="",this.playing=!1,me(this.player.media.play())})),d(this,"pauseContent",(()=>{this.elements.container.style.zIndex=3,this.playing=!0,this.player.media.pause()})),d(this,"cancel",(()=>{this.initialized&&this.resumeContent(),this.trigger("error"),this.loadAds()})),d(this,"loadAds",(()=>{this.managerPromise.then((()=>{this.manager&&this.manager.destroy(),this.managerPromise=new Promise((e=>{this.on("loaded",e),this.player.debug.log(this.manager)})),this.initialized=!1,this.requestAds()})).catch((()=>{}))})),d(this,"trigger",((e,...t)=>{const i=this.events[e];R.array(i)&&i.forEach((e=>{R.function(e)&&e.apply(this,t)}))})),d(this,"on",((e,t)=>(R.array(this.events[e])||(this.events[e]=[]),this.events[e].push(t),this))),d(this,"startSafetyTimer",((e,t)=>{this.player.debug.log(`Safety timer invoked from: ${t}`),this.safetyTimer=setTimeout((()=>{this.cancel(),this.clearSafetyTimer("startSafetyTimer()")}),e)})),d(this,"clearSafetyTimer",(e=>{R.nullOrUndefined(this.safetyTimer)||(this.player.debug.log(`Safety timer cleared from: ${e}`),clearTimeout(this.safetyTimer),this.safetyTimer=null)})),this.player=e,this.config=e.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(((e,t)=>{this.on("loaded",e),this.on("error",t)})),this.load()}get enabled(){const{config:e}=this;return this.player.isHTML5&&this.player.isVideo&&e.enabled&&(!R.empty(e.publisherId)||R.url(e.tagUrl))}get tagUrl(){const{config:e}=this;return R.url(e.tagUrl)?e.tagUrl:`https://go.aniview.com/api/adserver6/vast/?${Fe({AV_PUBLISHERID:"58c25bb0073ef448b1087ad6",AV_CHANNELID:"5a0458dc28a06145e4519d21",AV_URL:window.location.hostname,cb:Date.now(),AV_WIDTH:640,AV_HEIGHT:480,AV_CDIM2:e.publisherId})}`}}function ut(e=0,t=0,i=255){return Math.min(Math.max(e,t),i)}function dt(e){const t=[];return e.split(/\r\n\r\n|\n\n|\r\r/).forEach((e=>{const i={};e.split(/\r\n|\n|\r/).forEach((e=>{if(R.number(i.startTime)){if(!R.empty(e.trim())&&R.empty(i.text)){const t=e.trim().split("#xywh=");[i.text]=t,t[1]&&([i.x,i.y,i.w,i.h]=t[1].split(","))}}else{const t=e.match(/(\d{2})?:?(\d{2}):(\d{2}).(\d{2,3})( ?--> ?)(\d{2})?:?(\d{2}):(\d{2}).(\d{2,3})/);t&&(i.startTime=60*Number(t[1]||0)*60+60*Number(t[2])+Number(t[3])+Number(`0.${t[4]}`),i.endTime=60*Number(t[6]||0)*60+60*Number(t[7])+Number(t[8])+Number(`0.${t[9]}`))}})),i.text&&t.push(i)})),t}function ht(e,t){const i={};return e>t.width/t.height?(i.width=t.width,i.height=1/e*t.width):(i.height=t.height,i.width=e*t.height),i}class pt{constructor(e){d(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)}))})),d(this,"getThumbnails",(()=>new Promise((e=>{const{src:t}=this.player.config.previewThumbnails;if(R.empty(t))throw new Error("Missing previewThumbnails.src config attribute");const i=()=>{this.thumbnails.sort(((e,t)=>e.height-t.height)),this.player.debug.log("Preview thumbnails",this.thumbnails),e()};if(R.function(t))t((e=>{this.thumbnails=e,i()}));else{const e=(R.string(t)?[t]:t).map((e=>this.getThumbnail(e)));Promise.all(e).then(i)}})))),d(this,"getThumbnail",(e=>new Promise((t=>{je(e,void 0,this.player.config.previewThumbnails.withCredentials).then((i=>{const s={frames:dt(i),height:null,urlPrefix:""};s.frames[0].text.startsWith("/")||s.frames[0].text.startsWith("http://")||s.frames[0].text.startsWith("https://")||(s.urlPrefix=e.substring(0,e.lastIndexOf("/")+1));const n=new Image;n.onload=()=>{s.height=n.naturalHeight,s.width=n.naturalWidth,this.thumbnails.push(s),t()},n.src=s.urlPrefix+s.frames[0].text}))})))),d(this,"startMove",(e=>{if(this.loaded&&R.event(e)&&["touchmove","mousemove"].includes(e.type)&&this.player.media.duration){if("touchmove"===e.type)this.seekTime=this.player.media.duration*(this.player.elements.inputs.seek.value/100);else{var t,i;const s=this.player.elements.progress.getBoundingClientRect(),n=100/s.width*(e.pageX-s.left);this.seekTime=this.player.media.duration*(n/100),this.seekTime<0&&(this.seekTime=0),this.seekTime>this.player.media.duration-1&&(this.seekTime=this.player.media.duration-1),this.mousePosX=e.pageX,this.elements.thumb.time.textContent=Oe(this.seekTime);const a=null===(t=this.player.config.markers)||void 0===t||null===(i=t.points)||void 0===i?void 0:i.find((({time:e})=>e===Math.round(this.seekTime)));a&&this.elements.thumb.time.insertAdjacentHTML("afterbegin",`${a.label}<br>`)}this.showImageAtCurrentTime()}})),d(this,"endMove",(()=>{this.toggleThumbContainer(!1,!0)})),d(this,"startScrubbing",(e=>{(R.nullOrUndefined(e.button)||!1===e.button||0===e.button)&&(this.mouseDown=!0,this.player.media.duration&&(this.toggleScrubbingContainer(!0),this.toggleThumbContainer(!1,!0),this.showImageAtCurrentTime()))})),d(this,"endScrubbing",(()=>{this.mouseDown=!1,Math.ceil(this.lastTime)===Math.ceil(this.player.media.currentTime)?this.toggleScrubbingContainer(!1):ue.call(this.player,this.player.media,"timeupdate",(()=>{this.mouseDown||this.toggleScrubbingContainer(!1)}))})),d(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}))})),d(this,"render",(()=>{this.elements.thumb.container=W("div",{class:this.player.config.classNames.previewThumbnails.thumbContainer}),this.elements.thumb.imageContainer=W("div",{class:this.player.config.classNames.previewThumbnails.imageContainer}),this.elements.thumb.container.appendChild(this.elements.thumb.imageContainer);const e=W("div",{class:this.player.config.classNames.previewThumbnails.timeContainer});this.elements.thumb.time=W("span",{},"00:00"),e.appendChild(this.elements.thumb.time),this.elements.thumb.imageContainer.appendChild(e),R.element(this.player.elements.progress)&&this.player.elements.progress.appendChild(this.elements.thumb.container),this.elements.scrubbing.container=W("div",{class:this.player.config.classNames.previewThumbnails.scrubbingContainer}),this.player.elements.wrapper.appendChild(this.elements.scrubbing.container)})),d(this,"destroy",(()=>{this.elements.thumb.container&&this.elements.thumb.container.remove(),this.elements.scrubbing.container&&this.elements.scrubbing.container.remove()})),d(this,"showImageAtCurrentTime",(()=>{this.mouseDown?this.setScrubbingContainerSize():this.setThumbContainerSizeAndPos();const e=this.thumbnails[0].frames.findIndex((e=>this.seekTime>=e.startTime&&this.seekTime<=e.endTime)),t=e>=0;let i=0;this.mouseDown||this.toggleThumbContainer(t),t&&(this.thumbnails.forEach(((t,s)=>{this.loadedImages.includes(t.frames[e].text)&&(i=s)})),e!==this.showingThumb&&(this.showingThumb=e,this.loadImage(i)))})),d(this,"loadImage",((e=0)=>{const t=this.showingThumb,i=this.thumbnails[e],{urlPrefix:s}=i,n=i.frames[t],a=i.frames[t].text,r=s+a;if(this.currentImageElement&&this.currentImageElement.dataset.filename===a)this.showImage(this.currentImageElement,n,e,t,a,!1),this.currentImageElement.dataset.index=t,this.removeOldImages(this.currentImageElement);else{this.loadingImage&&this.usingSprites&&(this.loadingImage.onload=null);const i=new Image;i.src=r,i.dataset.index=t,i.dataset.filename=a,this.showingThumbFilename=a,this.player.debug.log(`Loading image: ${r}`),i.onload=()=>this.showImage(i,n,e,t,a,!0),this.loadingImage=i,this.removeOldImages(i)}})),d(this,"showImage",((e,t,i,s,n,a=!0)=>{this.player.debug.log(`Showing thumb: ${n}. num: ${s}. qual: ${i}. newimg: ${a}`),this.setImageSizeAndOffset(e,t),a&&(this.currentImageContainer.appendChild(e),this.currentImageElement=e,this.loadedImages.includes(n)||this.loadedImages.push(n)),this.preloadNearby(s,!0).then(this.preloadNearby(s,!1)).then(this.getHigherQuality(i,e,t,n))})),d(this,"removeOldImages",(e=>{Array.from(this.currentImageContainer.children).forEach((t=>{if("img"!==t.tagName.toLowerCase())return;const i=this.usingSprites?500:1e3;if(t.dataset.index!==e.dataset.index&&!t.dataset.deleting){t.dataset.deleting=!0;const{currentImageContainer:e}=this;setTimeout((()=>{e.removeChild(t),this.player.debug.log(`Removing thumb: ${t.dataset.filename}`)}),i)}}))})),d(this,"preloadNearby",((e,t=!0)=>new Promise((i=>{setTimeout((()=>{const s=this.thumbnails[0].frames[e].text;if(this.showingThumbFilename===s){let n;n=t?this.thumbnails[0].frames.slice(e):this.thumbnails[0].frames.slice(0,e).reverse();let a=!1;n.forEach((e=>{const t=e.text;if(t!==s&&!this.loadedImages.includes(t)){a=!0,this.player.debug.log(`Preloading thumb filename: ${t}`);const{urlPrefix:e}=this.thumbnails[0],s=e+t,n=new Image;n.src=s,n.onload=()=>{this.player.debug.log(`Preloaded thumb filename: ${t}`),this.loadedImages.includes(t)||this.loadedImages.push(t),i()}}})),a||i()}}),300)})))),d(this,"getHigherQuality",((e,t,i,s)=>{if(e<this.thumbnails.length-1){let n=t.naturalHeight;this.usingSprites&&(n=i.h),n<this.thumbContainerHeight&&setTimeout((()=>{this.showingThumbFilename===s&&(this.player.debug.log(`Showing higher quality thumb for: ${s}`),this.loadImage(e+1))}),300)}})),d(this,"toggleThumbContainer",((e=!1,t=!1)=>{const i=this.player.config.classNames.previewThumbnails.thumbContainerShown;this.elements.thumb.container.classList.toggle(i,e),!e&&t&&(this.showingThumb=null,this.showingThumbFilename=null)})),d(this,"toggleScrubbingContainer",((e=!1)=>{const t=this.player.config.classNames.previewThumbnails.scrubbingContainerShown;this.elements.scrubbing.container.classList.toggle(t,e),e||(this.showingThumb=null,this.showingThumbFilename=null)})),d(this,"determineContainerAutoSizing",(()=>{(this.elements.thumb.imageContainer.clientHeight>20||this.elements.thumb.imageContainer.clientWidth>20)&&(this.sizeSpecifiedInCSS=!0)})),d(this,"setThumbContainerSizeAndPos",(()=>{const{imageContainer:e}=this.elements.thumb;if(this.sizeSpecifiedInCSS){if(e.clientHeight>20&&e.clientWidth<20){const t=Math.floor(e.clientHeight*this.thumbAspectRatio);e.style.width=`${t}px`}else if(e.clientHeight<20&&e.clientWidth>20){const t=Math.floor(e.clientWidth/this.thumbAspectRatio);e.style.height=`${t}px`}}else{const t=Math.floor(this.thumbContainerHeight*this.thumbAspectRatio);e.style.height=`${this.thumbContainerHeight}px`,e.style.width=`${t}px`}this.setThumbContainerPos()})),d(this,"setThumbContainerPos",(()=>{const e=this.player.elements.progress.getBoundingClientRect(),t=this.player.elements.container.getBoundingClientRect(),{container:i}=this.elements.thumb,s=t.left-e.left+10,n=t.right-e.left-i.clientWidth-10,a=this.mousePosX-e.left-i.clientWidth/2,r=ut(a,s,n);i.style.left=`${r}px`,i.style.setProperty("--preview-arrow-offset",a-r+"px")})),d(this,"setScrubbingContainerSize",(()=>{const{width:e,height:t}=ht(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight});this.elements.scrubbing.container.style.width=`${e}px`,this.elements.scrubbing.container.style.height=`${t}px`})),d(this,"setImageSizeAndOffset",((e,t)=>{if(!this.usingSprites)return;const i=this.thumbContainerHeight/t.h;e.style.height=e.naturalHeight*i+"px",e.style.width=e.naturalWidth*i+"px",e.style.left=`-${t.x*i}px`,e.style.top=`-${t.y*i}px`})),this.player=e,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:e}=ht(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight});return e}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(e){this.mouseDown?this.currentScrubbingImageElement=e:this.currentThumbnailImageElement=e}}const mt={insertElements(e,t){R.string(t)?z(e,this.media,{src:t}):R.array(t)&&t.forEach((t=>{z(e,this.media,t)}))},change(e){q(e,"sources.length")?(Se.cancelRequests.call(this),this.destroy((()=>{this.options.quality=[],K(this.media),this.media=null,R.element(this.elements.container)&&this.elements.container.removeAttribute("class");const{sources:t,type:i}=e,[{provider:s=Be.html5,src:n}]=t,a="html5"===s?i:"div",r="html5"===s?{}:{src:n};Object.assign(this,{provider:s,type:i,supported:ae.check(i,s,this.config.playsinline),media:W(a,r)}),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","")),Qe.addStyleHook.call(this),this.isHTML5&&mt.insertElements.call(this,"source",t),this.config.title=e.title,lt.setup.call(this),this.isHTML5&&Object.keys(e).includes("tracks")&&mt.insertElements.call(this,"track",e.tracks),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&Qe.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 pt(this))),this.fullscreen.update()}),!0)):this.debug.warn("Invalid source format")}};class gt{constructor(e,t){if(d(this,"play",(()=>R.function(this.media.play)?(this.ads&&this.ads.enabled&&this.ads.managerPromise.then((()=>this.ads.play())).catch((()=>me(this.media.play()))),this.media.play()):null)),d(this,"pause",(()=>this.playing&&R.function(this.media.pause)?this.media.pause():null)),d(this,"togglePlay",(e=>(R.boolean(e)?e:!this.playing)?this.play():this.pause())),d(this,"stop",(()=>{this.isHTML5?(this.pause(),this.restart()):R.function(this.media.stop)&&this.media.stop()})),d(this,"restart",(()=>{this.currentTime=0})),d(this,"rewind",(e=>{this.currentTime-=R.number(e)?e:this.config.seekTime})),d(this,"forward",(e=>{this.currentTime+=R.number(e)?e:this.config.seekTime})),d(this,"increaseVolume",(e=>{const t=this.media.muted?0:this.volume;this.volume=t+(R.number(e)?e:0)})),d(this,"decreaseVolume",(e=>{this.increaseVolume(-e)})),d(this,"airplay",(()=>{ae.airplay&&this.media.webkitShowPlaybackTargetPicker()})),d(this,"toggleControls",(e=>{if(this.supported.ui&&!this.isAudio){const t=Z(this.elements.container,this.config.classNames.hideControls),i=void 0===e?void 0:!e,s=G(this.elements.container,this.config.classNames.hideControls,i);if(s&&R.array(this.config.controls)&&this.config.controls.includes("settings")&&!R.empty(this.config.settings)&&De.toggleMenu.call(this,!1),s!==t){const e=s?"controlshidden":"controlsshown";de.call(this,this.media,e)}return!s}return!1})),d(this,"on",((e,t)=>{le.call(this,this.elements.container,e,t)})),d(this,"once",((e,t)=>{ue.call(this,this.elements.container,e,t)})),d(this,"off",((e,t)=>{ce(this.elements.container,e,t)})),d(this,"destroy",((e,t=!1)=>{if(!this.ready)return;const i=()=>{document.body.style.overflow="",this.embed=null,t?(Object.keys(this.elements).length&&(K(this.elements.buttons.play),K(this.elements.captions),K(this.elements.controls),K(this.elements.wrapper),this.elements.buttons.play=null,this.elements.captions=null,this.elements.controls=null,this.elements.wrapper=null),R.function(e)&&e()):(he.call(this),Se.cancelRequests.call(this),Q(this.elements.original,this.elements.container),de.call(this,this.elements.original,"destroyed",!0),R.function(e)&&e.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?(Qe.toggleNativeControls.call(this,!0),i()):this.isYouTube?(clearInterval(this.timers.buffering),clearInterval(this.timers.playing),null!==this.embed&&R.function(this.embed.destroy)&&this.embed.destroy(),i()):this.isVimeo&&(null!==this.embed&&this.embed.unload().then(i),setTimeout(i,200))})),d(this,"supports",(e=>ae.mime.call(this,e))),this.timers={},this.ready=!1,this.loading=!1,this.failed=!1,this.touch=ae.touch,this.media=e,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=V({},qe,gt.defaults,t||{},(()=>{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 ze(this.config.debug),this.debug.log("Config",this.config),this.debug.log("Support",ae),R.nullOrUndefined(this.media)||!R.element(this.media))return void this.debug.error("Setup failed: no suitable element passed");if(this.media.plyr)return void this.debug.warn("Target already setup");if(!this.config.enabled)return void this.debug.error("Setup failed: disabled by config");if(!ae.check().api)return void this.debug.error("Setup failed: no support");const i=this.media.cloneNode(!0);i.autoplay=!1,this.elements.original=i;const s=this.media.tagName.toLowerCase();let n=null,a=null;switch(s){case"div":if(n=this.media.querySelector("iframe"),R.element(n)){if(a=Re(n.getAttribute("src")),this.provider=function(e){return/^(?:https?:\/\/)?(?:www\.)?(?:youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(e)?Be.youtube:/^https?:\/\/player.vimeo.com\/video\/\d{0,9}(?=\b|\/)/.test(e)?Be.vimeo:null}(a.toString()),this.elements.container=this.media,this.media=n,this.elements.container.className="",a.search.length){const e=["1","true"];e.includes(a.searchParams.get("autoplay"))&&(this.config.autoplay=!0),e.includes(a.searchParams.get("loop"))&&(this.config.loop.active=!0),this.isYouTube?(this.config.playsinline=e.includes(a.searchParams.get("playsinline")),this.config.youtube.hl=a.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(Be).includes(this.provider))return void this.debug.error("Setup failed: Invalid provider");this.type=Ue;break;case"video":case"audio":this.type=s,this.provider=Be.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:return void this.debug.error("Setup failed: unsupported type")}this.supported=ae.check(this.type,this.provider),this.supported.api?(this.eventListeners=[],this.listeners=new Xe(this),this.storage=new Le(this),this.media.plyr=this,R.element(this.elements.container)||(this.elements.container=W("div"),B(this.media,this.elements.container)),Qe.migrateStyles.call(this),Qe.addStyleHook.call(this),lt.setup.call(this),this.config.debug&&le.call(this,this.elements.container,this.config.events.join(" "),(e=>{this.debug.log(`event: ${e.type}`)})),this.fullscreen=new Ke(this),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&Qe.build.call(this),this.listeners.container(),this.listeners.global(),this.config.ads.enabled&&(this.ads=new ct(this)),this.isHTML5&&this.config.autoplay&&this.once("canplay",(()=>me(this.play()))),this.lastSeekTime=0,this.config.previewThumbnails.enabled&&(this.previewThumbnails=new pt(this))):this.debug.error("Setup failed: no support")}get isHTML5(){return this.provider===Be.html5}get isEmbed(){return this.isYouTube||this.isVimeo}get isYouTube(){return this.provider===Be.youtube}get isVimeo(){return this.provider===Be.vimeo}get isVideo(){return this.type===Ue}get isAudio(){return"audio"===this.type}get playing(){return Boolean(this.ready&&!this.paused&&!this.ended)}get paused(){return Boolean(this.media.paused)}get stopped(){return Boolean(this.paused&&0===this.currentTime)}get ended(){return Boolean(this.media.ended)}set currentTime(e){if(!this.duration)return;const t=R.number(e)&&e>0;this.media.currentTime=t?Math.min(e,this.duration):0,this.debug.log(`Seeking to ${this.currentTime} seconds`)}get currentTime(){return Number(this.media.currentTime)}get buffered(){const{buffered:e}=this.media;return R.number(e)?e:e&&e.length&&this.duration>0?e.end(0)/this.duration:0}get seeking(){return Boolean(this.media.seeking)}get duration(){const e=Number.parseFloat(this.config.duration),t=(this.media||{}).duration,i=R.number(t)&&t!==1/0?t:0;return e||i}set volume(e){let t=e;R.string(t)&&(t=Number(t)),R.number(t)||(t=this.storage.get("volume")),R.number(t)||({volume:t}=this.config),t>1&&(t=1),t<0&&(t=0),this.config.volume=t,this.media.volume=t,!R.empty(e)&&this.muted&&t>0&&(this.muted=!1)}get volume(){return Number(this.media.volume)}set muted(e){let t=e;R.boolean(t)||(t=this.storage.get("muted")),R.boolean(t)||(t=this.config.muted),this.config.muted=t,this.media.muted=t}get muted(){return Boolean(this.media.muted)}get hasAudio(){return!this.isHTML5||!!this.isAudio||Boolean(this.media.mozHasAudio)||Boolean(this.media.webkitAudioDecodedByteCount)||Boolean(this.media.audioTracks&&this.media.audioTracks.length)}set speed(e){let t=null;R.number(e)&&(t=e),R.number(t)||(t=this.storage.get("speed")),R.number(t)||(t=this.config.speed.selected);const{minimumSpeed:i,maximumSpeed:s}=this;t=ut(t,i,s),this.config.speed.selected=t,setTimeout((()=>{this.media&&(this.media.playbackRate=t)}),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(e){const t=this.config.quality,i=this.options.quality;if(!i.length)return;let s=[!R.empty(e)&&Number(e),this.storage.get("quality"),t.selected,t.default].find(R.number),n=!0;if(!i.includes(s)){const e=fe(i,s);this.debug.warn(`Unsupported quality option: ${s}, using ${e} instead`),s=e,n=!1}t.selected=s,this.media.quality=s,n&&this.storage.set({quality:s})}get quality(){return this.media.quality}set loop(e){const t=R.boolean(e)?e:this.config.loop.active;this.config.loop.active=t,this.media.loop=t}get loop(){return Boolean(this.media.loop)}set source(e){mt.change.call(this,e)}get source(){return this.media.currentSrc}get download(){const{download:e}=this.config.urls;return R.url(e)?e:this.source}set download(e){R.url(e)&&(this.config.urls.download=e,De.setDownloadUrl.call(this))}set poster(e){this.isVideo?Qe.setPoster.call(this,e,!1).catch((()=>{})):this.debug.warn("Poster can only be set for video")}get poster(){return this.isVideo?this.media.getAttribute("poster")||this.media.getAttribute("data-poster"):null}get ratio(){if(!this.isVideo)return null;const e=we(ke.call(this));return R.array(e)?e.join(":"):e}set ratio(e){this.isVideo?R.string(e)&&ve(e)?(this.config.ratio=we(e),Te.call(this)):this.debug.error(`Invalid aspect ratio specified (${e})`):this.debug.warn("Aspect ratio can only be set for video")}set autoplay(e){this.config.autoplay=R.boolean(e)?e:this.config.autoplay}get autoplay(){return Boolean(this.config.autoplay)}toggleCaptions(e){He.toggle.call(this,e,!1)}set currentTrack(e){He.set.call(this,e,!1),He.setup.call(this)}get currentTrack(){const{toggled:e,currentTrack:t}=this.captions;return e?t:-1}set language(e){He.setLanguage.call(this,e,!1)}get language(){return(He.getCurrentTrack.call(this)||{}).language}set pip(e){if(!ae.pip)return;const t=R.boolean(e)?e:!this.pip;R.function(this.media.webkitSetPresentationMode)&&this.media.webkitSetPresentationMode(t?Ve:"inline"),R.function(this.media.requestPictureInPicture)&&(!this.pip&&t?this.media.requestPictureInPicture():this.pip&&!t&&document.exitPictureInPicture())}get pip(){return ae.pip?R.empty(this.media.webkitPresentationMode)?this.media===document.pictureInPictureElement:this.media.webkitPresentationMode===Ve:null}setPreviewThumbnails(e){this.previewThumbnails&&this.previewThumbnails.loaded&&(this.previewThumbnails.destroy(),this.previewThumbnails=null),Object.assign(this.config.previewThumbnails,e),this.config.previewThumbnails.enabled&&(this.previewThumbnails=new pt(this))}static supported(e,t){return ae.check(e,t)}static loadSprite(e,t){return Ie(e,t)}static setup(e,t={}){let i=null;return R.string(e)?i=Array.from(document.querySelectorAll(e)):R.nodeList(e)?i=Array.from(e):R.array(e)&&(i=e.filter(R.element)),R.empty(i)?null:i.map((e=>new gt(e,t)))}}var ft;gt.defaults=(ft=qe,JSON.parse(JSON.stringify(ft)));var yt=i(5556),bt=i.n(yt);const vt=(e,t)=>{const i=new gt(".plyr-react",t.options||{});return t.source&&(i.source=t.source),i},wt=e=>{e&&e.destroy()},kt=()=>{},Tt=e=>e?()=>({plyr:e}):()=>new Proxy({plyr:{source:null}},{get:(e,t)=>"plyr"===t?e[t]:kt});const Ct=e.forwardRef(((t,i)=>{const{source:s,options:n=null,...a}=t,r=function(t,i,s=null){return function(t,i,s=[]){const[n,a]=(0,e.useState)(null),r=(0,e.useRef)(null),{instantiate:o,destroy:l,getAPI:c,params:u}=i;(0,e.useEffect)((()=>{const e=o(r.current,u);return a(e),()=>{l&&l(e,u)}}),s);const d=(0,e.useMemo)((()=>c(n,u)),[n]);return(0,e.useImperativeHandle)(t,d,[d]),r}(t,{instantiate:vt,getAPI:Tt,destroy:wt,params:i},s||[i.options,i.source])}(i,{source:s,options:n});return(0,c.jsx)("video",{ref:r,className:"plyr-react plyr",...a})}));Ct.displayName="Plyr",Ct.defaultProps={options:{controls:["rewind","play","fast-forward","progress","current-time","duration","mute","volume","settings","fullscreen"],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",menuBack:"Go back to previous menu",speed:"Speed",normal:"Normal",quality:"Quality",loop:"Loop"}},source:{type:"video",sources:[{src:"https://cdn.plyr.io/static/blank.mp4",type:"video/mp4",size:720},{src:"https://cdn.plyr.io/static/blank.mp4",type:"video/mp4",size:1080}]}},Ct.propTypes={options:bt().object,source:bt().any};const St=({popup:e})=>{const{type:t="video",content:i="",videoOptions:s={}}=e,{autoplay:n=!1}=s||{};return(0,c.jsx)(Ct,{source:{type:t,sources:[{src:i,provider:i.includes("youtube")?"youtube":i.includes("vimeo")?"vimeo":"html5"}]},options:{autoplay:n}})},xt=(0,e.forwardRef)((({attributes:e,securityPass:t=!0,setSecurityPass:i,isPremium:s,Popup:n,popupContent:a,isBackend:r=!1,children:o,onClick:d=()=>{}},h)=>{const{actionType:p="link",iconPos:m="left"}=e;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("a",{ref:h,...l(e,t,s,r),onClick:()=>d(!0),children:["right"!==m&&(0,c.jsx)(u,{attributes:e}),o,"right"===m&&(0,c.jsx)(u,{attributes:e})]}),s&&"popup"===p&&t&&!r&&(0,c.jsx)(Pt,{attributes:e,Popup:n,popupContent:a,securityPop:t,setSecurityPass:i,btnRef:h})]})})),Pt=({attributes:t,Popup:i,popupContent:s,securityPop:n,setSecurityPass:a})=>{const{actionType:r="link",popup:o={}}=t,{caption:l=""}=o,[u,d]=(0,e.useState)(n);return(0,e.useEffect)((()=>{}),[r]),(0,c.jsx)(i,{isOpen:u,onClose:()=>{d(!1),a(!1)},caption:l,children:(0,c.jsx)(At,{popup:o,popupContent:s})})},At=({popup:e,popupContent:t})=>{const{type:i="image",content:s="",caption:n=""}=e;if(!s)return(0,c.jsxs)("p",{className:"warning",children:["Sorry! No ","iframe"===i?"Iframe Source":i," Found. Please Insert..."]});switch(i){case"image":return(0,c.jsx)("img",{className:"image",src:s,alt:n});case"audio":case"video":return(0,c.jsx)(St,{popup:e});case"content":return t;case"document":return(0,c.jsx)("div",{className:"document",children:(0,c.jsx)("iframe",{src:`//docs.google.com/viewer?embedded=true&url=${s}`})});case"iframe":return(0,c.jsx)("div",{className:"iframe",children:(0,c.jsx)("iframe",{src:s})});default:return null}},Et="linear-gradient(135deg, #0040E3, #18D4FD)",$t=(e,t)=>s(t)?`${e}: ${t};`:"",Nt=e=>{const{width:t="",style:i="solid",color:s="",side:n="all",radius:a=""}=e||{},r=e=>{const t=n?.toLowerCase();return t?.includes("all")||t?.includes(e)},o=`${t} ${i} ${s}`,l=`\n\t\t${t&&0!==parseInt(t)?["top","right","bottom","left"].map((e=>r(e)?`border-${e}: ${o};`:"")).join(""):""}\n\t\t${$t("border-radius",a)}\n\t`;return l},Mt=e=>{const{color:t="",bgType:i="solid",bg:s="",gradient:n=Et}=e||{};return`\n\t\t${$t("color",t)}\n\t\t${n||s?$t("background","gradient"===i?n:s):""}\n\t`},Lt=(e,t="box")=>{let i="";return e?.map(((s,n)=>{const{hOffset:a="0px",vOffset:r="0px",blur:o="0px",spreed:l="0px",color:c="#e7f0fe",isInset:u=!1}=s||{},d=u?"inset":"",h=`${a} ${r} ${o}`,p=n+1>=e.length?"":", ";i+="text"===t?`${h} ${c}${p}`:`${h} ${l} ${c} ${d}${p}`})),i||""},jt=e=>{const{side:t=2,vertical:i="0px",horizontal:s="0px",top:n="0px",right:a="0px",bottom:r="0px",left:o="0px"}=e||{};return 2===t?`${i} ${s}`:`${n} ${a} ${r} ${o}`},It=(e,t,i=!0)=>{const{fontFamily:s="Default",fontCategory:n="sans-serif",fontVariant:a=400,fontWeight:r,isUploadFont:o=!0,fontSize:l={desktop:null,tablet:null,mobile:null},fontStyle:c,textTransform:u,textDecoration:d,lineHeight:h,letterSpace:p}=t||{},m=!i||!s||"Default"===s,g=l?.desktop||l,f=l?.tablet||g,y=l?.mobile||f,b=e=>{const t=String(e);return["px","em","rem","%","vh","vw"].some((e=>t.endsWith(e)))?t:"number"==typeof e?`${t}px`:""},v=`\n\t\t${m?"":`font-family: '${s}', ${n};`}\n\t\t${$t("font-weight",r)}\n\t\t${$t("font-size",b(g))}\n\t\t${$t("font-style",c)}\n\t\t${$t("text-transform",u)}\n\t\t${$t("text-decoration",d)}\n\t\t${$t("line-height",h)}\n\t\t${$t("letter-spacing",p)}\n\t`,w=a&&400!==a?"400i"===a?":ital@1":a?.includes("00i")?`: ital, wght@1, ${a?.replace("00i","00")} `:`: wght@${a} `:"",k=m?"":`https://fonts.googleapis.com/css2?family=${s?.split(" ").join("+")}${w.replace(/ /g,"")}&display=swap`;return{googleFontLink:!o||m?"":`@import url(${k});`,styles:`${e}{\n\t\t\t${v}\n\t\t}\n\t\t@media only screen and (max-width: 1024px) {\n\t\t\t${e}{\n\t\t\t\t${$t("font-size",b(f))}\n\t\t\t}\n\t\t}\n\t\t@media only screen and (max-width: 640px) {\n\t\t\t${e}{\n\t\t\t\t${$t("font-size",b(y))}\n\t\t\t}\n\t\t}`.replace(/\s+/g," ").trim()}},_t=({attributes:e,id:t})=>{const{hideOn:i={desktop:!1,tablet:!1,mobile:!1},isFullWidth:n,addCSS:a,alignment:r,typography:l,colors:u,hovColors:d,padding:h,border:p,shadow:m,buttonHover:g}=e,f=`#${t}`,y=`${f} .${o}`;return(0,c.jsx)("style",{dangerouslySetInnerHTML:{__html:`\n\t\t${It("",l)?.googleFontLink}\n\t\t${It(y,l)?.styles}\n\n\t\t${f}{\n\t\t\ttext-align: ${r};\n\t\t}\n\t\t${y}:not(.btnEditor){\n\t\t\tdisplay: ${i?.desktop?"none":"inline-flex"};\n\t\t}\n\t\t${y}.btnEditor{\n\t\t\topacity: ${i?.desktop?.8:1};\n\t\t}\n\t\t@media only screen and (max-width: 1024px) {\n\t\t\t${y}:not(.btnEditor){\n\t\t\t\tdisplay: ${i?.tablet?"none":"inline-flex"};\n\t\t\t}\n\t\t\t${y}.btnEditor{\n\t\t\t\topacity: ${i?.tablet?.8:1};\n\t\t\t}\n\t\t}\n\t\t@media only screen and (max-width: 640px) {\n\t\t\t${y}:not(.btnEditor){\n\t\t\t\tdisplay: ${i?.mobile?"none":"inline-flex"};\n\t\t\t}\n\t\t\t${y}.btnEditor{\n\t\t\t\topacity: ${i?.mobile?.8:1};\n\t\t\t}\n\t\t}\n\t\t${y}{\n\t\t\t${Mt(u)||"color: #fff; background-color: #146EF5;"}\n\t\t\twidth: ${n?"100%":"auto"};\n\t\t\tpadding: ${jt(h)||"10px 20px"};\n\t\t\t${Nt(p)||"border-radius: 5px;"}\n\t\t\tbox-shadow: ${Lt(m?.shadow||m)||"none"};\n\t\t}\n\t\t${y}:hover{\n\t\t\t${Mt(d)||"color: #fff; background-color: #FF7A00;"}\n\t\t\t${s(g?.shadow)?`box-shadow: ${Lt(g?.shadow)};`:""}\n\t\t\t${s(g?.border)?Nt(g?.border):""}\n\t\t\t${s(g?.padding)?`padding: ${jt(g?.padding)}`:""}\n\t\t}\n\t\t${a}\n\t\t`.replace(/\s+/g," ")}})},Ot=({isOpen:e,onClose:t,caption:i,children:s})=>e?(0,c.jsxs)("div",{className:"btnPopupWrap",onClick:()=>t(),children:[(0,c.jsx)("button",{className:"popupCloseBtn",onClick:()=>t(),children:(0,c.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"#fff",width:24,height:24,viewBox:"0 0 32 32",children:(0,c.jsx)("path",{d:"M17.769 16l9.016-9.016c0.226-0.226 0.366-0.539 0.366-0.884 0-0.691-0.56-1.251-1.251-1.251-0.346 0-0.658 0.14-0.885 0.367v0l-9.015 9.015-9.016-9.015c-0.226-0.226-0.539-0.366-0.884-0.366-0.69 0-1.25 0.56-1.25 1.25 0 0.345 0.14 0.658 0.366 0.884v0l9.015 9.016-9.015 9.015c-0.227 0.226-0.367 0.539-0.367 0.885 0 0.691 0.56 1.251 1.251 1.251 0.345 0 0.658-0.14 0.884-0.366v0l9.016-9.016 9.015 9.016c0.227 0.228 0.541 0.369 0.888 0.369 0.691 0 1.251-0.56 1.251-1.251 0-0.347-0.141-0.661-0.369-0.887l-0-0z"})})}),(0,c.jsxs)("div",{className:"popupContent",onClick:e=>e.stopPropagation(),children:[s,i&&(0,c.jsx)("p",{className:"popupCaption",dangerouslySetInnerHTML:{__html:a(i)}})]})]}):null;document.addEventListener("DOMContentLoaded",(()=>{document.querySelectorAll(".wp-block-b-blocks-button").forEach((e=>{const i=JSON.parse(e.dataset.nonce),s=JSON.parse(e.dataset.attributes),n=JSON.parse(e.dataset.info),{popup:a={}}=s,{content:r=""}=a;(0,t.createRoot)(e).render((0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(_t,{attributes:s,id:e.id}),(0,c.jsx)(Dt,{nonce:i,attributes:s,info:n,popupContent:(0,c.jsx)("div",{className:"content",dangerouslySetInnerHTML:{__html:r}})})]})),e?.removeAttribute("data-attributes"),e?.removeAttribute("data-nonce"),e?.removeAttribute("data-info")}))}));const Dt=({nonce:t,attributes:i,info:s,popupContent:o})=>{const{text:l,actionType:u,security:d="none",target:h,url:p,securityRole:m}=i,g=(0,e.useRef)(null),[f,y]=(0,e.useState)(!1),[b,v]=(0,e.useState)(!1),{isPremium:w}=r(t);return(0,e.useEffect)((()=>{window.AOS?.init()}),[]),(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(xt,{attributes:i,security:d,securityPass:f,setSecurityPass:y,securityPop:b,isPremium:w,Popup:f?Ot:null,popupContent:o,ref:g,onClick:e=>{"none"===d?"popup"===u?y(!0):(window.open(n(p),h),y(!1)):"login"==d?s.userRoles[0]===m||"default"===m?y(!0):v(e):("password"==d||"email"==d)&&v(e)},children:l&&(0,c.jsx)("span",{className:"btnText",dangerouslySetInnerHTML:{__html:a(l)}})}),b&&(0,c.jsx)(Rt,{attributes:i,info:s,setSecurityPop:v,setSecurityPass:y})]})},Rt=({attributes:t,info:i,setSecurityPass:s,setSecurityPop:a})=>{const{actionType:r,security:o="none",target:l,url:u,securityRole:d,securityPassword:h}=t,[p,m]=(0,e.useState)("Enter Password for Show Content"),[g,f]=(0,e.useState)(!0),[y,b]=(0,e.useState)(""),[v,w]=(0,e.useState)("");return(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)("div",{className:"securityPopup",children:["password"==o&&(0,c.jsx)("h2",{className:"popup_h2",children:g?p:(0,c.jsx)("span",{children:"Incorrect Password"})}),"login"==o&&(0,c.jsxs)("h2",{className:"popup_h2",children:["You have to login as ",(0,c.jsx)("span",{children:d})]}),"email"==o&&(0,c.jsx)("h2",{className:"popup_h2",children:g?"Enter Your Email here":(0,c.jsx)("span",{children:"We got an error try with a new email"})}),"password"==o&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("div",{className:"form-control",children:[(0,c.jsx)("label",{htmlFor:"passwordLabel",children:"Enter Password"}),(0,c.jsx)("input",{value:y,onChange:e=>{b(e.target.value)},type:"password",name:"password",id:"passwordLabel"})]}),(0,c.jsx)("button",{type:"button",onClick:()=>{y==h?("popup"===r?s(!0):(window.open(n(u),l),s(!1)),m("Correct Password"),f(!0)):(s(!1),m("Incorrect Password"),f(!1))},className:"button_ok password_button",children:"OK"})]}),"email"==o&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("div",{className:"form-control",children:[(0,c.jsx)("label",{htmlFor:"emailLabel",children:"Enter Email"}),(0,c.jsx)("input",{value:v,onChange:e=>{w(e.target.value)},type:"email",name:"email",id:"emailLabel"})]}),(0,c.jsx)("button",{type:"button",onClick:()=>{jQuery("#submitButton").prop("disabled",!0),f(!0),jQuery.ajax({type:"POST",url:RestScriptVars.endpoint,data:{action:"email_submit_from_user",email:v,postId:i.currentPostId},success(e){1==e.data.status?("popup"===r?s(!0):(window.open(n(u),l),s(!1)),a(!1),jQuery("#submitButton").prop("disabled",!1)):f(!1)},error(e,t,i){f(!1),jQuery("#submitButton").prop("disabled",!1)}})},id:"submitButton",className:"button_ok password_button",children:"Submit"})]}),"login"==o&&(0,c.jsx)("a",{href:i.loginURL,target:"_blank",className:"button_login",rel:"noreferrer",children:"Login"}),(0,c.jsx)("button",{type:"button",onClick:()=>a(!1),className:"close-overlay",children:(0,c.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"15",height:"15",viewBox:"0 0 384 512",fill:"currentColor",children:(0,c.jsx)("path",{d:"M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"})})})]})})}})()})(); |