1(function polyfill() { 2 const relList = document.createElement("link").relList; 3 if (relList && relList.supports && relList.supports("modulepreload")) { 4 return; 5 } 6 for (const link of document.querySelectorAll('link[rel="modulepreload"]')) { 7 processPreload(link); 8 } 9 new MutationObserver((mutations) => { 10 for (const mutation of mutations) { 11 if (mutation.type !== "childList") { 12 continue; 13 } 14 for (const node of mutation.addedNodes) { 15 if (node.tagName === "LINK" && node.rel === "modulepreload") 16 processPreload(node); 17 } 18 } 19 }).observe(document, { childList: true, subtree: true }); 20 function getFetchOpts(link) { 21 const fetchOpts = {}; 22 if (link.integrity) fetchOpts.integrity = link.integrity; 23 if (link.referrerPolicy) fetchOpts.referrerPolicy = link.referrerPolicy; 24 if (link.crossOrigin === "use-credentials") 25 fetchOpts.credentials = "include"; 26 else if (link.crossOrigin === "anonymous") fetchOpts.credentials = "omit"; 27 else fetchOpts.credentials = "same-origin"; 28 return fetchOpts; 29 } 30 function processPreload(link) { 31 if (link.ep) 32 return; 33 link.ep = true; 34 const fetchOpts = getFetchOpts(link); 35 fetch(link.href, fetchOpts); 36 } 37})(); 38function getDefaultExportFromCjs(x) { 39 return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x; 40} 41const scriptRel = "modulepreload"; 42const assetsURL = function(dep) { 43 return "/" + dep; 44}; 45const seen = {}; 46const __vitePreload = function preload(baseModule, deps, importerUrl) { 47 let promise = Promise.resolve(); 48 if (deps && deps.length > 0) { 49 let allSettled2 = function(promises) { 50 return Promise.all( 51 promises.map( 52 (p) => Promise.resolve(p).then( 53 (value) => ({ status: "fulfilled", value }), 54 (reason) => ({ status: "rejected", reason }) 55 ) 56 ) 57 ); 58 }; 59 document.getElementsByTagName("link"); 60 const cspNonceMeta = document.querySelector( 61 "meta[property=csp-nonce]" 62 ); 63 const cspNonce = (cspNonceMeta == null ? void 0 : cspNonceMeta.nonce) || (cspNonceMeta == null ? void 0 : cspNonceMeta.getAttribute("nonce")); 64 promise = allSettled2( 65 deps.map((dep) => { 66 dep = assetsURL(dep); 67 if (dep in seen) return; 68 seen[dep] = true; 69 const isCss = dep.endsWith(".css"); 70 const cssSelector = isCss ? '[rel="stylesheet"]' : ""; 71 if (document.querySelector(`link[href="${dep}"]${cssSelector}`)) { 72 return; 73 } 74 const link = document.createElement("link"); 75 link.rel = isCss ? "stylesheet" : scriptRel; 76 if (!isCss) { 77 link.as = "script"; 78 } 79 link.crossOrigin = ""; 80 link.href = dep; 81 if (cspNonce) { 82 link.setAttribute("nonce", cspNonce); 83 } 84 document.head.appendChild(link); 85 if (isCss) { 86 return new Promise((res, rej) => { 87 link.addEventListener("load", res); 88 link.addEventListener( 89 "error", 90 () => rej(new Error(`Unable to preload CSS for ${dep}`)) 91 ); 92 }); 93 } 94 }) 95 ); 96 } 97 function handlePreloadError(err) { 98 const e = new Event("vite:preloadError", { 99 cancelable: true 100 }); 101 e.payload = err; 102 window.dispatchEvent(e); 103 if (!e.defaultPrevented) { 104 throw err; 105 } 106 } 107 return promise.then((res) => { 108 for (const item of res || []) { 109 if (item.status !== "rejected") continue; 110 handlePreloadError(item.reason); 111 } 112 return baseModule().catch(handlePreloadError); 113 }); 114}; 115export { 116 __vitePreload as _, 117 getDefaultExportFromCjs as g 118};
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.