nemar-cli 0.9.16-PR1269.8f3df34 → 0.9.16-PR1269.abb2129
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -97,11 +97,11 @@ ${t}`,nwe,iwe,swe=(e,t,r)=>{let n=r===""?"":`with ${r.trim()}() `,i=rwe.bind(nul
|
|
|
97
97
|
depsCount: ${t},
|
|
98
98
|
deps: ${r}}`};var y8e={keyword:"dependencies",type:"object",schemaType:"object",error:dV.error,code(e){let[t,r]=x8e(e);uV(e,t),lV(e,r)}};function x8e({schema:e}){let t={},r={};for(let n in e){if(n==="__proto__")continue;let i=Array.isArray(e[n])?t:r;i[n]=e[n]}return[t,r]}function uV(e,t=e.schema){let{gen:r,data:n,it:i}=e;if(Object.keys(t).length===0)return;let s=r.let("missing");for(let o in t){let a=t[o];if(a.length===0)continue;let c=kd.propertyInData(r,n,o,i.opts.ownProperties);if(e.setParams({property:o,depsCount:a.length,deps:a.join(", ")}),i.allErrors)r.if(c,()=>{for(let l of a)kd.checkReportMissingProp(e,l)});else r.if(z1._`${c} && (${kd.checkMissingProp(e,a,s)})`),kd.reportMissingProp(e,s),r.else()}}dV.validatePropertyDeps=uV;function lV(e,t=e.schema){let{gen:r,data:n,keyword:i,it:s}=e,o=r.name("valid");for(let a in t){if(g8e.alwaysValidSchema(s,t[a]))continue;r.if(kd.propertyInData(r,n,a,s.opts.ownProperties),()=>{let c=e.subschema({keyword:i,schemaProp:a},o);e.mergeValidEvaluated(c,o)},()=>r.var(o,!0)),e.ok(o)}}dV.validateSchemaDeps=lV;dV.default=y8e});var yV=h(function(gV){Object.defineProperty(gV,"__esModule",{value:!0});var hV=be(),v8e=qe(),w8e={message:"property name must be valid",params:({params:e})=>hV._`{propertyName: ${e.propertyName}}`},D8e={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:w8e,code(e){let{gen:t,schema:r,data:n,it:i}=e;if(v8e.alwaysValidSchema(i,r))return;let s=t.name("valid");t.forIn("key",n,(o)=>{e.setParams({propertyName:o}),e.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},s),t.if(hV.not(s),()=>{if(e.error(!0),!i.allErrors)t.break()})}),e.ok(s)}};gV.default=D8e});var H1=h(function(xV){Object.defineProperty(xV,"__esModule",{value:!0});var Gh=cn(),Nn=be(),S8e=Ji(),Wh=qe(),$8e={message:"must NOT have additional properties",params:({params:e})=>Nn._`{additionalProperty: ${e.additionalProperty}}`},C8e={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:$8e,code(e){let{gen:t,schema:r,parentSchema:n,data:i,errsCount:s,it:o}=e;if(!s)throw Error("ajv implementation error");let{allErrors:a,opts:c}=o;if(o.props=!0,c.removeAdditional!=="all"&&Wh.alwaysValidSchema(o,r))return;let l=Gh.allSchemaProperties(n.properties),d=Gh.allSchemaProperties(n.patternProperties);f(),e.ok(Nn._`${s} === ${S8e.default.errors}`);function f(){t.forIn("key",i,(x)=>{if(!l.length&&!d.length)g(x);else t.if(m(x),()=>g(x))})}function m(x){let _;if(l.length>8){let v=Wh.schemaRefOrVal(o,n.properties,"properties");_=Gh.isOwnProperty(t,v,x)}else if(l.length)_=Nn.or(...l.map((v)=>Nn._`${x} === ${v}`));else _=Nn.nil;if(d.length)_=Nn.or(_,...d.map((v)=>Nn._`${Gh.usePattern(e,v)}.test(${x})`));return Nn.not(_)}function p(x){t.code(Nn._`delete ${i}[${x}]`)}function g(x){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){p(x);return}if(r===!1){if(e.setParams({additionalProperty:x}),e.error(),!a)t.break();return}if(typeof r=="object"&&!Wh.alwaysValidSchema(o,r)){let _=t.name("valid");if(c.removeAdditional==="failing")y(x,_,!1),t.if(Nn.not(_),()=>{e.reset(),p(x)});else if(y(x,_),!a)t.if(Nn.not(_),()=>t.break())}}function y(x,_,v){let E={keyword:"additionalProperties",dataProp:x,dataPropType:Wh.Type.Str};if(v===!1)Object.assign(E,{compositeRule:!0,createErrors:!1,allErrors:!1});e.subschema(E,_)}}};xV.default=C8e});var wV=h(function(vV){Object.defineProperty(vV,"__esModule",{value:!0});var O8e=_d(),_V=cn(),G1=qe(),bV=H1(),A8e={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:n,data:i,it:s}=e;if(s.opts.removeAdditional==="all"&&n.additionalProperties===void 0)bV.default.code(new O8e.KeywordCxt(s,bV.default,"additionalProperties"));let o=_V.allSchemaProperties(r);for(let f of o)s.definedProperties.add(f);if(s.opts.unevaluated&&o.length&&s.props!==!0)s.props=G1.mergeEvaluated.props(t,G1.toHash(o),s.props);let a=o.filter((f)=>!G1.alwaysValidSchema(s,r[f]));if(a.length===0)return;let c=t.name("valid");for(let f of a){if(l(f))d(f);else{if(t.if(_V.propertyInData(t,i,f,s.opts.ownProperties)),d(f),!s.allErrors)t.else().var(c,!0);t.endIf()}e.it.definedProperties.add(f),e.ok(c)}function l(f){return s.opts.useDefaults&&!s.compositeRule&&r[f].default!==void 0}function d(f){e.subschema({keyword:"properties",schemaProp:f,dataProp:f},c)}}};vV.default=A8e});var CV=h(function($V){Object.defineProperty($V,"__esModule",{value:!0});var DV=cn(),Kh=be(),EV=qe(),SV=qe(),F8e={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:i,it:s}=e,{opts:o}=s,a=DV.allSchemaProperties(r),c=a.filter((y)=>EV.alwaysValidSchema(s,r[y]));if(a.length===0||c.length===a.length&&(!s.opts.unevaluated||s.props===!0))return;let l=o.strictSchema&&!o.allowMatchingProperties&&i.properties,d=t.name("valid");if(s.props!==!0&&!(s.props instanceof Kh.Name))s.props=SV.evaluatedPropsToName(t,s.props);let{props:f}=s;m();function m(){for(let y of a){if(l)p(y);if(s.allErrors)g(y);else t.var(d,!0),g(y),t.if(d)}}function p(y){for(let x in l)if(new RegExp(y).test(x))EV.checkStrictMode(s,`property ${x} matches pattern ${y} (use allowMatchingProperties)`)}function g(y){t.forIn("key",n,(x)=>{t.if(Kh._`${DV.usePattern(e,y)}.test(${x})`,()=>{let _=c.includes(y);if(!_)e.subschema({keyword:"patternProperties",schemaProp:y,dataProp:x,dataPropType:SV.Type.Str},d);if(s.opts.unevaluated&&f!==!0)t.assign(Kh._`${f}[${x}]`,!0);else if(!_&&!s.allErrors)t.if(Kh.not(d),()=>t.break())})})}}};$V.default=F8e});var OV=h(function(RV){Object.defineProperty(RV,"__esModule",{value:!0});var I8e=qe(),T8e={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if(I8e.alwaysValidSchema(n,r)){e.fail();return}let i=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),e.failResult(i,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};RV.default=T8e});var kV=h(function(AV){Object.defineProperty(AV,"__esModule",{value:!0});var q8e=cn(),j8e={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:q8e.validateUnion,error:{message:"must match a schema in anyOf"}};AV.default=j8e});var PV=h(function(FV){Object.defineProperty(FV,"__esModule",{value:!0});var Yh=be(),B8e=qe(),L8e={message:"must match exactly one schema in oneOf",params:({params:e})=>Yh._`{passingSchemas: ${e.passing}}`},U8e={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:L8e,code(e){let{gen:t,schema:r,parentSchema:n,it:i}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;let s=r,o=t.let("valid",!1),a=t.let("passing",null),c=t.name("_valid");e.setParams({passing:a}),t.block(l),e.result(o,()=>e.reset(),()=>e.error(!0));function l(){s.forEach((d,f)=>{let m;if(B8e.alwaysValidSchema(i,d))t.var(c,!0);else m=e.subschema({keyword:"oneOf",schemaProp:f,compositeRule:!0},c);if(f>0)t.if(Yh._`${c} && ${o}`).assign(o,!1).assign(a,Yh._`[${a}, ${f}]`).else();t.if(c,()=>{if(t.assign(o,!0),t.assign(a,f),m)e.mergeEvaluated(m,Yh.Name)})})}}};FV.default=U8e});var TV=h(function(IV){Object.defineProperty(IV,"__esModule",{value:!0});var z8e=qe(),H8e={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw Error("ajv implementation error");let i=t.name("valid");r.forEach((s,o)=>{if(z8e.alwaysValidSchema(n,s))return;let a=e.subschema({keyword:"allOf",schemaProp:o},i);e.ok(i),e.mergeEvaluated(a)})}};IV.default=H8e});var MV=h(function(jV){Object.defineProperty(jV,"__esModule",{value:!0});var Jh=be(),qV=qe(),W8e={message:({params:e})=>Jh.str`must match "${e.ifClause}" schema`,params:({params:e})=>Jh._`{failingKeyword: ${e.ifClause}}`},K8e={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:W8e,code(e){let{gen:t,parentSchema:r,it:n}=e;if(r.then===void 0&&r.else===void 0)qV.checkStrictMode(n,'"if" without "then" and "else" is ignored');let i=NV(n,"then"),s=NV(n,"else");if(!i&&!s)return;let o=t.let("valid",!0),a=t.name("_valid");if(c(),e.reset(),i&&s){let d=t.let("ifClause");e.setParams({ifClause:d}),t.if(a,l("then",d),l("else",d))}else if(i)t.if(a,l("then"));else t.if(Jh.not(a),l("else"));e.pass(o,()=>e.error(!0));function c(){let d=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(d)}function l(d,f){return()=>{let m=e.subschema({keyword:d},a);if(t.assign(o,a),e.mergeValidEvaluated(m,o),f)t.assign(f,Jh._`${d}`);else e.setParams({ifClause:d})}}}};function NV(e,t){let r=e.schema[t];return r!==void 0&&!qV.alwaysValidSchema(e,r)}jV.default=K8e});var LV=h(function(BV){Object.defineProperty(BV,"__esModule",{value:!0});var J8e=qe(),X8e={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){if(t.if===void 0)J8e.checkStrictMode(r,`"${e}" without "if" is ignored`)}};BV.default=X8e});var VV=h(function(UV){Object.defineProperty(UV,"__esModule",{value:!0});var Z8e=U1(),e4e=nV(),t4e=V1(),r4e=oV(),n4e=cV(),i4e=mV(),s4e=yV(),o4e=H1(),a4e=wV(),c4e=CV(),u4e=OV(),l4e=kV(),d4e=PV(),f4e=TV(),p4e=MV(),m4e=LV();function h4e(e=!1){let t=[u4e.default,l4e.default,d4e.default,f4e.default,p4e.default,m4e.default,s4e.default,o4e.default,i4e.default,a4e.default,c4e.default];if(e)t.push(e4e.default,r4e.default);else t.push(Z8e.default,t4e.default);return t.push(n4e.default),t}UV.default=h4e});var HV=h(function(zV){Object.defineProperty(zV,"__esModule",{value:!0});var vt=be(),y4e={message:({schemaCode:e})=>vt.str`must match format "${e}"`,params:({schemaCode:e})=>vt._`{format: ${e}}`},x4e={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:y4e,code(e,t){let{gen:r,data:n,$data:i,schema:s,schemaCode:o,it:a}=e,{opts:c,errSchemaPath:l,schemaEnv:d,self:f}=a;if(!c.validateFormats)return;if(i)m();else p();function m(){let g=r.scopeValue("formats",{ref:f.formats,code:c.code.formats}),y=r.const("fDef",vt._`${g}[${o}]`),x=r.let("fType"),_=r.let("format");r.if(vt._`typeof ${y} == "object" && !(${y} instanceof RegExp)`,()=>r.assign(x,vt._`${y}.type || "string"`).assign(_,vt._`${y}.validate`),()=>r.assign(x,vt._`"string"`).assign(_,y)),e.fail$data(vt.or(v(),E()));function v(){if(c.strictSchema===!1)return vt.nil;return vt._`${o} && !${_}`}function E(){let S=d.$async?vt._`(${y}.async ? await ${_}(${n}) : ${_}(${n}))`:vt._`${_}(${n})`,D=vt._`(typeof ${_} == "function" ? ${S} : ${_}.test(${n}))`;return vt._`${_} && ${_} !== true && ${x} === ${t} && !${D}`}}function p(){let g=f.formats[s];if(!g){v();return}if(g===!0)return;let[y,x,_]=E(g);if(y===t)e.pass(S());function v(){if(c.strictSchema===!1){f.logger.warn(D());return}throw Error(D());function D(){return`unknown format "${s}" ignored in schema at path "${l}"`}}function E(D){let k=D instanceof RegExp?vt.regexpCode(D):c.code.formats?vt._`${c.code.formats}${vt.getProperty(s)}`:void 0,C=r.scopeValue("formats",{key:s,ref:D,code:k});if(typeof D=="object"&&!(D instanceof RegExp))return[D.type||"string",D.validate,vt._`${C}.validate`];return["string",D,C]}function S(){if(typeof g=="object"&&!(g instanceof RegExp)&&g.async){if(!d.$async)throw Error("async format in sync schema");return vt._`await ${_}(${n})`}return typeof x=="function"?vt._`${_}(${n})`:vt._`${_}.test(${n})`}}}};zV.default=x4e});var WV=h(function(GV){Object.defineProperty(GV,"__esModule",{value:!0});var _4e=HV(),v4e=[_4e.default];GV.default=v4e});var JV=h(function(KV){Object.defineProperty(KV,"__esModule",{value:!0});KV.contentVocabulary=KV.metadataVocabulary=void 0;KV.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];KV.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var ZV=h(function(QV){Object.defineProperty(QV,"__esModule",{value:!0});var E4e=vU(),S4e=KU(),$4e=VV(),C4e=WV(),XV=JV(),R4e=[E4e.default,S4e.default,(0,$4e.default)(),C4e.default,XV.metadataVocabulary,XV.contentVocabulary];QV.default=R4e});var nz=h(function(tz){Object.defineProperty(tz,"__esModule",{value:!0});tz.DiscrError=void 0;var ez;(function(e){e.Tag="tag",e.Mapping="mapping"})(ez||(tz.DiscrError=ez={}))});var oz=h(function(sz){Object.defineProperty(sz,"__esModule",{value:!0});var Lc=be(),W1=nz(),iz=Th(),A4e=vd(),k4e=qe(),F4e={message:({params:{discrError:e,tagName:t}})=>e===W1.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>Lc._`{error: ${e}, tag: ${r}, tagValue: ${t}}`},P4e={keyword:"discriminator",type:"object",schemaType:"object",error:F4e,code(e){let{gen:t,data:r,schema:n,parentSchema:i,it:s}=e,{oneOf:o}=i;if(!s.opts.discriminator)throw Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw Error("discriminator: requires propertyName");if(n.mapping)throw Error("discriminator: mapping is not supported");if(!o)throw Error("discriminator: requires oneOf keyword");let c=t.let("valid",!1),l=t.const("tag",Lc._`${r}${Lc.getProperty(a)}`);t.if(Lc._`typeof ${l} == "string"`,()=>d(),()=>e.error(!1,{discrError:W1.DiscrError.Tag,tag:l,tagName:a})),e.ok(c);function d(){let p=m();t.if(!1);for(let g in p)t.elseIf(Lc._`${l} === ${g}`),t.assign(c,f(p[g]));t.else(),e.error(!1,{discrError:W1.DiscrError.Mapping,tag:l,tagName:a}),t.endIf()}function f(p){let g=t.name("valid"),y=e.subschema({keyword:"oneOf",schemaProp:p},g);return e.mergeEvaluated(y,Lc.Name),g}function m(){var p;let g={},y=_(i),x=!0;for(let S=0;S<o.length;S++){let D=o[S];if((D===null||D===void 0?void 0:D.$ref)&&!k4e.schemaHasRulesButRef(D,s.self.RULES)){let C=D.$ref;if(D=iz.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,C),D instanceof iz.SchemaEnv)D=D.schema;if(D===void 0)throw new A4e.default(s.opts.uriResolver,s.baseId,C)}let k=(p=D===null||D===void 0?void 0:D.properties)===null||p===void 0?void 0:p[a];if(typeof k!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);x=x&&(y||_(D)),v(k,S)}if(!x)throw Error(`discriminator: "${a}" must be required`);return g;function _({required:S}){return Array.isArray(S)&&S.includes(a)}function v(S,D){if(S.const)E(S.const,D);else if(S.enum)for(let k of S.enum)E(k,D);else throw Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function E(S,D){if(typeof S!="string"||S in g)throw Error(`discriminator: "${a}" values must be unique strings`);g[S]=D}}}};sz.default=P4e});var az=h(function(ost,T4e){T4e.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var uz=h(function(Pr,K1){Object.defineProperty(Pr,"__esModule",{value:!0});Pr.MissingRefError=Pr.ValidationError=Pr.CodeGen=Pr.Name=Pr.nil=Pr.stringify=Pr.str=Pr._=Pr.KeywordCxt=Pr.Ajv=void 0;var N4e=dU(),q4e=ZV(),j4e=oz(),cz=az(),M4e=["/properties"],Xh="http://json-schema.org/draft-07/schema";class Fd extends N4e.default{_addVocabularies(){if(super._addVocabularies(),q4e.default.forEach((e)=>this.addVocabulary(e)),this.opts.discriminator)this.addKeyword(j4e.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(cz,M4e):cz;this.addMetaSchema(e,Xh,!1),this.refs["http://json-schema.org/schema"]=Xh}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Xh)?Xh:void 0)}}Pr.Ajv=Fd;K1.exports=Pr=Fd;K1.exports.Ajv=Fd;Object.defineProperty(Pr,"__esModule",{value:!0});Pr.default=Fd;var B4e=_d();Object.defineProperty(Pr,"KeywordCxt",{enumerable:!0,get:function(){return B4e.KeywordCxt}});var Uc=be();Object.defineProperty(Pr,"_",{enumerable:!0,get:function(){return Uc._}});Object.defineProperty(Pr,"str",{enumerable:!0,get:function(){return Uc.str}});Object.defineProperty(Pr,"stringify",{enumerable:!0,get:function(){return Uc.stringify}});Object.defineProperty(Pr,"nil",{enumerable:!0,get:function(){return Uc.nil}});Object.defineProperty(Pr,"Name",{enumerable:!0,get:function(){return Uc.Name}});Object.defineProperty(Pr,"CodeGen",{enumerable:!0,get:function(){return Uc.CodeGen}});var L4e=Ph();Object.defineProperty(Pr,"ValidationError",{enumerable:!0,get:function(){return L4e.default}});var U4e=vd();Object.defineProperty(Pr,"MissingRefError",{enumerable:!0,get:function(){return U4e.default}})});var dz=h(function(lz){Object.defineProperty(lz,"__esModule",{value:!0});lz.formatLimitDefinition=void 0;var H4e=uz(),qn=be(),Zs=qn.operators,Qh={formatMaximum:{okStr:"<=",ok:Zs.LTE,fail:Zs.GT},formatMinimum:{okStr:">=",ok:Zs.GTE,fail:Zs.LT},formatExclusiveMaximum:{okStr:"<",ok:Zs.LT,fail:Zs.GTE},formatExclusiveMinimum:{okStr:">",ok:Zs.GT,fail:Zs.LTE}},G4e={message:({keyword:e,schemaCode:t})=>qn.str`should be ${Qh[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>qn._`{comparison: ${Qh[e].okStr}, limit: ${t}}`};lz.formatLimitDefinition={keyword:Object.keys(Qh),type:"string",schemaType:"string",$data:!0,error:G4e,code(e){let{gen:t,data:r,schemaCode:n,keyword:i,it:s}=e,{opts:o,self:a}=s;if(!o.validateFormats)return;let c=new H4e.KeywordCxt(s,a.RULES.all.format.definition,"format");if(c.$data)l();else d();function l(){let m=t.scopeValue("formats",{ref:a.formats,code:o.code.formats}),p=t.const("fmt",qn._`${m}[${c.schemaCode}]`);e.fail$data(qn.or(qn._`typeof ${p} != "object"`,qn._`${p} instanceof RegExp`,qn._`typeof ${p}.compare != "function"`,f(p)))}function d(){let m=c.schema,p=a.formats[m];if(!p||p===!0)return;if(typeof p!="object"||p instanceof RegExp||typeof p.compare!="function")throw Error(`"${i}": format "${m}" does not define "compare" function`);let g=t.scopeValue("formats",{key:m,ref:p,code:o.code.formats?qn._`${o.code.formats}${qn.getProperty(m)}`:void 0});e.fail$data(f(g))}function f(m){return qn._`${m}.compare(${r}, ${n}) ${Qh[i].fail} 0`}},dependencies:["format"]};var W4e=(e)=>(e.addKeyword(lz.formatLimitDefinition),e);lz.default=W4e});var hz=h(function(Pd,mz){Object.defineProperty(Pd,"__esModule",{value:!0});var Vc=uB(),Y4e=dz(),J1=be(),fz=new J1.Name("fullFormats"),J4e=new J1.Name("fastFormats"),X1=(e,t={keywords:!0})=>{if(Array.isArray(t))return pz(e,t,Vc.fullFormats,fz),e;let[r,n]=t.mode==="fast"?[Vc.fastFormats,J4e]:[Vc.fullFormats,fz],i=t.formats||Vc.formatNames;if(pz(e,i,r,n),t.keywords)(0,Y4e.default)(e);return e};X1.get=(e,t="full")=>{let n=(t==="fast"?Vc.fastFormats:Vc.fullFormats)[e];if(!n)throw Error(`Unknown format "${e}"`);return n};function pz(e,t,r,n){var i,s;(i=(s=e.opts.code).formats)!==null&&i!==void 0||(s.formats=J1._`require("ajv-formats/dist/formats").${n}`);for(let o of t)e.addFormat(o,r[o])}mz.exports=Pd=X1;Object.defineProperty(Pd,"__esModule",{value:!0});Pd.default=X1});var X4e=(e,t={})=>{if(typeof e!=="function")throw TypeError(`Expected the first argument to be a function, got \`${typeof e}\``);let{wait:r=0,maxWait:n=Number.POSITIVE_INFINITY,before:i=!1,after:s=!0}=t;if(r<0||n<0)throw RangeError("`wait` and `maxWait` must not be negative.");if(!i&&!s)throw Error("Both `before` and `after` are false, function wouldn't be called.");let o,a,c,l=function(...d){let f=this,m=()=>{if(o=void 0,a)clearTimeout(a),a=void 0;if(s)c=e.apply(f,d)},p=()=>{if(a=void 0,o)clearTimeout(o),o=void 0;if(s)c=e.apply(f,d)},g=i&&!o;if(clearTimeout(o),o=setTimeout(m,r),n>0&&n!==Number.POSITIVE_INFINITY&&!a)a=setTimeout(p,n);if(g)c=e.apply(f,d);return c};return xl(l,e),l.cancel=()=>{if(o)clearTimeout(o),o=void 0;if(a)clearTimeout(a),a=void 0},l},Q1;var gz=O(()=>{p_();Q1=X4e});var Id=h(function(xst,yz){var Q4e=Number.MAX_SAFE_INTEGER||9007199254740991,Z4e=["major","premajor","minor","preminor","patch","prepatch","prerelease"];yz.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Q4e,RELEASE_TYPES:Z4e,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Td=h(function(bst,xz){var e3e=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};xz.exports=e3e});var zc=h(function(yi,bz){var{MAX_SAFE_COMPONENT_LENGTH:Z1,MAX_SAFE_BUILD_LENGTH:t3e,MAX_LENGTH:r3e}=Id(),n3e=Td();yi=bz.exports={};var i3e=yi.re=[],s3e=yi.safeRe=[],z=yi.src=[],o3e=yi.safeSrc=[],H=yi.t={},a3e=0,ew="[a-zA-Z0-9-]",c3e=[["\\s",1],["\\d",r3e],[ew,t3e]],u3e=(e)=>{for(let[t,r]of c3e)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},le=(e,t,r)=>{let n=u3e(t),i=a3e++;n3e(e,i,t),H[e]=i,z[i]=t,o3e[i]=n,i3e[i]=new RegExp(t,r?"g":void 0),s3e[i]=new RegExp(n,r?"g":void 0)};le("NUMERICIDENTIFIER","0|[1-9]\\d*");le("NUMERICIDENTIFIERLOOSE","\\d+");le("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${ew}*`);le("MAINVERSION",`(${z[H.NUMERICIDENTIFIER]})\\.(${z[H.NUMERICIDENTIFIER]})\\.(${z[H.NUMERICIDENTIFIER]})`);le("MAINVERSIONLOOSE",`(${z[H.NUMERICIDENTIFIERLOOSE]})\\.(${z[H.NUMERICIDENTIFIERLOOSE]})\\.(${z[H.NUMERICIDENTIFIERLOOSE]})`);le("PRERELEASEIDENTIFIER",`(?:${z[H.NONNUMERICIDENTIFIER]}|${z[H.NUMERICIDENTIFIER]})`);le("PRERELEASEIDENTIFIERLOOSE",`(?:${z[H.NONNUMERICIDENTIFIER]}|${z[H.NUMERICIDENTIFIERLOOSE]})`);le("PRERELEASE",`(?:-(${z[H.PRERELEASEIDENTIFIER]}(?:\\.${z[H.PRERELEASEIDENTIFIER]})*))`);le("PRERELEASELOOSE",`(?:-?(${z[H.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${z[H.PRERELEASEIDENTIFIERLOOSE]})*))`);le("BUILDIDENTIFIER",`${ew}+`);le("BUILD",`(?:\\+(${z[H.BUILDIDENTIFIER]}(?:\\.${z[H.BUILDIDENTIFIER]})*))`);le("FULLPLAIN",`v?${z[H.MAINVERSION]}${z[H.PRERELEASE]}?${z[H.BUILD]}?`);le("FULL",`^${z[H.FULLPLAIN]}$`);le("LOOSEPLAIN",`[v=\\s]*${z[H.MAINVERSIONLOOSE]}${z[H.PRERELEASELOOSE]}?${z[H.BUILD]}?`);le("LOOSE",`^${z[H.LOOSEPLAIN]}$`);le("GTLT","((?:<|>)?=?)");le("XRANGEIDENTIFIERLOOSE",`${z[H.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);le("XRANGEIDENTIFIER",`${z[H.NUMERICIDENTIFIER]}|x|X|\\*`);le("XRANGEPLAIN",`[v=\\s]*(${z[H.XRANGEIDENTIFIER]})(?:\\.(${z[H.XRANGEIDENTIFIER]})(?:\\.(${z[H.XRANGEIDENTIFIER]})(?:${z[H.PRERELEASE]})?${z[H.BUILD]}?)?)?`);le("XRANGEPLAINLOOSE",`[v=\\s]*(${z[H.XRANGEIDENTIFIERLOOSE]})(?:\\.(${z[H.XRANGEIDENTIFIERLOOSE]})(?:\\.(${z[H.XRANGEIDENTIFIERLOOSE]})(?:${z[H.PRERELEASELOOSE]})?${z[H.BUILD]}?)?)?`);le("XRANGE",`^${z[H.GTLT]}\\s*${z[H.XRANGEPLAIN]}$`);le("XRANGELOOSE",`^${z[H.GTLT]}\\s*${z[H.XRANGEPLAINLOOSE]}$`);le("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Z1}})(?:\\.(\\d{1,${Z1}}))?(?:\\.(\\d{1,${Z1}}))?`);le("COERCE",`${z[H.COERCEPLAIN]}(?:$|[^\\d])`);le("COERCEFULL",z[H.COERCEPLAIN]+`(?:${z[H.PRERELEASE]})?(?:${z[H.BUILD]})?(?:$|[^\\d])`);le("COERCERTL",z[H.COERCE],!0);le("COERCERTLFULL",z[H.COERCEFULL],!0);le("LONETILDE","(?:~>?)");le("TILDETRIM",`(\\s*)${z[H.LONETILDE]}\\s+`,!0);yi.tildeTrimReplace="$1~";le("TILDE",`^${z[H.LONETILDE]}${z[H.XRANGEPLAIN]}$`);le("TILDELOOSE",`^${z[H.LONETILDE]}${z[H.XRANGEPLAINLOOSE]}$`);le("LONECARET","(?:\\^)");le("CARETTRIM",`(\\s*)${z[H.LONECARET]}\\s+`,!0);yi.caretTrimReplace="$1^";le("CARET",`^${z[H.LONECARET]}${z[H.XRANGEPLAIN]}$`);le("CARETLOOSE",`^${z[H.LONECARET]}${z[H.XRANGEPLAINLOOSE]}$`);le("COMPARATORLOOSE",`^${z[H.GTLT]}\\s*(${z[H.LOOSEPLAIN]})$|^$`);le("COMPARATOR",`^${z[H.GTLT]}\\s*(${z[H.FULLPLAIN]})$|^$`);le("COMPARATORTRIM",`(\\s*)${z[H.GTLT]}\\s*(${z[H.LOOSEPLAIN]}|${z[H.XRANGEPLAIN]})`,!0);yi.comparatorTrimReplace="$1$2$3";le("HYPHENRANGE",`^\\s*(${z[H.XRANGEPLAIN]})\\s+-\\s+(${z[H.XRANGEPLAIN]})\\s*$`);le("HYPHENRANGELOOSE",`^\\s*(${z[H.XRANGEPLAINLOOSE]})\\s+-\\s+(${z[H.XRANGEPLAINLOOSE]})\\s*$`);le("STAR","(<|>)?=?\\s*\\*");le("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");le("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Zh=h(function(_st,_z){var l3e=Object.freeze({loose:!0}),d3e=Object.freeze({}),f3e=(e)=>{if(!e)return d3e;if(typeof e!=="object")return l3e;return e};_z.exports=f3e});var tw=h(function(vst,Dz){var vz=/^[0-9]+$/,wz=(e,t)=>{if(typeof e==="number"&&typeof t==="number")return e===t?0:e<t?-1:1;let r=vz.test(e),n=vz.test(t);if(r&&n)e=+e,t=+t;return e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},p3e=(e,t)=>wz(t,e);Dz.exports={compareIdentifiers:wz,rcompareIdentifiers:p3e}});var Qt=h(function(wst,Sz){var e0=Td(),{MAX_LENGTH:Ez,MAX_SAFE_INTEGER:t0}=Id(),{safeRe:r0,t:n0}=zc(),m3e=Zh(),{compareIdentifiers:rw}=tw();class jn{constructor(e,t){if(t=m3e(t),e instanceof jn)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else e=e.version;else if(typeof e!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>Ez)throw TypeError(`version is longer than ${Ez} characters`);e0("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?r0[n0.LOOSE]:r0[n0.FULL]);if(!r)throw TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>t0||this.major<0)throw TypeError("Invalid major version");if(this.minor>t0||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>t0||this.patch<0)throw TypeError("Invalid patch version");if(!r[4])this.prerelease=[];else this.prerelease=r[4].split(".").map((n)=>{if(/^[0-9]+$/.test(n)){let i=+n;if(i>=0&&i<t0)return i}return n});this.build=r[5]?r[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare(e){if(e0("SemVer.compare",this.version,this.options,e),!(e instanceof jn)){if(typeof e==="string"&&e===this.version)return 0;e=new jn(e,this.options)}if(e.version===this.version)return 0;return this.compareMain(e)||this.comparePre(e)}compareMain(e){if(!(e instanceof jn))e=new jn(e,this.options);if(this.major<e.major)return-1;if(this.major>e.major)return 1;if(this.minor<e.minor)return-1;if(this.minor>e.minor)return 1;if(this.patch<e.patch)return-1;if(this.patch>e.patch)return 1;return 0}comparePre(e){if(!(e instanceof jn))e=new jn(e,this.options);if(this.prerelease.length&&!e.prerelease.length)return-1;else if(!this.prerelease.length&&e.prerelease.length)return 1;else if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],n=e.prerelease[t];if(e0("prerelease compare",t,r,n),r===void 0&&n===void 0)return 0;else if(n===void 0)return 1;else if(r===void 0)return-1;else if(r===n)continue;else return rw(r,n)}while(++t)}compareBuild(e){if(!(e instanceof jn))e=new jn(e,this.options);let t=0;do{let r=this.build[t],n=e.build[t];if(e0("build compare",t,r,n),r===void 0&&n===void 0)return 0;else if(n===void 0)return 1;else if(r===void 0)return-1;else if(r===n)continue;else return rw(r,n)}while(++t)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&r===!1)throw Error("invalid increment argument: identifier is empty");if(t){let n=`-${t}`.match(this.options.loose?r0[n0.PRERELEASELOOSE]:r0[n0.PRERELEASE]);if(!n||n[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",t,r);this.inc("pre",t,r);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let n=Number(r)?1:0;if(this.prerelease.length===0)this.prerelease=[n];else{let i=this.prerelease.length;while(--i>=0)if(typeof this.prerelease[i]==="number")this.prerelease[i]++,i=-2;if(i===-1){if(t===this.prerelease.join(".")&&r===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(n)}}if(t){let i=[t,n];if(r===!1)i=[t];if(rw(this.prerelease[0],t)===0){if(isNaN(this.prerelease[1]))this.prerelease=i}else this.prerelease=i}break}default:throw Error(`invalid increment argument: ${e}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}Sz.exports=jn});var Jo=h(function(Dst,Cz){var $z=Qt(),h3e=(e,t,r=!1)=>{if(e instanceof $z)return e;try{return new $z(e,t)}catch(n){if(!r)return null;throw n}};Cz.exports=h3e});var Oz=h(function(Est,Rz){var g3e=Jo(),y3e=(e,t)=>{let r=g3e(e,t);return r?r.version:null};Rz.exports=y3e});var kz=h(function(Sst,Az){var x3e=Jo(),b3e=(e,t)=>{let r=x3e(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};Az.exports=b3e});var Iz=h(function($st,Pz){var Fz=Qt(),_3e=(e,t,r,n,i)=>{if(typeof r==="string")i=n,n=r,r=void 0;try{return new Fz(e instanceof Fz?e.version:e,r).inc(t,n,i).version}catch(s){return null}};Pz.exports=_3e});var qz=h(function(Cst,Nz){var Tz=Jo(),v3e=(e,t)=>{let r=Tz(e,null,!0),n=Tz(t,null,!0),i=r.compare(n);if(i===0)return null;let s=i>0,o=s?r:n,a=s?n:r,c=!!o.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(o)===0){if(a.minor&&!a.patch)return"minor";return"patch"}}let d=c?"pre":"";if(r.major!==n.major)return d+"major";if(r.minor!==n.minor)return d+"minor";if(r.patch!==n.patch)return d+"patch";return"prerelease"};Nz.exports=v3e});var Mz=h(function(Rst,jz){var w3e=Qt(),D3e=(e,t)=>new w3e(e,t).major;jz.exports=D3e});var Lz=h(function(Ost,Bz){var E3e=Qt(),S3e=(e,t)=>new E3e(e,t).minor;Bz.exports=S3e});var Vz=h(function(Ast,Uz){var $3e=Qt(),C3e=(e,t)=>new $3e(e,t).patch;Uz.exports=C3e});var Hz=h(function(kst,zz){var R3e=Jo(),O3e=(e,t)=>{let r=R3e(e,t);return r&&r.prerelease.length?r.prerelease:null};zz.exports=O3e});var ln=h(function(Fst,Wz){var Gz=Qt(),A3e=(e,t,r)=>new Gz(e,r).compare(new Gz(t,r));Wz.exports=A3e});var Yz=h(function(Pst,Kz){var k3e=ln(),F3e=(e,t,r)=>k3e(t,e,r);Kz.exports=F3e});var Xz=h(function(Ist,Jz){var P3e=ln(),I3e=(e,t)=>P3e(e,t,!0);Jz.exports=I3e});var i0=h(function(Tst,Zz){var Qz=Qt(),T3e=(e,t,r)=>{let n=new Qz(e,r),i=new Qz(t,r);return n.compare(i)||n.compareBuild(i)};Zz.exports=T3e});var tH=h(function(Nst,eH){var N3e=i0(),q3e=(e,t)=>e.sort((r,n)=>N3e(r,n,t));eH.exports=q3e});var nH=h(function(qst,rH){var j3e=i0(),M3e=(e,t)=>e.sort((r,n)=>j3e(n,r,t));rH.exports=M3e});var Nd=h(function(jst,iH){var B3e=ln(),L3e=(e,t,r)=>B3e(e,t,r)>0;iH.exports=L3e});var s0=h(function(Mst,sH){var U3e=ln(),V3e=(e,t,r)=>U3e(e,t,r)<0;sH.exports=V3e});var nw=h(function(Bst,oH){var z3e=ln(),H3e=(e,t,r)=>z3e(e,t,r)===0;oH.exports=H3e});var iw=h(function(Lst,aH){var G3e=ln(),W3e=(e,t,r)=>G3e(e,t,r)!==0;aH.exports=W3e});var o0=h(function(Ust,cH){var K3e=ln(),Y3e=(e,t,r)=>K3e(e,t,r)>=0;cH.exports=Y3e});var a0=h(function(Vst,uH){var J3e=ln(),X3e=(e,t,r)=>J3e(e,t,r)<=0;uH.exports=X3e});var sw=h(function(zst,lH){var Q3e=nw(),Z3e=iw(),e5e=Nd(),t5e=o0(),r5e=s0(),n5e=a0(),i5e=(e,t,r,n)=>{switch(t){case"===":if(typeof e==="object")e=e.version;if(typeof r==="object")r=r.version;return e===r;case"!==":if(typeof e==="object")e=e.version;if(typeof r==="object")r=r.version;return e!==r;case"":case"=":case"==":return Q3e(e,r,n);case"!=":return Z3e(e,r,n);case">":return e5e(e,r,n);case">=":return t5e(e,r,n);case"<":return r5e(e,r,n);case"<=":return n5e(e,r,n);default:throw TypeError(`Invalid operator: ${t}`)}};lH.exports=i5e});var fH=h(function(Hst,dH){var s5e=Qt(),o5e=Jo(),{safeRe:c0,t:u0}=zc(),a5e=(e,t)=>{if(e instanceof s5e)return e;if(typeof e==="number")e=String(e);if(typeof e!=="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?c0[u0.COERCEFULL]:c0[u0.COERCE]);else{let c=t.includePrerelease?c0[u0.COERCERTLFULL]:c0[u0.COERCERTL],l;while((l=c.exec(e))&&(!r||r.index+r[0].length!==e.length)){if(!r||l.index+l[0].length!==r.index+r[0].length)r=l;c.lastIndex=l.index+l[1].length+l[2].length}c.lastIndex=-1}if(r===null)return null;let n=r[2],i=r[3]||"0",s=r[4]||"0",o=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return o5e(`${n}.${i}.${s}${o}${a}`,t)};dH.exports=a5e});var hH=h(function(Gst,mH){class pH{constructor(){this.max=1000,this.map=new Map}get(e){let t=this.map.get(e);if(t===void 0)return;else return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let n=this.map.keys().next().value;this.delete(n)}this.map.set(e,t)}return this}}mH.exports=pH});var dn=h(function(Wst,bH){var c5e=/\s+/g;class qd{constructor(e,t){if(t=l5e(t),e instanceof qd)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else return new qd(e.raw,t);if(e instanceof ow)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(c5e," "),this.set=this.raw.split("||").map((r)=>this.parseRange(r.trim())).filter((r)=>r.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter((n)=>!yH(n[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let n of this.set)if(n.length===1&&y5e(n[0])){this.set=[n];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){if(e>0)this.formatted+="||";let t=this.set[e];for(let r=0;r<t.length;r++){if(r>0)this.formatted+=" ";this.formatted+=t[r].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let r=((this.options.includePrerelease&&h5e)|(this.options.loose&&g5e))+":"+e,n=gH.get(r);if(n)return n;let i=this.options.loose,s=i?fr[Zt.HYPHENRANGELOOSE]:fr[Zt.HYPHENRANGE];e=e.replace(s,C5e(this.options.includePrerelease)),st("hyphen replace",e),e=e.replace(fr[Zt.COMPARATORTRIM],f5e),st("comparator trim",e),e=e.replace(fr[Zt.TILDETRIM],p5e),st("tilde trim",e),e=e.replace(fr[Zt.CARETTRIM],m5e),st("caret trim",e);let o=e.split(" ").map((d)=>x5e(d,this.options)).join(" ").split(/\s+/).map((d)=>$5e(d,this.options));if(i)o=o.filter((d)=>(st("loose invalid filter",d,this.options),!!d.match(fr[Zt.COMPARATORLOOSE])));st("range list",o);let a=new Map,c=o.map((d)=>new ow(d,this.options));for(let d of c){if(yH(d))return[d];a.set(d.value,d)}if(a.size>1&&a.has(""))a.delete("");let l=[...a.values()];return gH.set(r,l),l}intersects(e,t){if(!(e instanceof qd))throw TypeError("a Range is required");return this.set.some((r)=>xH(r,t)&&e.set.some((n)=>xH(n,t)&&r.every((i)=>n.every((s)=>i.intersects(s,t)))))}test(e){if(!e)return!1;if(typeof e==="string")try{e=new d5e(e,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if(R5e(this.set[t],e,this.options))return!0;return!1}}bH.exports=qd;var u5e=hH(),gH=new u5e,l5e=Zh(),ow=jd(),st=Td(),d5e=Qt(),{safeRe:fr,t:Zt,comparatorTrimReplace:f5e,tildeTrimReplace:p5e,caretTrimReplace:m5e}=zc(),{FLAG_INCLUDE_PRERELEASE:h5e,FLAG_LOOSE:g5e}=Id(),yH=(e)=>e.value==="<0.0.0-0",y5e=(e)=>e.value==="",xH=(e,t)=>{let r=!0,n=e.slice(),i=n.pop();while(r&&n.length)r=n.every((s)=>i.intersects(s,t)),i=n.pop();return r},x5e=(e,t)=>(e=e.replace(fr[Zt.BUILD],""),st("comp",e,t),e=v5e(e,t),st("caret",e),e=b5e(e,t),st("tildes",e),e=D5e(e,t),st("xrange",e),e=S5e(e,t),st("stars",e),e),pr=(e)=>!e||e.toLowerCase()==="x"||e==="*",b5e=(e,t)=>e.trim().split(/\s+/).map((r)=>_5e(r,t)).join(" "),_5e=(e,t)=>{let r=t.loose?fr[Zt.TILDELOOSE]:fr[Zt.TILDE];return e.replace(r,(n,i,s,o,a)=>{st("tilde",e,n,i,s,o,a);let c;if(pr(i))c="";else if(pr(s))c=`>=${i}.0.0 <${+i+1}.0.0-0`;else if(pr(o))c=`>=${i}.${s}.0 <${i}.${+s+1}.0-0`;else if(a)st("replaceTilde pr",a),c=`>=${i}.${s}.${o}-${a} <${i}.${+s+1}.0-0`;else c=`>=${i}.${s}.${o} <${i}.${+s+1}.0-0`;return st("tilde return",c),c})},v5e=(e,t)=>e.trim().split(/\s+/).map((r)=>w5e(r,t)).join(" "),w5e=(e,t)=>{st("caret",e,t);let r=t.loose?fr[Zt.CARETLOOSE]:fr[Zt.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(i,s,o,a,c)=>{st("caret",e,i,s,o,a,c);let l;if(pr(s))l="";else if(pr(o))l=`>=${s}.0.0${n} <${+s+1}.0.0-0`;else if(pr(a))if(s==="0")l=`>=${s}.${o}.0${n} <${s}.${+o+1}.0-0`;else l=`>=${s}.${o}.0${n} <${+s+1}.0.0-0`;else if(c)if(st("replaceCaret pr",c),s==="0")if(o==="0")l=`>=${s}.${o}.${a}-${c} <${s}.${o}.${+a+1}-0`;else l=`>=${s}.${o}.${a}-${c} <${s}.${+o+1}.0-0`;else l=`>=${s}.${o}.${a}-${c} <${+s+1}.0.0-0`;else if(st("no pr"),s==="0")if(o==="0")l=`>=${s}.${o}.${a}${n} <${s}.${o}.${+a+1}-0`;else l=`>=${s}.${o}.${a}${n} <${s}.${+o+1}.0-0`;else l=`>=${s}.${o}.${a} <${+s+1}.0.0-0`;return st("caret return",l),l})},D5e=(e,t)=>(st("replaceXRanges",e,t),e.split(/\s+/).map((r)=>E5e(r,t)).join(" ")),E5e=(e,t)=>{e=e.trim();let r=t.loose?fr[Zt.XRANGELOOSE]:fr[Zt.XRANGE];return e.replace(r,(n,i,s,o,a,c)=>{st("xRange",e,n,i,s,o,a,c);let l=pr(s),d=l||pr(o),f=d||pr(a),m=f;if(i==="="&&m)i="";if(c=t.includePrerelease?"-0":"",l)if(i===">"||i==="<")n="<0.0.0-0";else n="*";else if(i&&m){if(d)o=0;if(a=0,i===">")if(i=">=",d)s=+s+1,o=0,a=0;else o=+o+1,a=0;else if(i==="<=")if(i="<",d)s=+s+1;else o=+o+1;if(i==="<")c="-0";n=`${i+s}.${o}.${a}${c}`}else if(d)n=`>=${s}.0.0${c} <${+s+1}.0.0-0`;else if(f)n=`>=${s}.${o}.0${c} <${s}.${+o+1}.0-0`;return st("xRange return",n),n})},S5e=(e,t)=>(st("replaceStars",e,t),e.trim().replace(fr[Zt.STAR],"")),$5e=(e,t)=>(st("replaceGTE0",e,t),e.trim().replace(fr[t.includePrerelease?Zt.GTE0PRE:Zt.GTE0],"")),C5e=(e)=>(t,r,n,i,s,o,a,c,l,d,f,m)=>{if(pr(n))r="";else if(pr(i))r=`>=${n}.0.0${e?"-0":""}`;else if(pr(s))r=`>=${n}.${i}.0${e?"-0":""}`;else if(o)r=`>=${r}`;else r=`>=${r}${e?"-0":""}`;if(pr(l))c="";else if(pr(d))c=`<${+l+1}.0.0-0`;else if(pr(f))c=`<${l}.${+d+1}.0-0`;else if(m)c=`<=${l}.${d}.${f}-${m}`;else if(e)c=`<${l}.${d}.${+f+1}-0`;else c=`<=${c}`;return`${r} ${c}`.trim()},R5e=(e,t,r)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let n=0;n<e.length;n++){if(st(e[n].semver),e[n].semver===ow.ANY)continue;if(e[n].semver.prerelease.length>0){let i=e[n].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}}return!1}return!0}});var jd=h(function(Kst,SH){var Md=Symbol("SemVer ANY");class l0{static get ANY(){return Md}constructor(e,t){if(t=_H(t),e instanceof l0)if(e.loose===!!t.loose)return e;else e=e.value;if(e=e.trim().split(/\s+/).join(" "),cw("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===Md)this.value="";else this.value=this.operator+this.semver.version;cw("comp",this)}parse(e){let t=this.options.loose?vH[wH.COMPARATORLOOSE]:vH[wH.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);if(this.operator=r[1]!==void 0?r[1]:"",this.operator==="=")this.operator="";if(!r[2])this.semver=Md;else this.semver=new DH(r[2],this.options.loose)}toString(){return this.value}test(e){if(cw("Comparator.test",e,this.options.loose),this.semver===Md||e===Md)return!0;if(typeof e==="string")try{e=new DH(e,this.options)}catch(t){return!1}return aw(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof l0))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new EH(e.value,t).test(this.value)}else if(e.operator===""){if(e.value==="")return!0;return new EH(this.value,t).test(e.semver)}if(t=_H(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0"))return!1;if(!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&e.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&e.operator.startsWith("<"))return!0;if(this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("="))return!0;if(aw(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))return!0;if(aw(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"))return!0;return!1}}SH.exports=l0;var _H=Zh(),{safeRe:vH,t:wH}=zc(),aw=sw(),cw=Td(),DH=Qt(),EH=dn()});var Bd=h(function(Yst,$H){var O5e=dn(),A5e=(e,t,r)=>{try{t=new O5e(t,r)}catch(n){return!1}return t.test(e)};$H.exports=A5e});var RH=h(function(Jst,CH){var k5e=dn(),F5e=(e,t)=>new k5e(e,t).set.map((r)=>r.map((n)=>n.value).join(" ").trim().split(" "));CH.exports=F5e});var AH=h(function(Xst,OH){var P5e=Qt(),I5e=dn(),T5e=(e,t,r)=>{let n=null,i=null,s=null;try{s=new I5e(t,r)}catch(o){return null}return e.forEach((o)=>{if(s.test(o)){if(!n||i.compare(o)===-1)n=o,i=new P5e(n,r)}}),n};OH.exports=T5e});var FH=h(function(Qst,kH){var N5e=Qt(),q5e=dn(),j5e=(e,t,r)=>{let n=null,i=null,s=null;try{s=new q5e(t,r)}catch(o){return null}return e.forEach((o)=>{if(s.test(o)){if(!n||i.compare(o)===1)n=o,i=new N5e(n,r)}}),n};kH.exports=j5e});var TH=h(function(Zst,IH){var uw=Qt(),M5e=dn(),PH=Nd(),B5e=(e,t)=>{e=new M5e(e,t);let r=new uw("0.0.0");if(e.test(r))return r;if(r=new uw("0.0.0-0"),e.test(r))return r;r=null;for(let n=0;n<e.set.length;++n){let i=e.set[n],s=null;if(i.forEach((o)=>{let a=new uw(o.semver.version);switch(o.operator){case">":if(a.prerelease.length===0)a.patch++;else a.prerelease.push(0);a.raw=a.format();case"":case">=":if(!s||PH(a,s))s=a;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${o.operator}`)}}),s&&(!r||PH(r,s)))r=s}if(r&&e.test(r))return r;return null};IH.exports=B5e});var qH=h(function(eot,NH){var L5e=dn(),U5e=(e,t)=>{try{return new L5e(e,t).range||"*"}catch(r){return null}};NH.exports=U5e});var d0=h(function(tot,LH){var V5e=Qt(),BH=jd(),{ANY:z5e}=BH,H5e=dn(),G5e=Bd(),jH=Nd(),MH=s0(),W5e=a0(),K5e=o0(),Y5e=(e,t,r,n)=>{e=new V5e(e,n),t=new H5e(t,n);let i,s,o,a,c;switch(r){case">":i=jH,s=W5e,o=MH,a=">",c=">=";break;case"<":i=MH,s=K5e,o=jH,a="<",c="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(G5e(e,t,n))return!1;for(let l=0;l<t.set.length;++l){let d=t.set[l],f=null,m=null;if(d.forEach((p)=>{if(p.semver===z5e)p=new BH(">=0.0.0");if(f=f||p,m=m||p,i(p.semver,f.semver,n))f=p;else if(o(p.semver,m.semver,n))m=p}),f.operator===a||f.operator===c)return!1;if((!m.operator||m.operator===a)&&s(e,m.semver))return!1;else if(m.operator===c&&o(e,m.semver))return!1}return!0};LH.exports=Y5e});var VH=h(function(rot,UH){var J5e=d0(),X5e=(e,t,r)=>J5e(e,t,">",r);UH.exports=X5e});var HH=h(function(not,zH){var Q5e=d0(),Z5e=(e,t,r)=>Q5e(e,t,"<",r);zH.exports=Z5e});var KH=h(function(iot,WH){var GH=dn(),eNe=(e,t,r)=>(e=new GH(e,r),t=new GH(t,r),e.intersects(t,r));WH.exports=eNe});var JH=h(function(sot,YH){var tNe=Bd(),rNe=ln();YH.exports=(e,t,r)=>{let n=[],i=null,s=null,o=e.sort((d,f)=>rNe(d,f,r));for(let d of o)if(tNe(d,t,r)){if(s=d,!i)i=d}else{if(s)n.push([i,s]);s=null,i=null}if(i)n.push([i,null]);let a=[];for(let[d,f]of n)if(d===f)a.push(d);else if(!f&&d===o[0])a.push("*");else if(!f)a.push(`>=${d}`);else if(d===o[0])a.push(`<=${f}`);else a.push(`${d} - ${f}`);let c=a.join(" || "),l=typeof t.raw==="string"?t.raw:String(t);return c.length<l.length?c:t}});var rG=h(function(oot,tG){var XH=dn(),dw=jd(),{ANY:lw}=dw,Ld=Bd(),fw=ln(),nNe=(e,t,r={})=>{if(e===t)return!0;e=new XH(e,r),t=new XH(t,r);let n=!1;e:for(let i of e.set){for(let s of t.set){let o=sNe(i,s,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},iNe=[new dw(">=0.0.0-0")],QH=[new dw(">=0.0.0")],sNe=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===lw)if(t.length===1&&t[0].semver===lw)return!0;else if(r.includePrerelease)e=iNe;else e=QH;if(t.length===1&&t[0].semver===lw)if(r.includePrerelease)return!0;else t=QH;let n=new Set,i,s;for(let p of e)if(p.operator===">"||p.operator===">=")i=ZH(i,p,r);else if(p.operator==="<"||p.operator==="<=")s=eG(s,p,r);else n.add(p.semver);if(n.size>1)return null;let o;if(i&&s){if(o=fw(i.semver,s.semver,r),o>0)return null;else if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(let p of n){if(i&&!Ld(p,String(i),r))return null;if(s&&!Ld(p,String(s),r))return null;for(let g of t)if(!Ld(p,String(g),r))return!1;return!0}let a,c,l,d,f=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,m=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;if(f&&f.prerelease.length===1&&s.operator==="<"&&f.prerelease[0]===0)f=!1;for(let p of t){if(d=d||p.operator===">"||p.operator===">=",l=l||p.operator==="<"||p.operator==="<=",i){if(m){if(p.semver.prerelease&&p.semver.prerelease.length&&p.semver.major===m.major&&p.semver.minor===m.minor&&p.semver.patch===m.patch)m=!1}if(p.operator===">"||p.operator===">="){if(a=ZH(i,p,r),a===p&&a!==i)return!1}else if(i.operator===">="&&!Ld(i.semver,String(p),r))return!1}if(s){if(f){if(p.semver.prerelease&&p.semver.prerelease.length&&p.semver.major===f.major&&p.semver.minor===f.minor&&p.semver.patch===f.patch)f=!1}if(p.operator==="<"||p.operator==="<="){if(c=eG(s,p,r),c===p&&c!==s)return!1}else if(s.operator==="<="&&!Ld(s.semver,String(p),r))return!1}if(!p.operator&&(s||i)&&o!==0)return!1}if(i&&l&&!s&&o!==0)return!1;if(s&&d&&!i&&o!==0)return!1;if(m||f)return!1;return!0},ZH=(e,t,r)=>{if(!e)return t;let n=fw(e.semver,t.semver,r);return n>0?e:n<0?t:t.operator===">"&&e.operator===">="?t:e},eG=(e,t,r)=>{if(!e)return t;let n=fw(e.semver,t.semver,r);return n<0?e:n>0?t:t.operator==="<"&&e.operator==="<="?t:e};tG.exports=nNe});var oG=h(function(aot,sG){var pw=zc(),nG=Id(),oNe=Qt(),iG=tw(),aNe=Jo(),cNe=Oz(),uNe=kz(),lNe=Iz(),dNe=qz(),fNe=Mz(),pNe=Lz(),mNe=Vz(),hNe=Hz(),gNe=ln(),yNe=Yz(),xNe=Xz(),bNe=i0(),_Ne=tH(),vNe=nH(),wNe=Nd(),DNe=s0(),ENe=nw(),SNe=iw(),$Ne=o0(),CNe=a0(),RNe=sw(),ONe=fH(),ANe=jd(),kNe=dn(),FNe=Bd(),PNe=RH(),INe=AH(),TNe=FH(),NNe=TH(),qNe=qH(),jNe=d0(),MNe=VH(),BNe=HH(),LNe=KH(),UNe=JH(),VNe=rG();sG.exports={parse:aNe,valid:cNe,clean:uNe,inc:lNe,diff:dNe,major:fNe,minor:pNe,patch:mNe,prerelease:hNe,compare:gNe,rcompare:yNe,compareLoose:xNe,compareBuild:bNe,sort:_Ne,rsort:vNe,gt:wNe,lt:DNe,eq:ENe,neq:SNe,gte:$Ne,lte:CNe,cmp:RNe,coerce:ONe,Comparator:ANe,Range:kNe,satisfies:FNe,toComparators:PNe,maxSatisfying:INe,minSatisfying:TNe,minVersion:NNe,validRange:qNe,outside:jNe,gtr:MNe,ltr:BNe,intersects:LNe,simplifyRange:UNe,subset:VNe,SemVer:oNe,re:pw.re,src:pw.src,tokens:pw.t,SEMVER_SPEC_VERSION:nG.SEMVER_SPEC_VERSION,RELEASE_TYPES:nG.RELEASE_TYPES,compareIdentifiers:iG.compareIdentifiers,rcompareIdentifiers:iG.rcompareIdentifiers}});function cG(e,t,r){if(!e)return!1;if(e.constructor===t)return!0;return zNe.call(e)===r}function uG(e){return cG(e,Uint8Array,"[object Uint8Array]")}function HNe(e){return cG(e,ArrayBuffer,"[object ArrayBuffer]")}function GNe(e){return uG(e)||HNe(e)}function WNe(e){if(!uG(e))throw TypeError(`Expected \`Uint8Array\`, got \`${typeof e}\``)}function KNe(e){if(!GNe(e))throw TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``)}function mw(e,t){if(e.length===0)return new Uint8Array(0);t??=e.reduce((i,s)=>i+s.length,0);let r=new Uint8Array(t),n=0;for(let i of e)WNe(i),r.set(i,n),n+=i.length;return r}function hw(e,t="utf8"){return KNe(e),aG[t]??=new globalThis.TextDecoder(t),aG[t].decode(e)}function YNe(e){if(typeof e!=="string")throw TypeError(`Expected \`string\`, got \`${typeof e}\``)}function f0(e){return YNe(e),JNe.encode(e)}var zNe,aG,JNe,cot;var lG=O(()=>{zNe=Object.prototype.toString;aG={utf8:new globalThis.TextDecoder("utf8")};JNe=new globalThis.TextEncoder;cot=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"))});import{isDeepStrictEqual as XNe}from"util";import dG from"process";import Xo from"fs";import fG from"path";import Ud from"crypto";import QNe from"assert";var mG,hG,Qo,ZNe,pG="aes-256-cbc",Hc=()=>Object.create(null),eqe=(e)=>e!==void 0&&e!==null,tqe=(e,t)=>{let r=new Set(["undefined","symbol","function"]),n=typeof t;if(r.has(n))throw TypeError(`Setting a value of type \`${n}\` for key \`${e}\` is not allowed as it's not supported by JSON`)},p0="__internal__",gw,m0;var gG=O(()=>{EN();$N();rq();gz();lG();mG=ce(ZM(),1),hG=ce(hz(),1),Qo=ce(oG(),1),ZNe=hG.default.default,gw=`${p0}.migrations.version`;m0=class m0{path;events;#r;#t;#e;#i={};constructor(e={}){let t={configName:"config",fileExtension:"json",projectSuffix:"nodejs",clearInvalidConfig:!1,accessPropertiesByDotNotation:!0,configFileMode:438,...e};if(!t.cwd){if(!t.projectName)throw Error("Please specify the `projectName` option.");t.cwd=G_(t.projectName,{suffix:t.projectSuffix}).config}if(this.#e=t,t.schema??t.ajvOptions??t.rootSchema){if(t.schema&&typeof t.schema!=="object")throw TypeError("The `schema` option must be an object.");let s=new mG.Ajv2020({allErrors:!0,useDefaults:!0,...t.ajvOptions});ZNe(s);let o={...t.rootSchema,type:"object",properties:t.schema};this.#r=s.compile(o);for(let[a,c]of Object.entries(t.schema??{}))if(c?.default)this.#i[a]=c.default}if(t.defaults)this.#i={...this.#i,...t.defaults};if(t.serialize)this._serialize=t.serialize;if(t.deserialize)this._deserialize=t.deserialize;this.events=new EventTarget,this.#t=t.encryptionKey;let r=t.fileExtension?`.${t.fileExtension}`:"";this.path=fG.resolve(t.cwd,`${t.configName??"config"}${r}`);let n=this.store,i=Object.assign(Hc(),t.defaults,n);if(t.migrations){if(!t.projectVersion)throw Error("Please specify the `projectVersion` option.");this._migrate(t.migrations,t.projectVersion,t.beforeEachMigration)}this._validate(i);try{QNe.deepEqual(n,i)}catch{this.store=i}if(t.watch)this._watch()}get(e,t){if(this.#e.accessPropertiesByDotNotation)return this._get(e,t);let{store:r}=this;return e in r?r[e]:t}set(e,t){if(typeof e!=="string"&&typeof e!=="object")throw TypeError(`Expected \`key\` to be of type \`string\` or \`object\`, got ${typeof e}`);if(typeof e!=="object"&&t===void 0)throw TypeError("Use `delete()` to clear values");if(this._containsReservedKey(e))throw TypeError(`Please don't use the ${p0} key, as it's used to manage this module internal operations.`);let{store:r}=this,n=(i,s)=>{if(tqe(i,s),this.#e.accessPropertiesByDotNotation)V_(r,i,s);else r[i]=s};if(typeof e==="object"){let i=e;for(let[s,o]of Object.entries(i))n(s,o)}else n(e,t);this.store=r}has(e){if(this.#e.accessPropertiesByDotNotation)return DN(this.store,e);return e in this.store}reset(...e){for(let t of e)if(eqe(this.#i[t]))this.set(t,this.#i[t])}delete(e){let{store:t}=this;if(this.#e.accessPropertiesByDotNotation)wN(t,e);else delete t[e];this.store=t}clear(){this.store=Hc();for(let e of Object.keys(this.#i))this.reset(e)}onDidChange(e,t){if(typeof e!=="string")throw TypeError(`Expected \`key\` to be of type \`string\`, got ${typeof e}`);if(typeof t!=="function")throw TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof t}`);return this._handleChange(()=>this.get(e),t)}onDidAnyChange(e){if(typeof e!=="function")throw TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof e}`);return this._handleChange(()=>this.store,e)}get size(){return Object.keys(this.store).length}get store(){try{let e=Xo.readFileSync(this.path,this.#t?null:"utf8"),t=this._encryptData(e),r=this._deserialize(t);return this._validate(r),Object.assign(Hc(),r)}catch(e){if(e?.code==="ENOENT")return this._ensureDirectory(),Hc();if(this.#e.clearInvalidConfig&&e.name==="SyntaxError")return Hc();throw e}}set store(e){this._ensureDirectory(),this._validate(e),this._write(e),this.events.dispatchEvent(new Event("change"))}*[Symbol.iterator](){for(let[e,t]of Object.entries(this.store))yield[e,t]}_encryptData(e){if(!this.#t)return typeof e==="string"?e:hw(e);try{let t=e.slice(0,16),r=Ud.pbkdf2Sync(this.#t,t.toString(),1e4,32,"sha512"),n=Ud.createDecipheriv(pG,r,t),i=e.slice(17),s=typeof i==="string"?f0(i):i;return hw(mw([n.update(s),n.final()]))}catch{}return e.toString()}_handleChange(e,t){let r=e(),n=()=>{let i=r,s=e();if(XNe(s,i))return;r=s,t.call(this,s,i)};return this.events.addEventListener("change",n),()=>{this.events.removeEventListener("change",n)}}_deserialize=(e)=>JSON.parse(e);_serialize=(e)=>JSON.stringify(e,void 0,"\t");_validate(e){if(!this.#r)return;if(this.#r(e)||!this.#r.errors)return;let r=this.#r.errors.map(({instancePath:n,message:i=""})=>`\`${n.slice(1)}\` ${i}`);throw Error("Config schema violation: "+r.join("; "))}_ensureDirectory(){Xo.mkdirSync(fG.dirname(this.path),{recursive:!0})}_write(e){let t=this._serialize(e);if(this.#t){let r=Ud.randomBytes(16),n=Ud.pbkdf2Sync(this.#t,r.toString(),1e4,32,"sha512"),i=Ud.createCipheriv(pG,n,r);t=mw([r,f0(":"),i.update(f0(t)),i.final()])}if(dG.env.SNAP)Xo.writeFileSync(this.path,t,{mode:this.#e.configFileMode});else try{nv(this.path,t,{mode:this.#e.configFileMode})}catch(r){if(r?.code==="EXDEV"){Xo.writeFileSync(this.path,t,{mode:this.#e.configFileMode});return}throw r}}_watch(){if(this._ensureDirectory(),!Xo.existsSync(this.path))this._write(Hc());if(dG.platform==="win32")Xo.watch(this.path,{persistent:!1},Q1(()=>{this.events.dispatchEvent(new Event("change"))},{wait:100}));else Xo.watchFile(this.path,{persistent:!1},Q1(()=>{this.events.dispatchEvent(new Event("change"))},{wait:5000}))}_migrate(e,t,r){let n=this._get(gw,"0.0.0"),i=Object.keys(e).filter((o)=>this._shouldPerformMigration(o,n,t)),s={...this.store};for(let o of i)try{if(r)r(this,{fromVersion:n,toVersion:o,finalVersion:t,versions:i});let a=e[o];a?.(this),this._set(gw,o),n=o,s={...this.store}}catch(a){throw this.store=s,Error(`Something went wrong during the migration! Changes applied to the store until this failed migration will be restored. ${a}`)}if(this._isVersionInRangeFormat(n)||!Qo.default.eq(n,t))this._set(gw,t)}_containsReservedKey(e){if(typeof e==="object"){if(Object.keys(e)[0]===p0)return!0}if(typeof e!=="string")return!1;if(this.#e.accessPropertiesByDotNotation){if(e.startsWith(`${p0}.`))return!0;return!1}return!1}_isVersionInRangeFormat(e){return Qo.default.clean(e)===null}_shouldPerformMigration(e,t,r){if(this._isVersionInRangeFormat(e)){if(t!=="0.0.0"&&Qo.default.satisfies(t,e))return!1;return Qo.default.satisfies(r,e)}if(Qo.default.lte(e,t))return!1;if(Qo.default.gt(e,r))return!1;return!0}_get(e,t){return vN(this.store,e,t)}_set(e,t){let{store:r}=this;V_(r,e,t),this.store=r}}});import{copyFileSync as rqe,existsSync as yG,mkdirSync as nqe}from"fs";import{homedir as g0}from"os";import{join as Gc}from"path";function sqe(e){let t=e.trim().replace(/\/+$/,"");try{let r=new URL(t);return r.protocol=r.protocol.toLowerCase(),r.host=r.host.toLowerCase(),r.toString().replace(/\/+$/,"")}catch{return console.error(`[nemar] could not parse stored apiUrl ${JSON.stringify(e)}; leaving as-is`),t}}function yw(){return process.env.NEMAR_CONFIG_DIR||Gc(g0(),".config","nemar")}function oqe(e){if(process.env.NEMAR_CONFIG_DIR)return;let t=Gc(e,"config.json");if(yG(t))return;let r=[];if(process.platform==="darwin")r.push(Gc(g0(),"Library","Preferences","nemar-nodejs","config.json"));if(process.platform==="win32"){let n=process.env.APPDATA||Gc(g0(),"AppData","Roaming");r.push(Gc(n,"nemar-nodejs","config.json"))}r.push(Gc(g0(),".config","nemar-nodejs","config.json"));for(let n of r)if(yG(n))try{nqe(e,{recursive:!0}),rqe(n,t),console.error(`[nemar] Config migrated from ${n} to ${t}
|
|
99
99
|
[nemar] You can safely remove the old file.`);return}catch(i){console.error(`[nemar] Failed to migrate config from ${n}:`,i,`
|
|
100
|
-
[nemar] You can manually copy ${n} to ${t}`)}}function fn(){let e=yw();if(h0&&xG===e)return h0;if(oqe(e),h0=new m0({projectName:"nemar",schema:{activeAccount:{type:"string"},accounts:{type:"object"},apiKey:{type:"string"},apiUrl:{type:"string"},username:{type:"string"},email:{type:"string"},githubUsername:{type:"string"},sandboxCompleted:{type:"boolean"},sandboxDatasetId:{type:"string"}},cwd:e}),xG=e,!bG.has(e))bG.add(e),cqe(),uqe();return h0}function cqe(){let e=fn(),t=e.get("accounts");if(t&&Object.keys(t).length>0)return;let r=e.get("apiKey"),n=e.get("username");if(!r&&!n)return;try{let i=n||"default",s={};for(let o of aqe){let a=e.get(o);if(a!==void 0)s[o]=a}e.store={activeAccount:i,accounts:{[i]:s}}}catch(i){console.error("Config migration failed (legacy config preserved):",i)}}function uqe(){let e=fn(),t=e.store,r=t.accounts,n=!1;if(r)for(let[s,o]of Object.entries(r)){let a=o?.apiUrl;if(!a)continue;if(iqe.has(sqe(a)))r[s]={...o,apiUrl:Zo},console.error(`[nemar] migrated stored apiUrl for account "${s}": ${a} -> ${Zo}`),n=!0}let i=t.apiUrl;if(r&&Object.keys(r).length>0&&i!==void 0){let{apiUrl:s,...o}=t;try{e.store=o,console.error(`[nemar] removed stale top-level apiUrl from config (was: ${i})`),n=!1}catch(a){console.error("API URL cleanup failed (config file unchanged):",a)}}if(n)try{e.store={...e.store,accounts:r}}catch(s){console.error("API URL migration failed (config file unchanged):",s)}}function Vd(){return fn().get("activeAccount")}function ea(){return fn().get("accounts")||{}}function pt(){let e={apiUrl:Zo},t=Vd();if(!t)return e;return ea()[t]||e}function _G(){return!!pt().sandboxCompleted}function wt(e,t){let r=fn(),n=r.get("activeAccount")||"default",i=r.get("accounts")||{};if(!i[n])i[n]={apiUrl:Zo};i[n][e]=t,r.store={...r.store,accounts:i,activeAccount:n}}function zd(e){let t=Vd();if(!t)return;let r=ea();if(r[t])delete r[t][e],fn().set("accounts",r)}function vG(){let e=fn(),t=Vd();if(!t){e.clear();return}let r=ea();delete r[t];let n=Object.keys(r);if(n.length>0)e.store={...e.store,accounts:r,activeAccount:n[0]};else e.clear()}function wG(){fn().clear()}function Me(){return!!pt().apiKey}function DG(){return fn().path}function Hd(){let e=ea(),t=Vd();return Object.entries(e).map(([r,n])=>({username:n.username||r,email:n.email,githubUsername:n.githubUsername,active:r===t}))}function EG(e,t){let r=fn(),n=ea();n[e]=t,r.store={...r.store,accounts:n,activeAccount:e}}function SG(e){let t=e.trim();if(!t)return
|
|
100
|
+
[nemar] You can manually copy ${n} to ${t}`)}}function fn(){let e=yw();if(h0&&xG===e)return h0;if(oqe(e),h0=new m0({projectName:"nemar",schema:{activeAccount:{type:"string"},accounts:{type:"object"},apiKey:{type:"string"},apiUrl:{type:"string"},username:{type:"string"},email:{type:"string"},githubUsername:{type:"string"},sandboxCompleted:{type:"boolean"},sandboxDatasetId:{type:"string"}},cwd:e}),xG=e,!bG.has(e))bG.add(e),cqe(),uqe();return h0}function cqe(){let e=fn(),t=e.get("accounts");if(t&&Object.keys(t).length>0)return;let r=e.get("apiKey"),n=e.get("username");if(!r&&!n)return;try{let i=n||"default",s={};for(let o of aqe){let a=e.get(o);if(a!==void 0)s[o]=a}e.store={activeAccount:i,accounts:{[i]:s}}}catch(i){console.error("Config migration failed (legacy config preserved):",i)}}function uqe(){let e=fn(),t=e.store,r=t.accounts,n=!1;if(r)for(let[s,o]of Object.entries(r)){let a=o?.apiUrl;if(!a)continue;if(iqe.has(sqe(a)))r[s]={...o,apiUrl:Zo},console.error(`[nemar] migrated stored apiUrl for account "${s}": ${a} -> ${Zo}`),n=!0}let i=t.apiUrl;if(r&&Object.keys(r).length>0&&i!==void 0){let{apiUrl:s,...o}=t;try{e.store=o,console.error(`[nemar] removed stale top-level apiUrl from config (was: ${i})`),n=!1}catch(a){console.error("API URL cleanup failed (config file unchanged):",a)}}if(n)try{e.store={...e.store,accounts:r}}catch(s){console.error("API URL migration failed (config file unchanged):",s)}}function Vd(){return fn().get("activeAccount")}function ea(){return fn().get("accounts")||{}}function pt(){let e={apiUrl:Zo},t=Vd();if(!t)return e;return ea()[t]||e}function _G(){return!!pt().sandboxCompleted}function wt(e,t){let r=fn(),n=r.get("activeAccount")||"default",i=r.get("accounts")||{};if(!i[n])i[n]={apiUrl:Zo};i[n][e]=t,r.store={...r.store,accounts:i,activeAccount:n}}function zd(e){let t=Vd();if(!t)return;let r=ea();if(r[t])delete r[t][e],fn().set("accounts",r)}function vG(){let e=fn(),t=Vd();if(!t){e.clear();return}let r=ea();delete r[t];let n=Object.keys(r);if(n.length>0)e.store={...e.store,accounts:r,activeAccount:n[0]};else e.clear()}function wG(){fn().clear()}function Me(){return!!pt().apiKey}function DG(){return fn().path}function Hd(){let e=ea(),t=Vd();return Object.entries(e).map(([r,n])=>({username:n.username||r,email:n.email,githubUsername:n.githubUsername,active:r===t}))}function EG(e,t){let r=fn(),n=ea();n[e]=t,r.store={...r.store,accounts:n,activeAccount:e}}function SG(e){let t=e.trim();if(!t)return"unchanged";let r=fn(),n=Vd();if(!n||n===t)return"unchanged";let i=ea(),s=i[n];if(!s)return"unchanged";if(i[t])return"key_taken";return delete i[n],i[t]={...s,username:t},r.store={...r.store,accounts:i,activeAccount:t},"renamed"}function $G(e){let t=fn(),r=ea();if(r[e])return t.store={...t.store,activeAccount:e},r[e];for(let[n,i]of Object.entries(r))if(i.githubUsername===e)return t.store={...t.store,activeAccount:n},i;return null}var Zo="https://api.nemar.org",iqe,Cot,h0=null,xG=null,bG,aqe;var Zi=O(()=>{gG();Vi();iqe=new Set(["https://api.osc.earth/nemar","https://nemar-api.neuromechanist.workers.dev","https://nemar-api-dev.shirazi-10f.workers.dev"]);Cot=tt({apiKey:A().optional(),apiUrl:A().url().default(Zo),username:A().optional(),email:A().email().optional(),githubUsername:A().optional(),sandboxCompleted:Er().optional(),sandboxDatasetId:A().optional(),dismissedNoticeIds:jt(K()).optional(),serviceAccess:Er().optional(),role:A().optional(),pendingEmailChange:A().email().optional()});bG=new Set;aqe=["apiKey","apiUrl","username","email","githubUsername","sandboxCompleted","sandboxDatasetId","dismissedNoticeIds"]});function T(e){if(e instanceof Error)return e.message;return String(e)}var N,eo;var er=O(()=>{N=class N extends Error{statusCode;details;step;blockReason;missing;constructor(e,t,r,n,i,s){super(t);this.statusCode=e;this.details=r;this.step=n;this.blockReason=i;this.missing=s;this.name="ApiError"}};eo=class eo extends N{mode;eta;constructor(e,t,r,n){super(503,t,n);this.mode=e;this.eta=r;this.name="MaintenanceError"}}});function CG(e){xw=e}function bw(){return xw}function Gd(e){if(xw)process.stderr.write(`${e}
|
|
101
101
|
`)}var xw=!1;var{spawn:lqe}=globalThis.Bun;async function R(e,t={}){let r={...process.env,GIT_TERMINAL_PROMPT:"0",...t.env};for(let l of t.unsetEnv??[])delete r[l];let n=lqe({cmd:e,cwd:t.cwd,stdout:"pipe",stderr:"pipe",env:r}),i=!1,s;if(t.timeout)s=setTimeout(()=>{i=!0,n.kill()},t.timeout);if(bw()){let l=t.cwd?` (cwd=${t.cwd})`:"";Gd(u.dim(`$ ${e.join(" ")}${l}`))}let o=await new Response(n.stdout).text(),a=await new Response(n.stderr).text(),c=await n.exited;if(s)clearTimeout(s);if(bw()){if(o.trim())Gd(u.dim(o.trimEnd()));if(a.trim())Gd(u.yellow(a.trimEnd()));Gd(u.dim(`(exit ${c})`))}if(i)return{stdout:o,stderr:a||`Command timed out after ${Math.round(t.timeout/1000)}s`,exitCode:c??1,timedOut:!0};return{stdout:o,stderr:a,exitCode:c,timedOut:!1}}var tr=O(()=>{Je()});function fqe(){if(process.platform==="darwin")return"macos";if(process.platform==="win32")return"windows";return"linux"}function OG(e,t=fqe()){return e.installInstructions[t]}function pqe(e){let t=e.match(/(\d+\.\d+(?:\.\d+)?)/);return t?t[1]:void 0}function hqe(){let e=Number(process.env.TEST_PROBE_TIMEOUT_MS);return Number.isFinite(e)&&e>0?e:mqe}async function AG(e){try{let{exitCode:t,stdout:r,timedOut:n}=await R(e.cmd,{timeout:hqe()});if(n)return{available:!1,timedOut:!0};if(t!==0)return{available:!1};return{available:!0,version:pqe(r)}}catch(t){let r=t instanceof Error?t.message:String(t);if(!r.includes("ENOENT")&&!r.includes("not found"))console.error(` Warning: ${e.name} check failed unexpectedly: ${r}`);return{available:!1}}}async function Wd(){let e=Object.entries(RG);return Promise.all(e.map(async([t,r])=>{let{available:n,version:i,timedOut:s}=await AG(r);return{key:t,name:r.name,purpose:r.purpose,required:r.required,available:n,version:i,timedOut:s,installInstruction:OG(r)}}))}async function kG(){let t=(await Wd()).filter((r)=>r.required&&!r.available);if(t.length===0)return[];console.warn(`
|
|
102
102
|
Heads up: some tools NEMAR needs for uploading/validating aren't installed yet:`);for(let r of t)console.warn(` - ${r.name} (${r.purpose})`),console.warn(` Install: ${r.installInstruction}`);return console.warn("Run `nemar doctor` anytime to re-check. You can finish signup without them.\n"),t}async function ta(e){let r=dqe[e].map((o)=>RG[o]).filter(Boolean),n=await Promise.all(r.map(async(o)=>{let a=await AG(o);return{check:o,available:a.available,timedOut:a.timedOut}}));for(let o of n)if(o.timedOut&&o.check.required)console.warn(`Warning: ${o.check.name} did not respond to a version check in time; continuing anyway.`);let i=n.filter((o)=>!o.available&&!o.timedOut&&o.check.required).map((o)=>({tool:o.check.name,installInstruction:OG(o.check)}));if(i.length===0)return;let s=[`
|
|
103
103
|
Missing required tools:`];for(let o of i)s.push(` ${o.tool} not installed`),s.push(` Install: ${o.installInstruction}`);throw Error(s.join(`
|
|
104
|
-
`))}var RG,dqe,mqe=4000;var Kd=O(()=>{tr();RG={git:{name:"git",purpose:"version control for dataset metadata",cmd:["git","--version"],required:!0,installInstructions:{macos:"brew install git (or install Xcode Command Line Tools)",linux:"sudo apt-get install git OR sudo dnf install git",windows:"winget install Git.Git (or https://git-scm.com/download/win)"}},"git-annex":{name:"git-annex",purpose:"large-file data transfer (upload/download)",cmd:["git-annex","version"],required:!0,installInstructions:{macos:"brew install git-annex",linux:"sudo apt-get install git-annex OR sudo dnf install git-annex",windows:"Download the installer from https://git-annex.branchable.com/install/Windows/"}},gh:{name:"GitHub CLI (gh)",purpose:"GitHub authentication + repository operations",cmd:["gh","--version"],required:!0,installInstructions:{macos:"brew install gh",linux:"See https://cli.github.com/manual/installation",windows:"winget install GitHub.cli (or: scoop install gh)"}},aws:{name:"AWS CLI",purpose:"S3 data upload/download",cmd:["aws","--version"],required:!0,installInstructions:{macos:"brew install awscli",linux:"pip install awscli OR sudo snap install aws-cli --classic",windows:"winget install Amazon.AWSCLI (or the MSI from https://aws.amazon.com/cli/)"}},deno:{name:"Deno",purpose:"BIDS validation",cmd:["deno","--version"],required:!0,installInstructions:{macos:"brew install deno (or: curl -fsSL https://deno.land/install.sh | sh)",linux:"curl -fsSL https://deno.land/install.sh | sh",windows:"winget install DenoLand.Deno (or: irm https://deno.land/install.ps1 | iex)"}}},dqe={upload:["git-annex","gh","aws","deno"],download:["gh"],clone:["git","gh"],push:["git-annex","gh"],publish:["gh","aws"],update:["git","gh"],release:["git","gh"]}});var PG;var FG=O(()=>{PG={name:"nemar-cli",version:"0.9.16-PR1269.
|
|
104
|
+
`))}var RG,dqe,mqe=4000;var Kd=O(()=>{tr();RG={git:{name:"git",purpose:"version control for dataset metadata",cmd:["git","--version"],required:!0,installInstructions:{macos:"brew install git (or install Xcode Command Line Tools)",linux:"sudo apt-get install git OR sudo dnf install git",windows:"winget install Git.Git (or https://git-scm.com/download/win)"}},"git-annex":{name:"git-annex",purpose:"large-file data transfer (upload/download)",cmd:["git-annex","version"],required:!0,installInstructions:{macos:"brew install git-annex",linux:"sudo apt-get install git-annex OR sudo dnf install git-annex",windows:"Download the installer from https://git-annex.branchable.com/install/Windows/"}},gh:{name:"GitHub CLI (gh)",purpose:"GitHub authentication + repository operations",cmd:["gh","--version"],required:!0,installInstructions:{macos:"brew install gh",linux:"See https://cli.github.com/manual/installation",windows:"winget install GitHub.cli (or: scoop install gh)"}},aws:{name:"AWS CLI",purpose:"S3 data upload/download",cmd:["aws","--version"],required:!0,installInstructions:{macos:"brew install awscli",linux:"pip install awscli OR sudo snap install aws-cli --classic",windows:"winget install Amazon.AWSCLI (or the MSI from https://aws.amazon.com/cli/)"}},deno:{name:"Deno",purpose:"BIDS validation",cmd:["deno","--version"],required:!0,installInstructions:{macos:"brew install deno (or: curl -fsSL https://deno.land/install.sh | sh)",linux:"curl -fsSL https://deno.land/install.sh | sh",windows:"winget install DenoLand.Deno (or: irm https://deno.land/install.ps1 | iex)"}}},dqe={upload:["git-annex","gh","aws","deno"],download:["gh"],clone:["git","gh"],push:["git-annex","gh"],publish:["gh","aws"],update:["git","gh"],release:["git","gh"]}});var PG;var FG=O(()=>{PG={name:"nemar-cli",version:"0.9.16-PR1269.abb2129",description:"CLI for NEMAR (Neuroelectromagnetic Data Archive and Tools Resource) dataset management",type:"module",main:"dist/index.js",bin:{nemar:"dist/index.js"},scripts:{dev:"bun run src/index.ts",build:"bun build src/index.ts --outdir dist --target bun --minify && sed '1s|#!/usr/bin/env node|#!/usr/bin/env bun|' dist/index.js > dist/index.js.tmp && mv dist/index.js.tmp dist/index.js",test:"bun test",lint:"biome check src/","migrations:d1-check":"bun run scripts/d1-migration-check.ts","lint:fix":"biome check --fix src/",format:"biome format --write src/",typecheck:"tsc --noEmit && tsc --noEmit -p backend","generate-openapi":"bun run scripts/generate-openapi.ts",prepublishOnly:"bun run build",prepare:"husky",postinstall:"bun scripts/postinstall-check.mjs",deploy:"wrangler deploy",preview:"wrangler dev"},keywords:["nemar","bids","neuroimaging","eeg","emg","datalad","cli"],author:"NEMAR Team",license:"CC-BY-NC-ND-4.0",repository:{type:"git",url:"git+https://github.com/nemarOrg/nemar-cli.git"},bugs:{url:"https://github.com/nemarOrg/nemar-cli/issues"},homepage:"https://docs.nemar.org",engines:{bun:">=1.0.0"},files:["dist","scripts/postinstall-check.mjs","scripts/recover-datasets.json","scripts/withdrawn-datasets.json","README.md","LICENSE"],dependencies:{chalk:"^5.3.0",commander:"^12.1.0",conf:"^13.0.1",inquirer:"^9.2.15",ora:"^8.0.1",semver:"^7.8.5",zod:"^3.23.8"},"lint-staged":{"src/**/*.{ts,tsx}":["biome check --fix"],"backend/src/**/*.{ts,tsx}":["biome check --fix"]},devDependencies:{"@asteasolutions/zod-to-openapi":"^7.3.4","@biomejs/biome":"1.9.4","@types/bun":"latest","@types/inquirer":"^9.0.7","@types/semver":"^7.8.0",ajv:"^8.20.0","ajv-formats":"^3.0.1",bcryptjs:"^3.0.3",husky:"^9.1.7","lint-staged":"^16.3.2",typescript:"^5.5.4",wrangler:"^4.70.0",yaml:"^2.8.4"}}});var es;var Yd=O(()=>{FG();es=PG.version});import{mkdirSync as yqe,readdirSync as xqe,unlinkSync as bqe,writeFileSync as _qe}from"fs";import{join as _w}from"path";function jG(){Wc=!0}function ra(){return Wc}function MG(e,t=process.env){return e.includes("--debug")||t.NEMAR_DEBUG==="1"}function Xd(e){qG=e,Mn(`Step: ${e}`)}function BG(){NG=!0}function LG(){return NG}function Mn(e){if(Wc)process.stderr.write(`[debug] ${e}
|
|
105
105
|
`)}function Eqe(e){let t={};for(let[r,n]of Object.entries(e))t[r]=Dqe.has(r.toLowerCase())?"[REDACTED]":n;return t}function VG(e){let t=e.indexOf("@");if(t<=0)return"***";return`${e[0]}***${e.slice(t)}`}function vw(e,t,r=0){if(r>$qe)return"[REDACTED: depth]";if(Array.isArray(t))return t.map((n)=>vw(e,n,r+1));if(t&&typeof t==="object"){let n={};for(let[i,s]of Object.entries(t))n[i]=vw(i,s,r+1);return n}if(typeof t==="string"){if(Sqe.test(e))return"[REDACTED]";return t.replace(UG,VG)}return t}function ww(e){return e.replace(Cqe,"Bearer [REDACTED]").replace(Rqe,"[REDACTED_AWS_KEY]").replace(Oqe,"$1[REDACTED]").replace(Aqe,"$1$2=[REDACTED]").replace(UG,VG)}function kqe(e){return ww(e)}function IG(e,t=wqe){if(e===void 0)return;let r=e;try{let n=JSON.parse(e);r=JSON.stringify(vw("",n))}catch{}if(r=ww(r),Buffer.byteLength(r,"utf8")>t)r=`${Buffer.from(r,"utf8").subarray(0,t).toString("utf8")}... [truncated]`;return r}function b0(e){if(!Wc)return;let t=kqe(e.url);try{let r={...e,url:t,requestHeaders:e.requestHeaders?Eqe(e.requestHeaders):void 0,requestBody:IG(e.requestBody),responseBody:IG(e.responseBody)};x0.push(r),Mn(`${e.method} ${t} -> ${e.status??"ERROR"} (${e.durationMs}ms)`)}catch(r){let n=T(r);x0.push({method:e.method,url:t,status:e.status,durationMs:e.durationMs,note:`redaction failed: ${n}`}),Mn(`redaction failed for ${e.method} ${t}: ${n}`)}}async function Fqe(){let e=[];try{let t=process.versions.bun?`Bun ${process.versions.bun}`:`Node ${process.version}`;e.push(`CLI version: ${es}`),e.push(`OS/Arch: ${process.platform}/${process.arch}`),e.push(`Runtime: ${t}`)}catch(t){e.push(`(could not read CLI/OS/runtime info: ${T(t)})`)}e.push(""),e.push("Active account:");try{let t=pt();if(t.apiKey){if(t.username)e.push(` Username: ${t.username}`);if(e.push(` API URL: ${t.apiUrl}`),t.role)e.push(` Role: ${t.role}`);e.push(` Sandbox completed: ${!!t.sandboxCompleted}`)}else e.push(" (not authenticated)")}catch(t){e.push(` (could not read account config: ${T(t)})`)}e.push(""),e.push("External tools:");try{let t=await Wd();for(let r of t){let n=r.available?r.version??"installed":r.timedOut?"(timed out)":"not installed";e.push(` ${r.name}: ${n}`)}}catch(t){e.push(` (could not probe external tools: ${T(t)})`)}return e}async function Dw(){return(await Fqe()).join(`
|
|
106
106
|
`)}async function zG(){if(!Wc||y0!==void 0)return;try{y0=await Dw()}catch(e){let t=T(e);y0=`(could not build environment report: ${t})`,Mn(`environment snapshot failed: ${t}`)}}function HG(e){if(TG.has(e))return{flag:e};for(let t of TG){if(!e.startsWith(t)||e.length<=t.length)continue;if(t.length===2)return{flag:t,kind:"short-attached"};if(e[t.length]==="=")return{flag:t,kind:"long-eq"}}return null}function Pqe(e){let t=[];for(let r=0;r<e.length;r++){let n=e[r],i=HG(n);if(!i){t.push(n);continue}if(i.kind==="long-eq")t.push(`${i.flag}=[REDACTED]`);else if(i.kind==="short-attached")t.push(`${i.flag}[REDACTED]`);else if(t.push(n),r+1<e.length)t.push("[REDACTED]"),r++}return t}function Iqe(e){let t=[];for(let r=0;r<e.length;r++){let n=e[r],i=HG(n);if(!i){t.push(n);continue}if(!i.kind&&r+1<e.length)r++}return t}function Tqe(e){let t=[];for(let n of Iqe(e)){if(n.startsWith("-"))continue;if(t.push(n),t.length===2)break}return(t.length>0?t.join("-"):"nemar").replace(/[^a-zA-Z0-9_-]/g,"_")}function Nqe(e,t){let r=[];if(r.push("NEMAR CLI Debug Log"),r.push(`Generated: ${new Date().toISOString()}`),r.push(`Command: nemar ${ww(Pqe(e).join(" "))}`),r.push(""),r.push(y0??"(environment snapshot unavailable)"),r.push(""),r.push("HTTP requests:"),x0.length===0)r.push(" (none)");else x0.forEach((n,i)=>{if(r.push(` [${i+1}] ${n.method} ${n.url} -> ${n.status??"ERROR"} (${n.durationMs}ms)`),n.error)r.push(` Error: ${n.error}`);if(n.note)r.push(` Note: ${n.note}`);if(n.requestHeaders)r.push(` Request headers: ${JSON.stringify(n.requestHeaders)}`);if(n.requestBody)r.push(` Request body: ${n.requestBody}`);if(n.responseBody)r.push(` Response body: ${n.responseBody}`)});return r.push(""),r.push(`Failing step: ${qG??"(none recorded)"}`),r.push(`Exit code: ${t}`),`${r.join(`
|
|
107
107
|
`)}
|
|
@@ -601,7 +601,7 @@ Subcommands (the same changes Settings on nemar.org makes):
|
|
|
601
601
|
Examples:
|
|
602
602
|
$ nemar auth profile
|
|
603
603
|
$ nemar auth profile set-email ada@lab.example.org
|
|
604
|
-
$ nemar auth profile orcid link`);var WD="Also changeable in Settings on https://nemar.org/settings";function wg(){if(Me())return!0;return console.log(u.yellow("Not authenticated")),console.log(),console.log(" Run 'nemar auth login' to authenticate"),process.exitCode=1,!1}async function bg(){try{let e=await uo();if(e.username
|
|
604
|
+
$ nemar auth profile orcid link`);var WD="Also changeable in Settings on https://nemar.org/settings";function wg(){if(Me())return!0;return console.log(u.yellow("Not authenticated")),console.log(),console.log(" Run 'nemar auth login' to authenticate"),process.exitCode=1,!1}async function bg(){try{let e=await uo();if(e.username&&SG(e.username)==="key_taken")console.log(u.yellow(` This machine already has a different account stored as '${e.username}'.`)),console.log(u.dim(" Your credentials stay under the old name; 'nemar auth switch' still selects that one."));if(wt("username",e.username??void 0),wt("email",e.email),wt("githubUsername",e.github_username??void 0),e.service_access!==void 0)wt("serviceAccess",e.service_access);wt("role",e.role)}catch(e){console.log(u.dim(` (local copy not refreshed: ${T(e)} \u2014 run 'nemar auth status --refresh')`))}}function DQ(e){try{e()}catch(t){console.log(u.yellow(` The change is live on the server; your local config could not be updated: ${T(t)}`)),console.log(u.dim(" Run 'nemar auth status --refresh' once the problem is fixed."))}}function vf(e,t,r){if(t instanceof N||t instanceof eo)e.fail(t.message);else e.fail(r),console.log(u.dim(` ${T(t)}`));process.exitCode=1}async function Dg(e,t,r){if(!wg())return;let n=w(t).start();try{await dQ(e),n.succeed(r),await bg(),console.log(u.dim(` ${WD}`))}catch(i){vf(n,i,"Could not update your profile")}}var ILe=fo.command("set-email <address>").description("Start an email change: mails a confirmation code to the new address").action(async(e)=>{if(!wg())return;let t=w(`Sending a confirmation code to ${e}...`).start(),r;try{r=await uQ(e)}catch(n){vf(t,n,"Could not send the confirmation code");return}if(t.succeed(`Code sent to ${r.masked_email}`),DQ(()=>wt("pendingEmailChange",e)),console.log(),console.log(" The address is not changed until you confirm the code:"),console.log(` ${u.cyan("nemar auth profile verify-email <code>")}`),console.log(u.dim(" The code expires in 10 minutes.")),r.dev_code)console.log(u.dim(` (development backend echoed the code: ${r.dev_code})`));if(r.dev_skip)console.log(u.yellow(" This backend is non-production and did not mail anything (delivery allow-list)."));console.log(u.dim(` ${WD}`))});Gt(ILe,`
|
|
605
605
|
Description:
|
|
606
606
|
Step one of changing the email address your NEMAR account signs in with.
|
|
607
607
|
A 6-digit code goes to the NEW address; nothing changes until you enter it
|
package/package.json
CHANGED