PageSourceSearch

https://videocompress.ai/_nuxt/DlaIKQfj.js

js videocompress.ai collected 2026-09-25 03:09:12 UTC 24,848 bytes, 11 lines download raw bytes

1import{H as le}from"./C2tqtMT2.js";import{c as W,d as M,u as E,e as D,j as A,o as u,v as b,m as n,h as e,V as pe,g as l,W as ce,X as de,k as $,b5 as me,t as h,f as w,F as j,i as B,Y as ue,B as z,U as fe,r as I,$ as T,G as U,p as K,n as X,x as P,w as Z,bE as Y,aP as ge,a7 as he,a8 as _e,D as ve,Q as be,bo as ye,a as Ce,T as we,I as ke,_ as xe,ar as Ae,bF as Te}from"./BqAJtNqk.js";import{S as J,a as $e}from"./DdWilQCi.js";import{C as ze}from"./BiA8Kh_c.js";import{f as q,d as Ie,s as R}from"./bkhgf8s_.js";import{U as Fe}from"./0UzfhQ3z.js";import{c as N,T as G,a as H,b as V}from"./MtS_M5b1.js";import{T as ee}from"./GGn08Wdr.js";import{D as se}from"./C0xCQ0UP.js";import{u as Se}from"./CB4Jk5ds.js";import{c as Ue}from"./CbLtJgxl.js";import{u as Me}from"./NdujGY1s.js";import{u as Le,B as Pe}from"./BxjcrImE.js";import{L as De}from"./CFZskh2C.js";import{F as je}from"./tZahJrTF.js";import{H as Ee}from"./_nWsE1DT.js";import{B as Be}from"./Dma-sPjB.js";import{U as Oe}from"./7akG44aZ.js";import{C as Re}from"./DWt5vZEt.js";import{F as qe}from"./CJPVlWhT.js";import{u as Ne}from"./CAeLC8T9.js";import{G as Ge}from"./w2sKat3r.js";import{S as He}from"./DuG0KA_v.js";import{E as Ve,F as Q}from"./DtKKkPPD.js";import"./TDtrdbi3.js";import"./BmknOeQE.js";import"./CsqXV2gZ.js";/**
2 * @license lucide-vue-next v0.542.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const Xe=W("image-plus",[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]]);/**
7 * @license lucide-vue-next v0.542.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const Ke=W("images",[["path",{d:"m22 11-1.296-1.296a2.4 2.4 0 0 0-3.408 0L11 16",key:"9kzy35"}],["path",{d:"M4 8a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2",key:"1t0f0t"}],["circle",{cx:"13",cy:"7",r:"1",fill:"currentColor",key:"1obus6"}],["rect",{x:"8",y:"2",width:"14",height:"14",rx:"2",key:"1gvhby"}]]),te=".jpeg,.jpg,.png,.gif,.webp,.heic",O=20,Qe=30,We={jpeg:"jpg",jpg:"jpg",png:"png",gif:"gif",webp:"webp",heic:"heic"},Ze=y=>{const o=y.toLowerCase().split(".").pop()||"";return We[o]||null},Ye={class:"space-y-4 py-4"},Je={class:"mb-2 flex items-center gap-2 font-semibold text-foreground"},es={class:"max-h-36 space-y-1 overflow-y-auto rounded-lg bg-muted p-3 text-sm text-muted-foreground"},ss=M({__name:"FileErrorDialog",props:{open:{type:Boolean},errors:{}},emits:["update:open"],setup(y,{emit:o}){const m=y,f=o,{t:p}=E(),s=D({get:()=>m.open,set:_=>f("update:open",_)}),c=_=>_==="tooManyFiles"?p("imageCompressApp.upload.error.tooManyFiles",{count:O}):p(`imageCompressApp.upload.error.${_}`);return(_,a)=>(u(),A(e(fe),{open:s.value,"onUpdate:open":a[1]||(a[1]=t=>s.value=t)},{default:b(()=>[n(e(pe),{class:"sm:max-w-md"},{default:b(()=>[n(e(ce),null,{default:b(()=>[n(e(de),{class:"flex items-center gap-2 text-destructive"},{default:b(()=>[n(e(me),{class:"h-5 w-5"}),$(" "+h(_.$t("imageCompressApp.indexPage.error")),1)]),_:1})]),_:1}),l("div",Ye,[(u(!0),w(j,null,B(_.errors,(t,r)=>(u(),w("div",{key:r},[l("div",Je,[n(e(ze),{class:"h-4 w-4 text-destructive"}),$(" "+h(c(r)),1)]),l("ul",es,[(u(!0),w(j,null,B(t,v=>(u(),w("li",{key:v,class:"break-all"},h(v),1))),128))])]))),128))]),n(e(ue),{class:"justify-center sm:justify-end"},{default:b(()=>[n(e(z),{class:"min-w-28 bg-primary text-white hover:bg-primary/90",onClick:a[0]||(a[0]=t=>s.value=!1)},{default:b(()=>[$(h(_.$t("imageCompressApp.common.confirm")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["open"]))}}),oe=Object.assign(ss,{__name:"BizImageCompressFileErrorDialog"});function re(){const y=I(!1),o=I({isOpen:!1,errors:{}});return{loading:y,processFiles:async(f,p=0)=>{if(f.length===0)return[];y.value=!0;const s=[],c={},_=(a,t)=>{c[a]||(c[a]=[]),c[a].push(t)};try{let a=p;for(const t of f){const r=Ze(t.name),v={filename:t.name,filesize:t.size,filetype:t.type};if(!r){T.track(100721,v),_("unsupportedFormat",t.name);continue}if(t.size===0){T.track(100723,v),_("emptyFile",t.name);continue}if(a>=O){T.track(100722,v),_("tooManyFiles",t.name);continue}a++,s.push({name:t.name,size:t.size,sizeStr:q(t.size),file:t,format:r,previewUrl:URL.createObjectURL(t)})}return Object.keys(c).length>0&&(o.value={isOpen:!0,errors:c}),s}finally{y.value=!1}},errorDialogState:o}}const ts=["onKeydown"],os=["accept"],rs={class:"text-lg font-semibold text-foreground"},as={class:"flex size-16 items-center justify-center rounded-2xl bg-primary/15 text-primary transition-transform duration-200 group-hover:-translate-y-0.5"},is={class:"mb-2 text-xl font-bold text-foreground"},ns={class:"text-muted-foreground"},ls={class:"mt-1 text-sm text-muted-foreground"},ps=M({__name:"FileUpload",emits:["files-selected"],setup(y,{emit:o}){const m=o,f=I(!1),p=I(null),{loading:s,processFiles:c,errorDialogState:_}=re(),a=()=>{s.value||p.value?.click()},t=async g=>{const d=await c(g);d.length>0&&m("files-selected",d)},r=async g=>{f.value=!1;const d=g.dataTransfer?.files;d?.length&&await t(Array.from(d))},v=async g=>{const d=g.target;d.files?.length&&await t(Array.from(d.files)),d.value=""};return(g,d)=>
11(u(),w("div",{class:X(["group flex h-80 cursor-pointer flex-col items-center justify-center gap-4 rounded-2xl border border-dashed bg-primary/10 p-6 text-center transition-colors duration-200 hover:bg-primary/15 sm:p-8",{"cursor-wait":e(s),"border-solid border-primary bg-primary/15":f.value}]),role:"button",tabindex:"0",onClick:U(a,["stop"]),onKeydown:[K(U(a,["prevent"]),["enter"]),K(U(a,["prevent"]),["space"])],onDragover:d[1]||(d[1]=U(i=>f.value=!0,["prevent"])),onDragleave:d[2]||(d[2]=U(i=>f.value=!1,["prevent"])),onDrop:U(r,["stop","prevent"])},[l("input",{ref_key:"fileInput",ref:p,type:"file",accept:e(te),class:"hidden",multiple:"",onChange:v},null,40,os),e(s)?(u(),w(j,{key:0},[n(e(J),{class:"size-14 text-primary"}),l("p",rs,h(g.$t("imageCompressApp.upload.processing")),1)],64)):(u(),w(j,{key:1},[l("div",as,[n(e(Ke),{class:"size-9"})]),l("div",null,[l("h2",is,h(g.$t("imageCompressApp.upload.title")),1),l("p",ns,h(g.$t("imageCompressApp.upload.desc")),1),l("p",ls,h(g.$t("imageCompressApp.upload.formatHint")),1)]),n(e(z),{size:"lg",class:"bg-primary text-white shadow-[0px_2px_0px_0px_rgba(255,255,255,0.3)_inset] hover:scale-[0.99] hover:bg-primary-600",onClick:U(a,["stop"])},{default:b(()=>[n(e(Fe),{class:"mr-1 size-5"}),$(" "+h(g.$t("imageCompressApp.upload.uploadButton")),1)]),_:1})],64)),n(oe,{open:e(_).isOpen,"onUpdate:open":d[0]||(d[0]=i=>e(_).isOpen=i),errors:e(_).errors},null,8,["open","errors"])],42,ts))}}),cs=Object.assign(ps,{__name:"BizImageCompressFileUpload"}),ds=["accept"],ms=["disabled"],us={class:"flex size-8 items-center justify-center rounded-lg bg-primary/10"},fs=M({__name:"AddMoreFilesButton",props:{currentCount:{}},emits:["files-selected"],setup(y,{emit:o}){const m=y,f=o,p=I(null),{loading:s,processFiles:c,errorDialogState:_}=re(),a=D(()=>m.currentCount>=O),t=D(()=>s.value||a.value),r=()=>{t.value||p.value?.click()},v=async g=>{const d=g.target;if(d.files?.length){const i=await c(Array.from(d.files),m.currentCount);i.length>0&&f("files-selected",i)}d.value=""};return(g,d)=>(u(),w("div",null,[l("input",{ref_key:"fileInput",ref:p,type:"file",accept:e(te),class:"hidden",multiple:"",onChange:v},null,40,ds),n(e(N),{"delay-duration":100},{default:b(()=>[n(e(G),null,{default:b(()=>[n(e(H),{"as-child":""},{default:b(()=>[l("button",{type:"button",class:X(["inline-flex min-h-11 items-center gap-2 rounded-lg text-base font-semibold text-primary transition-opacity focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2",t.value?"cursor-not-allowed opacity-40":"hover:opacity-80"]),disabled:t.value,onClick:r},[l("span",us,[e(s)?(u(),A(e(J),{key:0,class:"size-4"})):(u(),A(e(Xe),{key:1,class:"size-4"}))]),$(" "+h(g.$t("imageCompressApp.addMoreFiles.buttonText")),1)],10,ms)]),_:1}),a.value?(u(),A(e(V),{key:0,class:"bg-black/90 text-white"},{default:b(()=>[l("p",null,h(g.$t("imageCompressApp.addMoreFiles.maxReached",{count:e(O)})),1)]),_:1})):P("",!0)]),_:1})]),_:1}),n(oe,{open:e(_).isOpen,"onUpdate:open":d[0]||(d[0]=i=>e(_).isOpen=i),errors:e(_).errors},null,8,["open","errors"])]))}}),gs=Object.assign(fs,{__name:"BizImageCompressAddMoreFilesButton"}),hs={class:"flex items-center gap-3 rounded-xl border bg-white p-3 shadow-sm sm:gap-4 sm:p-4"},_s={class:"flex size-14 shrink-0 items-center justify-center overflow-hidden rounded-xl bg-muted sm:size-16"},vs=["src","alt"],bs={class:"min-w-0 flex-1"},ys=["title"],Cs={class:"mt-1 flex items-center gap-2 text-sm text-muted-foreground"},ws={class:"uppercase"},ks=M({__name:"ImageInfo",props:{fileInfo:{}},emits:["delete"],setup(y){const o=y,m=I(!1);return Z(()=>o.fileInfo.previewUrl,()=>{m.value=!1}),(f,p)=>(u(),w("div",hs,[l("div",_s,[m.value?(u(),A(e(Y),{key:1,class:"size-7 text-muted-foreground","aria-hidden":"true"})):(u(),w("img",{key:0,src:f.fileInfo.previewUrl,alt:f.fileInfo.name,class:"size-full object-cover",onError:p[0]||(p[0]=s=>m.value=!0)},null,40,vs))]),l("div",bs,[l("p",{class:"truncate font-medium text-foreground",title:f.fileInfo.name},h(f.fileInfo.name),9,ys),l("div",Cs,[l("span",ws,h(f.fileInfo.format),1),p[2]||(p[2]=l("span",{"aria-hidden":"true"},"·",-1)),l("span",null,h(f.fileInfo.sizeStr),1)])]),n(e(z),{variant:"ghost",size:"icon",class:"shrink-0 text-muted-foreground hover:bg-destructive/10 hover:text-destructive","aria-label":f.$t("imageCompressApp.imageInfo.delete",{filename:f.fileInfo.name}),onClick:p[1]||(p[1]=s=>f.$emit("delete"))},{default:b(()=>[n(e(ee),{class:"size-5"})]),_:1},8,["aria-label"])]))}}),xs=Object.assign(ks,{__name:"BizImageCompressImageInfo"}),As={class:"space-y-3"},Ts={class:"grid grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-x-3 gap-y-3 sm:gap-x-4"},$s={class:"row-span-2 flex size-12 items-center justify-center overflow-hidden rounded-lg bg-muted sm:size-14"},zs=["src","alt","onError"],Is={class:"min-w-0 self-end"},Fs=["title"],Ss={class:"mt-0.5 text-xs uppercase tracking-wide text-muted-foreground"},Us={class:"row-span-2 flex items-center justify-end gap-1 self-center sm:gap-2"},Ms={class:"hidden sm:inline"},Ls={class:"sr-only"},Ps={class:"col-start-2 min-w-0 self-start"},Ds={key:0,class:"inline-flex rounded bg-muted px-2 py-1 text-xs text-muted-foreground"},js={key:1,class:"flex flex-wrap items-center gap-x-2 gap-y-1 text-xs"},Es={class:"text-muted-foreground"},Bs={class:"inline-flex cursor-help rounded border border-red-200 bg-red-50 px-2 py-1 text-xs text-red-700"},Os={key:3,class:"flex max-w-md items-center gap-2"},Rs={class:"h-1.5 flex-1 overflow-hidden rounded-full bg-muted"},qs={class:"w-28 whitespace-nowrap text-right text-xs tabular-nums text-primary"},Ns=M({__name:"ProcessTaskList",props:{tasks:{}},emits:["download","retry","cancel"],setup(y,{emit:o}){const m=o,{t:f}=E(),p=ge(new Set),s=a=>{const t=a.fileInfo.size,r=a.result?.fileSize??t;if(t<=0)return{kind:"compressed",percentage:"0"};const v=Math.abs(r-t)/t*100;return{kind:r>t?"increased":"compressed",percentage:v===0?"0":v.toFixed(1)}},c=a=>{const t=s(a);return t.kind==="increased"?f("imageCompressApp.processTaskList.increasedBy",{percentage:t.percentage}):f("imageCompressApp.processTaskList.compressedBy",{percentage:t.percentage})},_=a=>{m("download",a),a.result?.downloadUrl&&Ie(a.result.downloadUrl,a.fileInfo.name)};return(a,t)=>(u(),w("div",As,[(u(!0),w(j,null,B(a.tasks,r=>(u(),w("div",{key:r.id,class:"rounded-xl border bg-white p-3 shadow-sm sm:p-4"},[l("div",Ts,[l("div",$s,[e(p).has(r.id)?(u(),A(e(Y),{key:1,class:"size-6 text-muted-foreground","aria-hidden":"true"})):(u(),w("img",{key:0,src:r.fileInfo.previewUrl,alt:r.fileInfo.name,class:"size-full object-cover",onError:v=>e(p).add(r.id)},null,40,zs))]),l("div",Is,[l("p",{class:"truncate font-medium text-foreground",title:r.fileInfo.name},h(r.fileInfo.name),9,Fs),l("p",Ss,h(r.fileInfo.format),1)]),l("div",Us,[r.status==="success"?(u(),A(e(z),{key:0,size:"sm",class:"bg-primary text-white hover:bg-primary-600",onClick:v=>_(r)},{default:b(()=>[n(e(se),{class:"size-4 sm:mr-1"}),l("span",Ms,h(a.$t("imageCompressApp.processTaskList.download")),1)]),_:2},1032,["onClick"])):P("",!0),r.status==="error"?(u(),A(e(z),{key:1,size:"sm",variant:"outline",class:"border-orange-600 text-orange-700 hover:border-orange-600 hover:bg-orange-50 hover:text-orange-700",onClick:v=>a.$emit("retry",r.id)},{default:b(()=>[$(h(a.$t("imageCompressApp.processTaskList.retry")),1)]),_:2},1032,["onClick"])):P("",!0),n(e(N),{"delay-duration":100},{default:b(()=>[n(e(G),null,{default:b(()=>[n(e(H),{"as-child":""},{default:b(()=>[n(e(z),{variant:"ghost",size:"icon",class:"text-muted-foreground hover:bg-destructive/10 hover:text-destructive",onClick:v=>a.$emit("cancel",r.id)},{default:b(()=>[n(e(he),{class:"size-5"}),l("span",Ls,h(r.status==="success"||r.status==="error"?a.$t("imageCompressApp.processTaskList.removeTask"):a.$t("imageCompressApp.processTaskList.cancelTask")),1)]),_:2},1032,["onClick"])]),_:2},1024),n(e(V),{class:"bg-black/90 text-white"},{default:b(()=>[l("p",null,h(r.status==="success"||r.status==="error"?a.$t("imageCompressApp.processTaskList.removeTask"):a.$t("imageCompressApp.processTaskList.cancelTask")),1)]),_:2},1024)]),_:2},1024)]),_:2},1024)]),l("div",Ps,[r.status==="pending"?(u(),w("span",Ds,h(a.$t("imageCompressApp.processTaskList.waiting")),1)):r.status==="success"?(u(),w("div",js,[l("span",Es,[$(h(e(q)(r.fileInfo.size))+" ",1),n(e(_e),{class:"mx-1 inline size-3","aria-hidden":"true"}),$(" "+h(e(q)(r.result?.fileSize||r.fileInfo.size)),1)]),l("span",{class:X(["font-semibold tabular-nums",s(r).kind==="increased"?"text-amber-700":"text-emerald-700"])}
11,h(c(r)),3)])):r.status==="error"?(u(),A(e(N),{key:2,"delay-duration":100},{default:b(()=>[n(e(G),null,{default:b(()=>[n(e(H),{"as-child":""},{default:b(()=>[l("span",Bs,h(a.$t("imageCompressApp.processTaskList.failed")),1)]),_:1}),n(e(V),{class:"max-w-72 bg-black/90 text-white"},{default:b(()=>[l("p",null,h(r.errorMessage),1)]),_:2},1024)]),_:2},1024)]),_:2},1024)):r.status==="uploading"||r.status==="processing"?(u(),w("div",Os,[l("div",Rs,[l("div",{class:"h-full rounded-full bg-primary transition-[width] duration-300",style:ve({width:`${r.progress}%`})},null,4)]),l("span",qs,h(r.status==="uploading"?a.$t("imageCompressApp.processTaskList.uploading"):a.$t("imageCompressApp.processTaskList.compressing"))+" "+h(r.progress)+"% ",1)])):P("",!0)])])]))),128))]))}}),Gs=Object.assign(Ns,{__name:"BizImageCompressProcessTaskList"});function Hs(){const y=I(0),o=I(null),m=I(null),f=be(),p=2e3;let s=null,c=null;const _=()=>{y.value=0,s=null};return{progress:y,error:o,result:m,createCompressImageTask:async(g,d)=>{if(o.value=null,m.value=null,c?.signal.aborted)return o.value="Task canceled",null;try{const i=await f("/api/compress/image-task",{method:"POST",body:g,signal:c?.signal});if(i.code!==1e5)return o.value="Failed to create image compress task",null;const k=i.data.export_task_id;return T.track(100728,{task_id:k,filesize:d,image_format:g.image_format}),k}catch(i){return i.name==="AbortError"||c?.signal.aborted?(o.value="Task canceled",null):(o.value=i.message||"Failed to create image compress task",null)}},waitCompressImageTaskPolling:async(g,d)=>{o.value=null,_(),s=Ue(d.fileSize,void 0),s.onProgressUpdate(k=>{y.value=k});let i=0;for(;;){if(c?.signal.aborted)return o.value="Task canceled",null;try{s.canUpdate()&&(y.value=s.updateProgress()),i++;const x=(await f(`/api/compress/task/${g}`,{method:"GET"})).data;if(x.status==="completed"){const L={taskId:x.task_id,status:x.status,downloadUrl:x.download_url,fileSize:x.file_size};return m.value=L,y.value<99&&(y.value=99),await R(500),y.value=s.complete(),T.track(100729,{task_id:g,filesize:d.fileSize,image_format:d.imageFormat,output_filesize:x.file_size}),L}if(x.status==="failed"||i>p)return o.value=x.error||"Image compression failed",T.track(100730,{task_id:g,filesize:d.fileSize,image_format:d.imageFormat,status:x.status,error_message:o.value}),null;await R(5e3)}catch(k){console.error("Image compression polling error:",k),await R(5e3)}}},resetProgress:_,abort:()=>c?.abort(),resetAbort:()=>{c=new AbortController}}}function Vs(){const{t:y}=E(),o=Me({maxConcurrent:Qe,processTask:f,resetOnRetry:()=>({compressTaskId:null}),onTaskRemoved:p=>URL.revokeObjectURL(p.fileInfo.previewUrl)}),m=p=>p.map(s=>o.addTask({compressTaskId:null,fileInfo:s,status:"pending",progress:0,settings:null}));async function f(p,s){const c=s.getTask(p);if(!c||c.status!=="pending")return;const _=Se(),a=new AbortController,t=Hs();s.registerAbort(()=>a.abort()),s.registerAbort(()=>t.abort());const r={filename:c.fileInfo.name,filesize:c.fileInfo.size,filetype:c.fileInfo.file.type,image_format:c.fileInfo.format};try{s.updateTask(p,{status:"uploading",progress:0}),T.track(100724,r);let v;try{v=(await _.uploadWithRetry(c.fileInfo.file,c.fileInfo.name,({loaded:k,total:x})=>{if(!x)return;s.getTask(p)?.status==="uploading"&&s.updateTask(p,{progress:Math.round(k*100/x)})},a.signal)).url}catch(i){throw T.track(100726,{...r,error_message:`${i}`}),i}if(T.track(100725,r),s.isAborted())return;s.updateTask(p,{uploadedUrl:v,status:"processing",progress:0}),t.resetAbort();const g=await t.createCompressImageTask({source_import:{operation:"import/url",url:v,filename:c.fileInfo.name},file_info:{file_size:c.fileInfo.size,file_duration:null},image_format:c.fileInfo.format},c.fileInfo.size);if(!g)throw new Error(t.error.value||y("imageCompressApp.queue.compressFailed"));if(s.isAborted())return;s.updateTask(p,{compressTaskId:g});const d=Z(t.progress,i=>{s.updateTask(p,{progress:i})});try{await t.waitCompressImageTaskPolling(g,{fileSize:c.fileInfo.size,imageFormat:c.fileInfo.format})}finally{d()}if(s.isAborted())return;if(t.error.value)throw new Error(t.error.value);if(!t.result.value)throw new Error(y("imageCompressApp.queue.compressFailed"));s.updateTask(p,{status:"success",progress:100,result:{downloadUrl:t.result.value.downloadUrl||"",fileSize:t.result.value.fileSize??c.fileInfo.size}})}catch(v){if(s.isAborted())return;s.updateTask(p,{status:"error",progress:0,errorMessage:v.message||y("imageCompressApp.queue.compressFailed")})}}return ye(()=>o.clearAllTasks()),{...o,addTasks:m}}const Xs={class:"mx-auto max-w-[1200px] px-4 sm:px-6 lg:px-8"},Ks={key:0,class:"mx-auto my-4 max-w-4xl rounded-3xl border bg-card p-3 text-card-foreground md:p-6"},Qs={key:1,class:"mx-auto my-4 max-w-4xl rounded-3xl border bg-card p-3 text-card-foreground md:p-6"},Ws={class:"mb-4"},Zs={class:"space-y-3"},Ys={class:"flex items-center justify-between gap-4 border-t pt-4"},Js={class:"text-sm text-muted-foreground sm:text-base"},et={key:2,class:"mx-auto my-4 max-w-4xl rounded-3xl border bg-card p-3 text-card-foreground md:p-6"},st={class:"mb-6 border-b pb-4"},tt={key:0,class:"mt-6 flex flex-wrap items-center justify-center gap-3 border-t pt-4"},ot=M({__name:"Index",setup(y){const o=I("pickFile"),{tasks:m,addTasks:f,deleteTask:p,clearAllTasks:s,processAllTasks:c,retryTask:_}=Vs(),{toast:a}=Ce(),{t}=E(),{isPreparing:r,downloadZip:v}=Le(),g=C=>
11{f(C),C.forEach(F=>{T.track(100720,{filename:F.name,filesize:F.size,image_format:F.format})})},d=D(()=>m.value.length>0&&m.value.every(C=>C.status==="success"||C.status==="error")),i=D(()=>m.value.filter(C=>C.status==="success"&&C.result?.downloadUrl).length),k=async()=>{o.value="compressing",T.track(100727,{count:m.value.length}),await c()},x=C=>{p(C),m.value.length===0&&(o.value="pickFile")},L=()=>{s(),o.value="pickFile"},ae=async()=>{L(),await ke(),window.scrollTo({top:0,behavior:window.matchMedia("(prefers-reduced-motion: reduce)").matches?"instant":"smooth"})},ie=C=>{T.track(100731,{filename:C.fileInfo.name,filesize:C.result?.fileSize||0,image_format:C.fileInfo.format})},ne=async()=>{const C=m.value.filter(S=>S.status==="success"&&S.result?.downloadUrl).map(S=>({url:S.result.downloadUrl,filename:S.fileInfo.name}));if(C.length===0)return;const{failed:F}=await v(C,"videocompress-images.zip");if(F===C.length){a({title:t("imageCompressApp.indexPage.downloadAllFailed"),variant:"destructive"});return}T.track(100732,{count:C.length-F}),F>0&&a({title:t("imageCompressApp.indexPage.downloadAllPartial",{failed:F})})};return(C,F)=>(u(),w("div",Xs,[n($e,null,{default:b(()=>[o.value==="pickFile"&&e(m).length===0?(u(),w("div",Ks,[n(cs,{onFilesSelected:g})])):o.value==="pickFile"?(u(),w("div",Qs,[l("div",Ws,[n(gs,{"current-count":e(m).length,onFilesSelected:g},null,8,["current-count"])]),l("div",Zs,[(u(!0),w(j,null,B(e(m),S=>(u(),A(xs,{key:S.id,"file-info":S.fileInfo,onDelete:lt=>x(S.id)},null,8,["file-info","onDelete"]))),128)),l("div",Ys,[l("p",Js,h(C.$t("imageCompressApp.indexPage.addedImages",{count:e(m).length})),1),n(e(z),{size:"lg",class:"w-36 bg-primary text-base text-white shadow-[0px_2px_0px_0px_rgba(255,255,255,0.3)_inset] hover:scale-[0.99] hover:bg-primary-600 sm:w-40",onClick:k},{default:b(()=>[$(h(C.$t("imageCompressApp.indexPage.compress")),1)]),_:1})])])])):(u(),w("div",et,[l("div",st,[n(e(z),{size:"lg",variant:"destructive",onClick:L},{default:b(()=>[n(e(ee),{class:"size-5"}),$(" "+h(C.$t("imageCompressApp.indexPage.deleteAllFiles")),1)]),_:1})]),n(Gs,{tasks:e(m),onDownload:ie,onRetry:e(_),onCancel:x},null,8,["tasks","onRetry"]),n(we,{name:"completion-actions"},{default:b(()=>[d.value?(u(),w("div",tt,[i.value>=2?(u(),A(e(z),{key:0,size:"lg",disabled:e(r),class:"completion-action bg-primary text-white hover:bg-primary-600",onClick:ne},{default:b(()=>[e(r)?(u(),A(e(De),{key:0,class:"size-5 animate-spin"})):(u(),A(e(se),{key:1,class:"size-5"})),$(" "+h(e(r)?C.$t("imageCompressApp.indexPage.preparingZip"):C.$t("imageCompressApp.indexPage.downloadAll",{count:i.value})),1)]),_:1},8,["disabled"])):P("",!0),n(e(z),{size:"lg",variant:"outline",class:"completion-action",onClick:ae},{default:b(()=>[$(h(C.$t("imageCompressApp.indexPage.compressMoreImages")),1)]),_:1})])):P("",!0)]),_:1})]))]),_:1})]))}}),rt=Object.assign(xe(ot,[["__scopeId","data-v-952ca701"]]),{__name:"BizImageCompress"}),at={id:"top",class:"relative overflow-hidden"},it={class:"relative z-10 pb-24"},nt={class:"py-12"},Dt=M({__name:"image-compressor",setup(y){const{t:o,tm:m}=E(),f=Ae(),p=D(()=>f.fullPath||f.path),s=i=>i?.body?.static||i||"";Ne({title:o("imageCompressApp.seo.title"),description:o("imageCompressApp.seo.description"),keywords:o("imageCompressApp.seo.keywords")});const c={title:o("imageCompressApp.hero.title"),description:o("imageCompressApp.hero.description")},_=[Ge,He,Ve,Te,Q,Pe],a={title:o("imageCompressApp.features.title"),description:o("imageCompressApp.features.description"),features:m("imageCompressApp.features.items").map((i,k)=>({title:s(i?.title),description:s(i?.description),icon:_[k]||Q}))},t={title:o("imageCompressApp.howTo.title"),description:o("imageCompressApp.howTo.description"),steps:m("imageCompressApp.howTo.steps").map(i=>({title:s(i?.title),description:s(i?.description)}))},r={title:o("imageCompressApp.benefits.title"),description:o("imageCompressApp.benefits.description"),ctaLabel:o("imageCompressApp.cta.btnText"),items:m("imageCompressApp.benefits.items").map((i,k)=>({title:s(i?.title),description:s(i?.description),imgUrl:`/assets/image-compressor/Benefits-${k+1}.jpeg`,imgAlt:s(i?.title)}))},v={title:o("imageCompressApp.userComments.title"),description:o("imageCompressApp.userComments.description"),testimonials:m("imageCompressApp.userComments.testimonials").map((i,k)=>
11({id:`image-comment-${k}`,name:s(i?.name),role:s(i?.role),comment:s(i?.comment),img:`/assets/image-compressor/avatar-${k+1}.png`,rate:5}))},g={title:o("imageCompressApp.cta.title"),description:o("imageCompressApp.cta.description"),btnText:o("imageCompressApp.cta.btnText")},d={title:o("imageCompressApp.faq.title"),description:o("imageCompressApp.faq.description"),faqs:m("imageCompressApp.faq.items").map(i=>({title:s(i?.title),description:s(i?.description)}))};return(i,k)=>(u(),w("div",at,[n(le,{title:c.title,description:c.description},null,8,["title","description"]),l("div",it,[n(rt),n(je,{title:a.title,description:a.description,features:a.features},null,8,["title","description","features"]),n(Ee,{item:t}),n(Be,{item:r,href:e(p)},null,8,["href"]),l("div",nt,[n(Oe,{title:v.title,description:v.description,testimonials:v.testimonials},null,8,["title","description","testimonials"])]),n(Re,{title:g.title,description:g.description,"btn-text":g.btnText,href:e(p)},null,8,["title","description","btn-text","href"]),n(qe,{title:d.title,description:d.description,"faq-list":d.faqs},null,8,["title","description","faq-list"])])]))}});export{Dt 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.