PageSourceSearch

https://karanroy2908-pdf.hf.space/assets/GetPdfInfo-4xo_AVrY.js

js karanroy2908-pdf.hf.space collected 2026-10-03 17:01:19 UTC 26,053 bytes, 1 lines download raw bytes

1import{ai as oe,aj as re,ak as ie,a as e,al as ae,am as le,at as de,b_ as ce,aL as me,u as b,r as m,cx as fe,G as D,cl as ue,T as l,A as J,S as c,B as pe,bj as he,aa as ge,cD as xe,D as _,bd as M,d_ as je,dm as ye,bL as Q,q as Pe,dj as Ie,by as be,o as we,bb as Ce,d$ as Se,cy as ve,e0 as ke}from"./index-BkeMuzUz.js";import{c as Fe}from"./createToolFlow-BpT2QXaV.js";import{u as ze}from"./useBaseTool-B_Jp9BE0.js";/* empty css               */import{C as De}from"./Code-BIydbTX9.js";import{A as S}from"./Accordion-ChvfzUhz.js";import"./vendor-react-CW0cBZaz.js";import"./pdf-engine-BPdFjzQc.js";import"./ToolStep-BLm9vVwd.js";import"./Undo-CiEDzaNw.js";import"./TextFields-zz689m9Q.js";import"./useViewScopedFiles-BWG1ydpQ.js";var Z={root:"m_7341320d"};const Te=le((s,{size:n,radius:t,variant:o,gradient:r,color:i,autoContrast:a})=>{const d=s.variantColorResolver({color:i||s.primaryColor,theme:s,gradient:r,variant:o||"filled",autoContrast:a});return{root:{"--ti-size":ce(n,"ti-size"),"--ti-radius":t===void 0?void 0:de(t),"--ti-bg":i||o?d.background:void 0,"--ti-color":i||o?d.color:void 0,"--ti-bd":i||o?d.border:void 0}}}),V=oe((s,n)=>{const t=re("ThemeIcon",null,s),{classNames:o,className:r,style:i,styles:a,unstyled:d,vars:f,autoContrast:u,attributes:j,...p}=t,g=ie({name:"ThemeIcon",classes:Z,props:t,className:r,style:i,classNames:o,styles:a,unstyled:d,attributes:j,vars:f,varsResolver:Te});return e.jsx(ae,{ref:n,...g("root"),...p})});V.classes=Z;V.displayName="@mantine/core/ThemeIcon";const ee={},Ne=()=>me({defaultParameters:ee,endpointName:"get-info-on-pdf"}),Ae=(s,n)=>s.find(t=>t.name.toLowerCase().endsWith(n)),Oe=({operation:s,isLoading:n,errorMessage:t})=>{const{t:o}=b(),r=m.useMemo(()=>Ae(s.files,".json"),[s.files]),i=m.useMemo(()=>r??null,[r]),a=m.useMemo(()=>o("getPdfInfo.downloadJson","Download JSON"),[o]),d=m.useCallback(f=>{fe({data:f,filename:f.name})},[]);return n&&s.results.length===0?e.jsxs(D,{justify:"center",gap:"sm",py:"md",children:[e.jsx(ue,{size:"sm"}),e.jsx(l,{children:o("getPdfInfo.processing","Extracting information...")})]}):!n&&s.results.length===0?e.jsx(J,{color:"gray",variant:"light",title:o("getPdfInfo.results","Results"),children:e.jsx(l,{size:"sm",children:o("getPdfInfo.noResults","Run the tool to generate a report.")})}):e.jsxs(c,{gap:"md",children:[t&&e.jsx(J,{color:"yellow",variant:"light",children:e.jsx(l,{size:"sm",children:t})}),e.jsxs(c,{gap:"xs",children:[e.jsx(l,{size:"sm",fw:600,children:o("getPdfInfo.downloads","Downloads")}),e.jsx(pe,{color:"blue",onClick:()=>i&&d(i),disabled:!i,fullWidth:!0,children:a})]})]})},Ee="response.json",te=()=>{const{t:s}=b(),{selectors:n}=he(),[t,o]=m.useState(!1),[r,i]=m.useState(""),[a,d]=m.useState(null),[f,u]=m.useState([]),[j,p]=m.useState(null),[g,v]=m.useState(""),[F,y]=m.useState([]),w=m.useRef(!1),x=m.useRef(null),C=m.useCallback(()=>{x.current&&(URL.revokeObjectURL(x.current),x.current=null)},[]),T=m.useCallback(()=>{w.current=!1,y([]),u([]),C(),p(null),v(""),i(""),d(null)},[C]),R=m.useCallback(()=>{d(null)},[]),W=m.useCallback(async(K,B)=>{if(B.length===0){d(s("noFileSelected","No file loaded"));return}w.current=!1,o(!0),i(s("getPdfInfo.processing","Extracting information...")),d(null),y([]),u([]),C(),p(null),v("");try{const I=[],$=Date.now();for(const P of B){if(w.current)break;const h=new FormData;h.append("fileInput",P);try{const k=await ge.post("/api/v1/security/get-info-on-pdf",h),A=n.getStirlingFileStub(P.fileId),U={fileId:P.fileId,fileName:P.name,fileSize:P.size??null,lastModified:P.lastModified??null,thumbnailUrl:A?.thumbnailUrl??null,data:k.data??{},error:null,summaryGeneratedAt:$};I.push(U)}catch(k){const A=n.getStirlingFileStub(P.fileId);I.push({fileId:P.fileId,fileName:P.name,fileSize:P.size??null,lastModified:P.lastModified??null,thumbnailUrl:A?.thumbnailUrl??null,data:{},error:xe(k),summaryGeneratedAt:$})}}if(!w.current){if(y(I),I.length>0){const h=I.filter(G=>!G.error).map(G=>G.data),k=h.length===1?h[0]:h,A=JSON.stringify(k,null,2),U=new File([A],Ee,{type:"application/json"});u([U])}I.some(h=>h.error)&&d(s("getPdfInfo.error.partial","Some files could not be processed.")),i(s("getPdfInfo.status.complete","Extraction complete"))}}catch(I){console.error("[getPdfInfo] unexpected failure",I),d(s("getPdfInfo.error.unexpected","Unexpected error during extraction."))}finally{o(!1)}},[C,n,s]),L=m.useCallback(()=>{t&&(w.current=!0,o(!1),i(s("operationCancelled","Operation cancelled")))},[t,s]),N=m.useCallback(async()=>{T()},[T]);return m.useEffect(()=>()=>{C()},[C]),m.useMemo(()=>({files:f,thumbnails:[],isGeneratingThumbnails:!1,downloadUrl:j,downloadFilename:g,isLoading:t,status:r,errorMessage:a,progress:null,executeOperation:W,resetResults:T,clearError:R,cancelOperation:L,undoOperation:N,results:F}),[L,R,g,j,a,W,f,t,T,F,r])},E=({title:s,anchorId:n,children:t})=>e.jsxs(c,{gap:"sm",id:n,children:[e.jsx(l,{fw:700,size:"lg",children:s}),e.jsx(_,{}),t]}),z=({obj:s,emptyLabel:n})=>!s||Object.keys(s).length===0?e.jsx(l,{size:"sm",c:"dimmed",children:n??"None detected"}):e.jsx(c,{gap:6,children:Object.entries(s).map(([t,o])=>e.jsxs(D,{wrap:"nowrap",align:"flex-start",style:{width:"100%"},children:[e.jsx(l,{size:"sm",style:{minWidth:180,maxWidth:180,flexShrink:0},children:t}),e.jsx(l,{size:"sm",c:"dimmed",style:{wordBreak:"break-word",overflowWrap:"break-word",flex:1},children:o==null?"":String(o)})]},t))}),Re=s=>{if(!s||s.length===0)return{hasCompliance:!1,passedStandards:[],failedCount:0};const n=s.filter(r=>r.Standard.toLowerCase()!=="not-pdfa");if(n.length===0)return{hasCompliance:!1,passedStandards:[],failedCount:0};const t=n.filter(r=>r.Compliant).map(r=>{const i=r.Standard.toLowerCase(),a=i.match(/^pdf[_-]?a[_-]?(\d+)([abuf])?$/i);if(a)return`PDF/A-${a[1]}${a[2]?.toUpperCase()||""}`;const d=i.match(/^pdf[_-]?ua[_-]?(\d+)?$/i);return d?`PDF/UA-${d[1]||"1"}`:r.Standard.toUpperCase()}),o=n.filter(r=>!r.Compliant).length;return{hasCompliance:!0,passedStandards:t,failedCount:o}},Be=({sections:s,hideSectionTitle:n=!1})=>{const{t}=b(),o=m.useMemo(()=>{const i=s.basicInfo??{},a=s.documentInfo??{},d=s.metadata??{},f=s.encryption??{},u=s.permissions??{},j=s.summaryData??{},p=s.other??{},g=s.perPage??{},v=i["Number of pages"],F=i.FileSizeInBytes,y=a["PDF version"],w=i.Language,x={[t("getPdfInfo.summary.pages","Pages")]:v,[t("getPdfInfo.summary.fileSize","File Size")]:typeof F=="number"?`${(F/1024).toFixed(2)} KB`:F,[t("getPdfInfo.summary.pdfVersion","PDF Version")]:y,[t("getPdfInfo.summary.language","Language")]:w},C={[t("getPdfInfo.summary.title","Title")]:d.Title,[t("getPdfInfo.summary.author","Author")]:d.Author,[t("getPdfInfo.summary.created","Created")]:d.CreationDate,[t("getPdfInfo.summary.modified","Modified")]:d.ModificationDate},T=f.IsEncrypted?t("getPdfInfo.summary.security.encrypted","Encrypted PDF - Password protection present"):t("getPdfInfo.summary.security.unencrypted","Unencrypted PDF - No password protection"),R=j.restrictedPermissionsCount??0,L=Object.values(u).every(h=>h==="Allowed")?t("getPdfInfo.summary.permsAll","All Permissions Allowed"):R>0?t("getPdfInfo.summary.permsRestricted","{{count}} restrictions",{count:R}):t("getPdfInfo.summary.permsMixed","Some permissions restricted"),N=Re(j.Compliance),K=N.hasCompliance?N.passedStandards.length>0?t("getPdfInfo.summary.compliancePassed","{{standards}} compliant",{standards:N.passedStandards.join(", ")}):t("getPdfInfo.summary.complianceChecked","Standards verified ({{failed}} failed)",{failed:N.failedCount}):t("getPdfInfo.summary.noCompliance","No Compliance Standards"),B=g["Page 1"],I=B?.Fonts??[],$={[t("getPdfInfo.summary.tech.images","Images")]:(()=>{const h=i.TotalImages;
1return typeof h=="number"?h===0?"None":`${h}`:"None"})(),[t("getPdfInfo.summary.tech.fonts","Fonts")]:(()=>{if(I.length===0)return"None";const h=I.filter(k=>k.IsEmbedded).length;return`${I.length} (${h} embedded)`})(),[t("getPdfInfo.summary.tech.formFields","Form Fields")]:s.formFields&&Object.keys(s.formFields).length>0?Object.keys(s.formFields).length:"None",[t("getPdfInfo.summary.tech.embeddedFiles","Embedded Files")]:p.EmbeddedFiles?.length??"None",[t("getPdfInfo.summary.tech.javaScript","JavaScript")]:p.JavaScript?.length??"None",[t("getPdfInfo.summary.tech.layers","Layers")]:p.Layers?.length??"None",[t("getPdfInfo.summary.tech.bookmarks","Bookmarks")]:s.toc?.length??"None",[t("getPdfInfo.summary.tech.multimedia","Multimedia")]:B?.Multimedia?.length??"None"},P=(()=>{const h=d.Title?`"${d.Title}"`:t("getPdfInfo.summary.overview.untitled","an untitled document"),k=d.Author||t("getPdfInfo.summary.overview.unknown","Unknown Author");return t("getPdfInfo.summary.overview.text","This is a {{pages}}-page PDF titled {{title}} created by {{author}} (PDF version {{version}}).",{pages:typeof v=="number"?v:"?",title:h,author:k,version:y??"?"})})();return{basicInformation:x,documentInformation:C,securityStatusText:T,permSummary:L,complianceText:K,technical:$,overview:P}},[s,t]),r=e.jsxs(c,{gap:"md",children:[e.jsxs(c,{gap:6,children:[e.jsx(l,{fw:600,size:"sm",children:t("getPdfInfo.summary.basic","Basic Information")}),e.jsx(z,{obj:o.basicInformation})]}),e.jsxs(c,{gap:6,children:[e.jsx(l,{fw:600,size:"sm",children:t("getPdfInfo.summary.documentInfo","Document Information")}),e.jsx(z,{obj:o.documentInformation})]}),e.jsxs(c,{gap:6,children:[e.jsx(l,{fw:600,size:"sm",children:t("getPdfInfo.summary.securityTitle","Security Status")}),e.jsx(l,{size:"sm",c:"dimmed",children:o.securityStatusText}),e.jsx(l,{size:"sm",c:"dimmed",children:o.permSummary}),e.jsx(l,{size:"sm",c:"dimmed",children:o.complianceText})]}),e.jsxs(c,{gap:6,children:[e.jsx(l,{fw:600,size:"sm",children:t("getPdfInfo.summary.technical","Technical")}),e.jsx(z,{obj:o.technical})]}),e.jsxs(c,{gap:6,children:[e.jsx(l,{fw:600,size:"sm",children:t("getPdfInfo.summary.overviewTitle","PDF Overview")}),e.jsx(l,{size:"sm",c:"dimmed",children:o.overview})]})]});return n?e.jsx("div",{id:"summary",children:r}):e.jsx(E,{title:t("getPdfInfo.summary.title","PDF Summary"),anchorId:"summary",children:r})},O=({title:s,anchorId:n,obj:t,emptyLabel:o})=>e.jsx(E,{title:s,anchorId:n,children:e.jsx(z,{obj:t,emptyLabel:o})}),Me=({anchorId:s,tocArray:n})=>{const{t}=b(),o=t("getPdfInfo.noneDetected","None detected");return e.jsx(E,{title:t("getPdfInfo.sections.tableOfContents","Table of Contents"),anchorId:s,children:!n||n.length===0?e.jsx(l,{size:"sm",c:"dimmed",children:o}):e.jsx(c,{gap:4,children:n.map((r,i)=>e.jsx(l,{size:"sm",c:"dimmed",children:typeof r=="string"?r:JSON.stringify(r)},i))})})},H=({content:s,maxHeight:n="400px",emptyMessage:t})=>{const{t:o}=b();return s?e.jsx(De,{block:!0,style:{whiteSpace:"pre-wrap",backgroundColor:"var(--bg-raised)",color:"var(--text-primary)",maxHeight:n,overflowY:"auto"},children:s}):e.jsx(l,{size:"sm",c:"dimmed",children:t??o("getPdfInfo.noneDetected","None detected")})},se={item:{backgroundColor:"var(--accordion-item-bg)"},control:{backgroundColor:"transparent"}},Le=(s,n)=>!s||s.length===0?e.jsx(l,{size:"sm",c:"dimmed",children:n}):e.jsx(c,{gap:4,children:s.map((t,o)=>e.jsx("div",{style:{wordBreak:"break-word",overflowWrap:"break-word"},children:e.jsxs(l,{size:"sm",c:"dimmed",children:[e.jsx("strong",{children:t.Name||"Unnamed attachment"}),t.Description&&` - ${t.Description}`,t.FileSize!=null&&` (${t.FileSize} bytes)`]})},o))}),$e=(s,n)=>!s||s.length===0?e.jsx(l,{size:"sm",c:"dimmed",children:n}):e.jsx(c,{gap:4,children:s.map((t,o)=>e.jsx("div",{style:{wordBreak:"break-word",overflowWrap:"break-word"},children:e.jsxs(l,{size:"sm",c:"dimmed",children:[e.jsx("strong",{children:t.Name||"Unnamed file"}),t.FileSize!=null&&` (${t.FileSize} bytes)`,t.MimeType&&` - ${t.MimeType}`,t.CreationDate&&` - Created: ${t.CreationDate}`,t.ModificationDate&&` - Modified: ${t.ModificationDate}`]})},o))}),X=(s,n)=>!s||s.length===0?e.jsx(l,{size:"sm",c:"dimmed",children:n}):e.jsx(c,{gap:4,children:s.map((t,o)=>e.jsx(l,{size:"sm",c:"dimmed",style:{wordBreak:"break-word",overflowWrap:"break-word"},children:typeof t=="string"?t:JSON.stringify(t)},o))}),Ue=({anchorId:s,other:n})=>{const{t}=b(),o=t("getPdfInfo.noneDetected","None detected"),r=Array.isArray(n?.StructureTree)&&n.StructureTree.length>0?JSON.stringify(n.StructureTree,null,2):null;return e.jsx(E,{title:t("getPdfInfo.sections.other","Other"),anch
1orId:s,children:e.jsxs(c,{gap:"sm",children:[e.jsxs(c,{gap:6,children:[e.jsx(l,{fw:600,size:"sm",children:t("getPdfInfo.other.attachments","Attachments")}),Le(n?.Attachments,o)]}),e.jsxs(c,{gap:6,children:[e.jsx(l,{fw:600,size:"sm",children:t("getPdfInfo.other.embeddedFiles","Embedded Files")}),$e(n?.EmbeddedFiles,o)]}),e.jsxs(c,{gap:6,children:[e.jsx(l,{fw:600,size:"sm",children:t("getPdfInfo.other.javaScript","JavaScript")}),X(n?.JavaScript,o)]}),e.jsxs(c,{gap:6,children:[e.jsx(l,{fw:600,size:"sm",children:t("getPdfInfo.other.layers","Layers")}),X(n?.Layers,o)]}),e.jsxs(S,{variant:"separated",radius:"md",defaultValue:"",styles:se,children:[e.jsxs(S.Item,{value:"structureTree",children:[e.jsx(S.Control,{children:e.jsx(l,{fw:600,size:"sm",children:t("getPdfInfo.other.structureTree","StructureTree")})}),e.jsx(S.Panel,{children:e.jsx(H,{content:r,maxHeight:"20rem"})})]}),e.jsxs(S.Item,{value:"xmp",children:[e.jsx(S.Control,{children:e.jsx(l,{fw:600,size:"sm",children:t("getPdfInfo.other.xmp","XMPMetadata")})}),e.jsx(S.Panel,{children:e.jsx(H,{content:n?.XMPMetadata,maxHeight:"400px"})})]})]})]})})},_e=(s,n)=>!s||s.length===0?e.jsx(l,{size:"sm",c:"dimmed",children:n}):e.jsx(c,{gap:4,children:s.map((t,o)=>e.jsx("div",{style:{wordBreak:"break-word",overflowWrap:"break-word"},children:e.jsxs(l,{size:"sm",c:"dimmed",children:[t.Name?`${t.Name} `:"Image ","(",t.Width,"×",t.Height,"px",t.ColorSpace?`, ${t.ColorSpace}`:"",")"]})},o))}),q=(s,n)=>!s||s.length===0?e.jsx(l,{size:"sm",c:"dimmed",children:n}):e.jsx(c,{gap:4,children:s.map((t,o)=>e.jsx(l,{size:"sm",c:"dimmed",style:{wordBreak:"break-word",overflowWrap:"break-word"},children:typeof t=="string"?t:JSON.stringify(t)},o))}),Ve=(s,n)=>!s||s.length===0?e.jsx(l,{size:"sm",c:"dimmed",children:n}):e.jsx(c,{gap:4,children:s.map((t,o)=>e.jsx(l,{size:"sm",c:"dimmed",style:{wordBreak:"break-word",overflowWrap:"break-word"},children:`${t.Name??"Unknown"}${t.IsEmbedded?" (embedded)":""}`},o))}),We=({anchorId:s,perPage:n})=>{const{t}=b(),o=t("getPdfInfo.noneDetected","None detected"),r=n&&Object.keys(n).length>0;return e.jsx(E,{title:t("getPdfInfo.sections.perPageInfo","Per Page Info"),anchorId:s,children:r?e.jsx(S,{variant:"separated",radius:"md",defaultValue:"",styles:se,children:Object.entries(n).map(([i,a])=>e.jsxs(S.Item,{value:i,children:[e.jsx(S.Control,{children:e.jsx(l,{fw:600,size:"sm",children:i})}),e.jsx(S.Panel,{children:e.jsx("div",{style:{backgroundColor:"var(--bg-raised)",color:"var(--text-primary)",borderRadius:8,padding:12},children:e.jsxs(c,{gap:"sm",children:[a?.Size&&e.jsxs(c,{gap:4,children:[e.jsx(l,{fw:600,size:"sm",children:t("getPdfInfo.perPage.size","Size")}),e.jsx(z,{obj:a.Size})]}),e.jsx(z,{obj:{Rotation:a?.Rotation,"Page Orientation":a?.["Page Orientation"],MediaBox:a?.MediaBox,CropBox:a?.CropBox,BleedBox:a?.BleedBox,TrimBox:a?.TrimBox,ArtBox:a?.ArtBox,"Text Characters Count":a?.["Text Characters Count"]}}),a?.Annotations&&e.jsxs(c,{gap:4,children:[e.jsx(l,{fw:600,size:"sm",children:t("getPdfInfo.perPage.annotations","Annotations")}),e.jsx(z,{obj:a.Annotations})]}),e.jsxs(c,{gap:4,children:[e.jsx(l,{fw:600,size:"sm",children:t("getPdfInfo.perPage.images","Images")}),_e(a?.Images,o)]}),e.jsxs(c,{gap:4,children:[e.jsx(l,{fw:600,size:"sm",children:t("getPdfInfo.perPage.links","Links")}),q(a?.Links,o)]}),e.jsxs(c,{gap:4,children:[e.jsx(l,{fw:600,size:"sm",children:t("getPdfInfo.perPage.fonts","Fonts")}),Ve(a?.Fonts,o)]}),a?.XObjectCounts&&e.jsxs(c,{gap:4,children:[e.jsx(l,{fw:600,size:"sm",children:t("getPdfInfo.perPage.xobjects","XObject Counts")}),e.jsx(z,{obj:a.XObjectCounts})]}),e.jsxs(c,{gap:4,children:[e.jsx(l,{fw:600,size:"sm",children:t("getPdfInfo.perPage.multimedia","Multimedia")}),q(a?.Multimedia,o)]})]})})})]},i))}):e.jsx(l,{size:"sm",c:"dimmed",children:o})})},Ge=s=>{const n=s.toLowerCase().trim(),t=n.match(/^pdf[_-]?a[_-]?(\d+)([abuf])?$/i);if(t){const a=t[1],d=t[2]?.toUpperCase()||"";return{displayName:`PDF/A-${a}${d}`,category:"PDF/A",sortOrder:10+parseInt(a)*10+(d==="A"?1:d==="B"?2:d==="U"?3:0)}}const o=n.match(/^pdf[_-]?ua[_-]?(\d+)?$/i);if(o){const a=o[1]||"1";return{displayName:`PDF/UA-${a}`,category:"PDF/UA",sortOrder:200+parseInt(a)}}const r=n.match(/^pdf[_-]?x[_-]?(.+)?$/i);if(r){const a=r[1]?.toUpperCase()||"";return{displayName:`PDF/X${a?`-${a}`:""}`,category:"PDF/X",sortOrder:300}}const i=n.match(/^pdf[_-]?e[_-]?(.+)?$/i);if(i){const a=i[1]?.toUpperCase()||"";return{displayName:`PDF/E${a?`-${a}`:""}`,category:"PDF/E",sortOrder:400}}return n.includes("pdfvt")||n.includes("pdf-vt")||n.includes("pdf_vt")?{displayName:"PDF/VT",category:"PDF/VT",sortOrder:500}:n.includes("sec")||n.includes("edgar")?{displayName:"SEC (EDGAR)",category:"SEC",sortOrder:600}:n==="not-pdfa"||n==="not_pdfa"?{displayName:"PDF/A Detection",category:"Detection",sortOrder:1}
1:{displayName:s.toUpperCase().replace(/[-_]/g,"/"),category:"Other",sortOrder:999}},Ke=(s,n)=>{const t=[],o=new Set;if(s&&s.length>0)for(const r of s){if(r.Standard.toLowerCase()==="not-pdfa")continue;const{displayName:i,category:a,sortOrder:d}=Ge(r.Standard);o.add(a),t.push({displayName:i,category:a,isCompliant:r.Compliant,summary:r.Summary,standardId:r.Standard,sortOrder:d})}if(n&&"IsPDF/SECCompliant"in n&&!o.has("SEC")){const r=n["IsPDF/SECCompliant"];t.push({displayName:"SEC (EDGAR)",category:"SEC",isCompliant:r,summary:r?"Document meets SEC EDGAR filing requirements":"Document does not meet SEC EDGAR filing requirements",standardId:"sec-edgar",sortOrder:600})}return t.sort((r,i)=>r.sortOrder-i.sortOrder),t},Je=s=>{const n=s.filter(t=>t.category==="PDF/A"&&t.isCompliant).sort((t,o)=>o.sortOrder-t.sortOrder);return n.length>0?n[0].displayName:null},He=({result:s})=>{const{t:n}=b(),t=s.isCompliant?je:ye,o=s.isCompliant?"teal":"red",r=s.isCompliant?n("getPdfInfo.compliance.passed","Passed"):n("getPdfInfo.compliance.failed","Failed");
1return e.jsx(Q,{p:"sm",radius:"sm",withBorder:!0,style:{borderColor:`var(--mantine-color-${o}-6)`},children:e.jsxs(D,{justify:"space-between",wrap:"nowrap",children:[e.jsxs(D,{gap:"sm",wrap:"nowrap",style:{minWidth:0},children:[e.jsx(V,{color:o,variant:"light",size:"lg",radius:"xl",children:e.jsx(t,{style:{fontSize:"1.2rem"}})}),e.jsxs(c,{gap:2,style:{minWidth:0},children:[e.jsx(l,{size:"sm",fw:600,truncate:!0,children:s.displayName}),e.jsx(Pe,{label:s.summary,multiline:!0,maw:400,withArrow:!0,children:e.jsx(l,{size:"xs",c:"dimmed",lineClamp:1,style:{cursor:"help"},children:s.summary})})]})]}),e.jsx(M,{color:o,variant:"light",size:"md",leftSection:e.jsx(t,{style:{width:12,height:12}}),children:r})]})})},Xe=()=>{const{t:s}=b();return e.jsx(Q,{p:"md",radius:"sm",withBorder:!0,children:e.jsxs(D,{gap:"sm",children:[e.jsx(V,{color:"gray",variant:"light",size:"lg",radius:"xl",children:e.jsx(Ie,{style:{fontSize:"1.2rem"}})}),e.jsxs(c,{gap:2,children:[e.jsx(l,{size:"sm",fw:500,children:s("getPdfInfo.compliance.noVerification","No Verification Performed")}),e.jsx(l,{size:"xs",c:"dimmed",children:s("getPdfInfo.compliance.noVerificationDesc","PDF standards compliance was not verified for this document.")})]})]})})},qe=({anchorId:s,complianceSummary:n,legacyCompliance:t})=>{const{t:o}=b(),r=m.useMemo(()=>Ke(n,t),[n,t]),i=m.useMemo(()=>Je(r),[r]),a=r.filter(u=>u.isCompliant).length,d=r.filter(u=>!u.isCompliant).length,f=r.length>0;return e.jsx(E,{title:o("getPdfInfo.sections.compliance","Compliance"),anch
1orId:s,children:e.jsxs(c,{gap:"md",children:[f&&e.jsxs(e.Fragment,{children:[e.jsx(D,{justify:"space-between",wrap:"wrap",gap:"xs",children:e.jsxs(D,{gap:"xs",children:[i&&e.jsx(M,{color:"cyan",variant:"light",size:"lg",children:i}),a>0&&e.jsxs(M,{color:"teal",variant:"outline",size:"sm",children:[a," ",o("getPdfInfo.compliance.passedCount","passed")]}),d>0&&e.jsxs(M,{color:"red",variant:"outline",size:"sm",children:[d," ",o("getPdfInfo.compliance.failedCount","failed")]})]})}),e.jsx(_,{})]}),f?e.jsx(c,{gap:"xs",children:r.map((u,j)=>e.jsx(He,{result:u},`${u.standardId}-${j}`))}):e.jsx(Xe,{})]})})},Ye=new Set(["summary","metadata","formFields","basicInfo","documentInfo","compliance","encryption","permissions","toc","other","perPage"]),Qe=({data:s})=>{const{t:n}=b(),t=m.useRef(null),o=s.entries[0]??null;m.useEffect(()=>{if(!s.scrollTo||!Ye.has(s.scrollTo))return;const i=s.scrollTo,a=t.current,d=a?.querySelector(`#${i}`);if(d&&a){const f=parseFloat(getComputedStyle(document.documentElement).fontSize)*4,u=d.getBoundingClientRect().top,j=a.getBoundingClientRect().top,g=a.scrollTop+(u-j)-f;a.scrollTo({top:Math.max(0,g),behavior:"smooth"}),d.classList.remove("section-flash-highlight"),d.offsetWidth,d.classList.add("section-flash-highlight"),setTimeout(()=>d.classList.remove("section-flash-highlight"),1500)}},[s.scrollTo]);const r=m.useMemo(()=>{const i=o?.data??{};return{metadata:i.Metadata??null,formFields:i.FormFields??i["Form Fields"]??null,basicInfo:i.BasicInfo??i["Basic Info"]??null,documentInfo:i.DocumentInfo??i["Document Info"]??null,compliance:i.Compliancy??i.Compliance??null,encryption:i.Encryption??null,permissions:i.Permissions??null,toc:i["Bookmarks/Outline/TOC"]??i["Table of Contents"]??null,other:i.Other??null,perPage:i.PerPageInfo??i["Per Page Info"]??null,summaryData:i.SummaryData??null}},[o]);return o?e.jsx("div",{className:"report-container",ref:t,children:e.jsx(c,{gap:"xl",align:"center",children:e.jsx("div",{className:"simulated-page",children:e.jsxs(c,{gap:"lg",children:[e.jsxs(c,{gap:"xs",children:[e.jsxs(l,{fw:700,size:"xl",style:{lineHeight:1.3,wordBreak:"break-word"},children:[o.fileName,e.jsxs(l,{component:"span",fw:700,children:[" ","- ",n("getPdfInfo.summary.title","PDF Summary")]})]}),e.jsx(_,{})]}),e.jsx(Be,{sections:r,hideSectionTitle:!0}),e.jsx(O,{title:n("getPdfInfo.sections.metadata","Metadata"),anchorId:"metadata",obj:r.metadata}),e.jsx(O,{title:n("getPdfInfo.sections.formFields","Form Fields"),anchorId:"formFields",obj:r.formFields}),e.jsx(O,{title:n("getPdfInfo.sections.basicInfo","Basic Info"),anchorId:"basicInfo",obj:r.basicInfo}),e.jsx(O,{title:n("getPdfInfo.sections.documentInfo","Document Info"),anchorId:"documentInfo",obj:r.documentInfo}),e.jsx(qe,{anchorId:"compliance",complianceSummary:r.summaryData?.Compliance,legacyCompliance:r.compliance}),e.jsx(O,{title:n("getPdfInfo.sections.encryption","Encryption"),anchorId:"encryption",obj:r.encryption}),e.jsx(O,{title:n("getPdfInfo.sections.permissions","Permissions"),anchorId:"permissions",obj:r.permissions}),e.jsx(Me,{anchorId:"toc",tocArray:r.toc??[]}),e.jsx(Ue,{anchorId:"other",other:r.other}),e.jsx(We,{anchorId:"perPage",perPage:r.perPage})]})})})}):e.jsx("div",{className:"report-container",children:e.jsxs(c,{gap:"md",align:"center",children:[e.jsx(M,{color:"gray",variant:"light",children:"No Data"}),e.jsx(l,{size:"sm",c:"dimmed",children:"Run the tool to generate the report."})]})})},Y=[{id:"summary",labelKey:"getPdfInfo.summary.title",fallback:"PDF Summary"},{id:"metadata",labelKey:"getPdfInfo.sections.metadata",fallback:"Metadata"},{id:"formFields",labelKey:"getPdfInfo.sections.formFields",fallback:"Form Fields"},{id:"basicInfo",labelKey:"getPdfInfo.sections.basicInfo",fallback:"Basic Info"},{id:"documentInfo",labelKey:"getPdfInfo.sections.documentInfo",fallback:"Document Info"},{id:"compliance",labelKey:"getPdfInfo.sections.compliance",fallback:"Compliance"},{id:"encryption",labelKey:"getPdfInfo.sections.encryption",fallback:"Encryption"},{id:"permissions",labelKey:"getPdfInfo.sections.permissions",fallback:"Permissions"},{id:"toc",labelKey:"getPdfInfo.sections.tableOfContents",fallback:"Table of Contents"},{id:"other",labelKey:"getPdfInfo.sections.other",fallback:"Other"},{id:"perPage",labelKey:"getPdfInfo.sections.perPageInfo",fallback:"Per Page Info"}],Ze=s=>{const{t:n}=b(),{actions:t}=be(),o=we(),{registerCustomWorkbenchView:r,unregisterCustomWorkbenchView:i,setCustomWorkbenchViewData:a,clearCustomWorkbenchViewData:d}=Ce(),f="getPdfInfoReport",u="custom:getPdfInfoReport",j=m.useMemo(()=>e.jsx(Se,{fontSize:"small"}),[]),p=ze("getPdfInfo",Ne,te,s),g=p.operation,v=g.results.length>0,F=v||p.operation.isLoading||!!p.operation.errorMessage;m.useEffect(()=>(r({id:f,workbenchId:u,label:n("getPdfInfo.report.shortTitle","PDF Information"),icon:j,component:Qe}),()=>{d(f),i(f)}),[d,r,j,n,i]);const y=m.useMemo(()=>g.results.length===0?null:{generatedAt:g.results[0].summaryGeneratedAt??Date.now(),entr
1ies:g.results},[g.results]),w=m.useRef(null);return m.useEffect(()=>{if(y){a(f,y);const x=y.generatedAt??null;x&&x!==w.current&&(w.current=x,o.selectedTool==="getPdfInfo"&&o.workbench!==u&&t.setWorkbench(u))}else d(f),w.current=null},[d,t,o.selectedTool,o.workbench,y,a]),Fe({files:{selectedFiles:p.selectedFiles,isCollapsed:v},steps:[{title:n("getPdfInfo.indexTitle","Index"),isVisible:!!y,isCollapsed:!1,content:e.jsx(c,{gap:0,children:Y.map((x,C)=>e.jsxs(c,{gap:0,children:[e.jsx(ve,{onClick:()=>{y&&(a(f,{...y,scrollTo:x.id}),o.workbench!==u&&t.setWorkbench(u))},style:{width:"100%",textAlign:"left",padding:"8px 4px"},children:e.jsxs(D,{justify:"flex-start",gap:"sm",children:[e.jsx(ke,{fontSize:"small",style:{opacity:.7}}),e.jsx(l,{size:"md",c:"dimmed",children:n(x.labelKey,x.fallback)})]})}),C<Y.length-1&&e.jsx(_,{my:6})]},x.id))})},{title:n("getPdfInfo.results","Results"),isVisible:F,isCollapsed:!1,content:e.jsx(Oe,{operation:g,isLoading:p.operation.isLoading,errorMessage:p.operation.errorMessage})}],executeButton:{text:n("getPdfInfo.submit","Generate"),loadingText:n("loading","Loading..."),onClick:p.handleExecute,endpointEnabled:p.endpointEnabled,paramsValid:p.params.validateParameters(),isVisible:!0},review:{isVisible:!1,operation:p.operation,title:n("getPdfInfo.results","Results"),onUndo:p.handleUndo}})},ne=Ze;ne.tool=()=>te;ne.getDefaultParameters=()=>({...ee});export{ne as default};

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.