@donotdev/core 0.0.13 → 0.0.14

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.
Files changed (36) hide show
  1. package/eslint/index.js +1 -1
  2. package/functions/index.d.ts +1083 -3
  3. package/functions/index.js +11 -1
  4. package/i18n/locales/eager/dndev_ar.json +0 -139
  5. package/i18n/locales/eager/dndev_de.json +0 -139
  6. package/i18n/locales/eager/dndev_en.json +5 -139
  7. package/i18n/locales/eager/dndev_es.json +0 -139
  8. package/i18n/locales/eager/dndev_fr.json +0 -139
  9. package/i18n/locales/eager/dndev_it.json +47 -186
  10. package/i18n/locales/eager/dndev_ja.json +0 -139
  11. package/i18n/locales/eager/dndev_ko.json +0 -139
  12. package/i18n/locales/lazy/crud_ar.json +195 -0
  13. package/i18n/locales/lazy/crud_de.json +195 -0
  14. package/i18n/locales/lazy/crud_en.json +412 -0
  15. package/i18n/locales/lazy/crud_es.json +195 -0
  16. package/i18n/locales/lazy/crud_fr.json +195 -0
  17. package/i18n/locales/lazy/crud_it.json +195 -0
  18. package/i18n/locales/lazy/crud_ja.json +195 -0
  19. package/i18n/locales/lazy/crud_ko.json +195 -0
  20. package/i18n/locales/lazy/oauth_ar.json +11 -11
  21. package/i18n/locales/lazy/oauth_de.json +11 -11
  22. package/i18n/locales/lazy/oauth_en.json +11 -11
  23. package/i18n/locales/lazy/oauth_es.json +11 -11
  24. package/i18n/locales/lazy/oauth_fr.json +11 -11
  25. package/i18n/locales/lazy/oauth_it.json +11 -11
  26. package/i18n/locales/lazy/oauth_ja.json +11 -11
  27. package/i18n/locales/lazy/oauth_ko.json +11 -11
  28. package/index.d.ts +6636 -6348
  29. package/index.js +37 -37
  30. package/next/index.d.ts +209 -154
  31. package/next/index.js +20 -20
  32. package/package.json +1 -1
  33. package/server.d.ts +4289 -3900
  34. package/server.js +1 -1
  35. package/vite/index.d.ts +209 -154
  36. package/vite/index.js +2 -2
