PageSourceSearch

https://conversiontab.com/build/assets/decompress-files-page-C2drkDL3.js

js conversiontab.com collected 2026-09-24 10:07:28 UTC 22,198 bytes, 6 lines download raw bytes

1import{d as _t}from"./ctMediaProgressUi-wz6CtyvX.js";import{a as mt}from"./jszipArchiveProgress-1iM3A8_N.js";import{s as Wt}from"./ctToast-C2BAo121.js";import"./app-gOHIPY12.js";/**
2 * @license
3 * Copyright 2019 Google LLC
4 * SPDX-License-Identifier: Apache-2.0
5 */const Ct=Symbol("Comlink.proxy"),Ot=Symbol("Comlink.endpoint"),jt=Symbol("Comlink.releaseProxy"),it=Symbol("Comlink.finalizer"),q=Symbol("Comlink.thrown"),gt=t=>typeof t=="object"&&t!==null||typeof t=="function",Rt=new Map([["proxy",{canHandle:t=>gt(t)&&t[Ct],serialize(t){const{port1:e,port2:n}=new MessageChannel;return kt(t,e),[n,[n]]},deserialize:t=>(t.start(),At(t))}],["throw",{canHandle:t=>gt(t)&&q in t,serialize({value:t}){let e;return e=t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[e,[]]},deserialize(t){throw t.isError?Object.assign(new Error(t.value.message),t.value):t.value}}]]);function kt(t,e=globalThis,n=["*"]){e.addEventListener("message",function r(a){if(!a||!a.data)return;if(!function(p,f){for(const m of p)if(f===m||m==="*"||m instanceof RegExp&&m.test(f))return!0;return!1}(n,a.origin))return void console.warn(`Invalid origin '${a.origin}' for comlink proxy`);const{id:s,type:l,path:c}=Object.assign({path:[]},a.data),g=(a.data.argumentList||[]).map(P);let u;try{const p=c.slice(0,-1).reduce((m,w)=>m[w],t),f=c.reduce((m,w)=>m[w],t);switch(l){case"GET":u=f;break;case"SET":p[c.slice(-1)[0]]=P(a.data.value),u=!0;break;case"APPLY":u=f.apply(p,g);break;case"CONSTRUCT":u=st(new f(...g));break;case"ENDPOINT":{const{port1:m,port2:w}=new MessageChannel;kt(t,w),u=function(x,z){return Pt.set(x,z),x}(m,[m])}break;case"RELEASE":u=void 0;break;default:return}}catch(p){u={value:p,[q]:0}}Promise.resolve(u).catch(p=>({value:p,[q]:0})).then(p=>{const[f,m]=K(p);e.postMessage(Object.assign(Object.assign({},f),{id:s}),m),l==="RELEASE"&&(e.removeEventListener("message",r),zt(e),it in t&&typeof t[it]=="function"&&t[it]())}).catch(p=>{const[f,m]=K({value:new TypeError("Unserializable return value"),[q]:0});e.postMessage(Object.assign(Object.assign({},f),{id:s}),m)})}),e.start&&e.start()}function zt(t){(function(e){return e.constructor.name==="MessagePort"})(t)&&t.close()}function At(t,e){return at(t,[],e)}function Z(t){if(t)throw new Error("Proxy has been released and is not useable")}function Dt(t){return U(t,{type:"RELEASE"}).then(()=>{zt(t)})}const Y=new WeakMap,G="FinalizationRegistry"in globalThis&&new FinalizationRegistry(t=>{const e=(Y.get(t)||0)-1;Y.set(t,e),e===0&&Dt(t)});function at(t,e=[],n=function(){}){let r=!1;const a=new Proxy(n,{get(s,l){if(Z(r),l===jt)return()=>{(function(c){G&&G.unregister(c)})(a),Dt(t),r=!0};if(l==="then"){if(e.length===0)return{then:()=>a};const c=U(t,{type:"GET",path:e.map(g=>g.toString())}).then(P);return c.then.bind(c)}return at(t,[...e,l])},set(s,l,c){Z(r);const[g,u]=K(c);return U(t,{type:"SET",path:[...e,l].map(p=>p.toString()),value:g},u).then(P)},apply(s,l,c){Z(r);const g=e[e.length-1];if(g===Ot)return U(t,{type:"ENDPOINT"}).then(P);if(g==="bind")return at(t,e.slice(0,-1));const[u,p]=wt(c);return U(t,{type:"APPLY",path:e.map(f=>f.toString()),argumentList:u},p).then(P)},construct(s,l){Z(r);const[c,g]=wt(l);return U(t,{type:"CONSTRUCT",path:e.map(u=>u.toString()),argumentList:c},g).then(P)}});return function(s,l){const c=(Y.get(l)||0)+1;Y.set(l,c),G&&G.register(s,l,s)}(a,t),a}function wt(t){const e=t.map(K);return[e.map(r=>r[0]),(n=e.map(r=>r[1]),Array.prototype.concat.apply([],n))];var n}const Pt=new WeakMap;function st(t){return Object.assign(t,{[Ct]:!0})}function K(t){for(const[e,n]of Rt)if(n.canHandle(t)){const[r,a]=n.serialize(t);return[{type:"HANDLER",name:e,value:r},a]}return[{type:"RAW",value:t},Pt.get(t)||[]]}function P(t){switch(t.type){case"HANDLER":return Rt.get(t.name).deserialize(t.value);case"RAW":return t.value}}function U(t,e,n){return new Promise(r=>{const a=new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-");t.addEventListener("message",function s(l){l.data&&l.data.id&&l.data.id===a&&(t.removeEventListener("message",s),r(l.data))}),t.start&&t.start(),t.postMessage(Object.assign({id:a},e),n)})}class lt{constructor(e,n,r,a,s){this._name=e,this._size=n,this._path=r,this._lastModified=a,this._archiveRef=s}get name(){return this._name}get size(){return this._size}get lastModified(){return this._lastModified}extract(){return this._archiveRef.extractSingleFile(this._path)}}function ot(t){if(t instanceof File||t instanceof lt||t===null)return t;const e={};for(const n of Object.keys(t))e[n]=ot(t[n]);return e}function St(t,e=""){const n=[];for(const r of Object.keys(t))t[r]instanceof File||t[r]instanceof lt||t[r]===null?n.push({f
5ile:t[r]||r,path:e}):n.push(...St(t[r],`${e}${r}/`));return n}function yt(t,e){const n=e.split("/");n[n.length-1]===""&&n.pop();let r=t,a=null;for(const s of n)r[s]=r[s]||{},a=r,r=r[s];return[a,n[n.length-1]]}class Vt{constructor(e,n,r){this._content={},this._processed=0,this.file=e,this.client=n,this.worker=r}open(){return this._content={},this._processed=0,new Promise((e,n)=>{this.client.open(this.file,st(()=>{e(this)}))})}async close(){var e;(e=this.worker)===null||e===void 0||e.terminate(),this.worker=null,this.client=null,this.file=null}async hasEncryptedData(){return await this.client.hasEncryptedData()}async usePassword(e){await this.client.usePassword(e)}async setLocale(e){await this.client.setLocale(e)}async getFilesObject(){return this._processed>0?Promise.resolve().then(()=>this._content):((await this.client.listFiles()).forEach(e=>{const[n,r]=yt(this._content,e.path);e.type==="FILE"&&(n[r]=new lt(e.fileName,e.size,e.path,e.lastModified,this))}),this._processed=1,ot(this._content))}getFilesArray(){return this.getFilesObject().then(e=>St(e))}async extractSingleFile(e){if(this.worker===null)throw new Error("Archive already closed");const n=await this.client.extractSingleFile(e);return new File([n.fileData],n.fileName,{type:"application/octet-stream",lastModified:n.lastModified/1e6})}async extractFiles(e=void 0){var n;return this._processed>1?Promise.resolve().then(()=>this._content):((await this.client.extractFiles()).forEach(r=>{const[a,s]=yt(this._content,r.path);r.type==="FILE"&&(a[s]=new File([r.fileData],r.fileName,{type:"application/octet-stream"}),e!==void 0&&setTimeout(e.bind(null,{file:a[s],path:r.path})))}),this._processed=2,(n=this.worker)===null||n===void 0||n.terminate(),ot(this._content))}}var vt,Et;(function(t){t.SEVEN_ZIP="7zip",t.AR="ar",t.ARBSD="arbsd",t.ARGNU="argnu",t.ARSVR4="arsvr4",t.BIN="bin",t.BSDTAR="bsdtar",t.CD9660="cd9660",t.CPIO="cpio",t.GNUTAR="gnutar",t.ISO="iso",t.ISO9660="iso9660",t.MTREE="mtree",t.MTREE_CLASSIC="mtree-classic",t.NEWC="newc",t.ODC="odc",t.OLDTAR="oldtar",t.PAX="pax",t.PAXR="paxr",t.POSIX="posix",t.PWB="pwb",t.RAW="raw",t.RPAX="rpax",t.SHAR="shar",t.SHARDUMP="shardump",t.USTAR="ustar",t.V7TAR="v7tar",t.V7="v7",t.WARC="warc",t.XAR="xar",t.ZIP="zip"})(vt||(vt={})),function(t){t.B64ENCODE="b64encode",t.BZIP2="bzip2",t.COMPRESS="compress",t.GRZIP="grzip",t.GZIP="gzip",t.LRZIP="lrzip",t.LZ4="lz4",t.LZIP="lzip",t.LZMA="lzma",t.LZOP="lzop",t.UUENCODE="uuencode",t.XZ="xz",t.ZSTD="zstd",t.NONE="none"}(Et||(Et={}));class L{static init(e=null){return L._options=e||{},L._options}static async open(e){const n=L.getWorker(L._options),r=await L.getClient(n,L._options);return await new Vt(e,r,n).open()}static async write({files:e,outputFileName:n,compression:r,format:a,passphrase:s=null}){const l=L.getWorker(L._options),c=await L.getClient(l,L._options),g=await c.writeArchive(e,r,a,s);return l.terminate(),new File([g],n,{type:"application/octet-stream"})}static getWorker(e){return e.getWorker?e.getWorker():new Worker(e.workerUrl||new URL("/build/assets/worker-bundle-Dx5mKZOL.js",import.meta.url),{type:"module"})}static async getClient(e,n){var r;const a=((r=n.createClient)===null||r===void 0?void 0:r.call(n,e))||At(e);let{promise:s,resolve:l}=Promise.withResolvers();const c=await new a(st(()=>{l()}));return await s,c}}L._options={},Promise.withResolvers||(Promise.withResolvers=function(){var t,e,n=new this(function(r,a){t=r,e=a});return{resolve:t,reject:e,promise:n}});let rt=null;function $t(){return rt||(L.init({workerUrl:"/libarchive/worker-bundle.js"}),rt=Promise.resolve()),rt}function Zt(t){const e=t.file;if(!e)return null;const n=typeof e=="string"?e:e.name;return n?`${String(t.path||"").replace(/\\/g,"/")}${n}`.replace(/\\/g,"/"):null}function Gt(t){const n=(t instanceof Error?t.message:String(t||"Could not read archive.")).trim();return n?/end of central directory/i.test(n)||/is this a zip file/i.test(n)?"This file is not a supported archive, or it may be password-protected or corrupted.":/passphrase|password|encrypted/i.test(n)?"This archive appears to be password-protected. Encrypted archives are not supported in the browser tool yet.":n:"Could not read archive."}async function Xt(t){await $t();const e=await L.open(t),n=await e.getFilesArray(),r=new Map,a=new Set;for(const s of n){const l=Zt(s);if(!l||l.endsWith("/"))continue;const c=s.file;!c||typeof c!="object"||typeof c.extract!="function"||(r.set(l,{isDir:!1,file:c}),a.add(l))}
5if(a.size===0)throw await e.close(),new Error("No files found in this archive.");return{archive:e,entries:r,paths:a,async readBlob(s){const l=r.get(s);if(!(l!=null&&l.file))throw new Error("File not found in archive.");const c=await l.file.extract();return c instanceof Blob?c:new Blob([c],{type:"application/octet-stream"})},async close(){await e.close()}}}const bt='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16" aria-hidden="true"><path d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z"/><path fill-rule="evenodd" d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM2.5 3V2h11v1h-11z"/></svg>',qt='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16" aria-hidden="true"><path d="M.5 9.9a.5.5 0 0 1 .5.5v2.5a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-2.5a.5.5 0 0 1 1 0v2.5a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-2.5a.5.5 0 0 1 .5-.5z"/><path d="M7.646 11.854a.5.5 0 0 0 .708 0l3-3a.5.5 0 0 0-.708-.708L8.5 10.293V1.5a.5.5 0 0 0-1 0v8.793L5.354 8.146a.5.5 0 1 0-.708.708l3 3z"/></svg>',Yt='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="text-warning" viewBox="0 0 16 16" aria-hidden="true"><path d="M.54 3.87.5 3a2 2 0 0 1 2-2h3.672a2 2 0 0 1 1.414.586l.828.828A2 2 0 0 0 9.828 3h3.982a2 2 0 0 1 1.992 2.181l-.637 7A2 2 0 0 1 13.174 14H2.825a2 2 0 0 1-1.991-1.819l-.637-7a1.99 1.99 0 0 1 .342-1.31zM2.19 4a1 1 0 0 0-.996 1.09l.637 7a1 1 0 0 0 .995.91h10.348a1 1 0 0 0 .995-.91l.637-7A1 1 0 0 0 13.81 4H2.19z"/></svg>',Kt='<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="currentColor" class="text-secondary" viewBox="0 0 16 16" aria-hidden="true"><path d="M14 4.5V14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2h5.5L14 4.5zm-3 0A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V4.5h-2z"/></svg>',Jt='<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="currentColor" class="text-body-secondary mx-1" viewBox="0 0 16 16" aria-hidden="true"><path fill-rule="evenodd" d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"/></svg>';function Tt(t){t.sort((e,n)=>{const r=e.children.length>0,a=n.children.length>0;return r&&!a?-1:!r&&a?1:e.name.localeCompare(n.name)});for(const e of t)Tt(e.children)}function X(t,e){const n={id:"root",name:"Root",parent:null,children:[],path:"/",fullPath:null};for(const r of t){const a=r.split("/").filter(c=>c.length>0);if(a.length===0)continue;let s=n,l=n.children;for(let c=0;c<a.length;c+=1){const g=a[c],u=c===a.length-1,p=u&&e(r);let f=l.find(m=>m.name===g);f?u&&!p&&(f.fullPath=r):(f={id:typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():`n_${Date.now()}_${Math.random()}`,name:g,parent:s,children:[],path:c===0?"/":`/${a.slice(0,c).join("/")}`,fullPath:u&&!p?r:null},l.push(f)),s=f,l=f.children}}return Tt(n.children),n}function Lt(t){const e=[];let n=t;for(;n&&n.id!=="root";)n.name!=="Root"&&e.unshift(n.name),n=n.parent;return e.join("/")}async function Qt(t,e,n){const r=e.split("/").filter(Boolean),a=r.pop();if(!a)return;let s=t;for(const g of r)s=await s.getDirectoryHandle(g,{create:!0});const c=await(await s.getFileHandle(a,{create:!0})).createWritable();await c.write(n),await c.close()}async function xt(t,e,n,r,a){const s=n.replace(/\/$/,""),l=[];for(const u of e){const p=t.entries.get(u);if(!p||p.isDir||s&&!(u===s||u.startsWith(`${s}/`)))continue;const f=s?u.startsWith(`${s}/`)?u.slice(s.length+1):u.split("/").pop()||u:u;!f||f.endsWith("/")||l.push({archivePath:u,rel:f})}const c=l.length;if(c===0)return;let g=0;for(const{archivePath:u,rel:p}of l){if(a){const{pct:m,label:w,detail:x,detailTitle:z}=mt(g,c,0,p,"Extracting");a(m,w,x,z)}const f=await t.readBlob(u);if(await Qt(r,p,f),g+=1,a){const{pct:m,label:w,detail:x,detailTitle:z}=mt(g,c,100,p,"Extracting");a(m,w,x,z)}}}function re(){if(!document.getElementById("ct-decompress-files-root"))return;const e=document.getElementById("ctUnzipDropWrap"),n=document.getElementById("ctUnzipDrop"),r=document.getElementById("ctUnzipFile"),a=document.getElementById("ctUnzipDropCaption"),s=document.getElementById("ctUnzipFileList"),l=document.getElementById("ctUnzipReset"),c=document.getElementById("ctUnzipExplorerWrap"),g=document.getElementById("ctUnzipNavBack"),u=document.getElementById("ctUnzipNavHome"),p=document.getElementById("ctUnzipCrumbs"),f=document.getElementById("ctUnzipSearch"),m=document.getElementById("ctUnzipList"),w=document.getElementById("ctUnzipDownload"),x=w==null?void 0:w.querySelector(".ct-decompress-btn-label"),z=w==null?void 0:w.querySelector(".ct-decompress-btn-spinner"),J=document.getElementById("ctUnzipCount"),ct=document.getElementById("ctUnzipExplorerEmpty"),dt=document.getElementById("ctUnzipToast"),ut=document.getElementById("ctUnzipToastBody"),S=document.getElementById("ctUnzipProgressWrap"),h=_t({barId:"ctUnzipProgBar",labelId:"ctUnzipProgLabel",percentId:"ctUnzipProgPct",detailId:"ctUnzipProgDetail"});if(!e||!n||!r||!a||!s||!l||!c||!g||!u||!p||!f||!m||!w||!dt||!ut)return;const pt=a.textContent.trim();let v=null,C=null,R=new Set,k=X(new Set,()=>!1),E=k,F=!1,T=!1;function Q(i){if(i.endsWith("/"))return!0;const o=v==null?void 0:v.entries.get(i);return(o==null?void 0:o.isDir)===!0}function I(i){Wt(dt,{bodyEl:ut,message:i,delay:9e3})}function ft(){if(s.innerHTML="",!C){s.classList.add("d-none");return}s.classList.remove("d-none");const i=document.createElement("li");i.className="list-group-item d-flex align-items-center justify-content-between";const o=document.createElement("span");o.className="text-truncate small",o.textContent=C.name;const d=document.createElement("button");d.type="button",d.className="btn btn-sm btn-link text-danger p-0",d.setAttribute("aria-label","Remove"),d.innerHTML=bt,d.addEventListener("click",()=>{V()}),i.appendChild(o),i.appendChild(d),s.appendChild(i)}function It(){if(!J)return;if(!C){J.textContent="No archive loaded";return}const i=R.size;J.textContent=`${C.name} · ${i} item(s)`}function M(){const i=!!C&&!!v;l.disabled=!C||F||T,w.disabled=F||T||!i,r.disabled=T||F,It()}
5function O(i){F=i,w.classList.toggle("is-loading",i),w.setAttribute("aria-busy",i?"true":"false"),x&&(x.classList.toggle("invisible",i),x.setAttribute("aria-hidden",i?"true":"false")),z&&z.classList.toggle("d-none",!i),M()}function tt(){S&&(S.classList.add("is-active"),S.setAttribute("aria-hidden","false"))}function j(){S&&(S.classList.remove("is-active"),S.setAttribute("aria-hidden","false")),h==null||h.hardReset("Ready")}function H(i,o,d=null,y=null){h==null||h.setEncoding(i,o,void 0,d,y)}async function V(){const i=v;if(v=null,C=null,F=!1,T=!1,R=new Set,k=X(R,()=>!1),E=k,r.value="",r.disabled=!1,a.textContent=pt,w.setAttribute("aria-busy","false"),w.classList.remove("is-loading"),x&&(x.classList.remove("invisible"),x.setAttribute("aria-hidden","false")),z&&z.classList.add("d-none"),j(),f.value="",m.innerHTML="",p.innerHTML="",et(),ft(),M(),i)try{await i.close()}catch{}}function Mt(){v&&k.children.length===0&&V()}function Bt(){if(p.innerHTML="",!v||E.name==="Root")return;const i=[];let o=E;for(;o&&o.name!=="Root";)i.unshift(o),o=o.parent;for(let d=0;d<i.length;d+=1){const y=i[d],A=d===i.length-1;if(d>0){const b=document.createElement("span");b.innerHTML=Jt,p.appendChild(b)}if(A){const b=document.createElement("span");b.className="small text-body-secondary",b.textContent=y.name,p.appendChild(b)}else{const b=document.createElement("button");b.type="button",b.className="btn btn-link btn-sm p-0 small",b.textContent=y.name;const W=y;b.addEventListener("click",()=>{E=W,D()}),p.appendChild(b)}}}function D(){if(m.innerHTML="",!v)return;const i=f.value.trim().toLowerCase(),o=E.children.filter(d=>d.name.toLowerCase().includes(i));if(o.length===0){const d=document.createElement("div");d.className="list-group-item small text-body-secondary text-center py-3",d.textContent="No files",m.appendChild(d)}else for(const d of o){const y=document.createElement("div");y.className="list-group-item d-flex align-items-center justify-content-between";const A=document.createElement("div");A.className="d-flex align-items-center min-w-0 gap-2",A.style.cursor=d.children.length>0?"pointer":"default";const b=document.createElement("span");b.className="d-inline-flex flex-shrink-0",b.innerHTML=d.children.length>0?Yt:Kt;const W=document.createElement("span");W.className="small text-truncate",W.textContent=d.name,A.appendChild(b),A.appendChild(W),d.children.length>0&&A.addEventListener("click",()=>{E=d,D()});const $=document.createElement("div");$.className="d-flex align-items-center gap-1";const B=document.createElement("button");B.type="button",B.className="btn btn-link p-1 text-primary",B.title="Download",B.innerHTML=qt,B.addEventListener("click",nt=>{nt.stopPropagation(),Ft(d)});const N=document.createElement("button");N.type="button",N.className="btn btn-link p-1 text-danger",N.title="Delete",N.innerHTML=bt,N.addEventListener("click",nt=>{nt.stopPropagation(),Nt(d)}),$.appendChild(B),$.appendChild(N),y.appendChild(A),y.appendChild($),m.appendChild(y)}Bt(),et()}function et(){const i=!!v&&k.children.length>0;c.classList.toggle("d-none",!i),ct&&ct.classList.toggle("d-none",i),g.disabled=!i||E.name==="Root",u.disabled=!i||E.name==="Root"}function Nt(i){if(v&&window.confirm(`Are you sure?
6You won't be able to revert this!`)){if(i.fullPath&&R.has(i.fullPath)&&!Q(i.fullPath))R.delete(i.fullPath);else{const o=Lt(i);for(const d of[...R]){const y=d.replace(/\/$/,"");(y===o||y.startsWith(`${o}
6/`))&&R.delete(d)}}k=X(R,Q),E.name!=="Root"&&!Ut(E)&&(E=k),D(),Mt(),M()}}function Ut(i){function o(d,y){return d.id===y?!0:d.children.some(A=>o(A,y))}return o(k,i.id)}async function Ft(i){if(!(!v||!C)){if(i.children.length>0){if(typeof window.showDirectoryPicker!="function")return;O(!0),tt(),h==null||h.beginEncoding("Preparing folder…");try{const o=await window.showDirectoryPicker({mode:"readwrite"}),d=Lt(i);await xt(v,R,d,o,H),h==null||h.setDone("Folder saved")}catch(o){if(o&&typeof o=="object"&&"name"in o&&o.name==="AbortError")return;I(o instanceof Error?o.message:"Save failed."),h==null||h.setState({pct:0,labelText:"Extract failed",phase:"error"})}finally{O(!1),j()}return}if(i.fullPath)try{const o=await v.readBlob(i.fullPath),d=URL.createObjectURL(o),y=document.createElement("a");y.href=d,y.download=i.name,y.click(),URL.revokeObjectURL(d)}catch(o){I(o instanceof Error?o.message:"Download failed.")}}}async function Ht(){if(!v||!C){I("Attach a file to decompress");return}if(typeof window.showDirectoryPicker!="function"){I("Choose a folder is not supported in this browser.");return}O(!0),tt(),h==null||h.beginEncoding("Preparing extract…");try{const o=await(await window.showDirectoryPicker({mode:"readwrite"})).getDirectoryHandle("Extracted_files",{create:!0});await xt(v,R,"",o,H),h==null||h.setDone("Extract complete")}catch(i){i&&typeof i=="object"&&"name"in i&&i.name==="AbortError"||(I(i instanceof Error?i.message:"Download failed."),h==null||h.setState({pct:0,labelText:"Extract failed",phase:"error"}))}finally{O(!1),j()}}async function ht(i){if(i){T=!0,a.textContent="Opening archive…",r.disabled=!0,tt(),h==null||h.beginEncoding("Reading archive…"),M();try{H(8,"Reading archive…"),H(35,"Parsing archive…");const o=await Xt(i);H(100,"Archive ready"),v=o,C=i,R=new Set(o.paths),k=X(R,Q),E=k,a.textContent=i.name,ft(),M(),D(),et()}catch(o){I(Gt(o)),h==null||h.setState({pct:0,labelText:"Could not open archive",phase:"error"}),await V()}finally{T=!1,r.disabled=!1,j(),M(),C&&v?a.textContent=C.name:C||(a.textContent=pt)}}}g.addEventListener("click",()=>{E.parent&&E.name!=="Root"&&(E=E.parent,D())}),u.addEventListener("click",()=>{E=k,D()}),f.addEventListener("input",()=>{D()}),l.addEventListener("click",()=>{V()}),w.addEventListener("click",()=>{Ht()}),r.addEventListener("change",()=>{var o;const i=(o=r.files)==null?void 0:o[0];i&&ht(i)});let _=0;e.addEventListener("click",i=>{i.target!==r&&r.click()},!0),e.addEventListener("dragenter",i=>{i.preventDefault(),i.stopPropagation(),_+=1,n.classList.add("ct-zip-drop--active")}),e.addEventListener("dragover",i=>{i.preventDefault(),i.stopPropagation(),i.dataTransfer&&(i.dataTransfer.dropEffect="copy")}),e.addEventListener("dragleave",i=>{i.preventDefault(),i.stopPropagation(),_=Math.max(0,_-1),_===0&&n.classList.remove("ct-zip-drop--active")}),e.addEventListener("drop",i=>{var d,y;i.preventDefault(),i.stopPropagation(),_=0,n.classList.remove("ct-zip-drop--active");const o=(y=(d=i.dataTransfer)==null?void 0:d.files)==null?void 0:y[0];o&&ht(o)}),n.addEventListener("keydown",i=>{i.key!=="Enter"&&i.key!==" "||(i.preventDefault(),r.click())})}export{re as initDecompressFilesPage};

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.