1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6101],{96522:function(e,r,t){t.d(r,{Z:function(){return d}});var a=t(85893),s=t(67294),l=t(11163),n=t(33291);function d(e){let{children:r}=e,t=(0,l.useRouter)();return(0,s.useEffect)(()=>{t.isReady&&(0,n.wM)(t.pathname)},[t.isReady,t.pathname]),(0,a.jsx)("div",{className:"flex w-full flex-1 flex-col min-h-0 bg-[var(--lightBg)] text-[var(--textBlack)]",children:r})}},52318:function(e,r,t){t.d(r,{h:function(){return m}});var a=t(85893),s=t(41664),l=t.n(s),n=t(11163),d=t(90163),i=t(43283),o=t(66466),c=t(19449);let x=[{href:"/pdf-tools/chat",label:"Chat PDF"},{href:"/pdf-tools/rearrange",label:"Rearrange"},{href:"/pdf-tools/extract",label:"Extract"},{href:"/pdf-tools/editor",label:"Editor"},{href:"/pdf-tools/rotate",label:"Rotate"},{href:"/pdf-tools/delete-pages",label:"Delete Pages"},{href:"/pdf-tools/merge",label:"Merge"},{href:"/pdf-tools/split",label:"Split"},{href:"/pdf-tools/convert",label:"Convert"},{href:"/pdf-tools/compress",label:"Compress"}];function m(e){let{onUploadClick:r,onStartOver:t,showStartOver:s=!1}=e,m=(0,n.useRouter)().pathname||"",u=(0,c.s)(e=>e.getActiveDocument());return(0,a.jsxs)("header",{className:"flex items-center gap-3 h-14 px-3 sm:px-4 bg-white dark:bg-slate-900 border-b border-gray-200 dark:border-slate-700 shrink-0 transition-colors",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[(0,a.jsx)("nav",{className:"hidden sm:flex flex-1 min-w-0 items-center gap-2 overflow-x-auto [scrollbar-width:thin] py-1",children:x.map(e=>{let r=m===e.href;return(0,a.jsx)(l(),{href:e.href,className:"shrink-0 px-2.5 sm:px-3 py-1.5 rounded-md text-sm transition-colors whitespace-nowrap ".concat(r?"font-medium":"text-gray-500 dark:text-slate-400 hover:text-gray-700 dark:hover:text-slate-300 hover:bg-gray-50 dark:hover:bg-slate-800"),style:r?{color:"var(--primary)",backgroundColor:"var(--activedropdown)"}:void 0,children:e.label},e.href)})}),u&&"/pdf-tools/chat"===m&&(0,a.jsxs)("div",{className:"flex min-w-0 max-sm:flex-1 items-center gap-2 border-gray-200 dark:border-slate-700 sm:ml-1 sm:max-w-[220px] sm:shrink-0 sm:border-l sm:pl-2",children:[(0,a.jsx)("span",{className:"truncate text-sm text-gray-600 dark:text-slate-300",title:u.filename,children:u.filename}),(0,a.jsxs)("span",{className:"shrink-0 text-xs text-gray-400 dark:text-slate-500",children:[u.pageCount," page",1!==u.pageCount?"s":""]})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 shrink-0 pl-0 sm:pl-1",children:[s&&t&&(0,a.jsxs)(o.z,{variant:"ghost",size:"sm",type:"button",onClick:t,"aria-label":"New document â return to upload",children:[(0,a.jsx)(d.Z,{className:"w-4 h-4"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:"New document"})]}),r&&(0,a.jsxs)(o.z,{variant:"primary",size:"sm",onClick:r,children:[(0,a.jsx)(i.Z,{className:"w-4 h-4"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:"Upload"})]})]})]})}},64937:function(e,r,t){t.d(r,{n:function(){return o}});var a=t(85893),s=t(67294),l=t(66466),n=t(23050),d=t(2553),i=t(33291);function o(e){let{message:r,buttonLabel:t,onReset:o,children:c,analyticsTool:x}=e;return(0,s.useEffect)(()=>{x&&(0,i.Ww)(x)},[x]),(0,a.jsx)("div",{className:"flex-1 flex items-center justify-center p-4 bg-gray-50 dark:bg-slate-900",children:(0,a.jsxs)("div",{className:"text-center space-y-6",children:[(0,a.jsx)("div",{className:"w-16 h-16 mx-auto bg-green-100 dark:bg-green-900/30 rounded-full flex items-center justify-center",children:(0,a.jsx)(n.Z,{className:"w-8 h-8 text-green-600 dark:text-green-400"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:"Download complete!"}),(0,a.jsx)("p",{className:"mt-2 text-gray-500 dark:text-slate-400",children:r}),c]}),(0,a.jsxs)(l.z,{variant:"primary",size:"lg",onClick:()=>{x&&(0,i.CS)(x),o()},children:[(0,a.jsx)(d.Z,{className:"w-5 h-5"}),t]})]})})}},34843:function(e,r,t){t.d(r,{g:function(){return m}});var a=t(85893),s=t(51821),l=t(67294),n=t(38074),d=t(78865),i=t(23432),o=t(83691),c=t(43283);
1let x=[{phase:"reading",label:"Read file into memory",detail:"Loading bytes from your device"},{phase:"parsing",label:"Analyze PDF",detail:"Validating structure and counting pages"},{phase:"preparing",label:"Prepare preview",detail:"Getting your document ready to view"}];function m(e){let{onSuccess:r,getUploadGeneration:m,idleHeadline:u}=e,[g,h]=(0,l.useState)(null),[p,f]=(0,l.useState)(!1),[b,y]=(0,l.useState)("idle"),[k,j]=(0,l.useState)(null),v=(0,l.useCallback)(async e=>{var a;if(h(null),0===e.length)return;let l=e[0],n=null!==(a=null==m?void 0:m())&&void 0!==a?a:0,d=()=>{var e;return(null!==(e=null==m?void 0:m())&&void 0!==e?e:0)!==n};f(!0),y("reading"),j(null);try{let e=await l.arrayBuffer();if(d())return;y("parsing");let a=await Promise.all([t.e(4928),t.e(8764)]).then(t.bind(t,28541));a.GlobalWorkerOptions.workerSrc=s.r;let n=a.getDocument({data:e.slice(0)});n.onProgress=e=>{if(d())return;let{loaded:r,total:t}=e;t>0?j(Math.min(100,Math.round(r/t*100))):j(null)};let i=await n.promise;if(d())return;let o=i.numPages;if(i.destroy(),d())return;y("preparing"),j(null);let c=URL.createObjectURL(new Blob([e],{type:"application/pdf"}));if(d()){URL.revokeObjectURL(c);return}r({filename:l.name,arrayBuffer:e,blobUrl:c,pageCount:o,fileSize:l.size})}catch(e){d()||h("Failed to read PDF. Please make sure the file is a valid PDF.")}finally{f(!1),y("idle"),j(null)}},[r,m]),{getRootProps:N,getInputProps:w,isDragActive:C}=(0,n.uI)({onDrop:v,accept:{"application/pdf":[".pdf"]},maxSize:26214400,multiple:!1,disabled:p}),P=e=>"idle"===e?-1:x.findIndex(r=>r.phase===e);return(0,a.jsxs)("div",{className:"w-full max-w-2xl mx-auto",children:[(0,a.jsxs)("div",{...N(),className:"relative border-2 border-dashed rounded-xl p-8 sm:p-12 text-center transition-all ".concat(C?"border-brand-500 bg-brand-50 dark:bg-brand-900/20 cursor-pointer":p?"border-brand-200 dark:border-brand-900/40 bg-brand-50/80 dark:bg-brand-950/20 cursor-wait":"border-gray-300 dark:border-slate-600 hover:border-brand-400 hover:bg-gray-50 dark:hover:bg-slate-800 cursor-pointer"),children:[(0,a.jsx)("input",{...w()}),p?(0,a.jsxs)("div",{className:"space-y-6 text-left max-w-md mx-auto",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:"Opening your PDF"}),(0,a.jsx)("p",{className:"mt-1 text-xs text-gray-500 dark:text-slate-400",children:"All steps run in your browser. Use âNew documentâ in the header anytime to cancel."})]}),(0,a.jsx)("ol",{className:"space-y-3",children:x.map((e,r)=>{let t=e.phase===b,s=P(b)>r;return(0,a.jsxs)("li",{className:"flex gap-3 rounded-lg border px-3 py-2.5 text-sm transition-colors ".concat(t?"border-brand-300 bg-white dark:bg-slate-800 dark:border-brand-700 shadow-sm":s?"border-gray-200 bg-gray-50/80 dark:bg-slate-800/50 dark:border-slate-600":"border-gray-100 bg-gray-50/50 text-gray-400 dark:border-slate-700 dark:bg-slate-900/30"),children:[(0,a.jsx)("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-gray-200 dark:border-slate-600 bg-white dark:bg-slate-800",children:s?(0,a.jsx)(d.Z,{className:"h-4 w-4 text-green-600 dark:text-green-400"}):t?(0,a.jsx)(i.Z,{className:"h-4 w-4 animate-spin text-brand-600"}):(0,a.jsx)("span",{className:"text-xs font-medium text-gray-400",children:r+1})}),(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsx)("span",{className:"font-medium ".concat(t||s?"text-gray-900 dark:text-slate-100":"text-gray-400 dark:text-slate-500"),children:e.label}),(0,a.jsx)("span",{className:"block text-xs text-gray-500 dark:text-slate-400 mt-0.5",children:e.detail}),"parsing"===e.phase&&t&&(0,a.jsx)("div",{className:"mt-2",children:null!=k?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-gray-200 dark:bg-slate-600",children:(0,a.jsx)("div",{className:"h-full rounded-full bg-brand-600 transition-[width] duration-150",style:{width:"".concat(k,"%")}})}),(0,a.jsxs)("p",{className:"mt-1 text-xs text-gray-500 dark:text-slate-400",children:[k,"% loaded"]})]}):(0,a.jsx)("p",{className:"text-xs text-gray-500 dark:text-slate-400",children:"Workingâ¦"})})]})]},e.phase)})}),(0,a.jsxs)("div",{className:"flex items-center justify-center gap-2 pt-2 border-t border-gray-200 dark:border-slate-600",children:[(0,a.jsx)(o.Z,{className:"w-4 h-4 text-brand-600 animate-pulse"}),(0,a.jsxs)("span",{className:"text-xs font-medium text-gray-600 dark:text-slate-300",children:["reading"===b&&"Reading fileâ¦","parsing"===b&&"Parsing PDFâ¦","preparing"===b&&"Almost readyâ¦"]})]})]}):(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)("div",{className:"w-16 h-16 mx-auto bg-brand-50 dark:bg-brand-900/20 rounded-full flex items-center justify-center",children:(0,a.jsx)(c.Z,{className:"w-8 h-8 ".concat(C?"text-brand-600":"text-brand-500")})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-base font-medium text-gray-700 dark:text-slate-300",children:C?"Drop your PDF here":u}),(0,a.jsx)("p",{className:"mt-1 text-sm text-gray-500 dark:text-slate-400",children:"Drag and drop or click to browse"})]}),(0,a.jsxs)("div",{className:"flex items-center justify-center gap-3 text-xs text-gray-400 dark:text-slate-500",children:[(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)(o.Z,{className:"w-3 h-3"})," PDF only"]}),(0,a.jsx)("span",{className:"text-gray-300 dark:text-slate-600",children:"|"}),(0,a.jsx)("span",{children:"Max 25MB"})]})]})]}),g&&(0,a.jsx)("div",{className:"mt-3 p-3 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg",children:(0,a.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:g})})]})}},66466:function(e,r,t){t.d(r,{z:function(){return s}});var a=t(85893);let s=(0,t(67294).forwardRef)((e,r)=>{let{variant:t="primary",size:s="md",className:l="",children:n,disabled:d,...i}=e;return(0,a.jsx)("button",{ref:r,className:"".concat("inline-flex items-center justify-center font-medium rounded-lg transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 dark:focus:ring-offset-slate-900 disabled:opacity-50 disabled:cursor-not-allowed"," ").concat({primary:"button_bg text_white hover:bg-opacity-90 focus:ring-0 focus:ring-offset-0 font-lato",secondary:"bg-gray-100 dark:bg-slate-700 text-gray-700 dark:text-slate-200 hover:bg-gray-200 dark:hover:bg-slate-600 focus:ring-gray-400 border border-gray-300 dark:border-slate-600",ghost:"text-gray-600 dark:text-slate-300 hover:bg-gray-100 dark:hover:bg-slate-700 focus:ring-gray-400",danger:"bg-red-600 text-white hover:bg-red-700 focus:ring-red-500"}[t]," ").concat({sm:"px-2.5 py-1.5 text-xs gap-1",md:"px-4 py-2 text-sm gap-2",lg:"px-6 py-3 text-base gap-2"}[s]," ").concat(l),disabled:d,...i,children:n})});s.displayName="Button"},59995:function(e,r,t){t.d(r,{Q:function(){return l}});var a=t(67294),s=t(33291);function l(e,r){(0,a.useEffect)(()=>{(0,s.pm)(e,r)},[e,r])}},51821:function(e,r,t){t.d(r,{r:function(){return s}});var a=t(34155);let s=(void 0!==a&&a.env.NEXT_PUBLIC_PDFJS_WORKER_URL?a.env.NEXT_PUBLIC_PDFJS_WORKER_URL:"")||"/pdf.worker.min.mjs"},78865:function(e,r,t){t.d(r,{Z:function(){return a}});let a=(0,t(31134).Z)("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},23050:function(e,r,t){t.d(r,{Z:function(){return a}});let a=(0,t(31134).Z)("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]])},23432:function(e,r,t){t.d(r,{Z:function(){return a}});let a=(0,t(31134).Z)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])}}]);
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.