@neurynae/toolcairn-mcp 1.0.0 → 1.0.2

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.
@@ -0,0 +1,369 @@
1
+ import { createRequire as __nodeCreateRequire } from 'module'; const require = __nodeCreateRequire(import.meta.url);
2
+ var uw=Object.create;var ho=Object.defineProperty;var fw=Object.getOwnPropertyDescriptor;var dw=Object.getOwnPropertyNames;var hw=Object.getPrototypeOf,pw=Object.prototype.hasOwnProperty;var X=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,n)=>(typeof require<"u"?require:e)[n]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var mw=(t,e)=>()=>(t&&(e=t(t=0)),e);var S=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),gw=(t,e)=>{for(var n in e)ho(t,n,{get:e[n],enumerable:!0})},yw=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of dw(e))!pw.call(t,s)&&s!==n&&ho(t,s,{get:()=>e[s],enumerable:!(r=fw(e,s))||r.enumerable});return t};var H=(t,e,n)=>(n=t!=null?uw(hw(t)):{},yw(e||!t||!t.__esModule?ho(n,"default",{value:t,enumerable:!0}):n,t));import _w from"path";import{fileURLToPath as ww}from"url";var mu,bw,_,w,d=mw(()=>{"use strict";mu=()=>ww(import.meta.url),bw=()=>_w.dirname(mu()),_=bw(),w=mu()});var is=S(ss=>{"use strict";d();Object.defineProperty(ss,"__esModule",{value:!0});ss.ErrorCode=void 0;ss.ErrorCode={ERR_DB_CONNECTION:"ERR_DB_CONNECTION",ERR_DB_QUERY:"ERR_DB_QUERY",ERR_DB_TIMEOUT:"ERR_DB_TIMEOUT",ERR_DB_CONSTRAINT:"ERR_DB_CONSTRAINT",ERR_DB_NOT_FOUND:"ERR_DB_NOT_FOUND",ERR_VALIDATION_INPUT:"ERR_VALIDATION_INPUT",ERR_VALIDATION_SCHEMA:"ERR_VALIDATION_SCHEMA",ERR_AUTH_TOKEN_EXPIRED:"ERR_AUTH_TOKEN_EXPIRED",ERR_AUTH_UNAUTHORIZED:"ERR_AUTH_UNAUTHORIZED",ERR_AUTH_FORBIDDEN:"ERR_AUTH_FORBIDDEN",ERR_EXTERNAL_GITHUB:"ERR_EXTERNAL_GITHUB",ERR_EXTERNAL_NOMIC:"ERR_EXTERNAL_NOMIC",ERR_EXTERNAL_QDRANT:"ERR_EXTERNAL_QDRANT",ERR_EXTERNAL_MEMGRAPH:"ERR_EXTERNAL_MEMGRAPH",ERR_EXTERNAL_RAZORPAY:"ERR_EXTERNAL_RAZORPAY",ERR_QUEUE_PUBLISH:"ERR_QUEUE_PUBLISH",ERR_QUEUE_CONSUME:"ERR_QUEUE_CONSUME",ERR_QUEUE_TIMEOUT:"ERR_QUEUE_TIMEOUT",ERR_SEARCH_PIPELINE:"ERR_SEARCH_PIPELINE",ERR_SEARCH_EMBEDDING:"ERR_SEARCH_EMBEDDING",ERR_SEARCH_NO_RESULTS:"ERR_SEARCH_NO_RESULTS",ERR_INDEXER_CRAWL:"ERR_INDEXER_CRAWL",ERR_INDEXER_PROCESS:"ERR_INDEXER_PROCESS",ERR_INDEXER_WRITE:"ERR_INDEXER_WRITE",ERR_NETWORK_TIMEOUT:"ERR_NETWORK_TIMEOUT",ERR_NETWORK_UNREACHABLE:"ERR_NETWORK_UNREACHABLE",ERR_MCP_HANDLER:"ERR_MCP_HANDLER",ERR_MCP_AUTH:"ERR_MCP_AUTH",ERR_INTERNAL:"ERR_INTERNAL",ERR_NOT_FOUND:"ERR_NOT_FOUND",ERR_RATE_LIMIT:"ERR_RATE_LIMIT"}});var os=S(ue=>{"use strict";d();Object.defineProperty(ue,"__esModule",{value:!0});ue.VectorError=ue.IndexerError=ue.SearchError=ue.QueueError=ue.ExternalServiceError=ue.AuthError=ue.ValidationError=ue.NetworkError=ue.DatabaseError=ue.AppError=void 0;var ct=is(),Pe=class extends Error{code;httpStatus;severity;isOperational;context;timestamp;constructor(e){super(e.message,{cause:e.cause}),this.name=this.constructor.name,this.code=e.code,this.httpStatus=e.httpStatus??500,this.severity=e.severity??"medium",this.isOperational=e.isOperational??!0,this.context=e.context??{},this.timestamp=new Date().toISOString(),Object.setPrototypeOf(this,new.target.prototype)}toJSON(){return{name:this.name,code:this.code,message:this.message,httpStatus:this.httpStatus,severity:this.severity,isOperational:this.isOperational,context:this.context,timestamp:this.timestamp,stack:this.stack,cause:this.cause instanceof Error?{name:this.cause.name,message:this.cause.message,stack:this.cause.stack}:this.cause}}};ue.AppError=Pe;var yo=class extends Pe{constructor(e){super({code:e.code??ct.ErrorCode.ERR_DB_QUERY,message:e.message,httpStatus:503,severity:"high",isOperational:!0,cause:e.cause,context:e.context})}};ue.DatabaseError=yo;var _o=class extends Pe{constructor(e){super({code:e.code??ct.ErrorCode.ERR_NETWORK_TIMEOUT,message:e.message,httpStatus:502,severity:"high",isOperational:!0,cause:e.cause,context:e.context})}};ue.NetworkError=_o;var wo=class extends Pe{constructor(e){super({code:e.code??ct.ErrorCode.ERR_VALIDATION_INPUT,message:e.message,httpStatus:400,severity:"low",isOperational:!0,cause:e.cause,context:e.context})}};ue.ValidationError=wo;var bo=class extends Pe{constructor(e){super({code:e.code??ct.ErrorCode.ERR_AUTH_UNAUTHORIZED,message:e.message,httpStatus:401,severity:"medium",isOperational:!0,cause:e.cause,context:e.context})}};ue.AuthError=bo;var vo=class extends Pe{constructor(e){super({code:e.code??ct.ErrorCode.ERR_INTERNAL,message:`[${e.service}] ${e.message}`,httpStatus:502,severity:"high",isOperational:!0,cause:e.cause,context:{...e.context,service:e.service}})}};ue.ExternalServiceError=vo;var So=class extends Pe{constructor(e){super({code:e.code??ct.ErrorCode.ERR_QUEUE_PUBLISH,message:e.message,httpStatus:503,severity:"high",isOperational:!0,cause:e.cause,context:e.context})}};ue.QueueError=So;var Eo=class extends Pe{constructor(e){super({code:e.code??ct.ErrorCode.ERR_SEARCH_PIPELINE,message:e.message,httpStatus:500,severity:"medium",isOperational:!0,cause:e.cause,context:e.context})}};ue.SearchError=Eo;var ko=class extends Pe{constructor(e){super({code:e.code??ct.ErrorCode.ERR_INDEXER_PROCESS,message:e.message,httpStatus:500,severity:"medium",isOperational:!0,cause:e.cause,context:e.context})}};ue.IndexerError=ko;var xo=class extends Pe{constructor(e){super({code:e.code??ct.ErrorCode.ERR_EXTERNAL_NOMIC,message:e.message,httpStatus:502,severity:"high",isOperational:!0,cause:e.cause,context:e.context})}};ue.VectorError=xo});var Oo=S(To=>{"use strict";d();Object.defineProperty(To,"__esModule",{value:!0});To.errorSerializer=Pb;var Ib=os();function Pb(t){return t instanceof Ib.AppError?t.toJSON():t instanceof Error?{name:t.name,message:t.message,stack:t.stack,cause:t.cause instanceof Error?{name:t.cause.name,message:t.cause.message,stack:t.cause.stack}:t.cause}:{message:String(t)}}});var Ao=S((mL,Au)=>{"use strict";d();var nr=t=>t&&typeof t.message=="string",No=t=>{if(!t)return;let e=t.cause;if(typeof e=="function"){let n=t.cause();return nr(n)?n:void 0}else return nr(e)?e:void 0},Ou=(t,e)=>{if(!nr(t))return"";let n=t.stack||"";if(e.has(t))return n+`
3
+ causes have become circular...`;let r=No(t);return r?(e.add(t),n+`
4
+ caused by: `+Ou(r,e)):n},Lb=t=>Ou(t,new Set),Nu=(t,e,n)=>{if(!nr(t))return"";let r=n?"":t.message||"";if(e.has(t))return r+": ...";let s=No(t);if(s){e.add(t);let i=typeof t.cause=="function";return r+(i?"":": ")+Nu(s,e,i)}else return r},Rb=t=>Nu(t,new Set);Au.exports={isErrorLike:nr,getErrorCause:No,stackWithCauses:Lb,messageWithCauses:Rb}});var Co=S((yL,Iu)=>{"use strict";d();var jb=Symbol("circular-ref-tag"),as=Symbol("pino-raw-err-ref"),Cu=Object.create({},{type:{enumerable:!0,writable:!0,value:void 0},message:{enumerable:!0,writable:!0,value:void 0},stack:{enumerable:!0,writable:!0,value:void 0},aggregateErrors:{enumerable:!0,writable:!0,value:void 0},raw:{enumerable:!1,get:function(){return this[as]},set:function(t){this[as]=t}}});Object.defineProperty(Cu,as,{writable:!0,value:{}});Iu.exports={pinoErrProto:Cu,pinoErrorSymbols:{seen:jb,rawSymbol:as}}});var Ru=S((wL,Lu)=>{"use strict";d();Lu.exports=Po;var{messageWithCauses:$b,stackWithCauses:Mb,isErrorLike:Pu}=Ao(),{pinoErrProto:qb,pinoErrorSymbols:Fb}=Co(),{seen:Io}=Fb,{toString:Bb}=Object.prototype;function Po(t){if(!Pu(t))return t;t[Io]=void 0;let e=Object.create(qb);e.type=Bb.call(t.constructor)==="[object Function]"?t.constructor.name:t.name,e.message=$b(t),e.stack=Mb(t),Array.isArray(t.errors)&&(e.aggregateErrors=t.errors.map(n=>Po(n)));for(let n in t)if(e[n]===void 0){let r=t[n];Pu(r)?n!=="cause"&&!Object.prototype.hasOwnProperty.call(r,Io)&&(e[n]=Po(r)):e[n]=r}return delete t[Io],e.raw=t,e}});var $u=S((vL,ju)=>{"use strict";d();ju.exports=ls;var{isErrorLike:Lo}=Ao(),{pinoErrProto:Db,pinoErrorSymbols:Ub}=Co(),{seen:cs}=Ub,{toString:Vb}=Object.prototype;function ls(t){if(!Lo(t))return t;t[cs]=void 0;let e=Object.create(Db);e.type=Vb.call(t.constructor)==="[object Function]"?t.constructor.name:t.name,e.message=t.message,e.stack=t.stack,Array.isArray(t.errors)&&(e.aggregateErrors=t.errors.map(n=>ls(n))),Lo(t.cause)&&!Object.prototype.hasOwnProperty.call(t.cause,cs)&&(e.cause=ls(t.cause));for(let n in t)if(e[n]===void 0){let r=t[n];Lo(r)?Object.prototype.hasOwnProperty.call(r,cs)||(e[n]=ls(r)):e[n]=r}return delete t[cs],e.raw=t,e}});var Bu=S((EL,Fu)=>{"use strict";d();Fu.exports={mapHttpRequest:Kb,reqSerializer:qu};var Ro=Symbol("pino-raw-req-ref"),Mu=Object.create({},{id:{enumerable:!0,writable:!0,value:""},method:{enumerable:!0,writable:!0,value:""},url:{enumerable:!0,writable:!0,value:""},query:{enumerable:!0,writable:!0,value:""},params:{enumerable:!0,writable:!0,value:""},headers:{enumerable:!0,writable:!0,value:{}},remoteAddress:{enumerable:!0,writable:!0,value:""},remotePort:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[Ro]},set:function(t){this[Ro]=t}}});Object.defineProperty(Mu,Ro,{writable:!0,value:{}});function qu(t){let e=t.info||t.socket,n=Object.create(Mu);if(n.id=typeof t.id=="function"?t.id():t.id||(t.info?t.info.id:void 0),n.method=t.method,t.originalUrl)n.url=t.originalUrl;else{let r=t.path;n.url=typeof r=="string"?r:t.url?t.url.path||t.url:void 0}return t.query&&(n.query=t.query),t.params&&(n.params=t.params),n.headers=t.headers,n.remoteAddress=e&&e.remoteAddress,n.remotePort=e&&e.remotePort,n.raw=t.raw||t,n}function Kb(t){return{req:qu(t)}}});var Ku=S((xL,Vu)=>{"use strict";d();Vu.exports={mapHttpResponse:Gb,resSerializer:Uu};var jo=Symbol("pino-raw-res-ref"),Du=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[jo]},set:function(t){this[jo]=t}}});Object.defineProperty(Du,jo,{writable:!0,value:{}});function Uu(t){let e=Object.create(Du);return e.statusCode=t.headersSent?t.statusCode:null,e.headers=t.getHeaders?t.getHeaders():t._headers,e.raw=t,e}function Gb(t){return{res:Uu(t)}}});var Mo=S((OL,Gu)=>{"use strict";d();var $o=Ru(),Wb=$u(),us=Bu(),fs=Ku();Gu.exports={err:$o,errWithCause:Wb,mapHttpRequest:us.mapHttpRequest,mapHttpResponse:fs.mapHttpResponse,req:us.reqSerializer,res:fs.resSerializer,wrapErrorSerializer:function(e){return e===$o?e:function(r){return e($o(r))}},wrapRequestSerializer:function(e){return e===us.reqSerializer?e:function(r){return e(us.reqSerializer(r))}},wrapResponseSerializer:function(e){return e===fs.resSerializer?e:function(r){return e(fs.resSerializer(r))}}}});var qo=S((AL,Wu)=>{"use strict";d();function Jb(t,e){return e}Wu.exports=function(){let e=Error.prepareStackTrace;Error.prepareStackTrace=Jb;let n=new Error().stack;if(Error.prepareStackTrace=e,!Array.isArray(n))return;let r=n.slice(2),s=[];for(let i of r)i&&s.push(i.getFileName());return s}});var Xu=S((IL,Zu)=>{"use strict";d();function Fo(t){if(t===null||typeof t!="object")return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof Array){let e=[];for(let n=0;n<t.length;n++)e[n]=Fo(t[n]);return e}if(typeof t=="object"){let e=Object.create(Object.getPrototypeOf(t));for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=Fo(t[n]));return e}return t}function Ju(t){let e=[],n="",r=!1,s=!1,i="";for(let o=0;o<t.length;o++){let a=t[o];!r&&a==="."?n&&(e.push(n),n=""):a==="["?(n&&(e.push(n),n=""),r=!0):a==="]"&&r?(e.push(n),n="",r=!1,s=!1):(a==='"'||a==="'")&&r?s?a===i?(s=!1,i=""):n+=a:(s=!0,i=a):n+=a}return n&&e.push(n),e}function Yu(t,e,n){let r=t;for(let i=0;i<e.length-1;i++){let o=e[i];if(typeof r!="object"||r===null||!(o in r)||typeof r[o]!="object"||r[o]===null)return!1;r=r[o]}let s=e[e.length-1];if(s==="*"){if(Array.isArray(r))for(let i=0;i<r.length;i++)r[i]=n;else if(typeof r=="object"&&r!==null)for(let i in r)Object.prototype.hasOwnProperty.call(r,i)&&(r[i]=n)}else typeof r=="object"&&r!==null&&s in r&&Object.prototype.hasOwnProperty.call(r,s)&&(r[s]=n);return!0}function zu(t,e){let n=t;for(let s=0;s<e.length-1;s++){let i=e[s];if(typeof n!="object"||n===null||!(i in n)||typeof n[i]!="object"||n[i]===null)return!1;n=n[i]}let r=e[e.length-1];if(r==="*"){if(Array.isArray(n))for(let s=0;s<n.length;s++)n[s]=void 0;else if(typeof n=="object"&&n!==null)for(let s in n)Object.prototype.hasOwnProperty.call(n,s)&&delete n[s]}else typeof n=="object"&&n!==null&&r in n&&Object.prototype.hasOwnProperty.call(n,r)&&delete n[r];return!0}var ds=Symbol("PATH_NOT_FOUND");function Yb(t,e){let n=t;for(let r of e){if(n==null||typeof n!="object"||n===null||!(r in n))return ds;n=n[r]}return n}function zb(t,e){let n=t;for(let r of e){if(n==null||typeof n!="object"||n===null)return;n=n[r]}return n}function Hb(t,e,n,r=!1){for(let s of e){let i=Ju(s);if(i.includes("*"))Hu(t,i,n,s,r);else if(r)zu(t,i);else{let o=Yb(t,i);if(o===ds)continue;let a=typeof n=="function"?n(o,i):n;Yu(t,i,a)}}}function Hu(t,e,n,r,s=!1){let i=e.indexOf("*");if(i===e.length-1){let o=e.slice(0,-1),a=t;for(let c of o){if(a==null||typeof a!="object"||a===null)return;a=a[c]}if(Array.isArray(a))if(s)for(let c=0;c<a.length;c++)a[c]=void 0;else for(let c=0;c<a.length;c++){let l=[...o,c.toString()],u=typeof n=="function"?n(a[c],l):n;a[c]=u}else if(typeof a=="object"&&a!==null)if(s){let c=[];for(let l in a)Object.prototype.hasOwnProperty.call(a,l)&&c.push(l);for(let l of c)delete a[l]}else for(let c in a){let l=[...o,c],u=typeof n=="function"?n(a[c],l):n;a[c]=u}}else Zb(t,e,n,i,r,s)}function Zb(t,e,n,r,s,i=!1){let o=e.slice(0,r),a=e.slice(r+1),c=[];function l(u,f){if(f===o.length){if(Array.isArray(u))for(let h=0;h<u.length;h++)c[f]=h.toString(),l(u[h],f+1);else if(typeof u=="object"&&u!==null)for(let h in u)c[f]=h,l(u[h],f+1)}else if(f<o.length){let h=o[f];u&&typeof u=="object"&&u!==null&&h in u&&(c[f]=h,l(u[h],f+1))}else if(a.includes("*"))Hu(u,a,typeof n=="function"?(g,p)=>{let m=[...c.slice(0,f),...p];return n(g,m)}:n,s,i);else if(i)zu(u,a);else{let h=typeof n=="function"?n(zb(u,a),[...c.slice(0,f),...a]):n;Yu(u,a,h)}}if(o.length===0)l(t,0);else{let u=t;for(let f=0;f<o.length;f++){let h=o[f];if(u==null||typeof u!="object"||u===null)return;u=u[h],c[f]=h}u!=null&&l(u,o.length)}}function Xb(t){if(t.length===0)return null;let e=new Map;for(let n of t){let r=Ju(n),s=e;for(let i=0;i<r.length;i++){let o=r[i];s.has(o)||s.set(o,new Map),s=s.get(o)}}return e}function Qb(t,e){if(!e)return t;function n(r,s,i=0){if(!s||s.size===0||r===null||typeof r!="object")return r;if(r instanceof Date)return new Date(r.getTime());if(Array.isArray(r)){let a=[];for(let c=0;c<r.length;c++){let l=c.toString();s.has(l)||s.has("*")?a[c]=n(r[c],s.get(l)||s.get("*")):a[c]=r[c]}return a}let o=Object.create(Object.getPrototypeOf(r));for(let a in r)Object.prototype.hasOwnProperty.call(r,a)&&(s.has(a)||s.has("*")?o[a]=n(r[a],s.get(a)||s.get("*")):o[a]=r[a]);return o}return n(t,e)}function ev(t){if(typeof t!="string")throw new Error("Paths must be (non-empty) strings");if(t==="")throw new Error("Invalid redaction path ()");if(t.includes(".."))throw new Error(`Invalid redaction path (${t})`);if(t.includes(","))throw new Error(`Invalid redaction path (${t})`);let e=0,n=!1,r="";for(let s=0;s<t.length;s++){let i=t[s];if((i==='"'||i==="'")&&e>0)n?i===r&&(n=!1,r=""):(n=!0,r=i);else if(i==="["&&!n)e++;else if(i==="]"&&!n&&(e--,e<0))throw new Error(`Invalid redaction path (${t})`)}if(e!==0)throw new Error(`Invalid redaction path (${t})`)}function tv(t){if(!Array.isArray(t))throw new TypeError("paths must be an array");for(let e of t)ev(e)}function nv(t={}){let{paths:e=[],censor:n="[REDACTED]",serialize:r=JSON.stringify,strict:s=!0,remove:i=!1}=t;tv(e);let o=Xb(e);return function(c){if(s&&(c===null||typeof c!="object")&&(c==null||typeof c!="object"))return r?r(c):c;let l=Qb(c,o),u=c,f=n;return typeof n=="function"&&(f=n),Hb(l,e,f,i),r===!1?(l.restore=function(){return Fo(u)},l):typeof r=="function"?r(l):JSON.stringify(l)}}Zu.exports=nv});var On=S((LL,Qu)=>{"use strict";d();var rv=Symbol("pino.setLevel"),sv=Symbol("pino.getLevel"),iv=Symbol("pino.levelVal"),ov=Symbol("pino.levelComp"),av=Symbol("pino.useLevelLabels"),cv=Symbol("pino.useOnlyCustomLevels"),lv=Symbol("pino.mixin"),uv=Symbol("pino.lsCache"),fv=Symbol("pino.chindings"),dv=Symbol("pino.asJson"),hv=Symbol("pino.write"),pv=Symbol("pino.redactFmt"),mv=Symbol("pino.time"),gv=Symbol("pino.timeSliceIndex"),yv=Symbol("pino.stream"),_v=Symbol("pino.stringify"),wv=Symbol("pino.stringifySafe"),bv=Symbol("pino.stringifiers"),vv=Symbol("pino.end"),Sv=Symbol("pino.formatOpts"),Ev=Symbol("pino.messageKey"),kv=Symbol("pino.errorKey"),xv=Symbol("pino.nestedKey"),Tv=Symbol("pino.nestedKeyStr"),Ov=Symbol("pino.mixinMergeStrategy"),Nv=Symbol("pino.msgPrefix"),Av=Symbol("pino.wildcardFirst"),Cv=Symbol.for("pino.serializers"),Iv=Symbol.for("pino.formatters"),Pv=Symbol.for("pino.hooks"),Lv=Symbol.for("pino.metadata");Qu.exports={setLevelSym:rv,getLevelSym:sv,levelValSym:iv,levelCompSym:ov,useLevelLabelsSym:av,mixinSym:lv,lsCacheSym:uv,chindingsSym:fv,asJsonSym:dv,writeSym:hv,serializersSym:Cv,redactFmtSym:pv,timeSym:mv,timeSliceIndexSym:gv,streamSym:yv,stringifySym:_v,stringifySafeSym:wv,stringifiersSym:bv,endSym:vv,formatOptsSym:Sv,messageKeySym:Ev,errorKeySym:kv,nestedKeySym:xv,wildcardFirstSym:Av,needsMetadataGsym:Lv,useOnlyCustomLevelsSym:cv,formattersSym:Iv,hooksSym:Pv,nestedKeyStrSym:Tv,mixinMergeStrategySym:Ov,msgPrefixSym:Nv}});var Do=S((jL,rf)=>{"use strict";d();var ef=Xu(),{redactFmtSym:Rv,wildcardFirstSym:hs}=On(),Bo=/[^.[\]]+|\[([^[\]]*?)\]/g,tf="[Redacted]",nf=!1;function jv(t,e){let{paths:n,censor:r,remove:s}=$v(t),i=n.reduce((c,l)=>{Bo.lastIndex=0;let u=Bo.exec(l),f=Bo.exec(l),h=u[1]!==void 0?u[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,"$1"):u[0];if(h==="*"&&(h=hs),f===null)return c[h]=null,c;if(c[h]===null)return c;let{index:g}=f,p=`${l.substr(g,l.length-1)}`;return c[h]=c[h]||[],h!==hs&&c[h].length===0&&c[h].push(...c[hs]||[]),h===hs&&Object.keys(c).forEach(function(m){c[m]&&c[m].push(p)}),c[h].push(p),c},{}),o={[Rv]:ef({paths:n,censor:r,serialize:e,strict:nf,remove:s})},a=(...c)=>e(typeof r=="function"?r(...c):r);return[...Object.keys(i),...Object.getOwnPropertySymbols(i)].reduce((c,l)=>{if(i[l]===null)c[l]=u=>a(u,[l]);else{let u=typeof r=="function"?(f,h)=>r(f,[l,...h]):r;c[l]=ef({paths:i[l],censor:u,serialize:e,strict:nf,remove:s})}return c},o)}function $v(t){if(Array.isArray(t))return t={paths:t,censor:tf},t;let{paths:e,censor:n=tf,remove:r}=t;if(Array.isArray(e)===!1)throw Error("pino \u2013 redact must contain an array of strings");return r===!0&&(n=void 0),{paths:e,censor:n,remove:r}}rf.exports=jv});var af=S((ML,of)=>{"use strict";d();var Mv=()=>"",qv=()=>`,"time":${Date.now()}`,Fv=()=>`,"time":${Math.round(Date.now()/1e3)}`,Bv=()=>`,"time":"${new Date(Date.now()).toISOString()}"`,Dv=1000000n,sf=1000000000n,Uv=BigInt(Date.now())*Dv,Vv=process.hrtime.bigint(),Kv=()=>{let t=process.hrtime.bigint()-Vv,e=Uv+t,n=e/sf,r=e%sf,s=Number(n*1000n+r/1000000n),i=new Date(s),o=i.getUTCFullYear(),a=(i.getUTCMonth()+1).toString().padStart(2,"0"),c=i.getUTCDate().toString().padStart(2,"0"),l=i.getUTCHours().toString().padStart(2,"0"),u=i.getUTCMinutes().toString().padStart(2,"0"),f=i.getUTCSeconds().toString().padStart(2,"0");return`,"time":"${o}-${a}-${c}T${l}:${u}:${f}.${r.toString().padStart(9,"0")}Z"`};of.exports={nullTime:Mv,epochTime:qv,unixTime:Fv,isoTime:Bv,isoTimeNano:Kv}});var lf=S((FL,cf)=>{"use strict";d();function Gv(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}cf.exports=Wv;function Wv(t,e,n){var r=n&&n.stringify||Gv,s=1;if(typeof t=="object"&&t!==null){var i=e.length+s;if(i===1)return t;var o=new Array(i);o[0]=r(t);for(var a=1;a<i;a++)o[a]=r(e[a]);return o.join(" ")}if(typeof t!="string")return t;var c=e.length;if(c===0)return t;for(var l="",u=1-s,f=-1,h=t&&t.length||0,g=0;g<h;){if(t.charCodeAt(g)===37&&g+1<h){switch(f=f>-1?f:0,t.charCodeAt(g+1)){case 100:case 102:if(u>=c||e[u]==null)break;f<g&&(l+=t.slice(f,g)),l+=Number(e[u]),f=g+2,g++;break;case 105:if(u>=c||e[u]==null)break;f<g&&(l+=t.slice(f,g)),l+=Math.floor(Number(e[u])),f=g+2,g++;break;case 79:case 111:case 106:if(u>=c||e[u]===void 0)break;f<g&&(l+=t.slice(f,g));var p=typeof e[u];if(p==="string"){l+="'"+e[u]+"'",f=g+2,g++;break}if(p==="function"){l+=e[u].name||"<anonymous>",f=g+2,g++;break}l+=r(e[u]),f=g+2,g++;break;case 115:if(u>=c)break;f<g&&(l+=t.slice(f,g)),l+=String(e[u]),f=g+2,g++;break;case 37:f<g&&(l+=t.slice(f,g)),l+="%",f=g+2,g++,u--;break}++u}++g}return f===-1?t:(f<h&&(l+=t.slice(f)),l)}});var Vo=S((DL,Uo)=>{"use strict";d();if(typeof SharedArrayBuffer<"u"&&typeof Atomics<"u"){let e=function(n){if((n>0&&n<1/0)===!1)throw typeof n!="number"&&typeof n!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");Atomics.wait(t,0,0,Number(n))},t=new Int32Array(new SharedArrayBuffer(4));Uo.exports=e}else{let t=function(e){if((e>0&&e<1/0)===!1)throw typeof e!="number"&&typeof e!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");let r=Date.now()+Number(e);for(;r>Date.now(););};Uo.exports=t}});var yf=S((VL,gf)=>{"use strict";d();var se=X("fs"),Jv=X("events"),Yv=X("util").inherits,uf=X("path"),Go=Vo(),zv=X("assert"),ps=100,ms=Buffer.allocUnsafe(0),Hv=16*1024,ff="buffer",df="utf8",[Zv,Xv]=(process.versions.node||"0.0").split(".").map(Number),Qv=Zv>=22&&Xv>=7;function hf(t,e){e._opening=!0,e._writing=!0,e._asyncDrainScheduled=!1;function n(i,o){if(i){e._reopening=!1,e._writing=!1,e._opening=!1,e.sync?process.nextTick(()=>{e.listenerCount("error")>0&&e.emit("error",i)}):e.emit("error",i);return}let a=e._reopening;e.fd=o,e.file=t,e._reopening=!1,e._opening=!1,e._writing=!1,e.sync?process.nextTick(()=>e.emit("ready")):e.emit("ready"),!e.destroyed&&(!e._writing&&e._len>e.minLength||e._flushPending?e._actualWrite():a&&process.nextTick(()=>e.emit("drain")))}let r=e.append?"a":"w",s=e.mode;if(e.sync)try{e.mkdir&&se.mkdirSync(uf.dirname(t),{recursive:!0});let i=se.openSync(t,r,s);n(null,i)}catch(i){throw n(i),i}else e.mkdir?se.mkdir(uf.dirname(t),{recursive:!0},i=>{if(i)return n(i);se.open(t,r,s,n)}):se.open(t,r,s,n)}function Be(t){if(!(this instanceof Be))return new Be(t);let{fd:e,dest:n,minLength:r,maxLength:s,maxWrite:i,periodicFlush:o,sync:a,append:c=!0,mkdir:l,retryEAGAIN:u,fsync:f,contentMode:h,mode:g}=t||{};e=e||n,this._len=0,this.fd=-1,this._bufs=[],this._lens=[],this._writing=!1,this._ending=!1,this._reopening=!1,this._asyncDrainScheduled=!1,this._flushPending=!1,this._hwm=Math.max(r||0,16387),this.file=null,this.destroyed=!1,this.minLength=r||0,this.maxLength=s||0,this.maxWrite=i||Hv,this._periodicFlush=o||0,this._periodicFlushTimer=void 0,this.sync=a||!1,this.writable=!0,this._fsync=f||!1,this.append=c||!1,this.mode=g,this.retryEAGAIN=u||(()=>!0),this.mkdir=l||!1;let p,m;if(h===ff)this._writingBuf=ms,this.write=nS,this.flush=sS,this.flushSync=oS,this._actualWrite=cS,p=()=>se.writeSync(this.fd,this._writingBuf),m=()=>se.write(this.fd,this._writingBuf,this.release);else if(h===void 0||h===df)this._writingBuf="",this.write=tS,this.flush=rS,this.flushSync=iS,this._actualWrite=aS,p=()=>Buffer.isBuffer(this._writingBuf)?se.writeSync(this.fd,this._writingBuf):se.writeSync(this.fd,this._writingBuf,"utf8"),m=()=>Buffer.isBuffer(this._writingBuf)?se.write(this.fd,this._writingBuf,this.release):se.write(this.fd,this._writingBuf,"utf8",this.release);else throw new Error(`SonicBoom supports "${df}" and "${ff}", but passed ${h}`);if(typeof e=="number")this.fd=e,process.nextTick(()=>this.emit("ready"));else if(typeof e=="string")hf(e,this);else throw new Error("SonicBoom supports only file descriptors and files");if(this.minLength>=this.maxWrite)throw new Error(`minLength should be smaller than maxWrite (${this.maxWrite})`);this.release=(y,b)=>{if(y){if((y.code==="EAGAIN"||y.code==="EBUSY")&&this.retryEAGAIN(y,this._writingBuf.length,this._len-this._writingBuf.length))if(this.sync)try{Go(ps),this.release(void 0,0)}catch(N){this.release(N)}else setTimeout(m,ps);else this._writing=!1,this.emit("error",y);return}this.emit("write",b);let v=Ko(this._writingBuf,this._len,b);if(this._len=v.len,this._writingBuf=v.writingBuf,this._writingBuf.length){if(!this.sync){m();return}try{do{let N=p(),L=Ko(this._writingBuf,this._len,N);this._len=L.len,this._writingBuf=L.writingBuf}while(this._writingBuf.length)}catch(N){this.release(N);return}}this._fsync&&se.fsyncSync(this.fd);let k=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):k>this.minLength?this._actualWrite():this._ending?k>0?this._actualWrite():(this._writing=!1,gs(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(eS,this)):this.emit("drain"))},this.on("newListener",function(y){y==="drain"&&(this._asyncDrainScheduled=!1)}),this._periodicFlush!==0&&(this._periodicFlushTimer=setInterval(()=>this.flush(null),this._periodicFlush),this._periodicFlushTimer.unref())}function Ko(t,e,n){return typeof t=="string"&&(t=Buffer.from(t)),e=Math.max(e-n,0),t=t.subarray(n),{writingBuf:t,len:e}}function eS(t){t.listenerCount("drain")>0&&(t._asyncDrainScheduled=!1,t.emit("drain"))}Yv(Be,Jv);function pf(t,e){return t.length===0?ms:t.length===1?t[0]:Buffer.concat(t,e)}function tS(t){if(this.destroyed)throw new Error("SonicBoom destroyed");t=""+t;let e=Buffer.byteLength(t),n=this._len+e,r=this._bufs;return this.maxLength&&n>this.maxLength?(this.emit("drop",t),this._len<this._hwm):(r.length===0||Buffer.byteLength(r[r.length-1])+e>this.maxWrite?r.push(t):r[r.length-1]+=t,this._len=n,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function nS(t){if(this.destroyed)throw new Error("SonicBoom destroyed");let e=this._len+t.length,n=this._bufs,r=this._lens;return this.maxLength&&e>this.maxLength?(this.emit("drop",t),this._len<this._hwm):(n.length===0||r[r.length-1]+t.length>this.maxWrite?(n.push([t]),r.push(t.length)):(n[n.length-1].push(t),r[r.length-1]+=t.length),this._len=e,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function mf(t){this._flushPending=!0;let e=()=>{if(this._fsync)this._flushPending=!1,t();else try{se.fsync(this.fd,r=>{this._flushPending=!1,t(r)})}catch(r){t(r)}this.off("error",n)},n=r=>{this._flushPending=!1,t(r),this.off("drain",e)};this.once("drain",e),this.once("error",n)}function rS(t){if(t!=null&&typeof t!="function")throw new Error("flush cb must be a function");if(this.destroyed){let e=new Error("SonicBoom destroyed");if(t){t(e);return}throw e}if(this.minLength<=0){t?.();return}t&&mf.call(this,t),!this._writing&&(this._bufs.length===0&&this._bufs.push(""),this._actualWrite())}function sS(t){if(t!=null&&typeof t!="function")throw new Error("flush cb must be a function");if(this.destroyed){let e=new Error("SonicBoom destroyed");if(t){t(e);return}throw e}if(this.minLength<=0){t?.();return}t&&mf.call(this,t),!this._writing&&(this._bufs.length===0&&(this._bufs.push([]),this._lens.push(0)),this._actualWrite())}Be.prototype.reopen=function(t){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.reopen(t)});return}if(this._ending)return;if(!this.file)throw new Error("Unable to reopen a file descriptor, you must pass a file to SonicBoom");if(t&&(this.file=t),this._reopening=!0,this._writing)return;let e=this.fd;this.once("ready",()=>{e!==this.fd&&se.close(e,n=>{if(n)return this.emit("error",n)})}),hf(this.file,this)};Be.prototype.end=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.end()});return}this._ending||(this._ending=!0,!this._writing&&(this._len>0&&this.fd>=0?this._actualWrite():gs(this)))};function iS(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift(this._writingBuf),this._writingBuf="");let t="";for(;this._bufs.length||t.length;){t.length<=0&&(t=this._bufs[0]);try{let e=Buffer.isBuffer(t)?se.writeSync(this.fd,t):se.writeSync(this.fd,t,"utf8"),n=Ko(t,this._len,e);t=n.writingBuf,this._len=n.len,t.length<=0&&this._bufs.shift()}catch(e){if((e.code==="EAGAIN"||e.code==="EBUSY")&&!this.retryEAGAIN(e,t.length,this._len-t.length))throw e;Go(ps)}}try{se.fsyncSync(this.fd)}catch{}}function oS(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift([this._writingBuf]),this._writingBuf=ms);let t=ms;for(;this._bufs.length||t.length;){t.length<=0&&(t=pf(this._bufs[0],this._lens[0]));try{let e=se.writeSync(this.fd,t);t=t.subarray(e),this._len=Math.max(this._len-e,0),t.length<=0&&(this._bufs.shift(),this._lens.shift())}catch(e){if((e.code==="EAGAIN"||e.code==="EBUSY")&&!this.retryEAGAIN(e,t.length,this._len-t.length))throw e;Go(ps)}}}Be.prototype.destroy=function(){this.destroyed||gs(this)};function aS(){let t=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:this._bufs.shift()||"",this.sync)try{let e=Buffer.isBuffer(this._writingBuf)?se.writeSync(this.fd,this._writingBuf):se.writeSync(this.fd,this._writingBuf,"utf8");t(null,e)}catch(e){t(e)}else se.write(this.fd,this._writingBuf,t)}function cS(){let t=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:pf(this._bufs.shift(),this._lens.shift()),this.sync)try{let e=se.writeSync(this.fd,this._writingBuf);t(null,e)}catch(e){t(e)}else Qv&&(this._writingBuf=Buffer.from(this._writingBuf)),se.write(this.fd,this._writingBuf,t)}function gs(t){if(t.fd===-1){t.once("ready",gs.bind(null,t));return}t._periodicFlushTimer!==void 0&&clearInterval(t._periodicFlushTimer),t.destroyed=!0,t._bufs=[],t._lens=[],zv(typeof t.fd=="number",`sonic.fd must be a number, got ${typeof t.fd}`);try{se.fsync(t.fd,e)}catch{}function e(){t.fd!==1&&t.fd!==2?se.close(t.fd,n):n()}function n(r){if(r){t.emit("error",r);return}t._ending&&!t._writing&&t.emit("finish"),t.emit("close")}}Be.SonicBoom=Be;Be.default=Be;gf.exports=Be});var Wo=S((GL,Sf)=>{"use strict";d();var De={exit:[],beforeExit:[]},_f={exit:fS,beforeExit:dS},Nn;function lS(){Nn===void 0&&(Nn=new FinalizationRegistry(hS))}function uS(t){De[t].length>0||process.on(t,_f[t])}function wf(t){De[t].length>0||(process.removeListener(t,_f[t]),De.exit.length===0&&De.beforeExit.length===0&&(Nn=void 0))}function fS(){bf("exit")}function dS(){bf("beforeExit")}function bf(t){for(let e of De[t]){let n=e.deref(),r=e.fn;n!==void 0&&r(n,t)}De[t]=[]}function hS(t){for(let e of["exit","beforeExit"]){let n=De[e].indexOf(t);De[e].splice(n,n+1),wf(e)}}function vf(t,e,n){if(e===void 0)throw new Error("the object can't be undefined");uS(t);let r=new WeakRef(e);r.fn=n,lS(),Nn.register(e,r),De[t].push(r)}function pS(t,e){vf("exit",t,e)}function mS(t,e){vf("beforeExit",t,e)}function gS(t){if(Nn!==void 0){Nn.unregister(t);for(let e of["exit","beforeExit"])De[e]=De[e].filter(n=>{let r=n.deref();return r&&r!==t}),wf(e)}}Sf.exports={register:pS,registerBeforeExit:mS,unregister:gS}});var Ef=S((JL,yS)=>{yS.exports={name:"thread-stream",version:"3.1.0",description:"A streaming way to send data to a Node.js Worker Thread",main:"index.js",types:"index.d.ts",dependencies:{"real-require":"^0.2.0"},devDependencies:{"@types/node":"^20.1.0","@types/tap":"^15.0.0","@yao-pkg/pkg":"^5.11.5",desm:"^1.3.0",fastbench:"^1.0.1",husky:"^9.0.6","pino-elasticsearch":"^8.0.0","sonic-boom":"^4.0.1",standard:"^17.0.0",tap:"^16.2.0","ts-node":"^10.8.0",typescript:"^5.3.2","why-is-node-running":"^2.2.2"},scripts:{build:"tsc --noEmit",test:'standard && npm run build && npm run transpile && tap "test/**/*.test.*js" && tap --ts test/*.test.*ts',"test:ci":"standard && npm run transpile && npm run test:ci:js && npm run test:ci:ts","test:ci:js":'tap --no-check-coverage --timeout=120 --coverage-report=lcovonly "test/**/*.test.*js"',"test:ci:ts":'tap --ts --no-check-coverage --coverage-report=lcovonly "test/**/*.test.*ts"',"test:yarn":'npm run transpile && tap "test/**/*.test.js" --no-check-coverage',transpile:"sh ./test/ts/transpile.sh",prepare:"husky install"},standard:{ignore:["test/ts/**/*","test/syntax-error.mjs"]},repository:{type:"git",url:"git+https://github.com/mcollina/thread-stream.git"},keywords:["worker","thread","threads","stream"],author:"Matteo Collina <hello@matteocollina.com>",license:"MIT",bugs:{url:"https://github.com/mcollina/thread-stream/issues"},homepage:"https://github.com/mcollina/thread-stream#readme"}});var xf=S((YL,kf)=>{"use strict";d();function _S(t,e,n,r,s){let i=Date.now()+r,o=Atomics.load(t,e);if(o===n){s(null,"ok");return}let a=o,c=l=>{Date.now()>i?s(null,"timed-out"):setTimeout(()=>{a=o,o=Atomics.load(t,e),o===a?c(l>=1e3?1e3:l*2):o===n?s(null,"ok"):s(null,"not-equal")},l)};c(1)}function wS(t,e,n,r,s){let i=Date.now()+r,o=Atomics.load(t,e);if(o!==n){s(null,"ok");return}let a=c=>{Date.now()>i?s(null,"timed-out"):setTimeout(()=>{o=Atomics.load(t,e),o!==n?s(null,"ok"):a(c>=1e3?1e3:c*2)},c)};a(1)}kf.exports={wait:_S,waitDiff:wS}});var Of=S((HL,Tf)=>{"use strict";d();Tf.exports={WRITE_INDEX:4,READ_INDEX:8}});var Pf=S((XL,If)=>{"use strict";d();var{version:bS}=Ef(),{EventEmitter:vS}=X("events"),{Worker:SS}=X("worker_threads"),{join:ES}=X("path"),{pathToFileURL:kS}=X("url"),{wait:xS}=xf(),{WRITE_INDEX:Ee,READ_INDEX:ze}=Of(),TS=X("buffer"),OS=X("assert"),T=Symbol("kImpl"),NS=TS.constants.MAX_STRING_LENGTH,rr=class{constructor(e){this._value=e}deref(){return this._value}},_s=class{register(){}unregister(){}},AS=process.env.NODE_V8_COVERAGE?_s:global.FinalizationRegistry||_s,CS=process.env.NODE_V8_COVERAGE?rr:global.WeakRef||rr,Nf=new AS(t=>{t.exited||t.terminate()});function IS(t,e){let{filename:n,workerData:r}=e,i=("__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{})["thread-stream-worker"]||ES(_,"lib","worker.js"),o=new SS(i,{...e.workerOpts,trackUnmanagedFds:!1,workerData:{filename:n.indexOf("file://")===0?n:kS(n).href,dataBuf:t[T].dataBuf,stateBuf:t[T].stateBuf,workerData:{$context:{threadStreamVersion:bS},...r}}});return o.stream=new rr(t),o.on("message",PS),o.on("exit",Cf),Nf.register(t,o),o}function Af(t){OS(!t[T].sync),t[T].needDrain&&(t[T].needDrain=!1,t.emit("drain"))}function ys(t){let e=Atomics.load(t[T].state,Ee),n=t[T].data.length-e;if(n>0){if(t[T].buf.length===0){t[T].flushing=!1,t[T].ending?Zo(t):t[T].needDrain&&process.nextTick(Af,t);return}let r=t[T].buf.slice(0,n),s=Buffer.byteLength(r);s<=n?(t[T].buf=t[T].buf.slice(n),ws(t,r,ys.bind(null,t))):t.flush(()=>{if(!t.destroyed){for(Atomics.store(t[T].state,ze,0),Atomics.store(t[T].state,Ee,0);s>t[T].data.length;)n=n/2,r=t[T].buf.slice(0,n),s=Buffer.byteLength(r);t[T].buf=t[T].buf.slice(n),ws(t,r,ys.bind(null,t))}})}else if(n===0){if(e===0&&t[T].buf.length===0)return;t.flush(()=>{Atomics.store(t[T].state,ze,0),Atomics.store(t[T].state,Ee,0),ys(t)})}else He(t,new Error("overwritten"))}function PS(t){let e=this.stream.deref();if(e===void 0){this.exited=!0,this.terminate();return}switch(t.code){case"READY":this.stream=new CS(e),e.flush(()=>{e[T].ready=!0,e.emit("ready")});break;case"ERROR":He(e,t.err);break;case"EVENT":Array.isArray(t.args)?e.emit(t.name,...t.args):e.emit(t.name,t.args);break;case"WARNING":process.emitWarning(t.err);break;default:He(e,new Error("this should not happen: "+t.code))}}function Cf(t){let e=this.stream.deref();e!==void 0&&(Nf.unregister(e),e.worker.exited=!0,e.worker.off("exit",Cf),He(e,t!==0?new Error("the worker thread exited"):null))}var Yo=class extends vS{constructor(e={}){if(super(),e.bufferSize<4)throw new Error("bufferSize must at least fit a 4-byte utf-8 char");this[T]={},this[T].stateBuf=new SharedArrayBuffer(128),this[T].state=new Int32Array(this[T].stateBuf),this[T].dataBuf=new SharedArrayBuffer(e.bufferSize||4*1024*1024),this[T].data=Buffer.from(this[T].dataBuf),this[T].sync=e.sync||!1,this[T].ending=!1,this[T].ended=!1,this[T].needDrain=!1,this[T].destroyed=!1,this[T].flushing=!1,this[T].ready=!1,this[T].finished=!1,this[T].errored=null,this[T].closed=!1,this[T].buf="",this.worker=IS(this,e),this.on("message",(n,r)=>{this.worker.postMessage(n,r)})}write(e){if(this[T].destroyed)return zo(this,new Error("the worker has exited")),!1;if(this[T].ending)return zo(this,new Error("the worker is ending")),!1;if(this[T].flushing&&this[T].buf.length+e.length>=NS)try{Jo(this),this[T].flushing=!0}catch(n){return He(this,n),!1}if(this[T].buf+=e,this[T].sync)try{return Jo(this),!0}catch(n){return He(this,n),!1}return this[T].flushing||(this[T].flushing=!0,setImmediate(ys,this)),this[T].needDrain=this[T].data.length-this[T].buf.length-Atomics.load(this[T].state,Ee)<=0,!this[T].needDrain}end(){this[T].destroyed||(this[T].ending=!0,Zo(this))}flush(e){if(this[T].destroyed){typeof e=="function"&&process.nextTick(e,new Error("the worker has exited"));return}let n=Atomics.load(this[T].state,Ee);xS(this[T].state,ze,n,1/0,(r,s)=>{if(r){He(this,r),process.nextTick(e,r);return}if(s==="not-equal"){this.flush(e);return}process.nextTick(e)})}flushSync(){this[T].destroyed||(Jo(this),Ho(this))}unref(){this.worker.unref()}ref(){this.worker.ref()}get ready(){return this[T].ready}get destroyed(){return this[T].destroyed}get closed(){return this[T].closed}get writable(){return!this[T].destroyed&&!this[T].ending}get writableEnded(){return this[T].ending}get writableFinished(){return this[T].finished}get writableNeedDrain(){return this[T].needDrain}get writableObjectMode(){return!1}get writableErrored(){return this[T].errored}};function zo(t,e){setImmediate(()=>{t.emit("error",e)})}function He(t,e){t[T].destroyed||(t[T].destroyed=!0,e&&(t[T].errored=e,zo(t,e)),t.worker.exited?setImmediate(()=>{t[T].closed=!0,t.emit("close")}):t.worker.terminate().catch(()=>{}).then(()=>{t[T].closed=!0,t.emit("close")}))}function ws(t,e,n){let r=Atomics.load(t[T].state,Ee),s=Buffer.byteLength(e);return t[T].data.write(e,r),Atomics.store(t[T].state,Ee,r+s),Atomics.notify(t[T].state,Ee),n(),!0}function Zo(t){if(!(t[T].ended||!t[T].ending||t[T].flushing)){t[T].ended=!0;try{t.flushSync();let e=Atomics.load(t[T].state,ze);Atomics.store(t[T].state,Ee,-1),Atomics.notify(t[T].state,Ee);let n=0;for(;e!==-1;){if(Atomics.wait(t[T].state,ze,e,1e3),e=Atomics.load(t[T].state,ze),e===-2){He(t,new Error("end() failed"));return}if(++n===10){He(t,new Error("end() took too long (10s)"));return}}process.nextTick(()=>{t[T].finished=!0,t.emit("finish")})}catch(e){He(t,e)}}}function Jo(t){let e=()=>{t[T].ending?Zo(t):t[T].needDrain&&process.nextTick(Af,t)};for(t[T].flushing=!1;t[T].buf.length!==0;){let n=Atomics.load(t[T].state,Ee),r=t[T].data.length-n;if(r===0){Ho(t),Atomics.store(t[T].state,ze,0),Atomics.store(t[T].state,Ee,0);continue}else if(r<0)throw new Error("overwritten");let s=t[T].buf.slice(0,r),i=Buffer.byteLength(s);if(i<=r)t[T].buf=t[T].buf.slice(r),ws(t,s,e);else{for(Ho(t),Atomics.store(t[T].state,ze,0),Atomics.store(t[T].state,Ee,0);i>t[T].buf.length;)r=r/2,s=t[T].buf.slice(0,r),i=Buffer.byteLength(s);t[T].buf=t[T].buf.slice(r),ws(t,s,e)}}}function Ho(t){if(t[T].flushing)throw new Error("unable to flush while flushing");let e=Atomics.load(t[T].state,Ee),n=0;for(;;){let r=Atomics.load(t[T].state,ze);if(r===-2)throw Error("_flushSync failed");if(r!==e)Atomics.wait(t[T].state,ze,r,1e3);else break;if(++n===10)throw new Error("_flushSync took too long (10s)")}}If.exports=Yo});var ea=S((eR,Lf)=>{"use strict";d();var{createRequire:LS}=X("module"),RS=qo(),{join:Xo,isAbsolute:jS,sep:$S}=X("path"),MS=Vo(),Qo=Wo(),qS=Pf();function FS(t){Qo.register(t,DS),Qo.registerBeforeExit(t,US),t.on("close",function(){Qo.unregister(t)})}function BS(t,e,n,r){let s=new qS({filename:t,workerData:e,workerOpts:n,sync:r});s.on("ready",i),s.on("close",function(){process.removeListener("exit",o)}),process.on("exit",o);function i(){process.removeListener("exit",o),s.unref(),n.autoEnd!==!1&&FS(s)}function o(){s.closed||(s.flushSync(),MS(100),s.end())}return s}function DS(t){t.ref(),t.flushSync(),t.end(),t.once("close",function(){t.unref()})}function US(t){t.flushSync()}function VS(t){let{pipeline:e,targets:n,levels:r,dedupe:s,worker:i={},caller:o=RS(),sync:a=!1}=t,c={...t.options},l=typeof o=="string"?[o]:o,u="__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{},f=t.target;if(f&&n)throw new Error("only one of target or targets can be specified");return n?(f=u["pino-worker"]||Xo(_,"worker.js"),c.targets=n.filter(g=>g.target).map(g=>({...g,target:h(g.target)})),c.pipelines=n.filter(g=>g.pipeline).map(g=>g.pipeline.map(p=>({...p,level:g.level,target:h(p.target)})))):e&&(f=u["pino-worker"]||Xo(_,"worker.js"),c.pipelines=[e.map(g=>({...g,target:h(g.target)}))]),r&&(c.levels=r),s&&(c.dedupe=s),c.pinoWillSendConfig=!0,BS(h(f),c,i,a);function h(g){if(g=u[g]||g,jS(g)||g.indexOf("file://")===0)return g;if(g==="pino/file")return Xo(_,"..","file.js");let p;for(let m of l)try{let y=m==="node:repl"?process.cwd()+$S:m;p=LS(y).resolve(g);break}catch{continue}if(!p)throw new Error(`unable to determine transport target for "${g}"`);return p}}Lf.exports=VS});var Es=S((nR,Wf)=>{"use strict";d();var Rf=X("diagnostics_channel"),jf=lf(),{mapHttpRequest:KS,mapHttpResponse:GS}=Mo(),na=yf(),$f=Wo(),{lsCacheSym:WS,chindingsSym:Bf,writeSym:Mf,serializersSym:Df,formatOptsSym:qf,endSym:JS,stringifiersSym:Uf,stringifySym:Vf,stringifySafeSym:ra,wildcardFirstSym:Kf,nestedKeySym:YS,formattersSym:Gf,messageKeySym:zS,errorKeySym:HS,nestedKeyStrSym:ZS,msgPrefixSym:bs}=On(),{isMainThread:XS}=X("worker_threads"),QS=ea(),Ss;typeof Rf.tracingChannel=="function"?Ss=Rf.tracingChannel("pino_asJson"):Ss={hasSubscribers:!1,traceSync(t,e,n,...r){return t.call(n,...r)}};function An(){}function e0(t,e){if(!e)return n;return function(...s){e.call(this,s,n,t)};function n(r,...s){if(typeof r=="object"){let i=r;r!==null&&(r.method&&r.headers&&r.socket?r=KS(r):typeof r.setHeader=="function"&&(r=GS(r)));let o;i===null&&s.length===0?o=[null]:(i=s.shift(),o=s),typeof this[bs]=="string"&&i!==void 0&&i!==null&&(i=this[bs]+i),this[Mf](r,jf(i,o,this[qf]),t)}else{let i=r===void 0?s.shift():r;typeof this[bs]=="string"&&i!==void 0&&i!==null&&(i=this[bs]+i),this[Mf](null,jf(i,s,this[qf]),t)}}}function ta(t){let e="",n=0,r=!1,s=255,i=t.length;if(i>100)return JSON.stringify(t);for(var o=0;o<i&&s>=32;o++)s=t.charCodeAt(o),(s===34||s===92)&&(e+=t.slice(n,o)+"\\",n=o,r=!0);return r?e+=t.slice(n):e=t,s<32?JSON.stringify(t):'"'+e+'"'}function t0(t,e,n,r){if(Ss.hasSubscribers===!1)return Ff.call(this,t,e,n,r);let s={instance:this,arguments};return Ss.traceSync(Ff,s,this,t,e,n,r)}function Ff(t,e,n,r){let s=this[Vf],i=this[ra],o=this[Uf],a=this[JS],c=this[Bf],l=this[Df],u=this[Gf],f=this[zS],h=this[HS],g=this[WS][n]+r;g=g+c;let p;u.log&&(t=u.log(t));let m=o[Kf],y="";for(let v in t)if(p=t[v],Object.prototype.hasOwnProperty.call(t,v)&&p!==void 0){l[v]?p=l[v](p):v===h&&l.err&&(p=l.err(p));let k=o[v]||m;switch(typeof p){case"undefined":case"function":continue;case"number":Number.isFinite(p)===!1&&(p=null);case"boolean":k&&(p=k(p));break;case"string":p=(k||ta)(p);break;default:p=(k||s)(p,i)}if(p===void 0)continue;let N=ta(v);y+=","+N+":"+p}let b="";if(e!==void 0){p=l[f]?l[f](e):e;let v=o[f]||m;switch(typeof p){case"function":break;case"number":Number.isFinite(p)===!1&&(p=null);case"boolean":v&&(p=v(p)),b=',"'+f+'":'+p;break;case"string":p=(v||ta)(p),b=',"'+f+'":'+p;break;default:p=(v||s)(p,i),b=',"'+f+'":'+p}}return this[YS]&&y?g+this[ZS]+y.slice(1)+"}"+b+a:g+y+b+a}function n0(t,e){let n,r=t[Bf],s=t[Vf],i=t[ra],o=t[Uf],a=o[Kf],c=t[Df],l=t[Gf].bindings;e=l(e);for(let u in e)if(n=e[u],((u.length<5||u!=="level"&&u!=="serializers"&&u!=="formatters"&&u!=="customLevels")&&e.hasOwnProperty(u)&&n!==void 0)===!0){if(n=c[u]?c[u](n):n,n=(o[u]||a||s)(n,i),n===void 0)continue;r+=',"'+u+'":'+n}return r}function r0(t){return t.write!==t.constructor.prototype.write}function vs(t){let e=new na(t);return e.on("error",n),!t.sync&&XS&&($f.register(e,s0),e.on("close",function(){$f.unregister(e)})),e;function n(r){if(r.code==="EPIPE"){e.write=An,e.end=An,e.flushSync=An,e.destroy=An;return}e.removeListener("error",n),e.emit("error",r)}}function s0(t,e){t.destroyed||(e==="beforeExit"?(t.flush(),t.on("drain",function(){t.end()})):t.flushSync())}function i0(t){return function(n,r,s={},i){if(typeof s=="string")i=vs({dest:s}),s={};else if(typeof i=="string"){if(s&&s.transport)throw Error("only one of option.transport or stream can be specified");i=vs({dest:i})}else if(s instanceof na||s.writable||s._writableState)i=s,s={};else if(s.transport){if(s.transport instanceof na||s.transport.writable||s.transport._writableState)throw Error("option.transport do not allow stream, please pass to option directly. e.g. pino(transport)");if(s.transport.targets&&s.transport.targets.length&&s.formatters&&typeof s.formatters.level=="function")throw Error("option.transport.targets do not allow custom level formatters");let c;s.customLevels&&(c=s.useOnlyCustomLevels?s.customLevels:Object.assign({},s.levels,s.customLevels)),i=QS({caller:r,...s.transport,levels:c})}if(s=Object.assign({},t,s),s.serializers=Object.assign({},t.serializers,s.serializers),s.formatters=Object.assign({},t.formatters,s.formatters),s.prettyPrint)throw new Error("prettyPrint option is no longer supported, see the pino-pretty package (https://github.com/pinojs/pino-pretty)");let{enabled:o,onChild:a}=s;return o===!1&&(s.level="silent"),a||(s.onChild=An),i||(r0(process.stdout)?i=process.stdout:i=vs({fd:process.stdout.fd||1})),{opts:s,stream:i}}}function o0(t,e){try{return JSON.stringify(t)}catch{try{return(e||this[ra])(t)}catch{return'"[unable to serialize, circular reference is too complex to analyze]"'}}}function a0(t,e,n){return{level:t,bindings:e,log:n}}function c0(t){let e=Number(t);return typeof t=="string"&&Number.isFinite(e)?e:t===void 0?1:t}Wf.exports={noop:An,buildSafeSonicBoom:vs,asChindings:n0,asJson:t0,genLog:e0,createArgsNormalizer:i0,stringify:o0,buildFormatters:a0,normalizeDestFileDescriptor:c0}});var ks=S((sR,Jf)=>{"use strict";d();var l0={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},u0={ASC:"ASC",DESC:"DESC"};Jf.exports={DEFAULT_LEVELS:l0,SORTING_ORDER:u0}});var oa=S((oR,Zf)=>{"use strict";d();var{lsCacheSym:f0,levelValSym:sa,useOnlyCustomLevelsSym:d0,streamSym:h0,formattersSym:p0,hooksSym:m0,levelCompSym:Yf}=On(),{noop:g0,genLog:Zt}=Es(),{DEFAULT_LEVELS:Ze,SORTING_ORDER:zf}=ks(),Hf={fatal:t=>{let e=Zt(Ze.fatal,t);return function(...n){let r=this[h0];if(e.call(this,...n),typeof r.flushSync=="function")try{r.flushSync()}catch{}}},error:t=>Zt(Ze.error,t),warn:t=>Zt(Ze.warn,t),info:t=>Zt(Ze.info,t),debug:t=>Zt(Ze.debug,t),trace:t=>Zt(Ze.trace,t)},ia=Object.keys(Ze).reduce((t,e)=>(t[Ze[e]]=e,t),{}),y0=Object.keys(ia).reduce((t,e)=>(t[e]='{"level":'+Number(e),t),{});function _0(t){let e=t[p0].level,{labels:n}=t.levels,r={};for(let s in n){let i=e(n[s],Number(s));r[s]=JSON.stringify(i).slice(0,-1)}return t[f0]=r,t}function w0(t,e){if(e)return!1;switch(t){case"fatal":case"error":case"warn":case"info":case"debug":case"trace":return!0;default:return!1}}function b0(t){let{labels:e,values:n}=this.levels;if(typeof t=="number"){if(e[t]===void 0)throw Error("unknown level value"+t);t=e[t]}if(n[t]===void 0)throw Error("unknown level "+t);let r=this[sa],s=this[sa]=n[t],i=this[d0],o=this[Yf],a=this[m0].logMethod;for(let c in n){if(o(n[c],s)===!1){this[c]=g0;continue}this[c]=w0(c,i)?Hf[c](a):Zt(n[c],a)}this.emit("level-change",t,s,e[r],r,this)}function v0(t){let{levels:e,levelVal:n}=this;return e&&e.labels?e.labels[n]:""}function S0(t){let{values:e}=this.levels,n=e[t];return n!==void 0&&this[Yf](n,this[sa])}function E0(t,e,n){return t===zf.DESC?e<=n:e>=n}function k0(t){return typeof t=="string"?E0.bind(null,t):t}function x0(t=null,e=!1){let n=t?Object.keys(t).reduce((i,o)=>(i[t[o]]=o,i),{}):null,r=Object.assign(Object.create(Object.prototype,{Infinity:{value:"silent"}}),e?null:ia,n),s=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),e?null:Ze,t);return{labels:r,values:s}}function T0(t,e,n){if(typeof t=="number"){if(![].concat(Object.keys(e||{}).map(i=>e[i]),n?[]:Object.keys(ia).map(i=>+i),1/0).includes(t))throw Error(`default level:${t} must be included in custom levels`);return}let r=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),n?null:Ze,e);if(!(t in r))throw Error(`default level:${t} must be included in custom levels`)}function O0(t,e){let{labels:n,values:r}=t;for(let s in e){if(s in r)throw Error("levels cannot be overridden");if(e[s]in n)throw Error("pre-existing level values cannot be used for new levels")}}function N0(t){if(typeof t!="function"&&!(typeof t=="string"&&Object.values(zf).includes(t)))throw new Error('Levels comparison should be one of "ASC", "DESC" or "function" type')}Zf.exports={initialLsCache:y0,genLsCache:_0,levelMethods:Hf,getLevel:v0,setLevel:b0,isLevelEnabled:S0,mappings:x0,assertNoLevelCollisions:O0,assertDefaultLevelFound:T0,genLevelComparison:k0,assertLevelComparison:N0}});var aa=S((cR,Xf)=>{"use strict";d();Xf.exports={version:"9.14.0"}});var od=S((fR,id)=>{"use strict";d();var{EventEmitter:A0}=X("events"),{lsCacheSym:C0,levelValSym:I0,setLevelSym:Ts,getLevelSym:Qf,chindingsSym:Os,parsedChindingsSym:P0,mixinSym:L0,asJsonSym:td,writeSym:R0,mixinMergeStrategySym:j0,timeSym:$0,timeSliceIndexSym:M0,streamSym:nd,serializersSym:Xt,formattersSym:sr,errorKeySym:q0,messageKeySym:F0,useOnlyCustomLevelsSym:B0,needsMetadataGsym:D0,redactFmtSym:U0,stringifySym:V0,formatOptsSym:K0,stringifiersSym:G0,msgPrefixSym:la,hooksSym:W0}=On(),{getLevel:J0,setLevel:Y0,isLevelEnabled:z0,mappings:H0,initialLsCache:Z0,genLsCache:X0,assertNoLevelCollisions:Q0}=oa(),{asChindings:ua,asJson:eE,buildFormatters:ca,stringify:ed,noop:rd}=Es(),{version:tE}=aa(),nE=Do(),rE=class{},sd={constructor:rE,child:sE,bindings:iE,setBindings:oE,flush:lE,isLevelEnabled:z0,version:tE,get level(){return this[Qf]()},set level(t){this[Ts](t)},get levelVal(){return this[I0]},set levelVal(t){throw Error("levelVal is read-only")},get msgPrefix(){return this[la]},get[Symbol.toStringTag](){return"Pino"},[C0]:Z0,[R0]:cE,[td]:eE,[Qf]:J0,[Ts]:Y0};Object.setPrototypeOf(sd,A0.prototype);id.exports=function(){return Object.create(sd)};var xs=t=>t;function sE(t,e){if(!t)throw Error("missing bindings for child Pino");let n=this[Xt],r=this[sr],s=Object.create(this);if(e==null)return s[sr].bindings!==xs&&(s[sr]=ca(r.level,xs,r.log)),s[Os]=ua(s,t),s[Ts](this.level),this.onChild!==rd&&this.onChild(s),s;if(e.hasOwnProperty("serializers")===!0){s[Xt]=Object.create(null);for(let u in n)s[Xt][u]=n[u];let c=Object.getOwnPropertySymbols(n);for(var i=0;i<c.length;i++){let u=c[i];s[Xt][u]=n[u]}for(let u in e.serializers)s[Xt][u]=e.serializers[u];let l=Object.getOwnPropertySymbols(e.serializers);for(var o=0;o<l.length;o++){let u=l[o];s[Xt][u]=e.serializers[u]}}else s[Xt]=n;if(e.hasOwnProperty("formatters")){let{level:c,bindings:l,log:u}=e.formatters;s[sr]=ca(c||r.level,l||xs,u||r.log)}else s[sr]=ca(r.level,xs,r.log);if(e.hasOwnProperty("customLevels")===!0&&(Q0(this.levels,e.customLevels),s.levels=H0(e.customLevels,s[B0]),X0(s)),typeof e.redact=="object"&&e.redact!==null||Array.isArray(e.redact)){s.redact=e.redact;let c=nE(s.redact,ed),l={stringify:c[U0]};s[V0]=ed,s[G0]=c,s[K0]=l}typeof e.msgPrefix=="string"&&(s[la]=(this[la]||"")+e.msgPrefix),s[Os]=ua(s,t);let a=e.level||this.level;return s[Ts](a),this.onChild(s),s}function iE(){let e=`{${this[Os].substr(1)}}`,n=JSON.parse(e);return delete n.pid,delete n.hostname,n}function oE(t){let e=ua(this,t);this[Os]=e,delete this[P0]}function aE(t,e){return Object.assign(e,t)}function cE(t,e,n){let r=this[$0](),s=this[L0],i=this[q0],o=this[F0],a=this[j0]||aE,c,l=this[W0].streamWrite;t==null?c={}:t instanceof Error?(c={[i]:t},e===void 0&&(e=t.message)):(c=t,e===void 0&&t[o]===void 0&&t[i]&&(e=t[i].message)),s&&(c=a(c,s(c,n,this)));let u=this[td](c,e,n,r),f=this[nd];f[D0]===!0&&(f.lastLevel=n,f.lastObj=c,f.lastMsg=e,f.lastTime=r.slice(this[M0]),f.lastLogger=this),f.write(l?l(u):u)}function lE(t){if(t!=null&&typeof t!="function")throw Error("callback must be a function");let e=this[nd];typeof e.flush=="function"?e.flush(t||rd):t&&t()}});var ud=S((pa,ld)=>{"use strict";d();var{hasOwnProperty:ir}=Object.prototype,en=ha();en.configure=ha;en.stringify=en;en.default=en;pa.stringify=en;pa.configure=ha;ld.exports=en;var uE=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function yt(t){return t.length<5e3&&!uE.test(t)?`"${t}"`:JSON.stringify(t)}function fa(t,e){if(t.length>200||e)return t.sort(e);for(let n=1;n<t.length;n++){let r=t[n],s=n;for(;s!==0&&t[s-1]>r;)t[s]=t[s-1],s--;t[s]=r}return t}var fE=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function da(t){return fE.call(t)!==void 0&&t.length!==0}function ad(t,e,n){t.length<n&&(n=t.length);let r=e===","?"":" ",s=`"0":${r}${t[0]}`;for(let i=1;i<n;i++)s+=`${e}"${i}":${r}${t[i]}`;return s}function dE(t){if(ir.call(t,"circularValue")){let e=t.circularValue;if(typeof e=="string")return`"${e}"`;if(e==null)return e;if(e===Error||e===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function hE(t){let e;if(ir.call(t,"deterministic")&&(e=t.deterministic,typeof e!="boolean"&&typeof e!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return e===void 0?!0:e}function pE(t,e){let n;if(ir.call(t,e)&&(n=t[e],typeof n!="boolean"))throw new TypeError(`The "${e}" argument must be of type boolean`);return n===void 0?!0:n}function cd(t,e){let n;if(ir.call(t,e)){if(n=t[e],typeof n!="number")throw new TypeError(`The "${e}" argument must be of type number`);if(!Number.isInteger(n))throw new TypeError(`The "${e}" argument must be an integer`);if(n<1)throw new RangeError(`The "${e}" argument must be >= 1`)}return n===void 0?1/0:n}function Qt(t){return t===1?"1 item":`${t} items`}function mE(t){let e=new Set;for(let n of t)(typeof n=="string"||typeof n=="number")&&e.add(String(n));return e}function gE(t){if(ir.call(t,"strict")){let e=t.strict;if(typeof e!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(e)return n=>{let r=`Object can not safely be stringified. Received type ${typeof n}`;throw typeof n!="function"&&(r+=` (${n.toString()})`),new Error(r)}}}function ha(t){t={...t};let e=gE(t);e&&(t.bigint===void 0&&(t.bigint=!1),"circularValue"in t||(t.circularValue=Error));let n=dE(t),r=pE(t,"bigint"),s=hE(t),i=typeof s=="function"?s:void 0,o=cd(t,"maximumDepth"),a=cd(t,"maximumBreadth");function c(g,p,m,y,b,v){let k=p[g];switch(typeof k=="object"&&k!==null&&typeof k.toJSON=="function"&&(k=k.toJSON(g)),k=y.call(p,g,k),typeof k){case"string":return yt(k);case"object":{if(k===null)return"null";if(m.indexOf(k)!==-1)return n;let N="",L=",",$=v;if(Array.isArray(k)){if(k.length===0)return"[]";if(o<m.length+1)return'"[Array]"';m.push(k),b!==""&&(v+=b,N+=`
5
+ ${v}`,L=`,
6
+ ${v}`);let I=Math.min(k.length,a),j=0;for(;j<I-1;j++){let J=c(String(j),k,m,y,b,v);N+=J!==void 0?J:"null",N+=L}let U=c(String(j),k,m,y,b,v);if(N+=U!==void 0?U:"null",k.length-1>a){let J=k.length-a-1;N+=`${L}"... ${Qt(J)} not stringified"`}return b!==""&&(N+=`
7
+ ${$}`),m.pop(),`[${N}]`}let F=Object.keys(k),E=F.length;if(E===0)return"{}";if(o<m.length+1)return'"[Object]"';let O="",M="";b!==""&&(v+=b,L=`,
8
+ ${v}`,O=" ");let x=Math.min(E,a);s&&!da(k)&&(F=fa(F,i)),m.push(k);for(let I=0;I<x;I++){let j=F[I],U=c(j,k,m,y,b,v);U!==void 0&&(N+=`${M}${yt(j)}:${O}${U}`,M=L)}if(E>a){let I=E-a;N+=`${M}"...":${O}"${Qt(I)} not stringified"`,M=L}return b!==""&&M.length>1&&(N=`
9
+ ${v}${N}
10
+ ${$}`),m.pop(),`{${N}}`}case"number":return isFinite(k)?String(k):e?e(k):"null";case"boolean":return k===!0?"true":"false";case"undefined":return;case"bigint":if(r)return String(k);default:return e?e(k):void 0}}function l(g,p,m,y,b,v){switch(typeof p=="object"&&p!==null&&typeof p.toJSON=="function"&&(p=p.toJSON(g)),typeof p){case"string":return yt(p);case"object":{if(p===null)return"null";if(m.indexOf(p)!==-1)return n;let k=v,N="",L=",";if(Array.isArray(p)){if(p.length===0)return"[]";if(o<m.length+1)return'"[Array]"';m.push(p),b!==""&&(v+=b,N+=`
11
+ ${v}`,L=`,
12
+ ${v}`);let E=Math.min(p.length,a),O=0;for(;O<E-1;O++){let x=l(String(O),p[O],m,y,b,v);N+=x!==void 0?x:"null",N+=L}let M=l(String(O),p[O],m,y,b,v);if(N+=M!==void 0?M:"null",p.length-1>a){let x=p.length-a-1;N+=`${L}"... ${Qt(x)} not stringified"`}return b!==""&&(N+=`
13
+ ${k}`),m.pop(),`[${N}]`}m.push(p);let $="";b!==""&&(v+=b,L=`,
14
+ ${v}`,$=" ");let F="";for(let E of y){let O=l(E,p[E],m,y,b,v);O!==void 0&&(N+=`${F}${yt(E)}:${$}${O}`,F=L)}return b!==""&&F.length>1&&(N=`
15
+ ${v}${N}
16
+ ${k}`),m.pop(),`{${N}}`}case"number":return isFinite(p)?String(p):e?e(p):"null";case"boolean":return p===!0?"true":"false";case"undefined":return;case"bigint":if(r)return String(p);default:return e?e(p):void 0}}function u(g,p,m,y,b){switch(typeof p){case"string":return yt(p);case"object":{if(p===null)return"null";if(typeof p.toJSON=="function"){if(p=p.toJSON(g),typeof p!="object")return u(g,p,m,y,b);if(p===null)return"null"}if(m.indexOf(p)!==-1)return n;let v=b;if(Array.isArray(p)){if(p.length===0)return"[]";if(o<m.length+1)return'"[Array]"';m.push(p),b+=y;let O=`
17
+ ${b}`,M=`,
18
+ ${b}`,x=Math.min(p.length,a),I=0;for(;I<x-1;I++){let U=u(String(I),p[I],m,y,b);O+=U!==void 0?U:"null",O+=M}let j=u(String(I),p[I],m,y,b);if(O+=j!==void 0?j:"null",p.length-1>a){let U=p.length-a-1;O+=`${M}"... ${Qt(U)} not stringified"`}return O+=`
19
+ ${v}`,m.pop(),`[${O}]`}let k=Object.keys(p),N=k.length;if(N===0)return"{}";if(o<m.length+1)return'"[Object]"';b+=y;let L=`,
20
+ ${b}`,$="",F="",E=Math.min(N,a);da(p)&&($+=ad(p,L,a),k=k.slice(p.length),E-=p.length,F=L),s&&(k=fa(k,i)),m.push(p);for(let O=0;O<E;O++){let M=k[O],x=u(M,p[M],m,y,b);x!==void 0&&($+=`${F}${yt(M)}: ${x}`,F=L)}if(N>a){let O=N-a;$+=`${F}"...": "${Qt(O)} not stringified"`,F=L}return F!==""&&($=`
21
+ ${b}${$}
22
+ ${v}`),m.pop(),`{${$}}`}case"number":return isFinite(p)?String(p):e?e(p):"null";case"boolean":return p===!0?"true":"false";case"undefined":return;case"bigint":if(r)return String(p);default:return e?e(p):void 0}}function f(g,p,m){switch(typeof p){case"string":return yt(p);case"object":{if(p===null)return"null";if(typeof p.toJSON=="function"){if(p=p.toJSON(g),typeof p!="object")return f(g,p,m);if(p===null)return"null"}if(m.indexOf(p)!==-1)return n;let y="",b=p.length!==void 0;if(b&&Array.isArray(p)){if(p.length===0)return"[]";if(o<m.length+1)return'"[Array]"';m.push(p);let $=Math.min(p.length,a),F=0;for(;F<$-1;F++){let O=f(String(F),p[F],m);y+=O!==void 0?O:"null",y+=","}let E=f(String(F),p[F],m);if(y+=E!==void 0?E:"null",p.length-1>a){let O=p.length-a-1;y+=`,"... ${Qt(O)} not stringified"`}return m.pop(),`[${y}]`}let v=Object.keys(p),k=v.length;if(k===0)return"{}";if(o<m.length+1)return'"[Object]"';let N="",L=Math.min(k,a);b&&da(p)&&(y+=ad(p,",",a),v=v.slice(p.length),L-=p.length,N=","),s&&(v=fa(v,i)),m.push(p);for(let $=0;$<L;$++){let F=v[$],E=f(F,p[F],m);E!==void 0&&(y+=`${N}${yt(F)}:${E}`,N=",")}if(k>a){let $=k-a;y+=`${N}"...":"${Qt($)} not stringified"`}return m.pop(),`{${y}}`}case"number":return isFinite(p)?String(p):e?e(p):"null";case"boolean":return p===!0?"true":"false";case"undefined":return;case"bigint":if(r)return String(p);default:return e?e(p):void 0}}function h(g,p,m){if(arguments.length>1){let y="";if(typeof m=="number"?y=" ".repeat(Math.min(m,10)):typeof m=="string"&&(y=m.slice(0,10)),p!=null){if(typeof p=="function")return c("",{"":g},[],p,y,"");if(Array.isArray(p))return l("",g,[],mE(p),y,"")}if(y.length!==0)return u("",g,[],y,"")}return f("",g,[])}return h}});var pd=S((pR,hd)=>{"use strict";d();var ma=Symbol.for("pino.metadata"),{DEFAULT_LEVELS:dd}=ks(),yE=dd.info;function _E(t,e){t=t||[],e=e||{dedupe:!1};let n=Object.create(dd);n.silent=1/0,e.levels&&typeof e.levels=="object"&&Object.keys(e.levels).forEach(f=>{n[f]=e.levels[f]});let r={write:s,add:a,remove:c,emit:i,flushSync:o,end:l,minLevel:0,lastId:0,streams:[],clone:u,[ma]:!0,streamLevels:n};return Array.isArray(t)?t.forEach(a,r):a.call(r,t),t=null,r;function s(f){let h,g=this.lastLevel,{streams:p}=this,m=0,y;for(let b=wE(p.length,e.dedupe);vE(b,p.length,e.dedupe);b=bE(b,e.dedupe))if(h=p[b],h.level<=g){if(m!==0&&m!==h.level)break;if(y=h.stream,y[ma]){let{lastTime:v,lastMsg:k,lastObj:N,lastLogger:L}=this;y.lastLevel=g,y.lastTime=v,y.lastMsg=k,y.lastObj=N,y.lastLogger=L}y.write(f),e.dedupe&&(m=h.level)}else if(!e.dedupe)break}function i(...f){for(let{stream:h}of this.streams)typeof h.emit=="function"&&h.emit(...f)}function o(){for(let{stream:f}of this.streams)typeof f.flushSync=="function"&&f.flushSync()}function a(f){if(!f)return r;let h=typeof f.write=="function"||f.stream,g=f.write?f:f.stream;if(!h)throw Error("stream object needs to implement either StreamEntry or DestinationStream interface");let{streams:p,streamLevels:m}=this,y;typeof f.levelVal=="number"?y=f.levelVal:typeof f.level=="string"?y=m[f.level]:typeof f.level=="number"?y=f.level:y=yE;let b={stream:g,level:y,levelVal:void 0,id:++r.lastId};return p.unshift(b),p.sort(fd),this.minLevel=p[0].level,r}function c(f){let{streams:h}=this,g=h.findIndex(p=>p.id===f);return g>=0&&(h.splice(g,1),h.sort(fd),this.minLevel=h.length>0?h[0].level:-1),r}function l(){for(let{stream:f}of this.streams)typeof f.flushSync=="function"&&f.flushSync(),f.end()}function u(f){let h=new Array(this.streams.length);for(let g=0;g<h.length;g++)h[g]={level:f,stream:this.streams[g].stream};return{write:s,add:a,remove:c,minLevel:f,streams:h,clone:u,emit:i,flushSync:o,[ma]:!0}}}function fd(t,e){return t.level-e.level}function wE(t,e){return e?t-1:0}function bE(t,e){return e?t-1:t+1}function vE(t,e,n){return n?t>=0:t<e}hd.exports=_E});var Nd=S((gR,Le)=>{"use strict";d();var SE=X("os"),Sd=Mo(),EE=qo(),kE=Do(),Ed=af(),xE=od(),kd=On(),{configure:TE}=ud(),{assertDefaultLevelFound:OE,mappings:xd,genLsCache:NE,genLevelComparison:AE,assertLevelComparison:CE}=oa(),{DEFAULT_LEVELS:Td,SORTING_ORDER:IE}=ks(),{createArgsNormalizer:PE,asChindings:LE,buildSafeSonicBoom:md,buildFormatters:RE,stringify:ga,normalizeDestFileDescriptor:gd,noop:jE}=Es(),{version:$E}=aa(),{chindingsSym:yd,redactFmtSym:ME,serializersSym:_d,timeSym:qE,timeSliceIndexSym:FE,streamSym:BE,stringifySym:wd,stringifySafeSym:ya,stringifiersSym:bd,setLevelSym:DE,endSym:UE,formatOptsSym:VE,messageKeySym:KE,errorKeySym:GE,nestedKeySym:WE,mixinSym:JE,levelCompSym:YE,useOnlyCustomLevelsSym:zE,formattersSym:vd,hooksSym:HE,nestedKeyStrSym:ZE,mixinMergeStrategySym:XE,msgPrefixSym:QE}=kd,{epochTime:Od,nullTime:ek}=Ed,{pid:tk}=process,nk=SE.hostname(),rk=Sd.err,sk={level:"info",levelComparison:IE.ASC,levels:Td,messageKey:"msg",errorKey:"err",nestedKey:null,enabled:!0,base:{pid:tk,hostname:nk},serializers:Object.assign(Object.create(null),{err:rk}),formatters:Object.assign(Object.create(null),{bindings(t){return t},level(t,e){return{level:e}}}),hooks:{logMethod:void 0,streamWrite:void 0},timestamp:Od,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100},ik=PE(sk),ok=Object.assign(Object.create(null),Sd);function _a(...t){let e={},{opts:n,stream:r}=ik(e,EE(),...t);n.level&&typeof n.level=="string"&&Td[n.level.toLowerCase()]!==void 0&&(n.level=n.level.toLowerCase());let{redact:s,crlf:i,serializers:o,timestamp:a,messageKey:c,errorKey:l,nestedKey:u,base:f,name:h,level:g,customLevels:p,levelComparison:m,mixin:y,mixinMergeStrategy:b,useOnlyCustomLevels:v,formatters:k,hooks:N,depthLimit:L,edgeLimit:$,onChild:F,msgPrefix:E}=n,O=TE({maximumDepth:L,maximumBreadth:$}),M=RE(k.level,k.bindings,k.log),x=ga.bind({[ya]:O}),I=s?kE(s,x):{},j=s?{stringify:I[ME]}:{stringify:x},U="}"+(i?`\r
23
+ `:`
24
+ `),J=LE.bind(null,{[yd]:"",[_d]:o,[bd]:I,[wd]:ga,[ya]:O,[vd]:M}),D="";f!==null&&(h===void 0?D=J(f):D=J(Object.assign({},f,{name:h})));let Q=a instanceof Function?a:a?Od:ek,re=Q().indexOf(":")+1;if(v&&!p)throw Error("customLevels is required if useOnlyCustomLevels is set true");if(y&&typeof y!="function")throw Error(`Unknown mixin type "${typeof y}" - expected "function"`);if(E&&typeof E!="string")throw Error(`Unknown msgPrefix type "${typeof E}" - expected "string"`);OE(g,p,v);let ne=xd(p,v);typeof r.emit=="function"&&r.emit("message",{code:"PINO_CONFIG",config:{levels:ne,messageKey:c,errorKey:l}}),CE(m);let Xr=AE(m);return Object.assign(e,{levels:ne,[YE]:Xr,[zE]:v,[BE]:r,[qE]:Q,[FE]:re,[wd]:ga,[ya]:O,[bd]:I,[UE]:U,[VE]:j,[KE]:c,[GE]:l,[WE]:u,[ZE]:u?`,${JSON.stringify(u)}:{`:"",[_d]:o,[JE]:y,[XE]:b,[yd]:D,[vd]:M,[HE]:N,silent:jE,onChild:F,[QE]:E}),Object.setPrototypeOf(e,xE()),NE(e),e[DE](g),e}Le.exports=_a;Le.exports.destination=(t=process.stdout.fd)=>typeof t=="object"?(t.dest=gd(t.dest||process.stdout.fd),md(t)):md({dest:gd(t),minLength:0});Le.exports.transport=ea();Le.exports.multistream=pd();Le.exports.levels=xd();Le.exports.stdSerializers=ok;Le.exports.stdTimeFunctions=Object.assign({},Ed);Le.exports.symbols=kd;Le.exports.version=$E;Le.exports.default=_a;Le.exports.pino=_a});var Pd=S(Cn=>{"use strict";d();var ak=Cn&&Cn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Cn,"__esModule",{value:!0});Cn.createMcpLogger=Id;Cn.createLogger=Id;var Ad=ak(Nd()),Cd=Oo(),ck=["password","token","accessToken","access_token","refreshToken","refresh_token","apiKey","api_key","secret","TOOLPILOT_API_KEY","authorization","cookie","*.password","*.token","*.secret","*.apiKey","*.api_key"];function Id(t){let e=t.level??process.env.LOG_LEVEL??(process.env.NODE_ENV!=="production"?"debug":"info"),n={name:t.name,level:e,serializers:{err:Cd.errorSerializer,error:Cd.errorSerializer},redact:{paths:ck,censor:"[REDACTED]"},timestamp:Ad.default.stdTimeFunctions.isoTime,base:{pid:process.pid,...t.defaultFields}};return(0,Ad.default)(n,process.stderr)}});var Ld=S(wa=>{"use strict";d();Object.defineProperty(wa,"__esModule",{value:!0});wa.withErrorHandling=fk;var lk=is(),uk=os();function fk(t,e,n){return async r=>{try{return await n(r)}catch(s){if(s instanceof uk.AppError){let i=s.severity==="critical"||s.severity==="high"?"error":"warn";return e[i]({err:s,tool:t},`Tool ${t} failed: ${s.message}`),{content:[{type:"text",text:JSON.stringify({ok:!1,error:s.code,message:s.isOperational?s.message:"An internal error occurred"})}],isError:!0}}return e.error({err:s,tool:t},`Unexpected error in tool ${t}`),{content:[{type:"text",text:JSON.stringify({ok:!1,error:lk.ErrorCode.ERR_MCP_HANDLER,message:s instanceof Error?s.message:String(s)})}],isError:!0}}}}});var oe=S(ee=>{"use strict";d();Object.defineProperty(ee,"__esModule",{value:!0});ee.withErrorHandling=ee.createLogger=ee.createMcpLogger=ee.errorSerializer=ee.VectorError=ee.IndexerError=ee.SearchError=ee.QueueError=ee.ExternalServiceError=ee.AuthError=ee.ValidationError=ee.NetworkError=ee.DatabaseError=ee.AppError=ee.ErrorCode=void 0;var dk=is();Object.defineProperty(ee,"ErrorCode",{enumerable:!0,get:function(){return dk.ErrorCode}});var Xe=os();Object.defineProperty(ee,"AppError",{enumerable:!0,get:function(){return Xe.AppError}});Object.defineProperty(ee,"DatabaseError",{enumerable:!0,get:function(){return Xe.DatabaseError}});Object.defineProperty(ee,"NetworkError",{enumerable:!0,get:function(){return Xe.NetworkError}});Object.defineProperty(ee,"ValidationError",{enumerable:!0,get:function(){return Xe.ValidationError}});Object.defineProperty(ee,"AuthError",{enumerable:!0,get:function(){return Xe.AuthError}});Object.defineProperty(ee,"ExternalServiceError",{enumerable:!0,get:function(){return Xe.ExternalServiceError}});Object.defineProperty(ee,"QueueError",{enumerable:!0,get:function(){return Xe.QueueError}});Object.defineProperty(ee,"SearchError",{enumerable:!0,get:function(){return Xe.SearchError}});Object.defineProperty(ee,"IndexerError",{enumerable:!0,get:function(){return Xe.IndexerError}});Object.defineProperty(ee,"VectorError",{enumerable:!0,get:function(){return Xe.VectorError}});var hk=Oo();Object.defineProperty(ee,"errorSerializer",{enumerable:!0,get:function(){return hk.errorSerializer}});var Rd=Pd();Object.defineProperty(ee,"createMcpLogger",{enumerable:!0,get:function(){return Rd.createMcpLogger}});Object.defineProperty(ee,"createLogger",{enumerable:!0,get:function(){return Rd.createLogger}});var pk=Ld();Object.defineProperty(ee,"withErrorHandling",{enumerable:!0,get:function(){return pk.withErrorHandling}})});var Z=S(ye=>{"use strict";d();var Na=Symbol.for("yaml.alias"),oh=Symbol.for("yaml.document"),Rs=Symbol.for("yaml.map"),ah=Symbol.for("yaml.pair"),Aa=Symbol.for("yaml.scalar"),js=Symbol.for("yaml.seq"),ut=Symbol.for("yaml.node.type"),Hk=t=>!!t&&typeof t=="object"&&t[ut]===Na,Zk=t=>!!t&&typeof t=="object"&&t[ut]===oh,Xk=t=>!!t&&typeof t=="object"&&t[ut]===Rs,Qk=t=>!!t&&typeof t=="object"&&t[ut]===ah,ch=t=>!!t&&typeof t=="object"&&t[ut]===Aa,ex=t=>!!t&&typeof t=="object"&&t[ut]===js;function lh(t){if(t&&typeof t=="object")switch(t[ut]){case Rs:case js:return!0}return!1}function tx(t){if(t&&typeof t=="object")switch(t[ut]){case Na:case Rs:case Aa:case js:return!0}return!1}var nx=t=>(ch(t)||lh(t))&&!!t.anchor;ye.ALIAS=Na;ye.DOC=oh;ye.MAP=Rs;ye.NODE_TYPE=ut;ye.PAIR=ah;ye.SCALAR=Aa;ye.SEQ=js;ye.hasAnchor=nx;ye.isAlias=Hk;ye.isCollection=lh;ye.isDocument=Zk;ye.isMap=Xk;ye.isNode=tx;ye.isPair=Qk;ye.isScalar=ch;ye.isSeq=ex});var lr=S(Ca=>{"use strict";d();var pe=Z(),ke=Symbol("break visit"),uh=Symbol("skip children"),Qe=Symbol("remove node");function $s(t,e){let n=fh(e);pe.isDocument(t)?Pn(null,t.contents,n,Object.freeze([t]))===Qe&&(t.contents=null):Pn(null,t,n,Object.freeze([]))}$s.BREAK=ke;$s.SKIP=uh;$s.REMOVE=Qe;function Pn(t,e,n,r){let s=dh(t,e,n,r);if(pe.isNode(s)||pe.isPair(s))return hh(t,r,s),Pn(t,s,n,r);if(typeof s!="symbol"){if(pe.isCollection(e)){r=Object.freeze(r.concat(e));for(let i=0;i<e.items.length;++i){let o=Pn(i,e.items[i],n,r);if(typeof o=="number")i=o-1;else{if(o===ke)return ke;o===Qe&&(e.items.splice(i,1),i-=1)}}}else if(pe.isPair(e)){r=Object.freeze(r.concat(e));let i=Pn("key",e.key,n,r);if(i===ke)return ke;i===Qe&&(e.key=null);let o=Pn("value",e.value,n,r);if(o===ke)return ke;o===Qe&&(e.value=null)}}return s}async function Ms(t,e){let n=fh(e);pe.isDocument(t)?await Ln(null,t.contents,n,Object.freeze([t]))===Qe&&(t.contents=null):await Ln(null,t,n,Object.freeze([]))}Ms.BREAK=ke;Ms.SKIP=uh;Ms.REMOVE=Qe;async function Ln(t,e,n,r){let s=await dh(t,e,n,r);if(pe.isNode(s)||pe.isPair(s))return hh(t,r,s),Ln(t,s,n,r);if(typeof s!="symbol"){if(pe.isCollection(e)){r=Object.freeze(r.concat(e));for(let i=0;i<e.items.length;++i){let o=await Ln(i,e.items[i],n,r);if(typeof o=="number")i=o-1;else{if(o===ke)return ke;o===Qe&&(e.items.splice(i,1),i-=1)}}}else if(pe.isPair(e)){r=Object.freeze(r.concat(e));let i=await Ln("key",e.key,n,r);if(i===ke)return ke;i===Qe&&(e.key=null);let o=await Ln("value",e.value,n,r);if(o===ke)return ke;o===Qe&&(e.value=null)}}return s}function fh(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function dh(t,e,n,r){if(typeof n=="function")return n(t,e,r);if(pe.isMap(e))return n.Map?.(t,e,r);if(pe.isSeq(e))return n.Seq?.(t,e,r);if(pe.isPair(e))return n.Pair?.(t,e,r);if(pe.isScalar(e))return n.Scalar?.(t,e,r);if(pe.isAlias(e))return n.Alias?.(t,e,r)}function hh(t,e,n){let r=e[e.length-1];if(pe.isCollection(r))r.items[t]=n;else if(pe.isPair(r))t==="key"?r.key=n:r.value=n;else if(pe.isDocument(r))r.contents=n;else{let s=pe.isAlias(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${s} parent`)}}Ca.visit=$s;Ca.visitAsync=Ms});var Ia=S(mh=>{"use strict";d();var ph=Z(),rx=lr(),sx={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},ix=t=>t.replace(/[!,[\]{}]/g,e=>sx[e]),ur=class t{constructor(e,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,n)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,n){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let r=e.trim().split(/[ \t]+/),s=r.shift();switch(s){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;let[i,o]=r;return this.tags[i]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[i]=r;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;{let o=/^\d+\.\d+$/.test(i);return n(6,`Unsupported YAML version ${i}`,o),!1}}default:return n(0,`Unknown directive ${s}`,!0),!1}}tagName(e,n){if(e==="!")return"!";if(e[0]!=="!")return n(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}let[,r,s]=e.match(/^(.*!)([^!]*)$/s);s||n(`The ${e} tag has no suffix`);let i=this.tags[r];if(i)try{return i+decodeURIComponent(s)}catch(o){return n(String(o)),null}return r==="!"?e:(n(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[n,r]of Object.entries(this.tags))if(e.startsWith(r))return n+ix(e.substring(r.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags),s;if(e&&r.length>0&&ph.isNode(e.contents)){let i={};rx.visit(e.contents,(o,a)=>{ph.isNode(a)&&a.tag&&(i[a.tag]=!0)}),s=Object.keys(i)}else s=[];for(let[i,o]of r)i==="!!"&&o==="tag:yaml.org,2002:"||(!e||s.some(a=>a.startsWith(o)))&&n.push(`%TAG ${i} ${o}`);return n.join(`
25
+ `)}};ur.defaultYaml={explicit:!1,version:"1.2"};ur.defaultTags={"!!":"tag:yaml.org,2002:"};mh.Directives=ur});var qs=S(fr=>{"use strict";d();var gh=Z(),ox=lr();function ax(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(n)}return!0}function yh(t){let e=new Set;return ox.visit(t,{Value(n,r){r.anchor&&e.add(r.anchor)}}),e}function _h(t,e){for(let n=1;;++n){let r=`${t}${n}`;if(!e.has(r))return r}}function cx(t,e){let n=[],r=new Map,s=null;return{onAnchor:i=>{n.push(i),s??(s=yh(t));let o=_h(e,s);return s.add(o),o},setAnchors:()=>{for(let i of n){let o=r.get(i);if(typeof o=="object"&&o.anchor&&(gh.isScalar(o.node)||gh.isCollection(o.node)))o.node.anchor=o.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=i,a}}},sourceObjects:r}}fr.anchorIsValid=ax;fr.anchorNames=yh;fr.createNodeAnchors=cx;fr.findNewAnchor=_h});var Pa=S(wh=>{"use strict";d();function dr(t,e,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let s=0,i=r.length;s<i;++s){let o=r[s],a=dr(t,r,String(s),o);a===void 0?delete r[s]:a!==o&&(r[s]=a)}else if(r instanceof Map)for(let s of Array.from(r.keys())){let i=r.get(s),o=dr(t,r,s,i);o===void 0?r.delete(s):o!==i&&r.set(s,o)}else if(r instanceof Set)for(let s of Array.from(r)){let i=dr(t,r,s,s);i===void 0?r.delete(s):i!==s&&(r.delete(s),r.add(i))}else for(let[s,i]of Object.entries(r)){let o=dr(t,r,s,i);o===void 0?delete r[s]:o!==i&&(r[s]=o)}return t.call(e,n,r)}wh.applyReviver=dr});var _t=S(vh=>{"use strict";d();var lx=Z();function bh(t,e,n){if(Array.isArray(t))return t.map((r,s)=>bh(r,String(s),n));if(t&&typeof t.toJSON=="function"){if(!n||!lx.hasAnchor(t))return t.toJSON(e,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(t,r),n.onCreate=i=>{r.res=i,delete n.onCreate};let s=t.toJSON(e,n);return n.onCreate&&n.onCreate(s),s}return typeof t=="bigint"&&!n?.keep?Number(t):t}vh.toJS=bh});var Fs=S(Eh=>{"use strict";d();var ux=Pa(),Sh=Z(),fx=_t(),La=class{constructor(e){Object.defineProperty(this,Sh.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:n,maxAliasCount:r,onAnchor:s,reviver:i}={}){if(!Sh.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},a=fx.toJS(this,"",o);if(typeof s=="function")for(let{count:c,res:l}of o.anchors.values())s(l,c);return typeof i=="function"?ux.applyReviver(i,{"":a},"",a):a}};Eh.NodeBase=La});var hr=S(kh=>{"use strict";d();var dx=qs(),hx=lr(),Rn=Z(),px=Fs(),mx=_t(),Ra=class extends px.NodeBase{constructor(e){super(Rn.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,n){let r;n?.aliasResolveCache?r=n.aliasResolveCache:(r=[],hx.visit(e,{Node:(i,o)=>{(Rn.isAlias(o)||Rn.hasAnchor(o))&&r.push(o)}}),n&&(n.aliasResolveCache=r));let s;for(let i of r){if(i===this)break;i.anchor===this.source&&(s=i)}return s}toJSON(e,n){if(!n)return{source:this.source};let{anchors:r,doc:s,maxAliasCount:i}=n,o=this.resolve(s,n);if(!o){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=r.get(o);if(a||(mx.toJS(o,null,n),a=r.get(o)),a?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=Bs(s,o,r)),a.count*a.aliasCount>i)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(e,n,r){let s=`*${this.source}`;if(e){if(dx.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(i)}if(e.implicitKey)return`${s} `}return s}};function Bs(t,e,n){if(Rn.isAlias(e)){let r=e.resolve(t),s=n&&r&&n.get(r);return s?s.count*s.aliasCount:0}else if(Rn.isCollection(e)){let r=0;for(let s of e.items){let i=Bs(t,s,n);i>r&&(r=i)}return r}else if(Rn.isPair(e)){let r=Bs(t,e.key,n),s=Bs(t,e.value,n);return Math.max(r,s)}return 1}kh.Alias=Ra});var he=S(ja=>{"use strict";d();var gx=Z(),yx=Fs(),_x=_t(),wx=t=>!t||typeof t!="function"&&typeof t!="object",wt=class extends yx.NodeBase{constructor(e){super(gx.SCALAR),this.value=e}toJSON(e,n){return n?.keep?this.value:_x.toJS(this.value,e,n)}toString(){return String(this.value)}};wt.BLOCK_FOLDED="BLOCK_FOLDED";wt.BLOCK_LITERAL="BLOCK_LITERAL";wt.PLAIN="PLAIN";wt.QUOTE_DOUBLE="QUOTE_DOUBLE";wt.QUOTE_SINGLE="QUOTE_SINGLE";ja.Scalar=wt;ja.isScalarValue=wx});var pr=S(Th=>{"use strict";d();var bx=hr(),nn=Z(),xh=he(),vx="tag:yaml.org,2002:";function Sx(t,e,n){if(e){let r=n.filter(i=>i.tag===e),s=r.find(i=>!i.format)??r[0];if(!s)throw new Error(`Tag ${e} not found`);return s}return n.find(r=>r.identify?.(t)&&!r.format)}function Ex(t,e,n){if(nn.isDocument(t)&&(t=t.contents),nn.isNode(t))return t;if(nn.isPair(t)){let f=n.schema[nn.MAP].createNode?.(n.schema,null,n);return f.items.push(t),f}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:r,onAnchor:s,onTagObj:i,schema:o,sourceObjects:a}=n,c;if(r&&t&&typeof t=="object"){if(c=a.get(t),c)return c.anchor??(c.anchor=s(t)),new bx.Alias(c.anchor);c={anchor:null,node:null},a.set(t,c)}e?.startsWith("!!")&&(e=vx+e.slice(2));let l=Sx(t,e,o.tags);if(!l){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let f=new xh.Scalar(t);return c&&(c.node=f),f}l=t instanceof Map?o[nn.MAP]:Symbol.iterator in Object(t)?o[nn.SEQ]:o[nn.MAP]}i&&(i(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,t,n):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(n.schema,t,n):new xh.Scalar(t);return e?u.tag=e:l.default||(u.tag=l.tag),c&&(c.node=u),u}Th.createNode=Ex});var Us=S(Ds=>{"use strict";d();var kx=pr(),et=Z(),xx=Fs();function $a(t,e,n){let r=n;for(let s=e.length-1;s>=0;--s){let i=e[s];if(typeof i=="number"&&Number.isInteger(i)&&i>=0){let o=[];o[i]=r,r=o}else r=new Map([[i,r]])}return kx.createNode(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var Oh=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,Ma=class extends xx.NodeBase{constructor(e,n){super(e),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(e){let n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(n.schema=e),n.items=n.items.map(r=>et.isNode(r)||et.isPair(r)?r.clone(e):r),this.range&&(n.range=this.range.slice()),n}addIn(e,n){if(Oh(e))this.add(n);else{let[r,...s]=e,i=this.get(r,!0);if(et.isCollection(i))i.addIn(s,n);else if(i===void 0&&this.schema)this.set(r,$a(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}deleteIn(e){let[n,...r]=e;if(r.length===0)return this.delete(n);let s=this.get(n,!0);if(et.isCollection(s))return s.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(e,n){let[r,...s]=e,i=this.get(r,!0);return s.length===0?!n&&et.isScalar(i)?i.value:i:et.isCollection(i)?i.getIn(s,n):void 0}hasAllNullValues(e){return this.items.every(n=>{if(!et.isPair(n))return!1;let r=n.value;return r==null||e&&et.isScalar(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){let[n,...r]=e;if(r.length===0)return this.has(n);let s=this.get(n,!0);return et.isCollection(s)?s.hasIn(r):!1}setIn(e,n){let[r,...s]=e;if(s.length===0)this.set(r,n);else{let i=this.get(r,!0);if(et.isCollection(i))i.setIn(s,n);else if(i===void 0&&this.schema)this.set(r,$a(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}};Ds.Collection=Ma;Ds.collectionFromPath=$a;Ds.isEmptyPath=Oh});var mr=S(Vs=>{"use strict";d();var Tx=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function qa(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var Ox=(t,e,n)=>t.endsWith(`
26
+ `)?qa(n,e):n.includes(`
27
+ `)?`
28
+ `+qa(n,e):(t.endsWith(" ")?"":" ")+n;Vs.indentComment=qa;Vs.lineComment=Ox;Vs.stringifyComment=Tx});var Ah=S(gr=>{"use strict";d();var Nx="flow",Fa="block",Ks="quoted";function Ax(t,e,n="flow",{indentAtStart:r,lineWidth:s=80,minContentWidth:i=20,onFold:o,onOverflow:a}={}){if(!s||s<0)return t;s<i&&(i=0);let c=Math.max(1+i,1+s-e.length);if(t.length<=c)return t;let l=[],u={},f=s-e.length;typeof r=="number"&&(r>s-Math.max(2,i)?l.push(0):f=s-r);let h,g,p=!1,m=-1,y=-1,b=-1;n===Fa&&(m=Nh(t,m,e.length),m!==-1&&(f=m+c));for(let k;k=t[m+=1];){if(n===Ks&&k==="\\"){switch(y=m,t[m+1]){case"x":m+=3;break;case"u":m+=5;break;case"U":m+=9;break;default:m+=1}b=m}if(k===`
29
+ `)n===Fa&&(m=Nh(t,m,e.length)),f=m+e.length+c,h=void 0;else{if(k===" "&&g&&g!==" "&&g!==`
30
+ `&&g!==" "){let N=t[m+1];N&&N!==" "&&N!==`
31
+ `&&N!==" "&&(h=m)}if(m>=f)if(h)l.push(h),f=h+c,h=void 0;else if(n===Ks){for(;g===" "||g===" ";)g=k,k=t[m+=1],p=!0;let N=m>b+1?m-2:y-1;if(u[N])return t;l.push(N),u[N]=!0,f=N+c,h=void 0}else p=!0}g=k}if(p&&a&&a(),l.length===0)return t;o&&o();let v=t.slice(0,l[0]);for(let k=0;k<l.length;++k){let N=l[k],L=l[k+1]||t.length;N===0?v=`
32
+ ${e}${t.slice(0,L)}`:(n===Ks&&u[N]&&(v+=`${t[N]}\\`),v+=`
33
+ ${e}${t.slice(N+1,L)}`)}return v}function Nh(t,e,n){let r=e,s=e+1,i=t[s];for(;i===" "||i===" ";)if(e<s+n)i=t[++e];else{do i=t[++e];while(i&&i!==`
34
+ `);r=e,s=e+1,i=t[s]}return r}gr.FOLD_BLOCK=Fa;gr.FOLD_FLOW=Nx;gr.FOLD_QUOTED=Ks;gr.foldFlowLines=Ax});var _r=S(Ch=>{"use strict";d();var Ve=he(),bt=Ah(),Ws=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),Js=t=>/^(%|---|\.\.\.)/m.test(t);function Cx(t,e,n){if(!e||e<0)return!1;let r=e-n,s=t.length;if(s<=r)return!1;for(let i=0,o=0;i<s;++i)if(t[i]===`
35
+ `){if(i-o>r)return!0;if(o=i+1,s-o<=r)return!1}return!0}function yr(t,e){let n=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=e,s=e.options.doubleQuotedMinMultiLineLength,i=e.indent||(Js(t)?" ":""),o="",a=0;for(let c=0,l=n[c];l;l=n[++c])if(l===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(o+=n.slice(a,c)+"\\ ",c+=1,a=c,l="\\"),l==="\\")switch(n[c+1]){case"u":{o+=n.slice(a,c);let u=n.substr(c+2,4);switch(u){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:u.substr(0,2)==="00"?o+="\\x"+u.substr(2):o+=n.substr(c,6)}c+=5,a=c+1}break;case"n":if(r||n[c+2]==='"'||n.length<s)c+=1;else{for(o+=n.slice(a,c)+`
36
+
37
+ `;n[c+2]==="\\"&&n[c+3]==="n"&&n[c+4]!=='"';)o+=`
38
+ `,c+=2;o+=i,n[c+2]===" "&&(o+="\\"),c+=1,a=c+1}break;default:c+=1}return o=a?o+n.slice(a):n,r?o:bt.foldFlowLines(o,i,bt.FOLD_QUOTED,Ws(e,!1))}function Ba(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
39
+ `)||/[ \t]\n|\n[ \t]/.test(t))return yr(t,e);let n=e.indent||(Js(t)?" ":""),r="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
40
+ ${n}`)+"'";return e.implicitKey?r:bt.foldFlowLines(r,n,bt.FOLD_FLOW,Ws(e,!1))}function jn(t,e){let{singleQuote:n}=e.options,r;if(n===!1)r=yr;else{let s=t.includes('"'),i=t.includes("'");s&&!i?r=Ba:i&&!s?r=yr:r=n?Ba:yr}return r(t,e)}var Da;try{Da=new RegExp(`(^|(?<!
41
+ ))
42
+ +(?!
43
+ |$)`,"g")}catch{Da=/\n+(?!\n|$)/g}function Gs({comment:t,type:e,value:n},r,s,i){let{blockQuote:o,commentString:a,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return jn(n,r);let l=r.indent||(r.forceBlockIndent||Js(n)?" ":""),u=o==="literal"?!0:o==="folded"||e===Ve.Scalar.BLOCK_FOLDED?!1:e===Ve.Scalar.BLOCK_LITERAL?!0:!Cx(n,c,l.length);if(!n)return u?`|
44
+ `:`>
45
+ `;let f,h;for(h=n.length;h>0;--h){let L=n[h-1];if(L!==`
46
+ `&&L!==" "&&L!==" ")break}let g=n.substring(h),p=g.indexOf(`
47
+ `);p===-1?f="-":n===g||p!==g.length-1?(f="+",i&&i()):f="",g&&(n=n.slice(0,-g.length),g[g.length-1]===`
48
+ `&&(g=g.slice(0,-1)),g=g.replace(Da,`$&${l}`));let m=!1,y,b=-1;for(y=0;y<n.length;++y){let L=n[y];if(L===" ")m=!0;else if(L===`
49
+ `)b=y;else break}let v=n.substring(0,b<y?b+1:y);v&&(n=n.substring(v.length),v=v.replace(/\n+/g,`$&${l}`));let N=(m?l?"2":"1":"")+f;if(t&&(N+=" "+a(t.replace(/ ?[\r\n]+/g," ")),s&&s()),!u){let L=n.replace(/\n+/g,`
50
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),$=!1,F=Ws(r,!0);o!=="folded"&&e!==Ve.Scalar.BLOCK_FOLDED&&(F.onOverflow=()=>{$=!0});let E=bt.foldFlowLines(`${v}${L}${g}`,l,bt.FOLD_BLOCK,F);if(!$)return`>${N}
51
+ ${l}${E}`}return n=n.replace(/\n+/g,`$&${l}`),`|${N}
52
+ ${l}${v}${n}${g}`}function Ix(t,e,n,r){let{type:s,value:i}=t,{actualString:o,implicitKey:a,indent:c,indentStep:l,inFlow:u}=e;if(a&&i.includes(`
53
+ `)||u&&/[[\]{},]/.test(i))return jn(i,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return a||u||!i.includes(`
54
+ `)?jn(i,e):Gs(t,e,n,r);if(!a&&!u&&s!==Ve.Scalar.PLAIN&&i.includes(`
55
+ `))return Gs(t,e,n,r);if(Js(i)){if(c==="")return e.forceBlockIndent=!0,Gs(t,e,n,r);if(a&&c===l)return jn(i,e)}let f=i.replace(/\n+/g,`$&
56
+ ${c}`);if(o){let h=m=>m.default&&m.tag!=="tag:yaml.org,2002:str"&&m.test?.test(f),{compat:g,tags:p}=e.doc.schema;if(p.some(h)||g?.some(h))return jn(i,e)}return a?f:bt.foldFlowLines(f,c,bt.FOLD_FLOW,Ws(e,!1))}function Px(t,e,n,r){let{implicitKey:s,inFlow:i}=e,o=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:a}=t;a!==Ve.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=Ve.Scalar.QUOTE_DOUBLE);let c=u=>{switch(u){case Ve.Scalar.BLOCK_FOLDED:case Ve.Scalar.BLOCK_LITERAL:return s||i?jn(o.value,e):Gs(o,e,n,r);case Ve.Scalar.QUOTE_DOUBLE:return yr(o.value,e);case Ve.Scalar.QUOTE_SINGLE:return Ba(o.value,e);case Ve.Scalar.PLAIN:return Ix(o,e,n,r);default:return null}},l=c(a);if(l===null){let{defaultKeyType:u,defaultStringType:f}=e.options,h=s&&u||f;if(l=c(h),l===null)throw new Error(`Unsupported default string type ${h}`)}return l}Ch.stringifyString=Px});var wr=S(Ua=>{"use strict";d();var Lx=qs(),vt=Z(),Rx=mr(),jx=_r();function $x(t,e){let n=Object.assign({blockQuote:!0,commentString:Rx.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:t,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:r,options:n}}function Mx(t,e){if(e.tag){let s=t.filter(i=>i.tag===e.tag);if(s.length>0)return s.find(i=>i.format===e.format)??s[0]}let n,r;if(vt.isScalar(e)){r=e.value;let s=t.filter(i=>i.identify?.(r));if(s.length>1){let i=s.filter(o=>o.test);i.length>0&&(s=i)}n=s.find(i=>i.format===e.format)??s.find(i=>!i.format)}else r=e,n=t.find(s=>s.nodeClass&&r instanceof s.nodeClass);if(!n){let s=r?.constructor?.name??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${s} value`)}return n}function qx(t,e,{anchors:n,doc:r}){if(!r.directives)return"";let s=[],i=(vt.isScalar(t)||vt.isCollection(t))&&t.anchor;i&&Lx.anchorIsValid(i)&&(n.add(i),s.push(`&${i}`));let o=t.tag??(e.default?null:e.tag);return o&&s.push(r.directives.tagString(o)),s.join(" ")}function Fx(t,e,n,r){if(vt.isPair(t))return t.toString(e,n,r);if(vt.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let s,i=vt.isNode(t)?t:e.doc.createNode(t,{onTagObj:c=>s=c});s??(s=Mx(e.doc.schema.tags,i));let o=qx(i,s,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let a=typeof s.stringify=="function"?s.stringify(i,e,n,r):vt.isScalar(i)?jx.stringifyString(i,e,n,r):i.toString(e,n,r);return o?vt.isScalar(i)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
57
+ ${e.indent}${a}`:a}Ua.createStringifyContext=$x;Ua.stringify=Fx});var Rh=S(Lh=>{"use strict";d();var ft=Z(),Ih=he(),Ph=wr(),br=mr();function Bx({key:t,value:e},n,r,s){let{allNullValues:i,doc:o,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:f}}=n,h=ft.isNode(t)&&t.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(ft.isCollection(t)||!ft.isNode(t)&&typeof t=="object"){let F="With simple keys, collection cannot be used as a key value";throw new Error(F)}}let g=!f&&(!t||h&&e==null&&!n.inFlow||ft.isCollection(t)||(ft.isScalar(t)?t.type===Ih.Scalar.BLOCK_FOLDED||t.type===Ih.Scalar.BLOCK_LITERAL:typeof t=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!g&&(f||!i),indent:a+c});let p=!1,m=!1,y=Ph.stringify(t,n,()=>p=!0,()=>m=!0);if(!g&&!n.inFlow&&y.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");g=!0}if(n.inFlow){if(i||e==null)return p&&r&&r(),y===""?"?":g?`? ${y}`:y}else if(i&&!f||e==null&&g)return y=`? ${y}`,h&&!p?y+=br.lineComment(y,n.indent,l(h)):m&&s&&s(),y;p&&(h=null),g?(h&&(y+=br.lineComment(y,n.indent,l(h))),y=`? ${y}
58
+ ${a}:`):(y=`${y}:`,h&&(y+=br.lineComment(y,n.indent,l(h))));let b,v,k;ft.isNode(e)?(b=!!e.spaceBefore,v=e.commentBefore,k=e.comment):(b=!1,v=null,k=null,e&&typeof e=="object"&&(e=o.createNode(e))),n.implicitKey=!1,!g&&!h&&ft.isScalar(e)&&(n.indentAtStart=y.length+1),m=!1,!u&&c.length>=2&&!n.inFlow&&!g&&ft.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(n.indent=n.indent.substring(2));let N=!1,L=Ph.stringify(e,n,()=>N=!0,()=>m=!0),$=" ";if(h||b||v){if($=b?`
59
+ `:"",v){let F=l(v);$+=`
60
+ ${br.indentComment(F,n.indent)}`}L===""&&!n.inFlow?$===`
61
+ `&&k&&($=`
62
+
63
+ `):$+=`
64
+ ${n.indent}`}else if(!g&&ft.isCollection(e)){let F=L[0],E=L.indexOf(`
65
+ `),O=E!==-1,M=n.inFlow??e.flow??e.items.length===0;if(O||!M){let x=!1;if(O&&(F==="&"||F==="!")){let I=L.indexOf(" ");F==="&"&&I!==-1&&I<E&&L[I+1]==="!"&&(I=L.indexOf(" ",I+1)),(I===-1||E<I)&&(x=!0)}x||($=`
66
+ ${n.indent}`)}}else(L===""||L[0]===`
67
+ `)&&($="");return y+=$+L,n.inFlow?N&&r&&r():k&&!N?y+=br.lineComment(y,n.indent,l(k)):m&&s&&s(),y}Lh.stringifyPair=Bx});var Ka=S(Va=>{"use strict";d();var jh=X("process");function Dx(t,...e){t==="debug"&&console.log(...e)}function Ux(t,e){(t==="debug"||t==="warn")&&(typeof jh.emitWarning=="function"?jh.emitWarning(e):console.warn(e))}Va.debug=Dx;Va.warn=Ux});var Zs=S(Hs=>{"use strict";d();var vr=Z(),$h=he(),Ys="<<",zs={identify:t=>t===Ys||typeof t=="symbol"&&t.description===Ys,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new $h.Scalar(Symbol(Ys)),{addToJSMap:Mh}),stringify:()=>Ys},Vx=(t,e)=>(zs.identify(e)||vr.isScalar(e)&&(!e.type||e.type===$h.Scalar.PLAIN)&&zs.identify(e.value))&&t?.doc.schema.tags.some(n=>n.tag===zs.tag&&n.default);function Mh(t,e,n){if(n=t&&vr.isAlias(n)?n.resolve(t.doc):n,vr.isSeq(n))for(let r of n.items)Ga(t,e,r);else if(Array.isArray(n))for(let r of n)Ga(t,e,r);else Ga(t,e,n)}function Ga(t,e,n){let r=t&&vr.isAlias(n)?n.resolve(t.doc):n;if(!vr.isMap(r))throw new Error("Merge sources must be maps or map aliases");let s=r.toJSON(null,t,Map);for(let[i,o]of s)e instanceof Map?e.has(i)||e.set(i,o):e instanceof Set?e.add(i):Object.prototype.hasOwnProperty.call(e,i)||Object.defineProperty(e,i,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}Hs.addMergeToJSMap=Mh;Hs.isMergeKey=Vx;Hs.merge=zs});var Ja=S(Bh=>{"use strict";d();var Kx=Ka(),qh=Zs(),Gx=wr(),Fh=Z(),Wa=_t();function Wx(t,e,{key:n,value:r}){if(Fh.isNode(n)&&n.addToJSMap)n.addToJSMap(t,e,r);else if(qh.isMergeKey(t,n))qh.addMergeToJSMap(t,e,r);else{let s=Wa.toJS(n,"",t);if(e instanceof Map)e.set(s,Wa.toJS(r,s,t));else if(e instanceof Set)e.add(s);else{let i=Jx(n,s,t),o=Wa.toJS(r,i,t);i in e?Object.defineProperty(e,i,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[i]=o}}return e}function Jx(t,e,n){if(e===null)return"";if(typeof e!="object")return String(e);if(Fh.isNode(t)&&n?.doc){let r=Gx.createStringifyContext(n.doc,{});r.anchors=new Set;for(let i of n.anchors.keys())r.anchors.add(i.anchor);r.inFlow=!0,r.inStringifyKey=!0;let s=t.toString(r);if(!n.mapKeyWarned){let i=JSON.stringify(s);i.length>40&&(i=i.substring(0,36)+'..."'),Kx.warn(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${i}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return s}return JSON.stringify(e)}Bh.addPairToJSMap=Wx});var St=S(Ya=>{"use strict";d();var Dh=pr(),Yx=Rh(),zx=Ja(),Xs=Z();function Hx(t,e,n){let r=Dh.createNode(t,void 0,n),s=Dh.createNode(e,void 0,n);return new Qs(r,s)}var Qs=class t{constructor(e,n=null){Object.defineProperty(this,Xs.NODE_TYPE,{value:Xs.PAIR}),this.key=e,this.value=n}clone(e){let{key:n,value:r}=this;return Xs.isNode(n)&&(n=n.clone(e)),Xs.isNode(r)&&(r=r.clone(e)),new t(n,r)}toJSON(e,n){let r=n?.mapAsMap?new Map:{};return zx.addPairToJSMap(n,r,this)}toString(e,n,r){return e?.doc?Yx.stringifyPair(this,e,n,r):JSON.stringify(this)}};Ya.Pair=Qs;Ya.createPair=Hx});var za=S(Vh=>{"use strict";d();var rn=Z(),Uh=wr(),ei=mr();function Zx(t,e,n){return(e.inFlow??t.flow?Qx:Xx)(t,e,n)}function Xx({comment:t,items:e},n,{blockItemPrefix:r,flowChars:s,itemIndent:i,onChompKeep:o,onComment:a}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:i,type:null}),f=!1,h=[];for(let p=0;p<e.length;++p){let m=e[p],y=null;if(rn.isNode(m))!f&&m.spaceBefore&&h.push(""),ti(n,h,m.commentBefore,f),m.comment&&(y=m.comment);else if(rn.isPair(m)){let v=rn.isNode(m.key)?m.key:null;v&&(!f&&v.spaceBefore&&h.push(""),ti(n,h,v.commentBefore,f))}f=!1;let b=Uh.stringify(m,u,()=>y=null,()=>f=!0);y&&(b+=ei.lineComment(b,i,l(y))),f&&y&&(f=!1),h.push(r+b)}let g;if(h.length===0)g=s.start+s.end;else{g=h[0];for(let p=1;p<h.length;++p){let m=h[p];g+=m?`
68
+ ${c}${m}`:`
69
+ `}}return t?(g+=`
70
+ `+ei.indentComment(l(t),c),a&&a()):f&&o&&o(),g}function Qx({items:t},e,{flowChars:n,itemIndent:r}){let{indent:s,indentStep:i,flowCollectionPadding:o,options:{commentString:a}}=e;r+=i;let c=Object.assign({},e,{indent:r,inFlow:!0,type:null}),l=!1,u=0,f=[];for(let p=0;p<t.length;++p){let m=t[p],y=null;if(rn.isNode(m))m.spaceBefore&&f.push(""),ti(e,f,m.commentBefore,!1),m.comment&&(y=m.comment);else if(rn.isPair(m)){let v=rn.isNode(m.key)?m.key:null;v&&(v.spaceBefore&&f.push(""),ti(e,f,v.commentBefore,!1),v.comment&&(l=!0));let k=rn.isNode(m.value)?m.value:null;k?(k.comment&&(y=k.comment),k.commentBefore&&(l=!0)):m.value==null&&v?.comment&&(y=v.comment)}y&&(l=!0);let b=Uh.stringify(m,c,()=>y=null);l||(l=f.length>u||b.includes(`
71
+ `)),p<t.length-1?b+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(l||(l=f.reduce((v,k)=>v+k.length+2,2)+(b.length+2)>e.options.lineWidth)),l&&(b+=",")),y&&(b+=ei.lineComment(b,r,a(y))),f.push(b),u=f.length}let{start:h,end:g}=n;if(f.length===0)return h+g;if(!l){let p=f.reduce((m,y)=>m+y.length+2,2);l=e.options.lineWidth>0&&p>e.options.lineWidth}if(l){let p=h;for(let m of f)p+=m?`
72
+ ${i}${s}${m}`:`
73
+ `;return`${p}
74
+ ${s}${g}`}else return`${h}${o}${f.join(" ")}${o}${g}`}function ti({indent:t,options:{commentString:e}},n,r,s){if(r&&s&&(r=r.replace(/^\n+/,"")),r){let i=ei.indentComment(e(r),t);n.push(i.trimStart())}}Vh.stringifyCollection=Zx});var kt=S(Za=>{"use strict";d();var eT=za(),tT=Ja(),nT=Us(),Et=Z(),ni=St(),rT=he();function Sr(t,e){let n=Et.isScalar(e)?e.value:e;for(let r of t)if(Et.isPair(r)&&(r.key===e||r.key===n||Et.isScalar(r.key)&&r.key.value===n))return r}var Ha=class extends nT.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Et.MAP,e),this.items=[]}static from(e,n,r){let{keepUndefined:s,replacer:i}=r,o=new this(e),a=(c,l)=>{if(typeof i=="function")l=i.call(n,c,l);else if(Array.isArray(i)&&!i.includes(c))return;(l!==void 0||s)&&o.items.push(ni.createPair(c,l,r))};if(n instanceof Map)for(let[c,l]of n)a(c,l);else if(n&&typeof n=="object")for(let c of Object.keys(n))a(c,n[c]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,n){let r;Et.isPair(e)?r=e:!e||typeof e!="object"||!("key"in e)?r=new ni.Pair(e,e?.value):r=new ni.Pair(e.key,e.value);let s=Sr(this.items,r.key),i=this.schema?.sortMapEntries;if(s){if(!n)throw new Error(`Key ${r.key} already set`);Et.isScalar(s.value)&&rT.isScalarValue(r.value)?s.value.value=r.value:s.value=r.value}else if(i){let o=this.items.findIndex(a=>i(r,a)<0);o===-1?this.items.push(r):this.items.splice(o,0,r)}else this.items.push(r)}delete(e){let n=Sr(this.items,e);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(e,n){let s=Sr(this.items,e)?.value;return(!n&&Et.isScalar(s)?s.value:s)??void 0}has(e){return!!Sr(this.items,e)}set(e,n){this.add(new ni.Pair(e,n),!0)}toJSON(e,n,r){let s=r?new r:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(s);for(let i of this.items)tT.addPairToJSMap(n,s,i);return s}toString(e,n,r){if(!e)return JSON.stringify(this);for(let s of this.items)if(!Et.isPair(s))throw new Error(`Map items must all be pairs; found ${JSON.stringify(s)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),eT.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:r,onComment:n})}};Za.YAMLMap=Ha;Za.findPair=Sr});var $n=S(Gh=>{"use strict";d();var sT=Z(),Kh=kt(),iT={collection:"map",default:!0,nodeClass:Kh.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return sT.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,n)=>Kh.YAMLMap.from(t,e,n)};Gh.map=iT});var xt=S(Wh=>{"use strict";d();var oT=pr(),aT=za(),cT=Us(),si=Z(),lT=he(),uT=_t(),Xa=class extends cT.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(si.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let n=ri(e);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(e,n){let r=ri(e);if(typeof r!="number")return;let s=this.items[r];return!n&&si.isScalar(s)?s.value:s}has(e){let n=ri(e);return typeof n=="number"&&n<this.items.length}set(e,n){let r=ri(e);if(typeof r!="number")throw new Error(`Expected a valid index, not ${e}.`);let s=this.items[r];si.isScalar(s)&&lT.isScalarValue(n)?s.value=n:this.items[r]=n}toJSON(e,n){let r=[];n?.onCreate&&n.onCreate(r);let s=0;for(let i of this.items)r.push(uT.toJS(i,String(s++),n));return r}toString(e,n,r){return e?aT.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(e,n,r){let{replacer:s}=r,i=new this(e);if(n&&Symbol.iterator in Object(n)){let o=0;for(let a of n){if(typeof s=="function"){let c=n instanceof Set?a:String(o++);a=s.call(n,c,a)}i.items.push(oT.createNode(a,void 0,r))}}return i}};function ri(t){let e=si.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}Wh.YAMLSeq=Xa});var Mn=S(Yh=>{"use strict";d();var fT=Z(),Jh=xt(),dT={collection:"seq",default:!0,nodeClass:Jh.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return fT.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,n)=>Jh.YAMLSeq.from(t,e,n)};Yh.seq=dT});var Er=S(zh=>{"use strict";d();var hT=_r(),pT={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,n,r){return e=Object.assign({actualString:!0},e),hT.stringifyString(t,e,n,r)}};zh.string=pT});var ii=S(Xh=>{"use strict";d();var Hh=he(),Zh={identify:t=>t==null,createNode:()=>new Hh.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Hh.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&Zh.test.test(t)?t:e.options.nullStr};Xh.nullTag=Zh});var Qa=S(ep=>{"use strict";d();var mT=he(),Qh={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new mT.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},n){if(t&&Qh.test.test(t)){let r=t[0]==="t"||t[0]==="T";if(e===r)return t}return e?n.options.trueStr:n.options.falseStr}};ep.boolTag=Qh});var qn=S(tp=>{"use strict";d();function gT({format:t,minFractionDigits:e,tag:n,value:r}){if(typeof r=="bigint")return String(r);let s=typeof r=="number"?r:Number(r);if(!isFinite(s))return isNaN(s)?".nan":s<0?"-.inf":".inf";let i=Object.is(r,-0)?"-0":JSON.stringify(r);if(!t&&e&&(!n||n==="tag:yaml.org,2002:float")&&/^\d/.test(i)){let o=i.indexOf(".");o<0&&(o=i.length,i+=".");let a=e-(i.length-o-1);for(;a-- >0;)i+="0"}return i}tp.stringifyNumber=gT});var tc=S(oi=>{"use strict";d();var yT=he(),ec=qn(),_T={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ec.stringifyNumber},wT={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():ec.stringifyNumber(t)}},bT={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new yT.Scalar(parseFloat(t)),n=t.indexOf(".");return n!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-n-1),e},stringify:ec.stringifyNumber};oi.float=bT;oi.floatExp=wT;oi.floatNaN=_T});var rc=S(ci=>{"use strict";d();var np=qn(),ai=t=>typeof t=="bigint"||Number.isInteger(t),nc=(t,e,n,{intAsBigInt:r})=>r?BigInt(t):parseInt(t.substring(e),n);function rp(t,e,n){let{value:r}=t;return ai(r)&&r>=0?n+r.toString(e):np.stringifyNumber(t)}var vT={identify:t=>ai(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,n)=>nc(t,2,8,n),stringify:t=>rp(t,8,"0o")},ST={identify:ai,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,n)=>nc(t,0,10,n),stringify:np.stringifyNumber},ET={identify:t=>ai(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,n)=>nc(t,2,16,n),stringify:t=>rp(t,16,"0x")};ci.int=ST;ci.intHex=ET;ci.intOct=vT});var ip=S(sp=>{"use strict";d();var kT=$n(),xT=ii(),TT=Mn(),OT=Er(),NT=Qa(),sc=tc(),ic=rc(),AT=[kT.map,TT.seq,OT.string,xT.nullTag,NT.boolTag,ic.intOct,ic.int,ic.intHex,sc.floatNaN,sc.floatExp,sc.float];sp.schema=AT});var cp=S(ap=>{"use strict";d();var CT=he(),IT=$n(),PT=Mn();function op(t){return typeof t=="bigint"||Number.isInteger(t)}var li=({value:t})=>JSON.stringify(t),LT=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:li},{identify:t=>t==null,createNode:()=>new CT.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:li},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:li},{identify:op,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:n})=>n?BigInt(t):parseInt(t,10),stringify:({value:t})=>op(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:li}],RT={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},jT=[IT.map,PT.seq].concat(LT,RT);ap.schema=jT});var ac=S(lp=>{"use strict";d();var kr=X("buffer"),oc=he(),$T=_r(),MT={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof kr.Buffer=="function")return kr.Buffer.from(t,"base64");if(typeof atob=="function"){let n=atob(t.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let s=0;s<n.length;++s)r[s]=n.charCodeAt(s);return r}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:n},r,s,i){if(!n)return"";let o=n,a;if(typeof kr.Buffer=="function")a=o instanceof kr.Buffer?o.toString("base64"):kr.Buffer.from(o.buffer).toString("base64");else if(typeof btoa=="function"){let c="";for(let l=0;l<o.length;++l)c+=String.fromCharCode(o[l]);a=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=oc.Scalar.BLOCK_LITERAL),e!==oc.Scalar.QUOTE_DOUBLE){let c=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),l=Math.ceil(a.length/c),u=new Array(l);for(let f=0,h=0;f<l;++f,h+=c)u[f]=a.substr(h,c);a=u.join(e===oc.Scalar.BLOCK_LITERAL?`
75
+ `:" ")}return $T.stringifyString({comment:t,type:e,value:a},r,s,i)}};lp.binary=MT});var di=S(fi=>{"use strict";d();var ui=Z(),cc=St(),qT=he(),FT=xt();function up(t,e){if(ui.isSeq(t))for(let n=0;n<t.items.length;++n){let r=t.items[n];if(!ui.isPair(r)){if(ui.isMap(r)){r.items.length>1&&e("Each pair must have its own sequence indicator");let s=r.items[0]||new cc.Pair(new qT.Scalar(null));if(r.commentBefore&&(s.key.commentBefore=s.key.commentBefore?`${r.commentBefore}
76
+ ${s.key.commentBefore}`:r.commentBefore),r.comment){let i=s.value??s.key;i.comment=i.comment?`${r.comment}
77
+ ${i.comment}`:r.comment}r=s}t.items[n]=ui.isPair(r)?r:new cc.Pair(r)}}else e("Expected a sequence for this tag");return t}function fp(t,e,n){let{replacer:r}=n,s=new FT.YAMLSeq(t);s.tag="tag:yaml.org,2002:pairs";let i=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof r=="function"&&(o=r.call(e,String(i++),o));let a,c;if(Array.isArray(o))if(o.length===2)a=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let l=Object.keys(o);if(l.length===1)a=l[0],c=o[a];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=o;s.items.push(cc.createPair(a,c,n))}return s}var BT={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:up,createNode:fp};fi.createPairs=fp;fi.pairs=BT;fi.resolvePairs=up});var fc=S(uc=>{"use strict";d();var dp=Z(),lc=_t(),xr=kt(),DT=xt(),hp=di(),sn=class t extends DT.YAMLSeq{constructor(){super(),this.add=xr.YAMLMap.prototype.add.bind(this),this.delete=xr.YAMLMap.prototype.delete.bind(this),this.get=xr.YAMLMap.prototype.get.bind(this),this.has=xr.YAMLMap.prototype.has.bind(this),this.set=xr.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,n){if(!n)return super.toJSON(e);let r=new Map;n?.onCreate&&n.onCreate(r);for(let s of this.items){let i,o;if(dp.isPair(s)?(i=lc.toJS(s.key,"",n),o=lc.toJS(s.value,i,n)):i=lc.toJS(s,"",n),r.has(i))throw new Error("Ordered maps must not include duplicate keys");r.set(i,o)}return r}static from(e,n,r){let s=hp.createPairs(e,n,r),i=new this;return i.items=s.items,i}};sn.tag="tag:yaml.org,2002:omap";var UT={collection:"seq",identify:t=>t instanceof Map,nodeClass:sn,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let n=hp.resolvePairs(t,e),r=[];for(let{key:s}of n.items)dp.isScalar(s)&&(r.includes(s.value)?e(`Ordered maps must not include duplicate keys: ${s.value}`):r.push(s.value));return Object.assign(new sn,n)},createNode:(t,e,n)=>sn.from(t,e,n)};uc.YAMLOMap=sn;uc.omap=UT});var _p=S(dc=>{"use strict";d();var pp=he();function mp({value:t,source:e},n){return e&&(t?gp:yp).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}var gp={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new pp.Scalar(!0),stringify:mp},yp={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new pp.Scalar(!1),stringify:mp};dc.falseTag=yp;dc.trueTag=gp});var wp=S(hi=>{"use strict";d();var VT=he(),hc=qn(),KT={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:hc.stringifyNumber},GT={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():hc.stringifyNumber(t)}},WT={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new VT.Scalar(parseFloat(t.replace(/_/g,""))),n=t.indexOf(".");if(n!==-1){let r=t.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(e.minFractionDigits=r.length)}return e},stringify:hc.stringifyNumber};hi.float=WT;hi.floatExp=GT;hi.floatNaN=KT});var vp=S(Or=>{"use strict";d();var bp=qn(),Tr=t=>typeof t=="bigint"||Number.isInteger(t);function pi(t,e,n,{intAsBigInt:r}){let s=t[0];if((s==="-"||s==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),r){switch(n){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let o=BigInt(t);return s==="-"?BigInt(-1)*o:o}let i=parseInt(t,n);return s==="-"?-1*i:i}function pc(t,e,n){let{value:r}=t;if(Tr(r)){let s=r.toString(e);return r<0?"-"+n+s.substr(1):n+s}return bp.stringifyNumber(t)}var JT={identify:Tr,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,n)=>pi(t,2,2,n),stringify:t=>pc(t,2,"0b")},YT={identify:Tr,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,n)=>pi(t,1,8,n),stringify:t=>pc(t,8,"0")},zT={identify:Tr,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,n)=>pi(t,0,10,n),stringify:bp.stringifyNumber},HT={identify:Tr,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,n)=>pi(t,2,16,n),stringify:t=>pc(t,16,"0x")};Or.int=zT;Or.intBin=JT;Or.intHex=HT;Or.intOct=YT});var gc=S(mc=>{"use strict";d();var yi=Z(),mi=St(),gi=kt(),on=class t extends gi.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let n;yi.isPair(e)?n=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?n=new mi.Pair(e.key,null):n=new mi.Pair(e,null),gi.findPair(this.items,n.key)||this.items.push(n)}get(e,n){let r=gi.findPair(this.items,e);return!n&&yi.isPair(r)?yi.isScalar(r.key)?r.key.value:r.key:r}set(e,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let r=gi.findPair(this.items,e);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new mi.Pair(e))}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(e,n,r){let{replacer:s}=r,i=new this(e);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof s=="function"&&(o=s.call(n,o,o)),i.items.push(mi.createPair(o,null,r));return i}};on.tag="tag:yaml.org,2002:set";var ZT={collection:"map",identify:t=>t instanceof Set,nodeClass:on,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,n)=>on.from(t,e,n),resolve(t,e){if(yi.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new on,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};mc.YAMLSet=on;mc.set=ZT});var _c=S(_i=>{"use strict";d();var XT=qn();function yc(t,e){let n=t[0],r=n==="-"||n==="+"?t.substring(1):t,s=o=>e?BigInt(o):Number(o),i=r.replace(/_/g,"").split(":").reduce((o,a)=>o*s(60)+s(a),s(0));return n==="-"?s(-1)*i:i}function Sp(t){let{value:e}=t,n=o=>o;if(typeof e=="bigint")n=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return XT.stringifyNumber(t);let r="";e<0&&(r="-",e*=n(-1));let s=n(60),i=[e%s];return e<60?i.unshift(0):(e=(e-i[0])/s,i.unshift(e%s),e>=60&&(e=(e-i[0])/s,i.unshift(e))),r+i.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var QT={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:n})=>yc(t,n),stringify:Sp},eO={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>yc(t,!1),stringify:Sp},Ep={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){let e=t.match(Ep.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,r,s,i,o,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(n,r-1,s,i||0,o||0,a||0,c),u=e[8];if(u&&u!=="Z"){let f=yc(u,!1);Math.abs(f)<30&&(f*=60),l-=6e4*f}return new Date(l)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};_i.floatTime=eO;_i.intTime=QT;_i.timestamp=Ep});var Tp=S(xp=>{"use strict";d();var tO=$n(),nO=ii(),rO=Mn(),sO=Er(),iO=ac(),kp=_p(),wc=wp(),wi=vp(),oO=Zs(),aO=fc(),cO=di(),lO=gc(),bc=_c(),uO=[tO.map,rO.seq,sO.string,nO.nullTag,kp.trueTag,kp.falseTag,wi.intBin,wi.intOct,wi.int,wi.intHex,wc.floatNaN,wc.floatExp,wc.float,iO.binary,oO.merge,aO.omap,cO.pairs,lO.set,bc.intTime,bc.floatTime,bc.timestamp];xp.schema=uO});var $p=S(Ec=>{"use strict";d();var Cp=$n(),fO=ii(),Ip=Mn(),dO=Er(),hO=Qa(),vc=tc(),Sc=rc(),pO=ip(),mO=cp(),Pp=ac(),Nr=Zs(),Lp=fc(),Rp=di(),Op=Tp(),jp=gc(),bi=_c(),Np=new Map([["core",pO.schema],["failsafe",[Cp.map,Ip.seq,dO.string]],["json",mO.schema],["yaml11",Op.schema],["yaml-1.1",Op.schema]]),Ap={binary:Pp.binary,bool:hO.boolTag,float:vc.float,floatExp:vc.floatExp,floatNaN:vc.floatNaN,floatTime:bi.floatTime,int:Sc.int,intHex:Sc.intHex,intOct:Sc.intOct,intTime:bi.intTime,map:Cp.map,merge:Nr.merge,null:fO.nullTag,omap:Lp.omap,pairs:Rp.pairs,seq:Ip.seq,set:jp.set,timestamp:bi.timestamp},gO={"tag:yaml.org,2002:binary":Pp.binary,"tag:yaml.org,2002:merge":Nr.merge,"tag:yaml.org,2002:omap":Lp.omap,"tag:yaml.org,2002:pairs":Rp.pairs,"tag:yaml.org,2002:set":jp.set,"tag:yaml.org,2002:timestamp":bi.timestamp};function yO(t,e,n){let r=Np.get(e);if(r&&!t)return n&&!r.includes(Nr.merge)?r.concat(Nr.merge):r.slice();let s=r;if(!s)if(Array.isArray(t))s=[];else{let i=Array.from(Np.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${i} or define customTags array`)}if(Array.isArray(t))for(let i of t)s=s.concat(i);else typeof t=="function"&&(s=t(s.slice()));return n&&(s=s.concat(Nr.merge)),s.reduce((i,o)=>{let a=typeof o=="string"?Ap[o]:o;if(!a){let c=JSON.stringify(o),l=Object.keys(Ap).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return i.includes(a)||i.push(a),i},[])}Ec.coreKnownTags=gO;Ec.getTags=yO});var Tc=S(Mp=>{"use strict";d();var kc=Z(),_O=$n(),wO=Mn(),bO=Er(),vi=$p(),vO=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,xc=class t{constructor({compat:e,customTags:n,merge:r,resolveKnownTags:s,schema:i,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?vi.getTags(e,"compat"):e?vi.getTags(null,e):null,this.name=typeof i=="string"&&i||"core",this.knownTags=s?vi.coreKnownTags:{},this.tags=vi.getTags(n,this.name,r),this.toStringOptions=a??null,Object.defineProperty(this,kc.MAP,{value:_O.map}),Object.defineProperty(this,kc.SCALAR,{value:bO.string}),Object.defineProperty(this,kc.SEQ,{value:wO.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?vO:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};Mp.Schema=xc});var Fp=S(qp=>{"use strict";d();var SO=Z(),Oc=wr(),Ar=mr();function EO(t,e){let n=[],r=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(n.push(c),r=!0):t.directives.docStart&&(r=!0)}r&&n.push("---");let s=Oc.createStringifyContext(t,e),{commentString:i}=s.options;if(t.commentBefore){n.length!==1&&n.unshift("");let c=i(t.commentBefore);n.unshift(Ar.indentComment(c,""))}let o=!1,a=null;if(t.contents){if(SO.isNode(t.contents)){if(t.contents.spaceBefore&&r&&n.push(""),t.contents.commentBefore){let u=i(t.contents.commentBefore);n.push(Ar.indentComment(u,""))}s.forceBlockIndent=!!t.comment,a=t.contents.comment}let c=a?void 0:()=>o=!0,l=Oc.stringify(t.contents,s,()=>a=null,c);a&&(l+=Ar.lineComment(l,"",i(a))),(l[0]==="|"||l[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${l}`:n.push(l)}else n.push(Oc.stringify(t.contents,s));if(t.directives?.docEnd)if(t.comment){let c=i(t.comment);c.includes(`
78
+ `)?(n.push("..."),n.push(Ar.indentComment(c,""))):n.push(`... ${c}`)}else n.push("...");else{let c=t.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||a)&&n[n.length-1]!==""&&n.push(""),n.push(Ar.indentComment(i(c),"")))}return n.join(`
79
+ `)+`
80
+ `}qp.stringifyDocument=EO});var Cr=S(Bp=>{"use strict";d();var kO=hr(),Fn=Us(),Re=Z(),xO=St(),TO=_t(),OO=Tc(),NO=Fp(),Nc=qs(),AO=Pa(),CO=pr(),Ac=Ia(),Cc=class t{constructor(e,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Re.NODE_TYPE,{value:Re.DOC});let s=null;typeof n=="function"||Array.isArray(n)?s=n:r===void 0&&n&&(r=n,n=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=i;let{version:o}=i;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Ac.Directives({version:o}),this.setSchema(o,r),this.contents=e===void 0?null:this.createNode(e,s,r)}clone(){let e=Object.create(t.prototype,{[Re.NODE_TYPE]:{value:Re.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=Re.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Bn(this.contents)&&this.contents.add(e)}addIn(e,n){Bn(this.contents)&&this.contents.addIn(e,n)}createAlias(e,n){if(!e.anchor){let r=Nc.anchorNames(this);e.anchor=!n||r.has(n)?Nc.findNewAnchor(n||"a",r):n}return new kO.Alias(e.anchor)}createNode(e,n,r){let s;if(typeof n=="function")e=n.call({"":e},"",e),s=n;else if(Array.isArray(n)){let y=v=>typeof v=="number"||v instanceof String||v instanceof Number,b=n.filter(y).map(String);b.length>0&&(n=n.concat(b)),s=n}else r===void 0&&n&&(r=n,n=void 0);let{aliasDuplicateObjects:i,anchorPrefix:o,flow:a,keepUndefined:c,onTagObj:l,tag:u}=r??{},{onAnchor:f,setAnchors:h,sourceObjects:g}=Nc.createNodeAnchors(this,o||"a"),p={aliasDuplicateObjects:i??!0,keepUndefined:c??!1,onAnchor:f,onTagObj:l,replacer:s,schema:this.schema,sourceObjects:g},m=CO.createNode(e,u,p);return a&&Re.isCollection(m)&&(m.flow=!0),h(),m}createPair(e,n,r={}){let s=this.createNode(e,null,r),i=this.createNode(n,null,r);return new xO.Pair(s,i)}delete(e){return Bn(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Fn.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):Bn(this.contents)?this.contents.deleteIn(e):!1}get(e,n){return Re.isCollection(this.contents)?this.contents.get(e,n):void 0}getIn(e,n){return Fn.isEmptyPath(e)?!n&&Re.isScalar(this.contents)?this.contents.value:this.contents:Re.isCollection(this.contents)?this.contents.getIn(e,n):void 0}has(e){return Re.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return Fn.isEmptyPath(e)?this.contents!==void 0:Re.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,n){this.contents==null?this.contents=Fn.collectionFromPath(this.schema,[e],n):Bn(this.contents)&&this.contents.set(e,n)}setIn(e,n){Fn.isEmptyPath(e)?this.contents=n:this.contents==null?this.contents=Fn.collectionFromPath(this.schema,Array.from(e),n):Bn(this.contents)&&this.contents.setIn(e,n)}setSchema(e,n={}){typeof e=="number"&&(e=String(e));let r;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Ac.Directives({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new Ac.Directives({version:e}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{let s=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${s}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(r)this.schema=new OO.Schema(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:n,mapAsMap:r,maxAliasCount:s,onAnchor:i,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},c=TO.toJS(this.contents,n??"",a);if(typeof i=="function")for(let{count:l,res:u}of a.anchors.values())i(u,l);return typeof o=="function"?AO.applyReviver(o,{"":c},"",c):c}toJSON(e,n){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:n})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let n=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return NO.stringifyDocument(this,e)}};function Bn(t){if(Re.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}Bp.Document=Cc});var Lr=S(Pr=>{"use strict";d();var Ir=class extends Error{constructor(e,n,r,s){super(),this.name=e,this.code=r,this.message=s,this.pos=n}},Ic=class extends Ir{constructor(e,n,r){super("YAMLParseError",e,n,r)}},Pc=class extends Ir{constructor(e,n,r){super("YAMLWarning",e,n,r)}},IO=(t,e)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(a=>e.linePos(a));let{line:r,col:s}=n.linePos[0];n.message+=` at line ${r}, column ${s}`;let i=s-1,o=t.substring(e.lineStarts[r-1],e.lineStarts[r]).replace(/[\n\r]+$/,"");if(i>=60&&o.length>80){let a=Math.min(i-39,o.length-79);o="\u2026"+o.substring(a),i-=a-1}if(o.length>80&&(o=o.substring(0,79)+"\u2026"),r>1&&/^ *$/.test(o.substring(0,i))){let a=t.substring(e.lineStarts[r-2],e.lineStarts[r-1]);a.length>80&&(a=a.substring(0,79)+`\u2026
81
+ `),o=a+o}if(/[^ ]/.test(o)){let a=1,c=n.linePos[1];c?.line===r&&c.col>s&&(a=Math.max(1,Math.min(c.col-s,80-i)));let l=" ".repeat(i)+"^".repeat(a);n.message+=`:
82
+
83
+ ${o}
84
+ ${l}
85
+ `}};Pr.YAMLError=Ir;Pr.YAMLParseError=Ic;Pr.YAMLWarning=Pc;Pr.prettifyError=IO});var Rr=S(Dp=>{"use strict";d();function PO(t,{flow:e,indicator:n,next:r,offset:s,onError:i,parentIndent:o,startOnNewline:a}){let c=!1,l=a,u=a,f="",h="",g=!1,p=!1,m=null,y=null,b=null,v=null,k=null,N=null,L=null;for(let E of t)switch(p&&(E.type!=="space"&&E.type!=="newline"&&E.type!=="comma"&&i(E.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),p=!1),m&&(l&&E.type!=="comment"&&E.type!=="newline"&&i(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),m=null),E.type){case"space":!e&&(n!=="doc-start"||r?.type!=="flow-collection")&&E.source.includes(" ")&&(m=E),u=!0;break;case"comment":{u||i(E,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let O=E.source.substring(1)||" ";f?f+=h+O:f=O,h="",l=!1;break}case"newline":l?f?f+=E.source:(!N||n!=="seq-item-ind")&&(c=!0):h+=E.source,l=!0,g=!0,(y||b)&&(v=E),u=!0;break;case"anchor":y&&i(E,"MULTIPLE_ANCHORS","A node can have at most one anchor"),E.source.endsWith(":")&&i(E.offset+E.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),y=E,L??(L=E.offset),l=!1,u=!1,p=!0;break;case"tag":{b&&i(E,"MULTIPLE_TAGS","A node can have at most one tag"),b=E,L??(L=E.offset),l=!1,u=!1,p=!0;break}case n:(y||b)&&i(E,"BAD_PROP_ORDER",`Anchors and tags must be after the ${E.source} indicator`),N&&i(E,"UNEXPECTED_TOKEN",`Unexpected ${E.source} in ${e??"collection"}`),N=E,l=n==="seq-item-ind"||n==="explicit-key-ind",u=!1;break;case"comma":if(e){k&&i(E,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),k=E,l=!1,u=!1;break}default:i(E,"UNEXPECTED_TOKEN",`Unexpected ${E.type} token`),l=!1,u=!1}let $=t[t.length-1],F=$?$.offset+$.source.length:s;return p&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&i(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m&&(l&&m.indent<=o||r?.type==="block-map"||r?.type==="block-seq")&&i(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:k,found:N,spaceBefore:c,comment:f,hasNewline:g,anchor:y,tag:b,newlineAfterProp:v,end:F,start:L??F}}Dp.resolveProps=PO});var Si=S(Up=>{"use strict";d();function Lc(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
86
+ `))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let n of e.start)if(n.type==="newline")return!0;if(e.sep){for(let n of e.sep)if(n.type==="newline")return!0}if(Lc(e.key)||Lc(e.value))return!0}return!1;default:return!0}}Up.containsNewline=Lc});var Rc=S(Vp=>{"use strict";d();var LO=Si();function RO(t,e,n){if(e?.type==="flow-collection"){let r=e.end[0];r.indent===t&&(r.source==="]"||r.source==="}")&&LO.containsNewline(e)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Vp.flowIndentCheck=RO});var jc=S(Gp=>{"use strict";d();var Kp=Z();function jO(t,e,n){let{uniqueKeys:r}=t.options;if(r===!1)return!1;let s=typeof r=="function"?r:(i,o)=>i===o||Kp.isScalar(i)&&Kp.isScalar(o)&&i.value===o.value;return e.some(i=>s(i.key,n))}Gp.mapIncludes=jO});var Zp=S(Hp=>{"use strict";d();var Wp=St(),$O=kt(),Jp=Rr(),MO=Si(),Yp=Rc(),qO=jc(),zp="All mapping items must start at the same column";function FO({composeNode:t,composeEmptyNode:e},n,r,s,i){let o=i?.nodeClass??$O.YAMLMap,a=new o(n.schema);n.atRoot&&(n.atRoot=!1);let c=r.offset,l=null;for(let u of r.items){let{start:f,key:h,sep:g,value:p}=u,m=Jp.resolveProps(f,{indicator:"explicit-key-ind",next:h??g?.[0],offset:c,onError:s,parentIndent:r.indent,startOnNewline:!0}),y=!m.found;if(y){if(h&&(h.type==="block-seq"?s(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in h&&h.indent!==r.indent&&s(c,"BAD_INDENT",zp)),!m.anchor&&!m.tag&&!g){l=m.end,m.comment&&(a.comment?a.comment+=`
87
+ `+m.comment:a.comment=m.comment);continue}(m.newlineAfterProp||MO.containsNewline(h))&&s(h??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else m.found?.indent!==r.indent&&s(c,"BAD_INDENT",zp);n.atKey=!0;let b=m.end,v=h?t(n,h,m,s):e(n,b,f,null,m,s);n.schema.compat&&Yp.flowIndentCheck(r.indent,h,s),n.atKey=!1,qO.mapIncludes(n,a.items,v)&&s(b,"DUPLICATE_KEY","Map keys must be unique");let k=Jp.resolveProps(g??[],{indicator:"map-value-ind",next:p,offset:v.range[2],onError:s,parentIndent:r.indent,startOnNewline:!h||h.type==="block-scalar"});if(c=k.end,k.found){y&&(p?.type==="block-map"&&!k.hasNewline&&s(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&m.start<k.found.offset-1024&&s(v.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let N=p?t(n,p,k,s):e(n,c,g,null,k,s);n.schema.compat&&Yp.flowIndentCheck(r.indent,p,s),c=N.range[2];let L=new Wp.Pair(v,N);n.options.keepSourceTokens&&(L.srcToken=u),a.items.push(L)}else{y&&s(v.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),k.comment&&(v.comment?v.comment+=`
88
+ `+k.comment:v.comment=k.comment);let N=new Wp.Pair(v);n.options.keepSourceTokens&&(N.srcToken=u),a.items.push(N)}}return l&&l<c&&s(l,"IMPOSSIBLE","Map comment with trailing content"),a.range=[r.offset,c,l??c],a}Hp.resolveBlockMap=FO});var Qp=S(Xp=>{"use strict";d();var BO=xt(),DO=Rr(),UO=Rc();function VO({composeNode:t,composeEmptyNode:e},n,r,s,i){let o=i?.nodeClass??BO.YAMLSeq,a=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let c=r.offset,l=null;for(let{start:u,value:f}of r.items){let h=DO.resolveProps(u,{indicator:"seq-item-ind",next:f,offset:c,onError:s,parentIndent:r.indent,startOnNewline:!0});if(!h.found)if(h.anchor||h.tag||f)f?.type==="block-seq"?s(h.end,"BAD_INDENT","All sequence items must start at the same column"):s(c,"MISSING_CHAR","Sequence item without - indicator");else{l=h.end,h.comment&&(a.comment=h.comment);continue}let g=f?t(n,f,h,s):e(n,h.end,u,null,h,s);n.schema.compat&&UO.flowIndentCheck(r.indent,f,s),c=g.range[2],a.items.push(g)}return a.range=[r.offset,c,l??c],a}Xp.resolveBlockSeq=VO});var Dn=S(em=>{"use strict";d();function KO(t,e,n,r){let s="";if(t){let i=!1,o="";for(let a of t){let{source:c,type:l}=a;switch(l){case"space":i=!0;break;case"comment":{n&&!i&&r(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=c.substring(1)||" ";s?s+=o+u:s=u,o="";break}case"newline":s&&(o+=c),i=!0;break;default:r(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:s,offset:e}}em.resolveEnd=KO});var sm=S(rm=>{"use strict";d();var GO=Z(),WO=St(),tm=kt(),JO=xt(),YO=Dn(),nm=Rr(),zO=Si(),HO=jc(),$c="Block collections are not allowed within flow collections",Mc=t=>t&&(t.type==="block-map"||t.type==="block-seq");function ZO({composeNode:t,composeEmptyNode:e},n,r,s,i){let o=r.start.source==="{",a=o?"flow map":"flow sequence",c=i?.nodeClass??(o?tm.YAMLMap:JO.YAMLSeq),l=new c(n.schema);l.flow=!0;let u=n.atRoot;u&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=r.offset+r.start.source.length;for(let y=0;y<r.items.length;++y){let b=r.items[y],{start:v,key:k,sep:N,value:L}=b,$=nm.resolveProps(v,{flow:a,indicator:"explicit-key-ind",next:k??N?.[0],offset:f,onError:s,parentIndent:r.indent,startOnNewline:!1});if(!$.found){if(!$.anchor&&!$.tag&&!N&&!L){y===0&&$.comma?s($.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):y<r.items.length-1&&s($.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),$.comment&&(l.comment?l.comment+=`
89
+ `+$.comment:l.comment=$.comment),f=$.end;continue}!o&&n.options.strict&&zO.containsNewline(k)&&s(k,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(y===0)$.comma&&s($.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if($.comma||s($.start,"MISSING_CHAR",`Missing , between ${a} items`),$.comment){let F="";e:for(let E of v)switch(E.type){case"comma":case"space":break;case"comment":F=E.source.substring(1);break e;default:break e}if(F){let E=l.items[l.items.length-1];GO.isPair(E)&&(E=E.value??E.key),E.comment?E.comment+=`
90
+ `+F:E.comment=F,$.comment=$.comment.substring(F.length+1)}}if(!o&&!N&&!$.found){let F=L?t(n,L,$,s):e(n,$.end,N,null,$,s);l.items.push(F),f=F.range[2],Mc(L)&&s(F.range,"BLOCK_IN_FLOW",$c)}else{n.atKey=!0;let F=$.end,E=k?t(n,k,$,s):e(n,F,v,null,$,s);Mc(k)&&s(E.range,"BLOCK_IN_FLOW",$c),n.atKey=!1;let O=nm.resolveProps(N??[],{flow:a,indicator:"map-value-ind",next:L,offset:E.range[2],onError:s,parentIndent:r.indent,startOnNewline:!1});if(O.found){if(!o&&!$.found&&n.options.strict){if(N)for(let I of N){if(I===O.found)break;if(I.type==="newline"){s(I,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}$.start<O.found.offset-1024&&s(O.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else L&&("source"in L&&L.source?.[0]===":"?s(L,"MISSING_CHAR",`Missing space after : in ${a}`):s(O.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let M=L?t(n,L,O,s):O.found?e(n,O.end,N,null,O,s):null;M?Mc(L)&&s(M.range,"BLOCK_IN_FLOW",$c):O.comment&&(E.comment?E.comment+=`
91
+ `+O.comment:E.comment=O.comment);let x=new WO.Pair(E,M);if(n.options.keepSourceTokens&&(x.srcToken=b),o){let I=l;HO.mapIncludes(n,I.items,E)&&s(F,"DUPLICATE_KEY","Map keys must be unique"),I.items.push(x)}else{let I=new tm.YAMLMap(n.schema);I.flow=!0,I.items.push(x);let j=(M??E).range;I.range=[E.range[0],j[1],j[2]],l.items.push(I)}f=M?M.range[2]:O.end}}let h=o?"}":"]",[g,...p]=r.end,m=f;if(g?.source===h)m=g.offset+g.source.length;else{let y=a[0].toUpperCase()+a.substring(1),b=u?`${y} must end with a ${h}`:`${y} in block collection must be sufficiently indented and end with a ${h}`;s(f,u?"MISSING_CHAR":"BAD_INDENT",b),g&&g.source.length!==1&&p.unshift(g)}if(p.length>0){let y=YO.resolveEnd(p,m,n.options.strict,s);y.comment&&(l.comment?l.comment+=`
92
+ `+y.comment:l.comment=y.comment),l.range=[r.offset,m,y.offset]}else l.range=[r.offset,m,m];return l}rm.resolveFlowCollection=ZO});var om=S(im=>{"use strict";d();var XO=Z(),QO=he(),eN=kt(),tN=xt(),nN=Zp(),rN=Qp(),sN=sm();function qc(t,e,n,r,s,i){let o=n.type==="block-map"?nN.resolveBlockMap(t,e,n,r,i):n.type==="block-seq"?rN.resolveBlockSeq(t,e,n,r,i):sN.resolveFlowCollection(t,e,n,r,i),a=o.constructor;return s==="!"||s===a.tagName?(o.tag=a.tagName,o):(s&&(o.tag=s),o)}function iN(t,e,n,r,s){let i=r.tag,o=i?e.directives.tagName(i.source,h=>s(i,"TAG_RESOLVE_FAILED",h)):null;if(n.type==="block-seq"){let{anchor:h,newlineAfterProp:g}=r,p=h&&i?h.offset>i.offset?h:i:h??i;p&&(!g||g.offset<p.offset)&&s(p,"MISSING_CHAR","Missing newline after block sequence props")}let a=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!i||!o||o==="!"||o===eN.YAMLMap.tagName&&a==="map"||o===tN.YAMLSeq.tagName&&a==="seq")return qc(t,e,n,s,o);let c=e.schema.tags.find(h=>h.tag===o&&h.collection===a);if(!c){let h=e.schema.knownTags[o];if(h?.collection===a)e.schema.tags.push(Object.assign({},h,{default:!1})),c=h;else return h?s(i,"BAD_COLLECTION_TYPE",`${h.tag} used for ${a} collection, but expects ${h.collection??"scalar"}`,!0):s(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),qc(t,e,n,s,o)}let l=qc(t,e,n,s,o,c),u=c.resolve?.(l,h=>s(i,"TAG_RESOLVE_FAILED",h),e.options)??l,f=XO.isNode(u)?u:new QO.Scalar(u);return f.range=l.range,f.tag=o,c?.format&&(f.format=c.format),f}im.composeCollection=iN});var Bc=S(am=>{"use strict";d();var Fc=he();function oN(t,e,n){let r=e.offset,s=aN(e,t.options.strict,n);if(!s)return{value:"",type:null,comment:"",range:[r,r,r]};let i=s.mode===">"?Fc.Scalar.BLOCK_FOLDED:Fc.Scalar.BLOCK_LITERAL,o=e.source?cN(e.source):[],a=o.length;for(let m=o.length-1;m>=0;--m){let y=o[m][1];if(y===""||y==="\r")a=m;else break}if(a===0){let m=s.chomp==="+"&&o.length>0?`
93
+ `.repeat(Math.max(1,o.length-1)):"",y=r+s.length;return e.source&&(y+=e.source.length),{value:m,type:i,comment:s.comment,range:[r,y,y]}}let c=e.indent+s.indent,l=e.offset+s.length,u=0;for(let m=0;m<a;++m){let[y,b]=o[m];if(b===""||b==="\r")s.indent===0&&y.length>c&&(c=y.length);else{y.length<c&&n(l+y.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),s.indent===0&&(c=y.length),u=m,c===0&&!t.atRoot&&n(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=y.length+b.length+1}for(let m=o.length-1;m>=a;--m)o[m][0].length>c&&(a=m+1);let f="",h="",g=!1;for(let m=0;m<u;++m)f+=o[m][0].slice(c)+`
94
+ `;for(let m=u;m<a;++m){let[y,b]=o[m];l+=y.length+b.length+1;let v=b[b.length-1]==="\r";if(v&&(b=b.slice(0,-1)),b&&y.length<c){let N=`Block scalar lines must not be less indented than their ${s.indent?"explicit indentation indicator":"first line"}`;n(l-b.length-(v?2:1),"BAD_INDENT",N),y=""}i===Fc.Scalar.BLOCK_LITERAL?(f+=h+y.slice(c)+b,h=`
95
+ `):y.length>c||b[0]===" "?(h===" "?h=`
96
+ `:!g&&h===`
97
+ `&&(h=`
98
+
99
+ `),f+=h+y.slice(c)+b,h=`
100
+ `,g=!0):b===""?h===`
101
+ `?f+=`
102
+ `:h=`
103
+ `:(f+=h+b,h=" ",g=!1)}switch(s.chomp){case"-":break;case"+":for(let m=a;m<o.length;++m)f+=`
104
+ `+o[m][0].slice(c);f[f.length-1]!==`
105
+ `&&(f+=`
106
+ `);break;default:f+=`
107
+ `}let p=r+s.length+e.source.length;return{value:f,type:i,comment:s.comment,range:[r,p,p]}}function aN({offset:t,props:e},n,r){if(e[0].type!=="block-scalar-header")return r(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:s}=e[0],i=s[0],o=0,a="",c=-1;for(let h=1;h<s.length;++h){let g=s[h];if(!a&&(g==="-"||g==="+"))a=g;else{let p=Number(g);!o&&p?o=p:c===-1&&(c=t+h)}}c!==-1&&r(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${s}`);let l=!1,u="",f=s.length;for(let h=1;h<e.length;++h){let g=e[h];switch(g.type){case"space":l=!0;case"newline":f+=g.source.length;break;case"comment":n&&!l&&r(g,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=g.source.length,u=g.source.substring(1);break;case"error":r(g,"UNEXPECTED_TOKEN",g.message),f+=g.source.length;break;default:{let p=`Unexpected token in block scalar header: ${g.type}`;r(g,"UNEXPECTED_TOKEN",p);let m=g.source;m&&typeof m=="string"&&(f+=m.length)}}}return{mode:i,indent:o,chomp:a,comment:u,length:f}}function cN(t){let e=t.split(/\n( *)/),n=e[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let o=1;o<e.length;o+=2)i.push([e[o],e[o+1]]);return i}am.resolveBlockScalar=oN});var Uc=S(lm=>{"use strict";d();var Dc=he(),lN=Dn();function uN(t,e,n){let{offset:r,type:s,source:i,end:o}=t,a,c,l=(h,g,p)=>n(r+h,g,p);switch(s){case"scalar":a=Dc.Scalar.PLAIN,c=fN(i,l);break;case"single-quoted-scalar":a=Dc.Scalar.QUOTE_SINGLE,c=dN(i,l);break;case"double-quoted-scalar":a=Dc.Scalar.QUOTE_DOUBLE,c=hN(i,l);break;default:return n(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${s}`),{value:"",type:null,comment:"",range:[r,r+i.length,r+i.length]}}let u=r+i.length,f=lN.resolveEnd(o,u,e,n);return{value:c,type:a,comment:f.comment,range:[r,u,f.offset]}}function fN(t,e){let n="";switch(t[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${t[0]}`;break}case"@":case"`":{n=`reserved character ${t[0]}`;break}}return n&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),cm(t)}function dN(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),cm(t.slice(1,-1)).replace(/''/g,"'")}function cm(t){let e,n;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
108
+ `,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
109
+ `,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=e.exec(t);if(!r)return t;let s=r[1],i=" ",o=e.lastIndex;for(n.lastIndex=o;r=n.exec(t);)r[1]===""?i===`
110
+ `?s+=i:i=`
111
+ `:(s+=i+r[1],i=" "),o=n.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=o,r=a.exec(t),s+i+(r?.[1]??"")}function hN(t,e){let n="";for(let r=1;r<t.length-1;++r){let s=t[r];if(!(s==="\r"&&t[r+1]===`
112
+ `))if(s===`
113
+ `){let{fold:i,offset:o}=pN(t,r);n+=i,r=o}else if(s==="\\"){let i=t[++r],o=mN[i];if(o)n+=o;else if(i===`
114
+ `)for(i=t[r+1];i===" "||i===" ";)i=t[++r+1];else if(i==="\r"&&t[r+1]===`
115
+ `)for(i=t[++r+1];i===" "||i===" ";)i=t[++r+1];else if(i==="x"||i==="u"||i==="U"){let a={x:2,u:4,U:8}[i];n+=gN(t,r+1,a,e),r+=a}else{let a=t.substr(r-1,2);e(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),n+=a}}else if(s===" "||s===" "){let i=r,o=t[r+1];for(;o===" "||o===" ";)o=t[++r+1];o!==`
116
+ `&&!(o==="\r"&&t[r+2]===`
117
+ `)&&(n+=r>i?t.slice(i,r+1):s)}else n+=s}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),n}function pN(t,e){let n="",r=t[e+1];for(;(r===" "||r===" "||r===`
118
+ `||r==="\r")&&!(r==="\r"&&t[e+2]!==`
119
+ `);)r===`
120
+ `&&(n+=`
121
+ `),e+=1,r=t[e+1];return n||(n=" "),{fold:n,offset:e}}var mN={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
122
+ `,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function gN(t,e,n,r){let s=t.substr(e,n),o=s.length===n&&/^[0-9a-fA-F]+$/.test(s)?parseInt(s,16):NaN;if(isNaN(o)){let a=t.substr(e-2,n+2);return r(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}return String.fromCodePoint(o)}lm.resolveFlowScalar=uN});var dm=S(fm=>{"use strict";d();var an=Z(),um=he(),yN=Bc(),_N=Uc();function wN(t,e,n,r){let{value:s,type:i,comment:o,range:a}=e.type==="block-scalar"?yN.resolveBlockScalar(t,e,r):_N.resolveFlowScalar(e,t.options.strict,r),c=n?t.directives.tagName(n.source,f=>r(n,"TAG_RESOLVE_FAILED",f)):null,l;t.options.stringKeys&&t.atKey?l=t.schema[an.SCALAR]:c?l=bN(t.schema,s,c,n,r):e.type==="scalar"?l=vN(t,s,e,r):l=t.schema[an.SCALAR];let u;try{let f=l.resolve(s,h=>r(n??e,"TAG_RESOLVE_FAILED",h),t.options);u=an.isScalar(f)?f:new um.Scalar(f)}catch(f){let h=f instanceof Error?f.message:String(f);r(n??e,"TAG_RESOLVE_FAILED",h),u=new um.Scalar(s)}return u.range=a,u.source=s,i&&(u.type=i),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function bN(t,e,n,r,s){if(n==="!")return t[an.SCALAR];let i=[];for(let a of t.tags)if(!a.collection&&a.tag===n)if(a.default&&a.test)i.push(a);else return a;for(let a of i)if(a.test?.test(e))return a;let o=t.knownTags[n];return o&&!o.collection?(t.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(s(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),t[an.SCALAR])}function vN({atKey:t,directives:e,schema:n},r,s,i){let o=n.tags.find(a=>(a.default===!0||t&&a.default==="key")&&a.test?.test(r))||n[an.SCALAR];if(n.compat){let a=n.compat.find(c=>c.default&&c.test?.test(r))??n[an.SCALAR];if(o.tag!==a.tag){let c=e.tagString(o.tag),l=e.tagString(a.tag),u=`Value may be parsed as either ${c} or ${l}`;i(s,"TAG_RESOLVE_FAILED",u,!0)}}return o}fm.composeScalar=wN});var pm=S(hm=>{"use strict";d();function SN(t,e,n){if(e){n??(n=e.length);for(let r=n-1;r>=0;--r){let s=e[r];switch(s.type){case"space":case"comment":case"newline":t-=s.source.length;continue}for(s=e[++r];s?.type==="space";)t+=s.source.length,s=e[++r];break}}return t}hm.emptyScalarPosition=SN});var ym=S(Kc=>{"use strict";d();var EN=hr(),kN=Z(),xN=om(),mm=dm(),TN=Dn(),ON=pm(),NN={composeNode:gm,composeEmptyNode:Vc};function gm(t,e,n,r){let s=t.atKey,{spaceBefore:i,comment:o,anchor:a,tag:c}=n,l,u=!0;switch(e.type){case"alias":l=AN(t,e,r),(a||c)&&r(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=mm.composeScalar(t,e,c,r),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=xN.composeCollection(NN,t,e,n,r),a&&(l.anchor=a.source.substring(1))}catch(f){let h=f instanceof Error?f.message:String(f);r(e,"RESOURCE_EXHAUSTION",h)}break;default:{let f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;r(e,"UNEXPECTED_TOKEN",f),u=!1}}return l??(l=Vc(t,e.offset,void 0,null,n,r)),a&&l.anchor===""&&r(a,"BAD_ALIAS","Anchor cannot be an empty string"),s&&t.options.stringKeys&&(!kN.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&r(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),i&&(l.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?l.comment=o:l.commentBefore=o),t.options.keepSourceTokens&&u&&(l.srcToken=e),l}function Vc(t,e,n,r,{spaceBefore:s,comment:i,anchor:o,tag:a,end:c},l){let u={type:"scalar",offset:ON.emptyScalarPosition(e,n,r),indent:-1,source:""},f=mm.composeScalar(t,u,a,l);return o&&(f.anchor=o.source.substring(1),f.anchor===""&&l(o,"BAD_ALIAS","Anchor cannot be an empty string")),s&&(f.spaceBefore=!0),i&&(f.comment=i,f.range[2]=c),f}function AN({options:t},{offset:e,source:n,end:r},s){let i=new EN.Alias(n.substring(1));i.source===""&&s(e,"BAD_ALIAS","Alias cannot be an empty string"),i.source.endsWith(":")&&s(e+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+n.length,a=TN.resolveEnd(r,o,t.strict,s);return i.range=[e,o,a.offset],a.comment&&(i.comment=a.comment),i}Kc.composeEmptyNode=Vc;Kc.composeNode=gm});var bm=S(wm=>{"use strict";d();var CN=Cr(),_m=ym(),IN=Dn(),PN=Rr();function LN(t,e,{offset:n,start:r,value:s,end:i},o){let a=Object.assign({_directives:e},t),c=new CN.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=PN.resolveProps(r,{indicator:"doc-start",next:s??i?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});u.found&&(c.directives.docStart=!0,s&&(s.type==="block-map"||s.type==="block-seq")&&!u.hasNewline&&o(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=s?_m.composeNode(l,s,u,o):_m.composeEmptyNode(l,u.end,r,null,u,o);let f=c.contents.range[2],h=IN.resolveEnd(i,f,!1,o);return h.comment&&(c.comment=h.comment),c.range=[n,f,h.offset],c}wm.composeDoc=LN});var Wc=S(Em=>{"use strict";d();var RN=X("process"),jN=Ia(),$N=Cr(),jr=Lr(),vm=Z(),MN=bm(),qN=Dn();function $r(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:n}=t;return[e,e+(typeof n=="string"?n.length:1)]}function Sm(t){let e="",n=!1,r=!1;for(let s=0;s<t.length;++s){let i=t[s];switch(i[0]){case"#":e+=(e===""?"":r?`
123
+
124
+ `:`
125
+ `)+(i.substring(1)||" "),n=!0,r=!1;break;case"%":t[s+1]?.[0]!=="#"&&(s+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:e,afterEmptyLine:r}}var Gc=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,s,i)=>{let o=$r(n);i?this.warnings.push(new jr.YAMLWarning(o,r,s)):this.errors.push(new jr.YAMLParseError(o,r,s))},this.directives=new jN.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,n){let{comment:r,afterEmptyLine:s}=Sm(this.prelude);if(r){let i=e.contents;if(n)e.comment=e.comment?`${e.comment}
126
+ ${r}`:r;else if(s||e.directives.docStart||!i)e.commentBefore=r;else if(vm.isCollection(i)&&!i.flow&&i.items.length>0){let o=i.items[0];vm.isPair(o)&&(o=o.key);let a=o.commentBefore;o.commentBefore=a?`${r}
127
+ ${a}`:r}else{let o=i.commentBefore;i.commentBefore=o?`${r}
128
+ ${o}`:r}}n?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Sm(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,n=!1,r=-1){for(let s of e)yield*this.next(s);yield*this.end(n,r)}*next(e){switch(RN.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(n,r,s)=>{let i=$r(e);i[0]+=n,this.onError(i,"BAD_DIRECTIVE",r,s)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let n=MN.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let n=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,r=new jr.YAMLParseError($r(e),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){let r="Unexpected doc-end without preceding document";this.errors.push(new jr.YAMLParseError($r(e),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;let n=qN.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){let r=this.doc.comment;this.doc.comment=r?`${r}
129
+ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new jr.YAMLParseError($r(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let r=Object.assign({_directives:this.directives},this.options),s=new $N.Document(void 0,r);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),s.range=[0,n,n],this.decorate(s,!1),yield s}}};Em.Composer=Gc});var Tm=S(Ei=>{"use strict";d();var FN=Bc(),BN=Uc(),DN=Lr(),km=_r();function UN(t,e=!0,n){if(t){let r=(s,i,o)=>{let a=typeof s=="number"?s:Array.isArray(s)?s[0]:s.offset;if(n)n(a,i,o);else throw new DN.YAMLParseError([a,a+1],i,o)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return BN.resolveFlowScalar(t,e,r);case"block-scalar":return FN.resolveBlockScalar({options:{strict:e}},t,r)}}return null}function VN(t,e){let{implicitKey:n=!1,indent:r,inFlow:s=!1,offset:i=-1,type:o="PLAIN"}=e,a=km.stringifyString({type:o,value:t},{implicitKey:n,indent:r>0?" ".repeat(r):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:r,source:`
130
+ `}];switch(a[0]){case"|":case">":{let l=a.indexOf(`
131
+ `),u=a.substring(0,l),f=a.substring(l+1)+`
132
+ `,h=[{type:"block-scalar-header",offset:i,indent:r,source:u}];return xm(h,c)||h.push({type:"newline",offset:-1,indent:r,source:`
133
+ `}),{type:"block-scalar",offset:i,indent:r,props:h,source:f}}case'"':return{type:"double-quoted-scalar",offset:i,indent:r,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:i,indent:r,source:a,end:c};default:return{type:"scalar",offset:i,indent:r,source:a,end:c}}}function KN(t,e,n={}){let{afterKey:r=!1,implicitKey:s=!1,inFlow:i=!1,type:o}=n,a="indent"in t?t.indent:null;if(r&&typeof a=="number"&&(a+=2),!o)switch(t.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let l=t.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}let c=km.stringifyString({type:o,value:e},{implicitKey:s||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":GN(t,c);break;case'"':Jc(t,c,"double-quoted-scalar");break;case"'":Jc(t,c,"single-quoted-scalar");break;default:Jc(t,c,"scalar")}}function GN(t,e){let n=e.indexOf(`
134
+ `),r=e.substring(0,n),s=e.substring(n+1)+`
135
+ `;if(t.type==="block-scalar"){let i=t.props[0];if(i.type!=="block-scalar-header")throw new Error("Invalid block scalar header");i.source=r,t.source=s}else{let{offset:i}=t,o="indent"in t?t.indent:-1,a=[{type:"block-scalar-header",offset:i,indent:o,source:r}];xm(a,"end"in t?t.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:`
136
+ `});for(let c of Object.keys(t))c!=="type"&&c!=="offset"&&delete t[c];Object.assign(t,{type:"block-scalar",indent:o,props:a,source:s})}}function xm(t,e){if(e)for(let n of e)switch(n.type){case"space":case"comment":t.push(n);break;case"newline":return t.push(n),!0}return!1}function Jc(t,e,n){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=n,t.source=e;break;case"block-scalar":{let r=t.props.slice(1),s=e.length;t.props[0].type==="block-scalar-header"&&(s-=t.props[0].source.length);for(let i of r)i.offset+=s;delete t.props,Object.assign(t,{type:n,source:e,end:r});break}case"block-map":case"block-seq":{let s={type:"newline",offset:t.offset+e.length,indent:t.indent,source:`
137
+ `};delete t.items,Object.assign(t,{type:n,source:e,end:[s]});break}default:{let r="indent"in t?t.indent:-1,s="end"in t&&Array.isArray(t.end)?t.end.filter(i=>i.type==="space"||i.type==="comment"||i.type==="newline"):[];for(let i of Object.keys(t))i!=="type"&&i!=="offset"&&delete t[i];Object.assign(t,{type:n,indent:r,source:e,end:s})}}}Ei.createScalarToken=VN;Ei.resolveAsScalar=UN;Ei.setScalarValue=KN});var Nm=S(Om=>{"use strict";d();var WN=t=>"type"in t?xi(t):ki(t);function xi(t){switch(t.type){case"block-scalar":{let e="";for(let n of t.props)e+=xi(n);return e+t.source}case"block-map":case"block-seq":{let e="";for(let n of t.items)e+=ki(n);return e}case"flow-collection":{let e=t.start.source;for(let n of t.items)e+=ki(n);for(let n of t.end)e+=n.source;return e}case"document":{let e=ki(t);if(t.end)for(let n of t.end)e+=n.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let n of t.end)e+=n.source;return e}}}function ki({start:t,key:e,sep:n,value:r}){let s="";for(let i of t)s+=i.source;if(e&&(s+=xi(e)),n)for(let i of n)s+=i.source;return r&&(s+=xi(r)),s}Om.stringify=WN});var Pm=S(Im=>{"use strict";d();var Yc=Symbol("break visit"),JN=Symbol("skip children"),Am=Symbol("remove item");function cn(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),Cm(Object.freeze([]),t,e)}cn.BREAK=Yc;cn.SKIP=JN;cn.REMOVE=Am;cn.itemAtPath=(t,e)=>{let n=t;for(let[r,s]of e){let i=n?.[r];if(i&&"items"in i)n=i.items[s];else return}return n};cn.parentCollection=(t,e)=>{let n=cn.itemAtPath(t,e.slice(0,-1)),r=e[e.length-1][0],s=n?.[r];if(s&&"items"in s)return s;throw new Error("Parent collection not found")};function Cm(t,e,n){let r=n(e,t);if(typeof r=="symbol")return r;for(let s of["key","value"]){let i=e[s];if(i&&"items"in i){for(let o=0;o<i.items.length;++o){let a=Cm(Object.freeze(t.concat([[s,o]])),i.items[o],n);if(typeof a=="number")o=a-1;else{if(a===Yc)return Yc;a===Am&&(i.items.splice(o,1),o-=1)}}typeof r=="function"&&s==="key"&&(r=r(e,t))}}return typeof r=="function"?r(e,t):r}Im.visit=cn});var Ti=S(xe=>{"use strict";d();var zc=Tm(),YN=Nm(),zN=Pm(),Hc="\uFEFF",Zc="",Xc="",Qc="",HN=t=>!!t&&"items"in t,ZN=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function XN(t){switch(t){case Hc:return"<BOM>";case Zc:return"<DOC>";case Xc:return"<FLOW_END>";case Qc:return"<SCALAR>";default:return JSON.stringify(t)}}function QN(t){switch(t){case Hc:return"byte-order-mark";case Zc:return"doc-mode";case Xc:return"flow-error-end";case Qc:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
138
+ `:case`\r
139
+ `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}xe.createScalarToken=zc.createScalarToken;xe.resolveAsScalar=zc.resolveAsScalar;xe.setScalarValue=zc.setScalarValue;xe.stringify=YN.stringify;xe.visit=zN.visit;xe.BOM=Hc;xe.DOCUMENT=Zc;xe.FLOW_END=Xc;xe.SCALAR=Qc;xe.isCollection=HN;xe.isScalar=ZN;xe.prettyToken=XN;xe.tokenType=QN});var nl=S(Rm=>{"use strict";d();var Mr=Ti();function Ke(t){switch(t){case void 0:case" ":case`
140
+ `:case"\r":case" ":return!0;default:return!1}}var Lm=new Set("0123456789ABCDEFabcdef"),e1=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Oi=new Set(",[]{}"),t1=new Set(` ,[]{}
141
+ \r `),el=t=>!t||t1.has(t),tl=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,n=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!n;let r=this.next??"stream";for(;r&&(n||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let e=this.pos,n=this.buffer[e];for(;n===" "||n===" ";)n=this.buffer[++e];return!n||n==="#"||n===`
142
+ `?!0:n==="\r"?this.buffer[e+1]===`
143
+ `:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let n=this.buffer[e];if(this.indentNext>0){let r=0;for(;n===" ";)n=this.buffer[++r+e];if(n==="\r"){let s=this.buffer[r+e+1];if(s===`
144
+ `||!s&&!this.atEnd)return e+r+1}return n===`
145
+ `||r>=this.indentNext||!n&&!this.atEnd?e+r:-1}if(n==="-"||n==="."){let r=this.buffer.substr(e,3);if((r==="---"||r==="...")&&Ke(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
146
+ `,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===Mr.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let n=e.length,r=e.indexOf("#");for(;r!==-1;){let i=e[r-1];if(i===" "||i===" "){n=r-1;break}else r=e.indexOf("#",r+1)}for(;;){let i=e[n-1];if(i===" "||i===" ")n-=1;else break}let s=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-s),this.pushNewline(),"stream"}if(this.atLineEnd()){let n=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-n),yield*this.pushNewline(),"stream"}return yield Mr.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let n=this.peek(3);if((n==="---"||n==="...")&&Ke(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,n==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!Ke(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&Ke(n)){let r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(e[n]){case"#":yield*this.pushCount(e.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(el),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,n,r=-1;do e=yield*this.pushNewline(),e>0?(n=yield*this.pushSpaces(!1),this.indentValue=r=n):n=0,n+=yield*this.pushSpaces(!0);while(e+n>0);let s=this.getLine();if(s===null)return this.setNext("flow");if((r!==-1&&r<this.indentNext&&s[0]!=="#"||r===0&&(s.startsWith("---")||s.startsWith("..."))&&Ke(s[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(s[0]==="]"||s[0]==="}")))return this.flowLevel=0,yield Mr.FLOW_END,yield*this.parseLineStart();let i=0;for(;s[i]===",";)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),s[i]){case void 0:return"flow";case"#":return yield*this.pushCount(s.length-i),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(el),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||Ke(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),n=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let i=0;for(;this.buffer[n-1-i]==="\\";)i+=1;if(i%2===0)break;n=this.buffer.indexOf('"',n+1)}let r=this.buffer.substring(0,n),s=r.indexOf(`
147
+ `,this.pos);if(s!==-1){for(;s!==-1;){let i=this.continueScalar(s+1);if(i===-1)break;s=r.indexOf(`
148
+ `,i)}s!==-1&&(n=s-(r[s-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let n=this.buffer[++e];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>Ke(n)||n==="#")}*parseBlockScalar(){let e=this.pos-1,n=0,r;e:for(let i=this.pos;r=this.buffer[i];++i)switch(r){case" ":n+=1;break;case`
149
+ `:e=i,n=0;break;case"\r":{let o=this.buffer[i+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
150
+ `)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let i=this.continueScalar(e+1);if(i===-1)break;e=this.buffer.indexOf(`
151
+ `,i)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let s=e+1;for(r=this.buffer[s];r===" ";)r=this.buffer[++s];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===`
152
+ `;)r=this.buffer[++s];e=s-1}else if(!this.blockScalarKeep)do{let i=e-1,o=this.buffer[i];o==="\r"&&(o=this.buffer[--i]);let a=i;for(;o===" ";)o=this.buffer[--i];if(o===`
153
+ `&&i>=this.pos&&i+1+n>a)e=i;else break}while(!0);return yield Mr.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,n=this.pos-1,r=this.pos-1,s;for(;s=this.buffer[++r];)if(s===":"){let i=this.buffer[r+1];if(Ke(i)||e&&Oi.has(i))break;n=r}else if(Ke(s)){let i=this.buffer[r+1];if(s==="\r"&&(i===`
154
+ `?(r+=1,s=`
155
+ `,i=this.buffer[r+1]):n=r),i==="#"||e&&Oi.has(i))break;if(s===`
156
+ `){let o=this.continueScalar(r+1);if(o===-1)break;r=Math.max(r,o-2)}}else{if(e&&Oi.has(s))break;n=r}return!s&&!this.atEnd?this.setNext("plain-scalar"):(yield Mr.SCALAR,yield*this.pushToIndex(n+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,n){let r=this.buffer.slice(this.pos,e);return r?(yield r,this.pos+=r.length,r.length):(n&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(el))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let e=this.flowLevel>0,n=this.charAt(1);if(Ke(n)||e&&Oi.has(n))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,n=this.buffer[e];for(;!Ke(n)&&n!==">";)n=this.buffer[++e];return yield*this.pushToIndex(n===">"?e+1:e,!1)}else{let e=this.pos+1,n=this.buffer[e];for(;n;)if(e1.has(n))n=this.buffer[++e];else if(n==="%"&&Lm.has(this.buffer[e+1])&&Lm.has(this.buffer[e+2]))n=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
157
+ `?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
158
+ `?yield*this.pushCount(2):0}*pushSpaces(e){let n=this.pos-1,r;do r=this.buffer[++n];while(r===" "||e&&r===" ");let s=n-this.pos;return s>0&&(yield this.buffer.substr(this.pos,s),this.pos=n),s}*pushUntil(e){let n=this.pos,r=this.buffer[n];for(;!e(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}};Rm.Lexer=tl});var sl=S(jm=>{"use strict";d();var rl=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let n=0,r=this.lineStarts.length;for(;n<r;){let i=n+r>>1;this.lineStarts[i]<e?n=i+1:r=i}if(this.lineStarts[n]===e)return{line:n+1,col:1};if(n===0)return{line:0,col:e};let s=this.lineStarts[n-1];return{line:n,col:e-s+1}}}};jm.LineCounter=rl});var ol=S(Bm=>{"use strict";d();var n1=X("process"),$m=Ti(),r1=nl();function Tt(t,e){for(let n=0;n<t.length;++n)if(t[n].type===e)return!0;return!1}function Mm(t){for(let e=0;e<t.length;++e)switch(t[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function Fm(t){switch(t?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Ni(t){switch(t.type){case"document":return t.start;case"block-map":{let e=t.items[t.items.length-1];return e.sep??e.start}case"block-seq":return t.items[t.items.length-1].start;default:return[]}}function Un(t){if(t.length===0)return[];let e=t.length;e:for(;--e>=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function qm(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!Tt(e.start,"explicit-key-ind")&&!Tt(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,Fm(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}var il=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new r1.Lexer,this.onNewLine=e}*parse(e,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let r of this.lexer.lex(e,n))yield*this.next(r);n||(yield*this.end())}*next(e){if(this.source=e,n1.env.LOG_TOKENS&&console.log("|",$m.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let n=$m.tokenType(e);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let r=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:r,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let n=e??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{let r=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in r?r.indent:0:n.type==="flow-collection"&&r.type==="document"&&(n.indent=0),n.type==="flow-collection"&&qm(n),r.type){case"document":r.value=n;break;case"block-scalar":r.props.push(n);break;case"block-map":{let s=r.items[r.items.length-1];if(s.value){r.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(s.sep)s.value=n;else{Object.assign(s,{key:n,sep:[]}),this.onKeyLine=!s.explicitKey;return}break}case"block-seq":{let s=r.items[r.items.length-1];s.value?r.items.push({start:[],value:n}):s.value=n;break}case"flow-collection":{let s=r.items[r.items.length-1];!s||s.value?r.items.push({start:[],key:n,sep:[]}):s.sep?s.value=n:Object.assign(s,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){let s=n.items[n.items.length-1];s&&!s.sep&&!s.value&&s.start.length>0&&Mm(s.start)===-1&&(n.indent===0||s.start.every(i=>i.type!=="comment"||i.indent<n.indent))&&(r.type==="document"?r.end=s.start:r.items.push({start:s.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{Mm(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let n=Ni(this.peek(2)),r=Un(n),s;e.end?(s=e.end,s.push(this.sourceToken),delete e.end):s=[this.sourceToken];let i={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
159
+ `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
160
+ `,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){let r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,e.indent)){let s=e.items[e.items.length-2]?.value?.end;if(Array.isArray(s)){Array.prototype.push.apply(s,n.start),s.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let r=!this.onKeyLine&&this.indent===e.indent,s=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind",i=[];if(s&&n.sep&&!n.value){let o=[];for(let a=0;a<n.sep.length;++a){let c=n.sep[a];switch(c.type){case"newline":o.push(a);break;case"space":break;case"comment":c.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(i=n.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":s||n.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):s||n.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Tt(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(Fm(n.key)&&!Tt(n.sep,"newline")){let o=Un(n.start),a=n.key,c=n.sep;c.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:c}]})}else i.length>0?n.sep=n.sep.concat(i,this.sourceToken):n.sep.push(this.sourceToken);else if(Tt(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{let o=Un(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||s?e.items.push({start:i,key:null,sep:[this.sourceToken]}):Tt(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);s||n.value?(e.items.push({start:i,key:o,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(o):(Object.assign(n,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Tt(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&e.items.push({start:i});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(n.value){let r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,e.indent)){let s=e.items[e.items.length-2]?.value?.end;if(Array.isArray(s)){Array.prototype.push.apply(s,n.start),s.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=e.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;n.value||Tt(n.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>e.indent){let r=this.startBlockValue(e);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let n=e.items[e.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?e.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let s=this.flowScalar(this.type);!n||n.value?e.items.push({start:[],key:s,sep:[]}):n.sep?this.stack.push(s):Object.assign(n,{key:s,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let r=this.startBlockValue(e);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{let r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===e.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){let s=Ni(r),i=Un(s);qm(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let n=this.source.indexOf(`
161
+ `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
162
+ `,n)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let n=Ni(e),r=Un(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=Ni(e),r=Un(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,n){return this.type!=="comment"||this.indent<=n?!1:e.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};Bm.Parser=il});var Gm=S(Fr=>{"use strict";d();var Dm=Wc(),s1=Cr(),qr=Lr(),i1=Ka(),o1=Z(),a1=sl(),Um=ol();function Vm(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new a1.LineCounter||null,prettyErrors:e}}function c1(t,e={}){let{lineCounter:n,prettyErrors:r}=Vm(e),s=new Um.Parser(n?.addNewLine),i=new Dm.Composer(e),o=Array.from(i.compose(s.parse(t)));if(r&&n)for(let a of o)a.errors.forEach(qr.prettifyError(t,n)),a.warnings.forEach(qr.prettifyError(t,n));return o.length>0?o:Object.assign([],{empty:!0},i.streamInfo())}function Km(t,e={}){let{lineCounter:n,prettyErrors:r}=Vm(e),s=new Um.Parser(n?.addNewLine),i=new Dm.Composer(e),o=null;for(let a of i.compose(s.parse(t),!0,t.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new qr.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(o.errors.forEach(qr.prettifyError(t,n)),o.warnings.forEach(qr.prettifyError(t,n))),o}function l1(t,e,n){let r;typeof e=="function"?r=e:n===void 0&&e&&typeof e=="object"&&(n=e);let s=Km(t,n);if(!s)return null;if(s.warnings.forEach(i=>i1.warn(s.options.logLevel,i)),s.errors.length>0){if(s.options.logLevel!=="silent")throw s.errors[0];s.errors=[]}return s.toJS(Object.assign({reviver:r},n))}function u1(t,e,n){let r=null;if(typeof e=="function"||Array.isArray(e)?r=e:n===void 0&&e&&(n=e),typeof n=="string"&&(n=n.length),typeof n=="number"){let s=Math.round(n);n=s<1?void 0:s>8?{indent:8}:{indent:s}}if(t===void 0){let{keepUndefined:s}=n??e??{};if(!s)return}return o1.isDocument(t)&&!r?t.toString(n):new s1.Document(t,r,n).toString(n)}Fr.parse=l1;Fr.parseAllDocuments=c1;Fr.parseDocument=Km;Fr.stringify=u1});var Br=S(te=>{"use strict";d();var f1=Wc(),d1=Cr(),h1=Tc(),al=Lr(),p1=hr(),Ot=Z(),m1=St(),g1=he(),y1=kt(),_1=xt(),w1=Ti(),b1=nl(),v1=sl(),S1=ol(),Ai=Gm(),Wm=lr();te.Composer=f1.Composer;te.Document=d1.Document;te.Schema=h1.Schema;te.YAMLError=al.YAMLError;te.YAMLParseError=al.YAMLParseError;te.YAMLWarning=al.YAMLWarning;te.Alias=p1.Alias;te.isAlias=Ot.isAlias;te.isCollection=Ot.isCollection;te.isDocument=Ot.isDocument;te.isMap=Ot.isMap;te.isNode=Ot.isNode;te.isPair=Ot.isPair;te.isScalar=Ot.isScalar;te.isSeq=Ot.isSeq;te.Pair=m1.Pair;te.Scalar=g1.Scalar;te.YAMLMap=y1.YAMLMap;te.YAMLSeq=_1.YAMLSeq;te.CST=w1;te.Lexer=b1.Lexer;te.LineCounter=v1.LineCounter;te.Parser=S1.Parser;te.parse=Ai.parse;te.parseAllDocuments=Ai.parseAllDocuments;te.parseDocument=Ai.parseDocument;te.stringify=Ai.stringify;te.visit=Wm.visit;te.visitAsync=Wm.visitAsync});var Dr=S(Ge=>{"use strict";d();var Zm=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",k1=Zm+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",Xm="["+Zm+"]["+k1+"]*",x1=new RegExp("^"+Xm+"$"),T1=function(t,e){let n=[],r=e.exec(t);for(;r;){let s=[];s.startIndex=e.lastIndex-r[0].length;let i=r.length;for(let o=0;o<i;o++)s.push(r[o]);n.push(s),r=e.exec(t)}return n},O1=function(t){let e=x1.exec(t);return!(e===null||typeof e>"u")};Ge.isExist=function(t){return typeof t<"u"};Ge.isEmptyObject=function(t){return Object.keys(t).length===0};Ge.merge=function(t,e,n){if(e){let r=Object.keys(e),s=r.length;for(let i=0;i<s;i++)n==="strict"?t[r[i]]=[e[r[i]]]:t[r[i]]=e[r[i]]}};Ge.getValue=function(t){return Ge.isExist(t)?t:""};var N1=["hasOwnProperty","toString","valueOf","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"],A1=["__proto__","constructor","prototype"];Ge.isName=O1;Ge.getAllMatches=T1;Ge.nameRegexp=Xm;Ge.DANGEROUS_PROPERTY_NAMES=N1;Ge.criticalProperties=A1});var ul=S(rg=>{"use strict";d();var ll=Dr(),C1={allowBooleanAttributes:!1,unpairedTags:[]};rg.validate=function(t,e){e=Object.assign({},C1,e);let n=[],r=!1,s=!1;t[0]==="\uFEFF"&&(t=t.substr(1));for(let i=0;i<t.length;i++)if(t[i]==="<"&&t[i+1]==="?"){if(i+=2,i=eg(t,i),i.err)return i}else if(t[i]==="<"){let o=i;if(i++,t[i]==="!"){i=tg(t,i);continue}else{let a=!1;t[i]==="/"&&(a=!0,i++);let c="";for(;i<t.length&&t[i]!==">"&&t[i]!==" "&&t[i]!==" "&&t[i]!==`
163
+ `&&t[i]!=="\r";i++)c+=t[i];if(c=c.trim(),c[c.length-1]==="/"&&(c=c.substring(0,c.length-1),i--),!q1(c)){let f;return c.trim().length===0?f="Invalid space after '<'.":f="Tag '"+c+"' is an invalid name.",de("InvalidTag",f,be(t,i))}let l=L1(t,i);if(l===!1)return de("InvalidAttr","Attributes for '"+c+"' have open quote.",be(t,i));let u=l.value;if(i=l.index,u[u.length-1]==="/"){let f=i-u.length;u=u.substring(0,u.length-1);let h=ng(u,e);if(h===!0)r=!0;else return de(h.err.code,h.err.msg,be(t,f+h.err.line))}else if(a)if(l.tagClosed){if(u.trim().length>0)return de("InvalidTag","Closing tag '"+c+"' can't have attributes or invalid starting.",be(t,o));if(n.length===0)return de("InvalidTag","Closing tag '"+c+"' has not been opened.",be(t,o));{let f=n.pop();if(c!==f.tagName){let h=be(t,f.tagStartPos);return de("InvalidTag","Expected closing tag '"+f.tagName+"' (opened in line "+h.line+", col "+h.col+") instead of closing tag '"+c+"'.",be(t,o))}n.length==0&&(s=!0)}}else return de("InvalidTag","Closing tag '"+c+"' doesn't have proper closing.",be(t,i));else{let f=ng(u,e);if(f!==!0)return de(f.err.code,f.err.msg,be(t,i-u.length+f.err.line));if(s===!0)return de("InvalidXml","Multiple possible root nodes found.",be(t,i));e.unpairedTags.indexOf(c)!==-1||n.push({tagName:c,tagStartPos:o}),r=!0}for(i++;i<t.length;i++)if(t[i]==="<")if(t[i+1]==="!"){i++,i=tg(t,i);continue}else if(t[i+1]==="?"){if(i=eg(t,++i),i.err)return i}else break;else if(t[i]==="&"){let f=$1(t,i);if(f==-1)return de("InvalidChar","char '&' is not expected.",be(t,i));i=f}else if(s===!0&&!Qm(t[i]))return de("InvalidXml","Extra text at the end",be(t,i));t[i]==="<"&&i--}}else{if(Qm(t[i]))continue;return de("InvalidChar","char '"+t[i]+"' is not expected.",be(t,i))}if(r){if(n.length==1)return de("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",be(t,n[0].tagStartPos));if(n.length>0)return de("InvalidXml","Invalid '"+JSON.stringify(n.map(i=>i.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return de("InvalidXml","Start tag expected.",1);return!0};function Qm(t){return t===" "||t===" "||t===`
164
+ `||t==="\r"}function eg(t,e){let n=e;for(;e<t.length;e++)if(t[e]=="?"||t[e]==" "){let r=t.substr(n,e-n);if(e>5&&r==="xml")return de("InvalidXml","XML declaration allowed only at the start of the document.",be(t,e));if(t[e]=="?"&&t[e+1]==">"){e++;break}else continue}return e}function tg(t,e){if(t.length>e+5&&t[e+1]==="-"&&t[e+2]==="-"){for(e+=3;e<t.length;e++)if(t[e]==="-"&&t[e+1]==="-"&&t[e+2]===">"){e+=2;break}}else if(t.length>e+8&&t[e+1]==="D"&&t[e+2]==="O"&&t[e+3]==="C"&&t[e+4]==="T"&&t[e+5]==="Y"&&t[e+6]==="P"&&t[e+7]==="E"){let n=1;for(e+=8;e<t.length;e++)if(t[e]==="<")n++;else if(t[e]===">"&&(n--,n===0))break}else if(t.length>e+9&&t[e+1]==="["&&t[e+2]==="C"&&t[e+3]==="D"&&t[e+4]==="A"&&t[e+5]==="T"&&t[e+6]==="A"&&t[e+7]==="["){for(e+=8;e<t.length;e++)if(t[e]==="]"&&t[e+1]==="]"&&t[e+2]===">"){e+=2;break}}return e}var I1='"',P1="'";function L1(t,e){let n="",r="",s=!1;for(;e<t.length;e++){if(t[e]===I1||t[e]===P1)r===""?r=t[e]:r!==t[e]||(r="");else if(t[e]===">"&&r===""){s=!0;break}n+=t[e]}return r!==""?!1:{value:n,index:e,tagClosed:s}}var R1=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function ng(t,e){let n=ll.getAllMatches(t,R1),r={};for(let s=0;s<n.length;s++){if(n[s][1].length===0)return de("InvalidAttr","Attribute '"+n[s][2]+"' has no space in starting.",Ur(n[s]));if(n[s][3]!==void 0&&n[s][4]===void 0)return de("InvalidAttr","Attribute '"+n[s][2]+"' is without value.",Ur(n[s]));if(n[s][3]===void 0&&!e.allowBooleanAttributes)return de("InvalidAttr","boolean attribute '"+n[s][2]+"' is not allowed.",Ur(n[s]));let i=n[s][2];if(!M1(i))return de("InvalidAttr","Attribute '"+i+"' is an invalid name.",Ur(n[s]));if(!r.hasOwnProperty(i))r[i]=1;else return de("InvalidAttr","Attribute '"+i+"' is repeated.",Ur(n[s]))}return!0}function j1(t,e){let n=/\d/;for(t[e]==="x"&&(e++,n=/[\da-fA-F]/);e<t.length;e++){if(t[e]===";")return e;if(!t[e].match(n))break}return-1}function $1(t,e){if(e++,t[e]===";")return-1;if(t[e]==="#")return e++,j1(t,e);let n=0;for(;e<t.length;e++,n++)if(!(t[e].match(/\w/)&&n<20)){if(t[e]===";")break;return-1}return e}function de(t,e,n){return{err:{code:t,msg:e,line:n.line||n,col:n.col}}}function M1(t){return ll.isName(t)}function q1(t){return ll.isName(t)}function be(t,e){let n=t.substring(0,e).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function Ur(t){return t.startIndex+t[1].length}});var cg=S(fl=>{"use strict";d();var{DANGEROUS_PROPERTY_NAMES:sg,criticalProperties:F1}=Dr(),ig=t=>sg.includes(t)?"__"+t:t,og={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,n){return t},captureMetaData:!1,maxNestedTags:100,strictReservedNames:!0,onDangerousProperty:ig};function B1(t,e){if(typeof t!="string")return;let n=t.toLowerCase();if(sg.some(r=>n===r.toLowerCase()))throw new Error(`[SECURITY] Invalid ${e}: "${t}" is a reserved JavaScript keyword that could cause prototype pollution`);if(F1.some(r=>n===r.toLowerCase()))throw new Error(`[SECURITY] Invalid ${e}: "${t}" is a reserved JavaScript keyword that could cause prototype pollution`)}function ag(t){return typeof t=="boolean"?{enabled:t,maxEntitySize:1e4,maxExpansionDepth:10,maxTotalExpansions:1e3,maxExpandedLength:1e5,allowedTags:null,tagFilter:null}:typeof t=="object"&&t!==null?{enabled:t.enabled!==!1,maxEntitySize:Math.max(1,t.maxEntitySize??1e4),maxExpansionDepth:Math.max(1,t.maxExpansionDepth??1e4),maxTotalExpansions:Math.max(1,t.maxTotalExpansions??1/0),maxExpandedLength:Math.max(1,t.maxExpandedLength??1e5),maxEntityCount:Math.max(1,t.maxEntityCount??1e3),allowedTags:t.allowedTags??null,tagFilter:t.tagFilter??null}:ag(!0)}var D1=function(t){let e=Object.assign({},og,t),n=[{value:e.attributeNamePrefix,name:"attributeNamePrefix"},{value:e.attributesGroupName,name:"attributesGroupName"},{value:e.textNodeName,name:"textNodeName"},{value:e.cdataPropName,name:"cdataPropName"},{value:e.commentPropName,name:"commentPropName"}];for(let{value:r,name:s}of n)r&&B1(r,s);return e.onDangerousProperty===null&&(e.onDangerousProperty=ig),e.processEntities=ag(e.processEntities),e};fl.buildOptions=D1;fl.defaultOptions=og});var ug=S((Gq,lg)=>{"use strict";d();var dl=class{constructor(e){this.tagname=e,this.child=[],this[":@"]={}}add(e,n){e==="__proto__"&&(e="#__proto__"),this.child.push({[e]:n})}addChild(e){e.tagname==="__proto__"&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child})}};lg.exports=dl});var hg=S((Jq,dg)=>{"use strict";d();var fg=Dr(),hl=class{constructor(e){this.suppressValidationErr=!e,this.options=e||{}}readDocType(e,n){let r=Object.create(null),s=0;if(e[n+3]==="O"&&e[n+4]==="C"&&e[n+5]==="T"&&e[n+6]==="Y"&&e[n+7]==="P"&&e[n+8]==="E"){n=n+9;let i=1,o=!1,a=!1,c="";for(;n<e.length;n++)if(e[n]==="<"&&!a){if(o&&ln(e,"!ENTITY",n)){n+=7;let l,u;if([l,u,n]=this.readEntityExp(e,n+1,this.suppressValidationErr),u.indexOf("&")===-1){if(this.options.enabled!==!1&&this.options.maxEntityCount!=null&&s>=this.options.maxEntityCount)throw new Error(`Entity count (${s+1}) exceeds maximum allowed (${this.options.maxEntityCount})`);let f=l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");r[l]={regx:RegExp(`&${f};`,"g"),val:u},s++}}else if(o&&ln(e,"!ELEMENT",n)){n+=8;let{index:l}=this.readElementExp(e,n+1);n=l}else if(o&&ln(e,"!ATTLIST",n))n+=8;else if(o&&ln(e,"!NOTATION",n)){n+=9;let{index:l}=this.readNotationExp(e,n+1,this.suppressValidationErr);n=l}else if(ln(e,"!--",n))a=!0;else throw new Error("Invalid DOCTYPE");i++,c=""}else if(e[n]===">"){if(a?e[n-1]==="-"&&e[n-2]==="-"&&(a=!1,i--):i--,i===0)break}else e[n]==="["?o=!0:c+=e[n];if(i!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:r,i:n}}readEntityExp(e,n){n=Te(e,n);let r="";for(;n<e.length&&!/\s/.test(e[n])&&e[n]!=='"'&&e[n]!=="'";)r+=e[n],n++;if(Vr(r),n=Te(e,n),!this.suppressValidationErr){if(e.substring(n,n+6).toUpperCase()==="SYSTEM")throw new Error("External entities are not supported");if(e[n]==="%")throw new Error("Parameter entities are not supported")}let s="";if([n,s]=this.readIdentifierVal(e,n,"entity"),this.options.enabled!==!1&&this.options.maxEntitySize!=null&&s.length>this.options.maxEntitySize)throw new Error(`Entity "${r}" size (${s.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`);return n--,[r,s,n]}readNotationExp(e,n){n=Te(e,n);let r="";for(;n<e.length&&!/\s/.test(e[n]);)r+=e[n],n++;!this.suppressValidationErr&&Vr(r),n=Te(e,n);let s=e.substring(n,n+6).toUpperCase();if(!this.suppressValidationErr&&s!=="SYSTEM"&&s!=="PUBLIC")throw new Error(`Expected SYSTEM or PUBLIC, found "${s}"`);n+=s.length,n=Te(e,n);let i=null,o=null;if(s==="PUBLIC")[n,i]=this.readIdentifierVal(e,n,"publicIdentifier"),n=Te(e,n),(e[n]==='"'||e[n]==="'")&&([n,o]=this.readIdentifierVal(e,n,"systemIdentifier"));else if(s==="SYSTEM"&&([n,o]=this.readIdentifierVal(e,n,"systemIdentifier"),!this.suppressValidationErr&&!o))throw new Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:r,publicIdentifier:i,systemIdentifier:o,index:--n}}readIdentifierVal(e,n,r){let s="",i=e[n];if(i!=='"'&&i!=="'")throw new Error(`Expected quoted string, found "${i}"`);for(n++;n<e.length&&e[n]!==i;)s+=e[n],n++;if(e[n]!==i)throw new Error(`Unterminated ${r} value`);return n++,[n,s]}readElementExp(e,n){n=Te(e,n);let r="";for(;n<e.length&&!/\s/.test(e[n]);)r+=e[n],n++;if(!this.suppressValidationErr&&!fg.isName(r))throw new Error(`Invalid element name: "${r}"`);n=Te(e,n);let s="";if(e[n]==="E"&&ln(e,"MPTY",n))n+=4;else if(e[n]==="A"&&ln(e,"NY",n))n+=2;else if(e[n]==="("){for(n++;n<e.length&&e[n]!==")";)s+=e[n],n++;if(e[n]!==")")throw new Error("Unterminated content model")}else if(!this.suppressValidationErr)throw new Error(`Invalid Element Expression, found "${e[n]}"`);return{elementName:r,contentModel:s.trim(),index:n}}readAttlistExp(e,n){n=Te(e,n);let r="";for(;n<e.length&&!/\s/.test(e[n]);)r+=e[n],n++;Vr(r),n=Te(e,n);let s="";for(;n<e.length&&!/\s/.test(e[n]);)s+=e[n],n++;if(!Vr(s))throw new Error(`Invalid attribute name: "${s}"`);n=Te(e,n);let i="";if(e.substring(n,n+8).toUpperCase()==="NOTATION"){if(i="NOTATION",n+=8,n=Te(e,n),e[n]!=="(")throw new Error(`Expected '(', found "${e[n]}"`);n++;let a=[];for(;n<e.length&&e[n]!==")";){let c="";for(;n<e.length&&e[n]!=="|"&&e[n]!==")";)c+=e[n],n++;if(c=c.trim(),!Vr(c))throw new Error(`Invalid notation name: "${c}"`);a.push(c),e[n]==="|"&&(n++,n=Te(e,n))}if(e[n]!==")")throw new Error("Unterminated list of notations");n++,i+=" ("+a.join("|")+")"}else{for(;n<e.length&&!/\s/.test(e[n]);)i+=e[n],n++;let a=["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"];if(!this.suppressValidationErr&&!a.includes(i.toUpperCase()))throw new Error(`Invalid attribute type: "${i}"`)}n=Te(e,n);let o="";return e.substring(n,n+8).toUpperCase()==="#REQUIRED"?(o="#REQUIRED",n+=8):e.substring(n,n+7).toUpperCase()==="#IMPLIED"?(o="#IMPLIED",n+=7):[n,o]=this.readIdentifierVal(e,n,"ATTLIST"),{elementName:r,attributeName:s,attributeType:i,defaultValue:o,index:n}}},Te=(t,e)=>{for(;e<t.length&&/\s/.test(t[e]);)e++;return e};function ln(t,e,n){for(let r=0;r<e.length;r++)if(e[r]!==t[n+r+1])return!1;return!0}function Vr(t){if(fg.isName(t))return t;throw new Error(`Invalid entity name ${t}`)}dg.exports=hl});var mg=S((zq,pg)=>{"use strict";d();var U1=/^[-+]?0x[a-fA-F0-9]+$/,V1=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,K1={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function G1(t,e={}){if(e=Object.assign({},K1,e),!t||typeof t!="string")return t;let n=t.trim();if(e.skipLike!==void 0&&e.skipLike.test(n))return t;if(t==="0")return 0;if(e.hex&&U1.test(n))return J1(n,16);if(n.search(/[eE]/)!==-1){let r=n.match(/^([-\+])?(0*)([0-9]*(\.[0-9]*)?[eE][-\+]?[0-9]+)$/);if(r){if(e.leadingZeros)n=(r[1]||"")+r[3];else if(!(r[2]==="0"&&r[3][0]==="."))return t;return e.eNotation?Number(n):t}else return t}else{let r=V1.exec(n);if(r){let s=r[1],i=r[2],o=W1(r[3]);if(!e.leadingZeros&&i.length>0&&s&&n[2]!==".")return t;if(!e.leadingZeros&&i.length>0&&!s&&n[1]!==".")return t;if(e.leadingZeros&&i===t)return 0;{let a=Number(n),c=""+a;return c.search(/[eE]/)!==-1?e.eNotation?a:t:n.indexOf(".")!==-1?c==="0"&&o===""||c===o||s&&c==="-"+o?a:t:i?o===c||s+o===c?a:t:n===c||n===s+c?a:t}}else return t}}function W1(t){return t&&t.indexOf(".")!==-1&&(t=t.replace(/0+$/,""),t==="."?t="0":t[0]==="."?t="0"+t:t[t.length-1]==="."&&(t=t.substr(0,t.length-1))),t}function J1(t,e){if(parseInt)return parseInt(t,e);if(Number.parseInt)return Number.parseInt(t,e);if(window&&window.parseInt)return window.parseInt(t,e);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}pg.exports=G1});var pl=S((Zq,gg)=>{"use strict";d();function Y1(t){return typeof t=="function"?t:Array.isArray(t)?e=>{for(let n of t)if(typeof n=="string"&&e===n||n instanceof RegExp&&n.test(e))return!0}:()=>!1}gg.exports=Y1});var wg=S((Qq,_g)=>{"use strict";d();var Ci=Dr(),Vn=ug(),z1=hg(),H1=mg(),Z1=pl(),ml=class{constructor(e){if(this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"\xA2"},pound:{regex:/&(pound|#163);/g,val:"\xA3"},yen:{regex:/&(yen|#165);/g,val:"\xA5"},euro:{regex:/&(euro|#8364);/g,val:"\u20AC"},copyright:{regex:/&(copy|#169);/g,val:"\xA9"},reg:{regex:/&(reg|#174);/g,val:"\xAE"},inr:{regex:/&(inr|#8377);/g,val:"\u20B9"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(n,r)=>yg(r,10,"&#")},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(n,r)=>yg(r,16,"&#x")}},this.addExternalEntities=X1,this.parseXml=rA,this.parseTextData=Q1,this.resolveNameSpace=eA,this.buildAttributesMap=nA,this.isItStopNode=aA,this.replaceEntitiesValue=iA,this.readStopNodeData=lA,this.saveTextToParentTag=oA,this.addChild=sA,this.ignoreAttributesFn=Z1(this.options.ignoreAttributes),this.entityExpansionCount=0,this.currentExpandedLength=0,this.options.stopNodes&&this.options.stopNodes.length>0){this.stopNodesExact=new Set,this.stopNodesWildcard=new Set;for(let n=0;n<this.options.stopNodes.length;n++){let r=this.options.stopNodes[n];typeof r=="string"&&(r.startsWith("*.")?this.stopNodesWildcard.add(r.substring(2)):this.stopNodesExact.add(r))}}}};function X1(t){let e=Object.keys(t);for(let n=0;n<e.length;n++){let r=e[n],s=r.replace(/[.\-+*:]/g,"\\.");this.lastEntities[r]={regex:new RegExp("&"+s+";","g"),val:t[r]}}}function Q1(t,e,n,r,s,i,o){if(t!==void 0&&(this.options.trimValues&&!r&&(t=t.trim()),t.length>0)){o||(t=this.replaceEntitiesValue(t,e,n));let a=this.options.tagValueProcessor(e,t,n,s,i);return a==null?t:typeof a!=typeof t||a!==t?a:this.options.trimValues?yl(t,this.options.parseTagValue,this.options.numberParseOptions):t.trim()===t?yl(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function eA(t){if(this.options.removeNSPrefix){let e=t.split(":"),n=t.charAt(0)==="/"?"/":"";if(e[0]==="xmlns")return"";e.length===2&&(t=n+e[1])}return t}var tA=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function nA(t,e,n){if(this.options.ignoreAttributes!==!0&&typeof t=="string"){let r=Ci.getAllMatches(t,tA),s=r.length,i={};for(let o=0;o<s;o++){let a=this.resolveNameSpace(r[o][1]);if(this.ignoreAttributesFn(a,e))continue;let c=r[o][4],l=this.options.attributeNamePrefix+a;if(a.length)if(this.options.transformAttributeName&&(l=this.options.transformAttributeName(l)),l=uA(l,this.options),c!==void 0){this.options.trimValues&&(c=c.trim()),c=this.replaceEntitiesValue(c,n,e);let u=this.options.attributeValueProcessor(a,c,e);u==null?i[l]=c:typeof u!=typeof c||u!==c?i[l]=u:i[l]=yl(c,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(i[l]=!0)}if(!Object.keys(i).length)return;if(this.options.attributesGroupName){let o={};return o[this.options.attributesGroupName]=i,o}return i}}var rA=function(t){t=t.replace(/\r\n?/g,`
165
+ `);let e=new Vn("!xml"),n=e,r="",s="";this.entityExpansionCount=0,this.currentExpandedLength=0;let i=new z1(this.options.processEntities);for(let o=0;o<t.length;o++)if(t[o]==="<")if(t[o+1]==="/"){let c=un(t,">",o,"Closing Tag is not closed."),l=t.substring(o+2,c).trim();if(this.options.removeNSPrefix){let h=l.indexOf(":");h!==-1&&(l=l.substr(h+1))}this.options.transformTagName&&(l=this.options.transformTagName(l)),n&&(r=this.saveTextToParentTag(r,n,s));let u=s.substring(s.lastIndexOf(".")+1);if(l&&this.options.unpairedTags.indexOf(l)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${l}>`);let f=0;u&&this.options.unpairedTags.indexOf(u)!==-1?(f=s.lastIndexOf(".",s.lastIndexOf(".")-1),this.tagsNodeStack.pop()):f=s.lastIndexOf("."),s=s.substring(0,f),n=this.tagsNodeStack.pop(),r="",o=c}else if(t[o+1]==="?"){let c=gl(t,o,!1,"?>");if(!c)throw new Error("Pi Tag is not closed.");if(r=this.saveTextToParentTag(r,n,s),!(this.options.ignoreDeclaration&&c.tagName==="?xml"||this.options.ignorePiTags)){let l=new Vn(c.tagName);l.add(this.options.textNodeName,""),c.tagName!==c.tagExp&&c.attrExpPresent&&(l[":@"]=this.buildAttributesMap(c.tagExp,s,c.tagName)),this.addChild(n,l,s,o)}o=c.closeIndex+1}else if(t.substr(o+1,3)==="!--"){let c=un(t,"-->",o+4,"Comment is not closed.");if(this.options.commentPropName){let l=t.substring(o+4,c-2);r=this.saveTextToParentTag(r,n,s),n.add(this.options.commentPropName,[{[this.options.textNodeName]:l}])}o=c}else if(t.substr(o+1,2)==="!D"){let c=i.readDocType(t,o);this.docTypeEntities=c.entities,o=c.i}else if(t.substr(o+1,2)==="!["){let c=un(t,"]]>",o,"CDATA is not closed.")-2,l=t.substring(o+9,c);r=this.saveTextToParentTag(r,n,s);let u=this.parseTextData(l,n.tagname,s,!0,!1,!0,!0);u==null&&(u=""),this.options.cdataPropName?n.add(this.options.cdataPropName,[{[this.options.textNodeName]:l}]):n.add(this.options.textNodeName,u),o=c+2}else{let c=gl(t,o,this.options.removeNSPrefix),l=c.tagName,u=c.rawTagName,f=c.tagExp,h=c.attrExpPresent,g=c.closeIndex;if(this.options.transformTagName){let y=this.options.transformTagName(l);f===l&&(f=y),l=y}if(this.options.strictReservedNames&&(l===this.options.commentPropName||l===this.options.cdataPropName||l===this.options.textNodeName||l===this.options.attributesGroupName))throw new Error(`Invalid tag name: ${l}`);n&&r&&n.tagname!=="!xml"&&(r=this.saveTextToParentTag(r,n,s,!1));let p=n;p&&this.options.unpairedTags.indexOf(p.tagname)!==-1&&(n=this.tagsNodeStack.pop(),s=s.substring(0,s.lastIndexOf("."))),l!==e.tagname&&(s+=s?"."+l:l);let m=o;if(this.isItStopNode(this.stopNodesExact,this.stopNodesWildcard,s,l)){let y="";if(f.length>0&&f.lastIndexOf("/")===f.length-1)l[l.length-1]==="/"?(l=l.substr(0,l.length-1),s=s.substr(0,s.length-1),f=l):f=f.substr(0,f.length-1),o=c.closeIndex;else if(this.options.unpairedTags.indexOf(l)!==-1)o=c.closeIndex;else{let v=this.readStopNodeData(t,u,g+1);if(!v)throw new Error(`Unexpected end of ${u}`);o=v.i,y=v.tagContent}let b=new Vn(l);l!==f&&h&&(b[":@"]=this.buildAttributesMap(f,s,l)),y&&(y=this.parseTextData(y,l,s,!0,h,!0,!0)),s=s.substr(0,s.lastIndexOf(".")),b.add(this.options.textNodeName,y),this.addChild(n,b,s,m)}else{if(f.length>0&&f.lastIndexOf("/")===f.length-1){if(l[l.length-1]==="/"?(l=l.substr(0,l.length-1),s=s.substr(0,s.length-1),f=l):f=f.substr(0,f.length-1),this.options.transformTagName){let b=this.options.transformTagName(l);f===l&&(f=b),l=b}let y=new Vn(l);l!==f&&h&&(y[":@"]=this.buildAttributesMap(f,s,l)),this.addChild(n,y,s,m),s=s.substr(0,s.lastIndexOf("."))}else if(this.options.unpairedTags.indexOf(l)!==-1){let y=new Vn(l);l!==f&&h&&(y[":@"]=this.buildAttributesMap(f,s)),this.addChild(n,y,s,m),s=s.substr(0,s.lastIndexOf(".")),o=c.closeIndex;continue}else{let y=new Vn(l);if(this.tagsNodeStack.length>this.options.maxNestedTags)throw new Error("Maximum nested tags exceeded");this.tagsNodeStack.push(n),l!==f&&h&&(y[":@"]=this.buildAttributesMap(f,s,l)),this.addChild(n,y,s),n=y}r="",o=g}}else r+=t[o];return e.child};function sA(t,e,n,r){this.options.captureMetaData||(r=void 0);let s=this.options.updateTag(e.tagname,n,e[":@"]);s===!1||(typeof s=="string"&&(e.tagname=s),t.addChild(e,r))}var iA=function(t,e,n){if(t.indexOf("&")===-1)return t;let r=this.options.processEntities;if(!r.enabled||r.allowedTags&&!r.allowedTags.includes(e)||r.tagFilter&&!r.tagFilter(e,n))return t;for(let s in this.docTypeEntities){let i=this.docTypeEntities[s],o=t.match(i.regx);if(o){if(this.entityExpansionCount+=o.length,r.maxTotalExpansions&&this.entityExpansionCount>r.maxTotalExpansions)throw new Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${r.maxTotalExpansions}`);let a=t.length;if(t=t.replace(i.regx,i.val),r.maxExpandedLength&&(this.currentExpandedLength+=t.length-a,this.currentExpandedLength>r.maxExpandedLength))throw new Error(`Total expanded content size exceeded: ${this.currentExpandedLength} > ${r.maxExpandedLength}`)}}if(t.indexOf("&")===-1)return t;for(let s of Object.keys(this.lastEntities)){let i=this.lastEntities[s],o=t.match(i.regex);if(o&&(this.entityExpansionCount+=o.length,r.maxTotalExpansions&&this.entityExpansionCount>r.maxTotalExpansions))throw new Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${r.maxTotalExpansions}`);t=t.replace(i.regex,i.val)}if(t.indexOf("&")===-1)return t;if(this.options.htmlEntities)for(let s of Object.keys(this.htmlEntities)){let i=this.htmlEntities[s],o=t.match(i.regex);if(o&&(this.entityExpansionCount+=o.length,r.maxTotalExpansions&&this.entityExpansionCount>r.maxTotalExpansions))throw new Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${r.maxTotalExpansions}`);t=t.replace(i.regex,i.val)}return t=t.replace(this.ampEntity.regex,this.ampEntity.val),t};function oA(t,e,n,r){return t&&(r===void 0&&(r=e.child.length===0),t=this.parseTextData(t,e.tagname,n,!1,e[":@"]?Object.keys(e[":@"]).length!==0:!1,r),t!==void 0&&t!==""&&e.add(this.options.textNodeName,t),t=""),t}function aA(t,e,n,r){return!!(e&&e.has(r)||t&&t.has(n))}function cA(t,e,n=">"){let r,s="";for(let i=e;i<t.length;i++){let o=t[i];if(r)o===r&&(r="");else if(o==='"'||o==="'")r=o;else if(o===n[0])if(n[1]){if(t[i+1]===n[1])return{data:s,index:i}}else return{data:s,index:i};else o===" "&&(o=" ");s+=o}}function un(t,e,n,r){let s=t.indexOf(e,n);if(s===-1)throw new Error(r);return s+e.length-1}function gl(t,e,n,r=">"){let s=cA(t,e+1,r);if(!s)return;let i=s.data,o=s.index,a=i.search(/\s/),c=i,l=!0;a!==-1&&(c=i.substring(0,a),i=i.substring(a+1).trimStart());let u=c;if(n){let f=c.indexOf(":");f!==-1&&(c=c.substr(f+1),l=c!==s.data.substr(f+1))}return{tagName:c,tagExp:i,closeIndex:o,attrExpPresent:l,rawTagName:u}}function lA(t,e,n){let r=n,s=1;for(;n<t.length;n++)if(t[n]==="<")if(t[n+1]==="/"){let i=un(t,">",n,`${e} is not closed`);if(t.substring(n+2,i).trim()===e&&(s--,s===0))return{tagContent:t.substring(r,n),i};n=i}else if(t[n+1]==="?")n=un(t,"?>",n+1,"StopNode is not closed.");else if(t.substr(n+1,3)==="!--")n=un(t,"-->",n+3,"StopNode is not closed.");else if(t.substr(n+1,2)==="![")n=un(t,"]]>",n,"StopNode is not closed.")-2;else{let i=gl(t,n,">");i&&((i&&i.tagName)===e&&i.tagExp[i.tagExp.length-1]!=="/"&&s++,n=i.closeIndex)}}function yl(t,e,n){if(e&&typeof t=="string"){let r=t.trim();return r==="true"?!0:r==="false"?!1:H1(t,n)}else return Ci.isExist(t)?t:""}function yg(t,e,n){let r=Number.parseInt(t,e);return r>=0&&r<=1114111?String.fromCodePoint(r):n+t+";"}function uA(t,e){if(Ci.criticalProperties.includes(t))throw new Error(`[SECURITY] Invalid name: "${t}" is a reserved JavaScript keyword that could cause prototype pollution`);return Ci.DANGEROUS_PROPERTY_NAMES.includes(t)?e.onDangerousProperty(t):t}_g.exports=ml});var Sg=S(vg=>{"use strict";d();function fA(t,e){return bg(t,e)}function bg(t,e,n){let r,s={};for(let i=0;i<t.length;i++){let o=t[i],a=dA(o),c="";if(n===void 0?c=a:c=n+"."+a,a===e.textNodeName)r===void 0?r=o[a]:r+=""+o[a];else{if(a===void 0)continue;if(o[a]){let l=bg(o[a],e,c),u=pA(l,e);o[":@"]?hA(l,o[":@"],c,e):Object.keys(l).length===1&&l[e.textNodeName]!==void 0&&!e.alwaysCreateTextNode?l=l[e.textNodeName]:Object.keys(l).length===0&&(e.alwaysCreateTextNode?l[e.textNodeName]="":l=""),s[a]!==void 0&&s.hasOwnProperty(a)?(Array.isArray(s[a])||(s[a]=[s[a]]),s[a].push(l)):e.isArray(a,c,u)?s[a]=[l]:s[a]=l}}}return typeof r=="string"?r.length>0&&(s[e.textNodeName]=r):r!==void 0&&(s[e.textNodeName]=r),s}function dA(t){let e=Object.keys(t);for(let n=0;n<e.length;n++){let r=e[n];if(r!==":@")return r}}function hA(t,e,n,r){if(e){let s=Object.keys(e),i=s.length;for(let o=0;o<i;o++){let a=s[o];r.isArray(a,n+"."+a,!0,!0)?t[a]=[e[a]]:t[a]=e[a]}}}function pA(t,e){let{textNodeName:n}=e,r=Object.keys(t).length;return!!(r===0||r===1&&(t[n]||typeof t[n]=="boolean"||t[n]===0))}vg.prettify=fA});var kg=S((rF,Eg)=>{"use strict";d();var{buildOptions:mA}=cg(),gA=wg(),{prettify:yA}=Sg(),_A=ul(),_l=class{constructor(e){this.externalEntities={},this.options=mA(e)}parse(e,n){if(typeof e!="string")if(e.toString)e=e.toString();else throw new Error("XML data is accepted in String or Bytes[] form.");if(n){n===!0&&(n={});let i=_A.validate(e,n);if(i!==!0)throw Error(`${i.err.msg}:${i.err.line}:${i.err.col}`)}let r=new gA(this.options);r.addExternalEntities(this.externalEntities);let s=r.parseXml(e);return this.options.preserveOrder||s===void 0?s:yA(s,this.options)}addEntity(e,n){if(n.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(e.indexOf("&")!==-1||e.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if(n==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[e]=n}};Eg.exports=_l});var Ng=S((iF,Og)=>{"use strict";d();function wA(t,e){let n="";return e.format&&e.indentBy.length>0&&(n=`
166
+ `),Tg(t,e,"",n)}function Tg(t,e,n,r){let s="",i=!1;if(!Array.isArray(t)){if(t!=null){let o=t.toString();return o=wl(o,e),o}return""}for(let o=0;o<t.length;o++){let a=t[o],c=bA(a);if(c===void 0)continue;let l="";if(n.length===0?l=c:l=`${n}.${c}`,c===e.textNodeName){let p=a[c];vA(l,e)||(p=e.tagValueProcessor(c,p),p=wl(p,e)),i&&(s+=r),s+=p,i=!1;continue}else if(c===e.cdataPropName){i&&(s+=r),s+=`<![CDATA[${a[c][0][e.textNodeName]}]]>`,i=!1;continue}else if(c===e.commentPropName){s+=r+`<!--${a[c][0][e.textNodeName]}-->`,i=!0;continue}else if(c[0]==="?"){let p=xg(a[":@"],e),m=c==="?xml"?"":r,y=a[c][0][e.textNodeName];y=y.length!==0?" "+y:"",s+=m+`<${c}${y}${p}?>`,i=!0;continue}let u=r;u!==""&&(u+=e.indentBy);let f=xg(a[":@"],e),h=r+`<${c}${f}`,g=Tg(a[c],e,l,u);e.unpairedTags.indexOf(c)!==-1?e.suppressUnpairedNode?s+=h+">":s+=h+"/>":(!g||g.length===0)&&e.suppressEmptyNode?s+=h+"/>":g&&g.endsWith(">")?s+=h+`>${g}${r}</${c}>`:(s+=h+">",g&&r!==""&&(g.includes("/>")||g.includes("</"))?s+=r+e.indentBy+g+r:s+=g,s+=`</${c}>`),i=!0}return s}function bA(t){let e=Object.keys(t);for(let n=0;n<e.length;n++){let r=e[n];if(Object.prototype.hasOwnProperty.call(t,r)&&r!==":@")return r}}function xg(t,e){let n="";if(t&&!e.ignoreAttributes)for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;let s=e.attributeValueProcessor(r,t[r]);s=wl(s,e),s===!0&&e.suppressBooleanAttributes?n+=` ${r.substr(e.attributeNamePrefix.length)}`:n+=` ${r.substr(e.attributeNamePrefix.length)}="${s}"`}return n}function vA(t,e){t=t.substr(0,t.length-e.textNodeName.length-1);let n=t.substr(t.lastIndexOf(".")+1);for(let r in e.stopNodes)if(e.stopNodes[r]===t||e.stopNodes[r]==="*."+n)return!0;return!1}function wl(t,e){if(t&&t.length>0&&e.processEntities)for(let n=0;n<e.entities.length;n++){let r=e.entities[n];t=t.replace(r.regex,r.val)}return t}Og.exports=wA});var Cg=S((aF,Ag)=>{"use strict";d();var SA=Ng(),EA=pl(),kA={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function Nt(t){this.options=Object.assign({},kA,t),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=EA(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=OA),this.processTextOrObjNode=xA,this.options.format?(this.indentate=TA,this.tagEndChar=`>
167
+ `,this.newLine=`
168
+ `):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}Nt.prototype.build=function(t){return this.options.preserveOrder?SA(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t={[this.options.arrayNodeName]:t}),this.j2x(t,0,[]).val)};Nt.prototype.j2x=function(t,e,n){let r="",s="",i=n.join(".");for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o))if(typeof t[o]>"u")this.isAttribute(o)&&(s+="");else if(t[o]===null)this.isAttribute(o)||o===this.options.cdataPropName?s+="":o[0]==="?"?s+=this.indentate(e)+"<"+o+"?"+this.tagEndChar:s+=this.indentate(e)+"<"+o+"/"+this.tagEndChar;else if(t[o]instanceof Date)s+=this.buildTextValNode(t[o],o,"",e);else if(typeof t[o]!="object"){let a=this.isAttribute(o);if(a&&!this.ignoreAttributesFn(a,i))r+=this.buildAttrPairStr(a,""+t[o]);else if(!a)if(o===this.options.textNodeName){let c=this.options.tagValueProcessor(o,""+t[o]);s+=this.replaceEntitiesValue(c)}else s+=this.buildTextValNode(t[o],o,"",e)}else if(Array.isArray(t[o])){let a=t[o].length,c="",l="";for(let u=0;u<a;u++){let f=t[o][u];if(!(typeof f>"u"))if(f===null)o[0]==="?"?s+=this.indentate(e)+"<"+o+"?"+this.tagEndChar:s+=this.indentate(e)+"<"+o+"/"+this.tagEndChar;else if(typeof f=="object")if(this.options.oneListGroup){let h=this.j2x(f,e+1,n.concat(o));c+=h.val,this.options.attributesGroupName&&f.hasOwnProperty(this.options.attributesGroupName)&&(l+=h.attrStr)}else c+=this.processTextOrObjNode(f,o,e,n);else if(this.options.oneListGroup){let h=this.options.tagValueProcessor(o,f);h=this.replaceEntitiesValue(h),c+=h}else c+=this.buildTextValNode(f,o,"",e)}this.options.oneListGroup&&(c=this.buildObjectNode(c,o,l,e)),s+=c}else if(this.options.attributesGroupName&&o===this.options.attributesGroupName){let a=Object.keys(t[o]),c=a.length;for(let l=0;l<c;l++)r+=this.buildAttrPairStr(a[l],""+t[o][a[l]])}else s+=this.processTextOrObjNode(t[o],o,e,n);return{attrStr:r,val:s}};Nt.prototype.buildAttrPairStr=function(t,e){return e=this.options.attributeValueProcessor(t,""+e),e=this.replaceEntitiesValue(e),this.options.suppressBooleanAttributes&&e==="true"?" "+t:" "+t+'="'+e+'"'};function xA(t,e,n,r){let s=this.j2x(t,n+1,r.concat(e));return t[this.options.textNodeName]!==void 0&&Object.keys(t).length===1?this.buildTextValNode(t[this.options.textNodeName],e,s.attrStr,n):this.buildObjectNode(s.val,e,s.attrStr,n)}Nt.prototype.buildObjectNode=function(t,e,n,r){if(t==="")return e[0]==="?"?this.indentate(r)+"<"+e+n+"?"+this.tagEndChar:this.indentate(r)+"<"+e+n+this.closeTag(e)+this.tagEndChar;{let s="</"+e+this.tagEndChar,i="";return e[0]==="?"&&(i="?",s=""),(n||n==="")&&t.indexOf("<")===-1?this.indentate(r)+"<"+e+n+i+">"+t+s:this.options.commentPropName!==!1&&e===this.options.commentPropName&&i.length===0?this.indentate(r)+`<!--${t}-->`+this.newLine:this.indentate(r)+"<"+e+n+i+this.tagEndChar+t+this.indentate(r)+s}};Nt.prototype.closeTag=function(t){let e="";return this.options.unpairedTags.indexOf(t)!==-1?this.options.suppressUnpairedNode||(e="/"):this.options.suppressEmptyNode?e="/":e=`></${t}`,e};Nt.prototype.buildTextValNode=function(t,e,n,r){if(this.options.cdataPropName!==!1&&e===this.options.cdataPropName)return this.indentate(r)+`<![CDATA[${t}]]>`+this.newLine;if(this.options.commentPropName!==!1&&e===this.options.commentPropName)return this.indentate(r)+`<!--${t}-->`+this.newLine;if(e[0]==="?")return this.indentate(r)+"<"+e+n+"?"+this.tagEndChar;{let s=this.options.tagValueProcessor(e,t);return s=this.replaceEntitiesValue(s),s===""?this.indentate(r)+"<"+e+n+this.closeTag(e)+this.tagEndChar:this.indentate(r)+"<"+e+n+">"+s+"</"+e+this.tagEndChar}};Nt.prototype.replaceEntitiesValue=function(t){if(t&&t.length>0&&this.options.processEntities)for(let e=0;e<this.options.entities.length;e++){let n=this.options.entities[e];t=t.replace(n.regex,n.val)}return t};function TA(t){return this.options.indentBy.repeat(t)}function OA(t){return t.startsWith(this.options.attributeNamePrefix)&&t!==this.options.textNodeName?t.substr(this.attrPrefixLen):!1}Ag.exports=Nt});var Kr=S((lF,Ig)=>{"use strict";d();var NA=ul(),AA=kg(),CA=Cg();Ig.exports={XMLParser:AA,XMLValidator:NA,XMLBuilder:CA}});var Jy=S((lU,Ll)=>{"use strict";d();(function(){var t;function e(n,r){var s=this instanceof e?this:t;if(s.reset(r),typeof n=="string"&&n.length>0&&s.hash(n),s!==this)return s}e.prototype.hash=function(n){var r,s,i,o,a;switch(a=n.length,this.len+=a,s=this.k1,i=0,this.rem){case 0:s^=a>i?n.charCodeAt(i++)&65535:0;case 1:s^=a>i?(n.charCodeAt(i++)&65535)<<8:0;case 2:s^=a>i?(n.charCodeAt(i++)&65535)<<16:0;case 3:s^=a>i?(n.charCodeAt(i)&255)<<24:0,s^=a>i?(n.charCodeAt(i++)&65280)>>8:0}if(this.rem=a+this.rem&3,a-=this.rem,a>0){for(r=this.h1;s=s*11601+(s&65535)*3432906752&4294967295,s=s<<15|s>>>17,s=s*13715+(s&65535)*461832192&4294967295,r^=s,r=r<<13|r>>>19,r=r*5+3864292196&4294967295,!(i>=a);)s=n.charCodeAt(i++)&65535^(n.charCodeAt(i++)&65535)<<8^(n.charCodeAt(i++)&65535)<<16,o=n.charCodeAt(i++),s^=(o&255)<<24^(o&65280)>>8;switch(s=0,this.rem){case 3:s^=(n.charCodeAt(i+2)&65535)<<16;case 2:s^=(n.charCodeAt(i+1)&65535)<<8;case 1:s^=n.charCodeAt(i)&65535}this.h1=r}return this.k1=s,this},e.prototype.result=function(){var n,r;return n=this.k1,r=this.h1,n>0&&(n=n*11601+(n&65535)*3432906752&4294967295,n=n<<15|n>>>17,n=n*13715+(n&65535)*461832192&4294967295,r^=n),r^=this.len,r^=r>>>16,r=r*51819+(r&65535)*2246770688&4294967295,r^=r>>>13,r=r*44597+(r&65535)*3266445312&4294967295,r^=r>>>16,r>>>0},e.prototype.reset=function(n){return this.h1=typeof n=="number"?n:0,this.rem=this.k1=this.len=0,this},t=new e,typeof Ll<"u"?Ll.exports=e:this.MurmurHash3=e})()});var Yy=S(fn=>{"use strict";d();Object.defineProperty(fn,"__esModule",{value:!0});fn.signals=void 0;fn.signals=[];fn.signals.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&fn.signals.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&fn.signals.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});var zy=S(nt=>{"use strict";d();var Fi;Object.defineProperty(nt,"__esModule",{value:!0});nt.unload=nt.load=nt.onExit=nt.signals=void 0;var Bi=Yy();Object.defineProperty(nt,"signals",{enumerable:!0,get:function(){return Bi.signals}});var Di=t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function",Rl=Symbol.for("signal-exit emitter"),jl=globalThis,sI=Object.defineProperty.bind(Object),$l=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(jl[Rl])return jl[Rl];sI(jl,Rl,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,n){this.listeners[e].push(n)}removeListener(e,n){let r=this.listeners[e],s=r.indexOf(n);s!==-1&&(s===0&&r.length===1?r.length=0:r.splice(s,1))}emit(e,n,r){if(this.emitted[e])return!1;this.emitted[e]=!0;let s=!1;for(let i of this.listeners[e])s=i(n,r)===!0||s;return e==="exit"&&(s=this.emit("afterExit",n,r)||s),s}},Ui=class{},iI=t=>({onExit(e,n){return t.onExit(e,n)},load(){return t.load()},unload(){return t.unload()}}),Ml=class extends Ui{onExit(){return()=>{}}load(){}unload(){}},ql=class extends Ui{#n=Fl.platform==="win32"?"SIGINT":"SIGHUP";#t=new $l;#e;#i;#o;#s={};#r=!1;constructor(e){super(),this.#e=e,this.#s={};for(let n of Bi.signals)this.#s[n]=()=>{let r=this.#e.listeners(n),{count:s}=this.#t,i=e;if(typeof i.__signal_exit_emitter__=="object"&&typeof i.__signal_exit_emitter__.count=="number"&&(s+=i.__signal_exit_emitter__.count),r.length===s){this.unload();let o=this.#t.emit("exit",null,n),a=n==="SIGHUP"?this.#n:n;o||e.kill(e.pid,a)}};this.#o=e.reallyExit,this.#i=e.emit}onExit(e,n){if(!Di(this.#e))return()=>{};this.#r===!1&&this.load();let r=n?.alwaysLast?"afterExit":"exit";return this.#t.on(r,e),()=>{this.#t.removeListener(r,e),this.#t.listeners.exit.length===0&&this.#t.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#r){this.#r=!0,this.#t.count+=1;for(let e of Bi.signals)try{let n=this.#s[e];n&&this.#e.on(e,n)}catch{}this.#e.emit=(e,...n)=>this.#c(e,...n),this.#e.reallyExit=e=>this.#a(e)}}unload(){this.#r&&(this.#r=!1,Bi.signals.forEach(e=>{let n=this.#s[e];if(!n)throw new Error("Listener not defined for signal: "+e);try{this.#e.removeListener(e,n)}catch{}}),this.#e.emit=this.#i,this.#e.reallyExit=this.#o,this.#t.count-=1)}#a(e){return Di(this.#e)?(this.#e.exitCode=e||0,this.#t.emit("exit",this.#e.exitCode,null),this.#o.call(this.#e,this.#e.exitCode)):0}#c(e,...n){let r=this.#i;if(e==="exit"&&Di(this.#e)){typeof n[0]=="number"&&(this.#e.exitCode=n[0]);let s=r.call(this.#e,e,...n);return this.#t.emit("exit",this.#e.exitCode,null),s}else return r.call(this.#e,e,...n)}},Fl=globalThis.process;Fi=iI(Di(Fl)?new ql(Fl):new Ml),nt.onExit=Fi.onExit,nt.load=Fi.load,nt.unload=Fi.unload});var Ki=S((mU,Jr)=>{"use strict";d();Jr.exports=dI;Jr.exports.sync=hI;Jr.exports._getTmpname=Bl;Jr.exports._cleanupOnExit=Dl;var ae=X("fs"),oI=Jy(),{onExit:Hy}=zy(),aI=X("path"),{promisify:$e}=X("util"),At={},cI=(function(){try{return X("worker_threads").threadId}catch{return 0}})(),lI=0;function Bl(t){return t+"."+oI(w).hash(String(process.pid)).hash(String(cI)).hash(String(++lI)).result()}function Dl(t){return()=>{try{ae.unlinkSync(typeof t=="function"?t():t)}catch{}}}function uI(t){return new Promise(e=>{At[t]||(At[t]=[]),At[t].push(e),At[t].length===1&&e()})}function Vi(t){return t.code==="ENOSYS"||(!process.getuid||process.getuid()!==0)&&(t.code==="EINVAL"||t.code==="EPERM")}async function fI(t,e,n={}){typeof n=="string"&&(n={encoding:n});let r,s,i=Hy(Dl(()=>s)),o=aI.resolve(t);try{await uI(o);let a=await $e(ae.realpath)(t).catch(()=>t);if(s=Bl(a),!n.mode||!n.chown){let c=await $e(ae.stat)(a).catch(()=>{});c&&(n.mode==null&&(n.mode=c.mode),n.chown==null&&process.getuid&&(n.chown={uid:c.uid,gid:c.gid}))}r=await $e(ae.open)(s,"w",n.mode),n.tmpfileCreated&&await n.tmpfileCreated(s),ArrayBuffer.isView(e)?await $e(ae.write)(r,e,0,e.length,0):e!=null&&await $e(ae.write)(r,String(e),0,String(n.encoding||"utf8")),n.fsync!==!1&&await $e(ae.fsync)(r),await $e(ae.close)(r),r=null,n.chown&&await $e(ae.chown)(s,n.chown.uid,n.chown.gid).catch(c=>{if(!Vi(c))throw c}),n.mode&&await $e(ae.chmod)(s,n.mode).catch(c=>{if(!Vi(c))throw c}),await $e(ae.rename)(s,a)}finally{r&&await $e(ae.close)(r).catch(()=>{}),i(),await $e(ae.unlink)(s).catch(()=>{}),At[o].shift(),At[o].length>0?At[o][0]():delete At[o]}}async function dI(t,e,n,r){n instanceof Function&&(r=n,n={});let s=fI(t,e,n);if(r)try{let i=await s;return r(i)}catch(i){return r(i)}return s}function hI(t,e,n){typeof n=="string"?n={encoding:n}:n||(n={});try{t=ae.realpathSync(t)}catch{}let r=Bl(t);if(!n.mode||!n.chown)try{let c=ae.statSync(t);n=Object.assign({},n),n.mode||(n.mode=c.mode),!n.chown&&process.getuid&&(n.chown={uid:c.uid,gid:c.gid})}catch{}let s,i=Dl(r),o=Hy(i),a=!0;try{if(s=ae.openSync(r,"w",n.mode||438),n.tmpfileCreated&&n.tmpfileCreated(r),ArrayBuffer.isView(e)?ae.writeSync(s,e,0,e.length,0):e!=null&&ae.writeSync(s,String(e),0,String(n.encoding||"utf8")),n.fsync!==!1&&ae.fsyncSync(s),ae.closeSync(s),s=null,n.chown)try{ae.chownSync(r,n.chown.uid,n.chown.gid)}catch(c){if(!Vi(c))throw c}if(n.mode)try{ae.chmodSync(r,n.mode)}catch(c){if(!Vi(c))throw c}ae.renameSync(r,t),a=!1}finally{if(s)try{ae.closeSync(s)}catch{}o(),a&&i()}}});var t_=S((CU,e_)=>{"use strict";d();var Pt=X("constants"),wI=process.cwd,Ji=null,bI=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Ji||(Ji=wI.call(process)),Ji};try{process.cwd()}catch{}typeof process.chdir=="function"&&(Jl=process.chdir,process.chdir=function(t){Ji=null,Jl.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Jl));var Jl;e_.exports=vI;function vI(t){Pt.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||n(t),t.chown=i(t.chown),t.fchown=i(t.fchown),t.lchown=i(t.lchown),t.chmod=r(t.chmod),t.fchmod=r(t.fchmod),t.lchmod=r(t.lchmod),t.chownSync=o(t.chownSync),t.fchownSync=o(t.fchownSync),t.lchownSync=o(t.lchownSync),t.chmodSync=s(t.chmodSync),t.fchmodSync=s(t.fchmodSync),t.lchmodSync=s(t.lchmodSync),t.stat=a(t.stat),t.fstat=a(t.fstat),t.lstat=a(t.lstat),t.statSync=c(t.statSync),t.fstatSync=c(t.fstatSync),t.lstatSync=c(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(u,f,h){h&&process.nextTick(h)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(u,f,h,g){g&&process.nextTick(g)},t.lchownSync=function(){}),bI==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:(function(u){function f(h,g,p){var m=Date.now(),y=0;u(h,g,function b(v){if(v&&(v.code==="EACCES"||v.code==="EPERM"||v.code==="EBUSY")&&Date.now()-m<6e4){setTimeout(function(){t.stat(g,function(k,N){k&&k.code==="ENOENT"?u(h,g,b):p(v)})},y),y<100&&(y+=10);return}p&&p(v)})}return Object.setPrototypeOf&&Object.setPrototypeOf(f,u),f})(t.rename)),t.read=typeof t.read!="function"?t.read:(function(u){function f(h,g,p,m,y,b){var v;if(b&&typeof b=="function"){var k=0;v=function(N,L,$){if(N&&N.code==="EAGAIN"&&k<10)return k++,u.call(t,h,g,p,m,y,v);b.apply(this,arguments)}}return u.call(t,h,g,p,m,y,v)}return Object.setPrototypeOf&&Object.setPrototypeOf(f,u),f})(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:(function(u){return function(f,h,g,p,m){for(var y=0;;)try{return u.call(t,f,h,g,p,m)}catch(b){if(b.code==="EAGAIN"&&y<10){y++;continue}throw b}}})(t.readSync);function e(u){u.lchmod=function(f,h,g){u.open(f,Pt.O_WRONLY|Pt.O_SYMLINK,h,function(p,m){if(p){g&&g(p);return}u.fchmod(m,h,function(y){u.close(m,function(b){g&&g(y||b)})})})},u.lchmodSync=function(f,h){var g=u.openSync(f,Pt.O_WRONLY|Pt.O_SYMLINK,h),p=!0,m;try{m=u.fchmodSync(g,h),p=!1}finally{if(p)try{u.closeSync(g)}catch{}else u.closeSync(g)}return m}}function n(u){Pt.hasOwnProperty("O_SYMLINK")&&u.futimes?(u.lutimes=function(f,h,g,p){u.open(f,Pt.O_SYMLINK,function(m,y){if(m){p&&p(m);return}u.futimes(y,h,g,function(b){u.close(y,function(v){p&&p(b||v)})})})},u.lutimesSync=function(f,h,g){var p=u.openSync(f,Pt.O_SYMLINK),m,y=!0;try{m=u.futimesSync(p,h,g),y=!1}finally{if(y)try{u.closeSync(p)}catch{}else u.closeSync(p)}return m}):u.futimes&&(u.lutimes=function(f,h,g,p){p&&process.nextTick(p)},u.lutimesSync=function(){})}function r(u){return u&&function(f,h,g){return u.call(t,f,h,function(p){l(p)&&(p=null),g&&g.apply(this,arguments)})}}function s(u){return u&&function(f,h){try{return u.call(t,f,h)}catch(g){if(!l(g))throw g}}}function i(u){return u&&function(f,h,g,p){return u.call(t,f,h,g,function(m){l(m)&&(m=null),p&&p.apply(this,arguments)})}}function o(u){return u&&function(f,h,g){try{return u.call(t,f,h,g)}catch(p){if(!l(p))throw p}}}function a(u){return u&&function(f,h,g){typeof h=="function"&&(g=h,h=null);function p(m,y){y&&(y.uid<0&&(y.uid+=4294967296),y.gid<0&&(y.gid+=4294967296)),g&&g.apply(this,arguments)}return h?u.call(t,f,h,p):u.call(t,f,p)}}function c(u){return u&&function(f,h){var g=h?u.call(t,f,h):u.call(t,f);return g&&(g.uid<0&&(g.uid+=4294967296),g.gid<0&&(g.gid+=4294967296)),g}}function l(u){if(!u||u.code==="ENOSYS")return!0;var f=!process.getuid||process.getuid()!==0;return!!(f&&(u.code==="EINVAL"||u.code==="EPERM"))}}});var s_=S((PU,r_)=>{"use strict";d();var n_=X("stream").Stream;r_.exports=SI;function SI(t){return{ReadStream:e,WriteStream:n};function e(r,s){if(!(this instanceof e))return new e(r,s);n_.call(this);var i=this;this.path=r,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,s=s||{};for(var o=Object.keys(s),a=0,c=o.length;a<c;a++){var l=o[a];this[l]=s[l]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){i._read()});return}t.open(this.path,this.flags,this.mode,function(u,f){if(u){i.emit("error",u),i.readable=!1;return}i.fd=f,i.emit("open",f),i._read()})}function n(r,s){if(!(this instanceof n))return new n(r,s);n_.call(this),this.path=r,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,s=s||{};for(var i=Object.keys(s),o=0,a=i.length;o<a;o++){var c=i[o];this[c]=s[c]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var o_=S((RU,i_)=>{"use strict";d();i_.exports=kI;var EI=Object.getPrototypeOf||function(t){return t.__proto__};function kI(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:EI(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}});var Zl=S(($U,Hl)=>{"use strict";d();var le=X("fs"),xI=t_(),TI=s_(),OI=o_(),Yi=X("util"),_e,Hi;typeof Symbol=="function"&&typeof Symbol.for=="function"?(_e=Symbol.for("graceful-fs.queue"),Hi=Symbol.for("graceful-fs.previous")):(_e="___graceful-fs.queue",Hi="___graceful-fs.previous");function NI(){}function l_(t,e){Object.defineProperty(t,_e,{get:function(){return e}})}var dn=NI;Yi.debuglog?dn=Yi.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(dn=function(){var t=Yi.format.apply(Yi,arguments);t="GFS4: "+t.split(/\n/).join(`
169
+ GFS4: `),console.error(t)});le[_e]||(a_=global[_e]||[],l_(le,a_),le.close=(function(t){function e(n,r){return t.call(le,n,function(s){s||c_(),typeof r=="function"&&r.apply(this,arguments)})}return Object.defineProperty(e,Hi,{value:t}),e})(le.close),le.closeSync=(function(t){function e(n){t.apply(le,arguments),c_()}return Object.defineProperty(e,Hi,{value:t}),e})(le.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){dn(le[_e]),X("assert").equal(le[_e].length,0)}));var a_;global[_e]||l_(global,le[_e]);Hl.exports=Yl(OI(le));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!le.__patched&&(Hl.exports=Yl(le),le.__patched=!0);function Yl(t){xI(t),t.gracefulify=Yl,t.createReadStream=L,t.createWriteStream=$;var e=t.readFile;t.readFile=n;function n(O,M,x){return typeof M=="function"&&(x=M,M=null),I(O,M,x);function I(j,U,J,D){return e(j,U,function(Q){Q&&(Q.code==="EMFILE"||Q.code==="ENFILE")?Jn([I,[j,U,J],Q,D||Date.now(),Date.now()]):typeof J=="function"&&J.apply(this,arguments)})}}var r=t.writeFile;t.writeFile=s;function s(O,M,x,I){return typeof x=="function"&&(I=x,x=null),j(O,M,x,I);function j(U,J,D,Q,re){return r(U,J,D,function(ne){ne&&(ne.code==="EMFILE"||ne.code==="ENFILE")?Jn([j,[U,J,D,Q],ne,re||Date.now(),Date.now()]):typeof Q=="function"&&Q.apply(this,arguments)})}}var i=t.appendFile;i&&(t.appendFile=o);function o(O,M,x,I){return typeof x=="function"&&(I=x,x=null),j(O,M,x,I);function j(U,J,D,Q,re){return i(U,J,D,function(ne){ne&&(ne.code==="EMFILE"||ne.code==="ENFILE")?Jn([j,[U,J,D,Q],ne,re||Date.now(),Date.now()]):typeof Q=="function"&&Q.apply(this,arguments)})}}var a=t.copyFile;a&&(t.copyFile=c);function c(O,M,x,I){return typeof x=="function"&&(I=x,x=0),j(O,M,x,I);function j(U,J,D,Q,re){return a(U,J,D,function(ne){ne&&(ne.code==="EMFILE"||ne.code==="ENFILE")?Jn([j,[U,J,D,Q],ne,re||Date.now(),Date.now()]):typeof Q=="function"&&Q.apply(this,arguments)})}}var l=t.readdir;t.readdir=f;var u=/^v[0-5]\./;function f(O,M,x){typeof M=="function"&&(x=M,M=null);var I=u.test(process.version)?function(J,D,Q,re){return l(J,j(J,D,Q,re))}:function(J,D,Q,re){return l(J,D,j(J,D,Q,re))};return I(O,M,x);function j(U,J,D,Q){return function(re,ne){re&&(re.code==="EMFILE"||re.code==="ENFILE")?Jn([I,[U,J,D],re,Q||Date.now(),Date.now()]):(ne&&ne.sort&&ne.sort(),typeof D=="function"&&D.call(this,re,ne))}}}if(process.version.substr(0,4)==="v0.8"){var h=TI(t);b=h.ReadStream,k=h.WriteStream}var g=t.ReadStream;g&&(b.prototype=Object.create(g.prototype),b.prototype.open=v);var p=t.WriteStream;p&&(k.prototype=Object.create(p.prototype),k.prototype.open=N),Object.defineProperty(t,"ReadStream",{get:function(){return b},set:function(O){b=O},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return k},set:function(O){k=O},enumerable:!0,configurable:!0});var m=b;Object.defineProperty(t,"FileReadStream",{get:function(){return m},set:function(O){m=O},enumerable:!0,configurable:!0});var y=k;Object.defineProperty(t,"FileWriteStream",{get:function(){return y},set:function(O){y=O},enumerable:!0,configurable:!0});function b(O,M){return this instanceof b?(g.apply(this,arguments),this):b.apply(Object.create(b.prototype),arguments)}function v(){var O=this;E(O.path,O.flags,O.mode,function(M,x){M?(O.autoClose&&O.destroy(),O.emit("error",M)):(O.fd=x,O.emit("open",x),O.read())})}function k(O,M){return this instanceof k?(p.apply(this,arguments),this):k.apply(Object.create(k.prototype),arguments)}function N(){var O=this;E(O.path,O.flags,O.mode,function(M,x){M?(O.destroy(),O.emit("error",M)):(O.fd=x,O.emit("open",x))})}function L(O,M){return new t.ReadStream(O,M)}function $(O,M){return new t.WriteStream(O,M)}var F=t.open;t.open=E;function E(O,M,x,I){return typeof x=="function"&&(I=x,x=null),j(O,M,x,I);function j(U,J,D,Q,re){return F(U,J,D,function(ne,Xr){ne&&(ne.code==="EMFILE"||ne.code==="ENFILE")?Jn([j,[U,J,D,Q],ne,re||Date.now(),Date.now()]):typeof Q=="function"&&Q.apply(this,arguments)})}}return t}function Jn(t){dn("ENQUEUE",t[0].name,t[1]),le[_e].push(t),zl()}var zi;function c_(){for(var t=Date.now(),e=0;e<le[_e].length;++e)le[_e][e].length>2&&(le[_e][e][3]=t,le[_e][e][4]=t);zl()}function zl(){if(clearTimeout(zi),zi=void 0,le[_e].length!==0){var t=le[_e].shift(),e=t[0],n=t[1],r=t[2],s=t[3],i=t[4];if(s===void 0)dn("RETRY",e.name,n),e.apply(null,n);else if(Date.now()-s>=6e4){dn("TIMEOUT",e.name,n);var o=n.pop();typeof o=="function"&&o.call(null,r)}else{var a=Date.now()-i,c=Math.max(i-s,1),l=Math.min(c*1.2,100);a>=l?(dn("RETRY",e.name,n),e.apply(null,n.concat([s]))):le[_e].push(t)}zi===void 0&&(zi=setTimeout(zl,0))}}});var f_=S((qU,u_)=>{"use strict";d();function Me(t,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}u_.exports=Me;Me.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};Me.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};Me.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var e=new Date().getTime();if(t&&e-this._operationStart>=this._maxRetryTime)return this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var n=this._timeouts.shift();if(n===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),n=this._timeouts.shift();else return!1;var r=this,s=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},n);return this._options.unref&&s.unref(),!0};Me.prototype.attempt=function(t,e){this._fn=t,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var n=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){n._operationTimeoutCb()},n._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};Me.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)};Me.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)};Me.prototype.start=Me.prototype.try;Me.prototype.errors=function(){return this._errors};Me.prototype.attempts=function(){return this._attempts};Me.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},e=null,n=0,r=0;r<this._errors.length;r++){var s=this._errors[r],i=s.message,o=(t[i]||0)+1;t[i]=o,o>=n&&(e=s,n=o)}return e}});var d_=S(hn=>{"use strict";d();var AI=f_();hn.operation=function(t){var e=hn.timeouts(t);return new AI(e,{forever:t&&t.forever,unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};hn.timeouts=function(t){if(t instanceof Array)return[].concat(t);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var n in t)e[n]=t[n];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var r=[],s=0;s<e.retries;s++)r.push(this.createTimeout(s,e));return t&&t.forever&&!r.length&&r.push(this.createTimeout(s,e)),r.sort(function(i,o){return i-o}),r};hn.createTimeout=function(t,e){var n=e.randomize?Math.random()+1:1,r=Math.round(n*e.minTimeout*Math.pow(e.factor,t));return r=Math.min(r,e.maxTimeout),r};hn.wrap=function(t,e,n){if(e instanceof Array&&(n=e,e=null),!n){n=[];for(var r in t)typeof t[r]=="function"&&n.push(r)}for(var s=0;s<n.length;s++){var i=n[s],o=t[i];t[i]=function(c){var l=hn.operation(e),u=Array.prototype.slice.call(arguments,1),f=u.pop();u.push(function(h){l.retry(h)||(h&&(arguments[0]=l.mainError()),f.apply(this,arguments))}),l.attempt(function(){c.apply(t,u)})}.bind(t,o),t[i].options=e}}});var p_=S((UU,h_)=>{"use strict";d();h_.exports=d_()});var m_=S((KU,Zi)=>{"use strict";d();Zi.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&Zi.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Zi.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var b_=S((WU,Hn)=>{"use strict";d();var ce=global.process,pn=function(t){return t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function"};pn(ce)?(g_=X("assert"),Yn=m_(),y_=/^win/i.test(ce.platform),Yr=X("events"),typeof Yr!="function"&&(Yr=Yr.EventEmitter),ce.__signal_exit_emitter__?me=ce.__signal_exit_emitter__:(me=ce.__signal_exit_emitter__=new Yr,me.count=0,me.emitted={}),me.infinite||(me.setMaxListeners(1/0),me.infinite=!0),Hn.exports=function(t,e){if(!pn(global.process))return function(){};g_.equal(typeof t,"function","a callback must be provided for exit handler"),zn===!1&&Xl();var n="exit";e&&e.alwaysLast&&(n="afterexit");var r=function(){me.removeListener(n,t),me.listeners("exit").length===0&&me.listeners("afterexit").length===0&&Xi()};return me.on(n,t),r},Xi=function(){!zn||!pn(global.process)||(zn=!1,Yn.forEach(function(e){try{ce.removeListener(e,Qi[e])}catch{}}),ce.emit=eo,ce.reallyExit=Ql,me.count-=1)},Hn.exports.unload=Xi,mn=function(e,n,r){me.emitted[e]||(me.emitted[e]=!0,me.emit(e,n,r))},Qi={},Yn.forEach(function(t){Qi[t]=function(){if(pn(global.process)){var n=ce.listeners(t);n.length===me.count&&(Xi(),mn("exit",null,t),mn("afterexit",null,t),y_&&t==="SIGHUP"&&(t="SIGINT"),ce.kill(ce.pid,t))}}}),Hn.exports.signals=function(){return Yn},zn=!1,Xl=function(){zn||!pn(global.process)||(zn=!0,me.count+=1,Yn=Yn.filter(function(e){try{return ce.on(e,Qi[e]),!0}catch{return!1}}),ce.emit=w_,ce.reallyExit=__)},Hn.exports.load=Xl,Ql=ce.reallyExit,__=function(e){pn(global.process)&&(ce.exitCode=e||0,mn("exit",ce.exitCode,null),mn("afterexit",ce.exitCode,null),Ql.call(ce,ce.exitCode))},eo=ce.emit,w_=function(e,n){if(e==="exit"&&pn(global.process)){n!==void 0&&(ce.exitCode=n);var r=eo.apply(this,arguments);return mn("exit",ce.exitCode,null),mn("afterexit",ce.exitCode,null),r}else return eo.apply(this,arguments)}):Hn.exports=function(){return function(){}};var g_,Yn,y_,Yr,me,Xi,mn,Qi,zn,Xl,Ql,__,eo,w_});var S_=S((YU,eu)=>{"use strict";d();var v_=Symbol();function CI(t,e,n){let r=e[v_];if(r)return e.stat(t,(i,o)=>{if(i)return n(i);n(null,o.mtime,r)});let s=new Date(Math.ceil(Date.now()/1e3)*1e3+5);e.utimes(t,s,s,i=>{if(i)return n(i);e.stat(t,(o,a)=>{if(o)return n(o);let c=a.mtime.getTime()%1e3===0?"s":"ms";Object.defineProperty(e,v_,{value:c}),n(null,a.mtime,c)})})}function II(t){let e=Date.now();return t==="s"&&(e=Math.ceil(e/1e3)*1e3),new Date(e)}eu.exports.probe=CI;eu.exports.getMtime=II});var O_=S((HU,Hr)=>{"use strict";d();var PI=X("path"),ru=Zl(),LI=p_(),RI=b_(),E_=S_(),dt={};function zr(t,e){return e.lockfilePath||`${t}.lock`}function su(t,e,n){if(!e.realpath)return n(null,PI.resolve(t));e.fs.realpath(t,n)}function nu(t,e,n){let r=zr(t,e);e.fs.mkdir(r,s=>{if(!s)return E_.probe(r,e.fs,(i,o,a)=>{if(i)return e.fs.rmdir(r,()=>{}),n(i);n(null,o,a)});if(s.code!=="EEXIST")return n(s);if(e.stale<=0)return n(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:t}));e.fs.stat(r,(i,o)=>{if(i)return i.code==="ENOENT"?nu(t,{...e,stale:0},n):n(i);if(!k_(o,e))return n(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:t}));x_(t,e,a=>{if(a)return n(a);nu(t,{...e,stale:0},n)})})})}function k_(t,e){return t.mtime.getTime()<Date.now()-e.stale}function x_(t,e,n){e.fs.rmdir(zr(t,e),r=>{if(r&&r.code!=="ENOENT")return n(r);n()})}function to(t,e){let n=dt[t];n.updateTimeout||(n.updateDelay=n.updateDelay||e.update,n.updateTimeout=setTimeout(()=>{n.updateTimeout=null,e.fs.stat(n.lockfilePath,(r,s)=>{let i=n.lastUpdate+e.stale<Date.now();if(r)return r.code==="ENOENT"||i?tu(t,n,Object.assign(r,{code:"ECOMPROMISED"})):(n.updateDelay=1e3,to(t,e));if(!(n.mtime.getTime()===s.mtime.getTime()))return tu(t,n,Object.assign(new Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let a=E_.getMtime(n.mtimePrecision);e.fs.utimes(n.lockfilePath,a,a,c=>{let l=n.lastUpdate+e.stale<Date.now();if(!n.released){if(c)return c.code==="ENOENT"||l?tu(t,n,Object.assign(c,{code:"ECOMPROMISED"})):(n.updateDelay=1e3,to(t,e));n.mtime=a,n.lastUpdate=Date.now(),n.updateDelay=null,to(t,e)}})})},n.updateDelay),n.updateTimeout.unref&&n.updateTimeout.unref())}function tu(t,e,n){e.released=!0,e.updateTimeout&&clearTimeout(e.updateTimeout),dt[t]===e&&delete dt[t],e.options.onCompromised(n)}function jI(t,e,n){e={stale:1e4,update:null,realpath:!0,retries:0,fs:ru,onCompromised:r=>{throw r},...e},e.retries=e.retries||0,e.retries=typeof e.retries=="number"?{retries:e.retries}:e.retries,e.stale=Math.max(e.stale||0,2e3),e.update=e.update==null?e.stale/2:e.update||0,e.update=Math.max(Math.min(e.update,e.stale/2),1e3),su(t,e,(r,s)=>{if(r)return n(r);let i=LI.operation(e.retries);i.attempt(()=>{nu(s,e,(o,a,c)=>{if(i.retry(o))return;if(o)return n(i.mainError());let l=dt[s]={lockfilePath:zr(s,e),mtime:a,mtimePrecision:c,options:e,lastUpdate:Date.now()};to(s,e),n(null,u=>{if(l.released)return u&&u(Object.assign(new Error("Lock is already released"),{code:"ERELEASED"}));T_(s,{...e,realpath:!1},u)})})})})}function T_(t,e,n){e={fs:ru,realpath:!0,...e},su(t,e,(r,s)=>{if(r)return n(r);let i=dt[s];if(!i)return n(Object.assign(new Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));i.updateTimeout&&clearTimeout(i.updateTimeout),i.released=!0,delete dt[s],x_(s,e,n)})}function $I(t,e,n){e={stale:1e4,realpath:!0,fs:ru,...e},e.stale=Math.max(e.stale||0,2e3),su(t,e,(r,s)=>{if(r)return n(r);e.fs.stat(zr(s,e),(i,o)=>i?i.code==="ENOENT"?n(null,!1):n(i):n(null,!k_(o,e)))})}function MI(){return dt}RI(()=>{for(let t in dt){let e=dt[t].options;try{e.fs.rmdirSync(zr(t,e))}catch{}}});Hr.exports.lock=jI;Hr.exports.unlock=T_;Hr.exports.check=$I;Hr.exports.getLocks=MI});var A_=S((XU,N_)=>{"use strict";d();var qI=Zl();function FI(t){let e=["mkdir","realpath","stat","rmdir","utimes"],n={...t};return e.forEach(r=>{n[r]=(...s)=>{let i=s.pop(),o;try{o=t[`${r}Sync`](...s)}catch(a){return i(a)}i(null,o)}}),n}function BI(t){return(...e)=>new Promise((n,r)=>{e.push((s,i)=>{s?r(s):n(i)}),t(...e)})}function DI(t){return(...e)=>{let n,r;if(e.push((s,i)=>{n=s,r=i}),t(...e),n)throw n;return r}}function UI(t){if(t={...t},t.fs=FI(t.fs||qI),typeof t.retries=="number"&&t.retries>0||t.retries&&typeof t.retries.retries=="number"&&t.retries.retries>0)throw Object.assign(new Error("Cannot use retries with the sync api"),{code:"ESYNC"});return t}N_.exports={toPromise:BI,toSync:DI,toSyncOptions:UI}});var ou=S((eV,Lt)=>{"use strict";d();var Zn=O_(),{toPromise:no,toSync:ro,toSyncOptions:iu}=A_();async function C_(t,e){let n=await no(Zn.lock)(t,e);return no(n)}function VI(t,e){let n=ro(Zn.lock)(t,iu(e));return ro(n)}function KI(t,e){return no(Zn.unlock)(t,e)}function GI(t,e){return ro(Zn.unlock)(t,iu(e))}function WI(t,e){return no(Zn.check)(t,e)}function JI(t,e){return ro(Zn.check)(t,iu(e))}Lt.exports=C_;Lt.exports.lock=C_;Lt.exports.unlock=KI;Lt.exports.lockSync=VI;Lt.exports.unlockSync=GI;Lt.exports.check=WI;Lt.exports.checkSync=JI});var C={};gw(C,{BRAND:()=>Ww,DIRTY:()=>jt,EMPTY_PATH:()=>kw,INVALID:()=>V,NEVER:()=>Cb,OK:()=>we,ParseStatus:()=>ge,Schema:()=>Y,ZodAny:()=>mt,ZodArray:()=>at,ZodBigInt:()=>Mt,ZodBoolean:()=>qt,ZodBranded:()=>er,ZodCatch:()=>zt,ZodDate:()=>Ft,ZodDefault:()=>Yt,ZodDiscriminatedUnion:()=>ts,ZodEffects:()=>Ie,ZodEnum:()=>Wt,ZodError:()=>ve,ZodFirstPartyTypeKind:()=>K,ZodFunction:()=>rs,ZodIntersection:()=>Vt,ZodIssueCode:()=>A,ZodLazy:()=>Kt,ZodLiteral:()=>Gt,ZodMap:()=>kn,ZodNaN:()=>Tn,ZodNativeEnum:()=>Jt,ZodNever:()=>Fe,ZodNull:()=>Dt,ZodNullable:()=>Ye,ZodNumber:()=>$t,ZodObject:()=>Se,ZodOptional:()=>Ae,ZodParsedType:()=>q,ZodPipeline:()=>tr,ZodPromise:()=>gt,ZodReadonly:()=>Ht,ZodRecord:()=>ns,ZodSchema:()=>Y,ZodSet:()=>xn,ZodString:()=>pt,ZodSymbol:()=>Sn,ZodTransformer:()=>Ie,ZodTuple:()=>Je,ZodType:()=>Y,ZodUndefined:()=>Bt,ZodUnion:()=>Ut,ZodUnknown:()=>ot,ZodVoid:()=>En,addIssueToContext:()=>R,any:()=>tb,array:()=>ib,bigint:()=>Hw,boolean:()=>Tu,coerce:()=>Ab,custom:()=>Eu,date:()=>Zw,datetimeRegex:()=>vu,defaultErrorMap:()=>st,discriminatedUnion:()=>lb,effect:()=>vb,enum:()=>_b,function:()=>mb,getErrorMap:()=>wn,getParsedType:()=>We,instanceof:()=>Yw,intersection:()=>ub,isAborted:()=>Qr,isAsync:()=>bn,isDirty:()=>es,isValid:()=>ht,late:()=>Jw,lazy:()=>gb,literal:()=>yb,makeIssue:()=>Qn,map:()=>hb,nan:()=>zw,nativeEnum:()=>wb,never:()=>rb,null:()=>eb,nullable:()=>Eb,number:()=>xu,object:()=>ob,objectUtil:()=>po,oboolean:()=>Nb,onumber:()=>Ob,optional:()=>Sb,ostring:()=>Tb,pipeline:()=>xb,preprocess:()=>kb,promise:()=>bb,quotelessJson:()=>vw,record:()=>db,set:()=>pb,setErrorMap:()=>Ew,strictObject:()=>ab,string:()=>ku,symbol:()=>Xw,transformer:()=>vb,tuple:()=>fb,undefined:()=>Qw,union:()=>cb,unknown:()=>nb,util:()=>z,void:()=>sb});d();d();d();d();d();var z;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{let i={};for(let o of s)i[o]=o;return i},t.getValidEnumValues=s=>{let i=t.objectKeys(s).filter(a=>typeof s[s[a]]!="number"),o={};for(let a of i)o[a]=s[a];return t.objectValues(o)},t.objectValues=s=>t.objectKeys(s).map(function(i){return s[i]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{let i=[];for(let o in s)Object.prototype.hasOwnProperty.call(s,o)&&i.push(o);return i},t.find=(s,i)=>{for(let o of s)if(i(o))return o},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,i=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}t.joinValues=r,t.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(z||(z={}));var po;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(po||(po={}));var q=z.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),We=t=>{switch(typeof t){case"undefined":return q.undefined;case"string":return q.string;case"number":return Number.isNaN(t)?q.nan:q.number;case"boolean":return q.boolean;case"function":return q.function;case"bigint":return q.bigint;case"symbol":return q.symbol;case"object":return Array.isArray(t)?q.array:t===null?q.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?q.promise:typeof Map<"u"&&t instanceof Map?q.map:typeof Set<"u"&&t instanceof Set?q.set:typeof Date<"u"&&t instanceof Date?q.date:q.object;default:return q.unknown}};var A=z.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),vw=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),ve=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){let n=e||function(i){return i.message},r={_errors:[]},s=i=>{for(let o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let a=r,c=0;for(;c<o.path.length;){let l=o.path[c];c===o.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(n(o))):a[l]=a[l]||{_errors:[]},a=a[l],c++}}};return s(this),r}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,z.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){let n={},r=[];for(let s of this.issues)if(s.path.length>0){let i=s.path[0];n[i]=n[i]||[],n[i].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};ve.create=t=>new ve(t);var Sw=(t,e)=>{let n;switch(t.code){case A.invalid_type:t.received===q.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case A.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,z.jsonStringifyReplacer)}`;break;case A.unrecognized_keys:n=`Unrecognized key(s) in object: ${z.joinValues(t.keys,", ")}`;break;case A.invalid_union:n="Invalid input";break;case A.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${z.joinValues(t.options)}`;break;case A.invalid_enum_value:n=`Invalid enum value. Expected ${z.joinValues(t.options)}, received '${t.received}'`;break;case A.invalid_arguments:n="Invalid function arguments";break;case A.invalid_return_type:n="Invalid function return type";break;case A.invalid_date:n="Invalid date";break;case A.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:z.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case A.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case A.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case A.custom:n="Invalid input";break;case A.invalid_intersection_types:n="Intersection results could not be merged";break;case A.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case A.not_finite:n="Number must be finite";break;default:n=e.defaultError,z.assertNever(t)}return{message:n}},st=Sw;var gu=st;function Ew(t){gu=t}function wn(){return gu}d();var Qn=t=>{let{data:e,path:n,errorMaps:r,issueData:s}=t,i=[...n,...s.path||[]],o={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let a="",c=r.filter(l=>!!l).slice().reverse();for(let l of c)a=l(o,{data:e,defaultError:a}).message;return{...s,path:i,message:a}},kw=[];function R(t,e){let n=wn(),r=Qn({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===st?void 0:st].filter(s=>!!s)});t.common.issues.push(r)}var ge=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){let r=[];for(let s of n){if(s.status==="aborted")return V;s.status==="dirty"&&e.dirty(),r.push(s.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){let r=[];for(let s of n){let i=await s.key,o=await s.value;r.push({key:i,value:o})}return t.mergeObjectSync(e,r)}static mergeObjectSync(e,n){let r={};for(let s of n){let{key:i,value:o}=s;if(i.status==="aborted"||o.status==="aborted")return V;i.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(r[i.value]=o.value)}return{status:e.value,value:r}}},V=Object.freeze({status:"aborted"}),jt=t=>({status:"dirty",value:t}),we=t=>({status:"valid",value:t}),Qr=t=>t.status==="aborted",es=t=>t.status==="dirty",ht=t=>t.status==="valid",bn=t=>typeof Promise<"u"&&t instanceof Promise;d();d();var B;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(B||(B={}));var Ce=class{constructor(e,n,r,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},yu=(t,e)=>{if(ht(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new ve(t.common.issues);return this._error=n,this._error}}};function G(t){if(!t)return{};let{errorMap:e,invalid_type_error:n,required_error:r,description:s}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(o,a)=>{let{message:c}=t;return o.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??r??a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:c??n??a.defaultError}},description:s}}var Y=class{get description(){return this._def.description}_getType(e){return We(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:We(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ge,ctx:{common:e.parent.common,data:e.data,parsedType:We(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(bn(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){let n=this._parse(e);return Promise.resolve(n)}parse(e,n){let r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){let r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:We(e)},s=this._parseSync({data:e,path:r.path,parent:r});return yu(r,s)}"~validate"(e){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:We(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:n});return ht(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(r=>ht(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(e,n){let r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){let r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:We(e)},s=this._parse({data:e,path:r.path,parent:r}),i=await(bn(s)?s:Promise.resolve(s));return yu(r,i)}refine(e,n){let r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,i)=>{let o=e(s),a=()=>i.addIssue({code:A.custom,...r(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,n){return this._refinement((r,s)=>e(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}_refinement(e){return new Ie({schema:this,typeName:K.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Ae.create(this,this._def)}nullable(){return Ye.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return at.create(this)}promise(){return gt.create(this,this._def)}or(e){return Ut.create([this,e],this._def)}and(e){return Vt.create(this,e,this._def)}transform(e){return new Ie({...G(this._def),schema:this,typeName:K.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let n=typeof e=="function"?e:()=>e;return new Yt({...G(this._def),innerType:this,defaultValue:n,typeName:K.ZodDefault})}brand(){return new er({typeName:K.ZodBranded,type:this,...G(this._def)})}catch(e){let n=typeof e=="function"?e:()=>e;return new zt({...G(this._def),innerType:this,catchValue:n,typeName:K.ZodCatch})}describe(e){let n=this.constructor;return new n({...this._def,description:e})}pipe(e){return tr.create(this,e)}readonly(){return Ht.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},xw=/^c[^\s-]{8,}$/i,Tw=/^[0-9a-z]+$/,Ow=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Nw=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Aw=/^[a-z0-9_-]{21}$/i,Cw=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Iw=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Pw=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Lw="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",mo,Rw=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,jw=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,$w=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Mw=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,qw=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Fw=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,wu="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Bw=new RegExp(`^${wu}$`);function bu(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function Dw(t){return new RegExp(`^${bu(t)}$`)}function vu(t){let e=`${wu}T${bu(t)}`,n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function Uw(t,e){return!!((e==="v4"||!e)&&Rw.test(t)||(e==="v6"||!e)&&$w.test(t))}function Vw(t,e){if(!Cw.test(t))return!1;try{let[n]=t.split(".");if(!n)return!1;let r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),s=JSON.parse(atob(r));return!(typeof s!="object"||s===null||"typ"in s&&s?.typ!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function Kw(t,e){return!!((e==="v4"||!e)&&jw.test(t)||(e==="v6"||!e)&&Mw.test(t))}var pt=class t extends Y{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==q.string){let i=this._getOrReturnCtx(e);return R(i,{code:A.invalid_type,expected:q.string,received:i.parsedType}),V}let r=new ge,s;for(let i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(s=this._getOrReturnCtx(e,s),R(s,{code:A.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")e.data.length>i.value&&(s=this._getOrReturnCtx(e,s),R(s,{code:A.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){let o=e.data.length>i.value,a=e.data.length<i.value;(o||a)&&(s=this._getOrReturnCtx(e,s),o?R(s,{code:A.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&R(s,{code:A.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")Pw.test(e.data)||(s=this._getOrReturnCtx(e,s),R(s,{validation:"email",code:A.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")mo||(mo=new RegExp(Lw,"u")),mo.test(e.data)||(s=this._getOrReturnCtx(e,s),R(s,{validation:"emoji",code:A.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")Nw.test(e.data)||(s=this._getOrReturnCtx(e,s),R(s,{validation:"uuid",code:A.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")Aw.test(e.data)||(s=this._getOrReturnCtx(e,s),R(s,{validation:"nanoid",code:A.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")xw.test(e.data)||(s=this._getOrReturnCtx(e,s),R(s,{validation:"cuid",code:A.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")Tw.test(e.data)||(s=this._getOrReturnCtx(e,s),R(s,{validation:"cuid2",code:A.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")Ow.test(e.data)||(s=this._getOrReturnCtx(e,s),R(s,{validation:"ulid",code:A.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),R(s,{validation:"url",code:A.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),R(s,{validation:"regex",code:A.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(s=this._getOrReturnCtx(e,s),R(s,{code:A.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(s=this._getOrReturnCtx(e,s),R(s,{code:A.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(s=this._getOrReturnCtx(e,s),R(s,{code:A.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?vu(i).test(e.data)||(s=this._getOrReturnCtx(e,s),R(s,{code:A.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?Bw.test(e.data)||(s=this._getOrReturnCtx(e,s),R(s,{code:A.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?Dw(i).test(e.data)||(s=this._getOrReturnCtx(e,s),R(s,{code:A.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?Iw.test(e.data)||(s=this._getOrReturnCtx(e,s),R(s,{validation:"duration",code:A.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?Uw(e.data,i.version)||(s=this._getOrReturnCtx(e,s),R(s,{validation:"ip",code:A.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?Vw(e.data,i.alg)||(s=this._getOrReturnCtx(e,s),R(s,{validation:"jwt",code:A.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?Kw(e.data,i.version)||(s=this._getOrReturnCtx(e,s),R(s,{validation:"cidr",code:A.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?qw.test(e.data)||(s=this._getOrReturnCtx(e,s),R(s,{validation:"base64",code:A.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?Fw.test(e.data)||(s=this._getOrReturnCtx(e,s),R(s,{validation:"base64url",code:A.invalid_string,message:i.message}),r.dirty()):z.assertNever(i);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(s=>e.test(s),{validation:n,code:A.invalid_string,...B.errToObj(r)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...B.errToObj(e)})}url(e){return this._addCheck({kind:"url",...B.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...B.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...B.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...B.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...B.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...B.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...B.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...B.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...B.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...B.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...B.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...B.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...B.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...B.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...B.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...B.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...B.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...B.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...B.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...B.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...B.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...B.errToObj(n)})}nonempty(e){return this.min(1,B.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};pt.create=t=>new pt({checks:[],typeName:K.ZodString,coerce:t?.coerce??!1,...G(t)});function Gw(t,e){let n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,s=n>r?n:r,i=Number.parseInt(t.toFixed(s).replace(".","")),o=Number.parseInt(e.toFixed(s).replace(".",""));return i%o/10**s}var $t=class t extends Y{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==q.number){let i=this._getOrReturnCtx(e);return R(i,{code:A.invalid_type,expected:q.number,received:i.parsedType}),V}let r,s=new ge;for(let i of this._def.checks)i.kind==="int"?z.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),R(r,{code:A.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),R(r,{code:A.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),R(r,{code:A.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?Gw(e.data,i.value)!==0&&(r=this._getOrReturnCtx(e,r),R(r,{code:A.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),R(r,{code:A.not_finite,message:i.message}),s.dirty()):z.assertNever(i);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,B.toString(n))}gt(e,n){return this.setLimit("min",e,!1,B.toString(n))}lte(e,n){return this.setLimit("max",e,!0,B.toString(n))}lt(e,n){return this.setLimit("max",e,!1,B.toString(n))}setLimit(e,n,r,s){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:B.toString(s)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:B.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:B.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:B.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:B.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:B.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:B.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:B.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:B.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:B.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&z.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}};$t.create=t=>new $t({checks:[],typeName:K.ZodNumber,coerce:t?.coerce||!1,...G(t)});var Mt=class t extends Y{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==q.bigint)return this._getInvalidInput(e);let r,s=new ge;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),R(r,{code:A.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),R(r,{code:A.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),R(r,{code:A.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):z.assertNever(i);return{status:s.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return R(n,{code:A.invalid_type,expected:q.bigint,received:n.parsedType}),V}gte(e,n){return this.setLimit("min",e,!0,B.toString(n))}gt(e,n){return this.setLimit("min",e,!1,B.toString(n))}lte(e,n){return this.setLimit("max",e,!0,B.toString(n))}lt(e,n){return this.setLimit("max",e,!1,B.toString(n))}setLimit(e,n,r,s){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:B.toString(s)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:B.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:B.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:B.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:B.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:B.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};Mt.create=t=>new Mt({checks:[],typeName:K.ZodBigInt,coerce:t?.coerce??!1,...G(t)});var qt=class extends Y{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==q.boolean){let r=this._getOrReturnCtx(e);return R(r,{code:A.invalid_type,expected:q.boolean,received:r.parsedType}),V}return we(e.data)}};qt.create=t=>new qt({typeName:K.ZodBoolean,coerce:t?.coerce||!1,...G(t)});var Ft=class t extends Y{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==q.date){let i=this._getOrReturnCtx(e);return R(i,{code:A.invalid_type,expected:q.date,received:i.parsedType}),V}if(Number.isNaN(e.data.getTime())){let i=this._getOrReturnCtx(e);return R(i,{code:A.invalid_date}),V}let r=new ge,s;for(let i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(s=this._getOrReturnCtx(e,s),R(s,{code:A.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(s=this._getOrReturnCtx(e,s),R(s,{code:A.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):z.assertNever(i);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:B.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:B.toString(n)})}get minDate(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}};Ft.create=t=>new Ft({checks:[],coerce:t?.coerce||!1,typeName:K.ZodDate,...G(t)});var Sn=class extends Y{_parse(e){if(this._getType(e)!==q.symbol){let r=this._getOrReturnCtx(e);return R(r,{code:A.invalid_type,expected:q.symbol,received:r.parsedType}),V}return we(e.data)}};Sn.create=t=>new Sn({typeName:K.ZodSymbol,...G(t)});var Bt=class extends Y{_parse(e){if(this._getType(e)!==q.undefined){let r=this._getOrReturnCtx(e);return R(r,{code:A.invalid_type,expected:q.undefined,received:r.parsedType}),V}return we(e.data)}};Bt.create=t=>new Bt({typeName:K.ZodUndefined,...G(t)});var Dt=class extends Y{_parse(e){if(this._getType(e)!==q.null){let r=this._getOrReturnCtx(e);return R(r,{code:A.invalid_type,expected:q.null,received:r.parsedType}),V}return we(e.data)}};Dt.create=t=>new Dt({typeName:K.ZodNull,...G(t)});var mt=class extends Y{constructor(){super(...arguments),this._any=!0}_parse(e){return we(e.data)}};mt.create=t=>new mt({typeName:K.ZodAny,...G(t)});var ot=class extends Y{constructor(){super(...arguments),this._unknown=!0}_parse(e){return we(e.data)}};ot.create=t=>new ot({typeName:K.ZodUnknown,...G(t)});var Fe=class extends Y{_parse(e){let n=this._getOrReturnCtx(e);return R(n,{code:A.invalid_type,expected:q.never,received:n.parsedType}),V}};Fe.create=t=>new Fe({typeName:K.ZodNever,...G(t)});var En=class extends Y{_parse(e){if(this._getType(e)!==q.undefined){let r=this._getOrReturnCtx(e);return R(r,{code:A.invalid_type,expected:q.void,received:r.parsedType}),V}return we(e.data)}};En.create=t=>new En({typeName:K.ZodVoid,...G(t)});var at=class t extends Y{_parse(e){let{ctx:n,status:r}=this._processInputParams(e),s=this._def;if(n.parsedType!==q.array)return R(n,{code:A.invalid_type,expected:q.array,received:n.parsedType}),V;if(s.exactLength!==null){let o=n.data.length>s.exactLength.value,a=n.data.length<s.exactLength.value;(o||a)&&(R(n,{code:o?A.too_big:A.too_small,minimum:a?s.exactLength.value:void 0,maximum:o?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(R(n,{code:A.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(R(n,{code:A.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,a)=>s.type._parseAsync(new Ce(n,o,n.path,a)))).then(o=>ge.mergeArray(r,o));let i=[...n.data].map((o,a)=>s.type._parseSync(new Ce(n,o,n.path,a)));return ge.mergeArray(r,i)}get element(){return this._def.type}min(e,n){return new t({...this._def,minLength:{value:e,message:B.toString(n)}})}max(e,n){return new t({...this._def,maxLength:{value:e,message:B.toString(n)}})}length(e,n){return new t({...this._def,exactLength:{value:e,message:B.toString(n)}})}nonempty(e){return this.min(1,e)}};at.create=(t,e)=>new at({type:t,minLength:null,maxLength:null,exactLength:null,typeName:K.ZodArray,...G(e)});function vn(t){if(t instanceof Se){let e={};for(let n in t.shape){let r=t.shape[n];e[n]=Ae.create(vn(r))}return new Se({...t._def,shape:()=>e})}else return t instanceof at?new at({...t._def,type:vn(t.element)}):t instanceof Ae?Ae.create(vn(t.unwrap())):t instanceof Ye?Ye.create(vn(t.unwrap())):t instanceof Je?Je.create(t.items.map(e=>vn(e))):t}var Se=class t extends Y{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),n=z.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==q.object){let l=this._getOrReturnCtx(e);return R(l,{code:A.invalid_type,expected:q.object,received:l.parsedType}),V}let{status:r,ctx:s}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof Fe&&this._def.unknownKeys==="strip"))for(let l in s.data)o.includes(l)||a.push(l);let c=[];for(let l of o){let u=i[l],f=s.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new Ce(s,f,s.path,l)),alwaysSet:l in s.data})}if(this._def.catchall instanceof Fe){let l=this._def.unknownKeys;if(l==="passthrough")for(let u of a)c.push({key:{status:"valid",value:u},value:{status:"valid",value:s.data[u]}});else if(l==="strict")a.length>0&&(R(s,{code:A.unrecognized_keys,keys:a}),r.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let u of a){let f=s.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new Ce(s,f,s.path,u)),alwaysSet:u in s.data})}}return s.common.async?Promise.resolve().then(async()=>{let l=[];for(let u of c){let f=await u.key,h=await u.value;l.push({key:f,value:h,alwaysSet:u.alwaysSet})}return l}).then(l=>ge.mergeObjectSync(r,l)):ge.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(e){return B.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{let s=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:B.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:K.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let n={};for(let r of z.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}omit(e){let n={};for(let r of z.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}deepPartial(){return vn(this)}partial(e){let n={};for(let r of z.objectKeys(this.shape)){let s=this.shape[r];e&&!e[r]?n[r]=s:n[r]=s.optional()}return new t({...this._def,shape:()=>n})}required(e){let n={};for(let r of z.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof Ae;)i=i._def.innerType;n[r]=i}return new t({...this._def,shape:()=>n})}keyof(){return Su(z.objectKeys(this.shape))}};Se.create=(t,e)=>new Se({shape:()=>t,unknownKeys:"strip",catchall:Fe.create(),typeName:K.ZodObject,...G(e)});Se.strictCreate=(t,e)=>new Se({shape:()=>t,unknownKeys:"strict",catchall:Fe.create(),typeName:K.ZodObject,...G(e)});Se.lazycreate=(t,e)=>new Se({shape:t,unknownKeys:"strip",catchall:Fe.create(),typeName:K.ZodObject,...G(e)});var Ut=class extends Y{_parse(e){let{ctx:n}=this._processInputParams(e),r=this._def.options;function s(i){for(let a of i)if(a.result.status==="valid")return a.result;for(let a of i)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;let o=i.map(a=>new ve(a.ctx.common.issues));return R(n,{code:A.invalid_union,unionErrors:o}),V}if(n.common.async)return Promise.all(r.map(async i=>{let o={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(s);{let i,o=[];for(let c of r){let l={...n,common:{...n.common,issues:[]},parent:null},u=c._parseSync({data:n.data,path:n.path,parent:l});if(u.status==="valid")return u;u.status==="dirty"&&!i&&(i={result:u,ctx:l}),l.common.issues.length&&o.push(l.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;let a=o.map(c=>new ve(c));return R(n,{code:A.invalid_union,unionErrors:a}),V}}get options(){return this._def.options}};Ut.create=(t,e)=>new Ut({options:t,typeName:K.ZodUnion,...G(e)});var it=t=>t instanceof Kt?it(t.schema):t instanceof Ie?it(t.innerType()):t instanceof Gt?[t.value]:t instanceof Wt?t.options:t instanceof Jt?z.objectValues(t.enum):t instanceof Yt?it(t._def.innerType):t instanceof Bt?[void 0]:t instanceof Dt?[null]:t instanceof Ae?[void 0,...it(t.unwrap())]:t instanceof Ye?[null,...it(t.unwrap())]:t instanceof er||t instanceof Ht?it(t.unwrap()):t instanceof zt?it(t._def.innerType):[],ts=class t extends Y{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==q.object)return R(n,{code:A.invalid_type,expected:q.object,received:n.parsedType}),V;let r=this.discriminator,s=n.data[r],i=this.optionsMap.get(s);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(R(n,{code:A.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),V)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){let s=new Map;for(let i of n){let o=it(i.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of o){if(s.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);s.set(a,i)}}return new t({typeName:K.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:s,...G(r)})}};function go(t,e){let n=We(t),r=We(e);if(t===e)return{valid:!0,data:t};if(n===q.object&&r===q.object){let s=z.objectKeys(e),i=z.objectKeys(t).filter(a=>s.indexOf(a)!==-1),o={...t,...e};for(let a of i){let c=go(t[a],e[a]);if(!c.valid)return{valid:!1};o[a]=c.data}return{valid:!0,data:o}}else if(n===q.array&&r===q.array){if(t.length!==e.length)return{valid:!1};let s=[];for(let i=0;i<t.length;i++){let o=t[i],a=e[i],c=go(o,a);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return n===q.date&&r===q.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Vt=class extends Y{_parse(e){let{status:n,ctx:r}=this._processInputParams(e),s=(i,o)=>{if(Qr(i)||Qr(o))return V;let a=go(i.value,o.value);return a.valid?((es(i)||es(o))&&n.dirty(),{status:n.value,value:a.data}):(R(r,{code:A.invalid_intersection_types}),V)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,o])=>s(i,o)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};Vt.create=(t,e,n)=>new Vt({left:t,right:e,typeName:K.ZodIntersection,...G(n)});var Je=class t extends Y{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==q.array)return R(r,{code:A.invalid_type,expected:q.array,received:r.parsedType}),V;if(r.data.length<this._def.items.length)return R(r,{code:A.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),V;!this._def.rest&&r.data.length>this._def.items.length&&(R(r,{code:A.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let i=[...r.data].map((o,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new Ce(r,o,r.path,a)):null}).filter(o=>!!o);return r.common.async?Promise.all(i).then(o=>ge.mergeArray(n,o)):ge.mergeArray(n,i)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Je.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Je({items:t,typeName:K.ZodTuple,rest:null,...G(e)})};var ns=class t extends Y{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==q.object)return R(r,{code:A.invalid_type,expected:q.object,received:r.parsedType}),V;let s=[],i=this._def.keyType,o=this._def.valueType;for(let a in r.data)s.push({key:i._parse(new Ce(r,a,r.path,a)),value:o._parse(new Ce(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?ge.mergeObjectAsync(n,s):ge.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof Y?new t({keyType:e,valueType:n,typeName:K.ZodRecord,...G(r)}):new t({keyType:pt.create(),valueType:e,typeName:K.ZodRecord,...G(n)})}},kn=class extends Y{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==q.map)return R(r,{code:A.invalid_type,expected:q.map,received:r.parsedType}),V;let s=this._def.keyType,i=this._def.valueType,o=[...r.data.entries()].map(([a,c],l)=>({key:s._parse(new Ce(r,a,r.path,[l,"key"])),value:i._parse(new Ce(r,c,r.path,[l,"value"]))}));if(r.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of o){let l=await c.key,u=await c.value;if(l.status==="aborted"||u.status==="aborted")return V;(l.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(l.value,u.value)}return{status:n.value,value:a}})}else{let a=new Map;for(let c of o){let l=c.key,u=c.value;if(l.status==="aborted"||u.status==="aborted")return V;(l.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(l.value,u.value)}return{status:n.value,value:a}}}};kn.create=(t,e,n)=>new kn({valueType:e,keyType:t,typeName:K.ZodMap,...G(n)});var xn=class t extends Y{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==q.set)return R(r,{code:A.invalid_type,expected:q.set,received:r.parsedType}),V;let s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(R(r,{code:A.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(R(r,{code:A.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());let i=this._def.valueType;function o(c){let l=new Set;for(let u of c){if(u.status==="aborted")return V;u.status==="dirty"&&n.dirty(),l.add(u.value)}return{status:n.value,value:l}}let a=[...r.data.values()].map((c,l)=>i._parse(new Ce(r,c,r.path,l)));return r.common.async?Promise.all(a).then(c=>o(c)):o(a)}min(e,n){return new t({...this._def,minSize:{value:e,message:B.toString(n)}})}max(e,n){return new t({...this._def,maxSize:{value:e,message:B.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};xn.create=(t,e)=>new xn({valueType:t,minSize:null,maxSize:null,typeName:K.ZodSet,...G(e)});var rs=class t extends Y{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==q.function)return R(n,{code:A.invalid_type,expected:q.function,received:n.parsedType}),V;function r(a,c){return Qn({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,wn(),st].filter(l=>!!l),issueData:{code:A.invalid_arguments,argumentsError:c}})}function s(a,c){return Qn({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,wn(),st].filter(l=>!!l),issueData:{code:A.invalid_return_type,returnTypeError:c}})}let i={errorMap:n.common.contextualErrorMap},o=n.data;if(this._def.returns instanceof gt){let a=this;return we(async function(...c){let l=new ve([]),u=await a._def.args.parseAsync(c,i).catch(g=>{throw l.addIssue(r(c,g)),l}),f=await Reflect.apply(o,this,u);return await a._def.returns._def.type.parseAsync(f,i).catch(g=>{throw l.addIssue(s(f,g)),l})})}else{let a=this;return we(function(...c){let l=a._def.args.safeParse(c,i);if(!l.success)throw new ve([r(c,l.error)]);let u=Reflect.apply(o,this,l.data),f=a._def.returns.safeParse(u,i);if(!f.success)throw new ve([s(u,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Je.create(e).rest(ot.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new t({args:e||Je.create([]).rest(ot.create()),returns:n||ot.create(),typeName:K.ZodFunction,...G(r)})}},Kt=class extends Y{get schema(){return this._def.getter()}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};Kt.create=(t,e)=>new Kt({getter:t,typeName:K.ZodLazy,...G(e)});var Gt=class extends Y{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return R(n,{received:n.data,code:A.invalid_literal,expected:this._def.value}),V}return{status:"valid",value:e.data}}get value(){return this._def.value}};Gt.create=(t,e)=>new Gt({value:t,typeName:K.ZodLiteral,...G(e)});function Su(t,e){return new Wt({values:t,typeName:K.ZodEnum,...G(e)})}var Wt=class t extends Y{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),r=this._def.values;return R(n,{expected:z.joinValues(r),received:n.parsedType,code:A.invalid_type}),V}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),r=this._def.values;return R(n,{received:n.data,code:A.invalid_enum_value,options:r}),V}return we(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return t.create(e,{...this._def,...n})}exclude(e,n=this._def){return t.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}};Wt.create=Su;var Jt=class extends Y{_parse(e){let n=z.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==q.string&&r.parsedType!==q.number){let s=z.objectValues(n);return R(r,{expected:z.joinValues(s),received:r.parsedType,code:A.invalid_type}),V}if(this._cache||(this._cache=new Set(z.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let s=z.objectValues(n);return R(r,{received:r.data,code:A.invalid_enum_value,options:s}),V}return we(e.data)}get enum(){return this._def.values}};Jt.create=(t,e)=>new Jt({values:t,typeName:K.ZodNativeEnum,...G(e)});var gt=class extends Y{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==q.promise&&n.common.async===!1)return R(n,{code:A.invalid_type,expected:q.promise,received:n.parsedType}),V;let r=n.parsedType===q.promise?n.data:Promise.resolve(n.data);return we(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}};gt.create=(t,e)=>new gt({type:t,typeName:K.ZodPromise,...G(e)});var Ie=class extends Y{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===K.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:n,ctx:r}=this._processInputParams(e),s=this._def.effect||null,i={addIssue:o=>{R(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){let o=s.transform(r.data,i);if(r.common.async)return Promise.resolve(o).then(async a=>{if(n.value==="aborted")return V;let c=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return c.status==="aborted"?V:c.status==="dirty"?jt(c.value):n.value==="dirty"?jt(c.value):c});{if(n.value==="aborted")return V;let a=this._def.schema._parseSync({data:o,path:r.path,parent:r});return a.status==="aborted"?V:a.status==="dirty"?jt(a.value):n.value==="dirty"?jt(a.value):a}}if(s.type==="refinement"){let o=a=>{let c=s.refinement(a,i);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){let a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?V:(a.status==="dirty"&&n.dirty(),o(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?V:(a.status==="dirty"&&n.dirty(),o(a.value).then(()=>({status:n.value,value:a.value}))))}if(s.type==="transform")if(r.common.async===!1){let o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!ht(o))return V;let a=s.transform(o.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>ht(o)?Promise.resolve(s.transform(o.value,i)).then(a=>({status:n.value,value:a})):V);z.assertNever(s)}};Ie.create=(t,e,n)=>new Ie({schema:t,typeName:K.ZodEffects,effect:e,...G(n)});Ie.createWithPreprocess=(t,e,n)=>new Ie({schema:e,effect:{type:"preprocess",transform:t},typeName:K.ZodEffects,...G(n)});var Ae=class extends Y{_parse(e){return this._getType(e)===q.undefined?we(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ae.create=(t,e)=>new Ae({innerType:t,typeName:K.ZodOptional,...G(e)});var Ye=class extends Y{_parse(e){return this._getType(e)===q.null?we(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ye.create=(t,e)=>new Ye({innerType:t,typeName:K.ZodNullable,...G(e)});var Yt=class extends Y{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return n.parsedType===q.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};Yt.create=(t,e)=>new Yt({innerType:t,typeName:K.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...G(e)});var zt=class extends Y{_parse(e){let{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return bn(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ve(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new ve(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};zt.create=(t,e)=>new zt({innerType:t,typeName:K.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...G(e)});var Tn=class extends Y{_parse(e){if(this._getType(e)!==q.nan){let r=this._getOrReturnCtx(e);return R(r,{code:A.invalid_type,expected:q.nan,received:r.parsedType}),V}return{status:"valid",value:e.data}}};Tn.create=t=>new Tn({typeName:K.ZodNaN,...G(t)});var Ww=Symbol("zod_brand"),er=class extends Y{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}},tr=class t extends Y{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?V:i.status==="dirty"?(n.dirty(),jt(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{let s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?V:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(e,n){return new t({in:e,out:n,typeName:K.ZodPipeline})}},Ht=class extends Y{_parse(e){let n=this._def.innerType._parse(e),r=s=>(ht(s)&&(s.value=Object.freeze(s.value)),s);return bn(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}};Ht.create=(t,e)=>new Ht({innerType:t,typeName:K.ZodReadonly,...G(e)});function _u(t,e){let n=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof n=="string"?{message:n}:n}function Eu(t,e={},n){return t?mt.create().superRefine((r,s)=>{let i=t(r);if(i instanceof Promise)return i.then(o=>{if(!o){let a=_u(e,r),c=a.fatal??n??!0;s.addIssue({code:"custom",...a,fatal:c})}});if(!i){let o=_u(e,r),a=o.fatal??n??!0;s.addIssue({code:"custom",...o,fatal:a})}}):mt.create()}var Jw={object:Se.lazycreate},K;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(K||(K={}));var Yw=(t,e={message:`Input not instance of ${t.name}`})=>Eu(n=>n instanceof t,e),ku=pt.create,xu=$t.create,zw=Tn.create,Hw=Mt.create,Tu=qt.create,Zw=Ft.create,Xw=Sn.create,Qw=Bt.create,eb=Dt.create,tb=mt.create,nb=ot.create,rb=Fe.create,sb=En.create,ib=at.create,ob=Se.create,ab=Se.strictCreate,cb=Ut.create,lb=ts.create,ub=Vt.create,fb=Je.create,db=ns.create,hb=kn.create,pb=xn.create,mb=rs.create,gb=Kt.create,yb=Gt.create,_b=Wt.create,wb=Jt.create,bb=gt.create,vb=Ie.create,Sb=Ae.create,Eb=Ye.create,kb=Ie.createWithPreprocess,xb=tr.create,Tb=()=>ku().optional(),Ob=()=>xu().optional(),Nb=()=>Tu().optional(),Ab={string:(t=>pt.create({...t,coerce:!0})),number:(t=>$t.create({...t,coerce:!0})),boolean:(t=>qt.create({...t,coerce:!0})),bigint:(t=>Mt.create({...t,coerce:!0})),date:(t=>Ft.create({...t,coerce:!0}))};var Cb=V;d();d();var jd=H(oe(),1),mk=3e4,ba=class{baseUrl;apiKey;timeoutMs;accessToken;constructor(e){this.baseUrl=e.baseUrl.replace(/\/$/,""),this.apiKey=e.apiKey,this.accessToken=e.accessToken,this.timeoutMs=e.timeoutMs??mk}async searchTools(e){return this.post("/v1/search",e)}async searchToolsRespond(e){return this.post("/v1/search/respond",e)}async checkCompatibility(e){return this.post("/v1/graph/compatibility",e)}async compareTools(e){return this.post("/v1/graph/compare",e)}async getStack(e){return this.post("/v1/graph/stack",e)}async refineRequirement(e){return this.post("/v1/intelligence/refine",e)}async verifySuggestion(e){return this.post("/v1/intelligence/verify",e)}async checkIssue(e){return this.post("/v1/intelligence/issue",e)}async batchResolve(e){let n=[],r=new Map,s=new Map;if(e.length===0)return{results:[],warnings:n,methods:r,githubUrls:s};try{let i=await this.rawPost("/v1/tools/batch-resolve",{api_version:"1",tools:e});if(i.status===404)return n.push({scope:"batch-resolve",message:"/v1/tools/batch-resolve not deployed on this engine \u2014 falling back to offline classification (source: non_oss)."}),{results:e.map(c=>({input:c,matched:!1,match_method:"none"})),warnings:n,methods:r,githubUrls:s};if(!i.ok)return n.push({scope:"batch-resolve",message:`batch-resolve returned HTTP ${i.status} \u2014 all tools marked as non_oss.`}),{results:e.map(c=>({input:c,matched:!1,match_method:"none"})),warnings:n,methods:r,githubUrls:s};let o=await i.json();if(!Array.isArray(o.resolved))return n.push({scope:"batch-resolve",message:"batch-resolve returned unexpected body shape \u2014 falling back."}),{results:e.map(c=>({input:c,matched:!1,match_method:"none"})),warnings:n,methods:r,githubUrls:s};let a=[];for(let c of o.resolved){let l=c.match_method??(c.matched?"tool_name_exact":"none"),u=c.matched??l!=="none",f=`${c.input.ecosystem}:${c.input.name}`;r.set(f,l),c.tool?.github_url&&s.set(f,c.tool.github_url),a.push({input:c.input,matched:u,match_method:l,tool:c.tool})}return{results:a,warnings:n,methods:r,githubUrls:s}}catch(i){return n.push({scope:"batch-resolve",message:`batch-resolve network failure: ${i instanceof Error?i.message:String(i)}. Tools classified as non_oss.`}),{results:e.map(o=>({input:o,matched:!1,match_method:"none"})),warnings:n,methods:r,githubUrls:s}}}async reportOutcome(e){return this.post("/v1/feedback/outcome",e)}async suggestGraphUpdate(e){return this.post("/v1/feedback/suggest",e)}async register(e){return(await this.rawPost("/v1/register",{client_id:e})).json()}async healthCheck(){try{return(await fetch(`${this.baseUrl}/v1/health`,{signal:AbortSignal.timeout(5e3)})).ok}catch{return!1}}async post(e,n){try{let r=await this.rawPost(e,n);if(r.status===429&&r.headers.get("x-toolcairn-limit-exhausted")==="1")try{return{content:[{type:"text",text:(await r.clone().json()).message??"ToolCairn daily limit reached. Join the Pro waitlist for 1 month free: https://toolcairn.neurynae.com/waitlist?source=limit_exhausted"}]}}catch{}let s=await r.json();return s&&typeof s=="object"&&"content"in s?s:{content:[{type:"text",text:JSON.stringify(s)}]}}catch(r){let s=r instanceof Error?r.message:String(r);return{content:[{type:"text",text:JSON.stringify({ok:!1,error:jd.ErrorCode.ERR_NETWORK_UNREACHABLE,message:`ToolCairn API unreachable: ${s}. Check your internet connection or try again later.`})}],isError:!0}}}rawPost(e,n){let r={"Content-Type":"application/json","X-ToolCairn-Key":this.apiKey,"Accept-Encoding":"gzip"};return this.accessToken&&(r.Authorization=`Bearer ${this.accessToken}`),fetch(`${this.baseUrl}${e}`,{method:"POST",headers:r,body:JSON.stringify(n),signal:AbortSignal.timeout(this.timeoutMs)})}};d();import{chmod as $d,mkdir as gk,readFile as Md,writeFile as yk}from"fs/promises";import{homedir as _k}from"os";import{join as Sa}from"path";var Ns=Sa(_k(),".toolcairn"),qd=Sa(Ns,"credentials.json"),Ea=Sa(Ns,"pending-auth.json"),va=process.platform==="win32";async function Fd(t,e){if(await gk(Ns,{recursive:!0,mode:va?void 0:448}),await yk(t,e,{encoding:"utf-8",mode:va?void 0:384}),!va){try{await $d(t,384)}catch{}try{await $d(Ns,448)}catch{}}}async function ka(t){await Fd(Ea,JSON.stringify(t,null,2))}async function xa(){try{let t=await Md(Ea,"utf-8"),e=JSON.parse(t);return new Date(e.expires_at)<new Date?(await or(),null):e}catch{return null}}async function or(){try{let{unlink:t}=await import("fs/promises");await t(Ea)}catch{}}function wk(t){if(!t.access_token)return!1;try{let e=t.access_token.split(".");if(e.length!==3)return!1;let n=JSON.parse(Buffer.from(e[1]??"","base64url").toString("utf-8"));return!(n.exp&&n.exp<Date.now()/1e3+300)}catch{return!1}}async function Bd(){try{let t=await Md(qd,"utf-8");return JSON.parse(t)}catch{return null}}async function Ta(){let t=await Bd();if(t)return t;let e={client_id:crypto.randomUUID(),created_at:new Date().toISOString()};return await As(e),e}async function As(t){await Fd(qd,JSON.stringify(t,null,2))}async function Oa(t,e,n){let r=await Ta();await As({...r,client_id:e,access_token:t,user_id:n.id,user_email:n.email??void 0,user_name:n.name??void 0,authenticated_at:new Date().toISOString()})}async function bk(){let t=await Ta();await As({client_id:t.client_id,created_at:t.created_at,api_url:t.api_url})}d();var lt=H(oe(),1);async function vk(t){let{spawn:e}=await import("child_process");try{let n=process.platform,r,s;n==="win32"?(r="cmd",s=["/c","start","",t]):n==="darwin"?(r="open",s=[t]):(r="xdg-open",s=[t]),e(r,s,{detached:!0,stdio:"ignore",shell:!1}).unref()}catch{}}async function Dd(t){let e=await fetch(`${t}/v1/auth/device-code`,{method:"POST"});if(!e.ok)throw new lt.NetworkError({code:lt.ErrorCode.ERR_NETWORK_UNREACHABLE,message:"Failed to start device auth. Check your internet connection."});let n=await e.json();return await ka({device_code:n.device_code,user_code:n.user_code,verification_uri:n.verification_uri,expires_at:new Date(Date.now()+n.expires_in*1e3).toISOString(),api_url:t}),process.stderr.write(`
170
+ \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
171
+ `),process.stderr.write(` ToolCairn \u2014 Sign In Required
172
+ `),process.stderr.write(`\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
173
+ `),process.stderr.write(`
174
+ Opening browser for authentication...
175
+
176
+ `),process.stderr.write(` URL: ${n.verification_uri}
177
+ `),process.stderr.write(` Code: ${n.user_code}
178
+
179
+ `),await vk(n.verification_uri),n}async function Sk(t){let e=await xa(),n;e&&e.api_url===t?(n={device_code:e.device_code,user_code:e.user_code,verification_uri:e.verification_uri,expires_in:Math.floor((new Date(e.expires_at).getTime()-Date.now())/1e3),interval:5},process.stderr.write(`
180
+ ToolCairn: Waiting for sign-in confirmation...
181
+ `),process.stderr.write(` URL: ${n.verification_uri}
182
+ `),process.stderr.write(` Code: ${n.user_code}
183
+
184
+ `)):n=await Dd(t);let r=await Ek(t,n.device_code,5);return await or(),await Oa(r.access_token,r.api_key,r.user),process.stderr.write(`
185
+ \u2713 Signed in as ${r.user.email}
186
+
187
+ `),{userId:r.user.id,email:r.user.email??"",name:r.user.name}}async function Ek(t,e,n){let r=Math.max(n,5)*1e3;for(;;){await kk(r);let i=await(await fetch(`${t}/v1/auth/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({device_code:e,grant_type:"device_code"})})).json();if(i.error!=="authorization_pending"){if(i.error==="expired_token")throw await or(),new lt.AuthError({code:lt.ErrorCode.ERR_AUTH_TOKEN_EXPIRED,message:"Device code expired. Please try again."});if(i.error)throw new lt.AuthError({code:lt.ErrorCode.ERR_AUTH_UNAUTHORIZED,message:`Authorization failed: ${i.error}`});if(i.access_token)return i}}}function kk(t){return new Promise(e=>setTimeout(e,t))}d();d();var Dy=H(oe(),1);import{readFile as JC}from"fs/promises";import{basename as YC,resolve as Cl}from"path";d();import{readdir as Ok}from"fs/promises";import{join as Nk}from"path";d();import{access as xk,readdir as DR,stat as Tk}from"fs/promises";async function P(t){try{return await xk(t),!0}catch{return!1}}async function fe(t){try{return(await Tk(t)).isDirectory()}catch{return!1}}var tn=new Set(["node_modules",".git",".hg",".svn","dist","build","out",".next",".turbo",".nuxt","target","vendor","__pycache__",".venv","venv",".tox",".pytest_cache",".mypy_cache","bin","obj",".gradle",".idea",".vscode",".DS_Store","coverage",".cache",".pnpm-store"]);var Ak={npm:["package.json"],pypi:["pyproject.toml","requirements.txt","requirements-dev.txt","setup.py","Pipfile"],cargo:["Cargo.toml"],go:["go.mod"],rubygems:["Gemfile"],maven:["pom.xml"],gradle:["build.gradle","build.gradle.kts","gradle.lockfile"],composer:["composer.json"],hex:["mix.exs"],pub:["pubspec.yaml"],nuget:["packages.config"],"swift-pm":["Package.swift"]},Ck={".csproj":"nuget",".fsproj":"nuget"};async function Ud(t){let e=new Set;for(let[n,r]of Object.entries(Ak))for(let s of r)if(await P(Nk(t,s))){e.add(n);break}try{let n=await Ok(t);for(let r of n)for(let[s,i]of Object.entries(Ck))if(r.endsWith(s)){e.add(i);break}}catch{}return Array.from(e)}d();var Ik={npm:{next:"Next.js",react:"React",vue:"Vue",nuxt:"Nuxt",svelte:"Svelte","@sveltejs/kit":"SvelteKit",astro:"Astro","solid-js":"SolidJS",express:"Express",fastify:"Fastify",koa:"Koa",hono:"Hono","@nestjs/core":"NestJS",remix:"Remix","@remix-run/react":"Remix",gatsby:"Gatsby",electron:"Electron","react-native":"React Native",expo:"Expo",angular:"Angular","@angular/core":"Angular",turbo:"Turborepo",nx:"Nx",vite:"Vite",webpack:"Webpack"},pypi:{django:"Django",flask:"Flask",fastapi:"FastAPI",starlette:"Starlette",pyramid:"Pyramid",tornado:"Tornado",aiohttp:"aiohttp",litestar:"Litestar",sanic:"Sanic",bottle:"Bottle",quart:"Quart",celery:"Celery",streamlit:"Streamlit",gradio:"Gradio",torch:"PyTorch",tensorflow:"TensorFlow",transformers:"Transformers",langchain:"LangChain","llama-index":"LlamaIndex"},cargo:{"actix-web":"Actix Web",axum:"Axum",rocket:"Rocket",warp:"Warp",tide:"Tide",poem:"Poem",salvo:"Salvo",leptos:"Leptos",dioxus:"Dioxus",yew:"Yew",tauri:"Tauri",bevy:"Bevy",tokio:"Tokio"},go:{"github.com/gin-gonic/gin":"Gin","github.com/labstack/echo":"Echo","github.com/labstack/echo/v4":"Echo","github.com/gofiber/fiber":"Fiber","github.com/gofiber/fiber/v2":"Fiber","github.com/beego/beego":"Beego","github.com/go-chi/chi":"Chi","github.com/gorilla/mux":"Gorilla","github.com/revel/revel":"Revel"},rubygems:{rails:"Ruby on Rails",sinatra:"Sinatra",hanami:"Hanami",roda:"Roda",rack:"Rack"},maven:{"org.springframework.boot:spring-boot-starter":"Spring Boot","org.springframework.boot:spring-boot-starter-web":"Spring Boot","io.quarkus:quarkus-core":"Quarkus","io.micronaut:micronaut-core":"Micronaut","io.vertx:vertx-core":"Vert.x","com.google.inject:guice":"Guice"},gradle:{"org.springframework.boot:spring-boot-starter":"Spring Boot","io.quarkus:quarkus-core":"Quarkus","io.micronaut:micronaut-core":"Micronaut","io.ktor:ktor-server-core":"Ktor"},composer:{"laravel/framework":"Laravel","symfony/framework-bundle":"Symfony","cakephp/cakephp":"CakePHP","yiisoft/yii2":"Yii","slim/slim":"Slim"},hex:{phoenix:"Phoenix",ecto:"Ecto",nerves:"Nerves",ash:"Ash"},pub:{flutter:"Flutter",flutter_bloc:"Flutter BLoC"},nuget:{"Microsoft.AspNetCore.App":"ASP.NET Core","Microsoft.AspNetCore":"ASP.NET Core","Microsoft.EntityFrameworkCore":"Entity Framework Core","Microsoft.NET.Sdk.Web":"ASP.NET Core",Avalonia:"Avalonia",MAUI:".NET MAUI"},"swift-pm":{vapor:"Vapor",kitura:"Kitura",perfect:"Perfect"}},Pk=new Set(["framework","web-framework","ui-framework","meta-framework","backend-framework","frontend-framework","mobile-framework"]);function Vd(t,e){let n=[],r=new Set;for(let s of t){if(s.section==="dev")continue;let i=s.workspace_path||".",o=`${s.ecosystem}:${s.name}`,a=e.get(o),c=null,l="local";if(a?.matched&&a.tool&&(a.tool.categories??[]).some(h=>Pk.has(h.toLowerCase()))&&(c=a.tool.canonical_name,l="graph"),!c){let f=Ik[s.ecosystem]?.[s.name];f&&(c=f,l="local")}if(!c)continue;let u=`${c}:${i}`;r.has(u)||(r.add(u),n.push({name:c,ecosystem:s.ecosystem,workspace:i,source:l}))}return n}d();import{readdir as Lk}from"fs/promises";import{join as Rk,relative as jk,sep as $k}from"path";var Mk={".ts":"TypeScript",".tsx":"TypeScript",".js":"JavaScript",".jsx":"JavaScript",".mjs":"JavaScript",".cjs":"JavaScript",".py":"Python",".pyi":"Python",".rs":"Rust",".go":"Go",".rb":"Ruby",".java":"Java",".kt":"Kotlin",".kts":"Kotlin",".scala":"Scala",".php":"PHP",".ex":"Elixir",".exs":"Elixir",".erl":"Erlang",".dart":"Dart",".cs":"C#",".fs":"F#",".vb":"Visual Basic",".swift":"Swift",".c":"C",".h":"C",".cpp":"C++",".cxx":"C++",".cc":"C++",".hpp":"C++",".m":"Objective-C",".mm":"Objective-C",".lua":"Lua",".r":"R",".jl":"Julia",".nim":"Nim",".zig":"Zig",".clj":"Clojure",".cljs":"Clojure",".hs":"Haskell",".elm":"Elm",".ml":"OCaml",".mli":"OCaml",".vue":"Vue",".svelte":"Svelte",".astro":"Astro"};async function Kd(t,e){let n=new Map,r=new Map,s=[...e,""].filter((i,o,a)=>a.indexOf(i)===o).sort((i,o)=>o.length-i.length);for(let i of s)r.set(i,new Map);return await Gd(t,t,n,r,s),[...n.entries()].map(([i,o])=>{let a=s.filter(c=>(r.get(c)?.get(i)??0)>0).map(c=>c||".");return{name:i,file_count:o,workspaces:a}}).filter(i=>i.file_count>0).sort((i,o)=>o.file_count-i.file_count)}async function Gd(t,e,n,r,s){let i;try{i=await Lk(e,{withFileTypes:!0})}catch{return}for(let o of i){if(o.name.startsWith(".")&&o.name!==".github"&&![".toolcairn",".claude"].includes(o.name)||tn.has(o.name))continue;let a=Rk(e,o.name);if(o.isDirectory())await Gd(t,a,n,r,s);else if(o.isFile()){let c=qk(o.name);if(!c)continue;let l=Mk[c];if(!l)continue;n.set(l,(n.get(l)??0)+1);let u=jk(t,a).split($k).join("/");for(let f of s)if(f===""||u===f||u.startsWith(`${f}/`)){let h=r.get(f);h&&h.set(l,(h.get(l)??0)+1);break}}}}function qk(t){let e=t.lastIndexOf(".");return e<0||e===0?null:t.slice(e).toLowerCase()}d();d();import{readFile as Xd}from"fs/promises";import{join as Qd}from"path";d();d();d();d();d();d();function Fk(t,e){let n=t.slice(0,e).split(/\r\n|\n|\r/g);return[n.length,n.pop().length+1]}function Bk(t,e,n){let r=t.split(/\r\n|\n|\r/g),s="",i=(Math.log10(e+1)|0)+1;for(let o=e-1;o<=e+1;o++){let a=r[o-1];a&&(s+=o.toString().padEnd(i," "),s+=": ",s+=a,s+=`
188
+ `,o===e&&(s+=" ".repeat(i+n+2),s+=`^
189
+ `))}return s}var W=class extends Error{line;column;codeblock;constructor(e,n){let[r,s]=Fk(n.toml,n.ptr),i=Bk(n.toml,r,s);super(`Invalid TOML document: ${e}
190
+
191
+ ${i}`,n),this.line=r,this.column=s,this.codeblock=i}};function Dk(t,e){let n=0;for(;t[e-++n]==="\\";);return--n&&n%2}function Cs(t,e=0,n=t.length){let r=t.indexOf(`
192
+ `,e);return t[r-1]==="\r"&&r--,r<=n?r:-1}function In(t,e){for(let n=e;n<t.length;n++){let r=t[n];if(r===`
193
+ `)return n;if(r==="\r"&&t[n+1]===`
194
+ `)return n+1;if(r<" "&&r!==" "||r==="\x7F")throw new W("control characters are not allowed in comments",{toml:t,ptr:e})}return t.length}function Ne(t,e,n,r){let s;for(;;){for(;(s=t[e])===" "||s===" "||!n&&(s===`
195
+ `||s==="\r"&&t[e+1]===`
196
+ `);)e++;if(r||s!=="#")break;e=In(t,e)}return e}function Wd(t,e,n,r,s=!1){if(!r)return e=Cs(t,e),e<0?t.length:e;for(let i=e;i<t.length;i++){let o=t[i];if(o==="#")i=Cs(t,i);else{if(o===n)return i+1;if(o===r||s&&(o===`
197
+ `||o==="\r"&&t[i+1]===`
198
+ `))return i}}throw new W("cannot find end of structure",{toml:t,ptr:e})}function Is(t,e){let n=t[e],r=n===t[e+1]&&t[e+1]===t[e+2]?t.slice(e,e+3):n;e+=r.length-1;do e=t.indexOf(r,++e);while(e>-1&&n!=="'"&&Dk(t,e));return e>-1&&(e+=r.length,r.length>1&&(t[e]===n&&e++,t[e]===n&&e++)),e}d();var Uk=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i,ar=class t extends Date{#n=!1;#t=!1;#e=null;constructor(e){let n=!0,r=!0,s="Z";if(typeof e=="string"){let i=e.match(Uk);i?(i[1]||(n=!1,e=`0000-01-01T${e}`),r=!!i[2],r&&e[10]===" "&&(e=e.replace(" ","T")),i[2]&&+i[2]>23?e="":(s=i[3]||null,e=e.toUpperCase(),!s&&r&&(e+="Z"))):e=""}super(e),isNaN(this.getTime())||(this.#n=n,this.#t=r,this.#e=s)}isDateTime(){return this.#n&&this.#t}isLocal(){return!this.#n||!this.#t||!this.#e}isDate(){return this.#n&&!this.#t}isTime(){return this.#t&&!this.#n}isValid(){return this.#n||this.#t}toISOString(){let e=super.toISOString();if(this.isDate())return e.slice(0,10);if(this.isTime())return e.slice(11,23);if(this.#e===null)return e.slice(0,-1);if(this.#e==="Z")return e;let n=+this.#e.slice(1,3)*60+ +this.#e.slice(4,6);return n=this.#e[0]==="-"?n:-n,new Date(this.getTime()-n*6e4).toISOString().slice(0,-1)+this.#e}static wrapAsOffsetDateTime(e,n="Z"){let r=new t(e);return r.#e=n,r}static wrapAsLocalDateTime(e){let n=new t(e);return n.#e=null,n}static wrapAsLocalDate(e){let n=new t(e);return n.#t=!1,n.#e=null,n}static wrapAsLocalTime(e){let n=new t(e);return n.#n=!1,n.#e=null,n}};var Vk=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,Kk=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,Gk=/^[+-]?0[0-9_]/,Wk=/^[0-9a-f]{2,8}$/i,Jd={b:"\b",t:" ",n:`
199
+ `,f:"\f",r:"\r",e:"\x1B",'"':'"',"\\":"\\"};function Ps(t,e=0,n=t.length){let r=t[e]==="'",s=t[e++]===t[e]&&t[e]===t[e+1];s&&(n-=2,t[e+=2]==="\r"&&e++,t[e]===`
200
+ `&&e++);let i=0,o,a="",c=e;for(;e<n-1;){let l=t[e++];if(l===`
201
+ `||l==="\r"&&t[e]===`
202
+ `){if(!s)throw new W("newlines are not allowed in strings",{toml:t,ptr:e-1})}else if(l<" "&&l!==" "||l==="\x7F")throw new W("control characters are not allowed in strings",{toml:t,ptr:e-1});if(o){if(o=!1,l==="x"||l==="u"||l==="U"){let u=t.slice(e,e+=l==="x"?2:l==="u"?4:8);if(!Wk.test(u))throw new W("invalid unicode escape",{toml:t,ptr:i});try{a+=String.fromCodePoint(parseInt(u,16))}catch{throw new W("invalid unicode escape",{toml:t,ptr:i})}}else if(s&&(l===`
203
+ `||l===" "||l===" "||l==="\r")){if(e=Ne(t,e-1,!0),t[e]!==`
204
+ `&&t[e]!=="\r")throw new W("invalid escape: only line-ending whitespace may be escaped",{toml:t,ptr:i});e=Ne(t,e)}else if(l in Jd)a+=Jd[l];else throw new W("unrecognized escape sequence",{toml:t,ptr:i});c=e}else!r&&l==="\\"&&(i=e-1,o=!0,a+=t.slice(c,i))}return a+t.slice(c,n-1)}function Yd(t,e,n,r){if(t==="true")return!0;if(t==="false")return!1;if(t==="-inf")return-1/0;if(t==="inf"||t==="+inf")return 1/0;if(t==="nan"||t==="+nan"||t==="-nan")return NaN;if(t==="-0")return r?0n:0;let s=Vk.test(t);if(s||Kk.test(t)){if(Gk.test(t))throw new W("leading zeroes are not allowed",{toml:e,ptr:n});t=t.replace(/_/g,"");let o=+t;if(isNaN(o))throw new W("invalid number",{toml:e,ptr:n});if(s){if((s=!Number.isSafeInteger(o))&&!r)throw new W("integer value cannot be represented losslessly",{toml:e,ptr:n});(s||r===!0)&&(o=BigInt(t))}return o}let i=new ar(t);if(!i.isValid())throw new W("invalid value",{toml:e,ptr:n});return i}d();function Jk(t,e,n){let r=t.slice(e,n),s=r.indexOf("#");return s>-1&&(In(t,s),r=r.slice(0,s)),[r.trimEnd(),s]}function cr(t,e,n,r,s){if(r===0)throw new W("document contains excessively nested structures. aborting.",{toml:t,ptr:e});let i=t[e];if(i==="["||i==="{"){let[c,l]=i==="["?Hd(t,e,r,s):zd(t,e,r,s);if(n){if(l=Ne(t,l),t[l]===",")l++;else if(t[l]!==n)throw new W("expected comma or end of structure",{toml:t,ptr:l})}return[c,l]}let o;if(i==='"'||i==="'"){o=Is(t,e);let c=Ps(t,e,o);if(n){if(o=Ne(t,o),t[o]&&t[o]!==","&&t[o]!==n&&t[o]!==`
205
+ `&&t[o]!=="\r")throw new W("unexpected character encountered",{toml:t,ptr:o});o+=+(t[o]===",")}return[c,o]}o=Wd(t,e,",",n);let a=Jk(t,e,o-+(t[o-1]===","));if(!a[0])throw new W("incomplete key-value declaration: no value specified",{toml:t,ptr:e});return n&&a[1]>-1&&(o=Ne(t,e+a[1]),o+=+(t[o]===",")),[Yd(a[0],t,e,s),o]}var Yk=/^[a-zA-Z0-9-_]+[ \t]*$/;function Ls(t,e,n="="){let r=e-1,s=[],i=t.indexOf(n,e);if(i<0)throw new W("incomplete key-value: cannot find end of key",{toml:t,ptr:e});do{let o=t[e=++r];if(o!==" "&&o!==" ")if(o==='"'||o==="'"){if(o===t[e+1]&&o===t[e+2])throw new W("multiline strings are not allowed in keys",{toml:t,ptr:e});let a=Is(t,e);if(a<0)throw new W("unfinished string encountered",{toml:t,ptr:e});r=t.indexOf(".",a);let c=t.slice(a,r<0||r>i?i:r),l=Cs(c);if(l>-1)throw new W("newlines are not allowed in keys",{toml:t,ptr:e+r+l});if(c.trimStart())throw new W("found extra tokens after the string part",{toml:t,ptr:a});if(i<a&&(i=t.indexOf(n,a),i<0))throw new W("incomplete key-value: cannot find end of key",{toml:t,ptr:e});s.push(Ps(t,e,a))}else{r=t.indexOf(".",e);let a=t.slice(e,r<0||r>i?i:r);if(!Yk.test(a))throw new W("only letter, numbers, dashes and underscores are allowed in keys",{toml:t,ptr:e});s.push(a.trimEnd())}}while(r+1&&r<i);return[s,Ne(t,i+1,!0,!0)]}function zd(t,e,n,r){let s={},i=new Set,o;for(e++;(o=t[e++])!=="}"&&o;){if(o===",")throw new W("expected value, found comma",{toml:t,ptr:e-1});if(o==="#")e=In(t,e);else if(o!==" "&&o!==" "&&o!==`
206
+ `&&o!=="\r"){let a,c=s,l=!1,[u,f]=Ls(t,e-1);for(let p=0;p<u.length;p++){if(p&&(c=l?c[a]:c[a]={}),a=u[p],(l=Object.hasOwn(c,a))&&(typeof c[a]!="object"||i.has(c[a])))throw new W("trying to redefine an already defined value",{toml:t,ptr:e});!l&&a==="__proto__"&&Object.defineProperty(c,a,{enumerable:!0,configurable:!0,writable:!0})}if(l)throw new W("trying to redefine an already defined value",{toml:t,ptr:e});let[h,g]=cr(t,f,"}",n-1,r);i.add(h),c[a]=h,e=g}}if(!o)throw new W("unfinished table encountered",{toml:t,ptr:e});return[s,e]}function Hd(t,e,n,r){let s=[],i;for(e++;(i=t[e++])!=="]"&&i;){if(i===",")throw new W("expected value, found comma",{toml:t,ptr:e-1});if(i==="#")e=In(t,e);else if(i!==" "&&i!==" "&&i!==`
207
+ `&&i!=="\r"){let o=cr(t,e-1,"]",n-1,r);s.push(o[0]),e=o[1]}}if(!i)throw new W("unfinished array encountered",{toml:t,ptr:e});return[s,e]}function Zd(t,e,n,r){let s=e,i=n,o,a=!1,c;for(let l=0;l<t.length;l++){if(l){if(s=a?s[o]:s[o]={},i=(c=i[o]).c,r===0&&(c.t===1||c.t===2))return null;if(c.t===2){let u=s.length-1;s=s[u],i=i[u].c}}if(o=t[l],(a=Object.hasOwn(s,o))&&i[o]?.t===0&&i[o]?.d)return null;a||(o==="__proto__"&&(Object.defineProperty(s,o,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(i,o,{enumerable:!0,configurable:!0,writable:!0})),i[o]={t:l<t.length-1&&r===2?3:r,d:!1,i:0,c:{}})}if(c=i[o],c.t!==r&&!(r===1&&c.t===3)||(r===2&&(c.d||(c.d=!0,s[o]=[]),s[o].push(s={}),c.c[c.i++]=c={t:1,d:!1,i:0,c:{}}),c.d))return null;if(c.d=!0,r===1)s=a?s[o]:s[o]={};else if(r===0&&a)return null;return[o,s,c.c]}function Ue(t,{maxDepth:e=1e3,integersAsBigInt:n}={}){let r={},s={},i=r,o=s;for(let a=Ne(t,0);a<t.length;){if(t[a]==="["){let c=t[++a]==="[",l=Ls(t,a+=+c,"]");if(c){if(t[l[1]-1]!=="]")throw new W("expected end of table declaration",{toml:t,ptr:l[1]-1});l[1]++}let u=Zd(l[0],r,s,c?2:1);if(!u)throw new W("trying to redefine an already defined table or value",{toml:t,ptr:a});o=u[2],i=u[1],a=l[1]}else{let c=Ls(t,a),l=Zd(c[0],i,o,0);if(!l)throw new W("trying to redefine an already defined table or value",{toml:t,ptr:a});let u=cr(t,c[1],void 0,e,n);l[1][l[0]]=u[0],a=u[1]}if(a=Ne(t,a,!0),t[a]&&t[a]!==`
208
+ `&&t[a]!=="\r")throw new W("each key-value declaration must be followed by an end-of-line",{toml:t,ptr:a});a=Ne(t,a)}return r}d();var zk=[["dependencies","dep"],["dev-dependencies","dev"],["build-dependencies","build"]];function eh(t,e,n,r,s,i){if(t)for(let[o,a]of Object.entries(t)){let c=typeof a=="string"?a:a.version;r.push({name:o,ecosystem:"cargo",version_constraint:c,resolved_version:n.get(o),section:e,manifest_file:s,workspace_path:i})}}var th=async({workspace_dir:t,workspace_rel:e})=>{let n=[],r=[],s=Qd(t,"Cargo.toml");if(!await P(s))return{ecosystem:"cargo",tools:r,warnings:n};let i;try{i=Ue(await Xd(s,"utf-8"))}catch(l){return n.push({scope:"parser:cargo",path:s,message:`Failed to parse Cargo.toml: ${l instanceof Error?l.message:String(l)}`}),{ecosystem:"cargo",tools:r,warnings:n}}let o=new Map,a=Qd(t,"Cargo.lock");if(await P(a))try{let l=Ue(await Xd(a,"utf-8"));for(let u of l.package??[])u.name&&u.version&&o.set(u.name,u.version)}catch(l){n.push({scope:"parser:cargo",path:a,message:`Failed to parse Cargo.lock: ${l instanceof Error?l.message:String(l)}`})}let c=e?`${e}/Cargo.toml`:"Cargo.toml";for(let[l,u]of zk)eh(i[l],u,o,r,c,e);return eh(i.workspace?.dependencies,"dep",o,r,c,e),{ecosystem:"cargo",tools:r,warnings:n}};d();import{readFile as nh}from"fs/promises";import{join as rh}from"path";function sh(t){return t==="php"||t.startsWith("ext-")||t.startsWith("lib-")}var ih=async({workspace_dir:t,workspace_rel:e})=>{let n=[],r=[],s=rh(t,"composer.lock"),i=rh(t,"composer.json");if(await P(s))try{let o=JSON.parse(await nh(s,"utf-8")),a=e?`${e}/composer.lock`:"composer.lock";for(let[c,l]of[[o.packages??[],"dep"],[o["packages-dev"]??[],"dev"]])for(let u of c)!u.name||sh(u.name)||r.push({name:u.name,ecosystem:"composer",version_constraint:void 0,resolved_version:u.version,section:l,manifest_file:a,workspace_path:e});if(r.length>0)return{ecosystem:"composer",tools:r,warnings:n}}catch(o){n.push({scope:"parser:composer",path:s,message:`Failed to parse composer.lock: ${o instanceof Error?o.message:String(o)}`})}if(await P(i))try{let o=JSON.parse(await nh(i,"utf-8")),a=e?`${e}/composer.json`:"composer.json";for(let[c,l]of[[o.require,"dep"],[o["require-dev"],"dev"]])for(let[u,f]of Object.entries(c??{}))sh(u)||r.push({name:u,ecosystem:"composer",version_constraint:f,section:l,manifest_file:a,workspace_path:e})}catch(o){n.push({scope:"parser:composer",path:i,message:`Failed to parse composer.json: ${o instanceof Error?o.message:String(o)}`})}return{ecosystem:"composer",tools:r,warnings:n}};d();var cl=H(Br(),1);import{readFile as Jm}from"fs/promises";import{join as Ym}from"path";function E1(t){if(typeof t=="object"&&t!==null){let e=t;if(e.sdk||e.path)return!0}return!1}function zm(t,e,n,r,s,i){if(t)for(let[o,a]of Object.entries(t)){if(E1(a))continue;let c=typeof a=="string"?a:a.version;r.push({name:o,ecosystem:"pub",version_constraint:c,resolved_version:n.get(o),section:e,manifest_file:s,workspace_path:i})}}var Hm=async({workspace_dir:t,workspace_rel:e})=>{let n=[],r=[],s=Ym(t,"pubspec.yaml");if(!await P(s))return{ecosystem:"pub",tools:r,warnings:n};let i;try{i=(0,cl.parse)(await Jm(s,"utf-8"))}catch(l){return n.push({scope:"parser:dart",path:s,message:`Failed to parse pubspec.yaml: ${l instanceof Error?l.message:String(l)}`}),{ecosystem:"pub",tools:r,warnings:n}}let o=new Map,a=Ym(t,"pubspec.lock");if(await P(a))try{let l=(0,cl.parse)(await Jm(a,"utf-8"));for(let[u,f]of Object.entries(l.packages??{}))f.version&&o.set(u,f.version)}catch(l){n.push({scope:"parser:dart",path:a,message:`Failed to parse pubspec.lock: ${l instanceof Error?l.message:String(l)}`})}let c=e?`${e}/pubspec.yaml`:"pubspec.yaml";return zm(i.dependencies,"dep",o,r,c,e),zm(i.dev_dependencies,"dev",o,r,c,e),{ecosystem:"pub",tools:r,warnings:n}};d();var $g=H(Kr(),1);import{readFile as Pg,readdir as IA}from"fs/promises";import{join as Lg,relative as Rg}from"path";function jg(t){return t===void 0?[]:Array.isArray(t)?t:[t]}var Mg=async({workspace_dir:t,workspace_rel:e})=>{let n=[],r=[],s=[];try{s=await IA(t)}catch{return{ecosystem:"nuget",tools:r,warnings:n}}let i=s.filter(c=>c.endsWith(".csproj")||c.endsWith(".fsproj")),o=new $g.XMLParser({ignoreAttributes:!1});for(let c of i){let l=Lg(t,c);try{let u=await Pg(l,"utf-8"),f=o.parse(u),h=Array.isArray(f.Project?.ItemGroup)?f.Project?.ItemGroup??[]:f.Project?.ItemGroup?[f.Project.ItemGroup]:[],g=e?`${e}/${Rg(t,l)}`:Rg(t,l);for(let p of h)for(let m of jg(p.PackageReference)){let y=m["@_Include"];if(!y)continue;let b=m["@_Version"];r.push({name:y,ecosystem:"nuget",version_constraint:b,resolved_version:b,section:m["@_PrivateAssets"]?"build":"dep",manifest_file:g,workspace_path:e})}}catch(u){n.push({scope:"parser:dotnet",path:l,message:`Failed to parse ${c}: ${u instanceof Error?u.message:String(u)}`})}}let a=Lg(t,"packages.config");if(await P(a))try{let c=await Pg(a,"utf-8"),l=o.parse(c),u=e?`${e}/packages.config`:"packages.config";for(let f of jg(l.packages?.package)){let h=f["@_Include"];h&&r.push({name:h,ecosystem:"nuget",version_constraint:f["@_Version"],resolved_version:f["@_Version"],section:"dep",manifest_file:u,workspace_path:e})}}catch(c){n.push({scope:"parser:dotnet",path:a,message:`Failed to parse packages.config: ${c instanceof Error?c.message:String(c)}`})}return{ecosystem:"nuget",tools:r,warnings:n}};d();import{readFile as PA}from"fs/promises";import{join as LA}from"path";function RA(t){let e=[],n=t.split(`
209
+ `),r=!1;for(let s of n){let i=s.replace(/\/\/.*$/,"").trim(),o=s.match(/\/\/\s*(.*)$/)?.[1]??"",a=/\bindirect\b/.test(o);if(i){if(i==="require ("){r=!0;continue}if(i===")"){r=!1;continue}if(i.startsWith("require ")){let c=i.slice(8).trim().split(/\s+/);c[0]&&c[1]&&e.push({name:c[0],version:c[1],indirect:a});continue}if(r){let c=i.split(/\s+/);c[0]&&c[1]&&e.push({name:c[0],version:c[1],indirect:a})}}}return e}var qg=async({workspace_dir:t,workspace_rel:e})=>{let n=[],r=[],s=LA(t,"go.mod");if(!await P(s))return{ecosystem:"go",tools:r,warnings:n};try{let i=await PA(s,"utf-8"),o=e?`${e}/go.mod`:"go.mod";for(let a of RA(i))r.push({name:a.name,ecosystem:"go",version_constraint:a.version,resolved_version:a.version,section:a.indirect?"optional":"dep",manifest_file:o,workspace_path:e})}catch(i){n.push({scope:"parser:go",path:s,message:`Failed to parse go.mod: ${i instanceof Error?i.message:String(i)}`})}return{ecosystem:"go",tools:r,warnings:n}};d();import{readFile as Fg}from"fs/promises";import{join as Bg}from"path";function jA(t){let e=[];for(let n of t.split(`
210
+ `)){let r=n.trim();if(!r||r.startsWith("#"))continue;let s=r.match(/^([^:]+):([^:]+):([^=]+)=(.*)$/);s?.[1]&&s[2]&&s[3]&&e.push({group:s[1],name:s[2],version:s[3],configurations:(s[4]??"").split(",").map(i=>i.trim())})}return e}function $A(t){let e=t.join(" ").toLowerCase();return e.includes("test")?"dev":e.includes("annotationprocessor")||e.includes("kapt")?"build":"dep"}function MA(t){let e=[],n=[/(implementation|api|compileOnly|runtimeOnly|testImplementation|testRuntimeOnly|annotationProcessor|kapt|ksp)\s*\(?\s*(['"])([A-Za-z0-9_.\-]+:[A-Za-z0-9_.\-]+:[^'"]+)\2/g];for(let r of n){let s;for(;(s=r.exec(t))!==null;)s[1]&&s[3]&&e.push({spec:s[3],config:s[1]})}return e}function qA(t){let e=t.toLowerCase();return e.startsWith("test")?"dev":e.includes("annotationprocessor")||e==="kapt"||e==="ksp"?"build":"dep"}var Dg=async({workspace_dir:t,workspace_rel:e})=>{let n=[],r=[],s=Bg(t,"gradle.lockfile");if(await P(s))try{let i=await Fg(s,"utf-8"),o=e?`${e}/gradle.lockfile`:"gradle.lockfile";for(let a of jA(i))r.push({name:`${a.group}:${a.name}`,ecosystem:"gradle",version_constraint:a.version,resolved_version:a.version,section:$A(a.configurations),manifest_file:o,workspace_path:e});if(r.length>0)return{ecosystem:"gradle",tools:r,warnings:n}}catch(i){n.push({scope:"parser:gradle",path:s,message:`Failed to parse gradle.lockfile: ${i instanceof Error?i.message:String(i)}`})}for(let i of["build.gradle.kts","build.gradle"]){let o=Bg(t,i);if(await P(o))try{let a=await Fg(o,"utf-8"),c=e?`${e}/${i}`:i,l=!1;for(let u of MA(a)){let f=u.spec.split(":");if(f.length<3||!f[0]||!f[1])continue;let h=f.slice(2).join(":");if(h.startsWith("$")||h.includes("${")){l=!0;continue}r.push({name:`${f[0]}:${f[1]}`,ecosystem:"gradle",version_constraint:h,section:qA(u.config),manifest_file:c,workspace_path:e})}n.push({scope:"parser:gradle",path:c,message:"Shallow parse of build.gradle \u2014 results may be incomplete. Add `dependencyLocking` to the project for deterministic discovery."}),l&&n.push({scope:"parser:gradle",path:c,message:"Some deps use variable interpolation ($ver / ${var}) \u2014 skipped."});break}catch(a){n.push({scope:"parser:gradle",path:o,message:`Failed to read ${i}: ${a instanceof Error?a.message:String(a)}`})}}return{ecosystem:"gradle",tools:r,warnings:n}};d();var Vg=H(Kr(),1);import{readFile as FA}from"fs/promises";import{join as BA}from"path";function DA(t,e){if(e)return"optional";switch(t){case"test":case"provided":return"dev";default:return"dep"}}function Ug(t){return t===void 0?[]:Array.isArray(t)?t:[t]}var Kg=async({workspace_dir:t,workspace_rel:e})=>{let n=[],r=[],s=BA(t,"pom.xml");if(!await P(s))return{ecosystem:"maven",tools:r,warnings:n};let i;try{let u=await FA(s,"utf-8");i=new Vg.XMLParser({ignoreAttributes:!0,parseTagValue:!0}).parse(u)}catch(u){return n.push({scope:"parser:maven",path:s,message:`Failed to parse pom.xml: ${u instanceof Error?u.message:String(u)}`}),{ecosystem:"maven",tools:r,warnings:n}}let o=e?`${e}/pom.xml`:"pom.xml",a=Ug(i.project?.dependencies?.dependency),c=Ug(i.project?.dependencyManagement?.dependencies?.dependency),l=!1;for(let u of[...a,...c]){if(!u.groupId||!u.artifactId)continue;let f=`${u.groupId}:${u.artifactId}`,h=typeof u.version=="string"?u.version:void 0;h&&h.includes("${")&&(l=!0);let g=u.optional===!0||u.optional==="true";r.push({name:f,ecosystem:"maven",version_constraint:h,resolved_version:h&&!h.includes("${")?h:void 0,section:DA(u.scope,g),manifest_file:o,workspace_path:e})}return l&&n.push({scope:"parser:maven",path:s,message:"Some dependencies use ${...} variable interpolation which is not resolved \u2014 version info may be incomplete."}),{ecosystem:"maven",tools:r,warnings:n}};d();import{readFile as Gg}from"fs/promises";import{join as Wg}from"path";function UA(t){let e=[],n=/"([^"]+)":\s*\{\s*:hex\s*,\s*:[A-Za-z_][A-Za-z0-9_]*\s*,\s*"([^"]+)"/g,r;for(;(r=n.exec(t))!==null;)r[1]&&r[2]&&e.push({name:r[1],version:r[2]});return e}function VA(t){let e=[],n=/\{:([a-z_][a-z0-9_]*)\s*,\s*"([^"]+)"(?:[^}]*only:\s*(?:\[?:?([a-z_]+))?[^}]*)?\}/g,r;for(;(r=n.exec(t))!==null;)if(r[1]){let s=r[3];e.push({name:r[1],constraint:r[2],dev:s==="dev"||s==="test"})}return e}var Jg=async({workspace_dir:t,workspace_rel:e})=>{let n=[],r=[],s=Wg(t,"mix.lock");if(await P(s))try{let o=await Gg(s,"utf-8"),a=e?`${e}/mix.lock`:"mix.lock";for(let c of UA(o))r.push({name:c.name,ecosystem:"hex",version_constraint:void 0,resolved_version:c.version,section:"dep",manifest_file:a,workspace_path:e});if(r.length>0)return{ecosystem:"hex",tools:r,warnings:n}}catch(o){n.push({scope:"parser:mix",path:s,message:`Failed to parse mix.lock: ${o instanceof Error?o.message:String(o)}`})}let i=Wg(t,"mix.exs");if(await P(i))try{let o=await Gg(i,"utf-8"),a=e?`${e}/mix.exs`:"mix.exs";for(let c of VA(o))r.push({name:c.name,ecosystem:"hex",version_constraint:c.constraint,section:c.dev?"dev":"dep",manifest_file:a,workspace_path:e})}catch(o){n.push({scope:"parser:mix",path:i,message:`Failed to parse mix.exs: ${o instanceof Error?o.message:String(o)}`})}return{ecosystem:"hex",tools:r,warnings:n}};d();var Yg=H(Br(),1);import{readFile as bl}from"fs/promises";import{join as Ii}from"path";var KA=[["dependencies","dep"],["devDependencies","dev"],["peerDependencies","peer"],["optionalDependencies","optional"]];function GA(t){let e=t.lastIndexOf("@");if(e<=0)return;let n=t.slice(e+1),r=n.indexOf("(");return r>=0?n.slice(0,r):n||void 0}function WA(t,e,n,r){let i=t.importers?.[e]?.[n]?.[r];if(i){if(typeof i=="string")return i;if(i.version){let o=i.version.indexOf("(");return o>=0?i.version.slice(0,o):i.version}}}function JA(t,e){let n=`node_modules/${e}`;return t.packages?.[n]?.version??t.dependencies?.[e]?.version}var zg=async({workspace_dir:t,workspace_rel:e})=>{let n=[],r=[],s=Ii(t,"package.json");if(!await P(s))return{ecosystem:"npm",tools:r,warnings:n};let i;try{i=JSON.parse(await bl(s,"utf-8"))}catch(h){return n.push({scope:"parser:npm",path:s,message:`Failed to parse package.json: ${h instanceof Error?h.message:String(h)}`}),{ecosystem:"npm",tools:r,warnings:n}}let o,a,c=Ii(t,"pnpm-lock.yaml"),l=Ii(t,"package-lock.json");if(await P(c))try{o=(0,Yg.parse)(await bl(c,"utf-8"))}catch(h){n.push({scope:"parser:npm",path:c,message:`Failed to parse pnpm-lock.yaml, falling back to manifest: ${h instanceof Error?h.message:String(h)}`})}else if(await P(l))try{a=JSON.parse(await bl(l,"utf-8"))}catch(h){n.push({scope:"parser:npm",path:l,message:`Failed to parse package-lock.json, falling back to manifest: ${h instanceof Error?h.message:String(h)}`})}else await P(Ii(t,"yarn.lock"))||n.push({scope:"parser:npm",path:s,message:"No lockfile present \u2014 resolved_version will be absent."});let u=e?`${e}/package.json`:"package.json",f=e||".";for(let[h,g]of KA){let p=i[h];if(p)for(let[m,y]of Object.entries(p)){let b;o?b=WA(o,f,h,m):a&&(b=JA(a,m)),r.push({name:m,ecosystem:"npm",version_constraint:y,resolved_version:b,section:g,manifest_file:u,workspace_path:e})}}return{ecosystem:"npm",tools:r,warnings:n}};d();import{readFile as vl}from"fs/promises";import{join as Sl}from"path";function Pi(t){let e=t.trim();if(!e||e.startsWith("#"))return null;let n=e.match(/^([A-Za-z0-9_.\-]+)(\[[^\]]*\])?(.*)$/);if(!n||!n[1])return null;let r=(n[3]??"").trim();return{name:n[1],constraint:r||void 0}}function El(t,e,n,r,s,i){if(t)for(let[o,a]of Object.entries(t)){if(o==="python")continue;let c=typeof a=="string"?a:a.version;n.push({name:o,ecosystem:"pypi",version_constraint:c,resolved_version:i.get(o.toLowerCase()),section:e,manifest_file:r,workspace_path:s})}}var Hg=async({workspace_dir:t,workspace_rel:e})=>{let n=[],r=[],s=new Map,i=Sl(t,"uv.lock");if(await P(i))try{let a=Ue(await vl(i,"utf-8"));for(let c of a.package??[])c.name&&c.version&&s.set(c.name.toLowerCase(),c.version)}catch(a){n.push({scope:"parser:pypi",path:i,message:`Failed to parse uv.lock: ${a instanceof Error?a.message:String(a)}`})}let o=Sl(t,"pyproject.toml");if(await P(o))try{let a=Ue(await vl(o,"utf-8")),c=e?`${e}/pyproject.toml`:"pyproject.toml";for(let l of a.project?.dependencies??[]){let u=Pi(l);u&&r.push({name:u.name,ecosystem:"pypi",version_constraint:u.constraint,resolved_version:s.get(u.name.toLowerCase()),section:"dep",manifest_file:c,workspace_path:e})}for(let[l,u]of Object.entries(a.project?.["optional-dependencies"]??{}))for(let f of u){let h=Pi(f);h&&r.push({name:h.name,ecosystem:"pypi",version_constraint:h.constraint,resolved_version:s.get(h.name.toLowerCase()),section:l==="dev"?"dev":"optional",manifest_file:c,workspace_path:e})}for(let[l,u]of Object.entries(a["dependency-groups"]??{}))for(let f of u){let h=Pi(f);h&&r.push({name:h.name,ecosystem:"pypi",version_constraint:h.constraint,resolved_version:s.get(h.name.toLowerCase()),section:l==="dev"?"dev":"optional",manifest_file:c,workspace_path:e})}El(a.tool?.poetry?.dependencies,"dep",r,c,e,s),El(a.tool?.poetry?.["dev-dependencies"],"dev",r,c,e,s);for(let l of Object.values(a.tool?.poetry?.group??{}))El(l.dependencies,"dev",r,c,e,s);if(r.length>0)return{ecosystem:"pypi",tools:r,warnings:n}}catch(a){n.push({scope:"parser:pypi",path:o,message:`Failed to parse pyproject.toml: ${a instanceof Error?a.message:String(a)}`})}for(let[a,c]of[["requirements.txt","dep"],["requirements-dev.txt","dev"],["dev-requirements.txt","dev"]]){let l=Sl(t,a);if(await P(l))try{let u=await vl(l,"utf-8"),f=e?`${e}/${a}`:a;for(let h of u.split(`
211
+ `)){let g=Pi(h);g&&r.push({name:g.name,ecosystem:"pypi",version_constraint:g.constraint,resolved_version:s.get(g.name.toLowerCase()),section:c,manifest_file:f,workspace_path:e})}}catch(u){n.push({scope:"parser:pypi",path:l,message:`Failed to read ${a}: ${u instanceof Error?u.message:String(u)}`})}}return{ecosystem:"pypi",tools:r,warnings:n}};d();import{readFile as kl}from"fs/promises";import{join as Zg}from"path";function YA(t){let e=[],n=t.split(`
212
+ `),r=!1;for(let s of n){if(s.trim()==="specs:"){r=!0;continue}if(r){if(!s.startsWith(" ")){r=!1;continue}let i=s.match(/^ {4}([A-Za-z0-9_\-.]+) \(([^)]+)\)/);i?.[1]&&i[2]&&e.push({name:i[1],version:i[2]})}}return e}function Xg(t){let e=[],n=t.split(`
213
+ `),r=0,s=!1;for(let i of n){let o=i.split("#")[0]?.trim()??"";if(!o)continue;let a=o.match(/^group\s+(:[\w,\s:]+?)\s*do\s*$/);if(a&&a[1]){r++,s=/\b(development|test)\b/.test(a[1]);continue}if(o==="end"&&r>0){r--,r===0&&(s=!1);continue}let c=o.match(/^gem\s+(['"])([A-Za-z0-9_\-.]+)\1(?:\s*,\s*(['"])([^'"]+)\3)?/);c?.[2]&&e.push({name:c[2],constraint:c[4],dev:s})}return e}var Qg=async({workspace_dir:t,workspace_rel:e})=>{let n=[],r=[],s=Zg(t,"Gemfile.lock"),i=Zg(t,"Gemfile");if(await P(s))try{let o=await kl(s,"utf-8"),a=e?`${e}/Gemfile.lock`:"Gemfile.lock",c=new Set;if(await P(i))try{let l=await kl(i,"utf-8");for(let u of Xg(l))c.add(u.name)}catch{}for(let l of YA(o))c.size>0&&!c.has(l.name)||r.push({name:l.name,ecosystem:"rubygems",version_constraint:void 0,resolved_version:l.version,section:"dep",manifest_file:a,workspace_path:e});if(r.length>0)return{ecosystem:"rubygems",tools:r,warnings:n}}catch(o){n.push({scope:"parser:ruby",path:s,message:`Failed to parse Gemfile.lock: ${o instanceof Error?o.message:String(o)}`})}if(await P(i))try{let o=await kl(i,"utf-8"),a=e?`${e}/Gemfile`:"Gemfile";for(let c of Xg(o))r.push({name:c.name,ecosystem:"rubygems",version_constraint:c.constraint,section:c.dev?"dev":"dep",manifest_file:a,workspace_path:e});n.push({scope:"parser:ruby",path:a,message:"No Gemfile.lock \u2014 resolved_version unavailable."})}catch(o){n.push({scope:"parser:ruby",path:i,message:`Failed to parse Gemfile: ${o instanceof Error?o.message:String(o)}`})}return{ecosystem:"rubygems",tools:r,warnings:n}};d();import{readFile as ey}from"fs/promises";import{join as ty}from"path";function zA(t){let e;try{e=JSON.parse(t)}catch{return[]}let n=[];for(let r of e.pins??[])r.identity&&n.push({name:r.identity,version:r.state?.version});for(let r of e.object?.pins??[])r.package&&n.push({name:r.package,version:r.state?.version});return n}function HA(t){let e=[],n=/\.package\(\s*(?:name:\s*"[^"]+"\s*,\s*)?url:\s*"([^"]+)"\s*,\s*([^)]+)\)/g,r;for(;(r=n.exec(t))!==null;){let s=r[1],i=r[2]?.trim();if(!s)continue;let o=s.split("/").pop()?.replace(/\.git$/,"");o&&e.push({name:o,constraint:i})}return e}var ny=async({workspace_dir:t,workspace_rel:e})=>{let n=[],r=[],s=ty(t,"Package.resolved");if(await P(s))try{let o=await ey(s,"utf-8"),a=e?`${e}/Package.resolved`:"Package.resolved";for(let c of zA(o))r.push({name:c.name,ecosystem:"swift-pm",resolved_version:c.version,section:"dep",manifest_file:a,workspace_path:e});if(r.length>0)return{ecosystem:"swift-pm",tools:r,warnings:n}}catch(o){n.push({scope:"parser:swift",path:s,message:`Failed to parse Package.resolved: ${o instanceof Error?o.message:String(o)}`})}let i=ty(t,"Package.swift");if(await P(i))try{let o=await ey(i,"utf-8"),a=e?`${e}/Package.swift`:"Package.swift";for(let c of HA(o))r.push({name:c.name,ecosystem:"swift-pm",version_constraint:c.constraint,section:"dep",manifest_file:a,workspace_path:e});n.push({scope:"parser:swift",path:a,message:"No Package.resolved \u2014 resolved_version unavailable."})}catch(o){n.push({scope:"parser:swift",path:i,message:`Failed to parse Package.swift: ${o instanceof Error?o.message:String(o)}`})}return{ecosystem:"swift-pm",tools:r,warnings:n}};var ry={npm:zg,pypi:Hg,cargo:th,go:qg,rubygems:Qg,maven:Kg,gradle:Dg,composer:ih,hex:Jg,pub:Hm,nuget:Mg,"swift-pm":ny};d();d();var iy=H(oe(),1);import{readFile as ZA,readdir as sy}from"fs/promises";import{homedir as XA}from"os";import{join as xl}from"path";d();function ie(t){if(!t)return;let e=t.trim();if(!e||(e.startsWith("git+")&&(e=e.slice(4)),e.startsWith("github:")&&(e=`https://github.com/${e.slice(7)}`),/^[A-Za-z0-9_.\-]+\/[A-Za-z0-9_.\-]+$/.test(e)&&(e=`https://github.com/${e}`),e=e.replace(/^git@github\.com:/,"https://github.com/"),e=e.replace(/^ssh:\/\/git@github\.com\//,"https://github.com/"),e=e.replace(/^http:\/\//,"https://"),!/^https:\/\/github\.com\//.test(e)))return;e=e.replace(/\.git$/,""),e=e.replace(/\/$/,"");let n=e.match(/^https:\/\/github\.com\/([^/]+)\/([^/]+)/);if(n)return`https://github.com/${n[1]}/${n[2]}`}var QA=(0,iy.createMcpLogger)({name:"@toolcairn/tools:resolver:cargo"});async function eC(t,e){let n=xl(XA(),".cargo","registry","src");if(!await fe(n))return null;let r;try{r=await sy(n)}catch{return null}let s=[];for(let i of r){let o=xl(n,i);if(!await fe(o))continue;let a;try{a=await sy(o)}catch{continue}for(let c of a){if(!c.startsWith(`${t}-`)||e&&c!==`${t}-${e}`)continue;let l=xl(o,c,"Cargo.toml");await P(l)&&s.push(l)}}return s.length===0?null:(s.sort(),s[s.length-1]??null)}async function oy(t,e,n,r={}){let s=await eC(n,r.resolved_version);if(!s)return{};try{let i=await ZA(s,"utf-8"),a=Ue(i).package;if(!a)return{};let c={};a.name&&a.name!==n&&(c.canonical_package_name=a.name),a.version&&(c.resolved_version=a.version);let l=ie(a.repository??a.homepage);return l&&(c.github_url=l),c}catch(i){return QA.debug({err:i instanceof Error?i.message:String(i),manifestPath:s},"Failed to parse cached Cargo.toml"),{}}}d();var ay=H(oe(),1);import{readFile as tC}from"fs/promises";import{join as nC}from"path";var rC=(0,ay.createMcpLogger)({name:"@toolcairn/tools:resolver:composer"});async function cy(t,e,n){let r=nC(t,"vendor",n,"composer.json");if(!await P(r))return{};try{let s=JSON.parse(await tC(r,"utf-8")),i={};s.name&&s.name!==n&&(i.canonical_package_name=s.name),s.version&&(i.resolved_version=s.version);let o=s.source?.url??s.support?.source??s.homepage,a=ie(o);return a&&(i.github_url=a),i}catch(s){return rC.debug({err:s instanceof Error?s.message:String(s),path:r},"Failed to parse installed composer.json"),{}}}d();function ly(t,e,n){if(!n.startsWith("github.com/"))return{};let s=n.slice(11).split("/");if(s.length<2||!s[0]||!s[1])return{};let i=s[0],o=s[1];o=o.replace(/\.git$/,"");let a=ie(`https://github.com/${i}/${o}`);return a?{github_url:a}:{}}d();import{readdir as dy}from"fs/promises";import{homedir as oC}from"os";import{join as Tl}from"path";d();var uy=H(oe(),1),fy=H(Kr(),1);import{readFile as sC}from"fs/promises";var iC=(0,uy.createMcpLogger)({name:"@toolcairn/tools:resolver:pom"});async function Li(t,e){if(!await P(t))return{};try{let n=await sC(t,"utf-8"),i=new fy.XMLParser({ignoreAttributes:!0,parseTagValue:!0}).parse(n).project;if(!i)return{};let o={},a=i.groupId&&i.artifactId?`${i.groupId}:${i.artifactId}`:void 0;a&&a!==e&&(o.canonical_package_name=a),i.version&&(o.resolved_version=i.version);let c=[i.scm?.url,i.scm?.connection,i.scm?.developerConnection,i.url];for(let l of c){let u=ie(l);if(u){o.github_url=u;break}}return o}catch(n){return iC.debug({err:n instanceof Error?n.message:String(n),path:t},"Failed to parse .pom"),{}}}async function aC(t,e,n){let r=Tl(oC(),".gradle","caches","modules-2","files-2.1",t,e);if(!await fe(r))return null;let s;try{s=await dy(r)}catch{return null}let i=n&&s.includes(n)?n:s.sort().at(-1);if(!i)return null;let o=Tl(r,i),a;try{a=await dy(o)}catch{return null}for(let c of a)return Tl(o,c,`${e}-${i}.pom`);return null}async function hy(t,e,n,r={}){let s=n.indexOf(":");if(s<0)return{};let i=n.slice(0,s),o=n.slice(s+1);if(!i||!o)return{};let a=await aC(i,o,r.resolved_version);return a?Li(a,n):{}}d();var my=H(oe(),1);import{readFile as py}from"fs/promises";import{join as Ol}from"path";var cC=(0,my.createMcpLogger)({name:"@toolcairn/tools:resolver:hex"});function lC(t){let e=t.match(/<<"GitHub">>\s*,\s*<<"([^"]+)">>/i);if(e?.[1]||(e=t.match(/<<"[^"]*github[^"]*">>\s*,\s*<<"(https?:\/\/[^"]+)">>/i),e?.[1]))return e[1]}function uC(t){let e=t.match(/@source_url\s*\(?\s*["']([^"']+)["']/);if(e?.[1])return e[1];let n=t.match(/\bsource_url\s*:\s*["']([^"']+)["']/);if(n?.[1])return n[1]}async function gy(t,e,n){let r=Ol(t,"deps",n),s={},i=Ol(r,"hex_metadata.config");if(await P(i))try{let o=await py(i,"utf-8"),a=lC(o),c=ie(a);c&&(s.github_url=c)}catch(o){cC.debug({err:o instanceof Error?o.message:String(o),metaPath:i},"Failed to read hex_metadata.config")}if(!s.github_url){let o=Ol(r,"mix.exs");if(await P(o))try{let a=await py(o,"utf-8"),c=uC(a),l=ie(c);l&&(s.github_url=l)}catch{}}return s}d();import{readdir as fC}from"fs/promises";import{homedir as dC}from"os";import{join as yy}from"path";async function hC(t,e,n){let r=t.replace(/\./g,"/"),s=yy(dC(),".m2","repository",r,e);if(!await fe(s))return null;let i;try{i=await fC(s)}catch{return null}let o;return n&&i.includes(n)?o=n:(i.sort(),o=i[i.length-1]),o?yy(s,o,`${e}-${o}.pom`):null}async function _y(t,e,n,r={}){let s=n.indexOf(":");if(s<0)return{};let i=n.slice(0,s),o=n.slice(s+1);if(!i||!o)return{};let a=await hC(i,o,r.resolved_version);return a?Li(a,n):{}}d();var by=H(oe(),1);import{readFile as pC}from"fs/promises";import{join as wy}from"path";var mC=(0,by.createMcpLogger)({name:"@toolcairn/tools:resolver:npm"});function gC(t){let e=t.repository;if(e)return typeof e=="string"?e:e.url}async function yC(t,e,n){let r=t,s=e;for(let i=0;i<10;i++){let o=wy(r,"node_modules",n,"package.json");if(await P(o))return o;if(r===s)break;let a=wy(r,"..");if(a===r)break;r=a}return null}async function vy(t,e,n){let r=await yC(t,e,n);if(!r)return{};let s;try{s=JSON.parse(await pC(r,"utf-8"))}catch(c){return mC.debug({err:c instanceof Error?c.message:String(c),manifestPath:r},"Failed to parse installed package.json \u2014 skipping url resolution"),{}}let i={};s.name&&s.name!==n&&(i.canonical_package_name=s.name),s.version&&(i.resolved_version=s.version);let o=gC(s),a=ie(o);return a&&(i.github_url=a),i}d();var Ey=H(oe(),1),ky=H(Kr(),1);import{readFile as _C,readdir as wC}from"fs/promises";import{homedir as bC}from"os";import{join as Sy}from"path";var vC=(0,Ey.createMcpLogger)({name:"@toolcairn/tools:resolver:nuget"});async function SC(t,e){let n=Sy(bC(),".nuget","packages",t.toLowerCase());if(!await fe(n))return null;let r;try{r=await wC(n)}catch{return null}let s=e&&r.includes(e)?e:r.sort().at(-1);if(!s)return null;let i=Sy(n,s,`${t.toLowerCase()}.nuspec`);return await P(i)?i:null}async function xy(t,e,n,r={}){let s=await SC(n,r.resolved_version);if(!s)return{};try{let i=await _C(s,"utf-8"),c=new ky.XMLParser({ignoreAttributes:!1}).parse(i).package?.metadata;if(!c)return{};let l={};c.id&&c.id!==n&&(l.canonical_package_name=c.id),c.version&&(l.resolved_version=c.version);let u=c.repository?.["@_url"]??c.repository?.url,f=ie(u??c.projectUrl);return f&&(l.github_url=f),l}catch(i){return vC.debug({err:i instanceof Error?i.message:String(i),path:s},"Failed to parse .nuspec"),{}}}d();var Ty=H(oe(),1),Oy=H(Br(),1);import{readFile as EC}from"fs/promises";import{homedir as kC,platform as xC}from"os";import{join as Ri}from"path";var TC=(0,Ty.createMcpLogger)({name:"@toolcairn/tools:resolver:pub"});function OC(){if(xC()==="win32"){let t=process.env.LOCALAPPDATA;if(t)return Ri(t,"Pub","Cache","hosted","pub.dev")}return Ri(kC(),".pub-cache","hosted","pub.dev")}async function NC(t,e){let n=OC();if(e){let r=Ri(n,`${t}-${e}`,"pubspec.yaml");return await P(r)?r:null}try{let{readdir:r}=await import("fs/promises"),o=(await r(n)).filter(c=>c.startsWith(`${t}-`)).sort().at(-1);if(!o)return null;let a=Ri(n,o,"pubspec.yaml");return await P(a)?a:null}catch{return null}}async function Ny(t,e,n,r={}){let s=await NC(n,r.resolved_version);if(!s)return{};try{let i=await EC(s,"utf-8"),o=(0,Oy.parse)(i),a={};o.name&&o.name!==n&&(a.canonical_package_name=o.name),o.version&&(a.resolved_version=o.version);let c=ie(o.repository??o.homepage);return c&&(a.github_url=c),a}catch(i){return TC.debug({err:i instanceof Error?i.message:String(i),path:s},"Failed to parse pubspec.yaml"),{}}}d();var Cy=H(oe(),1);import{readFile as AC,readdir as Ay}from"fs/promises";import{join as Gr}from"path";var CC=(0,Cy.createMcpLogger)({name:"@toolcairn/tools:resolver:pypi"});async function IC(t){let e=[],n=[".venv","venv",".virtualenv"];for(let r of n){let s=Gr(t,r);if(!await fe(s))continue;let i=Gr(s,"Lib","site-packages");await fe(i)&&e.push(i);let o=Gr(s,"lib");if(await fe(o))try{for(let a of await Ay(o)){if(!a.startsWith("python"))continue;let c=Gr(o,a,"site-packages");await fe(c)&&e.push(c)}}catch{}}return e}function ji(t){return t.toLowerCase().replace(/[._]+/g,"-")}async function PC(t,e){let n=ji(e),r;try{r=await Ay(t)}catch{return null}for(let s of r){if(!s.endsWith(".dist-info"))continue;let i=s.replace(/-[^-]+\.dist-info$/,"");if(ji(i)===n){let o=Gr(t,s,"METADATA");if(await P(o))return o}}return null}function LC(t){let e=[],n,r,s=t.split(`
214
+ `);for(let i of s){if(i.trim()==="")break;let o=i.indexOf(":");if(o<0)continue;let a=i.slice(0,o).trim(),c=i.slice(o+1).trim();if(a==="Name"&&!n)n=c;else if(a==="Version"&&!r)r=c;else if(a==="Home-page")e.push(c);else if(a==="Project-URL"){let l=c.indexOf(",");l>=0?e.push(c.slice(l+1).trim()):e.push(c)}}return{name:n,version:r,urls:e}}async function Iy(t,e,n){let r=await IC(t);for(let s of r){let i=await PC(s,n);if(i)try{let o=await AC(i,"utf-8"),{name:a,version:c,urls:l}=LC(o),u={};a&&ji(a)!==ji(n)&&(u.canonical_package_name=a),c&&(u.resolved_version=c);for(let f of l){let h=ie(f);if(h){u.github_url=h;break}}return u}catch(o){CC.debug({err:o instanceof Error?o.message:String(o),path:i},"Failed to parse METADATA")}}return{}}d();var Ly=H(oe(),1);import{readFile as RC,readdir as Py}from"fs/promises";import{homedir as jC}from"os";import{join as $i}from"path";var $C=(0,Ly.createMcpLogger)({name:"@toolcairn/tools:resolver:ruby"});async function MC(t,e,n){let r=[],s=$i(t,"vendor","bundle","ruby");if(await fe(s))try{for(let o of await Py(s)){let a=$i(s,o,"specifications");await fe(a)&&r.push(a)}}catch{}let i=$i(jC(),".gem","specifications");await fe(i)&&r.push(i);for(let o of r){let a;try{a=await Py(o)}catch{continue}let l=a.filter(u=>u.endsWith(".gemspec")&&u.startsWith(`${e}-`)).filter(u=>n?u===`${e}-${n}.gemspec`:!0).sort().at(-1);if(l){let u=$i(o,l);if(await P(u))return u}}return null}function qC(t){let e={},n=r=>{let s=t.match(r);return s?s[1]:void 0};return e.name=n(/(?:s|spec)\.name\s*=\s*(['"])([^'"]+)\1/)?t.match(/(?:s|spec)\.name\s*=\s*['"]([^'"]+)['"]/)?.[1]:void 0,e.version=t.match(/(?:s|spec)\.version\s*=\s*['"]([^'"]+)['"]/)?.[1],e.homepage=t.match(/(?:s|spec)\.homepage\s*=\s*['"]([^'"]+)['"]/)?.[1],e.source_code_uri=t.match(/["']source_code_uri["']\s*=>\s*["']([^'"]+)["']/)?.[1],e}async function Ry(t,e,n,r={}){let s=await MC(t,n,r.resolved_version);if(!s)return{};try{let i=await RC(s,"utf-8"),o=qC(i),a={};o.name&&o.name!==n&&(a.canonical_package_name=o.name),o.version&&(a.resolved_version=o.version);let c=ie(o.source_code_uri??o.homepage);return c&&(a.github_url=c),a}catch(i){return $C.debug({err:i instanceof Error?i.message:String(i),path:s},"Failed to read/parse gemspec"),{}}}d();var jy=H(oe(),1);import{readFile as FC}from"fs/promises";import{join as BC}from"path";var DC=(0,jy.createMcpLogger)({name:"@toolcairn/tools:resolver:swift-pm"});async function $y(t,e,n){let r=BC(t,"Package.resolved");if(!await P(r))return{};try{let s=await FC(r,"utf-8"),i=JSON.parse(s),o={};for(let a of i.pins??[])if(a.identity===n){a.state?.version&&(o.resolved_version=a.state.version);let c=ie(a.location);return c&&(o.github_url=c),o}for(let a of i.object?.pins??[])if(a.package===n){a.state?.version&&(o.resolved_version=a.state.version);let c=ie(a.repositoryURL);return c&&(o.github_url=c),o}return{}}catch(s){return DC.debug({err:s instanceof Error?s.message:String(s),path:r},"Failed to parse Package.resolved during resolve"),{}}}var My={npm:vy,pypi:Iy,cargo:oy,go:(t,e,n)=>ly(t,e,n),rubygems:Ry,maven:_y,gradle:hy,composer:cy,hex:gy,pub:Ny,nuget:xy,"swift-pm":$y};d();import{readdir as qy}from"fs/promises";import{join as Nl,relative as UC,sep as VC}from"path";async function Fy(t,e){let n=new Set,r=new Set;for(let s of e){let i=s.trim();if(!i)continue;let o=i.startsWith("!"),c=(o?i.slice(1):i).replace(/\\/g,"/"),l=await KC(t,c),u=o?n:r;for(let f of l)u.add(f)}return[...r].filter(s=>!n.has(s)).sort()}async function KC(t,e){let n=e.split("/").filter(Boolean),r=[];return await Wr(t,t,n,0,r),r}async function Wr(t,e,n,r,s){if(r>=n.length){await fe(e)&&s.push(e);return}let i=n[r];if(i){if(i==="**"){await Wr(t,e,n,r+1,s);try{let o=await qy(e,{withFileTypes:!0});for(let a of o)!a.isDirectory()||tn.has(a.name)||await Wr(t,Nl(e,a.name),n,r,s)}catch{}return}if(i.includes("*")){let o=GC(i);try{let a=await qy(e,{withFileTypes:!0});for(let c of a)!c.isDirectory()||tn.has(c.name)||o.test(c.name)&&await Wr(t,Nl(e,c.name),n,r+1,s)}catch{}return}await Wr(t,Nl(e,i),n,r+1,s)}}function GC(t){let e=t.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*");return new RegExp(`^${e}$`)}function Mi(t,e){return UC(t,e).split(VC).join("/")}d();import{readFile as Kn}from"fs/promises";import{join as Gn}from"path";var By=H(Br(),1);async function qi(t,e=5){let n=[],r=new Set([t]),s=new Set,i=[{dir:t,depth:0}];for(;i.length>0;){let{dir:o,depth:a}=i.shift();if(s.has(o)||a>e)continue;s.add(o);let c=await WC(o,n);if(c.length===0)continue;let l=await Fy(o,c);for(let u of l)r.has(u)||(r.add(u),i.push({dir:u,depth:a+1}))}return{paths:[...r].sort(),warnings:n}}async function WC(t,e){let n=[],r=Gn(t,"pnpm-workspace.yaml");if(await P(r))try{let l=(0,By.parse)(await Kn(r,"utf-8"));Array.isArray(l.packages)&&n.push(...l.packages)}catch(l){e.push({scope:"workspace:pnpm",path:r,message:`Failed to parse pnpm-workspace.yaml: ${l instanceof Error?l.message:String(l)}`})}let s=Gn(t,"package.json");if(await P(s))try{let l=JSON.parse(await Kn(s,"utf-8"));Array.isArray(l.workspaces)?n.push(...l.workspaces):l.workspaces&&Array.isArray(l.workspaces.packages)&&n.push(...l.workspaces.packages)}catch(l){e.push({scope:"workspace:package-json",path:s,message:`Failed to parse package.json#workspaces: ${l instanceof Error?l.message:String(l)}`})}let i=Gn(t,"Cargo.toml");if(await P(i))try{let l=Ue(await Kn(i,"utf-8"));Array.isArray(l.workspace?.members)&&n.push(...l.workspace.members)}catch(l){e.push({scope:"workspace:cargo",path:i,message:`Failed to parse Cargo workspace: ${l instanceof Error?l.message:String(l)}`})}let o=Gn(t,"go.work");if(await P(o))try{let l=await Kn(o,"utf-8"),u=l.match(/use\s*\(([^)]*)\)/s);if(u?.[1])for(let f of u[1].split(`
215
+ `)){let h=f.trim().replace(/^['"]|['"]$/g,"");h&&!h.startsWith("//")&&n.push(h)}else for(let f of l.split(`
216
+ `)){let h=f.match(/^\s*use\s+(.+)$/);h?.[1]&&n.push(h[1].trim().replace(/^['"]|['"]$/g,""))}}catch(l){e.push({scope:"workspace:go",path:o,message:`Failed to parse go.work: ${l instanceof Error?l.message:String(l)}`})}let a=Gn(t,"lerna.json");if(await P(a))try{let l=JSON.parse(await Kn(a,"utf-8"));Array.isArray(l.packages)&&n.push(...l.packages)}catch(l){e.push({scope:"workspace:lerna",path:a,message:`Failed to parse lerna.json: ${l instanceof Error?l.message:String(l)}`})}let c=Gn(t,"nx.json");if(await P(c))try{let u=JSON.parse(await Kn(c,"utf-8")).workspaceLayout?.projectsDir??"packages";n.push(`${u}/*`)}catch(l){e.push({scope:"workspace:nx",path:c,message:`Failed to parse nx.json: ${l instanceof Error?l.message:String(l)}`})}return n}var Al=(0,Dy.createMcpLogger)({name:"@toolcairn/tools:scan-project"});async function Il(t,e={}){let n=Date.now(),{batchResolve:r,maxDepth:s=5}=e,i=Cl(t),o=[];Al.info({projectRoot:i},"Starting project scan");let{paths:a,warnings:c}=await qi(i,s);o.push(...c);let l=[],u=new Set,f=[],h=[],g=[];for(let x of a){let I=Mi(i,x),j=await Ud(x);for(let U of j){u.add(U);let J=ry[U];g.push(J({workspace_dir:x,workspace_rel:I,project_root:i}).then(D=>{l.push(...D.tools),o.push(...D.warnings),D.tools.length>0&&I!==""&&(h.find(re=>re.path===I&&re.ecosystem===U)||h.push({path:I,manifest:zC(U),ecosystem:U}))}).catch(D=>{f.push(`${U}@${I||"."}`),o.push({scope:`parser:${U}`,path:I||".",message:`Parser crashed: ${D instanceof Error?D.message:String(D)}`})}))}}await Promise.all(g);let p=new Map;for(let x of l){let I=`${x.ecosystem}:${x.name}`,j={workspace_path:x.workspace_path,manifest_file:x.manifest_file,section:x.section,ecosystem:x.ecosystem,version_constraint:x.version_constraint,resolved_version:x.resolved_version},U=p.get(I);U?U.locations.some(D=>D.workspace_path===j.workspace_path&&D.manifest_file===j.manifest_file&&D.section===j.section)||U.locations.push(j):p.set(I,{name:x.name,ecosystem:x.ecosystem,locations:[j]})}await Promise.all([...p.values()].map(async x=>{let I=My[x.ecosystem];if(I)for(let j of x.locations){let U=Cl(i,j.workspace_path),J={resolved_version:j.resolved_version};try{let D=await I(U,i,x.name,J);if(D.canonical_package_name&&(x.canonical_package_name=D.canonical_package_name),D.github_url&&(x.local_github_url=D.github_url),D.canonical_package_name||D.github_url)break}catch(D){Al.debug({ecosystem:x.ecosystem,name:x.name,workspace:j.workspace_path,err:D instanceof Error?D.message:String(D)},"Resolver threw \u2014 skipping this location")}}}));let m=a.map(x=>Mi(i,x)),y=await Kd(i,m),b=[...p.values()].map(({name:x,ecosystem:I,canonical_package_name:j,local_github_url:U})=>({name:x,ecosystem:I,canonical_package_name:j,github_url:U})),v=new Map,k=new Map,N=new Map;if(r&&b.length>0)try{let x=await r(b);for(let I of x.results){let j=`${I.input.ecosystem}:${I.input.name}`;v.set(j,I)}for(let[I,j]of x.methods)k.set(I,j);for(let[I,j]of x.githubUrls)N.set(I,j);o.push(...x.warnings)}catch(x){o.push({scope:"batch-resolve",message:`Failed to resolve tools against graph: ${x instanceof Error?x.message:String(x)}. Falling back to local classification.`})}else r||o.push({scope:"batch-resolve",message:"No batchResolve client provided \u2014 running in offline-only mode; all tools classified as non_oss."});let L=Vd(l,v),$=new Date().toISOString(),F=[],E=0;for(let{name:x,ecosystem:I,locations:j,local_github_url:U}of p.values()){let J=`${I}:${x}`,D=v.get(J),Q=k.get(J)??"none",re=D?.matched===!0;re&&E++;let ne=re?"toolcairn":"non_oss",Xr=D?.tool?.canonical_name,ow=D?.tool?.categories,aw=N.get(J)??U,cw=j.find(fo=>fo.resolved_version)?.resolved_version??j[0]?.version_constraint,qe=D?.tool,uo=qe?.docs?{readme_url:qe.docs.readme_url??void 0,docs_url:qe.docs.docs_url??void 0,api_url:qe.docs.api_url??void 0,changelog_url:qe.docs.changelog_url??void 0}:void 0,lw=uo&&Object.values(uo).some(fo=>fo!==void 0);F.push({name:x,source:ne,github_url:aw,version:cw,chosen_at:$,chosen_reason:"Auto-detected from manifest during toolcairn_init scan",alternatives_considered:[],canonical_name:Xr,categories:ow,match_method:Q,locations:j,description:qe?.description??void 0,license:qe?.license??void 0,homepage_url:qe?.homepage_url??void 0,docs:lw?uo:void 0,package_managers:qe?.package_managers&&qe.package_managers.length>0?qe.package_managers:void 0})}F.sort((x,I)=>{let j=U=>U.source==="toolcairn"?0:1;return j(x)!==j(I)?j(x)-j(I):x.name.localeCompare(I.name)}),h.sort((x,I)=>x.path.localeCompare(I.path));let O=await HC(i),M={ecosystems_scanned:[...u].sort(),parsers_failed:f.sort(),tools_resolved:E,tools_unresolved:F.length-E,duration_ms:Date.now()-n,completed_at:$};return Al.info({projectRoot:i,workspaces:a.length,ecosystems:M.ecosystems_scanned,tools:F.length,resolved:E,languages:y.map(x=>x.name),frameworks:L.map(x=>x.name),duration_ms:M.duration_ms},"Project scan complete"),{name:O,languages:y,frameworks:L,subprojects:h,tools:F,warnings:o,scan_metadata:M}}function zC(t){switch(t){case"npm":return"package.json";case"pypi":return"pyproject.toml";case"cargo":return"Cargo.toml";case"go":return"go.mod";case"rubygems":return"Gemfile";case"maven":return"pom.xml";case"gradle":return"build.gradle";case"composer":return"composer.json";case"hex":return"mix.exs";case"pub":return"pubspec.yaml";case"nuget":return"*.csproj";case"swift-pm":return"Package.swift"}}async function HC(t){let e=Cl(t,"package.json");if(await P(e))try{let n=JSON.parse(await JC(e,"utf-8"));if(n.name)return n.name}catch{}return YC(t)}d();d();var Ky=H(oe(),1);import{readdir as Vy}from"fs/promises";import{resolve as Pl}from"path";var Uy=(0,Ky.createMcpLogger)({name:"@toolcairn/tools:discover-roots"}),ZC=["package.json","Cargo.toml","pyproject.toml","requirements.txt","setup.py","setup.cfg","go.mod","Gemfile","pom.xml","build.gradle","build.gradle.kts","composer.json","mix.exs","pubspec.yaml","Package.swift"],XC=[".csproj",".fsproj",".sln"];async function QC(t,e={}){let{maxDepth:n=5}=e,r=Pl(t),s=await eI(r,n);if(s.length===0)return Uy.info({cwd:r},"No project roots discovered \u2014 falling back to cwd itself"),{roots:[r],usedFallback:!0};s.sort((a,c)=>a.split(/[\\/]/).length-c.split(/[\\/]/).length||a.localeCompare(c));let i=new Set(s);for(let a of s){if(!i.has(a))continue;let c=await qi(a,n).catch(()=>({paths:[a]}));if(!(c.paths.length<=1))for(let l of c.paths)l!==a&&i.has(l)&&i.delete(l)}let o=[...i].sort();return Uy.info({cwd:r,candidates:s.length,roots:o.length},"Discovered project roots"),{roots:o,usedFallback:!1}}async function eI(t,e){let n=[],r=[{dir:t,depth:0}];for(;r.length>0;){let s=r.shift();if(!s)break;let{dir:i,depth:o}=s;if(o>e)continue;await tI(i)&&n.push(i);let a;try{a=await Vy(i,{withFileTypes:!0})}catch{continue}for(let c of a)c.isDirectory()&&(tn.has(c.name)||c.name.startsWith(".")||r.push({dir:Pl(i,c.name),depth:o+1}))}return[...new Set(n)]}async function tI(t){if(!await fe(t))return!1;for(let n of ZC)if(await P(Pl(t,n)))return!0;let e;try{e=await Vy(t)}catch{return!1}for(let n of e)for(let r of XC)if(n.endsWith(r))return!0;return!1}d();d();var UD={query:C.string().min(1).max(500),context:C.object({filters:C.record(C.string(),C.unknown())}).optional(),query_id:C.string().uuid().optional(),user_id:C.string().optional()},VD={query_id:C.string().uuid(),answers:C.array(C.object({dimension:C.string(),value:C.string()}))},KD={query_id:C.string().uuid(),chosen_tool:C.string(),reason:C.string().optional(),outcome:C.enum(["success","failure","replaced","pending"]),feedback:C.string().optional(),replaced_by:C.string().optional()},GD={use_case:C.string().min(1),sub_needs:C.array(C.union([C.string().min(1),C.object({sub_need_type:C.string().min(1).max(50).describe('Stack layer type, e.g. "database", "auth", "web-framework"'),keyword_sentence:C.string().min(1).max(500).describe("Comma-separated keywords matching tool vocabulary, max 20 keywords")})])).min(1).max(8).optional().describe("Structured sub-needs from refine_requirement. Each is {sub_need_type, keyword_sentence} for keyword-matched search, or a plain string (legacy). The structured format dramatically improves accuracy."),constraints:C.object({deployment_model:C.enum(["self-hosted","cloud","embedded","serverless"]).optional(),language:C.string().optional(),license:C.string().optional()}).optional(),limit:C.number().int().positive().max(10).default(5)},WD={tool_name:C.string(),issue_title:C.string(),retry_count:C.number().int().min(0).default(0),docs_consulted:C.boolean().default(!1),issue_url:C.string().url().optional()},JD={tool_a:C.string(),tool_b:C.string(),tool_a_version:C.string().optional().describe('Specific version of tool_a to evaluate (e.g., "14.0.0"). Default: latest.'),tool_b_version:C.string().optional().describe('Specific version of tool_b to evaluate (e.g., "18.2.0"). Default: latest.')},YD={suggestion_type:C.enum(["new_tool","new_edge","update_health","new_use_case"]),data:C.object({tool_name:C.string().optional(),github_url:C.string().url().optional(),description:C.string().optional(),tools:C.array(C.object({tool_name:C.string().min(1),github_url:C.string().url().optional(),description:C.string().optional(),ecosystem:C.string().min(1).optional()})).min(1).max(200).optional().describe('Batch of tools to stage for admin review. Use with suggestion_type="new_tool". Each entry may include `ecosystem` (npm/pypi/cargo/\u2026) so the engine can cross-check the authoritative github_url from the package registry. Overrides single-tool fields when present.'),ecosystem:C.string().min(1).optional(),relationship:C.object({source_tool:C.string(),target_tool:C.string(),edge_type:C.enum(["SOLVES","REQUIRES","INTEGRATES_WITH","REPLACES","CONFLICTS_WITH","POPULAR_WITH","BREAKS_FROM","COMPATIBLE_WITH"]),evidence:C.string().optional()}).optional(),use_case:C.object({name:C.string(),description:C.string(),tools:C.array(C.string()).optional()}).optional()}),query_id:C.string().uuid().optional(),confidence:C.number().min(0).max(1).default(.5)},zD={tool_a:C.string().min(1),tool_b:C.string().min(1),use_case:C.string().optional(),project_config:C.string().max(1e5).optional()},HD={agent:C.enum(["claude","cursor","windsurf","copilot","copilot-cli","opencode","generic"]),project_root:C.string().min(1),server_path:C.string().optional()},ZD={project_root:C.string().min(1),include_locations:C.boolean().optional()},XD={project_root:C.string().min(1),action:C.enum(["add_tool","remove_tool","update_tool","add_evaluation","mark_suggestions_sent"]),tool_name:C.string().min(1).optional(),data:C.record(C.string(),C.unknown()).optional()},QD={prompt:C.string().min(1).max(2e3),project_tools:C.array(C.string()).optional()},eU={query:C.string().min(1).max(500),agent_suggestions:C.array(C.string().min(1)).min(1).max(10)},tU={prompt:C.string().min(1).max(2e3),classification:C.enum(["tool_discovery","stack_building","tool_comparison","tool_configuration"]),project_context:C.object({existing_tools:C.array(C.string()).optional(),language:C.string().optional(),framework:C.string().optional()}).optional()};d();function tt(t){return{content:[{type:"text",text:JSON.stringify({ok:!0,data:t})}]}}function je(t,e){return{content:[{type:"text",text:JSON.stringify({ok:!1,error:t,message:e})}],isError:!0}}d();var Wy=H(oe(),1);var Gy=(0,Wy.createMcpLogger)({name:"@toolcairn/tools:classify-prompt"}),nI=["tool_discovery","stack_building","tool_comparison"];async function rI(t){try{Gy.info({promptLen:t.prompt.length},"classify_prompt called");let e=t.project_tools&&t.project_tools.length>0?`
217
+
218
+ The project already uses: ${t.project_tools.join(", ")}. Consider whether the prompt relates to tools already confirmed in the project.`:"",n=`Classify the following developer prompt into exactly ONE of these categories:
219
+
220
+ Categories:
221
+ - tool_discovery: The developer needs to find, select, or identify a tool, library, framework, or service
222
+ - stack_building: The developer needs to compose multiple tools together to build a complete system
223
+ - tool_comparison: The developer wants to compare two or more specific tools
224
+ - tool_configuration: The developer already has a tool chosen and needs help configuring or using it
225
+ - debugging: The developer is encountering an error, bug, or unexpected behavior
226
+ - general_coding: Architecture, business logic, algorithms \u2014 no new tool selection is needed
227
+
228
+ Rules:
229
+ 1. If the prompt involves building something "from scratch" or asks for tech stack recommendations, classify as stack_building
230
+ 2. If the prompt mentions a specific tool and asks "should I use X or Y", classify as tool_comparison
231
+ 3. If the prompt is about implementing features WITHOUT mentioning specific tools, classify as tool_discovery
232
+ 4. If the prompt mentions an error message, traceback, or "not working", classify as debugging
233
+ 5. Respond with ONLY the category name, nothing else
234
+
235
+ Prompt to classify:
236
+ """
237
+ ${t.prompt}
238
+ """${e}
239
+
240
+ Your response (one category name only):`;return tt({classification_prompt:n,needs_tool_search_prompt:`Based on this classification, determine if ToolCairn tool search should be invoked.
241
+ Respond with 1 if the classification is one of: tool_discovery, stack_building, tool_comparison
242
+ Respond with 0 if the classification is: tool_configuration, debugging, general_coding
243
+ Respond with ONLY 0 or 1.`,valid_classifications:["tool_discovery","stack_building","tool_comparison","tool_configuration","debugging","general_coding"],tool_required_if:nI,instructions:"Step 1: Send classification_prompt to the LLM and get a classification. Step 2: If classification is in tool_required_if, call refine_requirement with the classification. Otherwise, proceed without ToolCairn search."})}catch(e){return Gy.error({err:e},"classify_prompt failed"),je("classify_error",e instanceof Error?e.message:String(e))}}d();var tw=H(oe(),1);d();var Y_=H(oe(),1),Xn=H(Ki(),1);import{readFile as du}from"fs/promises";import{resolve as co}from"path";d();d();import{join as Gi}from"path";var Ct=".toolcairn",Ul="config.json",Vl="audit-log.jsonl",Kl="audit-log.archive.jsonl";function rt(t){return Gi(t,Ct)}function Oe(t){return Gi(t,Ct,Ul)}function It(t){return Gi(t,Ct,Vl)}function Gl(t){return Gi(t,Ct,Kl)}d();var Zy=H(oe(),1);import{readFile as pI,rename as mI}from"fs/promises";import{join as gI}from"path";var Wl=(0,Zy.createMcpLogger)({name:"@toolcairn/tools:config-store"});async function Wn(t){let e=Oe(t);if(!await P(e))return{config:null,path:e,corrupt_backup_path:null};let n;try{n=await pI(e,"utf-8")}catch(r){throw Wl.error({err:r,configPath:e},"Failed to read config.json"),r}try{return{config:JSON.parse(n),path:e,corrupt_backup_path:null}}catch(r){let s=new Date().toISOString().replace(/[:.]/g,"-"),i=gI(t,Ct,`config.json.corrupt.${s}`);try{await mI(e,i),Wl.warn({configPath:e,backup:i,err:r},"config.json was unparseable \u2014 moved to backup")}catch(o){Wl.error({err:o,configPath:e,backup:i},"Failed to rename corrupt config.json")}return{config:null,path:e,corrupt_backup_path:i}}}d();var Xy=H(oe(),1),Qy=H(Ki(),1);import{mkdir as yI}from"fs/promises";var _I=(0,Xy.createMcpLogger)({name:"@toolcairn/tools:config-store"});async function Wi(t,e){await yI(rt(t),{recursive:!0});let n=Oe(t),r=`${JSON.stringify(e,null,2)}
244
+ `;await(0,Qy.default)(n,r),_I.debug({configPath:n,bytes:r.length},"config.json written atomically")}d();var L_=H(oe(),1),R_=H(ou(),1),j_=H(Ki(),1);import{appendFile as au,mkdir as cu,readFile as P_,rm as iV,writeFile as YI}from"fs/promises";d();function gn(t=""){return{version:"1.2",project:{name:t,languages:[],frameworks:[],subprojects:[]},tools:{confirmed:[],pending_evaluation:[],unknown_in_graph:[]},last_audit_entry:null}}var Zr=(0,L_.createMcpLogger)({name:"@toolcairn/tools:audit-log"}),zI=5e3,I_=2500;async function yn(t,e){await cu(rt(t),{recursive:!0});let n=It(t),r=`${JSON.stringify($_(e))}
245
+ `;await au(n,r,"utf-8"),await q_(t,n)}function $_(t){return{action:t.action,tool:t.tool,timestamp:t.timestamp,reason:t.reason,mcp_tool:t.mcp_tool??null,query_id:t.query_id??null,duration_ms:t.duration_ms??null,status:t.status??"ok",outcome:t.outcome??null,replaced_by:t.replaced_by??null,candidates:t.candidates??null,metadata:t.metadata??null}}async function so(t,e){if(e.length===0)return;await cu(rt(t),{recursive:!0});let n=It(t),r=e.map(s=>`${JSON.stringify($_(s))}
246
+ `).join("");await au(n,r,"utf-8"),await q_(t,n)}async function M_(t,e){try{await HI(t)}catch(s){Zr.debug({err:s,projectRoot:t},"audit-log: bootstrap skipped (read-only?) \u2014 abandoning");return}let n=Oe(t),r=null;try{r=await R_.default.lock(n,{stale:1e4,retries:{retries:5,minTimeout:50,factor:2,maxTimeout:500},realpath:!1}),await yn(t,e)}catch(s){Zr.warn({err:s,projectRoot:t},"audit-log: tool-call append failed")}finally{if(r)try{await r()}catch(s){Zr.debug({err:s},"audit-log: lock release failed (likely already stale)")}}}async function HI(t){await cu(rt(t),{recursive:!0});let e=Oe(t);await P(e)||await YI(e,`${JSON.stringify(gn(),null,2)}
247
+ `,"utf-8")}async function io(t){let e=It(t);if(!await P(e))return[];let n=await P_(e,"utf-8");return ZI(n)}async function q_(t,e){let r=(await P_(e,"utf-8")).split(`
248
+ `).filter(a=>a.trim().length>0);if(r.length<=zI)return;let s=r.slice(0,I_),i=r.slice(I_),o=Gl(t);try{await au(o,`${s.join(`
249
+ `)}
250
+ `,"utf-8");let a=`${i.join(`
251
+ `)}
252
+ `;await(0,j_.default)(e,a),Zr.info({archived:s.length,retained:i.length},"audit-log.jsonl rotated")}catch(a){Zr.warn({err:a,auditPath:e,archivePath:o},"Audit-log rotation failed \u2014 live file intact")}}function ZI(t){let e=[];for(let n of t.split(`
253
+ `))if(n.trim())try{e.push(JSON.parse(n))}catch{}return e}d();async function oo(t,e){if(t.version==="1.1"||t.version==="1.2"){for(let i of t.tools.confirmed)i.locations||(i.locations=[]);return{migrated:!1,was_v1_0:!1,legacy_audit_entries:[]}}t.project.languages||(t.project.languages=t.project.language?[{name:t.project.language,file_count:0,workspaces:["."]}]:[]),t.project.frameworks||(t.project.frameworks=t.project.framework?[{name:t.project.framework,ecosystem:"npm",workspace:".",source:"local"}]:[]),t.project.subprojects||(t.project.subprojects=[]);for(let i of t.tools.confirmed)i.locations||(i.locations=[]);let n=t.audit_log??[];delete t.audit_log;let s={action:"migrate",tool:"__schema__",timestamp:new Date().toISOString(),reason:"Schema 1.0 \u2192 1.1: audit_log relocated to audit-log.jsonl; languages/frameworks expanded to arrays"};return t.last_audit_entry=s,t.version="1.1",await so(e,[...n,s]),{migrated:!0,was_v1_0:!0,legacy_audit_entries:n}}async function ao(t,e){if(t.version==="1.2")return t.tools.unknown_in_graph||(t.tools.unknown_in_graph=[]),{migrated:!1};if(t.version!=="1.1")return{migrated:!1};t.tools.unknown_in_graph||(t.tools.unknown_in_graph=[]),t.version="1.2";let r={action:"migrate",tool:"__schema__",timestamp:new Date().toISOString(),reason:"Schema 1.1 \u2192 1.2: added tools.unknown_in_graph for suggest_graph_update drain tracking"};return t.last_audit_entry=r,await yn(e,r),{migrated:!0}}d();var F_=H(oe(),1),B_=H(ou(),1);import{mkdir as XI,writeFile as QI}from"fs/promises";var lu=(0,F_.createMcpLogger)({name:"@toolcairn/tools:config-store"});async function Rt(t,e,n){let r=Oe(t),s=await P(r);await eP(t);let i=Date.now(),o=await B_.default.lock(r,{stale:1e4,retries:{retries:5,minTimeout:50,factor:2,maxTimeout:500},realpath:!1});try{let{config:a}=await Wn(t),c,l=!s,u=!1;if(a?c=a:(c=gn(),lu.info({projectRoot:t},"Bootstrapping fresh .toolcairn/config.json")),c.version==="1.0")u=(await oo(c,t)).migrated;else{for(let p of c.tools.confirmed)p.locations||(p.locations=[]);c.project.languages||(c.project.languages=[]),c.project.frameworks||(c.project.frameworks=[]),c.project.subprojects||(c.project.subprojects=[])}if(c.version==="1.1"){let p=await ao(c,t);u=u||p.migrated}else c.tools.unknown_in_graph||(c.tools.unknown_in_graph=[]);await e(c);let f=new Date().toISOString(),h=Date.now()-i,g={...n,timestamp:f,duration_ms:n.duration_ms??h,status:n.status??"ok"};return c.last_audit_entry=g,c.version="1.2",await Wi(t,c),await yn(t,g),{config:c,audit_entry:g,bootstrapped:l,migrated:u}}finally{try{await o()}catch(a){lu.warn({err:a,configPath:r},"Failed to release config lock \u2014 may be stale")}}}async function eP(t){await XI(rt(t),{recursive:!0});let e=Oe(t);if(!await P(e))try{await QI(e,`${JSON.stringify(gn(),null,2)}
254
+ `,"utf-8")}catch(n){lu.debug({err:n,configPath:e},"Bootstrap seed skipped (likely race)")}}d();var D_=process.platform==="win32",tP=D_?{toolcairn:{command:"cmd",args:["/c","npx","-y","@neurynae/toolcairn-mcp"]}}:{toolcairn:{command:"npx",args:["-y","@neurynae/toolcairn-mcp"]}},U_="<!-- toolcairn:start -->",V_="<!-- toolcairn:end -->",_n=`${U_}
255
+ <!-- ToolCairn MCP \u2014 15-tool flow guide. Managed by @neurynae/toolcairn-mcp;
256
+ do not edit between markers. -->
257
+
258
+ ### ToolCairn \u2014 when to call which tool
259
+
260
+ Always consult ToolCairn before recommending a library / CLI / framework.
261
+
262
+ **Session entry.** Call \`toolcairn_auth\` once. The auth response auto-runs \`toolcairn_init\` for every project root under CWD; call \`toolcairn_init\` explicitly only when \`read_project_config\` returns \`not_initialized\`.
263
+
264
+ **Before answering ANY user request \u2014 per project root**
265
+
266
+ 1. \`read_project_config\` \u2014 load the snapshot.
267
+ 2. Drain non-empty \`unknown_tools[]\`: \`suggest_graph_update\` (stages them for admin review) \u2192 \`update_project_config\` action \`mark_suggestions_sent\`.
268
+ 3. Each \`pending_outcomes[]\` entry still owes a \`report_outcome\` \u2014 fire it as soon as the underlying tool is used.
269
+
270
+ **Use the on-disk state, not just MCP tools**
271
+
272
+ \`.toolcairn/\` is a local knowledge base \u2014 read it freely, never write directly (mutations go through \`update_project_config\`).
273
+
274
+ - \`.toolcairn/config.json\` \u2192 \`tools.confirmed[]\` carries every tool's full enrichment: \`description\`, \`license\`, \`homepage_url\`, \`docs.{readme_url,docs_url,api_url,changelog_url}\`, \`package_managers[].install_commands[]\`, \`version\` (resolved from the lockfile), \`categories\`, \`locations[]\` (workspaces + manifest paths). When the user asks "how do I install X?", "where are X's docs?", "what version of X are we on?", "where is X used?" \u2014 read config.json. Do NOT call \`search_tools\` or hit the network.
275
+ - \`tools.unknown_in_graph[]\` tracks which candidates still owe \`suggest_graph_update\` (\`suggested:true\` is already drained).
276
+ - \`project.subprojects[]\` + per-tool \`locations[]\` reveal monorepo layout \u2014 pick the right \`project_root\` before mutating.
277
+ - \`.toolcairn/audit-log.jsonl\` is the append-only journal \u2014 tail it to recover a recent \`query_id\` or de-dup against an identical recent search.
278
+
279
+ **Per user request**
280
+
281
+ 1. \`classify_prompt\` to decide if ToolCairn is needed at all. Branch on the returned classification:
282
+ 2. \`tool_discovery\` (one specific need) \u2192 \`search_tools\`. If the response asks clarification questions \u2192 \`search_tools_respond\` (loop until complete).
283
+ 3. \`stack_building\` (multi-layer "build me a \u2026") \u2192 \`refine_requirement\` \u2192 feed its \`sub_needs\` into \`get_stack\`.
284
+ 4. \`tool_comparison\` ("X vs Y") \u2192 \`compare_tools\`.
285
+ 5. Anything else \u2192 answer directly, ToolCairn isn't the right surface.
286
+
287
+ **Validate + persist (after the agent picks tools)**
288
+
289
+ 1. \`verify_suggestion\` to confirm every pick exists in the graph; not-indexed picks route through \`suggest_graph_update\` instead of \`add_tool\`.
290
+ 2. \`check_compatibility\` between picks when versions are uncertain.
291
+ 3. \`update_project_config\` action \`add_tool\` for each accepted tool \u2014 record the \`query_id\` and \`chosen_reason\`.
292
+
293
+ **Close the loop**
294
+
295
+ - \`report_outcome\` after the user actually uses (or replaces) each tool. Fire-and-forget; never await.
296
+
297
+ **Last resort.** \`check_issue\` for known-bug lookup, ONLY after 4+ retries on the user's actual error and a docs review.
298
+
299
+ **Tracker.** Open \`.toolcairn/tracker.html\` in any browser \u2014 server-rewritten, auto-refreshes, shows every tool call + pending outcomes in real time.
300
+ ${V_}`;function nP(){return{file_path:"CLAUDE.md",mode:"append",content:_n}}function rP(){return{file_path:".cursorrules",mode:"append",content:_n}}function sP(){return{file_path:".windsurfrules",mode:"append",content:_n}}function iP(){return{file_path:".github/copilot-instructions.md",mode:"append",content:_n}}function oP(){return{file_path:".github/copilot-instructions.md",mode:"append",content:_n}}function aP(){return{file_path:"AGENTS.md",mode:"append",content:_n}}function cP(){return{file_path:"AI_INSTRUCTIONS.md",mode:"append",content:_n}}var K_=U_,uu=V_,G_="## ToolCairn MCP \u2014 Tool Intelligence";function fu(t){switch(t){case"claude":return nP();case"cursor":return rP();case"windsurf":return sP();case"copilot":return iP();case"copilot-cli":return oP();case"opencode":return aP();case"generic":return cP()}}function W_(t){return t?{toolcairn:{command:"node",args:[t]}}:tP}function J_(t){return t?{toolcairn:{type:"local",command:["node",t],enabled:!0}}:{toolcairn:{type:"local",command:D_?["cmd","/c","npx","-y","@neurynae/toolcairn-mcp"]:["npx","-y","@neurynae/toolcairn-mcp"],enabled:!0}}}var lo=(0,Y_.createMcpLogger)({name:"@toolcairn/tools:auto-init"}),z_=`
301
+ # ToolCairn
302
+ .toolcairn/
303
+ `;async function hu(t){let{projectRoot:e,agent:n,batchResolve:r,serverPath:s,reason:i}=t;lo.info({projectRoot:e,agent:n},"autoInitProject starting");let o=await Il(e,{batchResolve:r}),a=o.warnings.some(E=>E.scope==="batch-resolve"&&/offline|falling back|unreachable|http /i.test(E.message)),c=new Date().toISOString(),l=a?[]:o.tools.filter(E=>E.source==="non_oss"&&!!E.github_url).map(E=>{let O=E.locations?.[0]?.ecosystem??"npm";return{name:E.name,ecosystem:O,canonical_package_name:E.canonical_name,github_url:E.github_url,discovered_at:c,suggested:!1}}),u={action:"init",tool:"__project__",reason:i??`Auto-init: scanned ${o.tools.length} tools across ${o.scan_metadata.ecosystems_scanned.length} ecosystems; ${l.length} candidate(s) for graph submission.`,metadata:{project_name:o.name,tools_scanned:o.tools.length,tools_resolved:o.scan_metadata.tools_resolved,tools_unresolved:o.scan_metadata.tools_unresolved,unknown_in_graph:l.length,ecosystems_scanned:o.scan_metadata.ecosystems_scanned,languages:o.languages.map(E=>E.name),frameworks:o.frameworks.map(E=>E.name),scan_duration_ms:o.scan_metadata.duration_ms,batch_resolve_failed:a}},{config:f,audit_entry:h,bootstrapped:g,migrated:p}=await Rt(e,E=>{if(E.project.name=o.name,E.project.languages=o.languages,E.project.frameworks=o.frameworks,E.project.subprojects=o.subprojects,E.scan_metadata=o.scan_metadata,!a){let M=new Map;for(let x of E.tools.confirmed){let I=x.locations?.[0]?.ecosystem??"";M.set(`${I}:${x.name}`,x)}E.tools.confirmed=o.tools.map(x=>{let I=x.locations?.[0]?.ecosystem??"",j=M.get(`${I}:${x.name}`);return j?{...x,chosen_at:j.chosen_at??x.chosen_at,confirmed_at:j.confirmed_at??j.chosen_at??x.chosen_at,last_verified:c,chosen_reason:j.chosen_reason&&j.chosen_reason.length>0?j.chosen_reason:x.chosen_reason,alternatives_considered:j.alternatives_considered&&j.alternatives_considered.length>0?j.alternatives_considered:x.alternatives_considered,query_id:j.query_id??x.query_id,notes:j.notes??x.notes}:x})}let O=new Map;for(let M of E.tools.unknown_in_graph??[])O.set(`${M.ecosystem}:${M.name}`,M);E.tools.unknown_in_graph=l.map(M=>{let x=O.get(`${M.ecosystem}:${M.name}`);return x?.suggested?{...M,suggested:!0,suggested_at:x.suggested_at}:M})},u),m=fu(n),y=n==="opencode",b=y?J_(s):W_(s),v=y?"opencode.json":".mcp.json",k=JSON.stringify(y?{mcp:b}:{mcpServers:b},null,2),N=[{step:1,action:"append-or-create",file:m.file_path,content:m.content,note:`Append the ToolCairn rules block to ${m.file_path} (or create it if missing).`},{step:2,action:"merge-or-create",file:v,content:k,note:y?`Merge the toolcairn entry into ${v} under "mcp".`:`Merge the toolcairn entry into ${v} under "mcpServers".`},{step:3,action:"append",file:".gitignore",content:z_,note:"Ignore runtime/audit files. config.json should be committed so teammates share tool intelligence."}],L=t.skipSetupFileWrites?N.map(E=>({file:E.file,action:E.action,applied:!1,reason:"skipSetupFileWrites=true"})):await lP(e,{agent:n,instructionFile:m.file_path,instructionContent:m.content,mcpConfigFile:v,mcpConfigEntry:b,isOpenCode:y}),$={total:f.tools.confirmed.length,indexed:f.tools.confirmed.filter(E=>E.source==="toolcairn").length,non_oss:f.tools.confirmed.filter(E=>E.source==="non_oss").length},F=(f.tools.unknown_in_graph??[]).filter(E=>!E.suggested);return{project_root:e,instruction_file:m.file_path,config_path:".toolcairn/config.json",audit_log_path:".toolcairn/audit-log.jsonl",events_path:".toolcairn/events.jsonl",mcp_config_entry:b,setup_steps:N,applied_steps:L,scan_summary:{project_name:o.name,languages:o.languages.map(E=>({name:E.name,file_count:E.file_count})),frameworks:o.frameworks,subprojects:o.subprojects,tool_counts:$,warnings:o.warnings,scan_metadata:o.scan_metadata},bootstrapped:g,migrated:p,last_audit_entry:h,unknown_tools:F}}async function lP(t,e){let n=[];return n.push(await H_(co(t,e.instructionFile),e.instructionFile,e.instructionContent)),n.push(await fP(co(t,e.mcpConfigFile),e.mcpConfigFile,e.mcpConfigEntry,e.isOpenCode)),n.push(await hP(co(t,".gitignore"))),n}async function uP(t,e){let n=fu(e);return H_(co(t,n.file_path),n.file_path,n.content)}async function H_(t,e,n){try{let r="",s=!1;await P(t)&&(r=await du(t,"utf-8"),s=!0);let i=Z_(r,s,n);return s&&i===r?{file:e,action:"append-or-create",applied:!1,reason:"content already up to date"}:(await(0,Xn.default)(t,i,"utf-8"),{file:e,action:"append-or-create",applied:!0})}catch(r){let s=r instanceof Error?r.message:String(r);return lo.warn({err:r,file:e},"Failed to write instruction file"),{file:e,action:"append-or-create",applied:!1,reason:s}}}function Z_(t,e,n){if(!e||t.length===0)return n;let r=t.indexOf(K_),s=t.indexOf(uu);if(r>=0&&s>r){let a=t.slice(0,r),c=t.slice(s+uu.length);return a+n+c}let i=t.indexOf(G_);if(i>=0){let a=t.slice(0,i).replace(/\s+$/,"");return a+(a.length>0?`
304
+
305
+ `:"")+n+`
306
+ `}return t.replace(/\s+$/,"")+`
307
+
308
+ `+n+`
309
+ `}async function fP(t,e,n,r){try{let s=await P(t),i=r?"mcp":"mcpServers";if(!s){let h={[i]:n};return await(0,Xn.default)(t,`${JSON.stringify(h,null,2)}
310
+ `,"utf-8"),{file:e,action:"merge-or-create",applied:!0}}let o=await du(t,"utf-8"),a;try{a=JSON.parse(o)}catch{return{file:e,action:"merge-or-create",applied:!1,reason:"existing file is not valid JSON \u2014 refusing to overwrite; fix manually"}}let c=a[i]&&typeof a[i]=="object"&&!Array.isArray(a[i])?a[i]:{},l=n.toolcairn??n,u={...a,[i]:{...c,toolcairn:l}},f=`${JSON.stringify(u,null,2)}
311
+ `;return o===f?{file:e,action:"merge-or-create",applied:!1,reason:"toolcairn entry already up to date"}:(await(0,Xn.default)(t,f,"utf-8"),{file:e,action:"merge-or-create",applied:!0})}catch(s){let i=s instanceof Error?s.message:String(s);return lo.warn({err:s,file:e},"Failed to write MCP config"),{file:e,action:"merge-or-create",applied:!1,reason:i}}}var X_="# toolcairn:start",Q_="# toolcairn:end";function dP(){return`${X_}${z_}${Q_}
312
+ `}async function hP(t){let e=".gitignore";try{let n=await P(t),r=dP();if(!n)return await(0,Xn.default)(t,r,"utf-8"),{file:e,action:"append",applied:!0};let s=await du(t,"utf-8"),i=s.indexOf(X_),o=s.indexOf(Q_),a;if(i!==-1&&o!==-1&&o>i){let c=s.lastIndexOf(`
313
+ `,i)+1,l=s.indexOf(`
314
+ `,o),u=l===-1?s.length:l+1;a=s.slice(0,c)+r+s.slice(u)}else{let c=s.endsWith(`
315
+ `)?"":`
316
+ `;a=`${s}${c}${r}`}return a===s?{file:e,action:"append",applied:!1,reason:"block already up to date"}:(await(0,Xn.default)(t,a,"utf-8"),{file:e,action:"append",applied:!0})}catch(n){let r=n instanceof Error?n.message:String(n);return lo.warn({err:n,file:e},"Failed to write .gitignore"),{file:e,action:"append",applied:!1,reason:r}}}var ew=(0,tw.createMcpLogger)({name:"@toolcairn/tools:toolcairn-init"});async function pP(t,e={}){try{ew.info({agent:t.agent,project_root:t.project_root},"toolcairn_init called");let n=await hu({projectRoot:t.project_root,agent:t.agent,batchResolve:e.batchResolve,serverPath:t.server_path,reason:"Explicit toolcairn_init call from agent"});return tt({agent:t.agent,instruction_file:n.instruction_file,config_path:n.config_path,audit_log_path:n.audit_log_path,events_path:n.events_path,mcp_config_entry:n.mcp_config_entry,setup_steps:n.setup_steps,scan_summary:n.scan_summary,bootstrapped:n.bootstrapped,migrated:n.migrated,last_audit_entry:n.last_audit_entry,unknown_tools:n.unknown_tools,first_turn_directive:mP(n.unknown_tools.length),next_steps:'Config written. Apply setup_steps (CLAUDE.md / .mcp.json / .gitignore). If unknown_tools is non-empty, drain it via suggest_graph_update (batch) + update_project_config action="mark_suggestions_sent" before responding to the user.'})}catch(n){return ew.error({err:n},"toolcairn_init failed"),je("init_error",n instanceof Error?n.message:String(n))}}function mP(t){return t===0?"":[`The scan found ${t} tool(s) not currently in the ToolCairn graph.`,'BEFORE responding to the user, call `suggest_graph_update` with suggestion_type="new_tool"',"and `data.tools = <unknown_tools array>` to STAGE them for admin review (they do NOT go live",'until approved). Then call `update_project_config` action="mark_suggestions_sent" with the',"tool_names that staged successfully."].join(" ")}d();var rw=H(oe(),1);var pu=(0,rw.createMcpLogger)({name:"@toolcairn/tools:read-project-config"}),gP=90,yP=7,_P=new Set(["search_tools","search_tools_respond","get_stack"]);function wP(t){let e=Date.now()-yP*24*60*60*1e3,n=new Map;for(let r of t){if(r.action!=="tool_call"||!r.query_id||r.status==="error")continue;let s=Date.parse(r.timestamp);if(!(Number.isNaN(s)||s<e))if(r.mcp_tool&&_P.has(r.mcp_tool)){let i=typeof r.metadata?.query=="string"?r.metadata.query:typeof r.metadata?.use_case=="string"?r.metadata.use_case:null;n.set(r.query_id,{query_id:r.query_id,mcp_tool:r.mcp_tool,selected_at:r.timestamp,age_hours:Math.round((Date.now()-s)/(1e3*60*60)),candidates:r.candidates??[],query:i})}else r.mcp_tool==="report_outcome"&&n.delete(r.query_id)}return Array.from(n.values()).sort((r,s)=>Date.parse(r.selected_at)-Date.parse(s.selected_at))}function nw(t){return(Date.now()-new Date(t).getTime())/(1e3*60*60*24)}async function bP(t){try{pu.info({project_root:t.project_root},"read_project_config called");let{config:e,corrupt_backup_path:n}=await Wn(t.project_root);if(!e)return tt({status:"not_initialized",project_root:t.project_root,config_path:Oe(t.project_root),audit_log_path:It(t.project_root),corrupt_backup_path:n,agent_instructions:n?`.toolcairn/config.json was unparseable \u2014 moved to ${n}. Call toolcairn_init with the project_root to re-discover and write a fresh config.`:"No .toolcairn/config.json present. Call toolcairn_init with the project_root to auto-discover the project and bootstrap the config."});let r=e,s=!1;(e.version==="1.0"||e.version==="1.1")&&(r=(await Rt(t.project_root,()=>{},{action:"migrate",tool:"__schema__",reason:`Lazy migration on first read: ${e.version} \u2192 1.2`})).config,s=!0);let i=r.tools.confirmed.map(m=>m.name),o=r.tools.pending_evaluation.map(m=>m.name),a=r.tools.confirmed.filter(m=>{let y=m.last_verified??m.chosen_at??m.confirmed_at;return y?nw(y)>gP:!0}).map(m=>{let y=m.last_verified??m.chosen_at??m.confirmed_at,b=y?Math.round(nw(y)):-1;return{name:m.name,last_verified:y??"unknown",days_since_verified:b,recommendation:"Consider using check_issue to verify no new known issues"}}),c=r.tools.confirmed.filter(m=>m.source==="non_oss").map(m=>m.name),l=(r.tools.unknown_in_graph??[]).filter(m=>!m.suggested),u=[];try{let m=await io(t.project_root);u=wP(m)}catch(m){pu.debug({err:m},"pending_outcomes derivation skipped (audit-log unreadable)")}let f=r.tools.confirmed.filter(m=>m.source==="toolcairn"||m.source==="toolpilot").map(m=>m.name),g=t.include_locations===!0?r.tools.confirmed.map(m=>({name:m.name,source:m.source,canonical_name:m.canonical_name,categories:m.categories??[],match_method:m.match_method??"none",github_url:m.github_url,locations:m.locations??[]})):void 0,p=[`Project: ${r.project.name}`,r.project.languages&&r.project.languages.length>0?`Languages: ${r.project.languages.map(m=>`${m.name} (${m.file_count} files)`).join(", ")}`:"",r.project.frameworks&&r.project.frameworks.length>0?`Frameworks: ${r.project.frameworks.map(m=>`${m.name}@${m.workspace}`).join(", ")}`:"",`Confirmed tools (${i.length}): ${i.join(", ")||"none"}`,"When recommending tools, skip any already in confirmed_tools.",c.length>0?`Non-OSS tools in project (handle separately): ${c.join(", ")}`:"",a.length>0?`Tools that may be stale \u2014 worth re-checking: ${a.map(m=>m.name).join(", ")}`:"",l.length>0?`Unknown-to-graph tools awaiting submission (${l.length}): ${l.map(m=>m.name).join(", ")}. BEFORE answering the user, call suggest_graph_update (suggestion_type="new_tool", data.tools=<this list>) to STAGE them for admin review, then update_project_config action="mark_suggestions_sent" with the successful tool_names.`:"",u.length>0?`Pending outcomes (${u.length}) \u2014 recommendations the user used but you have not yet reported on. As soon as the user uses (or replaces) one of the suggested tools, call report_outcome with the matching query_id: ${u.map(m=>`${m.query_id} (${m.mcp_tool}, ${m.age_hours}h ago${m.candidates.length>0?`, candidates: ${m.candidates.slice(0,3).join("/")}`:""})`).join("; ")}.`:""].filter(Boolean);return tt({status:"ready",schema_version:r.version,migrated:s,project:{name:r.project.name,languages:r.project.languages??[],frameworks:r.project.frameworks??[],subprojects:r.project.subprojects??[]},confirmed_tools:i,pending_tools:o,non_oss_tools:c,toolcairn_indexed_tools:f,stale_tools:a,unknown_tools:l,total_confirmed:i.length,total_pending:o.length,total_unknown_undrained:l.length,pending_outcomes:u,total_pending_outcomes:u.length,last_audit_entry:r.last_audit_entry??null,scan_metadata:r.scan_metadata??null,confirmed_tools_detail:g,agent_instructions:p.join(`
317
+ `)})}catch(e){return pu.error({err:e},"read_project_config failed"),je("read_config_error",e instanceof Error?e.message:String(e))}}d();var iw=H(oe(),1);var sw=(0,iw.createMcpLogger)({name:"@toolcairn/tools:update-project-config"});async function vP(t){try{sw.info({project_root:t.project_root,action:t.action,tool:t.tool_name},"update_project_config called");let e=t.data??{},n=t.action==="mark_suggestions_sent",r=n?Array.isArray(e.tool_names)?e.tool_names.filter(f=>typeof f=="string"):[]:[];if(!n&&!t.tool_name)return je("missing_field",`tool_name is required for action "${t.action}"`);if(n&&r.length===0)return je("missing_field","mark_suggestions_sent requires data.tool_names: string[] with at least one entry");let s=!1,i=0,o=new Date().toISOString(),a={action:t.action,tool:n?`__batch__:${r.length}`:t.tool_name,reason:e.reason??e.chosen_reason??EP(t.action),...t.query_id?{query_id:t.query_id}:{},metadata:SP(t,e)},{config:c,audit_entry:l,bootstrapped:u}=await Rt(t.project_root,f=>{switch(t.action){case"add_tool":{let h=t.tool_name;if(f.tools.pending_evaluation=f.tools.pending_evaluation.filter(g=>g.name!==h),!f.tools.confirmed.some(g=>g.name===h)){let g={name:h,source:e.source??"toolcairn",github_url:e.github_url,version:e.version,chosen_at:o,chosen_reason:e.chosen_reason??"Selected via ToolCairn",alternatives_considered:e.alternatives_considered??[],query_id:e.query_id,notes:e.notes,locations:[]};f.tools.confirmed.push(g)}break}case"remove_tool":{let h=t.tool_name;f.tools.confirmed=f.tools.confirmed.filter(g=>g.name!==h),f.tools.pending_evaluation=f.tools.pending_evaluation.filter(g=>g.name!==h);break}case"update_tool":{let h=t.tool_name,g=f.tools.confirmed.findIndex(m=>m.name===h);if(g===-1){s=!0;return}let p=f.tools.confirmed[g];if(!p){s=!0;return}f.tools.confirmed[g]={...p,...e.version!==void 0?{version:e.version}:{},...e.notes!==void 0?{notes:e.notes}:{},...e.chosen_reason!==void 0?{chosen_reason:e.chosen_reason}:{},...e.alternatives_considered!==void 0?{alternatives_considered:e.alternatives_considered}:{},last_verified:o};break}case"add_evaluation":{let h=t.tool_name,g=f.tools.confirmed.some(m=>m.name===h),p=f.tools.pending_evaluation.some(m=>m.name===h);if(!g&&!p){let m={name:h,category:e.category??"other",added_at:o};f.tools.pending_evaluation.push(m)}break}case"mark_suggestions_sent":{let h=f.tools.unknown_in_graph??[],g=new Set(r);for(let p of h)g.has(p.name)&&!p.suggested&&(p.suggested=!0,p.suggested_at=o,i++);f.tools.unknown_in_graph=h;break}}},a);return s?je("not_found",`Tool "${t.tool_name}" is not in the confirmed list \u2014 cannot update.`):tt({action_applied:t.action,tool_name:t.tool_name,tool_names:n?r:void 0,marked_count:n?i:void 0,undrained_unknown_count:(c.tools.unknown_in_graph??[]).filter(f=>!f.suggested).length,confirmed_count:c.tools.confirmed.length,pending_count:c.tools.pending_evaluation.length,last_audit_entry:l,bootstrapped:u,config_path:".toolcairn/config.json",audit_log_path:".toolcairn/audit-log.jsonl"})}catch(e){return sw.error({err:e},"update_project_config failed"),je("update_config_error",e instanceof Error?e.message:String(e))}}function SP(t,e){let n={config_action:t.action};switch(t.action){case"add_tool":{t.tool_name&&(n.tool_name=t.tool_name),typeof e.source=="string"&&(n.source=e.source),typeof e.version=="string"&&(n.version=e.version),typeof e.github_url=="string"&&(n.github_url=e.github_url),Array.isArray(e.alternatives_considered)&&(n.alternatives_count=e.alternatives_considered.length);break}case"remove_tool":case"update_tool":{t.tool_name&&(n.tool_name=t.tool_name),typeof e.version=="string"&&(n.version=e.version);break}case"add_evaluation":{t.tool_name&&(n.tool_name=t.tool_name);break}case"mark_suggestions_sent":{let r=Array.isArray(e.tool_names)?e.tool_names.filter(s=>typeof s=="string"):[];n.tool_names=r,n.tool_count=r.length;break}}return n}function EP(t){switch(t){case"add_tool":return"Added via ToolCairn recommendation";case"remove_tool":return"Removed from project";case"update_tool":return"Tool details updated";case"add_evaluation":return"Added for evaluation";case"mark_suggestions_sent":return"Agent successfully staged unknown tools via suggest_graph_update"}}export{S as a,gw as b,H as c,d,Ae as e,K as f,ob as g,C as h,oe as i,ba as j,xa as k,wk as l,Bd as m,bk as n,Dd as o,Sk as p,UD as q,VD as r,KD as s,GD as t,WD as u,JD as v,YD as w,zD as x,HD as y,ZD as z,XD as A,QD as B,eU as C,tU as D,rI as E,rt as F,M_ as G,io as H,Rt as I,Il as J,QC as K,hu as L,uP as M,pP as N,bP as O,vP as P};
318
+ /*! Bundled license information:
319
+
320
+ imurmurhash/imurmurhash.js:
321
+ (**
322
+ * @preserve
323
+ * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013)
324
+ *
325
+ * @author <a href="mailto:jensyt@gmail.com">Jens Taylor</a>
326
+ * @see http://github.com/homebrewing/brauhaus-diff
327
+ * @author <a href="mailto:gary.court@gmail.com">Gary Court</a>
328
+ * @see http://github.com/garycourt/murmurhash-js
329
+ * @author <a href="mailto:aappleby@gmail.com">Austin Appleby</a>
330
+ * @see http://sites.google.com/site/murmurhash/
331
+ *)
332
+
333
+ smol-toml/dist/error.js:
334
+ smol-toml/dist/util.js:
335
+ smol-toml/dist/date.js:
336
+ smol-toml/dist/primitive.js:
337
+ smol-toml/dist/extract.js:
338
+ smol-toml/dist/struct.js:
339
+ smol-toml/dist/parse.js:
340
+ smol-toml/dist/stringify.js:
341
+ smol-toml/dist/index.js:
342
+ (*!
343
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
344
+ * SPDX-License-Identifier: BSD-3-Clause
345
+ *
346
+ * Redistribution and use in source and binary forms, with or without
347
+ * modification, are permitted provided that the following conditions are met:
348
+ *
349
+ * 1. Redistributions of source code must retain the above copyright notice, this
350
+ * list of conditions and the following disclaimer.
351
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
352
+ * this list of conditions and the following disclaimer in the
353
+ * documentation and/or other materials provided with the distribution.
354
+ * 3. Neither the name of the copyright holder nor the names of its contributors
355
+ * may be used to endorse or promote products derived from this software without
356
+ * specific prior written permission.
357
+ *
358
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
359
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
360
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
361
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
362
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
363
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
364
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
365
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
366
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
367
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
368
+ *)
369
+ */