PageSourceSearch

https://localpdf.online/app/assets/index-CHe-v2sx.js

js localpdf.online collected 2026-09-24 14:25:57 UTC 6,422 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-pdflib-BC_rCeQu.js","assets/vendor-react-C_xdI0Ng.js"])))=>i.map(i=>d[i]);
2import{_ as m}from"./index-BLFiW9lJ.js";import"./vendor-react-C_xdI0Ng.js";function x(n){return n.replace(/^[A-Z]{6}\+/,"").trim()}function E(n){return/^g_[a-z0-9_]+$/i.test(n)||/^[a-z]\d+$/i.test(n)}let b=null;function g(n,e,t){if(!e||E(e))return;const o=x(e);if(!o)return;const a=(t==null?void 0:t.embedded)??!1,r=n.get(o);if(r){r.embedded=r.embedded||a,r.instances=(r.instances??1)+1,!r.type&&(t!=null&&t.type)&&(r.type=t.type);return}n.set(o,{name:o,type:t==null?void 0:t.type,embedded:a,instances:1})}function F(...n){const e=new Map;for(const t of n)for(const o of t){const a=x(o.name);if(!a)continue;const r=e.get(a);if(r){r.embedded=r.embedded||o.embedded,r.instances=Math.max(r.instances??1,o.instances??1),!r.type&&o.type&&(r.type=o.type);continue}e.set(a,{name:a,type:o.type,embedded:o.embedded,instances:o.instances??1})}return[...e.values()].sort((t,o)=>t.name.localeCompare(o.name))}async function S(){return b||(b=(async()=>{const n=[()=>m(()=>import("./vendor-pdfjs-Oio34r9s.js").then(e=>e.p),[]),()=>m(()=>import("./vendor-pdfjs-Oio34r9s.js").then(e=>e.c),[]),()=>m(()=>import("./vendor-pdfjs-Oio34r9s.js").then(e=>e.c),[])];for(const e of n)try{const t=await e();if(t&&typeof t.getDocument=="function"){if(t.GlobalWorkerOptions&&!t.GlobalWorkerOptions.workerSrc){const o=[()=>m(()=>import("./vendor-pdfjs-Oio34r9s.js").then(a=>a.a),[]),()=>m(()=>import("./vendor-pdfjs-Oio34r9s.js").then(a=>a.b),[])];for(const a of o)try{const r=await a();if(r.default){t.GlobalWorkerOptions.workerSrc=r.default;break}}catch{}}return t}}catch{}return null})()),b}function D(n){if(!(!n||Number.isNaN(n.getTime())))return n.toISOString()}function h(n){let e="";for(let t=0;t<n.length;t+=1)e+=String.fromCharCode(n[t]);return e}function v(n){const t=h(n.subarray(0,Math.min(n.length,1024))).match(/%PDF-(\d\.\d)/);return(t==null?void 0:t[1])??null}function O(n){const e=h(n.subarray(0,Math.min(n.length,4096)));return/\/Linearized\s+1/.test(e)}function C(n){const e=h(n.subarray(0,Math.min(n.length,65536)));if(!/\/Encrypt\b/.test(e))return{encrypted:!1};const t=e.match(/\/Filter\s*\/([A-Za-z0-9]+)/);return{encrypted:!0,method:(t==null?void 0:t[1])??null}}function I(n){var c;const e=n.match(/pdfaid:part(?:>|=)"?\s*(\d+)/i)??n.match(/<pdfaid:part>\s*(\d+)\s*<\/pdfaid:part>/i),t=n.match(/pdfaid:conformance(?:>|=)"?\s*([A-Za-z])/i)??n.match(/<pdfaid:conformance>\s*([A-Za-z])\s*<\/pdfaid:conformance>/i);if(!e&&!t)return null;const o=e==null?void 0:e[1],a=(c=t==null?void 0:t[1])==null?void 0:c.toUpperCase(),r=o&&a?`PDF/A-${o}${a.toLowerCase()}`:void 0;return{part:o,conformance:a,pdfAClaim:r}}function L(n){const e=h(n),t=e.indexOf("<?xpacket begin"),o=e.indexOf("<x:xmpmeta"),a=t>=0?t:o;if(a<0)return;const r=e.indexOf("<?xpacket end",a),c=r>=0?r+64:Math.min(e.length,a+12e3),i=e.slice(a,c);return{present:!0,selfDeclared:!0,...I(i)}}function k(n){const e=h(n),t=new Map,o=/\/Type\s*\/Font\b[\s\S]{0,1800}?\/BaseFont\s*\/([^\s/>[\]()]+)/g;for(const r of e.matchAll(o)){const c=r.index??0,i=e.slice(c,c+r[0].length),s=i.match(/\/Subtype\s*\/([A-Za-z0-9]+)/),d=/\/FontFile(?:2|3)?\b/.test(i)||/\/FontDescriptor\b/.test(i);g(t,r[1]??"",{type:s==null?void 0:s[1],embedded:d})}const a=/<<([\s\S]{0,3000}?)>>/g;for(const r of e.matchAll(a)){const c=r[1]??"";if(!/\/Type\s*\/Font\b/.test(c))continue;const i=c.split(/\/Type\s*\/Font\b/)[1]??"",s=i.match(/\/BaseFont\s*\/([^\s/>[\]()]+)/);if(!(s!=null&&s[1]))continue;const d=i.match(/\/Subtype\s*\/([A-Za-z0-9]+)/),f=/\/FontFile(?:2|3)?\b/.test(c)||/\/FontDescriptor\b/.test(c);g(t,s[1],{type:d==null?void 0:d[1],embedded:f})}return[...t.values()].sort((r,c)=>r.name.localeCompare(c.name))}async function A(n){var a,r,c;const e=await S();if(!e)return[];const t=new Map,o=new Set([(a=e.OPS)==null?void 0:a.setFont,(r=e.OPS)==null?void 0:r.setFontDict].filter(i=>typeof i=="number"));try{const i=await e.getDocument({data:n,disableWorker:!0,verbosity:(c=e.VerbosityLevel)==null?void 0:c.ERRORS}).promise;for(let s=1;s<=i.numPages;s+=1){const d=await i.getPage(s),f=await d.getOperatorList(),l=new Set;for(let p=0;p<f.fnArray.length;p+=1){if(!o.has(f.fnArray[p]))continue;const y=f.argsArray[p];
2if(!Array.isArray(y)||typeof y[0]!="string")continue;const w=y[0];if(!l.has(w)){l.add(w);try{const u=await d.commonObjs.get(w),_=(u==null?void 0:u.name)||(u==null?void 0:u.fallbackName);if(!_)continue;g(t,_,{type:u.type,embedded:!0})}catch{}}}}}catch{return[]}return[...t.values()].sort((i,s)=>i.name.localeCompare(s.name))}async function P(n){const{PDFDocument:e}=await m(async()=>{const{PDFDocument:a}=await import("./vendor-pdflib-BC_rCeQu.js").then(r=>r.c);return{PDFDocument:a}},__vite__mapDeps([0,1]));let t=!1;try{await e.load(n,{ignoreEncryption:!1})}catch(a){(a instanceof Error?a.message.toLowerCase():"").includes("encrypt")&&(t=!0)}const o=await e.load(n,{ignoreEncryption:!0});return{pageCount:o.getPageCount(),passwordProtected:t,documentInfo:{title:o.getTitle()||void 0,author:o.getAuthor()||void 0,subject:o.getSubject()||void 0,keywords:o.getKeywords()||void 0,creator:o.getCreator()||void 0,producer:o.getProducer()||void 0,creationDate:D(o.getCreationDate()),modificationDate:D(o.getModificationDate())}}}async function z(n,e){const t=new Uint8Array(await n.arrayBuffer()),o=t.byteLength,a=v(t),r=O(t),c=C(t),i=L(t),s=k(t);try{const[{pageCount:d,documentInfo:f,passwordProtected:l},p]=await Promise.all([P(t.slice()),A(t.slice())]),y=F(s,p);return{fileName:e,fileSizeBytes:o,pageCount:d,pdfVersion:a,linearized:r,encrypted:c.encrypted||l,passwordProtected:l,encryptionMethod:c.method??(l?"Standard":null),documentInfo:f,fonts:y,xmp:i}}catch(d){return{fileName:e,fileSizeBytes:o,pageCount:0,pdfVersion:a,linearized:r,encrypted:c.encrypted,passwordProtected:c.encrypted,encryptionMethod:c.method??null,documentInfo:{},fonts:F(s,await A(t.slice()).catch(()=>[])),xmp:i,error:d instanceof Error?d.message:"Failed to analyze PDF"}}}const V=async({inputIds:n,fs:e,emitProgress:t})=>{if(n.length===0)throw new Error("PDF Info requires at least one input file");t==null||t(5);const o=await e.read(n[0]),a=await o.getBlob();t==null||t(20);const r=await z(a,o.getName());t==null||t(90);const c=await e.write(new Blob([JSON.stringify(r)],{type:"application/json"}));return t==null||t(100),{outputIds:[c.id]}};export{V as run};

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.