(()=>{"use strict";classe{constructor(){this.query_selector="#poping-notice",this.closePopingNotice.addEventListener("click",(e=>{this.setVisible(!1)}))}setVisible(e){e?this.element.classList.add("active"):this.element.classList.remove("active")}setMessage(e){if(!einstanceofArray)throw"Message is not instance of Array.";lett=document.createElement("p");for(letoofe)if("string"==typeofo||oinstanceofString)o=document.createTextNode(o),t.appendChild(o);else{if(!(oinstanceofNode))throw"Node is not a instance of Node nor a String";t.appendChild(o)}this.popingNoticeContent.innerHTML="",this.popingNoticeContent.appendChild(t)}getquerySelector(){returnthis.query_selector}getelement(){returndocument.querySelector(this.querySelector)}getpopingNoticeContent(){returnthis.element.querySelector("#poping-notice-content")}getclosePopingNotice(){returnthis.element.querySelector("#close-poping-notice")}}classt{constructor(e){this.query_selector="#download-form",this.callback=t=>{t.preventDefault(),e(this.downloadFormUrl.value)},this.addEventListeners()}addEventListeners(){this.downloadFormButton.addEventListener("click",this.callback),this.element.addEventListener("submit",this.callback)}getdownloadFormButton(){returnthis.element.querySelector("#download-form-button")}getdownloadFormUrl(){returnthis.element.querySelector("#download-form-url")}getquerySelector(){returnthis.query_selector}getelement(){returndocument.querySelector(this.querySelector)}}classo{constructor(){this.query_selector="#modal-loading"}setVisible(e){e?this.element.classList.add("active"):this.element.classList.remove("active")}getelement(){returndocument.querySelector(this.querySelector)}getquerySelector(){returnthis.query_selector}}classi{constructor(){this.query_selector="#modal-video-container",this.addEventListeners()}setVisible(e){e?this.element.classList.add("active"):(this.element.classList.remove("active"),this.downloadVideoPrepare.classList.add("active"),this.downloadVideoLoading.classList.remove("active"),this.downloadVideo.classList.remove("active"))}addEventListeners(){this.downloadVideoPrepare.addEventListener("click",this.downloadPrepareHandler.bind(this)),this.closeAndResetVideoContainer.addEventListener("click",(e=>{this.setVisible(!1)}))}downloadPrepareHandler(e){this.downloadVideoPrepare.classList.remove("active"),this.downloadVideoLoading.classList.add("active"),this.generateBlobVideo(this.URLVideo).then((e=>{this.downloadVideo.href=URL.createObjectURL(e),this.downloadVideo.download=this.filename,this.downloadVideoLoading.classList.remove("active"),this.downloadVideo.classList.add("active")}))}asyncgenerateBlobVideo(e){returnawaitfetch(e,{mode:"cors"}).then((e=>e.blob())).catch((t=>this.generateBlobVideoByProxy(e)))}asyncgenerateBlobVideoByProxy(e){returnawaitfetch("/proxy_to_get",{method:"POST",mode:"cors",cache:"no-cache",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:e})}).then((e=>e.blob()))}onCanPlay(e){video.addEventListener("canplay",(t=>{e()}))}setURLVideo(e){this.url_video=e,video.src=e}setFilename(e){this.filename=e}getcloseAndResetVideoContainer(){returnthis.element.querySelector("#close-and-reset-video-container")}getdownloadVideo(){returnthis.element.querySelector("#download-video")}getURLVideo(){returnthis.url_video}getcloseAndResetVideoContainer(){returnthis.element.querySelector("#close-and-reset-video-container")}getdownloadVideoLoading(){returnthis.element.querySelector("#download-video-loading")}getdownloadVideoPrepare(){returnthis.element.querySelector("#download-video-prepare")}getvideo(){returnthis.element.querySelector("#video")}getelement(){returndocument.querySelector(this.querySelector)}getquerySelector(){returnthis.query_selector}}classr{constructor(){this.query_selector="#modal-format-selector",this.addEventListeners()}appendFormat(e,t,o,i){letr=document.createElement("a");r.innerText=o?"Id: "+t.id+"\nFormat: "+t.mimeType+"\nQualityLabel: "+t.qualityLabel+"p\nBitrate: "+t.bitrate+"\n"+(void0!==t.audioSampleRate?"AudioSampleRate: "+t.audioSa