Files
site/node_modules/@sveltia/cms/npm/chunks/status-BQ2Mosjf.js
T
site-admin 3ac81d5a52
deploy / build-and-publish (push) Successful in 1m37s
the editable site (validation-lab)
2026-11-21 08:03:55 +01:00

2 lines
2.4 KiB
JavaScript

import{Ba as e,Ra as t,Tc as n,Ys as r,ir as i,xc as a}from"./init-Da57-oKP.js";import{a as o}from"./networking-_mWsNZqn.js";var s=(e,t)=>{let{databaseName:r}=e??{};return r?new n(r,t):void 0},c=async e=>{try{return new Map(await e?.entries()??[])}catch(e){return console.error(e),new Map}},l=async(e,t,n)=>{if(e)try{t.size&&await e.saveEntries([...t]),n.length&&await e.deleteEntries(n)}catch(e){console.error(e)}},u=e=>{let t=e.split(`/`),n=t.findIndex(e=>e.includes(`{{`));return(n===-1?t:t.slice(0,n)).join(`/`)},d=(e,t)=>e===t||e.startsWith(`${t}/`),f=()=>{let e=[],n=[];return t.current.forEach(({filePathMap:t,folderPathMap:r})=>{t?e.push(...Object.values(t)):n.push(...Object.values(r??{}))}),i.current.forEach(({internalPath:e})=>{e!==void 0&&n.push(e)}),{filePaths:e,folderPaths:n}},p=()=>{let{filePaths:e,folderPaths:t}=f(),n=e.filter(e=>!e.includes(`{{`)),r=[...e.filter(e=>e.includes(`{{`)),...t].map(e=>u(a(e)));if(r.some(e=>!e))return;let i=[...new Set(r)].filter(e=>!e.startsWith(`../`)).sort().filter((e,t,n)=>!n.slice(0,t).some(t=>d(e,t)));return{dirs:i,files:[...new Set(n.map(e=>a(e)))].filter(e=>!e.startsWith(`../`)&&!i.some(t=>d(e,t)))}},m=2,h=r(),g=e=>{h.current=e>=m?{phase:`preparing`,done:0,total:e,approximate:!1}:void 0},_=()=>{let e=h.current;e?.phase===`preparing`&&(h.current={...e,done:Math.min(e.done+1,e.total)})},v=(e,t)=>{let n=Math.max(e,t);h.current=n>=m?{phase:`committing`,done:e,total:n,approximate:!0}:void 0},y=()=>{h.current=void 0},b=[408,413,499,502,504],x=(e,t=new Set)=>({queue:e.filter(({path:e})=>!t.has(e)).toSorted((e,t)=>Number(typeof e.data==`string`)-Number(typeof t.data==`string`)),addedAgain:e.filter(({path:e})=>t.has(e))}),S=(e,t)=>{let n=[],r=0;for(;e.length&&(!n.length||r+e[0].contents.length<=t);){let t=e.shift();n.push(t),r+=t.contents.length}return n},C=e=>e.reduce((e,{contents:t})=>e+t.length,0),w=(e,t)=>Math.max(1,Math.ceil(C(e)/t)),T=e=>e?.message===`Failed to send the request`||b.includes(e?.cause?.status),E=10,D=t=>{let n=Math.max(100/(Math.max(t,1)*E)*100,.1),r=0;e.current=r;let i=window.setInterval(()=>{r=Math.min(r+n,99),e.current=r},100);return()=>{window.clearInterval(i),e.current=void 0}},O=(e,t)=>async()=>{try{return t(await o(e))??`unknown`}catch{return`unknown`}};export{l as _,T as a,_ as c,h as d,g as f,c as g,s as h,C as i,y as l,p as m,D as n,x as o,f as p,w as r,S as s,O as t,v as u};
//# sourceMappingURL=status-BQ2Mosjf.js.map