forge-terminal 0.3.1 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -17
- package/dist/chunks/about-credits-2XUFRHGQ.js +4 -0
- package/dist/chunks/{boot-3M2WUSSL.js → boot-NP6SNVTV.js} +1 -1
- package/dist/chunks/{check-DN7SEN44.js → check-BRP6EKSA.js} +1 -1
- package/dist/chunks/{chunk-OIZCRBLT.js → chunk-32VJ2RDH.js} +1 -1
- package/dist/chunks/{chunk-VNAIHACR.js → chunk-3GVFOZ7M.js} +1 -1
- package/dist/chunks/{chunk-W42HVOBD.js → chunk-4QQEJ6YG.js} +1 -1
- package/dist/chunks/chunk-BZXDNDPG.js +3 -0
- package/dist/chunks/chunk-DG4IXNWJ.js +4 -0
- package/dist/chunks/{chunk-Z5PQWCG5.js → chunk-G4DU5ADF.js} +2 -2
- package/dist/chunks/{chunk-LI2JPLF7.js → chunk-GGBNT4WI.js} +1 -1
- package/dist/chunks/chunk-GNLE6JXL.js +3 -0
- package/dist/chunks/chunk-H2IUSPAK.js +4 -0
- package/dist/chunks/{chunk-Q45MSMTN.js → chunk-I6QBBRCE.js} +1 -1
- package/dist/chunks/chunk-K2ABBIR4.js +19 -0
- package/dist/chunks/chunk-KSRGJD2E.js +66 -0
- package/dist/chunks/{chunk-M6LD6DHO.js → chunk-LW2QEXDT.js} +1 -1
- package/dist/chunks/chunk-MBTGANIR.js +3 -0
- package/dist/chunks/{chunk-E5QDHFKQ.js → chunk-MMRDELHW.js} +1 -1
- package/dist/chunks/chunk-QXTXBMTM.js +3 -0
- package/dist/chunks/{chunk-NY6BX7QS.js → chunk-SAWVMQAD.js} +1 -1
- package/dist/chunks/{chunk-6ZEGAH36.js → chunk-TEO2EUS3.js} +1 -1
- package/dist/chunks/chunk-U5TEGDGH.js +3 -0
- package/dist/chunks/chunk-WFD6OWQY.js +3 -0
- package/dist/chunks/{chunk-YZG5A3GA.js → chunk-X54KIHCN.js} +1 -1
- package/dist/chunks/colour-D7L5VGQC.js +3 -0
- package/dist/chunks/{config-command-UW6BYQ2K.js → config-command-TXQUYFA6.js} +1 -1
- package/dist/chunks/execute-75YNMBFF.js +3 -0
- package/dist/chunks/extensions-4OWNFLEI.js +3 -0
- package/dist/chunks/{extensions-command-5QO6YX6O.js → extensions-command-UGXZIFRI.js} +1 -1
- package/dist/chunks/image-F5D73JPQ.js +3 -0
- package/dist/chunks/{install-HCF5BIA6.js → install-YG43OJ7P.js} +1 -1
- package/dist/chunks/launch-OVBNYIQE.js +4 -0
- package/dist/chunks/{lock-RZ6NVZFD.js → lock-6KTGUFBY.js} +1 -1
- package/dist/chunks/{manager-7HNOLCYH.js → manager-XN7WNMEW.js} +1 -1
- package/dist/chunks/{preferences-AKDCPHJ5.js → preferences-YL6SRNZR.js} +1 -1
- package/dist/chunks/{restart-6ONEYN6T.js → restart-RO6DM5N3.js} +1 -1
- package/dist/chunks/reveal-L6TBFOMV.js +3 -0
- package/dist/chunks/{run-C475RRUL.js → run-XQYPVWFI.js} +1 -1
- package/dist/chunks/{server-ETHSTOP6.js → server-3VV7IJPS.js} +15 -15
- package/dist/chunks/{theme-TYCKAIEA.js → theme-RVWVYUCH.js} +1 -1
- package/dist/chunks/{update-command-HT2RBFLR.js → update-command-6VNVMAYO.js} +1 -1
- package/dist/chunks/{update-note-ES7TWSUT.js → update-note-UA3267X2.js} +1 -1
- package/dist/index.js +31 -31
- package/package.json +1 -1
- package/skills/forge/SKILL.md +19 -1
- package/dist/chunks/chunk-4L6HNYSN.js +0 -4
- package/dist/chunks/chunk-775ILWZI.js +0 -3
- package/dist/chunks/chunk-GDQQDHXJ.js +0 -10
- package/dist/chunks/chunk-RE7E6NA7.js +0 -3
- package/dist/chunks/chunk-XYYVNUE6.js +0 -4
- package/dist/chunks/colour-6YGDI44N.js +0 -3
- package/dist/chunks/execute-BRPAGFUR.js +0 -3
- package/dist/chunks/image-ESDL7GZU.js +0 -3
- package/dist/chunks/launch-ILBEFGNR.js +0 -65
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
2
|
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
-
import{f as m,g as n}from"./chunk-
|
|
3
|
+
import{f as m,g as n}from"./chunk-GGBNT4WI.js";import{I as f,d as r}from"./chunk-MMRDELHW.js";function a(t){let e=Object.keys(r);return[...t].sort((o,i)=>e.indexOf(o)-e.indexOf(i))}function s(t){let e=new Set;for(let o of n)if(o.reads.has(t.format))for(let i of o.writes)e.add(i);return a([...e])}function I(t){return s(t).map(e=>({id:e,label:r[e].label,hint:r[e].hint,lossy:r[e].lossy}))}function d(){let t=new Set;for(let e of n)for(let o of e.reads)t.add(o);return a([...t])}function p(){let t=new Set;for(let e of n)for(let o of e.writes)t.add(o);return a([...t])}function F(t){return m.writes.has(t)}function g(){let t=new Set(d()),e=new Set(p());return a([...new Set([...t,...e])]).map(o=>({id:o,label:r[o].label,extensions:[...r[o].extensions],read:t.has(o),write:e.has(o),lossy:r[o].lossy}))}var z=5,R=200,$=5;function O(t){return t.format==="heic"?"jpeg":s(t).includes(t.format)?t.format:"png"}function j(t,e){let o=n.find(i=>i.id==="image")?.writes;if(!o?.has(t))return f(`Cannot ${e} into ${r[t].label}; only an image format can take the edit.`,`Choose one of: ${[...o??[]].join(", ")}.`)}var T=t=>`${t.width}x${t.height}`,C=t=>"percent"in t?`${t.percent}pct`:"width"in t?`${t.width}w`:`${t.height}h`;export{s as a,I as b,d as c,p as d,F as e,g as f,z as g,R as h,$ as i,O as j,j as k,T as l,C as m};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
|
+
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
+
import{b as h,c as S,d as A,e as R,f as T,g}from"./chunk-QVACE4IE.js";import{I as E}from"./chunk-MMRDELHW.js";var y={set:"tailwind",start:50,end:950,count:11},O=["tailwind","even","radix"],v=[0,50,100,150,200,250,300,350,400,450],D=[550,600,650,700,750,800,850,900,950,1e3],I=Array.from({length:19},(e,n)=>n+3),$=[20,50,100,150,200,260,330,420,500,560,750,920],N=8;function P({set:e,start:n,end:r,count:o}){if(!O.includes(e))return`The set must be tailwind, even or radix; got ${e}.`;if(e!=="radix"){if(!v.includes(n))return n%50===0?`The start must be from 0 to 450, so the colour (500) stays in the scale; got ${n}.`:`The start must be a multiple of 50; got ${n}.`;if(!D.includes(r))return r%50===0?`The end must be from 550 to 1000, so the colour (500) stays in the scale; got ${r}.`:`The end must be a multiple of 50; got ${r}.`;if(e==="even"&&!I.includes(o))return`An even set has 3 to 21 steps; got ${o}.`}}function d(e){let{set:n,start:r,end:o,count:a}=e;if(n==="radix")return $.map((t,s)=>({step:s+1,at:t}));if(n==="tailwind"){let t=new Set([r,o,500]);for(let s=Math.ceil((r+1)/100)*100;s<o;s+=100)t.add(s);return[...t].sort((s,u)=>s-u).map(s=>({step:s,at:s}))}let i=a-1,f=Math.round(i*(500-r)/(o-r)),c=Math.max(1,Math.min(i-1,f)),p=i-c,b=[];for(let t=0;t<=c;t++)b.push(r+(500-r)*t/c);for(let t=1;t<=p;t++)b.push(500+(o-500)*t/p);for(let t of[10,5,1]){let s=b.map(u=>Math.round(u/t)*t);if(new Set(s).size===s.length)return b.map((u,l)=>({step:s[l],at:u}))}return b.map(t=>({step:t,at:t}))}function _(e){return d(e).map(n=>n.step)}var z=_(y);function K(e){return e.set==="radix"?N:d(e).findIndex(n=>n.at===500)}var W=[[50,1],[100,.86],[200,.68],[300,.46],[400,.22],[500,0]],F=[[500,0],[600,.2],[700,.4],[800,.6],[900,.8],[950,1]];function w(e,n){for(let r=1;r<e.length;r++){let[o,a]=e[r-1],[i,f]=e[r];if(n<=i)return a+(f-a)*(n-o)/(i-o)}return e[e.length-1][1]}var H=.995,U=.35,j=5e-4;function Y(e,n=y){let r=P(n);if(r)throw E(r,"Try: Tailwind, from 50 to 950.");let{L:o,C:a,h:i}=T(S(e)),f=a<j,c=Math.max(.975,o),p=o<.16?.42*o:Math.max(.16,.42*o);return d(n).map(({step:b,at:t})=>{if(t===500)return{step:b,at:t,rgb:{...e},hex:h(e),reference:!0};let s,u;if(t>=50&&t<500){let m=w(W,t);s=o+(c-o)*m,u=a*(1-.88*m)}else if(t<50){let m=(50-t)/50;s=c+(Math.max(H,c)-c)*m,u=a*.12*(1-m)}else if(t<=950){let m=w(F,t);s=o-(o-p)*m,u=a*(1-.45*m)}else{let m=(t-950)/50;s=p*(1-U*m),u=a*.55*(1-.4*m)}for(f&&(u=0);u>0&&!R(g({L:s,C:u,h:i}));)u-=.002;let l=A(g({L:s,C:Math.max(0,u),h:i}));return{step:b,at:t,rgb:l,hex:h(l),reference:!1}})}var x=e=>{let n=e/255;return n<=.04045?n/12.92:((n+.055)/1.055)**2.4},M=({r:e,g:n,b:r})=>.2126*x(e)+.7152*x(n)+.0722*x(r);function L(e,n){let[r,o]=[M(e),M(n)].sort((a,i)=>i-a);return(r+.05)/(o+.05)}function J(e){return e>=7?"AAA":e>=4.5?"AA":e>=3?"large":"fails"}var k={r:255,g:255,b:255},B={r:0,g:0,b:0},C=e=>Math.floor(e*10)/10;function Q(e){return{white:C(L(e,k)),black:C(L(e,B))}}export{y as a,O as b,v as c,D as d,I as e,d as f,_ as g,K as h,Y as i,L as j,J as k,Q as l};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
2
|
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
-
import{a as l}from"./chunk-J7FLFHQJ.js";import{homedir as f}from"node:os";import{posix as c,win32 as h}from"node:path";var g=/[\u0000-\u001f\u007f-\u009f--]/g;function d(e){return e.replace(g,"?")}function p(e,t,n){let i=n.relative(t,e);if(i==="")return"";if(!(i===".."||i.startsWith(`..${n.sep}`)||n.isAbsolute(i)))return i}function k(e,t={}){return d(m(e,t))}function m(e,t){let n=(t.platform??process.platform)==="win32"?h:c;if(t.cwd!==void 0){let a=p(e,t.cwd,n);if(a!==void 0)return a===""?".":a}let i=p(e,t.home??f(),n);return i!==void 0?i===""?"~":`~${n.sep}${i}`:e}function r(e,t=process.platform){return d((t==="win32"?h:c).basename(e))}var s={jpeg:{id:"jpeg",label:"JPEG",extensions:[".jpg",".jpeg"],hasAlpha:!1,animatable:!1,lossy:!0,hint:"universal",defaultQuality:82},png:{id:"png",label:"PNG",extensions:[".png"],hasAlpha:!0,animatable:!1,lossy:!1,hint:"lossless"},webp:{id:"webp",label:"WebP",extensions:[".webp"],hasAlpha:!0,animatable:!0,lossy:!0,hint:"smaller, modern",defaultQuality:80},avif:{id:"avif",label:"AVIF",extensions:[".avif"],hasAlpha:!0,animatable:!0,lossy:!0,hint:"smallest",defaultQuality:50},heic:{id:"heic",label:"HEIC",extensions:[".heic",".heif"],hasAlpha:!0,animatable:!1,lossy:!0,hint:"Apple photos"},gif:{id:"gif",label:"GIF",extensions:[".gif"],hasAlpha:!0,animatable:!0,lossy:!1,hint:"animation"},tiff:{id:"tiff",label:"TIFF",extensions:[".tif",".tiff"],hasAlpha:!0,animatable:!1,lossy:!1,hint:"archival"},pdf:{id:"pdf",label:"PDF",extensions:[".pdf"],hasAlpha:!1,animatable:!1,lossy:!1,hint:"document"},docx:{id:"docx",label:"DOCX",extensions:[".docx"],hasAlpha:!1,animatable:!1,lossy:!1,hint:"Word document"},doc:{id:"doc",label:"DOC",extensions:[".doc"],hasAlpha:!1,animatable:!1,lossy:!1,hint:"legacy Word"}},I=Object.keys(s);function S(e){return s[e.toLowerCase()]}function T(e){let t=s[e].extensions[0];if(!t)throw new Error(`format ${e} declares no extensions`);return t}import{dirname as w}from"node:path";var o=class extends Error{code;title;detail;short;hint;shellHint;constructor(t){super(`${t.title}: ${t.detail}`,t.cause===void 0?void 0:{cause:t.cause}),this.name="ForgeError",this.code=t.code,this.title=t.title,this.detail=t.detail,this.short=t.short,this.hint=t.hint,this.shellHint=t.shellHint}};function x(e){return e instanceof o}function O(e){return new o({code:"file-not-found",title:"File not found",detail:`${r(e)} could not be found.`,short:`${r(e)} could not be found.`,hint:"Check the filename and try again."})}function j(e){return new o({code:"not-a-file",title:"Not a file",detail:`${r(e)} is not a file.`,short:`${r(e)} is not a file.`,hint:"Point Forge at an image, or at a directory of images."})}function R(e){return new o({code:"permission-denied",title:"Permission denied",detail:`${r(e)} could not be read.`,short:`${r(e)} could not be read.`,hint:"Check the file permissions and try again."})}function U(e){return new o({code:"not-a-directory",title:"Invalid path",detail:`${r(e)} could not be found: part of its path is not a directory.`,short:`part of ${r(e)}'s path is not a folder.`,hint:"Check the path and try again."})}function z(e){return new o({code:"symlink-loop",title:"Too many symbolic links",detail:`${r(e)} could not be resolved: its path contains a symbolic-link loop.`,short:`${r(e)}'s path loops back on itself.`,hint:"Check for a circular symlink somewhere in the path."})}function J(e){return new o({code:"path-too-long",title:"Path too long",detail:`${r(e)}'s path is too long for the filesystem to resolve.`,short:`${r(e)}'s path is too long.`,hint:"Use a shorter path and try again."})}function W(e,t){return new o({code:"unreadable-path",title:"Could not read path",detail:`${r(e)} could not be checked.`,short:`${r(e)} could not be checked.`,hint:"Check the path and try again.",cause:t})}function M(e,t){return new o({code:"unsupported-source",title:"Unsupported file type",detail:`${r(e)} is ${t}, which Forge cannot read.`,short:`${r(e)} is ${t}, which Forge cannot read.`,hint:"Forge 0.1 handles images only."})}function L(e,t){return new o({code:"unsupported-source",title:"Not an image",detail:`${r(e)} is ${t}, not an image.`,hint:"A palette is taken from a photo, a screenshot or artwork."})}function _(e){return new o({code:"unsupported-source",title:"Nothing to take colours from",detail:`${r(e)} has no visible pixels.`})}function B(e,t=process.platform){return t==="win32"?new o({code:"heic-decoder-unavailable",title:"Cannot read HEIC here",detail:`${r(e,t)} is a HEIC photo, which needs Forge's free HEIC extension on Windows.`,short:"HEIC needs the heic extension.",hint:"Install it with: forge extensions add heic",shellHint:"Open /extensions to install it."}):new o({code:"heic-decoder-unavailable",title:"Cannot read HEIC here",detail:`${r(e)} is a HEIC photo, which Forge decodes with the macOS sips tool.`,short:"HEIC needs sips, which could not be run.",hint:"sips could not be run. It ships with macOS at /usr/bin/sips."})}function G(e,t){let n=r(e.path);if(t!==void 0&&t!==e.format){let i=s[t].label;return s[t].lossy?new o({code:"unsupported-compress",title:"Cannot fit that to a size",detail:`Forge cannot search ${n} \u2192 ${i} toward a size yet.`,hint:"Convert it first, then compress the result with --max-size.",shellHint:"Convert it first, then /compress the result to a size."}):new o({code:"unsupported-compress",title:"Cannot fit that to a size",detail:`${i} is lossless \u2014 there is no quality to trade away, so ${n} cannot be made to fit as ${i}.`,hint:"Drop --max-size, or choose a lossy target. forge --formats lists them.",shellHint:"Choose a lossy target to aim for a size."})}if(e.kind==="document"&&e.format==="pdf"){let i=e.images?.skipped??0;return new o({code:"unsupported-compress",title:"Nothing to compress",detail:i>0?`${n}'s images are a kind Forge cannot re-encode, so there is nothing to make smaller.`:`${n} has no images \u2014 it is text and layout, which compression cannot shrink.`,hint:"Try a page operation such as --extract to keep fewer pages, or --to <format> to turn its pages into images.",shellHint:"Try /pdf to keep fewer pages, or /convert to turn its pages into images."})}return e.kind==="document"?new o({code:"unsupported-compress",title:"Nothing to compress",detail:`${n} is ${s[e.format].label}, which has no images Forge can re-encode.`,hint:`Use --to pdf to change it to PDF instead: forge ${n} --to pdf`,shellHint:"Use /convert to change it to PDF instead."}):new o({code:"unsupported-compress",title:"Nothing to compress",detail:`${n} is ${s[e.format].label}, which is lossless \u2014 there is no quality to trade away.`,hint:"Use --to to change it to a smaller format instead. forge --formats lists them.",shellHint:"Use /convert to change it to a smaller format instead."})}function q(e){let t=r(e.path);return new o({code:"unsupported-pdf",title:"/pdf needs a PDF",detail:`${t} is ${s[e.format].label}, not a PDF.`,hint:"Converting it instead."})}function Q(e,t,n){return new o({code:"unsupported-operation",title:`Cannot ${e} these files`,detail:`Not available for these files: ${t}.`,hint:n??"Page operations work on PDFs: --merge takes two or more, the others take one.",shellHint:n??"Use /pdf with a PDF staged \u2014 two or more for merge."})}function X(e,t,n){return new o({code:"target-unreachable",title:"Cannot get that small",detail:`${r(e.path)} is ${l(n)} even at the lowest quality, which is still over ${l(t)}.`,hint:"Try a larger --max-size, or --to a smaller format.",shellHint:"Try a larger target, or /convert to a smaller format."})}function V(e,t,n){return new o({code:"unsupported-target",title:`Can't convert ${r(e.path)} to ${t}`,detail:`${r(e.path)} is a ${s[e.format].label} ${e.kind==="image"?"image":"document"}.`,hint:`Available: ${n.join(", ")}`})}function Y(e,t){return new o({code:"corrupt-source",title:"Damaged file",detail:`${r(e)} could not be read. It may be damaged, or not a format Forge recognises.`,short:`${r(e)} could not be read.`,hint:"The file may be incomplete or corrupted.",cause:t})}function K(e,t,n){return new o({code:"corrupt-source",title:`Damaged ${s[t].label}`,detail:`${r(e)} is a ${s[t].label} file, but its content could not be read.`,short:`${r(e)} could not be read.`,hint:"The file may be incomplete or corrupted.",cause:n})}function Z(e,t={}){let n=r(e);return new o({code:"encrypted-source",title:"This PDF is password-protected",detail:`${n} is password-protected.`,short:`${n} is password-protected.`,hint:t.attempted?"That password didn't open it. Check it and try again.":`Convert it to images instead: forge ${n} --to jpeg --password-stdin`})}var u=e=>e==="convert"||e==="boost"||e==="remove-background";function ee(e,t="convert"){return new o({code:"output-exists",title:"File already exists",detail:`${r(e)} is already there.`,hint:u(t)?"Pass --force to replace it, or choose a different --output.":"Pass --force to replace it, or move the existing file out of the way.",shellHint:"Run it again and Forge will ask before replacing it."})}function te(e,t){return new o({code:"output-collision",title:"Two files want the same output",detail:`${r(e[0])} and ${r(e[1])} would both become ${r(t)}.`,hint:"Convert them separately, or use --output to send them to different folders.",shellHint:"Convert them one at a time."})}function oe(e,t){return new o({code:"output-collision",title:"One output, written twice",detail:`${r(e)} would write ${r(t)} twice, and only the second would survive.`,hint:"Every output has to be its own file. Check the selection for a repeated page."})}function ne(e,t="convert"){return new o({code:"output-is-input",title:"Output would replace the original",detail:`${r(e)} is both the input and the output.`,hint:u(t)?"Choose a different --output, or pass --force to overwrite in place.":"Move or rename that file first, or pass --force to overwrite it in place.",shellHint:u(t)?"Choose a different folder to save it in.":"Move or rename that file first."})}function b(e,t){return new o({code:"permission-denied",title:"Permission denied",detail:`${r(w(e))} is not a folder you can write to.`,hint:"Choose a different --output, or check the folder permissions.",shellHint:"Choose a different folder, or check its permissions.",cause:t})}var y=new Set(["EACCES","EPERM","EROFS"]);function re(e,t){if(x(t))return t;let n=t?.code;return n!==void 0&&y.has(n)?b(e,t):t}function ie(e,t){return new o({code:"output-invalid",title:"Cannot write there",detail:`${e} could not be written to.`,hint:"Check that the path is valid and that you have permission to write to it.",cause:t})}function se(e){return new o({code:"empty-directory",title:"No images found",detail:`${r(e)} contains no images Forge can convert.`,hint:"Try --recursive to look inside subfolders.",shellHint:"Only files directly inside a folder are read \u2014 drop the files themselves, or the folder that holds them."})}function ae(e,t){return new o({code:"invalid-arguments",title:"Invalid arguments",detail:e,hint:t})}function le(e,t,n){return new o({code:"invalid-page-range",title:"Page range not understood",detail:t,hint:`This document has ${n} pages. Use numbers and spans, like "3-7, 12, 20-".`})}function de(e){return new o({code:"empty-selection",title:"Nothing to write",detail:e,hint:"Select at least one page to keep."})}function ue(e){return new o({code:"invalid-dpi",title:"Invalid resolution",detail:`${String(e)} is not a resolution Forge can use.`,hint:"Give a number between 36 and 600. The default is 150."})}function pe(e){return new o({code:"extension-missing",title:"Extension not installed",detail:`${e} is an optional extension and is not installed.`,hint:`Install it with: forge extensions add ${e}`,shellHint:"Open /extensions to install it."})}function ce(e,t,n,i){return new o({code:"extension-outdated",title:"Extension out of date",detail:`${e} ${n} cannot ${t}; that needs ${i} or later.`,hint:`Update it with: forge extensions add ${e}`,shellHint:"Open /extensions to update it."})}function he(e,t){return new o({code:"extension-corrupt",title:"Extension failed verification",detail:`${e}: ${t}`,hint:`Nothing was installed. Try again with: forge extensions add ${e}`,shellHint:"Nothing was installed. Try again from /extensions."})}function ge(e,t,n=process.platform){let i=n==="win32"?"PC":"Mac";return new o({code:"extension-unsupported",title:"Extension not available here",detail:`${e} cannot be installed on this ${i}: ${t}`,hint:"See what is available with: forge extensions",shellHint:"See what is available in /extensions."})}function fe(e,t=process.platform){let n=t==="win32"?"Windows":t==="darwin"?"macOS":"this system";return new o({code:"extension-unsupported",title:"Extension not available here",detail:`${e} is not available on ${n}.`,hint:"See what is available with: forge extensions",shellHint:"See what is available in /extensions."})}function me(e){return new o({code:"update-unavailable",title:"Cannot update this Forge",detail:`This copy of Forge was not installed with npm i -g, so ${e} cannot be installed over it.`,hint:"npm i -g forge-terminal"})}function we(e,t=process.platform){return t==="win32"?new o({code:"update-denied",title:"Forge is in use",detail:`npm could not replace Forge's files to update it to ${e}. Windows keeps them locked while Forge runs: close every Forge window, then run the command below. If Node is installed for every user, run it in a terminal opened as administrator.`,short:"Windows locks Forge while it runs: close it, then run this",hint:`npm i -g forge-terminal@${e}`}):new o({code:"update-denied",title:"npm needs permission",detail:`npm needs permission to update Forge to ${e}.`,short:"npm needs permission to update Forge",hint:`sudo npm i -g forge-terminal@${e}`})}function xe(e,t){return new o({code:"update-failed",title:"Update failed",detail:`npm could not install Forge ${e}: ${t}`,short:"npm could not install the update",hint:`npm i -g forge-terminal@${e}`})}function be(){return new o({code:"update-unreachable",title:"Could not check for updates",detail:"The npm registry could not be reached.",short:"could not reach npm",hint:"Check your connection (and HTTPS_PROXY if you use a proxy), then run: forge update",shellHint:"Check your connection, then try again."})}function ye(e,t){return new o({code:"extension-download-failed",title:"Download failed",detail:`${e}: ${t}`,hint:`Check your connection (and HTTPS_PROXY if you use a proxy), then run: forge extensions add ${e}`,shellHint:"Check your connection, then try again from /extensions."})}function $e(e,t){return new o({code:"extension-download-failed",title:"Not enough disk space",detail:`${e}: ${t}`,hint:`Free some disk space, then run: forge extensions add ${e}`,shellHint:"Free some disk space, then try again from /extensions."})}function Fe(e,t,n){let i=t?t.what?`${t.what} (forge, pid ${t.pid})`:`another forge (pid ${t.pid}) is using it`:"another forge is using it";return new o({code:"extension-in-use",title:"Extension in use",detail:`${e} is in use: ${i}.`,hint:n==="remove"?`Wait for that job to finish, then run: forge extensions remove ${e}`:"Wait for that job to finish, then try again.",shellHint:n==="remove"?"It can be removed when that job finishes.":"Try again when that job finishes."})}function Ee(e){return new o({code:"no-subject",title:"No subject found",detail:`${r(e)} has no clear subject to cut out.`,hint:"Try a photo where the subject stands apart from the background."})}function ve(e,t,n){return n===1?new o({code:"boost-too-large",title:"Too large to sharpen",detail:`${r(e)} is too large to sharpen.`,hint:"Sharpen works on images up to 16,384 px a side and 100 megapixels."}):new o({code:"boost-too-large",title:"Too large to boost",detail:t>=2?`${r(e)} is too large to boost that far; ${t}x is the most it can take.`:`${r(e)} is already too large to boost.`,hint:t>=2?`Try --boost ${t}.`:"Boost works on images up to 100 megapixels.",shellHint:t>=2?`Choose ${t}x instead.`:void 0})}function ke(e,t){return new o({code:"resize-too-large",title:"Too large to resize to",detail:`${r(e)} would be ${t.width} \xD7 ${t.height}.`,hint:"Resize works up to 16,384 px a side and 100 megapixels."})}function Ce(e){return new o({code:"nothing-to-trim",title:"Nothing to trim",detail:`${r(e)} has no empty edges.`,short:"no empty edges"})}function Ie(e){return new o({code:"animated-trim",title:"Can't trim an animation",detail:`${r(e)} is animated; trimming works on still images.`})}function Se(e,t){return new o({code:"conversion-failed",title:"Conversion failed",detail:`${r(e)} could not be converted.`,hint:"Run again with --debug for the underlying error.",shellHint:"Run the same conversion with forge --debug from the command line to see why.",cause:t})}function Te(e){return new o({code:"unexpected",title:"Something went wrong",detail:e instanceof Error?e.message:String(e),hint:"This was not expected. Try again \u2014 if it keeps happening, it may be worth reporting.",cause:e})}function Pe(e,t={}){let n=[`\u2715 ${e.title}`,"",` ${e.detail}`];return e.hint&&n.push("",` ${e.hint}`),t.debug&&e.cause instanceof Error&&n.push("",` ${e.cause.stack??e.cause.message}`),n}export{d as a,k as b,r as c,s as d,S as e,T as f,x as g,O as h,j as i,R as j,U as k,z as l,J as m,W as n,M as o,L as p,_ as q,B as r,G as s,q as t,Q as u,X as v,V as w,Y as x,K as y,Z as z,ee as A,te as B,oe as C,ne as D,b as E,re as F,ie as G,se as H,ae as I,le as J,de as K,ue as L,pe as M,ce as N,he as O,ge as P,fe as Q,me as R,we as S,xe as T,be as U,ye as V,$e as W,Fe as X,Ee as Y,ve as Z,ke as _,Ce as $,Ie as aa,Se as ba,Te as ca,Pe as da};
|
|
3
|
+
import{a as l}from"./chunk-J7FLFHQJ.js";import{homedir as f}from"node:os";import{posix as c,win32 as h}from"node:path";var g=/[\u0000-\u001f\u007f-\u009f--]/g;function d(e){return e.replace(g,"?")}function p(e,t,r){let i=r.relative(t,e);if(i==="")return"";if(!(i===".."||i.startsWith(`..${r.sep}`)||r.isAbsolute(i)))return i}function k(e,t={}){return d(m(e,t))}function m(e,t){let r=(t.platform??process.platform)==="win32"?h:c;if(t.cwd!==void 0){let a=p(e,t.cwd,r);if(a!==void 0)return a===""?".":a}let i=p(e,t.home??f(),r);return i!==void 0?i===""?"~":`~${r.sep}${i}`:e}function n(e,t=process.platform){return d((t==="win32"?h:c).basename(e))}var s={jpeg:{id:"jpeg",label:"JPEG",extensions:[".jpg",".jpeg"],hasAlpha:!1,animatable:!1,lossy:!0,hint:"universal",defaultQuality:82},png:{id:"png",label:"PNG",extensions:[".png"],hasAlpha:!0,animatable:!1,lossy:!1,hint:"lossless"},webp:{id:"webp",label:"WebP",extensions:[".webp"],hasAlpha:!0,animatable:!0,lossy:!0,hint:"smaller, modern",defaultQuality:80},avif:{id:"avif",label:"AVIF",extensions:[".avif"],hasAlpha:!0,animatable:!0,lossy:!0,hint:"smallest",defaultQuality:50},heic:{id:"heic",label:"HEIC",extensions:[".heic",".heif"],hasAlpha:!0,animatable:!1,lossy:!0,hint:"Apple photos"},gif:{id:"gif",label:"GIF",extensions:[".gif"],hasAlpha:!0,animatable:!0,lossy:!1,hint:"animation"},tiff:{id:"tiff",label:"TIFF",extensions:[".tif",".tiff"],hasAlpha:!0,animatable:!1,lossy:!1,hint:"archival"},pdf:{id:"pdf",label:"PDF",extensions:[".pdf"],hasAlpha:!1,animatable:!1,lossy:!1,hint:"document"},docx:{id:"docx",label:"DOCX",extensions:[".docx"],hasAlpha:!1,animatable:!1,lossy:!1,hint:"Word document"},doc:{id:"doc",label:"DOC",extensions:[".doc"],hasAlpha:!1,animatable:!1,lossy:!1,hint:"legacy Word"}},I=Object.keys(s);function S(e){return s[e.toLowerCase()]}function T(e){let t=s[e].extensions[0];if(!t)throw new Error(`format ${e} declares no extensions`);return t}import{dirname as w}from"node:path";var o=class extends Error{code;title;detail;short;hint;shellHint;constructor(t){super(`${t.title}: ${t.detail}`,t.cause===void 0?void 0:{cause:t.cause}),this.name="ForgeError",this.code=t.code,this.title=t.title,this.detail=t.detail,this.short=t.short,this.hint=t.hint,this.shellHint=t.shellHint}};function x(e){return e instanceof o}function O(e){return new o({code:"file-not-found",title:"File not found",detail:`${n(e)} could not be found.`,short:`${n(e)} could not be found.`,hint:"Check the filename and try again."})}function j(e){return new o({code:"not-a-file",title:"Not a file",detail:`${n(e)} is not a file.`,short:`${n(e)} is not a file.`,hint:"Point Forge at an image, or at a directory of images."})}function R(e){return new o({code:"permission-denied",title:"Permission denied",detail:`${n(e)} could not be read.`,short:`${n(e)} could not be read.`,hint:"Check the file permissions and try again."})}function U(e){return new o({code:"not-a-directory",title:"Invalid path",detail:`${n(e)} could not be found: part of its path is not a directory.`,short:`part of ${n(e)}'s path is not a folder.`,hint:"Check the path and try again."})}function z(e){return new o({code:"symlink-loop",title:"Too many symbolic links",detail:`${n(e)} could not be resolved: its path contains a symbolic-link loop.`,short:`${n(e)}'s path loops back on itself.`,hint:"Check for a circular symlink somewhere in the path."})}function J(e){return new o({code:"path-too-long",title:"Path too long",detail:`${n(e)}'s path is too long for the filesystem to resolve.`,short:`${n(e)}'s path is too long.`,hint:"Use a shorter path and try again."})}function W(e,t){return new o({code:"unreadable-path",title:"Could not read path",detail:`${n(e)} could not be checked.`,short:`${n(e)} could not be checked.`,hint:"Check the path and try again.",cause:t})}function M(e,t){return new o({code:"unsupported-source",title:"Unsupported file type",detail:`${n(e)} is ${t}, which Forge cannot read.`,short:`${n(e)} is ${t}, which Forge cannot read.`,hint:"Forge 0.1 handles images only."})}function L(e,t){return new o({code:"unsupported-source",title:"Not an image",detail:`${n(e)} is ${t}, not an image.`,hint:"A palette is taken from a photo, a screenshot or artwork."})}function _(e){return new o({code:"unsupported-source",title:"Nothing to take colours from",detail:`${n(e)} has no visible pixels.`})}function B(e,t=process.platform){return t==="win32"?new o({code:"heic-decoder-unavailable",title:"Cannot read HEIC here",detail:`${n(e,t)} is a HEIC photo, which needs Forge's free HEIC extension on Windows.`,short:"HEIC needs the heic extension.",hint:"Install it with: forge extensions add heic",shellHint:"Open /extensions to install it."}):new o({code:"heic-decoder-unavailable",title:"Cannot read HEIC here",detail:`${n(e)} is a HEIC photo, which Forge decodes with the macOS sips tool.`,short:"HEIC needs sips, which could not be run.",hint:"sips could not be run. It ships with macOS at /usr/bin/sips."})}function G(e,t){let r=n(e.path);if(t!==void 0&&t!==e.format){let i=s[t].label;return s[t].lossy?new o({code:"unsupported-compress",title:"Cannot fit that to a size",detail:`Forge cannot search ${r} \u2192 ${i} toward a size yet.`,hint:"Convert it first, then compress the result with --max-size.",shellHint:"Convert it first, then /compress the result to a size."}):new o({code:"unsupported-compress",title:"Cannot fit that to a size",detail:`${i} is lossless \u2014 there is no quality to trade away, so ${r} cannot be made to fit as ${i}.`,hint:"Drop --max-size, or choose a lossy target. forge --formats lists them.",shellHint:"Choose a lossy target to aim for a size."})}if(e.kind==="document"&&e.format==="pdf"){let i=e.images?.skipped??0;return new o({code:"unsupported-compress",title:"Nothing to compress",detail:i>0?`${r}'s images are a kind Forge cannot re-encode, so there is nothing to make smaller.`:`${r} has no images \u2014 it is text and layout, which compression cannot shrink.`,hint:"Try a page operation such as --extract to keep fewer pages, or --to <format> to turn its pages into images.",shellHint:"Try /pdf to keep fewer pages, or /convert to turn its pages into images."})}return e.kind==="document"?new o({code:"unsupported-compress",title:"Nothing to compress",detail:`${r} is ${s[e.format].label}, which has no images Forge can re-encode.`,hint:`Use --to pdf to change it to PDF instead: forge ${r} --to pdf`,shellHint:"Use /convert to change it to PDF instead."}):new o({code:"unsupported-compress",title:"Nothing to compress",detail:`${r} is ${s[e.format].label}, which is lossless \u2014 there is no quality to trade away.`,hint:"Use --to to change it to a smaller format instead. forge --formats lists them.",shellHint:"Use /convert to change it to a smaller format instead."})}function q(e){let t=n(e.path);return new o({code:"unsupported-pdf",title:"/pdf needs a PDF",detail:`${t} is ${s[e.format].label}, not a PDF.`,hint:"Converting it instead."})}function Q(e,t,r){return new o({code:"unsupported-operation",title:`Cannot ${e} these files`,detail:`Not available for these files: ${t}.`,hint:r??"Page operations work on PDFs: --merge takes two or more, the others take one.",shellHint:r??"Use /pdf with a PDF staged \u2014 two or more for merge."})}function X(e,t,r){return new o({code:"target-unreachable",title:"Cannot get that small",detail:`${n(e.path)} is ${l(r)} even at the lowest quality, which is still over ${l(t)}.`,hint:"Try a larger --max-size, or --to a smaller format.",shellHint:"Try a larger target, or /convert to a smaller format."})}function V(e,t,r){return new o({code:"unsupported-target",title:`Can't convert ${n(e.path)} to ${t}`,detail:`${n(e.path)} is a ${s[e.format].label} ${e.kind==="image"?"image":"document"}.`,hint:`Available: ${r.join(", ")}`})}function Y(e,t){return new o({code:"corrupt-source",title:"Damaged file",detail:`${n(e)} could not be read. It may be damaged, or not a format Forge recognises.`,short:`${n(e)} could not be read.`,hint:"The file may be incomplete or corrupted.",cause:t})}function K(e,t,r){return new o({code:"corrupt-source",title:`Damaged ${s[t].label}`,detail:`${n(e)} is a ${s[t].label} file, but its content could not be read.`,short:`${n(e)} could not be read.`,hint:"The file may be incomplete or corrupted.",cause:r})}function Z(e,t={}){let r=n(e);return new o({code:"encrypted-source",title:"This PDF is password-protected",detail:`${r} is password-protected.`,short:`${r} is password-protected.`,hint:t.attempted?"That password didn't open it. Check it and try again.":`Convert it to images instead: forge ${r} --to jpeg --password-stdin`})}var u=e=>e==="convert"||e==="boost"||e==="remove-background";function ee(e,t="convert"){return new o({code:"output-exists",title:"File already exists",detail:`${n(e)} is already there.`,hint:u(t)?"Pass --force to replace it, or choose a different --output.":"Pass --force to replace it, or move the existing file out of the way.",shellHint:"Run it again and Forge will ask before replacing it."})}function te(e,t){return new o({code:"output-collision",title:"Two files want the same output",detail:`${n(e[0])} and ${n(e[1])} would both become ${n(t)}.`,hint:"Convert them separately, or use --output to send them to different folders.",shellHint:"Convert them one at a time."})}function oe(e,t){return new o({code:"output-collision",title:"One output, written twice",detail:`${n(e)} would write ${n(t)} twice, and only the second would survive.`,hint:"Every output has to be its own file. Check the selection for a repeated page."})}function ne(e,t="convert"){return new o({code:"output-is-input",title:"Output would replace the original",detail:`${n(e)} is both the input and the output.`,hint:u(t)?"Choose a different --output, or pass --force to overwrite in place.":"Move or rename that file first, or pass --force to overwrite it in place.",shellHint:u(t)?"Choose a different folder to save it in.":"Move or rename that file first."})}function b(e,t){return new o({code:"permission-denied",title:"Permission denied",detail:`${n(w(e))} is not a folder you can write to.`,hint:"Choose a different --output, or check the folder permissions.",shellHint:"Choose a different folder, or check its permissions.",cause:t})}var $=new Set(["EACCES","EPERM","EROFS"]);function re(e,t){if(x(t))return t;let r=t?.code;return r!==void 0&&$.has(r)?b(e,t):t}function ie(e,t){return new o({code:"output-invalid",title:"Cannot write there",detail:`${e} could not be written to.`,hint:"Check that the path is valid and that you have permission to write to it.",cause:t})}function se(e){return new o({code:"empty-directory",title:"No images found",detail:`${n(e)} contains no images Forge can convert.`,hint:"Try --recursive to look inside subfolders.",shellHint:"Only files directly inside a folder are read \u2014 drop the files themselves, or the folder that holds them."})}function ae(e,t){return new o({code:"invalid-arguments",title:"Invalid arguments",detail:e,hint:t})}function le(e,t,r){return new o({code:"invalid-page-range",title:"Page range not understood",detail:t,hint:`This document has ${r} pages. Use numbers and spans, like "3-7, 12, 20-".`})}function de(e){return new o({code:"empty-selection",title:"Nothing to write",detail:e,hint:"Select at least one page to keep."})}function ue(e){return new o({code:"invalid-dpi",title:"Invalid resolution",detail:`${String(e)} is not a resolution Forge can use.`,hint:"Give a number between 36 and 600. The default is 150."})}function pe(e){return new o({code:"extension-missing",title:"Extension not installed",detail:`${e} is an optional extension and is not installed.`,hint:`Install it with: forge extensions add ${e}`,shellHint:"Open /extensions to install it."})}function ce(e,t,r,i){return new o({code:"extension-outdated",title:"Extension out of date",detail:`${e} ${r} cannot ${t}; that needs ${i} or later.`,hint:`Update it with: forge extensions add ${e}`,shellHint:"Open /extensions to update it."})}function he(e,t){return new o({code:"extension-corrupt",title:"Extension failed verification",detail:`${e}: ${t}`,hint:`Nothing was installed. Try again with: forge extensions add ${e}`,shellHint:"Nothing was installed. Try again from /extensions."})}function ge(e,t,r=process.platform){let i=r==="win32"?"PC":"Mac";return new o({code:"extension-unsupported",title:"Extension not available here",detail:`${e} cannot be installed on this ${i}: ${t}`,hint:"See what is available with: forge extensions",shellHint:"See what is available in /extensions."})}function fe(e,t=process.platform){let r=t==="win32"?"Windows":t==="darwin"?"macOS":"this system";return new o({code:"extension-unsupported",title:"Extension not available here",detail:`${e} is not available on ${r}.`,hint:"See what is available with: forge extensions",shellHint:"See what is available in /extensions."})}function me(e){return new o({code:"update-unavailable",title:"Cannot update this Forge",detail:`This copy of Forge was not installed with npm i -g, so ${e} cannot be installed over it.`,hint:"npm i -g forge-terminal"})}function we(e,t=process.platform){return t==="win32"?new o({code:"update-denied",title:"Forge is in use",detail:`npm could not replace Forge's files to update it to ${e}. Windows keeps them locked while Forge runs: close every Forge window, then run the command below. If Node is installed for every user, run it in a terminal opened as administrator.`,short:"Windows locks Forge while it runs: close it, then run this",hint:`npm i -g forge-terminal@${e}`}):new o({code:"update-denied",title:"npm needs permission",detail:`npm needs permission to update Forge to ${e}.`,short:"npm needs permission to update Forge",hint:`sudo npm i -g forge-terminal@${e}`})}function xe(e,t){return new o({code:"update-failed",title:"Update failed",detail:`npm could not install Forge ${e}: ${t}`,short:"npm could not install the update",hint:`npm i -g forge-terminal@${e}`})}function be(){return new o({code:"update-unreachable",title:"Could not check for updates",detail:"The npm registry could not be reached.",short:"could not reach npm",hint:"Check your connection (and HTTPS_PROXY if you use a proxy), then run: forge update",shellHint:"Check your connection, then try again."})}function $e(e,t){return new o({code:"extension-download-failed",title:"Download failed",detail:`${e}: ${t}`,hint:`Check your connection (and HTTPS_PROXY if you use a proxy), then run: forge extensions add ${e}`,shellHint:"Check your connection, then try again from /extensions."})}function ye(e,t){return new o({code:"extension-download-failed",title:"Not enough disk space",detail:`${e}: ${t}`,hint:`Free some disk space, then run: forge extensions add ${e}`,shellHint:"Free some disk space, then try again from /extensions."})}function Fe(e,t,r){let i=t?t.what?`${t.what} (forge, pid ${t.pid})`:`another forge (pid ${t.pid}) is using it`:"another forge is using it";return new o({code:"extension-in-use",title:"Extension in use",detail:`${e} is in use: ${i}.`,hint:r==="remove"?`Wait for that job to finish, then run: forge extensions remove ${e}`:"Wait for that job to finish, then try again.",shellHint:r==="remove"?"It can be removed when that job finishes.":"Try again when that job finishes."})}function Ee(e){return new o({code:"no-subject",title:"No subject found",detail:`${n(e)} has no clear subject to cut out.`,hint:"Try a photo where the subject stands apart from the background."})}function ve(e,t,r){return r===1?new o({code:"boost-too-large",title:"Too large to sharpen",detail:`${n(e)} is too large to sharpen.`,hint:"Sharpen works on images up to 16,384 px a side and 100 megapixels."}):new o({code:"boost-too-large",title:"Too large to boost",detail:t>=2?`${n(e)} is too large to boost that far; ${t}x is the most it can take.`:`${n(e)} is already too large to boost.`,hint:t>=2?`Try --boost ${t}.`:"Boost works on images up to 100 megapixels.",shellHint:t>=2?`Choose ${t}x instead.`:void 0})}function ke(e,t){return new o({code:"resize-too-large",title:"Too large to resize to",detail:`${n(e)} would be ${t.width} \xD7 ${t.height}.`,hint:"Resize works up to 16,384 px a side and 100 megapixels."})}function Ce(e){return new o({code:"nothing-to-trim",title:"Nothing to trim",detail:`${n(e)} has no empty edges.`,short:"no empty edges"})}function Ie(e){return new o({code:"animated-trim",title:"Can't trim an animation",detail:`${n(e)} is animated; trimming works on still images.`})}function Se(e,t){return new o({code:"nothing-to-crop",title:"Nothing to crop",detail:`${n(e)} is already ${t}.`,short:`already ${t}`})}function Te(e){return new o({code:"animated-crop",title:"Can't crop an animation",detail:`${n(e)} is animated; cropping works on still images.`})}function Pe(e,t){return new o({code:"conversion-failed",title:"Conversion failed",detail:`${n(e)} could not be converted.`,hint:"Run again with --debug for the underlying error.",shellHint:"Run the same conversion with forge --debug from the command line to see why.",cause:t})}function He(e){return new o({code:"unexpected",title:"Something went wrong",detail:e instanceof Error?e.message:String(e),hint:"This was not expected. Try again \u2014 if it keeps happening, it may be worth reporting.",cause:e})}function Ne(e,t={}){let r=[`\u2715 ${e.title}`,"",` ${e.detail}`];return e.hint&&r.push("",` ${e.hint}`),t.debug&&e.cause instanceof Error&&r.push("",` ${e.cause.stack??e.cause.message}`),r}export{d as a,k as b,n as c,s as d,S as e,T as f,x as g,O as h,j as i,R as j,U as k,z as l,J as m,W as n,M as o,L as p,_ as q,B as r,G as s,q as t,Q as u,X as v,V as w,Y as x,K as y,Z as z,ee as A,te as B,oe as C,ne as D,b as E,re as F,ie as G,se as H,ae as I,le as J,de as K,ue as L,pe as M,ce as N,he as O,ge as P,fe as Q,me as R,we as S,xe as T,be as U,$e as V,ye as W,Fe as X,Ee as Y,ve as Z,ke as _,Ce as $,Ie as aa,Se as ba,Te as ca,Pe as da,He as ea,Ne as fa};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
|
+
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
+
import{execFile as s}from"node:child_process";import{access as a}from"node:fs/promises";import{win32 as c}from"node:path";import{promisify as f}from"node:util";var e=f(s);async function i(r){try{await e("explorer.exe",r)}catch(o){if(typeof o.code=="number")return;throw o}}var n=r=>c.normalize(r);async function t(r){try{await a(r)}catch{throw new Error(`The file ${r} does not exist.`)}}async function u(r,o=process.platform){if(o==="win32")return await t(r),i([n(r)]);await e("open",[r])}async function d(r,o=process.platform){if(o==="win32")return i([r]);await e("open",[r])}async function x(r,o=process.platform){if(o==="win32")return await t(r),i(["/select,",n(r)]);await e("open",["-R",r])}function P(r=process.platform){return r==="darwin"?"Show in Finder":r==="win32"?"Show in Explorer":"Show in file manager"}export{u as a,d as b,x as c,P as d};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
2
|
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
-
import{R as a,S as u,T as l}from"./chunk-
|
|
3
|
+
import{R as a,S as u,T as l}from"./chunk-MMRDELHW.js";import{spawn as x}from"node:child_process";import{existsSync as c,realpathSync as b}from"node:fs";import{dirname as h,join as E,win32 as d}from"node:path";function f(n,t=process.platform,e=c){if(n===void 0)return!1;if(t==="win32"){let r=/^(.*)[\\/]node_modules[\\/]forge-terminal[\\/]/.exec(n)?.[1];return r!==void 0&&e(d.join(r,"forge.cmd"))}return/\/lib\/node_modules\/forge-terminal\//.test(n)&&!n.includes("/_npx/")}function m(n){if(n!==void 0)try{return b(n)}catch{return n}}function P(n,t=c){let e=E(h(n),"npm");return t(e)?e:"npm"}function R(n,t=c){let e=d.join(d.dirname(n),"node_modules","npm","bin","npm-cli.js");return t(e)?e:void 0}var g=(n,t,e)=>new Promise(r=>{let o="",s=x(n,t,{stdio:["ignore","pipe","pipe"],...e?{signal:e}:{}});s.stdout.setEncoding("utf8").on("data",i=>{o+=i}),s.stderr.setEncoding("utf8").on("data",i=>{o+=i}),s.on("error",i=>r({code:null,output:`${o}
|
|
4
4
|
${i.message}`})),s.on("close",i=>r({code:i,output:o}))});function w(n){return n.split(`
|
|
5
5
|
`).map(e=>e.replace(/^npm (error|ERR!)\s*/,"").trim()).filter(e=>e!==""&&!/^(code|errno|syscall|path|dest|A complete log)/.test(e)).at(-1)??"npm exited without saying why"}async function _(n,t={}){let e=t.platform??process.platform;if(e==="win32")return S(n,t);let r=t.script??m(process.argv[1]);if(!f(r,e))throw a(n);let o=t.npm??P(process.execPath),s=t.run??g,{code:i,output:p}=await s(o,["install","--global",`forge-terminal@${n}`],t.signal);if(i!==0)throw/EACCES|EPERM|permission denied/i.test(p)?u(n,e):l(n,w(p))}async function S(n,t){let e=t.script??m(process.argv[1]);if(!f(e,"win32",t.exists))throw a(n);let r=R(process.execPath,t.exists);if(r===void 0)throw l(n,"npm was not found beside Node");let o=t.run??g,{code:s,output:i}=await o(process.execPath,[r,"install","--global",`forge-terminal@${n}`],t.signal);if(s!==0)throw/EACCES|EPERM|EBUSY|permission denied/i.test(i)?u(n,"win32"):l(n,w(i))}export{f as a,m as b,P as c,R as d,_ as e};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
2
|
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
-
import{a as m}from"./chunk-ZRP5CWIK.js";import{X as l}from"./chunk-
|
|
3
|
+
import{a as m}from"./chunk-ZRP5CWIK.js";import{X as l}from"./chunk-MMRDELHW.js";import{randomBytes as h}from"node:crypto";import{link as y,mkdir as p,readdir as x,readFile as P,rename as E,rm as c,stat as L,writeFile as S}from"node:fs/promises";import{join as u}from"node:path";var b=720*60*1e3,k=600*1e3,M=200,F=600*1e3;function a(){return u(m(),".locks")}function f(t){return u(a(),`${t}.lock`)}function v(t){if(!Number.isInteger(t)||t<=0)return!1;try{return process.kill(t,0),!0}catch(n){return n.code==="EPERM"}}async function s(t){try{let n=JSON.parse(await P(t,"utf8"));return typeof n.pid!="number"||typeof n.token!="string"?void 0:n}catch{return}}async function d(t,n){if(n===void 0||!v(n.pid))return!0;let e=await L(t).catch(()=>{});return e!==void 0&&Date.now()-e.mtimeMs>b}async function D(t){let n=`${t}.stale-${h(4).toString("hex")}`;try{await E(t,n)}catch{return}let e=await s(n);e!==void 0&&!await d(n,e)&&await y(n,t).catch(()=>{}),await c(n,{force:!0})}async function A(){let t=await x(a()).catch(()=>[]);for(let n of t){if(!/\.lock\.(stale-)?[0-9a-f]+$/.test(n))continue;let e=u(a(),n),i=await L(e).catch(()=>{});i&&Date.now()-i.mtimeMs>F&&await c(e,{force:!0})}}async function g(t,n){await p(a(),{recursive:!0});let e=f(t),i={pid:process.pid,token:h(8).toString("hex"),at:Date.now(),...n!==void 0?{what:n}:{}},r=`${e}.${i.token}`;await S(r,JSON.stringify(i),{flag:"wx"});try{for(let o=0;o<2;o++){try{return await y(r,e),i}catch(w){if(w.code!=="EEXIST")throw w}if(!await d(e,await s(e)))return;await D(e)}return}finally{await c(r,{force:!0})}}async function T(t,n){let e=f(t);(await s(e))?.token===n.token&&await c(e,{force:!0})}async function _(t){let n=f(t),e=await s(n);if(!(e===void 0||await d(n,e)))return{pid:e.pid,...e.what!==void 0?{what:e.what}:{}}}async function H(t,n,e={}){let i=Date.now()+(e.waitMs??k);await p(a(),{recursive:!0}),await A();let r=await g(t,e.what);for(r===void 0&&(e.waitMs??k)>0&&e.onWait?.();r===void 0;){if(e.signal?.aborted)throw e.signal.reason??new Error("aborted");if(Date.now()>=i)throw l(t,await _(t),e.action??"run");await new Promise(o=>setTimeout(o,M)),r=await g(t,e.what)}try{return await n()}finally{await T(t,r)}}export{k as a,_ as b,H as c};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
|
+
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
+
import{d as t,g as p}from"./chunk-QVACE4IE.js";var h={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},y={"cloudy blue":"#acc2d9","dark pastel green":"#56ae57",dust:"#b2996e","electric lime":"#a8ff04","fresh green":"#69d84f","light eggplant":"#894585","nasty green":"#70b23f","really light blue":"#d4ffff",tea:"#65ab7c","warm purple":"#952e8f","yellowish tan":"#fcfc81",cement:"#a5a391","dark grass green":"#388004","dusty teal":"#4c9085","grey teal":"#5e9b8a","macaroni and cheese":"#efb435","pinkish tan":"#d99b82",spruce:"#0a5f38","strong blue":"#0c06f7","toxic green":"#61de2a","windows blue":"#3778bf","blue blue":"#2242c7","blue with a hint of purple":"#533cc6",booger:"#9bb53c","bright sea green":"#05ffa6","dark green blue":"#1f6357","deep turquoise":"#017374","green teal":"#0cb577","strong pink":"#ff0789",bland:"#afa88b","deep aqua":"#08787f","lavender pink":"#dd85d7","light moss green":"#a6c875","light seafoam green":"#a7ffb5","olive yellow":"#c2b709","pig pink":"#e78ea5","deep lilac":"#966ebd",desert:"#ccad60","dusty lavender":"#ac86a8","purpley grey":"#947e94",purply:"#983fb2","candy pink":"#ff63e9","light pastel green":"#b2fba5","boring green":"#63b365","kiwi green":"#8ee53f","light grey green":"#b7e1a1","orange pink":"#ff6f52","tea green":"#bdf8a3","very light brown":"#d3b683","egg shell":"#fffcc4","eggplant purple":"#430541","powder pink":"#ffb2d0","reddish grey":"#997570","baby shit brown":"#ad900d",liliac:"#c48efd","stormy blue":"#507b9c","ugly brown":"#7d7103",custard:"#fffd78","darkish pink":"#da467d","deep brown":"#410200","greenish beige":"#c9d179",manilla:"#fffa86","off blue":"#5684ae","battleship grey":"#6b7c85","browny green":"#6f6c0a",bruise:"#7e4071","kelley green":"#009337","sickly yellow":"#d0e429","sunny yellow":"#fff917",azul:"#1d5dec",darkgreen:"#054907","green/yellow":"#b5ce08",lichen:"#8fb67b","light light green":"#c8ffb0","pale gold":"#fdde6c","sun yellow":"#ffdf22","tan green":"#a9be70",burple:"#6832e3",butterscotch:"#fdb147",toupe:"#c7ac7d","dark cream":"#fff39a","indian red":"#850e04","light lavendar":"#efc0fe","poison green":"#40fd14","baby puke green":"#b6c406","bright yellow green":"#9dff00","charcoal grey":"#3c4142",squash:"#f2ab15",cinnamon:"#ac4f06","light pea green":"#c4fe82","radioactive green":"#2cfa1f","raw sienna":"#9a6200","baby purple":"#ca9bf7",cocoa:"#875f42","light royal blue":"#3a2efe",orangeish:"#fd8d49","rust brown":"#8b3103","sand brown":"#cba560",swamp:"#698339","tealish green":"#0cdc73","burnt siena":"#b75203",camo:"#7f8f4e","dusk blue":"#26538d",fern:"#63a950","old rose":"#c87f89","pale light green":"#b1fc99","peachy pink":"#ff9a8a","rosy pink":"#f6688e","light bluish green":"#76fda8","light bright green":"#53fe5c","light neon green":"#4efd54","light seafoam":"#a0febf","tiffany blue":"#7bf2da","washed out green":"#bcf5a6","browny orange":"#ca6b02","nice blue":"#107ab0",sapphire:"#2138ab","greyish teal":"#719f91","orangey yellow":"#fdb915",parchment:"#fefcaf",straw:"#fcf679","very dark brown":"#1d0200",terracota:"#cb6843","ugly blue":"#31668a","clear blue":"#247afd",creme:"#ffffb6","foam green":"#90fda9","grey/green":"#86a17d","light gold":"#fddc5c","seafoam blue":"#78d1b6",topaz:"#13bbaf","violet pink":"#fb5ffc",wintergreen:"#20f986","yellow tan":"#ffe36e","dark fuchsia":"#9d0759","indigo blue":"#3a18b1","light yellowish green":"#c2ff89","pale magenta":"#d767ad","rich purple":"#720058","sunflower yellow":"#ffda03","green/blue":"#01c08d",leather:"#ac7434","racing green":"#014600","vivid purple":"#9900fa","dark royal blue":"#02066f",hazel:"#8e7618","muted pink":"#d1768f","booger green":"#96b403",canary:"#fdff63","cool grey":"#95a3a6","dark taupe":"#7f684e","darkish purple":"#751973","true green":"#089404","coral pink":"#ff6163","dark sage":"#598556","dark slate blue":"#214761","flat blue":"#3c73a8",mushroom:"#ba9e88","rich blue":"#021bf9","dirty purple":"#734a65",greenblue:"#23c48b","icky green":"#8fae22","light khaki":"#e6f2a2","warm blue":"#4b57db","dark hot pink":"#d90166","deep sea blue":"#015482",carmine:"#9d0216","dark yellow green":"#728f02","pale peach":"#ffe5ad","plum purple":"#4e0550","golden rod":"#f9bc08","neon red":"#ff073a","old pink":"#c77986","very pale blue":"#d6fffe","blood orange":"#fe4b03",grapefruit:"#fd5956","sand yellow":"#fce166","clay brown":"#b2713d","dark blue grey":"#1f3b4d","flat green":"#699d4c","light green blue":"#56fca2","warm pink":"#fb5581","dodger blue":"#3e82fc","gross green":"#a0bf16",ice:"#d6fffa","metallic blue":"#4f738e","pale salmon":"#ffb19a","sap green":"#5c8b15",algae:"#54ac68","bluey grey":"#89a0b0","greeny grey":"#7ea07a","highlighter green":"#1bfc06","light light blue":"#cafffb","light mint":"#b6ffbb","raw umber":"#a75e09","vivid blue":"#152eff","deep lavender":"#8d5eb7","dull teal":"#5f9e8f","light greenish blue":"#63f7b4","mud green":"#606602",pinky:"#fc86aa","red wine":"#8c0034","shit green":"#758000","tan brown":"#ab7e4c",darkblue:"#030764",rosa:"#fe86a4",lipstick:"#d5174e","pale mauve":"#fed0fc",claret:"#680018",dandelion:"#fedf08",orangered:"#fe420f","poop green":"#6f7c00",ruby:"#ca0147",dark:"#1b2431","greenish turquoise":"#00fbb0","pastel red":"#db5856","piss yellow":"#ddd618","bright cyan":"#41fdfe","dark coral":"#cf524e","algae green":"#21c36f","darkish red":"#a90308","reddy brown":"#6e1005","blush pink":"#fe828c","camouflage green":"#4b6113","lawn green":"#4da409",putty:"#beae8a","vibrant blue":"#0339f8","dark sand":"#a88f59","purple/blue":"#5d21d0",saffron:"#feb209",twilight:"#4e518b","warm brown":"#964e02",bluegrey:"#85a3b2","bubble gum pink":"#ff69af","duck egg blue":"#c3fbf4","greenish cyan":"#2afeb7",petrol:"#005f6a",royal:"#0c1793",butter:"#ffff81","dusty orange":"#f0833a","off yellow":"#f1f33f","pale olive green":"#b1d27b",orangish:"#fc824a",leaf:"#71aa34","light blue grey":"#b7c9e2","dried blood":"#4b0101","lightish purple":"#a552e6","rusty red":"#af2f0d","lavender blue":"#8b88f8","light grass green":"#9af764","light mint green":"#a6fbb2",sunflower:"#ffc512",velvet:"#750851","brick orange":"#c14a09","lightish red":"#fe2f4a","pure blue":"#0203e2","twilight blue":"#0a437a","violet red":"#a50055","yellowy brown":"#ae8b0c",carnation:"#fd798f","muddy yellow":"#bfac05","dark seafoam green":"#3eaf76","deep rose":"#c74767","dusty red":"#b9484e","grey/blue":"#647d8e","lemon lime":"#bffe28","purple/pink":"#d725de","brown yellow":"#b29705","purple brown":"#673a3f",wisteria:"#a87dc2","banana yellow":"#fafe4b","lipstick red":"#c0022f","water blue":"#0e87cc","brown grey":"#8d8468","vibrant purple":"#ad03de","baby green":"#8cff9e","barf green":"#94ac02","eggshell blue":"#c4fff7","sandy yellow":"#fdee73","cool green":"#33b864",pale:"#fff9d0","blue/grey":"#758da3","hot magenta":"#f504c9",greyblue:"#77a1b5",purpley:"#8756e4","baby shit green":"#889717","brownish pink":"#c27e79","dark aquamarine":"#017371",diarrhea:"#9f8303","light mustard":"#f7d560","pale sky blue":"#bdf6fe","turtle green":"#75b84f","bright olive":"#9cbb04","dark grey blue":"#29465b","greeny brown":"#696006","lemon green":"#adf802","light periwinkle":"#c1c6fc","seaweed green":"#35ad6b","sunshine yellow":"#fffd37","ugly purple":"#a442a0","medium pink":"#f36196","puke brown":"#947706","very light pink":"#fff4f2",viridian:"#1e9167",bile:"#b5c306","faded yellow":"#feff7f","very pale green":"#cffdbc","vibrant green":"#0add08","bright lime":"#87fd05",spearmint:"#1ef876","light aquamarine":"#7bfdc7","light sage":"#bcecac",yellowgreen:"#bbf90f","baby poo":"#ab9004","dark seafoam":"#1fb57a","deep teal":"#00555a",heather:"#a484ac","rust orange":"#c45508","dirty blue":"#3f829d","fern green":"#548d44","bright lilac":"#c95efb","weird green":"#3ae57f","peacock blue":"#016795","avocado green":"#87a922","faded orange":"#f0944d","grape purple":"#5d1451","hot green":"#25ff29","lime yellow":"#d0fe1d",mango:"#ffa62b",shamrock:"#01b44c",bubblegum:"#ff6cb5","purplish brown":"#6b4247","vomit yellow":"#c7c10c","pale cyan":"#b7fffa","key lime":"#aeff6e","tomato red":"#ec2d01",lightgreen:"#76ff7b",merlot:"#730039","night blue":"#040348","purpleish pink":"#df4ec8",apple:"#6ecb3c","baby poop green":"#8f9805","green apple":"#5edc1f",heliotrope:"#d94ff5","yellow/green":"#c8fd3d","almost black":"#070d0d","cool blue":"#4984b8","leafy green":"#51b73b","mustard brown":"#ac7e04",dusk:"#4e5481","dull brown":"#876e4b","frog green":"#58bc08","vivid green":"#2fef10","bright light green":"#2dfe54","fluro green":"#0aff02",kiwi:"#9cef43",seaweed:"#18d17b","navy green":"#35530a","ultramarine blue":"#1805db",iris:"#6258c4","pastel orange":"#ff964f","yellowish orange":"#ffab0f",perrywinkle:"#8f8ce7",tealish:"#24bca8","dark plum":"#3f012c",pear:"#cbf85f","pinkish orange":"#ff724c","midnight purple":"#280137","light urple":"#b36ff6","dark mint":"#48c072","greenish tan":"#bccb7a","light burgundy":"#a8415b","turquoise blue":"#06b1c4","ugly pink":"#cd7584",sandy:"#f1da7a","electric pink":"#ff0490","muted purple":"#805b87","mid green":"#50a747",greyish:"#a8a495","neon yellow":"#cfff04",banana:"#ffff7e","carnation pink":"#ff7fa7",tomato:"#ef4026",sea:"#3c9992","muddy brown":"#886806","turquoise green":"#04f489",buff:"#fef69e",fawn:"#cfaf7b","muted blue":"#3b719f","pale rose":"#fdc1c5","dark mint green":"#20c073",amethyst:"#9b5fc0","blue/green":"#0f9b8e",chestnut:"#742802","sick green":"#9db92c",pea:"#a4bf20","rusty orange":"#cd5909",stone:"#ada587","rose red":"#be013c","pale aqua":"#b8ffeb","deep orange":"#dc4d01",earth:"#a2653e","mossy green":"#638b27","grassy green":"#419c03","pale lime green":"#b1ff65","light grey blue":"#9dbcd4","pale grey":"#fdfdfe",asparagus:"#77ab56",blueberry:"#464196","purple red":"#990147","pale lime":"#befd73","greenish teal":"#32bf84",caramel:"#af6f09","deep magenta":"#a0025c","light peach":"#ffd8b1","milk chocolate":"#7f4e1e",ocher:"#bf9b0c","off green":"#6ba353","purply pink":"#f075e6",lightblue:"#7bc8f6","dusky blue":"#475f94",golden:"#f5bf03","light beige":"#fffeb6","butter yellow":"#fffd74","dusky purple":"#895b7b","french blue":"#436bad","ugly yellow":"#d0c101","greeny yellow":"#c6f808","orangish red":"#f43605","shamrock green":"#02c14d","orangish brown":"#b25f03","tree green":"#2a7e19","deep violet":"#490648",gunmetal:"#536267","blue/purple":"#5a06ef",cherry:"#cf0234","sandy brown":"#c4a661","warm grey":"#978a84","dark indigo":"#1f0954",midnight:"#03012d","bluey green":"#2bb179","grey pink":"#c3909b","soft purple":"#a66fb5",blood:"#770001","brown red":"#922b05","medium grey":"#7d7f7c",berry:"#990f4b",poo:"#8f7303","purpley pink":"#c83cb9","light salmon":"#fea993",snot:"#acbb0d","easter purple":"#c071fe","light yellow green":"#ccfd7f","dark navy blue":"#00022e",drab:"#828344","light rose":"#ffc5cb",rouge:"#ab1239","purplish red":"#b0054b","slime green":"#99cc04","baby poop":"#937c00","irish green":"#019529","pink/purple":"#ef1de7","dark navy":"#000435","greeny blue":"#42b395","light plum":"#9d5783","pinkish grey":"#c8aca9","dirty orange":"#c87606","rust red":"#aa2704","pale lilac":"#e4cbff","orangey red":"#fa4224","primary blue":"#0804f9","kermit green":"#5cb200","brownish purple":"#76424e","murky green":"#6c7a0e",wheat:"#fbdd7e","very dark purple":"#2a0134","bottle green":"#044a05",watermelon:"#fd4659","deep sky blue":"#0d75f8","fire engine red":"#fe0002","yellow ochre":"#cb9d06","pumpkin orange":"#fb7d07","pale olive":"#b9cc81","light lilac":"#edc8ff","lightish green":"#61e160","carolina blue":"#8ab8fe",mulberry:"#920a4e","shocking pink":"#fe02a2",auburn:"#9a3001","bright lime green":"#65fe08",celadon:"#befdb7","pinkish brown":"#b17261","poo brown":"#885f01","bright sky blue":"#02ccfe",celery:"#c1fd95","dirt brown":"#836539",strawberry:"#fb2943","dark lime":"#84b701",copper:"#b66325","medium brown":"#7f5112","muted green":"#5fa052","robin's egg":"#6dedfd","bright aqua":"#0bf9ea","bright lavender":"#c760ff",ivory:"#ffffcb","very light purple":"#f6cefc","light navy":"#155084","pink red":"#f5054f","olive brown":"#645403","poop brown":"#7a5901","mustard green":"#a8b504","ocean green":"#3d9973","very dark blue":"#000133","dusty green":"#76a973","light navy blue":"#2e5a88","minty green":"#0bf77d",adobe:"#bd6c48",barney:"#ac1db8","jade green":"#2baf6a","bright light blue":"#26f7fd","light lime":"#aefd6c","dark khaki":"#9b8f55","orange yellow":"#ffad01",ocre:"#c69c04",maize:"#f4d054","faded pink":"#de9dac","british racing green":"#05480d",sandstone:"#c9ae74","mud brown":"#60460f","light sea green":"#98f6b0","robin egg blue":"#8af1fe","aqua marine":"#2ee8bb","dark sea green":"#11875d","soft pink":"#fdb0c0","orangey brown":"#b16002","cherry red":"#f7022a","burnt yellow":"#d5ab09","brownish grey":"#86775f",camel:"#c69f59","purplish grey":"#7a687f",marine:"#042e60","greyish pink":"#c88d94","pale turquoise":"#a5fbd5","pastel yellow":"#fffe71","bluey purple":"#6241c7","canary yellow":"#fffe40","faded red":"#d3494e",sepia:"#985e2b",coffee:"#a6814c","bright magenta":"#ff08e8",mocha:"#9d7651",ecru:"#feffca",purpleish:"#98568d",cranberry:"#9e003a","darkish green":"#287c37","brown orange":"#b96902","dusky rose":"#ba6873",melon:"#ff7855","sickly green":"#94b21c",silver:"#c5c9c7","purply blue":"#661aee","purpleish blue":"#6140ef","hospital green":"#9be5aa","shit brown":"#7b5804","mid blue":"#276ab3",amber:"#feb308","easter green":"#8cfd7e","soft blue":"#6488ea","cerulean blue":"#056eee","golden brown":"#b27a01","bright turquoise":"#0ffef9","red pink":"#fa2a55","red purple":"#820747","greyish brown":"#7a6a4f",vermillion:"#f4320c",russet:"#a13905","steel grey":"#6f828a","lighter purple":"#a55af4","bright violet":"#ad0afd","prussian blue":"#004577","slate green":"#658d6d","dirty pink":"#ca7b80","dark blue green":"#005249",pine:"#2b5d34","yellowy green":"#bff128","dark gold":"#b59410",bluish:"#2976bb","darkish blue":"#014182","dull red":"#bb3f3f","pinky red":"#fc2647",bronze:"#a87900","pale teal":"#82cbb2","military green":"#667c3e","barbie pink":"#fe46a5","bubblegum pink":"#fe83cc","pea soup green":"#94a617","dark mustard":"#a88905",shit:"#7f5f00","medium purple":"#9e43a2","very dark green":"#062e03",dirt:"#8a6e45","dusky pink":"#cc7a8b","red violet":"#9e0168","lemon yellow":"#fdff38",pistachio:"#c0fa8b","dull yellow":"#eedc5b","dark lime green":"#7ebd01","denim blue":"#3b5b92","teal blue":"#01889f","lightish blue":"#3d7afd","purpley blue":"#5f34e7","light indigo":"#6d5acf","swamp green":"#748500","brown green":"#706c11","dark maroon":"#3c0008","hot purple":"#cb00f5","dark forest green":"#002d04","faded blue":"#658cbb","drab green":"#749551","light lime green":"#b9ff66","snot green":"#9dc100",yellowish:"#faee66","light blue green":"#7efbb3",bordeaux:"#7b002c","light mauve":"#c292a1",ocean:"#017b92",marigold:"#fcc006","muddy green":"#657432","dull orange":"#d8863b",steel:"#738595","electric purple":"#aa23ff","fluorescent green":"#08ff08","yellowish brown":"#9b7a01",blush:"#f29e8e","soft green":"#6fc276","bright orange":"#ff5b00",lemon:"#fdff52","purple grey":"#866f85","acid green":"#8ffe09","pale lavender":"#eecffe","violet blue":"#510ac9","light forest green":"#4f9153","burnt red":"#9f2305","khaki green":"#728639",cerise:"#de0c62","faded purple":"#916e99",apricot:"#ffb16d","dark olive green":"#3c4d03","grey brown":"#7f7053","green grey":"#77926f","true blue":"#010fcc","pale violet":"#ceaefa","periwinkle blue":"#8f99fb","light sky blue":"#c6fcff",blurple:"#5539cc","green brown":"#544e03",bluegreen:"#017a79","bright teal":"#01f9c6","brownish yellow":"#c9b003","pea soup":"#929901",forest:"#0b5509","barney purple":"#a00498",ultramarine:"#2000b1",purplish:"#94568c","puke yellow":"#c2be0e","bluish grey":"#748b97","dark periwinkle":"#665fd1","dark lilac":"#9c6da5",reddish:"#c44240","light maroon":"#a24857","dusty purple":"#825f87","terra cotta":"#c9643b",avocado:"#90b134","marine blue":"#01386a","teal green":"#25a36f","slate grey":"#59656d","lighter green":"#75fd63","electric green":"#21fc0d","dusty blue":"#5a86ad","golden yellow":"#fec615","bright yellow":"#fffd01","light lavender":"#dfc5fe",umber:"#b26400",poop:"#7f5e00","dark peach":"#de7e5d","jungle green":"#048243",eggshell:"#ffffd4",denim:"#3b638c","yellow brown":"#b79400","dull purple":"#84597e","chocolate brown":"#411900","wine red":"#7b0323","neon blue":"#04d9ff","dirty green":"#667e2c","light tan":"#fbeeac","ice blue":"#d7fffe","cadet blue":"#4e7496","dark mauve":"#874c62","very light blue":"#d5ffff","grey purple":"#826d8c","pastel pink":"#ffbacd","very light green":"#d1ffbd","dark sky blue":"#448ee4",evergreen:"#05472a","dull pink":"#d5869d",aubergine:"#3d0734",mahogany:"#4a0100","reddish orange":"#f8481c","deep green":"#02590f","vomit green":"#89a203","purple pink":"#e03fd8","dusty pink":"#d58a94","faded green":"#7bb274","camo green":"#526525","pinky purple":"#c94cbe","pink purple":"#db4bda","brownish red":"#9e3623","dark rose":"#b5485d",mud:"#735c12",brownish:"#9c6d57","emerald green":"#028f1e","pale brown":"#b1916e","dull blue":"#49759c","burnt umber":"#a0450e","medium green":"#39ad48",clay:"#b66a50","light aqua":"#8cffdb","light olive green":"#a4be5c","brownish orange":"#cb7723","dark aqua":"#05696b","purplish pink":"#ce5dae","dark salmon":"#c85a53","greenish grey":"#96ae8d",jade:"#1fa774","ugly green":"#7a9703","dark beige":"#ac9362",emerald:"#01a049","pale red":"#d9544d","light magenta":"#fa5ff7",sky:"#82cafc","light cyan":"#acfffc","yellow orange":"#fcb001","reddish purple":"#910951","reddish pink":"#fe2c54",orchid:"#c875c4","dirty yellow":"#cdc50a","orange red":"#fd411e","deep red":"#9a0200","orange brown":"#be6400","cobalt blue":"#030aa7","neon pink":"#fe019a","rose pink":"#f7879a","greyish purple":"#887191",raspberry:"#b00149","aqua green":"#12e193","salmon pink":"#fe7b7c",tangerine:"#ff9408","brownish green":"#6a6e09","red brown":"#8b2e16","greenish brown":"#696112",pumpkin:"#e17701","pine green":"#0a481e",charcoal:"#343837","baby pink":"#ffb7ce",cornflower:"#6a79f7","blue violet":"#5d06e9",chocolate:"#3d1c02","greyish green":"#82a67d",scarlet:"#be0119","green yellow":"#c9ff27","dark olive":"#373e02",sienna:"#a9561e","pastel purple":"#caa0ff",terracotta:"#ca6641","aqua blue":"#02d8e9","sage green":"#88b378","blood red":"#980002","deep pink":"#cb0162",grass:"#5cac2d",moss:"#769958","pastel blue":"#a2bffe","bluish green":"#10a674","green blue":"#06b48b","dark tan":"#af884a","greenish blue":"#0b8b87","pale orange":"#ffa756",vomit:"#a2a415","forrest green":"#154406","dark lavender":"#856798","dark violet":"#34013f","purple blue":"#632de9","dark cyan":"#0a888a","olive drab":"#6f7632",pinkish:"#d46a7e",cobalt:"#1e488f","neon purple":"#bc13fe","light turquoise":"#7ef4cc","apple green":"#76cd26","dull green":"#74a662",wine:"#80013f","powder blue":"#b1d1fc","off white":"#ffffe4","electric blue":"#0652ff","dark turquoise":"#045c5a","blue purple":"#5729ce",azure:"#069af3","bright red":"#ff000d","pinkish red":"#f10c45","cornflower blue":"#5170d7","light olive":"#acbf69",grape:"#6c3461","greyish blue":"#5e819d","purplish blue":"#601ef9","yellowish green":"#b0dd16","greenish yellow":"#cdfd02","medium blue":"#2c6fbb","dusty rose":"#c0737a","light violet":"#d6b4fc","midnight blue":"#020035","bluish purple":"#703be7","red orange":"#fd3c06","dark magenta":"#960056",greenish:"#40a368","ocean blue":"#03719c",coral:"#fc5a50",cream:"#ffffc2","reddish brown":"#7f2b0a","burnt sienna":"#b04e0f",brick:"#a03623",sage:"#87ae73","grey green":"#789b73",white:"#ffffff","robin's egg blue":"#98eff9","moss green":"#658b38","steel blue":"#5a7d9a",eggplant:"#380835","light yellow":"#fffe7a","leaf green":"#5ca904","light grey":"#d8dcd6",puke:"#a5a502","pinkish purple":"#d648d7","sea blue":"#047495","pale purple":"#b790d4","slate blue":"#5b7c99","blue grey":"#607c8e","hunter green":"#0b4008",fuchsia:"#ed0dd9",crimson:"#8c000f","pale yellow":"#ffff84",ochre:"#bf9005","mustard yellow":"#d2bd0a","light red":"#ff474c",cerulean:"#0485d1","pale pink":"#ffcfdc","deep blue":"#040273",rust:"#a83c09","light teal":"#90e4c1",slate:"#516572",goldenrod:"#fac205","dark yellow":"#d5b60a","dark grey":"#363737","army green":"#4b5d16","grey blue":"#6b8ba4",seafoam:"#80f9ad",puce:"#a57e52","spring green":"#a9f971","dark orange":"#c65102",sand:"#e2ca76","pastel green":"#b0ff9d",mint:"#9ffeb0","light orange":"#fdaa48","bright pink":"#fe01b1",chartreuse:"#c1f80a","deep purple":"#36013f","dark brown":"#341c02",taupe:"#b9a281","pea green":"#8eab12","puke green":"#9aae07","kelly green":"#02ab2e","seafoam green":"#7af9ab","blue green":"#137e6d",khaki:"#aaa662",burgundy:"#610023","dark teal":"#014d4e","brick red":"#8f1402","royal purple":"#4b006e",plum:"#580f41","mint green":"#8fff9f",gold:"#dbb40c","baby blue":"#a2cffe","yellow green":"#c0fb2d","bright purple":"#be03fd","dark red":"#840000","pale blue":"#d0fefe","grass green":"#3f9b0b",navy:"#01153e",aquamarine:"#04d8b2","burnt orange":"#c04e01","neon green":"#0cff0c","bright blue":"#0165fc",rose:"#cf6275","light pink":"#ffd1df",mustard:"#ceb301",indigo:"#380282",lime:"#aaff32","sea green":"#53fca1",periwinkle:"#8e82fe","dark pink":"#cb416b","olive green":"#677a04",peach:"#ffb07c","pale green":"#c7fdb5","light brown":"#ad8150","hot pink":"#ff028d",black:"#000000",lilac:"#cea2fd","navy blue":"#001146","royal blue":"#0504aa",beige:"#e6daa6",salmon:"#ff796c",olive:"#6e750e",maroon:"#650021","bright green":"#01ff07","dark purple":"#35063e",mauve:"#ae7181","forest green":"#06470c",aqua:"#13eac9",cyan:"#00ffff",tan:"#d1b26f","dark blue":"#00035b",lavender:"#c79fef",turquoise:"#06c2ac","dark green":"#033500",violet:"#9a0eea","light purple":"#bf77f6","lime green":"#89fe05",grey:"#929591","sky blue":"#75bbfd",yellow:"#ffff14",magenta:"#c20078","light green":"#96f97b",orange:"#f97306",teal:"#029386","light blue":"#95d0fc",red:"#e50000",brown:"#653700",pink:"#ff81c0",blue:"#0343df",green:"#15b01a",purple:"#7e1e9c"};function A(e){let a=e.trim().toLowerCase().replace(/\s+/g," ");if(a!=="")return q(a)??C(a)??z(a)}function q(e){let a=/^#?([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.exec(e);if(!a)return;let r=a[1],l=r.length<=4?[...r].map(f=>f+f).join(""):r,n=f=>Number.parseInt(l.slice(f,f+2),16),d={r:n(0),g:n(2),b:n(4)};return l.length===8?{rgb:d,alpha:n(6)/255}:{rgb:d}}function m(e){let a=/^([+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?)(%|deg|grad|rad|turn)?$/.exec(e);return a?{n:Number(a[1]),unit:a[2]??""}:void 0}var b=(e,a,r)=>e>=a&&e<=r?e:void 0;function M(e){return e.unit==="%"?b(e.n/100,0,1):e.unit===""?b(e.n,0,1):void 0}function o(e){return e.unit==="%"?b(e.n,0,100)===void 0?void 0:Math.round(e.n*2.55):e.unit===""&&b(e.n,0,255)!==void 0?Math.round(e.n):void 0}function k(e){let r={"":1,deg:1,grad:.9,rad:180/Math.PI,turn:360}[e.unit];return r===void 0?void 0:(e.n*r%360+360)%360}function w(e){return e.unit==="%"?b(e.n/100,0,1):void 0}function v(e){return e.unit==="%"?b(e.n/100,0,1):e.unit===""?b(e.n,0,1):void 0}function s(e){return e.unit==="%"?e.n/100*.4:e.unit===""?e.n:void 0}function x(e,a){let r,l;if(e.includes(",")){if(!a||e.includes("/")||(r=e.split(",").map(f=>f.trim()),r.some(f=>f===""||f.includes(" "))))return;r.length===4&&(l=r.pop())}else{let f=e.split("/").map(u=>u.trim());if(f.length>2||(r=f[0].split(" ").filter(u=>u!==""),f.length===2&&(l=f[1],l===""||l.includes(" "))))return}if(r.length!==3)return;let n=r.map(m);if(n.some(f=>f===void 0))return;if(l===void 0)return{parts:n};let d=m(l);return d?{parts:n,alpha:d}:void 0}function R(e,a,r){let l=n=>{let d=(n+e/30)%12;return r-a*Math.min(r,1-r)*Math.max(-1,Math.min(d-3,9-d,1))};return{r:Math.round(l(0)*255),g:Math.round(l(8)*255),b:Math.round(l(4)*255)}}function C(e){let a=/^([a-z]+) ?\((.*)\)$/.exec(e);if(!a)return;let r=a[1],l=a[2],n=x(l,r==="rgb"||r==="rgba"||r==="hsl"||r==="hsla");if(!n)return;let[d,f,u]=n.parts,c;if(n.alpha&&(c=M(n.alpha),c===void 0))return;let g=S(r,d,f,u);if(g)return c===void 0?{rgb:g}:{rgb:g,alpha:c}}function S(e,a,r,l){switch(e){case"rgb":case"rgba":{let n=o(a),d=o(r),f=o(l);return n===void 0||d===void 0||f===void 0?void 0:{r:n,g:d,b:f}}case"hsl":case"hsla":{let n=k(a),d=w(r),f=w(l);return n===void 0||d===void 0||f===void 0?void 0:R(n,d,f)}case"oklch":{let n=v(a),d=s(r),f=k(l);return n===void 0||d===void 0||d<0||f===void 0?void 0:t(p({L:n,C:d,h:f}))}case"oklab":{let n=v(a),d=s(r),f=s(l);return n===void 0||d===void 0||f===void 0?void 0:t({L:n,a:d,b:f})}default:return}}var N=e=>e.toLowerCase().replace(/[\s_-]+/g,""),i;function j(){if(i)return i;i=new Map;for(let e of[h,y])for(let[a,r]of Object.entries(e)){let l=N(a);i.has(l)||i.set(l,r)}return i}function z(e){let a=j().get(N(e)),r=a===void 0?void 0:q(a)?.rgb;return r&&{rgb:r}}export{A as a};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
|
+
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
+
import{a as yt}from"./chunk-BZXDNDPG.js";import{a as Ee,b as _e,e as Bt,j as ke,l as qt,m as Ie}from"./chunk-LW2QEXDT.js";import{a as vt,b as ut,d as Re,h as Ot,i as Mt}from"./chunk-GGBNT4WI.js";import{c as Ae,j as xe,r as Nt}from"./chunk-GNLE6JXL.js";import{A as me,B as ge,C as ye,D as be,H as Se,I as it,d as Q,da as mt,e as pe,f as ht,g as rt,h as Ht,s as fe,v as de,w as he}from"./chunk-MMRDELHW.js";import{a as gt,d as Gt}from"./chunk-H2IUSPAK.js";import{c as st,e as Yn}from"./chunk-TMUK2DD3.js";var At=st((Iu,An)=>{"use strict";var gn="[^\\\\/]",wo="(?=.)",yn="[^/]",Yt="(?:\\/|$)",bn="(?:^|\\/)",Zt=`\\.{1,2}${Yt}`,Co="(?!\\.)",$o=`(?!${bn}${Zt})`,To=`(?!\\.{0,1}${Yt})`,Po=`(?!${Zt})`,Lo="[^.\\/]",Fo=`${yn}*?`,Do="/",Sn={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:wo,QMARK:yn,END_ANCHOR:Yt,DOTS_SLASH:Zt,NO_DOT:Co,NO_DOTS:$o,NO_DOT_SLASH:To,NO_DOTS_SLASH:Po,QMARK_NO_DOT:Lo,STAR:Fo,START_ANCHOR:bn,SEP:Do},Ho={...Sn,SLASH_LITERAL:"[\\\\/]",QMARK:gn,STAR:`${gn}*?`,DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},No={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};An.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:No,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?Ho:Sn}}});var xt=st(W=>{"use strict";var{REGEX_BACKSLASH:Mo,REGEX_REMOVE_BACKSLASH:Bo,REGEX_SPECIAL_CHARS:qo,REGEX_SPECIAL_CHARS_GLOBAL:Go}=At();W.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);W.hasRegexChars=t=>qo.test(t);W.isRegexChar=t=>t.length===1&&W.hasRegexChars(t);W.escapeRegex=t=>t.replace(Go,"\\$1");W.toPosixSlashes=t=>t.replace(Mo,"/");W.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let t=navigator.platform.toLowerCase();return t==="win32"||t==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":!1};W.removeBackslashes=t=>t.replace(Bo,e=>e==="\\"?"":e);W.escapeLast=(t,e,n)=>{let r=t.lastIndexOf(e,n);return r===-1?t:t[r-1]==="\\"?W.escapeLast(t,e,r-1):`${t.slice(0,r)}\\${t.slice(r)}`};W.removePrefix=(t,e={})=>{let n=t;return n.startsWith("./")&&(n=n.slice(2),e.prefix="./"),n};W.wrapOutput=(t,e={},n={})=>{let r=n.contains?"":"^",o=n.contains?"":"$",s=`${r}(?:${t})${o}`;return e.negated===!0&&(s=`(?:^(?!${s}).*$)`),s};W.basename=(t,{windows:e}={})=>{let n=t.split(e?/[\\/]/:"/"),r=n[n.length-1];return r===""?n[n.length-2]:r}});var On=st((Ou,vn)=>{"use strict";var xn=xt(),{CHAR_ASTERISK:Vt,CHAR_AT:jo,CHAR_BACKWARD_SLASH:Rt,CHAR_COMMA:Wo,CHAR_DOT:te,CHAR_EXCLAMATION_MARK:ee,CHAR_FORWARD_SLASH:In,CHAR_LEFT_CURLY_BRACE:ne,CHAR_LEFT_PARENTHESES:re,CHAR_LEFT_SQUARE_BRACKET:zo,CHAR_PLUS:Uo,CHAR_QUESTION_MARK:Rn,CHAR_RIGHT_CURLY_BRACE:Jo,CHAR_RIGHT_PARENTHESES:En,CHAR_RIGHT_SQUARE_BRACKET:Xo}=At(),_n=t=>t===In||t===Rt,kn=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},Ko=(t,e)=>{let n=e||{},r=t.length-1,o=n.parts===!0||n.scanToEnd===!0,s=[],i=[],u=[],p=t,h=-1,g=0,y=0,f=!1,b=!1,S=!1,x=!1,R=!1,T=!1,A=!1,G=!1,K=!1,F=!1,C=0,O,E,I={value:"",depth:0,isGlob:!1},l=()=>h>=r,j=()=>p.charCodeAt(h+1),N=()=>(O=E,p.charCodeAt(++h));for(;h<r;){E=N();let v;if(E===Rt){A=I.backslashes=!0,E=N(),E===ne&&(T=!0);continue}if(T===!0||E===ne){for(C++;l()!==!0&&(E=N());){if(E===Rt){A=I.backslashes=!0,N();continue}if(E===ne){C++;continue}if(T!==!0&&E===te&&(E=N())===te){if(f=I.isBrace=!0,S=I.isGlob=!0,F=!0,o===!0)continue;break}if(T!==!0&&E===Wo){if(f=I.isBrace=!0,S=I.isGlob=!0,F=!0,o===!0)continue;break}if(E===Jo&&(C--,C===0)){T=!1,f=I.isBrace=!0,F=!0;break}}if(o===!0)continue;break}if(E===In){if(s.push(h),i.push(I),I={value:"",depth:0,isGlob:!1},F===!0)continue;if(O===te&&h===g+1){g+=2;continue}y=h+1;continue}if(n.noext!==!0&&(E===Uo||E===jo||E===Vt||E===Rn||E===ee)===!0&&j()===re){if(S=I.isGlob=!0,x=I.isExtglob=!0,F=!0,E===ee&&h===g&&(K=!0),o===!0){for(;l()!==!0&&(E=N());){if(E===Rt){A=I.backslashes=!0,E=N();continue}if(E===En){S=I.isGlob=!0,F=!0;break}}continue}break}if(E===Vt){if(O===Vt&&(R=I.isGlobstar=!0),S=I.isGlob=!0,F=!0,o===!0)continue;break}if(E===Rn){if(S=I.isGlob=!0,F=!0,o===!0)continue;break}if(E===zo){for(;l()!==!0&&(v=N());){if(v===Rt){A=I.backslashes=!0,N();continue}if(v===Xo){b=I.isBracket=!0,S=I.isGlob=!0,F=!0;break}}if(o===!0)continue;break}if(n.nonegate!==!0&&E===ee&&h===g){G=I.negated=!0,g++;continue}if(n.noparen!==!0&&E===re){if(S=I.isGlob=!0,o===!0){for(;l()!==!0&&(E=N());){if(E===re){A=I.backslashes=!0,E=N();continue}if(E===En){F=!0;break}}continue}break}if(S===!0){if(F=!0,o===!0)continue;break}}n.noext===!0&&(x=!1,S=!1);let D=p,c="",a="";g>0&&(c=p.slice(0,g),p=p.slice(g),y-=g),D&&S===!0&&y>0?(D=p.slice(0,y),a=p.slice(y)):S===!0?(D="",a=p):D=p,D&&D!==""&&D!=="/"&&D!==p&&_n(D.charCodeAt(D.length-1))&&(D=D.slice(0,-1)),n.unescape===!0&&(a&&(a=xn.removeBackslashes(a)),D&&A===!0&&(D=xn.removeBackslashes(D)));let U={prefix:c,input:t,start:g,base:D,glob:a,isBrace:f,isBracket:b,isGlob:S,isExtglob:x,isGlobstar:R,negated:G,negatedExtglob:K};if(n.tokens===!0&&(U.maxDepth=0,_n(E)||i.push(I),U.tokens=i),n.parts===!0||n.tokens===!0){let v;for(let L=0;L<s.length;L++){let V=v?v+1:g,J=s[L],tt=t.slice(V,J);n.tokens&&(L===0&&g!==0?(i[L].isPrefix=!0,i[L].value=c):i[L].value=tt,kn(i[L]),U.maxDepth+=i[L].depth),(L!==0||tt!=="")&&u.push(tt),v=J}if(v&&v+1<t.length){let L=t.slice(v+1);u.push(L),n.tokens&&(i[i.length-1].value=L,kn(i[i.length-1]),U.maxDepth+=i[i.length-1].depth)}U.slashes=s,U.parts=u}return U};vn.exports=Ko});var Tn=st((wu,$n)=>{"use strict";var Et=At(),z=xt(),{MAX_LENGTH:Dt,POSIX_REGEX_SOURCE:Qo,REGEX_NON_SPECIAL_CHARS:Yo,REGEX_SPECIAL_CHARS_BACKREF:Zo,REPLACEMENTS:wn}=Et,Vo=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let n=`[${t.join("-")}]`;try{new RegExp(n)}catch{return t.map(o=>z.escapeRegex(o)).join("..")}return n},ft=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,Cn=t=>{let e=[],n=0,r=0,o=0,s="",i=!1;for(let u of t){if(i===!0){s+=u,i=!1;continue}if(u==="\\"){s+=u,i=!0;continue}if(u==='"'){o=o===1?0:1,s+=u;continue}if(o===0){if(u==="[")n++;else if(u==="]"&&n>0)n--;else if(n===0){if(u==="(")r++;else if(u===")"&&r>0)r--;else if(u==="|"&&r===0){e.push(s),s="";continue}}}s+=u}return e.push(s),e},ts=t=>{let e=!1;for(let n of t){if(e===!0){e=!1;continue}if(n==="\\"){e=!0;continue}if(/[?*+@!()[\]{}]/.test(n))return!1}return!0},se=t=>{let e=t.trim(),n=!0;for(;n===!0;)n=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),n=!0);if(ts(e))return e.replace(/\\(.)/g,"$1")},es=t=>{let e=t.map(se).filter(Boolean);for(let n=0;n<e.length;n++)for(let r=n+1;r<e.length;r++){let o=e[n],s=e[r],i=o[0];if(!(!i||o!==i.repeat(o.length)||s!==i.repeat(s.length))&&(o===s||o.startsWith(s)||s.startsWith(o)))return!0}return!1},oe=(t,e=!0)=>{if(t[0]!=="+"&&t[0]!=="*"||t[1]!=="(")return;let n=0,r=0,o=0,s=!1;for(let i=1;i<t.length;i++){let u=t[i];if(s===!0){s=!1;continue}if(u==="\\"){s=!0;continue}if(u==='"'){o=o===1?0:1;continue}if(o!==1){if(u==="["){n++;continue}if(u==="]"&&n>0){n--;continue}if(!(n>0)){if(u==="("){r++;continue}if(u===")"&&(r--,r===0))return e===!0&&i!==t.length-1?void 0:{type:t[0],body:t.slice(2,i),end:i}}}}},ns=t=>`${t.length===1?z.escapeRegex(t[0]):`[${t.map(n=>z.escapeRegex(n)).join("")}]`}*`,rs=t=>{let e=0,n=[];for(;e<t.length;){let r=oe(t.slice(e),!1);if(!r||r.type!=="*")return;let o=Cn(r.body).map(i=>i.trim());if(o.length!==1)return;let s=se(o[0]);if(!s||s.length!==1)return;n.push(s),e+=r.end+1}if(!(n.length<1))return n},os=t=>{let e=0,n=t.trim(),r=oe(n);for(;r;)e++,n=r.body.trim(),r=oe(n);return e},ss=(t,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let n=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:Et.DEFAULT_MAX_EXTGLOB_RECURSION,r=Cn(t).map(u=>u.trim());if(r.length>1&&(r.some(u=>u==="")||r.some(u=>/^[*?]+$/.test(u))||es(r)))return{risky:!0};let o=[],s=!1,i=!0;for(let u of r){let p=rs(u);if(p){s=!0,o.push(...p);continue}let h=se(u);if(h&&h.length===1){o.push(h);continue}if(i=!1,os(u)>n)return{risky:!0}}return s?i?{risky:!0,safeOutput:ns([...new Set(o)])}:{risky:!0}:{risky:!1}},ie=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=wn[t]||t;let n={...e},r=typeof n.maxLength=="number"?Math.min(Dt,n.maxLength):Dt,o=t.length;if(o>r)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${r}`);let s={type:"bos",value:"",output:n.prepend||""},i=[s],u=n.capture?"":"?:",p=Et.globChars(n.windows),h=Et.extglobChars(p),{DOT_LITERAL:g,PLUS_LITERAL:y,SLASH_LITERAL:f,ONE_CHAR:b,DOTS_SLASH:S,NO_DOT:x,NO_DOT_SLASH:R,NO_DOTS_SLASH:T,QMARK:A,QMARK_NO_DOT:G,STAR:K,START_ANCHOR:F}=p,C=m=>`(${u}(?:(?!${F}${m.dot?S:g}).)*?)`,O=n.dot?"":x,E=n.dot?A:G,I=n.bash===!0?C(n):K;n.capture&&(I=`(${I})`),typeof n.noext=="boolean"&&(n.noextglob=n.noext);let l={input:t,index:-1,start:0,dot:n.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:i};t=z.removePrefix(t,l),o=t.length;let j=[],N=[],D=[],c=s,a,U=()=>l.index===o-1,v=l.peek=(m=1)=>t[l.index+m],L=l.advance=()=>t[++l.index]||"",V=()=>t.slice(l.index+1),J=(m="",P=0)=>{l.consumed+=m,l.index+=P},tt=m=>{l.output+=m.output!=null?m.output:m.value,J(m.value)},Kn=()=>{let m=1;for(;v()==="!"&&(v(2)!=="("||v(3)==="?");)L(),l.start++,m++;return m%2===0?!1:(l.negated=!0,l.start++,!0)},kt=m=>{l[m]++,D.push(m)},et=m=>{l[m]--,D.pop()},_=m=>{if(c.type==="globstar"){let P=l.braces>0&&(m.type==="comma"||m.type==="brace"),d=m.extglob===!0||j.length&&(m.type==="pipe"||m.type==="paren");m.type!=="slash"&&m.type!=="paren"&&!P&&!d&&(l.output=l.output.slice(0,-c.output.length),c.type="star",c.value="*",c.output=I,l.output+=c.output)}if(j.length&&m.type!=="paren"&&(j[j.length-1].inner+=m.value),(m.value||m.output)&&tt(m),c&&c.type==="text"&&m.type==="text"){c.output=(c.output||c.value)+m.value,c.value+=m.value;return}m.prev=c,i.push(m),c=m},It=(m,P)=>{let d={...h[P],conditions:1,inner:""};d.prev=c,d.parens=l.parens,d.output=l.output,d.startIndex=l.index,d.tokensIndex=i.length;let k=(n.capture?"(":"")+d.open;kt("parens"),_({type:m,value:P,output:l.output?"":b}),_({type:"paren",extglob:!0,value:L(),output:k}),j.push(d)},Qn=m=>{let P=t.slice(m.startIndex,l.index+1),d=t.slice(m.startIndex+2,l.index),k=ss(d,n);if((m.type==="plus"||m.type==="star")&&k.risky){let w=k.safeOutput?(m.output?"":b)+(n.capture?`(${k.safeOutput})`:k.safeOutput):void 0,Y=i[m.tokensIndex];Y.type="text",Y.value=P,Y.output=w||z.escapeRegex(P);for(let Z=m.tokensIndex+1;Z<i.length;Z++)i[Z].value="",i[Z].output="",delete i[Z].suffix;l.output=m.output+Y.output,l.backtrack=!0,_({type:"paren",extglob:!0,value:a,output:""}),et("parens");return}let $=m.close+(n.capture?")":""),M;if(m.type==="negate"){let w=I;if(m.inner&&m.inner.length>1&&m.inner.includes("/")&&(w=C(n)),(w!==I||U()||/^\)+$/.test(V()))&&($=m.close=`)$))${w}`),m.inner.includes("*")&&(M=V())&&/^\.[^\\/.]+$/.test(M)){let Y=ie(M,{...e,fastpaths:!1}).output;$=m.close=`)${Y})${w})`}m.prev.type==="bos"&&(l.negatedExtglob=!0)}_({type:"paren",extglob:!0,value:a,output:$}),et("parens")};if(n.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let m=!1,P=t.replace(Zo,(d,k,$,M,w,Y)=>M==="\\"?(m=!0,d):M==="?"?k?k+M+(w?A.repeat(w.length):""):Y===0?E+(w?A.repeat(w.length):""):A.repeat($.length):M==="."?g.repeat($.length):M==="*"?k?k+M+(w?I:""):I:k?d:`\\${d}`);return m===!0&&(n.unescape===!0?P=P.replace(/\\/g,""):P=P.replace(/\\+/g,d=>d.length%2===0?"\\\\":d?"\\":"")),P===t&&n.contains===!0?(l.output=t,l):(l.output=z.wrapOutput(P,l,e),l)}for(;!U();){if(a=L(),a==="\0")continue;if(a==="\\"){let d=v();if(d==="/"&&n.bash!==!0||d==="."||d===";")continue;if(!d){a+="\\",_({type:"text",value:a});continue}let k=/^\\+/.exec(V()),$=0;if(k&&k[0].length>2&&($=k[0].length,l.index+=$,$%2!==0&&(a+="\\")),n.unescape===!0?a=L():a+=L(),l.brackets===0){_({type:"text",value:a});continue}}if(l.brackets>0&&(a!=="]"||c.value==="["||c.value==="[^")){if(n.posix!==!1&&a===":"){let d=c.value.slice(1);if(d.includes("[")&&(c.posix=!0,d.includes(":"))){let k=c.value.lastIndexOf("["),$=c.value.slice(0,k),M=c.value.slice(k+2),w=Qo[M];if(w){c.value=$+w,l.backtrack=!0,L(),!s.output&&i.indexOf(c)===1&&(s.output=b);continue}}}(a==="["&&v()!==":"||a==="-"&&v()==="]")&&(a=`\\${a}`),a==="]"&&(c.value==="["||c.value==="[^")&&(a=`\\${a}`),n.posix===!0&&a==="!"&&c.value==="["&&(a="^"),c.value+=a,tt({value:a});continue}if(l.quotes===1&&a!=='"'){a=z.escapeRegex(a),c.value+=a,tt({value:a});continue}if(a==='"'){l.quotes=l.quotes===1?0:1,n.keepQuotes===!0&&_({type:"text",value:a});continue}if(a==="("){kt("parens"),_({type:"paren",value:a});continue}if(a===")"){if(l.parens===0&&n.strictBrackets===!0)throw new SyntaxError(ft("opening","("));let d=j[j.length-1];if(d&&l.parens===d.parens+1){Qn(j.pop());continue}_({type:"paren",value:a,output:l.parens?")":"\\)"}),et("parens");continue}if(a==="["){if(n.nobracket===!0||!V().includes("]")){if(n.nobracket!==!0&&n.strictBrackets===!0)throw new SyntaxError(ft("closing","]"));a=`\\${a}`}else kt("brackets");_({type:"bracket",value:a});continue}if(a==="]"){if(n.nobracket===!0||c&&c.type==="bracket"&&c.value.length===1){_({type:"text",value:a,output:`\\${a}`});continue}if(l.brackets===0){if(n.strictBrackets===!0)throw new SyntaxError(ft("opening","["));_({type:"text",value:a,output:`\\${a}`});continue}et("brackets");let d=c.value.slice(1);if(c.posix!==!0&&d[0]==="^"&&!d.includes("/")&&(a=`/${a}`),c.value+=a,tt({value:a}),n.literalBrackets===!1||z.hasRegexChars(d))continue;let k=z.escapeRegex(c.value);if(l.output=l.output.slice(0,-c.value.length),n.literalBrackets===!0){l.output+=k,c.value=k;continue}c.value=`(${u}${k}|${c.value})`,l.output+=c.value;continue}if(a==="{"&&n.nobrace!==!0){kt("braces");let d={type:"brace",value:a,output:"(",outputIndex:l.output.length,tokensIndex:l.tokens.length};N.push(d),_(d);continue}if(a==="}"){let d=N[N.length-1];if(n.nobrace===!0||!d){_({type:"text",value:a,output:a});continue}let k=")";if(d.dots===!0){let $=i.slice(),M=[];for(let w=$.length-1;w>=0&&(i.pop(),$[w].type!=="brace");w--)$[w].type!=="dots"&&M.unshift($[w].value);k=Vo(M,n),l.backtrack=!0}if(d.comma!==!0&&d.dots!==!0){let $=l.output.slice(0,d.outputIndex),M=l.tokens.slice(d.tokensIndex);d.value=d.output="\\{",a=k="\\}",l.output=$;for(let w of M)l.output+=w.output||w.value}_({type:"brace",value:a,output:k}),et("braces"),N.pop();continue}if(a==="|"){j.length>0&&j[j.length-1].conditions++,_({type:"text",value:a});continue}if(a===","){let d=a,k=N[N.length-1];k&&D[D.length-1]==="braces"&&(k.comma=!0,d="|"),_({type:"comma",value:a,output:d});continue}if(a==="/"){if(c.type==="dot"&&l.index===l.start+1){l.start=l.index+1,l.consumed="",l.output="",i.pop(),c=s;continue}_({type:"slash",value:a,output:f});continue}if(a==="."){if(l.braces>0&&c.type==="dot"){c.value==="."&&(c.output=g);let d=N[N.length-1];c.type="dots",c.output+=a,c.value+=a,d.dots=!0;continue}if(l.braces+l.parens===0&&c.type!=="bos"&&c.type!=="slash"){_({type:"text",value:a,output:g});continue}_({type:"dot",value:a,output:g});continue}if(a==="?"){if(!(c&&c.value==="(")&&n.noextglob!==!0&&v()==="("&&v(2)!=="?"){It("qmark",a);continue}if(c&&c.type==="paren"){let k=v(),$=a;(c.value==="("&&!/[!=<:]/.test(k)||k==="<"&&!/<([!=]|\w+>)/.test(V()))&&($=`\\${a}`),_({type:"text",value:a,output:$});continue}if(n.dot!==!0&&(c.type==="slash"||c.type==="bos")){_({type:"qmark",value:a,output:G});continue}_({type:"qmark",value:a,output:A});continue}if(a==="!"){if(n.noextglob!==!0&&v()==="("&&(v(2)!=="?"||!/[!=<:]/.test(v(3)))){It("negate",a);continue}if(n.nonegate!==!0&&l.index===0){Kn();continue}}if(a==="+"){if(n.noextglob!==!0&&v()==="("&&v(2)!=="?"){It("plus",a);continue}if(c&&c.value==="("||n.regex===!1){_({type:"plus",value:a,output:y});continue}if(c&&(c.type==="bracket"||c.type==="paren"||c.type==="brace")||l.parens>0){_({type:"plus",value:a});continue}_({type:"plus",value:y});continue}if(a==="@"){if(n.noextglob!==!0&&v()==="("&&v(2)!=="?"){_({type:"at",extglob:!0,value:a,output:""});continue}_({type:"text",value:a});continue}if(a!=="*"){(a==="$"||a==="^")&&(a=`\\${a}`);let d=Yo.exec(V());d&&(a+=d[0],l.index+=d[0].length),_({type:"text",value:a});continue}if(c&&(c.type==="globstar"||c.star===!0)){c.type="star",c.star=!0,c.value+=a,c.output=I,l.backtrack=!0,l.globstar=!0,J(a);continue}let m=V();if(n.noextglob!==!0&&/^\([^?]/.test(m)){It("star",a);continue}if(c.type==="star"){if(n.noglobstar===!0){J(a);continue}let d=c.prev,k=d.prev,$=d.type==="slash"||d.type==="bos",M=k&&(k.type==="star"||k.type==="globstar");if(n.bash===!0&&(!$||m[0]&&m[0]!=="/")){_({type:"star",value:a,output:""});continue}let w=l.braces>0&&(d.type==="comma"||d.type==="brace"),Y=j.length&&(d.type==="pipe"||d.type==="paren");if(!$&&d.type!=="paren"&&!w&&!Y){_({type:"star",value:a,output:""});continue}for(;m.slice(0,3)==="/**";){let Z=t[l.index+4];if(Z&&Z!=="/")break;m=m.slice(3),J("/**",3)}if(d.type==="bos"&&U()){c.type="globstar",c.value+=a,c.output=C(n),l.output=c.output,l.globstar=!0,J(a);continue}if(d.type==="slash"&&d.prev.type!=="bos"&&!M&&U()){l.output=l.output.slice(0,-(d.output+c.output).length),d.output=`(?:${d.output}`,c.type="globstar",c.output=C(n)+(n.strictSlashes?")":"|$)"),c.value+=a,l.globstar=!0,l.output+=d.output+c.output,J(a);continue}if(d.type==="slash"&&d.prev.type!=="bos"&&m[0]==="/"){let Z=m[1]!==void 0?"|$":"";l.output=l.output.slice(0,-(d.output+c.output).length),d.output=`(?:${d.output}`,c.type="globstar",c.output=`${C(n)}${f}|${f}${Z})`,c.value+=a,l.output+=d.output+c.output,l.globstar=!0,J(a+L()),_({type:"slash",value:"/",output:""});continue}if(d.type==="bos"&&m[0]==="/"){c.type="globstar",c.value+=a,c.output=`(?:^|${f}|${C(n)}${f})`,l.output=c.output,l.globstar=!0,J(a+L()),_({type:"slash",value:"/",output:""});continue}l.output=l.output.slice(0,-c.output.length),c.type="globstar",c.output=C(n),c.value+=a,l.output+=c.output,l.globstar=!0,J(a);continue}let P={type:"star",value:a,output:I};if(n.bash===!0){P.output=".*?",(c.type==="bos"||c.type==="slash")&&(P.output=O+P.output),_(P);continue}if(c&&(c.type==="bracket"||c.type==="paren")&&n.regex===!0){P.output=a,_(P);continue}(l.index===l.start||c.type==="slash"||c.type==="dot")&&(c.type==="dot"?(l.output+=R,c.output+=R):n.dot===!0?(l.output+=T,c.output+=T):(l.output+=O,c.output+=O),v()!=="*"&&(l.output+=b,c.output+=b)),_(P)}for(;l.brackets>0;){if(n.strictBrackets===!0)throw new SyntaxError(ft("closing","]"));l.output=z.escapeLast(l.output,"["),et("brackets")}for(;l.parens>0;){if(n.strictBrackets===!0)throw new SyntaxError(ft("closing",")"));l.output=z.escapeLast(l.output,"("),et("parens")}for(;l.braces>0;){if(n.strictBrackets===!0)throw new SyntaxError(ft("closing","}"));l.output=z.escapeLast(l.output,"{"),et("braces")}if(n.strictSlashes!==!0&&(c.type==="star"||c.type==="bracket")&&_({type:"maybe_slash",value:"",output:`${f}?`}),l.backtrack===!0){l.output="";for(let m of l.tokens)l.output+=m.output!=null?m.output:m.value,m.suffix&&(l.output+=m.suffix)}return l};ie.fastpaths=(t,e)=>{let n={...e},r=typeof n.maxLength=="number"?Math.min(Dt,n.maxLength):Dt,o=t.length;if(o>r)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${r}`);t=wn[t]||t;let{DOT_LITERAL:s,SLASH_LITERAL:i,ONE_CHAR:u,DOTS_SLASH:p,NO_DOT:h,NO_DOTS:g,NO_DOTS_SLASH:y,STAR:f,START_ANCHOR:b}=Et.globChars(n.windows),S=n.dot?g:h,x=n.dot?y:h,R=n.capture?"":"?:",T={negated:!1,prefix:""},A=n.bash===!0?".*?":f;n.capture&&(A=`(${A})`);let G=O=>O.noglobstar===!0?A:`(${R}(?:(?!${b}${O.dot?p:s}).)*?)`,K=O=>{switch(O){case"*":return`${S}${u}${A}`;case".*":return`${s}${u}${A}`;case"*.*":return`${S}${A}${s}${u}${A}`;case"*/*":return`${S}${A}${i}${u}${x}${A}`;case"**":return S+G(n);case"**/*":return`(?:${S}${G(n)}${i})?${x}${u}${A}`;case"**/*.*":return`(?:${S}${G(n)}${i})?${x}${A}${s}${u}${A}`;case"**/.*":return`(?:${S}${G(n)}${i})?${s}${u}${A}`;default:{let E=/^(.*?)\.(\w+)$/.exec(O);if(!E)return;let I=K(E[1]);return I?I+s+E[2]:void 0}}},F=z.removePrefix(t,T),C=K(F);return C&&n.strictSlashes!==!0&&(C+=`${i}?`),C};$n.exports=ie});var Fn=st((Cu,Ln)=>{"use strict";var is=On(),ue=Tn(),Pn=xt(),us=At(),as=t=>t&&typeof t=="object"&&!Array.isArray(t),H=(t,e,n=!1)=>{if(Array.isArray(t)){let g=t.map(f=>H(f,e,n));return f=>{for(let b of g){let S=b(f);if(S)return S}return!1}}let r=as(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!r)throw new TypeError("Expected pattern to be a non-empty string");let o=e||{},s=o.windows,i=r?H.compileRe(t,e):H.makeRe(t,e,!1,!0),u=i.state;delete i.state;let p=()=>!1;if(o.ignore){let g={...e,ignore:null,onMatch:null,onResult:null};p=H(o.ignore,g,n)}let h=(g,y=!1)=>{let{isMatch:f,match:b,output:S}=H.test(g,i,e,{glob:t,posix:s}),x={glob:t,state:u,regex:i,posix:s,input:g,output:S,match:b,isMatch:f};return typeof o.onResult=="function"&&o.onResult(x),f===!1?(x.isMatch=!1,y?x:!1):p(g)?(typeof o.onIgnore=="function"&&o.onIgnore(x),x.isMatch=!1,y?x:!1):(typeof o.onMatch=="function"&&o.onMatch(x),y?x:!0)};return n&&(h.state=u),h};H.test=(t,e,n,{glob:r,posix:o}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let s=n||{},i=s.format||(o?Pn.toPosixSlashes:null),u=t===r,p=u&&i?i(t):t;return u===!1&&(p=i?i(t):t,u=p===r),(u===!1||s.capture===!0)&&(s.matchBase===!0||s.basename===!0?u=H.matchBase(t,e,n,o):u=e.exec(p)),{isMatch:!!u,match:u,output:p}};H.matchBase=(t,e,n,r=n&&n.windows)=>(e instanceof RegExp?e:H.makeRe(e,n)).test(Pn.basename(t,{windows:r}));H.isMatch=(t,e,n)=>H(e,n)(t);H.parse=(t,e)=>Array.isArray(t)?t.map(n=>H.parse(n,e)):ue(t,{...e,fastpaths:!1});H.scan=(t,e)=>is(t,e);H.compileRe=(t,e,n=!1,r=!1)=>{if(n===!0)return t.output;let o=e||{},s=o.contains?"":"^",i=o.contains?"":"$",u=`${s}(?:${t.output})${i}`;t&&t.negated===!0&&(u=`^(?!${u}).*$`);let p=H.toRegex(u,e);return r===!0&&(p.state=t),p};H.makeRe=(t,e={},n=!1,r=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let o={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(o.output=ue.fastpaths(t,e)),o.output||(o=ue(t,e)),H.compileRe(o,e,n,r)};H.toRegex=(t,e)=>{try{let n=e||{};return new RegExp(t,n.flags||(n.nocase?"i":""))}catch(n){if(e&&e.debug===!0)throw n;return/$^/}};H.constants=us;Ln.exports=H});var Mn=st(($u,Nn)=>{"use strict";var Dn=Fn(),cs=xt();function Hn(t,e,n=!1){return e&&(e.windows===null||e.windows===void 0)&&(e={...e,windows:cs.isWindows()}),Dn(t,e,n)}Object.assign(Hn,Dn);Nn.exports=Hn});import{dirname as tr}from"node:path";import{dirname as Zn,join as ve}from"node:path";var Oe="Same location",we="New subfolder";function Vn(t,e){return t===e?Oe:t===gt("Desktop")?"Desktop":t===gt("Downloads")?"Downloads":t===ve(e,"converted")?we:yt(t)||t}function wt(t,e,{subfolder:n=!1}={}){let r=Zn(t.path),o=Gt(e.defaultOutput),s=e.lastOutput?Gt(e.lastOutput):void 0,i=g=>({label:Vn(g,r),path:g}),u=[i(o),...s?[i(s)]:[],i(gt("Desktop")),{label:Oe,path:r},i(gt("Downloads")),...n?[{label:we,path:ve(r,"converted")}]:[]],p=new Set,h=u.filter(g=>p.has(g.path)?!1:(p.add(g.path),!0));return{kind:"path",id:"destination",label:"Save to",default:o,presets:h,...s&&s!==o?{last:s}:{}}}var q=t=>typeof t=="string"&&t!==""?t:void 0;var er=t=>t.length===1&&t[0]?.kind==="image"?t[0]:void 0,nr=t=>t.length===1&&t[0]?.kind==="document"?t[0]:void 0,rr="-small",Ce={id:"compress",label:"Compress",verb:"Compressing",hint:"make it smaller",appliesTo:t=>{let e=er(t);return e!==void 0?Q[e.format].lossy:(nr(t)?.images?.compressible??0)>0},options(t,e,n){let r=t[0];if(!r)return[];let o=[{kind:"select",id:"mode",label:`Compress ${yt(r.path)??"this file"}`,choices:[{value:"quality",label:"By quality",hint:"pick a level, see the result"},{value:"size",label:"To a target size",hint:"smallest quality that fits"}],default:"quality"}];if(e.mode==="quality")o.push({kind:"slider",id:"quality",label:"Quality",min:1,max:100,step:5,default:n.quality});else if(e.mode==="size")o.push({kind:"text",id:"size",label:"Target size",placeholder:"e.g. 500kb or 2mb"});else return o;return o.push(wt(r,n)),o},plan(t,e){let n=e.mode;if(n!=="quality"&&n!=="size")throw it(`compressAction.plan() needs a mode of "quality" or "size", got ${JSON.stringify(n)}.`,"This is a caller bug, not a user-facing condition: walk options() before calling plan().");let r=t[0];if(!r)return[];let o=(yt(r.path)??"file").replace(/\.[^.]+$/,""),i=`${typeof e.destination=="string"?e.destination:tr(r.path)}/${o}${rr}${ht(r.format)}`;return[{op:"convert",sources:[r],target:r.format,outputs:[i],options:{background:"#ffffff",keepMetadata:!1,...n==="quality"&&typeof e.quality=="number"?{quality:e.quality}:{}}}]}};import{existsSync as jt,statSync as or}from"node:fs";import{basename as at,dirname as sr,extname as ct,isAbsolute as ir,join as X,relative as ur,resolve as B,sep as ar}from"node:path";function $e(t){return t.endsWith("/")||t.endsWith(ar)||jt(t)&&or(t).isDirectory()?!0:ct(t)===""}function cr(t,e){let n=at(t),r=ct(n);return(r?n.slice(0,-r.length):n)+ht(e)}function Te(t,e,n){if(!n)return t;let r=ur(B(n),e);return!r||r.startsWith("..")?t:X(t,r)}function Wt(t){let e=B(t.sourcePath),n=cr(e,t.target);if(!t.output)return X(B(e,".."),n);let r=ir(t.output)?t.output:B(t.output);return $e(t.output)?X(Te(r,B(e,".."),t.sourceRoot),n):B(r)}function bt(t){let e=Wt(t);if(t.output&&!$e(t.output))return e;let n=ct(e);return X(B(e,".."),`${at(e,n)}-${t.suffix}${n}`)}function oi(t){if(!jt(t))return t;let e=B(t,".."),n=at(t),r=ct(n),o=r?n.slice(0,-r.length):n;for(let s=1;s<1e4;s++){let i=X(e,`${o} (${s})${r}`);if(!jt(i))return i}throw new Error(`no free name beside ${n}`)}function Ct(t){let e=B(t,".."),n=at(t),r=ct(n);return{dir:e,stem:r?n.slice(0,-r.length):n,ext:r||".pdf"}}function lt(t,e){let{dir:n,stem:r,ext:o}=Ct(B(t));return X(n,`${r}-${e}${o}`)}function Pe(t,e){let{dir:n,stem:r,ext:o}=Ct(B(t)),s=String(e).length;return Array.from({length:e},(i,u)=>X(n,`${r}-${String(u+1).padStart(s,"0")}${o}`))}function Le(t,e,n,r,o){let{stem:s}=Ct(B(t)),i=r?Te(B(r),B(t,".."),o):B(t,".."),u=ht(n),p=String(Math.max(1,...e.map(f=>f+1))).length,h=e.map(f=>X(i,`${s}-${String(f+1).padStart(p,"0")}${u}`)),[g,...y]=h;if(g===void 0)throw new Error("rasterOutputPaths requires at least one selected page");return[g,...y]}function Fe(t,e,n){if(!n)return[lt(t,"extract")];let{dir:r,stem:o,ext:s}=Ct(B(t));return e.map(i=>X(r,`${o}-p${i+1}${s}`))}function De(t){let e=B(t[0]??"merged.pdf");if(new Set(t.map(r=>B(r,".."))).size===1){let r=B(e,"..");return X(r,`${at(r)}-merged.pdf`)}return lt(e,"merged")}function St(t,e,n){let r=e?t.map(s=>X(e,at(s))):t,[o]=r;return!n||r.length!==1||o===void 0?r:[X(sr(o),`${n}${ct(o)}`)]}function nt(t,e,n){return St([t],e,n)[0]??t}function lr(t){return{kind:"select",id:"pages",label:"Pages",default:"all",choices:[{value:"all",label:"All pages",hint:`${t.pages} pages`},{value:"first",label:"First page only"},{value:"choose",label:"Choose pages",hint:"pick which ones"}]}}function pr(){return{kind:"select",id:"dpi",label:"Resolution",default:"150",choices:[{value:"72",label:"72 dpi",hint:"screen"},{value:"150",label:"150 dpi",badge:"default"},{value:"300",label:"300 dpi",hint:"print"}]}}function fr(t,e){return Array.isArray(e)?ut(e):e==="first"?[0]:typeof e=="string"&&e!=="all"&&e!==""?ut(vt(e,t.pages)):Array.from({length:t.pages},(n,r)=>r)}function dr(t,e){let n=Q[t.format].lossy,r=Q[e].lossy;if(n&&!r)return{hint:"likely bigger",tone:"warn"};if(!n&&r)return{hint:"likely smaller",tone:"ok"}}function hr(t){let e=_e(t).filter(r=>r.id!==t.format),n=e[0];return{kind:"select",id:"target",label:`Convert ${Q[t.format].label} to`,choices:e.map(r=>{let o=dr(t,r.id);return{value:r.id,label:r.label,hint:o?.hint??r.hint,...o===void 0?{}:{tone:o.tone}}}),default:n?n.id:""}}function mr(t){let e=t.target,n=typeof e=="string"?pe(e):void 0;if(!n)throw it(`convertAction.plan() requires a valid target format, got ${JSON.stringify(e)}.`,"This is a caller bug, not a user-facing condition: call options() and pass one of the target select choices before calling plan().");return n}var He={id:"convert",label:"Convert",verb:"Converting",hint:"to another format",appliesTo:t=>t.length>=1,options(t,e,n){let r=t[0];if(!r)return[];let o=[hr(r)],s=e.target;return typeof s!="string"||(r.kind==="document"&&Bt(s)&&o.push(lr(r),pr()),Q[s]?.lossy&&o.push({kind:"slider",id:"quality",label:"Quality",min:1,max:100,step:5,default:n.quality}),o.push(wt(r,n,{subfolder:!0}))),o},plan(t,e){let n=t[0];if(!n)return[];let r=mr(e),o=r.id,s={background:typeof e.background=="string"?e.background:"#ffffff",keepMetadata:e.keepMetadata===!0};r.lossy&&typeof e.quality=="number"&&(s.quality=e.quality);let i=typeof e.destination=="string"?e.destination:void 0;if(n.kind==="document"&&Bt(o)){let p=Number(e.dpi);s.dpi=Number.isFinite(p)&&p>0?p:150;let h=fr(n,e.pages);s.pages=h;let g=typeof e.sourceRoot=="string"?e.sourceRoot:void 0,y=Le(n.path,h,o,i,g);return[{op:"convert",sources:[n],outputs:y,target:o,options:s}]}let u=Wt({sourcePath:n.path,target:o,...i===void 0?{}:{output:`${i}/`}});return[{op:"convert",sources:[n],outputs:[u],target:o,options:s}]}};var $t=t=>t.length>0&&t.every(e=>e.kind==="image")?t:void 0;function Si(t,e){let n=Ee(t);return n.includes(e)?void 0:he(t,e,n)}function Ne(t){return{target:t.target??"png",background:typeof t.background=="string"?t.background:"#ffffff",keepMetadata:t.keepMetadata===!0,...typeof t.output=="string"?{output:t.output}:{},...t.roots instanceof Map?{roots:t.roots}:{},...typeof t.quality=="number"?{quality:t.quality}:{}}}var Me=()=>({kind:"select",id:"target",label:"Save as",default:"png",choices:[{value:"png",label:"PNG",hint:Q.png.hint}]}),gr=t=>t===1?"sharp":`${t}x`,yr=t=>t===1||t===3||t===4?t:2,Be={id:"boost",label:"Boost resolution",verb:"Boosting",hint:"sharper, at its size or at 2\xD7, 3\xD7 or 4\xD7",requires:"boost",appliesTo:t=>$t(t)!==void 0,unavailable:()=>"images only",options:()=>[{kind:"select",id:"scale",label:"Scale",default:"2",choices:[{value:"1",label:"Sharpen",hint:"the same size, sharper"},{value:"2",label:"2\xD7",hint:"twice the width and height"},{value:"3",label:"3\xD7",hint:"three times the width and height"},{value:"4",label:"4\xD7",hint:"four times the width and height"}]},Me()],plan(t,e){let n=$t(t);if(!n)return[];let r=Ne(e),o=yr(Number(e.scale??2));return n.map(s=>({op:"boost",sources:[s],outputs:[bt({sourcePath:s.path,target:r.target,suffix:gr(o),...r.output===void 0?{}:{output:r.output},...r.roots?.get(s.path)===void 0?{}:{sourceRoot:r.roots.get(s.path)}})],scale:o,target:r.target,options:{background:r.background,keepMetadata:r.keepMetadata,...r.quality===void 0?{}:{quality:r.quality}}}))}},qe={id:"remove-background",label:"Remove background",verb:"Removing",hint:"cut out the subject",requires:"remove-background",appliesTo:t=>$t(t)!==void 0,unavailable:()=>"images only",options:()=>[Me()],plan(t,e){let n=$t(t);if(!n)return[];let r=Ne(e);return n.map(o=>({op:"remove-background",sources:[o],outputs:[bt({sourcePath:o.path,target:r.target,suffix:"cutout",...r.output===void 0?{}:{output:r.output},...r.roots?.get(o.path)===void 0?{}:{sourceRoot:r.roots.get(o.path)}})],target:r.target,options:{background:r.background,keepMetadata:r.keepMetadata,...r.quality===void 0?{}:{quality:r.quality}}}))}};function br(t,e){if(e.crop){let n=xe(e.crop.aspect);if(!e.resize)return n;let r=e.crop.box??Ae(t,e.crop.aspect);return`${n}-${qt(Nt(r,e.resize))}`}return e.trim&&e.resize?`trimmed-${Ie(e.resize)}`:e.resize?qt(Nt(t,e.resize)):"trimmed"}function Sr(t,e){if(e.trim&&e.crop)throw new Error("planEdit cannot trim and crop the same image");return t.map(n=>{let r=e.target??ke(n),o={background:e.background,keepMetadata:e.keepMetadata,...e.quality===void 0?{}:{quality:e.quality},...e.trim?{trim:!0}:{},...e.resize?{resize:e.resize}:{},...e.crop?{crop:e.crop}:{}},s=e.roots?.get(n.path),i=bt({sourcePath:n.path,target:r,suffix:br(n,e),...e.output===void 0?{}:{output:e.output},...s===void 0?{}:{sourceRoot:s}});return{op:"convert",sources:[n],outputs:[nt(i,q(e.destination),q(e.name))],target:r,options:o}})}var zt=t=>t.length>0&&t.every(e=>e.kind==="image")?t:void 0,Ar=t=>typeof t=="object"&&t!==null&&("percent"in t||"width"in t||"height"in t),Ge=t=>typeof t=="object"&&t!==null&&"aspect"in t&&typeof t.aspect=="object"&&t.aspect!==null&&"w"in t.aspect&&"h"in t.aspect;function Ut(t,e,n,r){return{id:t,label:e,verb:n,hint:r,appliesTo:o=>zt(o)?.every(s=>t==="resize"||s.frames<=1)===!0,unavailable:o=>zt(o)?"animated":"images only",options:()=>[],plan(o,s){let i=zt(o);return i?t==="crop"&&!Ge(s.crop)?[]:Sr(i,{trim:t==="trim"||s.trim===!0,...Ar(s.resize)?{resize:s.resize}:{},...Ge(s.crop)?{crop:s.crop}:{},...typeof s.target=="string"?{target:s.target}:{},...typeof s.output=="string"?{output:s.output}:{},...s.roots instanceof Map?{roots:s.roots}:{},destination:s.destination,name:s.name,background:typeof s.background=="string"?s.background:"#ffffff",keepMetadata:s.keepMetadata===!0,...typeof s.quality=="number"?{quality:s.quality}:{}}):[]}}}var je=Ut("trim","Trim edges","Trimming edges","cut empty borders"),We=Ut("resize","Resize","Resizing","smaller or larger"),ze=Ut("crop","Crop to shape","Cropping","change the shape");var Tt=t=>t.length===1&&t[0]?.kind==="document"&&t[0].format==="pdf"?t[0]:void 0,Ue={id:"split",label:"Split",verb:"Splitting",hint:"into several files",appliesTo:t=>(Tt(t)?.pages??0)>1,unavailable:t=>Tt(t)===void 0?"one PDF at a time":"only one page",options(t){let e=Tt(t);return e?[{kind:"select",id:"mode",label:"How",default:"every-page",choices:[{value:"every-page",label:"Every page",hint:`${e.pages} files`},{value:"every-n",label:"Every N pages",hint:"ask how many"},{value:"points",label:"At points I choose",hint:"grid"}]}]:[]},plan(t,e){let n=Tt(t);if(!n)return[];let r=Array.isArray(e.cuts)?e.cuts:[],o=Re(r,n.pages).length,s=St(Pe(n.path,o),q(e.destination),q(e.name));return[{op:"split",sources:[n],outputs:s,cuts:r}]}};function Ci(t){return Array.from({length:Math.max(0,t-1)},(e,n)=>n)}function $i(t,e){if(!Number.isInteger(e)||e<1)throw it("Splitting every N pages needs N to be a whole number, at least 1.");let n=[];for(let r=e;r<t;r+=e)n.push(r-1);return n}var pt=t=>t.length===1&&t[0]?.kind==="document"&&t[0].format==="pdf"?t[0]:void 0;function Je(t,e){return Array.isArray(e.pages)?ut(e.pages):typeof e.pages=="string"?ut(vt(e.pages,t.pages)):[]}var Xe=t=>({kind:"text",id:"pages",label:"Pages",placeholder:`1-${t.pages}`}),Ke={id:"extract",label:"Extract",verb:"Extracting",hint:"keep only some pages",appliesTo:t=>pt(t)!==void 0,unavailable:()=>"one PDF at a time",options:t=>{let e=pt(t);return e?[Xe(e),{kind:"select",id:"separate",label:"Output",default:"one",choices:[{value:"one",label:"One file",hint:"all selected pages together"},{value:"many",label:"Separate files",hint:"one per page"}]}]:[]},plan(t,e){let n=pt(t);if(!n)return[];let r=Je(n,e),o=e.separate==="many";return[{op:"extract",sources:[n],outputs:St(Fe(n.path,r,o),q(e.destination),q(e.name)),pages:r,separate:o}]}},Qe={id:"delete",label:"Delete",verb:"Deleting",hint:"drop some pages",appliesTo:t=>pt(t)!==void 0,unavailable:()=>"one PDF at a time",options:t=>{let e=pt(t);return e?[Xe(e)]:[]},plan(t,e){let n=pt(t);return n?[{op:"delete",sources:[n],outputs:[nt(lt(n.path,"trimmed"),q(e.destination),q(e.name))],pages:Je(n,e)}]:[]}};var Jt=t=>t.filter(e=>e.kind==="document"&&e.format==="pdf"),Ye={id:"merge",label:"Merge",verb:"Merging",hint:"several files into one",appliesTo:t=>Jt(t).length>=2&&Jt(t).length===t.length,unavailable:t=>Jt(t).length!==t.length?"PDFs only":"needs 2+ files",options:()=>[],plan(t,e){let n=nt(De(t.map(r=>r.path)),q(e.destination),q(e.name));return[{op:"merge",sources:t,outputs:[n]}]}};var Ze=t=>t.length===1&&t[0]?.kind==="document"&&t[0].format==="pdf"?t[0]:void 0,Ve={id:"rotate",label:"Rotate",verb:"Rotating",hint:"turn pages",appliesTo:t=>Ze(t)!==void 0,unavailable:()=>"one PDF at a time",options:()=>[{kind:"select",id:"degrees",label:"Turn",default:"90",choices:[{value:"90",label:"90\xB0 right",hint:"a quarter turn"},{value:"180",label:"180\xB0",hint:"upside down"},{value:"270",label:"90\xB0 left",hint:"a quarter turn back"}]}],plan(t,e){let n=Ze(t);if(!n)return[];let o=Number(e.degrees??90)/90%4||1;return[{op:"rotate",sources:[n],outputs:[nt(lt(n.path,"rotated"),q(e.destination),q(e.name))],turns:o}]}};var tn=[He,Ce,Ye,Ue,Ke,Qe,Ve,je,We,ze],Yi=tn.filter(t=>!["convert","compress","trim","resize","crop"].includes(t.id)),xr=[Be,qe];function Zi(t,e=new Set){return[...tn,...xr.filter(n=>n.requires&&e.has(n.requires))].filter(n=>n.appliesTo(t))}function Vi(t,e){return t.appliesTo(e)?void 0:t.unavailable?.(e)}function Rr(t=1,e=100){let n=Math.max(1,e-t+1);return 1+Math.max(0,Math.ceil(Math.log2(n)))}async function en(t){let e=t.min??1,n=t.max??100,r=Rr(e,n),o=0,s=async f=>(o+=1,t.onAttempt?.(o,r),t.encode(f)),i=()=>t.signal?.aborted===!0,u=await s(n);if(i())return{quality:n,bytes:u,missed:!1,cancelled:!0};if(u<=t.targetBytes)return{quality:n,bytes:u,missed:!1};let p=e,h=n,g;for(;p<=h;){let f=Math.floor((p+h)/2),b=await s(f);if(i())return{quality:f,bytes:b,missed:!1,cancelled:!0};b<=t.targetBytes?(g={quality:f,bytes:b,missed:!1},p=f+1):h=f-1}if(g)return g;let y=await t.encode(e);return{quality:e,bytes:y,missed:!0}}import{cpus as Er}from"node:os";function _r(){return Math.max(1,Math.min(Er().length,4))}function Pt(t){let e=t!==void 0&&Number.isFinite(t)?t:void 0;return Math.max(1,e??_r())}async function Xt(t,e,n){let r=0,o=async()=>{for(;r<t.length;){let i=r++;await n(t[i],i)}},s=Math.min(Pt(e),t.length);await Promise.all(Array.from({length:s},o))}async function nn(t,e){let n=e.onEvent??(()=>{}),r=e.engineFor??Ot,o=Pt(e.concurrency),s=t.length,i=[],u=[],p=0;await Xt(t,o,async(f,b)=>{n({type:"job:start",job:f,index:b,total:s});let S=r(f);if(!S){p++;let x=f.sources[0].path,R={path:x,error:mt(x,new Error(`no engine runs ${f.op}`))};u[b]=R,n({type:"job:error",job:f,failure:R,completed:p,total:s});return}try{let x=await S.run(f,R=>n({type:"job:phase",job:f,progress:R}),e.signal);i[b]=x,p++,n({type:"job:done",job:f,result:x,completed:p,total:s})}catch(x){p++;let R=f.sources[0].path,T=rt(x)?x:mt(R,x),A={path:R,error:T};u[b]=A,n({type:"job:error",job:f,failure:A,completed:p,total:s})}});let h=i.filter(f=>f!==void 0),g=u.filter(f=>f!==void 0),y={results:h,failures:g,inputBytes:h.reduce((f,b)=>f+b.job.sources[0].bytes,0),outputBytes:h.reduce((f,b)=>f+b.outputBytes,0)};return n({type:"batch:done",summary:y}),y}import{existsSync as kr}from"node:fs";import{resolve as Lt}from"node:path";function Ir(t){let e=t.sources[0]?.path??t.outputs[0]??"",n=new Set;for(let r of t.outputs){let o=Lt(r);if(n.has(o))return{output:r,error:ye(e,r)};n.add(o)}}function vr(t,e,n){let r=Ir(t);if(r)return r;let o=new Set(t.sources.map(i=>Lt(i.path))),s=t.sources[0]?.path??t.outputs[0]??"";for(let i of t.outputs){let u=Lt(i);if(o.has(u)&&!n)return{output:i,error:be(i,t.op)};let p=e.get(u);if(p){let h=p.sources[0]?.path??p.outputs[0]??"";return{output:i,error:ge([h,s],i)}}if(kr(u)&&!n)return{output:i,error:me(i,t.op)}}}function rn(t,e){let n=[],r=[],o=new Map;for(let s of t){let i=vr(s,o,e.force);if(i){let u=s.sources[0]?.path??i.output;r.push({path:u,error:i.error});continue}for(let u of s.outputs)o.set(Lt(u),s);n.push(s)}return{jobs:n,failures:r}}async function Or(t,e,n,r,o){let s=t.sources[0].path,i=f=>({kind:"failed",failure:{path:s,error:rt(f)?f:mt(s,f)}}),u;try{u=await n(t)?.measurer?.(t)}catch(f){return i(f)}if(!u||u.ladder.length===0)return{kind:"refused",failure:{path:s,error:fe(t.sources[0],t.target)}};let p=u;if(o?.aborted)return{kind:"cancelled"};let h=Number.POSITIVE_INFINITY,g;try{for(let f of p.ladder){let b=await en({encode:S=>p.measure({...t.options,...f,quality:S}),targetBytes:e,onAttempt:(S,x)=>r({type:"search:attempt",job:t,attempt:S,of:x,rung:f}),...o===void 0?{}:{signal:o}});if(b.cancelled)return{kind:"cancelled"};if(b.bytes<h&&(h=b.bytes,g={...f,quality:b.quality}),!b.missed)return t.options={...t.options,...f,quality:b.quality},{kind:"ready"}}}catch(f){return i(f)}return{kind:"unreachable",entry:{job:t,smallest:h,settings:g??{quality:1},error:de(t.sources[0],e,h)}}}async function mu(t,e){let n=e.onEvent??(()=>{}),r=e.engineFor??Ot,o=e.targetBytes,s=rn(t,{force:e.force}),i=o===void 0?0:s.jobs.filter(R=>R.op==="convert").length,u=[],p=0;await Xt(s.jobs,Pt(e.concurrency),async(R,T)=>{if(o===void 0||R.op!=="convert"){u[T]={kind:"ready"};return}if(e.signal?.aborted){u[T]={kind:"cancelled"};return}let A=await Or(R,o,r,n,e.signal);u[T]=A,A.kind!=="cancelled"&&(p+=1,n({type:"search:settled",job:R,completed:p,total:i}))});let h=[...s.failures],g=[],y=[],f=[],b=!1;for(let[R,T]of s.jobs.entries()){let A=u[R]??{kind:"ready"};A.kind==="ready"?f.push(T):A.kind==="refused"?h.push(A.failure):A.kind==="failed"?y.push(A.failure):A.kind==="unreachable"?g.push(A.entry):b=!0}if(b)return{results:[],refusals:h,unreachable:[],failures:[],inputBytes:0,outputBytes:0,cancelled:!0};let S=new Set,x=await nn(f,{...e.concurrency===void 0?{}:{concurrency:e.concurrency},...e.engineFor===void 0?{}:{engineFor:e.engineFor},...e.signal===void 0?{}:{signal:e.signal},onEvent:R=>{R.type==="job:error"&&!e.signal?.aborted&&S.add(R.failure),n(R)}});if(e.signal?.aborted&&x.failures.length>0){let R=x.failures.filter(T=>S.has(T));return{...x,refusals:h,unreachable:g,failures:[...y,...R],cancelled:!0}}return{results:x.results,refusals:h,unreachable:g,failures:[...y,...x.failures],inputBytes:x.inputBytes,outputBytes:x.outputBytes}}import{existsSync as Bs}from"node:fs";import{stat as qs}from"node:fs/promises";import{resolve as le}from"node:path";import{readdir as ls,readdirSync as ps,realpath as fs,realpathSync as ds,stat as hs,statSync as ms}from"fs";import{isAbsolute as gs,posix as ot,resolve as ys}from"path";import{fileURLToPath as bs}from"url";import{createRequire as wr}from"module";import{basename as Cr,dirname as Qt,normalize as $r,relative as Tr,resolve as Pr,sep as un}from"path";import*as Lr from"fs";var on=wr(import.meta.url);function Fr(t){let e=$r(t);return e.length>1&&e[e.length-1]===un&&(e=e.substring(0,e.length-1)),e}var Dr=/[\\/]/g;function an(t,e){return t.replace(Dr,e)}var Hr=/^[a-z]:[\\/]$/i;function Nr(t){return t==="/"||Hr.test(t)}function Kt(t,e){let{resolvePaths:n,normalizePath:r,pathSeparator:o}=e,s=process.platform==="win32"&&t.includes("/")||t.startsWith(".");if(n&&(t=Pr(t)),(r||s)&&(t=Fr(t)),t===".")return"";let i=t[t.length-1]!==o;return an(i?t+o:t,o)}function cn(t,e){return e+t}function Mr(t,e){return function(n,r){return r.startsWith(t)?r.slice(t.length)+n:an(Tr(t,r),e.pathSeparator)+e.pathSeparator+n}}function Br(t){return t}function qr(t,e,n){return e+t+n}function Gr(t,e){let{relativePaths:n,includeBasePath:r}=e;return n&&t?Mr(t,e):r?cn:Br}function jr(t){return function(e,n){n.push(e.substring(t.length)||".")}}function Wr(t){return function(e,n,r){let o=e.substring(t.length)||".";r.every(s=>s(o,!0))&&n.push(o)}}var zr=(t,e)=>{e.push(t||".")},Ur=(t,e,n)=>{let r=t||".";n.every(o=>o(r,!0))&&e.push(r)},Jr=()=>{};function Xr(t,e){let{includeDirs:n,filters:r,relativePaths:o}=e;return n?o?r&&r.length?Wr(t):jr(t):r&&r.length?Ur:zr:Jr}var Kr=(t,e,n,r)=>{r.every(o=>o(t,!1))&&n.files++},Qr=(t,e,n,r)=>{r.every(o=>o(t,!1))&&e.push(t)},Yr=(t,e,n,r)=>{n.files++},Zr=(t,e)=>{e.push(t)},Vr=()=>{};function to(t){let{excludeFiles:e,filters:n,onlyCounts:r}=t;return e?Vr:n&&n.length?r?Kr:Qr:r?Yr:Zr}var eo=t=>t,no=()=>[""].slice(0,0);function ro(t){return t.group?no:eo}var oo=(t,e,n)=>{t.push({directory:e,files:n,dir:e})},so=()=>{};function io(t){return t.group?oo:so}var uo=function(t,e,n){let{queue:r,fs:o,options:{suppressErrors:s}}=e;r.enqueue(),o.realpath(t,(i,u)=>{if(i)return r.dequeue(s?null:i,e);o.stat(u,(p,h)=>{if(p)return r.dequeue(s?null:p,e);if(h.isDirectory()&&ln(t,u,e))return r.dequeue(null,e);n(h,u),r.dequeue(null,e)})})},ao=function(t,e,n){let{queue:r,fs:o,options:{suppressErrors:s}}=e;r.enqueue();try{let i=o.realpathSync(t),u=o.statSync(i);if(u.isDirectory()&&ln(t,i,e))return;n(u,i)}catch(i){if(!s)throw i}};function co(t,e){return!t.resolveSymlinks||t.excludeSymlinks?null:e?ao:uo}function ln(t,e,n){if(n.options.useRealPaths)return lo(e,n);let r=Qt(t),o=1;for(;r!==n.root&&o<2;){let s=n.symlinks.get(r);!!s&&(s===e||s.startsWith(e)||e.startsWith(s))?o++:r=Qt(r)}return n.symlinks.set(t,e),o>1}function lo(t,e){return e.visited.includes(t+e.options.pathSeparator)}var po=t=>t.counts,fo=t=>t.groups,ho=t=>t.paths,mo=t=>t.paths.slice(0,t.options.maxFiles),go=(t,e,n)=>(Ft(e,n,t.counts,t.options.suppressErrors),null),yo=(t,e,n)=>(Ft(e,n,t.paths,t.options.suppressErrors),null),bo=(t,e,n)=>(Ft(e,n,t.paths.slice(0,t.options.maxFiles),t.options.suppressErrors),null),So=(t,e,n)=>(Ft(e,n,t.groups,t.options.suppressErrors),null);function Ft(t,e,n,r){e(t&&!r?t:null,n)}function Ao(t,e){let{onlyCounts:n,group:r,maxFiles:o}=t;return n?e?po:go:r?e?fo:So:o?e?mo:bo:e?ho:yo}var pn={withFileTypes:!0},xo=(t,e,n,r,o)=>{if(t.queue.enqueue(),r<0)return t.queue.dequeue(null,t);let{fs:s}=t;t.visited.push(e),t.counts.directories++,s.readdir(e||".",pn,(i,u=[])=>{o(u,n,r),t.queue.dequeue(t.options.suppressErrors?null:i,t)})},Ro=(t,e,n,r,o)=>{let{fs:s}=t;if(r<0)return;t.visited.push(e),t.counts.directories++;let i=[];try{i=s.readdirSync(e||".",pn)}catch(u){if(!t.options.suppressErrors)throw u}o(i,n,r)};function Eo(t){return t?Ro:xo}var _o=class{count=0;constructor(t){this.onQueueEmpty=t}enqueue(){return this.count++,this.count}dequeue(t,e){this.onQueueEmpty&&(--this.count<=0||t)&&(this.onQueueEmpty(t,e),t&&(e.controller.abort(),this.onQueueEmpty=void 0))}},ko=class{_files=0;_directories=0;set files(t){this._files=t}get files(){return this._files}set directories(t){this._directories=t}get directories(){return this._directories}get dirs(){return this._directories}},Io=class{aborted=!1;abort(){this.aborted=!0}},fn=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(t,e,n){this.isSynchronous=!n,this.callbackInvoker=Ao(e,this.isSynchronous),this.root=Kt(t,e),this.state={root:Nr(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new ko,options:e,queue:new _o((r,o)=>this.callbackInvoker(o,r,n)),symlinks:new Map,visited:[""].slice(0,0),controller:new Io,fs:e.fs||Lr},this.joinPath=Gr(this.root,e),this.pushDirectory=Xr(this.root,e),this.pushFile=to(e),this.getArray=ro(e),this.groupFiles=io(e),this.resolveSymlink=co(e,this.isSynchronous),this.walkDirectory=Eo(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(t,e,n)=>{let{paths:r,options:{filters:o,resolveSymlinks:s,excludeSymlinks:i,exclude:u,maxFiles:p,signal:h,useRealPaths:g,pathSeparator:y},controller:f}=this.state;if(f.aborted||h&&h.aborted||p&&r.length>p)return;let b=this.getArray(this.state.paths);for(let S=0;S<t.length;++S){let x=t[S];if(x.isFile()||x.isSymbolicLink()&&!s&&!i){let R=this.joinPath(x.name,e);this.pushFile(R,b,this.state.counts,o)}else if(x.isDirectory()){let R=qr(x.name,e,this.state.options.pathSeparator);if(u&&u(x.name,R))continue;this.pushDirectory(R,r,o),this.walkDirectory(this.state,R,R,n-1,this.walk)}else if(this.resolveSymlink&&x.isSymbolicLink()){let R=cn(x.name,e);this.resolveSymlink(R,this.state,(T,A)=>{if(T.isDirectory()){if(A=Kt(A,this.state.options),u&&u(x.name,g?A:R+y))return;this.walkDirectory(this.state,A,g?A:R+y,n-1,this.walk)}else{A=g?A:R;let G=Cr(A),K=Kt(Qt(A),this.state.options);A=this.joinPath(G,K),this.pushFile(A,b,this.state.counts,o)}})}}this.groupFiles(this.state.groups,e,b)}};function vo(t,e){return new Promise((n,r)=>{dn(t,e,(o,s)=>{if(o)return r(o);n(s)})})}function dn(t,e,n){new fn(t,e,n).start()}function Oo(t,e){return new fn(t,e).start()}var sn=class{constructor(t,e){this.root=t,this.options=e}withPromise(){return vo(this.root,this.options)}withCallback(t){dn(this.root,this.options,t)}sync(){return Oo(this.root,this.options)}},hn=null;try{on.resolve("picomatch"),hn=on("picomatch")}catch{}var mn=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:un,filters:[]};globFunction;constructor(t){this.options={...this.options,...t},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(t){return this.options.pathSeparator=t,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(t){return this.options.maxDepth=t,this}withMaxFiles(t){return this.options.maxFiles=t,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:t=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=t,this.withFullPaths()}withAbortSignal(t){return this.options.signal=t,this}normalize(){return this.options.normalizePath=!0,this}filter(t){return this.options.filters.push(t),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(t){return this.options.exclude=t,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(t){return new sn(t||".",this.options)}withGlobFunction(t){return this.globFunction=t,this}crawlWithOptions(t,e){return this.options={...this.options,...e},new sn(t||".",this.options)}glob(...t){return this.globFunction?this.globWithOptions(t):this.globWithOptions(t,{dot:!0})}globWithOptions(t,...e){let n=this.globFunction||hn;if(!n)throw new Error("Please specify a glob function to use glob matching.");var r=this.globCache[t.join("\0")];return r||(r=n(t,...e),this.globCache[t.join("\0")]=r),this.options.filters.push(o=>r(o)),this}};var dt=Yn(Mn(),1),Ss=Array.isArray,jn=/\\/g,As=/^[A-Za-z]:$/,Wn=process.platform==="win32",xs=/^(\/?\.\.)+$/;function Rs(t,e={}){let n=t.length,r=Array(n),o=Array(n),s,i;for(s=0;s<n;s++){let u=zn(t[s]);r[s]=u;let p=u.length,h=Array(p);for(i=0;i<p;i++)h[i]=(0,dt.default)(u[i],e);o[s]=h}return u=>{let p=u.split("/");if(p[0]===".."&&xs.test(u))return!0;for(s=0;s<n;s++){let h=r[s],g=o[s],y=p.length,f=Math.min(y,h.length);for(i=0;i<f;){let b=h[i];if(b.includes("/"))return!0;if(!g[i](p[i]))break;if(!e.noglobstar&&b==="**")return!0;i++}if(i===y)return!0}return!1}}var Es=/^[A-Z]:\/$/i,_s=Wn?t=>Es.test(t):t=>t==="/";function Bn(t,e,n){if(t===e||e.startsWith(`${t}/`)){if(n){let o=t.length+ +!_s(t);return(s,i)=>s.slice(o,i?-1:void 0)||"."}let r=e.slice(t.length+1);return r?(o,s)=>{if(o===".")return r;let i=`${r}/${o}`;return s?i.slice(0,-1):i}:(o,s)=>s&&o!=="."?o.slice(0,-1):o}return n?r=>ot.relative(t,r)||".":r=>ot.relative(t,`${e}/${r}`)||"."}function ks(t,e){if(e.startsWith(`${t}/`)){let n=e.slice(t.length+1);return r=>`${n}/${r}`}return n=>{let r=ot.relative(t,`${e}/${n}`);return n[n.length-1]==="/"&&r!==""?`${r}/`:r||"."}}function qn(t){return t.replace(As,e=>`${e}/`)}var Is={parts:!0};function zn(t){var e;let n=dt.default.scan(t,Is);return!((e=n.parts)===null||e===void 0)&&e.length?n.parts:[t]}var vs=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,Os=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,ws=t=>t.replace(vs,"\\$&"),Cs=t=>t.replace(Os,"\\$&"),$s=Wn?Cs:ws;function Ts(t,e){if(e?.caseSensitiveMatch===!1)return!0;let n=dt.default.scan(t);return n.isGlob||n.negated}function _t(...t){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...t)}function Un(t){return typeof t=="string"?[t]:t??[]}var Ps=/^(\/?\.\.)+/,Ls=/\\(?=[()[\]{}!*+?@|])/g;function ae(t,e,n,r){var o;let s=e.cwd,i=t;t[t.length-1]==="/"&&(i=t.slice(0,-1)),i[i.length-1]!=="*"&&e.expandDirectories&&(i+="/**");let u=$s(s);i=gs(i.replace(Ls,""))?ot.relative(u,i):ot.normalize(i);let p=(o=Ps.exec(i))===null||o===void 0?void 0:o[0],h=zn(i);if(p){let y=(p.length+1)/3,f=0,b=u.split("/");for(;f<y&&h[f+y]===b[b.length+f-y];)i=i.slice(0,(y-f-1)*3)+i.slice((y-f)*3+h[f+y].length+1)||".",f++;let S=ot.join(s,p.slice(f*3));S[0]!=="."&&n.root.length>S.length&&(n.root=qn(S),n.depthOffset=-y+f)}if(!r&&n.depthOffset>=0){var g;(g=n.commonPath)!==null&&g!==void 0||(n.commonPath=h);let y=[],f=Math.min(n.commonPath.length,h.length);for(let b=0;b<f;b++){let S=h[b];if(S==="**"&&!h[b+1]){y.pop();break}if(b===h.length-1||S!==n.commonPath[b]||Ts(S))break;y.push(S)}n.depthOffset=y.length,n.commonPath=y,n.root=qn(y.length>0?ot.join(s,...y):s)}return i}function Fs(t,e,n){let r=[],o=[];for(let s of t.ignore)s&&(s[0]!=="!"||s[1]==="(")&&o.push(ae(s,t,n,!0));for(let s of e)s&&(s[0]!=="!"||s[1]==="("?r.push(ae(s,t,n,!1)):(s[1]!=="!"||s[2]==="(")&&o.push(ae(s.slice(1),t,n,!0)));return{match:r,ignore:o}}function Ds(t,e){let n=t.cwd,r={root:n,depthOffset:0},o=Fs(t,e,r);t.debug&&_t("internal processing patterns:",o);let{absolute:s,caseSensitiveMatch:i,debug:u,dot:p,followSymbolicLinks:h,onlyDirectories:g}=t,y=r.root.replace(jn,""),f={dot:p,nobrace:t.braceExpansion===!1,nocase:!i,noextglob:t.extglob===!1,noglobstar:t.globstar===!1,posix:!0},b=(0,dt.default)(o.match,f),S=(0,dt.default)(o.ignore,f),x=Rs(o.match,f),R=Bn(n,y,s),T=s?R:Bn(n,y,!0),A=(F,C)=>{let O=T(C,!0);return O!=="."&&!x(O)||S(O)},G;t.deep!==void 0&&(G=Math.round(t.deep-r.depthOffset));let K=new mn({filters:[u?(F,C)=>{let O=R(F,C),E=b(O)&&!S(O);return E&&_t(`matched ${O}`),E}:(F,C)=>{let O=R(F,C);return b(O)&&!S(O)}],exclude:u?(F,C)=>{let O=A(F,C);return _t(`${O?"skipped":"crawling"} ${C}`),O}:A,fs:t.fs,pathSeparator:"/",relativePaths:!s,resolvePaths:s,includeBasePath:s,resolveSymlinks:h,excludeSymlinks:!h,excludeFiles:g,includeDirs:g||!t.onlyFiles,maxDepth:G,signal:t.signal}).crawl(y);return t.debug&&_t("internal properties:",{...r,root:y}),[K,n!==y&&!s&&ks(n,y)]}function Hs(t,e){if(e)for(let n=t.length-1;n>=0;n--)t[n]=e(t[n]);return t}var Gn={caseSensitiveMatch:!0,debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0};function Ns(t){let e=Object.assign({},t);for(let n in Gn)e[n]===void 0&&Object.assign(e,{[n]:Gn[n]});return e.cwd=(e.cwd instanceof URL?bs(e.cwd):ys(e.cwd||process.cwd())).replace(jn,"/"),e.ignore=Un(e.ignore),e.fs&&(e.fs={readdir:e.fs.readdir||ls,readdirSync:e.fs.readdirSync||ps,realpath:e.fs.realpath||fs,realpathSync:e.fs.realpathSync||ds,stat:e.fs.stat||hs,statSync:e.fs.statSync||ms}),e.debug&&_t("globbing with options:",e),e}function Ms(t,e={}){var n;if(t&&e?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");let r=Ss(t)||typeof t=="string",o=Un((n=r?t:t.patterns)!==null&&n!==void 0?n:"**/*"),s=Ns(r?e:t);return o.length>0?Ds(s,o):[]}async function ce(t,e){let[n,r]=Ms(t,e);return n?Hs(await n.withPromise(),r):[]}var Jn=Object.values(Q).flatMap(t=>t.extensions).map(t=>t.slice(1));function Gs(t){return/[*?[\]{}]/.test(t)}async function js(t,e){let n=e?`**/*.{${Jn.join(",")}}`:`*.{${Jn.join(",")}}`;return(await ce([n],{cwd:t,absolute:!0,onlyFiles:!0,caseSensitiveMatch:!1})).sort()}async function Xn(t,e,n,r){let o=await js(t,e);if(o.length===0){n.push({path:t,error:Se(t)});return}for(let s of o)await r(s,t,!1)}async function Wu(t,e){let n=[],r=[],o=new Map,s=le(t);return await Xn(s,e.recursive,r,async(i,u)=>{try{n.push(await Mt(i)),o.set(i,u)}catch(p){rt(p)&&r.push({path:i,error:p})}}),{sources:n,failures:r,roots:o}}async function zu(t,e){let n=[],r=[],o=new Map,s=new Set,i=async(u,p,h)=>{let g=le(u);if(!s.has(g)){s.add(g);try{n.push(await Mt(g)),p&&o.set(g,p)}catch(y){if(rt(y))r.push({path:g,error:y});else if(h)throw y}}};for(let u of t){let p=le(u);if(Gs(u)&&!Bs(p)){let g=(e.platform??process.platform)==="win32"?u.replaceAll("\\","/"):u,y=await ce([g],{absolute:!0,onlyFiles:!0});y.length===0&&r.push({path:p,error:Ht(p)});for(let f of y.sort())await i(f,void 0,!1);continue}let h;try{h=await qs(p)}catch{r.push({path:p,error:Ht(p)});continue}if(h.isDirectory()){await Xn(p,e.recursive,r,i);continue}await i(p,void 0,!0)}return{sources:n,failures:r,roots:o}}export{we as a,wt as b,Ce as c,$e as d,Wt as e,oi as f,He as g,Si as h,Be as i,qe as j,Sr as k,je as l,We as m,ze as n,Ve as o,Ue as p,Ci as q,$i as r,tn as s,Yi as t,Zi as u,Vi as v,rn as w,mu as x,Wu as y,zu as z};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
2
|
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
-
import{c as s}from"./chunk-
|
|
3
|
+
import{c as s}from"./chunk-H2IUSPAK.js";import{randomBytes as d}from"node:crypto";import{mkdir as p,readFile as m,rename as l,rm as h,writeFile as b}from"node:fs/promises";import{dirname as c,join as g}from"node:path";var w="https://registry.npmjs.org/forge-terminal/latest",y=1440*60*1e3,C=3e3,k=/^(\d+)\.(\d+)\.(\d+)$/;function o(t){let e=k.exec(t);return e?[Number(e[1]),Number(e[2]),Number(e[3])]:void 0}function x(t,e){let n=o(t),r=o(e);if(!n||!r)return!1;for(let i=0;i<3;i++)if(n[i]!==r[i])return n[i]>r[i];return!1}function _(t,e=process.env){return!(t.updateCheck===!1||e.CI!==void 0&&e.CI!==""&&e.CI!=="false"||e.FORGE_NO_UPDATE_CHECK!==void 0&&e.FORGE_NO_UPDATE_CHECK!=="")}function u(){return g(c(s()),"update-check.json")}async function f(){try{let t=JSON.parse(await m(u(),"utf8"));if(typeof t!="object"||t===null)return;let{checkedAt:e,latest:n,notifiedAt:r}=t;return typeof e!="number"?void 0:{checkedAt:e,...typeof n=="string"&&o(n)?{latest:n}:{},...typeof r=="number"?{notifiedAt:r}:{}}}catch{return}}async function A(t){let e=u();await p(c(e),{recursive:!0});let n=`${e}.${d(4).toString("hex")}.tmp`;try{await b(n,`${JSON.stringify(t)}
|
|
4
4
|
`),await l(n,e)}catch(r){throw await h(n,{force:!0}).catch(()=>{}),r}}function R(t,e=Date.now()){return t===void 0?!0:t.checkedAt>e||e-t.checkedAt>y}async function E(t={}){let e=t.fetchImpl??fetch,n=AbortSignal.timeout(t.timeoutMs??C),r=t.signal?AbortSignal.any([t.signal,n]):n;try{let i=await e(w,{signal:r,headers:{accept:"application/json"}});if(!i.ok)return;let a=(await i.json())?.version;return typeof a=="string"&&o(a)?a:void 0}catch{return}}async function F(t={}){let e=await E(t),n=await f(),r={checkedAt:t.now??Date.now(),...(e??n?.latest)!==void 0?{latest:e??n?.latest}:{},...n?.notifiedAt!==void 0?{notifiedAt:n.notifiedAt}:{}};return await A(r).catch(()=>{}),e}async function I(t){let e=(await f())?.latest;return e!==void 0&&x(e,t)?e:void 0}export{w as a,y as b,x as c,_ as d,u as e,f,A as g,R as h,E as i,F as j,I as k};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
|
+
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
+
import{g as S,h as k,l as C}from"./chunk-K2ABBIR4.js";import{i as $,k as u,l as w}from"./chunk-MBTGANIR.js";import{c as I,d as y,f as O}from"./chunk-PBIS2ONZ.js";import{b as m,c as d,h as f,i as p}from"./chunk-QVACE4IE.js";import{a as h,b as g}from"./chunk-3GVFOZ7M.js";import"./chunk-GGBNT4WI.js";import"./chunk-GNLE6JXL.js";import"./chunk-32VJ2RDH.js";import{a as l}from"./chunk-G4DU5ADF.js";import{c as b,q as x}from"./chunk-MMRDELHW.js";import"./chunk-J7FLFHQJ.js";import"./chunk-TMUK2DD3.js";import{resolve as R}from"node:path";var P=({r:t,g:n,b:o},s)=>s?`\x1B[38;2;${t};${n};${o}m\u2588\u2588\x1B[39m `:"";function N(t,n){let o=d(n),s,e=Number.POSITIVE_INFINITY;for(let r of t){let a=(r.centre.L-o.L)**2+(r.centre.a-o.a)**2+(r.centre.b-o.b)**2;a<e&&(e=a,s=r)}return s}async function D(t,n){let{pixels:o}=await C(t.input),s=I(o);if(s.length===0)throw x(t.input);let e=t.inside?N(s,t.inside):void 0,r=e?y(o,e):s;if(t.svg)return{exitCode:0,stdout:[S(b(t.input),r,"light",e?.hex)],stderr:[]};if(n.json){let i=h(l,{source:R(t.input),...e?{inside:e.hex}:{},colours:r.map(c=>({hex:c.hex,rgb:f(c.rgb),oklch:p(c.rgb),share:c.share}))});return{exitCode:0,stdout:[JSON.stringify(i)],stderr:[]}}let a=O(r.map(i=>i.share));return{exitCode:0,stdout:r.map((i,c)=>`${P(i.rgb,n.colour)}${i.hex} ${String(a[c]).padStart(3)}%`),stderr:[]}}async function H(t,n){let o=$(t.colour);if(t.svg)return{exitCode:0,stdout:[k(t.colour,o)],stderr:[]};let s=o.map(e=>({...e,...w(e.rgb)}));if(n.json){let e=g(l,{reference:m(t.colour),steps:s.map(r=>({step:r.step,hex:r.hex,oklch:p(r.rgb),white:r.white,black:r.black}))});return{exitCode:0,stdout:[JSON.stringify(e)],stderr:[]}}return{exitCode:0,stdout:s.map(e=>`${String(e.step).padStart(4)} ${P(e.rgb,n.colour)}${e.hex} white ${e.white.toFixed(1)} ${u(e.white)} \xB7 black ${e.black.toFixed(1)} ${u(e.black)}`),stderr:[]}}export{D as runPalette,H as runScale};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
2
|
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
-
import{a,b}from"./chunk-
|
|
3
|
+
import{a,b}from"./chunk-I6QBBRCE.js";import"./chunk-MMRDELHW.js";import"./chunk-J7FLFHQJ.js";import"./chunk-H2IUSPAK.js";import"./chunk-HON4OV7M.js";import"./chunk-TMUK2DD3.js";export{a as CONFIG_KEYS,b as runConfig};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
|
+
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
+
import{b as a,c as b,d as c,e as d}from"./chunk-DG4IXNWJ.js";import"./chunk-WFD6OWQY.js";import"./chunk-BZXDNDPG.js";import"./chunk-LW2QEXDT.js";import"./chunk-3GVFOZ7M.js";import"./chunk-GGBNT4WI.js";import"./chunk-GNLE6JXL.js";import"./chunk-32VJ2RDH.js";import"./chunk-G4DU5ADF.js";import"./chunk-MMRDELHW.js";import"./chunk-J7FLFHQJ.js";import"./chunk-H2IUSPAK.js";import"./chunk-HON4OV7M.js";import"./chunk-TMUK2DD3.js";export{d as execute,a as exitCodeFor,c as renderRun,b as runIntent};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
|
+
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
+
import{Aa as b,Ba as c,Ca as d,Da as e,za as a}from"./chunk-KSRGJD2E.js";import"./chunk-MBTGANIR.js";import"./chunk-PBIS2ONZ.js";import"./chunk-BZXDNDPG.js";import"./chunk-IBPGC4N2.js";import"./chunk-QVACE4IE.js";import"./chunk-G4DU5ADF.js";import"./chunk-MMRDELHW.js";import"./chunk-J7FLFHQJ.js";import"./chunk-YILLB45O.js";import"./chunk-TMUK2DD3.js";export{e as ExtensionsFlow,c as byteCount,b as extensionCredits,d as extensionsChip,a as realManager};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
2
|
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
-
import{a as c}from"./chunk-J7FLFHQJ.js";import{c as d}from"./chunk-YILLB45O.js";import"./chunk-TMUK2DD3.js";function f(e){let t=Object.entries(e.assets).find(([n])=>n.startsWith(`${process.platform}-`));return d(e)?.version??t?.[1]?.version??""}function y(e){return{id:e.entry.id,title:e.entry.title,summary:e.entry.summary,version:f(e.entry),licence:e.entry.licence,installed:e.installed??null,updateAvailable:e.updateAvailable,supported:e.supported,...e.reason!==void 0?{reason:e.reason}:{},...e.downloadBytes!==void 0?{downloadBytes:e.downloadBytes}:{}}}function x(e){return e.supported?e.installed===void 0?`not installed${e.downloadBytes?`, ${c(e.downloadBytes)} download`:""}`:e.updateAvailable?`installed ${e.installed}, update to ${d(e.entry)?.version} available`:`installed ${e.installed}`:`not available: ${e.reason??"unsupported here"}`}function E(e){let t=Math.max(...e.map(n=>n.entry.id.length));return e.flatMap((n,a)=>[...a>0?[""]:[],`${n.entry.id.padEnd(t)} ${n.entry.summary}`,`${" ".repeat(t)} ${x(n)}`,`${" ".repeat(t)} ${n.entry.licence}`])}async function g(e,t={}){let{installExtension:n,listExtensions:a,removeExtension:p}=await import("./manager-
|
|
3
|
+
import{a as c}from"./chunk-J7FLFHQJ.js";import{c as d}from"./chunk-YILLB45O.js";import"./chunk-TMUK2DD3.js";function f(e){let t=Object.entries(e.assets).find(([n])=>n.startsWith(`${process.platform}-`));return d(e)?.version??t?.[1]?.version??""}function y(e){return{id:e.entry.id,title:e.entry.title,summary:e.entry.summary,version:f(e.entry),licence:e.entry.licence,installed:e.installed??null,updateAvailable:e.updateAvailable,supported:e.supported,...e.reason!==void 0?{reason:e.reason}:{},...e.downloadBytes!==void 0?{downloadBytes:e.downloadBytes}:{}}}function x(e){return e.supported?e.installed===void 0?`not installed${e.downloadBytes?`, ${c(e.downloadBytes)} download`:""}`:e.updateAvailable?`installed ${e.installed}, update to ${d(e.entry)?.version} available`:`installed ${e.installed}`:`not available: ${e.reason??"unsupported here"}`}function E(e){let t=Math.max(...e.map(n=>n.entry.id.length));return e.flatMap((n,a)=>[...a>0?[""]:[],`${n.entry.id.padEnd(t)} ${n.entry.summary}`,`${" ".repeat(t)} ${x(n)}`,`${" ".repeat(t)} ${n.entry.licence}`])}async function g(e,t={}){let{installExtension:n,listExtensions:a,removeExtension:p}=await import("./manager-XN7WNMEW.js"),i,s;if(e.action==="add"&&e.id!==void 0){let o=(await a()).find(m=>m.entry.id===e.id),l=o?.installed!==void 0&&!o.updateAvailable,u=await n(e.id,{onProgress:t.onDownload});i={id:e.id,action:l?"unchanged":"added"},s=l?`${e.id} ${u.version} is already installed`:`Installed ${e.id} ${u.version}`}else if(e.action==="remove"&&e.id!==void 0){let o=await p(e.id);i={id:e.id,action:o?"removed":"unchanged"},s=o?`Removed ${e.id}`:`${e.id} was not installed`}let r=await a();return{stdout:s===void 0?E(r):[s],data:{extensions:r.map(y),...i?{changed:i}:{}}}}export{g as runExtensions,y as toExtensionJson};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
|
+
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
+
import{F as a,G as b,H as c,I as d,J as e,K as f,L as g,M as h}from"./chunk-GNLE6JXL.js";import"./chunk-32VJ2RDH.js";import"./chunk-MMRDELHW.js";import"./chunk-J7FLFHQJ.js";import"./chunk-TMUK2DD3.js";export{c as decodeToPng,a as encode,d as encodeToBuffer,g as guessCrop,h as imageEngine,f as loadCropView,e as measureImage,b as writeAtomic};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
2
|
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
-
import{a,b,c,d,e}from"./chunk-
|
|
3
|
+
import{a,b,c,d,e}from"./chunk-SAWVMQAD.js";import"./chunk-MMRDELHW.js";import"./chunk-J7FLFHQJ.js";import"./chunk-TMUK2DD3.js";export{e as installUpdate,a as installedGlobally,c as npmBeside,d as npmCliBeside,b as runningScript};
|