PageSourceSearch

https://spawngraph.com/assets/js/zip-CbEwaFQ8.js

js spawngraph.com collected 2026-10-03 20:07:32 UTC 2,759 bytes, 12 lines download raw bytes

1import{J as I}from"./jszip.min-CWT0vWaI.js";import"./react-DcbKnVvw.js";import"./jszip.min-jXTwSvUT.js";import"./_commonjs-dynamic-modules-TDtrdbi3.js";const h=35e4,$=100,M=50*1024*1024;function b(e){const t=e.match(/(\d+)/);return t?Number.parseInt(t[1],10):0}function w(e){return/^ppt\/slides\/slide\d+\.xml$/i.test(e)?1:/^ppt\/notesSlides\/notesSlide\d+\.xml$/i.test(e)?1.5:e==="xl/sharedStrings.xml"?2:/^xl\/worksheets\/.+\.xml$/i.test(e)?3:e==="content.xml"?4:/\.x?html?$/i.test(e)?5:/\.(txt|md|json|csv|yaml|yml)$/i.test(e)?6:/\.xml$/i.test(e)?7:10}function N(e,t){const n=w(e),s=w(t);return n!==s?n-s:b(e)-b(t)}function x(e){return e.replace(/<text:h[^>]*text:outline-level="(\d)"[^>]*>([\s\S]*?)<\/text:h>/gi,(t,n,s)=>`
2`+"#".repeat(Math.min(Number(n),6))+" "+s.replace(/<[^>]+>/g,"").trim()+`
3`).replace(/<\/(p|w:p|a:p|text:p|h[1-6]|li|div|td|tr)>/gi,`
4`).replace(/<br\s*\/?>/gi,`
5`).replace(/<[^>]+>/g," ").replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&apos;/g,"'").replace(/&#(\d+);/g,(t,n)=>String.fromCharCode(Number.parseInt(n,10))).replace(/[ \t]+/g," ").replace(/\n{3,}/g,`
6
7`).trim()}async function k(e){try{const t=Object.keys(e.files).find(o=>/\.opf$/i.test(o));if(!t)return null;const n=await e.file(t)?.async("string");if(!n)return null;const s=t.includes("/")?t.substring(0,t.lastIndexOf("/")+1):"",c=new Map,u=/<item\s[^>]*?id="([^"]+)"[^>]*?href="([^"]+)"[^>]*?\/?>/gi;let i;for(;(i=u.exec(n))!==null;)c.set(i[1],s+decodeURIComponent(i[2]));const p=[],m=/<itemref\s[^>]*?idref="([^"]+)"[^>]*?\/?>/gi;for(;(i=m.exec(n))!==null;){const o=c.get(i[1]);o&&p.push(o)}return p.length>0?p:null}catch{return null}}async function F(e,t){t?.("Opening file...");const n=await e.arrayBuffer(),s=new I,c=await s.loadAsync(n),u=await k(s);let i=Object.keys(c.files).filter(l=>!c.files[l]?.dir).sort(N).slice(0,$);if(u){const l=new Set(u),f=u.filter(r=>i.includes(r)||Object.keys(c.files).includes(r));i=[...i.filter(r=>!l.has(r)&&!/\.x?html?$/i.test(r)),...f].slice(0,$)}const p=[];let m=0,o=0;for(let l=0;l<i.length&&!(m>=h);l++){const f=i[l],g=c.file(f);if(!g)continue;t?.(`Extracting content ${l+1} of ${i.length}...`);const r=await g.async("string");if(o+=r.length,o>M)break;let a;const y=f.match(/^ppt\/slides\/slide(\d+)\.xml$/i),O=f.match(/^ppt\/notesSlides\/notesSlide\d+\.xml$/i);if(y)a=`## Slide ${y[1]}
8${x(r)}`;else if(O){const S=x(r).trim();if(!S)continue;a=`**Notes:** ${S}`}else/\.(xml|x?html?)$/i.test(f)?a=x(r):a=r.replace(/[ \t]+/g," ").replace(/\n{3,}/g,`
9
10`).trim();a&&(p.push(a),m+=a.length)}const d=p.join(`
11
12`).trim();if(!d)throw new Error("No readable text found in this file. It may be empty or contain only images.");return d.length>h?d.slice(0,h):d}export{F as parseZip};

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.