1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[368],{6368:(e,t,r)=>{r.r(t),r.d(t,{default:()=>o});var l=r(5155),a=r(2115);function o(e){let{url:t,urls:o}=e,n=a.useRef(null),[i,s]=a.useState(!0),[c,d]=a.useState(null);return a.useEffect(()=>{let e=!1;async function l(){s(!0),d(null);let l=o||(t?[t]:[]);if(0===l.length)return void s(!1);try{let t;try{t=await r.e(213).then(r.bind(r,9139))}catch(e){console.warn("pdfjs-dist not available, falling back to iframe viewer",e),d("pdfjs-dist not installed; using iframe fallback");return}let a="/pdf.worker.min.js";try{let e=await fetch(a,{method:"HEAD"});if(e.ok)t.GlobalWorkerOptions.workerSrc=a,console.debug("Using local pdf.worker at",a);else{console.warn("Local pdf.worker not found at",a,"status",e.status);let r="https://unpkg.com/pdfjs-dist@".concat(t.version,"/legacy/build/pdf.worker.min.js");t.GlobalWorkerOptions.workerSrc=r,console.debug("Falling back to CDN pdf.worker at",r)}}catch(r){console.warn("Could not check local pdf.worker; falling back to CDN",r);let e="https://unpkg.com/pdfjs-dist@".concat(t.version,"/legacy/build/pdf.worker.min.js");t.GlobalWorkerOptions.workerSrc=e}let o=n.current;if(!o)return;o.innerHTML="";let i=0;for(let r of l){if(e)break;try{let l=t.getDocument(r),a=await l.promise;i++;for(let t=1;t<=a.numPages&&!e;t++){let e=await a.getPage(t),r=document.createElement("div");r.className="w-full mb-4 flex justify-center";let l=document.createElement("canvas"),n=l.getContext("2d"),i=o.clientWidth||800,s=e.getViewport({scale:1}),c=i/s.width,d=e.getViewport({scale:c});l.width=Math.floor(d.width),l.height=Math.floor(d.height),l.style.width="100%",l.style.height="auto",r.appendChild(l),o.appendChild(r),await e.render({canvasContext:n,viewport:d}).promise}}catch(e){console.error("Error rendering PDF ".concat(r),e)}}if(0===i&&l.length>0)throw Error("Falha ao carregar o PDF (poss\xedvel erro de CORS ou arquivo inv\xe1lido).")}catch(t){console.error("PDF render error",t),e||d(String((null==t?void 0:t.message)||t))}finally{e||s(!1)}}l();let a=()=>{l()};return window.addEventListener("resize",a),()=>{e=!0,window.removeEventListener("resize",a)}},[t,o]),(0,l.jsxs)("div",{className:"w-full h-full flex flex-col",children:[i&&(0,l.jsx)("div",{className:"p-4 text-center text-sm text-gray-500",children:"Carregando PDF..."}),!i&&c?(0,l.jsx)("div",{className:"w-full flex-1",children:(0,l.jsx)("iframe",{src:t,className:"w-full h-full",title:"PDF fallback"})}):(0,l.jsx)("div",{ref:n,className:"w-full flex-1 overflow-auto px-2 py-2"})]})}}}]);
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.