@donotdev/core 0.0.16 → 0.0.17

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/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as v from 'valibot';
2
2
  import * as React$1 from 'react';
3
- import { ReactNode, ComponentType, ReactElement } from 'react';
3
+ import { ReactNode, ReactElement, ComponentType } from 'react';
4
4
  export { ReactNode } from 'react';
5
5
  import * as zustand from 'zustand';
6
6
  import { UseBoundStore, StoreApi as StoreApi$1 } from 'zustand';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@donotdev/core",
3
- "version": "0.0.16",
3
+ "version": "0.0.17",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -33,11 +33,6 @@
33
33
  "import": "./functions/index.js",
34
34
  "default": "./functions/index.js"
35
35
  },
36
- "./eslint": {
37
- "types": "./eslint/index.d.ts",
38
- "import": "./eslint/index.js",
39
- "default": "./eslint/index.js"
40
- },
41
36
  "./empty": {
42
37
  "import": "./empty.js",
43
38
  "default": "./empty.js"
@@ -52,7 +47,6 @@
52
47
  "vite",
53
48
  "next",
54
49
  "functions",
55
- "eslint",
56
50
  "i18n/locales"
57
51
  ],
58
52
  "sideEffects": false,
package/vite/index.js CHANGED
@@ -1,4 +1,4 @@
1
- var so=Object.create;var Yr=Object.defineProperty;var no=Object.getOwnPropertyDescriptor;var io=Object.getOwnPropertyNames;var oo=Object.getPrototypeOf,ao=Object.prototype.hasOwnProperty;var ie=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Qr=(e,t)=>()=>(e&&(t=e(e=0)),t);var q=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var lo=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of io(t))!ao.call(e,n)&&n!==r&&Yr(e,n,{get:()=>t[n],enumerable:!(s=no(t,n))||s.enumerable});return e};var co=(e,t,r)=>(r=e!=null?so(oo(e)):{},lo(t||!e||!e.__esModule?Yr(r,"default",{value:e,enumerable:!0}):r,e));function ts(e,t=null){let r=ke[e];if(!r)throw new Error(`Unknown pattern type: ${e}`);return t&&r.framework?{...r,framework:r.framework.map(s=>`${t}/${s}`)}:r}function Mt(e){return Zr[e]||Zr.base}var dr,ee,ve,ue,gr,Ge,Lt,ke,at,es,pr,mr,br,Zr,ge=Qr(()=>{"use strict";g();dr={HOMEPAGE_FILE:"HomePage.tsx",HOMEPAGE_PATH:"/",HOMEPAGE_COMPONENT:"HomePage"},ee={routes:"virtual:routes",themes:"virtual:themes",i18n:"virtual:i18n-mapping",assets:"virtual:assets",env:"virtual:env"},ve={routes:"routes",themes:"themes",i18n:"i18n",assets:"assets",env:"env"},ue={next:{middleware:"middleware.ts",routeManifest:"public/route-manifest.json",assetManifest:"public/asset-manifest.json",utilities:"src/styles/utilities.generated.css",appPages:"src/app",appLayout:"src/app/layout.tsx",configRoute:"src/config/dndev-config-route.js",configTheme:"src/config/dndev-config-theme.js",configI18n:"src/config/dndev-config-i18n.js",configPwa:"src/config/dndev-config-pwa.js",configAsset:"src/config/dndev-config-asset.js",configSeo:"src/config/dndev-config-seo.js",configServer:"src/config/dndev-config-server.js"},vite:{routeInspection:"src/routes.generated.log",themeInspection:"src/themes.generated.log",i18nInspection:"src/i18n.generated.log",assetInspection:"src/assets.generated.log",envInspection:"src/env.generated.log"},manifests:{route:"route-manifest.json",theme:"theme-manifest.json",i18n:"i18n-manifest.json",asset:"asset-manifest.json",feature:"feature-manifest.json",env:"env-manifest.json"}},gr={package:"@donotdev/ui",assetsPath:"packages/ui/assets",browserTargets:["> 1%","last 2 versions","Firefox ESR","not dead","not op_mini all"]},Ge={public:"public",fonts:"fonts",nodeModules:"node_modules",packages:"packages",core:"core",ui:"ui"},Lt={SOURCE_ROOT:"packages/core/i18n",SOURCE_LOCALES:"packages/core/i18n/locales",SOURCE_EAGER:"packages/core/i18n/locales/eager",SOURCE_LAZY:"packages/core/i18n/locales/lazy",PUBLISHED_ROOT:"i18n",PUBLISHED_LOCALES:"i18n/locales",PUBLISHED_EAGER:"i18n/locales/eager",PUBLISHED_LAZY:"i18n/locales/lazy"},ke={routes:{consumer:["src/**/*Page.tsx","src/pages/**/*Page.tsx"],exclude:["**/node_modules/**","**/dist/**","**/build/**","**/*.test.tsx","**/*.stories.tsx"],extensions:[".tsx"]},css:{consumer:["src/**/*.css"],themes:["src/**/*.css"],extensions:[".css",".scss",".sass"],framework:["packages/ui/src/**/*.css","packages/core/components/src/**/*.css","packages/core/templates/src/**/*.css"]},i18n:{eager:["src/locales/*_*.json"],lazy:["src/**/locales/*_*.json","!src/locales/*_*.json"],framework:{eager:[`${Lt.SOURCE_EAGER}/*_*.json`],lazy:[`${Lt.SOURCE_LAZY}/*_*.json`]},extensions:[".json"]},assets:{consumer:["public/**/*"],fallback:["manifest.json"],modern:["logo.svg","favicon.svg","apple-touch-icon.png","android-chrome-192x192.png","android-chrome-512x512.png"],patterns:["favicon.svg","favicon.ico","favicon-*.png","logo.svg","logo.png","logo.webp","logo.avif","apple-touch-icon*.png","android-chrome-*.png","manifest.json"],fonts:["fonts/**/*.woff2","fonts/**/*.woff","fonts/**/*.ttf"],framework:["packages/ui/assets/**/*"]},pwa:{consumer:["public/manifest.json","public/service-worker.js","public/sw.js","public/icon-192x192.png","public/icon-512x512.png","public/favicon.ico","public/favicon.svg","public/apple-touch-icon.png","public/logo.svg"],exclude:["**/node_modules/**","**/dist/**","**/build/**"],extensions:[".json",".js",".png",".svg",".ico"],framework:["packages/ui/assets/**/*"]},globalIgnore:["**/node_modules/**","**/dist/**","**/build/**","**/.git/**","**/coverage/**","**/test/**"]},at={mandatoryIncludes:["react","react-dom","react-router-dom","zustand","lucide-react","valibot","i18next","i18next-browser-languagedetector","i18next-http-backend","react-i18next","@tanstack/react-query","react-helmet-async","@donotdev/core","@donotdev/components","@donotdev/ui","@donotdev/templates","@donotdev/firebase"],optionalFeatures:["@donotdev/adv-comps","@donotdev/auth","@donotdev/billing","@donotdev/crud","@donotdev/oauth","shiki","@tiptap/react","@tiptap/starter-kit","@tiptap/extension-placeholder"],coreBundled:["@donotdev/types","@donotdev/utils","@donotdev/stores","@donotdev/schemas","@donotdev/hooks","@donotdev/i18n","@donotdev/config"],componentsBundled:["class-variance-authority","clsx","lucide-react","react-day-picker"],radixUIPattern:"@radix-ui/",buildTools:["esbuild","@esbuild/win32-x64","@esbuild/darwin-x64","@esbuild/linux-x64","@esbuild/darwin-arm64","@esbuild/linux-arm64","vite","rollup","rollup-plugin-visualizer","@vitejs/plugin-react","vite-tsconfig-paths","vite-plugin-pwa","vite-plugin-compression2","vite-plugin-node-polyfills","fsevents","postcss","postcss-import","postcss-nesting","autoprefixer"],buildTimePackages:[],largeOptional:["@sentry/react","framer-motion","stripe","@tanstack/react-query","shiki","@tiptap/react","@tiptap/starter-kit","@tiptap/extension-placeholder","sharp","semver","file-type"]},es=["firebase-admin","gcp-metadata","google-logging-utils","payload","undici","@fastify/busboy","image-size","@donotdev/tooling","fs","path","crypto","net","tls","http","https","child_process","os","util","stream","buffer","events","querystring","url","zlib","assert","constants","domain","punycode","string_decoder","timers","tty","vm","worker_threads","cluster","dgram","dns","http2","inspector","module","perf_hooks","process","readline","repl","trace_events","v8","wasi"],pr=["@donotdev/core/eslint","@donotdev/core/functions","@donotdev/core/server"],mr={selectors:{class:/\.([a-zA-Z0-9-]+)/g,variable:/--[a-zA-Z0-9-]+/g,keyframe:/@keyframes\s+([a-zA-Z0-9-]+)/g},themes:{themeClass:/(?::root\.|\.)([a-z][a-z0-9-]+)\s*\{([\s\S]*?)\}/gim,themeLabel:/--theme-label\s*:\s*['"]([^'"]+)['"]/,themeIcon:/--theme-icon\s*:\s*['"]([^'"]+)['"]/,themeIsDark:/--theme-is-dark\s*:\s*(0|1)/}},br=[{name:"light",displayName:"Light",icon:"Sun",isDark:!1}],Zr={base:{absolute:!0,onlyFiles:!0,ignore:ke.globalIgnore},css:{absolute:!0,onlyFiles:!0,ignore:[...ke.globalIgnore,"**/*.test.css"]},routes:{absolute:!0,onlyFiles:!0,ignore:[...ke.globalIgnore,"**/*.test.tsx","**/*.stories.tsx"]},i18n:{absolute:!0,onlyFiles:!0,ignore:ke.globalIgnore},assets:{absolute:!0,onlyFiles:!0,ignore:ke.globalIgnore}}});import{Buffer as v}from"node:buffer";import{createRequire as fo}from"node:module";import{dirname as ho,resolve as $f}from"node:path";import p from"node:process";import{fileURLToPath as go}from"node:url";var po,y,w,g=Qr(()=>{"use strict";po=fo(import.meta.url),y=go(import.meta.url),w=ho(y);typeof globalThis<"u"&&(globalThis.require=po,globalThis.__filename=y,globalThis.__dirname=w,globalThis.Buffer=v,globalThis.process=p,typeof global>"u"&&(globalThis.global=globalThis))});var Oe=q((Ph,ys)=>{g();var vs=e=>typeof e<"u"&&e!==null,Oo=e=>typeof e=="object",jo=e=>Object.prototype.toString.call(e)==="[object Object]",Lo=e=>typeof e=="function",Mo=e=>typeof e=="boolean",zo=e=>e instanceof v,Bo=e=>{if(vs(e))switch(e.constructor){case Uint8Array:case Uint8ClampedArray:case Int8Array:case Uint16Array:case Int16Array:case Uint32Array:case Int32Array:case Float32Array:case Float64Array:return!0}return!1},Uo=e=>e instanceof ArrayBuffer,Go=e=>typeof e=="string"&&e.length>0,qo=e=>typeof e=="number"&&!Number.isNaN(e),Wo=e=>Number.isInteger(e),Ho=(e,t,r)=>e>=t&&e<=r,Vo=(e,t)=>t.includes(e),Jo=(e,t,r)=>new Error(`Expected ${t} for ${e} but received ${r} of type ${typeof r}`),Xo=(e,t)=>(t.message=e.message,t);ys.exports={defined:vs,object:Oo,plainObject:jo,fn:Lo,bool:Mo,buffer:zo,typedArray:Bo,arrayBuffer:Uo,string:Go,number:qo,integer:Wo,inRange:Ho,inArray:Vo,invalidParameterError:Jo,nativeError:Xo}});var xs=q((Sh,Es)=>{"use strict";g();var ws=()=>p.platform==="linux",Ut=null,Ko=()=>{if(!Ut)if(ws()&&p.report){let e=p.report.excludeNetwork;p.report.excludeNetwork=!0,Ut=p.report.getReport(),p.report.excludeNetwork=e}else Ut={};return Ut};Es.exports={isLinux:ws,getReport:Ko}});var Rs=q((kh,Ps)=>{"use strict";g();var mt=ie("fs"),Yo="/usr/bin/ldd",Qo="/proc/self/exe",Gt=2048,Zo=e=>{let t=mt.openSync(e,"r"),r=v.alloc(Gt),s=mt.readSync(t,r,0,Gt,0);return mt.close(t,()=>{}),r.subarray(0,s)},ea=e=>new Promise((t,r)=>{mt.open(e,"r",(s,n)=>{if(s)r(s);else{let i=v.alloc(Gt);mt.read(n,i,0,Gt,0,(o,a)=>{t(i.subarray(0,a)),mt.close(n,()=>{})})}})});Ps.exports={LDD_PATH:Yo,SELF_PATH:Qo,readFileSync:Zo,readFile:ea}});var $s=q((_h,Ss)=>{"use strict";g();var ta=e=>{if(e.length<64||e.readUInt32BE(0)!==2135247942||e.readUInt8(4)!==2||e.readUInt8(5)!==1)return null;let t=e.readUInt32LE(32),r=e.readUInt16LE(54),s=e.readUInt16LE(56);for(let n=0;n<s;n++){let i=t+n*r;if(e.readUInt32LE(i)===3){let a=e.readUInt32LE(i+8),c=e.readUInt32LE(i+32);return e.subarray(a,a+c).toString().replace(/\0.*$/g,"")}}return null};Ss.exports={interpreterPath:ta}});var Wt=q((Ih,qs)=>{"use strict";g();var As=ie("child_process"),{isLinux:bt,getReport:_s}=xs(),{LDD_PATH:qt,SELF_PATH:Ns,readFile:yr,readFileSync:wr}=Rs(),{interpreterPath:Is}=$s(),je,Le,Me,Ts="getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",et="",Ds=()=>et||new Promise(e=>{As.exec(Ts,(t,r)=>{et=t?" ":r,e(et)})}),Cs=()=>{if(!et)try{et=As.execSync(Ts,{encoding:"utf8"})}catch{et=" "}return et},We="glibc",Fs=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,lt="musl",ra=e=>e.includes("libc.musl-")||e.includes("ld-musl-"),Os=()=>{let e=_s();return e.header&&e.header.glibcVersionRuntime?We:Array.isArray(e.sharedObjects)&&e.sharedObjects.some(ra)?lt:null},js=e=>{let[t,r]=e.split(/[\r\n]+/);return t&&t.includes(We)?We:r&&r.includes(lt)?lt:null},Ls=e=>{if(e){if(e.includes("/ld-musl-"))return lt;if(e.includes("/ld-linux-"))return We}return null},Ms=e=>(e=e.toString(),e.includes("musl")?lt:e.includes("GNU C Library")?We:null),sa=async()=>{if(Le!==void 0)return Le;Le=null;try{let e=await yr(qt);Le=Ms(e)}catch{}return Le},na=()=>{if(Le!==void 0)return Le;Le=null;try{let e=wr(qt);Le=Ms(e)}catch{}return Le},ia=async()=>{if(je!==void 0)return je;je=null;try{let e=await yr(Ns),t=Is(e);je=Ls(t)}catch{}return je},oa=()=>{if(je!==void 0)return je;je=null;try{let e=wr(Ns),t=Is(e);je=Ls(t)}catch{}return je},zs=async()=>{let e=null;if(bt()&&(e=await ia(),!e&&(e=await sa(),e||(e=Os()),!e))){let t=await Ds();e=js(t)}return e},Bs=()=>{let e=null;if(bt()&&(e=oa(),!e&&(e=na(),e||(e=Os()),!e))){let t=Cs();e=js(t)}return e},aa=async()=>bt()&&await zs()!==We,la=()=>bt()&&Bs()!==We,ca=async()=>{if(Me!==void 0)return Me;Me=null;try{let t=(await yr(qt)).match(Fs);t&&(Me=t[1])}catch{}return Me},ua=()=>{if(Me!==void 0)return Me;Me=null;try{let t=wr(qt).match(Fs);t&&(Me=t[1])}catch{}return Me},Us=()=>{let e=_s();return e.header&&e.header.glibcVersionRuntime?e.header.glibcVersionRuntime:null},ks=e=>e.trim().split(/\s+/)[1],Gs=e=>{let[t,r,s]=e.split(/[\r\n]+/);return t&&t.includes(We)?ks(t):r&&s&&r.includes(lt)?ks(s):null},fa=async()=>{let e=null;if(bt()&&(e=await ca(),e||(e=Us()),!e)){let t=await Ds();e=Gs(t)}return e},ha=()=>{let e=null;if(bt()&&(e=ua(),e||(e=Us()),!e)){let t=Cs();e=Gs(t)}return e};qs.exports={GLIBC:We,MUSL:lt,family:zs,familySync:Bs,isNonGlibcLinux:aa,isNonGlibcLinuxSync:la,version:fa,versionSync:ha}});var Nt=q((Dh,Ws)=>{"use strict";g();var da=typeof p=="object"&&p.env&&p.env.NODE_DEBUG&&/\bsemver\b/i.test(p.env.NODE_DEBUG)?(...e)=>{}:()=>{};Ws.exports=da});var Ht=q((Fh,Hs)=>{"use strict";g();var ga="2.0.0",pa=Number.MAX_SAFE_INTEGER||9007199254740991,ma=16,ba=250,va=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Hs.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:ma,MAX_SAFE_BUILD_LENGTH:ba,MAX_SAFE_INTEGER:pa,RELEASE_TYPES:va,SEMVER_SPEC_VERSION:ga,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var It=q((ze,Vs)=>{"use strict";g();var{MAX_SAFE_COMPONENT_LENGTH:Er,MAX_SAFE_BUILD_LENGTH:ya,MAX_LENGTH:wa}=Ht(),Ea=Nt();ze=Vs.exports={};var xa=ze.re=[],Pa=ze.safeRe=[],N=ze.src=[],Ra=ze.safeSrc=[],I=ze.t={},Sa=0,xr="[a-zA-Z0-9-]",$a=[["\\s",1],["\\d",wa],[xr,ya]],ka=e=>{for(let[t,r]of $a)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},B=(e,t,r)=>{let s=ka(t),n=Sa++;Ea(e,n,t),I[e]=n,N[n]=t,Ra[n]=s,xa[n]=new RegExp(t,r?"g":void 0),Pa[n]=new RegExp(s,r?"g":void 0)};B("NUMERICIDENTIFIER","0|[1-9]\\d*");B("NUMERICIDENTIFIERLOOSE","\\d+");B("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${xr}*`);B("MAINVERSION",`(${N[I.NUMERICIDENTIFIER]})\\.(${N[I.NUMERICIDENTIFIER]})\\.(${N[I.NUMERICIDENTIFIER]})`);B("MAINVERSIONLOOSE",`(${N[I.NUMERICIDENTIFIERLOOSE]})\\.(${N[I.NUMERICIDENTIFIERLOOSE]})\\.(${N[I.NUMERICIDENTIFIERLOOSE]})`);B("PRERELEASEIDENTIFIER",`(?:${N[I.NONNUMERICIDENTIFIER]}|${N[I.NUMERICIDENTIFIER]})`);B("PRERELEASEIDENTIFIERLOOSE",`(?:${N[I.NONNUMERICIDENTIFIER]}|${N[I.NUMERICIDENTIFIERLOOSE]})`);B("PRERELEASE",`(?:-(${N[I.PRERELEASEIDENTIFIER]}(?:\\.${N[I.PRERELEASEIDENTIFIER]})*))`);B("PRERELEASELOOSE",`(?:-?(${N[I.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${N[I.PRERELEASEIDENTIFIERLOOSE]})*))`);B("BUILDIDENTIFIER",`${xr}+`);B("BUILD",`(?:\\+(${N[I.BUILDIDENTIFIER]}(?:\\.${N[I.BUILDIDENTIFIER]})*))`);B("FULLPLAIN",`v?${N[I.MAINVERSION]}${N[I.PRERELEASE]}?${N[I.BUILD]}?`);B("FULL",`^${N[I.FULLPLAIN]}$`);B("LOOSEPLAIN",`[v=\\s]*${N[I.MAINVERSIONLOOSE]}${N[I.PRERELEASELOOSE]}?${N[I.BUILD]}?`);B("LOOSE",`^${N[I.LOOSEPLAIN]}$`);B("GTLT","((?:<|>)?=?)");B("XRANGEIDENTIFIERLOOSE",`${N[I.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);B("XRANGEIDENTIFIER",`${N[I.NUMERICIDENTIFIER]}|x|X|\\*`);B("XRANGEPLAIN",`[v=\\s]*(${N[I.XRANGEIDENTIFIER]})(?:\\.(${N[I.XRANGEIDENTIFIER]})(?:\\.(${N[I.XRANGEIDENTIFIER]})(?:${N[I.PRERELEASE]})?${N[I.BUILD]}?)?)?`);B("XRANGEPLAINLOOSE",`[v=\\s]*(${N[I.XRANGEIDENTIFIERLOOSE]})(?:\\.(${N[I.XRANGEIDENTIFIERLOOSE]})(?:\\.(${N[I.XRANGEIDENTIFIERLOOSE]})(?:${N[I.PRERELEASELOOSE]})?${N[I.BUILD]}?)?)?`);B("XRANGE",`^${N[I.GTLT]}\\s*${N[I.XRANGEPLAIN]}$`);B("XRANGELOOSE",`^${N[I.GTLT]}\\s*${N[I.XRANGEPLAINLOOSE]}$`);B("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Er}})(?:\\.(\\d{1,${Er}}))?(?:\\.(\\d{1,${Er}}))?`);B("COERCE",`${N[I.COERCEPLAIN]}(?:$|[^\\d])`);B("COERCEFULL",N[I.COERCEPLAIN]+`(?:${N[I.PRERELEASE]})?(?:${N[I.BUILD]})?(?:$|[^\\d])`);B("COERCERTL",N[I.COERCE],!0);B("COERCERTLFULL",N[I.COERCEFULL],!0);B("LONETILDE","(?:~>?)");B("TILDETRIM",`(\\s*)${N[I.LONETILDE]}\\s+`,!0);ze.tildeTrimReplace="$1~";B("TILDE",`^${N[I.LONETILDE]}${N[I.XRANGEPLAIN]}$`);B("TILDELOOSE",`^${N[I.LONETILDE]}${N[I.XRANGEPLAINLOOSE]}$`);B("LONECARET","(?:\\^)");B("CARETTRIM",`(\\s*)${N[I.LONECARET]}\\s+`,!0);ze.caretTrimReplace="$1^";B("CARET",`^${N[I.LONECARET]}${N[I.XRANGEPLAIN]}$`);B("CARETLOOSE",`^${N[I.LONECARET]}${N[I.XRANGEPLAINLOOSE]}$`);B("COMPARATORLOOSE",`^${N[I.GTLT]}\\s*(${N[I.LOOSEPLAIN]})$|^$`);B("COMPARATOR",`^${N[I.GTLT]}\\s*(${N[I.FULLPLAIN]})$|^$`);B("COMPARATORTRIM",`(\\s*)${N[I.GTLT]}\\s*(${N[I.LOOSEPLAIN]}|${N[I.XRANGEPLAIN]})`,!0);ze.comparatorTrimReplace="$1$2$3";B("HYPHENRANGE",`^\\s*(${N[I.XRANGEPLAIN]})\\s+-\\s+(${N[I.XRANGEPLAIN]})\\s*$`);B("HYPHENRANGELOOSE",`^\\s*(${N[I.XRANGEPLAINLOOSE]})\\s+-\\s+(${N[I.XRANGEPLAINLOOSE]})\\s*$`);B("STAR","(<|>)?=?\\s*\\*");B("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");B("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Vt=q((Lh,Js)=>{"use strict";g();var Aa=Object.freeze({loose:!0}),_a=Object.freeze({}),Na=e=>e?typeof e!="object"?Aa:e:_a;Js.exports=Na});var Qs=q((zh,Ys)=>{"use strict";g();var Xs=/^[0-9]+$/,Ks=(e,t)=>{if(typeof e=="number"&&typeof t=="number")return e===t?0:e<t?-1:1;let r=Xs.test(e),s=Xs.test(t);return r&&s&&(e=+e,t=+t),e===t?0:r&&!s?-1:s&&!r?1:e<t?-1:1},Ia=(e,t)=>Ks(t,e);Ys.exports={compareIdentifiers:Ks,rcompareIdentifiers:Ia}});var vt=q((Uh,en)=>{"use strict";g();var Jt=Nt(),{MAX_LENGTH:Zs,MAX_SAFE_INTEGER:Xt}=Ht(),{safeRe:Kt,t:Yt}=It(),Ta=Vt(),{compareIdentifiers:Pr}=Qs(),Rr=class e{constructor(t,r){if(r=Ta(r),t instanceof e){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>Zs)throw new TypeError(`version is longer than ${Zs} characters`);Jt("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let s=t.trim().match(r.loose?Kt[Yt.LOOSE]:Kt[Yt.FULL]);if(!s)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+s[1],this.minor=+s[2],this.patch=+s[3],this.major>Xt||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Xt||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Xt||this.patch<0)throw new TypeError("Invalid patch version");s[4]?this.prerelease=s[4].split(".").map(n=>{if(/^[0-9]+$/.test(n)){let i=+n;if(i>=0&&i<Xt)return i}return n}):this.prerelease=[],this.build=s[5]?s[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(Jt("SemVer.compare",this.version,this.options,t),!(t instanceof e)){if(typeof t=="string"&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:this.patch>t.patch?1:0}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let s=this.prerelease[r],n=t.prerelease[r];if(Jt("prerelease compare",r,s,n),s===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(s===void 0)return-1;if(s===n)continue;return Pr(s,n)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let s=this.build[r],n=t.build[r];if(Jt("build compare",r,s,n),s===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(s===void 0)return-1;if(s===n)continue;return Pr(s,n)}while(++r)}inc(t,r,s){if(t.startsWith("pre")){if(!r&&s===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let n=`-${r}`.match(this.options.loose?Kt[Yt.PRERELEASELOOSE]:Kt[Yt.PRERELEASE]);if(!n||n[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,s);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,s);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,s),this.inc("pre",r,s);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,s),this.inc("pre",r,s);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let n=Number(s)?1:0;if(this.prerelease.length===0)this.prerelease=[n];else{let i=this.prerelease.length;for(;--i>=0;)typeof this.prerelease[i]=="number"&&(this.prerelease[i]++,i=-2);if(i===-1){if(r===this.prerelease.join(".")&&s===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(n)}}if(r){let i=[r,n];s===!1&&(i=[r]),Pr(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};en.exports=Rr});var sn=q((qh,rn)=>{"use strict";g();var tn=vt(),Da=(e,t,r=!1)=>{if(e instanceof tn)return e;try{return new tn(e,t)}catch(s){if(!r)return null;throw s}};rn.exports=Da});var on=q((Hh,nn)=>{"use strict";g();var Ca=vt(),Fa=sn(),{safeRe:Qt,t:Zt}=It(),Oa=(e,t)=>{if(e instanceof Ca)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?Qt[Zt.COERCEFULL]:Qt[Zt.COERCE]);else{let c=t.includePrerelease?Qt[Zt.COERCERTLFULL]:Qt[Zt.COERCERTL],u;for(;(u=c.exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||u.index+u[0].length!==r.index+r[0].length)&&(r=u),c.lastIndex=u.index+u[1].length+u[2].length;c.lastIndex=-1}if(r===null)return null;let s=r[2],n=r[3]||"0",i=r[4]||"0",o=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return Fa(`${s}.${n}.${i}${o}${a}`,t)};nn.exports=Oa});var ct=q((Jh,ln)=>{"use strict";g();var an=vt(),ja=(e,t,r)=>new an(e,r).compare(new an(t,r));ln.exports=ja});var Sr=q((Kh,cn)=>{"use strict";g();var La=ct(),Ma=(e,t,r)=>La(e,t,r)>=0;cn.exports=Ma});var fn=q((Qh,un)=>{"use strict";g();var $r=class{constructor(){this.max=1e3,this.map=new Map}get(t){let r=this.map.get(t);if(r!==void 0)return this.map.delete(t),this.map.set(t,r),r}delete(t){return this.map.delete(t)}set(t,r){if(!this.delete(t)&&r!==void 0){if(this.map.size>=this.max){let n=this.map.keys().next().value;this.delete(n)}this.map.set(t,r)}return this}};un.exports=$r});var dn=q((ed,hn)=>{"use strict";g();var za=ct(),Ba=(e,t,r)=>za(e,t,r)===0;hn.exports=Ba});var pn=q((rd,gn)=>{"use strict";g();var Ua=ct(),Ga=(e,t,r)=>Ua(e,t,r)!==0;gn.exports=Ga});var bn=q((nd,mn)=>{"use strict";g();var qa=ct(),Wa=(e,t,r)=>qa(e,t,r)>0;mn.exports=Wa});var yn=q((od,vn)=>{"use strict";g();var Ha=ct(),Va=(e,t,r)=>Ha(e,t,r)<0;vn.exports=Va});var En=q((ld,wn)=>{"use strict";g();var Ja=ct(),Xa=(e,t,r)=>Ja(e,t,r)<=0;wn.exports=Xa});var Pn=q((ud,xn)=>{"use strict";g();var Ka=dn(),Ya=pn(),Qa=bn(),Za=Sr(),el=yn(),tl=En(),rl=(e,t,r,s)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return Ka(e,r,s);case"!=":return Ya(e,r,s);case">":return Qa(e,r,s);case">=":return Za(e,r,s);case"<":return el(e,r,s);case"<=":return tl(e,r,s);default:throw new TypeError(`Invalid operator: ${t}`)}};xn.exports=rl});var Nn=q((hd,_n)=>{"use strict";g();var Tt=Symbol("SemVer ANY"),_r=class e{static get ANY(){return Tt}constructor(t,r){if(r=Rn(r),t instanceof e){if(t.loose===!!r.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),Ar("comparator",t,r),this.options=r,this.loose=!!r.loose,this.parse(t),this.semver===Tt?this.value="":this.value=this.operator+this.semver.version,Ar("comp",this)}parse(t){let r=this.options.loose?Sn[$n.COMPARATORLOOSE]:Sn[$n.COMPARATOR],s=t.match(r);if(!s)throw new TypeError(`Invalid comparator: ${t}`);this.operator=s[1]!==void 0?s[1]:"",this.operator==="="&&(this.operator=""),s[2]?this.semver=new kn(s[2],this.options.loose):this.semver=Tt}toString(){return this.value}test(t){if(Ar("Comparator.test",t,this.options.loose),this.semver===Tt||t===Tt)return!0;if(typeof t=="string")try{t=new kn(t,this.options)}catch{return!1}return kr(t,this.operator,this.semver,this.options)}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new An(t.value,r).test(this.value):t.operator===""?t.value===""?!0:new An(this.value,r).test(t.semver):(r=Rn(r),r.includePrerelease&&(this.value==="<0.0.0-0"||t.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&t.operator.startsWith(">")||this.operator.startsWith("<")&&t.operator.startsWith("<")||this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")||kr(this.semver,"<",t.semver,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||kr(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}};_n.exports=_r;var Rn=Vt(),{safeRe:Sn,t:$n}=It(),kr=Pn(),Ar=Nt(),kn=vt(),An=Nr()});var Nr=q((gd,Cn)=>{"use strict";g();var sl=/\s+/g,Ir=class e{constructor(t,r){if(r=il(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof Tr)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().replace(sl," "),this.set=this.raw.split("||").map(s=>this.parseRange(s.trim())).filter(s=>s.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let s=this.set[0];if(this.set=this.set.filter(n=>!Tn(n[0])),this.set.length===0)this.set=[s];else if(this.set.length>1){for(let n of this.set)if(n.length===1&&hl(n[0])){this.set=[n];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let t=0;t<this.set.length;t++){t>0&&(this.formatted+="||");let r=this.set[t];for(let s=0;s<r.length;s++)s>0&&(this.formatted+=" "),this.formatted+=r[s].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(t){let s=((this.options.includePrerelease&&ul)|(this.options.loose&&fl))+":"+t,n=In.get(s);if(n)return n;let i=this.options.loose,o=i?we[be.HYPHENRANGELOOSE]:we[be.HYPHENRANGE];t=t.replace(o,xl(this.options.includePrerelease)),te("hyphen replace",t),t=t.replace(we[be.COMPARATORTRIM],al),te("comparator trim",t),t=t.replace(we[be.TILDETRIM],ll),te("tilde trim",t),t=t.replace(we[be.CARETTRIM],cl),te("caret trim",t);let a=t.split(" ").map(b=>dl(b,this.options)).join(" ").split(/\s+/).map(b=>El(b,this.options));i&&(a=a.filter(b=>(te("loose invalid filter",b,this.options),!!b.match(we[be.COMPARATORLOOSE])))),te("range list",a);let c=new Map,u=a.map(b=>new Tr(b,this.options));for(let b of u){if(Tn(b))return[b];c.set(b.value,b)}c.size>1&&c.has("")&&c.delete("");let f=[...c.values()];return In.set(s,f),f}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some(s=>Dn(s,r)&&t.set.some(n=>Dn(n,r)&&s.every(i=>n.every(o=>i.intersects(o,r)))))}test(t){if(!t)return!1;if(typeof t=="string")try{t=new ol(t,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(Pl(this.set[r],t,this.options))return!0;return!1}};Cn.exports=Ir;var nl=fn(),In=new nl,il=Vt(),Tr=Nn(),te=Nt(),ol=vt(),{safeRe:we,t:be,comparatorTrimReplace:al,tildeTrimReplace:ll,caretTrimReplace:cl}=It(),{FLAG_INCLUDE_PRERELEASE:ul,FLAG_LOOSE:fl}=Ht(),Tn=e=>e.value==="<0.0.0-0",hl=e=>e.value==="",Dn=(e,t)=>{let r=!0,s=e.slice(),n=s.pop();for(;r&&s.length;)r=s.every(i=>n.intersects(i,t)),n=s.pop();return r},dl=(e,t)=>(e=e.replace(we[be.BUILD],""),te("comp",e,t),e=ml(e,t),te("caret",e),e=gl(e,t),te("tildes",e),e=vl(e,t),te("xrange",e),e=wl(e,t),te("stars",e),e),Ee=e=>!e||e.toLowerCase()==="x"||e==="*",gl=(e,t)=>e.trim().split(/\s+/).map(r=>pl(r,t)).join(" "),pl=(e,t)=>{let r=t.loose?we[be.TILDELOOSE]:we[be.TILDE];return e.replace(r,(s,n,i,o,a)=>{te("tilde",e,s,n,i,o,a);let c;return Ee(n)?c="":Ee(i)?c=`>=${n}.0.0 <${+n+1}.0.0-0`:Ee(o)?c=`>=${n}.${i}.0 <${n}.${+i+1}.0-0`:a?(te("replaceTilde pr",a),c=`>=${n}.${i}.${o}-${a} <${n}.${+i+1}.0-0`):c=`>=${n}.${i}.${o} <${n}.${+i+1}.0-0`,te("tilde return",c),c})},ml=(e,t)=>e.trim().split(/\s+/).map(r=>bl(r,t)).join(" "),bl=(e,t)=>{te("caret",e,t);let r=t.loose?we[be.CARETLOOSE]:we[be.CARET],s=t.includePrerelease?"-0":"";return e.replace(r,(n,i,o,a,c)=>{te("caret",e,n,i,o,a,c);let u;return Ee(i)?u="":Ee(o)?u=`>=${i}.0.0${s} <${+i+1}.0.0-0`:Ee(a)?i==="0"?u=`>=${i}.${o}.0${s} <${i}.${+o+1}.0-0`:u=`>=${i}.${o}.0${s} <${+i+1}.0.0-0`:c?(te("replaceCaret pr",c),i==="0"?o==="0"?u=`>=${i}.${o}.${a}-${c} <${i}.${o}.${+a+1}-0`:u=`>=${i}.${o}.${a}-${c} <${i}.${+o+1}.0-0`:u=`>=${i}.${o}.${a}-${c} <${+i+1}.0.0-0`):(te("no pr"),i==="0"?o==="0"?u=`>=${i}.${o}.${a}${s} <${i}.${o}.${+a+1}-0`:u=`>=${i}.${o}.${a}${s} <${i}.${+o+1}.0-0`:u=`>=${i}.${o}.${a} <${+i+1}.0.0-0`),te("caret return",u),u})},vl=(e,t)=>(te("replaceXRanges",e,t),e.split(/\s+/).map(r=>yl(r,t)).join(" ")),yl=(e,t)=>{e=e.trim();let r=t.loose?we[be.XRANGELOOSE]:we[be.XRANGE];return e.replace(r,(s,n,i,o,a,c)=>{te("xRange",e,s,n,i,o,a,c);let u=Ee(i),f=u||Ee(o),b=f||Ee(a),m=b;return n==="="&&m&&(n=""),c=t.includePrerelease?"-0":"",u?n===">"||n==="<"?s="<0.0.0-0":s="*":n&&m?(f&&(o=0),a=0,n===">"?(n=">=",f?(i=+i+1,o=0,a=0):(o=+o+1,a=0)):n==="<="&&(n="<",f?i=+i+1:o=+o+1),n==="<"&&(c="-0"),s=`${n+i}.${o}.${a}${c}`):f?s=`>=${i}.0.0${c} <${+i+1}.0.0-0`:b&&(s=`>=${i}.${o}.0${c} <${i}.${+o+1}.0-0`),te("xRange return",s),s})},wl=(e,t)=>(te("replaceStars",e,t),e.trim().replace(we[be.STAR],"")),El=(e,t)=>(te("replaceGTE0",e,t),e.trim().replace(we[t.includePrerelease?be.GTE0PRE:be.GTE0],"")),xl=e=>(t,r,s,n,i,o,a,c,u,f,b,m)=>(Ee(s)?r="":Ee(n)?r=`>=${s}.0.0${e?"-0":""}`:Ee(i)?r=`>=${s}.${n}.0${e?"-0":""}`:o?r=`>=${r}`:r=`>=${r}${e?"-0":""}`,Ee(u)?c="":Ee(f)?c=`<${+u+1}.0.0-0`:Ee(b)?c=`<${u}.${+f+1}.0-0`:m?c=`<=${u}.${f}.${b}-${m}`:e?c=`<${u}.${f}.${+b+1}-0`:c=`<=${c}`,`${r} ${c}`.trim()),Pl=(e,t,r)=>{for(let s=0;s<e.length;s++)if(!e[s].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let s=0;s<e.length;s++)if(te(e[s].semver),e[s].semver!==Tr.ANY&&e[s].semver.prerelease.length>0){let n=e[s].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0}});var On=q((md,Fn)=>{"use strict";g();var Rl=Nr(),Sl=(e,t,r)=>{try{t=new Rl(t,r)}catch{return!1}return t.test(e)};Fn.exports=Sl});var Dr=q((vd,$l)=>{$l.exports={name:"sharp",description:"High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images",version:"0.34.5",author:"Lovell Fuller <npm@lovell.info>",homepage:"https://sharp.pixelplumbing.com",contributors:["Pierre Inglebert <pierre.inglebert@gmail.com>","Jonathan Ong <jonathanrichardong@gmail.com>","Chanon Sajjamanochai <chanon.s@gmail.com>","Juliano Julio <julianojulio@gmail.com>","Daniel Gasienica <daniel@gasienica.ch>","Julian Walker <julian@fiftythree.com>","Amit Pitaru <pitaru.amit@gmail.com>","Brandon Aaron <hello.brandon@aaron.sh>","Andreas Lind <andreas@one.com>","Maurus Cuelenaere <mcuelenaere@gmail.com>","Linus Unneb\xE4ck <linus@folkdatorn.se>","Victor Mateevitsi <mvictoras@gmail.com>","Alaric Holloway <alaric.holloway@gmail.com>","Bernhard K. Weisshuhn <bkw@codingforce.com>","Chris Riley <criley@primedia.com>","David Carley <dacarley@gmail.com>","John Tobin <john@limelightmobileinc.com>","Kenton Gray <kentongray@gmail.com>","Felix B\xFCnemann <Felix.Buenemann@gmail.com>","Samy Al Zahrani <samyalzahrany@gmail.com>","Chintan Thakkar <lemnisk8@gmail.com>","F. Orlando Galashan <frulo@gmx.de>","Kleis Auke Wolthuizen <info@kleisauke.nl>","Matt Hirsch <mhirsch@media.mit.edu>","Matthias Thoemmes <thoemmes@gmail.com>","Patrick Paskaris <patrick@paskaris.gr>","J\xE9r\xE9my Lal <kapouer@melix.org>","Rahul Nanwani <r.nanwani@gmail.com>","Alice Monday <alice0meta@gmail.com>","Kristo Jorgenson <kristo.jorgenson@gmail.com>","YvesBos <yves_bos@outlook.com>","Guy Maliar <guy@tailorbrands.com>","Nicolas Coden <nicolas@ncoden.fr>","Matt Parrish <matt.r.parrish@gmail.com>","Marcel Bretschneider <marcel.bretschneider@gmail.com>","Matthew McEachen <matthew+github@mceachen.org>","Jarda Kot\u011B\u0161ovec <jarda.kotesovec@gmail.com>","Kenric D'Souza <kenric.dsouza@gmail.com>","Oleh Aleinyk <oleg.aleynik@gmail.com>","Marcel Bretschneider <marcel.bretschneider@gmail.com>","Andrea Bianco <andrea.bianco@unibas.ch>","Rik Heywood <rik@rik.org>","Thomas Parisot <hi@oncletom.io>","Nathan Graves <nathanrgraves+github@gmail.com>","Tom Lokhorst <tom@lokhorst.eu>","Espen Hovlandsdal <espen@hovlandsdal.com>","Sylvain Dumont <sylvain.dumont35@gmail.com>","Alun Davies <alun.owain.davies@googlemail.com>","Aidan Hoolachan <ajhoolachan21@gmail.com>","Axel Eirola <axel.eirola@iki.fi>","Freezy <freezy@xbmc.org>","Daiz <taneli.vatanen@gmail.com>","Julian Aubourg <j@ubourg.net>","Keith Belovay <keith@picthrive.com>","Michael B. Klein <mbklein@gmail.com>","Jordan Prudhomme <jordan@raboland.fr>","Ilya Ovdin <iovdin@gmail.com>","Andargor <andargor@yahoo.com>","Paul Neave <paul.neave@gmail.com>","Brendan Kennedy <brenwken@gmail.com>","Brychan Bennett-Odlum <git@brychan.io>","Edward Silverton <e.silverton@gmail.com>","Roman Malieiev <aromaleev@gmail.com>","Tomas Szabo <tomas.szabo@deftomat.com>","Robert O'Rourke <robert@o-rourke.org>","Guillermo Alfonso Varela Chouci\xF1o <guillevch@gmail.com>","Christian Flintrup <chr@gigahost.dk>","Manan Jadhav <manan@motionden.com>","Leon Radley <leon@radley.se>","alza54 <alza54@thiocod.in>","Jacob Smith <jacob@frende.me>","Michael Nutt <michael@nutt.im>","Brad Parham <baparham@gmail.com>","Taneli Vatanen <taneli.vatanen@gmail.com>","Joris Dugu\xE9 <zaruike10@gmail.com>","Chris Banks <christopher.bradley.banks@gmail.com>","Ompal Singh <ompal.hitm09@gmail.com>","Brodan <christopher.hranj@gmail.com>","Ankur Parihar <ankur.github@gmail.com>","Brahim Ait elhaj <brahima@gmail.com>","Mart Jansink <m.jansink@gmail.com>","Lachlan Newman <lachnewman007@gmail.com>","Dennis Beatty <dennis@dcbeatty.com>","Ingvar Stepanyan <me@rreverser.com>","Don Denton <don@happycollision.com>"],scripts:{build:"node install/build.js",install:"node install/check.js || npm run build",clean:"rm -rf src/build/ .nyc_output/ coverage/ test/fixtures/output.*",test:"npm run lint && npm run test-unit",lint:"npm run lint-cpp && npm run lint-js && npm run lint-types","lint-cpp":"cpplint --quiet src/*.h src/*.cc","lint-js":"biome lint","lint-types":"tsd --files ./test/types/sharp.test-d.ts","test-leak":"./test/leak/leak.sh","test-unit":"node --experimental-test-coverage test/unit.mjs","package-from-local-build":"node npm/from-local-build.js","package-release-notes":"node npm/release-notes.js","docs-build":"node docs/build.mjs","docs-serve":"cd docs && npm start","docs-publish":"cd docs && npm run build && npx firebase-tools deploy --project pixelplumbing --only hosting:pixelplumbing-sharp"},type:"commonjs",main:"lib/index.js",types:"lib/index.d.ts",files:["install","lib","src/*.{cc,h,gyp}"],repository:{type:"git",url:"git://github.com/lovell/sharp.git"},keywords:["jpeg","png","webp","avif","tiff","gif","svg","jp2","dzi","image","resize","thumbnail","crop","embed","libvips","vips"],dependencies:{"@img/colour":"^1.0.0","detect-libc":"^2.1.2",semver:"^7.7.3"},optionalDependencies:{"@img/sharp-darwin-arm64":"0.34.5","@img/sharp-darwin-x64":"0.34.5","@img/sharp-libvips-darwin-arm64":"1.2.4","@img/sharp-libvips-darwin-x64":"1.2.4","@img/sharp-libvips-linux-arm":"1.2.4","@img/sharp-libvips-linux-arm64":"1.2.4","@img/sharp-libvips-linux-ppc64":"1.2.4","@img/sharp-libvips-linux-riscv64":"1.2.4","@img/sharp-libvips-linux-s390x":"1.2.4","@img/sharp-libvips-linux-x64":"1.2.4","@img/sharp-libvips-linuxmusl-arm64":"1.2.4","@img/sharp-libvips-linuxmusl-x64":"1.2.4","@img/sharp-linux-arm":"0.34.5","@img/sharp-linux-arm64":"0.34.5","@img/sharp-linux-ppc64":"0.34.5","@img/sharp-linux-riscv64":"0.34.5","@img/sharp-linux-s390x":"0.34.5","@img/sharp-linux-x64":"0.34.5","@img/sharp-linuxmusl-arm64":"0.34.5","@img/sharp-linuxmusl-x64":"0.34.5","@img/sharp-wasm32":"0.34.5","@img/sharp-win32-arm64":"0.34.5","@img/sharp-win32-ia32":"0.34.5","@img/sharp-win32-x64":"0.34.5"},devDependencies:{"@biomejs/biome":"^2.3.4","@cpplint/cli":"^0.1.0","@emnapi/runtime":"^1.7.0","@img/sharp-libvips-dev":"1.2.4","@img/sharp-libvips-dev-wasm32":"1.2.4","@img/sharp-libvips-win32-arm64":"1.2.4","@img/sharp-libvips-win32-ia32":"1.2.4","@img/sharp-libvips-win32-x64":"1.2.4","@types/node":"*",emnapi:"^1.7.0","exif-reader":"^2.0.2","extract-zip":"^2.0.1",icc:"^3.0.0","jsdoc-to-markdown":"^9.1.3","node-addon-api":"^8.5.0","node-gyp":"^11.5.0","tar-fs":"^3.1.1",tsd:"^0.33.0"},license:"Apache-2.0",engines:{node:"^18.17.0 || ^20.3.0 || >=21.0.0"},config:{libvips:">=8.17.3"},funding:{url:"https://opencollective.com/libvips"}}});var Fr=q((yd,Hn)=>{g();var{spawnSync:er}=ie("node:child_process"),{createHash:kl}=ie("node:crypto"),zn=on(),Al=Sr(),_l=On(),jn=Wt(),{config:Nl,engines:Ln,optionalDependencies:Il}=Dr(),Tl=p.env.npm_package_config_libvips||Nl.libvips,Bn=zn(Tl).version,Dl=["darwin-arm64","darwin-x64","linux-arm","linux-arm64","linux-ppc64","linux-riscv64","linux-s390x","linux-x64","linuxmusl-arm64","linuxmusl-x64","win32-arm64","win32-ia32","win32-x64"],tr={encoding:"utf8",shell:!0},Cl=e=>{e instanceof Error},Un=()=>jn.isNonGlibcLinuxSync()?jn.familySync():"",Fl=()=>`${p.platform}${Un()}-${p.arch}`,yt=()=>{if(Gn())return"wasm32";let{npm_config_arch:e,npm_config_platform:t,npm_config_libc:r}=p.env,s=typeof r=="string"?r:Un();return`${t||p.platform}${s}-${e||p.arch}`},Ol=()=>{try{return ie(`@img/sharp-libvips-dev-${yt()}/include`)}catch{try{return ie("@img/sharp-libvips-dev/include")}catch{}}return""},jl=()=>{try{return ie("@img/sharp-libvips-dev/cplusplus")}catch{}return""},Ll=()=>{try{return ie(`@img/sharp-libvips-dev-${yt()}/lib`)}catch{try{return ie(`@img/sharp-libvips-${yt()}/lib`)}catch{}}return""},Ml=()=>{if(p.release?.name==="node"&&p.versions&&!_l(p.versions.node,Ln.node))return{found:p.versions.node,expected:Ln.node}},Gn=()=>{let{CC:e}=p.env;return!!e?.endsWith("/emcc")},zl=()=>p.platform==="darwin"&&p.arch==="x64"?(er("sysctl sysctl.proc_translated",tr).stdout||"").trim()==="sysctl.proc_translated: 1":!1,Mn=e=>kl("sha512").update(e).digest("hex"),Bl=()=>{try{let e=Mn(`imgsharp-libvips-${yt()}`),t=zn(Il[`@img/sharp-libvips-${yt()}`],{includePrerelease:!0}).version;return Mn(`${e}npm:${t}`).slice(0,10)}catch{}return""},Ul=()=>er(`node-gyp rebuild --directory=src ${Gn()?"--nodedir=emscripten":""}`,{...tr,stdio:"inherit"}).status,qn=()=>p.platform!=="win32"?(er("pkg-config --modversion vips-cpp",{...tr,env:{...p.env,PKG_CONFIG_PATH:Wn()}}).stdout||"").trim():"",Wn=()=>p.platform!=="win32"?[(er('which brew >/dev/null 2>&1 && brew environment --plain | grep PKG_CONFIG_LIBDIR | cut -d" " -f2',tr).stdout||"").trim(),p.env.PKG_CONFIG_PATH,"/usr/local/lib/pkgconfig","/usr/lib/pkgconfig","/usr/local/libdata/pkgconfig","/usr/libdata/pkgconfig"].filter(Boolean).join(":"):"",Cr=(e,t,r)=>(r&&r(`Detected ${t}, skipping search for globally-installed libvips`),e),Gl=e=>{if(p.env.SHARP_IGNORE_GLOBAL_LIBVIPS)return Cr(!1,"SHARP_IGNORE_GLOBAL_LIBVIPS",e);if(p.env.SHARP_FORCE_GLOBAL_LIBVIPS)return Cr(!0,"SHARP_FORCE_GLOBAL_LIBVIPS",e);if(zl())return Cr(!1,"Rosetta",e);let t=qn();return!!t&&Al(t,Bn)};Hn.exports={minimumLibvipsVersion:Bn,prebuiltPlatforms:Dl,buildPlatformArch:yt,buildSharpLibvipsIncludeDir:Ol,buildSharpLibvipsCPlusPlusDir:jl,buildSharpLibvipsLibDir:Ll,isUnsupportedNodeRuntime:Ml,runtimePlatformArch:Fl,log:Cl,yarnLocator:Bl,spawnRebuild:Ul,globalLibvipsVersion:qn,pkgConfigPath:Wn,useGlobalLibvips:Gl}});var Ct=q((xd,Jn)=>{g();var{familySync:ql,versionSync:Wl}=Wt(),{runtimePlatformArch:Hl,isUnsupportedNodeRuntime:Vn,prebuiltPlatforms:Vl,minimumLibvipsVersion:Jl}=Fr(),ut=Hl(),Xl=[`../src/build/Release/sharp-${ut}.node`,"../src/build/Release/sharp-wasm32.node",`@img/sharp-${ut}/sharp.node`,"@img/sharp-wasm32/sharp.node"],Or,wt,Dt=[];for(Or of Xl)try{wt=ie(Or);break}catch(e){Dt.push(e)}if(wt&&Or.startsWith("@img/sharp-linux-x64")&&!wt._isUsingX64V2()){let e=new Error("Prebuilt binaries for linux-x64 require v2 microarchitecture");e.code="Unsupported CPU",Dt.push(e),wt=null}if(wt)Jn.exports=wt;else{let[e,t,r]=["linux","darwin","win32"].map(i=>ut.startsWith(i)),s=[`Could not load the "sharp" module using the ${ut} runtime`];Dt.forEach(i=>{i.code!=="MODULE_NOT_FOUND"&&s.push(`${i.code}: ${i.message}`)});let n=Dt.map(i=>i.message).join(" ");if(s.push("Possible solutions:"),Vn()){let{found:i,expected:o}=Vn();s.push("- Please upgrade Node.js:",` Found ${i}`,` Requires ${o}`)}else if(Vl.includes(ut)){let[i,o]=ut.split("-"),a=i.endsWith("musl")?" --libc=musl":"";s.push("- Ensure optional dependencies can be installed:"," npm install --include=optional sharp","- Ensure your package manager supports multi-platform installation:"," See https://sharp.pixelplumbing.com/install#cross-platform","- Add platform-specific dependencies:",` npm install --os=${i.replace("musl","")}${a} --cpu=${o} sharp`)}else s.push(`- Manually install libvips >= ${Jl}`,"- Add experimental WebAssembly-based dependencies:"," npm install --cpu=wasm32 sharp"," npm install @img/sharp-wasm32");if(e&&/(symbol not found|CXXABI_)/i.test(n))try{let{config:i}=ie(`@img/sharp-libvips-${ut}/package`),o=`${ql()} ${Wl()}`,a=`${i.musl?"musl":"glibc"} ${i.musl||i.glibc}`;s.push("- Update your OS:",` Found ${o}`,` Requires ${a}`)}catch{}throw e&&/\/snap\/core[0-9]{2}/.test(n)&&s.push("- Remove the Node.js Snap, which does not support native modules"," snap remove node"),t&&/Incompatible library version/.test(n)&&s.push("- Update Homebrew:"," brew update && brew upgrade vips"),Dt.some(i=>i.code==="ERR_DLOPEN_DISABLED")&&s.push("- Run Node.js without using the --no-addons flag"),r&&/The specified procedure could not be found/.test(n)&&s.push("- Using the canvas package on Windows?"," See https://sharp.pixelplumbing.com/install#canvas-and-windows","- Check for outdated versions of sharp in the dependency tree:"," npm ls sharp"),s.push("- Consult the installation documentation:"," See https://sharp.pixelplumbing.com/install"),new Error(s.join(`
1
+ var so=Object.create;var Yr=Object.defineProperty;var no=Object.getOwnPropertyDescriptor;var io=Object.getOwnPropertyNames;var oo=Object.getPrototypeOf,ao=Object.prototype.hasOwnProperty;var ie=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Qr=(e,t)=>()=>(e&&(t=e(e=0)),t);var q=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var lo=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of io(t))!ao.call(e,n)&&n!==r&&Yr(e,n,{get:()=>t[n],enumerable:!(s=no(t,n))||s.enumerable});return e};var co=(e,t,r)=>(r=e!=null?so(oo(e)):{},lo(t||!e||!e.__esModule?Yr(r,"default",{value:e,enumerable:!0}):r,e));function ts(e,t=null){let r=ke[e];if(!r)throw new Error(`Unknown pattern type: ${e}`);return t&&r.framework?{...r,framework:r.framework.map(s=>`${t}/${s}`)}:r}function Mt(e){return Zr[e]||Zr.base}var dr,ee,ve,ue,gr,Ge,Lt,ke,at,es,pr,mr,br,Zr,ge=Qr(()=>{"use strict";g();dr={HOMEPAGE_FILE:"HomePage.tsx",HOMEPAGE_PATH:"/",HOMEPAGE_COMPONENT:"HomePage"},ee={routes:"virtual:routes",themes:"virtual:themes",i18n:"virtual:i18n-mapping",assets:"virtual:assets",env:"virtual:env"},ve={routes:"routes",themes:"themes",i18n:"i18n",assets:"assets",env:"env"},ue={next:{middleware:"middleware.ts",routeManifest:"public/route-manifest.json",assetManifest:"public/asset-manifest.json",utilities:"src/styles/utilities.generated.css",appPages:"src/app",appLayout:"src/app/layout.tsx",configRoute:"src/config/dndev-config-route.js",configTheme:"src/config/dndev-config-theme.js",configI18n:"src/config/dndev-config-i18n.js",configPwa:"src/config/dndev-config-pwa.js",configAsset:"src/config/dndev-config-asset.js",configSeo:"src/config/dndev-config-seo.js",configServer:"src/config/dndev-config-server.js"},vite:{routeInspection:"src/routes.generated.log",themeInspection:"src/themes.generated.log",i18nInspection:"src/i18n.generated.log",assetInspection:"src/assets.generated.log",envInspection:"src/env.generated.log"},manifests:{route:"route-manifest.json",theme:"theme-manifest.json",i18n:"i18n-manifest.json",asset:"asset-manifest.json",feature:"feature-manifest.json",env:"env-manifest.json"}},gr={package:"@donotdev/ui",assetsPath:"packages/ui/assets",browserTargets:["> 1%","last 2 versions","Firefox ESR","not dead","not op_mini all"]},Ge={public:"public",fonts:"fonts",nodeModules:"node_modules",packages:"packages",core:"core",ui:"ui"},Lt={SOURCE_ROOT:"packages/core/i18n",SOURCE_LOCALES:"packages/core/i18n/locales",SOURCE_EAGER:"packages/core/i18n/locales/eager",SOURCE_LAZY:"packages/core/i18n/locales/lazy",PUBLISHED_ROOT:"i18n",PUBLISHED_LOCALES:"i18n/locales",PUBLISHED_EAGER:"i18n/locales/eager",PUBLISHED_LAZY:"i18n/locales/lazy"},ke={routes:{consumer:["src/**/*Page.tsx","src/pages/**/*Page.tsx"],exclude:["**/node_modules/**","**/dist/**","**/build/**","**/*.test.tsx","**/*.stories.tsx"],extensions:[".tsx"]},css:{consumer:["src/**/*.css"],themes:["src/**/*.css"],extensions:[".css",".scss",".sass"],framework:["packages/ui/src/**/*.css","packages/core/components/src/**/*.css","packages/core/templates/src/**/*.css"]},i18n:{eager:["src/locales/*_*.json"],lazy:["src/**/locales/*_*.json","!src/locales/*_*.json"],framework:{eager:[`${Lt.SOURCE_EAGER}/*_*.json`],lazy:[`${Lt.SOURCE_LAZY}/*_*.json`]},extensions:[".json"]},assets:{consumer:["public/**/*"],fallback:["manifest.json"],modern:["logo.svg","favicon.svg","apple-touch-icon.png","android-chrome-192x192.png","android-chrome-512x512.png"],patterns:["favicon.svg","favicon.ico","favicon-*.png","logo.svg","logo.png","logo.webp","logo.avif","apple-touch-icon*.png","android-chrome-*.png","manifest.json"],fonts:["fonts/**/*.woff2","fonts/**/*.woff","fonts/**/*.ttf"],framework:["packages/ui/assets/**/*"]},pwa:{consumer:["public/manifest.json","public/service-worker.js","public/sw.js","public/icon-192x192.png","public/icon-512x512.png","public/favicon.ico","public/favicon.svg","public/apple-touch-icon.png","public/logo.svg"],exclude:["**/node_modules/**","**/dist/**","**/build/**"],extensions:[".json",".js",".png",".svg",".ico"],framework:["packages/ui/assets/**/*"]},globalIgnore:["**/node_modules/**","**/dist/**","**/build/**","**/.git/**","**/coverage/**","**/test/**"]},at={mandatoryIncludes:["react","react-dom","react-router-dom","zustand","lucide-react","valibot","i18next","i18next-browser-languagedetector","i18next-http-backend","react-i18next","@tanstack/react-query","react-helmet-async","@donotdev/core","@donotdev/components","@donotdev/ui","@donotdev/templates","@donotdev/firebase"],optionalFeatures:["@donotdev/adv-comps","@donotdev/auth","@donotdev/billing","@donotdev/crud","@donotdev/oauth","shiki","@tiptap/react","@tiptap/starter-kit","@tiptap/extension-placeholder"],coreBundled:["@donotdev/types","@donotdev/utils","@donotdev/stores","@donotdev/schemas","@donotdev/hooks","@donotdev/i18n","@donotdev/config"],componentsBundled:["class-variance-authority","clsx","lucide-react","react-day-picker"],radixUIPattern:"@radix-ui/",buildTools:["esbuild","@esbuild/win32-x64","@esbuild/darwin-x64","@esbuild/linux-x64","@esbuild/darwin-arm64","@esbuild/linux-arm64","vite","rollup","rollup-plugin-visualizer","@vitejs/plugin-react","vite-tsconfig-paths","vite-plugin-pwa","vite-plugin-compression2","vite-plugin-node-polyfills","fsevents","postcss","postcss-import","postcss-nesting","autoprefixer"],buildTimePackages:[],largeOptional:["@sentry/react","framer-motion","stripe","@tanstack/react-query","shiki","@tiptap/react","@tiptap/starter-kit","@tiptap/extension-placeholder","sharp","semver","file-type"]},es=["firebase-admin","gcp-metadata","google-logging-utils","payload","undici","@fastify/busboy","image-size","@donotdev/tooling","fs","path","crypto","net","tls","http","https","child_process","os","util","stream","buffer","events","querystring","url","zlib","assert","constants","domain","punycode","string_decoder","timers","tty","vm","worker_threads","cluster","dgram","dns","http2","inspector","module","perf_hooks","process","readline","repl","trace_events","v8","wasi"],pr=["@donotdev/core/functions","@donotdev/core/server"],mr={selectors:{class:/\.([a-zA-Z0-9-]+)/g,variable:/--[a-zA-Z0-9-]+/g,keyframe:/@keyframes\s+([a-zA-Z0-9-]+)/g},themes:{themeClass:/(?::root\.|\.)([a-z][a-z0-9-]+)\s*\{([\s\S]*?)\}/gim,themeLabel:/--theme-label\s*:\s*['"]([^'"]+)['"]/,themeIcon:/--theme-icon\s*:\s*['"]([^'"]+)['"]/,themeIsDark:/--theme-is-dark\s*:\s*(0|1)/}},br=[{name:"light",displayName:"Light",icon:"Sun",isDark:!1}],Zr={base:{absolute:!0,onlyFiles:!0,ignore:ke.globalIgnore},css:{absolute:!0,onlyFiles:!0,ignore:[...ke.globalIgnore,"**/*.test.css"]},routes:{absolute:!0,onlyFiles:!0,ignore:[...ke.globalIgnore,"**/*.test.tsx","**/*.stories.tsx"]},i18n:{absolute:!0,onlyFiles:!0,ignore:ke.globalIgnore},assets:{absolute:!0,onlyFiles:!0,ignore:ke.globalIgnore}}});import{Buffer as v}from"node:buffer";import{createRequire as fo}from"node:module";import{dirname as ho,resolve as $f}from"node:path";import p from"node:process";import{fileURLToPath as go}from"node:url";var po,y,w,g=Qr(()=>{"use strict";po=fo(import.meta.url),y=go(import.meta.url),w=ho(y);typeof globalThis<"u"&&(globalThis.require=po,globalThis.__filename=y,globalThis.__dirname=w,globalThis.Buffer=v,globalThis.process=p,typeof global>"u"&&(globalThis.global=globalThis))});var Oe=q((Ph,ys)=>{g();var vs=e=>typeof e<"u"&&e!==null,Oo=e=>typeof e=="object",jo=e=>Object.prototype.toString.call(e)==="[object Object]",Lo=e=>typeof e=="function",Mo=e=>typeof e=="boolean",zo=e=>e instanceof v,Bo=e=>{if(vs(e))switch(e.constructor){case Uint8Array:case Uint8ClampedArray:case Int8Array:case Uint16Array:case Int16Array:case Uint32Array:case Int32Array:case Float32Array:case Float64Array:return!0}return!1},Uo=e=>e instanceof ArrayBuffer,Go=e=>typeof e=="string"&&e.length>0,qo=e=>typeof e=="number"&&!Number.isNaN(e),Wo=e=>Number.isInteger(e),Ho=(e,t,r)=>e>=t&&e<=r,Vo=(e,t)=>t.includes(e),Jo=(e,t,r)=>new Error(`Expected ${t} for ${e} but received ${r} of type ${typeof r}`),Xo=(e,t)=>(t.message=e.message,t);ys.exports={defined:vs,object:Oo,plainObject:jo,fn:Lo,bool:Mo,buffer:zo,typedArray:Bo,arrayBuffer:Uo,string:Go,number:qo,integer:Wo,inRange:Ho,inArray:Vo,invalidParameterError:Jo,nativeError:Xo}});var xs=q((Sh,Es)=>{"use strict";g();var ws=()=>p.platform==="linux",Ut=null,Ko=()=>{if(!Ut)if(ws()&&p.report){let e=p.report.excludeNetwork;p.report.excludeNetwork=!0,Ut=p.report.getReport(),p.report.excludeNetwork=e}else Ut={};return Ut};Es.exports={isLinux:ws,getReport:Ko}});var Rs=q((kh,Ps)=>{"use strict";g();var mt=ie("fs"),Yo="/usr/bin/ldd",Qo="/proc/self/exe",Gt=2048,Zo=e=>{let t=mt.openSync(e,"r"),r=v.alloc(Gt),s=mt.readSync(t,r,0,Gt,0);return mt.close(t,()=>{}),r.subarray(0,s)},ea=e=>new Promise((t,r)=>{mt.open(e,"r",(s,n)=>{if(s)r(s);else{let i=v.alloc(Gt);mt.read(n,i,0,Gt,0,(o,a)=>{t(i.subarray(0,a)),mt.close(n,()=>{})})}})});Ps.exports={LDD_PATH:Yo,SELF_PATH:Qo,readFileSync:Zo,readFile:ea}});var $s=q((_h,Ss)=>{"use strict";g();var ta=e=>{if(e.length<64||e.readUInt32BE(0)!==2135247942||e.readUInt8(4)!==2||e.readUInt8(5)!==1)return null;let t=e.readUInt32LE(32),r=e.readUInt16LE(54),s=e.readUInt16LE(56);for(let n=0;n<s;n++){let i=t+n*r;if(e.readUInt32LE(i)===3){let a=e.readUInt32LE(i+8),c=e.readUInt32LE(i+32);return e.subarray(a,a+c).toString().replace(/\0.*$/g,"")}}return null};Ss.exports={interpreterPath:ta}});var Wt=q((Ih,qs)=>{"use strict";g();var As=ie("child_process"),{isLinux:bt,getReport:_s}=xs(),{LDD_PATH:qt,SELF_PATH:Ns,readFile:yr,readFileSync:wr}=Rs(),{interpreterPath:Is}=$s(),je,Le,Me,Ts="getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",et="",Ds=()=>et||new Promise(e=>{As.exec(Ts,(t,r)=>{et=t?" ":r,e(et)})}),Cs=()=>{if(!et)try{et=As.execSync(Ts,{encoding:"utf8"})}catch{et=" "}return et},We="glibc",Fs=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,lt="musl",ra=e=>e.includes("libc.musl-")||e.includes("ld-musl-"),Os=()=>{let e=_s();return e.header&&e.header.glibcVersionRuntime?We:Array.isArray(e.sharedObjects)&&e.sharedObjects.some(ra)?lt:null},js=e=>{let[t,r]=e.split(/[\r\n]+/);return t&&t.includes(We)?We:r&&r.includes(lt)?lt:null},Ls=e=>{if(e){if(e.includes("/ld-musl-"))return lt;if(e.includes("/ld-linux-"))return We}return null},Ms=e=>(e=e.toString(),e.includes("musl")?lt:e.includes("GNU C Library")?We:null),sa=async()=>{if(Le!==void 0)return Le;Le=null;try{let e=await yr(qt);Le=Ms(e)}catch{}return Le},na=()=>{if(Le!==void 0)return Le;Le=null;try{let e=wr(qt);Le=Ms(e)}catch{}return Le},ia=async()=>{if(je!==void 0)return je;je=null;try{let e=await yr(Ns),t=Is(e);je=Ls(t)}catch{}return je},oa=()=>{if(je!==void 0)return je;je=null;try{let e=wr(Ns),t=Is(e);je=Ls(t)}catch{}return je},zs=async()=>{let e=null;if(bt()&&(e=await ia(),!e&&(e=await sa(),e||(e=Os()),!e))){let t=await Ds();e=js(t)}return e},Bs=()=>{let e=null;if(bt()&&(e=oa(),!e&&(e=na(),e||(e=Os()),!e))){let t=Cs();e=js(t)}return e},aa=async()=>bt()&&await zs()!==We,la=()=>bt()&&Bs()!==We,ca=async()=>{if(Me!==void 0)return Me;Me=null;try{let t=(await yr(qt)).match(Fs);t&&(Me=t[1])}catch{}return Me},ua=()=>{if(Me!==void 0)return Me;Me=null;try{let t=wr(qt).match(Fs);t&&(Me=t[1])}catch{}return Me},Us=()=>{let e=_s();return e.header&&e.header.glibcVersionRuntime?e.header.glibcVersionRuntime:null},ks=e=>e.trim().split(/\s+/)[1],Gs=e=>{let[t,r,s]=e.split(/[\r\n]+/);return t&&t.includes(We)?ks(t):r&&s&&r.includes(lt)?ks(s):null},fa=async()=>{let e=null;if(bt()&&(e=await ca(),e||(e=Us()),!e)){let t=await Ds();e=Gs(t)}return e},ha=()=>{let e=null;if(bt()&&(e=ua(),e||(e=Us()),!e)){let t=Cs();e=Gs(t)}return e};qs.exports={GLIBC:We,MUSL:lt,family:zs,familySync:Bs,isNonGlibcLinux:aa,isNonGlibcLinuxSync:la,version:fa,versionSync:ha}});var Nt=q((Dh,Ws)=>{"use strict";g();var da=typeof p=="object"&&p.env&&p.env.NODE_DEBUG&&/\bsemver\b/i.test(p.env.NODE_DEBUG)?(...e)=>{}:()=>{};Ws.exports=da});var Ht=q((Fh,Hs)=>{"use strict";g();var ga="2.0.0",pa=Number.MAX_SAFE_INTEGER||9007199254740991,ma=16,ba=250,va=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Hs.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:ma,MAX_SAFE_BUILD_LENGTH:ba,MAX_SAFE_INTEGER:pa,RELEASE_TYPES:va,SEMVER_SPEC_VERSION:ga,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var It=q((ze,Vs)=>{"use strict";g();var{MAX_SAFE_COMPONENT_LENGTH:Er,MAX_SAFE_BUILD_LENGTH:ya,MAX_LENGTH:wa}=Ht(),Ea=Nt();ze=Vs.exports={};var xa=ze.re=[],Pa=ze.safeRe=[],N=ze.src=[],Ra=ze.safeSrc=[],I=ze.t={},Sa=0,xr="[a-zA-Z0-9-]",$a=[["\\s",1],["\\d",wa],[xr,ya]],ka=e=>{for(let[t,r]of $a)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},B=(e,t,r)=>{let s=ka(t),n=Sa++;Ea(e,n,t),I[e]=n,N[n]=t,Ra[n]=s,xa[n]=new RegExp(t,r?"g":void 0),Pa[n]=new RegExp(s,r?"g":void 0)};B("NUMERICIDENTIFIER","0|[1-9]\\d*");B("NUMERICIDENTIFIERLOOSE","\\d+");B("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${xr}*`);B("MAINVERSION",`(${N[I.NUMERICIDENTIFIER]})\\.(${N[I.NUMERICIDENTIFIER]})\\.(${N[I.NUMERICIDENTIFIER]})`);B("MAINVERSIONLOOSE",`(${N[I.NUMERICIDENTIFIERLOOSE]})\\.(${N[I.NUMERICIDENTIFIERLOOSE]})\\.(${N[I.NUMERICIDENTIFIERLOOSE]})`);B("PRERELEASEIDENTIFIER",`(?:${N[I.NONNUMERICIDENTIFIER]}|${N[I.NUMERICIDENTIFIER]})`);B("PRERELEASEIDENTIFIERLOOSE",`(?:${N[I.NONNUMERICIDENTIFIER]}|${N[I.NUMERICIDENTIFIERLOOSE]})`);B("PRERELEASE",`(?:-(${N[I.PRERELEASEIDENTIFIER]}(?:\\.${N[I.PRERELEASEIDENTIFIER]})*))`);B("PRERELEASELOOSE",`(?:-?(${N[I.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${N[I.PRERELEASEIDENTIFIERLOOSE]})*))`);B("BUILDIDENTIFIER",`${xr}+`);B("BUILD",`(?:\\+(${N[I.BUILDIDENTIFIER]}(?:\\.${N[I.BUILDIDENTIFIER]})*))`);B("FULLPLAIN",`v?${N[I.MAINVERSION]}${N[I.PRERELEASE]}?${N[I.BUILD]}?`);B("FULL",`^${N[I.FULLPLAIN]}$`);B("LOOSEPLAIN",`[v=\\s]*${N[I.MAINVERSIONLOOSE]}${N[I.PRERELEASELOOSE]}?${N[I.BUILD]}?`);B("LOOSE",`^${N[I.LOOSEPLAIN]}$`);B("GTLT","((?:<|>)?=?)");B("XRANGEIDENTIFIERLOOSE",`${N[I.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);B("XRANGEIDENTIFIER",`${N[I.NUMERICIDENTIFIER]}|x|X|\\*`);B("XRANGEPLAIN",`[v=\\s]*(${N[I.XRANGEIDENTIFIER]})(?:\\.(${N[I.XRANGEIDENTIFIER]})(?:\\.(${N[I.XRANGEIDENTIFIER]})(?:${N[I.PRERELEASE]})?${N[I.BUILD]}?)?)?`);B("XRANGEPLAINLOOSE",`[v=\\s]*(${N[I.XRANGEIDENTIFIERLOOSE]})(?:\\.(${N[I.XRANGEIDENTIFIERLOOSE]})(?:\\.(${N[I.XRANGEIDENTIFIERLOOSE]})(?:${N[I.PRERELEASELOOSE]})?${N[I.BUILD]}?)?)?`);B("XRANGE",`^${N[I.GTLT]}\\s*${N[I.XRANGEPLAIN]}$`);B("XRANGELOOSE",`^${N[I.GTLT]}\\s*${N[I.XRANGEPLAINLOOSE]}$`);B("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Er}})(?:\\.(\\d{1,${Er}}))?(?:\\.(\\d{1,${Er}}))?`);B("COERCE",`${N[I.COERCEPLAIN]}(?:$|[^\\d])`);B("COERCEFULL",N[I.COERCEPLAIN]+`(?:${N[I.PRERELEASE]})?(?:${N[I.BUILD]})?(?:$|[^\\d])`);B("COERCERTL",N[I.COERCE],!0);B("COERCERTLFULL",N[I.COERCEFULL],!0);B("LONETILDE","(?:~>?)");B("TILDETRIM",`(\\s*)${N[I.LONETILDE]}\\s+`,!0);ze.tildeTrimReplace="$1~";B("TILDE",`^${N[I.LONETILDE]}${N[I.XRANGEPLAIN]}$`);B("TILDELOOSE",`^${N[I.LONETILDE]}${N[I.XRANGEPLAINLOOSE]}$`);B("LONECARET","(?:\\^)");B("CARETTRIM",`(\\s*)${N[I.LONECARET]}\\s+`,!0);ze.caretTrimReplace="$1^";B("CARET",`^${N[I.LONECARET]}${N[I.XRANGEPLAIN]}$`);B("CARETLOOSE",`^${N[I.LONECARET]}${N[I.XRANGEPLAINLOOSE]}$`);B("COMPARATORLOOSE",`^${N[I.GTLT]}\\s*(${N[I.LOOSEPLAIN]})$|^$`);B("COMPARATOR",`^${N[I.GTLT]}\\s*(${N[I.FULLPLAIN]})$|^$`);B("COMPARATORTRIM",`(\\s*)${N[I.GTLT]}\\s*(${N[I.LOOSEPLAIN]}|${N[I.XRANGEPLAIN]})`,!0);ze.comparatorTrimReplace="$1$2$3";B("HYPHENRANGE",`^\\s*(${N[I.XRANGEPLAIN]})\\s+-\\s+(${N[I.XRANGEPLAIN]})\\s*$`);B("HYPHENRANGELOOSE",`^\\s*(${N[I.XRANGEPLAINLOOSE]})\\s+-\\s+(${N[I.XRANGEPLAINLOOSE]})\\s*$`);B("STAR","(<|>)?=?\\s*\\*");B("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");B("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Vt=q((Lh,Js)=>{"use strict";g();var Aa=Object.freeze({loose:!0}),_a=Object.freeze({}),Na=e=>e?typeof e!="object"?Aa:e:_a;Js.exports=Na});var Qs=q((zh,Ys)=>{"use strict";g();var Xs=/^[0-9]+$/,Ks=(e,t)=>{if(typeof e=="number"&&typeof t=="number")return e===t?0:e<t?-1:1;let r=Xs.test(e),s=Xs.test(t);return r&&s&&(e=+e,t=+t),e===t?0:r&&!s?-1:s&&!r?1:e<t?-1:1},Ia=(e,t)=>Ks(t,e);Ys.exports={compareIdentifiers:Ks,rcompareIdentifiers:Ia}});var vt=q((Uh,en)=>{"use strict";g();var Jt=Nt(),{MAX_LENGTH:Zs,MAX_SAFE_INTEGER:Xt}=Ht(),{safeRe:Kt,t:Yt}=It(),Ta=Vt(),{compareIdentifiers:Pr}=Qs(),Rr=class e{constructor(t,r){if(r=Ta(r),t instanceof e){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>Zs)throw new TypeError(`version is longer than ${Zs} characters`);Jt("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let s=t.trim().match(r.loose?Kt[Yt.LOOSE]:Kt[Yt.FULL]);if(!s)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+s[1],this.minor=+s[2],this.patch=+s[3],this.major>Xt||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Xt||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Xt||this.patch<0)throw new TypeError("Invalid patch version");s[4]?this.prerelease=s[4].split(".").map(n=>{if(/^[0-9]+$/.test(n)){let i=+n;if(i>=0&&i<Xt)return i}return n}):this.prerelease=[],this.build=s[5]?s[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(Jt("SemVer.compare",this.version,this.options,t),!(t instanceof e)){if(typeof t=="string"&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:this.patch>t.patch?1:0}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let s=this.prerelease[r],n=t.prerelease[r];if(Jt("prerelease compare",r,s,n),s===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(s===void 0)return-1;if(s===n)continue;return Pr(s,n)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let s=this.build[r],n=t.build[r];if(Jt("build compare",r,s,n),s===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(s===void 0)return-1;if(s===n)continue;return Pr(s,n)}while(++r)}inc(t,r,s){if(t.startsWith("pre")){if(!r&&s===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let n=`-${r}`.match(this.options.loose?Kt[Yt.PRERELEASELOOSE]:Kt[Yt.PRERELEASE]);if(!n||n[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,s);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,s);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,s),this.inc("pre",r,s);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,s),this.inc("pre",r,s);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let n=Number(s)?1:0;if(this.prerelease.length===0)this.prerelease=[n];else{let i=this.prerelease.length;for(;--i>=0;)typeof this.prerelease[i]=="number"&&(this.prerelease[i]++,i=-2);if(i===-1){if(r===this.prerelease.join(".")&&s===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(n)}}if(r){let i=[r,n];s===!1&&(i=[r]),Pr(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};en.exports=Rr});var sn=q((qh,rn)=>{"use strict";g();var tn=vt(),Da=(e,t,r=!1)=>{if(e instanceof tn)return e;try{return new tn(e,t)}catch(s){if(!r)return null;throw s}};rn.exports=Da});var on=q((Hh,nn)=>{"use strict";g();var Ca=vt(),Fa=sn(),{safeRe:Qt,t:Zt}=It(),Oa=(e,t)=>{if(e instanceof Ca)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?Qt[Zt.COERCEFULL]:Qt[Zt.COERCE]);else{let c=t.includePrerelease?Qt[Zt.COERCERTLFULL]:Qt[Zt.COERCERTL],u;for(;(u=c.exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||u.index+u[0].length!==r.index+r[0].length)&&(r=u),c.lastIndex=u.index+u[1].length+u[2].length;c.lastIndex=-1}if(r===null)return null;let s=r[2],n=r[3]||"0",i=r[4]||"0",o=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return Fa(`${s}.${n}.${i}${o}${a}`,t)};nn.exports=Oa});var ct=q((Jh,ln)=>{"use strict";g();var an=vt(),ja=(e,t,r)=>new an(e,r).compare(new an(t,r));ln.exports=ja});var Sr=q((Kh,cn)=>{"use strict";g();var La=ct(),Ma=(e,t,r)=>La(e,t,r)>=0;cn.exports=Ma});var fn=q((Qh,un)=>{"use strict";g();var $r=class{constructor(){this.max=1e3,this.map=new Map}get(t){let r=this.map.get(t);if(r!==void 0)return this.map.delete(t),this.map.set(t,r),r}delete(t){return this.map.delete(t)}set(t,r){if(!this.delete(t)&&r!==void 0){if(this.map.size>=this.max){let n=this.map.keys().next().value;this.delete(n)}this.map.set(t,r)}return this}};un.exports=$r});var dn=q((ed,hn)=>{"use strict";g();var za=ct(),Ba=(e,t,r)=>za(e,t,r)===0;hn.exports=Ba});var pn=q((rd,gn)=>{"use strict";g();var Ua=ct(),Ga=(e,t,r)=>Ua(e,t,r)!==0;gn.exports=Ga});var bn=q((nd,mn)=>{"use strict";g();var qa=ct(),Wa=(e,t,r)=>qa(e,t,r)>0;mn.exports=Wa});var yn=q((od,vn)=>{"use strict";g();var Ha=ct(),Va=(e,t,r)=>Ha(e,t,r)<0;vn.exports=Va});var En=q((ld,wn)=>{"use strict";g();var Ja=ct(),Xa=(e,t,r)=>Ja(e,t,r)<=0;wn.exports=Xa});var Pn=q((ud,xn)=>{"use strict";g();var Ka=dn(),Ya=pn(),Qa=bn(),Za=Sr(),el=yn(),tl=En(),rl=(e,t,r,s)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return Ka(e,r,s);case"!=":return Ya(e,r,s);case">":return Qa(e,r,s);case">=":return Za(e,r,s);case"<":return el(e,r,s);case"<=":return tl(e,r,s);default:throw new TypeError(`Invalid operator: ${t}`)}};xn.exports=rl});var Nn=q((hd,_n)=>{"use strict";g();var Tt=Symbol("SemVer ANY"),_r=class e{static get ANY(){return Tt}constructor(t,r){if(r=Rn(r),t instanceof e){if(t.loose===!!r.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),Ar("comparator",t,r),this.options=r,this.loose=!!r.loose,this.parse(t),this.semver===Tt?this.value="":this.value=this.operator+this.semver.version,Ar("comp",this)}parse(t){let r=this.options.loose?Sn[$n.COMPARATORLOOSE]:Sn[$n.COMPARATOR],s=t.match(r);if(!s)throw new TypeError(`Invalid comparator: ${t}`);this.operator=s[1]!==void 0?s[1]:"",this.operator==="="&&(this.operator=""),s[2]?this.semver=new kn(s[2],this.options.loose):this.semver=Tt}toString(){return this.value}test(t){if(Ar("Comparator.test",t,this.options.loose),this.semver===Tt||t===Tt)return!0;if(typeof t=="string")try{t=new kn(t,this.options)}catch{return!1}return kr(t,this.operator,this.semver,this.options)}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new An(t.value,r).test(this.value):t.operator===""?t.value===""?!0:new An(this.value,r).test(t.semver):(r=Rn(r),r.includePrerelease&&(this.value==="<0.0.0-0"||t.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&t.operator.startsWith(">")||this.operator.startsWith("<")&&t.operator.startsWith("<")||this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")||kr(this.semver,"<",t.semver,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||kr(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}};_n.exports=_r;var Rn=Vt(),{safeRe:Sn,t:$n}=It(),kr=Pn(),Ar=Nt(),kn=vt(),An=Nr()});var Nr=q((gd,Cn)=>{"use strict";g();var sl=/\s+/g,Ir=class e{constructor(t,r){if(r=il(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof Tr)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().replace(sl," "),this.set=this.raw.split("||").map(s=>this.parseRange(s.trim())).filter(s=>s.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let s=this.set[0];if(this.set=this.set.filter(n=>!Tn(n[0])),this.set.length===0)this.set=[s];else if(this.set.length>1){for(let n of this.set)if(n.length===1&&hl(n[0])){this.set=[n];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let t=0;t<this.set.length;t++){t>0&&(this.formatted+="||");let r=this.set[t];for(let s=0;s<r.length;s++)s>0&&(this.formatted+=" "),this.formatted+=r[s].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(t){let s=((this.options.includePrerelease&&ul)|(this.options.loose&&fl))+":"+t,n=In.get(s);if(n)return n;let i=this.options.loose,o=i?we[be.HYPHENRANGELOOSE]:we[be.HYPHENRANGE];t=t.replace(o,xl(this.options.includePrerelease)),te("hyphen replace",t),t=t.replace(we[be.COMPARATORTRIM],al),te("comparator trim",t),t=t.replace(we[be.TILDETRIM],ll),te("tilde trim",t),t=t.replace(we[be.CARETTRIM],cl),te("caret trim",t);let a=t.split(" ").map(b=>dl(b,this.options)).join(" ").split(/\s+/).map(b=>El(b,this.options));i&&(a=a.filter(b=>(te("loose invalid filter",b,this.options),!!b.match(we[be.COMPARATORLOOSE])))),te("range list",a);let c=new Map,u=a.map(b=>new Tr(b,this.options));for(let b of u){if(Tn(b))return[b];c.set(b.value,b)}c.size>1&&c.has("")&&c.delete("");let f=[...c.values()];return In.set(s,f),f}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some(s=>Dn(s,r)&&t.set.some(n=>Dn(n,r)&&s.every(i=>n.every(o=>i.intersects(o,r)))))}test(t){if(!t)return!1;if(typeof t=="string")try{t=new ol(t,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(Pl(this.set[r],t,this.options))return!0;return!1}};Cn.exports=Ir;var nl=fn(),In=new nl,il=Vt(),Tr=Nn(),te=Nt(),ol=vt(),{safeRe:we,t:be,comparatorTrimReplace:al,tildeTrimReplace:ll,caretTrimReplace:cl}=It(),{FLAG_INCLUDE_PRERELEASE:ul,FLAG_LOOSE:fl}=Ht(),Tn=e=>e.value==="<0.0.0-0",hl=e=>e.value==="",Dn=(e,t)=>{let r=!0,s=e.slice(),n=s.pop();for(;r&&s.length;)r=s.every(i=>n.intersects(i,t)),n=s.pop();return r},dl=(e,t)=>(e=e.replace(we[be.BUILD],""),te("comp",e,t),e=ml(e,t),te("caret",e),e=gl(e,t),te("tildes",e),e=vl(e,t),te("xrange",e),e=wl(e,t),te("stars",e),e),Ee=e=>!e||e.toLowerCase()==="x"||e==="*",gl=(e,t)=>e.trim().split(/\s+/).map(r=>pl(r,t)).join(" "),pl=(e,t)=>{let r=t.loose?we[be.TILDELOOSE]:we[be.TILDE];return e.replace(r,(s,n,i,o,a)=>{te("tilde",e,s,n,i,o,a);let c;return Ee(n)?c="":Ee(i)?c=`>=${n}.0.0 <${+n+1}.0.0-0`:Ee(o)?c=`>=${n}.${i}.0 <${n}.${+i+1}.0-0`:a?(te("replaceTilde pr",a),c=`>=${n}.${i}.${o}-${a} <${n}.${+i+1}.0-0`):c=`>=${n}.${i}.${o} <${n}.${+i+1}.0-0`,te("tilde return",c),c})},ml=(e,t)=>e.trim().split(/\s+/).map(r=>bl(r,t)).join(" "),bl=(e,t)=>{te("caret",e,t);let r=t.loose?we[be.CARETLOOSE]:we[be.CARET],s=t.includePrerelease?"-0":"";return e.replace(r,(n,i,o,a,c)=>{te("caret",e,n,i,o,a,c);let u;return Ee(i)?u="":Ee(o)?u=`>=${i}.0.0${s} <${+i+1}.0.0-0`:Ee(a)?i==="0"?u=`>=${i}.${o}.0${s} <${i}.${+o+1}.0-0`:u=`>=${i}.${o}.0${s} <${+i+1}.0.0-0`:c?(te("replaceCaret pr",c),i==="0"?o==="0"?u=`>=${i}.${o}.${a}-${c} <${i}.${o}.${+a+1}-0`:u=`>=${i}.${o}.${a}-${c} <${i}.${+o+1}.0-0`:u=`>=${i}.${o}.${a}-${c} <${+i+1}.0.0-0`):(te("no pr"),i==="0"?o==="0"?u=`>=${i}.${o}.${a}${s} <${i}.${o}.${+a+1}-0`:u=`>=${i}.${o}.${a}${s} <${i}.${+o+1}.0-0`:u=`>=${i}.${o}.${a} <${+i+1}.0.0-0`),te("caret return",u),u})},vl=(e,t)=>(te("replaceXRanges",e,t),e.split(/\s+/).map(r=>yl(r,t)).join(" ")),yl=(e,t)=>{e=e.trim();let r=t.loose?we[be.XRANGELOOSE]:we[be.XRANGE];return e.replace(r,(s,n,i,o,a,c)=>{te("xRange",e,s,n,i,o,a,c);let u=Ee(i),f=u||Ee(o),b=f||Ee(a),m=b;return n==="="&&m&&(n=""),c=t.includePrerelease?"-0":"",u?n===">"||n==="<"?s="<0.0.0-0":s="*":n&&m?(f&&(o=0),a=0,n===">"?(n=">=",f?(i=+i+1,o=0,a=0):(o=+o+1,a=0)):n==="<="&&(n="<",f?i=+i+1:o=+o+1),n==="<"&&(c="-0"),s=`${n+i}.${o}.${a}${c}`):f?s=`>=${i}.0.0${c} <${+i+1}.0.0-0`:b&&(s=`>=${i}.${o}.0${c} <${i}.${+o+1}.0-0`),te("xRange return",s),s})},wl=(e,t)=>(te("replaceStars",e,t),e.trim().replace(we[be.STAR],"")),El=(e,t)=>(te("replaceGTE0",e,t),e.trim().replace(we[t.includePrerelease?be.GTE0PRE:be.GTE0],"")),xl=e=>(t,r,s,n,i,o,a,c,u,f,b,m)=>(Ee(s)?r="":Ee(n)?r=`>=${s}.0.0${e?"-0":""}`:Ee(i)?r=`>=${s}.${n}.0${e?"-0":""}`:o?r=`>=${r}`:r=`>=${r}${e?"-0":""}`,Ee(u)?c="":Ee(f)?c=`<${+u+1}.0.0-0`:Ee(b)?c=`<${u}.${+f+1}.0-0`:m?c=`<=${u}.${f}.${b}-${m}`:e?c=`<${u}.${f}.${+b+1}-0`:c=`<=${c}`,`${r} ${c}`.trim()),Pl=(e,t,r)=>{for(let s=0;s<e.length;s++)if(!e[s].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let s=0;s<e.length;s++)if(te(e[s].semver),e[s].semver!==Tr.ANY&&e[s].semver.prerelease.length>0){let n=e[s].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0}});var On=q((md,Fn)=>{"use strict";g();var Rl=Nr(),Sl=(e,t,r)=>{try{t=new Rl(t,r)}catch{return!1}return t.test(e)};Fn.exports=Sl});var Dr=q((vd,$l)=>{$l.exports={name:"sharp",description:"High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images",version:"0.34.5",author:"Lovell Fuller <npm@lovell.info>",homepage:"https://sharp.pixelplumbing.com",contributors:["Pierre Inglebert <pierre.inglebert@gmail.com>","Jonathan Ong <jonathanrichardong@gmail.com>","Chanon Sajjamanochai <chanon.s@gmail.com>","Juliano Julio <julianojulio@gmail.com>","Daniel Gasienica <daniel@gasienica.ch>","Julian Walker <julian@fiftythree.com>","Amit Pitaru <pitaru.amit@gmail.com>","Brandon Aaron <hello.brandon@aaron.sh>","Andreas Lind <andreas@one.com>","Maurus Cuelenaere <mcuelenaere@gmail.com>","Linus Unneb\xE4ck <linus@folkdatorn.se>","Victor Mateevitsi <mvictoras@gmail.com>","Alaric Holloway <alaric.holloway@gmail.com>","Bernhard K. Weisshuhn <bkw@codingforce.com>","Chris Riley <criley@primedia.com>","David Carley <dacarley@gmail.com>","John Tobin <john@limelightmobileinc.com>","Kenton Gray <kentongray@gmail.com>","Felix B\xFCnemann <Felix.Buenemann@gmail.com>","Samy Al Zahrani <samyalzahrany@gmail.com>","Chintan Thakkar <lemnisk8@gmail.com>","F. Orlando Galashan <frulo@gmx.de>","Kleis Auke Wolthuizen <info@kleisauke.nl>","Matt Hirsch <mhirsch@media.mit.edu>","Matthias Thoemmes <thoemmes@gmail.com>","Patrick Paskaris <patrick@paskaris.gr>","J\xE9r\xE9my Lal <kapouer@melix.org>","Rahul Nanwani <r.nanwani@gmail.com>","Alice Monday <alice0meta@gmail.com>","Kristo Jorgenson <kristo.jorgenson@gmail.com>","YvesBos <yves_bos@outlook.com>","Guy Maliar <guy@tailorbrands.com>","Nicolas Coden <nicolas@ncoden.fr>","Matt Parrish <matt.r.parrish@gmail.com>","Marcel Bretschneider <marcel.bretschneider@gmail.com>","Matthew McEachen <matthew+github@mceachen.org>","Jarda Kot\u011B\u0161ovec <jarda.kotesovec@gmail.com>","Kenric D'Souza <kenric.dsouza@gmail.com>","Oleh Aleinyk <oleg.aleynik@gmail.com>","Marcel Bretschneider <marcel.bretschneider@gmail.com>","Andrea Bianco <andrea.bianco@unibas.ch>","Rik Heywood <rik@rik.org>","Thomas Parisot <hi@oncletom.io>","Nathan Graves <nathanrgraves+github@gmail.com>","Tom Lokhorst <tom@lokhorst.eu>","Espen Hovlandsdal <espen@hovlandsdal.com>","Sylvain Dumont <sylvain.dumont35@gmail.com>","Alun Davies <alun.owain.davies@googlemail.com>","Aidan Hoolachan <ajhoolachan21@gmail.com>","Axel Eirola <axel.eirola@iki.fi>","Freezy <freezy@xbmc.org>","Daiz <taneli.vatanen@gmail.com>","Julian Aubourg <j@ubourg.net>","Keith Belovay <keith@picthrive.com>","Michael B. Klein <mbklein@gmail.com>","Jordan Prudhomme <jordan@raboland.fr>","Ilya Ovdin <iovdin@gmail.com>","Andargor <andargor@yahoo.com>","Paul Neave <paul.neave@gmail.com>","Brendan Kennedy <brenwken@gmail.com>","Brychan Bennett-Odlum <git@brychan.io>","Edward Silverton <e.silverton@gmail.com>","Roman Malieiev <aromaleev@gmail.com>","Tomas Szabo <tomas.szabo@deftomat.com>","Robert O'Rourke <robert@o-rourke.org>","Guillermo Alfonso Varela Chouci\xF1o <guillevch@gmail.com>","Christian Flintrup <chr@gigahost.dk>","Manan Jadhav <manan@motionden.com>","Leon Radley <leon@radley.se>","alza54 <alza54@thiocod.in>","Jacob Smith <jacob@frende.me>","Michael Nutt <michael@nutt.im>","Brad Parham <baparham@gmail.com>","Taneli Vatanen <taneli.vatanen@gmail.com>","Joris Dugu\xE9 <zaruike10@gmail.com>","Chris Banks <christopher.bradley.banks@gmail.com>","Ompal Singh <ompal.hitm09@gmail.com>","Brodan <christopher.hranj@gmail.com>","Ankur Parihar <ankur.github@gmail.com>","Brahim Ait elhaj <brahima@gmail.com>","Mart Jansink <m.jansink@gmail.com>","Lachlan Newman <lachnewman007@gmail.com>","Dennis Beatty <dennis@dcbeatty.com>","Ingvar Stepanyan <me@rreverser.com>","Don Denton <don@happycollision.com>"],scripts:{build:"node install/build.js",install:"node install/check.js || npm run build",clean:"rm -rf src/build/ .nyc_output/ coverage/ test/fixtures/output.*",test:"npm run lint && npm run test-unit",lint:"npm run lint-cpp && npm run lint-js && npm run lint-types","lint-cpp":"cpplint --quiet src/*.h src/*.cc","lint-js":"biome lint","lint-types":"tsd --files ./test/types/sharp.test-d.ts","test-leak":"./test/leak/leak.sh","test-unit":"node --experimental-test-coverage test/unit.mjs","package-from-local-build":"node npm/from-local-build.js","package-release-notes":"node npm/release-notes.js","docs-build":"node docs/build.mjs","docs-serve":"cd docs && npm start","docs-publish":"cd docs && npm run build && npx firebase-tools deploy --project pixelplumbing --only hosting:pixelplumbing-sharp"},type:"commonjs",main:"lib/index.js",types:"lib/index.d.ts",files:["install","lib","src/*.{cc,h,gyp}"],repository:{type:"git",url:"git://github.com/lovell/sharp.git"},keywords:["jpeg","png","webp","avif","tiff","gif","svg","jp2","dzi","image","resize","thumbnail","crop","embed","libvips","vips"],dependencies:{"@img/colour":"^1.0.0","detect-libc":"^2.1.2",semver:"^7.7.3"},optionalDependencies:{"@img/sharp-darwin-arm64":"0.34.5","@img/sharp-darwin-x64":"0.34.5","@img/sharp-libvips-darwin-arm64":"1.2.4","@img/sharp-libvips-darwin-x64":"1.2.4","@img/sharp-libvips-linux-arm":"1.2.4","@img/sharp-libvips-linux-arm64":"1.2.4","@img/sharp-libvips-linux-ppc64":"1.2.4","@img/sharp-libvips-linux-riscv64":"1.2.4","@img/sharp-libvips-linux-s390x":"1.2.4","@img/sharp-libvips-linux-x64":"1.2.4","@img/sharp-libvips-linuxmusl-arm64":"1.2.4","@img/sharp-libvips-linuxmusl-x64":"1.2.4","@img/sharp-linux-arm":"0.34.5","@img/sharp-linux-arm64":"0.34.5","@img/sharp-linux-ppc64":"0.34.5","@img/sharp-linux-riscv64":"0.34.5","@img/sharp-linux-s390x":"0.34.5","@img/sharp-linux-x64":"0.34.5","@img/sharp-linuxmusl-arm64":"0.34.5","@img/sharp-linuxmusl-x64":"0.34.5","@img/sharp-wasm32":"0.34.5","@img/sharp-win32-arm64":"0.34.5","@img/sharp-win32-ia32":"0.34.5","@img/sharp-win32-x64":"0.34.5"},devDependencies:{"@biomejs/biome":"^2.3.4","@cpplint/cli":"^0.1.0","@emnapi/runtime":"^1.7.0","@img/sharp-libvips-dev":"1.2.4","@img/sharp-libvips-dev-wasm32":"1.2.4","@img/sharp-libvips-win32-arm64":"1.2.4","@img/sharp-libvips-win32-ia32":"1.2.4","@img/sharp-libvips-win32-x64":"1.2.4","@types/node":"*",emnapi:"^1.7.0","exif-reader":"^2.0.2","extract-zip":"^2.0.1",icc:"^3.0.0","jsdoc-to-markdown":"^9.1.3","node-addon-api":"^8.5.0","node-gyp":"^11.5.0","tar-fs":"^3.1.1",tsd:"^0.33.0"},license:"Apache-2.0",engines:{node:"^18.17.0 || ^20.3.0 || >=21.0.0"},config:{libvips:">=8.17.3"},funding:{url:"https://opencollective.com/libvips"}}});var Fr=q((yd,Hn)=>{g();var{spawnSync:er}=ie("node:child_process"),{createHash:kl}=ie("node:crypto"),zn=on(),Al=Sr(),_l=On(),jn=Wt(),{config:Nl,engines:Ln,optionalDependencies:Il}=Dr(),Tl=p.env.npm_package_config_libvips||Nl.libvips,Bn=zn(Tl).version,Dl=["darwin-arm64","darwin-x64","linux-arm","linux-arm64","linux-ppc64","linux-riscv64","linux-s390x","linux-x64","linuxmusl-arm64","linuxmusl-x64","win32-arm64","win32-ia32","win32-x64"],tr={encoding:"utf8",shell:!0},Cl=e=>{e instanceof Error},Un=()=>jn.isNonGlibcLinuxSync()?jn.familySync():"",Fl=()=>`${p.platform}${Un()}-${p.arch}`,yt=()=>{if(Gn())return"wasm32";let{npm_config_arch:e,npm_config_platform:t,npm_config_libc:r}=p.env,s=typeof r=="string"?r:Un();return`${t||p.platform}${s}-${e||p.arch}`},Ol=()=>{try{return ie(`@img/sharp-libvips-dev-${yt()}/include`)}catch{try{return ie("@img/sharp-libvips-dev/include")}catch{}}return""},jl=()=>{try{return ie("@img/sharp-libvips-dev/cplusplus")}catch{}return""},Ll=()=>{try{return ie(`@img/sharp-libvips-dev-${yt()}/lib`)}catch{try{return ie(`@img/sharp-libvips-${yt()}/lib`)}catch{}}return""},Ml=()=>{if(p.release?.name==="node"&&p.versions&&!_l(p.versions.node,Ln.node))return{found:p.versions.node,expected:Ln.node}},Gn=()=>{let{CC:e}=p.env;return!!e?.endsWith("/emcc")},zl=()=>p.platform==="darwin"&&p.arch==="x64"?(er("sysctl sysctl.proc_translated",tr).stdout||"").trim()==="sysctl.proc_translated: 1":!1,Mn=e=>kl("sha512").update(e).digest("hex"),Bl=()=>{try{let e=Mn(`imgsharp-libvips-${yt()}`),t=zn(Il[`@img/sharp-libvips-${yt()}`],{includePrerelease:!0}).version;return Mn(`${e}npm:${t}`).slice(0,10)}catch{}return""},Ul=()=>er(`node-gyp rebuild --directory=src ${Gn()?"--nodedir=emscripten":""}`,{...tr,stdio:"inherit"}).status,qn=()=>p.platform!=="win32"?(er("pkg-config --modversion vips-cpp",{...tr,env:{...p.env,PKG_CONFIG_PATH:Wn()}}).stdout||"").trim():"",Wn=()=>p.platform!=="win32"?[(er('which brew >/dev/null 2>&1 && brew environment --plain | grep PKG_CONFIG_LIBDIR | cut -d" " -f2',tr).stdout||"").trim(),p.env.PKG_CONFIG_PATH,"/usr/local/lib/pkgconfig","/usr/lib/pkgconfig","/usr/local/libdata/pkgconfig","/usr/libdata/pkgconfig"].filter(Boolean).join(":"):"",Cr=(e,t,r)=>(r&&r(`Detected ${t}, skipping search for globally-installed libvips`),e),Gl=e=>{if(p.env.SHARP_IGNORE_GLOBAL_LIBVIPS)return Cr(!1,"SHARP_IGNORE_GLOBAL_LIBVIPS",e);if(p.env.SHARP_FORCE_GLOBAL_LIBVIPS)return Cr(!0,"SHARP_FORCE_GLOBAL_LIBVIPS",e);if(zl())return Cr(!1,"Rosetta",e);let t=qn();return!!t&&Al(t,Bn)};Hn.exports={minimumLibvipsVersion:Bn,prebuiltPlatforms:Dl,buildPlatformArch:yt,buildSharpLibvipsIncludeDir:Ol,buildSharpLibvipsCPlusPlusDir:jl,buildSharpLibvipsLibDir:Ll,isUnsupportedNodeRuntime:Ml,runtimePlatformArch:Fl,log:Cl,yarnLocator:Bl,spawnRebuild:Ul,globalLibvipsVersion:qn,pkgConfigPath:Wn,useGlobalLibvips:Gl}});var Ct=q((xd,Jn)=>{g();var{familySync:ql,versionSync:Wl}=Wt(),{runtimePlatformArch:Hl,isUnsupportedNodeRuntime:Vn,prebuiltPlatforms:Vl,minimumLibvipsVersion:Jl}=Fr(),ut=Hl(),Xl=[`../src/build/Release/sharp-${ut}.node`,"../src/build/Release/sharp-wasm32.node",`@img/sharp-${ut}/sharp.node`,"@img/sharp-wasm32/sharp.node"],Or,wt,Dt=[];for(Or of Xl)try{wt=ie(Or);break}catch(e){Dt.push(e)}if(wt&&Or.startsWith("@img/sharp-linux-x64")&&!wt._isUsingX64V2()){let e=new Error("Prebuilt binaries for linux-x64 require v2 microarchitecture");e.code="Unsupported CPU",Dt.push(e),wt=null}if(wt)Jn.exports=wt;else{let[e,t,r]=["linux","darwin","win32"].map(i=>ut.startsWith(i)),s=[`Could not load the "sharp" module using the ${ut} runtime`];Dt.forEach(i=>{i.code!=="MODULE_NOT_FOUND"&&s.push(`${i.code}: ${i.message}`)});let n=Dt.map(i=>i.message).join(" ");if(s.push("Possible solutions:"),Vn()){let{found:i,expected:o}=Vn();s.push("- Please upgrade Node.js:",` Found ${i}`,` Requires ${o}`)}else if(Vl.includes(ut)){let[i,o]=ut.split("-"),a=i.endsWith("musl")?" --libc=musl":"";s.push("- Ensure optional dependencies can be installed:"," npm install --include=optional sharp","- Ensure your package manager supports multi-platform installation:"," See https://sharp.pixelplumbing.com/install#cross-platform","- Add platform-specific dependencies:",` npm install --os=${i.replace("musl","")}${a} --cpu=${o} sharp`)}else s.push(`- Manually install libvips >= ${Jl}`,"- Add experimental WebAssembly-based dependencies:"," npm install --cpu=wasm32 sharp"," npm install @img/sharp-wasm32");if(e&&/(symbol not found|CXXABI_)/i.test(n))try{let{config:i}=ie(`@img/sharp-libvips-${ut}/package`),o=`${ql()} ${Wl()}`,a=`${i.musl?"musl":"glibc"} ${i.musl||i.glibc}`;s.push("- Update your OS:",` Found ${o}`,` Requires ${a}`)}catch{}throw e&&/\/snap\/core[0-9]{2}/.test(n)&&s.push("- Remove the Node.js Snap, which does not support native modules"," snap remove node"),t&&/Incompatible library version/.test(n)&&s.push("- Update Homebrew:"," brew update && brew upgrade vips"),Dt.some(i=>i.code==="ERR_DLOPEN_DISABLED")&&s.push("- Run Node.js without using the --no-addons flag"),r&&/The specified procedure could not be found/.test(n)&&s.push("- Using the canvas package on Windows?"," See https://sharp.pixelplumbing.com/install#canvas-and-windows","- Check for outdated versions of sharp in the dependency tree:"," npm ls sharp"),s.push("- Consult the installation documentation:"," See https://sharp.pixelplumbing.com/install"),new Error(s.join(`
2
2
  `))}});var Kn=q((Sd,Xn)=>{g();var Kl=ie("node:util"),jr=ie("node:stream"),Yl=Oe();Ct();var Ql=Kl.debuglog("sharp"),Zl=e=>{ft.queue.emit("change",e)},ft=function(e,t){if(arguments.length===1&&!Yl.defined(e))throw new Error("Invalid input");return this instanceof ft?(jr.Duplex.call(this),this.options={topOffsetPre:-1,leftOffsetPre:-1,widthPre:-1,heightPre:-1,topOffsetPost:-1,leftOffsetPost:-1,widthPost:-1,heightPost:-1,width:-1,height:-1,canvas:"crop",position:0,resizeBackground:[0,0,0,255],angle:0,rotationAngle:0,rotationBackground:[0,0,0,255],rotateBefore:!1,orientBefore:!1,flip:!1,flop:!1,extendTop:0,extendBottom:0,extendLeft:0,extendRight:0,extendBackground:[0,0,0,255],extendWith:"background",withoutEnlargement:!1,withoutReduction:!1,affineMatrix:[],affineBackground:[0,0,0,255],affineIdx:0,affineIdy:0,affineOdx:0,affineOdy:0,affineInterpolator:this.constructor.interpolators.bilinear,kernel:"lanczos3",fastShrinkOnLoad:!0,tint:[-1,0,0,0],flatten:!1,flattenBackground:[0,0,0],unflatten:!1,negate:!1,negateAlpha:!0,medianSize:0,blurSigma:0,precision:"integer",minAmpl:.2,sharpenSigma:0,sharpenM1:1,sharpenM2:2,sharpenX1:2,sharpenY2:10,sharpenY3:20,threshold:0,thresholdGrayscale:!0,trimBackground:[],trimThreshold:-1,trimLineArt:!1,dilateWidth:0,erodeWidth:0,gamma:0,gammaOut:0,greyscale:!1,normalise:!1,normaliseLower:1,normaliseUpper:99,claheWidth:0,claheHeight:0,claheMaxSlope:3,brightness:1,saturation:1,hue:0,lightness:0,booleanBufferIn:null,booleanFileIn:"",joinChannelIn:[],extractChannel:-1,removeAlpha:!1,ensureAlpha:-1,colourspace:"srgb",colourspacePipeline:"last",composite:[],fileOut:"",formatOut:"input",streamOut:!1,keepMetadata:0,withMetadataOrientation:-1,withMetadataDensity:0,withIccProfile:"",withExif:{},withExifMerge:!0,withXmp:"",resolveWithObject:!1,loop:-1,delay:[],jpegQuality:80,jpegProgressive:!1,jpegChromaSubsampling:"4:2:0",jpegTrellisQuantisation:!1,jpegOvershootDeringing:!1,jpegOptimiseScans:!1,jpegOptimiseCoding:!0,jpegQuantisationTable:0,pngProgressive:!1,pngCompressionLevel:6,pngAdaptiveFiltering:!1,pngPalette:!1,pngQuality:100,pngEffort:7,pngBitdepth:8,pngDither:1,jp2Quality:80,jp2TileHeight:512,jp2TileWidth:512,jp2Lossless:!1,jp2ChromaSubsampling:"4:4:4",webpQuality:80,webpAlphaQuality:100,webpLossless:!1,webpNearLossless:!1,webpSmartSubsample:!1,webpSmartDeblock:!1,webpPreset:"default",webpEffort:4,webpMinSize:!1,webpMixed:!1,gifBitdepth:8,gifEffort:7,gifDither:1,gifInterFrameMaxError:0,gifInterPaletteMaxError:3,gifKeepDuplicateFrames:!1,gifReuse:!0,gifProgressive:!1,tiffQuality:80,tiffCompression:"jpeg",tiffBigtiff:!1,tiffPredictor:"horizontal",tiffPyramid:!1,tiffMiniswhite:!1,tiffBitdepth:8,tiffTile:!1,tiffTileHeight:256,tiffTileWidth:256,tiffXres:1,tiffYres:1,tiffResolutionUnit:"inch",heifQuality:50,heifLossless:!1,heifCompression:"av1",heifEffort:4,heifChromaSubsampling:"4:4:4",heifBitdepth:8,jxlDistance:1,jxlDecodingTier:0,jxlEffort:7,jxlLossless:!1,rawDepth:"uchar",tileSize:256,tileOverlap:0,tileContainer:"fs",tileLayout:"dz",tileFormat:"last",tileDepth:"last",tileAngle:0,tileSkipBlanks:-1,tileBackground:[255,255,255,255],tileCentre:!1,tileId:"https://example.com/iiif",tileBasename:"",timeoutSeconds:0,linearA:[],linearB:[],pdfBackground:[255,255,255,255],debuglog:r=>{this.emit("warning",r),Ql(r)},queueListener:Zl},this.options.input=this._createInputDescriptor(e,t,{allowStream:!0}),this):new ft(e,t)};Object.setPrototypeOf(ft.prototype,jr.Duplex.prototype);Object.setPrototypeOf(ft,jr.Duplex);function ec(){let e=this.constructor.call(),{debuglog:t,queueListener:r,...s}=this.options;return e.options=structuredClone(s),e.options.debuglog=t,e.options.queueListener=r,this._isStreamInput()&&this.on("finish",()=>{this._flattenBufferIn(),e.options.input.buffer=this.options.input.buffer,e.emit("finish")}),e}Object.assign(ft.prototype,{clone:ec});Xn.exports=ft});var Zn=q((kd,Qn)=>{g();var h=Oe(),tt=Ct(),tc={left:"low",top:"low",low:"low",center:"centre",centre:"centre",right:"high",bottom:"high",high:"high"},rc=["failOn","limitInputPixels","unlimited","animated","autoOrient","density","ignoreIcc","page","pages","sequentialRead","jp2","openSlide","pdf","raw","svg","tiff","failOnError","openSlideLevel","pdfBackground","tiffSubifd"];function Yn(e){let t=rc.filter(r=>h.defined(e[r])).map(r=>[r,e[r]]);return t.length?Object.fromEntries(t):void 0}function sc(e,t,r){let s={autoOrient:!1,failOn:"warning",limitInputPixels:268402689,ignoreIcc:!1,unlimited:!1,sequentialRead:!0};if(h.string(e))s.file=e;else if(h.buffer(e)){if(e.length===0)throw Error("Input Buffer is empty");s.buffer=e}else if(h.arrayBuffer(e)){if(e.byteLength===0)throw Error("Input bit Array is empty");s.buffer=v.from(e,0,e.byteLength)}else if(h.typedArray(e)){if(e.length===0)throw Error("Input Bit Array is empty");s.buffer=v.from(e.buffer,e.byteOffset,e.byteLength)}else if(h.plainObject(e)&&!h.defined(t))t=e,Yn(t)&&(s.buffer=[]);else if(!h.defined(e)&&!h.defined(t)&&h.object(r)&&r.allowStream)s.buffer=[];else if(Array.isArray(e))if(e.length>1)if(!this.options.joining)this.options.joining=!0,this.options.join=e.map(n=>this._createInputDescriptor(n));else throw new Error("Recursive join is unsupported");else throw new Error("Expected at least two images to join");else throw new Error(`Unsupported input '${e}' of type ${typeof e}${h.defined(t)?` when also providing options of type ${typeof t}`:""}`);if(h.object(t)){if(h.defined(t.failOnError))if(h.bool(t.failOnError))s.failOn=t.failOnError?"warning":"none";else throw h.invalidParameterError("failOnError","boolean",t.failOnError);if(h.defined(t.failOn))if(h.string(t.failOn)&&h.inArray(t.failOn,["none","truncated","error","warning"]))s.failOn=t.failOn;else throw h.invalidParameterError("failOn","one of: none, truncated, error, warning",t.failOn);if(h.defined(t.autoOrient))if(h.bool(t.autoOrient))s.autoOrient=t.autoOrient;else throw h.invalidParameterError("autoOrient","boolean",t.autoOrient);if(h.defined(t.density))if(h.inRange(t.density,1,1e5))s.density=t.density;else throw h.invalidParameterError("density","number between 1 and 100000",t.density);if(h.defined(t.ignoreIcc))if(h.bool(t.ignoreIcc))s.ignoreIcc=t.ignoreIcc;else throw h.invalidParameterError("ignoreIcc","boolean",t.ignoreIcc);if(h.defined(t.limitInputPixels))if(h.bool(t.limitInputPixels))s.limitInputPixels=t.limitInputPixels?16383**2:0;else if(h.integer(t.limitInputPixels)&&h.inRange(t.limitInputPixels,0,Number.MAX_SAFE_INTEGER))s.limitInputPixels=t.limitInputPixels;else throw h.invalidParameterError("limitInputPixels","positive integer",t.limitInputPixels);if(h.defined(t.unlimited))if(h.bool(t.unlimited))s.unlimited=t.unlimited;else throw h.invalidParameterError("unlimited","boolean",t.unlimited);if(h.defined(t.sequentialRead))if(h.bool(t.sequentialRead))s.sequentialRead=t.sequentialRead;else throw h.invalidParameterError("sequentialRead","boolean",t.sequentialRead);if(h.defined(t.raw)){if(h.object(t.raw)&&h.integer(t.raw.width)&&t.raw.width>0&&h.integer(t.raw.height)&&t.raw.height>0&&h.integer(t.raw.channels)&&h.inRange(t.raw.channels,1,4))switch(s.rawWidth=t.raw.width,s.rawHeight=t.raw.height,s.rawChannels=t.raw.channels,e.constructor){case Uint8Array:case Uint8ClampedArray:s.rawDepth="uchar";break;case Int8Array:s.rawDepth="char";break;case Uint16Array:s.rawDepth="ushort";break;case Int16Array:s.rawDepth="short";break;case Uint32Array:s.rawDepth="uint";break;case Int32Array:s.rawDepth="int";break;case Float32Array:s.rawDepth="float";break;case Float64Array:s.rawDepth="double";break;default:s.rawDepth="uchar";break}else throw new Error("Expected width, height and channels for raw pixel input");if(s.rawPremultiplied=!1,h.defined(t.raw.premultiplied))if(h.bool(t.raw.premultiplied))s.rawPremultiplied=t.raw.premultiplied;else throw h.invalidParameterError("raw.premultiplied","boolean",t.raw.premultiplied);if(s.rawPageHeight=0,h.defined(t.raw.pageHeight))if(h.integer(t.raw.pageHeight)&&t.raw.pageHeight>0&&t.raw.pageHeight<=t.raw.height){if(t.raw.height%t.raw.pageHeight!==0)throw new Error(`Expected raw.height ${t.raw.height} to be a multiple of raw.pageHeight ${t.raw.pageHeight}`);s.rawPageHeight=t.raw.pageHeight}else throw h.invalidParameterError("raw.pageHeight","positive integer",t.raw.pageHeight)}if(h.defined(t.animated))if(h.bool(t.animated))s.pages=t.animated?-1:1;else throw h.invalidParameterError("animated","boolean",t.animated);if(h.defined(t.pages))if(h.integer(t.pages)&&h.inRange(t.pages,-1,1e5))s.pages=t.pages;else throw h.invalidParameterError("pages","integer between -1 and 100000",t.pages);if(h.defined(t.page))if(h.integer(t.page)&&h.inRange(t.page,0,1e5))s.page=t.page;else throw h.invalidParameterError("page","integer between 0 and 100000",t.page);if(h.object(t.openSlide)&&h.defined(t.openSlide.level))if(h.integer(t.openSlide.level)&&h.inRange(t.openSlide.level,0,256))s.openSlideLevel=t.openSlide.level;else throw h.invalidParameterError("openSlide.level","integer between 0 and 256",t.openSlide.level);else if(h.defined(t.level))if(h.integer(t.level)&&h.inRange(t.level,0,256))s.openSlideLevel=t.level;else throw h.invalidParameterError("level","integer between 0 and 256",t.level);if(h.object(t.tiff)&&h.defined(t.tiff.subifd))if(h.integer(t.tiff.subifd)&&h.inRange(t.tiff.subifd,-1,1e5))s.tiffSubifd=t.tiff.subifd;else throw h.invalidParameterError("tiff.subifd","integer between -1 and 100000",t.tiff.subifd);else if(h.defined(t.subifd))if(h.integer(t.subifd)&&h.inRange(t.subifd,-1,1e5))s.tiffSubifd=t.subifd;else throw h.invalidParameterError("subifd","integer between -1 and 100000",t.subifd);if(h.object(t.svg)){if(h.defined(t.svg.stylesheet))if(h.string(t.svg.stylesheet))s.svgStylesheet=t.svg.stylesheet;else throw h.invalidParameterError("svg.stylesheet","string",t.svg.stylesheet);if(h.defined(t.svg.highBitdepth))if(h.bool(t.svg.highBitdepth))s.svgHighBitdepth=t.svg.highBitdepth;else throw h.invalidParameterError("svg.highBitdepth","boolean",t.svg.highBitdepth)}if(h.object(t.pdf)&&h.defined(t.pdf.background)?s.pdfBackground=this._getBackgroundColourOption(t.pdf.background):h.defined(t.pdfBackground)&&(s.pdfBackground=this._getBackgroundColourOption(t.pdfBackground)),h.object(t.jp2)&&h.defined(t.jp2.oneshot))if(h.bool(t.jp2.oneshot))s.jp2Oneshot=t.jp2.oneshot;else throw h.invalidParameterError("jp2.oneshot","boolean",t.jp2.oneshot);if(h.defined(t.create))if(h.object(t.create)&&h.integer(t.create.width)&&t.create.width>0&&h.integer(t.create.height)&&t.create.height>0&&h.integer(t.create.channels)){if(s.createWidth=t.create.width,s.createHeight=t.create.height,s.createChannels=t.create.channels,s.createPageHeight=0,h.defined(t.create.pageHeight))if(h.integer(t.create.pageHeight)&&t.create.pageHeight>0&&t.create.pageHeight<=t.create.height){if(t.create.height%t.create.pageHeight!==0)throw new Error(`Expected create.height ${t.create.height} to be a multiple of create.pageHeight ${t.create.pageHeight}`);s.createPageHeight=t.create.pageHeight}else throw h.invalidParameterError("create.pageHeight","positive integer",t.create.pageHeight);if(h.defined(t.create.noise)){if(!h.object(t.create.noise))throw new Error("Expected noise to be an object");if(t.create.noise.type!=="gaussian")throw new Error("Only gaussian noise is supported at the moment");if(s.createNoiseType=t.create.noise.type,!h.inRange(t.create.channels,1,4))throw h.invalidParameterError("create.channels","number between 1 and 4",t.create.channels);if(s.createNoiseMean=128,h.defined(t.create.noise.mean))if(h.number(t.create.noise.mean)&&h.inRange(t.create.noise.mean,0,1e4))s.createNoiseMean=t.create.noise.mean;else throw h.invalidParameterError("create.noise.mean","number between 0 and 10000",t.create.noise.mean);if(s.createNoiseSigma=30,h.defined(t.create.noise.sigma))if(h.number(t.create.noise.sigma)&&h.inRange(t.create.noise.sigma,0,1e4))s.createNoiseSigma=t.create.noise.sigma;else throw h.invalidParameterError("create.noise.sigma","number between 0 and 10000",t.create.noise.sigma)}else if(h.defined(t.create.background)){if(!h.inRange(t.create.channels,3,4))throw h.invalidParameterError("create.channels","number between 3 and 4",t.create.channels);s.createBackground=this._getBackgroundColourOption(t.create.background)}else throw new Error("Expected valid noise or background to create a new input image");delete s.buffer}else throw new Error("Expected valid width, height and channels to create a new input image");if(h.defined(t.text))if(h.object(t.text)&&h.string(t.text.text)){if(s.textValue=t.text.text,h.defined(t.text.height)&&h.defined(t.text.dpi))throw new Error("Expected only one of dpi or height");if(h.defined(t.text.font))if(h.string(t.text.font))s.textFont=t.text.font;else throw h.invalidParameterError("text.font","string",t.text.font);if(h.defined(t.text.fontfile))if(h.string(t.text.fontfile))s.textFontfile=t.text.fontfile;else throw h.invalidParameterError("text.fontfile","string",t.text.fontfile);if(h.defined(t.text.width))if(h.integer(t.text.width)&&t.text.width>0)s.textWidth=t.text.width;else throw h.invalidParameterError("text.width","positive integer",t.text.width);if(h.defined(t.text.height))if(h.integer(t.text.height)&&t.text.height>0)s.textHeight=t.text.height;else throw h.invalidParameterError("text.height","positive integer",t.text.height);if(h.defined(t.text.align))if(h.string(t.text.align)&&h.string(this.constructor.align[t.text.align]))s.textAlign=this.constructor.align[t.text.align];else throw h.invalidParameterError("text.align","valid alignment",t.text.align);if(h.defined(t.text.justify))if(h.bool(t.text.justify))s.textJustify=t.text.justify;else throw h.invalidParameterError("text.justify","boolean",t.text.justify);if(h.defined(t.text.dpi))if(h.integer(t.text.dpi)&&h.inRange(t.text.dpi,1,1e6))s.textDpi=t.text.dpi;else throw h.invalidParameterError("text.dpi","integer between 1 and 1000000",t.text.dpi);if(h.defined(t.text.rgba))if(h.bool(t.text.rgba))s.textRgba=t.text.rgba;else throw h.invalidParameterError("text.rgba","bool",t.text.rgba);if(h.defined(t.text.spacing))if(h.integer(t.text.spacing)&&h.inRange(t.text.spacing,-1e6,1e6))s.textSpacing=t.text.spacing;else throw h.invalidParameterError("text.spacing","integer between -1000000 and 1000000",t.text.spacing);if(h.defined(t.text.wrap))if(h.string(t.text.wrap)&&h.inArray(t.text.wrap,["word","char","word-char","none"]))s.textWrap=t.text.wrap;else throw h.invalidParameterError("text.wrap","one of: word, char, word-char, none",t.text.wrap);delete s.buffer}else throw new Error("Expected a valid string to create an image with text.");if(h.defined(t.join))if(h.defined(this.options.join)){if(h.defined(t.join.animated))if(h.bool(t.join.animated))s.joinAnimated=t.join.animated;else throw h.invalidParameterError("join.animated","boolean",t.join.animated);if(h.defined(t.join.across))if(h.integer(t.join.across)&&h.inRange(t.join.across,1,1e6))s.joinAcross=t.join.across;else throw h.invalidParameterError("join.across","integer between 1 and 100000",t.join.across);if(h.defined(t.join.shim))if(h.integer(t.join.shim)&&h.inRange(t.join.shim,0,1e6))s.joinShim=t.join.shim;else throw h.invalidParameterError("join.shim","integer between 0 and 100000",t.join.shim);if(h.defined(t.join.background)&&(s.joinBackground=this._getBackgroundColourOption(t.join.background)),h.defined(t.join.halign))if(h.string(t.join.halign)&&h.string(this.constructor.align[t.join.halign]))s.joinHalign=this.constructor.align[t.join.halign];else throw h.invalidParameterError("join.halign","valid alignment",t.join.halign);if(h.defined(t.join.valign))if(h.string(t.join.valign)&&h.string(this.constructor.align[t.join.valign]))s.joinValign=this.constructor.align[t.join.valign];else throw h.invalidParameterError("join.valign","valid alignment",t.join.valign)}else throw new Error("Expected input to be an array of images to join")}else if(h.defined(t))throw new Error(`Invalid input options ${t}`);return s}function nc(e,t,r){Array.isArray(this.options.input.buffer)?h.buffer(e)?(this.options.input.buffer.length===0&&this.on("finish",()=>{this.streamInFinished=!0}),this.options.input.buffer.push(e),r()):r(new Error("Non-Buffer data on Writable Stream")):r(new Error("Unexpected data on Writable Stream"))}function ic(){this._isStreamInput()&&(this.options.input.buffer=v.concat(this.options.input.buffer))}function oc(){return Array.isArray(this.options.input.buffer)}function ac(e){let t=Error();return h.fn(e)?(this._isStreamInput()?this.on("finish",()=>{this._flattenBufferIn(),tt.metadata(this.options,(r,s)=>{r?e(h.nativeError(r,t)):e(null,s)})}):tt.metadata(this.options,(r,s)=>{r?e(h.nativeError(r,t)):e(null,s)}),this):this._isStreamInput()?new Promise((r,s)=>{let n=()=>{this._flattenBufferIn(),tt.metadata(this.options,(i,o)=>{i?s(h.nativeError(i,t)):r(o)})};this.writableFinished?n():this.once("finish",n)}):new Promise((r,s)=>{tt.metadata(this.options,(n,i)=>{n?s(h.nativeError(n,t)):r(i)})})}function lc(e){let t=Error();return h.fn(e)?(this._isStreamInput()?this.on("finish",()=>{this._flattenBufferIn(),tt.stats(this.options,(r,s)=>{r?e(h.nativeError(r,t)):e(null,s)})}):tt.stats(this.options,(r,s)=>{r?e(h.nativeError(r,t)):e(null,s)}),this):this._isStreamInput()?new Promise((r,s)=>{this.on("finish",function(){this._flattenBufferIn(),tt.stats(this.options,(n,i)=>{n?s(h.nativeError(n,t)):r(i)})})}):new Promise((r,s)=>{tt.stats(this.options,(n,i)=>{n?s(h.nativeError(n,t)):r(i)})})}Qn.exports=e=>{Object.assign(e.prototype,{_inputOptionsFromObject:Yn,_createInputDescriptor:sc,_write:nc,_flattenBufferIn:ic,_isStreamInput:oc,metadata:ac,stats:lc}),e.align=tc}});var ii=q((_d,ni)=>{g();var D=Oe(),ti={center:0,centre:0,north:1,east:2,south:3,west:4,northeast:5,southeast:6,southwest:7,northwest:8},ri={top:1,right:2,bottom:3,left:4,"right top":5,"right bottom":6,"left bottom":7,"left top":8},ei={background:"background",copy:"copy",repeat:"repeat",mirror:"mirror"},si={entropy:16,attention:17},Lr={nearest:"nearest",linear:"linear",cubic:"cubic",mitchell:"mitchell",lanczos2:"lanczos2",lanczos3:"lanczos3",mks2013:"mks2013",mks2021:"mks2021"},cc={contain:"contain",cover:"cover",fill:"fill",inside:"inside",outside:"outside"},uc={contain:"embed",cover:"crop",fill:"ignore_aspect",inside:"max",outside:"min"};function Mr(e){return e.angle%360!==0||e.rotationAngle!==0}function rr(e){return e.width!==-1||e.height!==-1}function fc(e,t,r){if(rr(this.options)&&this.options.debuglog("ignoring previous resize options"),this.options.widthPost!==-1&&this.options.debuglog("operation order will be: extract, resize, extract"),D.defined(e))if(D.object(e)&&!D.defined(r))r=e;else if(D.integer(e)&&e>0)this.options.width=e;else throw D.invalidParameterError("width","positive integer",e);else this.options.width=-1;if(D.defined(t))if(D.integer(t)&&t>0)this.options.height=t;else throw D.invalidParameterError("height","positive integer",t);else this.options.height=-1;if(D.object(r)){if(D.defined(r.width))if(D.integer(r.width)&&r.width>0)this.options.width=r.width;else throw D.invalidParameterError("width","positive integer",r.width);if(D.defined(r.height))if(D.integer(r.height)&&r.height>0)this.options.height=r.height;else throw D.invalidParameterError("height","positive integer",r.height);if(D.defined(r.fit)){let s=uc[r.fit];if(D.string(s))this.options.canvas=s;else throw D.invalidParameterError("fit","valid fit",r.fit)}if(D.defined(r.position)){let s=D.integer(r.position)?r.position:si[r.position]||ri[r.position]||ti[r.position];if(D.integer(s)&&(D.inRange(s,0,8)||D.inRange(s,16,17)))this.options.position=s;else throw D.invalidParameterError("position","valid position/gravity/strategy",r.position)}if(this._setBackgroundColourOption("resizeBackground",r.background),D.defined(r.kernel))if(D.string(Lr[r.kernel]))this.options.kernel=Lr[r.kernel];else throw D.invalidParameterError("kernel","valid kernel name",r.kernel);D.defined(r.withoutEnlargement)&&this._setBooleanOption("withoutEnlargement",r.withoutEnlargement),D.defined(r.withoutReduction)&&this._setBooleanOption("withoutReduction",r.withoutReduction),D.defined(r.fastShrinkOnLoad)&&this._setBooleanOption("fastShrinkOnLoad",r.fastShrinkOnLoad)}return Mr(this.options)&&rr(this.options)&&(this.options.rotateBefore=!0),this}function hc(e){if(D.integer(e)&&e>0)this.options.extendTop=e,this.options.extendBottom=e,this.options.extendLeft=e,this.options.extendRight=e;else if(D.object(e)){if(D.defined(e.top))if(D.integer(e.top)&&e.top>=0)this.options.extendTop=e.top;else throw D.invalidParameterError("top","positive integer",e.top);if(D.defined(e.bottom))if(D.integer(e.bottom)&&e.bottom>=0)this.options.extendBottom=e.bottom;else throw D.invalidParameterError("bottom","positive integer",e.bottom);if(D.defined(e.left))if(D.integer(e.left)&&e.left>=0)this.options.extendLeft=e.left;else throw D.invalidParameterError("left","positive integer",e.left);if(D.defined(e.right))if(D.integer(e.right)&&e.right>=0)this.options.extendRight=e.right;else throw D.invalidParameterError("right","positive integer",e.right);if(this._setBackgroundColourOption("extendBackground",e.background),D.defined(e.extendWith))if(D.string(ei[e.extendWith]))this.options.extendWith=ei[e.extendWith];else throw D.invalidParameterError("extendWith","one of: background, copy, repeat, mirror",e.extendWith)}else throw D.invalidParameterError("extend","integer or object",e);return this}function dc(e){let t=rr(this.options)||this.options.widthPre!==-1?"Post":"Pre";return this.options[`width${t}`]!==-1&&this.options.debuglog("ignoring previous extract options"),["left","top","width","height"].forEach(function(r){let s=e[r];if(D.integer(s)&&s>=0)this.options[r+(r==="left"||r==="top"?"Offset":"")+t]=s;else throw D.invalidParameterError(r,"integer",s)},this),Mr(this.options)&&!rr(this.options)&&(this.options.widthPre===-1||this.options.widthPost===-1)&&(this.options.rotateBefore=!0),this.options.input.autoOrient&&(this.options.orientBefore=!0),this}function gc(e){if(this.options.trimThreshold=10,D.defined(e))if(D.object(e)){if(D.defined(e.background)&&this._setBackgroundColourOption("trimBackground",e.background),D.defined(e.threshold))if(D.number(e.threshold)&&e.threshold>=0)this.options.trimThreshold=e.threshold;else throw D.invalidParameterError("threshold","positive number",e.threshold);D.defined(e.lineArt)&&this._setBooleanOption("trimLineArt",e.lineArt)}else throw D.invalidParameterError("trim","object",e);return Mr(this.options)&&(this.options.rotateBefore=!0),this}ni.exports=e=>{Object.assign(e.prototype,{resize:fc,extend:hc,extract:dc,trim:gc}),e.gravity=ti,e.strategy=si,e.kernel=Lr,e.fit=cc,e.position=ri}});var ai=q((Id,oi)=>{g();var Z=Oe(),zr={clear:"clear",source:"source",over:"over",in:"in",out:"out",atop:"atop",dest:"dest","dest-over":"dest-over","dest-in":"dest-in","dest-out":"dest-out","dest-atop":"dest-atop",xor:"xor",add:"add",saturate:"saturate",multiply:"multiply",screen:"screen",overlay:"overlay",darken:"darken",lighten:"lighten","colour-dodge":"colour-dodge","color-dodge":"colour-dodge","colour-burn":"colour-burn","color-burn":"colour-burn","hard-light":"hard-light","soft-light":"soft-light",difference:"difference",exclusion:"exclusion"};function pc(e){if(!Array.isArray(e))throw Z.invalidParameterError("images to composite","array",e);return this.options.composite=e.map(t=>{if(!Z.object(t))throw Z.invalidParameterError("image to composite","object",t);let r=this._inputOptionsFromObject(t),s={input:this._createInputDescriptor(t.input,r,{allowStream:!1}),blend:"over",tile:!1,left:0,top:0,hasOffset:!1,gravity:0,premultiplied:!1};if(Z.defined(t.blend))if(Z.string(zr[t.blend]))s.blend=zr[t.blend];else throw Z.invalidParameterError("blend","valid blend name",t.blend);if(Z.defined(t.tile))if(Z.bool(t.tile))s.tile=t.tile;else throw Z.invalidParameterError("tile","boolean",t.tile);if(Z.defined(t.left))if(Z.integer(t.left))s.left=t.left;else throw Z.invalidParameterError("left","integer",t.left);if(Z.defined(t.top))if(Z.integer(t.top))s.top=t.top;else throw Z.invalidParameterError("top","integer",t.top);if(Z.defined(t.top)!==Z.defined(t.left))throw new Error("Expected both left and top to be set");if(s.hasOffset=Z.integer(t.top)&&Z.integer(t.left),Z.defined(t.gravity))if(Z.integer(t.gravity)&&Z.inRange(t.gravity,0,8))s.gravity=t.gravity;else if(Z.string(t.gravity)&&Z.integer(this.constructor.gravity[t.gravity]))s.gravity=this.constructor.gravity[t.gravity];else throw Z.invalidParameterError("gravity","valid gravity",t.gravity);if(Z.defined(t.premultiplied))if(Z.bool(t.premultiplied))s.premultiplied=t.premultiplied;else throw Z.invalidParameterError("premultiplied","boolean",t.premultiplied);return s}),this}oi.exports=e=>{e.prototype.composite=pc,e.blend=zr}});var hi=q((Dd,fi)=>{g();var d=Oe(),li={integer:"integer",float:"float",approximate:"approximate"};function mc(e,t){if(!d.defined(e))return this.autoOrient();if((this.options.angle||this.options.rotationAngle)&&(this.options.debuglog("ignoring previous rotate options"),this.options.angle=0,this.options.rotationAngle=0),d.integer(e)&&!(e%90))this.options.angle=e;else if(d.number(e))this.options.rotationAngle=e,d.object(t)&&t.background&&this._setBackgroundColourOption("rotationBackground",t.background);else throw d.invalidParameterError("angle","numeric",e);return this}function bc(){return this.options.input.autoOrient=!0,this}function vc(e){return this.options.flip=d.bool(e)?e:!0,this}function yc(e){return this.options.flop=d.bool(e)?e:!0,this}function wc(e,t){let r=[].concat(...e);if(r.length===4&&r.every(d.number))this.options.affineMatrix=r;else throw d.invalidParameterError("matrix","1x4 or 2x2 array",e);if(d.defined(t))if(d.object(t)){if(this._setBackgroundColourOption("affineBackground",t.background),d.defined(t.idx))if(d.number(t.idx))this.options.affineIdx=t.idx;else throw d.invalidParameterError("options.idx","number",t.idx);if(d.defined(t.idy))if(d.number(t.idy))this.options.affineIdy=t.idy;else throw d.invalidParameterError("options.idy","number",t.idy);if(d.defined(t.odx))if(d.number(t.odx))this.options.affineOdx=t.odx;else throw d.invalidParameterError("options.odx","number",t.odx);if(d.defined(t.ody))if(d.number(t.ody))this.options.affineOdy=t.ody;else throw d.invalidParameterError("options.ody","number",t.ody);if(d.defined(t.interpolator))if(d.inArray(t.interpolator,Object.values(this.constructor.interpolators)))this.options.affineInterpolator=t.interpolator;else throw d.invalidParameterError("options.interpolator","valid interpolator name",t.interpolator)}else throw d.invalidParameterError("options","object",t);return this}function Ec(e,t,r){if(!d.defined(e))this.options.sharpenSigma=-1;else if(d.bool(e))this.options.sharpenSigma=e?-1:0;else if(d.number(e)&&d.inRange(e,.01,1e4)){if(this.options.sharpenSigma=e,d.defined(t))if(d.number(t)&&d.inRange(t,0,1e4))this.options.sharpenM1=t;else throw d.invalidParameterError("flat","number between 0 and 10000",t);if(d.defined(r))if(d.number(r)&&d.inRange(r,0,1e4))this.options.sharpenM2=r;else throw d.invalidParameterError("jagged","number between 0 and 10000",r)}else if(d.plainObject(e)){if(d.number(e.sigma)&&d.inRange(e.sigma,1e-6,10))this.options.sharpenSigma=e.sigma;else throw d.invalidParameterError("options.sigma","number between 0.000001 and 10",e.sigma);if(d.defined(e.m1))if(d.number(e.m1)&&d.inRange(e.m1,0,1e6))this.options.sharpenM1=e.m1;else throw d.invalidParameterError("options.m1","number between 0 and 1000000",e.m1);if(d.defined(e.m2))if(d.number(e.m2)&&d.inRange(e.m2,0,1e6))this.options.sharpenM2=e.m2;else throw d.invalidParameterError("options.m2","number between 0 and 1000000",e.m2);if(d.defined(e.x1))if(d.number(e.x1)&&d.inRange(e.x1,0,1e6))this.options.sharpenX1=e.x1;else throw d.invalidParameterError("options.x1","number between 0 and 1000000",e.x1);if(d.defined(e.y2))if(d.number(e.y2)&&d.inRange(e.y2,0,1e6))this.options.sharpenY2=e.y2;else throw d.invalidParameterError("options.y2","number between 0 and 1000000",e.y2);if(d.defined(e.y3))if(d.number(e.y3)&&d.inRange(e.y3,0,1e6))this.options.sharpenY3=e.y3;else throw d.invalidParameterError("options.y3","number between 0 and 1000000",e.y3)}else throw d.invalidParameterError("sigma","number between 0.01 and 10000",e);return this}function xc(e){if(!d.defined(e))this.options.medianSize=3;else if(d.integer(e)&&d.inRange(e,1,1e3))this.options.medianSize=e;else throw d.invalidParameterError("size","integer between 1 and 1000",e);return this}function Pc(e){let t;if(d.number(e))t=e;else if(d.plainObject(e)){if(!d.number(e.sigma))throw d.invalidParameterError("options.sigma","number between 0.3 and 1000",t);if(t=e.sigma,"precision"in e)if(d.string(li[e.precision]))this.options.precision=li[e.precision];else throw d.invalidParameterError("precision","one of: integer, float, approximate",e.precision);if("minAmplitude"in e)if(d.number(e.minAmplitude)&&d.inRange(e.minAmplitude,.001,1))this.options.minAmpl=e.minAmplitude;else throw d.invalidParameterError("minAmplitude","number between 0.001 and 1",e.minAmplitude)}if(!d.defined(e))this.options.blurSigma=-1;else if(d.bool(e))this.options.blurSigma=e?-1:0;else if(d.number(t)&&d.inRange(t,.3,1e3))this.options.blurSigma=t;else throw d.invalidParameterError("sigma","number between 0.3 and 1000",t);return this}function ci(e){if(!d.defined(e))this.options.dilateWidth=1;else if(d.integer(e)&&e>0)this.options.dilateWidth=e;else throw d.invalidParameterError("dilate","positive integer",ci);return this}function ui(e){if(!d.defined(e))this.options.erodeWidth=1;else if(d.integer(e)&&e>0)this.options.erodeWidth=e;else throw d.invalidParameterError("erode","positive integer",ui);return this}function Rc(e){return this.options.flatten=d.bool(e)?e:!0,d.object(e)&&this._setBackgroundColourOption("flattenBackground",e.background),this}function Sc(){return this.options.unflatten=!0,this}function $c(e,t){if(!d.defined(e))this.options.gamma=2.2;else if(d.number(e)&&d.inRange(e,1,3))this.options.gamma=e;else throw d.invalidParameterError("gamma","number between 1.0 and 3.0",e);if(!d.defined(t))this.options.gammaOut=this.options.gamma;else if(d.number(t)&&d.inRange(t,1,3))this.options.gammaOut=t;else throw d.invalidParameterError("gammaOut","number between 1.0 and 3.0",t);return this}function kc(e){if(this.options.negate=d.bool(e)?e:!0,d.plainObject(e)&&"alpha"in e)if(d.bool(e.alpha))this.options.negateAlpha=e.alpha;else throw d.invalidParameterError("alpha","should be boolean value",e.alpha);return this}function Ac(e){if(d.plainObject(e)){if(d.defined(e.lower))if(d.number(e.lower)&&d.inRange(e.lower,0,99))this.options.normaliseLower=e.lower;else throw d.invalidParameterError("lower","number between 0 and 99",e.lower);if(d.defined(e.upper))if(d.number(e.upper)&&d.inRange(e.upper,1,100))this.options.normaliseUpper=e.upper;else throw d.invalidParameterError("upper","number between 1 and 100",e.upper)}if(this.options.normaliseLower>=this.options.normaliseUpper)throw d.invalidParameterError("range","lower to be less than upper",`${this.options.normaliseLower} >= ${this.options.normaliseUpper}`);return this.options.normalise=!0,this}function _c(e){return this.normalise(e)}function Nc(e){if(d.plainObject(e)){if(d.integer(e.width)&&e.width>0)this.options.claheWidth=e.width;else throw d.invalidParameterError("width","integer greater than zero",e.width);if(d.integer(e.height)&&e.height>0)this.options.claheHeight=e.height;else throw d.invalidParameterError("height","integer greater than zero",e.height);if(d.defined(e.maxSlope))if(d.integer(e.maxSlope)&&d.inRange(e.maxSlope,0,100))this.options.claheMaxSlope=e.maxSlope;else throw d.invalidParameterError("maxSlope","integer between 0 and 100",e.maxSlope)}else throw d.invalidParameterError("options","plain object",e);return this}function Ic(e){if(!d.object(e)||!Array.isArray(e.kernel)||!d.integer(e.width)||!d.integer(e.height)||!d.inRange(e.width,3,1001)||!d.inRange(e.height,3,1001)||e.height*e.width!==e.kernel.length)throw new Error("Invalid convolution kernel");return d.integer(e.scale)||(e.scale=e.kernel.reduce((t,r)=>t+r,0)),e.scale<1&&(e.scale=1),d.integer(e.offset)||(e.offset=0),this.options.convKernel=e,this}function Tc(e,t){if(!d.defined(e))this.options.threshold=128;else if(d.bool(e))this.options.threshold=e?128:0;else if(d.integer(e)&&d.inRange(e,0,255))this.options.threshold=e;else throw d.invalidParameterError("threshold","integer between 0 and 255",e);return!d.object(t)||t.greyscale===!0||t.grayscale===!0?this.options.thresholdGrayscale=!0:this.options.thresholdGrayscale=!1,this}function Dc(e,t,r){if(this.options.boolean=this._createInputDescriptor(e,r),d.string(t)&&d.inArray(t,["and","or","eor"]))this.options.booleanOp=t;else throw d.invalidParameterError("operator","one of: and, or, eor",t);return this}function Cc(e,t){if(!d.defined(e)&&d.number(t)?e=1:d.number(e)&&!d.defined(t)&&(t=0),!d.defined(e))this.options.linearA=[];else if(d.number(e))this.options.linearA=[e];else if(Array.isArray(e)&&e.length&&e.every(d.number))this.options.linearA=e;else throw d.invalidParameterError("a","number or array of numbers",e);if(!d.defined(t))this.options.linearB=[];else if(d.number(t))this.options.linearB=[t];else if(Array.isArray(t)&&t.length&&t.every(d.number))this.options.linearB=t;else throw d.invalidParameterError("b","number or array of numbers",t);if(this.options.linearA.length!==this.options.linearB.length)throw new Error("Expected a and b to be arrays of the same length");return this}function Fc(e){if(!Array.isArray(e))throw d.invalidParameterError("inputMatrix","array",e);if(e.length!==3&&e.length!==4)throw d.invalidParameterError("inputMatrix","3x3 or 4x4 array",e.length);let t=e.flat().map(Number);if(t.length!==9&&t.length!==16)throw d.invalidParameterError("inputMatrix","cardinality of 9 or 16",t.length);return this.options.recombMatrix=t,this}function Oc(e){if(!d.plainObject(e))throw d.invalidParameterError("options","plain object",e);if("brightness"in e)if(d.number(e.brightness)&&e.brightness>=0)this.options.brightness=e.brightness;else throw d.invalidParameterError("brightness","number above zero",e.brightness);if("saturation"in e)if(d.number(e.saturation)&&e.saturation>=0)this.options.saturation=e.saturation;else throw d.invalidParameterError("saturation","number above zero",e.saturation);if("hue"in e)if(d.integer(e.hue))this.options.hue=e.hue%360;else throw d.invalidParameterError("hue","number",e.hue);if("lightness"in e)if(d.number(e.lightness))this.options.lightness=e.lightness;else throw d.invalidParameterError("lightness","number",e.lightness);return this}fi.exports=e=>{Object.assign(e.prototype,{autoOrient:bc,rotate:mc,flip:vc,flop:yc,affine:wc,sharpen:Ec,erode:ui,dilate:ci,median:xc,blur:Pc,flatten:Rc,unflatten:Sc,gamma:$c,negate:kc,normalise:Ac,normalize:_c,clahe:Nc,convolve:Ic,threshold:Tc,boolean:Dc,linear:Cc,recomb:Fc,modulate:Oc})}});var vi=q((Fd,bi)=>{g();var qr=Object.defineProperty,jc=Object.getOwnPropertyDescriptor,Lc=Object.getOwnPropertyNames,Mc=Object.prototype.hasOwnProperty,zc=(e,t)=>{for(var r in t)qr(e,r,{get:t[r],enumerable:!0})},Bc=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Lc(t))!Mc.call(e,n)&&n!==r&&qr(e,n,{get:()=>t[n],enumerable:!(s=jc(t,n))||s.enumerable});return e},Uc=e=>Bc(qr({},"__esModule",{value:!0}),e),di={};zc(di,{default:()=>ru});bi.exports=Uc(di);var Be={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},gi=Object.create(null);for(let e in Be)Object.hasOwn(Be,e)&&(gi[Be[e]]=e);var Pe={to:{},get:{}};Pe.get=function(e){let t=e.slice(0,3).toLowerCase(),r,s;switch(t){case"hsl":{r=Pe.get.hsl(e),s="hsl";break}case"hwb":{r=Pe.get.hwb(e),s="hwb";break}default:{r=Pe.get.rgb(e),s="rgb";break}}return r?{model:s,value:r}:null};Pe.get.rgb=function(e){if(!e)return null;let t=/^#([a-f\d]{3,4})$/i,r=/^#([a-f\d]{6})([a-f\d]{2})?$/i,s=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/,n=/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/,i=/^(\w+)$/,o=[0,0,0,1],a,c,u;if(a=e.match(r)){for(u=a[2],a=a[1],c=0;c<3;c++){let f=c*2;o[c]=Number.parseInt(a.slice(f,f+2),16)}u&&(o[3]=Number.parseInt(u,16)/255)}else if(a=e.match(t)){for(a=a[1],u=a[3],c=0;c<3;c++)o[c]=Number.parseInt(a[c]+a[c],16);u&&(o[3]=Number.parseInt(u+u,16)/255)}else if(a=e.match(s)){for(c=0;c<3;c++)o[c]=Number.parseInt(a[c+1],10);a[4]&&(o[3]=a[5]?Number.parseFloat(a[4])*.01:Number.parseFloat(a[4]))}else if(a=e.match(n)){for(c=0;c<3;c++)o[c]=Math.round(Number.parseFloat(a[c+1])*2.55);a[4]&&(o[3]=a[5]?Number.parseFloat(a[4])*.01:Number.parseFloat(a[4]))}else return(a=e.match(i))?a[1]==="transparent"?[0,0,0,0]:Object.hasOwn(Be,a[1])?(o=Be[a[1]],o[3]=1,o):null:null;for(c=0;c<3;c++)o[c]=rt(o[c],0,255);return o[3]=rt(o[3],0,1),o};Pe.get.hsl=function(e){if(!e)return null;let t=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,r=e.match(t);if(r){let s=Number.parseFloat(r[4]),n=(Number.parseFloat(r[1])%360+360)%360,i=rt(Number.parseFloat(r[2]),0,100),o=rt(Number.parseFloat(r[3]),0,100),a=rt(Number.isNaN(s)?1:s,0,1);return[n,i,o,a]}return null};Pe.get.hwb=function(e){if(!e)return null;let t=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,r=e.match(t);if(r){let s=Number.parseFloat(r[4]),n=(Number.parseFloat(r[1])%360+360)%360,i=rt(Number.parseFloat(r[2]),0,100),o=rt(Number.parseFloat(r[3]),0,100),a=rt(Number.isNaN(s)?1:s,0,1);return[n,i,o,a]}return null};Pe.to.hex=function(...e){return"#"+sr(e[0])+sr(e[1])+sr(e[2])+(e[3]<1?sr(Math.round(e[3]*255)):"")};Pe.to.rgb=function(...e){return e.length<4||e[3]===1?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"};Pe.to.rgb.percent=function(...e){let t=Math.round(e[0]/255*100),r=Math.round(e[1]/255*100),s=Math.round(e[2]/255*100);return e.length<4||e[3]===1?"rgb("+t+"%, "+r+"%, "+s+"%)":"rgba("+t+"%, "+r+"%, "+s+"%, "+e[3]+")"};Pe.to.hsl=function(...e){return e.length<4||e[3]===1?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"};Pe.to.hwb=function(...e){let t="";return e.length>=4&&e[3]!==1&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"};Pe.to.keyword=function(...e){return gi[e.slice(0,3)]};function rt(e,t,r){return Math.min(Math.max(t,e),r)}function sr(e){let t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}var Et=Pe,pi={};for(let e of Object.keys(Be))pi[Be[e]]=e;var _={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},ht=_,He=(6/29)**3;function Pt(e){let t=e>.0031308?1.055*e**.4166666666666667-.055:e*12.92;return Math.min(Math.max(0,t),1)}function Rt(e){return e>.04045?((e+.055)/1.055)**2.4:e/12.92}for(let e of Object.keys(_)){if(!("channels"in _[e]))throw new Error("missing channels property: "+e);if(!("labels"in _[e]))throw new Error("missing channel labels property: "+e);if(_[e].labels.length!==_[e].channels)throw new Error("channel and label counts mismatch: "+e);let{channels:t,labels:r}=_[e];delete _[e].channels,delete _[e].labels,Object.defineProperty(_[e],"channels",{value:t}),Object.defineProperty(_[e],"labels",{value:r})}_.rgb.hsl=function(e){let t=e[0]/255,r=e[1]/255,s=e[2]/255,n=Math.min(t,r,s),i=Math.max(t,r,s),o=i-n,a,c;switch(i){case n:{a=0;break}case t:{a=(r-s)/o;break}case r:{a=2+(s-t)/o;break}case s:{a=4+(t-r)/o;break}}a=Math.min(a*60,360),a<0&&(a+=360);let u=(n+i)/2;return i===n?c=0:u<=.5?c=o/(i+n):c=o/(2-i-n),[a,c*100,u*100]};_.rgb.hsv=function(e){let t,r,s,n,i,o=e[0]/255,a=e[1]/255,c=e[2]/255,u=Math.max(o,a,c),f=u-Math.min(o,a,c),b=function(m){return(u-m)/6/f+1/2};if(f===0)n=0,i=0;else{switch(i=f/u,t=b(o),r=b(a),s=b(c),u){case o:{n=s-r;break}case a:{n=1/3+t-s;break}case c:{n=2/3+r-t;break}}n<0?n+=1:n>1&&(n-=1)}return[n*360,i*100,u*100]};_.rgb.hwb=function(e){let t=e[0],r=e[1],s=e[2],n=_.rgb.hsl(e)[0],i=1/255*Math.min(t,Math.min(r,s));return s=1-1/255*Math.max(t,Math.max(r,s)),[n,i*100,s*100]};_.rgb.oklab=function(e){let t=Rt(e[0]/255),r=Rt(e[1]/255),s=Rt(e[2]/255),n=Math.cbrt(.4122214708*t+.5363325363*r+.0514459929*s),i=Math.cbrt(.2119034982*t+.6806995451*r+.1073969566*s),o=Math.cbrt(.0883024619*t+.2817188376*r+.6299787005*s),a=.2104542553*n+.793617785*i-.0040720468*o,c=1.9779984951*n-2.428592205*i+.4505937099*o,u=.0259040371*n+.7827717662*i-.808675766*o;return[a*100,c*100,u*100]};_.rgb.cmyk=function(e){let t=e[0]/255,r=e[1]/255,s=e[2]/255,n=Math.min(1-t,1-r,1-s),i=(1-t-n)/(1-n)||0,o=(1-r-n)/(1-n)||0,a=(1-s-n)/(1-n)||0;return[i*100,o*100,a*100,n*100]};function Gc(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}_.rgb.keyword=function(e){let t=pi[e];if(t)return t;let r=Number.POSITIVE_INFINITY,s;for(let n of Object.keys(Be)){let i=Be[n],o=Gc(e,i);o<r&&(r=o,s=n)}return s};_.keyword.rgb=function(e){return Be[e]};_.rgb.xyz=function(e){let t=Rt(e[0]/255),r=Rt(e[1]/255),s=Rt(e[2]/255),n=t*.4124564+r*.3575761+s*.1804375,i=t*.2126729+r*.7151522+s*.072175,o=t*.0193339+r*.119192+s*.9503041;return[n*100,i*100,o*100]};_.rgb.lab=function(e){let t=_.rgb.xyz(e),r=t[0],s=t[1],n=t[2];r/=95.047,s/=100,n/=108.883,r=r>He?r**(1/3):7.787*r+16/116,s=s>He?s**(1/3):7.787*s+16/116,n=n>He?n**(1/3):7.787*n+16/116;let i=116*s-16,o=500*(r-s),a=200*(s-n);return[i,o,a]};_.hsl.rgb=function(e){let t=e[0]/360,r=e[1]/100,s=e[2]/100,n,i;if(r===0)return i=s*255,[i,i,i];let o=s<.5?s*(1+r):s+r-s*r,a=2*s-o,c=[0,0,0];for(let u=0;u<3;u++)n=t+1/3*-(u-1),n<0&&n++,n>1&&n--,6*n<1?i=a+(o-a)*6*n:2*n<1?i=o:3*n<2?i=a+(o-a)*(2/3-n)*6:i=a,c[u]=i*255;return c};_.hsl.hsv=function(e){let t=e[0],r=e[1]/100,s=e[2]/100,n=r,i=Math.max(s,.01);s*=2,r*=s<=1?s:2-s,n*=i<=1?i:2-i;let o=(s+r)/2,a=s===0?2*n/(i+n):2*r/(s+r);return[t,a*100,o*100]};_.hsv.rgb=function(e){let t=e[0]/60,r=e[1]/100,s=e[2]/100,n=Math.floor(t)%6,i=t-Math.floor(t),o=255*s*(1-r),a=255*s*(1-r*i),c=255*s*(1-r*(1-i));switch(s*=255,n){case 0:return[s,c,o];case 1:return[a,s,o];case 2:return[o,s,c];case 3:return[o,a,s];case 4:return[c,o,s];case 5:return[s,o,a]}};_.hsv.hsl=function(e){let t=e[0],r=e[1]/100,s=e[2]/100,n=Math.max(s,.01),i,o;o=(2-r)*s;let a=(2-r)*n;return i=r*n,i/=a<=1?a:2-a,i=i||0,o/=2,[t,i*100,o*100]};_.hwb.rgb=function(e){let t=e[0]/360,r=e[1]/100,s=e[2]/100,n=r+s,i;n>1&&(r/=n,s/=n);let o=Math.floor(6*t),a=1-s;i=6*t-o,(o&1)!==0&&(i=1-i);let c=r+i*(a-r),u,f,b;switch(o){default:case 6:case 0:{u=a,f=c,b=r;break}case 1:{u=c,f=a,b=r;break}case 2:{u=r,f=a,b=c;break}case 3:{u=r,f=c,b=a;break}case 4:{u=c,f=r,b=a;break}case 5:{u=a,f=r,b=c;break}}return[u*255,f*255,b*255]};_.cmyk.rgb=function(e){let t=e[0]/100,r=e[1]/100,s=e[2]/100,n=e[3]/100,i=1-Math.min(1,t*(1-n)+n),o=1-Math.min(1,r*(1-n)+n),a=1-Math.min(1,s*(1-n)+n);return[i*255,o*255,a*255]};_.xyz.rgb=function(e){let t=e[0]/100,r=e[1]/100,s=e[2]/100,n,i,o;return n=t*3.2404542+r*-1.5371385+s*-.4985314,i=t*-.969266+r*1.8760108+s*.041556,o=t*.0556434+r*-.2040259+s*1.0572252,n=Pt(n),i=Pt(i),o=Pt(o),[n*255,i*255,o*255]};_.xyz.lab=function(e){let t=e[0],r=e[1],s=e[2];t/=95.047,r/=100,s/=108.883,t=t>He?t**(1/3):7.787*t+16/116,r=r>He?r**(1/3):7.787*r+16/116,s=s>He?s**(1/3):7.787*s+16/116;let n=116*r-16,i=500*(t-r),o=200*(r-s);return[n,i,o]};_.xyz.oklab=function(e){let t=e[0]/100,r=e[1]/100,s=e[2]/100,n=Math.cbrt(.8189330101*t+.3618667424*r-.1288597137*s),i=Math.cbrt(.0329845436*t+.9293118715*r+.0361456387*s),o=Math.cbrt(.0482003018*t+.2643662691*r+.633851707*s),a=.2104542553*n+.793617785*i-.0040720468*o,c=1.9779984951*n-2.428592205*i+.4505937099*o,u=.0259040371*n+.7827717662*i-.808675766*o;return[a*100,c*100,u*100]};_.oklab.oklch=function(e){return _.lab.lch(e)};_.oklab.xyz=function(e){let t=e[0]/100,r=e[1]/100,s=e[2]/100,n=(.999999998*t+.396337792*r+.215803758*s)**3,i=(1.000000008*t-.105561342*r-.063854175*s)**3,o=(1.000000055*t-.089484182*r-1.291485538*s)**3,a=1.227013851*n-.55779998*i+.281256149*o,c=-.040580178*n+1.11225687*i-.071676679*o,u=-.076381285*n-.421481978*i+1.58616322*o;return[a*100,c*100,u*100]};_.oklab.rgb=function(e){let t=e[0]/100,r=e[1]/100,s=e[2]/100,n=(t+.3963377774*r+.2158037573*s)**3,i=(t-.1055613458*r-.0638541728*s)**3,o=(t-.0894841775*r-1.291485548*s)**3,a=Pt(4.0767416621*n-3.3077115913*i+.2309699292*o),c=Pt(-1.2684380046*n+2.6097574011*i-.3413193965*o),u=Pt(-.0041960863*n-.7034186147*i+1.707614701*o);return[a*255,c*255,u*255]};_.oklch.oklab=function(e){return _.lch.lab(e)};_.lab.xyz=function(e){let t=e[0],r=e[1],s=e[2],n,i,o;i=(t+16)/116,n=r/500+i,o=i-s/200;let a=i**3,c=n**3,u=o**3;return i=a>He?a:(i-16/116)/7.787,n=c>He?c:(n-16/116)/7.787,o=u>He?u:(o-16/116)/7.787,n*=95.047,i*=100,o*=108.883,[n,i,o]};_.lab.lch=function(e){let t=e[0],r=e[1],s=e[2],n;n=Math.atan2(s,r)*360/2/Math.PI,n<0&&(n+=360);let o=Math.sqrt(r*r+s*s);return[t,o,n]};_.lch.lab=function(e){let t=e[0],r=e[1],n=e[2]/360*2*Math.PI,i=r*Math.cos(n),o=r*Math.sin(n);return[t,i,o]};_.rgb.ansi16=function(e,t=null){let[r,s,n]=e,i=t===null?_.rgb.hsv(e)[2]:t;if(i=Math.round(i/50),i===0)return 30;let o=30+(Math.round(n/255)<<2|Math.round(s/255)<<1|Math.round(r/255));return i===2&&(o+=60),o};_.hsv.ansi16=function(e){return _.rgb.ansi16(_.hsv.rgb(e),e[2])};_.rgb.ansi256=function(e){let t=e[0],r=e[1],s=e[2];return t>>4===r>>4&&r>>4===s>>4?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(s/255*5)};_.ansi16.rgb=function(e){e=e[0];let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];let r=(Math.trunc(e>50)+1)*.5,s=(t&1)*r*255,n=(t>>1&1)*r*255,i=(t>>2&1)*r*255;return[s,n,i]};_.ansi256.rgb=function(e){if(e=e[0],e>=232){let i=(e-232)*10+8;return[i,i,i]}e-=16;let t,r=Math.floor(e/36)/5*255,s=Math.floor((t=e%36)/6)/5*255,n=t%6/5*255;return[r,s,n]};_.rgb.hex=function(e){let r=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".slice(r.length)+r};_.hex.rgb=function(e){let t=e.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!t)return[0,0,0];let r=t[0];t[0].length===3&&(r=[...r].map(a=>a+a).join(""));let s=Number.parseInt(r,16),n=s>>16&255,i=s>>8&255,o=s&255;return[n,i,o]};_.rgb.hcg=function(e){let t=e[0]/255,r=e[1]/255,s=e[2]/255,n=Math.max(Math.max(t,r),s),i=Math.min(Math.min(t,r),s),o=n-i,a,c=o<1?i/(1-o):0;return o<=0?a=0:n===t?a=(r-s)/o%6:n===r?a=2+(s-t)/o:a=4+(t-r)/o,a/=6,a%=1,[a*360,o*100,c*100]};_.hsl.hcg=function(e){let t=e[1]/100,r=e[2]/100,s=r<.5?2*t*r:2*t*(1-r),n=0;return s<1&&(n=(r-.5*s)/(1-s)),[e[0],s*100,n*100]};_.hsv.hcg=function(e){let t=e[1]/100,r=e[2]/100,s=t*r,n=0;return s<1&&(n=(r-s)/(1-s)),[e[0],s*100,n*100]};_.hcg.rgb=function(e){let t=e[0]/360,r=e[1]/100,s=e[2]/100;if(r===0)return[s*255,s*255,s*255];let n=[0,0,0],i=t%1*6,o=i%1,a=1-o,c=0;switch(Math.floor(i)){case 0:{n[0]=1,n[1]=o,n[2]=0;break}case 1:{n[0]=a,n[1]=1,n[2]=0;break}case 2:{n[0]=0,n[1]=1,n[2]=o;break}case 3:{n[0]=0,n[1]=a,n[2]=1;break}case 4:{n[0]=o,n[1]=0,n[2]=1;break}default:n[0]=1,n[1]=0,n[2]=a}return c=(1-r)*s,[(r*n[0]+c)*255,(r*n[1]+c)*255,(r*n[2]+c)*255]};_.hcg.hsv=function(e){let t=e[1]/100,r=e[2]/100,s=t+r*(1-t),n=0;return s>0&&(n=t/s),[e[0],n*100,s*100]};_.hcg.hsl=function(e){let t=e[1]/100,s=e[2]/100*(1-t)+.5*t,n=0;return s>0&&s<.5?n=t/(2*s):s>=.5&&s<1&&(n=t/(2*(1-s))),[e[0],n*100,s*100]};_.hcg.hwb=function(e){let t=e[1]/100,r=e[2]/100,s=t+r*(1-t);return[e[0],(s-t)*100,(1-s)*100]};_.hwb.hcg=function(e){let t=e[1]/100,s=1-e[2]/100,n=s-t,i=0;return n<1&&(i=(s-n)/(1-n)),[e[0],n*100,i*100]};_.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};_.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};_.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};_.gray.hsl=function(e){return[0,0,e[0]]};_.gray.hsv=_.gray.hsl;_.gray.hwb=function(e){return[0,100,e[0]]};_.gray.cmyk=function(e){return[0,0,0,e[0]]};_.gray.lab=function(e){return[e[0],0,0]};_.gray.hex=function(e){let t=Math.round(e[0]/100*255)&255,s=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".slice(s.length)+s};_.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};function qc(){let e={},t=Object.keys(ht);for(let{length:r}=t,s=0;s<r;s++)e[t[s]]={distance:-1,parent:null};return e}function Wc(e){let t=qc(),r=[e];for(t[e].distance=0;r.length>0;){let s=r.pop(),n=Object.keys(ht[s]);for(let{length:i}=n,o=0;o<i;o++){let a=n[o],c=t[a];c.distance===-1&&(c.distance=t[s].distance+1,c.parent=s,r.unshift(a))}}return t}function Hc(e,t){return function(r){return t(e(r))}}function Vc(e,t){let r=[t[e].parent,e],s=ht[t[e].parent][e],n=t[e].parent;for(;t[n].parent;)r.unshift(t[n].parent),s=Hc(ht[t[n].parent][n],s),n=t[n].parent;return s.conversion=r,s}function Jc(e){let t=Wc(e),r={},s=Object.keys(t);for(let{length:n}=s,i=0;i<n;i++){let o=s[i];t[o].parent!==null&&(r[o]=Vc(o,t))}return r}var Xc=Jc,xt={},Kc=Object.keys(ht);function Yc(e){let t=function(...r){let s=r[0];return s==null?s:(s.length>1&&(r=s),e(r))};return"conversion"in e&&(t.conversion=e.conversion),t}function Qc(e){let t=function(...r){let s=r[0];if(s==null)return s;s.length>1&&(r=s);let n=e(r);if(typeof n=="object")for(let{length:i}=n,o=0;o<i;o++)n[o]=Math.round(n[o]);return n};return"conversion"in e&&(t.conversion=e.conversion),t}for(let e of Kc){xt[e]={},Object.defineProperty(xt[e],"channels",{value:ht[e].channels}),Object.defineProperty(xt[e],"labels",{value:ht[e].labels});let t=Xc(e),r=Object.keys(t);for(let s of r){let n=t[s];xt[e][s]=Qc(n),xt[e][s].raw=Yc(n)}}var Se=xt,mi=["keyword","gray","hex"],Br={};for(let e of Object.keys(Se))Br[[...Se[e].labels].sort().join("")]=e;var Ur={};function he(e,t){if(!(this instanceof he))return new he(e,t);if(t&&t in mi&&(t=null),t&&!(t in Se))throw new Error("Unknown model: "+t);let r,s;if(e==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(e instanceof he)this.model=e.model,this.color=[...e.color],this.valpha=e.valpha;else if(typeof e=="string"){let n=Et.get(e);if(n===null)throw new Error("Unable to parse color from string: "+e);this.model=n.model,s=Se[this.model].channels,this.color=n.value.slice(0,s),this.valpha=typeof n.value[s]=="number"?n.value[s]:1}else if(e.length>0){this.model=t||"rgb",s=Se[this.model].channels;let n=Array.prototype.slice.call(e,0,s);this.color=Gr(n,s),this.valpha=typeof e[s]=="number"?e[s]:1}else if(typeof e=="number")this.model="rgb",this.color=[e>>16&255,e>>8&255,e&255],this.valpha=1;else{this.valpha=1;let n=Object.keys(e);"alpha"in e&&(n.splice(n.indexOf("alpha"),1),this.valpha=typeof e.alpha=="number"?e.alpha:0);let i=n.sort().join("");if(!(i in Br))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=Br[i];let{labels:o}=Se[this.model],a=[];for(r=0;r<o.length;r++)a.push(e[o[r]]);this.color=Gr(a)}if(Ur[this.model])for(s=Se[this.model].channels,r=0;r<s;r++){let n=Ur[this.model][r];n&&(this.color[r]=n(this.color[r]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}he.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(e){let t=this.model in Et.to?this:this.rgb();t=t.round(typeof e=="number"?e:1);let r=t.valpha===1?t.color:[...t.color,this.valpha];return Et.to[t.model](...r)},percentString(e){let t=this.rgb().round(typeof e=="number"?e:1),r=t.valpha===1?t.color:[...t.color,this.valpha];return Et.to.rgb.percent(...r)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let e={},{channels:t}=Se[this.model],{labels:r}=Se[this.model];for(let s=0;s<t;s++)e[r[s]]=this.color[s];return this.valpha!==1&&(e.alpha=this.valpha),e},unitArray(){let e=this.rgb().color;return e[0]/=255,e[1]/=255,e[2]/=255,this.valpha!==1&&e.push(this.valpha),e},unitObject(){let e=this.rgb().object();return e.r/=255,e.g/=255,e.b/=255,this.valpha!==1&&(e.alpha=this.valpha),e},round(e){return e=Math.max(e||0,0),new he([...this.color.map(eu(e)),this.valpha],this.model)},alpha(e){return e!==void 0?new he([...this.color,Math.max(0,Math.min(1,e))],this.model):this.valpha},red:oe("rgb",0,ce(255)),green:oe("rgb",1,ce(255)),blue:oe("rgb",2,ce(255)),hue:oe(["hsl","hsv","hsl","hwb","hcg"],0,e=>(e%360+360)%360),saturationl:oe("hsl",1,ce(100)),lightness:oe("hsl",2,ce(100)),saturationv:oe("hsv",1,ce(100)),value:oe("hsv",2,ce(100)),chroma:oe("hcg",1,ce(100)),gray:oe("hcg",2,ce(100)),white:oe("hwb",1,ce(100)),wblack:oe("hwb",2,ce(100)),cyan:oe("cmyk",0,ce(100)),magenta:oe("cmyk",1,ce(100)),yellow:oe("cmyk",2,ce(100)),black:oe("cmyk",3,ce(100)),x:oe("xyz",0,ce(95.047)),y:oe("xyz",1,ce(100)),z:oe("xyz",2,ce(108.833)),l:oe("lab",0,ce(100)),a:oe("lab",1),b:oe("lab",2),keyword(e){return e!==void 0?new he(e):Se[this.model].keyword(this.color)},hex(e){return e!==void 0?new he(e):Et.to.hex(...this.rgb().round().color)},hexa(e){if(e!==void 0)return new he(e);let t=this.rgb().round().color,r=Math.round(this.valpha*255).toString(16).toUpperCase();return r.length===1&&(r="0"+r),Et.to.hex(...t)+r},rgbNumber(){let e=this.rgb().color;return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255},luminosity(){let e=this.rgb().color,t=[];for(let[r,s]of e.entries()){let n=s/255;t[r]=n<=.04045?n/12.92:((n+.055)/1.055)**2.4}return .2126*t[0]+.7152*t[1]+.0722*t[2]},contrast(e){let t=this.luminosity(),r=e.luminosity();return t>r?(t+.05)/(r+.05):(r+.05)/(t+.05)},level(e){let t=this.contrast(e);return t>=7?"AAA":t>=4.5?"AA":""},isDark(){let e=this.rgb().color;return(e[0]*2126+e[1]*7152+e[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){let e=this.rgb();for(let t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten(e){let t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){let t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate(e){let t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate(e){let t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten(e){let t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken(e){let t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale(){let e=this.rgb().color,t=e[0]*.3+e[1]*.59+e[2]*.11;return he.rgb(t,t,t)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){let t=this.hsl(),r=t.color[0];return r=(r+e)%360,r=r<0?360+r:r,t.color[0]=r,t},mix(e,t){if(!e||!e.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);let r=e.rgb(),s=this.rgb(),n=t===void 0?.5:t,i=2*n-1,o=r.alpha()-s.alpha(),a=((i*o===-1?i:(i+o)/(1+i*o))+1)/2,c=1-a;return he.rgb(a*r.red()+c*s.red(),a*r.green()+c*s.green(),a*r.blue()+c*s.blue(),r.alpha()*n+s.alpha()*(1-n))}};for(let e of Object.keys(Se)){if(mi.includes(e))continue;let{channels:t}=Se[e];he.prototype[e]=function(...r){return this.model===e?new he(this):r.length>0?new he(r,e):new he([...tu(Se[this.model][e].raw(this.color)),this.valpha],e)},he[e]=function(...r){let s=r[0];return typeof s=="number"&&(s=Gr(r,t)),new he(s,e)}}function Zc(e,t){return Number(e.toFixed(t))}function eu(e){return function(t){return Zc(t,e)}}function oe(e,t,r){e=Array.isArray(e)?e:[e];for(let s of e)(Ur[s]||=[])[t]=r;return e=e[0],function(s){let n;return s!==void 0?(r&&(s=r(s)),n=this[e](),n.color[t]=s,n):(n=this[e]().color[t],r&&(n=r(n)),n)}}function ce(e){return function(t){return Math.max(0,Math.min(e,t))}}function tu(e){return Array.isArray(e)?e:[e]}function Gr(e,t){for(let r=0;r<t;r++)typeof e[r]!="number"&&(e[r]=0);return e}var ru=he});var wi=q((jd,yi)=>{g();yi.exports=vi().default});var Ri=q((Md,Pi)=>{g();var su=wi(),Ve=Oe(),Ei={multiband:"multiband","b-w":"b-w",bw:"b-w",cmyk:"cmyk",srgb:"srgb"};function nu(e){return this._setBackgroundColourOption("tint",e),this}function iu(e){return this.options.greyscale=Ve.bool(e)?e:!0,this}function ou(e){return this.greyscale(e)}function au(e){if(!Ve.string(e))throw Ve.invalidParameterError("colourspace","string",e);return this.options.colourspacePipeline=e,this}function lu(e){return this.pipelineColourspace(e)}function cu(e){if(!Ve.string(e))throw Ve.invalidParameterError("colourspace","string",e);return this.options.colourspace=e,this}function uu(e){return this.toColourspace(e)}function xi(e){if(Ve.object(e)||Ve.string(e)&&e.length>=3&&e.length<=200){let t=su(e);return[t.red(),t.green(),t.blue(),Math.round(t.alpha()*255)]}else throw Ve.invalidParameterError("background","object or string",e)}function fu(e,t){Ve.defined(t)&&(this.options[e]=xi(t))}Pi.exports=e=>{Object.assign(e.prototype,{tint:nu,greyscale:iu,grayscale:ou,pipelineColourspace:au,pipelineColorspace:lu,toColourspace:cu,toColorspace:uu,_getBackgroundColourOption:xi,_setBackgroundColourOption:fu}),e.colourspace=Ei,e.colorspace=Ei}});var $i=q((Bd,Si)=>{g();var Ue=Oe(),hu={and:"and",or:"or",eor:"eor"};function du(){return this.options.removeAlpha=!0,this}function gu(e){if(Ue.defined(e))if(Ue.number(e)&&Ue.inRange(e,0,1))this.options.ensureAlpha=e;else throw Ue.invalidParameterError("alpha","number between 0 and 1",e);else this.options.ensureAlpha=1;return this}function pu(e){let t={red:0,green:1,blue:2,alpha:3};if(Object.keys(t).includes(e)&&(e=t[e]),Ue.integer(e)&&Ue.inRange(e,0,4))this.options.extractChannel=e;else throw Ue.invalidParameterError("channel","integer or one of: red, green, blue, alpha",e);return this}function mu(e,t){return Array.isArray(e)?e.forEach(function(r){this.options.joinChannelIn.push(this._createInputDescriptor(r,t))},this):this.options.joinChannelIn.push(this._createInputDescriptor(e,t)),this}function bu(e){if(Ue.string(e)&&Ue.inArray(e,["and","or","eor"]))this.options.bandBoolOp=e;else throw Ue.invalidParameterError("boolOp","one of: and, or, eor",e);return this}Si.exports=e=>{Object.assign(e.prototype,{removeAlpha:du,ensureAlpha:gu,extractChannel:pu,joinChannel:mu,bandbool:bu}),e.bool=hu}});var Ii=q((Gd,Ni)=>{g();var Wr=ie("node:path"),l=Oe(),St=Ct(),ki=new Map([["heic","heif"],["heif","heif"],["avif","avif"],["jpeg","jpeg"],["jpg","jpeg"],["jpe","jpeg"],["tile","tile"],["dz","tile"],["png","png"],["raw","raw"],["tiff","tiff"],["tif","tiff"],["webp","webp"],["gif","gif"],["jp2","jp2"],["jpx","jp2"],["j2k","jp2"],["j2c","jp2"],["jxl","jxl"]]),vu=/\.(jp[2x]|j2[kc])$/i,Ai=()=>new Error("JP2 output requires libvips with support for OpenJPEG"),_i=e=>1<<31-Math.clz32(Math.ceil(Math.log2(e)));function yu(e,t){let r;if(l.string(e)?l.string(this.options.input.file)&&Wr.resolve(this.options.input.file)===Wr.resolve(e)?r=new Error("Cannot use same file for input and output"):vu.test(Wr.extname(e))&&!this.constructor.format.jp2k.output.file&&(r=Ai()):r=new Error("Missing output file path"),r)if(l.fn(t))t(r);else return Promise.reject(r);else{this.options.fileOut=e;let s=Error();return this._pipeline(t,s)}return this}function wu(e,t){l.object(e)?this._setBooleanOption("resolveWithObject",e.resolveWithObject):this.options.resolveWithObject&&(this.options.resolveWithObject=!1),this.options.fileOut="";let r=Error();return this._pipeline(l.fn(e)?e:t,r)}function Eu(){return this.options.keepMetadata|=1,this}function xu(e){if(l.object(e))for(let[t,r]of Object.entries(e))if(l.object(r))for(let[s,n]of Object.entries(r))if(l.string(n))this.options.withExif[`exif-${t.toLowerCase()}-${s}`]=n;else throw l.invalidParameterError(`${t}.${s}`,"string",n);else throw l.invalidParameterError(t,"object",r);else throw l.invalidParameterError("exif","object",e);return this.options.withExifMerge=!1,this.keepExif()}function Pu(e){return this.withExif(e),this.options.withExifMerge=!0,this}function Ru(){return this.options.keepMetadata|=8,this}function Su(e,t){if(l.string(e))this.options.withIccProfile=e;else throw l.invalidParameterError("icc","string",e);if(this.keepIccProfile(),l.object(t)&&l.defined(t.attach))if(l.bool(t.attach))t.attach||(this.options.keepMetadata&=-9);else throw l.invalidParameterError("attach","boolean",t.attach);return this}function $u(){return this.options.keepMetadata|=2,this}function ku(e){if(l.string(e)&&e.length>0)this.options.withXmp=e,this.options.keepMetadata|=2;else throw l.invalidParameterError("xmp","non-empty string",e);return this}function Au(){return this.options.keepMetadata=31,this}function _u(e){if(this.keepMetadata(),this.withIccProfile("srgb"),l.object(e)){if(l.defined(e.orientation))if(l.integer(e.orientation)&&l.inRange(e.orientation,1,8))this.options.withMetadataOrientation=e.orientation;else throw l.invalidParameterError("orientation","integer between 1 and 8",e.orientation);if(l.defined(e.density))if(l.number(e.density)&&e.density>0)this.options.withMetadataDensity=e.density;else throw l.invalidParameterError("density","positive number",e.density);l.defined(e.icc)&&this.withIccProfile(e.icc),l.defined(e.exif)&&this.withExifMerge(e.exif)}return this}function Nu(e,t){let r=ki.get((l.object(e)&&l.string(e.id)?e.id:e).toLowerCase());if(!r)throw l.invalidParameterError("format",`one of: ${[...ki.keys()].join(", ")}`,e);return this[r](t)}function Iu(e){if(l.object(e)){if(l.defined(e.quality))if(l.integer(e.quality)&&l.inRange(e.quality,1,100))this.options.jpegQuality=e.quality;else throw l.invalidParameterError("quality","integer between 1 and 100",e.quality);if(l.defined(e.progressive)&&this._setBooleanOption("jpegProgressive",e.progressive),l.defined(e.chromaSubsampling))if(l.string(e.chromaSubsampling)&&l.inArray(e.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jpegChromaSubsampling=e.chromaSubsampling;else throw l.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",e.chromaSubsampling);let t=l.bool(e.optimizeCoding)?e.optimizeCoding:e.optimiseCoding;if(l.defined(t)&&this._setBooleanOption("jpegOptimiseCoding",t),l.defined(e.mozjpeg))if(l.bool(e.mozjpeg))e.mozjpeg&&(this.options.jpegTrellisQuantisation=!0,this.options.jpegOvershootDeringing=!0,this.options.jpegOptimiseScans=!0,this.options.jpegProgressive=!0,this.options.jpegQuantisationTable=3);else throw l.invalidParameterError("mozjpeg","boolean",e.mozjpeg);let r=l.bool(e.trellisQuantization)?e.trellisQuantization:e.trellisQuantisation;l.defined(r)&&this._setBooleanOption("jpegTrellisQuantisation",r),l.defined(e.overshootDeringing)&&this._setBooleanOption("jpegOvershootDeringing",e.overshootDeringing);let s=l.bool(e.optimizeScans)?e.optimizeScans:e.optimiseScans;l.defined(s)&&(this._setBooleanOption("jpegOptimiseScans",s),s&&(this.options.jpegProgressive=!0));let n=l.number(e.quantizationTable)?e.quantizationTable:e.quantisationTable;if(l.defined(n))if(l.integer(n)&&l.inRange(n,0,8))this.options.jpegQuantisationTable=n;else throw l.invalidParameterError("quantisationTable","integer between 0 and 8",n)}return this._updateFormatOut("jpeg",e)}function Tu(e){if(l.object(e)){if(l.defined(e.progressive)&&this._setBooleanOption("pngProgressive",e.progressive),l.defined(e.compressionLevel))if(l.integer(e.compressionLevel)&&l.inRange(e.compressionLevel,0,9))this.options.pngCompressionLevel=e.compressionLevel;else throw l.invalidParameterError("compressionLevel","integer between 0 and 9",e.compressionLevel);l.defined(e.adaptiveFiltering)&&this._setBooleanOption("pngAdaptiveFiltering",e.adaptiveFiltering);let t=e.colours||e.colors;if(l.defined(t))if(l.integer(t)&&l.inRange(t,2,256))this.options.pngBitdepth=_i(t);else throw l.invalidParameterError("colours","integer between 2 and 256",t);if(l.defined(e.palette)?this._setBooleanOption("pngPalette",e.palette):[e.quality,e.effort,e.colours,e.colors,e.dither].some(l.defined)&&this._setBooleanOption("pngPalette",!0),this.options.pngPalette){if(l.defined(e.quality))if(l.integer(e.quality)&&l.inRange(e.quality,0,100))this.options.pngQuality=e.quality;else throw l.invalidParameterError("quality","integer between 0 and 100",e.quality);if(l.defined(e.effort))if(l.integer(e.effort)&&l.inRange(e.effort,1,10))this.options.pngEffort=e.effort;else throw l.invalidParameterError("effort","integer between 1 and 10",e.effort);if(l.defined(e.dither))if(l.number(e.dither)&&l.inRange(e.dither,0,1))this.options.pngDither=e.dither;else throw l.invalidParameterError("dither","number between 0.0 and 1.0",e.dither)}}return this._updateFormatOut("png",e)}function Du(e){if(l.object(e)){if(l.defined(e.quality))if(l.integer(e.quality)&&l.inRange(e.quality,1,100))this.options.webpQuality=e.quality;else throw l.invalidParameterError("quality","integer between 1 and 100",e.quality);if(l.defined(e.alphaQuality))if(l.integer(e.alphaQuality)&&l.inRange(e.alphaQuality,0,100))this.options.webpAlphaQuality=e.alphaQuality;else throw l.invalidParameterError("alphaQuality","integer between 0 and 100",e.alphaQuality);if(l.defined(e.lossless)&&this._setBooleanOption("webpLossless",e.lossless),l.defined(e.nearLossless)&&this._setBooleanOption("webpNearLossless",e.nearLossless),l.defined(e.smartSubsample)&&this._setBooleanOption("webpSmartSubsample",e.smartSubsample),l.defined(e.smartDeblock)&&this._setBooleanOption("webpSmartDeblock",e.smartDeblock),l.defined(e.preset))if(l.string(e.preset)&&l.inArray(e.preset,["default","photo","picture","drawing","icon","text"]))this.options.webpPreset=e.preset;else throw l.invalidParameterError("preset","one of: default, photo, picture, drawing, icon, text",e.preset);if(l.defined(e.effort))if(l.integer(e.effort)&&l.inRange(e.effort,0,6))this.options.webpEffort=e.effort;else throw l.invalidParameterError("effort","integer between 0 and 6",e.effort);l.defined(e.minSize)&&this._setBooleanOption("webpMinSize",e.minSize),l.defined(e.mixed)&&this._setBooleanOption("webpMixed",e.mixed)}return Hr(e,this.options),this._updateFormatOut("webp",e)}function Cu(e){if(l.object(e)){l.defined(e.reuse)&&this._setBooleanOption("gifReuse",e.reuse),l.defined(e.progressive)&&this._setBooleanOption("gifProgressive",e.progressive);let t=e.colours||e.colors;if(l.defined(t))if(l.integer(t)&&l.inRange(t,2,256))this.options.gifBitdepth=_i(t);else throw l.invalidParameterError("colours","integer between 2 and 256",t);if(l.defined(e.effort))if(l.number(e.effort)&&l.inRange(e.effort,1,10))this.options.gifEffort=e.effort;else throw l.invalidParameterError("effort","integer between 1 and 10",e.effort);if(l.defined(e.dither))if(l.number(e.dither)&&l.inRange(e.dither,0,1))this.options.gifDither=e.dither;else throw l.invalidParameterError("dither","number between 0.0 and 1.0",e.dither);if(l.defined(e.interFrameMaxError))if(l.number(e.interFrameMaxError)&&l.inRange(e.interFrameMaxError,0,32))this.options.gifInterFrameMaxError=e.interFrameMaxError;else throw l.invalidParameterError("interFrameMaxError","number between 0.0 and 32.0",e.interFrameMaxError);if(l.defined(e.interPaletteMaxError))if(l.number(e.interPaletteMaxError)&&l.inRange(e.interPaletteMaxError,0,256))this.options.gifInterPaletteMaxError=e.interPaletteMaxError;else throw l.invalidParameterError("interPaletteMaxError","number between 0.0 and 256.0",e.interPaletteMaxError);if(l.defined(e.keepDuplicateFrames))if(l.bool(e.keepDuplicateFrames))this._setBooleanOption("gifKeepDuplicateFrames",e.keepDuplicateFrames);else throw l.invalidParameterError("keepDuplicateFrames","boolean",e.keepDuplicateFrames)}return Hr(e,this.options),this._updateFormatOut("gif",e)}function Fu(e){if(!this.constructor.format.jp2k.output.buffer)throw Ai();if(l.object(e)){if(l.defined(e.quality))if(l.integer(e.quality)&&l.inRange(e.quality,1,100))this.options.jp2Quality=e.quality;else throw l.invalidParameterError("quality","integer between 1 and 100",e.quality);if(l.defined(e.lossless))if(l.bool(e.lossless))this.options.jp2Lossless=e.lossless;else throw l.invalidParameterError("lossless","boolean",e.lossless);if(l.defined(e.tileWidth))if(l.integer(e.tileWidth)&&l.inRange(e.tileWidth,1,32768))this.options.jp2TileWidth=e.tileWidth;else throw l.invalidParameterError("tileWidth","integer between 1 and 32768",e.tileWidth);if(l.defined(e.tileHeight))if(l.integer(e.tileHeight)&&l.inRange(e.tileHeight,1,32768))this.options.jp2TileHeight=e.tileHeight;else throw l.invalidParameterError("tileHeight","integer between 1 and 32768",e.tileHeight);if(l.defined(e.chromaSubsampling))if(l.string(e.chromaSubsampling)&&l.inArray(e.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jp2ChromaSubsampling=e.chromaSubsampling;else throw l.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",e.chromaSubsampling)}return this._updateFormatOut("jp2",e)}function Hr(e,t){if(l.object(e)&&l.defined(e.loop))if(l.integer(e.loop)&&l.inRange(e.loop,0,65535))t.loop=e.loop;else throw l.invalidParameterError("loop","integer between 0 and 65535",e.loop);if(l.object(e)&&l.defined(e.delay))if(l.integer(e.delay)&&l.inRange(e.delay,0,65535))t.delay=[e.delay];else if(Array.isArray(e.delay)&&e.delay.every(l.integer)&&e.delay.every(r=>l.inRange(r,0,65535)))t.delay=e.delay;else throw l.invalidParameterError("delay","integer or an array of integers between 0 and 65535",e.delay)}function Ou(e){if(l.object(e)){if(l.defined(e.quality))if(l.integer(e.quality)&&l.inRange(e.quality,1,100))this.options.tiffQuality=e.quality;else throw l.invalidParameterError("quality","integer between 1 and 100",e.quality);if(l.defined(e.bitdepth))if(l.integer(e.bitdepth)&&l.inArray(e.bitdepth,[1,2,4,8]))this.options.tiffBitdepth=e.bitdepth;else throw l.invalidParameterError("bitdepth","1, 2, 4 or 8",e.bitdepth);if(l.defined(e.tile)&&this._setBooleanOption("tiffTile",e.tile),l.defined(e.tileWidth))if(l.integer(e.tileWidth)&&e.tileWidth>0)this.options.tiffTileWidth=e.tileWidth;else throw l.invalidParameterError("tileWidth","integer greater than zero",e.tileWidth);if(l.defined(e.tileHeight))if(l.integer(e.tileHeight)&&e.tileHeight>0)this.options.tiffTileHeight=e.tileHeight;else throw l.invalidParameterError("tileHeight","integer greater than zero",e.tileHeight);if(l.defined(e.miniswhite)&&this._setBooleanOption("tiffMiniswhite",e.miniswhite),l.defined(e.pyramid)&&this._setBooleanOption("tiffPyramid",e.pyramid),l.defined(e.xres))if(l.number(e.xres)&&e.xres>0)this.options.tiffXres=e.xres;else throw l.invalidParameterError("xres","number greater than zero",e.xres);if(l.defined(e.yres))if(l.number(e.yres)&&e.yres>0)this.options.tiffYres=e.yres;else throw l.invalidParameterError("yres","number greater than zero",e.yres);if(l.defined(e.compression))if(l.string(e.compression)&&l.inArray(e.compression,["none","jpeg","deflate","packbits","ccittfax4","lzw","webp","zstd","jp2k"]))this.options.tiffCompression=e.compression;else throw l.invalidParameterError("compression","one of: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k",e.compression);if(l.defined(e.bigtiff)&&this._setBooleanOption("tiffBigtiff",e.bigtiff),l.defined(e.predictor))if(l.string(e.predictor)&&l.inArray(e.predictor,["none","horizontal","float"]))this.options.tiffPredictor=e.predictor;else throw l.invalidParameterError("predictor","one of: none, horizontal, float",e.predictor);if(l.defined(e.resolutionUnit))if(l.string(e.resolutionUnit)&&l.inArray(e.resolutionUnit,["inch","cm"]))this.options.tiffResolutionUnit=e.resolutionUnit;else throw l.invalidParameterError("resolutionUnit","one of: inch, cm",e.resolutionUnit)}return this._updateFormatOut("tiff",e)}function ju(e){return this.heif({...e,compression:"av1"})}function Lu(e){if(l.object(e)){if(l.string(e.compression)&&l.inArray(e.compression,["av1","hevc"]))this.options.heifCompression=e.compression;else throw l.invalidParameterError("compression","one of: av1, hevc",e.compression);if(l.defined(e.quality))if(l.integer(e.quality)&&l.inRange(e.quality,1,100))this.options.heifQuality=e.quality;else throw l.invalidParameterError("quality","integer between 1 and 100",e.quality);if(l.defined(e.lossless))if(l.bool(e.lossless))this.options.heifLossless=e.lossless;else throw l.invalidParameterError("lossless","boolean",e.lossless);if(l.defined(e.effort))if(l.integer(e.effort)&&l.inRange(e.effort,0,9))this.options.heifEffort=e.effort;else throw l.invalidParameterError("effort","integer between 0 and 9",e.effort);if(l.defined(e.chromaSubsampling))if(l.string(e.chromaSubsampling)&&l.inArray(e.chromaSubsampling,["4:2:0","4:4:4"]))this.options.heifChromaSubsampling=e.chromaSubsampling;else throw l.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",e.chromaSubsampling);if(l.defined(e.bitdepth))if(l.integer(e.bitdepth)&&l.inArray(e.bitdepth,[8,10,12])){if(e.bitdepth!==8&&this.constructor.versions.heif)throw l.invalidParameterError("bitdepth when using prebuilt binaries",8,e.bitdepth);this.options.heifBitdepth=e.bitdepth}else throw l.invalidParameterError("bitdepth","8, 10 or 12",e.bitdepth)}else throw l.invalidParameterError("options","Object",e);return this._updateFormatOut("heif",e)}function Mu(e){if(l.object(e)){if(l.defined(e.quality))if(l.integer(e.quality)&&l.inRange(e.quality,1,100))this.options.jxlDistance=e.quality>=30?.1+(100-e.quality)*.09:53/3e3*e.quality*e.quality-23/20*e.quality+25;else throw l.invalidParameterError("quality","integer between 1 and 100",e.quality);else if(l.defined(e.distance))if(l.number(e.distance)&&l.inRange(e.distance,0,15))this.options.jxlDistance=e.distance;else throw l.invalidParameterError("distance","number between 0.0 and 15.0",e.distance);if(l.defined(e.decodingTier))if(l.integer(e.decodingTier)&&l.inRange(e.decodingTier,0,4))this.options.jxlDecodingTier=e.decodingTier;else throw l.invalidParameterError("decodingTier","integer between 0 and 4",e.decodingTier);if(l.defined(e.lossless))if(l.bool(e.lossless))this.options.jxlLossless=e.lossless;else throw l.invalidParameterError("lossless","boolean",e.lossless);if(l.defined(e.effort))if(l.integer(e.effort)&&l.inRange(e.effort,1,9))this.options.jxlEffort=e.effort;else throw l.invalidParameterError("effort","integer between 1 and 9",e.effort)}return Hr(e,this.options),this._updateFormatOut("jxl",e)}function zu(e){if(l.object(e)&&l.defined(e.depth))if(l.string(e.depth)&&l.inArray(e.depth,["char","uchar","short","ushort","int","uint","float","complex","double","dpcomplex"]))this.options.rawDepth=e.depth;else throw l.invalidParameterError("depth","one of: char, uchar, short, ushort, int, uint, float, complex, double, dpcomplex",e.depth);return this._updateFormatOut("raw")}function Bu(e){if(l.object(e)){if(l.defined(e.size))if(l.integer(e.size)&&l.inRange(e.size,1,8192))this.options.tileSize=e.size;else throw l.invalidParameterError("size","integer between 1 and 8192",e.size);if(l.defined(e.overlap))if(l.integer(e.overlap)&&l.inRange(e.overlap,0,8192)){if(e.overlap>this.options.tileSize)throw l.invalidParameterError("overlap",`<= size (${this.options.tileSize})`,e.overlap);this.options.tileOverlap=e.overlap}else throw l.invalidParameterError("overlap","integer between 0 and 8192",e.overlap);if(l.defined(e.container))if(l.string(e.container)&&l.inArray(e.container,["fs","zip"]))this.options.tileContainer=e.container;else throw l.invalidParameterError("container","one of: fs, zip",e.container);if(l.defined(e.layout))if(l.string(e.layout)&&l.inArray(e.layout,["dz","google","iiif","iiif3","zoomify"]))this.options.tileLayout=e.layout;else throw l.invalidParameterError("layout","one of: dz, google, iiif, iiif3, zoomify",e.layout);if(l.defined(e.angle))if(l.integer(e.angle)&&!(e.angle%90))this.options.tileAngle=e.angle;else throw l.invalidParameterError("angle","positive/negative multiple of 90",e.angle);if(this._setBackgroundColourOption("tileBackground",e.background),l.defined(e.depth))if(l.string(e.depth)&&l.inArray(e.depth,["onepixel","onetile","one"]))this.options.tileDepth=e.depth;else throw l.invalidParameterError("depth","one of: onepixel, onetile, one",e.depth);if(l.defined(e.skipBlanks))if(l.integer(e.skipBlanks)&&l.inRange(e.skipBlanks,-1,65535))this.options.tileSkipBlanks=e.skipBlanks;else throw l.invalidParameterError("skipBlanks","integer between -1 and 255/65535",e.skipBlanks);else l.defined(e.layout)&&e.layout==="google"&&(this.options.tileSkipBlanks=5);let t=l.bool(e.center)?e.center:e.centre;if(l.defined(t)&&this._setBooleanOption("tileCentre",t),l.defined(e.id))if(l.string(e.id))this.options.tileId=e.id;else throw l.invalidParameterError("id","string",e.id);if(l.defined(e.basename))if(l.string(e.basename))this.options.tileBasename=e.basename;else throw l.invalidParameterError("basename","string",e.basename)}if(l.inArray(this.options.formatOut,["jpeg","png","webp"]))this.options.tileFormat=this.options.formatOut;else if(this.options.formatOut!=="input")throw l.invalidParameterError("format","one of: jpeg, png, webp",this.options.formatOut);return this._updateFormatOut("dz")}function Uu(e){if(!l.plainObject(e))throw l.invalidParameterError("options","object",e);if(l.integer(e.seconds)&&l.inRange(e.seconds,0,3600))this.options.timeoutSeconds=e.seconds;else throw l.invalidParameterError("seconds","integer between 0 and 3600",e.seconds);return this}function Gu(e,t){return l.object(t)&&t.force===!1||(this.options.formatOut=e),this}function qu(e,t){if(l.bool(t))this.options[e]=t;else throw l.invalidParameterError(e,"boolean",t)}function Wu(){if(!this.options.streamOut){this.options.streamOut=!0;let e=Error();this._pipeline(void 0,e)}}function Hu(e,t){return typeof e=="function"?(this._isStreamInput()?this.on("finish",()=>{this._flattenBufferIn(),St.pipeline(this.options,(r,s,n)=>{r?e(l.nativeError(r,t)):e(null,s,n)})}):St.pipeline(this.options,(r,s,n)=>{r?e(l.nativeError(r,t)):e(null,s,n)}),this):this.options.streamOut?(this._isStreamInput()?(this.once("finish",()=>{this._flattenBufferIn(),St.pipeline(this.options,(r,s,n)=>{r?this.emit("error",l.nativeError(r,t)):(this.emit("info",n),this.push(s)),this.push(null),this.on("end",()=>this.emit("close"))})}),this.streamInFinished&&this.emit("finish")):St.pipeline(this.options,(r,s,n)=>{r?this.emit("error",l.nativeError(r,t)):(this.emit("info",n),this.push(s)),this.push(null),this.on("end",()=>this.emit("close"))}),this):this._isStreamInput()?new Promise((r,s)=>{this.once("finish",()=>{this._flattenBufferIn(),St.pipeline(this.options,(n,i,o)=>{n?s(l.nativeError(n,t)):this.options.resolveWithObject?r({data:i,info:o}):r(i)})})}):new Promise((r,s)=>{St.pipeline(this.options,(n,i,o)=>{n?s(l.nativeError(n,t)):this.options.resolveWithObject?r({data:i,info:o}):r(i)})})}Ni.exports=e=>{Object.assign(e.prototype,{toFile:yu,toBuffer:wu,keepExif:Eu,withExif:xu,withExifMerge:Pu,keepIccProfile:Ru,withIccProfile:Su,keepXmp:$u,withXmp:ku,keepMetadata:Au,withMetadata:_u,toFormat:Nu,jpeg:Iu,jp2:Fu,png:Tu,webp:Du,tiff:Ou,avif:ju,heif:Lu,jxl:Mu,gif:Cu,raw:zu,tile:Bu,timeout:Uu,_updateFormatOut:Gu,_setBooleanOption:qu,_read:Wu,_pipeline:Hu})}});var Fi=q((Wd,Ci)=>{g();var Vu=ie("node:events"),nr=Wt(),Ne=Oe(),{runtimePlatformArch:Ju}=Fr(),xe=Ct(),Ti=Ju(),Vr=xe.libvipsVersion(),st=xe.format();st.heif.output.alias=["avif","heic"];st.jpeg.output.alias=["jpe","jpg"];st.tiff.output.alias=["tif"];st.jp2k.output.alias=["j2c","j2k","jp2","jpx"];var Xu={nearest:"nearest",bilinear:"bilinear",bicubic:"bicubic",locallyBoundedBicubic:"lbb",nohalo:"nohalo",vertexSplitQuadraticBasisSpline:"vsqbs"},$t={vips:Vr.semver};if(!Vr.isGlobal)if(Vr.isWasm)try{$t=ie("@img/sharp-wasm32/versions")}catch{}else try{$t=ie(`@img/sharp-${Ti}/versions`)}catch{try{$t=ie(`@img/sharp-libvips-${Ti}/versions`)}catch{}}$t.sharp=Dr().version;$t.heif&&st.heif&&(st.heif.input.fileSuffix=[".avif"],st.heif.output.alias=["avif"]);function Di(e){return Ne.bool(e)?e?xe.cache(50,20,100):xe.cache(0,0,0):Ne.object(e)?xe.cache(e.memory,e.files,e.items):xe.cache()}Di(!0);function Ku(e){return xe.concurrency(Ne.integer(e)?e:null)}nr.familySync()===nr.GLIBC&&!xe._isUsingJemalloc()?xe.concurrency(1):nr.familySync()===nr.MUSL&&xe.concurrency()===1024&&xe.concurrency(ie("node:os").availableParallelism());var Yu=new Vu.EventEmitter;function Qu(){return xe.counters()}function Zu(e){return xe.simd(Ne.bool(e)?e:null)}function ef(e){if(Ne.object(e))if(Array.isArray(e.operation)&&e.operation.every(Ne.string))xe.block(e.operation,!0);else throw Ne.invalidParameterError("operation","Array<string>",e.operation);else throw Ne.invalidParameterError("options","object",e)}function tf(e){if(Ne.object(e))if(Array.isArray(e.operation)&&e.operation.every(Ne.string))xe.block(e.operation,!1);else throw Ne.invalidParameterError("operation","Array<string>",e.operation);else throw Ne.invalidParameterError("options","object",e)}Ci.exports=e=>{e.cache=Di,e.concurrency=Ku,e.counters=Qu,e.simd=Zu,e.format=st,e.interpolators=Xu,e.versions=$t,e.queue=Yu,e.block=ef,e.unblock=tf}});var ji=q((Jd,Oi)=>{g();var Je=Kn();Zn()(Je);ii()(Je);ai()(Je);hi()(Je);Ri()(Je);$i()(Je);Ii()(Je);Fi()(Je);Oi.exports=Je});g();g();g();import ko from"@rollup/plugin-strip";import{visualizer as Ao}from"rollup-plugin-visualizer";g();var vr=["/react/","/react-dom/","/scheduler/","/react-router","/@radix-ui/","/react-day-picker/","/react-hook-form/","/react-i18next/","/clsx/","/class-variance-authority/"],mo={valibot:["/valibot/"],firebase:["/firebase/","/@firebase/"],lucide:["/lucide-react/","/lucide/"],i18n:["/i18next/","/i18next-browser-languagedetector/","/i18next-http-backend/","/@donotdev/i18n/"],zustand:["/zustand/"],"tanstack-query":["/@tanstack/react-query/","/@tanstack/query-core/"]};function bo(e){let t=e.match(/(?:^|\0)virtual:([^?]+)/);if(t)return t[1]}function ss(e){let t=e.replace(/\\/g,"/");if(t.includes("/node_modules/"))return t.split("?")[0]}function ns(e,t=vr){return t.some(r=>e.includes(r))}function vo(e){for(let[t,r]of Object.entries(mo))if(r.some(s=>e.includes(s)))return t}function yo(e){let t=bo(e);if(t)return t==="i18n-mapping"?"virtual-i18n-mapping":"virtual-modules";let r=ss(e);if(!r)return;if(ns(r))return"react-core";let s=vo(r);if(s)return s}function wo(e=[]){let t=e.filter(s=>!vr.includes(s)),r=[...vr,...t];return function(s){let n=ss(s);if(n&&ns(n,r))return"react-core"}}var rs={development:{manualChunks:void 0},production:{manualChunks:yo}};function is(e,t={}){let r=rs[e]||rs.production,s=t.reactCore||[];return s.length>0?{manualChunks:wo(s)}:r}g();import*as Re from"@clack/prompts";g();import{createRequire as Eo}from"node:module";import{resolve as zt,join as qe,dirname as Qe,relative as os,normalize as xo,sep as as,extname as Po}from"node:path";import{fileURLToPath as Ro}from"node:url";import*as W from"node:fs";ge();import So from"fast-glob";var pt={getGlobOptionsFor:Mt||void 0,SCAN_PATTERNS:ke||void 0,getPatternsFor:ts||void 0,I18N_PATHS:Lt||void 0},fe={error:(e,t)=>{},warn:(e,t)=>{},info:e=>{}};function ls(e,t){return e().catch(r=>{throw new Error(`${t}: ${r instanceof Error?r.message:String(r)}`)})}var cs={CLI:"packages/cli",COMPONENTS:"packages/core/components",CONFIG:"packages/core/config",CORE:"packages/core",CRUD:"packages/core/crud",FEATURES:"packages/features",HOOKS:"packages/core/hooks",I18N:"packages/core/i18n",SCHEMAS:"packages/core/schemas",STORES:"packages/core/stores",TEMPLATES:"packages/templates",TOOLING:"packages/tooling",TYPES:"packages/core/types",UI:"packages/ui",UTILS:"packages/core/utils",AUTH:"packages/features/auth",BILLING:"packages/features/billing",OAUTH:"packages/features/oauth",FIREBASE:"packages/providers/firebase",FUNCTIONS:"packages/functions"},ne=class e{static _instance=null;options;_repoRoot;_appRoot=null;static getInstance(t={}){return e._instance||(e._instance=new e(t)),e._instance}static _reset(){e._instance=null}constructor(t={}){if(e._instance)return e._instance;this.options={maxLevels:t.maxLevels??10,customMarkers:t.customMarkers||[],cache:t.cache??!1,debug:t.debug??!1};try{let r=p.cwd();if(!r)throw new Error("PathResolver: process.cwd() returned undefined. This should never happen.");this._repoRoot=this._findRepoRoot(r)}catch(r){throw new Error(`PathResolver constructor failed: ${r instanceof Error?r.message:String(r)}. cwd: ${p.cwd()}`)}this._appRoot=null,e._instance=this}normalizePath(t){if(!t)return"";try{return xo(t).split(as).join("/")}catch{return String(t).split(as).join("/")}}getRelativePath(t){let r=this.getAppRoot(),s=os(r,t);return this.normalizePath(s)}getBasename(t){if(!t)return"";let s=this.normalizePath(t).split("/");return s[s.length-1]||""}getDirname(t){return t?this.normalizePath(Qe(t)):""}resolvePackage(t,r=null){try{let s=r||this.getAppRoot(),i=Eo(qe(s,"package.json")).resolve(t);return this.normalizePath(i)}catch{return null}}resolveFrameworkPackage(t,r=null){let s=this.resolvePackage(`${t}/package.json`,r);if(s)return this.getDirname(s);if(this.isMonorepo()&&t.startsWith("@donotdev/")){let o=t.replace("@donotdev/",""),a=this.resolveRepoPath(`packages/${o}`);if(this.pathExists(a))return a;if(["auth","billing","crud","oauth"].includes(o)){let c=this.resolveRepoPath(`packages/features/${o}`);if(this.pathExists(c))return c}if(o==="firebase"){let c=this.resolveRepoPath(`packages/providers/${o}`);if(this.pathExists(c))return c}}let n=this.resolveAppPath(`node_modules/${t}`);if(this.pathExists(n))return n;let i=this.resolveRepoPath(`node_modules/${t}`);return this.pathExists(i)?i:null}resolvePackageAsset(t,r=null){return this.resolvePackage(t,r)}resolveAppPath(t){let r=this.getAppRoot(),s=zt(r,t);return this.normalizePath(s)}resolveRepoPath(t){let r=this.getRepoRoot(),s=this.normalizePath(t),n=zt(r,s);return this.normalizePath(n)}resolvePath(t,r){let s=this.normalizePath(r),n=this.normalizePath(t),i=zt(s,n);return this.normalizePath(i)}createImportPath(t){return"./"+this.getRelativePath(t)}getFileInfo(t){try{let r=W.statSync(t);return{absolutePath:this.normalizePath(t),relativePath:this.getRelativePath(t),importPath:this.createImportPath(t),size:r.size,isFile:r.isFile(),isDirectory:r.isDirectory()}}catch{return null}}_detectFormat(t,r){return r&&r!=="auto"?r:Po(t).toLowerCase()===".json"?"json":"text"}async read(t,r={}){let{format:s="auto",encoding:n="utf8"}=r,i=this._detectFormat(t,s);try{if(i==="buffer")return await W.promises.readFile(t);let o=await W.promises.readFile(t,n),a=this.stripBom(o);return i==="json"?JSON.parse(a):a}catch(o){return this.options.debug&&fe.warn(`Failed to read file: ${t}`,o),null}}readSync(t,r={}){let{format:s="auto",encoding:n="utf8"}=r,i=this._detectFormat(t,s);try{if(i==="buffer")return W.readFileSync(t);let o=W.readFileSync(t,n),a=this.stripBom(o);return i==="json"?JSON.parse(a):a}catch(o){return this.options.debug&&fe.warn(`Failed to read file: ${t}`,o),null}}async write(t,r,s={}){let{format:n="auto",overwrite:i=!1,dryRun:o=!1,verbose:a=!1}=s,c=this.normalizePath(t),u=this.normalizePath(Qe(c)),f=this.pathExists(c);if(f&&!i)return a&&fe.info(`Skipping existing file: ${c}`),!1;if(o)return fe.info(`[DRY RUN] Would write file: ${c}`),!0;try{await W.promises.mkdir(u,{recursive:!0})}catch(T){if(T?.code!=="EEXIST")throw T}let b=this._detectFormat(t,n),m;v.isBuffer(r)?m=r:b==="json"&&typeof r=="object"?m=JSON.stringify(r,null,2):m=String(r);try{return await ls(async()=>(v.isBuffer(m)?await W.promises.writeFile(c,m):await W.promises.writeFile(c,m,"utf8"),a&&fe.info(`${f?"Updated":"Created"} file: ${c}`),!0),`Failed to write file: ${c}`)}catch{return!1}}writeSync(t,r,s={}){let{format:n="auto",overwrite:i=!1,dryRun:o=!1,verbose:a=!1}=s,c=this.normalizePath(t),u=this.normalizePath(Qe(c)),f=this.pathExists(c);if(f&&!i)return a&&fe.info(`Skipping existing file: ${c}`),!1;if(o)return fe.info(`[DRY RUN] Would write file: ${c}`),!0;try{W.mkdirSync(u,{recursive:!0})}catch(T){if(T?.code!=="EEXIST")throw T}let b=this._detectFormat(t,n),m;v.isBuffer(r)?m=r:b==="json"&&typeof r=="object"?m=JSON.stringify(r,null,2):m=String(r);try{return v.isBuffer(m)?W.writeFileSync(c,m):W.writeFileSync(c,m,"utf8"),a&&fe.info(`${f?"Updated":"Created"} file: ${c}`),!0}catch(T){throw new Error(`Failed to write file: ${c}: ${T instanceof Error?T.message:String(T)}`)}}async copy(t,r,s={}){let{overwrite:n=!1,dryRun:i=!1,verbose:o=!1}=s,a=this.normalizePath(r),c=this.pathExists(a);if(c&&!n)return o&&fe.info(`Skipping existing file: ${a}`),!1;if(i)return fe.info(`[DRY RUN] Would copy file: ${a}`),!0;let u=this.normalizePath(Qe(a));try{await W.promises.mkdir(u,{recursive:!0})}catch(f){if(f?.code!=="EEXIST")throw f}try{return await ls(async()=>(await W.promises.copyFile(t,a),o&&fe.info(`${c?"Updated":"Created"} file: ${a}`),!0),`Failed to copy file from ${t} to ${a}`)}catch{return!1}}copySync(t,r,s={}){let{overwrite:n=!1,dryRun:i=!1,verbose:o=!1}=s,a=this.normalizePath(r),c=this.pathExists(a);if(c&&!n)return o&&fe.info(`Skipping existing file: ${a}`),!1;if(i)return fe.info(`[DRY RUN] Would copy file: ${a}`),!0;let u=this.normalizePath(Qe(a));try{W.mkdirSync(u,{recursive:!0})}catch(f){if(f?.code!=="EEXIST")throw f}try{return W.copyFileSync(t,a),o&&fe.info(`${c?"Updated":"Created"} file: ${a}`),!0}catch{return!1}}pathExists(t,r=!1){try{return W.existsSync(t)}catch(s){return r||fe.error(`Error checking path existence: ${t}`,s),!1}}mkdir(t){try{let r=t.startsWith("/")||t.match(/^[A-Z]:/)?this.normalizePath(t):this.resolveAppPath(t);return W.existsSync(r)||W.mkdirSync(r,{recursive:!0}),!0}catch{return!1}}readdirSync(t,r){try{return W.readdirSync(t,r)}catch(s){return this.options.debug&&fe.warn(`Failed to read directory: ${t}`,s),r&&typeof r=="object"&&"withFileTypes"in r&&r.withFileTypes?[]:[]}}statSync(t){try{return W.statSync(t)}catch(r){return this.options.debug&&fe.warn(`Failed to stat file: ${t}`,r),null}}lstatSync(t){try{return W.lstatSync(t)}catch(r){return this.options.debug&&fe.warn(`Failed to lstat file: ${t}`,r),null}}async ensureDir(t){try{await W.promises.mkdir(t,{recursive:!0})}catch(r){if(r?.code!=="EEXIST")throw r}}ensureDirSync(t){try{W.mkdirSync(t,{recursive:!0})}catch(r){if(r?.code!=="EEXIST")throw r}}async remove(t){await W.promises.rm(t,{recursive:!0,force:!0})}removeSync(t){W.rmSync(t,{recursive:!0,force:!0})}async readdir(t,r){return W.promises.readdir(t,r)}stripBom(t){return t.charCodeAt(0)===65279?t.slice(1):t}getRepoRoot(){return this._repoRoot||p.cwd()}getAppRoot(){return this._appRoot?this._appRoot:this._repoRoot}setAppRoot(t){if(!t)throw new Error("PathResolver.setAppRoot: root cannot be undefined or null");this._appRoot=this.normalizePath(t)}isMonorepo(){let t=qe(this._repoRoot,"packages");return this.pathExists(t)}isWithinApp(t){let r=this.normalizePath(zt(t)),s=this.getAppRoot(),n=os(s,r),i=this.normalizePath(n);return!i.startsWith("../")&&!i.startsWith("/")}async findFiles(t,r,s={}){let n=this.normalizePath(qe(t,r)),i=this.getAppRoot(),o=this.normalizePath(i),a=n.startsWith(o)?n.slice(o.length+1):n,c={absolute:!0,onlyFiles:!0,braceExpansion:!0,extglob:!0,globstar:!0,cwd:i,ignore:pt.SCAN_PATTERNS?.globalIgnore||["**/node_modules/**","**/dist/**","**/build/**","**/.git/**"]};return await this._globWithNormalization([a],{...c,...s})}clearCache(){}async _resolveFrameworkI18nPattern(t){let r=pt.I18N_PATHS;if(!r)return null;let s=t.replace(r.SOURCE_ROOT+"/",""),n=this.resolveFrameworkPackage("@donotdev/core");if(!n)return null;let i=this.normalizePath(qe(n,r.PUBLISHED_ROOT,s)),o=i.replace(/\/[^/]*\*.*$/,"");return this.pathExists(o),i}async _globWithNormalization(t,r){return(await So(t,r)).map(n=>{let i=typeof n=="string"?n:n.path;return this.normalizePath(i)})}async resolveFiles(t,r="css"){if(!t||typeof t!="object")return{frameworkFiles:[],consumerFiles:[]};if(r==="i18n")return{frameworkFiles:[],consumerFiles:[]};if(Array.isArray(t.framework)||(t.framework=[]),!Array.isArray(t.consumer))return{frameworkFiles:[],consumerFiles:[]};let s=[...t.framework,...t.consumer];for(let f of s)if(typeof f!="string"||f.trim()==="")return{frameworkFiles:[],consumerFiles:[]};let n=this.getAppRoot(),i=pt.getGlobOptionsFor?pt.getGlobOptionsFor(r):{ignore:["**/node_modules/**","**/dist/**","**/build/**"]},o=this.normalizePath(n),a=t.framework.map(f=>{let b=this.normalizePath(f);return b.startsWith(o)?b.slice(o.length+1):b}),c=t.consumer.map(f=>{let b=this.normalizePath(f);return b.startsWith(o)?b.slice(o.length+1):b}),u={...i,onlyFiles:!0,absolute:!0,braceExpansion:!0,extglob:!0,globstar:!0,cwd:n};try{let f=a.length>0?await this._globWithNormalization(a,u):[],b=await this._globWithNormalization(c,u);return{frameworkFiles:f,consumerFiles:b}}catch{return this.options.debug,{frameworkFiles:[],consumerFiles:[]}}}async resolvePatterns(t){if(!pt.getPatternsFor)return{framework:[],consumer:[],all:[]};let r=this.getAppRoot(),s=this.getRepoRoot();if(t==="i18n"&&(!r||r===s))throw new Error(`Cannot resolve i18n patterns: appRoot not set (appRoot: ${r}, repoRoot: ${s}). Ensure configResolved hook has run before discovery.`);let n=pt.getPatternsFor(t),i=this.isMonorepo();if(t==="i18n"){let c=n,u={eager:c.eager.map(f=>f.startsWith("!")?"!"+this.resolveAppPath(f.slice(1)):this.resolveAppPath(f)),lazy:c.lazy.map(f=>f.startsWith("!")?"!"+this.resolveAppPath(f.slice(1)):this.resolveAppPath(f)),framework:{eager:i?(c.framework?.eager||[]).map(f=>this.resolveRepoPath(f)).filter(Boolean):await Promise.all((c.framework?.eager||[]).map(f=>this._resolveFrameworkI18nPattern(f))).then(f=>f.filter(Boolean)),lazy:i?(c.framework?.lazy||[]).map(f=>this.resolveRepoPath(f)).filter(Boolean):await Promise.all((c.framework?.lazy||[]).map(f=>this._resolveFrameworkI18nPattern(f))).then(f=>f.filter(Boolean))},all:[]};return u.all=[...u.eager,...u.lazy,...u.framework.eager,...u.framework.lazy],u}let o=n,a={framework:i?(o.framework||[]).map(c=>this.resolveRepoPath(c)).filter(Boolean):[],consumer:(o.consumer||[]).map(c=>this.resolveAppPath(c)),all:[]};return a.all=[...a.consumer,...a.framework],a}getEmptyModulePath(t=!1){if(t)return"@donotdev/core/empty";let r=this.resolvePackage("@donotdev/core/empty");if(r)return r;let s=Qe(Ro(import.meta.url));return this.normalizePath(qe(s,"../empty.js"))}_findRepoRoot(t){let r=this.normalizePath(t),s=0,n=this.options.maxLevels;for(;s<n;){let i=this.normalizePath(qe(r,cs.TOOLING)),o=this.normalizePath(qe(r,cs.CORE));if(this.pathExists(i)&&this.pathExists(o))return r;let a=qe(r,"apps");if(this.pathExists(a)&&this.statSync(a)?.isDirectory())return this.normalizePath(r);let c=this.normalizePath(qe(r,"package.json"));if(this.pathExists(c)&&this.normalizePath(Qe(r))===r)return r;let u=this.normalizePath(Qe(r));if(u===r)break;r=u,s++}return this.normalizePath(t)}};var De={reset:"\x1B[0m",green:"\x1B[32m",brightGreen:"\x1B[92m",red:"\x1B[31m",brightRed:"\x1B[91m",yellow:"\x1B[33m",brightYellow:"\x1B[93m",blue:"\x1B[34m",cyan:"\x1B[36m",brightCyan:"\x1B[96m",gray:"\x1B[90m",white:"\x1B[37m"};function $o(){return p.env.NO_COLOR?!1:p.platform==="win32"?!0:p.stdout.isTTY===!0}function Ce(e,t){return $o()?`${t}${e}${De.reset}`:e}function Q(e,t,r,s={}){let{logDir:n=".dndev-logs",fileLogging:i=!1}=s,o=ne.getInstance(),a=null;if(i){let f=o.resolveAppPath(n);o.pathExists(f)||o.mkdir(f),a=o.resolveAppPath(`${n}/${e.replace(/[^a-zA-Z0-9]/g,"-")}.log`);let b=`=== ${e} Log Started at ${new Date().toISOString()} ===
3
3
  `;o.writeSync(a,b)}let c=(f,b,m)=>{if(a){let T=new Date().toISOString(),U=m.length>0?" "+m.map(re=>typeof re=="object"?JSON.stringify(re,null,2):String(re)).join(" "):"",V=`${T} [${f}] ${b}${U}
4
4
  `;o.appendFile(a,V)}},u=(f,b)=>{if(b.length===0)return f;let m=b.map(T=>typeof T=="object"?JSON.stringify(T,null,2):String(T)).join(" ");return`${f} ${m}`};return{debug:(f,...b)=>{t&&(i?c("DEBUG",f,b):Re.log.message(Ce(u(f,b),De.gray)))},verbose:(f,...b)=>{r&&(i?c("VERBOSE",f,b):Re.log.message(u(f,b)))},info:(f,...b)=>{i?c("INFO",f,b):Re.log.info(Ce(u(f,b),De.brightCyan))},warn:(f,...b)=>{t&&i?c("WARN",f,b):Re.log.warn(Ce(u(f,b),De.brightYellow))},error:(f,...b)=>{t&&i?c("ERROR",f,b):Re.log.error(Ce(u(f,b),De.brightRed))},success:(f,...b)=>{t&&i?c("SUCCESS",f,b):Re.log.success(Ce(u(f,b),De.brightGreen))},when:(f,b="debug")=>(m,...T)=>{if(f){let U=u(m,T);switch(b){case"verbose":r&&(Re.log.message(U),c("VERBOSE",m,T));break;case"info":Re.log.info(Ce(U,De.brightCyan)),c("INFO",m,T);break;case"warn":Re.log.warn(Ce(U,De.brightYellow)),c("WARN",m,T);break;case"error":Re.log.error(Ce(U,De.brightRed)),c("ERROR",m,T);break;case"success":Re.log.success(Ce(U,De.brightGreen)),c("SUCCESS",m,T);break;default:t&&(Re.log.message(Ce(U,De.gray)),c("DEBUG",m,T))}}},getLogFilePath:()=>a}}function us(e={}){let{mode:t="development",chunkingOptions:r={},debug:s,verbose:n=!0,isDev:i,isDebug:o,shouldAnalyze:a,build:c={}}=e,u=Q("build",s,n),f=is(t,r);return u.debug("\u{1F41B} DEBUG MODE ENABLED:"),u.debug(" - Minification: DISABLED"),u.debug(" - Sourcemaps: ENABLED"),u.debug(" - Console logs: PRESERVED"),u.debug(" - Debugger statements: PRESERVED"),a&&(u.info("\u{1F4CA} Bundle analysis enabled"),u.info(` Visual treemap will open after build (stats.html)