1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[85389],{40938:(e,t,n)=>{n.d(t,{r:()=>function e(t,n,r,s=new Set,i=new Set,l=0){let{PDFDict:o,PDFArray:d,PDFRef:c,PDFName:h,PDFStream:u}=t;if(l>24||s.has(r.tag)||i.has(r.tag))return 0;i.add(r.tag);let f=n.lookup(r);if(void 0===f)return 0;if(f instanceof u)return n.delete(r),1;if(f instanceof o){let u=f.get(h.of("Type"));if(void 0!==u&&"function"==typeof u.asString&&a.has(u.asString()))return 0;n.delete(r);let g=1,p=(a,r)=>{if(!(r>24)){if(a instanceof c){g+=e(t,n,a,s,i,l+1);return}if(a instanceof d){for(let e=0;e<a.size();e+=1)p(a.get(e),r+1);return}if(a instanceof o)for(let[,e]of a.entries())p(e,r+1)}};for(let[,e]of f.entries())p(e,0);return g}n.delete(r);let g=1;if(f instanceof d)for(let a=0;a<f.size();a+=1){let r=f.get(a);r instanceof c&&(g+=e(t,n,r,s,i,l+1))}return g}});let a=new Set(["/Page","/Pages","/Catalog","/Font","/XObject","/Metadata"])},85389:(e,t,n)=>{n.r(t),n.d(t,{default:()=>T,keepLinkAnnotsOnly:()=>F,matchRunsRe:()=>C,readErr:()=>D});var a=n(45993),r=n(75837),s=n(64954),i=n(2504),l=n(6505),o=n(64722),d=n(97219),c=n(56317),h=n(49128),u=n(99730),f=n(79514),g=n(41285),p=n(30109),m=n(90029),x=n(77771),b=n(72150),y=n(32241),w=n(14552),j=n(35578),k=n(35339),v=n(40938),N=n(93117);let $=[150,200,300],P=[{id:"email",label:"Email addresses",source:"[a-z0-9._%+-]+@[a-z0-9.-]+\\.[a-z]{2,}"},{id:"phone",label:"US phone numbers",source:"(?:\\+?1[\\s.-]?)?\\(?\\d{3}\\)?[\\s.-]?\\d{3}[\\s.-]?\\d{4}"},{id:"card",label:"Card numbers",source:"(?:\\d[ -]?){13,19}",luhn:!0},{id:"ssn",label:"US Social Security numbers",source:"\\d{3}-\\d{2}-\\d{4}"},{id:"ip",label:"IPv4 addresses",source:"(?:\\d{1,3}\\.){3}\\d{1,3}"}];function S(e){return e.normalize("NFKD").replace(/[\u0300-\u036f]/g,"").replace(/\u00ad/g,"").replace(/-\s*\n\s*/g,"").replace(/\s+/g," ").toLowerCase().trim()}function M(e){let t=e.replace(/\D/g,"");if(t.length<13||t.length>19)return!1;let n=0,a=!1;for(let e=t.length-1;e>=0;e--){let r=t[e];if(void 0===r)return!1;let s=Number(r);if(!Number.isFinite(s))return!1;a&&(s*=2)>9&&(s-=9),n+=s,a=!a}return n%10==0}function C(e,t,n){let a=new Set,r=[],s="",i=[],l="";for(let t of e){let e=S(t.str);r.push({start:s.length,end:s.length+e.length}),s+=e+" ",i.push({start:l.length,end:l.length+e.replace(/\s+/g,"").length}),l+=e.replace(/\s+/g,"")}let o=(e,r)=>{let s=new RegExp(t.source,t.flags.includes("g")?t.flags:t.flags+"g");s.lastIndex=0;let i=s.exec(e);for(;i;){let t=i[0];if(!n||M(t)){let e=i.index,n=e+t.length;for(let t=0;t<r.length;t++){let s=r[t];s&&s.end>e&&s.start<n&&a.add(t)}}i.index===s.lastIndex&&(s.lastIndex+=1),i=s.exec(e)}};return o(s,r),o(l,i),a}function R(e,t,n){try{let a=e.convertToViewportPoint(t,n),r=a[0],s=a[1];if("number"!=typeof r||"number"!=typeof s||!Number.isFinite(r)||!Number.isFinite(s))return null;return{x:r,y:s}}catch{return null}}function z(e,t){let n=e.slice(0,t),a=1===e.length?"page":"pages",r=e.length>n.length?` and ${e.length-n.length} more`:"";return`${a} ${n.join(", ")}${r}`}function A(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}async function O(e){let t=await Promise.all([n.e(31889),n.e(53046)]).then(n.bind(n,42975));t.GlobalWorkerOptions.workerSrc=new n.U(n(91035)).toString();let a=t.getDocument({data:new Uint8Array(A(e))});return await a.promise}function D(e,t="Could not open this PDF. It may be damaged, or it may not be a PDF at all."){let n=e instanceof Error?e.name:"",a=e instanceof Error?e.message:String(e);return"PasswordException"===n||/password|encrypt/i.test(a)?"This PDF is password-protected, and a locked file cannot be redacted safely. Remove the password first with the PDF Password Remover tool, then redact the unlocked copy.":t}function F(e,t,n){let{PDFName:a,PDFArray:r,PDFDict:s,PDFRef:i}=n,l=a.of("Annots"),o=e.node.lookup(l);if(!(o instanceof r))return e.node.delete(l),0;let d=[],c=[];for(let e of o.asArray()){let n=t.lookup(e),r=n instanceof s?n.lookup(a.of("Subtype")):void 0;(r instanceof a&&"/Link"===r.asString()?d:c).push(e)}if(0===d.length)e.node.delete(l);else{let n=r.withContext(t);for(let e of d)n.push(e);e.node.set(l,n)}let h=new Set;for(let e of d)e instanceof i&&h.add(e.tag);let u=new Set,f=0;for(let e of c)e instanceof i&&(f+=(0,v.r)(n,t,e,h,u));return f}function T(){let[e,t]=(0,r.useState)("redact"),[v,T]=(0,r.useState)(null),[E,I]=(0,r.useState)(0),[U,B]=(0,r.useState)(1),[L,K]=(0,r.useState)([]),[Y,V]=(0,r.useState)(null),[W,_]=(0,r.useState)(200),[G,X]=(0,r.useState)("jpeg"),[q,J]=(0,r.useState)(!0),[H,Q]=(0,r.useState)(!0),[Z,ee]=(0,r.useState)(""),[et,en]=(0,r.useState)(""),[ea,er]=(0,r.useState)([]),[es,ei]=(0,r.useState)(""),[el,eo]=(0,r.useState)(!1),[ed,ec]=(0,r.useState)(""),[eh,eu]=(0,r.useState)(""),[ef,eg]=(0,r.useState)(""),[ep,em]=(0,r.useState)(null),[ex,eb]=(0,r.useState)(null),[ey,ew]=(0,r.useState)(!1),[ej,ek]=(0,r.useState)({undo:!1,redo:!1}),[ev,eN]=(0,r.useState)(null),e$=(0,r.useRef)(null),eP=(0,r.useRef)(null),eS=(0,r.useRef)(null),eM=(0,r.useRef)(null),eC=(0,r.useRef)(null),eR=(0,r.useRef)(new Map),ez=(0,r.useRef)(0),eA=(0,r.useRef)(0),eO=(0,r.useRef)({stack:[[]],index:0}),eD=(0,r.useRef)(null),eF=(0,r.useRef)(null),eT=(0,r.useMemo)(()=>L.filter(e=>e.page===U),[L,U]),eE=(0,r.useMemo)(()=>{let e=new Set;for(let t of L)e.add(t.page);return e},[L]),eI=(0,r.useMemo)(()=>
1{if(E<=1)return[];if(E<=150)return Array.from({length:E},(e,t)=>t+1);let e=new Set;for(let t=Math.max(1,U-8);t<=Math.min(E,U+8);t++)e.add(t);for(let t of L)e.add(t.page);return[...e].sort((e,t)=>e-t)},[E,U,L]);function eU(e){let t=eO.current;t.stack=t.stack.slice(0,t.index+1),t.stack.push(e),t.index=t.stack.length-1,K(e),ek({undo:t.index>0,redo:!1})}async function eB(e){if(!e||el)return;if("application/pdf"!==e.type&&!e.name.toLowerCase().endsWith(".pdf"))return void eu("Please choose a PDF file.");eu(""),eg(""),ei(""),eb(e=>(e&&URL.revokeObjectURL(e.url),null)),em(null),V(null),eR.current=new Map,eO.current={stack:[[]],index:0},ek({undo:!1,redo:!1}),K([]);let t=eC.current;eC.current=null,t&&t.destroy().catch(()=>void 0),eo(!0),ec("Opening PDF...");try{let t=new Uint8Array(await e.arrayBuffer());eM.current=t;let n=await O(t);eC.current=n,T(e),I(n.numPages),B(1)}catch(e){eM.current=null,T(null),I(0),eu(D(e))}finally{eo(!1),ec("")}}(0,r.useEffect)(()=>{em(null),eb(e=>(e&&URL.revokeObjectURL(e.url),null))},[L,W,G,q,H,v,e,et,ea]),(0,r.useEffect)(()=>()=>{let e=eC.current;e&&e.destroy().catch(()=>void 0)},[]);let eL=(0,r.useCallback)(async()=>{let e=eC.current,t=eP.current,n=eS.current;if(!e||!t||!n)return;let a=++eA.current;try{let r=await e.getPage(U);if(a!==eA.current)return;let s=r.getViewport({scale:1});if(!(s.width>0)||!(s.height>0))return;let i=Math.max(240,Math.min(n.clientWidth||720,1100)),l=Math.min(window.devicePixelRatio||1,2),o=i/s.width*l;s.width*s.height*o*o>12e6&&(o=Math.sqrt(12e6/(s.width*s.height)));let d=r.getViewport({scale:o});t.width=Math.max(1,Math.floor(d.width)),t.height=Math.max(1,Math.floor(d.height));let c=t.getContext("2d");if(!c)return;c.fillStyle="#ffffff",c.fillRect(0,0,t.width,t.height),await r.render({canvasContext:c,viewport:d,canvas:t}).promise}catch{}},[U]);async function eK(e){let t=eR.current.get(e);if(t)return t;let n=eC.current;if(!n)return[];let a=[];try{let t=await n.getPage(e),r=t.getViewport({scale:1});if(!(r.width>0)||!(r.height>0))return[];for(let e of(await t.getTextContent()).items){if("string"!=typeof e.str||""===e.str.trim())continue;let t=e.transform;if(!Array.isArray(t)||t.length<6)continue;let n=Number(t[4]),s=Number(t[5]);if(!Number.isFinite(n)||!Number.isFinite(s))continue;let i=Number(e.width),l=Number(e.height),o=Number.isFinite(i)?i:0,d=Number.isFinite(l)?l:0,c=R(r,n,s-.25*d),h=R(r,n+o,s+d);c&&h&&a.push({str:e.str,x0:Math.min(c.x,h.x)/r.width,x1:Math.max(c.x,h.x)/r.width,y0:Math.min(c.y,h.y)/r.height,y1:Math.max(c.y,h.y)/r.height})}}catch{return[]}return eR.current.set(e,a),a}async function eY(){let e=eC.current;if(!e)return;let t=Z.trim();if(t.length<2&&0===ea.length)return void ei("Type at least two characters, or turn on one of the pattern scans.");eo(!0),ei(""),eu("");let n=++ez.current;try{let r=[],s=new Set,i=0,l=Math.min(e.numPages,100);for(let e=1;e<=l;e++){if(n!==ez.current)return;ec(`Searching page ${e} of ${l}...`);let o=await eK(e),d=new Set;if(t.length>=2)for(let e of function(e,t){let n=new Set,a=S(t);if(a.length<2)return n;let r=a.replace(/\s+/g,""),s=[],i="",l=[],o="";for(let t of e){let e=S(t.str);s.push({start:i.length,end:i.length+e.length}),i+=e+" ",l.push({start:o.length,end:o.length+e.replace(/\s+/g,"").length}),o+=e.replace(/\s+/g,"")}let d=(e,t,a)=>{if(t.length<2)return;let r=e.indexOf(t);for(;-1!==r;){let s=r+t.length;for(let e=0;e<a.length;e++){let t=a[e];t&&t.end>r&&t.start<s&&n.add(e)}r=e.indexOf(t,r+1)}};return d(i,a,s),d(o,r,l),n}(o,t))d.add(e);for(let e of P){if(!ea.includes(e.id))continue;let t=RegExp(e.source,"gi");for(let n=0;n<o.length;n++){let a=o[n];if(!a)continue;t.lastIndex=0;let r=t.exec(a.str);for(;r;){let s=r[0];if(!e.luhn||M(s)){d.add(n);break}r=t.exec(a.str)}}for(let n of C(o,t,!0===e.luhn))d.add(n)}for(let t of d){let n=o[t];if(n){var a;i++,s.add(e),r.push((a=e,{id:`b${Math.random().toString(36).slice(2,9)}`,page:a,x0:Math.max(0,n.x0-.004),y0:Math.max(0,n.y0-.003),x1:Math.min(1,n.x1+.004),y1:Math.min(1,n.y1+.003)}))}}}if(n!==ez.current)return;if(0===r.length)return void ei(`No match in the text layer of the first ${l} pages. A scanned page has no text to search, so nothing here proves the words are absent.`);eU([...L,...r]);let o=[...s].sort((e,t)=>
1e-t)[0];void 0!==o&&B(o);let d=e.numPages>l?` Only the first ${l} of ${e.numPages} pages were searched, so anything past page ${l} is not boxed.`:"";ei(`Boxed ${i} ${1===i?"match":"matches"} across ${s.size} ${1===s.size?"page":"pages"}.${d} These are candidates. Check each one, and add boxes by hand for anything the search could not see.`)}catch(e){eu(D(e,"The search could not finish."))}finally{eo(!1),ec("")}}async function eV(e,t,n){ec("Reading the objects in the file...");let a=await (0,N.o)(e),r={spaced:"",tight:""},s={spaced:"",tight:""};for(let e of a.all){let t=S(e);r.spaced+=t+" ",r.tight+=t.replace(/\s+/g,"")}for(let e of a.orphaned){let t=S(e);s.spaced+=t+" ",s.tight+=t.replace(/\s+/g,"")}let i=await O(e);try{let e=i.numPages,l=Math.min(e,100),o=[],d=[],c=[];for(let e=1;e<=l;e++){ec(`Checking page ${e} of ${l}...`);let t=await i.getPage(e),n=await t.getTextContent(),a=[];for(let e of n.items){let t=e.str;"string"==typeof t&&""!==t.trim()&&a.push(S(t))}o.push({spaced:a.join(" "),tight:a.map(e=>e.replace(/\s+/g,"")).join("")}),0===a.length&&d.push(e);let r=[];try{for(let e of(await t.getAnnotations())){for(let t of[e.contents,e.fieldValue,e.title,e.alternativeText])"string"==typeof t&&""!==t.trim()&&r.push(S(t));let t=e.contentsObj;t&&"string"==typeof t.str&&""!==t.str.trim()&&r.push(S(t.str))}}catch{}c.push(r.join(" "))}let h="",u=!1;try{let e=await i.getMetadata(),t=e.info;if(t)for(let e of Object.values(t))"string"==typeof e&&(h+=" "+S(e));let n=e.metadata;if(n&&"function"==typeof n.getAll)for(let e of Object.values(n.getAll()))"string"==typeof e&&(h+=" "+S(e));u=!0}catch{u=!1}let f=t.map(e=>{let t=S(e.text),n=t.replace(/\s+/g,""),a=[];for(let e=0;e<o.length;e++){let r=o[e];if(!r)continue;let s=t.length>=2&&r.spaced.includes(t),i=n.length>=2&&r.tight.includes(n);(s||i)&&a.push(e+1)}let i=[];for(let e=0;e<c.length;e++){let n=c[e];n&&t.length>=2&&n.includes(t)&&i.push(e+1)}let l=e=>t.length>=2&&e.spaced.includes(t)||n.length>=2&&e.tight.includes(n);return{text:e.text,from:e.from,short:n.length<4,pages:a,inAnnotations:i,inProperties:t.length>=2&&h.includes(t),inObjects:l(r),inOrphans:l(s)}}),g=[];for(let e of P){if(!n.includes(e.id))continue;let t=[],a=[];for(let n=0;n<o.length;n++){let r=o[n];if(!r)continue;let s=RegExp(e.source,"gi"),i=!1,l=s.exec(r.spaced);for(;l;){let t=l[0];if(!e.luhn||M(t)){i=!0,a.length<3&&!a.includes(t)&&a.push(t);break}l=s.exec(r.spaced)}i&&t.push(n+1)}let s=!1,i=RegExp(e.source,"gi"),l=i.exec(r.spaced);for(;l;){let t=l[0];if(!e.luhn||M(t)){s=!0,a.length<3&&!a.includes(t)&&a.push(t);break}l.index===i.lastIndex&&(i.lastIndex+=1),l=i.exec(r.spaced)}g.push({label:e.label,pages:t,samples:a,inObjects:s})}return{findings:f,patterns:g,scanned:l,total:e,capped:e>l,metadataRead:u,textFreePages:d,objectsRead:a.objects,orphanObjects:a.orphans,unreadableStreams:a.unreadableStreams}}finally{i.destroy().catch(()=>void 0)}}async function eW(){let e=eC.current,t=eM.current;if(!e||!t||!v||0===L.length)return;let a=[...eE].sort((e,t)=>e-t);if(a.length>150)return void eu(`You have boxes on ${a.length} pages and this tool rebuilds at most 150 in one pass. Split the document first and redact it in parts, so no page you asked for gets skipped.`);let r=++ez.current;eo(!0),eu(""),eg(""),em(null),eb(e=>(e&&URL.revokeObjectURL(e.url),null));try{let s=await n.e(34716).then(n.bind(n,34716)),{PDFDocument:i}=s;ec("Reading the source file...");let l=await i.load(new Uint8Array(A(t)),{ignoreEncryption:!1,updateMetadata:!1}),o=new Map,d=[],c=!1;for(let e of a){if(r!==ez.current)return;ec(`Reading the text under your boxes on page ${e}...`);let t=await eK(e);for(let n of L){if(n.page!==e)continue;let a=0;for(let r of t){if(r.x1<n.x0||r.x0>n.x1||r.y1<n.y0||r.y0>n.y1)continue;a++;let t=S(r.str);if(t.length<2)continue;let s=o.get(t);if(s){s.from.includes(e)||s.from.push(e);continue}if(o.size>=120){c=!0;continue}o.set(t,{text:r.str.trim(),from:[e]})}0===a&&d.push(e)}}let h=await i.create(),u=[];for(let t=1;t<=e.numPages;t++)eE.has(t)||u.push(t-1);let f=await h.copyPages(l,u),g=new Map;u.forEach((e,t)=>{let n=f[t];n&&g.set(e+1,n)});let p=[],m=0;for(let t=1;t<=e.numPages;t++){if(r!==ez.current)return;if(!eE.has(t)){let e=g.get(t);if(!e)continue;q&&(m+=F(e,h.context,s)),h.addPage(e);continue}ec(`Rebuilding page ${t}...`);let n=await e.getPage(t),a=n.getViewport({scale:1}),i=W/72,l=a.width*a.height;l*i*i>12e6&&l>0&&(i=Math.sqrt(12e6/l),p.push(t));let o=n.getViewport({scale:i}),d=Math.max(1,Math.floor(o.width)),c=Math.max(1,Math.floor(o.height)),u=(0,b.$t)(d,c);if(!u)throw Error(`${(0,b.m4)(d,c,`rebuilt page ${t}`)} Lower the detail setting and run it again.`);let{canvas:f,ctx:x}=u;for(let e of(x.fillStyle="#ffffff",x.fillRect(0,0,f.width,f.height),await n.render({canvasContext:x,viewport:o,canvas:f}).promise,x.fillStyle="#000000",L))e.page===t&&x.fillRect(Math.floor(e.x0*f.width),Math.floor(e.y0*f.height),Math.max(1,Math.ceil((e.x1-e.x0)*f.width)),Math.max(1,Math.ceil((e.y1-e.y0)*f.height)));let w="png"===G?"image/png":"image/jpeg",j=await new Promise(e=>f.toBlob(t=>e(t),w,.85));if(!j)throw Error(`Page ${t} could not be turned into an image. ${(0,y.m9)(f.width,f.height,"png"===G?"page.png":"page.jpg")}`);let k=await j.arrayBuffer(),v="png"===G?await h.embedPng(k):await h.embedJpg(k);h.addPage([a.width,a.height]).drawImage(v,{x:0,y:0,width:a.width,height:a.height}),f.width=0,f.height=0}if(H)h.setTitle(""),h.setAuthor(""),h.setSubject(""),h.setKeywords([]),h.setProducer(""),h.setCreator("");else{let e=(e,t)=>
1{try{let n=e();void 0!==n&&t(n)}catch{}};e(()=>l.getTitle(),e=>h.setTitle(e)),e(()=>l.getAuthor(),e=>h.setAuthor(e)),e(()=>l.getSubject(),e=>h.setSubject(e)),e(()=>l.getKeywords(),e=>h.setKeywords([e])),e(()=>l.getProducer(),e=>h.setProducer(e)),e(()=>l.getCreator(),e=>h.setCreator(e));try{let e=l.getCreationDate();e&&h.setCreationDate(e)}catch{}}ec("Saving...");let x=await h.save({useObjectStreams:!0});if(r!==ez.current)return;ec("Checking the file that was just made...");let w=await eV(x,[...o.values()],[]);if(r!==ez.current)return;let j=new Blob([A(x)],{type:"application/pdf"}),k=URL.createObjectURL(j);eb({url:k,name:v.name.replace(/\.pdf$/i,"")+"-redacted.pdf",origSize:v.size,newSize:j.size}),em({mode:"export",textFreePages:w.textFreePages.filter(e=>!a.includes(e)),fileName:v.name,scannedPages:w.scanned,totalPages:w.total,capped:w.capped,rebuilt:a,copied:u.length,findings:w.findings,patterns:[],blindBoxes:[...new Set(d)],termsCapped:c,metadataRead:w.metadataRead,objectsRead:w.objectsRead,orphanObjects:w.orphanObjects,unreadableStreams:w.unreadableStreams,strippedObjects:m}),p.length>0&&eg(`Pages ${p.join(", ")} were rendered below ${W} DPI because they are too large for this browser to draw at that size. The black is still solid, the page is just less sharp.`)}catch(e){eu(D(e,"The redaction could not finish, so no file was made."))}finally{eo(!1),ec("")}}async function e_(){let e=eM.current;if(!e||!v)return;let t=et.split("\n").map(e=>e.trim()).filter(e=>e.length>=2),n=t.length>120,a=t.slice(0,120).map(e=>({text:e,from:[]}));if(0===a.length&&0===ea.length)return void eu("Type at least one thing you want to be sure is gone, or turn on a pattern scan.");let r=++ez.current;eo(!0),eu(""),eg(""),em(null);try{let t=await eV(e,a,ea);if(r!==ez.current)return;em({mode:"check",fileName:v.name,scannedPages:t.scanned,totalPages:t.total,capped:t.capped,rebuilt:[],copied:0,findings:t.findings,patterns:t.patterns,blindBoxes:[],termsCapped:n,metadataRead:t.metadataRead,textFreePages:t.textFreePages,objectsRead:t.objectsRead,orphanObjects:t.orphanObjects,unreadableStreams:t.unreadableStreams,strippedObjects:0})}catch(e){eu(D(e))}finally{eo(!1),ec("")}}function eG(e){let t=e.currentTarget.getBoundingClientRect();return t.width>0&&t.height>0?{x:Math.min(1,Math.max(0,(e.clientX-t.left)/t.width)),y:Math.min(1,Math.max(0,(e.clientY-t.top)/t.height))}:null}function eX(e){let t=eD.current;eD.current=null;try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}if(!t)return;if("draw"===t.mode){if(eN(null),!ev||ev.x1-ev.x0<.004||ev.y1-ev.y0<.004)return;let e={id:`b${Math.random().toString(36).slice(2,9)}`,page:U,...ev};eU([...L,e]),V(e.id);return}let n=eF.current;eF.current=null,n&&eU(n)}(0,r.useEffect)(()=>{"redact"===e&&v&&eL()},[eL,v,e]);let eq=e=>0===e.pages.length&&0===e.inAnnotations.length&&!e.inProperties&&!e.inObjects,eJ=ep?ep.findings.filter(e=>eq(e)&&e.from.some(e=>e>ep.scannedPages)).length:0,eH=ep?ep.findings.filter(e=>eq(e)&&!e.from.some(e=>e>ep.scannedPages)).length:0,eQ=ep?ep.findings.length-eH-eJ:0;return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,a.jsx)(x.$,{variant:"redact"===e?"default":"outline",size:"sm",onClick:()=>t("redact"),disabled:el,children:"Redact a PDF"}),(0,a.jsxs)(x.$,{variant:"check"===e?"default":"outline",size:"sm",onClick:()=>t("check"),disabled:el,children:[(0,a.jsx)(s.A,{className:"mr-1.5 size-4"}),"Check a redacted PDF"]})]}),(0,a.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>e$.current?.click(),onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&e$.current?.click()},onDragOver:e=>{e.preventDefault(),ew(!0)},onDragLeave:()=>ew(!1),onDrop:e=>{e.preventDefault(),ew(!1),eB(e.dataTransfer.files[0]??null)},className:(0,w.cn)("flex cursor-pointer flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed p-8 text-center transition-colors",ey?"border-primary bg-primary/5":"border-input hover:border-primary/50"),children:[(0,a.jsx)(i.A,{className:"size-6 text-muted-foreground"}),(0,a.jsx)("p",{className:"text-sm font-medium",children:v?v.name:"Drop a PDF here, or click to choose one"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:v?`${(0,j.z3)(v.size)}, ${E} ${1===E?"page":"pages"}`:"It stays on your device either way"}),(0,a.jsx)("input",{ref:e$,type:"file",accept:"application/pdf,.pdf",className:"hidden",onChange:e=>void eB(e.target.files?.[0]??null)})]}),eh&&(0,a.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:eh}),ef&&(0,a.jsx)("p",{role:"status",className:"text-sm text-amber-600 dar
1k:text-amber-400",children:ef}),v&&"redact"===e&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"space-y-2 rounded-lg border p-3",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("input",{type:"text",value:Z,onChange:e=>ee(e.target.value),onKeyDown:e=>{"Enter"===e.key&&eY()},placeholder:"Find a name, an account number, an address",className:"min-w-[12rem] flex-1 rounded-md border border-input bg-background px-3 py-1.5 text-sm",disabled:el}),(0,a.jsxs)(x.$,{size:"sm",onClick:()=>void eY(),disabled:el,children:[(0,a.jsx)(l.A,{className:"mr-1.5 size-4"}),"Find and box"]})]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:P.map(e=>(0,a.jsx)("button",{type:"button",disabled:el,onClick:()=>er(t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id]),className:(0,w.cn)("rounded-full border px-2.5 py-1 text-xs transition-colors",ea.includes(e.id)?"border-primary bg-primary/10 text-primary":"border-input text-muted-foreground hover:border-primary/50"),children:e.label},e.id))}),es&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:es})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)(x.$,{variant:"outline",size:"sm",onClick:()=>B(e=>Math.max(1,e-1)),disabled:el||U<=1,children:(0,a.jsx)(o.A,{className:"size-4"})}),(0,a.jsxs)("span",{className:"text-sm tabular-nums",children:["Page ",U," of ",E]}),(0,a.jsx)(x.$,{variant:"outline",size:"sm",onClick:()=>B(e=>Math.min(E,e+1)),disabled:el||U>=E,children:(0,a.jsx)(d.A,{className:"size-4"})}),(0,a.jsxs)("span",{className:"mx-1 text-sm text-muted-foreground",children:[eT.length," on this page, ",L.length," in the document"]}),(0,a.jsxs)(x.$,{variant:"outline",size:"sm",onClick:function(){let e={id:`b${Math.random().toString(36).slice(2,9)}`,page:U,x0:.3,y0:.45,x1:.7,y1:.52};eU([...L,e]),V(e.id)},disabled:el,title:"Add a box you can move with the arrow keys",children:[(0,a.jsx)(c.A,{className:"mr-1.5 size-4"}),"Add box"]}),(0,a.jsx)(x.$,{variant:"outline",size:"sm",onClick:function(){let e=eO.current;e.index<=0||(e.index-=1,K(e.stack[e.index]??[]),V(null),ek({undo:e.index>0,redo:e.index<e.stack.length-1}))},disabled:el||!ej.undo,children:(0,a.jsx)(h.A,{className:"size-4"})}),(0,a.jsx)(x.$,{variant:"outline",size:"sm",onClick:function(){let e=eO.current;e.index>=e.stack.length-1||(e.index+=1,K(e.stack[e.index]??[]),V(null),ek({undo:e.index>0,redo:e.index<e.stack.length-1}))},disabled:el||!ej.redo,children:(0,a.jsx)(u.A,{className:"size-4"})}),(0,a.jsxs)(x.$,{variant:"outline",size:"sm",onClick:()=>eU(L.filter(e=>e.page!==U)),disabled:el||0===eT.length,children:[(0,a.jsx)(f.A,{className:"mr-1.5 size-4"}),"Clear page"]})]}),eI.length>0&&(0,a.jsx)("div",{className:"flex gap-1 overflow-x-auto pb-1",children:eI.map(e=>{let t=L.filter(t=>t.page===e).length;return(0,a.jsxs)("button",{type:"button",onClick:()=>B(e),className:(0,w.cn)("shrink-0 rounded border px-2 py-1 text-xs tabular-nums transition-colors",e===U?"border-primary bg-primary/10 font-medium text-primary":"border-input text-muted-foreground hover:border-primary/50",t>
10&&e!==U&&"border-foreground/40 text-foreground"),title:t>0?`${t} ${1===t?"box":"boxes"} on page ${e}`:`Page ${e}`,children:[e,t>0&&(0,a.jsx)("span",{className:"ml-1 rounded bg-foreground px-1 text-[10px] text-background",children:t})]},e)})}),(0,a.jsx)("div",{ref:eS,className:"overflow-hidden rounded-lg border bg-muted/30 p-2",children:(0,a.jsxs)("div",{className:"relative mx-auto w-full",children:[(0,a.jsx)("canvas",{ref:eP,className:"block h-auto w-full rounded bg-white"}),(0,a.jsxs)("div",{role:"application","aria-label":"Page surface. Drag to draw a box over anything that must be removed. Arrow keys move the selected box, hold Alt to resize, Delete removes it.",tabIndex:0,onPointerDown:function(e){if(el)return;let t=eG(e);t&&(e.currentTarget.setPointerCapture(e.pointerId),eD.current={mode:"draw",ax:t.x,ay:t.y},V(null),eN({x0:t.x,y0:t.y,x1:t.x,y1:t.y}))},onPointerMove:function(e){let t,n=eD.current;if(!n)return;let a=eG(e);if(!a)return;if("draw"===n.mode)return void eN({x0:Math.min(n.ax,a.x),y0:Math.min(n.ay,a.y),x1:Math.max(n.ax,a.x),y1:Math.max(n.ay,a.y)});let r=n.base;if(!r||!n.id)return;let s=a.x-n.ax,i=a.y-n.ay;if("move"===n.mode){let e=r.x1-r.x0,n=r.y1-r.y0,a=Math.min(1-e,Math.max(0,r.x0+s)),l=Math.min(1-n,Math.max(0,r.y0+i));t={...r,x0:a,y0:l,x1:a+e,y1:l+n}}else t={...r,x1:Math.min(1,Math.max(r.x0+.004,r.x1+s)),y1:Math.min(1,Math.max(r.y0+.004,r.y1+i))};let l=L.map(e=>e.id===t.id?t:e);eF.current=l,K(l)},onPointerUp:eX,onPointerCancel:eX,onKeyDown:function(e){let t;if(!Y)return;let n=L.find(e=>e.id===Y);if(!n)return;if("Delete"===e.key||"Backspace"===e.key){e.preventDefault(),eU(L.filter(e=>e.id!==Y)),V(null);return}let a=e.shiftKey?.02:.005,r={ArrowLeft:[-a,0],ArrowRight:[a,0],ArrowUp:[0,-a],ArrowDown:[0,a]}[e.key];if(!r)return;e.preventDefault();let[s,i]=r;if(e.altKey)t={...n,x1:Math.min(1,Math.max(n.x0+.004,n.x1+s)),y1:Math.min(1,Math.max(n.y0+.004,n.y1+i))};else{let e=n.x1-n.x0,a=n.y1-n.y0,r=Math.min(1-e,Math.max(0,n.x0+s)),l=Math.min(1-a,Math.max(0,n.y0+i));t={...n,x0:r,y0:l,x1:r+e,y1:l+a}}eU(L.map(e=>e.id===t.id?t:e))},className:"absolute inset-0 cursor-crosshair touch-none rounded outline-none ring-primary/60 focus-visible:ring-2",children:[eT.map(e=>(0,a.jsx)("div",{onPointerDown:t=>(function(e,t,n){if(el)return;e.stopPropagation();let a=e.currentTarget.parentElement;if(!a)return;let r=a.getBoundingClientRect();if(r.width>0&&r.height>0){V(t.id);try{a.setPointerCapture(e.pointerId)}catch{}eD.current={mode:n,id:t.id,base:t,ax:(e.clientX-r.left)/r.width,ay:(e.clientY-r.top)/r.height}}})(t,e,"move"),className:(0,w.cn)("absolute cursor-move bg-black",Y===e.id?"outline outline-2 outline-offset-1 outline-primary":""),style:{left:`${100*e.x0}%`,top:`${100*e.y0}%`,width:`${(e.x1-e.x0)*100}%`,height:`${(e.y1-e.y0)*100}%`},children:Y===e.id&&(0,a.jsx)("span",{onPointerDown:t=>{t.stopPropagation();let n=t.currentTarget.parentElement?.parentElement;if(!n)return;let a=n.getBoundingClientRect();if(a.width>0&&a.height>0){try{n.setPointerCapture(t.pointerId)}catch{}eD.current={mode:"resize",id:e.id,base:e,ax:(t.clientX-a.left)/a.width,ay:(t.clientY-a.top)/a.height}}},className:"absolute -bottom-1 -right-1 size-3 cursor-se-resize rounded-sm border border-background bg-primary"})},e.id)),ev&&(0,a.jsx)("div",{className:"absolute bg-black/70",style:{left:`${100*ev.x0}%`,top:`${100*ev.y0}%`,width:`${(ev.x1-ev.x0)*100}%`,height:`${(ev.y1-ev.y0)*100}%`}})]})]})}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2 rounded-lg border p-3 text-sm",children:[(0,a.jsxs)("label",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-muted-foreground",children:"Resolution"}),(0,a.jsx)("select",{value:W,onChange:e=>_(Number(e.target.value)),disabled:el,className:"rounded-md border border-input bg-background px-2 py-1 text-sm",children:$.map(e=>(0,a.jsxs)("option",{value:e,children:[e," DPI"]},e))})]}),(0,a.jsxs)("label",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-muted-foreground",children:"Rebuilt pages as"}),(0,a.jsxs)("select",{value:G,onChange:e=>X("png"===e.target.value?"png":"jpeg"),disabled:el,className:"rounded-md border border-input bg-background px-2 py-1 text-sm",children:[(0,a.jsx)("option",{value:"jpeg",children:"JPEG, smaller file"}),(0,a.jsx)("option",{value:"png",children:"PNG, sharper text"})]})]}),(0,a.jsxs)("label",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{type:"checkbox",checked:q,onCh
1ange:e=>J(e.target.checked),disabled:el,className:"size-4"}),(0,a.jsx)("span",{children:"Strip comments and form fields from untouched pages (links are kept)"})]}),(0,a.jsxs)("label",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{type:"checkbox",checked:H,onChange:e=>Q(e.target.checked),disabled:el,className:"size-4"}),(0,a.jsx)("span",{children:"Blank the title, author and other document properties"})]}),(0,a.jsx)("p",{className:"w-full text-xs text-muted-foreground",children:"Raising the resolution makes the file bigger and the page sharper. It does not make the redaction any safer, because the text is already gone by then."})]}),(0,a.jsx)(x.$,{onClick:()=>void eW(),disabled:el||0===L.length,children:el?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(g.A,{className:"mr-2 size-4 animate-spin"}),ed||"Working..."]}):`Redact and check ${L.length} ${1===L.length?"box":"boxes"}`})]}),v&&"check"===e&&(0,a.jsxs)("div",{className:"space-y-3 rounded-lg border p-3",children:[(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:"This mode never changes your file. It reads the text of the PDF as it stands and tells you whether the things you name are still findable in it. Works on anything, including a file somebody else redacted."}),(0,a.jsx)("textarea",{value:et,onChange:e=>en(e.target.value),rows:4,placeholder:"One thing per line, for example:\nChen\n4111 1111 1111 1111\n42 Ridgeway Close",className:"w-full rounded-md border border-input bg-background px-3 py-2 font-mono text-sm",disabled:el}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:P.map(e=>(0,a.jsx)("button",{type:"button",disabled:el,onClick:()=>er(t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id]),className:(0,w.cn)("rounded-full border px-2.5 py-1 text-xs transition-colors",ea.includes(e.id)?"border-primary bg-primary/10 text-primary":"border-input text-muted-foreground hover:border-primary/50"),children:e.label},e.id))}),(0,a.jsx)(x.$,{onClick:()=>void e_(),disabled:el,children:el?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(g.A,{className:"mr-2 size-4 animate-spin"}),ed||"Checking..."]}):"Check this file"})]}),ex&&(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3 rounded-lg border p-4",children:[(0,a.jsxs)(x.$,{onClick:()=>{(0,k.Is)(ex.url,ex.name)},children:[(0,a.jsx)(p.A,{className:"mr-2 size-4"}),"Download redacted PDF"]}),(0,a.jsxs)("span",{className:"text-sm text-muted-foreground",children:[(0,j.z3)(ex.origSize)," in, ",(0,j.z3)(ex.newSize)," out"]})]}),ep&&(0,a.jsxs)("div",{role:"status","aria-live":"polite",className:"space-y-3 rounded-lg border p-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-sm font-semibold",children:"export"===ep.mode?"What the exported file actually contains":`What ${ep.fileName} still contains`}),(0,a.jsxs)("p",{className:"mt-1 text-sm text-muted-foreground",children:["export"===ep.mode?`${ep.rebuilt.length} ${1===ep.rebuilt.length?"page was":"pages were"} rebuilt from pixels, ${ep.copied} copied through untouched. `:"","Text was read from ",ep.scannedPages," of ",ep.totalPages," pages.",ep.capped&&" The check stops at 100 pages, so nothing here says anything about the rest."]}),(0,a.jsxs)("p",{className:"mt-1 text-sm text-muted-foreground",children:[0===ep.objectsRead?"The objects inside this file could not be read, so nothing below says anything about text that is in the file but not on a page.":`${ep.objectsRead} objects were read straight out of the file, past the pages${ep.orphanObjects>0?`, ${ep.orphanObjects} of which nothing in the document points at any more`:", and every one of them is still pointed at by the document"}.`,"export"===ep.mode&&ep.strippedObjects>0?` The strip removed ${ep.strippedObjects} ${1===ep.strippedObjects?"object":"objects"} from the export rather than only unlinking them.`:"",ep.unreadableStreams>0?` ${ep.unreadableStreams} compressed ${1===ep.unreadableStreams?"stream":"streams"} could not be opened by this browser, so the object reading is a floor and not a complete one.`:""]})]}),ep.findings.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{className:"text-sm",children:"export"===ep.mode?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"font-medium",children:eH})," of ",ep.findings.length," recorded runs return no hits in the exported file",eQ>0?(0,a.jsxs)(a.Fragment,{children:[", and ",(0,a.jsx)("span",{className:"font-medium text-destructive",children:eQ})," can still be found."]}):"."]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"font-medium",children:eQ})," of ",ep.findings.length," terms are still in this file."]})}),(0,a.jsx)("ul",{className:"max-h-72 space-y-1 overflow-y-auto text-sm",children:ep.findings.map((e,t)=>{let n=eq(e),r=n&&e.from.some(e=>e>ep.scannedPages),s=n&&!r,i=[];return e.pages.length>0&&i.push(z(e.pages,6)),e.inAnnotations.length>0&&i.push(`a comment on ${z(e.inAnnotations,4)}`),e.inProperties&&i.push("the document properties"),e.inObjects&&0===i.length&&i.push(e.inOrphans?"an object left in the file that nothing in the document points at any more":"the file's objects, though no page or comment leads to it"),(0,a.jsxs)("li",{className:"flex gap-2 border-b border-border/50 pb-1 last:border-0",children:[(0,a.jsx)("span",{className:(0,w.cn)("shrink-0 font-mono text-xs",r?"text-amber-600 dar
1k:text-amber-400":s?"text-emerald-600 dark:text-emerald-400":"text-destructive"),children:r?"UNCHECKED":s?"GONE":"FOUND"}),(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsx)("span",{className:"break-words font-medium",children:e.text.length>60?`${e.text.slice(0,60)}...`:e.text}),(0,a.jsxs)("span",{className:"text-muted-foreground",children:[r?` was boxed on ${z(e.from.filter(e=>e>ep.scannedPages),4)}, which this check never opened. It stops at page ${ep.scannedPages}. Not a clean result, and not a dirty one`:s?` returns 0 hits in the ${ep.scannedPages} pages checked${ep.objectsRead>0?`, and none in the ${ep.objectsRead} objects read out of the file`:""}`:` still appears in ${i.join(", and ")}`,e.short&&!s?". This one is short, so the match may be part of an ordinary word":"",e.from.length>0?`. You boxed it on ${z(e.from,6)}`:""]})]})]},`${e.text}-${t}`)})})]}),ep.patterns.length>0&&(0,a.jsx)("ul",{className:"space-y-1 text-sm",children:ep.patterns.map(e=>{let t=0===e.pages.length&&!e.inObjects;return(0,a.jsxs)("li",{className:"flex gap-2",children:[(0,a.jsx)("span",{className:(0,w.cn)("shrink-0 font-mono text-xs",t?"text-emerald-600 dark:text-emerald-400":"text-amber-600 dark:text-amber-400"),children:t?"NONE":"SEEN"}),(0,a.jsxs)("span",{children:[(0,a.jsx)("span",{className:"font-medium",children:e.label}),(0,a.jsx)("span",{className:"text-muted-foreground",children:t?" matched nothing in the text that could be read, and nothing in the file's objects":e.pages.length>0?` matched on ${z(e.pages,6)}${e.samples.length>0?`, such as ${e.samples.join(", ")}`:""}`:` matched inside the file's objects rather than on a page${e.samples.length>0?`, such as ${e.samples.join(", ")}`:""}`})]})]},e.label)})}),ep.blindBoxes.length>0&&(0,a.jsxs)("p",{className:"rounded border border-amber-500/40 bg-amber-500/10 p-2 text-sm text-amber-700 dark:text-amber-300",children:["On ",1===ep.blindBoxes.length?"page":"pages"," ",ep.blindBoxes.join(", ")," a box covered an area with no extractable text under it, which is what a scan looks like. The black on those pages is real, but a text search proves nothing about them either way."]}),ep.textFreePages.length>0&&(0,a.jsx)("p",{className:"rounded border border-amber-500/40 bg-amber-500/10 p-2 text-sm font-medium text-amber-700 dark:text-amber-300",children:ep.textFreePages.length===ep.scannedPages?"None of the pages checked have any text in them at all, which is what a scan looks like. Nothing below is evidence that anything is absent, because there was nothing here to search.":`${ep.textFreePages.length} of the ${ep.scannedPages} pages checked have no text in them (${z(ep.textFreePages,8)}). A result of "gone" says nothing about those pages, because there was nothing on them to search.`}),ep.termsCapped&&("check"===ep.mode?(0,a.jsxs)("p",{className:"text-xs font-medium text-amber-700 dark:text-amber-400",children:["You listed more than ",120," things to look for, so only the first ",120," were searched. Anything below that in your list has NOT been checked. Run it again with the rest."]}):(0,a.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Your boxes covered more than ",120," separate runs, so the list above stops there. Every box was still rebuilt."]})),!ep.metadataRead&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"The document properties of this file could not be read, so they were not checked."}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"This is a text search of the file, and it is only as good as the text that can be pulled out of it. It is not a legal certification, and it says nothing about words that live inside a picture."})]}),(0,a.jsxs)("p",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[(0,a.jsx)(m.A,{className:"size-3.5"}),"Your PDF is opened, redacted and checked on your own device. Nothing is uploaded, nothing is stored, and the file name is not part of the file, so rename it before you send it."]})]})}},93117:(e,t,n)=>{n.d(t,{o:()=>s});let a={all:[],orphaned:[],objects:0,orphans:0,unreadableStreams:0,truncated:!1};async function r(e){let t=globalThis.DecompressionStream;if("function"!=typeof t||e.byteLength>4e6)return null;for(let n of["deflate","deflate-raw"])try{let a=new Blob([e.slice().buffer]).stream(),r=await new Response(a.pipeThrough(new t(n))).arrayBuffer();return new Uint8Array(r)}catch{}return null}async function s(e){let t,s;try{t=await n.e(34716).then(n.bind(n,34716))}catch{return a}let{PDFDocument:i,PDFDict:l,PDFArray:o,PDFRef:d,PDFName:c,PDFString:h,PDFHexString:u,PDFRawStream:f}=t;
1try{s=(await i.load(e,{updateMetadata:!1,throwOnInvalidObject:!1,ignoreEncryption:!0})).context}catch{return a}let g=s.enumerateIndirectObjects(),p=new Set,m=[];for(let e of[s.trailerInfo.Root,s.trailerInfo.Info,s.trailerInfo.Encrypt])e instanceof d&&!p.has(e.tag)&&(p.add(e.tag),m.push(e));let x=(e,t)=>{if(!(t>64)&&null!=e){if(e instanceof d){p.has(e.tag)||(p.add(e.tag),m.push(e));return}if(e instanceof f)return void x(e.dict,t+1);if(e instanceof o){for(let n=0;n<e.size();n+=1)x(e.get(n),t+1);return}if(e instanceof l)for(let[,n]of e.entries())x(n,t+1)}};for(;m.length>0;){let e=m.pop();if(void 0===e)break;x(s.lookup(e),0)}let b=new TextDecoder("utf-8",{fatal:!1}),y=[],w=[],j=0,k=!1,v=8e6,N=e=>{let t=e,n=e.match(/<[0-9A-Fa-f\s]{4,}>/g);if(null===n)return t;for(let e of n.slice(0,4e3)){let n=e.slice(1,-1).replace(/\s+/g,"");if(n.length%2!=0)continue;let a=new Uint8Array(n.length/2);for(let e=0;e<a.length;e+=1)a[e]=Number.parseInt(n.substr(2*e,2),16);let r=254===a[0]&&255===a[1],s="";if(r)for(let e=2;e+1<a.length;e+=2)s+=String.fromCharCode((a[e]??0)<<8|(a[e+1]??0));else for(let e of a)s+=String.fromCharCode(e);t+=" "+s}return t};for(let[e,t]of g){if(v<=0){k=!0;break}let n=[],a=new Set,s=async(e,t)=>{if(!(t>64)&&null!=e&&!(e instanceof d)){if(e instanceof h||e instanceof u){try{n.push(e.decodeText())}catch{}return}if(e instanceof f){let a=e.dict.get(c.of("Filter")),i=void 0!==a&&"function"==typeof a.asString?a.asString():"";if(""===i||"/Identity"===i)n.push(N(b.decode(e.contents)));else if("/FlateDecode"===i){let t=await r(e.contents);null===t?j+=1:n.push(N(b.decode(t)))}else j+=1;await s(e.dict,t+1);return}if(e instanceof o){if(a.has(e))return;a.add(e);for(let n=0;n<e.size();n+=1)await s(e.get(n),t+1);return}if(e instanceof l){if(a.has(e))return;for(let[,n]of(a.add(e),e.entries()))await s(n,t+1)}}};await s(t,0);let i=n.filter(e=>e.length>0).join(" ");0!==i.length&&(v-=i.length,y.push(i),p.has(e.tag)||w.push(i))}return{all:y,orphaned:w,objects:g.length,orphans:g.filter(([e])=>!p.has(e.tag)).length,unreadableStreams:j,truncated:k}}}}]);
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.