PageSourceSearch

https://localpdf.online/app/assets/index-7K0eYXQ0.js

js localpdf.online collected 2026-10-02 01:06:22 UTC 10,448 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-excel--wYEJF5V.js","assets/vendor-react-C_xdI0Ng.js"])))=>i.map(i=>d[i]);
2import{u as Q,_ as Y}from"./index-DbFRh42P.js";import{r as l,j as e}from"./vendor-react-C_xdI0Ng.js";import{L as p}from"./linear-icon-BS_Bu1OG.js";import"./vendor-icons-CmfhFn4k.js";function ae({inputFiles:r,onStart:A,onBack:M,onPickFiles:t,onClearFiles:S,currentStep:C,progress:$=0,outputCount:E=0,onDownload:L}){const{runtime:x}=Q(),v=l.useRef(null),[a,B]=l.useState([]),[h,T]=l.useState("portrait"),[f,G]=l.useState("one-page"),[b,W]=l.useState("workbook"),[m,X]=l.useState(!0),[j,U]=l.useState(""),[P,u]=l.useState([]),[n,d]=l.useState([]),[w,R]=l.useState("preview");l.useEffect(()=>{(async()=>{const s=await Promise.all(r.map(async o=>(await x.vfs.read(o)).getName()));B(s)})()},[r,x.vfs]),l.useEffect(()=>{(async()=>{var s;if(r.length===0){u([]),d([]);return}try{const H=await(await(await x.vfs.read(r[0])).getBlob()).arrayBuffer(),D=(s=(await Y(()=>import("./vendor-excel--wYEJF5V.js").then(i=>i.e),__vite__mapDeps([0,1]))).default)==null?void 0:s.Workbook;if(!D){u([]),d([]);return}const I=new D;await I.xlsx.load(H);const g=I.worksheets.map(i=>i.name).filter(Boolean);u(g),d(i=>{if(i.length===0)return g;const O=i.filter(J=>g.includes(J));return O.length>0?O:g})}catch{u([]),d([])}})()},[r,x.vfs]);const _=a[0]??"No file selected",F=l.useMemo(()=>{if(a.length===0)return"report.pdf";const c=a[0],s=c.lastIndexOf(".");return`${s>0?c.slice(0,s):c}.pdf`},[a]),K=n.length>0?n.join(", "):"all",y=C==="processing",N=C==="result"&&E>0,V=a.length>0&&!y,q=c=>{d(s=>{if(s.includes(c)){const o=s.filter(k=>k!==c);return o.length>0?o:s}return[...s,c]})},z=async c=>{const s=c.target.files?Array.from(c.target.files):[];c.target.value="",!(s.length===0||!t)&&await t(s)};return e.jsx("div",{className:"tool-config-root excel-concept-root",children:e.jsxs("div",{className:"ocr-concept-workspace",children:[e.jsxs("section",{className:"tool-config-card ocr-concept-left excel-concept-left",children:[e.jsx("h3",{className:"excel-concept-title",children:"Excel conversion"}),e.jsxs("div",{className:`ocr-concept-upload ${t?"":"upload-readonly"}`,role:t?"button":void 0,tabIndex:t?0:-1,onClick:()=>{var c;t&&((c=v.current)==null||c.click())},onKeyDown:c=>{var s;t&&(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),(s=v.current)==null||s.click())},children:[e.jsx("input",{ref:v,type:"file",accept:".xls,.xlsx,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",style:{display:"none"},onChange:c=>{z(c)}}),e.jsx("div",{className:"ocr-concept-upload-icon",children:e.jsx(p,{name:"excel",className:"linear-icon icon-md"})}),e.jsx("p",{className:"ocr-concept-upload-title",children:"Drop table or click to upload"}),e.jsx("p",{className:"ocr-concept-upload-copy",children:"XLS and XLSX. Local processing in browser runtime."}),e.jsxs("div",{className:"ocr-concept-file-chip",children:[e.jsx("span",{className:"ocr-concept-file-name",children:_}),a.length>0&&S?e.jsx("button",{type:"button",className:"ocr-concept-clear-btn",onClick:c=>{c.stopPropagation(),S()},"aria-label":"Clear selected files",children:e.jsx(p,{name:"x",className:"linear-icon"})}):e.jsx(p,{name:"refresh",className:"linear-icon"})]})]}),e.jsxs("div",{className:"ocr-concept-settings",children:[e.jsx("label",{className:"tool-config-label",htmlFor:"excel-orientation",children:"Page orientation"}),e.jsxs("select",{id:"excel-orientation",className:"tool-config-select",value:h,onChange:c=>T(c.target.value==="landscape"?"landscape":"portrait"),children:[e.jsx("option",{value:"portrait",children:"Portrait"}),e.jsx("option",{value:"landscape",children:"Landscape"})]}),e.jsx("label",{className:"tool-config-label",htmlFor:"excel-scale",children:"Scaling"}),e.jsxs("select",{id:"excel-scale",className:"tool-config-select",value:f,onChange:c=>{const s=c.target.value;G(s==="fit-columns"||s==="none"?s:"one-page")},children:[e.jsx("option",{value:"one-page",children:"Fit worksheet to one page"}),e.jsx("option",{value:"fit-columns",children:"Fit all columns to width"}),e.jsx("option",{value:"none",children:"No scaling"})]}),e.jsx("label",{className:"tool-config-label",htmlFor:"excel-range",children:"Range"}),e.jsxs("select",{id:"excel-range",className:"tool-config-select",value:b,onChange:c=>W(c.target.value==="active-sheet"?"active-sheet":"workbook"),children:[e.jsx("option",{value:"workbook",children:"Whole workbook"}),e.jsx("option",{value:"active-sheet",children:"Active sheet only"})]}),e.jsxs("label",{className:"ocr-concept-check",children:[e.jsx("input",{type:"checkbox",checked:m,onChange:c=>X(c.target.checked)}),"Show table grid"]}),e.jsx("label",{className:"tool-config-label",htmlFor:"excel-page-selection",children:"Output pages"}),e.jsx("input",{id:"excel-page-selection",className:"tool-config-input",placeholder:"All pages (or 1,3-5)",value:j,onChange:c=>U(c.target.value)}),P.length>0?e.jsxs("div",{children:[e.jsx("label",{className:"tool-config-label",children:"Sheets"}),e.jsx("div",{className:"tool-config-grid",children:P.map(c=>e.jsxs("label",{className:"ocr-concept-check",children:[e.jsx("input",{type:"checkbox",checked:n.includes(c),onChange:()=>q(c)}),c]},c))})]}):null]}),e.jsxs("div",{className:"tool-config-actions ocr-concept-actions",children:[e.jsx("button",{className:"btn-ghost",onClick:M,children:"Cancel"}),e.jsxs("button",{className:"btn-primary btn-inline",disabled:!V,onClick:()=>
2{if(N&&L){L();return}A({orientation:h,scaling:f,range:b,showGrid:m,pageSelection:j,selectedSheets:n})},children:[e.jsx(p,{name:N?"download":"play",className:"linear-icon"}),N?"Download PDF":y?"Converting...":"Convert to PDF"]})]}),a.length===0?e.jsx("p",{className:"tool-config-help",children:"Upload an Excel file to configure conversion options."}):e.jsxs("p",{className:"tool-config-help",children:["Selected sheets: ",n.length>0?n.join(", "):"all"," · ","Output pages: ",j||"all"]})]}),e.jsx("section",{className:"tool-config-card ocr-concept-right",children:a.length===0?e.jsxs("div",{className:"ocr-concept-empty",children:[e.jsx(p,{name:"excel",className:"linear-icon icon-md"}),e.jsx("h4",{className:"ocr-concept-empty-title",children:"Excel to PDF"}),e.jsx("p",{className:"ocr-concept-empty-copy",children:"Upload a spreadsheet and preview layout will appear here."}),e.jsxs("div",{className:"excel-pdf-empty-hint",children:[e.jsx("span",{className:"excel-pdf-empty-pill",children:"Local runtime only"}),e.jsx("span",{className:"excel-pdf-empty-pill",children:"Layout preview before export"})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"ocr-concept-tabs",role:"tablist","aria-label":"Excel preview tabs",children:[e.jsx("button",{type:"button",className:`ocr-concept-tab ${w==="preview"?"active":""}`,onClick:()=>R("preview"),children:"Preview"}),e.jsx("button",{type:"button",className:`ocr-concept-tab ${w==="details"?"active":""}`,onClick:()=>R("details"),children:"Details"})]}),e.jsxs("div",{className:"ocr-concept-toolbar",children:[y&&e.jsxs("span",{className:"tool-config-help excel-concept-toolbar-note",children:["Converting... ",Math.max(0,Math.min(100,Math.round($))),"%"]}),N&&e.jsxs("span",{className:"tool-config-help excel-concept-toolbar-note",children:["Conversion complete. ",E," output file(s) ready."]})]}),e.jsx("div",{className:"ocr-concept-editor",children:w==="preview"?e.jsxs("div",{className:`excel-concept-pdf-page ${h==="landscape"?"landscape":""}`,children:[e.jsx("div",{className:"excel-concept-sheet-title"}),e.jsxs("table",{className:`excel-concept-table ${m?"":"no-grid"}`,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:e.jsx("div",{className:"excel-concept-cell-skel"})}),e.jsx("th",{children:e.jsx("div",{className:"excel-concept-cell-skel"})}),e.jsx("th",{children:e.jsx("div",{className:"excel-concept-cell-skel long"})}),e.jsx("th",{children:e.jsx("div",{className:"excel-concept-cell-skel"})})]})}),e.jsx("tbody",{children:Array.from({length:4}).map((c,s)=>e.jsxs("tr",{children:[e.jsx("td",{children:e.jsx("div",{className:"excel-concept-cell-skel"})}),e.jsx("td",{children:e.jsx("div",{className:"excel-concept-cell-skel"})}),e.jsx("td",{children:e.jsx("div",{className:"excel-concept-cell-skel long"})}),e.jsx("td",{children:e.jsx("div",{className:"excel-concept-cell-skel"})})]},s))})]}),e.jsxs("div",{className:"excel-concept-chart",children:[e.jsx("span",{className:"excel-concept-bar h40"}),e.jsx("span",{className:"excel-concept-bar h70"}),e.jsx("span",{className:"excel-concept-bar h50"}),e.jsx("span",{className:"excel-concept-bar h90"}),e.jsx("span",{className:"excel-concept-bar h60"})]})]}):e.jsxs("div",{className:"excel-concept-details",children:[e.jsxs("div",{className:"excel-concept-details-row",children:[e.jsx("span",{className:"excel-concept-details-label",children:"Input"}),e.jsx("span",{className:"excel-concept-details-value",children:_})]}),e.jsxs("div",{className:"excel-concept-details-row",children:[e.jsx("span",{className:"excel-concept-details-label",children:"Output"}),e.jsx("span",{className:"excel-concept-details-value",children:F})]}),e.jsxs("div",{className:"excel-concept-details-row",children:[e.jsx("span",{className:"excel-concept-details-label",children:"Orientation"}),e.jsx("span",{className:"excel-concept-details-value",children:h})]}),e.jsxs("div",{className:"excel-concept-details-row",children:[e.jsx("span",{className:"excel-concept-details-label",children:"Scaling"}),e.jsx("span",{className:"excel-concept-details-value",children:f})]}),e.jsxs("div",{className:"excel-concept-details-row",children:[e.jsx("span",{className:"excel-concept-details-label",children:"Range"}),e.jsx("span",{className:"excel-concept-details-value",children:b})]}),e.jsxs("div",{className:"excel-concept-details-row",children:[e.jsx("span",{className:"excel-concept-details-label",children:"Grid"}),e.jsx("span",{className:"excel-concept-details-value",children:m?"shown":"hidden"})]}),e.jsxs("div",{className:"excel-concept-details-row",children:[e.jsx("span",{className:"excel-concept-details-label",children:"Pages"}),e.jsx("span",{className:"excel-concept-details-value",children:j||"all"})]}),e.jsxs("div",{className:"excel-concept-details-row",children:[e.jsx("span",{className:"excel-concept-details-label",children:"Sheets"}),e.jsx("span",{className:"excel-concept-details-value",children:K})]})]})})]})})]})})}export{ae 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.