PageSourceSearch

https://internxt.com/_next/static/chunks/pages/file-compressor/[filename]-3a2dc1fe67a0ac94.js

js internxt.com collected 2026-09-24 08:27:54 UTC 17,569 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2938],{6409:(e,t,s)=>{"use strict";s.d(t,{t:()=>n});var a=s(37876),l=s(41769),r=s(62442);let i=({text:e,className:t=""})=>{if(!e)return null;let s=e.split(" ");return(0,a.jsxs)("span",{className:t,children:[(0,a.jsx)("span",{className:"font-semibold",children:s[0]})," ",s.slice(1).join(" ")]})},n=({textContent:e,bannerText:t,lang:s})=>(0,a.jsx)("section",{className:"overflow-hidden px-5 py-20",children:(0,a.jsxs)("div",{className:"flex w-full flex-col items-center space-y-8",children:[(0,a.jsx)(r.A,{textContent:t,lang:"en"}),(0,a.jsx)("div",{className:"flex max-w-[832px] flex-col pt-16",children:(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("p",{className:"pb-4 text-center text-2xl font-medium text-gray-100",children:e.howToConvert.title}),(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:e.howToConvert.steps.map((e,t)=>(0,a.jsxs)("div",{className:"flex w-[256px] flex-col items-start gap-6 rounded-xl bg-gray-1 p-6 shadow-md",children:[(0,a.jsx)("span",{className:"mb-2 text-2xl font-medium text-primary",children:t+1}),(0,a.jsx)(i,{text:e.description,className:"text-base text-gray-80"})]},e.step))}),(0,a.jsx)("p",{className:"pt-6 text-base text-gray-80",children:e.howToConvert.outro})]})]})}),(0,a.jsxs)("div",{className:"flex max-w-[832px] flex-col",children:[(0,a.jsx)("p",{className:"pb-4 text-2xl font-medium text-gray-100",children:e.whyConvert.title}),(0,a.jsx)("p",{className:"pb-1 text-base text-gray-80",children:e.whyConvert.intro}),(0,a.jsx)("ul",{className:"my-2 flex flex-col space-y-3 pl-10",children:e.whyConvert.bullets.map((e,t)=>(0,a.jsxs)("li",{className:"flex items-center space-x-2",children:[(0,a.jsx)(l.n,{size:20,className:"mt-1 text-primary"}),(0,a.jsx)("span",{className:"text-base text-gray-80",children:e})]},t))}),(0,a.jsx)("p",{className:"pt-2 text-base text-gray-80",children:e.whyConvert.outro})]})]})})},9323:(e,t,s)=>{"use strict";s.d(t,{A:()=>l});var a=s(37876);let l=({textContent:e,files:t,onCancel:s,onFileConvert:l})=>{let r=t.length>1,i=t&&r?"Files":t[0].name;return(0,a.jsxs)("div",{className:"flex flex-col items-center space-y-8 text-center",children:[(0,a.jsx)("h3",{className:"text-3xl font-semibold",children:e.title}),(0,a.jsx)("p",{className:"text-lg font-semibold text-gray-60",children:i}),(0,a.jsxs)("div",{className:"flex flex-col gap-2 md:flex-row",children:[(0,a.jsx)("button",{onClick:s,className:"rounded-lg border border-gray-5 bg-white px-5 py-2.5 font-medium text-gray-80 shadow-sm hover:bg-gray-10",children:e.cancel}),(0,a.jsx)("button",{onClick:e=>{e.preventDefault(),l(t)},className:"rounded-lg bg-primary px-5 py-2.5 font-medium text-white hover:bg-primary-dark",children:e.convert})]})]})}},10391:(e,t,s)=>{"use strict";s.d(t,{W:()=>i});var a=s(37876),l=s(14232),r=s(41677);let i=({textContent:e,errorContent:t,error:s,resetViewToInitialState:i})=>{let[n,o]=(0,l.useState)();return(0,l.useEffect)(()=>{s&&o(s)},[s]),(0,a.jsx)("div",{className:"flex flex-col items-center space-y-8 text-center",children:n&&(0,a.jsx)(s=>({bigFile:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-row space-x-2 rounded-lg bg-red/8 p-4",children:[(0,a.jsx)(r.t,{className:"mt-0.5 hidden text-red sm:mt-0 md:flex",size:19.5}),(0,a.jsxs)("p",{className:"text-gray-100",children:[(0,a.jsxs)("span",{className:"font-semibold",children:[t.bigFile.label," "]}),e.maxFileSize,"."]})]}),(0,a.jsx)("p",{className:"text-3xl font-semibold text-gray-100",children:t.bigFile.selectFile}),(0,a.jsx)("button",{className:"flex rounded-lg bg-primary px-5 py-2.5 text-white",onClick:i,children:(0,a.jsx)("p",{className:"font-medium",children:e.cta})})]}),internalError:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-row space-x-2 rounded-lg bg-red/8 p-4",children:[(0,a.jsx)(r.t,{className:"mt-0.5 hidden text-red sm:mt-0 md:flex",size:19.5}),(0,a.jsxs)("p",{className:"text-gray-100",children:[(0,a.jsx)("span",{className:"font-semibold",children:t.internalError.label.bold}),t.internalError.label.normal]})]}),(0,a.jsx)("p",{className:"text-3xl font-semibold text-gray-100",children:e.dragYourFile}),(0,a.jsx)("button",{className:"flex rounded-lg bg-primary px-5 py-2.5 text-white",onClick:i,children:(0,a.jsx)("p",{className:"font-medium",children:e.cta})})]}),unsupportedFormat:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-row space-x-2 rounded-lg bg-red/8 p-4",children:[(0,a.jsx)(r.t,{className:"mt-0.5 hidden text-red sm:mt-0 md:flex",size:19.5}),(0,a.jsxs)("p",{className:"text-gray-100",children:[(0,a.jsx)("span",{className:"font-semibold",children:t.unsupportedFormat.label.bold}),t.unsupportedFormat.label.normal]})]}),(0,a.jsx)("p",{className:"text-3xl font-semibold text-gray-100",children:e.dragYourFile}),(0,a.jsx)("button",{className:"flex rounded-lg bg-primary px-5 py-2.5 text-white",onClick:i,children:(0,a.jsx)("p",{className:"font-medium",children:e.cta})})]})})[s.state],{state:n})})}},15616:(e,t,s)=>{"use strict";s.a(e,async(e,a)=>{try{s.d(t,{q:()=>w});var l=s(37876),r=s(14232),i=s(14e3),n=s(33993),o=s(22557),c=s(9323),d=s(76454),p=s(90327),m=s(15757),x=s(10391),f=s(52442),h=s(50191),g=s(14847),u=e([m]);m=(u.then?(await u)():u)[0];let w=({textContent:e,converterText:t,errorContent:s,pathname:a})=>{let u=(0,i.useRouter)(),[w,b]=(0,r.useState)(null),[j,y]=(0,r.useState)("initialState"),[v,N]=(0,r.useState)(null),[F,C]=(0,r.useState)(!1),k=(0,r.createRef)(),S=(0,r.useMemo)(()=>a.split("-")[1]||"pdf",[a]),A={jpg:["jpg","jpeg"],png:["png"],pdf:["pdf"],mov:["mov","mp4"],zip:["zip"],word:["doc","docx"],excel:["xls","xlsx"],ppt:["ppt","pptx"]}[S]||[],z=n.WO[S],D=(0,r.useMemo)(()=>(0,g.v)(t,{pathFrom:n.Zi[S]}),[t,S]),E=(0,r.useMemo)(()=>(0,g.v)(s,{pathFrom:n.Zi[S]}),[s,S]),O=F?"border border-dashed border-primary":"border-4 border-dashed border-primary/8 bg-primary/2",P=(0,r.useCallback)(()=>{N(null),b(null),y("initialState"),C(!1),k.current&&(k.current.value="")},[k]),_=e=>{let t=e.length>0?e.item(0):null;if(!t)return;if(Array.from(e).reduce((e,t)=>
1e+t.size,0)>n.w3){N("bigFile"),y("errorState");return}let s=t.name.split(".").pop()?.toLowerCase()||"";if(!A.includes(s)){N("unsupportedFormat"),y("errorState");return}b(e),y("selectedFileState")},T=e=>{_(e)},L=()=>{k.current?.click()},$=async()=>{if(S&&w&&w[0]){y("compressingState");try{let e,t=w[0].name.split(".").pop()?.toLowerCase()||"";for(let[s,a]of Object.entries(n.iz))if(a.includes(t)){e=s.replace("Compression","");break}if(!e)throw Error("Unsupported file type");await m.A.handleFileCompression(w[0],e,t),y("downloadFileState")}catch(t){let e=t.message.includes("File too large")?"bigFile":"internalError";N(e),y("errorState")}}};return(0,l.jsxs)("section",{className:"overflow-hidden bg-gray-1 pb-20 pt-32",children:[(0,l.jsx)("input",{className:"pointer-events-none absolute h-0 w-0 overflow-hidden",type:"file",accept:`${z}`,multiple:!1,id:"uploadFile",ref:k,tabIndex:-1,onChange:()=>{k.current?.files&&_(k.current.files)}}),(0,l.jsxs)("div",{className:"flex flex-col items-center space-y-12 px-5",children:[(0,l.jsxs)("div",{className:"flex flex-col items-center space-y-5 text-center",children:[(0,l.jsxs)("div",{className:"relative flex h-[58px] items-center text-center lg:w-[60rem] lg-xl:w-[65rem] 1.5xl:w-[72rem] 2xl:w-[80rem]",children:[(0,l.jsxs)("div",{className:"absolute left-0 hidden cursor-pointer flex-row items-center justify-end rounded-sm-6 border-[1.5px] border-primary px-4 py-2 pt-2.5 hover:bg-white/50 lg:flex",onClick:()=>u.back(),children:[(0,l.jsx)(f.Z,{className:"text-primary",size:24}),(0,l.jsx)("p",{className:"pl-1 text-base font-medium text-primary",children:"Back"})]}),(0,l.jsx)("p",{className:"absolute left-1/2 -translate-x-1/2 text-5xl font-semibold",children:D.title})]}),(0,l.jsx)("h2",{className:"max-w-[865px] pt-2 text-xl text-gray-80",children:e.description}),(0,l.jsxs)("div",{className:"flex flex-row items-center space-x-1",children:[(0,l.jsx)(h.o,{size:16,className:"text-green"}),(0,l.jsx)("p",{className:"text-sm font-medium text-gray-80",children:e.secureUpload})]})]}),(0,l.jsx)("div",{className:`flex w-full max-w-screen-lg flex-col items-center space-y-8 rounded-2xl px-5 ${O} py-12`,children:(()=>{switch(j){case"initialState":return(0,l.jsx)(o.A,{textContent:D.dragNDropArea,pathFrom:n.Zi[S],handleFileDrop:T,isDragging:F,setIsDragging:C,handleOpenFileExplorer:L});case"selectedFileState":return w&&(0,l.jsx)(c.A,{textContent:D.fileSelected,files:w,onFileConvert:$,onCancel:P});case"compressingState":return(0,l.jsxs)("div",{className:"flex h-full w-full flex-col items-center justify-center space-y-4 bg-opacity-3",children:[(0,l.jsxs)("div",{className:"relative",children:[(0,l.jsx)("div",{className:"absolute inset-1",children:(0,l.jsx)("div",{className:"upDownMotion absolute left-0 z-10 h-1 w-full -translate-y-1/2 rounded-xl bg-primary shadow-2xl"})}),(0,l.jsx)(d.A,{})]}),(0,l.jsx)("p",{className:"text-2xl font-semibold",children:D.compressing})]});case"downloadFileState":return(0,l.jsx)(p.A,{textContent:D.fileConverted,onConvertMoreFilesButtonPressed:P,onDownloadFile:$});case"errorState":return(0,l.jsx)(x.W,{error:v,resetViewToInitialState:P,errorContent:E,textContent:D.dragNDropArea});default:return null}})()})]})]})};a()}catch(e){a(e)}})},15757:(e,t,s)=>{"use strict";s.a(e,async(e,a)=>{try{s.d(t,{A:()=>x});var l=s(53114),r=s(97283),i=s(83587),n=s(27524),o=s.n(n),c=s(3866),d=s(53553),p=e([d]);(d=(p.then?(await p)():p)[0]).EA.workerSrc=`https://unpkg.com/pdfjs-dist@${d.rE}/build/pdf.worker.min.mjs`;class m{async handleFileCompression(e,t,s){let a;switch(t){case"image":a=await this.compressImage(e);break;case"video":a=await this.compressVideo(e);break;case"archive":a=await this.compressArchive(e);break;case"document":a=["docx","pptx","xlsx"].includes(s)?await this.compressOfficeDocument(e):await this.compressDocument(e,s);break;default:a=e}this.downloadFile(a,e.name)}async compressDocument(e,t){if("pdf"!==t)return e;try{let t=await e.arrayBuffer(),s=await c.PDFDocument.load(t),a=await s.save({useObjectStreams:!0,addDefaultPage:!1}),l=new Blob([a],{type:"application/pdf"}),r=d.YE({data:t}),i=await r.promise,n=await c.PDFDocument.create();for(let e=1;e<=i.numPages;e++){let t=await i.getPage(e),s=t.getViewport({scale:2}),a=document.createElement("canvas"),l=a.getContext("2d");if(!l)continue;a.height=s.height,a.width=s.width,await t.render({canvasContext:l,viewport:s}).promise;let r=a.toDataURL("image/jpeg",.55),o=await fetch(r).then(e=>e.arrayBuffer()),c=await n.embedJpg(o);n.addPage([s.width,s.height]).drawImage(c,{x:0,y:0,width:s.width,height:s.height})}let o=await n.save({useObjectStreams:!0}),p=new Blob([o],{type:"application/pdf"}),m=[{blob:e,size:e.size},{blob:l,size:l.size},{blob:p,size:p.size}];return m.sort((e,t)=>
1e.size-t.size),m[0].blob}catch(t){return console.error("Error during PDF compression:",t),e}}async compressImage(e){return await (0,i.A)(e,{maxSizeMB:1,maxWidthOrHeight:1920,useWebWorker:!0,initialQuality:.6})}async compressVideo(e){if(this.ffmpeg||(this.ffmpeg=new l.FFmpeg),!this.ffmpeg.loaded){let e="https://unpkg.com/@ffmpeg/[email protected]/dist/umd";await this.ffmpeg.load({coreURL:await (0,r.KA)(`${e}/ffmpeg-core.js`,"text/javascript"),wasmURL:await (0,r.KA)(`${e}/ffmpeg-core.wasm`,"application/wasm")})}let t=`input_${Date.now()}_${e.name.replaceAll(" ","_")}`,s=`output_${Date.now()}.mp4`;await this.ffmpeg.writeFile(t,await (0,r.t2)(e)),await this.ffmpeg.exec(["-i",t,"-vcodec","libx264","-crf","32","-preset","ultrafast","-movflags","faststart","-acodec","aac",s]);let a=await this.ffmpeg.readFile(s);return await this.ffmpeg.deleteFile(t),await this.ffmpeg.deleteFile(s),new Blob([a],{type:"video/mp4"})}async compressOfficeDocument(e){try{let t=new(o()),s=await t.loadAsync(e),a={maxSizeMB:.2,maxWidthOrHeight:1024,useWebWorker:!0,initialQuality:.5,fileType:"image/jpeg"},l=[];s.forEach((e,t)=>{if(/\.(jpg|jpeg|png|tif|tiff)$/i.test(e)){let r=(async()=>{let l=await t.async("blob"),r=e.split("/").pop()||"image.jpg",n=new File([l],r,{type:"image/jpeg"});try{let t=await (0,i.A)(n,a);s.file(e,t)}catch(e){}})();l.push(r)}}),await Promise.all(l);let r=await s.generateAsync({type:"blob",compression:"DEFLATE",compressionOptions:{level:9}});return r.size<e.size?r:e}catch(t){return e}}async compressArchive(e){let t=new(o()),s=await t.loadAsync(e);return await s.generateAsync({type:"blob",compression:"DEFLATE",compressionOptions:{level:9}})}downloadFile(e,t){let s=URL.createObjectURL(e),a=document.createElement("a");a.href=s;let l=t.split(".").slice(0,-1).join(".");a.download=`compressed_${l}.${t.split(".").pop()}`,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(s)}constructor(){this.ffmpeg=null}}let x=new m;a()}catch(e){a(e)}})},18878:(e,t,s)=>{"use strict";s.a(e,async(e,a)=>{try{s.r(t),s.d(t,{__N_SSP:()=>m,default:()=>x});var l=s(37876),r=s(43541),i=s(71511),n=s(64589),o=s(86201),c=s(15616),d=s(6409),p=e([c]);c=(p.then?(await p)():p)[0];var m=!0;let x=({metatagsDescriptions:e,navbarLang:t,textContent:s,converterText:a,errorContent:p,footerLang:m,lang:x,toolsContent:f,pathname:h,bannerLang:g})=>{let u=e.filter(e=>e.id===h),w=`/file-compressor/${h}`;return(0,l.jsxs)(r.A,{segmentName:"File Converter",title:u[0].title,description:u[0].description,lang:x,pathnameForSEO:w,children:[(0,l.jsx)(i.A,{textContent:t,lang:x,cta:["default"],fixed:!0}),(0,l.jsx)(c.q,{textContent:s.ConverterSection,converterText:a,errorContent:p,pathname:h}),(0,l.jsx)(d.t,{textContent:s.FeaturesSection,bannerText:g.SignUpFileCompressorBanner,lang:x}),(0,l.jsx)(o.D,{textContent:f,lang:x}),(0,l.jsx)(n.A,{textContent:m,lang:x,hideNewsletter:!1})]})};a()}catch(e){a(e)}})},22557:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});var a=s(37876),l=s(86924),r=s(76454),i=s(14847);let n=({textContent:e,isDragging:t,pathFrom:s,handleFileDrop:n,setIsDragging:o,handleOpenFileExplorer:c})=>(0,a.jsx)(l.A,{onItemsDropped:n,isDragging:t,setIsDragging:o,children:(0,a.jsx)("div",{className:"flex flex-col items-center space-y-8 text-center",children:t?(0,a.jsxs)("div",{className:"flex flex-col items-center space-y-4",children:[(0,a.jsx)(r.A,{}),(0,a.jsx)("p",{className:"text-2xl font-semibold",children:e.draggingFile})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"flex flex-col rounded-lg bg-orange-100 px-4 py-2",children:(0,a.jsx)("p",{className:"font-semibold text-orange-1",children:e.maxFileSize})}),(0,a.jsx)("p",{className:"text-3xl font-semibold text-gray-100",children:(0,i.v)(e.dragYourFile,{pathFrom:s})}),(0,a.jsx)("button",{className:"flex rounded-lg bg-primary px-5 py-2.5 text-white",onClick:c,children:(0,a.jsx)("p",{className:"font-medium",children:(0,i.v)(e.cta,{pathFrom:s})})})]})})})},33993:(e,t,s)=>{"use strict";s.d(t,{WO:()=>r,Zi:()=>i,iz:()=>l,w3:()=>a});let a=0x40000000,l={imageCompression:["jpg","png","webp"],documentCompression:["pdf","doc","docx","ppt","pptx","xls","xlsx"],videoCompression:["mov"],archiveCompression:["zip"],allC
1ompressionTypes:["pdf","doc","docx","ppt","pptx","xls","xlsx","mov","jpg","png","webp","zip"]},r={mov:"video/quicktime",pdf:"application/pdf",jpg:"image/jpeg",png:"image/png",ppt:"application/vnd.ms-powerpoint",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",word:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",doc:"application/msword",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",excel:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xls:"application/vnd.ms-excel",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",zip:"application/zip"},i={mov:"MOV",pdf:"PDF",jpg:"JPG",png:"PNG",ppt:"PPT",pptx:"PPTX",word:"Word",doc:"DOC",docx:"DOCX",excel:"Excel",xls:"XLS",xlsx:"XLSX",zip:"ZIP"}},71480:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/file-compressor/[filename]",function(){return s(18878)}])},90327:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});var a=s(37876),l=s(98408),r=s(27832),i=s(14e3);let n=({textContent:e,onConvertMoreFilesButtonPressed:t,onDownloadFile:s})=>{let n=(0,i.useRouter)();return(0,a.jsxs)("div",{className:"flex flex-col items-center space-y-8 text-center",children:[(0,a.jsxs)("div",{className:"flex flex-row items-center space-x-2 rounded-lg bg-green-40 p-4 text-center text-green-dark md:text-start",children:[(0,a.jsx)(l.r,{weight:"fill",size:19.5,className:"hidden shrink-0 md:flex"}),(0,a.jsx)("p",{children:e.label})]}),(0,a.jsx)("h3",{className:"text-3xl font-semibold",children:e.title}),(0,a.jsx)("p",{className:"text-lg font-semibold text-gray-60",children:e.description}),(0,a.jsxs)("div",{className:"flex flex-col gap-2 md:flex-row",children:[(0,a.jsxs)("button",{onClick:()=>n.push("/file-compressor"),className:"flex flex-row items-center justify-center space-x-2 rounded-lg border-gray-10 bg-white px-5 py-2 font-medium shadow-sm hover:bg-gray-5",children:[(0,a.jsx)(r.t,{size:24}),(0,a.jsx)("p",{children:e.goHome})]}),(0,a.jsx)("button",{onClick:t,className:"rounded-lg border border-gray-5 bg-white px-5 py-2.5 font-medium text-gray-80 shadow-sm hover:bg-gray-5",children:e.compressAnother||e.convertAnother}),(0,a.jsx)("button",{onClick:s,className:"rounded-lg bg-primary px-5 py-2.5 font-medium text-white hover:bg-primary-dark",children:e.downloadFile})]})]})}}},e=>{e.O(0,[8233,8230,2535,3359,541,4e3,3866,2447,6545,1511,4589,2442,4267,636,6593,8792],()=>e(e.s=71480)),_N_E=e.O()}]);

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.