mdast-to-docx
Version:
Convert Markdown Abstract Syntax Tree (MDAST) to DOCX seamlessly. Supports footnotes, images, links, and customizable document properties.
2 lines • 136 kB
JavaScript
import{a as R,b as y,c as Xn,d as gr,f as ke,g as Qr}from"./chunk-KWOFOD3W.mjs";var J=y((vc,Kr)=>{"use strict";var Jr=function(e){return typeof e!="undefined"&&e!==null},Qn=function(e){return typeof e=="object"},Jn=function(e){return Object.prototype.toString.call(e)==="[object Object]"},Kn=function(e){return typeof e=="function"},Yn=function(e){return typeof e=="boolean"},Zn=function(e){return e instanceof Buffer},ea=function(e){if(Jr(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},ra=function(e){return e instanceof ArrayBuffer},ta=function(e){return typeof e=="string"&&e.length>0},ia=function(e){return typeof e=="number"&&!Number.isNaN(e)},na=function(e){return Number.isInteger(e)},aa=function(e,r,t){return e>=r&&e<=t},sa=function(e,r){return r.includes(e)},oa=function(e,r,t){return new Error(`Expected ${r} for ${e} but received ${t} of type ${typeof t}`)},la=function(e,r){return r.message=e.message,r};Kr.exports={defined:Jr,object:Qn,plainObject:Jn,fn:Kn,bool:Yn,buffer:Zn,typedArray:ea,arrayBuffer:ra,string:ta,number:ia,integer:na,inRange:aa,inArray:sa,invalidParameterError:oa,nativeError:la}});var et=y((xc,Zr)=>{"use strict";var Yr=()=>process.platform==="linux",_e=null,ca=()=>{if(!_e)if(Yr()&&process.report){let e=process.report.excludeNetwork;process.report.excludeNetwork=!0,_e=process.report.getReport(),process.report.excludeNetwork=e}else _e={};return _e};Zr.exports={isLinux:Yr,getReport:ca}});var it=y((Pc,tt)=>{"use strict";var rt=R("fs"),fa="/usr/bin/ldd",ha=e=>rt.readFileSync(e,"utf-8"),ua=e=>new Promise((r,t)=>{rt.readFile(e,"utf-8",(i,n)=>{i?t(i):r(n)})});tt.exports={LDD_PATH:fa,readFileSync:ha,readFile:ua}});var ze=y((Rc,Et)=>{"use strict";var at=R("child_process"),{isLinux:be,getReport:st}=et(),{LDD_PATH:Ue,readFile:ot,readFileSync:lt}=it(),K,Y,ct="getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",se="",ft=()=>se||new Promise(e=>{at.exec(ct,(r,t)=>{se=r?" ":t,e(se)})}),ht=()=>{if(!se)try{se=at.execSync(ct,{encoding:"utf8"})}catch{se=" "}return se},oe="glibc",ut=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,pe="musl",da=e=>e.includes("libc.musl-")||e.includes("ld-musl-"),dt=()=>{let e=st();return e.header&&e.header.glibcVersionRuntime?oe:Array.isArray(e.sharedObjects)&&e.sharedObjects.some(da)?pe:null},mt=e=>{let[r,t]=e.split(/[\r\n]+/);return r&&r.includes(oe)?oe:t&&t.includes(pe)?pe:null},gt=e=>e.includes("musl")?pe:e.includes("GNU C Library")?oe:null,ma=async()=>{if(K!==void 0)return K;K=null;try{let e=await ot(Ue);K=gt(e)}catch{}return K},ga=()=>{if(K!==void 0)return K;K=null;try{let e=lt(Ue);K=gt(e)}catch{}return K},pt=async()=>{let e=null;if(be()&&(e=await ma(),e||(e=dt()),!e)){let r=await ft();e=mt(r)}return e},bt=()=>{let e=null;if(be()&&(e=ga(),e||(e=dt()),!e)){let r=ht();e=mt(r)}return e},pa=async()=>be()&&await pt()!==oe,ba=()=>be()&&bt()!==oe,wa=async()=>{if(Y!==void 0)return Y;Y=null;try{let r=(await ot(Ue)).match(ut);r&&(Y=r[1])}catch{}return Y},ya=()=>{if(Y!==void 0)return Y;Y=null;try{let r=lt(Ue).match(ut);r&&(Y=r[1])}catch{}return Y},wt=()=>{let e=st();return e.header&&e.header.glibcVersionRuntime?e.header.glibcVersionRuntime:null},nt=e=>e.trim().split(/\s+/)[1],yt=e=>{let[r,t,i]=e.split(/[\r\n]+/);return r&&r.includes(oe)?nt(r):t&&i&&t.includes(pe)?nt(i):null},Ea=async()=>{let e=null;if(be()&&(e=await wa(),e||(e=wt()),!e)){let r=await ft();e=yt(r)}return e},va=()=>{let e=null;if(be()&&(e=ya(),e||(e=wt()),!e)){let r=ht();e=yt(r)}return e};Et.exports={GLIBC:oe,MUSL:pe,family:pt,familySync:bt,isNonGlibcLinux:pa,isNonGlibcLinuxSync:ba,version:Ea,versionSync:va}});var Te=y((Ic,vt)=>{"use strict";var xa=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};vt.exports=xa});var Ge=y((Ac,xt)=>{"use strict";var Pa="2.0.0",Ra=Number.MAX_SAFE_INTEGER||9007199254740991,Ia=16,Aa=250,Sa=["major","premajor","minor","preminor","patch","prepatch","prerelease"];xt.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:Ia,MAX_SAFE_BUILD_LENGTH:Aa,MAX_SAFE_INTEGER:Ra,RELEASE_TYPES:Sa,SEMVER_SPEC_VERSION:Pa,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var je=y((Z,Pt)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:pr,MAX_SAFE_BUILD_LENGTH:$a,MAX_LENGTH:La}=Ge(),ka=Te();Z=Pt.exports={};var Ta=Z.re=[],ja=Z.safeRe=[],d=Z.src=[],Na=Z.safeSrc=[],m=Z.t={},Fa=0,br="[a-zA-Z0-9-]",Ca=[["\\s",1],["\\d",La],[br,$a]],Ba=e=>{for(let[r,t]of Ca)e=e.split(`${r}*`).join(`${r}{0,${t}}`).split(`${r}+`).join(`${r}{1,${t}}`);return e},E=(e,r,t)=>{let i=Ba(r),n=Fa++;ka(e,n,r),m[e]=n,d[n]=r,Na[n]=i,Ta[n]=new RegExp(r,t?"g":void 0),ja[n]=new RegExp(i,t?"g":void 0)};E("NUMERICIDENTIFIER","0|[1-9]\\d*");E("NUMERICIDENTIFIERLOOSE","\\d+");E("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${br}*`);E("MAINVERSION",`(${d[m.NUMERICIDENTIFIER]})\\.(${d[m.NUMERICIDENTIFIER]})\\.(${d[m.NUMERICIDENTIFIER]})`);E("MAINVERSIONLOOSE",`(${d[m.NUMERICIDENTIFIERLOOSE]})\\.(${d[m.NUMERICIDENTIFIERLOOSE]})\\.(${d[m.NUMERICIDENTIFIERLOOSE]})`);E("PRERELEASEIDENTIFIER",`(?:${d[m.NUMERICIDENTIFIER]}|${d[m.NONNUMERICIDENTIFIER]})`);E("PRERELEASEIDENTIFIERLOOSE",`(?:${d[m.NUMERICIDENTIFIERLOOSE]}|${d[m.NONNUMERICIDENTIFIER]})`);E("PRERELEASE",`(?:-(${d[m.PRERELEASEIDENTIFIER]}(?:\\.${d[m.PRERELEASEIDENTIFIER]})*))`);E("PRERELEASELOOSE",`(?:-?(${d[m.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${d[m.PRERELEASEIDENTIFIERLOOSE]})*))`);E("BUILDIDENTIFIER",`${br}+`);E("BUILD",`(?:\\+(${d[m.BUILDIDENTIFIER]}(?:\\.${d[m.BUILDIDENTIFIER]})*))`);E("FULLPLAIN",`v?${d[m.MAINVERSION]}${d[m.PRERELEASE]}?${d[m.BUILD]}?`);E("FULL",`^${d[m.FULLPLAIN]}$`);E("LOOSEPLAIN",`[v=\\s]*${d[m.MAINVERSIONLOOSE]}${d[m.PRERELEASELOOSE]}?${d[m.BUILD]}?`);E("LOOSE",`^${d[m.LOOSEPLAIN]}$`);E("GTLT","((?:<|>)?=?)");E("XRANGEIDENTIFIERLOOSE",`${d[m.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);E("XRANGEIDENTIFIER",`${d[m.NUMERICIDENTIFIER]}|x|X|\\*`);E("XRANGEPLAIN",`[v=\\s]*(${d[m.XRANGEIDENTIFIER]})(?:\\.(${d[m.XRANGEIDENTIFIER]})(?:\\.(${d[m.XRANGEIDENTIFIER]})(?:${d[m.PRERELEASE]})?${d[m.BUILD]}?)?)?`);E("XRANGEPLAINLOOSE",`[v=\\s]*(${d[m.XRANGEIDENTIFIERLOOSE]})(?:\\.(${d[m.XRANGEIDENTIFIERLOOSE]})(?:\\.(${d[m.XRANGEIDENTIFIERLOOSE]})(?:${d[m.PRERELEASELOOSE]})?${d[m.BUILD]}?)?)?`);E("XRANGE",`^${d[m.GTLT]}\\s*${d[m.XRANGEPLAIN]}$`);E("XRANGELOOSE",`^${d[m.GTLT]}\\s*${d[m.XRANGEPLAINLOOSE]}$`);E("COERCEPLAIN",`(^|[^\\d])(\\d{1,${pr}})(?:\\.(\\d{1,${pr}}))?(?:\\.(\\d{1,${pr}}))?`);E("COERCE",`${d[m.COERCEPLAIN]}(?:$|[^\\d])`);E("COERCEFULL",d[m.COERCEPLAIN]+`(?:${d[m.PRERELEASE]})?(?:${d[m.BUILD]})?(?:$|[^\\d])`);E("COERCERTL",d[m.COERCE],!0);E("COERCERTLFULL",d[m.COERCEFULL],!0);E("LONETILDE","(?:~>?)");E("TILDETRIM",`(\\s*)${d[m.LONETILDE]}\\s+`,!0);Z.tildeTrimReplace="$1~";E("TILDE",`^${d[m.LONETILDE]}${d[m.XRANGEPLAIN]}$`);E("TILDELOOSE",`^${d[m.LONETILDE]}${d[m.XRANGEPLAINLOOSE]}$`);E("LONECARET","(?:\\^)");E("CARETTRIM",`(\\s*)${d[m.LONECARET]}\\s+`,!0);Z.caretTrimReplace="$1^";E("CARET",`^${d[m.LONECARET]}${d[m.XRANGEPLAIN]}$`);E("CARETLOOSE",`^${d[m.LONECARET]}${d[m.XRANGEPLAINLOOSE]}$`);E("COMPARATORLOOSE",`^${d[m.GTLT]}\\s*(${d[m.LOOSEPLAIN]})$|^$`);E("COMPARATOR",`^${d[m.GTLT]}\\s*(${d[m.FULLPLAIN]})$|^$`);E("COMPARATORTRIM",`(\\s*)${d[m.GTLT]}\\s*(${d[m.LOOSEPLAIN]}|${d[m.XRANGEPLAIN]})`,!0);Z.comparatorTrimReplace="$1$2$3";E("HYPHENRANGE",`^\\s*(${d[m.XRANGEPLAIN]})\\s+-\\s+(${d[m.XRANGEPLAIN]})\\s*$`);E("HYPHENRANGELOOSE",`^\\s*(${d[m.XRANGEPLAINLOOSE]})\\s+-\\s+(${d[m.XRANGEPLAINLOOSE]})\\s*$`);E("STAR","(<|>)?=?\\s*\\*");E("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");E("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var He=y((Sc,Rt)=>{"use strict";var Oa=Object.freeze({loose:!0}),qa=Object.freeze({}),Ma=e=>e?typeof e!="object"?Oa:e:qa;Rt.exports=Ma});var $t=y(($c,St)=>{"use strict";var It=/^[0-9]+$/,At=(e,r)=>{let t=It.test(e),i=It.test(r);return t&&i&&(e=+e,r=+r),e===r?0:t&&!i?-1:i&&!t?1:e<r?-1:1},Da=(e,r)=>At(r,e);St.exports={compareIdentifiers:At,rcompareIdentifiers:Da}});var ye=y((Lc,jt)=>{"use strict";var We=Te(),{MAX_LENGTH:Lt,MAX_SAFE_INTEGER:Ve}=Ge(),{safeRe:kt,safeSrc:Tt,t:Xe}=je(),_a=He(),{compareIdentifiers:we}=$t(),wr=class e{constructor(r,t){if(t=_a(t),r instanceof e){if(r.loose===!!t.loose&&r.includePrerelease===!!t.includePrerelease)return r;r=r.version}else if(typeof r!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof r}".`);if(r.length>Lt)throw new TypeError(`version is longer than ${Lt} characters`);We("SemVer",r,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let i=r.trim().match(t.loose?kt[Xe.LOOSE]:kt[Xe.FULL]);if(!i)throw new TypeError(`Invalid Version: ${r}`);if(this.raw=r,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>Ve||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Ve||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Ve||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map(n=>{if(/^[0-9]+$/.test(n)){let a=+n;if(a>=0&&a<Ve)return a}return n}):this.prerelease=[],this.build=i[5]?i[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(r){if(We("SemVer.compare",this.version,this.options,r),!(r instanceof e)){if(typeof r=="string"&&r===this.version)return 0;r=new e(r,this.options)}return r.version===this.version?0:this.compareMain(r)||this.comparePre(r)}compareMain(r){return r instanceof e||(r=new e(r,this.options)),we(this.major,r.major)||we(this.minor,r.minor)||we(this.patch,r.patch)}comparePre(r){if(r instanceof e||(r=new e(r,this.options)),this.prerelease.length&&!r.prerelease.length)return-1;if(!this.prerelease.length&&r.prerelease.length)return 1;if(!this.prerelease.length&&!r.prerelease.length)return 0;let t=0;do{let i=this.prerelease[t],n=r.prerelease[t];if(We("prerelease compare",t,i,n),i===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(i===void 0)return-1;if(i===n)continue;return we(i,n)}while(++t)}compareBuild(r){r instanceof e||(r=new e(r,this.options));let t=0;do{let i=this.build[t],n=r.build[t];if(We("build compare",t,i,n),i===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(i===void 0)return-1;if(i===n)continue;return we(i,n)}while(++t)}inc(r,t,i){if(r.startsWith("pre")){if(!t&&i===!1)throw new Error("invalid increment argument: identifier is empty");if(t){let n=new RegExp(`^${this.options.loose?Tt[Xe.PRERELEASELOOSE]:Tt[Xe.PRERELEASE]}$`),a=`-${t}`.match(n);if(!a||a[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(r){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,i);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,i);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,i),this.inc("pre",t,i);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t,i),this.inc("pre",t,i);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(i)?1:0;if(this.prerelease.length===0)this.prerelease=[n];else{let a=this.prerelease.length;for(;--a>=0;)typeof this.prerelease[a]=="number"&&(this.prerelease[a]++,a=-2);if(a===-1){if(t===this.prerelease.join(".")&&i===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(n)}}if(t){let a=[t,n];i===!1&&(a=[t]),we(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=a):this.prerelease=a}break}default:throw new Error(`invalid increment argument: ${r}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};jt.exports=wr});var Ct=y((kc,Ft)=>{"use strict";var Nt=ye(),Ua=(e,r,t=!1)=>{if(e instanceof Nt)return e;try{return new Nt(e,r)}catch(i){if(!t)return null;throw i}};Ft.exports=Ua});var Ot=y((Tc,Bt)=>{"use strict";var za=ye(),Ga=Ct(),{safeRe:Qe,t:Je}=je(),Ha=(e,r)=>{if(e instanceof za)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;r=r||{};let t=null;if(!r.rtl)t=e.match(r.includePrerelease?Qe[Je.COERCEFULL]:Qe[Je.COERCE]);else{let h=r.includePrerelease?Qe[Je.COERCERTLFULL]:Qe[Je.COERCERTL],u;for(;(u=h.exec(e))&&(!t||t.index+t[0].length!==e.length);)(!t||u.index+u[0].length!==t.index+t[0].length)&&(t=u),h.lastIndex=u.index+u[1].length+u[2].length;h.lastIndex=-1}if(t===null)return null;let i=t[2],n=t[3]||"0",a=t[4]||"0",o=r.includePrerelease&&t[5]?`-${t[5]}`:"",l=r.includePrerelease&&t[6]?`+${t[6]}`:"";return Ga(`${i}.${n}.${a}${o}${l}`,r)};Bt.exports=Ha});var ue=y((jc,Mt)=>{"use strict";var qt=ye(),Wa=(e,r,t)=>new qt(e,t).compare(new qt(r,t));Mt.exports=Wa});var yr=y((Nc,Dt)=>{"use strict";var Va=ue(),Xa=(e,r,t)=>Va(e,r,t)>=0;Dt.exports=Xa});var Ut=y((Fc,_t)=>{"use strict";var Er=class{constructor(){this.max=1e3,this.map=new Map}get(r){let t=this.map.get(r);if(t!==void 0)return this.map.delete(r),this.map.set(r,t),t}delete(r){return this.map.delete(r)}set(r,t){if(!this.delete(r)&&t!==void 0){if(this.map.size>=this.max){let n=this.map.keys().next().value;this.delete(n)}this.map.set(r,t)}return this}};_t.exports=Er});var Gt=y((Cc,zt)=>{"use strict";var Qa=ue(),Ja=(e,r,t)=>Qa(e,r,t)===0;zt.exports=Ja});var Wt=y((Bc,Ht)=>{"use strict";var Ka=ue(),Ya=(e,r,t)=>Ka(e,r,t)!==0;Ht.exports=Ya});var Xt=y((Oc,Vt)=>{"use strict";var Za=ue(),es=(e,r,t)=>Za(e,r,t)>0;Vt.exports=es});var Jt=y((qc,Qt)=>{"use strict";var rs=ue(),ts=(e,r,t)=>rs(e,r,t)<0;Qt.exports=ts});var Yt=y((Mc,Kt)=>{"use strict";var is=ue(),ns=(e,r,t)=>is(e,r,t)<=0;Kt.exports=ns});var ei=y((Dc,Zt)=>{"use strict";var as=Gt(),ss=Wt(),os=Xt(),ls=yr(),cs=Jt(),fs=Yt(),hs=(e,r,t,i)=>{switch(r){case"===":return typeof e=="object"&&(e=e.version),typeof t=="object"&&(t=t.version),e===t;case"!==":return typeof e=="object"&&(e=e.version),typeof t=="object"&&(t=t.version),e!==t;case"":case"=":case"==":return as(e,t,i);case"!=":return ss(e,t,i);case">":return os(e,t,i);case">=":return ls(e,t,i);case"<":return cs(e,t,i);case"<=":return fs(e,t,i);default:throw new TypeError(`Invalid operator: ${r}`)}};Zt.exports=hs});var oi=y((_c,si)=>{"use strict";var Ne=Symbol("SemVer ANY"),Pr=class e{static get ANY(){return Ne}constructor(r,t){if(t=ri(t),r instanceof e){if(r.loose===!!t.loose)return r;r=r.value}r=r.trim().split(/\s+/).join(" "),xr("comparator",r,t),this.options=t,this.loose=!!t.loose,this.parse(r),this.semver===Ne?this.value="":this.value=this.operator+this.semver.version,xr("comp",this)}parse(r){let t=this.options.loose?ti[ii.COMPARATORLOOSE]:ti[ii.COMPARATOR],i=r.match(t);if(!i)throw new TypeError(`Invalid comparator: ${r}`);this.operator=i[1]!==void 0?i[1]:"",this.operator==="="&&(this.operator=""),i[2]?this.semver=new ni(i[2],this.options.loose):this.semver=Ne}toString(){return this.value}test(r){if(xr("Comparator.test",r,this.options.loose),this.semver===Ne||r===Ne)return!0;if(typeof r=="string")try{r=new ni(r,this.options)}catch{return!1}return vr(r,this.operator,this.semver,this.options)}intersects(r,t){if(!(r instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new ai(r.value,t).test(this.value):r.operator===""?r.value===""?!0:new ai(this.value,t).test(r.semver):(t=ri(t),t.includePrerelease&&(this.value==="<0.0.0-0"||r.value==="<0.0.0-0")||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||r.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&r.operator.startsWith(">")||this.operator.startsWith("<")&&r.operator.startsWith("<")||this.semver.version===r.semver.version&&this.operator.includes("=")&&r.operator.includes("=")||vr(this.semver,"<",r.semver,t)&&this.operator.startsWith(">")&&r.operator.startsWith("<")||vr(this.semver,">",r.semver,t)&&this.operator.startsWith("<")&&r.operator.startsWith(">")))}};si.exports=Pr;var ri=He(),{safeRe:ti,t:ii}=je(),vr=ei(),xr=Te(),ni=ye(),ai=Rr()});var Rr=y((Uc,hi)=>{"use strict";var us=/\s+/g,Ir=class e{constructor(r,t){if(t=ms(t),r instanceof e)return r.loose===!!t.loose&&r.includePrerelease===!!t.includePrerelease?r:new e(r.raw,t);if(r instanceof Ar)return this.raw=r.value,this.set=[[r]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=r.trim().replace(us," "),this.set=this.raw.split("||").map(i=>this.parseRange(i.trim())).filter(i=>i.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let i=this.set[0];if(this.set=this.set.filter(n=>!ci(n[0])),this.set.length===0)this.set=[i];else if(this.set.length>1){for(let n of this.set)if(n.length===1&&vs(n[0])){this.set=[n];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let r=0;r<this.set.length;r++){r>0&&(this.formatted+="||");let t=this.set[r];for(let i=0;i<t.length;i++)i>0&&(this.formatted+=" "),this.formatted+=t[i].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(r){let i=((this.options.includePrerelease&&ys)|(this.options.loose&&Es))+":"+r,n=li.get(i);if(n)return n;let a=this.options.loose,o=a?B[N.HYPHENRANGELOOSE]:B[N.HYPHENRANGE];r=r.replace(o,Ts(this.options.includePrerelease)),P("hyphen replace",r),r=r.replace(B[N.COMPARATORTRIM],ps),P("comparator trim",r),r=r.replace(B[N.TILDETRIM],bs),P("tilde trim",r),r=r.replace(B[N.CARETTRIM],ws),P("caret trim",r);let l=r.split(" ").map(w=>xs(w,this.options)).join(" ").split(/\s+/).map(w=>ks(w,this.options));a&&(l=l.filter(w=>(P("loose invalid filter",w,this.options),!!w.match(B[N.COMPARATORLOOSE])))),P("range list",l);let h=new Map,u=l.map(w=>new Ar(w,this.options));for(let w of u){if(ci(w))return[w];h.set(w.value,w)}h.size>1&&h.has("")&&h.delete("");let b=[...h.values()];return li.set(i,b),b}intersects(r,t){if(!(r instanceof e))throw new TypeError("a Range is required");return this.set.some(i=>fi(i,t)&&r.set.some(n=>fi(n,t)&&i.every(a=>n.every(o=>a.intersects(o,t)))))}test(r){if(!r)return!1;if(typeof r=="string")try{r=new gs(r,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(js(this.set[t],r,this.options))return!0;return!1}};hi.exports=Ir;var ds=Ut(),li=new ds,ms=He(),Ar=oi(),P=Te(),gs=ye(),{safeRe:B,t:N,comparatorTrimReplace:ps,tildeTrimReplace:bs,caretTrimReplace:ws}=je(),{FLAG_INCLUDE_PRERELEASE:ys,FLAG_LOOSE:Es}=Ge(),ci=e=>e.value==="<0.0.0-0",vs=e=>e.value==="",fi=(e,r)=>{let t=!0,i=e.slice(),n=i.pop();for(;t&&i.length;)t=i.every(a=>n.intersects(a,r)),n=i.pop();return t},xs=(e,r)=>(P("comp",e,r),e=Is(e,r),P("caret",e),e=Ps(e,r),P("tildes",e),e=Ss(e,r),P("xrange",e),e=Ls(e,r),P("stars",e),e),F=e=>!e||e.toLowerCase()==="x"||e==="*",Ps=(e,r)=>e.trim().split(/\s+/).map(t=>Rs(t,r)).join(" "),Rs=(e,r)=>{let t=r.loose?B[N.TILDELOOSE]:B[N.TILDE];return e.replace(t,(i,n,a,o,l)=>{P("tilde",e,i,n,a,o,l);let h;return F(n)?h="":F(a)?h=`>=${n}.0.0 <${+n+1}.0.0-0`:F(o)?h=`>=${n}.${a}.0 <${n}.${+a+1}.0-0`:l?(P("replaceTilde pr",l),h=`>=${n}.${a}.${o}-${l} <${n}.${+a+1}.0-0`):h=`>=${n}.${a}.${o} <${n}.${+a+1}.0-0`,P("tilde return",h),h})},Is=(e,r)=>e.trim().split(/\s+/).map(t=>As(t,r)).join(" "),As=(e,r)=>{P("caret",e,r);let t=r.loose?B[N.CARETLOOSE]:B[N.CARET],i=r.includePrerelease?"-0":"";return e.replace(t,(n,a,o,l,h)=>{P("caret",e,n,a,o,l,h);let u;return F(a)?u="":F(o)?u=`>=${a}.0.0${i} <${+a+1}.0.0-0`:F(l)?a==="0"?u=`>=${a}.${o}.0${i} <${a}.${+o+1}.0-0`:u=`>=${a}.${o}.0${i} <${+a+1}.0.0-0`:h?(P("replaceCaret pr",h),a==="0"?o==="0"?u=`>=${a}.${o}.${l}-${h} <${a}.${o}.${+l+1}-0`:u=`>=${a}.${o}.${l}-${h} <${a}.${+o+1}.0-0`:u=`>=${a}.${o}.${l}-${h} <${+a+1}.0.0-0`):(P("no pr"),a==="0"?o==="0"?u=`>=${a}.${o}.${l}${i} <${a}.${o}.${+l+1}-0`:u=`>=${a}.${o}.${l}${i} <${a}.${+o+1}.0-0`:u=`>=${a}.${o}.${l} <${+a+1}.0.0-0`),P("caret return",u),u})},Ss=(e,r)=>(P("replaceXRanges",e,r),e.split(/\s+/).map(t=>$s(t,r)).join(" ")),$s=(e,r)=>{e=e.trim();let t=r.loose?B[N.XRANGELOOSE]:B[N.XRANGE];return e.replace(t,(i,n,a,o,l,h)=>{P("xRange",e,i,n,a,o,l,h);let u=F(a),b=u||F(o),w=b||F(l),A=w;return n==="="&&A&&(n=""),h=r.includePrerelease?"-0":"",u?n===">"||n==="<"?i="<0.0.0-0":i="*":n&&A?(b&&(o=0),l=0,n===">"?(n=">=",b?(a=+a+1,o=0,l=0):(o=+o+1,l=0)):n==="<="&&(n="<",b?a=+a+1:o=+o+1),n==="<"&&(h="-0"),i=`${n+a}.${o}.${l}${h}`):b?i=`>=${a}.0.0${h} <${+a+1}.0.0-0`:w&&(i=`>=${a}.${o}.0${h} <${a}.${+o+1}.0-0`),P("xRange return",i),i})},Ls=(e,r)=>(P("replaceStars",e,r),e.trim().replace(B[N.STAR],"")),ks=(e,r)=>(P("replaceGTE0",e,r),e.trim().replace(B[r.includePrerelease?N.GTE0PRE:N.GTE0],"")),Ts=e=>(r,t,i,n,a,o,l,h,u,b,w,A)=>(F(i)?t="":F(n)?t=`>=${i}.0.0${e?"-0":""}`:F(a)?t=`>=${i}.${n}.0${e?"-0":""}`:o?t=`>=${t}`:t=`>=${t}${e?"-0":""}`,F(u)?h="":F(b)?h=`<${+u+1}.0.0-0`:F(w)?h=`<${u}.${+b+1}.0-0`:A?h=`<=${u}.${b}.${w}-${A}`:e?h=`<${u}.${b}.${+w+1}-0`:h=`<=${h}`,`${t} ${h}`.trim()),js=(e,r,t)=>{for(let i=0;i<e.length;i++)if(!e[i].test(r))return!1;if(r.prerelease.length&&!t.includePrerelease){for(let i=0;i<e.length;i++)if(P(e[i].semver),e[i].semver!==Ar.ANY&&e[i].semver.prerelease.length>0){let n=e[i].semver;if(n.major===r.major&&n.minor===r.minor&&n.patch===r.patch)return!0}return!1}return!0}});var di=y((zc,ui)=>{"use strict";var Ns=Rr(),Fs=(e,r,t)=>{try{r=new Ns(r,t)}catch{return!1}return r.test(e)};ui.exports=Fs});var Sr=y((Gc,Cs)=>{Cs.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.1",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:{install:"node install/check",clean:"rm -rf src/build/ .nyc_output/ coverage/ test/fixtures/output.*",test:"npm run test-lint && npm run test-unit && npm run test-licensing && npm run test-types","test-lint":"semistandard && cpplint","test-unit":"nyc --reporter=lcov --reporter=text --check-coverage --branches=100 mocha","test-licensing":'license-checker --production --summary --onlyAllow="Apache-2.0;BSD;ISC;LGPL-3.0-or-later;MIT"',"test-leak":"./test/leak/leak.sh","test-types":"tsd","package-from-local-build":"node npm/from-local-build","package-from-github-release":"node npm/from-github-release","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:{color:"^4.2.3","detect-libc":"^2.0.3",semver:"^7.7.1"},optionalDependencies:{"@img/sharp-darwin-arm64":"0.34.1","@img/sharp-darwin-x64":"0.34.1","@img/sharp-libvips-darwin-arm64":"1.1.0","@img/sharp-libvips-darwin-x64":"1.1.0","@img/sharp-libvips-linux-arm":"1.1.0","@img/sharp-libvips-linux-arm64":"1.1.0","@img/sharp-libvips-linux-ppc64":"1.1.0","@img/sharp-libvips-linux-s390x":"1.1.0","@img/sharp-libvips-linux-x64":"1.1.0","@img/sharp-libvips-linuxmusl-arm64":"1.1.0","@img/sharp-libvips-linuxmusl-x64":"1.1.0","@img/sharp-linux-arm":"0.34.1","@img/sharp-linux-arm64":"0.34.1","@img/sharp-linux-s390x":"0.34.1","@img/sharp-linux-x64":"0.34.1","@img/sharp-linuxmusl-arm64":"0.34.1","@img/sharp-linuxmusl-x64":"0.34.1","@img/sharp-wasm32":"0.34.1","@img/sharp-win32-ia32":"0.34.1","@img/sharp-win32-x64":"0.34.1"},devDependencies:{"@emnapi/runtime":"^1.4.0","@img/sharp-libvips-dev":"1.1.0","@img/sharp-libvips-dev-wasm32":"1.1.0","@img/sharp-libvips-win32-ia32":"1.1.0","@img/sharp-libvips-win32-x64":"1.1.0","@types/node":"*",cc:"^3.0.1",emnapi:"^1.4.0","exif-reader":"^2.0.2","extract-zip":"^2.0.1",icc:"^3.0.0","jsdoc-to-markdown":"^9.1.1","license-checker":"^25.0.1",mocha:"^11.1.0","node-addon-api":"^8.3.1",nyc:"^17.1.0",prebuild:"^13.0.1",semistandard:"^17.0.0","tar-fs":"^3.0.8",tsd:"^0.31.2"},license:"Apache-2.0",engines:{node:"^18.17.0 || ^20.3.0 || >=21.0.0"},config:{libvips:">=8.16.1"},funding:{url:"https://opencollective.com/libvips"},binary:{napi_versions:[9]},semistandard:{env:["mocha"]},cc:{linelength:"120",filter:["build/include"]},nyc:{include:["lib"]},tsd:{directory:"test/types/"}}});var Lr=y((Hc,Pi)=>{"use strict";var{spawnSync:Ke}=R("node:child_process"),{createHash:Bs}=R("node:crypto"),bi=Ot(),Os=yr(),qs=di(),mi=ze(),{config:Ms,engines:gi,optionalDependencies:Ds}=Sr(),_s=process.env.npm_package_config_libvips||Ms.libvips,wi=bi(_s).version,Us=["darwin-arm64","darwin-x64","linux-arm","linux-arm64","linux-s390x","linux-x64","linuxmusl-arm64","linuxmusl-x64","win32-ia32","win32-x64"],Ye={encoding:"utf8",shell:!0},zs=e=>{e instanceof Error?console.error(`sharp: Installation error: ${e.message}`):console.log(`sharp: ${e}`)},yi=()=>mi.isNonGlibcLinuxSync()?mi.familySync():"",Gs=()=>`${process.platform}${yi()}-${process.arch}`,Ee=()=>{if(Ei())return"wasm32";let{npm_config_arch:e,npm_config_platform:r,npm_config_libc:t}=process.env,i=typeof t=="string"?t:yi();return`${r||process.platform}${i}-${e||process.arch}`},Hs=()=>{try{return R(`@img/sharp-libvips-dev-${Ee()}/include`)}catch{try{return R("@img/sharp-libvips-dev/include")}catch{}}return""},Ws=()=>{try{return R("@img/sharp-libvips-dev/cplusplus")}catch{}return""},Vs=()=>{try{return R(`@img/sharp-libvips-dev-${Ee()}/lib`)}catch{try{return R(`@img/sharp-libvips-${Ee()}/lib`)}catch{}}return""},Xs=()=>{var e;if(((e=process.release)==null?void 0:e.name)==="node"&&process.versions&&!qs(process.versions.node,gi.node))return{found:process.versions.node,expected:gi.node}},Ei=()=>{let{CC:e}=process.env;return!!(e&&e.endsWith("/emcc"))},Qs=()=>process.platform==="darwin"&&process.arch==="x64"?(Ke("sysctl sysctl.proc_translated",Ye).stdout||"").trim()==="sysctl.proc_translated: 1":!1,pi=e=>Bs("sha512").update(e).digest("hex"),Js=()=>{try{let e=pi(`imgsharp-libvips-${Ee()}`),r=bi(Ds[`@img/sharp-libvips-${Ee()}`],{includePrerelease:!0}).version;return pi(`${e}npm:${r}`).slice(0,10)}catch{}return""},Ks=()=>Ke(`node-gyp rebuild --directory=src ${Ei()?"--nodedir=emscripten":""}`,{...Ye,stdio:"inherit"}).status,vi=()=>process.platform!=="win32"?(Ke("pkg-config --modversion vips-cpp",{...Ye,env:{...process.env,PKG_CONFIG_PATH:xi()}}).stdout||"").trim():"",xi=()=>process.platform!=="win32"?[(Ke('which brew >/dev/null 2>&1 && brew environment --plain | grep PKG_CONFIG_LIBDIR | cut -d" " -f2',Ye).stdout||"").trim(),process.env.PKG_CONFIG_PATH,"/usr/local/lib/pkgconfig","/usr/lib/pkgconfig","/usr/local/libdata/pkgconfig","/usr/libdata/pkgconfig"].filter(Boolean).join(":"):"",$r=(e,r,t)=>(t&&t(`Detected ${r}, skipping search for globally-installed libvips`),e),Ys=e=>{if(process.env.SHARP_IGNORE_GLOBAL_LIBVIPS)return $r(!1,"SHARP_IGNORE_GLOBAL_LIBVIPS",e);if(process.env.SHARP_FORCE_GLOBAL_LIBVIPS)return $r(!0,"SHARP_FORCE_GLOBAL_LIBVIPS",e);if(Qs())return $r(!1,"Rosetta",e);let r=vi();return!!r&&Os(r,wi)};Pi.exports={minimumLibvipsVersion:wi,prebuiltPlatforms:Us,buildPlatformArch:Ee,buildSharpLibvipsIncludeDir:Hs,buildSharpLibvipsCPlusPlusDir:Ws,buildSharpLibvipsLibDir:Vs,isUnsupportedNodeRuntime:Xs,runtimePlatformArch:Gs,log:zs,yarnLocator:Js,spawnRebuild:Ks,globalLibvipsVersion:vi,pkgConfigPath:xi,useGlobalLibvips:Ys}});var Ce=y((Vc,Ii)=>{"use strict";var{familySync:Zs,versionSync:eo}=ze(),{runtimePlatformArch:ro,isUnsupportedNodeRuntime:Ri,prebuiltPlatforms:to,minimumLibvipsVersion:io}=Lr(),de=ro(),no=[`../src/build/Release/sharp-${de}.node`,"../src/build/Release/sharp-wasm32.node",`@img/sharp-${de}/sharp.node`,"@img/sharp-wasm32/sharp.node"],kr,ve,Fe=[];for(kr of no)try{ve=R(kr);break}catch(e){Fe.push(e)}if(ve&&kr.startsWith("@img/sharp-linux-x64")&&!ve._isUsingX64V2()){let e=new Error("Prebuilt binaries for linux-x64 require v2 microarchitecture");e.code="Unsupported CPU",Fe.push(e),ve=null}if(ve)Ii.exports=ve;else{let[e,r,t]=["linux","darwin","win32"].map(a=>de.startsWith(a)),i=[`Could not load the "sharp" module using the ${de} runtime`];Fe.forEach(a=>{a.code!=="MODULE_NOT_FOUND"&&i.push(`${a.code}: ${a.message}`)});let n=Fe.map(a=>a.message).join(" ");if(i.push("Possible solutions:"),Ri()){let{found:a,expected:o}=Ri();i.push("- Please upgrade Node.js:",` Found ${a}`,` Requires ${o}`)}else if(to.includes(de)){let[a,o]=de.split("-"),l=a.endsWith("musl")?" --libc=musl":"";i.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=${a.replace("musl","")}${l} --cpu=${o} sharp`)}else i.push(`- Manually install libvips >= ${io}`,"- 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:a}=R(`@img/sharp-libvips-${de}/package`),o=`${Zs()} ${eo()}`,l=`${a.musl?"musl":"glibc"} ${a.musl||a.glibc}`;i.push("- Update your OS:",` Found ${o}`,` Requires ${l}`)}catch{}throw e&&/\/snap\/core[0-9]{2}/.test(n)&&i.push("- Remove the Node.js Snap, which does not support native modules"," snap remove node"),r&&/Incompatible library version/.test(n)&&i.push("- Update Homebrew:"," brew update && brew upgrade vips"),Fe.some(a=>a.code==="ERR_DLOPEN_DISABLED")&&i.push("- Run Node.js without using the --no-addons flag"),t&&/The specified procedure could not be found/.test(n)&&i.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"),i.push("- Consult the installation documentation:"," See https://sharp.pixelplumbing.com/install"),new Error(i.join(`
`))}});var Si=y((Qc,Ai)=>{"use strict";var ao=R("node:util"),Tr=R("node:stream"),so=J();Ce();var oo=ao.debuglog("sharp"),me=function(e,r){if(arguments.length===1&&!so.defined(e))throw new Error("Invalid input");return this instanceof me?(Tr.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],rotateBeforePreExtract:!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,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,gifReuse:!0,gifProgressive:!1,tiffQuality:80,tiffCompression:"jpeg",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:t=>{this.emit("warning",t),oo(t)},queueListener:function(t){me.queue.emit("change",t)}},this.options.input=this._createInputDescriptor(e,r,{allowStream:!0}),this):new me(e,r)};Object.setPrototypeOf(me.prototype,Tr.Duplex.prototype);Object.setPrototypeOf(me,Tr.Duplex);function lo(){let e=this.constructor.call(),{debuglog:r,queueListener:t,...i}=this.options;return e.options=structuredClone(i),e.options.debuglog=r,e.options.queueListener=t,this._isStreamInput()&&this.on("finish",()=>{this._flattenBufferIn(),e.options.input.buffer=this.options.input.buffer,e.emit("finish")}),e}Object.assign(me.prototype,{clone:lo});Ai.exports=me});var jr=y((Jc,$i)=>{"use strict";$i.exports={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]}});var ki=y((Kc,Li)=>{"use strict";Li.exports=function(r){return!r||typeof r=="string"?!1:r instanceof Array||Array.isArray(r)||r.length>=0&&(r.splice instanceof Function||Object.getOwnPropertyDescriptor(r,r.length-1)&&r.constructor.name!=="String")}});var Ni=y((Yc,ji)=>{"use strict";var co=ki(),fo=Array.prototype.concat,ho=Array.prototype.slice,Ti=ji.exports=function(r){for(var t=[],i=0,n=r.length;i<n;i++){var a=r[i];co(a)?t=fo.call(t,ho.call(a)):t.push(a)}return t};Ti.wrap=function(e){return function(){return e(Ti(arguments))}}});var Oi=y((Zc,Bi)=>{"use strict";var Be=jr(),Oe=Ni(),Fi=Object.hasOwnProperty,Ci=Object.create(null);for(Ze in Be)Fi.call(Be,Ze)&&(Ci[Be[Ze]]=Ze);var Ze,D=Bi.exports={to:{},get:{}};D.get=function(e){var r=e.substring(0,3).toLowerCase(),t,i;switch(r){case"hsl":t=D.get.hsl(e),i="hsl";break;case"hwb":t=D.get.hwb(e),i="hwb";break;default:t=D.get.rgb(e),i="rgb";break}return t?{model:i,value:t}:null};D.get.rgb=function(e){if(!e)return null;var r=/^#([a-f0-9]{3,4})$/i,t=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,i=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,n=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,a=/^(\w+)$/,o=[0,0,0,1],l,h,u;if(l=e.match(t)){for(u=l[2],l=l[1],h=0;h<3;h++){var b=h*2;o[h]=parseInt(l.slice(b,b+2),16)}u&&(o[3]=parseInt(u,16)/255)}else if(l=e.match(r)){for(l=l[1],u=l[3],h=0;h<3;h++)o[h]=parseInt(l[h]+l[h],16);u&&(o[3]=parseInt(u+u,16)/255)}else if(l=e.match(i)){for(h=0;h<3;h++)o[h]=parseInt(l[h+1],0);l[4]&&(l[5]?o[3]=parseFloat(l[4])*.01:o[3]=parseFloat(l[4]))}else if(l=e.match(n)){for(h=0;h<3;h++)o[h]=Math.round(parseFloat(l[h+1])*2.55);l[4]&&(l[5]?o[3]=parseFloat(l[4])*.01:o[3]=parseFloat(l[4]))}else return(l=e.match(a))?l[1]==="transparent"?[0,0,0,0]:Fi.call(Be,l[1])?(o=Be[l[1]],o[3]=1,o):null:null;for(h=0;h<3;h++)o[h]=le(o[h],0,255);return o[3]=le(o[3],0,1),o};D.get.hsl=function(e){if(!e)return null;var r=/^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*)?\)$/,t=e.match(r);if(t){var i=parseFloat(t[4]),n=(parseFloat(t[1])%360+360)%360,a=le(parseFloat(t[2]),0,100),o=le(parseFloat(t[3]),0,100),l=le(isNaN(i)?1:i,0,1);return[n,a,o,l]}return null};D.get.hwb=function(e){if(!e)return null;var r=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,t=e.match(r);if(t){var i=parseFloat(t[4]),n=(parseFloat(t[1])%360+360)%360,a=le(parseFloat(t[2]),0,100),o=le(parseFloat(t[3]),0,100),l=le(isNaN(i)?1:i,0,1);return[n,a,o,l]}return null};D.to.hex=function(){var e=Oe(arguments);return"#"+er(e[0])+er(e[1])+er(e[2])+(e[3]<1?er(Math.round(e[3]*255)):"")};D.to.rgb=function(){var e=Oe(arguments);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]+")"};D.to.rgb.percent=function(){var e=Oe(arguments),r=Math.round(e[0]/255*100),t=Math.round(e[1]/255*100),i=Math.round(e[2]/255*100);return e.length<4||e[3]===1?"rgb("+r+"%, "+t+"%, "+i+"%)":"rgba("+r+"%, "+t+"%, "+i+"%, "+e[3]+")"};D.to.hsl=function(){var e=Oe(arguments);return e.length<4||e[3]===1?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"};D.to.hwb=function(){var e=Oe(arguments),r="";return e.length>=4&&e[3]!==1&&(r=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+r+")"};D.to.keyword=function(e){return Ci[e.slice(0,3)]};function le(e,r,t){return Math.min(Math.max(r,e),t)}function er(e){var r=Math.round(e).toString(16).toUpperCase();return r.length<2?"0"+r:r}});var Nr=y((ef,Mi)=>{"use strict";var qe=jr(),qi={};for(let e of Object.keys(qe))qi[qe[e]]=e;var g={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"},lch:{channels:3,labels:"lch"},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"]}};Mi.exports=g;for(let e of Object.keys(g)){if(!("channels"in g[e]))throw new Error("missing channels property: "+e);if(!("labels"in g[e]))throw new Error("missing channel labels property: "+e);if(g[e].labels.length!==g[e].channels)throw new Error("channel and label counts mismatch: "+e);let{channels:r,labels:t}=g[e];delete g[e].channels,delete g[e].labels,Object.defineProperty(g[e],"channels",{value:r}),Object.defineProperty(g[e],"labels",{value:t})}g.rgb.hsl=function(e){let r=e[0]/255,t=e[1]/255,i=e[2]/255,n=Math.min(r,t,i),a=Math.max(r,t,i),o=a-n,l,h;a===n?l=0:r===a?l=(t-i)/o:t===a?l=2+(i-r)/o:i===a&&(l=4+(r-t)/o),l=Math.min(l*60,360),l<0&&(l+=360);let u=(n+a)/2;return a===n?h=0:u<=.5?h=o/(a+n):h=o/(2-a-n),[l,h*100,u*100]};g.rgb.hsv=function(e){let r,t,i,n,a,o=e[0]/255,l=e[1]/255,h=e[2]/255,u=Math.max(o,l,h),b=u-Math.min(o,l,h),w=function(A){return(u-A)/6/b+1/2};return b===0?(n=0,a=0):(a=b/u,r=w(o),t=w(l),i=w(h),o===u?n=i-t:l===u?n=1/3+r-i:h===u&&(n=2/3+t-r),n<0?n+=1:n>1&&(n-=1)),[n*360,a*100,u*100]};g.rgb.hwb=function(e){let r=e[0],t=e[1],i=e[2],n=g.rgb.hsl(e)[0],a=1/255*Math.min(r,Math.min(t,i));return i=1-1/255*Math.max(r,Math.max(t,i)),[n,a*100,i*100]};g.rgb.cmyk=function(e){let r=e[0]/255,t=e[1]/255,i=e[2]/255,n=Math.min(1-r,1-t,1-i),a=(1-r-n)/(1-n)||0,o=(1-t-n)/(1-n)||0,l=(1-i-n)/(1-n)||0;return[a*100,o*100,l*100,n*100]};function uo(e,r){return(e[0]-r[0])**2+(e[1]-r[1])**2+(e[2]-r[2])**2}g.rgb.keyword=function(e){let r=qi[e];if(r)return r;let t=1/0,i;for(let n of Object.keys(qe)){let a=qe[n],o=uo(e,a);o<t&&(t=o,i=n)}return i};g.keyword.rgb=function(e){return qe[e]};g.rgb.xyz=function(e){let r=e[0]/255,t=e[1]/255,i=e[2]/255;r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,i=i>.04045?((i+.055)/1.055)**2.4:i/12.92;let n=r*.4124+t*.3576+i*.1805,a=r*.2126+t*.7152+i*.0722,o=r*.0193+t*.1192+i*.9505;return[n*100,a*100,o*100]};g.rgb.lab=function(e){let r=g.rgb.xyz(e),t=r[0],i=r[1],n=r[2];t/=95.047,i/=100,n/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,i=i>.008856?i**(1/3):7.787*i+16/116,n=n>.008856?n**(1/3):7.787*n+16/116;let a=116*i-16,o=500*(t-i),l=200*(i-n);return[a,o,l]};g.hsl.rgb=function(e){let r=e[0]/360,t=e[1]/100,i=e[2]/100,n,a,o;if(t===0)return o=i*255,[o,o,o];i<.5?n=i*(1+t):n=i+t-i*t;let l=2*i-n,h=[0,0,0];for(let u=0;u<3;u++)a=r+1/3*-(u-1),a<0&&a++,a>1&&a--,6*a<1?o=l+(n-l)*6*a:2*a<1?o=n:3*a<2?o=l+(n-l)*(2/3-a)*6:o=l,h[u]=o*255;return h};g.hsl.hsv=function(e){let r=e[0],t=e[1]/100,i=e[2]/100,n=t,a=Math.max(i,.01);i*=2,t*=i<=1?i:2-i,n*=a<=1?a:2-a;let o=(i+t)/2,l=i===0?2*n/(a+n):2*t/(i+t);return[r,l*100,o*100]};g.hsv.rgb=function(e){let r=e[0]/60,t=e[1]/100,i=e[2]/100,n=Math.floor(r)%6,a=r-Math.floor(r),o=255*i*(1-t),l=255*i*(1-t*a),h=255*i*(1-t*(1-a));switch(i*=255,n){case 0:return[i,h,o];case 1:return[l,i,o];case 2:return[o,i,h];case 3:return[o,l,i];case 4:return[h,o,i];case 5:return[i,o,l]}};g.hsv.hsl=function(e){let r=e[0],t=e[1]/100,i=e[2]/100,n=Math.max(i,.01),a,o;o=(2-t)*i;let l=(2-t)*n;return a=t*n,a/=l<=1?l:2-l,a=a||0,o/=2,[r,a*100,o*100]};g.hwb.rgb=function(e){let r=e[0]/360,t=e[1]/100,i=e[2]/100,n=t+i,a;n>1&&(t/=n,i/=n);let o=Math.floor(6*r),l=1-i;a=6*r-o,(o&1)!==0&&(a=1-a);let h=t+a*(l-t),u,b,w;switch(o){default:case 6:case 0:u=l,b=h,w=t;break;case 1:u=h,b=l,w=t;break;case 2:u=t,b=l,w=h;break;case 3:u=t,b=h,w=l;break;case 4:u=h,b=t,w=l;break;case 5:u=l,b=t,w=h;break}return[u*255,b*255,w*255]};g.cmyk.rgb=function(e){let r=e[0]/100,t=e[1]/100,i=e[2]/100,n=e[3]/100,a=1-Math.min(1,r*(1-n)+n),o=1-Math.min(1,t*(1-n)+n),l=1-Math.min(1,i*(1-n)+n);return[a*255,o*255,l*255]};g.xyz.rgb=function(e){let r=e[0]/100,t=e[1]/100,i=e[2]/100,n,a,o;return n=r*3.2406+t*-1.5372+i*-.4986,a=r*-.9689+t*1.8758+i*.0415,o=r*.0557+t*-.204+i*1.057,n=n>.0031308?1.055*n**(1/2.4)-.055:n*12.92,a=a>.0031308?1.055*a**(1/2.4)-.055:a*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,n=Math.min(Math.max(0,n),1),a=Math.min(Math.max(0,a),1),o=Math.min(Math.max(0,o),1),[n*255,a*255,o*255]};g.xyz.lab=function(e){let r=e[0],t=e[1],i=e[2];r/=95.047,t/=100,i/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,t=t>.008856?t**(1/3):7.787*t+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;let n=116*t-16,a=500*(r-t),o=200*(t-i);return[n,a,o]};g.lab.xyz=function(e){let r=e[0],t=e[1],i=e[2],n,a,o;a=(r+16)/116,n=t/500+a,o=a-i/200;let l=a**3,h=n**3,u=o**3;return a=l>.008856?l:(a-16/116)/7.787,n=h>.008856?h:(n-16/116)/7.787,o=u>.008856?u:(o-16/116)/7.787,n*=95.047,a*=100,o*=108.883,[n,a,o]};g.lab