diff --git a/public/js/bundle.js b/public/js/bundle.js index 802b2f3..a9d6f42 100644 --- a/public/js/bundle.js +++ b/public/js/bundle.js @@ -16,7 +16,7 @@ var t=Object.freeze({});function e(t){return null==t}function a(t){return null!= * * Copyright (C) 2018 Varun A P */ -!function(e,a){t.exports?t.exports=a():e.Toastify=a()}(hl,(function(t){var e=function(t){return new e.lib.init(t)};function a(t,e){return!(!t||"string"!=typeof e)&&!!(t.className&&t.className.trim().split(/\s+/gi).indexOf(e)>-1)}return e.lib=e.prototype={toastify:"1.8.0",constructor:e,init:function(t){return t||(t={}),this.options={},this.toastElement=null,this.options.text=t.text||"Hi there!",this.options.node=t.node,this.options.duration=0===t.duration?0:t.duration||3e3,this.options.selector=t.selector,this.options.callback=t.callback||function(){},this.options.destination=t.destination,this.options.newWindow=t.newWindow||!1,this.options.close=t.close||!1,this.options.gravity="bottom"===t.gravity?"toastify-bottom":"toastify-top",this.options.positionLeft=t.positionLeft||!1,this.options.position=t.position||"",this.options.backgroundColor=t.backgroundColor,this.options.avatar=t.avatar||"",this.options.className=t.className||"",this.options.stopOnFocus=void 0===t.stopOnFocus||t.stopOnFocus,this.options.onClick=t.onClick,this},buildToast:function(){if(!this.options)throw"Toastify is not initialized";var t=document.createElement("div");if(t.className="toastify on "+this.options.className,this.options.position?t.className+=" toastify-"+this.options.position:!0===this.options.positionLeft?(t.className+=" toastify-left",console.warn("Property `positionLeft` will be depreciated in further versions. Please use `position` instead.")):t.className+=" toastify-right",t.className+=" "+this.options.gravity,this.options.backgroundColor&&(t.style.background=this.options.backgroundColor),this.options.node&&this.options.node.nodeType===Node.ELEMENT_NODE)t.appendChild(this.options.node);else if(t.innerHTML=this.options.text,""!==this.options.avatar){var e=document.createElement("img");e.src=this.options.avatar,e.className="toastify-avatar","left"==this.options.position||!0===this.options.positionLeft?t.appendChild(e):t.insertAdjacentElement("beforeend",e)}if(!0===this.options.close){var a=document.createElement("span");a.innerHTML="✖",a.className="toast-close",a.addEventListener("click",function(t){t.stopPropagation(),this.removeElement(this.toastElement),window.clearTimeout(this.toastElement.timeOutValue)}.bind(this));var n=window.innerWidth>0?window.innerWidth:screen.width;("left"==this.options.position||!0===this.options.positionLeft)&&n>360?t.insertAdjacentElement("afterbegin",a):t.appendChild(a)}if(this.options.stopOnFocus&&this.options.duration>0){const e=this;t.addEventListener("mouseover",(function(e){window.clearTimeout(t.timeOutValue)})),t.addEventListener("mouseleave",(function(){t.timeOutValue=window.setTimeout((function(){e.removeElement(t)}),e.options.duration)}))}return void 0!==this.options.destination&&t.addEventListener("click",function(t){t.stopPropagation(),!0===this.options.newWindow?window.open(this.options.destination,"_blank"):window.location=this.options.destination}.bind(this)),"function"==typeof this.options.onClick&&void 0===this.options.destination&&t.addEventListener("click",function(t){t.stopPropagation(),this.options.onClick()}.bind(this)),t},showToast:function(){var t;if(this.toastElement=this.buildToast(),!(t=void 0===this.options.selector?document.body:document.getElementById(this.options.selector)))throw"Root element is not defined";return t.insertBefore(this.toastElement,t.firstChild),e.reposition(),this.options.duration>0&&(this.toastElement.timeOutValue=window.setTimeout(function(){this.removeElement(this.toastElement)}.bind(this),this.options.duration)),this},hideToast:function(){this.toastElement.timeOutValue&&clearTimeout(this.toastElement.timeOutValue),this.removeElement(this.toastElement)},removeElement:function(t){t.className=t.className.replace(" on",""),window.setTimeout(function(){this.options.node&&this.options.node.parentNode&&this.options.node.parentNode.removeChild(this.options.node),t.parentNode&&t.parentNode.removeChild(t),this.options.callback.call(t),e.reposition()}.bind(this),400)}},e.reposition=function(){for(var t,e={top:15,bottom:15},n={top:15,bottom:15},i={top:15,bottom:15},r=document.getElementsByClassName("toastify"),s=0;s0?window.innerWidth:screen.width)<=360?(r[s].style[t]=i[t]+"px",i[t]+=o+15):!0===a(r[s],"toastify-left")?(r[s].style[t]=e[t]+"px",e[t]+=o+15):(r[s].style[t]=n[t]+"px",n[t]+=o+15)}return this},e.lib.init.prototype=e.lib,e}))}));let gl={};const fl=function(t,e=null,a=!0,n=null){if(gl[n]){let i=gl[n],r=document.querySelectorAll(`div.toastify[toast_id=${n}]`);t&&r.forEach(e=>{e.querySelectorAll(".toast-message").forEach(e=>{e.innerHTML=t})}),e&&(e="loading"==e?'
':`${e}`,r.forEach(t=>{t.querySelectorAll(".toast-icon").forEach(t=>{t.innerHTML=e})})),null!==a&&a&&(r.forEach(t=>{t.classList.add("dismissable")}),setTimeout(()=>{i.hideToast(),delete gl[n]},3e3))}else{let i=ml({text:`${e=null==e?"":"loading"==e?'
':`${e}`}
${t}`,duration:a?3e3:0,gravity:"bottom",position:"left",className:a?"dismissable":"",onClick:function(){let t=!0;if(n){let e=document.querySelector(`div.toastify[toast_id=${n}]`).classList;e&&(t=-1!=Array.prototype.slice.call(e).indexOf("dismissable"))}i&&t&&(i.hideToast(),n&&delete gl[n])}}).showToast();n&&(gl[n]=i,i.toastElement.setAttribute("toast_id",n))}};Go.on("toast",t=>{const{msg:e,icon:a,dismiss:n,id:i}=t;fl(e,a||null,void 0===n||n,i||null)});const vl={components:{QueueItem:pl},data:()=>({cachedTabWidth:parseInt(localStorage.getItem("downloadTabWidth"))||300,queue:[],queueList:{},queueComplete:[]}),computed:{...Do({clientMode:"getClientMode"})},mounted(){Go.on("startDownload",this.startDownload),Go.on("startConversion",this.startConversion),Go.on("init_downloadQueue",this.initQueue),Go.on("addedToQueue",this.addToQueue),Go.on("updateQueue",this.updateQueue),Go.on("removedFromQueue",this.removeFromQueue),Go.on("finishDownload",this.finishDownload),Go.on("removedAllDownloads",this.removeAllDownloads),Go.on("removedFinishedDownloads",this.removedFinishedDownloads),"true"===localStorage.getItem("slimDownloads")&&this.$refs.list.classList.add("slim"),"true"===localStorage.getItem("downloadTabOpen")&&(this.$refs.container.classList.remove("tab_hidden"),this.setTabWidth(this.cachedTabWidth)),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",this.handleDrag)}),window.addEventListener("beforeunload",()=>{localStorage.setItem("downloadTabWidth",this.cachedTabWidth)})},methods:{...Po(["setErrors"]),onRemoveItem(t){Go.emit("removeFromQueue",t)},setTabWidth(t){void 0===t?(this.$refs.container.style.width="",this.$refs.list.style.width=""):(this.$refs.container.style.width=t+"px",this.$refs.list.style.width=t+"px")},initQueue(t){const{queue:e,queueComplete:a,currentItem:n,queueList:i,restored:r}=t;a.length&&a.forEach(t=>{i[t].silent=!0,this.addToQueue(i[t])}),n&&(i[n].silent=!0,this.addToQueue(i[n],!0)),e.forEach(t=>{i[t].silent=!0,this.addToQueue(i[t])}),r&&(fl(this.$t("toasts.queueRestored"),"done",!0,"restoring_queue"),Go.emit("queueRestored"))},addToQueue(t,e=!1){if(Array.isArray(t)){if(t.length>1)return t.forEach((t,e)=>{t.silent=!0,this.addToQueue(t)}),void fl(this.$t("toasts.addedMoreToQueue",{n:t.length}),"playlist_add_check");t=t[0]}this.$set(t,"current",e),this.$set(this.queueList,t.uuid,t);if(t.downloaded+t.failed==t.size){const e=-1==this.queueComplete.indexOf(t.uuid);this.$set(this.queueList[t.uuid],"status","download finished"),e&&this.queueComplete.push(t.uuid)}else{-1==this.queue.indexOf(t.uuid)&&this.queue.push(t.uuid)}(t.progress>0&&t.progress<100||e)&&this.startDownload(t.uuid),t.silent||fl(this.$t("toasts.addedToQueue",{item:t.title}),"playlist_add_check")},updateQueue(t){const{uuid:e,downloaded:a,failed:n,progress:i,conversion:r,error:s,data:o,errid:l}=t;e&&this.queue.indexOf(e)>-1&&(a&&this.queueList[e].downloaded++,n&&(this.queueList[e].failed++,this.queueList[e].errors.push({message:s,data:o,errid:l})),i&&(this.queueList[e].progress=i),r&&(this.queueList[e].conversion=r))},removeFromQueue(t){let e=this.queue.indexOf(t);e>-1&&(this.$delete(this.queue,e),this.$delete(this.queueList,t))},removeAllDownloads(t){if(this.queueComplete=[],t){this.queue=[t];let e=this.queueList[t];this.queueList={},this.queueList[t]=e}else this.queue=[],this.queueList={}},removedFinishedDownloads(){this.queueComplete.forEach(t=>{this.$delete(this.queueList,t)}),this.queueComplete=[]},toggleDownloadTab(t){this.setTabWidth(),this.$refs.container.style.transition="all 250ms ease-in-out";let e=this.$refs.container.classList.toggle("tab_hidden");e||this.setTabWidth(this.cachedTabWidth),localStorage.setItem("downloadTabOpen",!e)},cleanQueue(){Go.emit("removeFinishedDownloads")},cancelQueue(){Go.emit("cancelAllDownloads")},openDownloadsFolder(){Go.emit("openDownloadsFolder")},handleDrag(t){let e=window.innerWidth-t.pageX+2;e<250?e=250:e>500&&(e=500),this.cachedTabWidth=e,this.setTabWidth(e)},startDrag(){document.addEventListener("mousemove",this.handleDrag)},startDownload(t){this.$set(this.queueList[t],"status","downloading")},finishDownload(t){if(!(this.queue.indexOf(t)>-1))return;this.$set(this.queueList[t],"status","download finished"),fl(this.$t("toasts.finishDownload",{item:this.queueList[t].title}),"done");let e=this.queue.indexOf(t);e>-1&&(this.queue.splice(e,1),this.queueComplete.push(t)),this.queue.length<=0&&fl(this.$t("toasts.allDownloaded"),"done_all")},startConversion(t){this.$set(this.queueList[t],"status","converting"),this.$set(this.queueList[t],"conversion",0)},async showErrorsTab(t){await this.setErrors(t),this.$router.push({name:"Errors"})}}};var bl=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{ref:"container",staticClass:"tab_hidden",attrs:{id:"download_tab_container","data-label":t.$t("downloads"),"aria-label":"downloads"},on:{transitionend:function(e){t.$refs.container.style.transition=""}}},[a("div",{ref:"dragHandler",attrs:{id:"download_tab_drag_handler"},on:{mousedown:function(e){return e.preventDefault(),t.startDrag(e)}}}),t._v(" "),a("i",{ref:"toggler",staticClass:"material-icons download_bar_icon",attrs:{id:"toggle_download_tab",title:t.$t("globals.toggle_download_tab_hint")},on:{click:function(e){return e.preventDefault(),t.toggleDownloadTab(e)}}}),t._v(" "),a("div",{attrs:{id:"queue_buttons"}},[t.clientMode?a("i",{staticClass:"material-icons download_bar_icon",attrs:{id:"open_downloads_folder",title:t.$t("globals.open_downloads_folder")},on:{click:t.openDownloadsFolder}},[t._v("\n\t\t\tfolder_open\n\t\t")]):t._e(),t._v(" "),a("i",{staticClass:"material-icons download_bar_icon",attrs:{id:"clean_queue",title:t.$t("globals.clean_queue_hint")},on:{click:t.cleanQueue}},[t._v("\n\t\t\tclear_all\n\t\t")]),t._v(" "),a("i",{staticClass:"material-icons download_bar_icon",attrs:{id:"cancel_queue",title:t.$t("globals.cancel_queue_hint")},on:{click:t.cancelQueue}},[t._v("\n\t\t\tdelete_sweep\n\t\t")])]),t._v(" "),a("div",{ref:"list",attrs:{id:"download_list"}},t._l(t.queueList,(function(e){return a("QueueItem",{key:e.uuid,attrs:{"queue-item":e},on:{"show-errors":t.showErrorsTab,"remove-item":t.onRemoveItem}})})),1)])};bl._withStripped=!0;var yl=function(t,e,a,n,i,r,s,o){const l=("function"==typeof a?a.options:a)||{};l.__file="C:\\Users\\Roberto\\Dev\\repos\\deemix-pyweb\\webui\\src\\components\\TheDownloadTab.vue",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=n;{let t;if(e&&(t=function(t){e.call(this,s(t))}),void 0!==t)if(l.functional){const e=l.render;l.render=function(a,n){return t.call(n),e(a,n)}}else{const e=l.beforeCreate;l.beforeCreate=e?[].concat(e,t):[t]}}return l}({render:bl,staticRenderFns:[]},(function(t){t&&t("data-v-1c37475e_0",{source:"#download_tab_container[data-v-1c37475e] {\n height: 100vh;\n}\n\n/*# sourceMappingURL=TheDownloadTab.vue.map */",map:{version:3,sources:["C:\\Users\\Roberto\\Dev\\repos\\deemix-pyweb\\webui/C:\\Users\\Roberto\\Dev\\repos\\deemix-pyweb\\webui/C:\\Users\\Roberto\\Dev\\repos\\deemix-pyweb\\webui\\src\\components\\TheDownloadTab.vue","TheDownloadTab.vue"],names:[],mappings:"AAyDA;EACA,aAAA;AAAA;;ACvDA,6CAA6C",file:"TheDownloadTab.vue",sourcesContent:[null,"#download_tab_container {\n height: 100vh; }\n\n/*# sourceMappingURL=TheDownloadTab.vue.map */"]},media:void 0})}),vl,"data-v-1c37475e",!1,0,(function t(){const e=document.head||document.getElementsByTagName("head")[0],a=t.styles||(t.styles={}),n="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());return function(t,i){if(document.querySelector('style[data-vue-ssr-id~="'+t+'"]'))return;const r=n?i.media||"default":t,s=a[r]||(a[r]={ids:[],parts:[],element:void 0});if(!s.ids.includes(t)){let a=i.source,o=s.ids.length;if(s.ids.push(t),n&&(s.element=s.element||document.querySelector("style[data-group="+r+"]")),!s.element){const t=s.element=document.createElement("style");t.type="text/css",i.media&&t.setAttribute("media",i.media),n&&(t.setAttribute("data-group",r),t.setAttribute("data-next-index","0")),e.appendChild(t)}if(n&&(o=parseInt(s.element.getAttribute("data-next-index")),s.element.setAttribute("data-next-index",o+1)),s.element.styleSheet)s.parts.push(a),s.element.styleSheet.cssText=s.parts.filter(Boolean).join("\n");else{const t=document.createTextNode(a),e=s.element.childNodes;e[o]&&s.element.removeChild(e[o]),e.length?s.element.insertBefore(t,e[o]):s.element.appendChild(t)}}}}));const _l={data:()=>({lastTextSearch:""}),mounted(){document.addEventListener("keyup",t=>{"Backspace"==t.key&&t.ctrlKey&&t.shiftKey&&(this.$refs.searchbar.value="",this.$refs.searchbar.focus())})},methods:{test(){console.log("test passato")},async handleSearchBarKeyup(t){if(!(13===t.keyCode))return;let e=this.$refs.searchbar.value;if(""===e)return;let a=el(e),n=t.ctrlKey,i="Link Analyzer"===this.$route.name,r="Search"===this.$route.name,s=e===this.lastTextSearch;if(a)n?this.$root.$emit("QualityModal:open",e):i?Go.emit("analyzeLink",e):Ho.sendAddToQueue(e);else{if(r&&s)return void this.$root.$emit("mainSearch:updateResults",e);r||await this.$router.push({name:"Search"}),s||(this.$root.$emit("updateSearchLoadingState",!0),this.lastTextSearch=e),this.$root.$emit("mainSearch:showNewResults",e,window.main_selected)}}}};var kl=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("header",{attrs:{id:"search","aria-label":"searchbar"}},[t._m(0),t._v(" "),a("input",{ref:"searchbar",attrs:{id:"searchbar",autocomplete:"off",type:"search",name:"searchbar",value:"",placeholder:t.$t("searchbar"),autofocus:""},on:{keyup:function(e){return t.handleSearchBarKeyup(e)}}})])};kl._withStripped=!0;var Al=function(t,e,a,n,i,r,s,o){const l=("function"==typeof a?a.options:a)||{};l.__file="C:\\Users\\Roberto\\Dev\\repos\\deemix-pyweb\\webui\\src\\components\\TheSearchBar.vue",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=n;{let t;if(e&&(t=function(t){e.call(this,s(t))}),void 0!==t)if(l.functional){const e=l.render;l.render=function(a,n){return t.call(n),e(a,n)}}else{const e=l.beforeCreate;l.beforeCreate=e?[].concat(e,t):[t]}}return l}({render:kl,staticRenderFns:[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"search__icon"},[e("i",{staticClass:"material-icons"},[this._v("search")])])}]},(function(t){t&&t("data-v-3fd2937c_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"TheSearchBar.vue"},media:void 0})}),_l,void 0,!1,0,(function t(){const e=document.head||document.getElementsByTagName("head")[0],a=t.styles||(t.styles={}),n="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());return function(t,i){if(document.querySelector('style[data-vue-ssr-id~="'+t+'"]'))return;const r=n?i.media||"default":t,s=a[r]||(a[r]={ids:[],parts:[],element:void 0});if(!s.ids.includes(t)){let a=i.source,o=s.ids.length;if(s.ids.push(t),n&&(s.element=s.element||document.querySelector("style[data-group="+r+"]")),!s.element){const t=s.element=document.createElement("style");t.type="text/css",i.media&&t.setAttribute("media",i.media),n&&(t.setAttribute("data-group",r),t.setAttribute("data-next-index","0")),e.appendChild(t)}if(n&&(o=parseInt(s.element.getAttribute("data-next-index")),s.element.setAttribute("data-next-index",o+1)),s.element.styleSheet)s.parts.push(a),s.element.styleSheet.cssText=s.parts.filter(Boolean).join("\n");else{const t=document.createTextNode(a),e=s.element.childNodes;e[o]&&s.element.removeChild(e[o]),e.length?s.element.insertBefore(t,e[o]):s.element.appendChild(t)}}}}));const wl={components:{BaseLoadingPlaceholder:Xo},data:()=>({performScrolledSearch:!1,loading:!1}),mounted(){this.$root.$on("updateSearchLoadingState",t=>{this.loading=t}),this.$router.beforeEach((t,e,a)=>{this.$refs.content.scrollTo(0,0),a()})},methods:{handleContentScroll:il((async function(){this.$refs.content.scrollTop+this.$refs.content.clientHeight-1)}return e.lib=e.prototype={toastify:"1.8.0",constructor:e,init:function(t){return t||(t={}),this.options={},this.toastElement=null,this.options.text=t.text||"Hi there!",this.options.node=t.node,this.options.duration=0===t.duration?0:t.duration||3e3,this.options.selector=t.selector,this.options.callback=t.callback||function(){},this.options.destination=t.destination,this.options.newWindow=t.newWindow||!1,this.options.close=t.close||!1,this.options.gravity="bottom"===t.gravity?"toastify-bottom":"toastify-top",this.options.positionLeft=t.positionLeft||!1,this.options.position=t.position||"",this.options.backgroundColor=t.backgroundColor,this.options.avatar=t.avatar||"",this.options.className=t.className||"",this.options.stopOnFocus=void 0===t.stopOnFocus||t.stopOnFocus,this.options.onClick=t.onClick,this},buildToast:function(){if(!this.options)throw"Toastify is not initialized";var t=document.createElement("div");if(t.className="toastify on "+this.options.className,this.options.position?t.className+=" toastify-"+this.options.position:!0===this.options.positionLeft?(t.className+=" toastify-left",console.warn("Property `positionLeft` will be depreciated in further versions. Please use `position` instead.")):t.className+=" toastify-right",t.className+=" "+this.options.gravity,this.options.backgroundColor&&(t.style.background=this.options.backgroundColor),this.options.node&&this.options.node.nodeType===Node.ELEMENT_NODE)t.appendChild(this.options.node);else if(t.innerHTML=this.options.text,""!==this.options.avatar){var e=document.createElement("img");e.src=this.options.avatar,e.className="toastify-avatar","left"==this.options.position||!0===this.options.positionLeft?t.appendChild(e):t.insertAdjacentElement("beforeend",e)}if(!0===this.options.close){var a=document.createElement("span");a.innerHTML="✖",a.className="toast-close",a.addEventListener("click",function(t){t.stopPropagation(),this.removeElement(this.toastElement),window.clearTimeout(this.toastElement.timeOutValue)}.bind(this));var n=window.innerWidth>0?window.innerWidth:screen.width;("left"==this.options.position||!0===this.options.positionLeft)&&n>360?t.insertAdjacentElement("afterbegin",a):t.appendChild(a)}if(this.options.stopOnFocus&&this.options.duration>0){const e=this;t.addEventListener("mouseover",(function(e){window.clearTimeout(t.timeOutValue)})),t.addEventListener("mouseleave",(function(){t.timeOutValue=window.setTimeout((function(){e.removeElement(t)}),e.options.duration)}))}return void 0!==this.options.destination&&t.addEventListener("click",function(t){t.stopPropagation(),!0===this.options.newWindow?window.open(this.options.destination,"_blank"):window.location=this.options.destination}.bind(this)),"function"==typeof this.options.onClick&&void 0===this.options.destination&&t.addEventListener("click",function(t){t.stopPropagation(),this.options.onClick()}.bind(this)),t},showToast:function(){var t;if(this.toastElement=this.buildToast(),!(t=void 0===this.options.selector?document.body:document.getElementById(this.options.selector)))throw"Root element is not defined";return t.insertBefore(this.toastElement,t.firstChild),e.reposition(),this.options.duration>0&&(this.toastElement.timeOutValue=window.setTimeout(function(){this.removeElement(this.toastElement)}.bind(this),this.options.duration)),this},hideToast:function(){this.toastElement.timeOutValue&&clearTimeout(this.toastElement.timeOutValue),this.removeElement(this.toastElement)},removeElement:function(t){t.className=t.className.replace(" on",""),window.setTimeout(function(){this.options.node&&this.options.node.parentNode&&this.options.node.parentNode.removeChild(this.options.node),t.parentNode&&t.parentNode.removeChild(t),this.options.callback.call(t),e.reposition()}.bind(this),400)}},e.reposition=function(){for(var t,e={top:15,bottom:15},n={top:15,bottom:15},i={top:15,bottom:15},r=document.getElementsByClassName("toastify"),s=0;s0?window.innerWidth:screen.width)<=360?(r[s].style[t]=i[t]+"px",i[t]+=o+15):!0===a(r[s],"toastify-left")?(r[s].style[t]=e[t]+"px",e[t]+=o+15):(r[s].style[t]=n[t]+"px",n[t]+=o+15)}return this},e.lib.init.prototype=e.lib,e}))}));let gl={};const fl=function(t,e=null,a=!0,n=null){if(gl[n]){let i=gl[n],r=document.querySelectorAll(`div.toastify[toast_id=${n}]`);t&&r.forEach(e=>{e.querySelectorAll(".toast-message").forEach(e=>{e.innerHTML=t})}),e&&(e="loading"==e?'
':`${e}`,r.forEach(t=>{t.querySelectorAll(".toast-icon").forEach(t=>{t.innerHTML=e})})),null!==a&&a&&(r.forEach(t=>{t.classList.add("dismissable")}),setTimeout(()=>{i.hideToast(),delete gl[n]},3e3))}else{let i=ml({text:`${e=null==e?"":"loading"==e?'
':`${e}`}
${t}`,duration:a?3e3:0,gravity:"bottom",position:"left",className:a?"dismissable":"",onClick:function(){let t=!0;if(n){let e=document.querySelector(`div.toastify[toast_id=${n}]`).classList;e&&(t=-1!=Array.prototype.slice.call(e).indexOf("dismissable"))}i&&t&&(i.hideToast(),n&&delete gl[n])}}).showToast();n&&(gl[n]=i,i.toastElement.setAttribute("toast_id",n))}};Go.on("toast",t=>{const{msg:e,icon:a,dismiss:n,id:i}=t;fl(e,a||null,void 0===n||n,i||null)});const vl={components:{QueueItem:pl},data:()=>({cachedTabWidth:parseInt(localStorage.getItem("downloadTabWidth"))||300,queue:[],queueList:{},queueComplete:[]}),computed:{...Do({clientMode:"getClientMode"})},mounted(){Go.on("startDownload",this.startDownload),Go.on("startConversion",this.startConversion),Go.on("init_downloadQueue",this.initQueue),Go.on("addedToQueue",this.addToQueue),Go.on("updateQueue",this.updateQueue),Go.on("removedFromQueue",this.removeFromQueue),Go.on("finishDownload",this.finishDownload),Go.on("removedAllDownloads",this.removeAllDownloads),Go.on("removedFinishedDownloads",this.removedFinishedDownloads),"true"===localStorage.getItem("slimDownloads")&&this.$refs.list.classList.add("slim"),"true"===localStorage.getItem("downloadTabOpen")&&(this.$refs.container.classList.remove("tab_hidden"),this.setTabWidth(this.cachedTabWidth)),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",this.handleDrag)}),window.addEventListener("beforeunload",()=>{localStorage.setItem("downloadTabWidth",this.cachedTabWidth)})},methods:{...Po(["setErrors"]),onRemoveItem(t){Go.emit("removeFromQueue",t)},setTabWidth(t){void 0===t?(this.$refs.container.style.width="",this.$refs.list.style.width=""):(this.$refs.container.style.width=t+"px",this.$refs.list.style.width=t+"px")},initQueue(t){const{queue:e,queueComplete:a,currentItem:n,queueList:i,restored:r}=t;a.length&&a.forEach(t=>{i[t].silent=!0,this.addToQueue(i[t])}),n&&(i[n].silent=!0,this.addToQueue(i[n],!0)),e.forEach(t=>{i[t].silent=!0,this.addToQueue(i[t])}),r&&(fl(this.$t("toasts.queueRestored"),"done",!0,"restoring_queue"),Go.emit("queueRestored"))},addToQueue(t,e=!1){if(Array.isArray(t)){if(t.length>1)return t.forEach((t,e)=>{t.silent=!0,this.addToQueue(t)}),void fl(this.$t("toasts.addedMoreToQueue",{n:t.length}),"playlist_add_check");t=t[0]}this.$set(t,"current",e),this.$set(this.queueList,t.uuid,t);if(t.downloaded+t.failed==t.size){const e=-1==this.queueComplete.indexOf(t.uuid);this.$set(this.queueList[t.uuid],"status","download finished"),e&&this.queueComplete.push(t.uuid)}else{-1==this.queue.indexOf(t.uuid)&&this.queue.push(t.uuid)}(t.progress>0&&t.progress<100||e)&&this.startDownload(t.uuid),t.silent||fl(this.$t("toasts.addedToQueue",{item:t.title}),"playlist_add_check")},updateQueue(t){const{uuid:e,downloaded:a,failed:n,progress:i,conversion:r,error:s,data:o,errid:l}=t;e&&this.queue.indexOf(e)>-1&&(a&&this.queueList[e].downloaded++,n&&(this.queueList[e].failed++,this.queueList[e].errors.push({message:s,data:o,errid:l})),i&&(this.queueList[e].progress=i),r&&(this.queueList[e].conversion=r))},removeFromQueue(t){let e=this.queue.indexOf(t);e>-1&&(this.$delete(this.queue,e),this.$delete(this.queueList,t))},removeAllDownloads(t){if(this.queueComplete=[],t){this.queue=[t];let e=this.queueList[t];this.queueList={},this.queueList[t]=e}else this.queue=[],this.queueList={}},removedFinishedDownloads(){this.queueComplete.forEach(t=>{this.$delete(this.queueList,t)}),this.queueComplete=[]},toggleDownloadTab(t){this.setTabWidth(),this.$refs.container.style.transition="all 250ms ease-in-out";let e=this.$refs.container.classList.toggle("tab_hidden");e||this.setTabWidth(this.cachedTabWidth),localStorage.setItem("downloadTabOpen",!e)},cleanQueue(){Go.emit("removeFinishedDownloads")},cancelQueue(){Go.emit("cancelAllDownloads")},openDownloadsFolder(){Go.emit("openDownloadsFolder")},handleDrag(t){let e=window.innerWidth-t.pageX+2;e<250?e=250:e>500&&(e=500),this.cachedTabWidth=e,this.setTabWidth(e)},startDrag(){document.addEventListener("mousemove",this.handleDrag)},startDownload(t){this.$set(this.queueList[t],"status","downloading")},finishDownload(t){if(!(this.queue.indexOf(t)>-1))return;this.$set(this.queueList[t],"status","download finished"),fl(this.$t("toasts.finishDownload",{item:this.queueList[t].title}),"done");let e=this.queue.indexOf(t);e>-1&&(this.queue.splice(e,1),this.queueComplete.push(t)),this.queue.length<=0&&fl(this.$t("toasts.allDownloaded"),"done_all")},startConversion(t){this.$set(this.queueList[t],"status","converting"),this.$set(this.queueList[t],"conversion",0)},async showErrorsTab(t){await this.setErrors(t),this.$router.push({name:"Errors"})}}};var bl=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{ref:"container",staticClass:"tab_hidden",attrs:{id:"download_tab_container","data-label":t.$t("downloads"),"aria-label":"downloads"},on:{transitionend:function(e){t.$refs.container.style.transition=""}}},[a("div",{ref:"dragHandler",attrs:{id:"download_tab_drag_handler"},on:{mousedown:function(e){return e.preventDefault(),t.startDrag(e)}}}),t._v(" "),a("i",{ref:"toggler",staticClass:"material-icons download_bar_icon",attrs:{id:"toggle_download_tab",title:t.$t("globals.toggle_download_tab_hint")},on:{click:function(e){return e.preventDefault(),t.toggleDownloadTab(e)}}}),t._v(" "),a("div",{attrs:{id:"queue_buttons"}},[t.clientMode?a("i",{staticClass:"material-icons download_bar_icon",attrs:{id:"open_downloads_folder",title:t.$t("globals.open_downloads_folder")},on:{click:t.openDownloadsFolder}},[t._v("\n\t\t\tfolder_open\n\t\t")]):t._e(),t._v(" "),a("i",{staticClass:"material-icons download_bar_icon",attrs:{id:"clean_queue",title:t.$t("globals.clean_queue_hint")},on:{click:t.cleanQueue}},[t._v("\n\t\t\tclear_all\n\t\t")]),t._v(" "),a("i",{staticClass:"material-icons download_bar_icon",attrs:{id:"cancel_queue",title:t.$t("globals.cancel_queue_hint")},on:{click:t.cancelQueue}},[t._v("\n\t\t\tdelete_sweep\n\t\t")])]),t._v(" "),a("div",{ref:"list",attrs:{id:"download_list"}},t._l(t.queueList,(function(e){return a("QueueItem",{key:e.uuid,attrs:{"queue-item":e},on:{"show-errors":t.showErrorsTab,"remove-item":t.onRemoveItem}})})),1)])};bl._withStripped=!0;var yl=function(t,e,a,n,i,r,s,o){const l=("function"==typeof a?a.options:a)||{};l.__file="C:\\Users\\Roberto\\Dev\\repos\\deemix-pyweb\\webui\\src\\components\\TheDownloadTab.vue",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=n;{let t;if(e&&(t=function(t){e.call(this,s(t))}),void 0!==t)if(l.functional){const e=l.render;l.render=function(a,n){return t.call(n),e(a,n)}}else{const e=l.beforeCreate;l.beforeCreate=e?[].concat(e,t):[t]}}return l}({render:bl,staticRenderFns:[]},(function(t){t&&t("data-v-1c37475e_0",{source:"#download_tab_container[data-v-1c37475e] {\n height: 100vh;\n}\n\n/*# sourceMappingURL=TheDownloadTab.vue.map */",map:{version:3,sources:["C:\\Users\\Roberto\\Dev\\repos\\deemix-pyweb\\webui/C:\\Users\\Roberto\\Dev\\repos\\deemix-pyweb\\webui/C:\\Users\\Roberto\\Dev\\repos\\deemix-pyweb\\webui\\src\\components\\TheDownloadTab.vue","TheDownloadTab.vue"],names:[],mappings:"AAyDA;EACA,aAAA;AAAA;;ACvDA,6CAA6C",file:"TheDownloadTab.vue",sourcesContent:[null,"#download_tab_container {\n height: 100vh; }\n\n/*# sourceMappingURL=TheDownloadTab.vue.map */"]},media:void 0})}),vl,"data-v-1c37475e",!1,0,(function t(){const e=document.head||document.getElementsByTagName("head")[0],a=t.styles||(t.styles={}),n="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());return function(t,i){if(document.querySelector('style[data-vue-ssr-id~="'+t+'"]'))return;const r=n?i.media||"default":t,s=a[r]||(a[r]={ids:[],parts:[],element:void 0});if(!s.ids.includes(t)){let a=i.source,o=s.ids.length;if(s.ids.push(t),n&&(s.element=s.element||document.querySelector("style[data-group="+r+"]")),!s.element){const t=s.element=document.createElement("style");t.type="text/css",i.media&&t.setAttribute("media",i.media),n&&(t.setAttribute("data-group",r),t.setAttribute("data-next-index","0")),e.appendChild(t)}if(n&&(o=parseInt(s.element.getAttribute("data-next-index")),s.element.setAttribute("data-next-index",o+1)),s.element.styleSheet)s.parts.push(a),s.element.styleSheet.cssText=s.parts.filter(Boolean).join("\n");else{const t=document.createTextNode(a),e=s.element.childNodes;e[o]&&s.element.removeChild(e[o]),e.length?s.element.insertBefore(t,e[o]):s.element.appendChild(t)}}}}));const _l={data:()=>({lastTextSearch:""}),mounted(){document.addEventListener("keyup",t=>{"Backspace"==t.key&&t.ctrlKey&&t.shiftKey&&(this.$refs.searchbar.value="",this.$refs.searchbar.focus())})},methods:{test(){console.log("test passato")},async handleSearchBarKeyup(t){if(!(13===t.keyCode))return;let e=this.$refs.searchbar.value;if(""===e)return;let a=el(e),n=t.ctrlKey,i="Link Analyzer"===this.$route.name,r="Search"===this.$route.name,s=e===this.lastTextSearch;if(a)n?this.$root.$emit("QualityModal:open",e):i?Go.emit("analyzeLink",e):Ho.sendAddToQueue(e);else{if(r&&s)return void this.$root.$emit("mainSearch:updateResults",e);r||await this.$router.push({name:"Search"}),s||(this.$root.$emit("updateSearchLoadingState",!0),this.lastTextSearch=e),this.$root.$emit("mainSearch:showNewResults",e,window.main_selected)}}}};var kl=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("header",{attrs:{id:"search","aria-label":"searchbar"}},[t._m(0),t._v(" "),a("input",{ref:"searchbar",attrs:{id:"searchbar",autocomplete:"off",type:"search",name:"searchbar",value:"",placeholder:t.$t("searchbar"),autofocus:""},on:{keyup:function(e){return t.handleSearchBarKeyup(e)}}})])};kl._withStripped=!0;var Al=function(t,e,a,n,i,r,s,o){const l=("function"==typeof a?a.options:a)||{};l.__file="C:\\Users\\Roberto\\Dev\\repos\\deemix-pyweb\\webui\\src\\components\\TheSearchBar.vue",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=n;{let t;if(e&&(t=function(t){e.call(this,s(t))}),void 0!==t)if(l.functional){const e=l.render;l.render=function(a,n){return t.call(n),e(a,n)}}else{const e=l.beforeCreate;l.beforeCreate=e?[].concat(e,t):[t]}}return l}({render:kl,staticRenderFns:[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"search__icon"},[e("i",{staticClass:"material-icons"},[this._v("search")])])}]},(function(t){t&&t("data-v-3fd2937c_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"TheSearchBar.vue"},media:void 0})}),_l,void 0,!1,0,(function t(){const e=document.head||document.getElementsByTagName("head")[0],a=t.styles||(t.styles={}),n="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());return function(t,i){if(document.querySelector('style[data-vue-ssr-id~="'+t+'"]'))return;const r=n?i.media||"default":t,s=a[r]||(a[r]={ids:[],parts:[],element:void 0});if(!s.ids.includes(t)){let a=i.source,o=s.ids.length;if(s.ids.push(t),n&&(s.element=s.element||document.querySelector("style[data-group="+r+"]")),!s.element){const t=s.element=document.createElement("style");t.type="text/css",i.media&&t.setAttribute("media",i.media),n&&(t.setAttribute("data-group",r),t.setAttribute("data-next-index","0")),e.appendChild(t)}if(n&&(o=parseInt(s.element.getAttribute("data-next-index")),s.element.setAttribute("data-next-index",o+1)),s.element.styleSheet)s.parts.push(a),s.element.styleSheet.cssText=s.parts.filter(Boolean).join("\n");else{const t=document.createTextNode(a),e=s.element.childNodes;e[o]&&s.element.removeChild(e[o]),e.length?s.element.insertBefore(t,e[o]):s.element.appendChild(t)}}}}));const wl={components:{BaseLoadingPlaceholder:Xo},data:()=>({performScrolledSearch:!1,loading:!1}),mounted(){this.$root.$on("updateSearchLoadingState",t=>{this.loading=t}),this.$router.beforeEach((t,e,a)=>{this.$refs.content.scrollTo(0,0),a()})},methods:{handleContentScroll:il((async function(){this.$refs.content.scrollTop+this.$refs.content.clientHeight