1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5744],{15744:(e,t,i)=>{i.d(t,{extractIndividualFilesFromZip:()=>o});var n=i(27524),a=i.n(n),s=i(65417);async function o(e){let t=Date.now(),i=e.name;try{let i=await e.arrayBuffer(),o=await a().loadAsync(i),r=[],l=[],p=[];for(let[t,i]of Object.entries(o.files)){if(i.dir){l.push({name:t,reason:"Directory"});continue}try{var n;let a,o,c=t.split("/").pop(),f=(null===(n=i._data)||void 0===n?void 0:n.uncompressedSize)||0,d=c.toLowerCase();if(f>0x3200000){l.push({name:c,reason:"File too large (>50MB)"});continue}if(c.startsWith(".")||c.startsWith("__MACOSX")||c.startsWith("~$")){l.push({name:c,reason:"System/hidden file"});continue}let m=s.f9.some(e=>d.endsWith(".".concat(e))),h=s.lg.some(e=>d.endsWith(".".concat(e))),g=d.endsWith(".pdf"),u=d.endsWith(".docx");if(!m&&!h&&!g&&!u){p.push({name:c,error:"Unsupported file type"});continue}if(m){let e=await i.async("arraybuffer");o=d.endsWith(".jpg")||d.endsWith(".jpeg")?"image/jpeg":d.endsWith(".png")?"image/png":d.endsWith(".gif")?"image/gif":d.endsWith(".webp")?"image/webp":d.endsWith(".bmp")?"image/bmp":d.endsWith(".svg")?"image/svg+xml":d.endsWith(".tiff")||d.endsWith(".tif")?"image/tiff":"image/jpeg",a=new Blob([e],{type:o})}else if(g){let e=await i.async("arraybuffer");a=new Blob([e],{type:"application/pdf"}),o="application/pdf"}else if(u){let e=await i.async("arraybuffer");a=new Blob([e],{type:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"}),o="application/vnd.openxmlformats-officedocument.wordprocessingml.document"}else if(h){let e=await i.async("text");if(!e||0===e.trim().length){l.push({name:c,reason:"Empty file"});continue}if(e.length>1048576){l.push({name:c,reason:"Text file too large (>1MB)"});continue}let t=d.endsWith(".md")?"text/markdown":"text/plain";a=new Blob([e],{type:t}),o=t}let w=new File([a],c,{type:o,lastModified:Date.now()});w._extractedFromZip=!0,w._originalZipName=e.name,w._zipPath=t,r.push(w)}catch(e){console.error('â ClientZIP: Failed to extract "'.concat(t,'":'),e),p.push({name:t,error:e.message})}}let c=Date.now()-t;return r.length>0&&(r[0]._zipExtractionSummary={totalFilesInZip:Object.keys(o.files).filter(e=>!o.files[e].dir).length,filesExtracted:r.length,filesSkipped:l.length,errors:p.length,processingTime:c,skippedFiles:l,errorFiles:p}),r}catch(n){let e=Date.now()-t;throw console.error('â ClientZIP: Failed to extract files from "'.concat(i,'" after ').concat(e,"ms:"),n),Error("Failed to extract ZIP: ".concat(n.message))}}}}]);
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.