1import{C as n}from"./application-k8eSbXnI.js";import{g as i}from"./verbs-D8LzV1YN.js";const s=480;class l extends n{connect(){this.element.getAttribute("href")===""&&(this.attempts=0,this.disableButtons(!0),this.waitForDocumentURL())}disconnect(){clearTimeout(this.timeout)}waitForDocumentURL(){this.attempts>=s||(this.attempts+=1,this.timeout=setTimeout(()=>this.requestDocumentURL(),Math.min(this.attempts,10)*1e3))}requestDocumentURL(){i(window.location,{responseKind:"json"}).then(async t=>{if(!t.ok)return this.waitForDocumentURL();const{url:e}=await t.json;e!==null?(document.querySelectorAll(".button-document-download").forEach(o=>o.href=e),this.disableButtons(!1),this.revealDocumentPreview()):this.waitForDocumentURL()})}revealDocumentPreview(){const t=document.getElementById("document_preview");t===null||t.querySelector("[data-document-preview-pending]")===null||(t.src=window.location.href)}disableButtons(t){document.querySelectorAll('[data-disable-when="document-download"]').forEach(e=>{e.classList.toggle("disabled",t)})}}export{l as default}; 2//# sourceMappingURL=document_download_controller-D2ixaYRr.js.map
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.