1jQuery(function(e){new DLM_XHR_Download});class DLM_XHR_Download{responsHeaders={};constructor(){(dlmXHRinstance=this).init()}init(){dlmXHRinstance.attachButtonEvent()}attachButtonEvent(){jQuery("html,body").on("click",".dlm-no-access-modal-window > div",function(e){e.stopPropagation()}),jQuery("html, body").on("click",".dlm-no-access-modal-overlay, .dlm-no-access-modal-close, .dlm-no-access-modal-window",function(e){e.stopPropagation(),jQuery("#dlm-no-access-modal").remove()}),jQuery(document).on("keydown",function(e){"Escape"===e.key&&jQuery("#dlm-no-access-modal").remove()}),jQuery("html, body").on("click","a",function(e){const d=jQuery(this).attr("href");let o=!1;var r,s;jQuery(this).hasClass("dlm-no-xhr-download")&&(o=!0),"undefined"!=typeof dlmNonXHRGlobalLinks&&0<dlmNonXHRGlobalLinks.length&&void 0!==d&&dlmNonXHRGlobalLinks.forEach(e=>{0<=d.indexOf(e)&&(o=!0)}),o?jQuery("#dlm-no-access-modal").remove():(jQuery(document).trigger("dlm-xhr-download-button-click",[d,this,dlmXHRGlobalLinks]),void 0!==d&&0<=d.indexOf(dlmXHRGlobalLinks)&&(r=jQuery(this).data("redirect"),s=jQuery(this).attr("target"),void 0!==r&&!0===r&&"_blank"===s||dlmXHRinstance.handleDownloadClick(this,e)))})}handleDownloadClick(e,d){d.stopPropagation();var o=e.getAttribute("href");let r={button:e,href:o,buttonObj:jQuery(e)};-1===r.href.indexOf("blob:http")&&"#"!==r.href&&(d.preventDefault(),dlmXHRinstance.retrieveBlob(r))}retrieveBlob(e){const f=this;let{button:h,href:x,buttonObj:w}=e,H;const g=new XMLHttpRequest,b=dlmXHR.prevent_duplicates,R=w.attr("target");let y=w.attr("class");y=void 0!==y&&""!==y?y.replace("dlm-download-started","").replace("dlm-download-completed",""):"",w.addClass("dlm-download-started"),h.setAttribute("href","#"),h.removeAttribute("download"),h.setAttribute("disabled","disabled"),dlmXHRProgress&&(e='<img src="'+dlmXHRgif+'" class="dlm-xhr-loading-gif" style="display:inline-block; vertical-align: middle; margin-left:15px;">',h.innerHTML+=e),jQuery(document).trigger("dlm_download_triggered",[this,h,w,H,g]);let X=!1;g.responseType="blob",g.onreadystatechange=function(){var{status:e,readyState:d,statusText:o}=g,r=g.getAllResponseHeaders().split("\r\n").reduce((e,d)=>{var[d,o]=d.split(": ");return e[d]=o,e},{});1<Object.keys(r).length&&(X=!0,f.responseHeaders=r);let s="download",n=!1,t=!1,l=!1,a=!1,i=null,m=!1,c=!1,p=!1,v=!1,u=!1;if(X&&void 0!==f.responseHeaders["dlm-file-name"]&&(n=f.responseHeaders["dlm-file-name"]),X&&void 0!==f.responseHeaders["dlm-no-waypoints"]&&(t=!0),X&&void 0!==f.responseHeaders["dlm-redirect"]&&(l=f.responseHeaders["dlm-redirect"]),X&&void 0!==f.responseHeaders["dlm-external-download"]&&(a=!0),X&&void 0!==f.responseHeaders["dlm-no-access"]&&(i=f.responseHeaders["dlm-no-access"]),X&&void 0!==f.responseHeaders["dlm-no-access-modal"]&&(m=f.responseHeaders["dlm-no-access-modal"]),X&&void 0!==f.responseHeaders["dlm-error"]&&(c=f.responseHeaders["dlm-error"]),X&&void 0!==f.responseHeaders["dlm-download-id"]&&(p=f.responseHeaders["dlm-download-id"]),X&&void 0!==f.responseHeaders["dlm-version-id"]&&(v=f.responseHeaders["dlm-version-id"]),X&&void 0!==f.responseHeaders["dlm-no-access-modal-text"]&&(u=f.responseHeaders["dlm-no-access-modal-text"]),X&&void 0!==f.responseHeaders["x-dlm-file-name"]&&(n=f.responseHeaders["x-dlm-file-name"]),X&&void 0!==f.responseHeaders["x-dlm-no-waypoints"]&&(t=!0),X&&void 0!==f.responseHeaders["x-dlm-redirect"]&&(l=f.responseHeaders["x-dlm-redirect"]),X&&void 0!==f.responseHeaders["x-dlm-external-download"]&&(a=!0),X&&void 0!==f.responseHeaders["x-dlm-no-access"]&&(i=f.responseHeaders["x-dlm-no-access"]),X&&void 0!==f.responseHeaders["x-dlm-no-access-modal"]&&(m=f.responseHeaders["x-dlm-no-access-modal"]),X&&void 0!==f.responseHeaders["x-dlm-error"]&&(c=f.responseHeaders["x-dlm-error"]),X&&void 0!==f.responseHeaders["x-dlm-download-id"]&&(p=f.responseHeaders["x-dlm-download-id"]),X&&void 0!==f.responseHeaders["x-dlm-version-id"]&&(v=f.responseHeaders["x-dlm-version-id"]),X&&void 0!==f.responseHeaders["x-dlm-no-access-modal-text"]&&(u=f.responseHeaders["x-dlm-no-access-modal-text"]),n?(s=n.replace(/\"/g,"").replace(";",""),s=decodeURI(s)):X&&void 0!==f.responseHeaders["content-disposition"]&&(s=(s=f.responseHeaders["content-disposition"].split(/(?:filename\*=UTF-8'')|(?:filename=)/)[1]).replace(/\"/g,"").replace(";",""),s=decodeURI(s)),c=c&&(c in dlmXHRtranslations?dlmXHRtranslations[c]:dlmXHRtranslations.error),2===g.readyState){if(X&&void 0!==f.responseHeaders["x-dlm-force-abort"]&&""!==f.responseHeaders["x-dlm-force-abort"])return h.removeAttribute("download"),h.setAttribute("href",x),w.removeClass().addClass(y).find("span.dlm-xhr-progress").remove(),w.find(".dlm-xhr-loading-gif").remove(),g.abort(),void jQuery("#dlm-no-access-modal").remove();if(t)return g.abort(),l?void(window.location.href=l):void(window.location.href=x);if(a)return g.abort(),void dlmXHRinstance.dlmExternalDownload(f.responseHeaders,h,w,s,x);if(0===Object.keys(f.responseHeaders).filter(e=>-1!==e.indexOf("dlm-")).length)return g.abort(),void(window.location.href=x);if(i&&"true"===i&&m&&0!=m)return dlmXHRinstance.dlmNoAccessModal(f.responseHeaders),h.removeAttribute("download"),h.setAttribute("href",x),w.removeClass().addClass(y).find("span.dlm-xhr-progress").remove(),w.find(".dlm-xhr-loading-gif").remove(),void g.abort();if(c&&""!==c&&null!==c)return dlmXHRinstance.dlmLogDownload(f.responseHeaders,"failed",!1),h.removeAttribute("download"),h.setAttribute("href",x),w.removeClass().addClass(y).find("span.dlm-xhr-progress").remove(),w.find(".dlm-xhr-loading-gif").remove(),g.abort(),void(m&&0!=m?dlmXHRinstance.dlmNoAccessModal(f.responseHeaders):(w.find(".dlm-xhr-error").remove(),w.append('<span class="dlm-xhr-error">'+c+"</span>")));if(l&&""!==l&&null!==l)return dlmXHRinstance.dlmLogDownload(f.responseHeaders,"redirected",!1,l,i,R),h.removeAttribute("download"),h.setAttribute("href",x),w.removeClass().addClass(y).find("span.dlm-xhr-progress").remove(),w.find(".dlm-xhr-loading-gif").remove(),void g.abort()}if(404==e&&2==d){let e=document.createElement("p");e.innerHTML=o,h.parentNode.appendChild(e)}if(401==e&&2==d)window.location.href=o;else{if(403==e&&2==d){let e=document.createElement("p");e.innerHTML=o,h.parentNode.appendChild(e)}200==e&&4==d&&(r=g.response,H=URL.createObjectURL(r),h.removeEventListener("click",dlmXHRinstance.handleDownloadClick),h.setAttribute("download",""+s),h.setAttribute("href",H),h.click(),w.removeClass().addClass(y+" dlm-d
1ownload-complete"),dlmXHRinstance.attachButtonEvent(),jQuery(document).trigger("dlm_download_complete",[this,h,w,H]),dlmXHRinstance.dlmLogDownload(f.responseHeaders,"completed",b),window.URL.revokeObjectURL(H),h.removeAttribute("download"),h.setAttribute("href",x),w.find(".dlm-xhr-loading-gif").remove(),setTimeout(function(){w.removeClass().addClass(y).find("span.dlm-xhr-progress").remove()},4e3))}},dlmXHRProgress&&g.addEventListener("progress",function(e){let d=e.total,o=(void 0!==e.total&&"undefined"!==e.total&&0!==e.total||void 0!==f.responseHeaders["x-dlm-filesize"]&&(d=f.responseHeaders["x-dlm-filesize"]),e.loaded/d*100);o=o.toFixed();var r;w.find("span.dlm-xhr-progress").remove(),r="dlm-download-started download-"+10*Math.ceil(o/10),1/0!=o&&w.append('<span class="dlm-xhr-progress"> '+o+"%</span>"),w.removeClass().addClass(y+" "+r),jQuery(document).trigger("dlm_download_progress",[this,h,w,H,e,o])}),g.onerror=function(){h.removeAttribute("download"),h.setAttribute("href",x),w.removeClass().addClass(y+" dlm-no-xhr-download").find("span.dlm-xhr-progress").remove(),w.find(".dlm-xhr-error").remove(),w.append('<span class="dlm-xhr-error">'+dlmXHRtranslations.error+"</span>"),console.log("** An error occurred during the transaction")},g.open("GET",x,!0),g.setRequestHeader("Cache-Control","no-store, no-cache, no-transform, max-age=0"),g.setRequestHeader("dlm-xhr-request","dlm_XMLHttpRequest"),g.send()}dlmLogDownload(e,d,o,r=null,s=null,n="_self"){null!==s?window.open(r,n):(s=window.location.href,d={download_id:void 0!==e["x-dlm-download-id"]?e["x-dlm-download-id"]:e["dlm-download-id"],version_id:void 0!==e["x-dlm-version-id"]?e["x-dlm-version-id"]:e["dlm-version-id"],status:d,cookie:o,currentURL:s,action:"log_dlm_xhr_download",responseHeaders:e,nonce:e["x-dlm-nonce"]},jQuery.post(dlmXHR.ajaxUrl,d,function(e){null!==r&&(null==n&&(n="_self"),window.open(r,n))}))}dlmNoAccessModal(e){let d="empty-download",o="empty-version",r="empty-restriction",s="",n=(void 0!==e["dlm-download-id"]&&(d=e["dlm-download-id"]),void 0!==e["dlm-version-id"]&&(o=e["dlm-version-id"]),void 0!==e["dlm-no-access-modal-text"]&&(s=e["dlm-no-access-modal-text"]),void 0!==e["dlm-no-access-restriction"]&&(r=e["dlm-no-access-restriction"]),void 0!==e["x-dlm-download-id"]&&(d=e["x-dlm-download-id"]),void 0!==e["x-dlm-version-id"]&&(o=e["x-dlm-version-id"]),void 0!==e["x-dlm-no-access-modal-text"]&&(s=e["x-dlm-no-access-modal-text"]),void 0!==e["x-dlm-no-access-restriction"]&&(r=e["x-dlm-no-access-restriction"]),{download_id:d,version_id:o,modal_text:s,restriction:r,action:"no_access_dlm_xhr_download",nonce:e["x-dlm-nonce"]});jQuery(document).trigger("dlm-xhr-modal-data",[n,e]),document.dispatchEvent(new CustomEvent("dlm-xhr-modal-data",{detail:{data:n,headers:e}})),jQuery.post(dlmXHR.ajaxUrl,n,function(e){jQuery("#dlm-no-access-modal").remove(),jQuery("body").append(e),jQuery(document).trigger(n.action,[e,n]),document.dispatchEvent(new CustomEvent(n.action,{detail:[e,n]}))})}dlmExternalDownload(o,s,n,r,t){const l=new XMLHttpRequest;n.attr("target");let a=n.attr("class"),i,e="";void 0!==o["dlm-external-download"]&&(e=o["dlm-external-download"]),void 0!==o["x-dlm-external-download"]&&(e=o["x-dlm-external-download"]),a=void 0!==a&&""!==a?a.replace("dlm-download-started","").replace("dlm-download-completed",""):"",n.addClass("dlm-download-started"),s.setAttribute("href","#"),s.removeAttribute("download"),s.setAttribute("disabled","disabled"),jQuery(document).trigger("dlm_download_triggered",[this,s,n,i,l]),l.responseType="blob",l.onreadystatechange=function(){var{status:e,readyState:d}=l;if(403===e)return dlmXHRinstance.dlmLogDownload(o,"failed",!1),l.abort(),n.find(".dlm-xhr-error").remove(),void n.append('<span class="dlm-xhr-error">Acces Denied to file.</span>');200==e&&4==d&&(e=l.response,i=URL.createObjectURL(e),s.removeEventListener("click",dlmXHRinstance.handleDownloadClick),s.setAttribute("download",""+r),s.setAttribute("href",i),s.click(),n.removeClass().addClass(a+" dlm-download-complete"),dlmXHRinstance.attachButtonEvent(),jQuery(document).trigger("dlm_download_complete",[this,s,n,i]),dlmXHRinstance.dlmLogDownload(o,"completed",!1),window.URL.revokeObjectURL(i),s.removeAttribute("download"),s.setAttribute("href",t),n.find(".dlm-xhr-loading-gif").remove(),setTimeout(function(){n.removeClass().addClass(a).find("span.dlm-xhr-progress").remove()},1e3))},dlmXHRProgress&&l.addEventListener("progress",function(e){let d=e.total,o=(void 0!==e.total&&"undefined"!==e.total||(d=l.getResponseHeader("X-DLM-Filesize")),e.loaded/d*100);o=o.toFixed();var r;n.find("span.dlm-xhr-progress").remove(),r="dlm-download-started download-"+10*Math.ceil(o/10),1/0!=o&&n.append('<span class="dlm-xhr-progress"> '+o+"%</span>"),n.removeClass().addClass(a+" "+r),jQuery(document).trigger("dlm_download_progress",[this,s,n,i,e,o])}),l.onerror=function(){s.removeAttribute("download"),s.setAttribute("href",t),n.removeClass().addClass(a+" .dlm-no-xhr-download").find("span.dlm-xhr-progress").remove(),n.find(".dlm-xhr-error").remove(),n.append('<span class="dlm-xhr-error">'+dlmXHRtranslations.error+"</span>"),console.log("** An error occurred during the transaction")}
1,l.open("GET",e,!0),l.setRequestHeader("Cache-Control","no-store, no-cache, no-transform, max-age=0"),l.setRequestHeader("dlm-xhr-request","dlm_XMLHttpRequest"),l.send()}}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.