package/vite/index.js CHANGED
@@ -1,8 +1,8 @@
1
- var ro=Object.create;var Kr=Object.defineProperty;var so=Object.getOwnPropertyDescriptor;var no=Object.getOwnPropertyNames;var io=Object.getPrototypeOf,oo=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 Yr=(e,t)=>()=>(e&&(t=e(e=0)),t);var q=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var ao=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of no(t))!oo.call(e,n)&&n!==r&&Kr(e,n,{get:()=>t[n],enumerable:!(s=so(t,n))||s.enumerable});return e};var lo=(e,t,r)=>(r=e!=null?ro(io(e)):{},ao(t||!e||!e.__esModule?Kr(r,"default",{value:e,enumerable:!0}):r,e));function es(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 Qr[e]||Qr.base}var dr,ee,ve,ue,gr,Ge,Lt,ke,at,Zr,pr,mr,Qr,ge=Yr(()=>{"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"],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","sharp","semver","file-type"]},Zr=["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={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)/}},mr=[{name:"light",displayName:"Light",icon:"Sun",isDark:!1}],Qr={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{createRequire as uo}from"node:module";import{fileURLToPath as fo}from"node:url";import{dirname as ho,resolve as Sf}from"node:path";import{Buffer as v}from"node:buffer";import p from"node:process";var go,y,w,g=Yr(()=>{"use strict";go=uo(import.meta.url),y=fo(import.meta.url),w=ho(y);typeof globalThis<"u"&&(globalThis.require=go,globalThis.__filename=y,globalThis.__dirname=w,globalThis.Buffer=v,globalThis.process=p,typeof global>"u"&&(globalThis.global=globalThis))});var Oe=q((xh,vs)=>{g();var bs=e=>typeof e<"u"&&e!==null,Fo=e=>typeof e=="object",Oo=e=>Object.prototype.toString.call(e)==="[object Object]",jo=e=>typeof e=="function",Lo=e=>typeof e=="boolean",Mo=e=>e instanceof v,zo=e=>{if(bs(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},Bo=e=>e instanceof ArrayBuffer,Uo=e=>typeof e=="string"&&e.length>0,Go=e=>typeof e=="number"&&!Number.isNaN(e),qo=e=>Number.isInteger(e),Wo=(e,t,r)=>e>=t&&e<=r,Ho=(e,t)=>t.includes(e),Vo=(e,t,r)=>new Error(`Expected ${t} for ${e} but received ${r} of type ${typeof r}`),Jo=(e,t)=>(t.message=e.message,t);vs.exports={defined:bs,object:Fo,plainObject:Oo,fn:jo,bool:Lo,buffer:Mo,typedArray:zo,arrayBuffer:Bo,string:Uo,number:Go,integer:qo,inRange:Wo,inArray:Ho,invalidParameterError:Vo,nativeError:Jo}});var Es=q((Rh,ws)=>{"use strict";g();var ys=()=>p.platform==="linux",Ut=null,Xo=()=>{if(!Ut)if(ys()&&p.report){let e=p.report.excludeNetwork;p.report.excludeNetwork=!0,Ut=p.report.getReport(),p.report.excludeNetwork=e}else Ut={};return Ut};ws.exports={isLinux:ys,getReport:Xo}});var Ps=q(($h,xs)=>{"use strict";g();var mt=ie("fs"),Ko="/usr/bin/ldd",Yo="/proc/self/exe",Gt=2048,Qo=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)},Zo=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,()=>{})})}})});xs.exports={LDD_PATH:Ko,SELF_PATH:Yo,readFileSync:Qo,readFile:Zo}});var Ss=q((Ah,Rs)=>{"use strict";g();var ea=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};Rs.exports={interpreterPath:ea}});var Wt=q((Nh,Gs)=>{"use strict";g();var ks=ie("child_process"),{isLinux:bt,getReport:As}=Es(),{LDD_PATH:qt,SELF_PATH:_s,readFile:vr,readFileSync:yr}=Ps(),{interpreterPath:Ns}=Ss(),je,Le,Me,Is="getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",et="",Ts=()=>et||new Promise(e=>{ks.exec(Is,(t,r)=>{et=t?" ":r,e(et)})}),Ds=()=>{if(!et)try{et=ks.execSync(Is,{encoding:"utf8"})}catch{et=" "}return et},We="glibc",Cs=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,lt="musl",ta=e=>e.includes("libc.musl-")||e.includes("ld-musl-"),Fs=()=>{let e=As();return e.header&&e.header.glibcVersionRuntime?We:Array.isArray(e.sharedObjects)&&e.sharedObjects.some(ta)?lt:null},Os=e=>{let[t,r]=e.split(/[\r\n]+/);return t&&t.includes(We)?We:r&&r.includes(lt)?lt:null},js=e=>{if(e){if(e.includes("/ld-musl-"))return lt;if(e.includes("/ld-linux-"))return We}return null},Ls=e=>(e=e.toString(),e.includes("musl")?lt:e.includes("GNU C Library")?We:null),ra=async()=>{if(Le!==void 0)return Le;Le=null;try{let e=await vr(qt);Le=Ls(e)}catch{}return Le},sa=()=>{if(Le!==void 0)return Le;Le=null;try{let e=yr(qt);Le=Ls(e)}catch{}return Le},na=async()=>{if(je!==void 0)return je;je=null;try{let e=await vr(_s),t=Ns(e);je=js(t)}catch{}return je},ia=()=>{if(je!==void 0)return je;je=null;try{let e=yr(_s),t=Ns(e);je=js(t)}catch{}return je},Ms=async()=>{let e=null;if(bt()&&(e=await na(),!e&&(e=await ra(),e||(e=Fs()),!e))){let t=await Ts();e=Os(t)}return e},zs=()=>{let e=null;if(bt()&&(e=ia(),!e&&(e=sa(),e||(e=Fs()),!e))){let t=Ds();e=Os(t)}return e},oa=async()=>bt()&&await Ms()!==We,aa=()=>bt()&&zs()!==We,la=async()=>{if(Me!==void 0)return Me;Me=null;try{let t=(await vr(qt)).match(Cs);t&&(Me=t[1])}catch{}return Me},ca=()=>{if(Me!==void 0)return Me;Me=null;try{let t=yr(qt).match(Cs);t&&(Me=t[1])}catch{}return Me},Bs=()=>{let e=As();return e.header&&e.header.glibcVersionRuntime?e.header.glibcVersionRuntime:null},$s=e=>e.trim().split(/\s+/)[1],Us=e=>{let[t,r,s]=e.split(/[\r\n]+/);return t&&t.includes(We)?$s(t):r&&s&&r.includes(lt)?$s(s):null},ua=async()=>{let e=null;if(bt()&&(e=await la(),e||(e=Bs()),!e)){let t=await Ts();e=Us(t)}return e},fa=()=>{let e=null;if(bt()&&(e=ca(),e||(e=Bs()),!e)){let t=Ds();e=Us(t)}return e};Gs.exports={GLIBC:We,MUSL:lt,family:Ms,familySync:zs,isNonGlibcLinux:oa,isNonGlibcLinuxSync:aa,version:ua,versionSync:fa}});var Nt=q((Th,qs)=>{"use strict";g();var ha=typeof p=="object"&&p.env&&p.env.NODE_DEBUG&&/\bsemver\b/i.test(p.env.NODE_DEBUG)?(...e)=>{}:()=>{};qs.exports=ha});var Ht=q((Ch,Ws)=>{"use strict";g();var da="2.0.0",ga=Number.MAX_SAFE_INTEGER||9007199254740991,pa=16,ma=250,ba=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Ws.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:pa,MAX_SAFE_BUILD_LENGTH:ma,MAX_SAFE_INTEGER:ga,RELEASE_TYPES:ba,SEMVER_SPEC_VERSION:da,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var It=q((ze,Hs)=>{"use strict";g();var{MAX_SAFE_COMPONENT_LENGTH:wr,MAX_SAFE_BUILD_LENGTH:va,MAX_LENGTH:ya}=Ht(),wa=Nt();ze=Hs.exports={};var Ea=ze.re=[],xa=ze.safeRe=[],N=ze.src=[],Pa=ze.safeSrc=[],I=ze.t={},Ra=0,Er="[a-zA-Z0-9-]",Sa=[["\\s",1],["\\d",ya],[Er,va]],$a=e=>{for(let[t,r]of Sa)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},B=(e,t,r)=>{let s=$a(t),n=Ra++;wa(e,n,t),I[e]=n,N[n]=t,Pa[n]=s,Ea[n]=new RegExp(t,r?"g":void 0),xa[n]=new RegExp(s,r?"g":void 0)};B("NUMERICIDENTIFIER","0|[1-9]\\d*");B("NUMERICIDENTIFIERLOOSE","\\d+");B("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Er}*`);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",`${Er}+`);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,${wr}})(?:\\.(\\d{1,${wr}}))?(?:\\.(\\d{1,${wr}}))?`);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((jh,Vs)=>{"use strict";g();var ka=Object.freeze({loose:!0}),Aa=Object.freeze({}),_a=e=>e?typeof e!="object"?ka:e:Aa;Vs.exports=_a});var Ys=q((Mh,Ks)=>{"use strict";g();var Js=/^[0-9]+$/,Xs=(e,t)=>{if(typeof e=="number"&&typeof t=="number")return e===t?0:e<t?-1:1;let r=Js.test(e),s=Js.test(t);return r&&s&&(e=+e,t=+t),e===t?0:r&&!s?-1:s&&!r?1:e<t?-1:1},Na=(e,t)=>Xs(t,e);Ks.exports={compareIdentifiers:Xs,rcompareIdentifiers:Na}});var vt=q((Bh,Zs)=>{"use strict";g();var Jt=Nt(),{MAX_LENGTH:Qs,MAX_SAFE_INTEGER:Xt}=Ht(),{safeRe:Kt,t:Yt}=It(),Ia=Vt(),{compareIdentifiers:xr}=Ys(),Pr=class e{constructor(t,r){if(r=Ia(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>Qs)throw new TypeError(`version is longer than ${Qs} 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 xr(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 xr(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]),xr(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}};Zs.exports=Pr});var rn=q((Gh,tn)=>{"use strict";g();var en=vt(),Ta=(e,t,r=!1)=>{if(e instanceof en)return e;try{return new en(e,t)}catch(s){if(!r)return null;throw s}};tn.exports=Ta});var nn=q((Wh,sn)=>{"use strict";g();var Da=vt(),Ca=rn(),{safeRe:Qt,t:Zt}=It(),Fa=(e,t)=>{if(e instanceof Da)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 Ca(`${s}.${n}.${i}${o}${a}`,t)};sn.exports=Fa});var ct=q((Vh,an)=>{"use strict";g();var on=vt(),Oa=(e,t,r)=>new on(e,r).compare(new on(t,r));an.exports=Oa});var Rr=q((Xh,ln)=>{"use strict";g();var ja=ct(),La=(e,t,r)=>ja(e,t,r)>=0;ln.exports=La});var un=q((Yh,cn)=>{"use strict";g();var Sr=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}};cn.exports=Sr});var hn=q((Zh,fn)=>{"use strict";g();var Ma=ct(),za=(e,t,r)=>Ma(e,t,r)===0;fn.exports=za});var gn=q((td,dn)=>{"use strict";g();var Ba=ct(),Ua=(e,t,r)=>Ba(e,t,r)!==0;dn.exports=Ua});var mn=q((sd,pn)=>{"use strict";g();var Ga=ct(),qa=(e,t,r)=>Ga(e,t,r)>0;pn.exports=qa});var vn=q((id,bn)=>{"use strict";g();var Wa=ct(),Ha=(e,t,r)=>Wa(e,t,r)<0;bn.exports=Ha});var wn=q((ad,yn)=>{"use strict";g();var Va=ct(),Ja=(e,t,r)=>Va(e,t,r)<=0;yn.exports=Ja});var xn=q((cd,En)=>{"use strict";g();var Xa=hn(),Ka=gn(),Ya=mn(),Qa=Rr(),Za=vn(),el=wn(),tl=(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 Xa(e,r,s);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);default:throw new TypeError(`Invalid operator: ${t}`)}};En.exports=tl});var _n=q((fd,An)=>{"use strict";g();var Tt=Symbol("SemVer ANY"),Ar=class e{static get ANY(){return Tt}constructor(t,r){if(r=Pn(r),t instanceof e){if(t.loose===!!r.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),kr("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,kr("comp",this)}parse(t){let r=this.options.loose?Rn[Sn.COMPARATORLOOSE]:Rn[Sn.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 $n(s[2],this.options.loose):this.semver=Tt}toString(){return this.value}test(t){if(kr("Comparator.test",t,this.options.loose),this.semver===Tt||t===Tt)return!0;if(typeof t=="string")try{t=new $n(t,this.options)}catch{return!1}return $r(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 kn(t.value,r).test(this.value):t.operator===""?t.value===""?!0:new kn(this.value,r).test(t.semver):(r=Pn(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("=")||$r(this.semver,"<",t.semver,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||$r(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}};An.exports=Ar;var Pn=Vt(),{safeRe:Rn,t:Sn}=It(),$r=xn(),kr=Nt(),$n=vt(),kn=_r()});var _r=q((dd,Dn)=>{"use strict";g();var rl=/\s+/g,Nr=class e{constructor(t,r){if(r=nl(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof Ir)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(rl," "),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=>!In(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&&fl(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&&cl)|(this.options.loose&&ul))+":"+t,n=Nn.get(s);if(n)return n;let i=this.options.loose,o=i?we[be.HYPHENRANGELOOSE]:we[be.HYPHENRANGE];t=t.replace(o,El(this.options.includePrerelease)),te("hyphen replace",t),t=t.replace(we[be.COMPARATORTRIM],ol),te("comparator trim",t),t=t.replace(we[be.TILDETRIM],al),te("tilde trim",t),t=t.replace(we[be.CARETTRIM],ll),te("caret trim",t);let a=t.split(" ").map(b=>hl(b,this.options)).join(" ").split(/\s+/).map(b=>wl(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 Ir(b,this.options));for(let b of u){if(In(b))return[b];c.set(b.value,b)}c.size>1&&c.has("")&&c.delete("");let f=[...c.values()];return Nn.set(s,f),f}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some(s=>Tn(s,r)&&t.set.some(n=>Tn(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 il(t,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(xl(this.set[r],t,this.options))return!0;return!1}};Dn.exports=Nr;var sl=un(),Nn=new sl,nl=Vt(),Ir=_n(),te=Nt(),il=vt(),{safeRe:we,t:be,comparatorTrimReplace:ol,tildeTrimReplace:al,caretTrimReplace:ll}=It(),{FLAG_INCLUDE_PRERELEASE:cl,FLAG_LOOSE:ul}=Ht(),In=e=>e.value==="<0.0.0-0",fl=e=>e.value==="",Tn=(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},hl=(e,t)=>(e=e.replace(we[be.BUILD],""),te("comp",e,t),e=pl(e,t),te("caret",e),e=dl(e,t),te("tildes",e),e=bl(e,t),te("xrange",e),e=yl(e,t),te("stars",e),e),Ee=e=>!e||e.toLowerCase()==="x"||e==="*",dl=(e,t)=>e.trim().split(/\s+/).map(r=>gl(r,t)).join(" "),gl=(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})},pl=(e,t)=>e.trim().split(/\s+/).map(r=>ml(r,t)).join(" "),ml=(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})},bl=(e,t)=>(te("replaceXRanges",e,t),e.split(/\s+/).map(r=>vl(r,t)).join(" ")),vl=(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})},yl=(e,t)=>(te("replaceStars",e,t),e.trim().replace(we[be.STAR],"")),wl=(e,t)=>(te("replaceGTE0",e,t),e.trim().replace(we[t.includePrerelease?be.GTE0PRE:be.GTE0],"")),El=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()),xl=(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!==Ir.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 Fn=q((pd,Cn)=>{"use strict";g();var Pl=_r(),Rl=(e,t,r)=>{try{t=new Pl(t,r)}catch{return!1}return t.test(e)};Cn.exports=Rl});var Tr=q((bd,Sl)=>{Sl.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 Cr=q((vd,Wn)=>{g();var{spawnSync:er}=ie("node:child_process"),{createHash:$l}=ie("node:crypto"),Mn=nn(),kl=Rr(),Al=Fn(),On=Wt(),{config:_l,engines:jn,optionalDependencies:Nl}=Tr(),Il=p.env.npm_package_config_libvips||_l.libvips,zn=Mn(Il).version,Tl=["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},Dl=e=>{e instanceof Error},Bn=()=>On.isNonGlibcLinuxSync()?On.familySync():"",Cl=()=>`${p.platform}${Bn()}-${p.arch}`,yt=()=>{if(Un())return"wasm32";let{npm_config_arch:e,npm_config_platform:t,npm_config_libc:r}=p.env,s=typeof r=="string"?r:Bn();return`${t||p.platform}${s}-${e||p.arch}`},Fl=()=>{try{return ie(`@img/sharp-libvips-dev-${yt()}/include`)}catch{try{return ie("@img/sharp-libvips-dev/include")}catch{}}return""},Ol=()=>{try{return ie("@img/sharp-libvips-dev/cplusplus")}catch{}return""},jl=()=>{try{return ie(`@img/sharp-libvips-dev-${yt()}/lib`)}catch{try{return ie(`@img/sharp-libvips-${yt()}/lib`)}catch{}}return""},Ll=()=>{if(p.release?.name==="node"&&p.versions&&!Al(p.versions.node,jn.node))return{found:p.versions.node,expected:jn.node}},Un=()=>{let{CC:e}=p.env;return!!e?.endsWith("/emcc")},Ml=()=>p.platform==="darwin"&&p.arch==="x64"?(er("sysctl sysctl.proc_translated",tr).stdout||"").trim()==="sysctl.proc_translated: 1":!1,Ln=e=>$l("sha512").update(e).digest("hex"),zl=()=>{try{let e=Ln(`imgsharp-libvips-${yt()}`),t=Mn(Nl[`@img/sharp-libvips-${yt()}`],{includePrerelease:!0}).version;return Ln(`${e}npm:${t}`).slice(0,10)}catch{}return""},Bl=()=>er(`node-gyp rebuild --directory=src ${Un()?"--nodedir=emscripten":""}`,{...tr,stdio:"inherit"}).status,Gn=()=>p.platform!=="win32"?(er("pkg-config --modversion vips-cpp",{...tr,env:{...p.env,PKG_CONFIG_PATH:qn()}}).stdout||"").trim():"",qn=()=>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(":"):"",Dr=(e,t,r)=>(r&&r(`Detected ${t}, skipping search for globally-installed libvips`),e),Ul=e=>{if(p.env.SHARP_IGNORE_GLOBAL_LIBVIPS)return Dr(!1,"SHARP_IGNORE_GLOBAL_LIBVIPS",e);if(p.env.SHARP_FORCE_GLOBAL_LIBVIPS)return Dr(!0,"SHARP_FORCE_GLOBAL_LIBVIPS",e);if(Ml())return Dr(!1,"Rosetta",e);let t=Gn();return!!t&&kl(t,zn)};Wn.exports={minimumLibvipsVersion:zn,prebuiltPlatforms:Tl,buildPlatformArch:yt,buildSharpLibvipsIncludeDir:Fl,buildSharpLibvipsCPlusPlusDir:Ol,buildSharpLibvipsLibDir:jl,isUnsupportedNodeRuntime:Ll,runtimePlatformArch:Cl,log:Dl,yarnLocator:zl,spawnRebuild:Bl,globalLibvipsVersion:Gn,pkgConfigPath:qn,useGlobalLibvips:Ul}});var Ct=q((Ed,Vn)=>{g();var{familySync:Gl,versionSync:ql}=Wt(),{runtimePlatformArch:Wl,isUnsupportedNodeRuntime:Hn,prebuiltPlatforms:Hl,minimumLibvipsVersion:Vl}=Cr(),ut=Wl(),Jl=[`../src/build/Release/sharp-${ut}.node`,"../src/build/Release/sharp-wasm32.node",`@img/sharp-${ut}/sharp.node`,"@img/sharp-wasm32/sharp.node"],Fr,wt,Dt=[];for(Fr of Jl)try{wt=ie(Fr);break}catch(e){Dt.push(e)}if(wt&&Fr.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)Vn.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:"),Hn()){let{found:i,expected:o}=Hn();s.push("- Please upgrade Node.js:",` Found ${i}`,` Requires ${o}`)}else if(Hl.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 >= ${Vl}`,"- 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=`${Gl()} ${ql()}`,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 ro=Object.create;var Kr=Object.defineProperty;var so=Object.getOwnPropertyDescriptor;var no=Object.getOwnPropertyNames;var io=Object.getPrototypeOf,oo=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 Yr=(e,t)=>()=>(e&&(t=e(e=0)),t);var q=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var ao=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of no(t))!oo.call(e,n)&&n!==r&&Kr(e,n,{get:()=>t[n],enumerable:!(s=so(t,n))||s.enumerable});return e};var lo=(e,t,r)=>(r=e!=null?ro(io(e)):{},ao(t||!e||!e.__esModule?Kr(r,"default",{value:e,enumerable:!0}):r,e));function es(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 Qr[e]||Qr.base}var dr,ee,ve,ue,gr,Ge,Lt,ke,at,Zr,pr,mr,Qr,ge=Yr(()=>{"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"]},Zr=["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={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)/}},mr=[{name:"light",displayName:"Light",icon:"Sun",isDark:!1}],Qr={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 uo}from"node:module";import{dirname as fo,resolve as Sf}from"node:path";import p from"node:process";import{fileURLToPath as ho}from"node:url";var go,y,w,g=Yr(()=>{"use strict";go=uo(import.meta.url),y=ho(import.meta.url),w=fo(y);typeof globalThis<"u"&&(globalThis.require=go,globalThis.__filename=y,globalThis.__dirname=w,globalThis.Buffer=v,globalThis.process=p,typeof global>"u"&&(globalThis.global=globalThis))});var Oe=q((xh,vs)=>{g();var bs=e=>typeof e<"u"&&e!==null,Fo=e=>typeof e=="object",Oo=e=>Object.prototype.toString.call(e)==="[object Object]",jo=e=>typeof e=="function",Lo=e=>typeof e=="boolean",Mo=e=>e instanceof v,zo=e=>{if(bs(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},Bo=e=>e instanceof ArrayBuffer,Uo=e=>typeof e=="string"&&e.length>0,Go=e=>typeof e=="number"&&!Number.isNaN(e),qo=e=>Number.isInteger(e),Wo=(e,t,r)=>e>=t&&e<=r,Ho=(e,t)=>t.includes(e),Vo=(e,t,r)=>new Error(`Expected ${t} for ${e} but received ${r} of type ${typeof r}`),Jo=(e,t)=>(t.message=e.message,t);vs.exports={defined:bs,object:Fo,plainObject:Oo,fn:jo,bool:Lo,buffer:Mo,typedArray:zo,arrayBuffer:Bo,string:Uo,number:Go,integer:qo,inRange:Wo,inArray:Ho,invalidParameterError:Vo,nativeError:Jo}});var Es=q((Rh,ws)=>{"use strict";g();var ys=()=>p.platform==="linux",Ut=null,Xo=()=>{if(!Ut)if(ys()&&p.report){let e=p.report.excludeNetwork;p.report.excludeNetwork=!0,Ut=p.report.getReport(),p.report.excludeNetwork=e}else Ut={};return Ut};ws.exports={isLinux:ys,getReport:Xo}});var Ps=q(($h,xs)=>{"use strict";g();var mt=ie("fs"),Ko="/usr/bin/ldd",Yo="/proc/self/exe",Gt=2048,Qo=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)},Zo=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,()=>{})})}})});xs.exports={LDD_PATH:Ko,SELF_PATH:Yo,readFileSync:Qo,readFile:Zo}});var Ss=q((Ah,Rs)=>{"use strict";g();var ea=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};Rs.exports={interpreterPath:ea}});var Wt=q((Nh,Gs)=>{"use strict";g();var ks=ie("child_process"),{isLinux:bt,getReport:As}=Es(),{LDD_PATH:qt,SELF_PATH:_s,readFile:vr,readFileSync:yr}=Ps(),{interpreterPath:Ns}=Ss(),je,Le,Me,Is="getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",et="",Ts=()=>et||new Promise(e=>{ks.exec(Is,(t,r)=>{et=t?" ":r,e(et)})}),Ds=()=>{if(!et)try{et=ks.execSync(Is,{encoding:"utf8"})}catch{et=" "}return et},We="glibc",Cs=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,lt="musl",ta=e=>e.includes("libc.musl-")||e.includes("ld-musl-"),Fs=()=>{let e=As();return e.header&&e.header.glibcVersionRuntime?We:Array.isArray(e.sharedObjects)&&e.sharedObjects.some(ta)?lt:null},Os=e=>{let[t,r]=e.split(/[\r\n]+/);return t&&t.includes(We)?We:r&&r.includes(lt)?lt:null},js=e=>{if(e){if(e.includes("/ld-musl-"))return lt;if(e.includes("/ld-linux-"))return We}return null},Ls=e=>(e=e.toString(),e.includes("musl")?lt:e.includes("GNU C Library")?We:null),ra=async()=>{if(Le!==void 0)return Le;Le=null;try{let e=await vr(qt);Le=Ls(e)}catch{}return Le},sa=()=>{if(Le!==void 0)return Le;Le=null;try{let e=yr(qt);Le=Ls(e)}catch{}return Le},na=async()=>{if(je!==void 0)return je;je=null;try{let e=await vr(_s),t=Ns(e);je=js(t)}catch{}return je},ia=()=>{if(je!==void 0)return je;je=null;try{let e=yr(_s),t=Ns(e);je=js(t)}catch{}return je},Ms=async()=>{let e=null;if(bt()&&(e=await na(),!e&&(e=await ra(),e||(e=Fs()),!e))){let t=await Ts();e=Os(t)}return e},zs=()=>{let e=null;if(bt()&&(e=ia(),!e&&(e=sa(),e||(e=Fs()),!e))){let t=Ds();e=Os(t)}return e},oa=async()=>bt()&&await Ms()!==We,aa=()=>bt()&&zs()!==We,la=async()=>{if(Me!==void 0)return Me;Me=null;try{let t=(await vr(qt)).match(Cs);t&&(Me=t[1])}catch{}return Me},ca=()=>{if(Me!==void 0)return Me;Me=null;try{let t=yr(qt).match(Cs);t&&(Me=t[1])}catch{}return Me},Bs=()=>{let e=As();return e.header&&e.header.glibcVersionRuntime?e.header.glibcVersionRuntime:null},$s=e=>e.trim().split(/\s+/)[1],Us=e=>{let[t,r,s]=e.split(/[\r\n]+/);return t&&t.includes(We)?$s(t):r&&s&&r.includes(lt)?$s(s):null},ua=async()=>{let e=null;if(bt()&&(e=await la(),e||(e=Bs()),!e)){let t=await Ts();e=Us(t)}return e},fa=()=>{let e=null;if(bt()&&(e=ca(),e||(e=Bs()),!e)){let t=Ds();e=Us(t)}return e};Gs.exports={GLIBC:We,MUSL:lt,family:Ms,familySync:zs,isNonGlibcLinux:oa,isNonGlibcLinuxSync:aa,version:ua,versionSync:fa}});var Nt=q((Th,qs)=>{"use strict";g();var ha=typeof p=="object"&&p.env&&p.env.NODE_DEBUG&&/\bsemver\b/i.test(p.env.NODE_DEBUG)?(...e)=>{}:()=>{};qs.exports=ha});var Ht=q((Ch,Ws)=>{"use strict";g();var da="2.0.0",ga=Number.MAX_SAFE_INTEGER||9007199254740991,pa=16,ma=250,ba=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Ws.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:pa,MAX_SAFE_BUILD_LENGTH:ma,MAX_SAFE_INTEGER:ga,RELEASE_TYPES:ba,SEMVER_SPEC_VERSION:da,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var It=q((ze,Hs)=>{"use strict";g();var{MAX_SAFE_COMPONENT_LENGTH:wr,MAX_SAFE_BUILD_LENGTH:va,MAX_LENGTH:ya}=Ht(),wa=Nt();ze=Hs.exports={};var Ea=ze.re=[],xa=ze.safeRe=[],N=ze.src=[],Pa=ze.safeSrc=[],I=ze.t={},Ra=0,Er="[a-zA-Z0-9-]",Sa=[["\\s",1],["\\d",ya],[Er,va]],$a=e=>{for(let[t,r]of Sa)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},B=(e,t,r)=>{let s=$a(t),n=Ra++;wa(e,n,t),I[e]=n,N[n]=t,Pa[n]=s,Ea[n]=new RegExp(t,r?"g":void 0),xa[n]=new RegExp(s,r?"g":void 0)};B("NUMERICIDENTIFIER","0|[1-9]\\d*");B("NUMERICIDENTIFIERLOOSE","\\d+");B("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Er}*`);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",`${Er}+`);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,${wr}})(?:\\.(\\d{1,${wr}}))?(?:\\.(\\d{1,${wr}}))?`);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((jh,Vs)=>{"use strict";g();var ka=Object.freeze({loose:!0}),Aa=Object.freeze({}),_a=e=>e?typeof e!="object"?ka:e:Aa;Vs.exports=_a});var Ys=q((Mh,Ks)=>{"use strict";g();var Js=/^[0-9]+$/,Xs=(e,t)=>{if(typeof e=="number"&&typeof t=="number")return e===t?0:e<t?-1:1;let r=Js.test(e),s=Js.test(t);return r&&s&&(e=+e,t=+t),e===t?0:r&&!s?-1:s&&!r?1:e<t?-1:1},Na=(e,t)=>Xs(t,e);Ks.exports={compareIdentifiers:Xs,rcompareIdentifiers:Na}});var vt=q((Bh,Zs)=>{"use strict";g();var Jt=Nt(),{MAX_LENGTH:Qs,MAX_SAFE_INTEGER:Xt}=Ht(),{safeRe:Kt,t:Yt}=It(),Ia=Vt(),{compareIdentifiers:xr}=Ys(),Pr=class e{constructor(t,r){if(r=Ia(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>Qs)throw new TypeError(`version is longer than ${Qs} 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 xr(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 xr(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]),xr(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}};Zs.exports=Pr});var rn=q((Gh,tn)=>{"use strict";g();var en=vt(),Ta=(e,t,r=!1)=>{if(e instanceof en)return e;try{return new en(e,t)}catch(s){if(!r)return null;throw s}};tn.exports=Ta});var nn=q((Wh,sn)=>{"use strict";g();var Da=vt(),Ca=rn(),{safeRe:Qt,t:Zt}=It(),Fa=(e,t)=>{if(e instanceof Da)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 Ca(`${s}.${n}.${i}${o}${a}`,t)};sn.exports=Fa});var ct=q((Vh,an)=>{"use strict";g();var on=vt(),Oa=(e,t,r)=>new on(e,r).compare(new on(t,r));an.exports=Oa});var Rr=q((Xh,ln)=>{"use strict";g();var ja=ct(),La=(e,t,r)=>ja(e,t,r)>=0;ln.exports=La});var un=q((Yh,cn)=>{"use strict";g();var Sr=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}};cn.exports=Sr});var hn=q((Zh,fn)=>{"use strict";g();var Ma=ct(),za=(e,t,r)=>Ma(e,t,r)===0;fn.exports=za});var gn=q((td,dn)=>{"use strict";g();var Ba=ct(),Ua=(e,t,r)=>Ba(e,t,r)!==0;dn.exports=Ua});var mn=q((sd,pn)=>{"use strict";g();var Ga=ct(),qa=(e,t,r)=>Ga(e,t,r)>0;pn.exports=qa});var vn=q((id,bn)=>{"use strict";g();var Wa=ct(),Ha=(e,t,r)=>Wa(e,t,r)<0;bn.exports=Ha});var wn=q((ad,yn)=>{"use strict";g();var Va=ct(),Ja=(e,t,r)=>Va(e,t,r)<=0;yn.exports=Ja});var xn=q((cd,En)=>{"use strict";g();var Xa=hn(),Ka=gn(),Ya=mn(),Qa=Rr(),Za=vn(),el=wn(),tl=(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 Xa(e,r,s);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);default:throw new TypeError(`Invalid operator: ${t}`)}};En.exports=tl});var _n=q((fd,An)=>{"use strict";g();var Tt=Symbol("SemVer ANY"),Ar=class e{static get ANY(){return Tt}constructor(t,r){if(r=Pn(r),t instanceof e){if(t.loose===!!r.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),kr("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,kr("comp",this)}parse(t){let r=this.options.loose?Rn[Sn.COMPARATORLOOSE]:Rn[Sn.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 $n(s[2],this.options.loose):this.semver=Tt}toString(){return this.value}test(t){if(kr("Comparator.test",t,this.options.loose),this.semver===Tt||t===Tt)return!0;if(typeof t=="string")try{t=new $n(t,this.options)}catch{return!1}return $r(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 kn(t.value,r).test(this.value):t.operator===""?t.value===""?!0:new kn(this.value,r).test(t.semver):(r=Pn(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("=")||$r(this.semver,"<",t.semver,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||$r(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}};An.exports=Ar;var Pn=Vt(),{safeRe:Rn,t:Sn}=It(),$r=xn(),kr=Nt(),$n=vt(),kn=_r()});var _r=q((dd,Dn)=>{"use strict";g();var rl=/\s+/g,Nr=class e{constructor(t,r){if(r=nl(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof Ir)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(rl," "),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=>!In(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&&fl(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&&cl)|(this.options.loose&&ul))+":"+t,n=Nn.get(s);if(n)return n;let i=this.options.loose,o=i?we[be.HYPHENRANGELOOSE]:we[be.HYPHENRANGE];t=t.replace(o,El(this.options.includePrerelease)),te("hyphen replace",t),t=t.replace(we[be.COMPARATORTRIM],ol),te("comparator trim",t),t=t.replace(we[be.TILDETRIM],al),te("tilde trim",t),t=t.replace(we[be.CARETTRIM],ll),te("caret trim",t);let a=t.split(" ").map(b=>hl(b,this.options)).join(" ").split(/\s+/).map(b=>wl(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 Ir(b,this.options));for(let b of u){if(In(b))return[b];c.set(b.value,b)}c.size>1&&c.has("")&&c.delete("");let f=[...c.values()];return Nn.set(s,f),f}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some(s=>Tn(s,r)&&t.set.some(n=>Tn(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 il(t,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(xl(this.set[r],t,this.options))return!0;return!1}};Dn.exports=Nr;var sl=un(),Nn=new sl,nl=Vt(),Ir=_n(),te=Nt(),il=vt(),{safeRe:we,t:be,comparatorTrimReplace:ol,tildeTrimReplace:al,caretTrimReplace:ll}=It(),{FLAG_INCLUDE_PRERELEASE:cl,FLAG_LOOSE:ul}=Ht(),In=e=>e.value==="<0.0.0-0",fl=e=>e.value==="",Tn=(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},hl=(e,t)=>(e=e.replace(we[be.BUILD],""),te("comp",e,t),e=pl(e,t),te("caret",e),e=dl(e,t),te("tildes",e),e=bl(e,t),te("xrange",e),e=yl(e,t),te("stars",e),e),Ee=e=>!e||e.toLowerCase()==="x"||e==="*",dl=(e,t)=>e.trim().split(/\s+/).map(r=>gl(r,t)).join(" "),gl=(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})},pl=(e,t)=>e.trim().split(/\s+/).map(r=>ml(r,t)).join(" "),ml=(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})},bl=(e,t)=>(te("replaceXRanges",e,t),e.split(/\s+/).map(r=>vl(r,t)).join(" ")),vl=(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})},yl=(e,t)=>(te("replaceStars",e,t),e.trim().replace(we[be.STAR],"")),wl=(e,t)=>(te("replaceGTE0",e,t),e.trim().replace(we[t.includePrerelease?be.GTE0PRE:be.GTE0],"")),El=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()),xl=(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!==Ir.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 Fn=q((pd,Cn)=>{"use strict";g();var Pl=_r(),Rl=(e,t,r)=>{try{t=new Pl(t,r)}catch{return!1}return t.test(e)};Cn.exports=Rl});var Tr=q((bd,Sl)=>{Sl.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 Cr=q((vd,Wn)=>{g();var{spawnSync:er}=ie("node:child_process"),{createHash:$l}=ie("node:crypto"),Mn=nn(),kl=Rr(),Al=Fn(),On=Wt(),{config:_l,engines:jn,optionalDependencies:Nl}=Tr(),Il=p.env.npm_package_config_libvips||_l.libvips,zn=Mn(Il).version,Tl=["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},Dl=e=>{e instanceof Error},Bn=()=>On.isNonGlibcLinuxSync()?On.familySync():"",Cl=()=>`${p.platform}${Bn()}-${p.arch}`,yt=()=>{if(Un())return"wasm32";let{npm_config_arch:e,npm_config_platform:t,npm_config_libc:r}=p.env,s=typeof r=="string"?r:Bn();return`${t||p.platform}${s}-${e||p.arch}`},Fl=()=>{try{return ie(`@img/sharp-libvips-dev-${yt()}/include`)}catch{try{return ie("@img/sharp-libvips-dev/include")}catch{}}return""},Ol=()=>{try{return ie("@img/sharp-libvips-dev/cplusplus")}catch{}return""},jl=()=>{try{return ie(`@img/sharp-libvips-dev-${yt()}/lib`)}catch{try{return ie(`@img/sharp-libvips-${yt()}/lib`)}catch{}}return""},Ll=()=>{if(p.release?.name==="node"&&p.versions&&!Al(p.versions.node,jn.node))return{found:p.versions.node,expected:jn.node}},Un=()=>{let{CC:e}=p.env;return!!e?.endsWith("/emcc")},Ml=()=>p.platform==="darwin"&&p.arch==="x64"?(er("sysctl sysctl.proc_translated",tr).stdout||"").trim()==="sysctl.proc_translated: 1":!1,Ln=e=>$l("sha512").update(e).digest("hex"),zl=()=>{try{let e=Ln(`imgsharp-libvips-${yt()}`),t=Mn(Nl[`@img/sharp-libvips-${yt()}`],{includePrerelease:!0}).version;return Ln(`${e}npm:${t}`).slice(0,10)}catch{}return""},Bl=()=>er(`node-gyp rebuild --directory=src ${Un()?"--nodedir=emscripten":""}`,{...tr,stdio:"inherit"}).status,Gn=()=>p.platform!=="win32"?(er("pkg-config --modversion vips-cpp",{...tr,env:{...p.env,PKG_CONFIG_PATH:qn()}}).stdout||"").trim():"",qn=()=>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(":"):"",Dr=(e,t,r)=>(r&&r(`Detected ${t}, skipping search for globally-installed libvips`),e),Ul=e=>{if(p.env.SHARP_IGNORE_GLOBAL_LIBVIPS)return Dr(!1,"SHARP_IGNORE_GLOBAL_LIBVIPS",e);if(p.env.SHARP_FORCE_GLOBAL_LIBVIPS)return Dr(!0,"SHARP_FORCE_GLOBAL_LIBVIPS",e);if(Ml())return Dr(!1,"Rosetta",e);let t=Gn();return!!t&&kl(t,zn)};Wn.exports={minimumLibvipsVersion:zn,prebuiltPlatforms:Tl,buildPlatformArch:yt,buildSharpLibvipsIncludeDir:Fl,buildSharpLibvipsCPlusPlusDir:Ol,buildSharpLibvipsLibDir:jl,isUnsupportedNodeRuntime:Ll,runtimePlatformArch:Cl,log:Dl,yarnLocator:zl,spawnRebuild:Bl,globalLibvipsVersion:Gn,pkgConfigPath:qn,useGlobalLibvips:Ul}});var Ct=q((Ed,Vn)=>{g();var{familySync:Gl,versionSync:ql}=Wt(),{runtimePlatformArch:Wl,isUnsupportedNodeRuntime:Hn,prebuiltPlatforms:Hl,minimumLibvipsVersion:Vl}=Cr(),ut=Wl(),Jl=[`../src/build/Release/sharp-${ut}.node`,"../src/build/Release/sharp-wasm32.node",`@img/sharp-${ut}/sharp.node`,"@img/sharp-wasm32/sharp.node"],Fr,wt,Dt=[];for(Fr of Jl)try{wt=ie(Fr);break}catch(e){Dt.push(e)}if(wt&&Fr.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)Vn.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:"),Hn()){let{found:i,expected:o}=Hn();s.push("- Please upgrade Node.js:",` Found ${i}`,` Requires ${o}`)}else if(Hl.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 >= ${Vl}`,"- 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=`${Gl()} ${ql()}`,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 Xn=q((Rd,Jn)=>{g();var Xl=ie("node:util"),Or=ie("node:stream"),Kl=Oe();Ct();var Yl=Xl.debuglog("sharp"),Ql=e=>{ft.queue.emit("change",e)},ft=function(e,t){if(arguments.length===1&&!Kl.defined(e))throw new Error("Invalid input");return this instanceof ft?(Or.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),Yl(r)},queueListener:Ql},this.options.input=this._createInputDescriptor(e,t,{allowStream:!0}),this):new ft(e,t)};Object.setPrototypeOf(ft.prototype,Or.Duplex.prototype);Object.setPrototypeOf(ft,Or.Duplex);function Zl(){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:Zl});Jn.exports=ft});var Qn=q(($d,Yn)=>{g();var h=Oe(),tt=Ct(),ec={left:"low",top:"low",low:"low",center:"centre",centre:"centre",right:"high",bottom:"high",high:"high"},tc=["failOn","limitInputPixels","unlimited","animated","autoOrient","density","ignoreIcc","page","pages","sequentialRead","jp2","openSlide","pdf","raw","svg","tiff","failOnError","openSlideLevel","pdfBackground","tiffSubifd"];function Kn(e){let t=tc.filter(r=>h.defined(e[r])).map(r=>[r,e[r]]);return t.length?Object.fromEntries(t):void 0}function rc(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,Kn(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 sc(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 nc(){this._isStreamInput()&&(this.options.input.buffer=v.concat(this.options.input.buffer))}function ic(){return Array.isArray(this.options.input.buffer)}function oc(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 ac(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)})})}Yn.exports=e=>{Object.assign(e.prototype,{_inputOptionsFromObject:Kn,_createInputDescriptor:rc,_write:sc,_flattenBufferIn:nc,_isStreamInput:ic,metadata:oc,stats:ac}),e.align=ec}});var ni=q((Ad,si)=>{g();var D=Oe(),ei={center:0,centre:0,north:1,east:2,south:3,west:4,northeast:5,southeast:6,southwest:7,northwest:8},ti={top:1,right:2,bottom:3,left:4,"right top":5,"right bottom":6,"left bottom":7,"left top":8},Zn={background:"background",copy:"copy",repeat:"repeat",mirror:"mirror"},ri={entropy:16,attention:17},jr={nearest:"nearest",linear:"linear",cubic:"cubic",mitchell:"mitchell",lanczos2:"lanczos2",lanczos3:"lanczos3",mks2013:"mks2013",mks2021:"mks2021"},lc={contain:"contain",cover:"cover",fill:"fill",inside:"inside",outside:"outside"},cc={contain:"embed",cover:"crop",fill:"ignore_aspect",inside:"max",outside:"min"};function Lr(e){return e.angle%360!==0||e.rotationAngle!==0}function rr(e){return e.width!==-1||e.height!==-1}function uc(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=cc[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:ri[r.position]||ti[r.position]||ei[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(jr[r.kernel]))this.options.kernel=jr[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 Lr(this.options)&&rr(this.options)&&(this.options.rotateBefore=!0),this}function fc(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(Zn[e.extendWith]))this.options.extendWith=Zn[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 hc(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),Lr(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 dc(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 Lr(this.options)&&(this.options.rotateBefore=!0),this}si.exports=e=>{Object.assign(e.prototype,{resize:uc,extend:fc,extract:hc,trim:dc}),e.gravity=ei,e.strategy=ri,e.kernel=jr,e.fit=lc,e.position=ti}});var oi=q((Nd,ii)=>{g();var Q=Oe(),Mr={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 gc(e){if(!Array.isArray(e))throw Q.invalidParameterError("images to composite","array",e);return this.options.composite=e.map(t=>{if(!Q.object(t))throw Q.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(Q.defined(t.blend))if(Q.string(Mr[t.blend]))s.blend=Mr[t.blend];else throw Q.invalidParameterError("blend","valid blend name",t.blend);if(Q.defined(t.tile))if(Q.bool(t.tile))s.tile=t.tile;else throw Q.invalidParameterError("tile","boolean",t.tile);if(Q.defined(t.left))if(Q.integer(t.left))s.left=t.left;else throw Q.invalidParameterError("left","integer",t.left);if(Q.defined(t.top))if(Q.integer(t.top))s.top=t.top;else throw Q.invalidParameterError("top","integer",t.top);if(Q.defined(t.top)!==Q.defined(t.left))throw new Error("Expected both left and top to be set");if(s.hasOffset=Q.integer(t.top)&&Q.integer(t.left),Q.defined(t.gravity))if(Q.integer(t.gravity)&&Q.inRange(t.gravity,0,8))s.gravity=t.gravity;else if(Q.string(t.gravity)&&Q.integer(this.constructor.gravity[t.gravity]))s.gravity=this.constructor.gravity[t.gravity];else throw Q.invalidParameterError("gravity","valid gravity",t.gravity);if(Q.defined(t.premultiplied))if(Q.bool(t.premultiplied))s.premultiplied=t.premultiplied;else throw Q.invalidParameterError("premultiplied","boolean",t.premultiplied);return s}),this}ii.exports=e=>{e.prototype.composite=gc,e.blend=Mr}});var fi=q((Td,ui)=>{g();var d=Oe(),ai={integer:"integer",float:"float",approximate:"approximate"};function pc(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 mc(){return this.options.input.autoOrient=!0,this}function bc(e){return this.options.flip=d.bool(e)?e:!0,this}function vc(e){return this.options.flop=d.bool(e)?e:!0,this}function yc(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 wc(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 Ec(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 xc(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(ai[e.precision]))this.options.precision=ai[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 li(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",li);return this}function ci(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",ci);return this}function Pc(e){return this.options.flatten=d.bool(e)?e:!0,d.object(e)&&this._setBackgroundColourOption("flattenBackground",e.background),this}function Rc(){return this.options.unflatten=!0,this}function Sc(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 $c(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 kc(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 Ac(e){return this.normalise(e)}function _c(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 Nc(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 Ic(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 Tc(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 Dc(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 Cc(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 Fc(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}ui.exports=e=>{Object.assign(e.prototype,{autoOrient:mc,rotate:pc,flip:bc,flop:vc,affine:yc,sharpen:wc,erode:ci,dilate:li,median:Ec,blur:xc,flatten:Pc,unflatten:Rc,gamma:Sc,negate:$c,normalise:kc,normalize:Ac,clahe:_c,convolve:Nc,threshold:Ic,boolean:Tc,linear:Dc,recomb:Cc,modulate:Fc})}});var bi=q((Cd,mi)=>{g();var Gr=Object.defineProperty,Oc=Object.getOwnPropertyDescriptor,jc=Object.getOwnPropertyNames,Lc=Object.prototype.hasOwnProperty,Mc=(e,t)=>{for(var r in t)Gr(e,r,{get:t[r],enumerable:!0})},zc=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of jc(t))!Lc.call(e,n)&&n!==r&&Gr(e,n,{get:()=>t[n],enumerable:!(s=Oc(t,n))||s.enumerable});return e},Bc=e=>zc(Gr({},"__esModule",{value:!0}),e),hi={};Mc(hi,{default:()=>tu});mi.exports=Bc(hi);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]},di=Object.create(null);for(let e in Be)Object.hasOwn(Be,e)&&(di[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 di[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,gi={};for(let e of Object.keys(Be))gi[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 Uc(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}_.rgb.keyword=function(e){let t=gi[e];if(t)return t;let r=Number.POSITIVE_INFINITY,s;for(let n of Object.keys(Be)){let i=Be[n],o=Uc(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 Gc(){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 qc(e){let t=Gc(),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 Wc(e,t){return function(r){return t(e(r))}}function Hc(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=Wc(ht[t[n].parent][n],s),n=t[n].parent;return s.conversion=r,s}function Vc(e){let t=qc(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]=Hc(o,t))}return r}var Jc=Vc,xt={},Xc=Object.keys(ht);function Kc(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 Yc(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 Xc){xt[e]={},Object.defineProperty(xt[e],"channels",{value:ht[e].channels}),Object.defineProperty(xt[e],"labels",{value:ht[e].labels});let t=Jc(e),r=Object.keys(t);for(let s of r){let n=t[s];xt[e][s]=Yc(n),xt[e][s].raw=Kc(n)}}var Se=xt,pi=["keyword","gray","hex"],zr={};for(let e of Object.keys(Se))zr[[...Se[e].labels].sort().join("")]=e;var Br={};function he(e,t){if(!(this instanceof he))return new he(e,t);if(t&&t in pi&&(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=Ur(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 zr))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=zr[i];let{labels:o}=Se[this.model],a=[];for(r=0;r<o.length;r++)a.push(e[o[r]]);this.color=Ur(a)}if(Br[this.model])for(s=Se[this.model].channels,r=0;r<s;r++){let n=Br[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(Zc(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(pi.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([...eu(Se[this.model][e].raw(this.color)),this.valpha],e)},he[e]=function(...r){let s=r[0];return typeof s=="number"&&(s=Ur(r,t)),new he(s,e)}}function Qc(e,t){return Number(e.toFixed(t))}function Zc(e){return function(t){return Qc(t,e)}}function oe(e,t,r){e=Array.isArray(e)?e:[e];for(let s of e)(Br[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 eu(e){return Array.isArray(e)?e:[e]}function Ur(e,t){for(let r=0;r<t;r++)typeof e[r]!="number"&&(e[r]=0);return e}var tu=he});var yi=q((Od,vi)=>{g();vi.exports=bi().default});var Pi=q((Ld,xi)=>{g();var ru=yi(),Ve=Oe(),wi={multiband:"multiband","b-w":"b-w",bw:"b-w",cmyk:"cmyk",srgb:"srgb"};function su(e){return this._setBackgroundColourOption("tint",e),this}function nu(e){return this.options.greyscale=Ve.bool(e)?e:!0,this}function iu(e){return this.greyscale(e)}function ou(e){if(!Ve.string(e))throw Ve.invalidParameterError("colourspace","string",e);return this.options.colourspacePipeline=e,this}function au(e){return this.pipelineColourspace(e)}function lu(e){if(!Ve.string(e))throw Ve.invalidParameterError("colourspace","string",e);return this.options.colourspace=e,this}function cu(e){return this.toColourspace(e)}function Ei(e){if(Ve.object(e)||Ve.string(e)&&e.length>=3&&e.length<=200){let t=ru(e);return[t.red(),t.green(),t.blue(),Math.round(t.alpha()*255)]}else throw Ve.invalidParameterError("background","object or string",e)}function uu(e,t){Ve.defined(t)&&(this.options[e]=Ei(t))}xi.exports=e=>{Object.assign(e.prototype,{tint:su,greyscale:nu,grayscale:iu,pipelineColourspace:ou,pipelineColorspace:au,toColourspace:lu,toColorspace:cu,_getBackgroundColourOption:Ei,_setBackgroundColourOption:uu}),e.colourspace=wi,e.colorspace=wi}});var Si=q((zd,Ri)=>{g();var Ue=Oe(),fu={and:"and",or:"or",eor:"eor"};function hu(){return this.options.removeAlpha=!0,this}function du(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 gu(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 pu(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 mu(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}Ri.exports=e=>{Object.assign(e.prototype,{removeAlpha:hu,ensureAlpha:du,extractChannel:gu,joinChannel:pu,bandbool:mu}),e.bool=fu}});var Ni=q((Ud,_i)=>{g();var qr=ie("node:path"),l=Oe(),St=Ct(),$i=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"]]),bu=/\.(jp[2x]|j2[kc])$/i,ki=()=>new Error("JP2 output requires libvips with support for OpenJPEG"),Ai=e=>1<<31-Math.clz32(Math.ceil(Math.log2(e)));function vu(e,t){let r;if(l.string(e)?l.string(this.options.input.file)&&qr.resolve(this.options.input.file)===qr.resolve(e)?r=new Error("Cannot use same file for input and output"):bu.test(qr.extname(e))&&!this.constructor.format.jp2k.output.file&&(r=ki()):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 yu(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 wu(){return this.options.keepMetadata|=1,this}function Eu(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 xu(e){return this.withExif(e),this.options.withExifMerge=!0,this}function Pu(){return this.options.keepMetadata|=8,this}function Ru(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 Su(){return this.options.keepMetadata|=2,this}function $u(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 ku(){return this.options.keepMetadata=31,this}function Au(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 _u(e,t){let r=$i.get((l.object(e)&&l.string(e.id)?e.id:e).toLowerCase());if(!r)throw l.invalidParameterError("format",`one of: ${[...$i.keys()].join(", ")}`,e);return this[r](t)}function Nu(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 Iu(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=Ai(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 Tu(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 Wr(e,this.options),this._updateFormatOut("webp",e)}function Du(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=Ai(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 Wr(e,this.options),this._updateFormatOut("gif",e)}function Cu(e){if(!this.constructor.format.jp2k.output.buffer)throw ki();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 Wr(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 Fu(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 Ou(e){return this.heif({...e,compression:"av1"})}function ju(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 Lu(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 Wr(e,this.options),this._updateFormatOut("jxl",e)}function Mu(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 zu(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 Bu(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 Uu(e,t){return l.object(t)&&t.force===!1||(this.options.formatOut=e),this}function Gu(e,t){if(l.bool(t))this.options[e]=t;else throw l.invalidParameterError(e,"boolean",t)}function qu(){if(!this.options.streamOut){this.options.streamOut=!0;let e=Error();this._pipeline(void 0,e)}}function Wu(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)})})}_i.exports=e=>{Object.assign(e.prototype,{toFile:vu,toBuffer:yu,keepExif:wu,withExif:Eu,withExifMerge:xu,keepIccProfile:Pu,withIccProfile:Ru,keepXmp:Su,withXmp:$u,keepMetadata:ku,withMetadata:Au,toFormat:_u,jpeg:Nu,jp2:Cu,png:Iu,webp:Tu,tiff:Fu,avif:Ou,heif:ju,jxl:Lu,gif:Du,raw:Mu,tile:zu,timeout:Bu,_updateFormatOut:Uu,_setBooleanOption:Gu,_read:qu,_pipeline:Wu})}});var Ci=q((qd,Di)=>{g();var Hu=ie("node:events"),nr=Wt(),Ne=Oe(),{runtimePlatformArch:Vu}=Cr(),xe=Ct(),Ii=Vu(),Hr=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 Ju={nearest:"nearest",bilinear:"bilinear",bicubic:"bicubic",locallyBoundedBicubic:"lbb",nohalo:"nohalo",vertexSplitQuadraticBasisSpline:"vsqbs"},$t={vips:Hr.semver};if(!Hr.isGlobal)if(Hr.isWasm)try{$t=ie("@img/sharp-wasm32/versions")}catch{}else try{$t=ie(`@img/sharp-${Ii}/versions`)}catch{try{$t=ie(`@img/sharp-libvips-${Ii}/versions`)}catch{}}$t.sharp=Tr().version;$t.heif&&st.heif&&(st.heif.input.fileSuffix=[".avif"],st.heif.output.alias=["avif"]);function Ti(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()}Ti(!0);function Xu(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 Ku=new Hu.EventEmitter;function Yu(){return xe.counters()}function Qu(e){return xe.simd(Ne.bool(e)?e:null)}function Zu(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 ef(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)}Di.exports=e=>{e.cache=Ti,e.concurrency=Xu,e.counters=Yu,e.simd=Qu,e.format=st,e.interpolators=Ju,e.versions=$t,e.queue=Ku,e.block=Zu,e.unblock=ef}});var Oi=q((Vd,Fi)=>{g();var Je=Xn();Qn()(Je);ni()(Je);oi()(Je);fi()(Je);Pi()(Je);Si()(Je);Ni()(Je);Ci()(Je);Fi.exports=Je});g();g();g();import $o from"@rollup/plugin-strip";import{visualizer as ko}from"rollup-plugin-visualizer";g();var br=["/react/","/react-dom/","/scheduler/","/react-router","/@radix-ui/","/react-day-picker/","/react-hook-form/","/react-i18next/","/clsx/","/class-variance-authority/"],po={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 mo(e){let t=e.match(/(?:^|\0)virtual:([^?]+)/);if(t)return t[1]}function rs(e){let t=e.replace(/\\/g,"/");if(t.includes("/node_modules/"))return t.split("?")[0]}function ss(e,t=br){return t.some(r=>e.includes(r))}function bo(e){for(let[t,r]of Object.entries(po))if(r.some(s=>e.includes(s)))return t}function vo(e){let t=mo(e);if(t)return t==="i18n-mapping"?"virtual-i18n-mapping":"virtual-modules";let r=rs(e);if(!r)return;if(ss(r))return"react-core";let s=bo(r);if(s)return s}function yo(e=[]){let t=e.filter(s=>!br.includes(s)),r=[...br,...t];return function(s){let n=rs(s);if(n&&ss(n,r))return"react-core"}}var ts={development:{manualChunks:void 0},production:{manualChunks:vo}};function ns(e,t={}){let r=ts[e]||ts.production,s=t.reactCore||[];return s.length>0?{manualChunks:yo(s)}:r}g();import*as Re from"@clack/prompts";g();import{createRequire as wo}from"node:module";import{resolve as zt,join as qe,dirname as Qe,relative as is,normalize as Eo,sep as os,extname as xo}from"node:path";import{fileURLToPath as Po}from"node:url";import*as W from"node:fs";ge();import Ro from"fast-glob";var pt={getGlobOptionsFor:Mt||void 0,SCAN_PATTERNS:ke||void 0,getPatternsFor:es||void 0,I18N_PATHS:Lt||void 0},fe={error:(e,t)=>{},warn:(e,t)=>{},info:e=>{}};function as(e,t){return e().catch(r=>{throw new Error(`${t}: ${r instanceof Error?r.message:String(r)}`)})}var ls={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 Eo(t).split(os).join("/")}catch{return String(t).split(os).join("/")}}getRelativePath(t){let r=this.getAppRoot(),s=is(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=wo(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:xo(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 as(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 as(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=is(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 Ro(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(Po(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,ls.TOOLING)),o=this.normalizePath(qe(r,ls.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 So(){return p.env.NO_COLOR?!1:p.platform==="win32"?!0:p.stdout.isTTY===!0}function Ce(e,t){return So()?`${t}${e}${De.reset}`:e}function Z(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 cs(e={}){let{mode:t="development",chunkingOptions:r={},debug:s,verbose:n=!0,isDev:i,isDebug:o,shouldAnalyze:a,build:c={}}=e,u=Z("build",s,n),f=ns(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)
5
- `)),{outDir:"dist",sourcemap:i||o,cacheDir:"node_modules/.vite",target:"baseline-widely-available",minify:o?!1:"esbuild",reportCompressedSize:!1,chunkSizeWarningLimit:2048,assetsInlineLimit:0,esbuild:{format:"esm",drop:o?[]:["console","debugger"],legalComments:"none"},cssMinify:o?!1:"esbuild",cssCodeSplit:!0,rollupOptions:{external:Ao(),output:{format:"es",entryFileNames:"assets/[name].[hash].js",chunkFileNames:"assets/[name].[hash].js",assetFileNames:"assets/[name].[hash][extname]",...f.manualChunks&&{manualChunks:f.manualChunks},compact:!0},onwarn(m,T){m.code!=="MODULE_LEVEL_DIRECTIVE"&&T(m)},plugins:[...o?[]:[$o({include:["**/*.js","**/*.ts","**/*.tsx","**/*.jsx"],functions:["console.*","debugger"],labels:["debug"]})],...a?[(()=>{let m=ne.getInstance(),T=m.getAppRoot(),U="dist",V=m.resolveAppPath(`${U}/stats.html`),re=()=>{try{let G=m.resolveAppPath(U);m.pathExists(G)||m.mkdir(G)}catch{}},Y=ko({filename:V,open:!0,gzipSize:!0,brotliSize:!0,template:"treemap",sourcemap:i||o,projectRoot:T});if(Y.buildStart){let G=Y.buildStart.bind(Y);Y.buildStart=function(...X){re();let O=G.apply(this,X);return O&&typeof O.then=="function"?O.catch(F=>{}):O}}else Y.buildStart=function(){re()};let L=["generateBundle","writeBundle","closeBundle"];for(let G of L)if(Y[G]){let X=Y[G];Y[G]=function(...O){try{re();let F=X.apply(this,O);return F&&typeof F.then=="function"?F.catch(z=>{let se=z?.message||z?.toString()||String(z)||"Unknown error";u.warn(`Bundle visualizer warning in ${G}: ${se}`),G==="closeBundle"&&u.warn(`You can manually open ${V} to view the bundle analysis`)}):F}catch(F){let z=F?.message||F?.toString()||String(F)||"Unknown error";buildLogger.warn(`Bundle visualizer warning in ${G}: ${z}`),G==="closeBundle"&&buildLogger.warn(` You can manually open ${V} to view the bundle analysis`)}}}return Y})()]:[]]}}}function Ao(e){return e?["firebase-admin","gcp-metadata","google-logging-utils","@google-cloud/firestore",/\.node$/,"esbuild",/@esbuild\/.*/]:["gcp-metadata","google-logging-utils","payload","file-type","firebase-admin","firebase-admin/app","firebase-admin/auth","firebase-admin/firestore","firebase-admin/functions","firebase-admin/credential","@google-cloud/firestore","google-auth-library","google-gax","googleapis-common"]}function _o(){let e=!1,t=ne.getInstance();if((t.pathExists("/.dockerenv")||t.pathExists("/run/.containerenv"))&&(e=!0),!e&&(p.env.DOCKER_CONTAINER==="true"||p.env.IS_DOCKER==="true"||p.env.DOCKER_BUILDKIT==="1"||p.env.CI==="true"&&p.env.DOCKER==="true")&&(e=!0),!e&&p.env.DOCKER_HOST&&p.env.DOCKER_HOST.includes("docker")&&(e=!0),!e&&p.platform==="linux"&&t.pathExists("/proc/self/cgroup"))try{let s=t.readSync("/proc/self/cgroup");s&&(s.includes("docker")||s.includes("containerd"))&&(e=!0)}catch{}let r=!1;if((p.env.WSL_DISTRO_NAME||p.env.WSLENV)&&(r=!0),!r&&p.platform==="linux"&&t.pathExists("/proc/version"))try{let s=(t.readSync("/proc/version")||"").toLowerCase();r=s.includes("microsoft")||s.includes("wsl")}catch{}if(!r&&p.platform==="linux"&&t.pathExists("/proc/sys/kernel/osrelease"))try{let s=(t.readSync("/proc/sys/kernel/osrelease")||"").toLowerCase()||"";(s.includes("microsoft")||s.includes("wsl"))&&(r=!0)}catch{}if(!r&&p.platform==="win32"){let s=p.cwd();s&&(s.includes("\\wsl$")||s.includes("\\wsl.localhost"))&&(r=!0)}return{isDocker:e,isWSL2:r}}function No(e,t){if(e!==void 0)return e;let{isDocker:r,isWSL2:s}=_o();if(r||s){let n=r?"Docker":"WSL2";return t.info(`Detected ${n} environment - enabling polling mode for file watching`),!0}}function us(e,t={},r){let s=ne.getInstance(),n=s.getRepoRoot(),{watch:i,hmr:o,host:a,...c}=t||{},u=o||{},f=a===!0?"localhost":a||"localhost",b={...u.port&&{port:u.port},...u.clientPort&&{clientPort:u.clientPort},host:u.host??f,...u.protocol&&{protocol:u.protocol},overlay:u.overlay??!0,timeout:u.timeout??5e3},m=a!==void 0?a:!0,T=c.https===!0;return{port:e,host:m,open:t.open!==void 0?t.open:!0,https:T,fs:{allow:[n,s.resolveRepoPath("packages"),s.resolveRepoPath("node_modules")],strict:!1},watch:{usePolling:No(t?.watch?.usePolling,r),interval:t?.watch?.interval??2e3,...t?.watch||{}},hmr:{...b,...u},headers:{"Cross-Origin-Opener-Policy":"same-origin-allow-popups","Cross-Origin-Embedder-Policy":"unsafe-none"},middlewareMode:!1,...c}}function fs(e={}){let t=e.https===!0;return{...e,https:t}}g();ge();g();var Ae={CONCATENATE_DEDUPE:"CONCATENATE_DEDUPE",SHALLOW_MERGE:"SHALLOW_MERGE",DEEP_MERGE:"DEEP_MERGE",REPLACE:"REPLACE"};function Ze(e,t,r,s={}){let{protectedKeys:n=[],onConflict:i}=s;if(t==null)return e;switch(r){case Ae.CONCATENATE_DEDUPE:{if(!Array.isArray(e)||!Array.isArray(t))return t;let o=[...e,...t];return[...new Set(o)]}case Ae.SHALLOW_MERGE:return typeof e!="object"||typeof t!="object"||e===null||t===null||Array.isArray(e)||Array.isArray(t)?t:{...e,...t};case Ae.DEEP_MERGE:{if(typeof e!="object"||typeof t!="object"||e===null||t===null||Array.isArray(e)||Array.isArray(t))return t;let o={...e};for(let a in t){if(n.includes(a)){i&&i(a,e[a],t[a]);continue}typeof o[a]=="object"&&typeof t[a]=="object"&&o[a]!==null&&t[a]!==null&&!Array.isArray(o[a])&&!Array.isArray(t[a])?o[a]=Ze(o[a],t[a],Ae.DEEP_MERGE,{protectedKeys:n,onConflict:i}):o[a]=t[a]}return o}case Ae.REPLACE:default:return t}}function hs(e,t,r=[],s){let n=[...e,...t||[]],i=[...new Set(n)];return[...new Set([...i,...r])]}var Bt={base:"/",mode:p.env.NODE_ENV==="production"?"production":"development",debug:!1,verbose:p.env.CI!=="true",server:{port:3e3,strictPort:!0,host:!0,open:!0,cors:!0,https:!0,hmr:{overlay:!0,timeout:5e3,usePolling:void 0,interval:2e3},watch:{usePolling:void 0,interval:2e3}},build:{sourcemap:!0,target:"es2020",minify:"esbuild",cssMinify:"esbuild",analyze:!0},preview:{port:4173,strictPort:!0,host:!0,open:!1,cors:!0,https:!0},routes:{hmr:!0},themes:{},i18n:{},assets:{copyFonts:!0},features:{},pwa:{enabled:!1},seo:{disabled:!1,generateRobotsTxt:!0,generateSitemap:!0,crawlDelay:1},serverShim:{enabled:!0},chunking:{reactCore:[]},discovery:{verbose:!0,cacheTimeout:6e4,fileLogging:!1,logDir:".dndev-logs"},pluginFactory:{verbose:!0,disableHmr:!1,hmrSmartDetection:!0,hmrDebounceMs:500,hmrCacheTimeout:3e4},resolve:{alias:{"@":"/src"},preserveSymlinks:!1},define:{__DEV__:JSON.stringify(p.env.NODE_ENV==="development"),__PROD__:JSON.stringify(p.env.NODE_ENV==="production")},optimizeDeps:{include:[...at.mandatoryIncludes],exclude:[...at.buildTools,...Object.values(ee)],esbuildOptions:{format:"esm",target:"es2020",platform:"browser",define:{"process.env.NODE_ENV":JSON.stringify(p.env.NODE_ENV||"development")},external:["next","next/*"]}},plugins:[],css:{},envDir:void 0};function ds(e={},t={}){let{onConflict:r}=t,s={...Bt},n=[],i=(o,a,c,u)=>{n.push({key:o,frameworkValue:a,userValue:c,reason:u}),r&&r(o,a,c,u)};return Object.keys(e).forEach(o=>{let a=e[o],c=s[o];if(o==="optimizeDeps"&&typeof a=="object"&&a!==null){let u=c?.include||[],f=c?.exclude||[],b=a.include||[],m=a.exclude||[],T=u.filter(L=>!L.startsWith("@donotdev/")),U=m.filter(L=>T.includes(L));if(U.length>0)for(let L of U)i("optimizeDeps.exclude",L,"excluded",`Framework requires ${L} to be included. It will be included despite your exclusion.`);let V=hs(u,b,T),re=Ze(f,m,Ae.CONCATENATE_DEDUPE),Y=Ze(c?.esbuildOptions||{},a.esbuildOptions||{},Ae.DEEP_MERGE,{protectedKeys:["external"],onConflict:L=>i(`optimizeDeps.esbuildOptions.${L}`,c?.esbuildOptions?.[L],a.esbuildOptions?.[L],`Framework requires ${L} to remain as configured.`)});s[o]={...c,include:V,exclude:re,esbuildOptions:Y,...Object.fromEntries(Object.entries(a).filter(([L])=>!["include","exclude","esbuildOptions"].includes(L)))};return}if(o==="css"&&typeof a=="object"&&a!==null){s[o]=Ze(c||{},a,Ae.DEEP_MERGE,{protectedKeys:["postcss"],onConflict:()=>i("css.postcss","framework PostCSS config",a.postcss,"Framework PostCSS config is required and cannot be overridden. Your postcss config is ignored.")});return}if(o==="define"&&typeof a=="object"&&a!==null){s[o]=Ze(c||{},a,Ae.DEEP_MERGE,{protectedKeys:["__DEV__","__PROD__"],onConflict:u=>i(`define.${u}`,c?.[u],a[u],`Framework requires ${u} to remain as configured.`)});return}if(Array.isArray(a)){Array.isArray(c)?s[o]=Ze(c,a,Ae.CONCATENATE_DEDUPE):s[o]=a;return}if(typeof a=="object"&&a!==null&&typeof c=="object"&&c!==null&&!Array.isArray(c)){s[o]=Ze(c,a,Ae.SHALLOW_MERGE);return}s[o]=a}),s}function gs(e){let{server:t={},preview:r={},mode:s,build:n={},resolve:i={},routes:o={},themes:a={},i18n:c={},assets:u={},features:f={},seo:b={},pwa:m={},serverShim:T={},chunking:U={},discovery:V={},pluginFactory:re={},debug:Y,verbose:L,base:G,define:X={},optimizeDeps:O={},plugins:F=[],css:z={},envDir:se,...M}=e,j=s!=="production",pe=Y||j,me=s==="production"&&(n.analyze??Bt.build.analyze);return{mode:s,debug:Y,verbose:L,isDev:j,isDebug:pe,shouldAnalyze:me,serverOptions:t,previewOptions:r,buildOverrides:n,resolveOptions:i,routeOptions:o,themeOptions:a,i18nOptions:c,assetOptions:u,featureOptions:f,seoOptions:b,pwaOptions:m,serverShimOptions:T,chunkingOptions:U,discoveryOptions:V,pluginFactoryOptions:re,base:G,defineOptions:X,optimizeDepsOptions:O,pluginsOptions:F,cssOptions:z,envDir:se,restOptions:M}}g();g();function ps({postcssImport:e,postcssNesting:t,autoprefixer:r,resolve:s}){return{plugins:[s?e({resolve:s}):e,t,r({overrideBrowserslist:["> 1%","last 2 versions","Firefox ESR","not dead","not op_mini all"],grid:"autoplace"})]}}import Io from"postcss-import";import To from"postcss-nesting";import Do from"autoprefixer";import{resolve as Co}from"node:path";function ms(e={}){return e.postcss?e.postcss:async()=>{let t=ne.getInstance();return ps({postcssImport:Io,postcssNesting:To,autoprefixer:Do,resolve:(s,n)=>{let i=t.resolvePackage(s,n);if(i)return i;if(s.startsWith("@donotdev/")){let o=s.split("/")[0]+"/"+s.split("/")[1],a=s.split("/").slice(2).join("/"),c=t.resolveFrameworkPackage(o,n);if(c&&a){let u=t.resolvePath(a,c);if(t.pathExists(u))return u}}return Co(n,s)}})}}g();import gf from"@vitejs/plugin-basic-ssl";import pf from"@vitejs/plugin-react";import mf from"vite-tsconfig-paths";g();g();g();var ye=class{static generateVirtualModule(t,r,s=!1,n=void 0,i=void 0){return r.isEmpty(t)?r.generateEmpty(t,s,n,i):r.generateModule(t,s,i)}static generateInspection(t,r,s,n){return r.generateInspection.length>=3?r.generateInspection(t,s,n):r.generateInspection(t,s)}static wrapVirtualModule(t,r){return`// Virtual module: ${t}
5
+ `)),{outDir:"dist",sourcemap:i||o,cacheDir:"node_modules/.vite",target:"baseline-widely-available",minify:o?!1:"esbuild",reportCompressedSize:!1,chunkSizeWarningLimit:2048,assetsInlineLimit:0,esbuild:{format:"esm",drop:o?[]:["console","debugger"],legalComments:"none"},cssMinify:o?!1:"esbuild",cssCodeSplit:!0,rollupOptions:{external:Ao(),output:{format:"es",entryFileNames:"assets/[name].[hash].js",chunkFileNames:"assets/[name].[hash].js",assetFileNames:"assets/[name].[hash][extname]",...f.manualChunks&&{manualChunks:f.manualChunks},compact:!0},onwarn(m,T){m.code!=="MODULE_LEVEL_DIRECTIVE"&&T(m)},plugins:[...o?[]:[$o({include:["**/*.js","**/*.ts","**/*.tsx","**/*.jsx"],functions:["console.*","debugger"],labels:["debug"]})],...a?[(()=>{let m=ne.getInstance(),T=m.getAppRoot(),U="dist",V=m.resolveAppPath(`${U}/stats.html`),re=()=>{try{let G=m.resolveAppPath(U);m.pathExists(G)||m.mkdir(G)}catch{}},Y=ko({filename:V,open:!0,gzipSize:!0,brotliSize:!0,template:"treemap",sourcemap:i||o,projectRoot:T});if(Y.buildStart){let G=Y.buildStart.bind(Y);Y.buildStart=function(...X){re();let O=G.apply(this,X);return O&&typeof O.then=="function"?O.catch(F=>{}):O}}else Y.buildStart=function(){re()};let L=["generateBundle","writeBundle","closeBundle"];for(let G of L)if(Y[G]){let X=Y[G];Y[G]=function(...O){try{re();let F=X.apply(this,O);return F&&typeof F.then=="function"?F.catch(z=>{let se=z?.message||z?.toString()||String(z)||"Unknown error";u.warn(`Bundle visualizer warning in ${G}: ${se}`),G==="closeBundle"&&u.warn(`You can manually open ${V} to view the bundle analysis`)}):F}catch(F){let z=F?.message||F?.toString()||String(F)||"Unknown error";buildLogger.warn(`Bundle visualizer warning in ${G}: ${z}`),G==="closeBundle"&&buildLogger.warn(` You can manually open ${V} to view the bundle analysis`)}}}return Y})()]:[]]}}}function Ao(e){return e?["firebase-admin","gcp-metadata","google-logging-utils","@google-cloud/firestore",/\.node$/,"esbuild",/@esbuild\/.*/]:["gcp-metadata","google-logging-utils","payload","file-type","firebase-admin","firebase-admin/app","firebase-admin/auth","firebase-admin/firestore","firebase-admin/functions","firebase-admin/credential","@google-cloud/firestore","google-auth-library","google-gax","googleapis-common"]}function _o(){let e=!1,t=ne.getInstance();if((t.pathExists("/.dockerenv")||t.pathExists("/run/.containerenv"))&&(e=!0),!e&&(p.env.DOCKER_CONTAINER==="true"||p.env.IS_DOCKER==="true"||p.env.DOCKER_BUILDKIT==="1"||p.env.CI==="true"&&p.env.DOCKER==="true")&&(e=!0),!e&&p.env.DOCKER_HOST&&p.env.DOCKER_HOST.includes("docker")&&(e=!0),!e&&p.platform==="linux"&&t.pathExists("/proc/self/cgroup"))try{let s=t.readSync("/proc/self/cgroup");s&&(s.includes("docker")||s.includes("containerd"))&&(e=!0)}catch{}let r=!1;if((p.env.WSL_DISTRO_NAME||p.env.WSLENV)&&(r=!0),!r&&p.platform==="linux"&&t.pathExists("/proc/version"))try{let s=(t.readSync("/proc/version")||"").toLowerCase();r=s.includes("microsoft")||s.includes("wsl")}catch{}if(!r&&p.platform==="linux"&&t.pathExists("/proc/sys/kernel/osrelease"))try{let s=(t.readSync("/proc/sys/kernel/osrelease")||"").toLowerCase()||"";(s.includes("microsoft")||s.includes("wsl"))&&(r=!0)}catch{}if(!r&&p.platform==="win32"){let s=p.cwd();s&&(s.includes("\\wsl$")||s.includes("\\wsl.localhost"))&&(r=!0)}return{isDocker:e,isWSL2:r}}function No(e,t){if(e!==void 0)return e;let{isDocker:r,isWSL2:s}=_o();if(r||s){let n=r?"Docker":"WSL2";return t.info(`Detected ${n} environment - enabling polling mode for file watching`),!0}}function us(e,t={},r){let s=ne.getInstance(),n=s.getRepoRoot(),{watch:i,hmr:o,host:a,...c}=t||{},u=o||{},f=a===!0?"localhost":a||"localhost",b={...u.port&&{port:u.port},...u.clientPort&&{clientPort:u.clientPort},host:u.host??f,...u.protocol&&{protocol:u.protocol},overlay:u.overlay??!0,timeout:u.timeout??5e3},m=a!==void 0?a:!0,T=c.https===!0;return{port:e,host:m,open:t.open!==void 0?t.open:!0,https:T,fs:{allow:[n,s.resolveRepoPath("packages"),s.resolveRepoPath("node_modules")],strict:!1},watch:{usePolling:No(t?.watch?.usePolling,r),interval:t?.watch?.interval??2e3,...t?.watch||{}},hmr:{...b,...u},headers:{"Cross-Origin-Opener-Policy":"same-origin-allow-popups","Cross-Origin-Embedder-Policy":"unsafe-none"},middlewareMode:!1,...c}}function fs(e={}){let t=e.https===!0;return{...e,https:t}}g();ge();g();var Ae={CONCATENATE_DEDUPE:"CONCATENATE_DEDUPE",SHALLOW_MERGE:"SHALLOW_MERGE",DEEP_MERGE:"DEEP_MERGE",REPLACE:"REPLACE"};function Ze(e,t,r,s={}){let{protectedKeys:n=[],onConflict:i}=s;if(t==null)return e;switch(r){case Ae.CONCATENATE_DEDUPE:{if(!Array.isArray(e)||!Array.isArray(t))return t;let o=[...e,...t];return[...new Set(o)]}case Ae.SHALLOW_MERGE:return typeof e!="object"||typeof t!="object"||e===null||t===null||Array.isArray(e)||Array.isArray(t)?t:{...e,...t};case Ae.DEEP_MERGE:{if(typeof e!="object"||typeof t!="object"||e===null||t===null||Array.isArray(e)||Array.isArray(t))return t;let o={...e};for(let a in t){if(n.includes(a)){i&&i(a,e[a],t[a]);continue}typeof o[a]=="object"&&typeof t[a]=="object"&&o[a]!==null&&t[a]!==null&&!Array.isArray(o[a])&&!Array.isArray(t[a])?o[a]=Ze(o[a],t[a],Ae.DEEP_MERGE,{protectedKeys:n,onConflict:i}):o[a]=t[a]}return o}case Ae.REPLACE:default:return t}}function hs(e,t,r=[],s){let n=[...e,...t||[]],i=[...new Set(n)];return[...new Set([...i,...r])]}var Bt={base:"/",mode:p.env.NODE_ENV==="production"?"production":"development",debug:!1,verbose:p.env.CI!=="true",server:{port:3e3,strictPort:!0,host:!0,open:!0,cors:!0,https:!0,hmr:{overlay:!0,timeout:5e3,usePolling:void 0,interval:2e3},watch:{usePolling:void 0,interval:2e3}},build:{sourcemap:!0,target:"es2020",minify:"esbuild",cssMinify:"esbuild",analyze:!0},preview:{port:4173,strictPort:!0,host:!0,open:!1,cors:!0,https:!0},routes:{hmr:!0},themes:{},i18n:{},assets:{copyFonts:!0},features:{},pwa:{enabled:!1},seo:{disabled:!1,generateRobotsTxt:!0,generateSitemap:!0,crawlDelay:1},serverShim:{enabled:!0},chunking:{reactCore:[]},discovery:{verbose:!0,cacheTimeout:6e4,fileLogging:!1,logDir:".dndev-logs"},pluginFactory:{verbose:!0,disableHmr:!1,hmrSmartDetection:!0,hmrDebounceMs:500,hmrCacheTimeout:3e4},resolve:{alias:{"@":"/src"},preserveSymlinks:!1},define:{__DEV__:JSON.stringify(p.env.NODE_ENV==="development"),__PROD__:JSON.stringify(p.env.NODE_ENV==="production")},optimizeDeps:{include:[...at.mandatoryIncludes],exclude:[...at.buildTools,...Object.values(ee)],esbuildOptions:{format:"esm",target:"es2020",platform:"browser",define:{"process.env.NODE_ENV":JSON.stringify(p.env.NODE_ENV||"development")},external:["next","next/*"]}},plugins:[],css:{},envDir:void 0};function ds(e={},t={}){let{onConflict:r}=t,s={...Bt},n=[],i=(o,a,c,u)=>{n.push({key:o,frameworkValue:a,userValue:c,reason:u}),r&&r(o,a,c,u)};return Object.keys(e).forEach(o=>{let a=e[o],c=s[o];if(o==="optimizeDeps"&&typeof a=="object"&&a!==null){let u=c?.include||[],f=c?.exclude||[],b=a.include||[],m=a.exclude||[],T=u.filter(L=>!L.startsWith("@donotdev/")),U=m.filter(L=>T.includes(L));if(U.length>0)for(let L of U)i("optimizeDeps.exclude",L,"excluded",`Framework requires ${L} to be included. It will be included despite your exclusion.`);let V=hs(u,b,T),re=Ze(f,m,Ae.CONCATENATE_DEDUPE),Y=Ze(c?.esbuildOptions||{},a.esbuildOptions||{},Ae.DEEP_MERGE,{protectedKeys:["external"],onConflict:L=>i(`optimizeDeps.esbuildOptions.${L}`,c?.esbuildOptions?.[L],a.esbuildOptions?.[L],`Framework requires ${L} to remain as configured.`)});s[o]={...c,include:V,exclude:re,esbuildOptions:Y,...Object.fromEntries(Object.entries(a).filter(([L])=>!["include","exclude","esbuildOptions"].includes(L)))};return}if(o==="css"&&typeof a=="object"&&a!==null){s[o]=Ze(c||{},a,Ae.DEEP_MERGE,{protectedKeys:["postcss"],onConflict:()=>i("css.postcss","framework PostCSS config",a.postcss,"Framework PostCSS config is required and cannot be overridden. Your postcss config is ignored.")});return}if(o==="define"&&typeof a=="object"&&a!==null){s[o]=Ze(c||{},a,Ae.DEEP_MERGE,{protectedKeys:["__DEV__","__PROD__"],onConflict:u=>i(`define.${u}`,c?.[u],a[u],`Framework requires ${u} to remain as configured.`)});return}if(Array.isArray(a)){Array.isArray(c)?s[o]=Ze(c,a,Ae.CONCATENATE_DEDUPE):s[o]=a;return}if(typeof a=="object"&&a!==null&&typeof c=="object"&&c!==null&&!Array.isArray(c)){s[o]=Ze(c,a,Ae.SHALLOW_MERGE);return}s[o]=a}),s}function gs(e){let{server:t={},preview:r={},mode:s,build:n={},resolve:i={},routes:o={},themes:a={},i18n:c={},assets:u={},features:f={},seo:b={},pwa:m={},serverShim:T={},chunking:U={},discovery:V={},pluginFactory:re={},debug:Y,verbose:L,base:G,define:X={},optimizeDeps:O={},plugins:F=[],css:z={},envDir:se,...M}=e,j=s!=="production",pe=Y||j,me=s==="production"&&(n.analyze??Bt.build.analyze);return{mode:s,debug:Y,verbose:L,isDev:j,isDebug:pe,shouldAnalyze:me,serverOptions:t,previewOptions:r,buildOverrides:n,resolveOptions:i,routeOptions:o,themeOptions:a,i18nOptions:c,assetOptions:u,featureOptions:f,seoOptions:b,pwaOptions:m,serverShimOptions:T,chunkingOptions:U,discoveryOptions:V,pluginFactoryOptions:re,base:G,defineOptions:X,optimizeDepsOptions:O,pluginsOptions:F,cssOptions:z,envDir:se,restOptions:M}}g();import{resolve as Io}from"node:path";import To from"autoprefixer";import Do from"postcss-import";import Co from"postcss-nesting";g();function ps({postcssImport:e,postcssNesting:t,autoprefixer:r,resolve:s}){return{plugins:[s?e({resolve:s}):e,t,r({overrideBrowserslist:["> 1%","last 2 versions","Firefox ESR","not dead","not op_mini all"],grid:"autoplace"})]}}function ms(e={}){return e.postcss?e.postcss:async()=>{let t=ne.getInstance();return ps({postcssImport:Do,postcssNesting:Co,autoprefixer:To,resolve:(s,n)=>{let i=t.resolvePackage(s,n);if(i)return i;if(s.startsWith("@donotdev/")){let o=s.split("/")[0]+"/"+s.split("/")[1],a=s.split("/").slice(2).join("/"),c=t.resolveFrameworkPackage(o,n);if(c&&a){let u=t.resolvePath(a,c);if(t.pathExists(u))return u}}return Io(n,s)}})}}g();import gf from"@vitejs/plugin-basic-ssl";import pf from"@vitejs/plugin-react";import mf from"vite-tsconfig-paths";g();g();g();var ye=class{static generateVirtualModule(t,r,s=!1,n=void 0,i=void 0){return r.isEmpty(t)?r.generateEmpty(t,s,n,i):r.generateModule(t,s,i)}static generateInspection(t,r,s,n){return r.generateInspection.length>=3?r.generateInspection(t,s,n):r.generateInspection(t,s)}static wrapVirtualModule(t,r){return`// Virtual module: ${t}
6
6
  // Generated by @donotdev/config discovery
7
7
  // Version: 1.0.0
8
8