@signetai/connector-pi 0.148.2 → 0.148.7

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 CHANGED
@@ -22100,41 +22100,41 @@ var CODE_EXTS2 = new Set([
22100
22100
  var SKIP_FILES2 = new Set([".DS_Store", "Thumbs.db", ".gitkeep", "node_modules", ".git", ".env", ".env.local"]);
22101
22101
 
22102
22102
  // src/extension-bundle.ts
22103
- var EXTENSION_BUNDLE = `var j9=Object.defineProperty;var R9=(Z)=>Z;function S9(Z,X){this[Z]=R9.bind(null,X)}var m6=(Z,X)=>{for(var z in X)j9(Z,z,{get:X[z],enumerable:!0,configurable:!0,set:S9.bind(X,z)})};import{existsSync as fJ,readFileSync as bJ}from"node:fs";import{join as xJ}from"node:path";import{createRequire as C9}from"node:module";import{dirname as Uz,join as ZY}from"node:path";import{fileURLToPath as Gz}from"node:url";import{createRequire as LQ}from"node:module";import{homedir as l6,platform as FQ}from"node:os";import{basename as BY,dirname as UY,resolve as L8}from"node:path";import{existsSync as s8,readFileSync as Q5,readdirSync as AY,realpathSync as LY,statSync as DY}from"node:fs";import{dirname as FY,join as W5}from"node:path";import{existsSync as jQ,mkdirSync as KY,readFileSync as RQ,rmSync as jY,writeFileSync as RY}from"node:fs";import{homedir as D8}from"node:os";import{dirname as EY,join as O8,resolve as SQ}from"node:path";import{homedir as yQ}from"node:os";var{create:E9,getPrototypeOf:I9,defineProperty:y5,getOwnPropertyNames:T9}=Object,P9=Object.prototype.hasOwnProperty;function w9(Z){return this[Z]}var k9,f9,r5=(Z,X,z)=>{var W=Z!=null&&typeof Z==="object";if(W){var Y=X?k9??=new WeakMap:f9??=new WeakMap,q=Y.get(Z);if(q)return q}z=Z!=null?E9(I9(Z)):{};let B=X||!Z||!Z.__esModule?y5(z,"default",{value:Z,enumerable:!0}):z;for(let U of T9(Z))if(!P9.call(B,U))y5(B,U,{get:w9.bind(Z,U),enumerable:!0});if(W)Y.set(Z,B);return B},w=(Z,X)=>()=>(X||Z((X={exports:{}}).exports,X),X.exports),a8=C9(import.meta.url),u=w((Z)=>{var X=Symbol.for("yaml.alias"),z=Symbol.for("yaml.document"),W=Symbol.for("yaml.map"),Y=Symbol.for("yaml.pair"),q=Symbol.for("yaml.scalar"),B=Symbol.for("yaml.seq"),U=Symbol.for("yaml.node.type"),G=(L)=>!!L&&typeof L==="object"&&L[U]===X,H=(L)=>!!L&&typeof L==="object"&&L[U]===z,_=(L)=>!!L&&typeof L==="object"&&L[U]===W,$=(L)=>!!L&&typeof L==="object"&&L[U]===Y,Q=(L)=>!!L&&typeof L==="object"&&L[U]===q,J=(L)=>!!L&&typeof L==="object"&&L[U]===B;function V(L){if(L&&typeof L==="object")switch(L[U]){case W:case B:return!0}return!1}function M(L){if(L&&typeof L==="object")switch(L[U]){case X:case W:case q:case B:return!0}return!1}var A=(L)=>(Q(L)||V(L))&&!!L.anchor;Z.ALIAS=X,Z.DOC=z,Z.MAP=W,Z.NODE_TYPE=U,Z.PAIR=Y,Z.SCALAR=q,Z.SEQ=B,Z.hasAnchor=A,Z.isAlias=G,Z.isCollection=V,Z.isDocument=H,Z.isMap=_,Z.isNode=M,Z.isPair=$,Z.isScalar=Q,Z.isSeq=J}),r8=w((Z)=>{var X=u(),z=Symbol("break visit"),W=Symbol("skip children"),Y=Symbol("remove node");function q(Q,J){let V=H(J);if(X.isDocument(Q)){if(B(null,Q.contents,V,Object.freeze([Q]))===Y)Q.contents=null}else B(null,Q,V,Object.freeze([]))}q.BREAK=z,q.SKIP=W,q.REMOVE=Y;function B(Q,J,V,M){let A=_(Q,J,V,M);if(X.isNode(A)||X.isPair(A))return $(Q,M,A),B(Q,A,V,M);if(typeof A!=="symbol"){if(X.isCollection(J)){M=Object.freeze(M.concat(J));for(let L=0;L<J.items.length;++L){let D=B(L,J.items[L],V,M);if(typeof D==="number")L=D-1;else if(D===z)return z;else if(D===Y)J.items.splice(L,1),L-=1}}else if(X.isPair(J)){M=Object.freeze(M.concat(J));let L=B("key",J.key,V,M);if(L===z)return z;else if(L===Y)J.key=null;let D=B("value",J.value,V,M);if(D===z)return z;else if(D===Y)J.value=null}}return A}async function U(Q,J){let V=H(J);if(X.isDocument(Q)){if(await G(null,Q.contents,V,Object.freeze([Q]))===Y)Q.contents=null}else await G(null,Q,V,Object.freeze([]))}U.BREAK=z,U.SKIP=W,U.REMOVE=Y;async function G(Q,J,V,M){let A=await _(Q,J,V,M);if(X.isNode(A)||X.isPair(A))return $(Q,M,A),G(Q,A,V,M);if(typeof A!=="symbol"){if(X.isCollection(J)){M=Object.freeze(M.concat(J));for(let L=0;L<J.items.length;++L){let D=await G(L,J.items[L],V,M);if(typeof D==="number")L=D-1;else if(D===z)return z;else if(D===Y)J.items.splice(L,1),L-=1}}else if(X.isPair(J)){M=Object.freeze(M.concat(J));let L=await G("key",J.key,V,M);if(L===z)return z;else if(L===Y)J.key=null;let D=await G("value",J.value,V,M);if(D===z)return z;else if(D===Y)J.value=null}}return A}function H(Q){if(typeof Q==="object"&&(Q.Collection||Q.Node||Q.Value))return Object.assign({Alias:Q.Node,Map:Q.Node,Scalar:Q.Node,Seq:Q.Node},Q.Value&&{Map:Q.Value,Scalar:Q.Value,Seq:Q.Value},Q.Collection&&{Map:Q.Collection,Seq:Q.Collection},Q);return Q}function _(Q,J,V,M){if(typeof V==="function")return V(Q,J,M);if(X.isMap(J))return V.Map?.(Q,J,M);if(X.isSeq(J))return V.Seq?.(Q,J,M);if(X.isPair(J))return V.Pair?.(Q,J,M);if(X.isScalar(J))return V.Scalar?.(Q,J,M);if(X.isAlias(J))return V.Alias?.(Q,J,M);return}function $(Q,J,V){let M=J[J.length-1];if(X.isCollection(M))M.items[Q]=V;else if(X.isPair(M))if(Q==="key")M.key=V;else M.value=V;else if(X.isDocument(M))M.contents=V;else{let A=X.isAlias(M)?"alias":"scalar";throw Error(\`Cannot replace node with \${A} parent\`)}}Z.visit=q,Z.visitAsync=U}),t5=w((Z)=>{var X=u(),z=r8(),W={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Y=(B)=>B.replace(/[!,[\\]{}]/g,(U)=>W[U]);class q{constructor(B,U){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},q.defaultYaml,B),this.tags=Object.assign({},q.defaultTags,U)}clone(){let B=new q(this.yaml,this.tags);return B.docStart=this.docStart,B}atDocument(){let B=new q(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:q.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},q.defaultTags);break}return B}add(B,U){if(this.atNextDocument)this.yaml={explicit:q.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},q.defaultTags),this.atNextDocument=!1;let G=B.trim().split(/[ \\t]+/),H=G.shift();switch(H){case"%TAG":{if(G.length!==2){if(U(0,"%TAG directive should contain exactly two parts"),G.length<2)return!1}let[_,$]=G;return this.tags[_]=$,!0}case"%YAML":{if(this.yaml.explicit=!0,G.length!==1)return U(0,"%YAML directive should contain exactly one part"),!1;let[_]=G;if(_==="1.1"||_==="1.2")return this.yaml.version=_,!0;else{let $=/^\\d+\\.\\d+$/.test(_);return U(6,\`Unsupported YAML version \${_}\`,$),!1}}default:return U(0,\`Unknown directive \${H}\`,!0),!1}}tagName(B,U){if(B==="!")return"!";if(B[0]!=="!")return U(\`Not a valid tag: \${B}\`),null;if(B[1]==="<"){let $=B.slice(2,-1);if($==="!"||$==="!!")return U(\`Verbatim tags aren't resolved, so \${B} is invalid.\`),null;if(B[B.length-1]!==">")U("Verbatim tags must end with a >");return $}let[,G,H]=B.match(/^(.*!)([^!]*)$/s);if(!H)U(\`The \${B} tag has no suffix\`);let _=this.tags[G];if(_)try{return _+decodeURIComponent(H)}catch($){return U(String($)),null}if(G==="!")return B;return U(\`Could not resolve tag: \${B}\`),null}tagString(B){for(let[U,G]of Object.entries(this.tags))if(B.startsWith(G))return U+Y(B.substring(G.length));return B[0]==="!"?B:\`!<\${B}>\`}toString(B){let U=this.yaml.explicit?[\`%YAML \${this.yaml.version||"1.2"}\`]:[],G=Object.entries(this.tags),H;if(B&&G.length>0&&X.isNode(B.contents)){let _={};z.visit(B.contents,($,Q)=>{if(X.isNode(Q)&&Q.tag)_[Q.tag]=!0}),H=Object.keys(_)}else H=[];for(let[_,$]of G){if(_==="!!"&&$==="tag:yaml.org,2002:")continue;if(!B||H.some((Q)=>Q.startsWith($)))U.push(\`%TAG \${_} \${$}\`)}return U.join(\`
22104
- \`)}}q.defaultYaml={explicit:!1,version:"1.2"},q.defaultTags={"!!":"tag:yaml.org,2002:"},Z.Directives=q}),o6=w((Z)=>{var X=u(),z=r8();function W(U){if(/[\\x00-\\x19\\s,[\\]{}]/.test(U)){let H=\`Anchor must not contain whitespace or control characters: \${JSON.stringify(U)}\`;throw Error(H)}return!0}function Y(U){let G=new Set;return z.visit(U,{Value(H,_){if(_.anchor)G.add(_.anchor)}}),G}function q(U,G){for(let H=1;;++H){let _=\`\${U}\${H}\`;if(!G.has(_))return _}}function B(U,G){let H=[],_=new Map,$=null;return{onAnchor:(Q)=>{H.push(Q),$??($=Y(U));let J=q(G,$);return $.add(J),J},setAnchors:()=>{for(let Q of H){let J=_.get(Q);if(typeof J==="object"&&J.anchor&&(X.isScalar(J.node)||X.isCollection(J.node)))J.node.anchor=J.anchor;else{let V=Error("Failed to resolve repeated object (this should not happen)");throw V.source=Q,V}}},sourceObjects:_}}Z.anchorIsValid=W,Z.anchorNames=Y,Z.createNodeAnchors=B,Z.findNewAnchor=q}),e5=w((Z)=>{function X(z,W,Y,q){if(q&&typeof q==="object")if(Array.isArray(q))for(let B=0,U=q.length;B<U;++B){let G=q[B],H=X(z,q,String(B),G);if(H===void 0)delete q[B];else if(H!==G)q[B]=H}else if(q instanceof Map)for(let B of Array.from(q.keys())){let U=q.get(B),G=X(z,q,B,U);if(G===void 0)q.delete(B);else if(G!==U)q.set(B,G)}else if(q instanceof Set)for(let B of Array.from(q)){let U=X(z,q,B,B);if(U===void 0)q.delete(B);else if(U!==B)q.delete(B),q.add(U)}else for(let[B,U]of Object.entries(q)){let G=X(z,q,B,U);if(G===void 0)delete q[B];else if(G!==U)q[B]=G}return z.call(W,Y,q)}Z.applyReviver=X}),xZ=w((Z)=>{var X=u();function z(W,Y,q){if(Array.isArray(W))return W.map((B,U)=>z(B,String(U),q));if(W&&typeof W.toJSON==="function"){if(!q||!X.hasAnchor(W))return W.toJSON(Y,q);let B={aliasCount:0,count:1,res:void 0};q.anchors.set(W,B),q.onCreate=(G)=>{B.res=G,delete q.onCreate};let U=W.toJSON(Y,q);if(q.onCreate)q.onCreate(U);return U}if(typeof W==="bigint"&&!q?.keep)return Number(W);return W}Z.toJS=z}),s6=w((Z)=>{var X=e5(),z=u(),W=xZ();class Y{constructor(q){Object.defineProperty(this,z.NODE_TYPE,{value:q})}clone(){let q=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)q.range=this.range.slice();return q}toJS(q,{mapAsMap:B,maxAliasCount:U,onAnchor:G,reviver:H}={}){if(!z.isDocument(q))throw TypeError("A document argument is required");let _={anchors:new Map,doc:q,keep:!0,mapAsMap:B===!0,mapKeyWarned:!1,maxAliasCount:typeof U==="number"?U:100},$=W.toJS(this,"",_);if(typeof G==="function")for(let{count:Q,res:J}of _.anchors.values())G(J,Q);return typeof H==="function"?X.applyReviver(H,{"":$},"",$):$}}Z.NodeBase=Y}),t8=w((Z)=>{var X=o6(),z=r8(),W=u(),Y=s6(),q=xZ();class B extends Y.NodeBase{constructor(G){super(W.ALIAS);this.source=G,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve(G,H){let _;if(H?.aliasResolveCache)_=H.aliasResolveCache;else if(_=[],z.visit(G,{Node:(Q,J)=>{if(W.isAlias(J)||W.hasAnchor(J))_.push(J)}}),H)H.aliasResolveCache=_;let $=void 0;for(let Q of _){if(Q===this)break;if(Q.anchor===this.source)$=Q}return $}toJSON(G,H){if(!H)return{source:this.source};let{anchors:_,doc:$,maxAliasCount:Q}=H,J=this.resolve($,H);if(!J){let M=\`Unresolved alias (the anchor must be set before the alias): \${this.source}\`;throw ReferenceError(M)}let V=_.get(J);if(!V)q.toJS(J,null,H),V=_.get(J);if(V?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(Q>=0){if(V.count+=1,V.aliasCount===0)V.aliasCount=U($,J,_);if(V.count*V.aliasCount>Q)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return V.res}toString(G,H,_){let $=\`*\${this.source}\`;if(G){if(X.anchorIsValid(this.source),G.options.verifyAliasOrder&&!G.anchors.has(this.source)){let Q=\`Unresolved alias (the anchor must be set before the alias): \${this.source}\`;throw Error(Q)}if(G.implicitKey)return\`\${$} \`}return $}}function U(G,H,_){if(W.isAlias(H)){let $=H.resolve(G),Q=_&&$&&_.get($);return Q?Q.count*Q.aliasCount:0}else if(W.isCollection(H)){let $=0;for(let Q of H.items){let J=U(G,Q,_);if(J>$)$=J}return $}else if(W.isPair(H)){let $=U(G,H.key,_),Q=U(G,H.value,_);return Math.max($,Q)}return 1}Z.Alias=B}),q0=w((Z)=>{var X=u(),z=s6(),W=xZ(),Y=(B)=>!B||typeof B!=="function"&&typeof B!=="object";class q extends z.NodeBase{constructor(B){super(X.SCALAR);this.value=B}toJSON(B,U){return U?.keep?this.value:W.toJS(this.value,B,U)}toString(){return String(this.value)}}q.BLOCK_FOLDED="BLOCK_FOLDED",q.BLOCK_LITERAL="BLOCK_LITERAL",q.PLAIN="PLAIN",q.QUOTE_DOUBLE="QUOTE_DOUBLE",q.QUOTE_SINGLE="QUOTE_SINGLE",Z.Scalar=q,Z.isScalarValue=Y}),e8=w((Z)=>{var X=t8(),z=u(),W=q0(),Y="tag:yaml.org,2002:";function q(U,G,H){if(G){let _=H.filter((Q)=>Q.tag===G),$=_.find((Q)=>!Q.format)??_[0];if(!$)throw Error(\`Tag \${G} not found\`);return $}return H.find((_)=>_.identify?.(U)&&!_.format)}function B(U,G,H){if(z.isDocument(U))U=U.contents;if(z.isNode(U))return U;if(z.isPair(U)){let D=H.schema[z.MAP].createNode?.(H.schema,null,H);return D.items.push(U),D}if(U instanceof String||U instanceof Number||U instanceof Boolean||typeof BigInt<"u"&&U instanceof BigInt)U=U.valueOf();let{aliasDuplicateObjects:_,onAnchor:$,onTagObj:Q,schema:J,sourceObjects:V}=H,M=void 0;if(_&&U&&typeof U==="object")if(M=V.get(U),M)return M.anchor??(M.anchor=$(U)),new X.Alias(M.anchor);else M={anchor:null,node:null},V.set(U,M);if(G?.startsWith("!!"))G=Y+G.slice(2);let A=q(U,G,J.tags);if(!A){if(U&&typeof U.toJSON==="function")U=U.toJSON();if(!U||typeof U!=="object"){let D=new W.Scalar(U);if(M)M.node=D;return D}A=U instanceof Map?J[z.MAP]:(Symbol.iterator in Object(U))?J[z.SEQ]:J[z.MAP]}if(Q)Q(A),delete H.onTagObj;let L=A?.createNode?A.createNode(H.schema,U,H):typeof A?.nodeClass?.from==="function"?A.nodeClass.from(H.schema,U,H):new W.Scalar(U);if(G)L.tag=G;else if(!A.default)L.tag=A.tag;if(M)M.node=L;return L}Z.createNode=B}),a6=w((Z)=>{var X=e8(),z=u(),W=s6();function Y(U,G,H){let _=H;for(let $=G.length-1;$>=0;--$){let Q=G[$];if(typeof Q==="number"&&Number.isInteger(Q)&&Q>=0){let J=[];J[Q]=_,_=J}else _=new Map([[Q,_]])}return X.createNode(_,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:U,sourceObjects:new Map})}var q=(U)=>U==null||typeof U==="object"&&!!U[Symbol.iterator]().next().done;class B extends W.NodeBase{constructor(U,G){super(U);Object.defineProperty(this,"schema",{value:G,configurable:!0,enumerable:!1,writable:!0})}clone(U){let G=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(U)G.schema=U;if(G.items=G.items.map((H)=>z.isNode(H)||z.isPair(H)?H.clone(U):H),this.range)G.range=this.range.slice();return G}addIn(U,G){if(q(U))this.add(G);else{let[H,..._]=U,$=this.get(H,!0);if(z.isCollection($))$.addIn(_,G);else if($===void 0&&this.schema)this.set(H,Y(this.schema,_,G));else throw Error(\`Expected YAML collection at \${H}. Remaining path: \${_}\`)}}deleteIn(U){let[G,...H]=U;if(H.length===0)return this.delete(G);let _=this.get(G,!0);if(z.isCollection(_))return _.deleteIn(H);else throw Error(\`Expected YAML collection at \${G}. Remaining path: \${H}\`)}getIn(U,G){let[H,..._]=U,$=this.get(H,!0);if(_.length===0)return!G&&z.isScalar($)?$.value:$;else return z.isCollection($)?$.getIn(_,G):void 0}hasAllNullValues(U){return this.items.every((G)=>{if(!z.isPair(G))return!1;let H=G.value;return H==null||U&&z.isScalar(H)&&H.value==null&&!H.commentBefore&&!H.comment&&!H.tag})}hasIn(U){let[G,...H]=U;if(H.length===0)return this.has(G);let _=this.get(G,!0);return z.isCollection(_)?_.hasIn(H):!1}setIn(U,G){let[H,..._]=U;if(_.length===0)this.set(H,G);else{let $=this.get(H,!0);if(z.isCollection($))$.setIn(_,G);else if($===void 0&&this.schema)this.set(H,Y(this.schema,_,G));else throw Error(\`Expected YAML collection at \${H}. Remaining path: \${_}\`)}}}Z.Collection=B,Z.collectionFromPath=Y,Z.isEmptyPath=q}),Z6=w((Z)=>{var X=(Y)=>Y.replace(/^(?!$)(?: $)?/gm,"#");function z(Y,q){if(/^\\n+$/.test(Y))return Y.substring(1);return q?Y.replace(/^(?! *$)/gm,q):Y}var W=(Y,q,B)=>Y.endsWith(\`
22103
+ var EXTENSION_BUNDLE = `var j9=Object.defineProperty;var R9=(Z)=>Z;function S9(Z,X){this[Z]=R9.bind(null,X)}var m6=(Z,X)=>{for(var z in X)j9(Z,z,{get:X[z],enumerable:!0,configurable:!0,set:S9.bind(X,z)})};import{existsSync as fJ,readFileSync as bJ}from"node:fs";import{join as xJ}from"node:path";import{createRequire as C9}from"node:module";import{dirname as Uz,join as ZY}from"node:path";import{fileURLToPath as Gz}from"node:url";import{createRequire as DQ}from"node:module";import{homedir as l6,platform as FQ}from"node:os";import{basename as BY,dirname as UY,resolve as D8}from"node:path";import{existsSync as s8,readFileSync as Q5,readdirSync as AY,realpathSync as DY,statSync as LY}from"node:fs";import{dirname as FY,join as W5}from"node:path";import{existsSync as jQ,mkdirSync as KY,readFileSync as RQ,rmSync as jY,writeFileSync as RY}from"node:fs";import{homedir as L8}from"node:os";import{dirname as EY,join as O8,resolve as SQ}from"node:path";import{homedir as yQ}from"node:os";var{create:E9,getPrototypeOf:I9,defineProperty:y5,getOwnPropertyNames:T9}=Object,P9=Object.prototype.hasOwnProperty;function w9(Z){return this[Z]}var k9,f9,r5=(Z,X,z)=>{var W=Z!=null&&typeof Z==="object";if(W){var Y=X?k9??=new WeakMap:f9??=new WeakMap,q=Y.get(Z);if(q)return q}z=Z!=null?E9(I9(Z)):{};let B=X||!Z||!Z.__esModule?y5(z,"default",{value:Z,enumerable:!0}):z;for(let U of T9(Z))if(!P9.call(B,U))y5(B,U,{get:w9.bind(Z,U),enumerable:!0});if(W)Y.set(Z,B);return B},w=(Z,X)=>()=>(X||Z((X={exports:{}}).exports,X),X.exports),a8=C9(import.meta.url),u=w((Z)=>{var X=Symbol.for("yaml.alias"),z=Symbol.for("yaml.document"),W=Symbol.for("yaml.map"),Y=Symbol.for("yaml.pair"),q=Symbol.for("yaml.scalar"),B=Symbol.for("yaml.seq"),U=Symbol.for("yaml.node.type"),G=(D)=>!!D&&typeof D==="object"&&D[U]===X,H=(D)=>!!D&&typeof D==="object"&&D[U]===z,_=(D)=>!!D&&typeof D==="object"&&D[U]===W,$=(D)=>!!D&&typeof D==="object"&&D[U]===Y,Q=(D)=>!!D&&typeof D==="object"&&D[U]===q,J=(D)=>!!D&&typeof D==="object"&&D[U]===B;function V(D){if(D&&typeof D==="object")switch(D[U]){case W:case B:return!0}return!1}function M(D){if(D&&typeof D==="object")switch(D[U]){case X:case W:case q:case B:return!0}return!1}var A=(D)=>(Q(D)||V(D))&&!!D.anchor;Z.ALIAS=X,Z.DOC=z,Z.MAP=W,Z.NODE_TYPE=U,Z.PAIR=Y,Z.SCALAR=q,Z.SEQ=B,Z.hasAnchor=A,Z.isAlias=G,Z.isCollection=V,Z.isDocument=H,Z.isMap=_,Z.isNode=M,Z.isPair=$,Z.isScalar=Q,Z.isSeq=J}),r8=w((Z)=>{var X=u(),z=Symbol("break visit"),W=Symbol("skip children"),Y=Symbol("remove node");function q(Q,J){let V=H(J);if(X.isDocument(Q)){if(B(null,Q.contents,V,Object.freeze([Q]))===Y)Q.contents=null}else B(null,Q,V,Object.freeze([]))}q.BREAK=z,q.SKIP=W,q.REMOVE=Y;function B(Q,J,V,M){let A=_(Q,J,V,M);if(X.isNode(A)||X.isPair(A))return $(Q,M,A),B(Q,A,V,M);if(typeof A!=="symbol"){if(X.isCollection(J)){M=Object.freeze(M.concat(J));for(let D=0;D<J.items.length;++D){let L=B(D,J.items[D],V,M);if(typeof L==="number")D=L-1;else if(L===z)return z;else if(L===Y)J.items.splice(D,1),D-=1}}else if(X.isPair(J)){M=Object.freeze(M.concat(J));let D=B("key",J.key,V,M);if(D===z)return z;else if(D===Y)J.key=null;let L=B("value",J.value,V,M);if(L===z)return z;else if(L===Y)J.value=null}}return A}async function U(Q,J){let V=H(J);if(X.isDocument(Q)){if(await G(null,Q.contents,V,Object.freeze([Q]))===Y)Q.contents=null}else await G(null,Q,V,Object.freeze([]))}U.BREAK=z,U.SKIP=W,U.REMOVE=Y;async function G(Q,J,V,M){let A=await _(Q,J,V,M);if(X.isNode(A)||X.isPair(A))return $(Q,M,A),G(Q,A,V,M);if(typeof A!=="symbol"){if(X.isCollection(J)){M=Object.freeze(M.concat(J));for(let D=0;D<J.items.length;++D){let L=await G(D,J.items[D],V,M);if(typeof L==="number")D=L-1;else if(L===z)return z;else if(L===Y)J.items.splice(D,1),D-=1}}else if(X.isPair(J)){M=Object.freeze(M.concat(J));let D=await G("key",J.key,V,M);if(D===z)return z;else if(D===Y)J.key=null;let L=await G("value",J.value,V,M);if(L===z)return z;else if(L===Y)J.value=null}}return A}function H(Q){if(typeof Q==="object"&&(Q.Collection||Q.Node||Q.Value))return Object.assign({Alias:Q.Node,Map:Q.Node,Scalar:Q.Node,Seq:Q.Node},Q.Value&&{Map:Q.Value,Scalar:Q.Value,Seq:Q.Value},Q.Collection&&{Map:Q.Collection,Seq:Q.Collection},Q);return Q}function _(Q,J,V,M){if(typeof V==="function")return V(Q,J,M);if(X.isMap(J))return V.Map?.(Q,J,M);if(X.isSeq(J))return V.Seq?.(Q,J,M);if(X.isPair(J))return V.Pair?.(Q,J,M);if(X.isScalar(J))return V.Scalar?.(Q,J,M);if(X.isAlias(J))return V.Alias?.(Q,J,M);return}function $(Q,J,V){let M=J[J.length-1];if(X.isCollection(M))M.items[Q]=V;else if(X.isPair(M))if(Q==="key")M.key=V;else M.value=V;else if(X.isDocument(M))M.contents=V;else{let A=X.isAlias(M)?"alias":"scalar";throw Error(\`Cannot replace node with \${A} parent\`)}}Z.visit=q,Z.visitAsync=U}),t5=w((Z)=>{var X=u(),z=r8(),W={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Y=(B)=>B.replace(/[!,[\\]{}]/g,(U)=>W[U]);class q{constructor(B,U){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},q.defaultYaml,B),this.tags=Object.assign({},q.defaultTags,U)}clone(){let B=new q(this.yaml,this.tags);return B.docStart=this.docStart,B}atDocument(){let B=new q(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:q.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},q.defaultTags);break}return B}add(B,U){if(this.atNextDocument)this.yaml={explicit:q.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},q.defaultTags),this.atNextDocument=!1;let G=B.trim().split(/[ \\t]+/),H=G.shift();switch(H){case"%TAG":{if(G.length!==2){if(U(0,"%TAG directive should contain exactly two parts"),G.length<2)return!1}let[_,$]=G;return this.tags[_]=$,!0}case"%YAML":{if(this.yaml.explicit=!0,G.length!==1)return U(0,"%YAML directive should contain exactly one part"),!1;let[_]=G;if(_==="1.1"||_==="1.2")return this.yaml.version=_,!0;else{let $=/^\\d+\\.\\d+$/.test(_);return U(6,\`Unsupported YAML version \${_}\`,$),!1}}default:return U(0,\`Unknown directive \${H}\`,!0),!1}}tagName(B,U){if(B==="!")return"!";if(B[0]!=="!")return U(\`Not a valid tag: \${B}\`),null;if(B[1]==="<"){let $=B.slice(2,-1);if($==="!"||$==="!!")return U(\`Verbatim tags aren't resolved, so \${B} is invalid.\`),null;if(B[B.length-1]!==">")U("Verbatim tags must end with a >");return $}let[,G,H]=B.match(/^(.*!)([^!]*)$/s);if(!H)U(\`The \${B} tag has no suffix\`);let _=this.tags[G];if(_)try{return _+decodeURIComponent(H)}catch($){return U(String($)),null}if(G==="!")return B;return U(\`Could not resolve tag: \${B}\`),null}tagString(B){for(let[U,G]of Object.entries(this.tags))if(B.startsWith(G))return U+Y(B.substring(G.length));return B[0]==="!"?B:\`!<\${B}>\`}toString(B){let U=this.yaml.explicit?[\`%YAML \${this.yaml.version||"1.2"}\`]:[],G=Object.entries(this.tags),H;if(B&&G.length>0&&X.isNode(B.contents)){let _={};z.visit(B.contents,($,Q)=>{if(X.isNode(Q)&&Q.tag)_[Q.tag]=!0}),H=Object.keys(_)}else H=[];for(let[_,$]of G){if(_==="!!"&&$==="tag:yaml.org,2002:")continue;if(!B||H.some((Q)=>Q.startsWith($)))U.push(\`%TAG \${_} \${$}\`)}return U.join(\`
22104
+ \`)}}q.defaultYaml={explicit:!1,version:"1.2"},q.defaultTags={"!!":"tag:yaml.org,2002:"},Z.Directives=q}),o6=w((Z)=>{var X=u(),z=r8();function W(U){if(/[\\x00-\\x19\\s,[\\]{}]/.test(U)){let H=\`Anchor must not contain whitespace or control characters: \${JSON.stringify(U)}\`;throw Error(H)}return!0}function Y(U){let G=new Set;return z.visit(U,{Value(H,_){if(_.anchor)G.add(_.anchor)}}),G}function q(U,G){for(let H=1;;++H){let _=\`\${U}\${H}\`;if(!G.has(_))return _}}function B(U,G){let H=[],_=new Map,$=null;return{onAnchor:(Q)=>{H.push(Q),$??($=Y(U));let J=q(G,$);return $.add(J),J},setAnchors:()=>{for(let Q of H){let J=_.get(Q);if(typeof J==="object"&&J.anchor&&(X.isScalar(J.node)||X.isCollection(J.node)))J.node.anchor=J.anchor;else{let V=Error("Failed to resolve repeated object (this should not happen)");throw V.source=Q,V}}},sourceObjects:_}}Z.anchorIsValid=W,Z.anchorNames=Y,Z.createNodeAnchors=B,Z.findNewAnchor=q}),e5=w((Z)=>{function X(z,W,Y,q){if(q&&typeof q==="object")if(Array.isArray(q))for(let B=0,U=q.length;B<U;++B){let G=q[B],H=X(z,q,String(B),G);if(H===void 0)delete q[B];else if(H!==G)q[B]=H}else if(q instanceof Map)for(let B of Array.from(q.keys())){let U=q.get(B),G=X(z,q,B,U);if(G===void 0)q.delete(B);else if(G!==U)q.set(B,G)}else if(q instanceof Set)for(let B of Array.from(q)){let U=X(z,q,B,B);if(U===void 0)q.delete(B);else if(U!==B)q.delete(B),q.add(U)}else for(let[B,U]of Object.entries(q)){let G=X(z,q,B,U);if(G===void 0)delete q[B];else if(G!==U)q[B]=G}return z.call(W,Y,q)}Z.applyReviver=X}),xZ=w((Z)=>{var X=u();function z(W,Y,q){if(Array.isArray(W))return W.map((B,U)=>z(B,String(U),q));if(W&&typeof W.toJSON==="function"){if(!q||!X.hasAnchor(W))return W.toJSON(Y,q);let B={aliasCount:0,count:1,res:void 0};q.anchors.set(W,B),q.onCreate=(G)=>{B.res=G,delete q.onCreate};let U=W.toJSON(Y,q);if(q.onCreate)q.onCreate(U);return U}if(typeof W==="bigint"&&!q?.keep)return Number(W);return W}Z.toJS=z}),s6=w((Z)=>{var X=e5(),z=u(),W=xZ();class Y{constructor(q){Object.defineProperty(this,z.NODE_TYPE,{value:q})}clone(){let q=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)q.range=this.range.slice();return q}toJS(q,{mapAsMap:B,maxAliasCount:U,onAnchor:G,reviver:H}={}){if(!z.isDocument(q))throw TypeError("A document argument is required");let _={anchors:new Map,doc:q,keep:!0,mapAsMap:B===!0,mapKeyWarned:!1,maxAliasCount:typeof U==="number"?U:100},$=W.toJS(this,"",_);if(typeof G==="function")for(let{count:Q,res:J}of _.anchors.values())G(J,Q);return typeof H==="function"?X.applyReviver(H,{"":$},"",$):$}}Z.NodeBase=Y}),t8=w((Z)=>{var X=o6(),z=r8(),W=u(),Y=s6(),q=xZ();class B extends Y.NodeBase{constructor(G){super(W.ALIAS);this.source=G,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve(G,H){let _;if(H?.aliasResolveCache)_=H.aliasResolveCache;else if(_=[],z.visit(G,{Node:(Q,J)=>{if(W.isAlias(J)||W.hasAnchor(J))_.push(J)}}),H)H.aliasResolveCache=_;let $=void 0;for(let Q of _){if(Q===this)break;if(Q.anchor===this.source)$=Q}return $}toJSON(G,H){if(!H)return{source:this.source};let{anchors:_,doc:$,maxAliasCount:Q}=H,J=this.resolve($,H);if(!J){let M=\`Unresolved alias (the anchor must be set before the alias): \${this.source}\`;throw ReferenceError(M)}let V=_.get(J);if(!V)q.toJS(J,null,H),V=_.get(J);if(V?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(Q>=0){if(V.count+=1,V.aliasCount===0)V.aliasCount=U($,J,_);if(V.count*V.aliasCount>Q)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return V.res}toString(G,H,_){let $=\`*\${this.source}\`;if(G){if(X.anchorIsValid(this.source),G.options.verifyAliasOrder&&!G.anchors.has(this.source)){let Q=\`Unresolved alias (the anchor must be set before the alias): \${this.source}\`;throw Error(Q)}if(G.implicitKey)return\`\${$} \`}return $}}function U(G,H,_){if(W.isAlias(H)){let $=H.resolve(G),Q=_&&$&&_.get($);return Q?Q.count*Q.aliasCount:0}else if(W.isCollection(H)){let $=0;for(let Q of H.items){let J=U(G,Q,_);if(J>$)$=J}return $}else if(W.isPair(H)){let $=U(G,H.key,_),Q=U(G,H.value,_);return Math.max($,Q)}return 1}Z.Alias=B}),q0=w((Z)=>{var X=u(),z=s6(),W=xZ(),Y=(B)=>!B||typeof B!=="function"&&typeof B!=="object";class q extends z.NodeBase{constructor(B){super(X.SCALAR);this.value=B}toJSON(B,U){return U?.keep?this.value:W.toJS(this.value,B,U)}toString(){return String(this.value)}}q.BLOCK_FOLDED="BLOCK_FOLDED",q.BLOCK_LITERAL="BLOCK_LITERAL",q.PLAIN="PLAIN",q.QUOTE_DOUBLE="QUOTE_DOUBLE",q.QUOTE_SINGLE="QUOTE_SINGLE",Z.Scalar=q,Z.isScalarValue=Y}),e8=w((Z)=>{var X=t8(),z=u(),W=q0(),Y="tag:yaml.org,2002:";function q(U,G,H){if(G){let _=H.filter((Q)=>Q.tag===G),$=_.find((Q)=>!Q.format)??_[0];if(!$)throw Error(\`Tag \${G} not found\`);return $}return H.find((_)=>_.identify?.(U)&&!_.format)}function B(U,G,H){if(z.isDocument(U))U=U.contents;if(z.isNode(U))return U;if(z.isPair(U)){let L=H.schema[z.MAP].createNode?.(H.schema,null,H);return L.items.push(U),L}if(U instanceof String||U instanceof Number||U instanceof Boolean||typeof BigInt<"u"&&U instanceof BigInt)U=U.valueOf();let{aliasDuplicateObjects:_,onAnchor:$,onTagObj:Q,schema:J,sourceObjects:V}=H,M=void 0;if(_&&U&&typeof U==="object")if(M=V.get(U),M)return M.anchor??(M.anchor=$(U)),new X.Alias(M.anchor);else M={anchor:null,node:null},V.set(U,M);if(G?.startsWith("!!"))G=Y+G.slice(2);let A=q(U,G,J.tags);if(!A){if(U&&typeof U.toJSON==="function")U=U.toJSON();if(!U||typeof U!=="object"){let L=new W.Scalar(U);if(M)M.node=L;return L}A=U instanceof Map?J[z.MAP]:(Symbol.iterator in Object(U))?J[z.SEQ]:J[z.MAP]}if(Q)Q(A),delete H.onTagObj;let D=A?.createNode?A.createNode(H.schema,U,H):typeof A?.nodeClass?.from==="function"?A.nodeClass.from(H.schema,U,H):new W.Scalar(U);if(G)D.tag=G;else if(!A.default)D.tag=A.tag;if(M)M.node=D;return D}Z.createNode=B}),a6=w((Z)=>{var X=e8(),z=u(),W=s6();function Y(U,G,H){let _=H;for(let $=G.length-1;$>=0;--$){let Q=G[$];if(typeof Q==="number"&&Number.isInteger(Q)&&Q>=0){let J=[];J[Q]=_,_=J}else _=new Map([[Q,_]])}return X.createNode(_,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:U,sourceObjects:new Map})}var q=(U)=>U==null||typeof U==="object"&&!!U[Symbol.iterator]().next().done;class B extends W.NodeBase{constructor(U,G){super(U);Object.defineProperty(this,"schema",{value:G,configurable:!0,enumerable:!1,writable:!0})}clone(U){let G=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(U)G.schema=U;if(G.items=G.items.map((H)=>z.isNode(H)||z.isPair(H)?H.clone(U):H),this.range)G.range=this.range.slice();return G}addIn(U,G){if(q(U))this.add(G);else{let[H,..._]=U,$=this.get(H,!0);if(z.isCollection($))$.addIn(_,G);else if($===void 0&&this.schema)this.set(H,Y(this.schema,_,G));else throw Error(\`Expected YAML collection at \${H}. Remaining path: \${_}\`)}}deleteIn(U){let[G,...H]=U;if(H.length===0)return this.delete(G);let _=this.get(G,!0);if(z.isCollection(_))return _.deleteIn(H);else throw Error(\`Expected YAML collection at \${G}. Remaining path: \${H}\`)}getIn(U,G){let[H,..._]=U,$=this.get(H,!0);if(_.length===0)return!G&&z.isScalar($)?$.value:$;else return z.isCollection($)?$.getIn(_,G):void 0}hasAllNullValues(U){return this.items.every((G)=>{if(!z.isPair(G))return!1;let H=G.value;return H==null||U&&z.isScalar(H)&&H.value==null&&!H.commentBefore&&!H.comment&&!H.tag})}hasIn(U){let[G,...H]=U;if(H.length===0)return this.has(G);let _=this.get(G,!0);return z.isCollection(_)?_.hasIn(H):!1}setIn(U,G){let[H,..._]=U;if(_.length===0)this.set(H,G);else{let $=this.get(H,!0);if(z.isCollection($))$.setIn(_,G);else if($===void 0&&this.schema)this.set(H,Y(this.schema,_,G));else throw Error(\`Expected YAML collection at \${H}. Remaining path: \${_}\`)}}}Z.Collection=B,Z.collectionFromPath=Y,Z.isEmptyPath=q}),Z6=w((Z)=>{var X=(Y)=>Y.replace(/^(?!$)(?: $)?/gm,"#");function z(Y,q){if(/^\\n+$/.test(Y))return Y.substring(1);return q?Y.replace(/^(?! *$)/gm,q):Y}var W=(Y,q,B)=>Y.endsWith(\`
22105
22105
  \`)?z(B,q):B.includes(\`
22106
22106
  \`)?\`
22107
- \`+z(B,q):(Y.endsWith(" ")?"":" ")+B;Z.indentComment=z,Z.lineComment=W,Z.stringifyComment=X}),b9=w((Z)=>{var X="flow",z="block",W="quoted";function Y(B,U,G="flow",{indentAtStart:H,lineWidth:_=80,minContentWidth:$=20,onFold:Q,onOverflow:J}={}){if(!_||_<0)return B;if(_<$)$=0;let V=Math.max(1+$,1+_-U.length);if(B.length<=V)return B;let M=[],A={},L=_-U.length;if(typeof H==="number")if(H>_-Math.max(2,$))M.push(0);else L=_-H;let D=void 0,F=void 0,j=!1,N=-1,K=-1,E=-1;if(G===z){if(N=q(B,N,U.length),N!==-1)L=N+V}for(let P;P=B[N+=1];){if(G===W&&P==="\\\\"){switch(K=N,B[N+1]){case"x":N+=3;break;case"u":N+=5;break;case"U":N+=9;break;default:N+=1}E=N}if(P===\`
22108
- \`){if(G===z)N=q(B,N,U.length);L=N+U.length+V,D=void 0}else{if(P===" "&&F&&F!==" "&&F!==\`
22107
+ \`+z(B,q):(Y.endsWith(" ")?"":" ")+B;Z.indentComment=z,Z.lineComment=W,Z.stringifyComment=X}),b9=w((Z)=>{var X="flow",z="block",W="quoted";function Y(B,U,G="flow",{indentAtStart:H,lineWidth:_=80,minContentWidth:$=20,onFold:Q,onOverflow:J}={}){if(!_||_<0)return B;if(_<$)$=0;let V=Math.max(1+$,1+_-U.length);if(B.length<=V)return B;let M=[],A={},D=_-U.length;if(typeof H==="number")if(H>_-Math.max(2,$))M.push(0);else D=_-H;let L=void 0,F=void 0,j=!1,N=-1,K=-1,E=-1;if(G===z){if(N=q(B,N,U.length),N!==-1)D=N+V}for(let P;P=B[N+=1];){if(G===W&&P==="\\\\"){switch(K=N,B[N+1]){case"x":N+=3;break;case"u":N+=5;break;case"U":N+=9;break;default:N+=1}E=N}if(P===\`
22108
+ \`){if(G===z)N=q(B,N,U.length);D=N+U.length+V,L=void 0}else{if(P===" "&&F&&F!==" "&&F!==\`
22109
22109
  \`&&F!=="\\t"){let C=B[N+1];if(C&&C!==" "&&C!==\`
22110
- \`&&C!=="\\t")D=N}if(N>=L)if(D)M.push(D),L=D+V,D=void 0;else if(G===W){while(F===" "||F==="\\t")F=P,P=B[N+=1],j=!0;let C=N>E+1?N-2:K-1;if(A[C])return B;M.push(C),A[C]=!0,L=C+V,D=void 0}else j=!0}F=P}if(j&&J)J();if(M.length===0)return B;if(Q)Q();let T=B.slice(0,M[0]);for(let P=0;P<M.length;++P){let C=M[P],k=M[P+1]||B.length;if(C===0)T=\`
22110
+ \`&&C!=="\\t")L=N}if(N>=D)if(L)M.push(L),D=L+V,L=void 0;else if(G===W){while(F===" "||F==="\\t")F=P,P=B[N+=1],j=!0;let C=N>E+1?N-2:K-1;if(A[C])return B;M.push(C),A[C]=!0,D=C+V,L=void 0}else j=!0}F=P}if(j&&J)J();if(M.length===0)return B;if(Q)Q();let T=B.slice(0,M[0]);for(let P=0;P<M.length;++P){let C=M[P],k=M[P+1]||B.length;if(C===0)T=\`
22111
22111
  \${U}\${B.slice(0,k)}\`;else{if(G===W&&A[C])T+=\`\${B[C]}\\\\\`;T+=\`
22112
22112
  \${U}\${B.slice(C+1,k)}\`}}return T}function q(B,U,G){let H=U,_=U+1,$=B[_];while($===" "||$==="\\t")if(U<_+G)$=B[++U];else{do $=B[++U];while($&&$!==\`
22113
- \`);H=U,_=U+1,$=B[_]}return H}Z.FOLD_BLOCK=z,Z.FOLD_FLOW=X,Z.FOLD_QUOTED=W,Z.foldFlowLines=Y}),X6=w((Z)=>{var X=q0(),z=b9(),W=(J,V)=>({indentAtStart:V?J.indent.length:J.indentAtStart,lineWidth:J.options.lineWidth,minContentWidth:J.options.minContentWidth}),Y=(J)=>/^(%|---|\\.\\.\\.)/m.test(J);function q(J,V,M){if(!V||V<0)return!1;let A=V-M,L=J.length;if(L<=A)return!1;for(let D=0,F=0;D<L;++D)if(J[D]===\`
22114
- \`){if(D-F>A)return!0;if(F=D+1,L-F<=A)return!1}return!0}function B(J,V){let M=JSON.stringify(J);if(V.options.doubleQuotedAsJSON)return M;let{implicitKey:A}=V,L=V.options.doubleQuotedMinMultiLineLength,D=V.indent||(Y(J)?" ":""),F="",j=0;for(let N=0,K=M[N];K;K=M[++N]){if(K===" "&&M[N+1]==="\\\\"&&M[N+2]==="n")F+=M.slice(j,N)+"\\\\ ",N+=1,j=N,K="\\\\";if(K==="\\\\")switch(M[N+1]){case"u":{F+=M.slice(j,N);let E=M.substr(N+2,4);switch(E){case"0000":F+="\\\\0";break;case"0007":F+="\\\\a";break;case"000b":F+="\\\\v";break;case"001b":F+="\\\\e";break;case"0085":F+="\\\\N";break;case"00a0":F+="\\\\_";break;case"2028":F+="\\\\L";break;case"2029":F+="\\\\P";break;default:if(E.substr(0,2)==="00")F+="\\\\x"+E.substr(2);else F+=M.substr(N,6)}N+=5,j=N+1}break;case"n":if(A||M[N+2]==='"'||M.length<L)N+=1;else{F+=M.slice(j,N)+\`
22113
+ \`);H=U,_=U+1,$=B[_]}return H}Z.FOLD_BLOCK=z,Z.FOLD_FLOW=X,Z.FOLD_QUOTED=W,Z.foldFlowLines=Y}),X6=w((Z)=>{var X=q0(),z=b9(),W=(J,V)=>({indentAtStart:V?J.indent.length:J.indentAtStart,lineWidth:J.options.lineWidth,minContentWidth:J.options.minContentWidth}),Y=(J)=>/^(%|---|\\.\\.\\.)/m.test(J);function q(J,V,M){if(!V||V<0)return!1;let A=V-M,D=J.length;if(D<=A)return!1;for(let L=0,F=0;L<D;++L)if(J[L]===\`
22114
+ \`){if(L-F>A)return!0;if(F=L+1,D-F<=A)return!1}return!0}function B(J,V){let M=JSON.stringify(J);if(V.options.doubleQuotedAsJSON)return M;let{implicitKey:A}=V,D=V.options.doubleQuotedMinMultiLineLength,L=V.indent||(Y(J)?" ":""),F="",j=0;for(let N=0,K=M[N];K;K=M[++N]){if(K===" "&&M[N+1]==="\\\\"&&M[N+2]==="n")F+=M.slice(j,N)+"\\\\ ",N+=1,j=N,K="\\\\";if(K==="\\\\")switch(M[N+1]){case"u":{F+=M.slice(j,N);let E=M.substr(N+2,4);switch(E){case"0000":F+="\\\\0";break;case"0007":F+="\\\\a";break;case"000b":F+="\\\\v";break;case"001b":F+="\\\\e";break;case"0085":F+="\\\\N";break;case"00a0":F+="\\\\_";break;case"2028":F+="\\\\L";break;case"2029":F+="\\\\P";break;default:if(E.substr(0,2)==="00")F+="\\\\x"+E.substr(2);else F+=M.substr(N,6)}N+=5,j=N+1}break;case"n":if(A||M[N+2]==='"'||M.length<D)N+=1;else{F+=M.slice(j,N)+\`
22115
22115
 
22116
22116
  \`;while(M[N+2]==="\\\\"&&M[N+3]==="n"&&M[N+4]!=='"')F+=\`
22117
- \`,N+=2;if(F+=D,M[N+2]===" ")F+="\\\\";N+=1,j=N+1}break;default:N+=1}}return F=j?F+M.slice(j):M,A?F:z.foldFlowLines(F,D,z.FOLD_QUOTED,W(V,!1))}function U(J,V){if(V.options.singleQuote===!1||V.implicitKey&&J.includes(\`
22117
+ \`,N+=2;if(F+=L,M[N+2]===" ")F+="\\\\";N+=1,j=N+1}break;default:N+=1}}return F=j?F+M.slice(j):M,A?F:z.foldFlowLines(F,L,z.FOLD_QUOTED,W(V,!1))}function U(J,V){if(V.options.singleQuote===!1||V.implicitKey&&J.includes(\`
22118
22118
  \`)||/[ \\t]\\n|\\n[ \\t]/.test(J))return B(J,V);let M=V.indent||(Y(J)?" ":""),A="'"+J.replace(/'/g,"''").replace(/\\n+/g,\`$&
22119
- \${M}\`)+"'";return V.implicitKey?A:z.foldFlowLines(A,M,z.FOLD_FLOW,W(V,!1))}function G(J,V){let{singleQuote:M}=V.options,A;if(M===!1)A=B;else{let L=J.includes('"'),D=J.includes("'");if(L&&!D)A=U;else if(D&&!L)A=B;else A=M?U:B}return A(J,V)}var H;try{H=new RegExp(\`(^|(?<!
22119
+ \${M}\`)+"'";return V.implicitKey?A:z.foldFlowLines(A,M,z.FOLD_FLOW,W(V,!1))}function G(J,V){let{singleQuote:M}=V.options,A;if(M===!1)A=B;else{let D=J.includes('"'),L=J.includes("'");if(D&&!L)A=U;else if(L&&!D)A=B;else A=M?U:B}return A(J,V)}var H;try{H=new RegExp(\`(^|(?<!
22120
22120
  ))
22121
22121
  +(?!
22122
- |$)\`,"g")}catch{H=/\\n+(?!\\n|$)/g}function _({comment:J,type:V,value:M},A,L,D){let{blockQuote:F,commentString:j,lineWidth:N}=A.options;if(!F||/\\n[\\t ]+$/.test(M))return G(M,A);let K=A.indent||(A.forceBlockIndent||Y(M)?" ":""),E=F==="literal"?!0:F==="folded"||V===X.Scalar.BLOCK_FOLDED?!1:V===X.Scalar.BLOCK_LITERAL?!0:!q(M,N,K.length);if(!M)return E?\`|
22122
+ |$)\`,"g")}catch{H=/\\n+(?!\\n|$)/g}function _({comment:J,type:V,value:M},A,D,L){let{blockQuote:F,commentString:j,lineWidth:N}=A.options;if(!F||/\\n[\\t ]+$/.test(M))return G(M,A);let K=A.indent||(A.forceBlockIndent||Y(M)?" ":""),E=F==="literal"?!0:F==="folded"||V===X.Scalar.BLOCK_FOLDED?!1:V===X.Scalar.BLOCK_LITERAL?!0:!q(M,N,K.length);if(!M)return E?\`|
22123
22123
  \`:\`>
22124
22124
  \`;let T,P;for(P=M.length;P>0;--P){let x=M[P-1];if(x!==\`
22125
22125
  \`&&x!=="\\t"&&x!==" ")break}let C=M.substring(P),k=C.indexOf(\`
22126
- \`);if(k===-1)T="-";else if(M===C||k!==C.length-1){if(T="+",D)D()}else T="";if(C){if(M=M.slice(0,-C.length),C[C.length-1]===\`
22126
+ \`);if(k===-1)T="-";else if(M===C||k!==C.length-1){if(T="+",L)L()}else T="";if(C){if(M=M.slice(0,-C.length),C[C.length-1]===\`
22127
22127
  \`)C=C.slice(0,-1);C=C.replace(H,\`$&\${K}\`)}let f=!1,l,U0=-1;for(l=0;l<M.length;++l){let x=M[l];if(x===" ")f=!0;else if(x===\`
22128
- \`)U0=l;else break}let Q0=M.substring(0,U0<l?U0+1:l);if(Q0)M=M.substring(Q0.length),Q0=Q0.replace(/\\n+/g,\`$&\${K}\`);let G0=(f?K?"2":"1":"")+T;if(J){if(G0+=" "+j(J.replace(/ ?[\\r\\n]+/g," ")),L)L()}if(!E){let x=M.replace(/\\n+/g,\`
22128
+ \`)U0=l;else break}let Q0=M.substring(0,U0<l?U0+1:l);if(Q0)M=M.substring(Q0.length),Q0=Q0.replace(/\\n+/g,\`$&\${K}\`);let G0=(f?K?"2":"1":"")+T;if(J){if(G0+=" "+j(J.replace(/ ?[\\r\\n]+/g," ")),D)D()}if(!E){let x=M.replace(/\\n+/g,\`
22129
22129
  $&\`).replace(/(?:^|\\n)([\\t ].*)(?:([\\n\\t ]*)\\n(?![\\n\\t ]))?/g,"$1$2").replace(/\\n+/g,\`$&\${K}\`),K0=!1,X0=W(A,!0);if(F!=="folded"&&V!==X.Scalar.BLOCK_FOLDED)X0.onOverflow=()=>{K0=!0};let j0=z.foldFlowLines(\`\${Q0}\${x}\${C}\`,K,z.FOLD_BLOCK,X0);if(!K0)return\`>\${G0}
22130
22130
  \${K}\${j0}\`}return M=M.replace(/\\n+/g,\`$&\${K}\`),\`|\${G0}
22131
- \${K}\${Q0}\${M}\${C}\`}function $(J,V,M,A){let{type:L,value:D}=J,{actualString:F,implicitKey:j,indent:N,indentStep:K,inFlow:E}=V;if(j&&D.includes(\`
22132
- \`)||E&&/[[\\]{},]/.test(D))return G(D,V);if(/^[\\n\\t ,[\\]{}#&*!|>'"%@\`]|^[?-]$|^[?-][ \\t]|[\\n:][ \\t]|[ \\t]\\n|[\\n\\t ]#|[\\n\\t :]$/.test(D))return j||E||!D.includes(\`
22133
- \`)?G(D,V):_(J,V,M,A);if(!j&&!E&&L!==X.Scalar.PLAIN&&D.includes(\`
22134
- \`))return _(J,V,M,A);if(Y(D)){if(N==="")return V.forceBlockIndent=!0,_(J,V,M,A);else if(j&&N===K)return G(D,V)}let T=D.replace(/\\n+/g,\`$&
22135
- \${N}\`);if(F){let P=(f)=>f.default&&f.tag!=="tag:yaml.org,2002:str"&&f.test?.test(T),{compat:C,tags:k}=V.doc.schema;if(k.some(P)||C?.some(P))return G(D,V)}return j?T:z.foldFlowLines(T,N,z.FOLD_FLOW,W(V,!1))}function Q(J,V,M,A){let{implicitKey:L,inFlow:D}=V,F=typeof J.value==="string"?J:Object.assign({},J,{value:String(J.value)}),{type:j}=J;if(j!==X.Scalar.QUOTE_DOUBLE){if(/[\\x00-\\x08\\x0b-\\x1f\\x7f-\\x9f\\u{D800}-\\u{DFFF}]/u.test(F.value))j=X.Scalar.QUOTE_DOUBLE}let N=(E)=>{switch(E){case X.Scalar.BLOCK_FOLDED:case X.Scalar.BLOCK_LITERAL:return L||D?G(F.value,V):_(F,V,M,A);case X.Scalar.QUOTE_DOUBLE:return B(F.value,V);case X.Scalar.QUOTE_SINGLE:return U(F.value,V);case X.Scalar.PLAIN:return $(F,V,M,A);default:return null}},K=N(j);if(K===null){let{defaultKeyType:E,defaultStringType:T}=V.options,P=L&&E||T;if(K=N(P),K===null)throw Error(\`Unsupported default string type \${P}\`)}return K}Z.stringifyString=Q}),z6=w((Z)=>{var X=o6(),z=u(),W=Z6(),Y=X6();function q(H,_){let $=Object.assign({blockQuote:!0,commentString:W.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},H.schema.toStringOptions,_),Q;switch($.collectionStyle){case"block":Q=!1;break;case"flow":Q=!0;break;default:Q=null}return{anchors:new Set,doc:H,flowCollectionPadding:$.flowCollectionPadding?" ":"",indent:"",indentStep:typeof $.indent==="number"?" ".repeat($.indent):" ",inFlow:Q,options:$}}function B(H,_){if(_.tag){let J=H.filter((V)=>V.tag===_.tag);if(J.length>0)return J.find((V)=>V.format===_.format)??J[0]}let $=void 0,Q;if(z.isScalar(_)){Q=_.value;let J=H.filter((V)=>V.identify?.(Q));if(J.length>1){let V=J.filter((M)=>M.test);if(V.length>0)J=V}$=J.find((V)=>V.format===_.format)??J.find((V)=>!V.format)}else Q=_,$=H.find((J)=>J.nodeClass&&Q instanceof J.nodeClass);if(!$){let J=Q?.constructor?.name??(Q===null?"null":typeof Q);throw Error(\`Tag not resolved for \${J} value\`)}return $}function U(H,_,{anchors:$,doc:Q}){if(!Q.directives)return"";let J=[],V=(z.isScalar(H)||z.isCollection(H))&&H.anchor;if(V&&X.anchorIsValid(V))$.add(V),J.push(\`&\${V}\`);let M=H.tag??(_.default?null:_.tag);if(M)J.push(Q.directives.tagString(M));return J.join(" ")}function G(H,_,$,Q){if(z.isPair(H))return H.toString(_,$,Q);if(z.isAlias(H)){if(_.doc.directives)return H.toString(_);if(_.resolvedAliases?.has(H))throw TypeError("Cannot stringify circular structure without alias nodes");else{if(_.resolvedAliases)_.resolvedAliases.add(H);else _.resolvedAliases=new Set([H]);H=H.resolve(_.doc)}}let J=void 0,V=z.isNode(H)?H:_.doc.createNode(H,{onTagObj:(L)=>J=L});J??(J=B(_.doc.schema.tags,V));let M=U(V,J,_);if(M.length>0)_.indentAtStart=(_.indentAtStart??0)+M.length+1;let A=typeof J.stringify==="function"?J.stringify(V,_,$,Q):z.isScalar(V)?Y.stringifyString(V,_,$,Q):V.toString(_,$,Q);if(!M)return A;return z.isScalar(V)||A[0]==="{"||A[0]==="["?\`\${M} \${A}\`:\`\${M}
22136
- \${_.indent}\${A}\`}Z.createStringifyContext=q,Z.stringify=G}),x9=w((Z)=>{var X=u(),z=q0(),W=z6(),Y=Z6();function q({key:B,value:U},G,H,_){let{allNullValues:$,doc:Q,indent:J,indentStep:V,options:{commentString:M,indentSeq:A,simpleKeys:L}}=G,D=X.isNode(B)&&B.comment||null;if(L){if(D)throw Error("With simple keys, key nodes cannot have comments");if(X.isCollection(B)||!X.isNode(B)&&typeof B==="object")throw Error("With simple keys, collection cannot be used as a key value")}let F=!L&&(!B||D&&U==null&&!G.inFlow||X.isCollection(B)||(X.isScalar(B)?B.type===z.Scalar.BLOCK_FOLDED||B.type===z.Scalar.BLOCK_LITERAL:typeof B==="object"));G=Object.assign({},G,{allNullValues:!1,implicitKey:!F&&(L||!$),indent:J+V});let j=!1,N=!1,K=W.stringify(B,G,()=>j=!0,()=>N=!0);if(!F&&!G.inFlow&&K.length>1024){if(L)throw Error("With simple keys, single line scalar must not span more than 1024 characters");F=!0}if(G.inFlow){if($||U==null){if(j&&H)H();return K===""?"?":F?\`? \${K}\`:K}}else if($&&!L||U==null&&F){if(K=\`? \${K}\`,D&&!j)K+=Y.lineComment(K,G.indent,M(D));else if(N&&_)_();return K}if(j)D=null;if(F){if(D)K+=Y.lineComment(K,G.indent,M(D));K=\`? \${K}
22137
- \${J}:\`}else if(K=\`\${K}:\`,D)K+=Y.lineComment(K,G.indent,M(D));let E,T,P;if(X.isNode(U))E=!!U.spaceBefore,T=U.commentBefore,P=U.comment;else if(E=!1,T=null,P=null,U&&typeof U==="object")U=Q.createNode(U);if(G.implicitKey=!1,!F&&!D&&X.isScalar(U))G.indentAtStart=K.length+1;if(N=!1,!A&&V.length>=2&&!G.inFlow&&!F&&X.isSeq(U)&&!U.flow&&!U.tag&&!U.anchor)G.indent=G.indent.substring(2);let C=!1,k=W.stringify(U,G,()=>C=!0,()=>N=!0),f=" ";if(D||E||T){if(f=E?\`
22131
+ \${K}\${Q0}\${M}\${C}\`}function $(J,V,M,A){let{type:D,value:L}=J,{actualString:F,implicitKey:j,indent:N,indentStep:K,inFlow:E}=V;if(j&&L.includes(\`
22132
+ \`)||E&&/[[\\]{},]/.test(L))return G(L,V);if(/^[\\n\\t ,[\\]{}#&*!|>'"%@\`]|^[?-]$|^[?-][ \\t]|[\\n:][ \\t]|[ \\t]\\n|[\\n\\t ]#|[\\n\\t :]$/.test(L))return j||E||!L.includes(\`
22133
+ \`)?G(L,V):_(J,V,M,A);if(!j&&!E&&D!==X.Scalar.PLAIN&&L.includes(\`
22134
+ \`))return _(J,V,M,A);if(Y(L)){if(N==="")return V.forceBlockIndent=!0,_(J,V,M,A);else if(j&&N===K)return G(L,V)}let T=L.replace(/\\n+/g,\`$&
22135
+ \${N}\`);if(F){let P=(f)=>f.default&&f.tag!=="tag:yaml.org,2002:str"&&f.test?.test(T),{compat:C,tags:k}=V.doc.schema;if(k.some(P)||C?.some(P))return G(L,V)}return j?T:z.foldFlowLines(T,N,z.FOLD_FLOW,W(V,!1))}function Q(J,V,M,A){let{implicitKey:D,inFlow:L}=V,F=typeof J.value==="string"?J:Object.assign({},J,{value:String(J.value)}),{type:j}=J;if(j!==X.Scalar.QUOTE_DOUBLE){if(/[\\x00-\\x08\\x0b-\\x1f\\x7f-\\x9f\\u{D800}-\\u{DFFF}]/u.test(F.value))j=X.Scalar.QUOTE_DOUBLE}let N=(E)=>{switch(E){case X.Scalar.BLOCK_FOLDED:case X.Scalar.BLOCK_LITERAL:return D||L?G(F.value,V):_(F,V,M,A);case X.Scalar.QUOTE_DOUBLE:return B(F.value,V);case X.Scalar.QUOTE_SINGLE:return U(F.value,V);case X.Scalar.PLAIN:return $(F,V,M,A);default:return null}},K=N(j);if(K===null){let{defaultKeyType:E,defaultStringType:T}=V.options,P=D&&E||T;if(K=N(P),K===null)throw Error(\`Unsupported default string type \${P}\`)}return K}Z.stringifyString=Q}),z6=w((Z)=>{var X=o6(),z=u(),W=Z6(),Y=X6();function q(H,_){let $=Object.assign({blockQuote:!0,commentString:W.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},H.schema.toStringOptions,_),Q;switch($.collectionStyle){case"block":Q=!1;break;case"flow":Q=!0;break;default:Q=null}return{anchors:new Set,doc:H,flowCollectionPadding:$.flowCollectionPadding?" ":"",indent:"",indentStep:typeof $.indent==="number"?" ".repeat($.indent):" ",inFlow:Q,options:$}}function B(H,_){if(_.tag){let J=H.filter((V)=>V.tag===_.tag);if(J.length>0)return J.find((V)=>V.format===_.format)??J[0]}let $=void 0,Q;if(z.isScalar(_)){Q=_.value;let J=H.filter((V)=>V.identify?.(Q));if(J.length>1){let V=J.filter((M)=>M.test);if(V.length>0)J=V}$=J.find((V)=>V.format===_.format)??J.find((V)=>!V.format)}else Q=_,$=H.find((J)=>J.nodeClass&&Q instanceof J.nodeClass);if(!$){let J=Q?.constructor?.name??(Q===null?"null":typeof Q);throw Error(\`Tag not resolved for \${J} value\`)}return $}function U(H,_,{anchors:$,doc:Q}){if(!Q.directives)return"";let J=[],V=(z.isScalar(H)||z.isCollection(H))&&H.anchor;if(V&&X.anchorIsValid(V))$.add(V),J.push(\`&\${V}\`);let M=H.tag??(_.default?null:_.tag);if(M)J.push(Q.directives.tagString(M));return J.join(" ")}function G(H,_,$,Q){if(z.isPair(H))return H.toString(_,$,Q);if(z.isAlias(H)){if(_.doc.directives)return H.toString(_);if(_.resolvedAliases?.has(H))throw TypeError("Cannot stringify circular structure without alias nodes");else{if(_.resolvedAliases)_.resolvedAliases.add(H);else _.resolvedAliases=new Set([H]);H=H.resolve(_.doc)}}let J=void 0,V=z.isNode(H)?H:_.doc.createNode(H,{onTagObj:(D)=>J=D});J??(J=B(_.doc.schema.tags,V));let M=U(V,J,_);if(M.length>0)_.indentAtStart=(_.indentAtStart??0)+M.length+1;let A=typeof J.stringify==="function"?J.stringify(V,_,$,Q):z.isScalar(V)?Y.stringifyString(V,_,$,Q):V.toString(_,$,Q);if(!M)return A;return z.isScalar(V)||A[0]==="{"||A[0]==="["?\`\${M} \${A}\`:\`\${M}
22136
+ \${_.indent}\${A}\`}Z.createStringifyContext=q,Z.stringify=G}),x9=w((Z)=>{var X=u(),z=q0(),W=z6(),Y=Z6();function q({key:B,value:U},G,H,_){let{allNullValues:$,doc:Q,indent:J,indentStep:V,options:{commentString:M,indentSeq:A,simpleKeys:D}}=G,L=X.isNode(B)&&B.comment||null;if(D){if(L)throw Error("With simple keys, key nodes cannot have comments");if(X.isCollection(B)||!X.isNode(B)&&typeof B==="object")throw Error("With simple keys, collection cannot be used as a key value")}let F=!D&&(!B||L&&U==null&&!G.inFlow||X.isCollection(B)||(X.isScalar(B)?B.type===z.Scalar.BLOCK_FOLDED||B.type===z.Scalar.BLOCK_LITERAL:typeof B==="object"));G=Object.assign({},G,{allNullValues:!1,implicitKey:!F&&(D||!$),indent:J+V});let j=!1,N=!1,K=W.stringify(B,G,()=>j=!0,()=>N=!0);if(!F&&!G.inFlow&&K.length>1024){if(D)throw Error("With simple keys, single line scalar must not span more than 1024 characters");F=!0}if(G.inFlow){if($||U==null){if(j&&H)H();return K===""?"?":F?\`? \${K}\`:K}}else if($&&!D||U==null&&F){if(K=\`? \${K}\`,L&&!j)K+=Y.lineComment(K,G.indent,M(L));else if(N&&_)_();return K}if(j)L=null;if(F){if(L)K+=Y.lineComment(K,G.indent,M(L));K=\`? \${K}
22137
+ \${J}:\`}else if(K=\`\${K}:\`,L)K+=Y.lineComment(K,G.indent,M(L));let E,T,P;if(X.isNode(U))E=!!U.spaceBefore,T=U.commentBefore,P=U.comment;else if(E=!1,T=null,P=null,U&&typeof U==="object")U=Q.createNode(U);if(G.implicitKey=!1,!F&&!L&&X.isScalar(U))G.indentAtStart=K.length+1;if(N=!1,!A&&V.length>=2&&!G.inFlow&&!F&&X.isSeq(U)&&!U.flow&&!U.tag&&!U.anchor)G.indent=G.indent.substring(2);let C=!1,k=W.stringify(U,G,()=>C=!0,()=>N=!0),f=" ";if(L||E||T){if(f=E?\`
22138
22138
  \`:"",T){let l=M(T);f+=\`
22139
22139
  \${Y.indentComment(l,G.indent)}\`}if(k===""&&!G.inFlow){if(f===\`
22140
22140
  \`&&P)f=\`
@@ -22143,76 +22143,76 @@ $&\`).replace(/(?:^|\\n)([\\t ].*)(?:([\\n\\t ]*)\\n(?![\\n\\t ]))?/g,"$1$2").re
22143
22143
  \${G.indent}\`}else if(!F&&X.isCollection(U)){let l=k[0],U0=k.indexOf(\`
22144
22144
  \`),Q0=U0!==-1,l0=G.inFlow??U.flow??U.items.length===0;if(Q0||!l0){let G0=!1;if(Q0&&(l==="&"||l==="!")){let x=k.indexOf(" ");if(l==="&"&&x!==-1&&x<U0&&k[x+1]==="!")x=k.indexOf(" ",x+1);if(x===-1||U0<x)G0=!0}if(!G0)f=\`
22145
22145
  \${G.indent}\`}}else if(k===""||k[0]===\`
22146
- \`)f="";if(K+=f+k,G.inFlow){if(C&&H)H()}else if(P&&!C)K+=Y.lineComment(K,G.indent,M(P));else if(N&&_)_();return K}Z.stringifyPair=q}),Z7=w((Z)=>{var X=a8("process");function z(Y,...q){if(Y==="debug")console.log(...q)}function W(Y,q){if(Y==="debug"||Y==="warn")if(typeof X.emitWarning==="function")X.emitWarning(q);else console.warn(q)}Z.debug=z,Z.warn=W}),r6=w((Z)=>{var X=u(),z=q0(),W="<<",Y={identify:(G)=>G===W||typeof G==="symbol"&&G.description===W,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new z.Scalar(Symbol(W)),{addToJSMap:B}),stringify:()=>W},q=(G,H)=>(Y.identify(H)||X.isScalar(H)&&(!H.type||H.type===z.Scalar.PLAIN)&&Y.identify(H.value))&&G?.doc.schema.tags.some((_)=>_.tag===Y.tag&&_.default);function B(G,H,_){if(_=G&&X.isAlias(_)?_.resolve(G.doc):_,X.isSeq(_))for(let $ of _.items)U(G,H,$);else if(Array.isArray(_))for(let $ of _)U(G,H,$);else U(G,H,_)}function U(G,H,_){let $=G&&X.isAlias(_)?_.resolve(G.doc):_;if(!X.isMap($))throw Error("Merge sources must be maps or map aliases");let Q=$.toJSON(null,G,Map);for(let[J,V]of Q)if(H instanceof Map){if(!H.has(J))H.set(J,V)}else if(H instanceof Set)H.add(J);else if(!Object.prototype.hasOwnProperty.call(H,J))Object.defineProperty(H,J,{value:V,writable:!0,enumerable:!0,configurable:!0});return H}Z.addMergeToJSMap=B,Z.isMergeKey=q,Z.merge=Y}),X7=w((Z)=>{var X=Z7(),z=r6(),W=z6(),Y=u(),q=xZ();function B(G,H,{key:_,value:$}){if(Y.isNode(_)&&_.addToJSMap)_.addToJSMap(G,H,$);else if(z.isMergeKey(G,_))z.addMergeToJSMap(G,H,$);else{let Q=q.toJS(_,"",G);if(H instanceof Map)H.set(Q,q.toJS($,Q,G));else if(H instanceof Set)H.add(Q);else{let J=U(_,Q,G),V=q.toJS($,J,G);if(J in H)Object.defineProperty(H,J,{value:V,writable:!0,enumerable:!0,configurable:!0});else H[J]=V}}return H}function U(G,H,_){if(H===null)return"";if(typeof H!=="object")return String(H);if(Y.isNode(G)&&_?.doc){let $=W.createStringifyContext(_.doc,{});$.anchors=new Set;for(let J of _.anchors.keys())$.anchors.add(J.anchor);$.inFlow=!0,$.inStringifyKey=!0;let Q=G.toString($);if(!_.mapKeyWarned){let J=JSON.stringify(Q);if(J.length>40)J=J.substring(0,36)+'..."';X.warn(_.doc.options.logLevel,\`Keys with collection values will be stringified due to JS Object restrictions: \${J}. Set mapAsMap: true to use object keys.\`),_.mapKeyWarned=!0}return Q}return JSON.stringify(H)}Z.addPairToJSMap=B}),gZ=w((Z)=>{var X=e8(),z=x9(),W=X7(),Y=u();function q(U,G,H){let _=X.createNode(U,void 0,H),$=X.createNode(G,void 0,H);return new B(_,$)}class B{constructor(U,G=null){Object.defineProperty(this,Y.NODE_TYPE,{value:Y.PAIR}),this.key=U,this.value=G}clone(U){let{key:G,value:H}=this;if(Y.isNode(G))G=G.clone(U);if(Y.isNode(H))H=H.clone(U);return new B(G,H)}toJSON(U,G){let H=G?.mapAsMap?new Map:{};return W.addPairToJSMap(G,H,this)}toString(U,G,H){return U?.doc?z.stringifyPair(this,U,G,H):JSON.stringify(this)}}Z.Pair=B,Z.createPair=q}),z7=w((Z)=>{var X=u(),z=z6(),W=Z6();function Y(G,H,_){return(H.inFlow??G.flow?B:q)(G,H,_)}function q({comment:G,items:H},_,{blockItemPrefix:$,flowChars:Q,itemIndent:J,onChompKeep:V,onComment:M}){let{indent:A,options:{commentString:L}}=_,D=Object.assign({},_,{indent:J,type:null}),F=!1,j=[];for(let K=0;K<H.length;++K){let E=H[K],T=null;if(X.isNode(E)){if(!F&&E.spaceBefore)j.push("");if(U(_,j,E.commentBefore,F),E.comment)T=E.comment}else if(X.isPair(E)){let C=X.isNode(E.key)?E.key:null;if(C){if(!F&&C.spaceBefore)j.push("");U(_,j,C.commentBefore,F)}}F=!1;let P=z.stringify(E,D,()=>T=null,()=>F=!0);if(T)P+=W.lineComment(P,J,L(T));if(F&&T)F=!1;j.push($+P)}let N;if(j.length===0)N=Q.start+Q.end;else{N=j[0];for(let K=1;K<j.length;++K){let E=j[K];N+=E?\`
22146
+ \`)f="";if(K+=f+k,G.inFlow){if(C&&H)H()}else if(P&&!C)K+=Y.lineComment(K,G.indent,M(P));else if(N&&_)_();return K}Z.stringifyPair=q}),Z7=w((Z)=>{var X=a8("process");function z(Y,...q){if(Y==="debug")console.log(...q)}function W(Y,q){if(Y==="debug"||Y==="warn")if(typeof X.emitWarning==="function")X.emitWarning(q);else console.warn(q)}Z.debug=z,Z.warn=W}),r6=w((Z)=>{var X=u(),z=q0(),W="<<",Y={identify:(G)=>G===W||typeof G==="symbol"&&G.description===W,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new z.Scalar(Symbol(W)),{addToJSMap:B}),stringify:()=>W},q=(G,H)=>(Y.identify(H)||X.isScalar(H)&&(!H.type||H.type===z.Scalar.PLAIN)&&Y.identify(H.value))&&G?.doc.schema.tags.some((_)=>_.tag===Y.tag&&_.default);function B(G,H,_){if(_=G&&X.isAlias(_)?_.resolve(G.doc):_,X.isSeq(_))for(let $ of _.items)U(G,H,$);else if(Array.isArray(_))for(let $ of _)U(G,H,$);else U(G,H,_)}function U(G,H,_){let $=G&&X.isAlias(_)?_.resolve(G.doc):_;if(!X.isMap($))throw Error("Merge sources must be maps or map aliases");let Q=$.toJSON(null,G,Map);for(let[J,V]of Q)if(H instanceof Map){if(!H.has(J))H.set(J,V)}else if(H instanceof Set)H.add(J);else if(!Object.prototype.hasOwnProperty.call(H,J))Object.defineProperty(H,J,{value:V,writable:!0,enumerable:!0,configurable:!0});return H}Z.addMergeToJSMap=B,Z.isMergeKey=q,Z.merge=Y}),X7=w((Z)=>{var X=Z7(),z=r6(),W=z6(),Y=u(),q=xZ();function B(G,H,{key:_,value:$}){if(Y.isNode(_)&&_.addToJSMap)_.addToJSMap(G,H,$);else if(z.isMergeKey(G,_))z.addMergeToJSMap(G,H,$);else{let Q=q.toJS(_,"",G);if(H instanceof Map)H.set(Q,q.toJS($,Q,G));else if(H instanceof Set)H.add(Q);else{let J=U(_,Q,G),V=q.toJS($,J,G);if(J in H)Object.defineProperty(H,J,{value:V,writable:!0,enumerable:!0,configurable:!0});else H[J]=V}}return H}function U(G,H,_){if(H===null)return"";if(typeof H!=="object")return String(H);if(Y.isNode(G)&&_?.doc){let $=W.createStringifyContext(_.doc,{});$.anchors=new Set;for(let J of _.anchors.keys())$.anchors.add(J.anchor);$.inFlow=!0,$.inStringifyKey=!0;let Q=G.toString($);if(!_.mapKeyWarned){let J=JSON.stringify(Q);if(J.length>40)J=J.substring(0,36)+'..."';X.warn(_.doc.options.logLevel,\`Keys with collection values will be stringified due to JS Object restrictions: \${J}. Set mapAsMap: true to use object keys.\`),_.mapKeyWarned=!0}return Q}return JSON.stringify(H)}Z.addPairToJSMap=B}),gZ=w((Z)=>{var X=e8(),z=x9(),W=X7(),Y=u();function q(U,G,H){let _=X.createNode(U,void 0,H),$=X.createNode(G,void 0,H);return new B(_,$)}class B{constructor(U,G=null){Object.defineProperty(this,Y.NODE_TYPE,{value:Y.PAIR}),this.key=U,this.value=G}clone(U){let{key:G,value:H}=this;if(Y.isNode(G))G=G.clone(U);if(Y.isNode(H))H=H.clone(U);return new B(G,H)}toJSON(U,G){let H=G?.mapAsMap?new Map:{};return W.addPairToJSMap(G,H,this)}toString(U,G,H){return U?.doc?z.stringifyPair(this,U,G,H):JSON.stringify(this)}}Z.Pair=B,Z.createPair=q}),z7=w((Z)=>{var X=u(),z=z6(),W=Z6();function Y(G,H,_){return(H.inFlow??G.flow?B:q)(G,H,_)}function q({comment:G,items:H},_,{blockItemPrefix:$,flowChars:Q,itemIndent:J,onChompKeep:V,onComment:M}){let{indent:A,options:{commentString:D}}=_,L=Object.assign({},_,{indent:J,type:null}),F=!1,j=[];for(let K=0;K<H.length;++K){let E=H[K],T=null;if(X.isNode(E)){if(!F&&E.spaceBefore)j.push("");if(U(_,j,E.commentBefore,F),E.comment)T=E.comment}else if(X.isPair(E)){let C=X.isNode(E.key)?E.key:null;if(C){if(!F&&C.spaceBefore)j.push("");U(_,j,C.commentBefore,F)}}F=!1;let P=z.stringify(E,L,()=>T=null,()=>F=!0);if(T)P+=W.lineComment(P,J,D(T));if(F&&T)F=!1;j.push($+P)}let N;if(j.length===0)N=Q.start+Q.end;else{N=j[0];for(let K=1;K<j.length;++K){let E=j[K];N+=E?\`
22147
22147
  \${A}\${E}\`:\`
22148
22148
  \`}}if(G){if(N+=\`
22149
- \`+W.indentComment(L(G),A),M)M()}else if(F&&V)V();return N}function B({items:G},H,{flowChars:_,itemIndent:$}){let{indent:Q,indentStep:J,flowCollectionPadding:V,options:{commentString:M}}=H;$+=J;let A=Object.assign({},H,{indent:$,inFlow:!0,type:null}),L=!1,D=0,F=[];for(let K=0;K<G.length;++K){let E=G[K],T=null;if(X.isNode(E)){if(E.spaceBefore)F.push("");if(U(H,F,E.commentBefore,!1),E.comment)T=E.comment}else if(X.isPair(E)){let C=X.isNode(E.key)?E.key:null;if(C){if(C.spaceBefore)F.push("");if(U(H,F,C.commentBefore,!1),C.comment)L=!0}let k=X.isNode(E.value)?E.value:null;if(k){if(k.comment)T=k.comment;if(k.commentBefore)L=!0}else if(E.value==null&&C?.comment)T=C.comment}if(T)L=!0;let P=z.stringify(E,A,()=>T=null);if(L||(L=F.length>D||P.includes(\`
22150
- \`)),K<G.length-1)P+=",";else if(H.options.trailingComma){if(H.options.lineWidth>0)L||(L=F.reduce((C,k)=>C+k.length+2,2)+(P.length+2)>H.options.lineWidth);if(L)P+=","}if(T)P+=W.lineComment(P,$,M(T));F.push(P),D=F.length}let{start:j,end:N}=_;if(F.length===0)return j+N;else{if(!L){let K=F.reduce((E,T)=>E+T.length+2,2);L=H.options.lineWidth>0&&K>H.options.lineWidth}if(L){let K=j;for(let E of F)K+=E?\`
22149
+ \`+W.indentComment(D(G),A),M)M()}else if(F&&V)V();return N}function B({items:G},H,{flowChars:_,itemIndent:$}){let{indent:Q,indentStep:J,flowCollectionPadding:V,options:{commentString:M}}=H;$+=J;let A=Object.assign({},H,{indent:$,inFlow:!0,type:null}),D=!1,L=0,F=[];for(let K=0;K<G.length;++K){let E=G[K],T=null;if(X.isNode(E)){if(E.spaceBefore)F.push("");if(U(H,F,E.commentBefore,!1),E.comment)T=E.comment}else if(X.isPair(E)){let C=X.isNode(E.key)?E.key:null;if(C){if(C.spaceBefore)F.push("");if(U(H,F,C.commentBefore,!1),C.comment)D=!0}let k=X.isNode(E.value)?E.value:null;if(k){if(k.comment)T=k.comment;if(k.commentBefore)D=!0}else if(E.value==null&&C?.comment)T=C.comment}if(T)D=!0;let P=z.stringify(E,A,()=>T=null);if(D||(D=F.length>L||P.includes(\`
22150
+ \`)),K<G.length-1)P+=",";else if(H.options.trailingComma){if(H.options.lineWidth>0)D||(D=F.reduce((C,k)=>C+k.length+2,2)+(P.length+2)>H.options.lineWidth);if(D)P+=","}if(T)P+=W.lineComment(P,$,M(T));F.push(P),L=F.length}let{start:j,end:N}=_;if(F.length===0)return j+N;else{if(!D){let K=F.reduce((E,T)=>E+T.length+2,2);D=H.options.lineWidth>0&&K>H.options.lineWidth}if(D){let K=j;for(let E of F)K+=E?\`
22151
22151
  \${J}\${Q}\${E}\`:\`
22152
22152
  \`;return\`\${K}
22153
- \${Q}\${N}\`}else return\`\${j}\${V}\${F.join(" ")}\${V}\${N}\`}}function U({indent:G,options:{commentString:H}},_,$,Q){if($&&Q)$=$.replace(/^\\n+/,"");if($){let J=W.indentComment(H($),G);_.push(J.trimStart())}}Z.stringifyCollection=Y}),hZ=w((Z)=>{var X=z7(),z=X7(),W=a6(),Y=u(),q=gZ(),B=q0();function U(H,_){let $=Y.isScalar(_)?_.value:_;for(let Q of H)if(Y.isPair(Q)){if(Q.key===_||Q.key===$)return Q;if(Y.isScalar(Q.key)&&Q.key.value===$)return Q}return}class G extends W.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(H){super(Y.MAP,H);this.items=[]}static from(H,_,$){let{keepUndefined:Q,replacer:J}=$,V=new this(H),M=(A,L)=>{if(typeof J==="function")L=J.call(_,A,L);else if(Array.isArray(J)&&!J.includes(A))return;if(L!==void 0||Q)V.items.push(q.createPair(A,L,$))};if(_ instanceof Map)for(let[A,L]of _)M(A,L);else if(_&&typeof _==="object")for(let A of Object.keys(_))M(A,_[A]);if(typeof H.sortMapEntries==="function")V.items.sort(H.sortMapEntries);return V}add(H,_){let $;if(Y.isPair(H))$=H;else if(!H||typeof H!=="object"||!("key"in H))$=new q.Pair(H,H?.value);else $=new q.Pair(H.key,H.value);let Q=U(this.items,$.key),J=this.schema?.sortMapEntries;if(Q){if(!_)throw Error(\`Key \${$.key} already set\`);if(Y.isScalar(Q.value)&&B.isScalarValue($.value))Q.value.value=$.value;else Q.value=$.value}else if(J){let V=this.items.findIndex((M)=>J($,M)<0);if(V===-1)this.items.push($);else this.items.splice(V,0,$)}else this.items.push($)}delete(H){let _=U(this.items,H);if(!_)return!1;return this.items.splice(this.items.indexOf(_),1).length>0}get(H,_){let Q=U(this.items,H)?.value;return(!_&&Y.isScalar(Q)?Q.value:Q)??void 0}has(H){return!!U(this.items,H)}set(H,_){this.add(new q.Pair(H,_),!0)}toJSON(H,_,$){let Q=$?new $:_?.mapAsMap?new Map:{};if(_?.onCreate)_.onCreate(Q);for(let J of this.items)z.addPairToJSMap(_,Q,J);return Q}toString(H,_,$){if(!H)return JSON.stringify(this);for(let Q of this.items)if(!Y.isPair(Q))throw Error(\`Map items must all be pairs; found \${JSON.stringify(Q)} instead\`);if(!H.allNullValues&&this.hasAllNullValues(!1))H=Object.assign({},H,{allNullValues:!0});return X.stringifyCollection(this,H,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:H.indent||"",onChompKeep:$,onComment:_})}}Z.YAMLMap=G,Z.findPair=U}),F8=w((Z)=>{var X=u(),z=hZ(),W={collection:"map",default:!0,nodeClass:z.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(Y,q){if(!X.isMap(Y))q("Expected a mapping for this tag");return Y},createNode:(Y,q,B)=>z.YAMLMap.from(Y,q,B)};Z.map=W}),vZ=w((Z)=>{var X=e8(),z=z7(),W=a6(),Y=u(),q=q0(),B=xZ();class U extends W.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(H){super(Y.SEQ,H);this.items=[]}add(H){this.items.push(H)}delete(H){let _=G(H);if(typeof _!=="number")return!1;return this.items.splice(_,1).length>0}get(H,_){let $=G(H);if(typeof $!=="number")return;let Q=this.items[$];return!_&&Y.isScalar(Q)?Q.value:Q}has(H){let _=G(H);return typeof _==="number"&&_<this.items.length}set(H,_){let $=G(H);if(typeof $!=="number")throw Error(\`Expected a valid index, not \${H}.\`);let Q=this.items[$];if(Y.isScalar(Q)&&q.isScalarValue(_))Q.value=_;else this.items[$]=_}toJSON(H,_){let $=[];if(_?.onCreate)_.onCreate($);let Q=0;for(let J of this.items)$.push(B.toJS(J,String(Q++),_));return $}toString(H,_,$){if(!H)return JSON.stringify(this);return z.stringifyCollection(this,H,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(H.indent||"")+" ",onChompKeep:$,onComment:_})}static from(H,_,$){let{replacer:Q}=$,J=new this(H);if(_&&Symbol.iterator in Object(_)){let V=0;for(let M of _){if(typeof Q==="function"){let A=_ instanceof Set?M:String(V++);M=Q.call(_,A,M)}J.items.push(X.createNode(M,void 0,$))}}return J}}function G(H){let _=Y.isScalar(H)?H.value:H;if(_&&typeof _==="string")_=Number(_);return typeof _==="number"&&Number.isInteger(_)&&_>=0?_:null}Z.YAMLSeq=U}),N8=w((Z)=>{var X=u(),z=vZ(),W={collection:"seq",default:!0,nodeClass:z.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(Y,q){if(!X.isSeq(Y))q("Expected a sequence for this tag");return Y},createNode:(Y,q,B)=>z.YAMLSeq.from(Y,q,B)};Z.seq=W}),$6=w((Z)=>{var X=X6(),z={identify:(W)=>typeof W==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(W)=>W,stringify(W,Y,q,B){return Y=Object.assign({actualString:!0},Y),X.stringifyString(W,Y,q,B)}};Z.string=z}),t6=w((Z)=>{var X=q0(),z={identify:(W)=>W==null,createNode:()=>new X.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new X.Scalar(null),stringify:({source:W},Y)=>typeof W==="string"&&z.test.test(W)?W:Y.options.nullStr};Z.nullTag=z}),$7=w((Z)=>{var X=q0(),z={identify:(W)=>typeof W==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:(W)=>new X.Scalar(W[0]==="t"||W[0]==="T"),stringify({source:W,value:Y},q){if(W&&z.test.test(W)){let B=W[0]==="t"||W[0]==="T";if(Y===B)return W}return Y?q.options.trueStr:q.options.falseStr}};Z.boolTag=z}),K8=w((Z)=>{function X({format:z,minFractionDigits:W,tag:Y,value:q}){if(typeof q==="bigint")return String(q);let B=typeof q==="number"?q:Number(q);if(!isFinite(B))return isNaN(B)?".nan":B<0?"-.inf":".inf";let U=Object.is(q,-0)?"-0":JSON.stringify(q);if(!z&&W&&(!Y||Y==="tag:yaml.org,2002:float")&&/^\\d/.test(U)){let G=U.indexOf(".");if(G<0)G=U.length,U+=".";let H=W-(U.length-G-1);while(H-- >0)U+="0"}return U}Z.stringifyNumber=X}),Q7=w((Z)=>{var X=q0(),z=K8(),W={identify:(B)=>typeof B==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\\.(?:inf|Inf|INF)|\\.nan|\\.NaN|\\.NAN)$/,resolve:(B)=>B.slice(-3).toLowerCase()==="nan"?NaN:B[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:z.stringifyNumber},Y={identify:(B)=>typeof B==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\\.[0-9]+|[0-9]+(?:\\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:(B)=>parseFloat(B),stringify(B){let U=Number(B.value);return isFinite(U)?U.toExponential():z.stringifyNumber(B)}},q={identify:(B)=>typeof B==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\\.[0-9]+|[0-9]+\\.[0-9]*)$/,resolve(B){let U=new X.Scalar(parseFloat(B)),G=B.indexOf(".");if(G!==-1&&B[B.length-1]==="0")U.minFractionDigits=B.length-G-1;return U},stringify:z.stringifyNumber};Z.float=q,Z.floatExp=Y,Z.floatNaN=W}),W7=w((Z)=>{var X=K8(),z=(G)=>typeof G==="bigint"||Number.isInteger(G),W=(G,H,_,{intAsBigInt:$})=>$?BigInt(G):parseInt(G.substring(H),_);function Y(G,H,_){let{value:$}=G;if(z($)&&$>=0)return _+$.toString(H);return X.stringifyNumber(G)}var q={identify:(G)=>z(G)&&G>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(G,H,_)=>W(G,2,8,_),stringify:(G)=>Y(G,8,"0o")},B={identify:z,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(G,H,_)=>W(G,0,10,_),stringify:X.stringifyNumber},U={identify:(G)=>z(G)&&G>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(G,H,_)=>W(G,2,16,_),stringify:(G)=>Y(G,16,"0x")};Z.int=B,Z.intHex=U,Z.intOct=q}),g9=w((Z)=>{var X=F8(),z=t6(),W=N8(),Y=$6(),q=$7(),B=Q7(),U=W7(),G=[X.map,W.seq,Y.string,z.nullTag,q.boolTag,U.intOct,U.int,U.intHex,B.floatNaN,B.floatExp,B.float];Z.schema=G}),h9=w((Z)=>{var X=q0(),z=F8(),W=N8();function Y(H){return typeof H==="bigint"||Number.isInteger(H)}var q=({value:H})=>JSON.stringify(H),B=[{identify:(H)=>typeof H==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(H)=>H,stringify:q},{identify:(H)=>H==null,createNode:()=>new X.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:q},{identify:(H)=>typeof H==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:(H)=>H==="true",stringify:q},{identify:Y,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(H,_,{intAsBigInt:$})=>$?BigInt(H):parseInt(H,10),stringify:({value:H})=>Y(H)?H.toString():JSON.stringify(H)},{identify:(H)=>typeof H==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:(H)=>parseFloat(H),stringify:q}],U={default:!0,tag:"",test:/^/,resolve(H,_){return _(\`Unresolved plain scalar \${JSON.stringify(H)}\`),H}},G=[z.map,W.seq].concat(B,U);Z.schema=G}),H7=w((Z)=>{var X=a8("buffer"),z=q0(),W=X6(),Y={identify:(q)=>q instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(q,B){if(typeof X.Buffer==="function")return X.Buffer.from(q,"base64");else if(typeof atob==="function"){let U=atob(q.replace(/[\\n\\r]/g,"")),G=new Uint8Array(U.length);for(let H=0;H<U.length;++H)G[H]=U.charCodeAt(H);return G}else return B("This environment does not support reading binary tags; either Buffer or atob is required"),q},stringify({comment:q,type:B,value:U},G,H,_){if(!U)return"";let $=U,Q;if(typeof X.Buffer==="function")Q=$ instanceof X.Buffer?$.toString("base64"):X.Buffer.from($.buffer).toString("base64");else if(typeof btoa==="function"){let J="";for(let V=0;V<$.length;++V)J+=String.fromCharCode($[V]);Q=btoa(J)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(B??(B=z.Scalar.BLOCK_LITERAL),B!==z.Scalar.QUOTE_DOUBLE){let J=Math.max(G.options.lineWidth-G.indent.length,G.options.minContentWidth),V=Math.ceil(Q.length/J),M=Array(V);for(let A=0,L=0;A<V;++A,L+=J)M[A]=Q.substr(L,J);Q=M.join(B===z.Scalar.BLOCK_LITERAL?\`
22153
+ \${Q}\${N}\`}else return\`\${j}\${V}\${F.join(" ")}\${V}\${N}\`}}function U({indent:G,options:{commentString:H}},_,$,Q){if($&&Q)$=$.replace(/^\\n+/,"");if($){let J=W.indentComment(H($),G);_.push(J.trimStart())}}Z.stringifyCollection=Y}),hZ=w((Z)=>{var X=z7(),z=X7(),W=a6(),Y=u(),q=gZ(),B=q0();function U(H,_){let $=Y.isScalar(_)?_.value:_;for(let Q of H)if(Y.isPair(Q)){if(Q.key===_||Q.key===$)return Q;if(Y.isScalar(Q.key)&&Q.key.value===$)return Q}return}class G extends W.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(H){super(Y.MAP,H);this.items=[]}static from(H,_,$){let{keepUndefined:Q,replacer:J}=$,V=new this(H),M=(A,D)=>{if(typeof J==="function")D=J.call(_,A,D);else if(Array.isArray(J)&&!J.includes(A))return;if(D!==void 0||Q)V.items.push(q.createPair(A,D,$))};if(_ instanceof Map)for(let[A,D]of _)M(A,D);else if(_&&typeof _==="object")for(let A of Object.keys(_))M(A,_[A]);if(typeof H.sortMapEntries==="function")V.items.sort(H.sortMapEntries);return V}add(H,_){let $;if(Y.isPair(H))$=H;else if(!H||typeof H!=="object"||!("key"in H))$=new q.Pair(H,H?.value);else $=new q.Pair(H.key,H.value);let Q=U(this.items,$.key),J=this.schema?.sortMapEntries;if(Q){if(!_)throw Error(\`Key \${$.key} already set\`);if(Y.isScalar(Q.value)&&B.isScalarValue($.value))Q.value.value=$.value;else Q.value=$.value}else if(J){let V=this.items.findIndex((M)=>J($,M)<0);if(V===-1)this.items.push($);else this.items.splice(V,0,$)}else this.items.push($)}delete(H){let _=U(this.items,H);if(!_)return!1;return this.items.splice(this.items.indexOf(_),1).length>0}get(H,_){let Q=U(this.items,H)?.value;return(!_&&Y.isScalar(Q)?Q.value:Q)??void 0}has(H){return!!U(this.items,H)}set(H,_){this.add(new q.Pair(H,_),!0)}toJSON(H,_,$){let Q=$?new $:_?.mapAsMap?new Map:{};if(_?.onCreate)_.onCreate(Q);for(let J of this.items)z.addPairToJSMap(_,Q,J);return Q}toString(H,_,$){if(!H)return JSON.stringify(this);for(let Q of this.items)if(!Y.isPair(Q))throw Error(\`Map items must all be pairs; found \${JSON.stringify(Q)} instead\`);if(!H.allNullValues&&this.hasAllNullValues(!1))H=Object.assign({},H,{allNullValues:!0});return X.stringifyCollection(this,H,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:H.indent||"",onChompKeep:$,onComment:_})}}Z.YAMLMap=G,Z.findPair=U}),F8=w((Z)=>{var X=u(),z=hZ(),W={collection:"map",default:!0,nodeClass:z.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(Y,q){if(!X.isMap(Y))q("Expected a mapping for this tag");return Y},createNode:(Y,q,B)=>z.YAMLMap.from(Y,q,B)};Z.map=W}),vZ=w((Z)=>{var X=e8(),z=z7(),W=a6(),Y=u(),q=q0(),B=xZ();class U extends W.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(H){super(Y.SEQ,H);this.items=[]}add(H){this.items.push(H)}delete(H){let _=G(H);if(typeof _!=="number")return!1;return this.items.splice(_,1).length>0}get(H,_){let $=G(H);if(typeof $!=="number")return;let Q=this.items[$];return!_&&Y.isScalar(Q)?Q.value:Q}has(H){let _=G(H);return typeof _==="number"&&_<this.items.length}set(H,_){let $=G(H);if(typeof $!=="number")throw Error(\`Expected a valid index, not \${H}.\`);let Q=this.items[$];if(Y.isScalar(Q)&&q.isScalarValue(_))Q.value=_;else this.items[$]=_}toJSON(H,_){let $=[];if(_?.onCreate)_.onCreate($);let Q=0;for(let J of this.items)$.push(B.toJS(J,String(Q++),_));return $}toString(H,_,$){if(!H)return JSON.stringify(this);return z.stringifyCollection(this,H,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(H.indent||"")+" ",onChompKeep:$,onComment:_})}static from(H,_,$){let{replacer:Q}=$,J=new this(H);if(_&&Symbol.iterator in Object(_)){let V=0;for(let M of _){if(typeof Q==="function"){let A=_ instanceof Set?M:String(V++);M=Q.call(_,A,M)}J.items.push(X.createNode(M,void 0,$))}}return J}}function G(H){let _=Y.isScalar(H)?H.value:H;if(_&&typeof _==="string")_=Number(_);return typeof _==="number"&&Number.isInteger(_)&&_>=0?_:null}Z.YAMLSeq=U}),N8=w((Z)=>{var X=u(),z=vZ(),W={collection:"seq",default:!0,nodeClass:z.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(Y,q){if(!X.isSeq(Y))q("Expected a sequence for this tag");return Y},createNode:(Y,q,B)=>z.YAMLSeq.from(Y,q,B)};Z.seq=W}),$6=w((Z)=>{var X=X6(),z={identify:(W)=>typeof W==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(W)=>W,stringify(W,Y,q,B){return Y=Object.assign({actualString:!0},Y),X.stringifyString(W,Y,q,B)}};Z.string=z}),t6=w((Z)=>{var X=q0(),z={identify:(W)=>W==null,createNode:()=>new X.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new X.Scalar(null),stringify:({source:W},Y)=>typeof W==="string"&&z.test.test(W)?W:Y.options.nullStr};Z.nullTag=z}),$7=w((Z)=>{var X=q0(),z={identify:(W)=>typeof W==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:(W)=>new X.Scalar(W[0]==="t"||W[0]==="T"),stringify({source:W,value:Y},q){if(W&&z.test.test(W)){let B=W[0]==="t"||W[0]==="T";if(Y===B)return W}return Y?q.options.trueStr:q.options.falseStr}};Z.boolTag=z}),K8=w((Z)=>{function X({format:z,minFractionDigits:W,tag:Y,value:q}){if(typeof q==="bigint")return String(q);let B=typeof q==="number"?q:Number(q);if(!isFinite(B))return isNaN(B)?".nan":B<0?"-.inf":".inf";let U=Object.is(q,-0)?"-0":JSON.stringify(q);if(!z&&W&&(!Y||Y==="tag:yaml.org,2002:float")&&/^\\d/.test(U)){let G=U.indexOf(".");if(G<0)G=U.length,U+=".";let H=W-(U.length-G-1);while(H-- >0)U+="0"}return U}Z.stringifyNumber=X}),Q7=w((Z)=>{var X=q0(),z=K8(),W={identify:(B)=>typeof B==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\\.(?:inf|Inf|INF)|\\.nan|\\.NaN|\\.NAN)$/,resolve:(B)=>B.slice(-3).toLowerCase()==="nan"?NaN:B[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:z.stringifyNumber},Y={identify:(B)=>typeof B==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\\.[0-9]+|[0-9]+(?:\\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:(B)=>parseFloat(B),stringify(B){let U=Number(B.value);return isFinite(U)?U.toExponential():z.stringifyNumber(B)}},q={identify:(B)=>typeof B==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\\.[0-9]+|[0-9]+\\.[0-9]*)$/,resolve(B){let U=new X.Scalar(parseFloat(B)),G=B.indexOf(".");if(G!==-1&&B[B.length-1]==="0")U.minFractionDigits=B.length-G-1;return U},stringify:z.stringifyNumber};Z.float=q,Z.floatExp=Y,Z.floatNaN=W}),W7=w((Z)=>{var X=K8(),z=(G)=>typeof G==="bigint"||Number.isInteger(G),W=(G,H,_,{intAsBigInt:$})=>$?BigInt(G):parseInt(G.substring(H),_);function Y(G,H,_){let{value:$}=G;if(z($)&&$>=0)return _+$.toString(H);return X.stringifyNumber(G)}var q={identify:(G)=>z(G)&&G>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(G,H,_)=>W(G,2,8,_),stringify:(G)=>Y(G,8,"0o")},B={identify:z,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(G,H,_)=>W(G,0,10,_),stringify:X.stringifyNumber},U={identify:(G)=>z(G)&&G>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(G,H,_)=>W(G,2,16,_),stringify:(G)=>Y(G,16,"0x")};Z.int=B,Z.intHex=U,Z.intOct=q}),g9=w((Z)=>{var X=F8(),z=t6(),W=N8(),Y=$6(),q=$7(),B=Q7(),U=W7(),G=[X.map,W.seq,Y.string,z.nullTag,q.boolTag,U.intOct,U.int,U.intHex,B.floatNaN,B.floatExp,B.float];Z.schema=G}),h9=w((Z)=>{var X=q0(),z=F8(),W=N8();function Y(H){return typeof H==="bigint"||Number.isInteger(H)}var q=({value:H})=>JSON.stringify(H),B=[{identify:(H)=>typeof H==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(H)=>H,stringify:q},{identify:(H)=>H==null,createNode:()=>new X.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:q},{identify:(H)=>typeof H==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:(H)=>H==="true",stringify:q},{identify:Y,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(H,_,{intAsBigInt:$})=>$?BigInt(H):parseInt(H,10),stringify:({value:H})=>Y(H)?H.toString():JSON.stringify(H)},{identify:(H)=>typeof H==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:(H)=>parseFloat(H),stringify:q}],U={default:!0,tag:"",test:/^/,resolve(H,_){return _(\`Unresolved plain scalar \${JSON.stringify(H)}\`),H}},G=[z.map,W.seq].concat(B,U);Z.schema=G}),H7=w((Z)=>{var X=a8("buffer"),z=q0(),W=X6(),Y={identify:(q)=>q instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(q,B){if(typeof X.Buffer==="function")return X.Buffer.from(q,"base64");else if(typeof atob==="function"){let U=atob(q.replace(/[\\n\\r]/g,"")),G=new Uint8Array(U.length);for(let H=0;H<U.length;++H)G[H]=U.charCodeAt(H);return G}else return B("This environment does not support reading binary tags; either Buffer or atob is required"),q},stringify({comment:q,type:B,value:U},G,H,_){if(!U)return"";let $=U,Q;if(typeof X.Buffer==="function")Q=$ instanceof X.Buffer?$.toString("base64"):X.Buffer.from($.buffer).toString("base64");else if(typeof btoa==="function"){let J="";for(let V=0;V<$.length;++V)J+=String.fromCharCode($[V]);Q=btoa(J)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(B??(B=z.Scalar.BLOCK_LITERAL),B!==z.Scalar.QUOTE_DOUBLE){let J=Math.max(G.options.lineWidth-G.indent.length,G.options.minContentWidth),V=Math.ceil(Q.length/J),M=Array(V);for(let A=0,D=0;A<V;++A,D+=J)M[A]=Q.substr(D,J);Q=M.join(B===z.Scalar.BLOCK_LITERAL?\`
22154
22154
  \`:" ")}return W.stringifyString({comment:q,type:B,value:Q},G,H,_)}};Z.binary=Y}),e6=w((Z)=>{var X=u(),z=gZ(),W=q0(),Y=vZ();function q(G,H){if(X.isSeq(G))for(let _=0;_<G.items.length;++_){let $=G.items[_];if(X.isPair($))continue;else if(X.isMap($)){if($.items.length>1)H("Each pair must have its own sequence indicator");let Q=$.items[0]||new z.Pair(new W.Scalar(null));if($.commentBefore)Q.key.commentBefore=Q.key.commentBefore?\`\${$.commentBefore}
22155
22155
  \${Q.key.commentBefore}\`:$.commentBefore;if($.comment){let J=Q.value??Q.key;J.comment=J.comment?\`\${$.comment}
22156
- \${J.comment}\`:$.comment}$=Q}G.items[_]=X.isPair($)?$:new z.Pair($)}else H("Expected a sequence for this tag");return G}function B(G,H,_){let{replacer:$}=_,Q=new Y.YAMLSeq(G);Q.tag="tag:yaml.org,2002:pairs";let J=0;if(H&&Symbol.iterator in Object(H))for(let V of H){if(typeof $==="function")V=$.call(H,String(J++),V);let M,A;if(Array.isArray(V))if(V.length===2)M=V[0],A=V[1];else throw TypeError(\`Expected [key, value] tuple: \${V}\`);else if(V&&V instanceof Object){let L=Object.keys(V);if(L.length===1)M=L[0],A=V[M];else throw TypeError(\`Expected tuple with one key, not \${L.length} keys\`)}else M=V;Q.items.push(z.createPair(M,A,_))}return Q}var U={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:q,createNode:B};Z.createPairs=B,Z.pairs=U,Z.resolvePairs=q}),J7=w((Z)=>{var X=u(),z=xZ(),W=hZ(),Y=vZ(),q=e6();class B extends Y.YAMLSeq{constructor(){super();this.add=W.YAMLMap.prototype.add.bind(this),this.delete=W.YAMLMap.prototype.delete.bind(this),this.get=W.YAMLMap.prototype.get.bind(this),this.has=W.YAMLMap.prototype.has.bind(this),this.set=W.YAMLMap.prototype.set.bind(this),this.tag=B.tag}toJSON(G,H){if(!H)return super.toJSON(G);let _=new Map;if(H?.onCreate)H.onCreate(_);for(let $ of this.items){let Q,J;if(X.isPair($))Q=z.toJS($.key,"",H),J=z.toJS($.value,Q,H);else Q=z.toJS($,"",H);if(_.has(Q))throw Error("Ordered maps must not include duplicate keys");_.set(Q,J)}return _}static from(G,H,_){let $=q.createPairs(G,H,_),Q=new this;return Q.items=$.items,Q}}B.tag="tag:yaml.org,2002:omap";var U={collection:"seq",identify:(G)=>G instanceof Map,nodeClass:B,default:!1,tag:"tag:yaml.org,2002:omap",resolve(G,H){let _=q.resolvePairs(G,H),$=[];for(let{key:Q}of _.items)if(X.isScalar(Q))if($.includes(Q.value))H(\`Ordered maps must not include duplicate keys: \${Q.value}\`);else $.push(Q.value);return Object.assign(new B,_)},createNode:(G,H,_)=>B.from(G,H,_)};Z.YAMLOMap=B,Z.omap=U}),v9=w((Z)=>{var X=q0();function z({value:q,source:B},U){if(B&&(q?W:Y).test.test(B))return B;return q?U.options.trueStr:U.options.falseStr}var W={identify:(q)=>q===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new X.Scalar(!0),stringify:z},Y={identify:(q)=>q===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new X.Scalar(!1),stringify:z};Z.falseTag=Y,Z.trueTag=W}),y9=w((Z)=>{var X=q0(),z=K8(),W={identify:(B)=>typeof B==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\\.(?:inf|Inf|INF)|\\.nan|\\.NaN|\\.NAN)$/,resolve:(B)=>B.slice(-3).toLowerCase()==="nan"?NaN:B[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:z.stringifyNumber},Y={identify:(B)=>typeof B==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:(B)=>parseFloat(B.replace(/_/g,"")),stringify(B){let U=Number(B.value);return isFinite(U)?U.toExponential():z.stringifyNumber(B)}},q={identify:(B)=>typeof B==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\\.[0-9_]*$/,resolve(B){let U=new X.Scalar(parseFloat(B.replace(/_/g,""))),G=B.indexOf(".");if(G!==-1){let H=B.substring(G+1).replace(/_/g,"");if(H[H.length-1]==="0")U.minFractionDigits=H.length}return U},stringify:z.stringifyNumber};Z.float=q,Z.floatExp=Y,Z.floatNaN=W}),m9=w((Z)=>{var X=K8(),z=(H)=>typeof H==="bigint"||Number.isInteger(H);function W(H,_,$,{intAsBigInt:Q}){let J=H[0];if(J==="-"||J==="+")_+=1;if(H=H.substring(_).replace(/_/g,""),Q){switch($){case 2:H=\`0b\${H}\`;break;case 8:H=\`0o\${H}\`;break;case 16:H=\`0x\${H}\`;break}let M=BigInt(H);return J==="-"?BigInt(-1)*M:M}let V=parseInt(H,$);return J==="-"?-1*V:V}function Y(H,_,$){let{value:Q}=H;if(z(Q)){let J=Q.toString(_);return Q<0?"-"+$+J.substr(1):$+J}return X.stringifyNumber(H)}var q={identify:z,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(H,_,$)=>W(H,2,2,$),stringify:(H)=>Y(H,2,"0b")},B={identify:z,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(H,_,$)=>W(H,1,8,$),stringify:(H)=>Y(H,8,"0")},U={identify:z,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(H,_,$)=>W(H,0,10,$),stringify:X.stringifyNumber},G={identify:z,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(H,_,$)=>W(H,2,16,$),stringify:(H)=>Y(H,16,"0x")};Z.int=U,Z.intBin=q,Z.intHex=G,Z.intOct=B}),Y7=w((Z)=>{var X=u(),z=gZ(),W=hZ();class Y extends W.YAMLMap{constructor(B){super(B);this.tag=Y.tag}add(B){let U;if(X.isPair(B))U=B;else if(B&&typeof B==="object"&&"key"in B&&"value"in B&&B.value===null)U=new z.Pair(B.key,null);else U=new z.Pair(B,null);if(!W.findPair(this.items,U.key))this.items.push(U)}get(B,U){let G=W.findPair(this.items,B);return!U&&X.isPair(G)?X.isScalar(G.key)?G.key.value:G.key:G}set(B,U){if(typeof U!=="boolean")throw Error(\`Expected boolean value for set(key, value) in a YAML set, not \${typeof U}\`);let G=W.findPair(this.items,B);if(G&&!U)this.items.splice(this.items.indexOf(G),1);else if(!G&&U)this.items.push(new z.Pair(B))}toJSON(B,U){return super.toJSON(B,U,Set)}toString(B,U,G){if(!B)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},B,{allNullValues:!0}),U,G);else throw Error("Set items must all have null values")}static from(B,U,G){let{replacer:H}=G,_=new this(B);if(U&&Symbol.iterator in Object(U))for(let $ of U){if(typeof H==="function")$=H.call(U,$,$);_.items.push(z.createPair($,null,G))}return _}}Y.tag="tag:yaml.org,2002:set";var q={collection:"map",identify:(B)=>B instanceof Set,nodeClass:Y,default:!1,tag:"tag:yaml.org,2002:set",createNode:(B,U,G)=>Y.from(B,U,G),resolve(B,U){if(X.isMap(B))if(B.hasAllNullValues(!0))return Object.assign(new Y,B);else U("Set items must all have null values");else U("Expected a mapping for this tag");return B}};Z.YAMLSet=Y,Z.set=q}),V7=w((Z)=>{var X=K8();function z(U,G){let H=U[0],_=H==="-"||H==="+"?U.substring(1):U,$=(J)=>G?BigInt(J):Number(J),Q=_.replace(/_/g,"").split(":").reduce((J,V)=>J*$(60)+$(V),$(0));return H==="-"?$(-1)*Q:Q}function W(U){let{value:G}=U,H=(J)=>J;if(typeof G==="bigint")H=(J)=>BigInt(J);else if(isNaN(G)||!isFinite(G))return X.stringifyNumber(U);let _="";if(G<0)_="-",G*=H(-1);let $=H(60),Q=[G%$];if(G<60)Q.unshift(0);else if(G=(G-Q[0])/$,Q.unshift(G%$),G>=60)G=(G-Q[0])/$,Q.unshift(G);return _+Q.map((J)=>String(J).padStart(2,"0")).join(":").replace(/000000\\d*$/,"")}var Y={identify:(U)=>typeof U==="bigint"||Number.isInteger(U),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(U,G,{intAsBigInt:H})=>z(U,H),stringify:W},q={identify:(U)=>typeof U==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*$/,resolve:(U)=>z(U,!1),stringify:W},B={identify:(U)=>U 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(U){let G=U.match(B.test);if(!G)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,H,_,$,Q,J,V]=G.map(Number),M=G[7]?Number((G[7]+"00").substr(1,3)):0,A=Date.UTC(H,_-1,$,Q||0,J||0,V||0,M),L=G[8];if(L&&L!=="Z"){let D=z(L,!1);if(Math.abs(D)<30)D*=60;A-=60000*D}return new Date(A)},stringify:({value:U})=>U?.toISOString().replace(/(T00:00:00)?\\.000Z$/,"")??""};Z.floatTime=q,Z.intTime=Y,Z.timestamp=B}),u9=w((Z)=>{var X=F8(),z=t6(),W=N8(),Y=$6(),q=H7(),B=v9(),U=y9(),G=m9(),H=r6(),_=J7(),$=e6(),Q=Y7(),J=V7(),V=[X.map,W.seq,Y.string,z.nullTag,B.trueTag,B.falseTag,G.intBin,G.intOct,G.int,G.intHex,U.floatNaN,U.floatExp,U.float,q.binary,H.merge,_.omap,$.pairs,Q.set,J.intTime,J.floatTime,J.timestamp];Z.schema=V}),c9=w((Z)=>{var X=F8(),z=t6(),W=N8(),Y=$6(),q=$7(),B=Q7(),U=W7(),G=g9(),H=h9(),_=H7(),$=r6(),Q=J7(),J=e6(),V=u9(),M=Y7(),A=V7(),L=new Map([["core",G.schema],["failsafe",[X.map,W.seq,Y.string]],["json",H.schema],["yaml11",V.schema],["yaml-1.1",V.schema]]),D={binary:_.binary,bool:q.boolTag,float:B.float,floatExp:B.floatExp,floatNaN:B.floatNaN,floatTime:A.floatTime,int:U.int,intHex:U.intHex,intOct:U.intOct,intTime:A.intTime,map:X.map,merge:$.merge,null:z.nullTag,omap:Q.omap,pairs:J.pairs,seq:W.seq,set:M.set,timestamp:A.timestamp},F={"tag:yaml.org,2002:binary":_.binary,"tag:yaml.org,2002:merge":$.merge,"tag:yaml.org,2002:omap":Q.omap,"tag:yaml.org,2002:pairs":J.pairs,"tag:yaml.org,2002:set":M.set,"tag:yaml.org,2002:timestamp":A.timestamp};function j(N,K,E){let T=L.get(K);if(T&&!N)return E&&!T.includes($.merge)?T.concat($.merge):T.slice();let P=T;if(!P)if(Array.isArray(N))P=[];else{let C=Array.from(L.keys()).filter((k)=>k!=="yaml11").map((k)=>JSON.stringify(k)).join(", ");throw Error(\`Unknown schema "\${K}"; use one of \${C} or define customTags array\`)}if(Array.isArray(N))for(let C of N)P=P.concat(C);else if(typeof N==="function")P=N(P.slice());if(E)P=P.concat($.merge);return P.reduce((C,k)=>{let f=typeof k==="string"?D[k]:k;if(!f){let l=JSON.stringify(k),U0=Object.keys(D).map((Q0)=>JSON.stringify(Q0)).join(", ");throw Error(\`Unknown custom tag \${l}; use one of \${U0}\`)}if(!C.includes(f))C.push(f);return C},[])}Z.coreKnownTags=F,Z.getTags=j}),_7=w((Z)=>{var X=u(),z=F8(),W=N8(),Y=$6(),q=c9(),B=(G,H)=>G.key<H.key?-1:G.key>H.key?1:0;class U{constructor({compat:G,customTags:H,merge:_,resolveKnownTags:$,schema:Q,sortMapEntries:J,toStringDefaults:V}){this.compat=Array.isArray(G)?q.getTags(G,"compat"):G?q.getTags(null,G):null,this.name=typeof Q==="string"&&Q||"core",this.knownTags=$?q.coreKnownTags:{},this.tags=q.getTags(H,this.name,_),this.toStringOptions=V??null,Object.defineProperty(this,X.MAP,{value:z.map}),Object.defineProperty(this,X.SCALAR,{value:Y.string}),Object.defineProperty(this,X.SEQ,{value:W.seq}),this.sortMapEntries=typeof J==="function"?J:J===!0?B:null}clone(){let G=Object.create(U.prototype,Object.getOwnPropertyDescriptors(this));return G.tags=this.tags.slice(),G}}Z.Schema=U}),d9=w((Z)=>{var X=u(),z=z6(),W=Z6();function Y(q,B){let U=[],G=B.directives===!0;if(B.directives!==!1&&q.directives){let J=q.directives.toString(q);if(J)U.push(J),G=!0;else if(q.directives.docStart)G=!0}if(G)U.push("---");let H=z.createStringifyContext(q,B),{commentString:_}=H.options;if(q.commentBefore){if(U.length!==1)U.unshift("");let J=_(q.commentBefore);U.unshift(W.indentComment(J,""))}let $=!1,Q=null;if(q.contents){if(X.isNode(q.contents)){if(q.contents.spaceBefore&&G)U.push("");if(q.contents.commentBefore){let M=_(q.contents.commentBefore);U.push(W.indentComment(M,""))}H.forceBlockIndent=!!q.comment,Q=q.contents.comment}let J=Q?void 0:()=>$=!0,V=z.stringify(q.contents,H,()=>Q=null,J);if(Q)V+=W.lineComment(V,"",_(Q));if((V[0]==="|"||V[0]===">")&&U[U.length-1]==="---")U[U.length-1]=\`--- \${V}\`;else U.push(V)}else U.push(z.stringify(q.contents,H));if(q.directives?.docEnd)if(q.comment){let J=_(q.comment);if(J.includes(\`
22156
+ \${J.comment}\`:$.comment}$=Q}G.items[_]=X.isPair($)?$:new z.Pair($)}else H("Expected a sequence for this tag");return G}function B(G,H,_){let{replacer:$}=_,Q=new Y.YAMLSeq(G);Q.tag="tag:yaml.org,2002:pairs";let J=0;if(H&&Symbol.iterator in Object(H))for(let V of H){if(typeof $==="function")V=$.call(H,String(J++),V);let M,A;if(Array.isArray(V))if(V.length===2)M=V[0],A=V[1];else throw TypeError(\`Expected [key, value] tuple: \${V}\`);else if(V&&V instanceof Object){let D=Object.keys(V);if(D.length===1)M=D[0],A=V[M];else throw TypeError(\`Expected tuple with one key, not \${D.length} keys\`)}else M=V;Q.items.push(z.createPair(M,A,_))}return Q}var U={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:q,createNode:B};Z.createPairs=B,Z.pairs=U,Z.resolvePairs=q}),J7=w((Z)=>{var X=u(),z=xZ(),W=hZ(),Y=vZ(),q=e6();class B extends Y.YAMLSeq{constructor(){super();this.add=W.YAMLMap.prototype.add.bind(this),this.delete=W.YAMLMap.prototype.delete.bind(this),this.get=W.YAMLMap.prototype.get.bind(this),this.has=W.YAMLMap.prototype.has.bind(this),this.set=W.YAMLMap.prototype.set.bind(this),this.tag=B.tag}toJSON(G,H){if(!H)return super.toJSON(G);let _=new Map;if(H?.onCreate)H.onCreate(_);for(let $ of this.items){let Q,J;if(X.isPair($))Q=z.toJS($.key,"",H),J=z.toJS($.value,Q,H);else Q=z.toJS($,"",H);if(_.has(Q))throw Error("Ordered maps must not include duplicate keys");_.set(Q,J)}return _}static from(G,H,_){let $=q.createPairs(G,H,_),Q=new this;return Q.items=$.items,Q}}B.tag="tag:yaml.org,2002:omap";var U={collection:"seq",identify:(G)=>G instanceof Map,nodeClass:B,default:!1,tag:"tag:yaml.org,2002:omap",resolve(G,H){let _=q.resolvePairs(G,H),$=[];for(let{key:Q}of _.items)if(X.isScalar(Q))if($.includes(Q.value))H(\`Ordered maps must not include duplicate keys: \${Q.value}\`);else $.push(Q.value);return Object.assign(new B,_)},createNode:(G,H,_)=>B.from(G,H,_)};Z.YAMLOMap=B,Z.omap=U}),v9=w((Z)=>{var X=q0();function z({value:q,source:B},U){if(B&&(q?W:Y).test.test(B))return B;return q?U.options.trueStr:U.options.falseStr}var W={identify:(q)=>q===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new X.Scalar(!0),stringify:z},Y={identify:(q)=>q===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new X.Scalar(!1),stringify:z};Z.falseTag=Y,Z.trueTag=W}),y9=w((Z)=>{var X=q0(),z=K8(),W={identify:(B)=>typeof B==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\\.(?:inf|Inf|INF)|\\.nan|\\.NaN|\\.NAN)$/,resolve:(B)=>B.slice(-3).toLowerCase()==="nan"?NaN:B[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:z.stringifyNumber},Y={identify:(B)=>typeof B==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:(B)=>parseFloat(B.replace(/_/g,"")),stringify(B){let U=Number(B.value);return isFinite(U)?U.toExponential():z.stringifyNumber(B)}},q={identify:(B)=>typeof B==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\\.[0-9_]*$/,resolve(B){let U=new X.Scalar(parseFloat(B.replace(/_/g,""))),G=B.indexOf(".");if(G!==-1){let H=B.substring(G+1).replace(/_/g,"");if(H[H.length-1]==="0")U.minFractionDigits=H.length}return U},stringify:z.stringifyNumber};Z.float=q,Z.floatExp=Y,Z.floatNaN=W}),m9=w((Z)=>{var X=K8(),z=(H)=>typeof H==="bigint"||Number.isInteger(H);function W(H,_,$,{intAsBigInt:Q}){let J=H[0];if(J==="-"||J==="+")_+=1;if(H=H.substring(_).replace(/_/g,""),Q){switch($){case 2:H=\`0b\${H}\`;break;case 8:H=\`0o\${H}\`;break;case 16:H=\`0x\${H}\`;break}let M=BigInt(H);return J==="-"?BigInt(-1)*M:M}let V=parseInt(H,$);return J==="-"?-1*V:V}function Y(H,_,$){let{value:Q}=H;if(z(Q)){let J=Q.toString(_);return Q<0?"-"+$+J.substr(1):$+J}return X.stringifyNumber(H)}var q={identify:z,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(H,_,$)=>W(H,2,2,$),stringify:(H)=>Y(H,2,"0b")},B={identify:z,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(H,_,$)=>W(H,1,8,$),stringify:(H)=>Y(H,8,"0")},U={identify:z,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(H,_,$)=>W(H,0,10,$),stringify:X.stringifyNumber},G={identify:z,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(H,_,$)=>W(H,2,16,$),stringify:(H)=>Y(H,16,"0x")};Z.int=U,Z.intBin=q,Z.intHex=G,Z.intOct=B}),Y7=w((Z)=>{var X=u(),z=gZ(),W=hZ();class Y extends W.YAMLMap{constructor(B){super(B);this.tag=Y.tag}add(B){let U;if(X.isPair(B))U=B;else if(B&&typeof B==="object"&&"key"in B&&"value"in B&&B.value===null)U=new z.Pair(B.key,null);else U=new z.Pair(B,null);if(!W.findPair(this.items,U.key))this.items.push(U)}get(B,U){let G=W.findPair(this.items,B);return!U&&X.isPair(G)?X.isScalar(G.key)?G.key.value:G.key:G}set(B,U){if(typeof U!=="boolean")throw Error(\`Expected boolean value for set(key, value) in a YAML set, not \${typeof U}\`);let G=W.findPair(this.items,B);if(G&&!U)this.items.splice(this.items.indexOf(G),1);else if(!G&&U)this.items.push(new z.Pair(B))}toJSON(B,U){return super.toJSON(B,U,Set)}toString(B,U,G){if(!B)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},B,{allNullValues:!0}),U,G);else throw Error("Set items must all have null values")}static from(B,U,G){let{replacer:H}=G,_=new this(B);if(U&&Symbol.iterator in Object(U))for(let $ of U){if(typeof H==="function")$=H.call(U,$,$);_.items.push(z.createPair($,null,G))}return _}}Y.tag="tag:yaml.org,2002:set";var q={collection:"map",identify:(B)=>B instanceof Set,nodeClass:Y,default:!1,tag:"tag:yaml.org,2002:set",createNode:(B,U,G)=>Y.from(B,U,G),resolve(B,U){if(X.isMap(B))if(B.hasAllNullValues(!0))return Object.assign(new Y,B);else U("Set items must all have null values");else U("Expected a mapping for this tag");return B}};Z.YAMLSet=Y,Z.set=q}),V7=w((Z)=>{var X=K8();function z(U,G){let H=U[0],_=H==="-"||H==="+"?U.substring(1):U,$=(J)=>G?BigInt(J):Number(J),Q=_.replace(/_/g,"").split(":").reduce((J,V)=>J*$(60)+$(V),$(0));return H==="-"?$(-1)*Q:Q}function W(U){let{value:G}=U,H=(J)=>J;if(typeof G==="bigint")H=(J)=>BigInt(J);else if(isNaN(G)||!isFinite(G))return X.stringifyNumber(U);let _="";if(G<0)_="-",G*=H(-1);let $=H(60),Q=[G%$];if(G<60)Q.unshift(0);else if(G=(G-Q[0])/$,Q.unshift(G%$),G>=60)G=(G-Q[0])/$,Q.unshift(G);return _+Q.map((J)=>String(J).padStart(2,"0")).join(":").replace(/000000\\d*$/,"")}var Y={identify:(U)=>typeof U==="bigint"||Number.isInteger(U),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(U,G,{intAsBigInt:H})=>z(U,H),stringify:W},q={identify:(U)=>typeof U==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*$/,resolve:(U)=>z(U,!1),stringify:W},B={identify:(U)=>U 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(U){let G=U.match(B.test);if(!G)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,H,_,$,Q,J,V]=G.map(Number),M=G[7]?Number((G[7]+"00").substr(1,3)):0,A=Date.UTC(H,_-1,$,Q||0,J||0,V||0,M),D=G[8];if(D&&D!=="Z"){let L=z(D,!1);if(Math.abs(L)<30)L*=60;A-=60000*L}return new Date(A)},stringify:({value:U})=>U?.toISOString().replace(/(T00:00:00)?\\.000Z$/,"")??""};Z.floatTime=q,Z.intTime=Y,Z.timestamp=B}),u9=w((Z)=>{var X=F8(),z=t6(),W=N8(),Y=$6(),q=H7(),B=v9(),U=y9(),G=m9(),H=r6(),_=J7(),$=e6(),Q=Y7(),J=V7(),V=[X.map,W.seq,Y.string,z.nullTag,B.trueTag,B.falseTag,G.intBin,G.intOct,G.int,G.intHex,U.floatNaN,U.floatExp,U.float,q.binary,H.merge,_.omap,$.pairs,Q.set,J.intTime,J.floatTime,J.timestamp];Z.schema=V}),c9=w((Z)=>{var X=F8(),z=t6(),W=N8(),Y=$6(),q=$7(),B=Q7(),U=W7(),G=g9(),H=h9(),_=H7(),$=r6(),Q=J7(),J=e6(),V=u9(),M=Y7(),A=V7(),D=new Map([["core",G.schema],["failsafe",[X.map,W.seq,Y.string]],["json",H.schema],["yaml11",V.schema],["yaml-1.1",V.schema]]),L={binary:_.binary,bool:q.boolTag,float:B.float,floatExp:B.floatExp,floatNaN:B.floatNaN,floatTime:A.floatTime,int:U.int,intHex:U.intHex,intOct:U.intOct,intTime:A.intTime,map:X.map,merge:$.merge,null:z.nullTag,omap:Q.omap,pairs:J.pairs,seq:W.seq,set:M.set,timestamp:A.timestamp},F={"tag:yaml.org,2002:binary":_.binary,"tag:yaml.org,2002:merge":$.merge,"tag:yaml.org,2002:omap":Q.omap,"tag:yaml.org,2002:pairs":J.pairs,"tag:yaml.org,2002:set":M.set,"tag:yaml.org,2002:timestamp":A.timestamp};function j(N,K,E){let T=D.get(K);if(T&&!N)return E&&!T.includes($.merge)?T.concat($.merge):T.slice();let P=T;if(!P)if(Array.isArray(N))P=[];else{let C=Array.from(D.keys()).filter((k)=>k!=="yaml11").map((k)=>JSON.stringify(k)).join(", ");throw Error(\`Unknown schema "\${K}"; use one of \${C} or define customTags array\`)}if(Array.isArray(N))for(let C of N)P=P.concat(C);else if(typeof N==="function")P=N(P.slice());if(E)P=P.concat($.merge);return P.reduce((C,k)=>{let f=typeof k==="string"?L[k]:k;if(!f){let l=JSON.stringify(k),U0=Object.keys(L).map((Q0)=>JSON.stringify(Q0)).join(", ");throw Error(\`Unknown custom tag \${l}; use one of \${U0}\`)}if(!C.includes(f))C.push(f);return C},[])}Z.coreKnownTags=F,Z.getTags=j}),_7=w((Z)=>{var X=u(),z=F8(),W=N8(),Y=$6(),q=c9(),B=(G,H)=>G.key<H.key?-1:G.key>H.key?1:0;class U{constructor({compat:G,customTags:H,merge:_,resolveKnownTags:$,schema:Q,sortMapEntries:J,toStringDefaults:V}){this.compat=Array.isArray(G)?q.getTags(G,"compat"):G?q.getTags(null,G):null,this.name=typeof Q==="string"&&Q||"core",this.knownTags=$?q.coreKnownTags:{},this.tags=q.getTags(H,this.name,_),this.toStringOptions=V??null,Object.defineProperty(this,X.MAP,{value:z.map}),Object.defineProperty(this,X.SCALAR,{value:Y.string}),Object.defineProperty(this,X.SEQ,{value:W.seq}),this.sortMapEntries=typeof J==="function"?J:J===!0?B:null}clone(){let G=Object.create(U.prototype,Object.getOwnPropertyDescriptors(this));return G.tags=this.tags.slice(),G}}Z.Schema=U}),d9=w((Z)=>{var X=u(),z=z6(),W=Z6();function Y(q,B){let U=[],G=B.directives===!0;if(B.directives!==!1&&q.directives){let J=q.directives.toString(q);if(J)U.push(J),G=!0;else if(q.directives.docStart)G=!0}if(G)U.push("---");let H=z.createStringifyContext(q,B),{commentString:_}=H.options;if(q.commentBefore){if(U.length!==1)U.unshift("");let J=_(q.commentBefore);U.unshift(W.indentComment(J,""))}let $=!1,Q=null;if(q.contents){if(X.isNode(q.contents)){if(q.contents.spaceBefore&&G)U.push("");if(q.contents.commentBefore){let M=_(q.contents.commentBefore);U.push(W.indentComment(M,""))}H.forceBlockIndent=!!q.comment,Q=q.contents.comment}let J=Q?void 0:()=>$=!0,V=z.stringify(q.contents,H,()=>Q=null,J);if(Q)V+=W.lineComment(V,"",_(Q));if((V[0]==="|"||V[0]===">")&&U[U.length-1]==="---")U[U.length-1]=\`--- \${V}\`;else U.push(V)}else U.push(z.stringify(q.contents,H));if(q.directives?.docEnd)if(q.comment){let J=_(q.comment);if(J.includes(\`
22157
22157
  \`))U.push("..."),U.push(W.indentComment(J,""));else U.push(\`... \${J}\`)}else U.push("...");else{let J=q.comment;if(J&&$)J=J.replace(/^\\n+/,"");if(J){if((!$||Q)&&U[U.length-1]!=="")U.push("");U.push(W.indentComment(_(J),""))}}return U.join(\`
22158
22158
  \`)+\`
22159
- \`}Z.stringifyDocument=Y}),Q6=w((Z)=>{var X=t8(),z=a6(),W=u(),Y=gZ(),q=xZ(),B=_7(),U=d9(),G=o6(),H=e5(),_=e8(),$=t5();class Q{constructor(V,M,A){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,W.NODE_TYPE,{value:W.DOC});let L=null;if(typeof M==="function"||Array.isArray(M))L=M;else if(A===void 0&&M)A=M,M=void 0;let D=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},A);this.options=D;let{version:F}=D;if(A?._directives){if(this.directives=A._directives.atDocument(),this.directives.yaml.explicit)F=this.directives.yaml.version}else this.directives=new $.Directives({version:F});this.setSchema(F,A),this.contents=V===void 0?null:this.createNode(V,L,A)}clone(){let V=Object.create(Q.prototype,{[W.NODE_TYPE]:{value:W.DOC}});if(V.commentBefore=this.commentBefore,V.comment=this.comment,V.errors=this.errors.slice(),V.warnings=this.warnings.slice(),V.options=Object.assign({},this.options),this.directives)V.directives=this.directives.clone();if(V.schema=this.schema.clone(),V.contents=W.isNode(this.contents)?this.contents.clone(V.schema):this.contents,this.range)V.range=this.range.slice();return V}add(V){if(J(this.contents))this.contents.add(V)}addIn(V,M){if(J(this.contents))this.contents.addIn(V,M)}createAlias(V,M){if(!V.anchor){let A=G.anchorNames(this);V.anchor=!M||A.has(M)?G.findNewAnchor(M||"a",A):M}return new X.Alias(V.anchor)}createNode(V,M,A){let L=void 0;if(typeof M==="function")V=M.call({"":V},"",V),L=M;else if(Array.isArray(M)){let l=(Q0)=>typeof Q0==="number"||Q0 instanceof String||Q0 instanceof Number,U0=M.filter(l).map(String);if(U0.length>0)M=M.concat(U0);L=M}else if(A===void 0&&M)A=M,M=void 0;let{aliasDuplicateObjects:D,anchorPrefix:F,flow:j,keepUndefined:N,onTagObj:K,tag:E}=A??{},{onAnchor:T,setAnchors:P,sourceObjects:C}=G.createNodeAnchors(this,F||"a"),k={aliasDuplicateObjects:D??!0,keepUndefined:N??!1,onAnchor:T,onTagObj:K,replacer:L,schema:this.schema,sourceObjects:C},f=_.createNode(V,E,k);if(j&&W.isCollection(f))f.flow=!0;return P(),f}createPair(V,M,A={}){let L=this.createNode(V,null,A),D=this.createNode(M,null,A);return new Y.Pair(L,D)}delete(V){return J(this.contents)?this.contents.delete(V):!1}deleteIn(V){if(z.isEmptyPath(V)){if(this.contents==null)return!1;return this.contents=null,!0}return J(this.contents)?this.contents.deleteIn(V):!1}get(V,M){return W.isCollection(this.contents)?this.contents.get(V,M):void 0}getIn(V,M){if(z.isEmptyPath(V))return!M&&W.isScalar(this.contents)?this.contents.value:this.contents;return W.isCollection(this.contents)?this.contents.getIn(V,M):void 0}has(V){return W.isCollection(this.contents)?this.contents.has(V):!1}hasIn(V){if(z.isEmptyPath(V))return this.contents!==void 0;return W.isCollection(this.contents)?this.contents.hasIn(V):!1}set(V,M){if(this.contents==null)this.contents=z.collectionFromPath(this.schema,[V],M);else if(J(this.contents))this.contents.set(V,M)}setIn(V,M){if(z.isEmptyPath(V))this.contents=M;else if(this.contents==null)this.contents=z.collectionFromPath(this.schema,Array.from(V),M);else if(J(this.contents))this.contents.setIn(V,M)}setSchema(V,M={}){if(typeof V==="number")V=String(V);let A;switch(V){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new $.Directives({version:"1.1"});A={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=V;else this.directives=new $.Directives({version:V});A={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;A=null;break;default:{let L=JSON.stringify(V);throw Error(\`Expected '1.1', '1.2' or null as first argument, but found: \${L}\`)}}if(M.schema instanceof Object)this.schema=M.schema;else if(A)this.schema=new B.Schema(Object.assign(A,M));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:V,jsonArg:M,mapAsMap:A,maxAliasCount:L,onAnchor:D,reviver:F}={}){let j={anchors:new Map,doc:this,keep:!V,mapAsMap:A===!0,mapKeyWarned:!1,maxAliasCount:typeof L==="number"?L:100},N=q.toJS(this.contents,M??"",j);if(typeof D==="function")for(let{count:K,res:E}of j.anchors.values())D(E,K);return typeof F==="function"?H.applyReviver(F,{"":N},"",N):N}toJSON(V,M){return this.toJS({json:!0,jsonArg:V,mapAsMap:!1,onAnchor:M})}toString(V={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in V&&(!Number.isInteger(V.indent)||Number(V.indent)<=0)){let M=JSON.stringify(V.indent);throw Error(\`"indent" option must be a positive integer, not \${M}\`)}return U.stringifyDocument(this,V)}}function J(V){if(W.isCollection(V))return!0;throw Error("Expected a YAML collection as document contents")}Z.Document=Q}),W6=w((Z)=>{class X extends Error{constructor(q,B,U,G){super();this.name=q,this.code=U,this.message=G,this.pos=B}}class z extends X{constructor(q,B,U){super("YAMLParseError",q,B,U)}}class W extends X{constructor(q,B,U){super("YAMLWarning",q,B,U)}}var Y=(q,B)=>(U)=>{if(U.pos[0]===-1)return;U.linePos=U.pos.map((Q)=>B.linePos(Q));let{line:G,col:H}=U.linePos[0];U.message+=\` at line \${G}, column \${H}\`;let _=H-1,$=q.substring(B.lineStarts[G-1],B.lineStarts[G]).replace(/[\\n\\r]+$/,"");if(_>=60&&$.length>80){let Q=Math.min(_-39,$.length-79);$="…"+$.substring(Q),_-=Q-1}if($.length>80)$=$.substring(0,79)+"…";if(G>1&&/^ *$/.test($.substring(0,_))){let Q=q.substring(B.lineStarts[G-2],B.lineStarts[G-1]);if(Q.length>80)Q=Q.substring(0,79)+\`…
22159
+ \`}Z.stringifyDocument=Y}),Q6=w((Z)=>{var X=t8(),z=a6(),W=u(),Y=gZ(),q=xZ(),B=_7(),U=d9(),G=o6(),H=e5(),_=e8(),$=t5();class Q{constructor(V,M,A){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,W.NODE_TYPE,{value:W.DOC});let D=null;if(typeof M==="function"||Array.isArray(M))D=M;else if(A===void 0&&M)A=M,M=void 0;let L=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},A);this.options=L;let{version:F}=L;if(A?._directives){if(this.directives=A._directives.atDocument(),this.directives.yaml.explicit)F=this.directives.yaml.version}else this.directives=new $.Directives({version:F});this.setSchema(F,A),this.contents=V===void 0?null:this.createNode(V,D,A)}clone(){let V=Object.create(Q.prototype,{[W.NODE_TYPE]:{value:W.DOC}});if(V.commentBefore=this.commentBefore,V.comment=this.comment,V.errors=this.errors.slice(),V.warnings=this.warnings.slice(),V.options=Object.assign({},this.options),this.directives)V.directives=this.directives.clone();if(V.schema=this.schema.clone(),V.contents=W.isNode(this.contents)?this.contents.clone(V.schema):this.contents,this.range)V.range=this.range.slice();return V}add(V){if(J(this.contents))this.contents.add(V)}addIn(V,M){if(J(this.contents))this.contents.addIn(V,M)}createAlias(V,M){if(!V.anchor){let A=G.anchorNames(this);V.anchor=!M||A.has(M)?G.findNewAnchor(M||"a",A):M}return new X.Alias(V.anchor)}createNode(V,M,A){let D=void 0;if(typeof M==="function")V=M.call({"":V},"",V),D=M;else if(Array.isArray(M)){let l=(Q0)=>typeof Q0==="number"||Q0 instanceof String||Q0 instanceof Number,U0=M.filter(l).map(String);if(U0.length>0)M=M.concat(U0);D=M}else if(A===void 0&&M)A=M,M=void 0;let{aliasDuplicateObjects:L,anchorPrefix:F,flow:j,keepUndefined:N,onTagObj:K,tag:E}=A??{},{onAnchor:T,setAnchors:P,sourceObjects:C}=G.createNodeAnchors(this,F||"a"),k={aliasDuplicateObjects:L??!0,keepUndefined:N??!1,onAnchor:T,onTagObj:K,replacer:D,schema:this.schema,sourceObjects:C},f=_.createNode(V,E,k);if(j&&W.isCollection(f))f.flow=!0;return P(),f}createPair(V,M,A={}){let D=this.createNode(V,null,A),L=this.createNode(M,null,A);return new Y.Pair(D,L)}delete(V){return J(this.contents)?this.contents.delete(V):!1}deleteIn(V){if(z.isEmptyPath(V)){if(this.contents==null)return!1;return this.contents=null,!0}return J(this.contents)?this.contents.deleteIn(V):!1}get(V,M){return W.isCollection(this.contents)?this.contents.get(V,M):void 0}getIn(V,M){if(z.isEmptyPath(V))return!M&&W.isScalar(this.contents)?this.contents.value:this.contents;return W.isCollection(this.contents)?this.contents.getIn(V,M):void 0}has(V){return W.isCollection(this.contents)?this.contents.has(V):!1}hasIn(V){if(z.isEmptyPath(V))return this.contents!==void 0;return W.isCollection(this.contents)?this.contents.hasIn(V):!1}set(V,M){if(this.contents==null)this.contents=z.collectionFromPath(this.schema,[V],M);else if(J(this.contents))this.contents.set(V,M)}setIn(V,M){if(z.isEmptyPath(V))this.contents=M;else if(this.contents==null)this.contents=z.collectionFromPath(this.schema,Array.from(V),M);else if(J(this.contents))this.contents.setIn(V,M)}setSchema(V,M={}){if(typeof V==="number")V=String(V);let A;switch(V){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new $.Directives({version:"1.1"});A={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=V;else this.directives=new $.Directives({version:V});A={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;A=null;break;default:{let D=JSON.stringify(V);throw Error(\`Expected '1.1', '1.2' or null as first argument, but found: \${D}\`)}}if(M.schema instanceof Object)this.schema=M.schema;else if(A)this.schema=new B.Schema(Object.assign(A,M));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:V,jsonArg:M,mapAsMap:A,maxAliasCount:D,onAnchor:L,reviver:F}={}){let j={anchors:new Map,doc:this,keep:!V,mapAsMap:A===!0,mapKeyWarned:!1,maxAliasCount:typeof D==="number"?D:100},N=q.toJS(this.contents,M??"",j);if(typeof L==="function")for(let{count:K,res:E}of j.anchors.values())L(E,K);return typeof F==="function"?H.applyReviver(F,{"":N},"",N):N}toJSON(V,M){return this.toJS({json:!0,jsonArg:V,mapAsMap:!1,onAnchor:M})}toString(V={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in V&&(!Number.isInteger(V.indent)||Number(V.indent)<=0)){let M=JSON.stringify(V.indent);throw Error(\`"indent" option must be a positive integer, not \${M}\`)}return U.stringifyDocument(this,V)}}function J(V){if(W.isCollection(V))return!0;throw Error("Expected a YAML collection as document contents")}Z.Document=Q}),W6=w((Z)=>{class X extends Error{constructor(q,B,U,G){super();this.name=q,this.code=U,this.message=G,this.pos=B}}class z extends X{constructor(q,B,U){super("YAMLParseError",q,B,U)}}class W extends X{constructor(q,B,U){super("YAMLWarning",q,B,U)}}var Y=(q,B)=>(U)=>{if(U.pos[0]===-1)return;U.linePos=U.pos.map((Q)=>B.linePos(Q));let{line:G,col:H}=U.linePos[0];U.message+=\` at line \${G}, column \${H}\`;let _=H-1,$=q.substring(B.lineStarts[G-1],B.lineStarts[G]).replace(/[\\n\\r]+$/,"");if(_>=60&&$.length>80){let Q=Math.min(_-39,$.length-79);$="…"+$.substring(Q),_-=Q-1}if($.length>80)$=$.substring(0,79)+"…";if(G>1&&/^ *$/.test($.substring(0,_))){let Q=q.substring(B.lineStarts[G-2],B.lineStarts[G-1]);if(Q.length>80)Q=Q.substring(0,79)+\`…
22160
22160
  \`;$=Q+$}if(/[^ ]/.test($)){let Q=1,J=U.linePos[1];if(J?.line===G&&J.col>H)Q=Math.max(1,Math.min(J.col-H,80-_));let V=" ".repeat(_)+"^".repeat(Q);U.message+=\`:
22161
22161
 
22162
22162
  \${$}
22163
22163
  \${V}
22164
- \`}};Z.YAMLError=X,Z.YAMLParseError=z,Z.YAMLWarning=W,Z.prettifyError=Y}),H6=w((Z)=>{function X(z,{flow:W,indicator:Y,next:q,offset:B,onError:U,parentIndent:G,startOnNewline:H}){let _=!1,$=H,Q=H,J="",V="",M=!1,A=!1,L=null,D=null,F=null,j=null,N=null,K=null,E=null;for(let C of z){if(A){if(C.type!=="space"&&C.type!=="newline"&&C.type!=="comma")U(C.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");A=!1}if(L){if($&&C.type!=="comment"&&C.type!=="newline")U(L,"TAB_AS_INDENT","Tabs are not allowed as indentation");L=null}switch(C.type){case"space":if(!W&&(Y!=="doc-start"||q?.type!=="flow-collection")&&C.source.includes("\\t"))L=C;Q=!0;break;case"comment":{if(!Q)U(C,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let k=C.source.substring(1)||" ";if(!J)J=k;else J+=V+k;V="",$=!1;break}case"newline":if($){if(J)J+=C.source;else if(!K||Y!=="seq-item-ind")_=!0}else V+=C.source;if($=!0,M=!0,D||F)j=C;Q=!0;break;case"anchor":if(D)U(C,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(C.source.endsWith(":"))U(C.offset+C.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);D=C,E??(E=C.offset),$=!1,Q=!1,A=!0;break;case"tag":{if(F)U(C,"MULTIPLE_TAGS","A node can have at most one tag");F=C,E??(E=C.offset),$=!1,Q=!1,A=!0;break}case Y:if(D||F)U(C,"BAD_PROP_ORDER",\`Anchors and tags must be after the \${C.source} indicator\`);if(K)U(C,"UNEXPECTED_TOKEN",\`Unexpected \${C.source} in \${W??"collection"}\`);K=C,$=Y==="seq-item-ind"||Y==="explicit-key-ind",Q=!1;break;case"comma":if(W){if(N)U(C,"UNEXPECTED_TOKEN",\`Unexpected , in \${W}\`);N=C,$=!1,Q=!1;break}default:U(C,"UNEXPECTED_TOKEN",\`Unexpected \${C.type} token\`),$=!1,Q=!1}}let T=z[z.length-1],P=T?T.offset+T.source.length:B;if(A&&q&&q.type!=="space"&&q.type!=="newline"&&q.type!=="comma"&&(q.type!=="scalar"||q.source!==""))U(q.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(L&&($&&L.indent<=G||q?.type==="block-map"||q?.type==="block-seq"))U(L,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:N,found:K,spaceBefore:_,comment:J,hasNewline:M,anchor:D,tag:F,newlineAfterProp:j,end:P,start:E??P}}Z.resolveProps=X}),Z5=w((Z)=>{function X(z){if(!z)return null;switch(z.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(z.source.includes(\`
22165
- \`))return!0;if(z.end){for(let W of z.end)if(W.type==="newline")return!0}return!1;case"flow-collection":for(let W of z.items){for(let Y of W.start)if(Y.type==="newline")return!0;if(W.sep){for(let Y of W.sep)if(Y.type==="newline")return!0}if(X(W.key)||X(W.value))return!0}return!1;default:return!0}}Z.containsNewline=X}),B7=w((Z)=>{var X=Z5();function z(W,Y,q){if(Y?.type==="flow-collection"){let B=Y.end[0];if(B.indent===W&&(B.source==="]"||B.source==="}")&&X.containsNewline(Y))q(B,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Z.flowIndentCheck=z}),U7=w((Z)=>{var X=u();function z(W,Y,q){let{uniqueKeys:B}=W.options;if(B===!1)return!1;let U=typeof B==="function"?B:(G,H)=>G===H||X.isScalar(G)&&X.isScalar(H)&&G.value===H.value;return Y.some((G)=>U(G.key,q))}Z.mapIncludes=z}),p9=w((Z)=>{var X=gZ(),z=hZ(),W=H6(),Y=Z5(),q=B7(),B=U7(),U="All mapping items must start at the same column";function G({composeNode:H,composeEmptyNode:_},$,Q,J,V){let A=new(V?.nodeClass??z.YAMLMap)($.schema);if($.atRoot)$.atRoot=!1;let L=Q.offset,D=null;for(let F of Q.items){let{start:j,key:N,sep:K,value:E}=F,T=W.resolveProps(j,{indicator:"explicit-key-ind",next:N??K?.[0],offset:L,onError:J,parentIndent:Q.indent,startOnNewline:!0}),P=!T.found;if(P){if(N){if(N.type==="block-seq")J(L,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in N&&N.indent!==Q.indent)J(L,"BAD_INDENT",U)}if(!T.anchor&&!T.tag&&!K){if(D=T.end,T.comment)if(A.comment)A.comment+=\`
22166
- \`+T.comment;else A.comment=T.comment;continue}if(T.newlineAfterProp||Y.containsNewline(N))J(N??j[j.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(T.found?.indent!==Q.indent)J(L,"BAD_INDENT",U);$.atKey=!0;let C=T.end,k=N?H($,N,T,J):_($,C,j,null,T,J);if($.schema.compat)q.flowIndentCheck(Q.indent,N,J);if($.atKey=!1,B.mapIncludes($,A.items,k))J(C,"DUPLICATE_KEY","Map keys must be unique");let f=W.resolveProps(K??[],{indicator:"map-value-ind",next:E,offset:k.range[2],onError:J,parentIndent:Q.indent,startOnNewline:!N||N.type==="block-scalar"});if(L=f.end,f.found){if(P){if(E?.type==="block-map"&&!f.hasNewline)J(L,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if($.options.strict&&T.start<f.found.offset-1024)J(k.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let l=E?H($,E,f,J):_($,L,K,null,f,J);if($.schema.compat)q.flowIndentCheck(Q.indent,E,J);L=l.range[2];let U0=new X.Pair(k,l);if($.options.keepSourceTokens)U0.srcToken=F;A.items.push(U0)}else{if(P)J(k.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(f.comment)if(k.comment)k.comment+=\`
22167
- \`+f.comment;else k.comment=f.comment;let l=new X.Pair(k);if($.options.keepSourceTokens)l.srcToken=F;A.items.push(l)}}if(D&&D<L)J(D,"IMPOSSIBLE","Map comment with trailing content");return A.range=[Q.offset,L,D??L],A}Z.resolveBlockMap=G}),l9=w((Z)=>{var X=vZ(),z=H6(),W=B7();function Y({composeNode:q,composeEmptyNode:B},U,G,H,_){let Q=new(_?.nodeClass??X.YAMLSeq)(U.schema);if(U.atRoot)U.atRoot=!1;if(U.atKey)U.atKey=!1;let J=G.offset,V=null;for(let{start:M,value:A}of G.items){let L=z.resolveProps(M,{indicator:"seq-item-ind",next:A,offset:J,onError:H,parentIndent:G.indent,startOnNewline:!0});if(!L.found)if(L.anchor||L.tag||A)if(A?.type==="block-seq")H(L.end,"BAD_INDENT","All sequence items must start at the same column");else H(J,"MISSING_CHAR","Sequence item without - indicator");else{if(V=L.end,L.comment)Q.comment=L.comment;continue}let D=A?q(U,A,L,H):B(U,L.end,M,null,L,H);if(U.schema.compat)W.flowIndentCheck(G.indent,A,H);J=D.range[2],Q.items.push(D)}return Q.range=[G.offset,J,V??J],Q}Z.resolveBlockSeq=Y}),j8=w((Z)=>{function X(z,W,Y,q){let B="";if(z){let U=!1,G="";for(let H of z){let{source:_,type:$}=H;switch($){case"space":U=!0;break;case"comment":{if(Y&&!U)q(H,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let Q=_.substring(1)||" ";if(!B)B=Q;else B+=G+Q;G="";break}case"newline":if(B)G+=_;U=!0;break;default:q(H,"UNEXPECTED_TOKEN",\`Unexpected \${$} at node end\`)}W+=_.length}}return{comment:B,offset:W}}Z.resolveEnd=X}),n9=w((Z)=>{var X=u(),z=gZ(),W=hZ(),Y=vZ(),q=j8(),B=H6(),U=Z5(),G=U7(),H="Block collections are not allowed within flow collections",_=(Q)=>Q&&(Q.type==="block-map"||Q.type==="block-seq");function $({composeNode:Q,composeEmptyNode:J},V,M,A,L){let D=M.start.source==="{",F=D?"flow map":"flow sequence",N=new(L?.nodeClass??(D?W.YAMLMap:Y.YAMLSeq))(V.schema);N.flow=!0;let K=V.atRoot;if(K)V.atRoot=!1;if(V.atKey)V.atKey=!1;let E=M.offset+M.start.source.length;for(let f=0;f<M.items.length;++f){let l=M.items[f],{start:U0,key:Q0,sep:l0,value:G0}=l,x=B.resolveProps(U0,{flow:F,indicator:"explicit-key-ind",next:Q0??l0?.[0],offset:E,onError:A,parentIndent:M.indent,startOnNewline:!1});if(!x.found){if(!x.anchor&&!x.tag&&!l0&&!G0){if(f===0&&x.comma)A(x.comma,"UNEXPECTED_TOKEN",\`Unexpected , in \${F}\`);else if(f<M.items.length-1)A(x.start,"UNEXPECTED_TOKEN",\`Unexpected empty item in \${F}\`);if(x.comment)if(N.comment)N.comment+=\`
22168
- \`+x.comment;else N.comment=x.comment;E=x.end;continue}if(!D&&V.options.strict&&U.containsNewline(Q0))A(Q0,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(f===0){if(x.comma)A(x.comma,"UNEXPECTED_TOKEN",\`Unexpected , in \${F}\`)}else{if(!x.comma)A(x.start,"MISSING_CHAR",\`Missing , between \${F} items\`);if(x.comment){let K0="";Z:for(let X0 of U0)switch(X0.type){case"comma":case"space":break;case"comment":K0=X0.source.substring(1);break Z;default:break Z}if(K0){let X0=N.items[N.items.length-1];if(X.isPair(X0))X0=X0.value??X0.key;if(X0.comment)X0.comment+=\`
22169
- \`+K0;else X0.comment=K0;x.comment=x.comment.substring(K0.length+1)}}}if(!D&&!l0&&!x.found){let K0=G0?Q(V,G0,x,A):J(V,x.end,l0,null,x,A);if(N.items.push(K0),E=K0.range[2],_(G0))A(K0.range,"BLOCK_IN_FLOW",H)}else{V.atKey=!0;let K0=x.end,X0=Q0?Q(V,Q0,x,A):J(V,K0,U0,null,x,A);if(_(Q0))A(X0.range,"BLOCK_IN_FLOW",H);V.atKey=!1;let j0=B.resolveProps(l0??[],{flow:F,indicator:"map-value-ind",next:G0,offset:X0.range[2],onError:A,parentIndent:M.indent,startOnNewline:!1});if(j0.found){if(!D&&!x.found&&V.options.strict){if(l0)for(let n0 of l0){if(n0===j0.found)break;if(n0.type==="newline"){A(n0,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(x.start<j0.found.offset-1024)A(j0.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(G0)if("source"in G0&&G0.source?.[0]===":")A(G0,"MISSING_CHAR",\`Missing space after : in \${F}\`);else A(j0.start,"MISSING_CHAR",\`Missing , or : between \${F} items\`);let oZ=G0?Q(V,G0,j0,A):j0.found?J(V,j0.end,l0,null,j0,A):null;if(oZ){if(_(G0))A(oZ.range,"BLOCK_IN_FLOW",H)}else if(j0.comment)if(X0.comment)X0.comment+=\`
22170
- \`+j0.comment;else X0.comment=j0.comment;let y6=new z.Pair(X0,oZ);if(V.options.keepSourceTokens)y6.srcToken=l;if(D){let n0=N;if(G.mapIncludes(V,n0.items,X0))A(K0,"DUPLICATE_KEY","Map keys must be unique");n0.items.push(y6)}else{let n0=new W.YAMLMap(V.schema);n0.flow=!0,n0.items.push(y6);let v5=(oZ??X0).range;n0.range=[X0.range[0],v5[1],v5[2]],N.items.push(n0)}E=oZ?oZ.range[2]:j0.end}}let T=D?"}":"]",[P,...C]=M.end,k=E;if(P?.source===T)k=P.offset+P.source.length;else{let f=F[0].toUpperCase()+F.substring(1),l=K?\`\${f} must end with a \${T}\`:\`\${f} in block collection must be sufficiently indented and end with a \${T}\`;if(A(E,K?"MISSING_CHAR":"BAD_INDENT",l),P&&P.source.length!==1)C.unshift(P)}if(C.length>0){let f=q.resolveEnd(C,k,V.options.strict,A);if(f.comment)if(N.comment)N.comment+=\`
22171
- \`+f.comment;else N.comment=f.comment;N.range=[M.offset,k,f.offset]}else N.range=[M.offset,k,k];return N}Z.resolveFlowCollection=$}),i9=w((Z)=>{var X=u(),z=q0(),W=hZ(),Y=vZ(),q=p9(),B=l9(),U=n9();function G(_,$,Q,J,V,M){let A=Q.type==="block-map"?q.resolveBlockMap(_,$,Q,J,M):Q.type==="block-seq"?B.resolveBlockSeq(_,$,Q,J,M):U.resolveFlowCollection(_,$,Q,J,M),L=A.constructor;if(V==="!"||V===L.tagName)return A.tag=L.tagName,A;if(V)A.tag=V;return A}function H(_,$,Q,J,V){let M=J.tag,A=!M?null:$.directives.tagName(M.source,(K)=>V(M,"TAG_RESOLVE_FAILED",K));if(Q.type==="block-seq"){let{anchor:K,newlineAfterProp:E}=J,T=K&&M?K.offset>M.offset?K:M:K??M;if(T&&(!E||E.offset<T.offset))V(T,"MISSING_CHAR","Missing newline after block sequence props")}let L=Q.type==="block-map"?"map":Q.type==="block-seq"?"seq":Q.start.source==="{"?"map":"seq";if(!M||!A||A==="!"||A===W.YAMLMap.tagName&&L==="map"||A===Y.YAMLSeq.tagName&&L==="seq")return G(_,$,Q,V,A);let D=$.schema.tags.find((K)=>K.tag===A&&K.collection===L);if(!D){let K=$.schema.knownTags[A];if(K?.collection===L)$.schema.tags.push(Object.assign({},K,{default:!1})),D=K;else{if(K)V(M,"BAD_COLLECTION_TYPE",\`\${K.tag} used for \${L} collection, but expects \${K.collection??"scalar"}\`,!0);else V(M,"TAG_RESOLVE_FAILED",\`Unresolved tag: \${A}\`,!0);return G(_,$,Q,V,A)}}let F=G(_,$,Q,V,A,D),j=D.resolve?.(F,(K)=>V(M,"TAG_RESOLVE_FAILED",K),$.options)??F,N=X.isNode(j)?j:new z.Scalar(j);if(N.range=F.range,N.tag=A,D?.format)N.format=D.format;return N}Z.composeCollection=H}),G7=w((Z)=>{var X=q0();function z(q,B,U){let G=B.offset,H=W(B,q.options.strict,U);if(!H)return{value:"",type:null,comment:"",range:[G,G,G]};let _=H.mode===">"?X.Scalar.BLOCK_FOLDED:X.Scalar.BLOCK_LITERAL,$=B.source?Y(B.source):[],Q=$.length;for(let j=$.length-1;j>=0;--j){let N=$[j][1];if(N===""||N==="\\r")Q=j;else break}if(Q===0){let j=H.chomp==="+"&&$.length>0?\`
22172
- \`.repeat(Math.max(1,$.length-1)):"",N=G+H.length;if(B.source)N+=B.source.length;return{value:j,type:_,comment:H.comment,range:[G,N,N]}}let J=B.indent+H.indent,V=B.offset+H.length,M=0;for(let j=0;j<Q;++j){let[N,K]=$[j];if(K===""||K==="\\r"){if(H.indent===0&&N.length>J)J=N.length}else{if(N.length<J)U(V+N.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(H.indent===0)J=N.length;if(M=j,J===0&&!q.atRoot)U(V,"BAD_INDENT","Block scalar values in collections must be indented");break}V+=N.length+K.length+1}for(let j=$.length-1;j>=Q;--j)if($[j][0].length>J)Q=j+1;let A="",L="",D=!1;for(let j=0;j<M;++j)A+=$[j][0].slice(J)+\`
22173
- \`;for(let j=M;j<Q;++j){let[N,K]=$[j];V+=N.length+K.length+1;let E=K[K.length-1]==="\\r";if(E)K=K.slice(0,-1);if(K&&N.length<J){let P=\`Block scalar lines must not be less indented than their \${H.indent?"explicit indentation indicator":"first line"}\`;U(V-K.length-(E?2:1),"BAD_INDENT",P),N=""}if(_===X.Scalar.BLOCK_LITERAL)A+=L+N.slice(J)+K,L=\`
22174
- \`;else if(N.length>J||K[0]==="\\t"){if(L===" ")L=\`
22175
- \`;else if(!D&&L===\`
22176
- \`)L=\`
22177
-
22178
- \`;A+=L+N.slice(J)+K,L=\`
22179
- \`,D=!0}else if(K==="")if(L===\`
22164
+ \`}};Z.YAMLError=X,Z.YAMLParseError=z,Z.YAMLWarning=W,Z.prettifyError=Y}),H6=w((Z)=>{function X(z,{flow:W,indicator:Y,next:q,offset:B,onError:U,parentIndent:G,startOnNewline:H}){let _=!1,$=H,Q=H,J="",V="",M=!1,A=!1,D=null,L=null,F=null,j=null,N=null,K=null,E=null;for(let C of z){if(A){if(C.type!=="space"&&C.type!=="newline"&&C.type!=="comma")U(C.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");A=!1}if(D){if($&&C.type!=="comment"&&C.type!=="newline")U(D,"TAB_AS_INDENT","Tabs are not allowed as indentation");D=null}switch(C.type){case"space":if(!W&&(Y!=="doc-start"||q?.type!=="flow-collection")&&C.source.includes("\\t"))D=C;Q=!0;break;case"comment":{if(!Q)U(C,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let k=C.source.substring(1)||" ";if(!J)J=k;else J+=V+k;V="",$=!1;break}case"newline":if($){if(J)J+=C.source;else if(!K||Y!=="seq-item-ind")_=!0}else V+=C.source;if($=!0,M=!0,L||F)j=C;Q=!0;break;case"anchor":if(L)U(C,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(C.source.endsWith(":"))U(C.offset+C.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);L=C,E??(E=C.offset),$=!1,Q=!1,A=!0;break;case"tag":{if(F)U(C,"MULTIPLE_TAGS","A node can have at most one tag");F=C,E??(E=C.offset),$=!1,Q=!1,A=!0;break}case Y:if(L||F)U(C,"BAD_PROP_ORDER",\`Anchors and tags must be after the \${C.source} indicator\`);if(K)U(C,"UNEXPECTED_TOKEN",\`Unexpected \${C.source} in \${W??"collection"}\`);K=C,$=Y==="seq-item-ind"||Y==="explicit-key-ind",Q=!1;break;case"comma":if(W){if(N)U(C,"UNEXPECTED_TOKEN",\`Unexpected , in \${W}\`);N=C,$=!1,Q=!1;break}default:U(C,"UNEXPECTED_TOKEN",\`Unexpected \${C.type} token\`),$=!1,Q=!1}}let T=z[z.length-1],P=T?T.offset+T.source.length:B;if(A&&q&&q.type!=="space"&&q.type!=="newline"&&q.type!=="comma"&&(q.type!=="scalar"||q.source!==""))U(q.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(D&&($&&D.indent<=G||q?.type==="block-map"||q?.type==="block-seq"))U(D,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:N,found:K,spaceBefore:_,comment:J,hasNewline:M,anchor:L,tag:F,newlineAfterProp:j,end:P,start:E??P}}Z.resolveProps=X}),Z5=w((Z)=>{function X(z){if(!z)return null;switch(z.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(z.source.includes(\`
22165
+ \`))return!0;if(z.end){for(let W of z.end)if(W.type==="newline")return!0}return!1;case"flow-collection":for(let W of z.items){for(let Y of W.start)if(Y.type==="newline")return!0;if(W.sep){for(let Y of W.sep)if(Y.type==="newline")return!0}if(X(W.key)||X(W.value))return!0}return!1;default:return!0}}Z.containsNewline=X}),B7=w((Z)=>{var X=Z5();function z(W,Y,q){if(Y?.type==="flow-collection"){let B=Y.end[0];if(B.indent===W&&(B.source==="]"||B.source==="}")&&X.containsNewline(Y))q(B,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Z.flowIndentCheck=z}),U7=w((Z)=>{var X=u();function z(W,Y,q){let{uniqueKeys:B}=W.options;if(B===!1)return!1;let U=typeof B==="function"?B:(G,H)=>G===H||X.isScalar(G)&&X.isScalar(H)&&G.value===H.value;return Y.some((G)=>U(G.key,q))}Z.mapIncludes=z}),p9=w((Z)=>{var X=gZ(),z=hZ(),W=H6(),Y=Z5(),q=B7(),B=U7(),U="All mapping items must start at the same column";function G({composeNode:H,composeEmptyNode:_},$,Q,J,V){let A=new(V?.nodeClass??z.YAMLMap)($.schema);if($.atRoot)$.atRoot=!1;let D=Q.offset,L=null;for(let F of Q.items){let{start:j,key:N,sep:K,value:E}=F,T=W.resolveProps(j,{indicator:"explicit-key-ind",next:N??K?.[0],offset:D,onError:J,parentIndent:Q.indent,startOnNewline:!0}),P=!T.found;if(P){if(N){if(N.type==="block-seq")J(D,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in N&&N.indent!==Q.indent)J(D,"BAD_INDENT",U)}if(!T.anchor&&!T.tag&&!K){if(L=T.end,T.comment)if(A.comment)A.comment+=\`
22166
+ \`+T.comment;else A.comment=T.comment;continue}if(T.newlineAfterProp||Y.containsNewline(N))J(N??j[j.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(T.found?.indent!==Q.indent)J(D,"BAD_INDENT",U);$.atKey=!0;let C=T.end,k=N?H($,N,T,J):_($,C,j,null,T,J);if($.schema.compat)q.flowIndentCheck(Q.indent,N,J);if($.atKey=!1,B.mapIncludes($,A.items,k))J(C,"DUPLICATE_KEY","Map keys must be unique");let f=W.resolveProps(K??[],{indicator:"map-value-ind",next:E,offset:k.range[2],onError:J,parentIndent:Q.indent,startOnNewline:!N||N.type==="block-scalar"});if(D=f.end,f.found){if(P){if(E?.type==="block-map"&&!f.hasNewline)J(D,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if($.options.strict&&T.start<f.found.offset-1024)J(k.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let l=E?H($,E,f,J):_($,D,K,null,f,J);if($.schema.compat)q.flowIndentCheck(Q.indent,E,J);D=l.range[2];let U0=new X.Pair(k,l);if($.options.keepSourceTokens)U0.srcToken=F;A.items.push(U0)}else{if(P)J(k.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(f.comment)if(k.comment)k.comment+=\`
22167
+ \`+f.comment;else k.comment=f.comment;let l=new X.Pair(k);if($.options.keepSourceTokens)l.srcToken=F;A.items.push(l)}}if(L&&L<D)J(L,"IMPOSSIBLE","Map comment with trailing content");return A.range=[Q.offset,D,L??D],A}Z.resolveBlockMap=G}),l9=w((Z)=>{var X=vZ(),z=H6(),W=B7();function Y({composeNode:q,composeEmptyNode:B},U,G,H,_){let Q=new(_?.nodeClass??X.YAMLSeq)(U.schema);if(U.atRoot)U.atRoot=!1;if(U.atKey)U.atKey=!1;let J=G.offset,V=null;for(let{start:M,value:A}of G.items){let D=z.resolveProps(M,{indicator:"seq-item-ind",next:A,offset:J,onError:H,parentIndent:G.indent,startOnNewline:!0});if(!D.found)if(D.anchor||D.tag||A)if(A?.type==="block-seq")H(D.end,"BAD_INDENT","All sequence items must start at the same column");else H(J,"MISSING_CHAR","Sequence item without - indicator");else{if(V=D.end,D.comment)Q.comment=D.comment;continue}let L=A?q(U,A,D,H):B(U,D.end,M,null,D,H);if(U.schema.compat)W.flowIndentCheck(G.indent,A,H);J=L.range[2],Q.items.push(L)}return Q.range=[G.offset,J,V??J],Q}Z.resolveBlockSeq=Y}),j8=w((Z)=>{function X(z,W,Y,q){let B="";if(z){let U=!1,G="";for(let H of z){let{source:_,type:$}=H;switch($){case"space":U=!0;break;case"comment":{if(Y&&!U)q(H,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let Q=_.substring(1)||" ";if(!B)B=Q;else B+=G+Q;G="";break}case"newline":if(B)G+=_;U=!0;break;default:q(H,"UNEXPECTED_TOKEN",\`Unexpected \${$} at node end\`)}W+=_.length}}return{comment:B,offset:W}}Z.resolveEnd=X}),n9=w((Z)=>{var X=u(),z=gZ(),W=hZ(),Y=vZ(),q=j8(),B=H6(),U=Z5(),G=U7(),H="Block collections are not allowed within flow collections",_=(Q)=>Q&&(Q.type==="block-map"||Q.type==="block-seq");function $({composeNode:Q,composeEmptyNode:J},V,M,A,D){let L=M.start.source==="{",F=L?"flow map":"flow sequence",N=new(D?.nodeClass??(L?W.YAMLMap:Y.YAMLSeq))(V.schema);N.flow=!0;let K=V.atRoot;if(K)V.atRoot=!1;if(V.atKey)V.atKey=!1;let E=M.offset+M.start.source.length;for(let f=0;f<M.items.length;++f){let l=M.items[f],{start:U0,key:Q0,sep:l0,value:G0}=l,x=B.resolveProps(U0,{flow:F,indicator:"explicit-key-ind",next:Q0??l0?.[0],offset:E,onError:A,parentIndent:M.indent,startOnNewline:!1});if(!x.found){if(!x.anchor&&!x.tag&&!l0&&!G0){if(f===0&&x.comma)A(x.comma,"UNEXPECTED_TOKEN",\`Unexpected , in \${F}\`);else if(f<M.items.length-1)A(x.start,"UNEXPECTED_TOKEN",\`Unexpected empty item in \${F}\`);if(x.comment)if(N.comment)N.comment+=\`
22168
+ \`+x.comment;else N.comment=x.comment;E=x.end;continue}if(!L&&V.options.strict&&U.containsNewline(Q0))A(Q0,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(f===0){if(x.comma)A(x.comma,"UNEXPECTED_TOKEN",\`Unexpected , in \${F}\`)}else{if(!x.comma)A(x.start,"MISSING_CHAR",\`Missing , between \${F} items\`);if(x.comment){let K0="";Z:for(let X0 of U0)switch(X0.type){case"comma":case"space":break;case"comment":K0=X0.source.substring(1);break Z;default:break Z}if(K0){let X0=N.items[N.items.length-1];if(X.isPair(X0))X0=X0.value??X0.key;if(X0.comment)X0.comment+=\`
22169
+ \`+K0;else X0.comment=K0;x.comment=x.comment.substring(K0.length+1)}}}if(!L&&!l0&&!x.found){let K0=G0?Q(V,G0,x,A):J(V,x.end,l0,null,x,A);if(N.items.push(K0),E=K0.range[2],_(G0))A(K0.range,"BLOCK_IN_FLOW",H)}else{V.atKey=!0;let K0=x.end,X0=Q0?Q(V,Q0,x,A):J(V,K0,U0,null,x,A);if(_(Q0))A(X0.range,"BLOCK_IN_FLOW",H);V.atKey=!1;let j0=B.resolveProps(l0??[],{flow:F,indicator:"map-value-ind",next:G0,offset:X0.range[2],onError:A,parentIndent:M.indent,startOnNewline:!1});if(j0.found){if(!L&&!x.found&&V.options.strict){if(l0)for(let n0 of l0){if(n0===j0.found)break;if(n0.type==="newline"){A(n0,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(x.start<j0.found.offset-1024)A(j0.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(G0)if("source"in G0&&G0.source?.[0]===":")A(G0,"MISSING_CHAR",\`Missing space after : in \${F}\`);else A(j0.start,"MISSING_CHAR",\`Missing , or : between \${F} items\`);let oZ=G0?Q(V,G0,j0,A):j0.found?J(V,j0.end,l0,null,j0,A):null;if(oZ){if(_(G0))A(oZ.range,"BLOCK_IN_FLOW",H)}else if(j0.comment)if(X0.comment)X0.comment+=\`
22170
+ \`+j0.comment;else X0.comment=j0.comment;let y6=new z.Pair(X0,oZ);if(V.options.keepSourceTokens)y6.srcToken=l;if(L){let n0=N;if(G.mapIncludes(V,n0.items,X0))A(K0,"DUPLICATE_KEY","Map keys must be unique");n0.items.push(y6)}else{let n0=new W.YAMLMap(V.schema);n0.flow=!0,n0.items.push(y6);let v5=(oZ??X0).range;n0.range=[X0.range[0],v5[1],v5[2]],N.items.push(n0)}E=oZ?oZ.range[2]:j0.end}}let T=L?"}":"]",[P,...C]=M.end,k=E;if(P?.source===T)k=P.offset+P.source.length;else{let f=F[0].toUpperCase()+F.substring(1),l=K?\`\${f} must end with a \${T}\`:\`\${f} in block collection must be sufficiently indented and end with a \${T}\`;if(A(E,K?"MISSING_CHAR":"BAD_INDENT",l),P&&P.source.length!==1)C.unshift(P)}if(C.length>0){let f=q.resolveEnd(C,k,V.options.strict,A);if(f.comment)if(N.comment)N.comment+=\`
22171
+ \`+f.comment;else N.comment=f.comment;N.range=[M.offset,k,f.offset]}else N.range=[M.offset,k,k];return N}Z.resolveFlowCollection=$}),i9=w((Z)=>{var X=u(),z=q0(),W=hZ(),Y=vZ(),q=p9(),B=l9(),U=n9();function G(_,$,Q,J,V,M){let A=Q.type==="block-map"?q.resolveBlockMap(_,$,Q,J,M):Q.type==="block-seq"?B.resolveBlockSeq(_,$,Q,J,M):U.resolveFlowCollection(_,$,Q,J,M),D=A.constructor;if(V==="!"||V===D.tagName)return A.tag=D.tagName,A;if(V)A.tag=V;return A}function H(_,$,Q,J,V){let M=J.tag,A=!M?null:$.directives.tagName(M.source,(K)=>V(M,"TAG_RESOLVE_FAILED",K));if(Q.type==="block-seq"){let{anchor:K,newlineAfterProp:E}=J,T=K&&M?K.offset>M.offset?K:M:K??M;if(T&&(!E||E.offset<T.offset))V(T,"MISSING_CHAR","Missing newline after block sequence props")}let D=Q.type==="block-map"?"map":Q.type==="block-seq"?"seq":Q.start.source==="{"?"map":"seq";if(!M||!A||A==="!"||A===W.YAMLMap.tagName&&D==="map"||A===Y.YAMLSeq.tagName&&D==="seq")return G(_,$,Q,V,A);let L=$.schema.tags.find((K)=>K.tag===A&&K.collection===D);if(!L){let K=$.schema.knownTags[A];if(K?.collection===D)$.schema.tags.push(Object.assign({},K,{default:!1})),L=K;else{if(K)V(M,"BAD_COLLECTION_TYPE",\`\${K.tag} used for \${D} collection, but expects \${K.collection??"scalar"}\`,!0);else V(M,"TAG_RESOLVE_FAILED",\`Unresolved tag: \${A}\`,!0);return G(_,$,Q,V,A)}}let F=G(_,$,Q,V,A,L),j=L.resolve?.(F,(K)=>V(M,"TAG_RESOLVE_FAILED",K),$.options)??F,N=X.isNode(j)?j:new z.Scalar(j);if(N.range=F.range,N.tag=A,L?.format)N.format=L.format;return N}Z.composeCollection=H}),G7=w((Z)=>{var X=q0();function z(q,B,U){let G=B.offset,H=W(B,q.options.strict,U);if(!H)return{value:"",type:null,comment:"",range:[G,G,G]};let _=H.mode===">"?X.Scalar.BLOCK_FOLDED:X.Scalar.BLOCK_LITERAL,$=B.source?Y(B.source):[],Q=$.length;for(let j=$.length-1;j>=0;--j){let N=$[j][1];if(N===""||N==="\\r")Q=j;else break}if(Q===0){let j=H.chomp==="+"&&$.length>0?\`
22172
+ \`.repeat(Math.max(1,$.length-1)):"",N=G+H.length;if(B.source)N+=B.source.length;return{value:j,type:_,comment:H.comment,range:[G,N,N]}}let J=B.indent+H.indent,V=B.offset+H.length,M=0;for(let j=0;j<Q;++j){let[N,K]=$[j];if(K===""||K==="\\r"){if(H.indent===0&&N.length>J)J=N.length}else{if(N.length<J)U(V+N.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(H.indent===0)J=N.length;if(M=j,J===0&&!q.atRoot)U(V,"BAD_INDENT","Block scalar values in collections must be indented");break}V+=N.length+K.length+1}for(let j=$.length-1;j>=Q;--j)if($[j][0].length>J)Q=j+1;let A="",D="",L=!1;for(let j=0;j<M;++j)A+=$[j][0].slice(J)+\`
22173
+ \`;for(let j=M;j<Q;++j){let[N,K]=$[j];V+=N.length+K.length+1;let E=K[K.length-1]==="\\r";if(E)K=K.slice(0,-1);if(K&&N.length<J){let P=\`Block scalar lines must not be less indented than their \${H.indent?"explicit indentation indicator":"first line"}\`;U(V-K.length-(E?2:1),"BAD_INDENT",P),N=""}if(_===X.Scalar.BLOCK_LITERAL)A+=D+N.slice(J)+K,D=\`
22174
+ \`;else if(N.length>J||K[0]==="\\t"){if(D===" ")D=\`
22175
+ \`;else if(!L&&D===\`
22176
+ \`)D=\`
22177
+
22178
+ \`;A+=D+N.slice(J)+K,D=\`
22179
+ \`,L=!0}else if(K==="")if(D===\`
22180
22180
  \`)A+=\`
22181
- \`;else L=\`
22182
- \`;else A+=L+K,L=" ",D=!1}switch(H.chomp){case"-":break;case"+":for(let j=Q;j<$.length;++j)A+=\`
22181
+ \`;else D=\`
22182
+ \`;else A+=D+K,D=" ",L=!1}switch(H.chomp){case"-":break;case"+":for(let j=Q;j<$.length;++j)A+=\`
22183
22183
  \`+$[j][0].slice(J);if(A[A.length-1]!==\`
22184
22184
  \`)A+=\`
22185
22185
  \`;break;default:A+=\`
22186
- \`}let F=G+H.length+B.source.length;return{value:A,type:_,comment:H.comment,range:[G,F,F]}}function W({offset:q,props:B},U,G){if(B[0].type!=="block-scalar-header")return G(B[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:H}=B[0],_=H[0],$=0,Q="",J=-1;for(let L=1;L<H.length;++L){let D=H[L];if(!Q&&(D==="-"||D==="+"))Q=D;else{let F=Number(D);if(!$&&F)$=F;else if(J===-1)J=q+L}}if(J!==-1)G(J,"UNEXPECTED_TOKEN",\`Block scalar header includes extra characters: \${H}\`);let V=!1,M="",A=H.length;for(let L=1;L<B.length;++L){let D=B[L];switch(D.type){case"space":V=!0;case"newline":A+=D.source.length;break;case"comment":if(U&&!V)G(D,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");A+=D.source.length,M=D.source.substring(1);break;case"error":G(D,"UNEXPECTED_TOKEN",D.message),A+=D.source.length;break;default:{let F=\`Unexpected token in block scalar header: \${D.type}\`;G(D,"UNEXPECTED_TOKEN",F);let j=D.source;if(j&&typeof j==="string")A+=j.length}}}return{mode:_,indent:$,chomp:Q,comment:M,length:A}}function Y(q){let B=q.split(/\\n( *)/),U=B[0],G=U.match(/^( *)/),_=[G?.[1]?[G[1],U.slice(G[1].length)]:["",U]];for(let $=1;$<B.length;$+=2)_.push([B[$],B[$+1]]);return _}Z.resolveBlockScalar=z}),q7=w((Z)=>{var X=q0(),z=j8();function W($,Q,J){let{offset:V,type:M,source:A,end:L}=$,D,F,j=(E,T,P)=>J(V+E,T,P);switch(M){case"scalar":D=X.Scalar.PLAIN,F=Y(A,j);break;case"single-quoted-scalar":D=X.Scalar.QUOTE_SINGLE,F=q(A,j);break;case"double-quoted-scalar":D=X.Scalar.QUOTE_DOUBLE,F=U(A,j);break;default:return J($,"UNEXPECTED_TOKEN",\`Expected a flow scalar value, but found: \${M}\`),{value:"",type:null,comment:"",range:[V,V+A.length,V+A.length]}}let N=V+A.length,K=z.resolveEnd(L,N,Q,J);return{value:F,type:D,comment:K.comment,range:[V,N,K.offset]}}function Y($,Q){let J="";switch($[0]){case"\\t":J="a tab character";break;case",":J="flow indicator character ,";break;case"%":J="directive indicator character %";break;case"|":case">":{J=\`block scalar indicator \${$[0]}\`;break}case"@":case"\`":{J=\`reserved character \${$[0]}\`;break}}if(J)Q(0,"BAD_SCALAR_START",\`Plain value cannot start with \${J}\`);return B($)}function q($,Q){if($[$.length-1]!=="'"||$.length===1)Q($.length,"MISSING_CHAR","Missing closing 'quote");return B($.slice(1,-1)).replace(/''/g,"'")}function B($){let Q,J;try{Q=new RegExp(\`(.*?)(?<![ ])[ ]*\\r?
22186
+ \`}let F=G+H.length+B.source.length;return{value:A,type:_,comment:H.comment,range:[G,F,F]}}function W({offset:q,props:B},U,G){if(B[0].type!=="block-scalar-header")return G(B[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:H}=B[0],_=H[0],$=0,Q="",J=-1;for(let D=1;D<H.length;++D){let L=H[D];if(!Q&&(L==="-"||L==="+"))Q=L;else{let F=Number(L);if(!$&&F)$=F;else if(J===-1)J=q+D}}if(J!==-1)G(J,"UNEXPECTED_TOKEN",\`Block scalar header includes extra characters: \${H}\`);let V=!1,M="",A=H.length;for(let D=1;D<B.length;++D){let L=B[D];switch(L.type){case"space":V=!0;case"newline":A+=L.source.length;break;case"comment":if(U&&!V)G(L,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");A+=L.source.length,M=L.source.substring(1);break;case"error":G(L,"UNEXPECTED_TOKEN",L.message),A+=L.source.length;break;default:{let F=\`Unexpected token in block scalar header: \${L.type}\`;G(L,"UNEXPECTED_TOKEN",F);let j=L.source;if(j&&typeof j==="string")A+=j.length}}}return{mode:_,indent:$,chomp:Q,comment:M,length:A}}function Y(q){let B=q.split(/\\n( *)/),U=B[0],G=U.match(/^( *)/),_=[G?.[1]?[G[1],U.slice(G[1].length)]:["",U]];for(let $=1;$<B.length;$+=2)_.push([B[$],B[$+1]]);return _}Z.resolveBlockScalar=z}),q7=w((Z)=>{var X=q0(),z=j8();function W($,Q,J){let{offset:V,type:M,source:A,end:D}=$,L,F,j=(E,T,P)=>J(V+E,T,P);switch(M){case"scalar":L=X.Scalar.PLAIN,F=Y(A,j);break;case"single-quoted-scalar":L=X.Scalar.QUOTE_SINGLE,F=q(A,j);break;case"double-quoted-scalar":L=X.Scalar.QUOTE_DOUBLE,F=U(A,j);break;default:return J($,"UNEXPECTED_TOKEN",\`Expected a flow scalar value, but found: \${M}\`),{value:"",type:null,comment:"",range:[V,V+A.length,V+A.length]}}let N=V+A.length,K=z.resolveEnd(D,N,Q,J);return{value:F,type:L,comment:K.comment,range:[V,N,K.offset]}}function Y($,Q){let J="";switch($[0]){case"\\t":J="a tab character";break;case",":J="flow indicator character ,";break;case"%":J="directive indicator character %";break;case"|":case">":{J=\`block scalar indicator \${$[0]}\`;break}case"@":case"\`":{J=\`reserved character \${$[0]}\`;break}}if(J)Q(0,"BAD_SCALAR_START",\`Plain value cannot start with \${J}\`);return B($)}function q($,Q){if($[$.length-1]!=="'"||$.length===1)Q($.length,"MISSING_CHAR","Missing closing 'quote");return B($.slice(1,-1)).replace(/''/g,"'")}function B($){let Q,J;try{Q=new RegExp(\`(.*?)(?<![ ])[ ]*\\r?
22187
22187
  \`,"sy"),J=new RegExp(\`[ ]*(.*?)(?:(?<![ ])[ ]*)?\\r?
22188
- \`,"sy")}catch{Q=/(.*?)[ \\t]*\\r?\\n/sy,J=/[ \\t]*(.*?)[ \\t]*\\r?\\n/sy}let V=Q.exec($);if(!V)return $;let M=V[1],A=" ",L=Q.lastIndex;J.lastIndex=L;while(V=J.exec($)){if(V[1]==="")if(A===\`
22188
+ \`,"sy")}catch{Q=/(.*?)[ \\t]*\\r?\\n/sy,J=/[ \\t]*(.*?)[ \\t]*\\r?\\n/sy}let V=Q.exec($);if(!V)return $;let M=V[1],A=" ",D=Q.lastIndex;J.lastIndex=D;while(V=J.exec($)){if(V[1]==="")if(A===\`
22189
22189
  \`)M+=A;else A=\`
22190
- \`;else M+=A+V[1],A=" ";L=J.lastIndex}let D=/[ \\t]*(.*)/sy;return D.lastIndex=L,V=D.exec($),M+A+(V?.[1]??"")}function U($,Q){let J="";for(let V=1;V<$.length-1;++V){let M=$[V];if(M==="\\r"&&$[V+1]===\`
22190
+ \`;else M+=A+V[1],A=" ";D=J.lastIndex}let L=/[ \\t]*(.*)/sy;return L.lastIndex=D,V=L.exec($),M+A+(V?.[1]??"")}function U($,Q){let J="";for(let V=1;V<$.length-1;++V){let M=$[V];if(M==="\\r"&&$[V+1]===\`
22191
22191
  \`)continue;if(M===\`
22192
- \`){let{fold:A,offset:L}=G($,V);J+=A,V=L}else if(M==="\\\\"){let A=$[++V],L=H[A];if(L)J+=L;else if(A===\`
22192
+ \`){let{fold:A,offset:D}=G($,V);J+=A,V=D}else if(M==="\\\\"){let A=$[++V],D=H[A];if(D)J+=D;else if(A===\`
22193
22193
  \`){A=$[V+1];while(A===" "||A==="\\t")A=$[++V+1]}else if(A==="\\r"&&$[V+1]===\`
22194
- \`){A=$[++V+1];while(A===" "||A==="\\t")A=$[++V+1]}else if(A==="x"||A==="u"||A==="U"){let D={x:2,u:4,U:8}[A];J+=_($,V+1,D,Q),V+=D}else{let D=$.substr(V-1,2);Q(V-1,"BAD_DQ_ESCAPE",\`Invalid escape sequence \${D}\`),J+=D}}else if(M===" "||M==="\\t"){let A=V,L=$[V+1];while(L===" "||L==="\\t")L=$[++V+1];if(L!==\`
22195
- \`&&!(L==="\\r"&&$[V+2]===\`
22194
+ \`){A=$[++V+1];while(A===" "||A==="\\t")A=$[++V+1]}else if(A==="x"||A==="u"||A==="U"){let L={x:2,u:4,U:8}[A];J+=_($,V+1,L,Q),V+=L}else{let L=$.substr(V-1,2);Q(V-1,"BAD_DQ_ESCAPE",\`Invalid escape sequence \${L}\`),J+=L}}else if(M===" "||M==="\\t"){let A=V,D=$[V+1];while(D===" "||D==="\\t")D=$[++V+1];if(D!==\`
22195
+ \`&&!(D==="\\r"&&$[V+2]===\`
22196
22196
  \`))J+=V>A?$.slice(A,V+1):M}else J+=M}if($[$.length-1]!=='"'||$.length===1)Q($.length,"MISSING_CHAR",'Missing closing "quote');return J}function G($,Q){let J="",V=$[Q+1];while(V===" "||V==="\\t"||V===\`
22197
22197
  \`||V==="\\r"){if(V==="\\r"&&$[Q+2]!==\`
22198
22198
  \`)break;if(V===\`
22199
22199
  \`)J+=\`
22200
22200
  \`;Q+=1,V=$[Q+1]}if(!J)J=" ";return{fold:J,offset:Q}}var H={"0":"\\x00",a:"\\x07",b:"\\b",e:"\\x1B",f:"\\f",n:\`
22201
- \`,r:"\\r",t:"\\t",v:"\\v",N:"…",_:" ",L:"\\u2028",P:"\\u2029"," ":" ",'"':'"',"/":"/","\\\\":"\\\\","\\t":"\\t"};function _($,Q,J,V){let M=$.substr(Q,J),L=M.length===J&&/^[0-9a-fA-F]+$/.test(M)?parseInt(M,16):NaN;if(isNaN(L)){let D=$.substr(Q-2,J+2);return V(Q-2,"BAD_DQ_ESCAPE",\`Invalid escape sequence \${D}\`),D}return String.fromCodePoint(L)}Z.resolveFlowScalar=W}),o9=w((Z)=>{var X=u(),z=q0(),W=G7(),Y=q7();function q(G,H,_,$){let{value:Q,type:J,comment:V,range:M}=H.type==="block-scalar"?W.resolveBlockScalar(G,H,$):Y.resolveFlowScalar(H,G.options.strict,$),A=_?G.directives.tagName(_.source,(F)=>$(_,"TAG_RESOLVE_FAILED",F)):null,L;if(G.options.stringKeys&&G.atKey)L=G.schema[X.SCALAR];else if(A)L=B(G.schema,Q,A,_,$);else if(H.type==="scalar")L=U(G,Q,H,$);else L=G.schema[X.SCALAR];let D;try{let F=L.resolve(Q,(j)=>$(_??H,"TAG_RESOLVE_FAILED",j),G.options);D=X.isScalar(F)?F:new z.Scalar(F)}catch(F){let j=F instanceof Error?F.message:String(F);$(_??H,"TAG_RESOLVE_FAILED",j),D=new z.Scalar(Q)}if(D.range=M,D.source=Q,J)D.type=J;if(A)D.tag=A;if(L.format)D.format=L.format;if(V)D.comment=V;return D}function B(G,H,_,$,Q){if(_==="!")return G[X.SCALAR];let J=[];for(let M of G.tags)if(!M.collection&&M.tag===_)if(M.default&&M.test)J.push(M);else return M;for(let M of J)if(M.test?.test(H))return M;let V=G.knownTags[_];if(V&&!V.collection)return G.tags.push(Object.assign({},V,{default:!1,test:void 0})),V;return Q($,"TAG_RESOLVE_FAILED",\`Unresolved tag: \${_}\`,_!=="tag:yaml.org,2002:str"),G[X.SCALAR]}function U({atKey:G,directives:H,schema:_},$,Q,J){let V=_.tags.find((M)=>(M.default===!0||G&&M.default==="key")&&M.test?.test($))||_[X.SCALAR];if(_.compat){let M=_.compat.find((A)=>A.default&&A.test?.test($))??_[X.SCALAR];if(V.tag!==M.tag){let A=H.tagString(V.tag),L=H.tagString(M.tag),D=\`Value may be parsed as either \${A} or \${L}\`;J(Q,"TAG_RESOLVE_FAILED",D,!0)}}return V}Z.composeScalar=q}),s9=w((Z)=>{function X(z,W,Y){if(W){Y??(Y=W.length);for(let q=Y-1;q>=0;--q){let B=W[q];switch(B.type){case"space":case"comment":case"newline":z-=B.source.length;continue}B=W[++q];while(B?.type==="space")z+=B.source.length,B=W[++q];break}}return z}Z.emptyScalarPosition=X}),a9=w((Z)=>{var X=t8(),z=u(),W=i9(),Y=o9(),q=j8(),B=s9(),U={composeNode:G,composeEmptyNode:H};function G($,Q,J,V){let M=$.atKey,{spaceBefore:A,comment:L,anchor:D,tag:F}=J,j,N=!0;switch(Q.type){case"alias":if(j=_($,Q,V),D||F)V(Q,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":if(j=Y.composeScalar($,Q,F,V),D)j.anchor=D.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":try{if(j=W.composeCollection(U,$,Q,J,V),D)j.anchor=D.source.substring(1)}catch(K){let E=K instanceof Error?K.message:String(K);V(Q,"RESOURCE_EXHAUSTION",E)}break;default:{let K=Q.type==="error"?Q.message:\`Unsupported token (type: \${Q.type})\`;V(Q,"UNEXPECTED_TOKEN",K),N=!1}}if(j??(j=H($,Q.offset,void 0,null,J,V)),D&&j.anchor==="")V(D,"BAD_ALIAS","Anchor cannot be an empty string");if(M&&$.options.stringKeys&&(!z.isScalar(j)||typeof j.value!=="string"||j.tag&&j.tag!=="tag:yaml.org,2002:str"))V(F??Q,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(A)j.spaceBefore=!0;if(L)if(Q.type==="scalar"&&Q.source==="")j.comment=L;else j.commentBefore=L;if($.options.keepSourceTokens&&N)j.srcToken=Q;return j}function H($,Q,J,V,{spaceBefore:M,comment:A,anchor:L,tag:D,end:F},j){let N={type:"scalar",offset:B.emptyScalarPosition(Q,J,V),indent:-1,source:""},K=Y.composeScalar($,N,D,j);if(L){if(K.anchor=L.source.substring(1),K.anchor==="")j(L,"BAD_ALIAS","Anchor cannot be an empty string")}if(M)K.spaceBefore=!0;if(A)K.comment=A,K.range[2]=F;return K}function _({options:$},{offset:Q,source:J,end:V},M){let A=new X.Alias(J.substring(1));if(A.source==="")M(Q,"BAD_ALIAS","Alias cannot be an empty string");if(A.source.endsWith(":"))M(Q+J.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let L=Q+J.length,D=q.resolveEnd(V,L,$.strict,M);if(A.range=[Q,L,D.offset],D.comment)A.comment=D.comment;return A}Z.composeEmptyNode=H,Z.composeNode=G}),r9=w((Z)=>{var X=Q6(),z=a9(),W=j8(),Y=H6();function q(B,U,{offset:G,start:H,value:_,end:$},Q){let J=Object.assign({_directives:U},B),V=new X.Document(void 0,J),M={atKey:!1,atRoot:!0,directives:V.directives,options:V.options,schema:V.schema},A=Y.resolveProps(H,{indicator:"doc-start",next:_??$?.[0],offset:G,onError:Q,parentIndent:0,startOnNewline:!0});if(A.found){if(V.directives.docStart=!0,_&&(_.type==="block-map"||_.type==="block-seq")&&!A.hasNewline)Q(A.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}V.contents=_?z.composeNode(M,_,A,Q):z.composeEmptyNode(M,A.end,H,null,A,Q);let L=V.contents.range[2],D=W.resolveEnd($,L,!1,Q);if(D.comment)V.comment=D.comment;return V.range=[G,L,D.offset],V}Z.composeDoc=q}),M7=w((Z)=>{var X=a8("process"),z=t5(),W=Q6(),Y=W6(),q=u(),B=r9(),U=j8();function G($){if(typeof $==="number")return[$,$+1];if(Array.isArray($))return $.length===2?$:[$[0],$[1]];let{offset:Q,source:J}=$;return[Q,Q+(typeof J==="string"?J.length:1)]}function H($){let Q="",J=!1,V=!1;for(let M=0;M<$.length;++M){let A=$[M];switch(A[0]){case"#":Q+=(Q===""?"":V?\`
22201
+ \`,r:"\\r",t:"\\t",v:"\\v",N:"…",_:" ",L:"\\u2028",P:"\\u2029"," ":" ",'"':'"',"/":"/","\\\\":"\\\\","\\t":"\\t"};function _($,Q,J,V){let M=$.substr(Q,J),D=M.length===J&&/^[0-9a-fA-F]+$/.test(M)?parseInt(M,16):NaN;if(isNaN(D)){let L=$.substr(Q-2,J+2);return V(Q-2,"BAD_DQ_ESCAPE",\`Invalid escape sequence \${L}\`),L}return String.fromCodePoint(D)}Z.resolveFlowScalar=W}),o9=w((Z)=>{var X=u(),z=q0(),W=G7(),Y=q7();function q(G,H,_,$){let{value:Q,type:J,comment:V,range:M}=H.type==="block-scalar"?W.resolveBlockScalar(G,H,$):Y.resolveFlowScalar(H,G.options.strict,$),A=_?G.directives.tagName(_.source,(F)=>$(_,"TAG_RESOLVE_FAILED",F)):null,D;if(G.options.stringKeys&&G.atKey)D=G.schema[X.SCALAR];else if(A)D=B(G.schema,Q,A,_,$);else if(H.type==="scalar")D=U(G,Q,H,$);else D=G.schema[X.SCALAR];let L;try{let F=D.resolve(Q,(j)=>$(_??H,"TAG_RESOLVE_FAILED",j),G.options);L=X.isScalar(F)?F:new z.Scalar(F)}catch(F){let j=F instanceof Error?F.message:String(F);$(_??H,"TAG_RESOLVE_FAILED",j),L=new z.Scalar(Q)}if(L.range=M,L.source=Q,J)L.type=J;if(A)L.tag=A;if(D.format)L.format=D.format;if(V)L.comment=V;return L}function B(G,H,_,$,Q){if(_==="!")return G[X.SCALAR];let J=[];for(let M of G.tags)if(!M.collection&&M.tag===_)if(M.default&&M.test)J.push(M);else return M;for(let M of J)if(M.test?.test(H))return M;let V=G.knownTags[_];if(V&&!V.collection)return G.tags.push(Object.assign({},V,{default:!1,test:void 0})),V;return Q($,"TAG_RESOLVE_FAILED",\`Unresolved tag: \${_}\`,_!=="tag:yaml.org,2002:str"),G[X.SCALAR]}function U({atKey:G,directives:H,schema:_},$,Q,J){let V=_.tags.find((M)=>(M.default===!0||G&&M.default==="key")&&M.test?.test($))||_[X.SCALAR];if(_.compat){let M=_.compat.find((A)=>A.default&&A.test?.test($))??_[X.SCALAR];if(V.tag!==M.tag){let A=H.tagString(V.tag),D=H.tagString(M.tag),L=\`Value may be parsed as either \${A} or \${D}\`;J(Q,"TAG_RESOLVE_FAILED",L,!0)}}return V}Z.composeScalar=q}),s9=w((Z)=>{function X(z,W,Y){if(W){Y??(Y=W.length);for(let q=Y-1;q>=0;--q){let B=W[q];switch(B.type){case"space":case"comment":case"newline":z-=B.source.length;continue}B=W[++q];while(B?.type==="space")z+=B.source.length,B=W[++q];break}}return z}Z.emptyScalarPosition=X}),a9=w((Z)=>{var X=t8(),z=u(),W=i9(),Y=o9(),q=j8(),B=s9(),U={composeNode:G,composeEmptyNode:H};function G($,Q,J,V){let M=$.atKey,{spaceBefore:A,comment:D,anchor:L,tag:F}=J,j,N=!0;switch(Q.type){case"alias":if(j=_($,Q,V),L||F)V(Q,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":if(j=Y.composeScalar($,Q,F,V),L)j.anchor=L.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":try{if(j=W.composeCollection(U,$,Q,J,V),L)j.anchor=L.source.substring(1)}catch(K){let E=K instanceof Error?K.message:String(K);V(Q,"RESOURCE_EXHAUSTION",E)}break;default:{let K=Q.type==="error"?Q.message:\`Unsupported token (type: \${Q.type})\`;V(Q,"UNEXPECTED_TOKEN",K),N=!1}}if(j??(j=H($,Q.offset,void 0,null,J,V)),L&&j.anchor==="")V(L,"BAD_ALIAS","Anchor cannot be an empty string");if(M&&$.options.stringKeys&&(!z.isScalar(j)||typeof j.value!=="string"||j.tag&&j.tag!=="tag:yaml.org,2002:str"))V(F??Q,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(A)j.spaceBefore=!0;if(D)if(Q.type==="scalar"&&Q.source==="")j.comment=D;else j.commentBefore=D;if($.options.keepSourceTokens&&N)j.srcToken=Q;return j}function H($,Q,J,V,{spaceBefore:M,comment:A,anchor:D,tag:L,end:F},j){let N={type:"scalar",offset:B.emptyScalarPosition(Q,J,V),indent:-1,source:""},K=Y.composeScalar($,N,L,j);if(D){if(K.anchor=D.source.substring(1),K.anchor==="")j(D,"BAD_ALIAS","Anchor cannot be an empty string")}if(M)K.spaceBefore=!0;if(A)K.comment=A,K.range[2]=F;return K}function _({options:$},{offset:Q,source:J,end:V},M){let A=new X.Alias(J.substring(1));if(A.source==="")M(Q,"BAD_ALIAS","Alias cannot be an empty string");if(A.source.endsWith(":"))M(Q+J.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let D=Q+J.length,L=q.resolveEnd(V,D,$.strict,M);if(A.range=[Q,D,L.offset],L.comment)A.comment=L.comment;return A}Z.composeEmptyNode=H,Z.composeNode=G}),r9=w((Z)=>{var X=Q6(),z=a9(),W=j8(),Y=H6();function q(B,U,{offset:G,start:H,value:_,end:$},Q){let J=Object.assign({_directives:U},B),V=new X.Document(void 0,J),M={atKey:!1,atRoot:!0,directives:V.directives,options:V.options,schema:V.schema},A=Y.resolveProps(H,{indicator:"doc-start",next:_??$?.[0],offset:G,onError:Q,parentIndent:0,startOnNewline:!0});if(A.found){if(V.directives.docStart=!0,_&&(_.type==="block-map"||_.type==="block-seq")&&!A.hasNewline)Q(A.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}V.contents=_?z.composeNode(M,_,A,Q):z.composeEmptyNode(M,A.end,H,null,A,Q);let D=V.contents.range[2],L=W.resolveEnd($,D,!1,Q);if(L.comment)V.comment=L.comment;return V.range=[G,D,L.offset],V}Z.composeDoc=q}),M7=w((Z)=>{var X=a8("process"),z=t5(),W=Q6(),Y=W6(),q=u(),B=r9(),U=j8();function G($){if(typeof $==="number")return[$,$+1];if(Array.isArray($))return $.length===2?$:[$[0],$[1]];let{offset:Q,source:J}=$;return[Q,Q+(typeof J==="string"?J.length:1)]}function H($){let Q="",J=!1,V=!1;for(let M=0;M<$.length;++M){let A=$[M];switch(A[0]){case"#":Q+=(Q===""?"":V?\`
22202
22202
 
22203
22203
  \`:\`
22204
22204
  \`)+(A.substring(1)||" "),J=!0,V=!1;break;case"%":if($[M+1]?.[0]!=="#")M+=1;J=!1;break;default:if(!J)V=!0;J=!1}}return{comment:Q,afterEmptyLine:V}}class _{constructor($={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(Q,J,V,M)=>{let A=G(Q);if(M)this.warnings.push(new Y.YAMLWarning(A,J,V));else this.errors.push(new Y.YAMLParseError(A,J,V))},this.directives=new z.Directives({version:$.version||"1.2"}),this.options=$}decorate($,Q){let{comment:J,afterEmptyLine:V}=H(this.prelude);if(J){let M=$.contents;if(Q)$.comment=$.comment?\`\${$.comment}
22205
- \${J}\`:J;else if(V||$.directives.docStart||!M)$.commentBefore=J;else if(q.isCollection(M)&&!M.flow&&M.items.length>0){let A=M.items[0];if(q.isPair(A))A=A.key;let L=A.commentBefore;A.commentBefore=L?\`\${J}
22206
- \${L}\`:J}else{let A=M.commentBefore;M.commentBefore=A?\`\${J}
22205
+ \${J}\`:J;else if(V||$.directives.docStart||!M)$.commentBefore=J;else if(q.isCollection(M)&&!M.flow&&M.items.length>0){let A=M.items[0];if(q.isPair(A))A=A.key;let D=A.commentBefore;A.commentBefore=D?\`\${J}
22206
+ \${D}\`:J}else{let A=M.commentBefore;M.commentBefore=A?\`\${J}
22207
22207
  \${A}\`:J}}if(Q)Array.prototype.push.apply($.errors,this.errors),Array.prototype.push.apply($.warnings,this.warnings);else $.errors=this.errors,$.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:H(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose($,Q=!1,J=-1){for(let V of $)yield*this.next(V);yield*this.end(Q,J)}*next($){if(X.env.LOG_STREAM)console.dir($,{depth:null});switch($.type){case"directive":this.directives.add($.source,(Q,J,V)=>{let M=G($);M[0]+=Q,this.onError(M,"BAD_DIRECTIVE",J,V)}),this.prelude.push($.source),this.atDirectives=!0;break;case"document":{let Q=B.composeDoc(this.options,this.directives,$,this.onError);if(this.atDirectives&&!Q.directives.docStart)this.onError($,"MISSING_CHAR","Missing directives-end/doc-start indicator line");if(this.decorate(Q,!1),this.doc)yield this.doc;this.doc=Q,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push($.source);break;case"error":{let Q=$.source?\`\${$.message}: \${JSON.stringify($.source)}\`:$.message,J=new Y.YAMLParseError(G($),"UNEXPECTED_TOKEN",Q);if(this.atDirectives||!this.doc)this.errors.push(J);else this.doc.errors.push(J);break}case"doc-end":{if(!this.doc){this.errors.push(new Y.YAMLParseError(G($),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let Q=U.resolveEnd($.end,$.offset+$.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),Q.comment){let J=this.doc.comment;this.doc.comment=J?\`\${J}
22208
- \${Q.comment}\`:Q.comment}this.doc.range[2]=Q.offset;break}default:this.errors.push(new Y.YAMLParseError(G($),"UNEXPECTED_TOKEN",\`Unsupported token \${$.type}\`))}}*end($=!1,Q=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if($){let J=Object.assign({_directives:this.directives},this.options),V=new W.Document(void 0,J);if(this.atDirectives)this.onError(Q,"MISSING_CHAR","Missing directives-end indicator line");V.range=[0,Q,Q],this.decorate(V,!1),yield V}}}Z.Composer=_}),t9=w((Z)=>{var X=G7(),z=q7(),W=W6(),Y=X6();function q($,Q=!0,J){if($){let V=(M,A,L)=>{let D=typeof M==="number"?M:Array.isArray(M)?M[0]:M.offset;if(J)J(D,A,L);else throw new W.YAMLParseError([D,D+1],A,L)};switch($.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return z.resolveFlowScalar($,Q,V);case"block-scalar":return X.resolveBlockScalar({options:{strict:Q}},$,V)}}return null}function B($,Q){let{implicitKey:J=!1,indent:V,inFlow:M=!1,offset:A=-1,type:L="PLAIN"}=Q,D=Y.stringifyString({type:L,value:$},{implicitKey:J,indent:V>0?" ".repeat(V):"",inFlow:M,options:{blockQuote:!0,lineWidth:-1}}),F=Q.end??[{type:"newline",offset:-1,indent:V,source:\`
22209
- \`}];switch(D[0]){case"|":case">":{let j=D.indexOf(\`
22210
- \`),N=D.substring(0,j),K=D.substring(j+1)+\`
22208
+ \${Q.comment}\`:Q.comment}this.doc.range[2]=Q.offset;break}default:this.errors.push(new Y.YAMLParseError(G($),"UNEXPECTED_TOKEN",\`Unsupported token \${$.type}\`))}}*end($=!1,Q=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if($){let J=Object.assign({_directives:this.directives},this.options),V=new W.Document(void 0,J);if(this.atDirectives)this.onError(Q,"MISSING_CHAR","Missing directives-end indicator line");V.range=[0,Q,Q],this.decorate(V,!1),yield V}}}Z.Composer=_}),t9=w((Z)=>{var X=G7(),z=q7(),W=W6(),Y=X6();function q($,Q=!0,J){if($){let V=(M,A,D)=>{let L=typeof M==="number"?M:Array.isArray(M)?M[0]:M.offset;if(J)J(L,A,D);else throw new W.YAMLParseError([L,L+1],A,D)};switch($.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return z.resolveFlowScalar($,Q,V);case"block-scalar":return X.resolveBlockScalar({options:{strict:Q}},$,V)}}return null}function B($,Q){let{implicitKey:J=!1,indent:V,inFlow:M=!1,offset:A=-1,type:D="PLAIN"}=Q,L=Y.stringifyString({type:D,value:$},{implicitKey:J,indent:V>0?" ".repeat(V):"",inFlow:M,options:{blockQuote:!0,lineWidth:-1}}),F=Q.end??[{type:"newline",offset:-1,indent:V,source:\`
22209
+ \`}];switch(L[0]){case"|":case">":{let j=L.indexOf(\`
22210
+ \`),N=L.substring(0,j),K=L.substring(j+1)+\`
22211
22211
  \`,E=[{type:"block-scalar-header",offset:A,indent:V,source:N}];if(!H(E,F))E.push({type:"newline",offset:-1,indent:V,source:\`
22212
- \`});return{type:"block-scalar",offset:A,indent:V,props:E,source:K}}case'"':return{type:"double-quoted-scalar",offset:A,indent:V,source:D,end:F};case"'":return{type:"single-quoted-scalar",offset:A,indent:V,source:D,end:F};default:return{type:"scalar",offset:A,indent:V,source:D,end:F}}}function U($,Q,J={}){let{afterKey:V=!1,implicitKey:M=!1,inFlow:A=!1,type:L}=J,D="indent"in $?$.indent:null;if(V&&typeof D==="number")D+=2;if(!L)switch($.type){case"single-quoted-scalar":L="QUOTE_SINGLE";break;case"double-quoted-scalar":L="QUOTE_DOUBLE";break;case"block-scalar":{let j=$.props[0];if(j.type!=="block-scalar-header")throw Error("Invalid block scalar header");L=j.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:L="PLAIN"}let F=Y.stringifyString({type:L,value:Q},{implicitKey:M||D===null,indent:D!==null&&D>0?" ".repeat(D):"",inFlow:A,options:{blockQuote:!0,lineWidth:-1}});switch(F[0]){case"|":case">":G($,F);break;case'"':_($,F,"double-quoted-scalar");break;case"'":_($,F,"single-quoted-scalar");break;default:_($,F,"scalar")}}function G($,Q){let J=Q.indexOf(\`
22212
+ \`});return{type:"block-scalar",offset:A,indent:V,props:E,source:K}}case'"':return{type:"double-quoted-scalar",offset:A,indent:V,source:L,end:F};case"'":return{type:"single-quoted-scalar",offset:A,indent:V,source:L,end:F};default:return{type:"scalar",offset:A,indent:V,source:L,end:F}}}function U($,Q,J={}){let{afterKey:V=!1,implicitKey:M=!1,inFlow:A=!1,type:D}=J,L="indent"in $?$.indent:null;if(V&&typeof L==="number")L+=2;if(!D)switch($.type){case"single-quoted-scalar":D="QUOTE_SINGLE";break;case"double-quoted-scalar":D="QUOTE_DOUBLE";break;case"block-scalar":{let j=$.props[0];if(j.type!=="block-scalar-header")throw Error("Invalid block scalar header");D=j.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:D="PLAIN"}let F=Y.stringifyString({type:D,value:Q},{implicitKey:M||L===null,indent:L!==null&&L>0?" ".repeat(L):"",inFlow:A,options:{blockQuote:!0,lineWidth:-1}});switch(F[0]){case"|":case">":G($,F);break;case'"':_($,F,"double-quoted-scalar");break;case"'":_($,F,"single-quoted-scalar");break;default:_($,F,"scalar")}}function G($,Q){let J=Q.indexOf(\`
22213
22213
  \`),V=Q.substring(0,J),M=Q.substring(J+1)+\`
22214
- \`;if($.type==="block-scalar"){let A=$.props[0];if(A.type!=="block-scalar-header")throw Error("Invalid block scalar header");A.source=V,$.source=M}else{let{offset:A}=$,L="indent"in $?$.indent:-1,D=[{type:"block-scalar-header",offset:A,indent:L,source:V}];if(!H(D,"end"in $?$.end:void 0))D.push({type:"newline",offset:-1,indent:L,source:\`
22215
- \`});for(let F of Object.keys($))if(F!=="type"&&F!=="offset")delete $[F];Object.assign($,{type:"block-scalar",indent:L,props:D,source:M})}}function H($,Q){if(Q)for(let J of Q)switch(J.type){case"space":case"comment":$.push(J);break;case"newline":return $.push(J),!0}return!1}function _($,Q,J){switch($.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":$.type=J,$.source=Q;break;case"block-scalar":{let V=$.props.slice(1),M=Q.length;if($.props[0].type==="block-scalar-header")M-=$.props[0].source.length;for(let A of V)A.offset+=M;delete $.props,Object.assign($,{type:J,source:Q,end:V});break}case"block-map":case"block-seq":{let M={type:"newline",offset:$.offset+Q.length,indent:$.indent,source:\`
22214
+ \`;if($.type==="block-scalar"){let A=$.props[0];if(A.type!=="block-scalar-header")throw Error("Invalid block scalar header");A.source=V,$.source=M}else{let{offset:A}=$,D="indent"in $?$.indent:-1,L=[{type:"block-scalar-header",offset:A,indent:D,source:V}];if(!H(L,"end"in $?$.end:void 0))L.push({type:"newline",offset:-1,indent:D,source:\`
22215
+ \`});for(let F of Object.keys($))if(F!=="type"&&F!=="offset")delete $[F];Object.assign($,{type:"block-scalar",indent:D,props:L,source:M})}}function H($,Q){if(Q)for(let J of Q)switch(J.type){case"space":case"comment":$.push(J);break;case"newline":return $.push(J),!0}return!1}function _($,Q,J){switch($.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":$.type=J,$.source=Q;break;case"block-scalar":{let V=$.props.slice(1),M=Q.length;if($.props[0].type==="block-scalar-header")M-=$.props[0].source.length;for(let A of V)A.offset+=M;delete $.props,Object.assign($,{type:J,source:Q,end:V});break}case"block-map":case"block-seq":{let M={type:"newline",offset:$.offset+Q.length,indent:$.indent,source:\`
22216
22216
  \`};delete $.items,Object.assign($,{type:J,source:Q,end:[M]});break}default:{let V="indent"in $?$.indent:-1,M="end"in $&&Array.isArray($.end)?$.end.filter((A)=>A.type==="space"||A.type==="comment"||A.type==="newline"):[];for(let A of Object.keys($))if(A!=="type"&&A!=="offset")delete $[A];Object.assign($,{type:J,indent:V,source:Q,end:M})}}}Z.createScalarToken=B,Z.resolveAsScalar=q,Z.setScalarValue=U}),e9=w((Z)=>{var X=(Y)=>("type"in Y)?z(Y):W(Y);function z(Y){switch(Y.type){case"block-scalar":{let q="";for(let B of Y.props)q+=z(B);return q+Y.source}case"block-map":case"block-seq":{let q="";for(let B of Y.items)q+=W(B);return q}case"flow-collection":{let q=Y.start.source;for(let B of Y.items)q+=W(B);for(let B of Y.end)q+=B.source;return q}case"document":{let q=W(Y);if(Y.end)for(let B of Y.end)q+=B.source;return q}default:{let q=Y.source;if("end"in Y&&Y.end)for(let B of Y.end)q+=B.source;return q}}}function W({start:Y,key:q,sep:B,value:U}){let G="";for(let H of Y)G+=H.source;if(q)G+=z(q);if(B)for(let H of B)G+=H.source;if(U)G+=z(U);return G}Z.stringify=X}),Zz=w((Z)=>{var X=Symbol("break visit"),z=Symbol("skip children"),W=Symbol("remove item");function Y(B,U){if("type"in B&&B.type==="document")B={start:B.start,value:B.value};q(Object.freeze([]),B,U)}Y.BREAK=X,Y.SKIP=z,Y.REMOVE=W,Y.itemAtPath=(B,U)=>{let G=B;for(let[H,_]of U){let $=G?.[H];if($&&"items"in $)G=$.items[_];else return}return G},Y.parentCollection=(B,U)=>{let G=Y.itemAtPath(B,U.slice(0,-1)),H=U[U.length-1][0],_=G?.[H];if(_&&"items"in _)return _;throw Error("Parent collection not found")};function q(B,U,G){let H=G(U,B);if(typeof H==="symbol")return H;for(let _ of["key","value"]){let $=U[_];if($&&"items"in $){for(let Q=0;Q<$.items.length;++Q){let J=q(Object.freeze(B.concat([[_,Q]])),$.items[Q],G);if(typeof J==="number")Q=J-1;else if(J===X)return X;else if(J===W)$.items.splice(Q,1),Q-=1}if(typeof H==="function"&&_==="key")H=H(U,B)}}return typeof H==="function"?H(U,B):H}Z.visit=Y}),X5=w((Z)=>{var X=t9(),z=e9(),W=Zz(),Y="\\uFEFF",q="\\x02",B="\\x18",U="\\x1F",G=(Q)=>!!Q&&("items"in Q),H=(Q)=>!!Q&&(Q.type==="scalar"||Q.type==="single-quoted-scalar"||Q.type==="double-quoted-scalar"||Q.type==="block-scalar");function _(Q){switch(Q){case Y:return"<BOM>";case q:return"<DOC>";case B:return"<FLOW_END>";case U:return"<SCALAR>";default:return JSON.stringify(Q)}}function $(Q){switch(Q){case Y:return"byte-order-mark";case q:return"doc-mode";case B:return"flow-error-end";case U:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case\`
22217
22217
  \`:case\`\\r
22218
22218
  \`: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(Q[0]){case" ":case"\\t":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}Z.createScalarToken=X.createScalarToken,Z.resolveAsScalar=X.resolveAsScalar,Z.setScalarValue=X.setScalarValue,Z.stringify=z.stringify,Z.visit=W.visit,Z.BOM=Y,Z.DOCUMENT=q,Z.FLOW_END=B,Z.SCALAR=U,Z.isCollection=G,Z.isScalar=H,Z.prettyToken=_,Z.tokenType=$}),A7=w((Z)=>{var X=X5();function z(H){switch(H){case void 0:case" ":case\`
@@ -22234,11 +22234,11 @@ $&\`).replace(/(?:^|\\n)([\\t ].*)(?:([\\n\\t ]*)\\n(?![\\n\\t ]))?/g,"$1$2").re
22234
22234
  \`,J=this.buffer[$+1];else _=$;if(J==="#"||H&&q.has(J))break;if(Q===\`
22235
22235
  \`){let V=this.continueScalar($+1);if(V===-1)break;$=Math.max($,V-2)}}else{if(H&&q.has(Q))break;_=$}if(!Q&&!this.atEnd)return this.setNext("plain-scalar");return yield X.SCALAR,yield*this.pushToIndex(_+1,!0),H?"flow":"doc"}*pushCount(H){if(H>0)return yield this.buffer.substr(this.pos,H),this.pos+=H,H;return 0}*pushToIndex(H,_){let $=this.buffer.slice(this.pos,H);if($)return yield $,this.pos+=$.length,$.length;else if(_)yield"";return 0}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(U))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let H=this.flowLevel>0,_=this.charAt(1);if(z(_)||H&&q.has(_)){if(!H)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=!1;return(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}}return 0}*pushTag(){if(this.charAt(1)==="<"){let H=this.pos+2,_=this.buffer[H];while(!z(_)&&_!==">")_=this.buffer[++H];return yield*this.pushToIndex(_===">"?H+1:H,!1)}else{let H=this.pos+1,_=this.buffer[H];while(_)if(Y.has(_))_=this.buffer[++H];else if(_==="%"&&W.has(this.buffer[H+1])&&W.has(this.buffer[H+2]))_=this.buffer[H+=3];else break;return yield*this.pushToIndex(H,!1)}}*pushNewline(){let H=this.buffer[this.pos];if(H===\`
22236
22236
  \`)return yield*this.pushCount(1);else if(H==="\\r"&&this.charAt(1)===\`
22237
- \`)return yield*this.pushCount(2);else return 0}*pushSpaces(H){let _=this.pos-1,$;do $=this.buffer[++_];while($===" "||H&&$==="\\t");let Q=_-this.pos;if(Q>0)yield this.buffer.substr(this.pos,Q),this.pos=_;return Q}*pushUntil(H){let _=this.pos,$=this.buffer[_];while(!H($))$=this.buffer[++_];return yield*this.pushToIndex(_,!1)}}Z.Lexer=G}),L7=w((Z)=>{class X{constructor(){this.lineStarts=[],this.addNewLine=(z)=>this.lineStarts.push(z),this.linePos=(z)=>{let W=0,Y=this.lineStarts.length;while(W<Y){let B=W+Y>>1;if(this.lineStarts[B]<z)W=B+1;else Y=B}if(this.lineStarts[W]===z)return{line:W+1,col:1};if(W===0)return{line:0,col:z};let q=this.lineStarts[W-1];return{line:W,col:z-q+1}}}}Z.LineCounter=X}),D7=w((Z)=>{var X=a8("process"),z=X5(),W=A7();function Y($,Q){for(let J=0;J<$.length;++J)if($[J].type===Q)return!0;return!1}function q($){for(let Q=0;Q<$.length;++Q)switch($[Q].type){case"space":case"comment":case"newline":break;default:return Q}return-1}function B($){switch($?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function U($){switch($.type){case"document":return $.start;case"block-map":{let Q=$.items[$.items.length-1];return Q.sep??Q.start}case"block-seq":return $.items[$.items.length-1].start;default:return[]}}function G($){if($.length===0)return[];let Q=$.length;Z:while(--Q>=0)switch($[Q].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break Z}while($[++Q]?.type==="space");return $.splice(Q,$.length)}function H($){if($.start.type==="flow-seq-start"){for(let Q of $.items)if(Q.sep&&!Q.value&&!Y(Q.start,"explicit-key-ind")&&!Y(Q.sep,"map-value-ind")){if(Q.key)Q.value=Q.key;if(delete Q.key,B(Q.value))if(Q.value.end)Array.prototype.push.apply(Q.value.end,Q.sep);else Q.value.end=Q.sep;else Array.prototype.push.apply(Q.start,Q.sep);delete Q.sep}}}class _{constructor($){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new W.Lexer,this.onNewLine=$}*parse($,Q=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let J of this.lexer.lex($,Q))yield*this.next(J);if(!Q)yield*this.end()}*next($){if(this.source=$,X.env.LOG_TOKENS)console.log("|",z.prettyToken($));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=$.length;return}let Q=z.tokenType($);if(!Q){let J=\`Not a YAML token: \${$}\`;yield*this.pop({type:"error",offset:this.offset,message:J,source:$}),this.offset+=$.length}else if(Q==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=Q,yield*this.step(),Q){case"newline":if(this.atNewLine=!0,this.indent=0,this.onNewLine)this.onNewLine(this.offset+$.length);break;case"space":if(this.atNewLine&&$[0]===" ")this.indent+=$.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=$.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=$.length}}*end(){while(this.stack.length>0)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let $=this.peek(1);if(this.type==="doc-end"&&$?.type!=="doc-end"){while(this.stack.length>0)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!$)return yield*this.stream();switch($.type){case"document":return yield*this.document($);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar($);case"block-scalar":return yield*this.blockScalar($);case"block-map":return yield*this.blockMap($);case"block-seq":return yield*this.blockSequence($);case"flow-collection":return yield*this.flowCollection($);case"doc-end":return yield*this.documentEnd($)}yield*this.pop()}peek($){return this.stack[this.stack.length-$]}*pop($){let Q=$??this.stack.pop();if(!Q)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield Q;else{let J=this.peek(1);if(Q.type==="block-scalar")Q.indent="indent"in J?J.indent:0;else if(Q.type==="flow-collection"&&J.type==="document")Q.indent=0;if(Q.type==="flow-collection")H(Q);switch(J.type){case"document":J.value=Q;break;case"block-scalar":J.props.push(Q);break;case"block-map":{let V=J.items[J.items.length-1];if(V.value){J.items.push({start:[],key:Q,sep:[]}),this.onKeyLine=!0;return}else if(V.sep)V.value=Q;else{Object.assign(V,{key:Q,sep:[]}),this.onKeyLine=!V.explicitKey;return}break}case"block-seq":{let V=J.items[J.items.length-1];if(V.value)J.items.push({start:[],value:Q});else V.value=Q;break}case"flow-collection":{let V=J.items[J.items.length-1];if(!V||V.value)J.items.push({start:[],key:Q,sep:[]});else if(V.sep)V.value=Q;else Object.assign(V,{key:Q,sep:[]});return}default:yield*this.pop(),yield*this.pop(Q)}if((J.type==="document"||J.type==="block-map"||J.type==="block-seq")&&(Q.type==="block-map"||Q.type==="block-seq")){let V=Q.items[Q.items.length-1];if(V&&!V.sep&&!V.value&&V.start.length>0&&q(V.start)===-1&&(Q.indent===0||V.start.every((M)=>M.type!=="comment"||M.indent<Q.indent))){if(J.type==="document")J.end=V.start;else J.items.push({start:V.start});Q.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 $={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")$.start.push(this.sourceToken);this.stack.push($);return}}yield{type:"error",offset:this.offset,message:\`Unexpected \${this.type} token in YAML stream\`,source:this.source}}*document($){if($.value)return yield*this.lineEnd($);switch(this.type){case"doc-start":{if(q($.start)!==-1)yield*this.pop(),yield*this.step();else $.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":$.start.push(this.sourceToken);return}let Q=this.startBlockValue($);if(Q)this.stack.push(Q);else yield{type:"error",offset:this.offset,message:\`Unexpected \${this.type} token in YAML document\`,source:this.source}}*scalar($){if(this.type==="map-value-ind"){let Q=U(this.peek(2)),J=G(Q),V;if($.end)V=$.end,V.push(this.sourceToken),delete $.end;else V=[this.sourceToken];let M={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:J,key:$,sep:V}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=M}else yield*this.lineEnd($)}*blockScalar($){switch(this.type){case"space":case"comment":case"newline":$.props.push(this.sourceToken);return;case"scalar":if($.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let Q=this.source.indexOf(\`
22237
+ \`)return yield*this.pushCount(2);else return 0}*pushSpaces(H){let _=this.pos-1,$;do $=this.buffer[++_];while($===" "||H&&$==="\\t");let Q=_-this.pos;if(Q>0)yield this.buffer.substr(this.pos,Q),this.pos=_;return Q}*pushUntil(H){let _=this.pos,$=this.buffer[_];while(!H($))$=this.buffer[++_];return yield*this.pushToIndex(_,!1)}}Z.Lexer=G}),D7=w((Z)=>{class X{constructor(){this.lineStarts=[],this.addNewLine=(z)=>this.lineStarts.push(z),this.linePos=(z)=>{let W=0,Y=this.lineStarts.length;while(W<Y){let B=W+Y>>1;if(this.lineStarts[B]<z)W=B+1;else Y=B}if(this.lineStarts[W]===z)return{line:W+1,col:1};if(W===0)return{line:0,col:z};let q=this.lineStarts[W-1];return{line:W,col:z-q+1}}}}Z.LineCounter=X}),L7=w((Z)=>{var X=a8("process"),z=X5(),W=A7();function Y($,Q){for(let J=0;J<$.length;++J)if($[J].type===Q)return!0;return!1}function q($){for(let Q=0;Q<$.length;++Q)switch($[Q].type){case"space":case"comment":case"newline":break;default:return Q}return-1}function B($){switch($?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function U($){switch($.type){case"document":return $.start;case"block-map":{let Q=$.items[$.items.length-1];return Q.sep??Q.start}case"block-seq":return $.items[$.items.length-1].start;default:return[]}}function G($){if($.length===0)return[];let Q=$.length;Z:while(--Q>=0)switch($[Q].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break Z}while($[++Q]?.type==="space");return $.splice(Q,$.length)}function H($){if($.start.type==="flow-seq-start"){for(let Q of $.items)if(Q.sep&&!Q.value&&!Y(Q.start,"explicit-key-ind")&&!Y(Q.sep,"map-value-ind")){if(Q.key)Q.value=Q.key;if(delete Q.key,B(Q.value))if(Q.value.end)Array.prototype.push.apply(Q.value.end,Q.sep);else Q.value.end=Q.sep;else Array.prototype.push.apply(Q.start,Q.sep);delete Q.sep}}}class _{constructor($){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new W.Lexer,this.onNewLine=$}*parse($,Q=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let J of this.lexer.lex($,Q))yield*this.next(J);if(!Q)yield*this.end()}*next($){if(this.source=$,X.env.LOG_TOKENS)console.log("|",z.prettyToken($));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=$.length;return}let Q=z.tokenType($);if(!Q){let J=\`Not a YAML token: \${$}\`;yield*this.pop({type:"error",offset:this.offset,message:J,source:$}),this.offset+=$.length}else if(Q==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=Q,yield*this.step(),Q){case"newline":if(this.atNewLine=!0,this.indent=0,this.onNewLine)this.onNewLine(this.offset+$.length);break;case"space":if(this.atNewLine&&$[0]===" ")this.indent+=$.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=$.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=$.length}}*end(){while(this.stack.length>0)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let $=this.peek(1);if(this.type==="doc-end"&&$?.type!=="doc-end"){while(this.stack.length>0)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!$)return yield*this.stream();switch($.type){case"document":return yield*this.document($);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar($);case"block-scalar":return yield*this.blockScalar($);case"block-map":return yield*this.blockMap($);case"block-seq":return yield*this.blockSequence($);case"flow-collection":return yield*this.flowCollection($);case"doc-end":return yield*this.documentEnd($)}yield*this.pop()}peek($){return this.stack[this.stack.length-$]}*pop($){let Q=$??this.stack.pop();if(!Q)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield Q;else{let J=this.peek(1);if(Q.type==="block-scalar")Q.indent="indent"in J?J.indent:0;else if(Q.type==="flow-collection"&&J.type==="document")Q.indent=0;if(Q.type==="flow-collection")H(Q);switch(J.type){case"document":J.value=Q;break;case"block-scalar":J.props.push(Q);break;case"block-map":{let V=J.items[J.items.length-1];if(V.value){J.items.push({start:[],key:Q,sep:[]}),this.onKeyLine=!0;return}else if(V.sep)V.value=Q;else{Object.assign(V,{key:Q,sep:[]}),this.onKeyLine=!V.explicitKey;return}break}case"block-seq":{let V=J.items[J.items.length-1];if(V.value)J.items.push({start:[],value:Q});else V.value=Q;break}case"flow-collection":{let V=J.items[J.items.length-1];if(!V||V.value)J.items.push({start:[],key:Q,sep:[]});else if(V.sep)V.value=Q;else Object.assign(V,{key:Q,sep:[]});return}default:yield*this.pop(),yield*this.pop(Q)}if((J.type==="document"||J.type==="block-map"||J.type==="block-seq")&&(Q.type==="block-map"||Q.type==="block-seq")){let V=Q.items[Q.items.length-1];if(V&&!V.sep&&!V.value&&V.start.length>0&&q(V.start)===-1&&(Q.indent===0||V.start.every((M)=>M.type!=="comment"||M.indent<Q.indent))){if(J.type==="document")J.end=V.start;else J.items.push({start:V.start});Q.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 $={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")$.start.push(this.sourceToken);this.stack.push($);return}}yield{type:"error",offset:this.offset,message:\`Unexpected \${this.type} token in YAML stream\`,source:this.source}}*document($){if($.value)return yield*this.lineEnd($);switch(this.type){case"doc-start":{if(q($.start)!==-1)yield*this.pop(),yield*this.step();else $.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":$.start.push(this.sourceToken);return}let Q=this.startBlockValue($);if(Q)this.stack.push(Q);else yield{type:"error",offset:this.offset,message:\`Unexpected \${this.type} token in YAML document\`,source:this.source}}*scalar($){if(this.type==="map-value-ind"){let Q=U(this.peek(2)),J=G(Q),V;if($.end)V=$.end,V.push(this.sourceToken),delete $.end;else V=[this.sourceToken];let M={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:J,key:$,sep:V}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=M}else yield*this.lineEnd($)}*blockScalar($){switch(this.type){case"space":case"comment":case"newline":$.props.push(this.sourceToken);return;case"scalar":if($.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let Q=this.source.indexOf(\`
22238
22238
  \`)+1;while(Q!==0)this.onNewLine(this.offset+Q),Q=this.source.indexOf(\`
22239
- \`,Q)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap($){let Q=$.items[$.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,Q.value){let J="end"in Q.value?Q.value.end:void 0;if((Array.isArray(J)?J[J.length-1]:void 0)?.type==="comment")J?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else if(Q.sep)Q.sep.push(this.sourceToken);else Q.start.push(this.sourceToken);return;case"space":case"comment":if(Q.value)$.items.push({start:[this.sourceToken]});else if(Q.sep)Q.sep.push(this.sourceToken);else{if(this.atIndentedComment(Q.start,$.indent)){let V=$.items[$.items.length-2]?.value?.end;if(Array.isArray(V)){Array.prototype.push.apply(V,Q.start),V.push(this.sourceToken),$.items.pop();return}}Q.start.push(this.sourceToken)}return}if(this.indent>=$.indent){let J=!this.onKeyLine&&this.indent===$.indent,V=J&&(Q.sep||Q.explicitKey)&&this.type!=="seq-item-ind",M=[];if(V&&Q.sep&&!Q.value){let A=[];for(let L=0;L<Q.sep.length;++L){let D=Q.sep[L];switch(D.type){case"newline":A.push(L);break;case"space":break;case"comment":if(D.indent>$.indent)A.length=0;break;default:A.length=0}}if(A.length>=2)M=Q.sep.splice(A[1])}switch(this.type){case"anchor":case"tag":if(V||Q.value)M.push(this.sourceToken),$.items.push({start:M}),this.onKeyLine=!0;else if(Q.sep)Q.sep.push(this.sourceToken);else Q.start.push(this.sourceToken);return;case"explicit-key-ind":if(!Q.sep&&!Q.explicitKey)Q.start.push(this.sourceToken),Q.explicitKey=!0;else if(V||Q.value)M.push(this.sourceToken),$.items.push({start:M,explicitKey:!0});else 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(Q.explicitKey)if(!Q.sep)if(Y(Q.start,"newline"))Object.assign(Q,{key:null,sep:[this.sourceToken]});else{let A=G(Q.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:A,key:null,sep:[this.sourceToken]}]})}else if(Q.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Y(Q.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:M,key:null,sep:[this.sourceToken]}]});else if(B(Q.key)&&!Y(Q.sep,"newline")){let A=G(Q.start),L=Q.key,D=Q.sep;D.push(this.sourceToken),delete Q.key,delete Q.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:A,key:L,sep:D}]})}else if(M.length>0)Q.sep=Q.sep.concat(M,this.sourceToken);else Q.sep.push(this.sourceToken);else if(!Q.sep)Object.assign(Q,{key:null,sep:[this.sourceToken]});else if(Q.value||V)$.items.push({start:M,key:null,sep:[this.sourceToken]});else if(Y(Q.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else Q.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let A=this.flowScalar(this.type);if(V||Q.value)$.items.push({start:M,key:A,sep:[]}),this.onKeyLine=!0;else if(Q.sep)this.stack.push(A);else Object.assign(Q,{key:A,sep:[]}),this.onKeyLine=!0;return}default:{let A=this.startBlockValue($);if(A){if(A.type==="block-seq"){if(!Q.explicitKey&&Q.sep&&!Y(Q.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 if(J)$.items.push({start:M});this.stack.push(A);return}}}}yield*this.pop(),yield*this.step()}*blockSequence($){let Q=$.items[$.items.length-1];switch(this.type){case"newline":if(Q.value){let J="end"in Q.value?Q.value.end:void 0;if((Array.isArray(J)?J[J.length-1]:void 0)?.type==="comment")J?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else Q.start.push(this.sourceToken);return;case"space":case"comment":if(Q.value)$.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(Q.start,$.indent)){let V=$.items[$.items.length-2]?.value?.end;if(Array.isArray(V)){Array.prototype.push.apply(V,Q.start),V.push(this.sourceToken),$.items.pop();return}}Q.start.push(this.sourceToken)}return;case"anchor":case"tag":if(Q.value||this.indent<=$.indent)break;Q.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==$.indent)break;if(Q.value||Y(Q.start,"seq-item-ind"))$.items.push({start:[this.sourceToken]});else Q.start.push(this.sourceToken);return}if(this.indent>$.indent){let J=this.startBlockValue($);if(J){this.stack.push(J);return}}yield*this.pop(),yield*this.step()}*flowCollection($){let Q=$.items[$.items.length-1];if(this.type==="flow-error-end"){let J;do yield*this.pop(),J=this.peek(1);while(J?.type==="flow-collection")}else if($.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!Q||Q.sep)$.items.push({start:[this.sourceToken]});else Q.start.push(this.sourceToken);return;case"map-value-ind":if(!Q||Q.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Q.sep)Q.sep.push(this.sourceToken);else Object.assign(Q,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!Q||Q.value)$.items.push({start:[this.sourceToken]});else if(Q.sep)Q.sep.push(this.sourceToken);else Q.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let V=this.flowScalar(this.type);if(!Q||Q.value)$.items.push({start:[],key:V,sep:[]});else if(Q.sep)this.stack.push(V);else Object.assign(Q,{key:V,sep:[]});return}case"flow-map-end":case"flow-seq-end":$.end.push(this.sourceToken);return}let J=this.startBlockValue($);if(J)this.stack.push(J);else yield*this.pop(),yield*this.step()}else{let J=this.peek(2);if(J.type==="block-map"&&(this.type==="map-value-ind"&&J.indent===$.indent||this.type==="newline"&&!J.items[J.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&J.type!=="flow-collection"){let V=U(J),M=G(V);H($);let A=$.end.splice(1,$.end.length);A.push(this.sourceToken);let L={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:M,key:$,sep:A}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=L}else yield*this.lineEnd($)}}flowScalar($){if(this.onNewLine){let Q=this.source.indexOf(\`
22239
+ \`,Q)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap($){let Q=$.items[$.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,Q.value){let J="end"in Q.value?Q.value.end:void 0;if((Array.isArray(J)?J[J.length-1]:void 0)?.type==="comment")J?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else if(Q.sep)Q.sep.push(this.sourceToken);else Q.start.push(this.sourceToken);return;case"space":case"comment":if(Q.value)$.items.push({start:[this.sourceToken]});else if(Q.sep)Q.sep.push(this.sourceToken);else{if(this.atIndentedComment(Q.start,$.indent)){let V=$.items[$.items.length-2]?.value?.end;if(Array.isArray(V)){Array.prototype.push.apply(V,Q.start),V.push(this.sourceToken),$.items.pop();return}}Q.start.push(this.sourceToken)}return}if(this.indent>=$.indent){let J=!this.onKeyLine&&this.indent===$.indent,V=J&&(Q.sep||Q.explicitKey)&&this.type!=="seq-item-ind",M=[];if(V&&Q.sep&&!Q.value){let A=[];for(let D=0;D<Q.sep.length;++D){let L=Q.sep[D];switch(L.type){case"newline":A.push(D);break;case"space":break;case"comment":if(L.indent>$.indent)A.length=0;break;default:A.length=0}}if(A.length>=2)M=Q.sep.splice(A[1])}switch(this.type){case"anchor":case"tag":if(V||Q.value)M.push(this.sourceToken),$.items.push({start:M}),this.onKeyLine=!0;else if(Q.sep)Q.sep.push(this.sourceToken);else Q.start.push(this.sourceToken);return;case"explicit-key-ind":if(!Q.sep&&!Q.explicitKey)Q.start.push(this.sourceToken),Q.explicitKey=!0;else if(V||Q.value)M.push(this.sourceToken),$.items.push({start:M,explicitKey:!0});else 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(Q.explicitKey)if(!Q.sep)if(Y(Q.start,"newline"))Object.assign(Q,{key:null,sep:[this.sourceToken]});else{let A=G(Q.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:A,key:null,sep:[this.sourceToken]}]})}else if(Q.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Y(Q.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:M,key:null,sep:[this.sourceToken]}]});else if(B(Q.key)&&!Y(Q.sep,"newline")){let A=G(Q.start),D=Q.key,L=Q.sep;L.push(this.sourceToken),delete Q.key,delete Q.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:A,key:D,sep:L}]})}else if(M.length>0)Q.sep=Q.sep.concat(M,this.sourceToken);else Q.sep.push(this.sourceToken);else if(!Q.sep)Object.assign(Q,{key:null,sep:[this.sourceToken]});else if(Q.value||V)$.items.push({start:M,key:null,sep:[this.sourceToken]});else if(Y(Q.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else Q.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let A=this.flowScalar(this.type);if(V||Q.value)$.items.push({start:M,key:A,sep:[]}),this.onKeyLine=!0;else if(Q.sep)this.stack.push(A);else Object.assign(Q,{key:A,sep:[]}),this.onKeyLine=!0;return}default:{let A=this.startBlockValue($);if(A){if(A.type==="block-seq"){if(!Q.explicitKey&&Q.sep&&!Y(Q.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 if(J)$.items.push({start:M});this.stack.push(A);return}}}}yield*this.pop(),yield*this.step()}*blockSequence($){let Q=$.items[$.items.length-1];switch(this.type){case"newline":if(Q.value){let J="end"in Q.value?Q.value.end:void 0;if((Array.isArray(J)?J[J.length-1]:void 0)?.type==="comment")J?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else Q.start.push(this.sourceToken);return;case"space":case"comment":if(Q.value)$.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(Q.start,$.indent)){let V=$.items[$.items.length-2]?.value?.end;if(Array.isArray(V)){Array.prototype.push.apply(V,Q.start),V.push(this.sourceToken),$.items.pop();return}}Q.start.push(this.sourceToken)}return;case"anchor":case"tag":if(Q.value||this.indent<=$.indent)break;Q.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==$.indent)break;if(Q.value||Y(Q.start,"seq-item-ind"))$.items.push({start:[this.sourceToken]});else Q.start.push(this.sourceToken);return}if(this.indent>$.indent){let J=this.startBlockValue($);if(J){this.stack.push(J);return}}yield*this.pop(),yield*this.step()}*flowCollection($){let Q=$.items[$.items.length-1];if(this.type==="flow-error-end"){let J;do yield*this.pop(),J=this.peek(1);while(J?.type==="flow-collection")}else if($.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!Q||Q.sep)$.items.push({start:[this.sourceToken]});else Q.start.push(this.sourceToken);return;case"map-value-ind":if(!Q||Q.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Q.sep)Q.sep.push(this.sourceToken);else Object.assign(Q,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!Q||Q.value)$.items.push({start:[this.sourceToken]});else if(Q.sep)Q.sep.push(this.sourceToken);else Q.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let V=this.flowScalar(this.type);if(!Q||Q.value)$.items.push({start:[],key:V,sep:[]});else if(Q.sep)this.stack.push(V);else Object.assign(Q,{key:V,sep:[]});return}case"flow-map-end":case"flow-seq-end":$.end.push(this.sourceToken);return}let J=this.startBlockValue($);if(J)this.stack.push(J);else yield*this.pop(),yield*this.step()}else{let J=this.peek(2);if(J.type==="block-map"&&(this.type==="map-value-ind"&&J.indent===$.indent||this.type==="newline"&&!J.items[J.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&J.type!=="flow-collection"){let V=U(J),M=G(V);H($);let A=$.end.splice(1,$.end.length);A.push(this.sourceToken);let D={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:M,key:$,sep:A}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=D}else yield*this.lineEnd($)}}flowScalar($){if(this.onNewLine){let Q=this.source.indexOf(\`
22240
22240
  \`)+1;while(Q!==0)this.onNewLine(this.offset+Q),Q=this.source.indexOf(\`
22241
- \`,Q)+1}return{type:$,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue($){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 Q=U($),J=G(Q);return J.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:J,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let Q=U($),J=G(Q);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:J,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment($,Q){if(this.type!=="comment")return!1;if(this.indent<=Q)return!1;return $.every((J)=>J.type==="newline"||J.type==="space")}*documentEnd($){if(this.type!=="doc-mode"){if($.end)$.end.push(this.sourceToken);else $.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd($){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;case"space":case"comment":default:if($.end)$.end.push(this.sourceToken);else $.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}Z.Parser=_}),Xz=w((Z)=>{var X=M7(),z=Q6(),W=W6(),Y=Z7(),q=u(),B=L7(),U=D7();function G(J){let V=J.prettyErrors!==!1;return{lineCounter:J.lineCounter||V&&new B.LineCounter||null,prettyErrors:V}}function H(J,V={}){let{lineCounter:M,prettyErrors:A}=G(V),L=new U.Parser(M?.addNewLine),D=new X.Composer(V),F=Array.from(D.compose(L.parse(J)));if(A&&M)for(let j of F)j.errors.forEach(W.prettifyError(J,M)),j.warnings.forEach(W.prettifyError(J,M));if(F.length>0)return F;return Object.assign([],{empty:!0},D.streamInfo())}function _(J,V={}){let{lineCounter:M,prettyErrors:A}=G(V),L=new U.Parser(M?.addNewLine),D=new X.Composer(V),F=null;for(let j of D.compose(L.parse(J),!0,J.length))if(!F)F=j;else if(F.options.logLevel!=="silent"){F.errors.push(new W.YAMLParseError(j.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(A&&M)F.errors.forEach(W.prettifyError(J,M)),F.warnings.forEach(W.prettifyError(J,M));return F}function $(J,V,M){let A=void 0;if(typeof V==="function")A=V;else if(M===void 0&&V&&typeof V==="object")M=V;let L=_(J,M);if(!L)return null;if(L.warnings.forEach((D)=>Y.warn(L.options.logLevel,D)),L.errors.length>0)if(L.options.logLevel!=="silent")throw L.errors[0];else L.errors=[];return L.toJS(Object.assign({reviver:A},M))}function Q(J,V,M){let A=null;if(typeof V==="function"||Array.isArray(V))A=V;else if(M===void 0&&V)M=V;if(typeof M==="string")M=M.length;if(typeof M==="number"){let L=Math.round(M);M=L<1?void 0:L>8?{indent:8}:{indent:L}}if(J===void 0){let{keepUndefined:L}=M??V??{};if(!L)return}if(q.isDocument(J)&&!A)return J.toString(M);return new z.Document(J,A,M).toString(M)}Z.parse=$,Z.parseAllDocuments=H,Z.parseDocument=_,Z.stringify=Q}),O7=w((Z)=>{var X=M7(),z=Q6(),W=_7(),Y=W6(),q=t8(),B=u(),U=gZ(),G=q0(),H=hZ(),_=vZ(),$=X5(),Q=A7(),J=L7(),V=D7(),M=Xz(),A=r8();Z.Composer=X.Composer,Z.Document=z.Document,Z.Schema=W.Schema,Z.YAMLError=Y.YAMLError,Z.YAMLParseError=Y.YAMLParseError,Z.YAMLWarning=Y.YAMLWarning,Z.Alias=q.Alias,Z.isAlias=B.isAlias,Z.isCollection=B.isCollection,Z.isDocument=B.isDocument,Z.isMap=B.isMap,Z.isNode=B.isNode,Z.isPair=B.isPair,Z.isScalar=B.isScalar,Z.isSeq=B.isSeq,Z.Pair=U.Pair,Z.Scalar=G.Scalar,Z.YAMLMap=H.YAMLMap,Z.YAMLSeq=_.YAMLSeq,Z.CST=$,Z.Lexer=Q.Lexer,Z.LineCounter=J.LineCounter,Z.Parser=V.Parser,Z.parse=M.parse,Z.parseAllDocuments=M.parseAllDocuments,Z.parseDocument=M.parseDocument,Z.stringify=M.stringify,Z.visit=A.visit,Z.visitAsync=A.visitAsync});var F7=["none","acpx","llama-cpp","ollama","claude-code","codex","opencode","anthropic","openrouter","openai-compatible","command"],zz=F7.filter((Z)=>Z!=="command");var rJ=new Set(F7),tJ=new Set(zz);function bZ(Z){return typeof Z==="object"&&Z!==null&&!Array.isArray(Z)}function z5(Z){return Object.fromEntries(Object.entries(Z).filter(([,X])=>X!==void 0))}function $z(Z){if(typeof Z==="string"){let X=Z.split(",").map((z)=>z.trim()).filter((z)=>z.length>0).join(",");return X.length>0?X:void 0}if(Array.isArray(Z)){let X=Z.map((z)=>z.trim()).filter((z)=>z.length>0).join(",");return X.length>0?X:void 0}return}function Qz(Z){if(typeof Z!=="number"||!Number.isFinite(Z))return 10;return Math.min(100,Math.max(1,Math.trunc(Z)))}function Wz(Z){return{primary:Z.filter((X)=>X.supplementary!==!0),supporting:Z.filter((X)=>X.supplementary===!0)}}function Hz(Z,X){if(!bZ(Z))return{totalReturned:X,hasSupplementary:!1,noHits:X===0};let z=typeof Z.totalReturned==="number"?Z.totalReturned:X,W=Z.hasSupplementary===!0,Y="noHits"in Z?Z.noHits===!0:z===0,q=bZ(Z.dedupe)?{enabled:Z.dedupe.enabled===!0,contextEpoch:typeof Z.dedupe.contextEpoch==="number"?Z.dedupe.contextEpoch:void 0,suppressed:typeof Z.dedupe.suppressed==="number"?Z.dedupe.suppressed:0,repeatedReturned:typeof Z.dedupe.repeatedReturned==="number"?Z.dedupe.repeatedReturned:0}:void 0,B=bZ(Z.temporal)?Z.temporal:void 0;return{totalReturned:z,hasSupplementary:W,noHits:Y,...q?{dedupe:q}:{},...B?{temporal:B}:{}}}function R8(Z){let X=bZ(Z)?Z:{},W=(Array.isArray(X.results)?X.results:Array.isArray(X.memories)?X.memories:[]).filter(bZ);return{query:typeof X.query==="string"?X.query:void 0,method:typeof X.method==="string"?X.method:void 0,rows:W,meta:Hz(X.meta,W.length),message:typeof X.message==="string"?X.message:void 0}}function Jz(Z){return typeof Z==="string"&&Z.length>0?Z.slice(0,10):"unknown"}function n6(Z,X){let z=typeof Z.score==="number"?\`[\${(Z.score*100).toFixed(0)}%] \`:"",W=typeof Z.source==="string"?Z.source:"unknown",Y=typeof Z.type==="string"?Z.type:"memory",q=typeof Z.who==="string"&&Z.who.length>0?\`, by \${Z.who}\`:"",B=Jz(Z.created_at),U=typeof Z.id==="string"&&Z.id.length>0?\`id: \${Z.id}; \`:"";return\`\${X?.includeIndex?\`\${X.includeIndex}. \`:"- "}\${z}\${U}\${Z.content??""} (\${Y}, \${W}, \${B}\${q})\`}function Yz(Z){if(Z.temporal_facet==="session")return"Sessions";if(Z.temporal_facet==="source")return"Source Activity";if(Z.temporal_facet==="occurred"||Z.temporal_facet==="observed"||Z.temporal_facet==="valid")return"Events";return"Memories Captured"}function Vz(Z){let X=new Date(Z);if(Number.isNaN(X.getTime()))return Z.slice(0,10);return X.toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric",timeZone:"UTC"})}function _z(Z,X){let z=[Vz(X.start)],W=new Map;for(let Y of Z){let q=Yz(Y);W.set(q,[...W.get(q)??[],Y])}for(let Y of["Sessions","Source Activity","Events","Memories Captured"]){let q=W.get(Y);if(!q||q.length===0)continue;z.push("",Y,...q.map((B)=>n6(B)))}return z.join(\`
22241
+ \`,Q)+1}return{type:$,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue($){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 Q=U($),J=G(Q);return J.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:J,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let Q=U($),J=G(Q);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:J,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment($,Q){if(this.type!=="comment")return!1;if(this.indent<=Q)return!1;return $.every((J)=>J.type==="newline"||J.type==="space")}*documentEnd($){if(this.type!=="doc-mode"){if($.end)$.end.push(this.sourceToken);else $.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd($){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;case"space":case"comment":default:if($.end)$.end.push(this.sourceToken);else $.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}Z.Parser=_}),Xz=w((Z)=>{var X=M7(),z=Q6(),W=W6(),Y=Z7(),q=u(),B=D7(),U=L7();function G(J){let V=J.prettyErrors!==!1;return{lineCounter:J.lineCounter||V&&new B.LineCounter||null,prettyErrors:V}}function H(J,V={}){let{lineCounter:M,prettyErrors:A}=G(V),D=new U.Parser(M?.addNewLine),L=new X.Composer(V),F=Array.from(L.compose(D.parse(J)));if(A&&M)for(let j of F)j.errors.forEach(W.prettifyError(J,M)),j.warnings.forEach(W.prettifyError(J,M));if(F.length>0)return F;return Object.assign([],{empty:!0},L.streamInfo())}function _(J,V={}){let{lineCounter:M,prettyErrors:A}=G(V),D=new U.Parser(M?.addNewLine),L=new X.Composer(V),F=null;for(let j of L.compose(D.parse(J),!0,J.length))if(!F)F=j;else if(F.options.logLevel!=="silent"){F.errors.push(new W.YAMLParseError(j.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(A&&M)F.errors.forEach(W.prettifyError(J,M)),F.warnings.forEach(W.prettifyError(J,M));return F}function $(J,V,M){let A=void 0;if(typeof V==="function")A=V;else if(M===void 0&&V&&typeof V==="object")M=V;let D=_(J,M);if(!D)return null;if(D.warnings.forEach((L)=>Y.warn(D.options.logLevel,L)),D.errors.length>0)if(D.options.logLevel!=="silent")throw D.errors[0];else D.errors=[];return D.toJS(Object.assign({reviver:A},M))}function Q(J,V,M){let A=null;if(typeof V==="function"||Array.isArray(V))A=V;else if(M===void 0&&V)M=V;if(typeof M==="string")M=M.length;if(typeof M==="number"){let D=Math.round(M);M=D<1?void 0:D>8?{indent:8}:{indent:D}}if(J===void 0){let{keepUndefined:D}=M??V??{};if(!D)return}if(q.isDocument(J)&&!A)return J.toString(M);return new z.Document(J,A,M).toString(M)}Z.parse=$,Z.parseAllDocuments=H,Z.parseDocument=_,Z.stringify=Q}),O7=w((Z)=>{var X=M7(),z=Q6(),W=_7(),Y=W6(),q=t8(),B=u(),U=gZ(),G=q0(),H=hZ(),_=vZ(),$=X5(),Q=A7(),J=D7(),V=L7(),M=Xz(),A=r8();Z.Composer=X.Composer,Z.Document=z.Document,Z.Schema=W.Schema,Z.YAMLError=Y.YAMLError,Z.YAMLParseError=Y.YAMLParseError,Z.YAMLWarning=Y.YAMLWarning,Z.Alias=q.Alias,Z.isAlias=B.isAlias,Z.isCollection=B.isCollection,Z.isDocument=B.isDocument,Z.isMap=B.isMap,Z.isNode=B.isNode,Z.isPair=B.isPair,Z.isScalar=B.isScalar,Z.isSeq=B.isSeq,Z.Pair=U.Pair,Z.Scalar=G.Scalar,Z.YAMLMap=H.YAMLMap,Z.YAMLSeq=_.YAMLSeq,Z.CST=$,Z.Lexer=Q.Lexer,Z.LineCounter=J.LineCounter,Z.Parser=V.Parser,Z.parse=M.parse,Z.parseAllDocuments=M.parseAllDocuments,Z.parseDocument=M.parseDocument,Z.stringify=M.stringify,Z.visit=A.visit,Z.visitAsync=A.visitAsync});var F7=["none","acpx","llama-cpp","ollama","claude-code","codex","opencode","anthropic","openrouter","openai-compatible","command"],zz=F7.filter((Z)=>Z!=="command");var rJ=new Set(F7),tJ=new Set(zz);function bZ(Z){return typeof Z==="object"&&Z!==null&&!Array.isArray(Z)}function z5(Z){return Object.fromEntries(Object.entries(Z).filter(([,X])=>X!==void 0))}function $z(Z){if(typeof Z==="string"){let X=Z.split(",").map((z)=>z.trim()).filter((z)=>z.length>0).join(",");return X.length>0?X:void 0}if(Array.isArray(Z)){let X=Z.map((z)=>z.trim()).filter((z)=>z.length>0).join(",");return X.length>0?X:void 0}return}function Qz(Z){if(typeof Z!=="number"||!Number.isFinite(Z))return 10;return Math.min(100,Math.max(1,Math.trunc(Z)))}function Wz(Z){return{primary:Z.filter((X)=>X.supplementary!==!0),supporting:Z.filter((X)=>X.supplementary===!0)}}function Hz(Z,X){if(!bZ(Z))return{totalReturned:X,hasSupplementary:!1,noHits:X===0};let z=typeof Z.totalReturned==="number"?Z.totalReturned:X,W=Z.hasSupplementary===!0,Y="noHits"in Z?Z.noHits===!0:z===0,q=bZ(Z.dedupe)?{enabled:Z.dedupe.enabled===!0,contextEpoch:typeof Z.dedupe.contextEpoch==="number"?Z.dedupe.contextEpoch:void 0,suppressed:typeof Z.dedupe.suppressed==="number"?Z.dedupe.suppressed:0,repeatedReturned:typeof Z.dedupe.repeatedReturned==="number"?Z.dedupe.repeatedReturned:0}:void 0,B=bZ(Z.temporal)?Z.temporal:void 0;return{totalReturned:z,hasSupplementary:W,noHits:Y,...q?{dedupe:q}:{},...B?{temporal:B}:{}}}function R8(Z){let X=bZ(Z)?Z:{},W=(Array.isArray(X.results)?X.results:Array.isArray(X.memories)?X.memories:[]).filter(bZ);return{query:typeof X.query==="string"?X.query:void 0,method:typeof X.method==="string"?X.method:void 0,rows:W,meta:Hz(X.meta,W.length),message:typeof X.message==="string"?X.message:void 0}}function Jz(Z){return typeof Z==="string"&&Z.length>0?Z.slice(0,10):"unknown"}function n6(Z,X){let z=typeof Z.score==="number"?\`[\${(Z.score*100).toFixed(0)}%] \`:"",W=typeof Z.source==="string"?Z.source:"unknown",Y=typeof Z.type==="string"?Z.type:"memory",q=typeof Z.who==="string"&&Z.who.length>0?\`, by \${Z.who}\`:"",B=Jz(Z.created_at),U=typeof Z.id==="string"&&Z.id.length>0?\`id: \${Z.id}; \`:"";return\`\${X?.includeIndex?\`\${X.includeIndex}. \`:"- "}\${z}\${U}\${Z.content??""} (\${Y}, \${W}, \${B}\${q})\`}function Yz(Z){if(Z.temporal_facet==="session")return"Sessions";if(Z.temporal_facet==="source")return"Source Activity";if(Z.temporal_facet==="occurred"||Z.temporal_facet==="observed"||Z.temporal_facet==="valid")return"Events";return"Memories Captured"}function Vz(Z){let X=new Date(Z);if(Number.isNaN(X.getTime()))return Z.slice(0,10);return X.toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric",timeZone:"UTC"})}function _z(Z,X){let z=[Vz(X.start)],W=new Map;for(let Y of Z){let q=Yz(Y);W.set(q,[...W.get(q)??[],Y])}for(let Y of["Sessions","Source Activity","Events","Memories Captured"]){let q=W.get(Y);if(!q||q.length===0)continue;z.push("",Y,...q.map((B)=>n6(B)))}return z.join(\`
22242
22242
  \`)}function J6(Z){if(typeof Z!=="object"||Z===null||Array.isArray(Z))return typeof Z==="string"?Z:JSON.stringify(Z,null,2);let X=Z,z=R8(X);if(z.message&&z.rows.length===0)return z.message;if(z.meta.noHits||z.rows.length===0)return"No matching memories found.";let{primary:W,supporting:Y}=Wz(z.rows);if(z.meta.temporal?.mode==="timeline")return _z(W,z.meta.temporal);let q=z.meta.totalReturned===1?"memory":"memories",B=X.aggregate?.partial===!0&&typeof X.aggregate.message==="string"?[X.aggregate.message,"",\`Found \${z.meta.totalReturned} \${q}\${z.method?\` (\${z.method})\`:""}.\`]:[\`Found \${z.meta.totalReturned} \${q}\${z.method?\` (\${z.method})\`:""}.\`];if(W.length>0)B.push("","Primary matches:",...W.map((U)=>n6(U)));if(Y.length>0)B.push("","Supporting context:",...Y.map((U)=>n6(U)));return B.join(\`
22243
22243
  \`)}function $5(Z,X={}){return z5({query:Z,keywordQuery:X.keywordQuery??X.keyword_query,limit:Qz(X.limit),project:X.project,type:X.type,tags:X.tags,who:X.who,pinned:X.pinned===!0?!0:void 0,importance_min:X.importance_min,since:X.since,until:X.until,time:X.time,expand:X.expand===!0?!0:void 0,agentId:X.agentId??X.agent_id??X.contextAgentId,sessionKey:X.sessionKey??X.session_key,includeRecalled:X.includeRecalled===!0||X.include_recalled===!0?!0:void 0,scope:X.scope,sourceOnly:X.sourceOnly===!0||X.source_only===!0?!0:void 0,aggregate:X.aggregate===!0?!0:void 0,aggregateBudget:X.aggregateBudget??X.aggregate_budget,saveAggregate:X.saveAggregate===!1||X.save_aggregate===!1?!1:X.saveAggregate===!0||X.save_aggregate===!0?!0:void 0})}function Bz(Z){if(!bZ(Z))return Z;let X=Z.aspects;if(!Array.isArray(X))return Z;return{...Z,aspects:X.map((z)=>{if(!bZ(z))return z;if(typeof z.entityName==="string"&&Array.isArray(z.attributes))return z;if(typeof z.entity==="string"&&typeof z.aspect==="string"&&typeof z.value==="string")return{entityName:z.entity,aspect:z.aspect,attributes:[z5({content:z.value,groupKey:typeof z.groupKey==="string"?z.groupKey:void 0,claimKey:typeof z.claimKey==="string"?z.claimKey:void 0,confidence:typeof z.confidence==="number"?z.confidence:void 0,importance:typeof z.importance==="number"?z.importance:void 0})]};return z})}}function N7(Z,X={}){return z5({content:Z,type:X.type,importance:X.importance,tags:$z(X.tags),who:X.who,pinned:X.pinned===!0?!0:void 0,sourceType:X.sourceType,sourceId:X.sourceId,sourcePath:X.sourcePath,createdAt:X.createdAt,occurredAt:X.occurredAt,observedAt:X.observedAt,validFrom:X.validFrom,validUntil:X.validUntil,sourceCreatedAt:X.sourceCreatedAt,hints:X.hints,transcript:X.transcript,structured:Bz(X.structured),agentId:X.agentId,visibility:X.visibility,mode:X.mode,idempotencyKey:X.idempotencyKey,runtimePath:X.runtimePath,harness:X.harness,source:X.source})}var K7="unicode61";function qz(Z){return Z.replace(/\\s+/g," ").trim().toLowerCase()}function j7(Z){Z.exec(\`
22244
22244
  CREATE VIRTUAL TABLE IF NOT EXISTS memories_fts USING fts5(
@@ -22260,7 +22260,7 @@ $&\`).replace(/(?:^|\\n)([\\t ].*)(?:([\\n\\t ]*)\\n(?![\\n\\t ]))?/g,"$1$2").re
22260
22260
  INSERT INTO memories_fts(memories_fts, rowid, content) VALUES('delete', old.rowid, old.content);
22261
22261
  INSERT INTO memories_fts(rowid, content) VALUES (new.rowid, new.content);
22262
22262
  END;
22263
- \`)}function Mz(Z){Z.exec("DROP TRIGGER IF EXISTS memories_ai"),Z.exec("DROP TRIGGER IF EXISTS memories_ad"),Z.exec("DROP TRIGGER IF EXISTS memories_au"),Z.exec("DROP TABLE IF EXISTS memories_fts"),j7(Z),Z.exec("INSERT INTO memories_fts(rowid, content) SELECT rowid, content FROM memories")}function Az(Z){let X=Z.prepare("SELECT sql FROM sqlite_master WHERE name = 'memories_fts' AND type = 'table'").get();return typeof X?.sql==="string"?X.sql:null}function Lz(Z){if(Z===null)return!1;let X=qz(Z);if(X.includes("porter unicode61"))return!0;return!X.includes(\`tokenize='\${K7}'\`)}function Dz(Z){Z.exec(\`
22263
+ \`)}function Mz(Z){Z.exec("DROP TRIGGER IF EXISTS memories_ai"),Z.exec("DROP TRIGGER IF EXISTS memories_ad"),Z.exec("DROP TRIGGER IF EXISTS memories_au"),Z.exec("DROP TABLE IF EXISTS memories_fts"),j7(Z),Z.exec("INSERT INTO memories_fts(rowid, content) SELECT rowid, content FROM memories")}function Az(Z){let X=Z.prepare("SELECT sql FROM sqlite_master WHERE name = 'memories_fts' AND type = 'table'").get();return typeof X?.sql==="string"?X.sql:null}function Dz(Z){if(Z===null)return!1;let X=qz(Z);if(X.includes("porter unicode61"))return!0;return!X.includes(\`tokenize='\${K7}'\`)}function Lz(Z){Z.exec(\`
22264
22264
  CREATE TABLE IF NOT EXISTS schema_migrations (
22265
22265
  version INTEGER PRIMARY KEY,
22266
22266
  applied_at TEXT NOT NULL,
@@ -23472,7 +23472,7 @@ $&\`).replace(/(?:^|\\n)([\\t ].*)(?:([\\n\\t ]*)\\n(?![\\n\\t ]))?/g,"$1$2").re
23472
23472
  sample = excluded.sample,
23473
23473
  updated_at = excluded.updated_at
23474
23474
  WHERE excluded.latest_at >= memory_thread_heads.latest_at;
23475
- \`)}function L$(Z){Z.exec(\`
23475
+ \`)}function D$(Z){Z.exec(\`
23476
23476
  CREATE TABLE IF NOT EXISTS session_extract_cursors (
23477
23477
  session_key TEXT NOT NULL,
23478
23478
  agent_id TEXT NOT NULL DEFAULT 'default',
@@ -23480,7 +23480,7 @@ $&\`).replace(/(?:^|\\n)([\\t ].*)(?:([\\n\\t ]*)\\n(?![\\n\\t ]))?/g,"$1$2").re
23480
23480
  last_extract_at TEXT NOT NULL,
23481
23481
  PRIMARY KEY (session_key, agent_id)
23482
23482
  );
23483
- \`)}function D$(Z,X){return Z.prepare(\`SELECT name
23483
+ \`)}function L$(Z,X){return Z.prepare(\`SELECT name
23484
23484
  FROM sqlite_master
23485
23485
  WHERE type = 'table' AND name = ?
23486
23486
  LIMIT 1\`).get(X)!==void 0}function O$(Z){if(Z.exec(\`
@@ -23505,7 +23505,7 @@ $&\`).replace(/(?:^|\\n)([\\t ].*)(?:([\\n\\t ]*)\\n(?![\\n\\t ]))?/g,"$1$2").re
23505
23505
  ON entity_dependency_history(agent_id);
23506
23506
  CREATE INDEX IF NOT EXISTS idx_entity_dependency_history_created
23507
23507
  ON entity_dependency_history(created_at DESC);
23508
- \`),!D$(Z,"entity_dependencies"))return;Z.exec("DROP TRIGGER IF EXISTS trg_entity_dependencies_related_to_reason_insert"),Z.exec("DROP TRIGGER IF EXISTS trg_entity_dependencies_related_to_reason_update"),Z.exec("DROP TRIGGER IF EXISTS trg_entity_dependencies_audit_insert"),Z.exec("DROP TRIGGER IF EXISTS trg_entity_dependencies_audit_update"),Z.exec("DROP TRIGGER IF EXISTS trg_entity_dependencies_audit_delete"),Z.exec(\`
23508
+ \`),!L$(Z,"entity_dependencies"))return;Z.exec("DROP TRIGGER IF EXISTS trg_entity_dependencies_related_to_reason_insert"),Z.exec("DROP TRIGGER IF EXISTS trg_entity_dependencies_related_to_reason_update"),Z.exec("DROP TRIGGER IF EXISTS trg_entity_dependencies_audit_insert"),Z.exec("DROP TRIGGER IF EXISTS trg_entity_dependencies_audit_update"),Z.exec("DROP TRIGGER IF EXISTS trg_entity_dependencies_audit_delete"),Z.exec(\`
23509
23509
  CREATE TRIGGER trg_entity_dependencies_related_to_reason_insert
23510
23510
  BEFORE INSERT ON entity_dependencies
23511
23511
  FOR EACH ROW
@@ -23801,7 +23801,7 @@ $&\`).replace(/(?:^|\\n)([\\t ].*)(?:([\\n\\t ]*)\\n(?![\\n\\t ]))?/g,"$1$2").re
23801
23801
  COALESCE(scope, '__NULL__')
23802
23802
  )
23803
23803
  WHERE content_hash IS NOT NULL AND is_deleted = 0
23804
- \`)}function E$(Z){let X=Az(Z);if(X!==null&&!Lz(X))return;Mz(Z)}function I$(Z){Z.exec(\`CREATE INDEX IF NOT EXISTS idx_entities_order
23804
+ \`)}function E$(Z){let X=Az(Z);if(X!==null&&!Dz(X))return;Mz(Z)}function I$(Z){Z.exec(\`CREATE INDEX IF NOT EXISTS idx_entities_order
23805
23805
  ON entities(agent_id, pinned DESC, pinned_at DESC, mentions DESC, updated_at DESC, name)\`),Z.exec(\`CREATE INDEX IF NOT EXISTS idx_entities_extracted_mentions
23806
23806
  ON entities(entity_type, mentions)
23807
23807
  WHERE entity_type = 'extracted'\`)}function T$(Z){if(!Z.prepare("PRAGMA table_info(entity_attributes)").all().some((z)=>z.name==="claim_key"))Z.exec("ALTER TABLE entity_attributes ADD COLUMN claim_key TEXT");Z.exec(\`CREATE INDEX IF NOT EXISTS idx_entity_attributes_claim_key
@@ -24303,23 +24303,23 @@ $&\`).replace(/(?:^|\\n)([\\t ].*)(?:([\\n\\t ]*)\\n(?![\\n\\t ]))?/g,"$1$2").re
24303
24303
  \`)}function GQ(Z,X,z,W){if(Z.prepare(\`PRAGMA table_info(\${X})\`).all().some((q)=>q.name===z))return;Z.exec(\`ALTER TABLE \${X} ADD COLUMN \${z} \${W}\`)}function qQ(Z){GQ(Z,"summary_jobs","boundary_reason","TEXT"),Z.exec(\`
24304
24304
  CREATE INDEX IF NOT EXISTS idx_summary_jobs_boundary_reason
24305
24305
  ON summary_jobs(agent_id, session_key, boundary_reason)
24306
- \`)}var o5=[{version:1,name:"baseline",up:Dz,artifacts:{tables:["memories","conversations","embeddings"]}},{version:2,name:"pipeline-v2",up:Fz,artifacts:{tables:["memory_history","memory_jobs","entities","relations","memory_entity_mentions"]}},{version:3,name:"unique-content-hash",up:Nz},{version:4,name:"history-actor-and-retention",up:jz,artifacts:{columns:[{table:"memory_history",column:"actor_type"}]}},{version:5,name:"graph-extended",up:Sz,artifacts:{columns:[{table:"entities",column:"canonical_name"}]}},{version:6,name:"idempotency-key",up:Cz,artifacts:{columns:[{table:"memories",column:"idempotency_key"}]}},{version:7,name:"documents-and-connectors",up:Iz,artifacts:{tables:["documents","document_memories","connectors"]}},{version:8,name:"embeddings-unique-hash",up:Tz},{version:9,name:"summary-jobs",up:Pz,artifacts:{tables:["summary_jobs"]}},{version:10,name:"umap-cache",up:wz,artifacts:{tables:["umap_cache"]}},{version:11,name:"session-scores",up:kz,artifacts:{tables:["session_scores"]}},{version:12,name:"scheduled-tasks",up:fz,artifacts:{tables:["scheduled_tasks","task_runs"]}},{version:13,name:"ingestion-tracking",up:bz,artifacts:{tables:["ingestion_jobs"],columns:[{table:"memories",column:"source_path"},{table:"memories",column:"source_section"}]}},{version:14,name:"telemetry",up:xz,artifacts:{tables:["telemetry_events"]}},{version:15,name:"session-memories",up:gz,artifacts:{tables:["session_memories"],columns:[{table:"session_scores",column:"confidence"},{table:"session_scores",column:"continuity_reasoning"}]}},{version:16,name:"session-checkpoints",up:hz,artifacts:{tables:["session_checkpoints"]}},{version:17,name:"task-skills",up:vz,artifacts:{columns:[{table:"scheduled_tasks",column:"skill_name"}]}},{version:18,name:"skill-meta",up:yz,artifacts:{tables:["skill_meta"]}},{version:19,name:"knowledge-structure",up:mz,artifacts:{tables:["entity_aspects","entity_attributes","entity_dependencies","task_meta"],columns:[{table:"entities",column:"agent_id"}]}},{version:20,name:"session-structural-columns",up:uz,artifacts:{columns:[{table:"session_memories",column:"entity_slot"},{table:"session_memories",column:"aspect_slot"},{table:"session_memories",column:"is_constraint"},{table:"session_memories",column:"structural_density"}]}},{version:21,name:"checkpoint-structural",up:cz,artifacts:{columns:[{table:"session_checkpoints",column:"focal_entity_ids"}]}},{version:22,name:"entity-pinning",up:dz,artifacts:{columns:[{table:"entities",column:"pinned"},{table:"entities",column:"pinned_at"}]}},{version:23,name:"retired-scorer-gap",up:pz},{version:24,name:"retired-scorer-gap",up:lz},{version:25,name:"agent-feedback",up:nz,artifacts:{columns:[{table:"session_memories",column:"agent_relevance_score"}]}},{version:26,name:"retired-scorer-gap",up:iz},{version:27,name:"backfill-canonical-names",up:oz},{version:28,name:"lossless-retention",up:sz},{version:29,name:"session-summary-dag",up:az},{version:30,name:"nullable-memory-job-memory-id",up:rz},{version:31,name:"dependency-reason",up:tz,artifacts:{columns:[{table:"entity_dependencies",column:"reason"},{table:"entities",column:"last_synthesized_at"}]}},{version:32,name:"embeddings-vector-column",up:ez,artifacts:{columns:[{table:"embeddings",column:"vector",optional:!0}]}},{version:33,name:"scope",up:Z$,artifacts:{columns:[{table:"memories",column:"scope"}]}},{version:34,name:"scope-aware-dedup",up:X$},{version:35,name:"entity-fts",up:z$},{version:36,name:"dependency-confidence",up:$$,artifacts:{columns:[{table:"entity_dependencies",column:"confidence"}]}},{version:37,name:"entity-communities",up:Q$,artifacts:{tables:["entity_communities"],columns:[{table:"entities",column:"community_id"}]}},{version:38,name:"memory-hints",up:W$,artifacts:{tables:["memory_hints"]}},{version:39,name:"dedup-entity-dependencies",up:H$},{version:40,name:"session-transcripts",up:J$,artifacts:{tables:["session_transcripts"]}},{version:41,name:"path-feedback",up:V$,artifacts:{tables:["path_feedback_events","path_feedback_stats","entity_retrieval_stats","entity_cooccurrence","path_feedback_sessions"],columns:[{table:"session_memories",column:"path_json"}]}},{version:42,name:"session-memories-agent-id",up:_$,artifacts:{columns:[{table:"session_memories",column:"agent_id"}]}},{version:43,name:"agents-table",up:B$,artifacts:{tables:["agents"],columns:[{table:"memories",column:"agent_id"},{table:"memories",column:"visibility"}]}},{version:44,name:"memory-md-temporal-head",up:U$,artifacts:{columns:[{table:"session_summaries",column:"source_type"},{table:"session_summaries",column:"source_ref"},{table:"session_summaries",column:"meta_json"}]}},{version:45,name:"lossless-working-memory-hardening",up:G$,artifacts:{tables:["session_transcripts_fts","memory_md_heads"],columns:[{table:"session_transcripts",column:"updated_at"},{table:"summary_jobs",column:"agent_id"},{table:"session_scores",column:"agent_id"}]}},{version:46,name:"session-summary-uniqueness",up:q$},{version:47,name:"agent-scoped-temporal-uniqueness",up:M$},{version:48,name:"thread-heads",up:A$,artifacts:{tables:["memory_thread_heads"]}},{version:49,name:"session-extract-cursors",up:L$,artifacts:{tables:["session_extract_cursors"]}},{version:50,name:"related-to-audit",up:O$,artifacts:{tables:["entity_dependency_history"]}},{version:51,name:"memory-md-rolling-window-lineage",up:F$,artifacts:{tables:["memory_artifacts","memory_artifact_tombstones","memory_artifacts_fts"],columns:[{table:"summary_jobs",column:"session_id"},{table:"summary_jobs",column:"trigger"},{table:"summary_jobs",column:"captured_at"},{table:"summary_jobs",column:"started_at"},{table:"summary_jobs",column:"ended_at"}]}},{version:52,name:"mcp-invocations",up:N$,artifacts:{tables:["mcp_invocations"]}},{version:53,name:"skill-invocations",up:K$,artifacts:{tables:["skill_invocations"]}},{version:54,name:"task-agent-scope",up:j$,artifacts:{tables:["task_scope_hints"]}},{version:55,name:"dreaming-state",up:R$,artifacts:{tables:["dreaming_state","dreaming_passes"]}},{version:56,name:"agent-scoped-content-hash",up:C$},{version:57,name:"memories-fts-tokenizer-repair",up:E$},{version:58,name:"knowledge-graph-indices",up:I$},{version:59,name:"entity-attribute-claim-key",up:T$,artifacts:{columns:[{table:"entity_attributes",column:"claim_key"}]}},{version:60,name:"entity-attribute-group-key",up:P$,artifacts:{columns:[{table:"entity_attributes",column:"group_key"}]}},{version:61,name:"memory-artifact-source-mtime",up:w$,artifacts:{columns:[{table:"memory_artifacts",column:"source_mtime_ms"}]}},{version:62,name:"memory-artifact-soft-delete",up:k$,artifacts:{columns:[{table:"memory_artifacts",column:"is_deleted"},{table:"memory_artifacts",column:"deleted_at"}]}},{version:63,name:"content-only-memories-fts-update",up:f$},{version:64,name:"source-graph-provenance",up:x$,artifacts:{columns:[{table:"entities",column:"source_path"},{table:"entity_communities",column:"source_path"},{table:"entity_attributes",column:"source_path"},{table:"entity_dependencies",column:"source_path"}]}},{version:65,name:"source-embedding-agent-scope",up:v$,artifacts:{columns:[{table:"embeddings",column:"agent_id",optional:!0}]}},{version:66,name:"memory-search-telemetry",up:y$,artifacts:{tables:["memory_search_telemetry"]}},{version:67,name:"ontology-proposals",up:u$,artifacts:{tables:["ontology_proposals"],columns:[{table:"entity_attributes",column:"proposal_id"},{table:"entity_attributes",column:"proposal_evidence"},{table:"entity_dependencies",column:"proposal_id"},{table:"entity_dependencies",column:"proposal_evidence"}]}},{version:68,name:"daily-reflections",up:c$,artifacts:{tables:["daily_reflections"]}},{version:69,name:"daily-reflections-multiple-insights",up:d$,artifacts:{tables:["daily_reflections"]}},{version:70,name:"ontology-control-plane-state",up:n$,artifacts:{columns:[{table:"entities",column:"status"},{table:"entity_aspects",column:"status"},{table:"entity_attributes",column:"version"},{table:"entity_attributes",column:"version_root_id"},{table:"entity_attributes",column:"previous_attribute_id"},{table:"entity_dependencies",column:"status"}]}},{version:71,name:"epistemic-assertions",up:i$,artifacts:{tables:["epistemic_assertions"]}},{version:72,name:"agent-scoped-idempotency-key",up:s$,artifacts:{columns:[{table:"memories",column:"idempotency_key"},{table:"memories",column:"runtime_path"}]}},{version:73,name:"recall-context-dedupe",up:a$,artifacts:{tables:["session_context_epochs","session_recall_events"]}},{version:74,name:"aggregate-memory-links",up:r$,artifacts:{tables:["aggregate_memory_sources"]}},{version:75,name:"memory-artifact-source-provenance",up:t$,artifacts:{columns:[{table:"memory_artifacts",column:"source_id"},{table:"memory_artifacts",column:"source_root"},{table:"memory_artifacts",column:"source_external_id"},{table:"memory_artifacts",column:"source_parent_path"},{table:"memory_artifacts",column:"source_meta_json"}]}},{version:76,name:"temporal-edges",up:e$,artifacts:{tables:["temporal_edges"]}},{version:77,name:"entity-aliases",up:ZQ,artifacts:{tables:["entity_aliases"]}},{version:78,name:"api-keys",up:XQ,artifacts:{tables:["api_keys"]}},{version:79,name:"transcript-capture-jobs",up:R7,artifacts:{tables:["transcript_capture_jobs"]}},{version:80,name:"document-scope-columns",up:S7,artifacts:{columns:[{table:"documents",column:"agent_id"},{table:"documents",column:"project"}]}},{version:81,name:"aggregate-evidence-sources",up:C7,artifacts:{tables:["aggregate_evidence_sources"]}},{version:82,name:"skill-invocations-harness",up:QQ,artifacts:{columns:[{table:"skill_invocations",column:"harness"},{table:"skill_invocations",column:"tool_use_id"}]}},{version:83,name:"memory-lifecycle-repair",up:YQ,artifacts:{tables:["transcript_capture_jobs","aggregate_evidence_sources","entity_dependencies"],columns:[{table:"documents",column:"agent_id"},{table:"documents",column:"project"},{table:"memories",column:"superseded_by"},{table:"memories",column:"superseded_at"},{table:"memories",column:"superseded_reason"}]}},{version:84,name:"legacy-markdown-import-state",up:VQ,artifacts:{tables:["legacy_markdown_imports","legacy_markdown_chunks"]}},{version:85,name:"backfill-relations-to-dependencies",up:_Q,artifacts:{tables:["entity_dependencies"]}},{version:86,name:"summary-jobs-content-hash",up:UQ,artifacts:{columns:[{table:"summary_jobs",column:"content_hash"}]}},{version:87,name:"summary-jobs-boundary-reason",up:qQ,artifacts:{columns:[{table:"summary_jobs",column:"boundary_reason"}]}}];var zY=o5[o5.length-1]?.version??0;var MQ=Gz(import.meta.url),$Y=Uz(MQ);var QY=r5(O7(),1);var AQ=r5(O7(),1);function E7(Z){try{let X=AQ.default.parse(Z);return typeof X==="object"&&X!==null?X:{}}catch{return{}}}var DQ=null;try{DQ=LQ(import.meta.url)("@signet/native")}catch{}var I7="signetai";var OQ=["skills","tools","dreaming"],HY=[".daemon",".shadow","node_modules",":(glob)**/node_modules/**",\`\${I7}\`,"memory/backups","memory/memories.db",":(glob)memory/memories.db*",":(glob)memory/**/*.db",":(glob)memory/**/*.db-*",":(glob)memory/**/*.db-journal",":(glob)memory/**/*.db-shm",":(glob)memory/**/*.db-wal",":(glob)memory/**/*.sqlite",":(glob)memory/**/*.sqlite3",":(glob)**/*.db",":(glob)**/*.db-*",":(glob)**/*.db-journal",":(glob)**/*.db-shm",":(glob)**/*.db-wal",":(glob)**/*.sqlite",":(glob)**/*.sqlite3"],JY=["*.md",":(glob)**/*.md","*.json",":(glob)**/*.json","*.jsonl",":(glob)**/*.jsonl","*.html",":(glob)**/*.html","*.yaml",":(glob)**/*.yaml","*.yml",":(glob)**/*.yml",...OQ];var YY=[".daemon/",".shadow/","node_modules/",\`\${I7}/\`,"memory/memories.db*","memory/**/*.db","memory/**/*.db-*","memory/**/*.db-journal","memory/**/*.db-shm","memory/**/*.db-wal","memory/**/*.sqlite","memory/**/*.sqlite3","memory/backups/","*.db","*.db-*","*.db-journal","*.db-shm","*.db-wal","*.sqlite","*.sqlite3"];var GY=KQ(),NQ=["issues","pulls","discussions","docs"];var qY=new Set(NQ);function KQ(){switch(FQ()){case"darwin":return L8(l6(),"Library","Application Support","discord");case"win32":return L8(process.env.APPDATA||L8(l6(),"AppData","Roaming"),"discord");default:return L8(process.env.XDG_CONFIG_HOME||L8(l6(),".config"),"discord")}}function T7(Z,X){let z=Z[X];if(typeof z!=="string")return null;let W=z.trim();return W.length>0?W:null}function CQ(Z){let X=Z.trim();if(X==="~")return D8();if(X.startsWith("~/"))return O8(D8(),X.slice(2));if(X.startsWith("~"))return O8(D8(),X.slice(1));return X}function H5(Z){return SQ(CQ(Z))}function EQ(Z){let X=T7(Z,"XDG_CONFIG_HOME");return X?H5(X):O8(D8(),".config")}function IQ(Z=process.env){return O8(EQ(Z),"signet","pi.json")}function TQ(Z=process.env){let X=IQ(Z);if(!jQ(X))return null;try{let z=JSON.parse(RQ(X,"utf-8"));if(typeof z!=="object"||z===null)return null;let W=Reflect.get(z,"agentDir");return typeof W==="string"&&W.trim().length>0?H5(W):null}catch{return null}}function P7(Z=process.env){let X=T7(Z,"PI_CODING_AGENT_DIR");if(X)return H5(X);return TQ(Z)??O8(D8(),".pi","agent")}var PQ=["managed","passthrough","off"],w7={agents:{path:"AGENTS.md",description:"Operational rules and behavioral settings",optional:!1},soul:{path:"SOUL.md",description:"Persona, character, and security settings",optional:!1},identity:{path:"IDENTITY.md",description:"Agent name, creature type, and vibe",optional:!1},user:{path:"USER.md",description:"User profile and preferences",optional:!1},heartbeat:{path:"HEARTBEAT.md",description:"Heartbeat prompt used only for heartbeat/background check sessions",optional:!0,context:"session",session:"heartbeat"},memory:{path:"MEMORY.md",description:"Memory index and summary",optional:!0},tools:{path:"TOOLS.md",description:"Tool preferences and notes",optional:!0},bootstrap:{path:"BOOTSTRAP.md",description:"Setup ritual (typically deleted after first run)",optional:!0,context:"session",session:"bootstrap"},dreaming:{path:"DREAMING.md",description:"Dreaming/reflection prompt used only for dreaming sessions",optional:!0,context:"session",session:"dreaming"}},wQ={minimal:{name:"minimal",description:"AGENTS.md only for normal startup, plus DREAMING.md for dreaming sessions.",startup:[{path:"AGENTS.md",role:"operating_instructions",budget:12000}],special:[{path:"DREAMING.md",kind:"dreaming",role:"dreaming_prompt",budget:4000}]},hermes:{name:"hermes",description:"Hermes-style SOUL.md primary identity with project-context discovery handled by Hermes.",startup:[{path:"SOUL.md",role:"primary_identity",budget:4000},{path:"AGENTS.md",role:"project_context",budget:12000}],special:[{path:"DREAMING.md",kind:"dreaming",role:"dreaming_prompt",budget:4000}]},openclaw:{name:"openclaw",description:"OpenClaw-style rich identity stack for character-forward agents.",startup:[{path:"AGENTS.md",role:"operating_instructions",budget:12000},{path:"SOUL.md",role:"persona",budget:4000},{path:"IDENTITY.md",role:"agent_identity",budget:2000},{path:"USER.md",role:"user_profile",budget:6000},{path:"MEMORY.md",role:"working_memory",budget:1e4}],special:[{path:"HEARTBEAT.md",kind:"heartbeat",role:"heartbeat_prompt",budget:4000},{path:"DREAMING.md",kind:"dreaming",role:"dreaming_prompt",budget:4000},{path:"BOOTSTRAP.md",kind:"bootstrap",role:"bootstrap_prompt",budget:4000}]},custom:{name:"custom",description:"User-selected startup files and explicit order.",startup:[{path:"AGENTS.md",role:"operating_instructions",budget:12000}],special:[{path:"DREAMING.md",kind:"dreaming",role:"dreaming_prompt",budget:4000}]}},IY=Object.entries(w7).filter(([,Z])=>!Z.optional).map(([Z])=>Z),TY=Object.entries(w7).filter(([,Z])=>Z.optional).map(([Z])=>Z);var i6=[{file:"AGENTS.md",header:"Agent Instructions",budget:12000},{file:"SOUL.md",header:"Soul",budget:4000},{file:"IDENTITY.md",header:"Identity",budget:2000},{file:"USER.md",header:"About Your User",budget:6000},{file:"MEMORY.md",header:"Working Memory",budget:1e4}],kQ={"AGENTS.md":"Agent Instructions","SOUL.md":"Soul","IDENTITY.md":"Identity","USER.md":"About Your User","MEMORY.md":"Working Memory"};function s5(Z){let X=Z.trim();if(!X)return!1;if(X.startsWith("/")||X.startsWith("~"))return!1;return!X.split(/[\\\\/]/).includes("..")}function fZ(Z){return typeof Z==="object"&&Z!==null&&!Array.isArray(Z)?Z:{}}function a5(Z){return typeof Z==="string"&&PQ.includes(Z)}function k7(Z){let X=fZ(Z),z=fZ(X.capabilities),W=fZ(z.identity);if(a5(W.mode))return W.mode;let Y=fZ(X.identity);if(a5(Y.mode))return Y.mode;if(Y.enabled===!1)return"off";return"managed"}function fQ(Z){let X=W5(Z,"agent.yaml");if(!s8(X))return"managed";try{return k7(E7(Q5(X,"utf-8")))}catch{return"managed"}}function f7(Z){return Z!=="off"}function bQ(Z){if(typeof Z==="string")return s5(Z)?{path:Z}:null;let X=fZ(Z),z=typeof X.path==="string"?X.path.trim():"";if(!s5(z))return null;if(X.enabled===!1)return null;let W=typeof X.role==="string"?X.role:void 0,Y=typeof X.budget==="number"?X.budget:Number.parseInt(String(X.budget??""),10),q=Number.isFinite(Y)&&Y>0?Math.floor(Y):void 0;return{path:z,role:W,budget:q}}function xQ(Z){if(!Array.isArray(Z))return[];return Z.map(bQ).filter((X)=>X!==null)}function gQ(Z,X){let z=Z.split(/[\\\\/]/).pop()??Z;return kQ[z]??X??z.replace(/\\.md$/i,"")}function hQ(Z){let X=W5(Z,"agent.yaml");if(!s8(X))return i6.map(({file:z,budget:W})=>({path:z,budget:W}));try{let z=E7(Q5(X,"utf-8"));if(!f7(k7(z)))return[];let W=fZ(z.identity),Y=fZ(W.startup),q=xQ(Y.load);if(q.length>0)return q;let B=typeof W.preset==="string"?W.preset:"",U=wQ[B];if(U)return U.startup}catch{}return i6.map(({file:z,budget:W})=>({path:z,budget:W}))}var vQ="[signet: daemon offline — running with static identity]";function b7(Z,X=vQ){if(!s8(Z))return null;if(!f7(fQ(Z)))return null;let z=[];for(let W of hQ(Z)){let Y=W5(Z,W.path);if(!s8(Y))continue;try{let q=Q5(Y,"utf-8").trim();if(!q)continue;let B=W.budget??i6.find((G)=>G.file===W.path)?.budget??4000,U=q.length<=B?q:\`\${q.slice(0,B)}
24306
+ \`)}var o5=[{version:1,name:"baseline",up:Lz,artifacts:{tables:["memories","conversations","embeddings"]}},{version:2,name:"pipeline-v2",up:Fz,artifacts:{tables:["memory_history","memory_jobs","entities","relations","memory_entity_mentions"]}},{version:3,name:"unique-content-hash",up:Nz},{version:4,name:"history-actor-and-retention",up:jz,artifacts:{columns:[{table:"memory_history",column:"actor_type"}]}},{version:5,name:"graph-extended",up:Sz,artifacts:{columns:[{table:"entities",column:"canonical_name"}]}},{version:6,name:"idempotency-key",up:Cz,artifacts:{columns:[{table:"memories",column:"idempotency_key"}]}},{version:7,name:"documents-and-connectors",up:Iz,artifacts:{tables:["documents","document_memories","connectors"]}},{version:8,name:"embeddings-unique-hash",up:Tz},{version:9,name:"summary-jobs",up:Pz,artifacts:{tables:["summary_jobs"]}},{version:10,name:"umap-cache",up:wz,artifacts:{tables:["umap_cache"]}},{version:11,name:"session-scores",up:kz,artifacts:{tables:["session_scores"]}},{version:12,name:"scheduled-tasks",up:fz,artifacts:{tables:["scheduled_tasks","task_runs"]}},{version:13,name:"ingestion-tracking",up:bz,artifacts:{tables:["ingestion_jobs"],columns:[{table:"memories",column:"source_path"},{table:"memories",column:"source_section"}]}},{version:14,name:"telemetry",up:xz,artifacts:{tables:["telemetry_events"]}},{version:15,name:"session-memories",up:gz,artifacts:{tables:["session_memories"],columns:[{table:"session_scores",column:"confidence"},{table:"session_scores",column:"continuity_reasoning"}]}},{version:16,name:"session-checkpoints",up:hz,artifacts:{tables:["session_checkpoints"]}},{version:17,name:"task-skills",up:vz,artifacts:{columns:[{table:"scheduled_tasks",column:"skill_name"}]}},{version:18,name:"skill-meta",up:yz,artifacts:{tables:["skill_meta"]}},{version:19,name:"knowledge-structure",up:mz,artifacts:{tables:["entity_aspects","entity_attributes","entity_dependencies","task_meta"],columns:[{table:"entities",column:"agent_id"}]}},{version:20,name:"session-structural-columns",up:uz,artifacts:{columns:[{table:"session_memories",column:"entity_slot"},{table:"session_memories",column:"aspect_slot"},{table:"session_memories",column:"is_constraint"},{table:"session_memories",column:"structural_density"}]}},{version:21,name:"checkpoint-structural",up:cz,artifacts:{columns:[{table:"session_checkpoints",column:"focal_entity_ids"}]}},{version:22,name:"entity-pinning",up:dz,artifacts:{columns:[{table:"entities",column:"pinned"},{table:"entities",column:"pinned_at"}]}},{version:23,name:"retired-scorer-gap",up:pz},{version:24,name:"retired-scorer-gap",up:lz},{version:25,name:"agent-feedback",up:nz,artifacts:{columns:[{table:"session_memories",column:"agent_relevance_score"}]}},{version:26,name:"retired-scorer-gap",up:iz},{version:27,name:"backfill-canonical-names",up:oz},{version:28,name:"lossless-retention",up:sz},{version:29,name:"session-summary-dag",up:az},{version:30,name:"nullable-memory-job-memory-id",up:rz},{version:31,name:"dependency-reason",up:tz,artifacts:{columns:[{table:"entity_dependencies",column:"reason"},{table:"entities",column:"last_synthesized_at"}]}},{version:32,name:"embeddings-vector-column",up:ez,artifacts:{columns:[{table:"embeddings",column:"vector",optional:!0}]}},{version:33,name:"scope",up:Z$,artifacts:{columns:[{table:"memories",column:"scope"}]}},{version:34,name:"scope-aware-dedup",up:X$},{version:35,name:"entity-fts",up:z$},{version:36,name:"dependency-confidence",up:$$,artifacts:{columns:[{table:"entity_dependencies",column:"confidence"}]}},{version:37,name:"entity-communities",up:Q$,artifacts:{tables:["entity_communities"],columns:[{table:"entities",column:"community_id"}]}},{version:38,name:"memory-hints",up:W$,artifacts:{tables:["memory_hints"]}},{version:39,name:"dedup-entity-dependencies",up:H$},{version:40,name:"session-transcripts",up:J$,artifacts:{tables:["session_transcripts"]}},{version:41,name:"path-feedback",up:V$,artifacts:{tables:["path_feedback_events","path_feedback_stats","entity_retrieval_stats","entity_cooccurrence","path_feedback_sessions"],columns:[{table:"session_memories",column:"path_json"}]}},{version:42,name:"session-memories-agent-id",up:_$,artifacts:{columns:[{table:"session_memories",column:"agent_id"}]}},{version:43,name:"agents-table",up:B$,artifacts:{tables:["agents"],columns:[{table:"memories",column:"agent_id"},{table:"memories",column:"visibility"}]}},{version:44,name:"memory-md-temporal-head",up:U$,artifacts:{columns:[{table:"session_summaries",column:"source_type"},{table:"session_summaries",column:"source_ref"},{table:"session_summaries",column:"meta_json"}]}},{version:45,name:"lossless-working-memory-hardening",up:G$,artifacts:{tables:["session_transcripts_fts","memory_md_heads"],columns:[{table:"session_transcripts",column:"updated_at"},{table:"summary_jobs",column:"agent_id"},{table:"session_scores",column:"agent_id"}]}},{version:46,name:"session-summary-uniqueness",up:q$},{version:47,name:"agent-scoped-temporal-uniqueness",up:M$},{version:48,name:"thread-heads",up:A$,artifacts:{tables:["memory_thread_heads"]}},{version:49,name:"session-extract-cursors",up:D$,artifacts:{tables:["session_extract_cursors"]}},{version:50,name:"related-to-audit",up:O$,artifacts:{tables:["entity_dependency_history"]}},{version:51,name:"memory-md-rolling-window-lineage",up:F$,artifacts:{tables:["memory_artifacts","memory_artifact_tombstones","memory_artifacts_fts"],columns:[{table:"summary_jobs",column:"session_id"},{table:"summary_jobs",column:"trigger"},{table:"summary_jobs",column:"captured_at"},{table:"summary_jobs",column:"started_at"},{table:"summary_jobs",column:"ended_at"}]}},{version:52,name:"mcp-invocations",up:N$,artifacts:{tables:["mcp_invocations"]}},{version:53,name:"skill-invocations",up:K$,artifacts:{tables:["skill_invocations"]}},{version:54,name:"task-agent-scope",up:j$,artifacts:{tables:["task_scope_hints"]}},{version:55,name:"dreaming-state",up:R$,artifacts:{tables:["dreaming_state","dreaming_passes"]}},{version:56,name:"agent-scoped-content-hash",up:C$},{version:57,name:"memories-fts-tokenizer-repair",up:E$},{version:58,name:"knowledge-graph-indices",up:I$},{version:59,name:"entity-attribute-claim-key",up:T$,artifacts:{columns:[{table:"entity_attributes",column:"claim_key"}]}},{version:60,name:"entity-attribute-group-key",up:P$,artifacts:{columns:[{table:"entity_attributes",column:"group_key"}]}},{version:61,name:"memory-artifact-source-mtime",up:w$,artifacts:{columns:[{table:"memory_artifacts",column:"source_mtime_ms"}]}},{version:62,name:"memory-artifact-soft-delete",up:k$,artifacts:{columns:[{table:"memory_artifacts",column:"is_deleted"},{table:"memory_artifacts",column:"deleted_at"}]}},{version:63,name:"content-only-memories-fts-update",up:f$},{version:64,name:"source-graph-provenance",up:x$,artifacts:{columns:[{table:"entities",column:"source_path"},{table:"entity_communities",column:"source_path"},{table:"entity_attributes",column:"source_path"},{table:"entity_dependencies",column:"source_path"}]}},{version:65,name:"source-embedding-agent-scope",up:v$,artifacts:{columns:[{table:"embeddings",column:"agent_id",optional:!0}]}},{version:66,name:"memory-search-telemetry",up:y$,artifacts:{tables:["memory_search_telemetry"]}},{version:67,name:"ontology-proposals",up:u$,artifacts:{tables:["ontology_proposals"],columns:[{table:"entity_attributes",column:"proposal_id"},{table:"entity_attributes",column:"proposal_evidence"},{table:"entity_dependencies",column:"proposal_id"},{table:"entity_dependencies",column:"proposal_evidence"}]}},{version:68,name:"daily-reflections",up:c$,artifacts:{tables:["daily_reflections"]}},{version:69,name:"daily-reflections-multiple-insights",up:d$,artifacts:{tables:["daily_reflections"]}},{version:70,name:"ontology-control-plane-state",up:n$,artifacts:{columns:[{table:"entities",column:"status"},{table:"entity_aspects",column:"status"},{table:"entity_attributes",column:"version"},{table:"entity_attributes",column:"version_root_id"},{table:"entity_attributes",column:"previous_attribute_id"},{table:"entity_dependencies",column:"status"}]}},{version:71,name:"epistemic-assertions",up:i$,artifacts:{tables:["epistemic_assertions"]}},{version:72,name:"agent-scoped-idempotency-key",up:s$,artifacts:{columns:[{table:"memories",column:"idempotency_key"},{table:"memories",column:"runtime_path"}]}},{version:73,name:"recall-context-dedupe",up:a$,artifacts:{tables:["session_context_epochs","session_recall_events"]}},{version:74,name:"aggregate-memory-links",up:r$,artifacts:{tables:["aggregate_memory_sources"]}},{version:75,name:"memory-artifact-source-provenance",up:t$,artifacts:{columns:[{table:"memory_artifacts",column:"source_id"},{table:"memory_artifacts",column:"source_root"},{table:"memory_artifacts",column:"source_external_id"},{table:"memory_artifacts",column:"source_parent_path"},{table:"memory_artifacts",column:"source_meta_json"}]}},{version:76,name:"temporal-edges",up:e$,artifacts:{tables:["temporal_edges"]}},{version:77,name:"entity-aliases",up:ZQ,artifacts:{tables:["entity_aliases"]}},{version:78,name:"api-keys",up:XQ,artifacts:{tables:["api_keys"]}},{version:79,name:"transcript-capture-jobs",up:R7,artifacts:{tables:["transcript_capture_jobs"]}},{version:80,name:"document-scope-columns",up:S7,artifacts:{columns:[{table:"documents",column:"agent_id"},{table:"documents",column:"project"}]}},{version:81,name:"aggregate-evidence-sources",up:C7,artifacts:{tables:["aggregate_evidence_sources"]}},{version:82,name:"skill-invocations-harness",up:QQ,artifacts:{columns:[{table:"skill_invocations",column:"harness"},{table:"skill_invocations",column:"tool_use_id"}]}},{version:83,name:"memory-lifecycle-repair",up:YQ,artifacts:{tables:["transcript_capture_jobs","aggregate_evidence_sources","entity_dependencies"],columns:[{table:"documents",column:"agent_id"},{table:"documents",column:"project"},{table:"memories",column:"superseded_by"},{table:"memories",column:"superseded_at"},{table:"memories",column:"superseded_reason"}]}},{version:84,name:"legacy-markdown-import-state",up:VQ,artifacts:{tables:["legacy_markdown_imports","legacy_markdown_chunks"]}},{version:85,name:"backfill-relations-to-dependencies",up:_Q,artifacts:{tables:["entity_dependencies"]}},{version:86,name:"summary-jobs-content-hash",up:UQ,artifacts:{columns:[{table:"summary_jobs",column:"content_hash"}]}},{version:87,name:"summary-jobs-boundary-reason",up:qQ,artifacts:{columns:[{table:"summary_jobs",column:"boundary_reason"}]}}];var zY=o5[o5.length-1]?.version??0;var MQ=Gz(import.meta.url),$Y=Uz(MQ);var QY=r5(O7(),1);var AQ=r5(O7(),1);function E7(Z){try{let X=AQ.default.parse(Z);return typeof X==="object"&&X!==null?X:{}}catch{return{}}}var LQ=null;try{LQ=DQ(import.meta.url)("@signet/native")}catch{}var I7="signetai";var OQ=["skills","tools","dreaming"],HY=[".daemon",".shadow","node_modules",":(glob)**/node_modules/**",\`\${I7}\`,"memory/backups","memory/memories.db",":(glob)memory/memories.db*",":(glob)memory/**/*.db",":(glob)memory/**/*.db-*",":(glob)memory/**/*.db-journal",":(glob)memory/**/*.db-shm",":(glob)memory/**/*.db-wal",":(glob)memory/**/*.sqlite",":(glob)memory/**/*.sqlite3",":(glob)**/*.db",":(glob)**/*.db-*",":(glob)**/*.db-journal",":(glob)**/*.db-shm",":(glob)**/*.db-wal",":(glob)**/*.sqlite",":(glob)**/*.sqlite3"],JY=["*.md",":(glob)**/*.md","*.json",":(glob)**/*.json","*.jsonl",":(glob)**/*.jsonl","*.html",":(glob)**/*.html","*.yaml",":(glob)**/*.yaml","*.yml",":(glob)**/*.yml",...OQ];var YY=[".daemon/",".shadow/","node_modules/",\`\${I7}/\`,"memory/memories.db*","memory/**/*.db","memory/**/*.db-*","memory/**/*.db-journal","memory/**/*.db-shm","memory/**/*.db-wal","memory/**/*.sqlite","memory/**/*.sqlite3","memory/backups/","*.db","*.db-*","*.db-journal","*.db-shm","*.db-wal","*.sqlite","*.sqlite3"];var GY=KQ(),NQ=["issues","pulls","discussions","docs"];var qY=new Set(NQ);function KQ(){switch(FQ()){case"darwin":return D8(l6(),"Library","Application Support","discord");case"win32":return D8(process.env.APPDATA||D8(l6(),"AppData","Roaming"),"discord");default:return D8(process.env.XDG_CONFIG_HOME||D8(l6(),".config"),"discord")}}function T7(Z,X){let z=Z[X];if(typeof z!=="string")return null;let W=z.trim();return W.length>0?W:null}function CQ(Z){let X=Z.trim();if(X==="~")return L8();if(X.startsWith("~/"))return O8(L8(),X.slice(2));if(X.startsWith("~"))return O8(L8(),X.slice(1));return X}function H5(Z){return SQ(CQ(Z))}function EQ(Z){let X=T7(Z,"XDG_CONFIG_HOME");return X?H5(X):O8(L8(),".config")}function IQ(Z=process.env){return O8(EQ(Z),"signet","pi.json")}function TQ(Z=process.env){let X=IQ(Z);if(!jQ(X))return null;try{let z=JSON.parse(RQ(X,"utf-8"));if(typeof z!=="object"||z===null)return null;let W=Reflect.get(z,"agentDir");return typeof W==="string"&&W.trim().length>0?H5(W):null}catch{return null}}function P7(Z=process.env){let X=T7(Z,"PI_CODING_AGENT_DIR");if(X)return H5(X);return TQ(Z)??O8(L8(),".pi","agent")}var PQ=["managed","passthrough","off"],w7={agents:{path:"AGENTS.md",description:"Operational rules and behavioral settings",optional:!1},soul:{path:"SOUL.md",description:"Persona, character, and security settings",optional:!1},identity:{path:"IDENTITY.md",description:"Agent name, creature type, and vibe",optional:!1},user:{path:"USER.md",description:"User profile and preferences",optional:!1},heartbeat:{path:"HEARTBEAT.md",description:"Heartbeat prompt used only for heartbeat/background check sessions",optional:!0,context:"session",session:"heartbeat"},memory:{path:"MEMORY.md",description:"Memory index and summary",optional:!0},tools:{path:"TOOLS.md",description:"Tool preferences and notes",optional:!0},bootstrap:{path:"BOOTSTRAP.md",description:"Setup ritual (typically deleted after first run)",optional:!0,context:"session",session:"bootstrap"},dreaming:{path:"DREAMING.md",description:"Dreaming/reflection prompt used only for dreaming sessions",optional:!0,context:"session",session:"dreaming"}},wQ={minimal:{name:"minimal",description:"AGENTS.md only for normal startup, plus DREAMING.md for dreaming sessions.",startup:[{path:"AGENTS.md",role:"operating_instructions",budget:12000}],special:[{path:"DREAMING.md",kind:"dreaming",role:"dreaming_prompt",budget:4000}]},hermes:{name:"hermes",description:"Hermes-style SOUL.md primary identity with project-context discovery handled by Hermes.",startup:[{path:"SOUL.md",role:"primary_identity",budget:4000},{path:"AGENTS.md",role:"project_context",budget:12000}],special:[{path:"DREAMING.md",kind:"dreaming",role:"dreaming_prompt",budget:4000}]},openclaw:{name:"openclaw",description:"OpenClaw-style rich identity stack for character-forward agents.",startup:[{path:"AGENTS.md",role:"operating_instructions",budget:12000},{path:"SOUL.md",role:"persona",budget:4000},{path:"IDENTITY.md",role:"agent_identity",budget:2000},{path:"USER.md",role:"user_profile",budget:6000},{path:"MEMORY.md",role:"working_memory",budget:1e4}],special:[{path:"HEARTBEAT.md",kind:"heartbeat",role:"heartbeat_prompt",budget:4000},{path:"DREAMING.md",kind:"dreaming",role:"dreaming_prompt",budget:4000},{path:"BOOTSTRAP.md",kind:"bootstrap",role:"bootstrap_prompt",budget:4000}]},custom:{name:"custom",description:"User-selected startup files and explicit order.",startup:[{path:"AGENTS.md",role:"operating_instructions",budget:12000}],special:[{path:"DREAMING.md",kind:"dreaming",role:"dreaming_prompt",budget:4000}]}},IY=Object.entries(w7).filter(([,Z])=>!Z.optional).map(([Z])=>Z),TY=Object.entries(w7).filter(([,Z])=>Z.optional).map(([Z])=>Z);var i6=[{file:"AGENTS.md",header:"Agent Instructions",budget:12000},{file:"SOUL.md",header:"Soul",budget:4000},{file:"IDENTITY.md",header:"Identity",budget:2000},{file:"USER.md",header:"About Your User",budget:6000},{file:"MEMORY.md",header:"Working Memory",budget:1e4}],kQ={"AGENTS.md":"Agent Instructions","SOUL.md":"Soul","IDENTITY.md":"Identity","USER.md":"About Your User","MEMORY.md":"Working Memory"};function s5(Z){let X=Z.trim();if(!X)return!1;if(X.startsWith("/")||X.startsWith("~"))return!1;return!X.split(/[\\\\/]/).includes("..")}function fZ(Z){return typeof Z==="object"&&Z!==null&&!Array.isArray(Z)?Z:{}}function a5(Z){return typeof Z==="string"&&PQ.includes(Z)}function k7(Z){let X=fZ(Z),z=fZ(X.capabilities),W=fZ(z.identity);if(a5(W.mode))return W.mode;let Y=fZ(X.identity);if(a5(Y.mode))return Y.mode;if(Y.enabled===!1)return"off";return"managed"}function fQ(Z){let X=W5(Z,"agent.yaml");if(!s8(X))return"managed";try{return k7(E7(Q5(X,"utf-8")))}catch{return"managed"}}function f7(Z){return Z!=="off"}function bQ(Z){if(typeof Z==="string")return s5(Z)?{path:Z}:null;let X=fZ(Z),z=typeof X.path==="string"?X.path.trim():"";if(!s5(z))return null;if(X.enabled===!1)return null;let W=typeof X.role==="string"?X.role:void 0,Y=typeof X.budget==="number"?X.budget:Number.parseInt(String(X.budget??""),10),q=Number.isFinite(Y)&&Y>0?Math.floor(Y):void 0;return{path:z,role:W,budget:q}}function xQ(Z){if(!Array.isArray(Z))return[];return Z.map(bQ).filter((X)=>X!==null)}function gQ(Z,X){let z=Z.split(/[\\\\/]/).pop()??Z;return kQ[z]??X??z.replace(/\\.md$/i,"")}function hQ(Z){let X=W5(Z,"agent.yaml");if(!s8(X))return i6.map(({file:z,budget:W})=>({path:z,budget:W}));try{let z=E7(Q5(X,"utf-8"));if(!f7(k7(z)))return[];let W=fZ(z.identity),Y=fZ(W.startup),q=xQ(Y.load);if(q.length>0)return q;let B=typeof W.preset==="string"?W.preset:"",U=wQ[B];if(U)return U.startup}catch{}return i6.map(({file:z,budget:W})=>({path:z,budget:W}))}var vQ="[signet: daemon offline — running with static identity]";function b7(Z,X=vQ){if(!s8(Z))return null;if(!f7(fQ(Z)))return null;let z=[];for(let W of hQ(Z)){let Y=W5(Z,W.path);if(!s8(Y))continue;try{let q=Q5(Y,"utf-8").trim();if(!q)continue;let B=W.budget??i6.find((G)=>G.file===W.path)?.budget??4000,U=q.length<=B?q:\`\${q.slice(0,B)}
24307
24307
  [truncated]\`;z.push(\`## \${gQ(W.path,W.role)}
24308
24308
 
24309
24309
  \${U}\`)}catch{}}if(z.length===0)return null;return\`\${X}
24310
24310
 
24311
24311
  \${z.join(\`
24312
24312
 
24313
- \`)}\`}var wY=yQ();function LZ(Z){return typeof Z==="object"&&Z!==null}function S8(Z){let X=Reflect.get(globalThis,"process");if(!LZ(X))return;let z=Reflect.get(X,"env");if(!LZ(z))return;let W=Reflect.get(z,Z);return typeof W==="string"?W:void 0}function p(Z){if(typeof Z!=="string")return;let X=Z.trim();return X.length>0?X:void 0}function o0(Z){return p(S8(Z))}import{existsSync as mQ,readFileSync as uQ}from"node:fs";function x7(Z){return Z.replace(/\\s*\\r?\\n\\s*/g," ").trim()}function cQ(Z){let X=Z?.trim().toLowerCase();if(!X||["user","human","client"].includes(X))return"User";if(["assistant","agent","model","ai"].includes(X))return"Assistant";if(["system","developer"].includes(X))return"System";if(["custom","tool","toolresult","tool_result","bashexecution","pythonexecution"].includes(X))return X==="custom"?"Custom":"Tool";return}function dQ(Z){if(typeof Z==="string"){let z=x7(Z);return z.length>0?z:void 0}if(!Array.isArray(Z))return;let X=[];for(let z of Z){if(!LZ(z))continue;let W=p(z.text)??p(z.input_text)??p(z.content);if(!W)continue;X.push(x7(W))}if(X.length===0)return;return X.join(" ")}function g7(Z,X){let z=dQ(X),W=cQ(Z);if(!z||!W)return;return\`\${W}: \${z}\`}function pQ(Z,X){if(!LZ(Z)||typeof Z.type!=="string")return;if(Z.type==="custom_message"){if(typeof Z.customType==="string"&&X.has(Z.customType))return;return g7("custom",Z.content)}if(Z.type!=="message")return;if(!LZ(Z.message))return;let z=p(Z.message.role),W=Reflect.get(Z.message,"content")??Reflect.get(Z.message,"parts");return g7(z,W)}function Y6(Z,X=new Set){let z=[];for(let W of Z){let Y=pQ(W,X);if(!Y)continue;z.push(Y)}if(z.length===0)return;return z.join(\`
24314
- \`)}function lQ(Z){try{return JSON.parse(Z)}catch{return}}function nQ(Z){let X,z=[];for(let W of Z){let Y=lQ(W);if(!LZ(Y)||typeof Y.type!=="string")continue;if(Y.type==="session"){X=Y;continue}z.push(Y)}return{header:X,entries:z}}function iQ(Z){return uQ(Z,"utf-8").split(\`
24315
- \`).map((X)=>X.trim()).filter((X)=>X.length>0)}function oQ(Z){return p(Z?.cwd)??p(Z?.project)??p(Z?.workspace)}function V6(Z,X=new Set){if(!Z||!mQ(Z))return{loaded:!1,sessionId:void 0,project:void 0,transcript:void 0};try{let{header:z,entries:W}=nQ(iQ(Z));return{loaded:!0,sessionId:p(z?.id),project:oQ(z),transcript:Y6(W,X)}}catch{return{loaded:!1,sessionId:void 0,project:void 0,transcript:void 0}}}function sQ(){return o0("SIGNET_API_KEY")??o0("SIGNET_TOKEN")}function aQ(Z){let X={"Content-Type":"application/json","x-signet-runtime-path":Z.runtimePath,"x-signet-actor":Z.actorName,"x-signet-actor-type":"harness"},z=sQ();if(z)X.Authorization=\`Bearer \${z}\`;return X}function y7(Z){if(typeof Z!=="object"||Z===null)return"";let X=Reflect.get(Z,"name");return typeof X==="string"?X:""}function h7(Z){let X=y7(Z);if(X==="AbortError"||X==="TimeoutError")return!0;return(typeof Z==="object"&&Z!==null?Reflect.get(Z,"code"):void 0)==="ABORT_ERR"}async function v7(Z,X,z,W={}){let{method:Y="POST",body:q,timeout:B=z.defaultTimeout}=W;try{let U={method:Y,headers:aQ(z),signal:AbortSignal.timeout(B)};if(q!==void 0)U.body=JSON.stringify(q);let G=await fetch(\`\${Z}\${X}\`,U);if(!G.ok)return console.warn(\`[\${z.logPrefix}] \${Y} \${X} failed: \${G.status}\`),{ok:!1,reason:"http",status:G.status};try{let H=await G.text();try{return{ok:!0,data:JSON.parse(H)}}catch{return console.warn(\`[\${z.logPrefix}] \${Y} \${X} returned invalid JSON (\${H.length} chars\${H.length===0?", empty body":""})\`),{ok:!1,reason:"invalid-json",status:G.status}}}catch(H){if(h7(H))return console.warn(\`[\${z.logPrefix}] \${Y} \${X} body read timed out after \${B}ms\`),{ok:!1,reason:"timeout"};return console.warn(\`[\${z.logPrefix}] \${Y} \${X} body read failed:\`,y7(H)||H),{ok:!1,reason:"body-read"}}}catch(U){if(h7(U))return console.warn(\`[\${z.logPrefix}] \${Y} \${X} timed out after \${B}ms\`),{ok:!1,reason:"timeout"};return console.warn(\`[\${z.logPrefix}] \${Y} \${X} error:\`,U),{ok:!1,reason:"offline"}}}function J5(Z,X){return{async post(z,W,Y=X.defaultTimeout){let q=await v7(Z,z,X,{method:"POST",body:W,timeout:Y});if(!q.ok)return null;return q.data},postResult(z,W,Y=X.defaultTimeout){return v7(Z,z,X,{method:"POST",body:W,timeout:Y})}}}import{homedir as rQ}from"node:os";import{join as tQ}from"node:path";function Y5(Z){let X=o0("SIGNET_PATH")??tQ(rQ(),".agents");return b7(X)??""}function eQ(Z){let X=Z.sessionManager.getBranch();if(Array.isArray(X)&&X.length>0)return X;let z=Z.sessionManager.getEntries();return Array.isArray(z)?z:[]}function T0(Z){let X=Z.sessionManager.getHeader(),z=p(Z.sessionManager.getSessionId())??p(X?.id),W=p(Z.sessionManager.getSessionFile()),Y=p(Z.cwd)??p(X?.cwd)??p(X?.project)??p(X?.workspace);return{sessionId:z,sessionFile:W,project:Y}}async function C8(Z,X){return await Z.client.post("/api/hooks/session-end",{harness:Z.config.harness,runtimePath:Z.config.runtimePath,reason:X.reason,sessionKey:X.sessionId,sessionId:X.sessionId,agentId:X.agentId,cwd:X.project,...X.transcript?{transcript:X.transcript}:{}},Z.config.writeTimeout)!==null}async function sZ(Z){for(let X of Z.state.getPendingSessionEnds()){if(Z.state.sessionAlreadyEnded(X.sessionId)){Z.state.clearPendingSessionEnd(X.sessionId);continue}let z=V6(X.sessionFile,Z.config.excludedCustomTypes);if(!z.loaded){await C8(Z,{sessionId:X.sessionId,agentId:X.agentId,transcript:void 0,reason:X.reason,project:void 0});continue}if(!await C8(Z,{sessionId:z.sessionId??X.sessionId,agentId:X.agentId,transcript:z.transcript,reason:X.reason,project:z.project}))continue;Z.state.markSessionEnded(X.sessionId),Z.state.clearPendingSessionData(X.sessionId),Z.state.clearPendingSessionEnd(X.sessionId)}}async function DZ(Z,X){await sZ(Z);let z=T0(X);Z.state.setActiveSession(z.sessionId,z.sessionFile),Z.state.clearSessionEnded(z.sessionId);let W=await Z.client.postResult("/api/hooks/session-start",{harness:Z.config.harness,project:z.project,agentId:Z.agentId,sessionKey:z.sessionId,runtimePath:Z.config.runtimePath},Z.config.sessionStartTimeout()),Y=W.ok?W.data.inject??W.data.recentContext??"":Z.config.staticFallback(W.reason==="timeout"?"timeout":"offline");Z.state.setSessionContext(Y),Z.state.setPendingSessionContext(z.sessionId,Y)}async function aZ(Z,X){await sZ(Z);let z=T0(X);if(!z.sessionId)return;if(z.sessionId===Z.state.getActiveSessionId()&&z.sessionFile===Z.state.getActiveSessionFile())return;await DZ(Z,X)}async function _6(Z,X,z){await sZ(Z);let W=T0(X);if(Z.state.sessionAlreadyEnded(W.sessionId))return;if(!await C8(Z,{sessionId:W.sessionId,agentId:Z.agentId,transcript:Y6(eQ(X),Z.config.excludedCustomTypes),reason:z,project:W.project}))return;Z.state.markSessionEnded(W.sessionId),Z.state.clearPendingSessionData(W.sessionId)}async function E8(Z,X,z){let W=p(X.previousSessionFile)??Z.state.getActiveSessionFile(),Y=V6(W,Z.config.excludedCustomTypes),q=Y.sessionId??Z.state.getActiveSessionId();if(Z.state.sessionAlreadyEnded(q))return;if(!Y.loaded){if(q)await C8(Z,{sessionId:q,agentId:Z.agentId,transcript:void 0,reason:z,project:void 0});if(q&&W)Z.state.queuePendingSessionEnd(q,W,Z.agentId,z);return}if(!await C8(Z,{sessionId:q,agentId:Z.agentId,transcript:Y.transcript,reason:z,project:Y.project})){if(q&&W)Z.state.queuePendingSessionEnd(q,W,Z.agentId,z);return}Z.state.markSessionEnded(q),Z.state.clearPendingSessionData(q)}async function I8(Z,X,z){await sZ(Z);let W=p(z);if(!W)return;await aZ(Z,X);let Y=T0(X);if(!Y.sessionId)return;let q=await Z.client.post("/api/hooks/user-prompt-submit",{harness:Z.config.harness,project:Y.project,agentId:Z.agentId,sessionKey:Y.sessionId,userMessage:W,runtimePath:Z.config.runtimePath},Z.config.promptSubmitTimeout);if(!q)return;if(q.sessionKnown===!1)await DZ(Z,X);let B=p(q.inject);if(B)Z.state.queuePendingRecall(Y.sessionId,B)}var V5=64,m7=4,u7=128;function _5(Z){return Z.replace(/<\\/signet-memory>/gi,"<\\\\/signet-memory>")}function B6(Z,X){if(Z.size<X)return;let z=Z.keys().next().value;if(z!==void 0)Z.delete(z)}class U6{pendingSessionContext=new Map;pendingRecall=new Map;pendingSessionEnds=new Map;endedSessions=new Map;activeSessionId;activeSessionFile;sessionContext="";setActiveSession(Z,X){this.activeSessionId=Z,this.activeSessionFile=X}getActiveSessionId(){return this.activeSessionId}getActiveSessionFile(){return this.activeSessionFile}setSessionContext(Z){this.sessionContext=Z}getSessionContext(){return this.sessionContext}markSessionEnded(Z){if(!Z)return;if(!this.endedSessions.has(Z))B6(this.endedSessions,u7);this.endedSessions.set(Z,Date.now())}clearSessionEnded(Z){if(!Z)return;this.endedSessions.delete(Z)}sessionAlreadyEnded(Z){if(!Z)return!1;return this.endedSessions.has(Z)}setPendingSessionContext(Z,X){if(!Z)return;let z=p(X);if(z){this.pendingSessionContext.set(Z,z);return}this.pendingSessionContext.delete(Z)}clearPendingSessionContext(Z){if(!Z)return;this.pendingSessionContext.delete(Z)}queuePendingRecall(Z,X){if(!this.pendingRecall.has(Z))B6(this.pendingRecall,V5);let z=this.pendingRecall.get(Z)??[];z.push(X);while(z.length>m7)z.shift();this.pendingRecall.set(Z,z)}clearPendingRecall(Z){if(!Z)return;this.pendingRecall.delete(Z)}clearPendingSessionData(Z){if(!Z)return;this.pendingSessionContext.delete(Z),this.pendingRecall.delete(Z),this.pendingSessionEnds.delete(Z)}hasPendingRecall(Z){if(!Z)return!1;let X=this.pendingRecall.get(Z);return Array.isArray(X)&&X.length>0}consumePendingRecall(Z){if(!Z)return;let X=this.pendingRecall.get(Z);if(!X||X.length===0)return;let z=X.shift();if(X.length===0)this.pendingRecall.delete(Z);return p(z)}queuePendingSessionEnd(Z,X,z,W){if(!this.pendingSessionEnds.has(Z))B6(this.pendingSessionEnds,V5);this.pendingSessionEnds.set(Z,{sessionId:Z,sessionFile:X,agentId:z,reason:W})}clearPendingSessionEnd(Z){if(!Z)return;this.pendingSessionEnds.delete(Z)}getPendingSessionEnds(){return Array.from(this.pendingSessionEnds.values())}}var D0={};m6(D0,{IsUndefined:()=>J0,IsUint8Array:()=>BZ,IsSymbol:()=>M5,IsString:()=>a,IsRegExp:()=>P8,IsObject:()=>n,IsNumber:()=>P0,IsNull:()=>q5,IsIterator:()=>G5,IsFunction:()=>U5,IsDate:()=>yZ,IsBoolean:()=>_Z,IsBigInt:()=>T8,IsAsyncIterator:()=>B5,IsArray:()=>H0,HasPropertyKey:()=>G6});function G6(Z,X){return X in Z}function B5(Z){return n(Z)&&!H0(Z)&&!BZ(Z)&&Symbol.asyncIterator in Z}function H0(Z){return Array.isArray(Z)}function T8(Z){return typeof Z==="bigint"}function _Z(Z){return typeof Z==="boolean"}function yZ(Z){return Z instanceof globalThis.Date}function U5(Z){return typeof Z==="function"}function G5(Z){return n(Z)&&!H0(Z)&&!BZ(Z)&&Symbol.iterator in Z}function q5(Z){return Z===null}function P0(Z){return typeof Z==="number"}function n(Z){return typeof Z==="object"&&Z!==null}function P8(Z){return Z instanceof globalThis.RegExp}function a(Z){return typeof Z==="string"}function M5(Z){return typeof Z==="symbol"}function BZ(Z){return Z instanceof globalThis.Uint8Array}function J0(Z){return Z===void 0}function Z1(Z){return Z.map((X)=>q6(X))}function X1(Z){return new Date(Z.getTime())}function z1(Z){return new Uint8Array(Z)}function $1(Z){return new RegExp(Z.source,Z.flags)}function Q1(Z){let X={};for(let z of Object.getOwnPropertyNames(Z))X[z]=q6(Z[z]);for(let z of Object.getOwnPropertySymbols(Z))X[z]=q6(Z[z]);return X}function q6(Z){return H0(Z)?Z1(Z):yZ(Z)?X1(Z):BZ(Z)?z1(Z):P8(Z)?$1(Z):n(Z)?Q1(Z):Z}function e(Z){return q6(Z)}function rZ(Z,X){return X===void 0?e(Z):e({...X,...Z})}function c7(Z){return Z!==null&&typeof Z==="object"}function d7(Z){return globalThis.Array.isArray(Z)&&!globalThis.ArrayBuffer.isView(Z)}function p7(Z){return Z===void 0}function l7(Z){return typeof Z==="number"}var M6;(function(Z){Z.InstanceMode="default",Z.ExactOptionalPropertyTypes=!1,Z.AllowArrayObject=!1,Z.AllowNaN=!1,Z.AllowNullVoid=!1;function X(B,U){return Z.ExactOptionalPropertyTypes?U in B:B[U]!==void 0}Z.IsExactOptionalProperty=X;function z(B){let U=c7(B);return Z.AllowArrayObject?U:U&&!d7(B)}Z.IsObjectLike=z;function W(B){return z(B)&&!(B instanceof Date)&&!(B instanceof Uint8Array)}Z.IsRecordLike=W;function Y(B){return Z.AllowNaN?l7(B):Number.isFinite(B)}Z.IsNumberLike=Y;function q(B){let U=p7(B);return Z.AllowNullVoid?U||B===null:U}Z.IsVoidLike=q})(M6||(M6={}));function W1(Z){return globalThis.Object.freeze(Z).map((X)=>w8(X))}function H1(Z){return Z}function J1(Z){return Z}function Y1(Z){return Z}function V1(Z){let X={};for(let z of Object.getOwnPropertyNames(Z))X[z]=w8(Z[z]);for(let z of Object.getOwnPropertySymbols(Z))X[z]=w8(Z[z]);return globalThis.Object.freeze(X)}function w8(Z){return H0(Z)?W1(Z):yZ(Z)?H1(Z):BZ(Z)?J1(Z):P8(Z)?Y1(Z):n(Z)?V1(Z):Z}function R(Z,X){let z=X!==void 0?{...X,...Z}:Z;switch(M6.InstanceMode){case"freeze":return w8(z);case"clone":return e(z);default:return z}}class A0 extends Error{constructor(Z){super(Z)}}var V0=Symbol.for("TypeBox.Transform"),s0=Symbol.for("TypeBox.Readonly"),L0=Symbol.for("TypeBox.Optional"),v0=Symbol.for("TypeBox.Hint"),I=Symbol.for("TypeBox.Kind");function tZ(Z){return n(Z)&&Z[s0]==="Readonly"}function S0(Z){return n(Z)&&Z[L0]==="Optional"}function A5(Z){return h(Z,"Any")}function L5(Z){return h(Z,"Argument")}function a0(Z){return h(Z,"Array")}function mZ(Z){return h(Z,"AsyncIterator")}function uZ(Z){return h(Z,"BigInt")}function UZ(Z){return h(Z,"Boolean")}function r0(Z){return h(Z,"Computed")}function t0(Z){return h(Z,"Constructor")}function _1(Z){return h(Z,"Date")}function e0(Z){return h(Z,"Function")}function ZZ(Z){return h(Z,"Integer")}function z0(Z){return h(Z,"Intersect")}function cZ(Z){return h(Z,"Iterator")}function h(Z,X){return n(Z)&&I in Z&&Z[I]===X}function A6(Z){return _Z(Z)||P0(Z)||a(Z)}function w0(Z){return h(Z,"Literal")}function k0(Z){return h(Z,"MappedKey")}function Z0(Z){return h(Z,"MappedResult")}function OZ(Z){return h(Z,"Never")}function B1(Z){return h(Z,"Not")}function k8(Z){return h(Z,"Null")}function XZ(Z){return h(Z,"Number")}function Y0(Z){return h(Z,"Object")}function dZ(Z){return h(Z,"Promise")}function pZ(Z){return h(Z,"Record")}function W0(Z){return h(Z,"Ref")}function D5(Z){return h(Z,"RegExp")}function GZ(Z){return h(Z,"String")}function f8(Z){return h(Z,"Symbol")}function f0(Z){return h(Z,"TemplateLiteral")}function U1(Z){return h(Z,"This")}function FZ(Z){return n(Z)&&V0 in Z}function b0(Z){return h(Z,"Tuple")}function b8(Z){return h(Z,"Undefined")}function v(Z){return h(Z,"Union")}function G1(Z){return h(Z,"Uint8Array")}function q1(Z){return h(Z,"Unknown")}function M1(Z){return h(Z,"Unsafe")}function A1(Z){return h(Z,"Void")}function L1(Z){return n(Z)&&I in Z&&a(Z[I])}function x0(Z){return A5(Z)||L5(Z)||a0(Z)||UZ(Z)||uZ(Z)||mZ(Z)||r0(Z)||t0(Z)||_1(Z)||e0(Z)||ZZ(Z)||z0(Z)||cZ(Z)||w0(Z)||k0(Z)||Z0(Z)||OZ(Z)||B1(Z)||k8(Z)||XZ(Z)||Y0(Z)||dZ(Z)||pZ(Z)||W0(Z)||D5(Z)||GZ(Z)||f8(Z)||f0(Z)||U1(Z)||b0(Z)||b8(Z)||v(Z)||G1(Z)||q1(Z)||M1(Z)||A1(Z)||L1(Z)}var O={};m6(O,{TypeGuardUnknownTypeError:()=>n7,IsVoid:()=>fX,IsUnsafe:()=>kX,IsUnknown:()=>wX,IsUnionLiteral:()=>C1,IsUnion:()=>N5,IsUndefined:()=>TX,IsUint8Array:()=>PX,IsTuple:()=>IX,IsTransform:()=>EX,IsThis:()=>CX,IsTemplateLiteral:()=>SX,IsSymbol:()=>RX,IsString:()=>jX,IsSchema:()=>M0,IsRegExp:()=>KX,IsRef:()=>NX,IsRecursive:()=>S1,IsRecord:()=>FX,IsReadonly:()=>N1,IsProperties:()=>L6,IsPromise:()=>OX,IsOptional:()=>K1,IsObject:()=>DX,IsNumber:()=>LX,IsNull:()=>AX,IsNot:()=>MX,IsNever:()=>qX,IsMappedResult:()=>GX,IsMappedKey:()=>UX,IsLiteralValue:()=>BX,IsLiteralString:()=>VX,IsLiteralNumber:()=>_X,IsLiteralBoolean:()=>R1,IsLiteral:()=>g8,IsKindOf:()=>g,IsKind:()=>bX,IsIterator:()=>YX,IsIntersect:()=>JX,IsInteger:()=>HX,IsImport:()=>j1,IsFunction:()=>WX,IsDate:()=>QX,IsConstructor:()=>$X,IsComputed:()=>zX,IsBoolean:()=>XX,IsBigInt:()=>ZX,IsAsyncIterator:()=>e7,IsArray:()=>t7,IsArgument:()=>r7,IsAny:()=>a7});class n7 extends A0{}var D1=["Argument","Any","Array","AsyncIterator","BigInt","Boolean","Computed","Constructor","Date","Enum","Function","Integer","Intersect","Iterator","Literal","MappedKey","MappedResult","Not","Null","Number","Object","Promise","Record","Ref","RegExp","String","Symbol","TemplateLiteral","This","Tuple","Undefined","Union","Uint8Array","Unknown","Void"];function i7(Z){try{return new RegExp(Z),!0}catch{return!1}}function O5(Z){if(!a(Z))return!1;for(let X=0;X<Z.length;X++){let z=Z.charCodeAt(X);if(z>=7&&z<=13||z===27||z===127)return!1}return!0}function o7(Z){return F5(Z)||M0(Z)}function x8(Z){return J0(Z)||T8(Z)}function r(Z){return J0(Z)||P0(Z)}function F5(Z){return J0(Z)||_Z(Z)}function i(Z){return J0(Z)||a(Z)}function O1(Z){return J0(Z)||a(Z)&&O5(Z)&&i7(Z)}function F1(Z){return J0(Z)||a(Z)&&O5(Z)}function s7(Z){return J0(Z)||M0(Z)}function N1(Z){return n(Z)&&Z[s0]==="Readonly"}function K1(Z){return n(Z)&&Z[L0]==="Optional"}function a7(Z){return g(Z,"Any")&&i(Z.$id)}function r7(Z){return g(Z,"Argument")&&P0(Z.index)}function t7(Z){return g(Z,"Array")&&Z.type==="array"&&i(Z.$id)&&M0(Z.items)&&r(Z.minItems)&&r(Z.maxItems)&&F5(Z.uniqueItems)&&s7(Z.contains)&&r(Z.minContains)&&r(Z.maxContains)}function e7(Z){return g(Z,"AsyncIterator")&&Z.type==="AsyncIterator"&&i(Z.$id)&&M0(Z.items)}function ZX(Z){return g(Z,"BigInt")&&Z.type==="bigint"&&i(Z.$id)&&x8(Z.exclusiveMaximum)&&x8(Z.exclusiveMinimum)&&x8(Z.maximum)&&x8(Z.minimum)&&x8(Z.multipleOf)}function XX(Z){return g(Z,"Boolean")&&Z.type==="boolean"&&i(Z.$id)}function zX(Z){return g(Z,"Computed")&&a(Z.target)&&H0(Z.parameters)&&Z.parameters.every((X)=>M0(X))}function $X(Z){return g(Z,"Constructor")&&Z.type==="Constructor"&&i(Z.$id)&&H0(Z.parameters)&&Z.parameters.every((X)=>M0(X))&&M0(Z.returns)}function QX(Z){return g(Z,"Date")&&Z.type==="Date"&&i(Z.$id)&&r(Z.exclusiveMaximumTimestamp)&&r(Z.exclusiveMinimumTimestamp)&&r(Z.maximumTimestamp)&&r(Z.minimumTimestamp)&&r(Z.multipleOfTimestamp)}function WX(Z){return g(Z,"Function")&&Z.type==="Function"&&i(Z.$id)&&H0(Z.parameters)&&Z.parameters.every((X)=>M0(X))&&M0(Z.returns)}function j1(Z){return g(Z,"Import")&&G6(Z,"$defs")&&n(Z.$defs)&&L6(Z.$defs)&&G6(Z,"$ref")&&a(Z.$ref)&&Z.$ref in Z.$defs}function HX(Z){return g(Z,"Integer")&&Z.type==="integer"&&i(Z.$id)&&r(Z.exclusiveMaximum)&&r(Z.exclusiveMinimum)&&r(Z.maximum)&&r(Z.minimum)&&r(Z.multipleOf)}function L6(Z){return n(Z)&&Object.entries(Z).every(([X,z])=>O5(X)&&M0(z))}function JX(Z){return g(Z,"Intersect")&&(a(Z.type)&&Z.type!=="object"?!1:!0)&&H0(Z.allOf)&&Z.allOf.every((X)=>M0(X)&&!EX(X))&&i(Z.type)&&(F5(Z.unevaluatedProperties)||s7(Z.unevaluatedProperties))&&i(Z.$id)}function YX(Z){return g(Z,"Iterator")&&Z.type==="Iterator"&&i(Z.$id)&&M0(Z.items)}function g(Z,X){return n(Z)&&I in Z&&Z[I]===X}function VX(Z){return g8(Z)&&a(Z.const)}function _X(Z){return g8(Z)&&P0(Z.const)}function R1(Z){return g8(Z)&&_Z(Z.const)}function g8(Z){return g(Z,"Literal")&&i(Z.$id)&&BX(Z.const)}function BX(Z){return _Z(Z)||P0(Z)||a(Z)}function UX(Z){return g(Z,"MappedKey")&&H0(Z.keys)&&Z.keys.every((X)=>P0(X)||a(X))}function GX(Z){return g(Z,"MappedResult")&&L6(Z.properties)}function qX(Z){return g(Z,"Never")&&n(Z.not)&&Object.getOwnPropertyNames(Z.not).length===0}function MX(Z){return g(Z,"Not")&&M0(Z.not)}function AX(Z){return g(Z,"Null")&&Z.type==="null"&&i(Z.$id)}function LX(Z){return g(Z,"Number")&&Z.type==="number"&&i(Z.$id)&&r(Z.exclusiveMaximum)&&r(Z.exclusiveMinimum)&&r(Z.maximum)&&r(Z.minimum)&&r(Z.multipleOf)}function DX(Z){return g(Z,"Object")&&Z.type==="object"&&i(Z.$id)&&L6(Z.properties)&&o7(Z.additionalProperties)&&r(Z.minProperties)&&r(Z.maxProperties)}function OX(Z){return g(Z,"Promise")&&Z.type==="Promise"&&i(Z.$id)&&M0(Z.item)}function FX(Z){return g(Z,"Record")&&Z.type==="object"&&i(Z.$id)&&o7(Z.additionalProperties)&&n(Z.patternProperties)&&((X)=>{let z=Object.getOwnPropertyNames(X.patternProperties);return z.length===1&&i7(z[0])&&n(X.patternProperties)&&M0(X.patternProperties[z[0]])})(Z)}function S1(Z){return n(Z)&&v0 in Z&&Z[v0]==="Recursive"}function NX(Z){return g(Z,"Ref")&&i(Z.$id)&&a(Z.$ref)}function KX(Z){return g(Z,"RegExp")&&i(Z.$id)&&a(Z.source)&&a(Z.flags)&&r(Z.maxLength)&&r(Z.minLength)}function jX(Z){return g(Z,"String")&&Z.type==="string"&&i(Z.$id)&&r(Z.minLength)&&r(Z.maxLength)&&O1(Z.pattern)&&F1(Z.format)}function RX(Z){return g(Z,"Symbol")&&Z.type==="symbol"&&i(Z.$id)}function SX(Z){return g(Z,"TemplateLiteral")&&Z.type==="string"&&a(Z.pattern)&&Z.pattern[0]==="^"&&Z.pattern[Z.pattern.length-1]==="$"}function CX(Z){return g(Z,"This")&&i(Z.$id)&&a(Z.$ref)}function EX(Z){return n(Z)&&V0 in Z}function IX(Z){return g(Z,"Tuple")&&Z.type==="array"&&i(Z.$id)&&P0(Z.minItems)&&P0(Z.maxItems)&&Z.minItems===Z.maxItems&&(J0(Z.items)&&J0(Z.additionalItems)&&Z.minItems===0||H0(Z.items)&&Z.items.every((X)=>M0(X)))}function TX(Z){return g(Z,"Undefined")&&Z.type==="undefined"&&i(Z.$id)}function C1(Z){return N5(Z)&&Z.anyOf.every((X)=>VX(X)||_X(X))}function N5(Z){return g(Z,"Union")&&i(Z.$id)&&n(Z)&&H0(Z.anyOf)&&Z.anyOf.every((X)=>M0(X))}function PX(Z){return g(Z,"Uint8Array")&&Z.type==="Uint8Array"&&i(Z.$id)&&r(Z.minByteLength)&&r(Z.maxByteLength)}function wX(Z){return g(Z,"Unknown")&&i(Z.$id)}function kX(Z){return g(Z,"Unsafe")}function fX(Z){return g(Z,"Void")&&Z.type==="void"&&i(Z.$id)}function bX(Z){return n(Z)&&I in Z&&a(Z[I])&&!D1.includes(Z[I])}function M0(Z){return n(Z)&&(a7(Z)||r7(Z)||t7(Z)||XX(Z)||ZX(Z)||e7(Z)||zX(Z)||$X(Z)||QX(Z)||WX(Z)||HX(Z)||JX(Z)||YX(Z)||g8(Z)||UX(Z)||GX(Z)||qX(Z)||MX(Z)||AX(Z)||LX(Z)||DX(Z)||OX(Z)||FX(Z)||NX(Z)||KX(Z)||jX(Z)||RX(Z)||SX(Z)||CX(Z)||IX(Z)||TX(Z)||N5(Z)||PX(Z)||wX(Z)||kX(Z)||fX(Z)||bX(Z))}var xX="(true|false)",D6="(0|[1-9][0-9]*)",gX="(.*)";var NZ="^(0|[1-9][0-9]*)$",KZ="^(.*)$",hX="^(?!.*)$";function vX(Z,X){return Z.includes(X)}function yX(Z){return[...new Set(Z)]}function E1(Z,X){return Z.filter((z)=>X.includes(z))}function I1(Z,X){return Z.reduce((z,W)=>{return E1(z,W)},X)}function mX(Z){return Z.length===1?Z[0]:Z.length>1?I1(Z.slice(1),Z[0]):[]}function uX(Z){let X=[];for(let z of Z)X.push(...z);return X}function jZ(Z){return R({[I]:"Any"},Z)}function eZ(Z,X){return R({[I]:"Array",type:"array",items:Z},X)}function cX(Z){return R({[I]:"Argument",index:Z})}function Z8(Z,X){return R({[I]:"AsyncIterator",type:"AsyncIterator",items:Z},X)}function t(Z,X,z){return R({[I]:"Computed",target:Z,parameters:X},z)}function T1(Z,X){let{[X]:z,...W}=Z;return W}function $0(Z,X){return X.reduce((z,W)=>T1(z,W),Z)}function y(Z){return R({[I]:"Never",not:{}},Z)}function m(Z){return R({[I]:"MappedResult",properties:Z})}function X8(Z,X,z){return R({[I]:"Constructor",type:"Constructor",parameters:Z,returns:X},z)}function WZ(Z,X,z){return R({[I]:"Function",type:"Function",parameters:Z,returns:X},z)}function h8(Z,X){return R({[I]:"Union",anyOf:Z},X)}function P1(Z){return Z.some((X)=>S0(X))}function dX(Z){return Z.map((X)=>S0(X)?w1(X):X)}function w1(Z){return $0(Z,[L0])}function k1(Z,X){return P1(Z)?O0(h8(dX(Z),X)):h8(dX(Z),X)}function HZ(Z,X){return Z.length===1?R(Z[0],X):Z.length===0?y(X):k1(Z,X)}function d(Z,X){return Z.length===0?y(X):Z.length===1?R(Z[0],X):h8(Z,X)}class K5 extends A0{}function f1(Z){return Z.replace(/\\\\\\$/g,"$").replace(/\\\\\\*/g,"*").replace(/\\\\\\^/g,"^").replace(/\\\\\\|/g,"|").replace(/\\\\\\(/g,"(").replace(/\\\\\\)/g,")")}function j5(Z,X,z){return Z[X]===z&&Z.charCodeAt(X-1)!==92}function MZ(Z,X){return j5(Z,X,"(")}function v8(Z,X){return j5(Z,X,")")}function pX(Z,X){return j5(Z,X,"|")}function b1(Z){if(!(MZ(Z,0)&&v8(Z,Z.length-1)))return!1;let X=0;for(let z=0;z<Z.length;z++){if(MZ(Z,z))X+=1;if(v8(Z,z))X-=1;if(X===0&&z!==Z.length-1)return!1}return!0}function x1(Z){return Z.slice(1,Z.length-1)}function g1(Z){let X=0;for(let z=0;z<Z.length;z++){if(MZ(Z,z))X+=1;if(v8(Z,z))X-=1;if(pX(Z,z)&&X===0)return!0}return!1}function h1(Z){for(let X=0;X<Z.length;X++)if(MZ(Z,X))return!0;return!1}function v1(Z){let[X,z]=[0,0],W=[];for(let q=0;q<Z.length;q++){if(MZ(Z,q))X+=1;if(v8(Z,q))X-=1;if(pX(Z,q)&&X===0){let B=Z.slice(z,q);if(B.length>0)W.push(z8(B));z=q+1}}let Y=Z.slice(z);if(Y.length>0)W.push(z8(Y));if(W.length===0)return{type:"const",const:""};if(W.length===1)return W[0];return{type:"or",expr:W}}function y1(Z){function X(Y,q){if(!MZ(Y,q))throw new K5("TemplateLiteralParser: Index must point to open parens");let B=0;for(let U=q;U<Y.length;U++){if(MZ(Y,U))B+=1;if(v8(Y,U))B-=1;if(B===0)return[q,U]}throw new K5("TemplateLiteralParser: Unclosed group parens in expression")}function z(Y,q){for(let B=q;B<Y.length;B++)if(MZ(Y,B))return[q,B];return[q,Y.length]}let W=[];for(let Y=0;Y<Z.length;Y++)if(MZ(Z,Y)){let[q,B]=X(Z,Y),U=Z.slice(q,B+1);W.push(z8(U)),Y=B}else{let[q,B]=z(Z,Y),U=Z.slice(q,B);if(U.length>0)W.push(z8(U));Y=B-1}return W.length===0?{type:"const",const:""}:W.length===1?W[0]:{type:"and",expr:W}}function z8(Z){return b1(Z)?z8(x1(Z)):g1(Z)?v1(Z):h1(Z)?y1(Z):{type:"const",const:f1(Z)}}function $8(Z){return z8(Z.slice(1,Z.length-1))}class lX extends A0{}function m1(Z){return Z.type==="or"&&Z.expr.length===2&&Z.expr[0].type==="const"&&Z.expr[0].const==="0"&&Z.expr[1].type==="const"&&Z.expr[1].const==="[1-9][0-9]*"}function u1(Z){return Z.type==="or"&&Z.expr.length===2&&Z.expr[0].type==="const"&&Z.expr[0].const==="true"&&Z.expr[1].type==="const"&&Z.expr[1].const==="false"}function c1(Z){return Z.type==="const"&&Z.const===".*"}function lZ(Z){return m1(Z)||c1(Z)?!1:u1(Z)?!0:Z.type==="and"?Z.expr.every((X)=>lZ(X)):Z.type==="or"?Z.expr.every((X)=>lZ(X)):Z.type==="const"?!0:(()=>{throw new lX("Unknown expression type")})()}function nX(Z){let X=$8(Z.pattern);return lZ(X)}class iX extends A0{}function*oX(Z){if(Z.length===1)return yield*Z[0];for(let X of Z[0])for(let z of oX(Z.slice(1)))yield\`\${X}\${z}\`}function*d1(Z){return yield*oX(Z.expr.map((X)=>[...y8(X)]))}function*p1(Z){for(let X of Z.expr)yield*y8(X)}function*l1(Z){return yield Z.const}function*y8(Z){return Z.type==="and"?yield*d1(Z):Z.type==="or"?yield*p1(Z):Z.type==="const"?yield*l1(Z):(()=>{throw new iX("Unknown expression")})()}function O6(Z){let X=$8(Z.pattern);return lZ(X)?[...y8(X)]:[]}function c(Z,X){return R({[I]:"Literal",const:Z,type:typeof Z},X)}function F6(Z){return R({[I]:"Boolean",type:"boolean"},Z)}function Q8(Z){return R({[I]:"BigInt",type:"bigint"},Z)}function y0(Z){return R({[I]:"Number",type:"number"},Z)}function zZ(Z){return R({[I]:"String",type:"string"},Z)}function*n1(Z){let X=Z.trim().replace(/"|'/g,"");return X==="boolean"?yield F6():X==="number"?yield y0():X==="bigint"?yield Q8():X==="string"?yield zZ():yield(()=>{let z=X.split("|").map((W)=>c(W.trim()));return z.length===0?y():z.length===1?z[0]:HZ(z)})()}function*i1(Z){if(Z[1]!=="{"){let X=c("$"),z=R5(Z.slice(1));return yield*[X,...z]}for(let X=2;X<Z.length;X++)if(Z[X]==="}"){let z=n1(Z.slice(2,X)),W=R5(Z.slice(X+1));return yield*[...z,...W]}yield c(Z)}function*R5(Z){for(let X=0;X<Z.length;X++)if(Z[X]==="$"){let z=c(Z.slice(0,X)),W=i1(Z.slice(X));return yield*[z,...W]}yield c(Z)}function sX(Z){return[...R5(Z)]}class aX extends A0{}function o1(Z){return Z.replace(/[.*+?^\${}()|[\\]\\\\]/g,"\\\\$&")}function rX(Z,X){return f0(Z)?Z.pattern.slice(1,Z.pattern.length-1):v(Z)?\`(\${Z.anyOf.map((z)=>rX(z,X)).join("|")})\`:XZ(Z)?\`\${X}\${D6}\`:ZZ(Z)?\`\${X}\${D6}\`:uZ(Z)?\`\${X}\${D6}\`:GZ(Z)?\`\${X}\${gX}\`:w0(Z)?\`\${X}\${o1(Z.const.toString())}\`:UZ(Z)?\`\${X}\${xX}\`:(()=>{throw new aX(\`Unexpected Kind '\${Z[I]}'\`)})()}function S5(Z){return\`^\${Z.map((X)=>rX(X,"")).join("")}$\`}function nZ(Z){let z=O6(Z).map((W)=>c(W));return HZ(z)}function N6(Z,X){let z=a(Z)?S5(sX(Z)):S5(Z);return R({[I]:"TemplateLiteral",type:"string",pattern:z},X)}function s1(Z){return O6(Z).map((z)=>z.toString())}function a1(Z){let X=[];for(let z of Z)X.push(...C0(z));return X}function r1(Z){return[Z.toString()]}function C0(Z){return[...new Set(f0(Z)?s1(Z):v(Z)?a1(Z.anyOf):w0(Z)?r1(Z.const):XZ(Z)?["[number]"]:ZZ(Z)?["[number]"]:[])]}function t1(Z,X,z){let W={};for(let Y of Object.getOwnPropertyNames(X))W[Y]=RZ(Z,C0(X[Y]),z);return W}function e1(Z,X,z){return t1(Z,X.properties,z)}function tX(Z,X,z){let W=e1(Z,X,z);return m(W)}function Z2(Z,X){return Z.map((z)=>X2(z,X))}function ZW(Z){return Z.filter((X)=>!OZ(X))}function XW(Z,X){return K6(ZW(Z2(Z,X)))}function zW(Z){return Z.some((X)=>OZ(X))?[]:Z}function $W(Z,X){return HZ(zW(Z2(Z,X)))}function QW(Z,X){return X in Z?Z[X]:X==="[number]"?HZ(Z):y()}function WW(Z,X){return X==="[number]"?Z:y()}function HW(Z,X){return X in Z?Z[X]:y()}function X2(Z,X){return z0(Z)?XW(Z.allOf,X):v(Z)?$W(Z.anyOf,X):b0(Z)?QW(Z.items??[],X):a0(Z)?WW(Z.items,X):Y0(Z)?HW(Z.properties,X):y()}function C5(Z,X){return X.map((z)=>X2(Z,z))}function eX(Z,X){return HZ(C5(Z,X))}function RZ(Z,X,z){if(W0(Z)||W0(X)){if(!x0(Z)||!x0(X))throw new A0("Index types using Ref parameters require both Type and Key to be of TSchema");return t("Index",[Z,X])}if(Z0(X))return tX(Z,X,z);if(k0(X))return z2(Z,X,z);return R(x0(X)?eX(Z,C0(X)):eX(Z,X),z)}function JW(Z,X,z){return{[X]:RZ(Z,[X],e(z))}}function YW(Z,X,z){return X.reduce((W,Y)=>{return{...W,...JW(Z,Y,z)}},{})}function VW(Z,X,z){return YW(Z,X.keys,z)}function z2(Z,X,z){let W=VW(Z,X,z);return m(W)}function W8(Z,X){return R({[I]:"Iterator",type:"Iterator",items:Z},X)}function _W(Z){return globalThis.Object.keys(Z).filter((X)=>!S0(Z[X]))}function BW(Z,X){let z=_W(Z),W=z.length>0?{[I]:"Object",type:"object",required:z,properties:Z}:{[I]:"Object",type:"object",properties:Z};return R(W,X)}var o=BW;function j6(Z,X){return R({[I]:"Promise",type:"Promise",item:Z},X)}function UW(Z){return R($0(Z,[s0]))}function GW(Z){return R({...Z,[s0]:"Readonly"})}function qW(Z,X){return X===!1?UW(Z):GW(Z)}function E0(Z,X){let z=X??!0;return Z0(Z)?$2(Z,z):qW(Z,z)}function MW(Z,X){let z={};for(let W of globalThis.Object.getOwnPropertyNames(Z))z[W]=E0(Z[W],X);return z}function AW(Z,X){return MW(Z.properties,X)}function $2(Z,X){let z=AW(Z,X);return m(z)}function m0(Z,X){return R(Z.length>0?{[I]:"Tuple",type:"array",items:Z,additionalItems:!1,minItems:Z.length,maxItems:Z.length}:{[I]:"Tuple",type:"array",minItems:Z.length,maxItems:Z.length},X)}function Q2(Z,X){return Z in X?u0(Z,X[Z]):m(X)}function LW(Z){return{[Z]:c(Z)}}function DW(Z){let X={};for(let z of Z)X[z]=c(z);return X}function OW(Z,X){return vX(X,Z)?LW(Z):DW(X)}function FW(Z,X){let z=OW(Z,X);return Q2(Z,z)}function m8(Z,X){return X.map((z)=>u0(Z,z))}function NW(Z,X){let z={};for(let W of globalThis.Object.getOwnPropertyNames(X))z[W]=u0(Z,X[W]);return z}function u0(Z,X){let z={...X};return S0(X)?O0(u0(Z,$0(X,[L0]))):tZ(X)?E0(u0(Z,$0(X,[s0]))):Z0(X)?Q2(Z,X.properties):k0(X)?FW(Z,X.keys):t0(X)?X8(m8(Z,X.parameters),u0(Z,X.returns),z):e0(X)?WZ(m8(Z,X.parameters),u0(Z,X.returns),z):mZ(X)?Z8(u0(Z,X.items),z):cZ(X)?W8(u0(Z,X.items),z):z0(X)?F0(m8(Z,X.allOf),z):v(X)?d(m8(Z,X.anyOf),z):b0(X)?m0(m8(Z,X.items??[]),z):Y0(X)?o(NW(Z,X.properties),z):a0(X)?eZ(u0(Z,X.items),z):dZ(X)?j6(u0(Z,X.item),z):X}function KW(Z,X){let z={};for(let W of Z)z[W]=u0(W,X);return z}function W2(Z,X,z){let W=x0(Z)?C0(Z):Z,Y=X({[I]:"MappedKey",keys:W}),q=KW(W,Y);return o(q,z)}function jW(Z){return R($0(Z,[L0]))}function RW(Z){return R({...Z,[L0]:"Optional"})}function SW(Z,X){return X===!1?jW(Z):RW(Z)}function O0(Z,X){let z=X??!0;return Z0(Z)?H2(Z,z):SW(Z,z)}function CW(Z,X){let z={};for(let W of globalThis.Object.getOwnPropertyNames(Z))z[W]=O0(Z[W],X);return z}function EW(Z,X){return CW(Z.properties,X)}function H2(Z,X){let z=EW(Z,X);return m(z)}function u8(Z,X={}){let z=Z.every((Y)=>Y0(Y)),W=x0(X.unevaluatedProperties)?{unevaluatedProperties:X.unevaluatedProperties}:{};return R(X.unevaluatedProperties===!1||x0(X.unevaluatedProperties)||z?{...W,[I]:"Intersect",type:"object",allOf:Z}:{...W,[I]:"Intersect",allOf:Z},X)}function IW(Z){return Z.every((X)=>S0(X))}function TW(Z){return $0(Z,[L0])}function J2(Z){return Z.map((X)=>S0(X)?TW(X):X)}function PW(Z,X){return IW(Z)?O0(u8(J2(Z),X)):u8(J2(Z),X)}function K6(Z,X={}){if(Z.length===1)return R(Z[0],X);if(Z.length===0)return y(X);if(Z.some((z)=>FZ(z)))throw Error("Cannot intersect transform types");return PW(Z,X)}function F0(Z,X){if(Z.length===1)return R(Z[0],X);if(Z.length===0)return y(X);if(Z.some((z)=>FZ(z)))throw Error("Cannot intersect transform types");return u8(Z,X)}function JZ(...Z){let[X,z]=typeof Z[0]==="string"?[Z[0],Z[1]]:[Z[0].$id,Z[1]];if(typeof X!=="string")throw new A0("Ref: $ref must be a string");return R({[I]:"Ref",$ref:X},z)}function wW(Z,X){return t("Awaited",[t(Z,X)])}function kW(Z){return t("Awaited",[JZ(Z)])}function fW(Z){return F0(Y2(Z))}function bW(Z){return d(Y2(Z))}function xW(Z){return H8(Z)}function Y2(Z){return Z.map((X)=>H8(X))}function H8(Z,X){return R(r0(Z)?wW(Z.target,Z.parameters):z0(Z)?fW(Z.allOf):v(Z)?bW(Z.anyOf):dZ(Z)?xW(Z.item):W0(Z)?kW(Z.$ref):Z,X)}function V2(Z){let X=[];for(let z of Z)X.push(c8(z));return X}function gW(Z){let X=V2(Z);return uX(X)}function hW(Z){let X=V2(Z);return mX(X)}function vW(Z){return Z.map((X,z)=>z.toString())}function yW(Z){return["[number]"]}function mW(Z){return globalThis.Object.getOwnPropertyNames(Z)}function uW(Z){if(!cW)return[];return globalThis.Object.getOwnPropertyNames(Z).map((z)=>{return z[0]==="^"&&z[z.length-1]==="$"?z.slice(1,z.length-1):z})}function c8(Z){return z0(Z)?gW(Z.allOf):v(Z)?hW(Z.anyOf):b0(Z)?vW(Z.items??[]):a0(Z)?yW(Z.items):Y0(Z)?mW(Z.properties):pZ(Z)?uW(Z.patternProperties):[]}var cW=!1;function dW(Z,X){return t("KeyOf",[t(Z,X)])}function pW(Z){return t("KeyOf",[JZ(Z)])}function lW(Z,X){let z=c8(Z),W=nW(z),Y=HZ(W);return R(Y,X)}function nW(Z){return Z.map((X)=>X==="[number]"?y0():c(X))}function J8(Z,X){return r0(Z)?dW(Z.target,Z.parameters):W0(Z)?pW(Z.$ref):Z0(Z)?_2(Z,X):lW(Z,X)}function iW(Z,X){let z={};for(let W of globalThis.Object.getOwnPropertyNames(Z))z[W]=J8(Z[W],e(X));return z}function oW(Z,X){return iW(Z.properties,X)}function _2(Z,X){let z=oW(Z,X);return m(z)}function sW(Z){let X=[];for(let z of Z)X.push(...c8(z));return yX(X)}function aW(Z){return Z.filter((X)=>!OZ(X))}function rW(Z,X){let z=[];for(let W of Z)z.push(...C5(W,[X]));return aW(z)}function tW(Z,X){let z={};for(let W of X)z[W]=K6(rW(Z,W));return z}function B2(Z,X){let z=sW(Z),W=tW(Z,z);return o(W,X)}function R6(Z){return R({[I]:"Date",type:"Date"},Z)}function S6(Z){return R({[I]:"Null",type:"null"},Z)}function C6(Z){return R({[I]:"Symbol",type:"symbol"},Z)}function E6(Z){return R({[I]:"Undefined",type:"undefined"},Z)}function I6(Z){return R({[I]:"Uint8Array",type:"Uint8Array"},Z)}function SZ(Z){return R({[I]:"Unknown"},Z)}function eW(Z){return Z.map((X)=>E5(X,!1))}function Z4(Z){let X={};for(let z of globalThis.Object.getOwnPropertyNames(Z))X[z]=E0(E5(Z[z],!1));return X}function T6(Z,X){return X===!0?Z:E0(Z)}function E5(Z,X){return B5(Z)?T6(jZ(),X):G5(Z)?T6(jZ(),X):H0(Z)?E0(m0(eW(Z))):BZ(Z)?I6():yZ(Z)?R6():n(Z)?T6(o(Z4(Z)),X):U5(Z)?T6(WZ([],SZ()),X):J0(Z)?E6():q5(Z)?S6():M5(Z)?C6():T8(Z)?Q8():P0(Z)?c(Z):_Z(Z)?c(Z):a(Z)?c(Z):o({})}function U2(Z,X){return R(E5(Z,!0),X)}function G2(Z,X){return t0(Z)?m0(Z.parameters,X):y(X)}function q2(Z,X){if(J0(Z))throw Error("Enum undefined or empty");let z=globalThis.Object.getOwnPropertyNames(Z).filter((q)=>isNaN(q)).map((q)=>Z[q]),Y=[...new Set(z)].map((q)=>c(q));return d(Y,{...X,[v0]:"Enum"})}class O2 extends A0{}var S;(function(Z){Z[Z.Union=0]="Union",Z[Z.True=1]="True",Z[Z.False=2]="False"})(S||(S={}));function c0(Z){return Z===S.False?Z:S.True}function Y8(Z){throw new O2(Z)}function _0(Z){return O.IsNever(Z)||O.IsIntersect(Z)||O.IsUnion(Z)||O.IsUnknown(Z)||O.IsAny(Z)}function B0(Z,X){return O.IsNever(X)?K2(Z,X):O.IsIntersect(X)?P6(Z,X):O.IsUnion(X)?k5(Z,X):O.IsUnknown(X)?C2(Z,X):O.IsAny(X)?w5(Z,X):Y8("StructuralRight")}function w5(Z,X){return S.True}function X4(Z,X){return O.IsIntersect(X)?P6(Z,X):O.IsUnion(X)&&X.anyOf.some((z)=>O.IsAny(z)||O.IsUnknown(z))?S.True:O.IsUnion(X)?S.Union:O.IsUnknown(X)?S.True:O.IsAny(X)?S.True:S.Union}function z4(Z,X){return O.IsUnknown(Z)?S.False:O.IsAny(Z)?S.Union:O.IsNever(Z)?S.True:S.False}function $4(Z,X){return O.IsObject(X)&&w6(X)?S.True:_0(X)?B0(Z,X):!O.IsArray(X)?S.False:c0(s(Z.items,X.items))}function Q4(Z,X){return _0(X)?B0(Z,X):!O.IsAsyncIterator(X)?S.False:c0(s(Z.items,X.items))}function W4(Z,X){return _0(X)?B0(Z,X):O.IsObject(X)?N0(Z,X):O.IsRecord(X)?d0(Z,X):O.IsBigInt(X)?S.True:S.False}function F2(Z,X){return O.IsLiteralBoolean(Z)?S.True:O.IsBoolean(Z)?S.True:S.False}function H4(Z,X){return _0(X)?B0(Z,X):O.IsObject(X)?N0(Z,X):O.IsRecord(X)?d0(Z,X):O.IsBoolean(X)?S.True:S.False}function J4(Z,X){return _0(X)?B0(Z,X):O.IsObject(X)?N0(Z,X):!O.IsConstructor(X)?S.False:Z.parameters.length>X.parameters.length?S.False:!Z.parameters.every((z,W)=>c0(s(X.parameters[W],z))===S.True)?S.False:c0(s(Z.returns,X.returns))}function Y4(Z,X){return _0(X)?B0(Z,X):O.IsObject(X)?N0(Z,X):O.IsRecord(X)?d0(Z,X):O.IsDate(X)?S.True:S.False}function V4(Z,X){return _0(X)?B0(Z,X):O.IsObject(X)?N0(Z,X):!O.IsFunction(X)?S.False:Z.parameters.length>X.parameters.length?S.False:!Z.parameters.every((z,W)=>c0(s(X.parameters[W],z))===S.True)?S.False:c0(s(Z.returns,X.returns))}function N2(Z,X){return O.IsLiteral(Z)&&D0.IsNumber(Z.const)?S.True:O.IsNumber(Z)||O.IsInteger(Z)?S.True:S.False}function _4(Z,X){return O.IsInteger(X)||O.IsNumber(X)?S.True:_0(X)?B0(Z,X):O.IsObject(X)?N0(Z,X):O.IsRecord(X)?d0(Z,X):S.False}function P6(Z,X){return X.allOf.every((z)=>s(Z,z)===S.True)?S.True:S.False}function B4(Z,X){return Z.allOf.some((z)=>s(z,X)===S.True)?S.True:S.False}function U4(Z,X){return _0(X)?B0(Z,X):!O.IsIterator(X)?S.False:c0(s(Z.items,X.items))}function G4(Z,X){return O.IsLiteral(X)&&X.const===Z.const?S.True:_0(X)?B0(Z,X):O.IsObject(X)?N0(Z,X):O.IsRecord(X)?d0(Z,X):O.IsString(X)?S2(Z,X):O.IsNumber(X)?j2(Z,X):O.IsInteger(X)?N2(Z,X):O.IsBoolean(X)?F2(Z,X):S.False}function K2(Z,X){return S.False}function q4(Z,X){return S.True}function M2(Z){let[X,z]=[Z,0];while(!0){if(!O.IsNot(X))break;X=X.not,z+=1}return z%2===0?X:SZ()}function M4(Z,X){return O.IsNot(Z)?s(M2(Z),X):O.IsNot(X)?s(Z,M2(X)):Y8("Invalid fallthrough for Not")}function A4(Z,X){return _0(X)?B0(Z,X):O.IsObject(X)?N0(Z,X):O.IsRecord(X)?d0(Z,X):O.IsNull(X)?S.True:S.False}function j2(Z,X){return O.IsLiteralNumber(Z)?S.True:O.IsNumber(Z)||O.IsInteger(Z)?S.True:S.False}function L4(Z,X){return _0(X)?B0(Z,X):O.IsObject(X)?N0(Z,X):O.IsRecord(X)?d0(Z,X):O.IsInteger(X)||O.IsNumber(X)?S.True:S.False}function I0(Z,X){return Object.getOwnPropertyNames(Z.properties).length===X}function A2(Z){return w6(Z)}function L2(Z){return I0(Z,0)||I0(Z,1)&&"description"in Z.properties&&O.IsUnion(Z.properties.description)&&Z.properties.description.anyOf.length===2&&(O.IsString(Z.properties.description.anyOf[0])&&O.IsUndefined(Z.properties.description.anyOf[1])||O.IsString(Z.properties.description.anyOf[1])&&O.IsUndefined(Z.properties.description.anyOf[0]))}function I5(Z){return I0(Z,0)}function D2(Z){return I0(Z,0)}function D4(Z){return I0(Z,0)}function O4(Z){return I0(Z,0)}function F4(Z){return w6(Z)}function N4(Z){let X=y0();return I0(Z,0)||I0(Z,1)&&"length"in Z.properties&&c0(s(Z.properties.length,X))===S.True}function K4(Z){return I0(Z,0)}function w6(Z){let X=y0();return I0(Z,0)||I0(Z,1)&&"length"in Z.properties&&c0(s(Z.properties.length,X))===S.True}function j4(Z){let X=WZ([jZ()],jZ());return I0(Z,0)||I0(Z,1)&&"then"in Z.properties&&c0(s(Z.properties.then,X))===S.True}function R2(Z,X){return s(Z,X)===S.False?S.False:O.IsOptional(Z)&&!O.IsOptional(X)?S.False:S.True}function N0(Z,X){return O.IsUnknown(Z)?S.False:O.IsAny(Z)?S.Union:O.IsNever(Z)||O.IsLiteralString(Z)&&A2(X)||O.IsLiteralNumber(Z)&&I5(X)||O.IsLiteralBoolean(Z)&&D2(X)||O.IsSymbol(Z)&&L2(X)||O.IsBigInt(Z)&&D4(X)||O.IsString(Z)&&A2(X)||O.IsSymbol(Z)&&L2(X)||O.IsNumber(Z)&&I5(X)||O.IsInteger(Z)&&I5(X)||O.IsBoolean(Z)&&D2(X)||O.IsUint8Array(Z)&&F4(X)||O.IsDate(Z)&&O4(X)||O.IsConstructor(Z)&&K4(X)||O.IsFunction(Z)&&N4(X)?S.True:O.IsRecord(Z)&&O.IsString(T5(Z))?(()=>{return X[v0]==="Record"?S.True:S.False})():O.IsRecord(Z)&&O.IsNumber(T5(Z))?(()=>{return I0(X,0)?S.True:S.False})():S.False}function R4(Z,X){return _0(X)?B0(Z,X):O.IsRecord(X)?d0(Z,X):!O.IsObject(X)?S.False:(()=>{for(let z of Object.getOwnPropertyNames(X.properties)){if(!(z in Z.properties)&&!O.IsOptional(X.properties[z]))return S.False;if(O.IsOptional(X.properties[z]))return S.True;if(R2(Z.properties[z],X.properties[z])===S.False)return S.False}return S.True})()}function S4(Z,X){return _0(X)?B0(Z,X):O.IsObject(X)&&j4(X)?S.True:!O.IsPromise(X)?S.False:c0(s(Z.item,X.item))}function T5(Z){return NZ in Z.patternProperties?y0():(KZ in Z.patternProperties)?zZ():Y8("Unknown record key pattern")}function P5(Z){return NZ in Z.patternProperties?Z.patternProperties[NZ]:(KZ in Z.patternProperties)?Z.patternProperties[KZ]:Y8("Unable to get record value schema")}function d0(Z,X){let[z,W]=[T5(X),P5(X)];return O.IsLiteralString(Z)&&O.IsNumber(z)&&c0(s(Z,W))===S.True?S.True:O.IsUint8Array(Z)&&O.IsNumber(z)?s(Z,W):O.IsString(Z)&&O.IsNumber(z)?s(Z,W):O.IsArray(Z)&&O.IsNumber(z)?s(Z,W):O.IsObject(Z)?(()=>{for(let Y of Object.getOwnPropertyNames(Z.properties))if(R2(W,Z.properties[Y])===S.False)return S.False;return S.True})():S.False}function C4(Z,X){return _0(X)?B0(Z,X):O.IsObject(X)?N0(Z,X):!O.IsRecord(X)?S.False:s(P5(Z),P5(X))}function E4(Z,X){let z=O.IsRegExp(Z)?zZ():Z,W=O.IsRegExp(X)?zZ():X;return s(z,W)}function S2(Z,X){return O.IsLiteral(Z)&&D0.IsString(Z.const)?S.True:O.IsString(Z)?S.True:S.False}function I4(Z,X){return _0(X)?B0(Z,X):O.IsObject(X)?N0(Z,X):O.IsRecord(X)?d0(Z,X):O.IsString(X)?S.True:S.False}function T4(Z,X){return _0(X)?B0(Z,X):O.IsObject(X)?N0(Z,X):O.IsRecord(X)?d0(Z,X):O.IsSymbol(X)?S.True:S.False}function P4(Z,X){return O.IsTemplateLiteral(Z)?s(nZ(Z),X):O.IsTemplateLiteral(X)?s(Z,nZ(X)):Y8("Invalid fallthrough for TemplateLiteral")}function w4(Z,X){return O.IsArray(X)&&Z.items!==void 0&&Z.items.every((z)=>s(z,X.items)===S.True)}function k4(Z,X){return O.IsNever(Z)?S.True:O.IsUnknown(Z)?S.False:O.IsAny(Z)?S.Union:S.False}function f4(Z,X){return _0(X)?B0(Z,X):O.IsObject(X)&&w6(X)?S.True:O.IsArray(X)&&w4(Z,X)?S.True:!O.IsTuple(X)?S.False:D0.IsUndefined(Z.items)&&!D0.IsUndefined(X.items)||!D0.IsUndefined(Z.items)&&D0.IsUndefined(X.items)?S.False:D0.IsUndefined(Z.items)&&!D0.IsUndefined(X.items)?S.True:Z.items.every((z,W)=>s(z,X.items[W])===S.True)?S.True:S.False}function b4(Z,X){return _0(X)?B0(Z,X):O.IsObject(X)?N0(Z,X):O.IsRecord(X)?d0(Z,X):O.IsUint8Array(X)?S.True:S.False}function x4(Z,X){return _0(X)?B0(Z,X):O.IsObject(X)?N0(Z,X):O.IsRecord(X)?d0(Z,X):O.IsVoid(X)?v4(Z,X):O.IsUndefined(X)?S.True:S.False}function k5(Z,X){return X.anyOf.some((z)=>s(Z,z)===S.True)?S.True:S.False}function g4(Z,X){return Z.anyOf.every((z)=>s(z,X)===S.True)?S.True:S.False}function C2(Z,X){return S.True}function h4(Z,X){return O.IsNever(X)?K2(Z,X):O.IsIntersect(X)?P6(Z,X):O.IsUnion(X)?k5(Z,X):O.IsAny(X)?w5(Z,X):O.IsString(X)?S2(Z,X):O.IsNumber(X)?j2(Z,X):O.IsInteger(X)?N2(Z,X):O.IsBoolean(X)?F2(Z,X):O.IsArray(X)?z4(Z,X):O.IsTuple(X)?k4(Z,X):O.IsObject(X)?N0(Z,X):O.IsUnknown(X)?S.True:S.False}function v4(Z,X){return O.IsUndefined(Z)?S.True:O.IsUndefined(Z)?S.True:S.False}function y4(Z,X){return O.IsIntersect(X)?P6(Z,X):O.IsUnion(X)?k5(Z,X):O.IsUnknown(X)?C2(Z,X):O.IsAny(X)?w5(Z,X):O.IsObject(X)?N0(Z,X):O.IsVoid(X)?S.True:S.False}function s(Z,X){return O.IsTemplateLiteral(Z)||O.IsTemplateLiteral(X)?P4(Z,X):O.IsRegExp(Z)||O.IsRegExp(X)?E4(Z,X):O.IsNot(Z)||O.IsNot(X)?M4(Z,X):O.IsAny(Z)?X4(Z,X):O.IsArray(Z)?$4(Z,X):O.IsBigInt(Z)?W4(Z,X):O.IsBoolean(Z)?H4(Z,X):O.IsAsyncIterator(Z)?Q4(Z,X):O.IsConstructor(Z)?J4(Z,X):O.IsDate(Z)?Y4(Z,X):O.IsFunction(Z)?V4(Z,X):O.IsInteger(Z)?_4(Z,X):O.IsIntersect(Z)?B4(Z,X):O.IsIterator(Z)?U4(Z,X):O.IsLiteral(Z)?G4(Z,X):O.IsNever(Z)?q4(Z,X):O.IsNull(Z)?A4(Z,X):O.IsNumber(Z)?L4(Z,X):O.IsObject(Z)?R4(Z,X):O.IsRecord(Z)?C4(Z,X):O.IsString(Z)?I4(Z,X):O.IsSymbol(Z)?T4(Z,X):O.IsTuple(Z)?f4(Z,X):O.IsPromise(Z)?S4(Z,X):O.IsUint8Array(Z)?b4(Z,X):O.IsUndefined(Z)?x4(Z,X):O.IsUnion(Z)?g4(Z,X):O.IsUnknown(Z)?h4(Z,X):O.IsVoid(Z)?y4(Z,X):Y8(\`Unknown left type operand '\${Z[I]}'\`)}function CZ(Z,X){return s(Z,X)}function m4(Z,X,z,W,Y){let q={};for(let B of globalThis.Object.getOwnPropertyNames(Z))q[B]=V8(Z[B],X,z,W,e(Y));return q}function u4(Z,X,z,W,Y){return m4(Z.properties,X,z,W,Y)}function E2(Z,X,z,W,Y){let q=u4(Z,X,z,W,Y);return m(q)}function c4(Z,X,z,W){let Y=CZ(Z,X);return Y===S.Union?d([z,W]):Y===S.True?z:W}function V8(Z,X,z,W,Y){return Z0(Z)?E2(Z,X,z,W,Y):k0(Z)?R(I2(Z,X,z,W,Y)):R(c4(Z,X,z,W),Y)}function d4(Z,X,z,W,Y){return{[Z]:V8(c(Z),X,z,W,e(Y))}}function p4(Z,X,z,W,Y){return Z.reduce((q,B)=>{return{...q,...d4(B,X,z,W,Y)}},{})}function l4(Z,X,z,W,Y){return p4(Z.keys,X,z,W,Y)}function I2(Z,X,z,W,Y){let q=l4(Z,X,z,W,Y);return m(q)}function T2(Z,X){return _8(nZ(Z),X)}function n4(Z,X){let z=Z.filter((W)=>CZ(W,X)===S.False);return z.length===1?z[0]:d(z)}function _8(Z,X,z={}){if(f0(Z))return R(T2(Z,X),z);if(Z0(Z))return R(P2(Z,X),z);return R(v(Z)?n4(Z.anyOf,X):CZ(Z,X)!==S.False?y():Z,z)}function i4(Z,X){let z={};for(let W of globalThis.Object.getOwnPropertyNames(Z))z[W]=_8(Z[W],X);return z}function o4(Z,X){return i4(Z.properties,X)}function P2(Z,X){let z=o4(Z,X);return m(z)}function w2(Z,X){return B8(nZ(Z),X)}function s4(Z,X){let z=Z.filter((W)=>CZ(W,X)!==S.False);return z.length===1?z[0]:d(z)}function B8(Z,X,z){if(f0(Z))return R(w2(Z,X),z);if(Z0(Z))return R(k2(Z,X),z);return R(v(Z)?s4(Z.anyOf,X):CZ(Z,X)!==S.False?Z:y(),z)}function a4(Z,X){let z={};for(let W of globalThis.Object.getOwnPropertyNames(Z))z[W]=B8(Z[W],X);return z}function r4(Z,X){return a4(Z.properties,X)}function k2(Z,X){let z=r4(Z,X);return m(z)}function f2(Z,X){return t0(Z)?R(Z.returns,X):y(X)}function k6(Z){return E0(O0(Z))}function iZ(Z,X,z){return R({[I]:"Record",type:"object",patternProperties:{[Z]:X}},z)}function f5(Z,X,z){let W={};for(let Y of Z)W[Y]=X;return o(W,{...z,[v0]:"Record"})}function t4(Z,X,z){return nX(Z)?f5(C0(Z),X,z):iZ(Z.pattern,X,z)}function e4(Z,X,z){return f5(C0(d(Z)),X,z)}function ZH(Z,X,z){return f5([Z.toString()],X,z)}function XH(Z,X,z){return iZ(Z.source,X,z)}function zH(Z,X,z){let W=J0(Z.pattern)?KZ:Z.pattern;return iZ(W,X,z)}function $H(Z,X,z){return iZ(KZ,X,z)}function QH(Z,X,z){return iZ(hX,X,z)}function WH(Z,X,z){return o({true:X,false:X},z)}function HH(Z,X,z){return iZ(NZ,X,z)}function JH(Z,X,z){return iZ(NZ,X,z)}function f6(Z,X,z={}){return v(Z)?e4(Z.anyOf,X,z):f0(Z)?t4(Z,X,z):w0(Z)?ZH(Z.const,X,z):UZ(Z)?WH(Z,X,z):ZZ(Z)?HH(Z,X,z):XZ(Z)?JH(Z,X,z):D5(Z)?XH(Z,X,z):GZ(Z)?zH(Z,X,z):A5(Z)?$H(Z,X,z):OZ(Z)?QH(Z,X,z):y(z)}function b6(Z){return globalThis.Object.getOwnPropertyNames(Z.patternProperties)[0]}function b2(Z){let X=b6(Z);return X===KZ?zZ():X===NZ?y0():zZ({pattern:X})}function x6(Z){return Z.patternProperties[b6(Z)]}function YH(Z,X){return X.parameters=d8(Z,X.parameters),X.returns=$Z(Z,X.returns),X}function VH(Z,X){return X.parameters=d8(Z,X.parameters),X.returns=$Z(Z,X.returns),X}function _H(Z,X){return X.allOf=d8(Z,X.allOf),X}function BH(Z,X){return X.anyOf=d8(Z,X.anyOf),X}function UH(Z,X){if(J0(X.items))return X;return X.items=d8(Z,X.items),X}function GH(Z,X){return X.items=$Z(Z,X.items),X}function qH(Z,X){return X.items=$Z(Z,X.items),X}function MH(Z,X){return X.items=$Z(Z,X.items),X}function AH(Z,X){return X.item=$Z(Z,X.item),X}function LH(Z,X){let z=NH(Z,X.properties);return{...X,...o(z)}}function DH(Z,X){let z=$Z(Z,b2(X)),W=$Z(Z,x6(X)),Y=f6(z,W);return{...X,...Y}}function OH(Z,X){return X.index in Z?Z[X.index]:SZ()}function FH(Z,X){let z=tZ(X),W=S0(X),Y=$Z(Z,X);return z&&W?k6(Y):z&&!W?E0(Y):!z&&W?O0(Y):Y}function NH(Z,X){return globalThis.Object.getOwnPropertyNames(X).reduce((z,W)=>{return{...z,[W]:FH(Z,X[W])}},{})}function d8(Z,X){return X.map((z)=>$Z(Z,z))}function $Z(Z,X){return t0(X)?YH(Z,X):e0(X)?VH(Z,X):z0(X)?_H(Z,X):v(X)?BH(Z,X):b0(X)?UH(Z,X):a0(X)?GH(Z,X):mZ(X)?qH(Z,X):cZ(X)?MH(Z,X):dZ(X)?AH(Z,X):Y0(X)?LH(Z,X):pZ(X)?DH(Z,X):L5(X)?OH(Z,X):X}function x2(Z,X){return $Z(X,rZ(Z))}function g2(Z){return R({[I]:"Integer",type:"integer"},Z)}function KH(Z,X,z){return{[Z]:QZ(c(Z),X,e(z))}}function jH(Z,X,z){return Z.reduce((Y,q)=>{return{...Y,...KH(q,X,z)}},{})}function RH(Z,X,z){return jH(Z.keys,X,z)}function h2(Z,X,z){let W=RH(Z,X,z);return m(W)}function SH(Z){let[X,z]=[Z.slice(0,1),Z.slice(1)];return[X.toLowerCase(),z].join("")}function CH(Z){let[X,z]=[Z.slice(0,1),Z.slice(1)];return[X.toUpperCase(),z].join("")}function EH(Z){return Z.toUpperCase()}function IH(Z){return Z.toLowerCase()}function TH(Z,X,z){let W=$8(Z.pattern);if(!lZ(W))return{...Z,pattern:v2(Z.pattern,X)};let B=[...y8(W)].map((H)=>c(H)),U=y2(B,X),G=d(U);return N6([G],z)}function v2(Z,X){return typeof Z==="string"?X==="Uncapitalize"?SH(Z):X==="Capitalize"?CH(Z):X==="Uppercase"?EH(Z):X==="Lowercase"?IH(Z):Z:Z.toString()}function y2(Z,X){return Z.map((z)=>QZ(z,X))}function QZ(Z,X,z={}){return k0(Z)?h2(Z,X,z):f0(Z)?TH(Z,X,z):v(Z)?d(y2(Z.anyOf,X),z):w0(Z)?c(v2(Z.const,X),z):R(Z,z)}function m2(Z,X={}){return QZ(Z,"Capitalize",X)}function u2(Z,X={}){return QZ(Z,"Lowercase",X)}function c2(Z,X={}){return QZ(Z,"Uncapitalize",X)}function d2(Z,X={}){return QZ(Z,"Uppercase",X)}function PH(Z,X,z){let W={};for(let Y of globalThis.Object.getOwnPropertyNames(Z))W[Y]=EZ(Z[Y],X,e(z));return W}function wH(Z,X,z){return PH(Z.properties,X,z)}function p2(Z,X,z){let W=wH(Z,X,z);return m(W)}function kH(Z,X){return Z.map((z)=>b5(z,X))}function fH(Z,X){return Z.map((z)=>b5(z,X))}function bH(Z,X){let{[X]:z,...W}=Z;return W}function xH(Z,X){return X.reduce((z,W)=>bH(z,W),Z)}function gH(Z,X,z){let W=$0(Z,[V0,"$id","required","properties"]),Y=xH(z,X);return o(Y,W)}function hH(Z){let X=Z.reduce((z,W)=>A6(W)?[...z,c(W)]:z,[]);return d(X)}function b5(Z,X){return z0(Z)?F0(kH(Z.allOf,X)):v(Z)?d(fH(Z.anyOf,X)):Y0(Z)?gH(Z,X,Z.properties):o({})}function EZ(Z,X,z){let W=H0(X)?hH(X):X,Y=x0(X)?C0(X):X,q=W0(Z),B=W0(X);return Z0(Z)?p2(Z,Y,z):k0(X)?l2(Z,X,z):q&&B?t("Omit",[Z,W],z):!q&&B?t("Omit",[Z,W],z):q&&!B?t("Omit",[Z,W],z):R({...b5(Z,Y),...z})}function vH(Z,X,z){return{[X]:EZ(Z,[X],e(z))}}function yH(Z,X,z){return X.reduce((W,Y)=>{return{...W,...vH(Z,Y,z)}},{})}function mH(Z,X,z){return yH(Z,X.keys,z)}function l2(Z,X,z){let W=mH(Z,X,z);return m(W)}function uH(Z,X,z){let W={};for(let Y of globalThis.Object.getOwnPropertyNames(Z))W[Y]=IZ(Z[Y],X,e(z));return W}function cH(Z,X,z){return uH(Z.properties,X,z)}function n2(Z,X,z){let W=cH(Z,X,z);return m(W)}function dH(Z,X){return Z.map((z)=>x5(z,X))}function pH(Z,X){return Z.map((z)=>x5(z,X))}function lH(Z,X){let z={};for(let W of X)if(W in Z)z[W]=Z[W];return z}function nH(Z,X,z){let W=$0(Z,[V0,"$id","required","properties"]),Y=lH(z,X);return o(Y,W)}function iH(Z){let X=Z.reduce((z,W)=>A6(W)?[...z,c(W)]:z,[]);return d(X)}function x5(Z,X){return z0(Z)?F0(dH(Z.allOf,X)):v(Z)?d(pH(Z.anyOf,X)):Y0(Z)?nH(Z,X,Z.properties):o({})}function IZ(Z,X,z){let W=H0(X)?iH(X):X,Y=x0(X)?C0(X):X,q=W0(Z),B=W0(X);return Z0(Z)?n2(Z,Y,z):k0(X)?i2(Z,X,z):q&&B?t("Pick",[Z,W],z):!q&&B?t("Pick",[Z,W],z):q&&!B?t("Pick",[Z,W],z):R({...x5(Z,Y),...z})}function oH(Z,X,z){return{[X]:IZ(Z,[X],e(z))}}function sH(Z,X,z){return X.reduce((W,Y)=>{return{...W,...oH(Z,Y,z)}},{})}function aH(Z,X,z){return sH(Z,X.keys,z)}function i2(Z,X,z){let W=aH(Z,X,z);return m(W)}function rH(Z,X){return t("Partial",[t(Z,X)])}function tH(Z){return t("Partial",[JZ(Z)])}function eH(Z){let X={};for(let z of globalThis.Object.getOwnPropertyNames(Z))X[z]=O0(Z[z]);return X}function ZJ(Z,X){let z=$0(Z,[V0,"$id","required","properties"]),W=eH(X);return o(W,z)}function o2(Z){return Z.map((X)=>s2(X))}function s2(Z){return r0(Z)?rH(Z.target,Z.parameters):W0(Z)?tH(Z.$ref):z0(Z)?F0(o2(Z.allOf)):v(Z)?d(o2(Z.anyOf)):Y0(Z)?ZJ(Z,Z.properties):uZ(Z)?Z:UZ(Z)?Z:ZZ(Z)?Z:w0(Z)?Z:k8(Z)?Z:XZ(Z)?Z:GZ(Z)?Z:f8(Z)?Z:b8(Z)?Z:o({})}function U8(Z,X){if(Z0(Z))return a2(Z,X);else return R({...s2(Z),...X})}function XJ(Z,X){let z={};for(let W of globalThis.Object.getOwnPropertyNames(Z))z[W]=U8(Z[W],e(X));return z}function zJ(Z,X){return XJ(Z.properties,X)}function a2(Z,X){let z=zJ(Z,X);return m(z)}function $J(Z,X){return t("Required",[t(Z,X)])}function QJ(Z){return t("Required",[JZ(Z)])}function WJ(Z){let X={};for(let z of globalThis.Object.getOwnPropertyNames(Z))X[z]=$0(Z[z],[L0]);return X}function HJ(Z,X){let z=$0(Z,[V0,"$id","required","properties"]),W=WJ(X);return o(W,z)}function r2(Z){return Z.map((X)=>t2(X))}function t2(Z){return r0(Z)?$J(Z.target,Z.parameters):W0(Z)?QJ(Z.$ref):z0(Z)?F0(r2(Z.allOf)):v(Z)?d(r2(Z.anyOf)):Y0(Z)?HJ(Z,Z.properties):uZ(Z)?Z:UZ(Z)?Z:ZZ(Z)?Z:w0(Z)?Z:k8(Z)?Z:XZ(Z)?Z:GZ(Z)?Z:f8(Z)?Z:b8(Z)?Z:o({})}function G8(Z,X){if(Z0(Z))return e2(Z,X);else return R({...t2(Z),...X})}function JJ(Z,X){let z={};for(let W of globalThis.Object.getOwnPropertyNames(Z))z[W]=G8(Z[W],X);return z}function YJ(Z,X){return JJ(Z.properties,X)}function e2(Z,X){let z=YJ(Z,X);return m(z)}function VJ(Z,X){return X.map((z)=>{return W0(z)?g5(Z,z.$ref):g0(Z,z)})}function g5(Z,X){return X in Z?W0(Z[X])?g5(Z,Z[X].$ref):g0(Z,Z[X]):y()}function _J(Z){return H8(Z[0])}function BJ(Z){return RZ(Z[0],Z[1])}function UJ(Z){return J8(Z[0])}function GJ(Z){return U8(Z[0])}function qJ(Z){return EZ(Z[0],Z[1])}function MJ(Z){return IZ(Z[0],Z[1])}function AJ(Z){return G8(Z[0])}function LJ(Z,X,z){let W=VJ(Z,z);return X==="Awaited"?_J(W):X==="Index"?BJ(W):X==="KeyOf"?UJ(W):X==="Partial"?GJ(W):X==="Omit"?qJ(W):X==="Pick"?MJ(W):X==="Required"?AJ(W):y()}function DJ(Z,X){return eZ(g0(Z,X))}function OJ(Z,X){return Z8(g0(Z,X))}function FJ(Z,X,z){return X8(p8(Z,X),g0(Z,z))}function NJ(Z,X,z){return WZ(p8(Z,X),g0(Z,z))}function KJ(Z,X){return F0(p8(Z,X))}function jJ(Z,X){return W8(g0(Z,X))}function RJ(Z,X){return o(globalThis.Object.keys(X).reduce((z,W)=>{return{...z,[W]:g0(Z,X[W])}},{}))}function SJ(Z,X){let[z,W]=[g0(Z,x6(X)),b6(X)],Y=rZ(X);return Y.patternProperties[W]=z,Y}function CJ(Z,X){return W0(X)?{...g5(Z,X.$ref),[V0]:X[V0]}:X}function EJ(Z,X){return m0(p8(Z,X))}function IJ(Z,X){return d(p8(Z,X))}function p8(Z,X){return X.map((z)=>g0(Z,z))}function g0(Z,X){return S0(X)?R(g0(Z,$0(X,[L0])),X):tZ(X)?R(g0(Z,$0(X,[s0])),X):FZ(X)?R(CJ(Z,X),X):a0(X)?R(DJ(Z,X.items),X):mZ(X)?R(OJ(Z,X.items),X):r0(X)?R(LJ(Z,X.target,X.parameters)):t0(X)?R(FJ(Z,X.parameters,X.returns),X):e0(X)?R(NJ(Z,X.parameters,X.returns),X):z0(X)?R(KJ(Z,X.allOf),X):cZ(X)?R(jJ(Z,X.items),X):Y0(X)?R(RJ(Z,X.properties),X):pZ(X)?R(SJ(Z,X)):b0(X)?R(EJ(Z,X.items||[]),X):v(X)?R(IJ(Z,X.anyOf),X):X}function TJ(Z,X){return X in Z?g0(Z,Z[X]):y()}function Z9(Z){return globalThis.Object.getOwnPropertyNames(Z).reduce((X,z)=>{return{...X,[z]:TJ(Z,z)}},{})}class X9{constructor(Z){let X=Z9(Z),z=this.WithIdentifiers(X);this.$defs=z}Import(Z,X){let z={...this.$defs,[Z]:R(this.$defs[Z],X)};return R({[I]:"Import",$defs:z,$ref:Z})}WithIdentifiers(Z){return globalThis.Object.getOwnPropertyNames(Z).reduce((X,z)=>{return{...X,[z]:{...Z[z],$id:z}}},{})}}function z9(Z){return new X9(Z)}function $9(Z,X){return R({[I]:"Not",not:Z},X)}function Q9(Z,X){return e0(Z)?m0(Z.parameters,X):y()}var PJ=0;function W9(Z,X={}){if(J0(X.$id))X.$id=\`T\${PJ++}\`;let z=rZ(Z({[I]:"This",$ref:\`\${X.$id}\`}));return z.$id=X.$id,R({[v0]:"Recursive",...z},X)}function H9(Z,X){let z=a(Z)?new globalThis.RegExp(Z):Z;return R({[I]:"RegExp",type:"RegExp",source:z.source,flags:z.flags},X)}function wJ(Z){return z0(Z)?Z.allOf:v(Z)?Z.anyOf:b0(Z)?Z.items??[]:[]}function J9(Z){return wJ(Z)}function Y9(Z,X){return e0(Z)?R(Z.returns,X):y(X)}class V9{constructor(Z){this.schema=Z}Decode(Z){return new _9(this.schema,Z)}}class _9{constructor(Z,X){this.schema=Z,this.decode=X}EncodeTransform(Z,X){let Y={Encode:(q)=>X[V0].Encode(Z(q)),Decode:(q)=>this.decode(X[V0].Decode(q))};return{...X,[V0]:Y}}EncodeSchema(Z,X){let z={Decode:this.decode,Encode:Z};return{...X,[V0]:z}}Encode(Z){return FZ(this.schema)?this.EncodeTransform(Z,this.schema):this.EncodeSchema(Z,this.schema)}}function B9(Z){return new V9(Z)}function U9(Z={}){return R({[I]:Z[I]??"Unsafe"},Z)}function G9(Z){return R({[I]:"Void",type:"void"},Z)}var h5={};m6(h5,{Void:()=>G9,Uppercase:()=>d2,Unsafe:()=>U9,Unknown:()=>SZ,Union:()=>d,Undefined:()=>E6,Uncapitalize:()=>c2,Uint8Array:()=>I6,Tuple:()=>m0,Transform:()=>B9,TemplateLiteral:()=>N6,Symbol:()=>C6,String:()=>zZ,ReturnType:()=>Y9,Rest:()=>J9,Required:()=>G8,RegExp:()=>H9,Ref:()=>JZ,Recursive:()=>W9,Record:()=>f6,ReadonlyOptional:()=>k6,Readonly:()=>E0,Promise:()=>j6,Pick:()=>IZ,Partial:()=>U8,Parameters:()=>Q9,Optional:()=>O0,Omit:()=>EZ,Object:()=>o,Number:()=>y0,Null:()=>S6,Not:()=>$9,Never:()=>y,Module:()=>z9,Mapped:()=>W2,Lowercase:()=>u2,Literal:()=>c,KeyOf:()=>J8,Iterator:()=>W8,Intersect:()=>F0,Integer:()=>g2,Instantiate:()=>x2,InstanceType:()=>f2,Index:()=>RZ,Function:()=>WZ,Extract:()=>B8,Extends:()=>V8,Exclude:()=>_8,Enum:()=>q2,Date:()=>R6,ConstructorParameters:()=>G2,Constructor:()=>X8,Const:()=>U2,Composite:()=>B2,Capitalize:()=>m2,Boolean:()=>F6,BigInt:()=>Q8,Awaited:()=>H8,AsyncIterator:()=>Z8,Array:()=>eZ,Argument:()=>cX,Any:()=>jZ});var b=h5;var q9="http://127.0.0.1:3850",q8="pi",TZ="plugin",p0=5000,l8=1e4,M9=5000,g6="signet-pi-hidden-recall",h6="signet-pi-session-context";function A9(Z){return J5(Z,{logPrefix:"signet-pi",actorName:"pi-extension",runtimePath:TZ,defaultTimeout:p0})}var kJ=new Set([g6,h6]),L9={harness:q8,runtimePath:TZ,writeTimeout:l8,promptSubmitTimeout:M9,excludedCustomTypes:kJ,sessionStartTimeout:()=>p0,staticFallback:Y5};function D9(Z,X){return{role:"custom",customType:Z,display:!1,content:\`<signet-memory source="auto-recall">
24313
+ \`)}\`}var wY=yQ();function DZ(Z){return typeof Z==="object"&&Z!==null}function S8(Z){let X=Reflect.get(globalThis,"process");if(!DZ(X))return;let z=Reflect.get(X,"env");if(!DZ(z))return;let W=Reflect.get(z,Z);return typeof W==="string"?W:void 0}function p(Z){if(typeof Z!=="string")return;let X=Z.trim();return X.length>0?X:void 0}function o0(Z){return p(S8(Z))}import{existsSync as mQ,readFileSync as uQ}from"node:fs";function x7(Z){return Z.replace(/\\s*\\r?\\n\\s*/g," ").trim()}function cQ(Z){let X=Z?.trim().toLowerCase();if(!X||["user","human","client"].includes(X))return"User";if(["assistant","agent","model","ai"].includes(X))return"Assistant";if(["system","developer"].includes(X))return"System";if(["custom","tool","toolresult","tool_result","bashexecution","pythonexecution"].includes(X))return X==="custom"?"Custom":"Tool";return}function dQ(Z){if(typeof Z==="string"){let z=x7(Z);return z.length>0?z:void 0}if(!Array.isArray(Z))return;let X=[];for(let z of Z){if(!DZ(z))continue;let W=p(z.text)??p(z.input_text)??p(z.content);if(!W)continue;X.push(x7(W))}if(X.length===0)return;return X.join(" ")}function g7(Z,X){let z=dQ(X),W=cQ(Z);if(!z||!W)return;return\`\${W}: \${z}\`}function pQ(Z,X){if(!DZ(Z)||typeof Z.type!=="string")return;if(Z.type==="custom_message"){if(typeof Z.customType==="string"&&X.has(Z.customType))return;return g7("custom",Z.content)}if(Z.type!=="message")return;if(!DZ(Z.message))return;let z=p(Z.message.role),W=Reflect.get(Z.message,"content")??Reflect.get(Z.message,"parts");return g7(z,W)}function Y6(Z,X=new Set){let z=[];for(let W of Z){let Y=pQ(W,X);if(!Y)continue;z.push(Y)}if(z.length===0)return;return z.join(\`
24314
+ \`)}function lQ(Z){try{return JSON.parse(Z)}catch{return}}function nQ(Z){let X,z=[];for(let W of Z){let Y=lQ(W);if(!DZ(Y)||typeof Y.type!=="string")continue;if(Y.type==="session"){X=Y;continue}z.push(Y)}return{header:X,entries:z}}function iQ(Z){return uQ(Z,"utf-8").split(\`
24315
+ \`).map((X)=>X.trim()).filter((X)=>X.length>0)}function oQ(Z){return p(Z?.cwd)??p(Z?.project)??p(Z?.workspace)}function V6(Z,X=new Set){if(!Z||!mQ(Z))return{loaded:!1,sessionId:void 0,project:void 0,transcript:void 0};try{let{header:z,entries:W}=nQ(iQ(Z));return{loaded:!0,sessionId:p(z?.id),project:oQ(z),transcript:Y6(W,X)}}catch{return{loaded:!1,sessionId:void 0,project:void 0,transcript:void 0}}}function sQ(){return o0("SIGNET_API_KEY")??o0("SIGNET_TOKEN")}function aQ(Z){let X={"Content-Type":"application/json","x-signet-runtime-path":Z.runtimePath,"x-signet-actor":Z.actorName,"x-signet-actor-type":"harness"},z=sQ();if(z)X.Authorization=\`Bearer \${z}\`;return X}function y7(Z){if(typeof Z!=="object"||Z===null)return"";let X=Reflect.get(Z,"name");return typeof X==="string"?X:""}function h7(Z){let X=y7(Z);if(X==="AbortError"||X==="TimeoutError")return!0;return(typeof Z==="object"&&Z!==null?Reflect.get(Z,"code"):void 0)==="ABORT_ERR"}async function v7(Z,X,z,W={}){let{method:Y="POST",body:q,timeout:B=z.defaultTimeout}=W;try{let U={method:Y,headers:aQ(z),signal:AbortSignal.timeout(B)};if(q!==void 0)U.body=JSON.stringify(q);let G=await fetch(\`\${Z}\${X}\`,U);if(!G.ok)return console.warn(\`[\${z.logPrefix}] \${Y} \${X} failed: \${G.status}\`),{ok:!1,reason:"http",status:G.status};try{let H=await G.text();try{return{ok:!0,data:JSON.parse(H)}}catch{return console.warn(\`[\${z.logPrefix}] \${Y} \${X} returned invalid JSON (\${H.length} chars\${H.length===0?", empty body":""})\`),{ok:!1,reason:"invalid-json",status:G.status}}}catch(H){if(h7(H))return console.warn(\`[\${z.logPrefix}] \${Y} \${X} body read timed out after \${B}ms\`),{ok:!1,reason:"timeout"};return console.warn(\`[\${z.logPrefix}] \${Y} \${X} body read failed:\`,y7(H)||H),{ok:!1,reason:"body-read"}}}catch(U){if(h7(U))return console.warn(\`[\${z.logPrefix}] \${Y} \${X} timed out after \${B}ms\`),{ok:!1,reason:"timeout"};return console.warn(\`[\${z.logPrefix}] \${Y} \${X} error:\`,U),{ok:!1,reason:"offline"}}}function J5(Z,X){return{async post(z,W,Y=X.defaultTimeout){let q=await v7(Z,z,X,{method:"POST",body:W,timeout:Y});if(!q.ok)return null;return q.data},postResult(z,W,Y=X.defaultTimeout){return v7(Z,z,X,{method:"POST",body:W,timeout:Y})}}}import{homedir as rQ}from"node:os";import{join as tQ}from"node:path";function Y5(Z){let X=o0("SIGNET_PATH")??tQ(rQ(),".agents");return b7(X)??""}function eQ(Z){let X=Z.sessionManager.getBranch();if(Array.isArray(X)&&X.length>0)return X;let z=Z.sessionManager.getEntries();return Array.isArray(z)?z:[]}function T0(Z){let X=Z.sessionManager.getHeader(),z=p(Z.sessionManager.getSessionId())??p(X?.id),W=p(Z.sessionManager.getSessionFile()),Y=p(Z.cwd)??p(X?.cwd)??p(X?.project)??p(X?.workspace);return{sessionId:z,sessionFile:W,project:Y}}async function C8(Z,X){return await Z.client.post("/api/hooks/session-end",{harness:Z.config.harness,runtimePath:Z.config.runtimePath,reason:X.reason,sessionKey:X.sessionId,sessionId:X.sessionId,agentId:X.agentId,cwd:X.project,...X.transcript?{transcript:X.transcript}:{}},Z.config.writeTimeout)!==null}async function sZ(Z){for(let X of Z.state.getPendingSessionEnds()){if(Z.state.sessionAlreadyEnded(X.sessionId)){Z.state.clearPendingSessionEnd(X.sessionId);continue}let z=V6(X.sessionFile,Z.config.excludedCustomTypes);if(!z.loaded){await C8(Z,{sessionId:X.sessionId,agentId:X.agentId,transcript:void 0,reason:X.reason,project:void 0});continue}if(!await C8(Z,{sessionId:z.sessionId??X.sessionId,agentId:X.agentId,transcript:z.transcript,reason:X.reason,project:z.project}))continue;Z.state.markSessionEnded(X.sessionId),Z.state.clearPendingSessionData(X.sessionId),Z.state.clearPendingSessionEnd(X.sessionId)}}async function LZ(Z,X){await sZ(Z);let z=T0(X);Z.state.setActiveSession(z.sessionId,z.sessionFile),Z.state.clearSessionEnded(z.sessionId);let W=await Z.client.postResult("/api/hooks/session-start",{harness:Z.config.harness,project:z.project,agentId:Z.agentId,sessionKey:z.sessionId,runtimePath:Z.config.runtimePath},Z.config.sessionStartTimeout()),Y=W.ok?W.data.inject??W.data.recentContext??"":Z.config.staticFallback(W.reason==="timeout"?"timeout":"offline");Z.state.setSessionContext(Y),Z.state.setPendingSessionContext(z.sessionId,Y)}async function aZ(Z,X){await sZ(Z);let z=T0(X);if(!z.sessionId)return;if(z.sessionId===Z.state.getActiveSessionId()&&z.sessionFile===Z.state.getActiveSessionFile())return;await LZ(Z,X)}async function _6(Z,X,z){await sZ(Z);let W=T0(X);if(Z.state.sessionAlreadyEnded(W.sessionId))return;if(!await C8(Z,{sessionId:W.sessionId,agentId:Z.agentId,transcript:Y6(eQ(X),Z.config.excludedCustomTypes),reason:z,project:W.project}))return;Z.state.markSessionEnded(W.sessionId),Z.state.clearPendingSessionData(W.sessionId)}async function E8(Z,X,z){let W=p(X.previousSessionFile)??Z.state.getActiveSessionFile(),Y=V6(W,Z.config.excludedCustomTypes),q=Y.sessionId??Z.state.getActiveSessionId();if(Z.state.sessionAlreadyEnded(q))return;if(!Y.loaded){if(q)await C8(Z,{sessionId:q,agentId:Z.agentId,transcript:void 0,reason:z,project:void 0});if(q&&W)Z.state.queuePendingSessionEnd(q,W,Z.agentId,z);return}if(!await C8(Z,{sessionId:q,agentId:Z.agentId,transcript:Y.transcript,reason:z,project:Y.project})){if(q&&W)Z.state.queuePendingSessionEnd(q,W,Z.agentId,z);return}Z.state.markSessionEnded(q),Z.state.clearPendingSessionData(q)}async function I8(Z,X,z){await sZ(Z);let W=p(z);if(!W)return;await aZ(Z,X);let Y=T0(X);if(!Y.sessionId)return;let q=await Z.client.post("/api/hooks/user-prompt-submit",{harness:Z.config.harness,project:Y.project,agentId:Z.agentId,sessionKey:Y.sessionId,userMessage:W,runtimePath:Z.config.runtimePath},Z.config.promptSubmitTimeout);if(!q)return;if(q.sessionKnown===!1)await LZ(Z,X);let B=p(q.inject);if(B)Z.state.queuePendingRecall(Y.sessionId,B)}var V5=64,m7=4,u7=128;function _5(Z){return Z.replace(/<\\/signet-memory>/gi,"<\\\\/signet-memory>")}function B6(Z,X){if(Z.size<X)return;let z=Z.keys().next().value;if(z!==void 0)Z.delete(z)}class U6{pendingSessionContext=new Map;pendingRecall=new Map;pendingSessionEnds=new Map;endedSessions=new Map;activeSessionId;activeSessionFile;sessionContext="";setActiveSession(Z,X){this.activeSessionId=Z,this.activeSessionFile=X}getActiveSessionId(){return this.activeSessionId}getActiveSessionFile(){return this.activeSessionFile}setSessionContext(Z){this.sessionContext=Z}getSessionContext(){return this.sessionContext}markSessionEnded(Z){if(!Z)return;if(!this.endedSessions.has(Z))B6(this.endedSessions,u7);this.endedSessions.set(Z,Date.now())}clearSessionEnded(Z){if(!Z)return;this.endedSessions.delete(Z)}sessionAlreadyEnded(Z){if(!Z)return!1;return this.endedSessions.has(Z)}setPendingSessionContext(Z,X){if(!Z)return;let z=p(X);if(z){this.pendingSessionContext.set(Z,z);return}this.pendingSessionContext.delete(Z)}clearPendingSessionContext(Z){if(!Z)return;this.pendingSessionContext.delete(Z)}queuePendingRecall(Z,X){if(!this.pendingRecall.has(Z))B6(this.pendingRecall,V5);let z=this.pendingRecall.get(Z)??[];z.push(X);while(z.length>m7)z.shift();this.pendingRecall.set(Z,z)}clearPendingRecall(Z){if(!Z)return;this.pendingRecall.delete(Z)}clearPendingSessionData(Z){if(!Z)return;this.pendingSessionContext.delete(Z),this.pendingRecall.delete(Z),this.pendingSessionEnds.delete(Z)}hasPendingRecall(Z){if(!Z)return!1;let X=this.pendingRecall.get(Z);return Array.isArray(X)&&X.length>0}consumePendingRecall(Z){if(!Z)return;let X=this.pendingRecall.get(Z);if(!X||X.length===0)return;let z=X.shift();if(X.length===0)this.pendingRecall.delete(Z);return p(z)}queuePendingSessionEnd(Z,X,z,W){if(!this.pendingSessionEnds.has(Z))B6(this.pendingSessionEnds,V5);this.pendingSessionEnds.set(Z,{sessionId:Z,sessionFile:X,agentId:z,reason:W})}clearPendingSessionEnd(Z){if(!Z)return;this.pendingSessionEnds.delete(Z)}getPendingSessionEnds(){return Array.from(this.pendingSessionEnds.values())}}var L0={};m6(L0,{IsUndefined:()=>J0,IsUint8Array:()=>BZ,IsSymbol:()=>M5,IsString:()=>a,IsRegExp:()=>P8,IsObject:()=>n,IsNumber:()=>P0,IsNull:()=>q5,IsIterator:()=>G5,IsFunction:()=>U5,IsDate:()=>yZ,IsBoolean:()=>_Z,IsBigInt:()=>T8,IsAsyncIterator:()=>B5,IsArray:()=>H0,HasPropertyKey:()=>G6});function G6(Z,X){return X in Z}function B5(Z){return n(Z)&&!H0(Z)&&!BZ(Z)&&Symbol.asyncIterator in Z}function H0(Z){return Array.isArray(Z)}function T8(Z){return typeof Z==="bigint"}function _Z(Z){return typeof Z==="boolean"}function yZ(Z){return Z instanceof globalThis.Date}function U5(Z){return typeof Z==="function"}function G5(Z){return n(Z)&&!H0(Z)&&!BZ(Z)&&Symbol.iterator in Z}function q5(Z){return Z===null}function P0(Z){return typeof Z==="number"}function n(Z){return typeof Z==="object"&&Z!==null}function P8(Z){return Z instanceof globalThis.RegExp}function a(Z){return typeof Z==="string"}function M5(Z){return typeof Z==="symbol"}function BZ(Z){return Z instanceof globalThis.Uint8Array}function J0(Z){return Z===void 0}function Z1(Z){return Z.map((X)=>q6(X))}function X1(Z){return new Date(Z.getTime())}function z1(Z){return new Uint8Array(Z)}function $1(Z){return new RegExp(Z.source,Z.flags)}function Q1(Z){let X={};for(let z of Object.getOwnPropertyNames(Z))X[z]=q6(Z[z]);for(let z of Object.getOwnPropertySymbols(Z))X[z]=q6(Z[z]);return X}function q6(Z){return H0(Z)?Z1(Z):yZ(Z)?X1(Z):BZ(Z)?z1(Z):P8(Z)?$1(Z):n(Z)?Q1(Z):Z}function e(Z){return q6(Z)}function rZ(Z,X){return X===void 0?e(Z):e({...X,...Z})}function c7(Z){return Z!==null&&typeof Z==="object"}function d7(Z){return globalThis.Array.isArray(Z)&&!globalThis.ArrayBuffer.isView(Z)}function p7(Z){return Z===void 0}function l7(Z){return typeof Z==="number"}var M6;(function(Z){Z.InstanceMode="default",Z.ExactOptionalPropertyTypes=!1,Z.AllowArrayObject=!1,Z.AllowNaN=!1,Z.AllowNullVoid=!1;function X(B,U){return Z.ExactOptionalPropertyTypes?U in B:B[U]!==void 0}Z.IsExactOptionalProperty=X;function z(B){let U=c7(B);return Z.AllowArrayObject?U:U&&!d7(B)}Z.IsObjectLike=z;function W(B){return z(B)&&!(B instanceof Date)&&!(B instanceof Uint8Array)}Z.IsRecordLike=W;function Y(B){return Z.AllowNaN?l7(B):Number.isFinite(B)}Z.IsNumberLike=Y;function q(B){let U=p7(B);return Z.AllowNullVoid?U||B===null:U}Z.IsVoidLike=q})(M6||(M6={}));function W1(Z){return globalThis.Object.freeze(Z).map((X)=>w8(X))}function H1(Z){return Z}function J1(Z){return Z}function Y1(Z){return Z}function V1(Z){let X={};for(let z of Object.getOwnPropertyNames(Z))X[z]=w8(Z[z]);for(let z of Object.getOwnPropertySymbols(Z))X[z]=w8(Z[z]);return globalThis.Object.freeze(X)}function w8(Z){return H0(Z)?W1(Z):yZ(Z)?H1(Z):BZ(Z)?J1(Z):P8(Z)?Y1(Z):n(Z)?V1(Z):Z}function R(Z,X){let z=X!==void 0?{...X,...Z}:Z;switch(M6.InstanceMode){case"freeze":return w8(z);case"clone":return e(z);default:return z}}class A0 extends Error{constructor(Z){super(Z)}}var V0=Symbol.for("TypeBox.Transform"),s0=Symbol.for("TypeBox.Readonly"),D0=Symbol.for("TypeBox.Optional"),v0=Symbol.for("TypeBox.Hint"),I=Symbol.for("TypeBox.Kind");function tZ(Z){return n(Z)&&Z[s0]==="Readonly"}function S0(Z){return n(Z)&&Z[D0]==="Optional"}function A5(Z){return h(Z,"Any")}function D5(Z){return h(Z,"Argument")}function a0(Z){return h(Z,"Array")}function mZ(Z){return h(Z,"AsyncIterator")}function uZ(Z){return h(Z,"BigInt")}function UZ(Z){return h(Z,"Boolean")}function r0(Z){return h(Z,"Computed")}function t0(Z){return h(Z,"Constructor")}function _1(Z){return h(Z,"Date")}function e0(Z){return h(Z,"Function")}function ZZ(Z){return h(Z,"Integer")}function z0(Z){return h(Z,"Intersect")}function cZ(Z){return h(Z,"Iterator")}function h(Z,X){return n(Z)&&I in Z&&Z[I]===X}function A6(Z){return _Z(Z)||P0(Z)||a(Z)}function w0(Z){return h(Z,"Literal")}function k0(Z){return h(Z,"MappedKey")}function Z0(Z){return h(Z,"MappedResult")}function OZ(Z){return h(Z,"Never")}function B1(Z){return h(Z,"Not")}function k8(Z){return h(Z,"Null")}function XZ(Z){return h(Z,"Number")}function Y0(Z){return h(Z,"Object")}function dZ(Z){return h(Z,"Promise")}function pZ(Z){return h(Z,"Record")}function W0(Z){return h(Z,"Ref")}function L5(Z){return h(Z,"RegExp")}function GZ(Z){return h(Z,"String")}function f8(Z){return h(Z,"Symbol")}function f0(Z){return h(Z,"TemplateLiteral")}function U1(Z){return h(Z,"This")}function FZ(Z){return n(Z)&&V0 in Z}function b0(Z){return h(Z,"Tuple")}function b8(Z){return h(Z,"Undefined")}function v(Z){return h(Z,"Union")}function G1(Z){return h(Z,"Uint8Array")}function q1(Z){return h(Z,"Unknown")}function M1(Z){return h(Z,"Unsafe")}function A1(Z){return h(Z,"Void")}function D1(Z){return n(Z)&&I in Z&&a(Z[I])}function x0(Z){return A5(Z)||D5(Z)||a0(Z)||UZ(Z)||uZ(Z)||mZ(Z)||r0(Z)||t0(Z)||_1(Z)||e0(Z)||ZZ(Z)||z0(Z)||cZ(Z)||w0(Z)||k0(Z)||Z0(Z)||OZ(Z)||B1(Z)||k8(Z)||XZ(Z)||Y0(Z)||dZ(Z)||pZ(Z)||W0(Z)||L5(Z)||GZ(Z)||f8(Z)||f0(Z)||U1(Z)||b0(Z)||b8(Z)||v(Z)||G1(Z)||q1(Z)||M1(Z)||A1(Z)||D1(Z)}var O={};m6(O,{TypeGuardUnknownTypeError:()=>n7,IsVoid:()=>fX,IsUnsafe:()=>kX,IsUnknown:()=>wX,IsUnionLiteral:()=>C1,IsUnion:()=>N5,IsUndefined:()=>TX,IsUint8Array:()=>PX,IsTuple:()=>IX,IsTransform:()=>EX,IsThis:()=>CX,IsTemplateLiteral:()=>SX,IsSymbol:()=>RX,IsString:()=>jX,IsSchema:()=>M0,IsRegExp:()=>KX,IsRef:()=>NX,IsRecursive:()=>S1,IsRecord:()=>FX,IsReadonly:()=>N1,IsProperties:()=>D6,IsPromise:()=>OX,IsOptional:()=>K1,IsObject:()=>LX,IsNumber:()=>DX,IsNull:()=>AX,IsNot:()=>MX,IsNever:()=>qX,IsMappedResult:()=>GX,IsMappedKey:()=>UX,IsLiteralValue:()=>BX,IsLiteralString:()=>VX,IsLiteralNumber:()=>_X,IsLiteralBoolean:()=>R1,IsLiteral:()=>g8,IsKindOf:()=>g,IsKind:()=>bX,IsIterator:()=>YX,IsIntersect:()=>JX,IsInteger:()=>HX,IsImport:()=>j1,IsFunction:()=>WX,IsDate:()=>QX,IsConstructor:()=>$X,IsComputed:()=>zX,IsBoolean:()=>XX,IsBigInt:()=>ZX,IsAsyncIterator:()=>e7,IsArray:()=>t7,IsArgument:()=>r7,IsAny:()=>a7});class n7 extends A0{}var L1=["Argument","Any","Array","AsyncIterator","BigInt","Boolean","Computed","Constructor","Date","Enum","Function","Integer","Intersect","Iterator","Literal","MappedKey","MappedResult","Not","Null","Number","Object","Promise","Record","Ref","RegExp","String","Symbol","TemplateLiteral","This","Tuple","Undefined","Union","Uint8Array","Unknown","Void"];function i7(Z){try{return new RegExp(Z),!0}catch{return!1}}function O5(Z){if(!a(Z))return!1;for(let X=0;X<Z.length;X++){let z=Z.charCodeAt(X);if(z>=7&&z<=13||z===27||z===127)return!1}return!0}function o7(Z){return F5(Z)||M0(Z)}function x8(Z){return J0(Z)||T8(Z)}function r(Z){return J0(Z)||P0(Z)}function F5(Z){return J0(Z)||_Z(Z)}function i(Z){return J0(Z)||a(Z)}function O1(Z){return J0(Z)||a(Z)&&O5(Z)&&i7(Z)}function F1(Z){return J0(Z)||a(Z)&&O5(Z)}function s7(Z){return J0(Z)||M0(Z)}function N1(Z){return n(Z)&&Z[s0]==="Readonly"}function K1(Z){return n(Z)&&Z[D0]==="Optional"}function a7(Z){return g(Z,"Any")&&i(Z.$id)}function r7(Z){return g(Z,"Argument")&&P0(Z.index)}function t7(Z){return g(Z,"Array")&&Z.type==="array"&&i(Z.$id)&&M0(Z.items)&&r(Z.minItems)&&r(Z.maxItems)&&F5(Z.uniqueItems)&&s7(Z.contains)&&r(Z.minContains)&&r(Z.maxContains)}function e7(Z){return g(Z,"AsyncIterator")&&Z.type==="AsyncIterator"&&i(Z.$id)&&M0(Z.items)}function ZX(Z){return g(Z,"BigInt")&&Z.type==="bigint"&&i(Z.$id)&&x8(Z.exclusiveMaximum)&&x8(Z.exclusiveMinimum)&&x8(Z.maximum)&&x8(Z.minimum)&&x8(Z.multipleOf)}function XX(Z){return g(Z,"Boolean")&&Z.type==="boolean"&&i(Z.$id)}function zX(Z){return g(Z,"Computed")&&a(Z.target)&&H0(Z.parameters)&&Z.parameters.every((X)=>M0(X))}function $X(Z){return g(Z,"Constructor")&&Z.type==="Constructor"&&i(Z.$id)&&H0(Z.parameters)&&Z.parameters.every((X)=>M0(X))&&M0(Z.returns)}function QX(Z){return g(Z,"Date")&&Z.type==="Date"&&i(Z.$id)&&r(Z.exclusiveMaximumTimestamp)&&r(Z.exclusiveMinimumTimestamp)&&r(Z.maximumTimestamp)&&r(Z.minimumTimestamp)&&r(Z.multipleOfTimestamp)}function WX(Z){return g(Z,"Function")&&Z.type==="Function"&&i(Z.$id)&&H0(Z.parameters)&&Z.parameters.every((X)=>M0(X))&&M0(Z.returns)}function j1(Z){return g(Z,"Import")&&G6(Z,"$defs")&&n(Z.$defs)&&D6(Z.$defs)&&G6(Z,"$ref")&&a(Z.$ref)&&Z.$ref in Z.$defs}function HX(Z){return g(Z,"Integer")&&Z.type==="integer"&&i(Z.$id)&&r(Z.exclusiveMaximum)&&r(Z.exclusiveMinimum)&&r(Z.maximum)&&r(Z.minimum)&&r(Z.multipleOf)}function D6(Z){return n(Z)&&Object.entries(Z).every(([X,z])=>O5(X)&&M0(z))}function JX(Z){return g(Z,"Intersect")&&(a(Z.type)&&Z.type!=="object"?!1:!0)&&H0(Z.allOf)&&Z.allOf.every((X)=>M0(X)&&!EX(X))&&i(Z.type)&&(F5(Z.unevaluatedProperties)||s7(Z.unevaluatedProperties))&&i(Z.$id)}function YX(Z){return g(Z,"Iterator")&&Z.type==="Iterator"&&i(Z.$id)&&M0(Z.items)}function g(Z,X){return n(Z)&&I in Z&&Z[I]===X}function VX(Z){return g8(Z)&&a(Z.const)}function _X(Z){return g8(Z)&&P0(Z.const)}function R1(Z){return g8(Z)&&_Z(Z.const)}function g8(Z){return g(Z,"Literal")&&i(Z.$id)&&BX(Z.const)}function BX(Z){return _Z(Z)||P0(Z)||a(Z)}function UX(Z){return g(Z,"MappedKey")&&H0(Z.keys)&&Z.keys.every((X)=>P0(X)||a(X))}function GX(Z){return g(Z,"MappedResult")&&D6(Z.properties)}function qX(Z){return g(Z,"Never")&&n(Z.not)&&Object.getOwnPropertyNames(Z.not).length===0}function MX(Z){return g(Z,"Not")&&M0(Z.not)}function AX(Z){return g(Z,"Null")&&Z.type==="null"&&i(Z.$id)}function DX(Z){return g(Z,"Number")&&Z.type==="number"&&i(Z.$id)&&r(Z.exclusiveMaximum)&&r(Z.exclusiveMinimum)&&r(Z.maximum)&&r(Z.minimum)&&r(Z.multipleOf)}function LX(Z){return g(Z,"Object")&&Z.type==="object"&&i(Z.$id)&&D6(Z.properties)&&o7(Z.additionalProperties)&&r(Z.minProperties)&&r(Z.maxProperties)}function OX(Z){return g(Z,"Promise")&&Z.type==="Promise"&&i(Z.$id)&&M0(Z.item)}function FX(Z){return g(Z,"Record")&&Z.type==="object"&&i(Z.$id)&&o7(Z.additionalProperties)&&n(Z.patternProperties)&&((X)=>{let z=Object.getOwnPropertyNames(X.patternProperties);return z.length===1&&i7(z[0])&&n(X.patternProperties)&&M0(X.patternProperties[z[0]])})(Z)}function S1(Z){return n(Z)&&v0 in Z&&Z[v0]==="Recursive"}function NX(Z){return g(Z,"Ref")&&i(Z.$id)&&a(Z.$ref)}function KX(Z){return g(Z,"RegExp")&&i(Z.$id)&&a(Z.source)&&a(Z.flags)&&r(Z.maxLength)&&r(Z.minLength)}function jX(Z){return g(Z,"String")&&Z.type==="string"&&i(Z.$id)&&r(Z.minLength)&&r(Z.maxLength)&&O1(Z.pattern)&&F1(Z.format)}function RX(Z){return g(Z,"Symbol")&&Z.type==="symbol"&&i(Z.$id)}function SX(Z){return g(Z,"TemplateLiteral")&&Z.type==="string"&&a(Z.pattern)&&Z.pattern[0]==="^"&&Z.pattern[Z.pattern.length-1]==="$"}function CX(Z){return g(Z,"This")&&i(Z.$id)&&a(Z.$ref)}function EX(Z){return n(Z)&&V0 in Z}function IX(Z){return g(Z,"Tuple")&&Z.type==="array"&&i(Z.$id)&&P0(Z.minItems)&&P0(Z.maxItems)&&Z.minItems===Z.maxItems&&(J0(Z.items)&&J0(Z.additionalItems)&&Z.minItems===0||H0(Z.items)&&Z.items.every((X)=>M0(X)))}function TX(Z){return g(Z,"Undefined")&&Z.type==="undefined"&&i(Z.$id)}function C1(Z){return N5(Z)&&Z.anyOf.every((X)=>VX(X)||_X(X))}function N5(Z){return g(Z,"Union")&&i(Z.$id)&&n(Z)&&H0(Z.anyOf)&&Z.anyOf.every((X)=>M0(X))}function PX(Z){return g(Z,"Uint8Array")&&Z.type==="Uint8Array"&&i(Z.$id)&&r(Z.minByteLength)&&r(Z.maxByteLength)}function wX(Z){return g(Z,"Unknown")&&i(Z.$id)}function kX(Z){return g(Z,"Unsafe")}function fX(Z){return g(Z,"Void")&&Z.type==="void"&&i(Z.$id)}function bX(Z){return n(Z)&&I in Z&&a(Z[I])&&!L1.includes(Z[I])}function M0(Z){return n(Z)&&(a7(Z)||r7(Z)||t7(Z)||XX(Z)||ZX(Z)||e7(Z)||zX(Z)||$X(Z)||QX(Z)||WX(Z)||HX(Z)||JX(Z)||YX(Z)||g8(Z)||UX(Z)||GX(Z)||qX(Z)||MX(Z)||AX(Z)||DX(Z)||LX(Z)||OX(Z)||FX(Z)||NX(Z)||KX(Z)||jX(Z)||RX(Z)||SX(Z)||CX(Z)||IX(Z)||TX(Z)||N5(Z)||PX(Z)||wX(Z)||kX(Z)||fX(Z)||bX(Z))}var xX="(true|false)",L6="(0|[1-9][0-9]*)",gX="(.*)";var NZ="^(0|[1-9][0-9]*)$",KZ="^(.*)$",hX="^(?!.*)$";function vX(Z,X){return Z.includes(X)}function yX(Z){return[...new Set(Z)]}function E1(Z,X){return Z.filter((z)=>X.includes(z))}function I1(Z,X){return Z.reduce((z,W)=>{return E1(z,W)},X)}function mX(Z){return Z.length===1?Z[0]:Z.length>1?I1(Z.slice(1),Z[0]):[]}function uX(Z){let X=[];for(let z of Z)X.push(...z);return X}function jZ(Z){return R({[I]:"Any"},Z)}function eZ(Z,X){return R({[I]:"Array",type:"array",items:Z},X)}function cX(Z){return R({[I]:"Argument",index:Z})}function Z8(Z,X){return R({[I]:"AsyncIterator",type:"AsyncIterator",items:Z},X)}function t(Z,X,z){return R({[I]:"Computed",target:Z,parameters:X},z)}function T1(Z,X){let{[X]:z,...W}=Z;return W}function $0(Z,X){return X.reduce((z,W)=>T1(z,W),Z)}function y(Z){return R({[I]:"Never",not:{}},Z)}function m(Z){return R({[I]:"MappedResult",properties:Z})}function X8(Z,X,z){return R({[I]:"Constructor",type:"Constructor",parameters:Z,returns:X},z)}function WZ(Z,X,z){return R({[I]:"Function",type:"Function",parameters:Z,returns:X},z)}function h8(Z,X){return R({[I]:"Union",anyOf:Z},X)}function P1(Z){return Z.some((X)=>S0(X))}function dX(Z){return Z.map((X)=>S0(X)?w1(X):X)}function w1(Z){return $0(Z,[D0])}function k1(Z,X){return P1(Z)?O0(h8(dX(Z),X)):h8(dX(Z),X)}function HZ(Z,X){return Z.length===1?R(Z[0],X):Z.length===0?y(X):k1(Z,X)}function d(Z,X){return Z.length===0?y(X):Z.length===1?R(Z[0],X):h8(Z,X)}class K5 extends A0{}function f1(Z){return Z.replace(/\\\\\\$/g,"$").replace(/\\\\\\*/g,"*").replace(/\\\\\\^/g,"^").replace(/\\\\\\|/g,"|").replace(/\\\\\\(/g,"(").replace(/\\\\\\)/g,")")}function j5(Z,X,z){return Z[X]===z&&Z.charCodeAt(X-1)!==92}function MZ(Z,X){return j5(Z,X,"(")}function v8(Z,X){return j5(Z,X,")")}function pX(Z,X){return j5(Z,X,"|")}function b1(Z){if(!(MZ(Z,0)&&v8(Z,Z.length-1)))return!1;let X=0;for(let z=0;z<Z.length;z++){if(MZ(Z,z))X+=1;if(v8(Z,z))X-=1;if(X===0&&z!==Z.length-1)return!1}return!0}function x1(Z){return Z.slice(1,Z.length-1)}function g1(Z){let X=0;for(let z=0;z<Z.length;z++){if(MZ(Z,z))X+=1;if(v8(Z,z))X-=1;if(pX(Z,z)&&X===0)return!0}return!1}function h1(Z){for(let X=0;X<Z.length;X++)if(MZ(Z,X))return!0;return!1}function v1(Z){let[X,z]=[0,0],W=[];for(let q=0;q<Z.length;q++){if(MZ(Z,q))X+=1;if(v8(Z,q))X-=1;if(pX(Z,q)&&X===0){let B=Z.slice(z,q);if(B.length>0)W.push(z8(B));z=q+1}}let Y=Z.slice(z);if(Y.length>0)W.push(z8(Y));if(W.length===0)return{type:"const",const:""};if(W.length===1)return W[0];return{type:"or",expr:W}}function y1(Z){function X(Y,q){if(!MZ(Y,q))throw new K5("TemplateLiteralParser: Index must point to open parens");let B=0;for(let U=q;U<Y.length;U++){if(MZ(Y,U))B+=1;if(v8(Y,U))B-=1;if(B===0)return[q,U]}throw new K5("TemplateLiteralParser: Unclosed group parens in expression")}function z(Y,q){for(let B=q;B<Y.length;B++)if(MZ(Y,B))return[q,B];return[q,Y.length]}let W=[];for(let Y=0;Y<Z.length;Y++)if(MZ(Z,Y)){let[q,B]=X(Z,Y),U=Z.slice(q,B+1);W.push(z8(U)),Y=B}else{let[q,B]=z(Z,Y),U=Z.slice(q,B);if(U.length>0)W.push(z8(U));Y=B-1}return W.length===0?{type:"const",const:""}:W.length===1?W[0]:{type:"and",expr:W}}function z8(Z){return b1(Z)?z8(x1(Z)):g1(Z)?v1(Z):h1(Z)?y1(Z):{type:"const",const:f1(Z)}}function $8(Z){return z8(Z.slice(1,Z.length-1))}class lX extends A0{}function m1(Z){return Z.type==="or"&&Z.expr.length===2&&Z.expr[0].type==="const"&&Z.expr[0].const==="0"&&Z.expr[1].type==="const"&&Z.expr[1].const==="[1-9][0-9]*"}function u1(Z){return Z.type==="or"&&Z.expr.length===2&&Z.expr[0].type==="const"&&Z.expr[0].const==="true"&&Z.expr[1].type==="const"&&Z.expr[1].const==="false"}function c1(Z){return Z.type==="const"&&Z.const===".*"}function lZ(Z){return m1(Z)||c1(Z)?!1:u1(Z)?!0:Z.type==="and"?Z.expr.every((X)=>lZ(X)):Z.type==="or"?Z.expr.every((X)=>lZ(X)):Z.type==="const"?!0:(()=>{throw new lX("Unknown expression type")})()}function nX(Z){let X=$8(Z.pattern);return lZ(X)}class iX extends A0{}function*oX(Z){if(Z.length===1)return yield*Z[0];for(let X of Z[0])for(let z of oX(Z.slice(1)))yield\`\${X}\${z}\`}function*d1(Z){return yield*oX(Z.expr.map((X)=>[...y8(X)]))}function*p1(Z){for(let X of Z.expr)yield*y8(X)}function*l1(Z){return yield Z.const}function*y8(Z){return Z.type==="and"?yield*d1(Z):Z.type==="or"?yield*p1(Z):Z.type==="const"?yield*l1(Z):(()=>{throw new iX("Unknown expression")})()}function O6(Z){let X=$8(Z.pattern);return lZ(X)?[...y8(X)]:[]}function c(Z,X){return R({[I]:"Literal",const:Z,type:typeof Z},X)}function F6(Z){return R({[I]:"Boolean",type:"boolean"},Z)}function Q8(Z){return R({[I]:"BigInt",type:"bigint"},Z)}function y0(Z){return R({[I]:"Number",type:"number"},Z)}function zZ(Z){return R({[I]:"String",type:"string"},Z)}function*n1(Z){let X=Z.trim().replace(/"|'/g,"");return X==="boolean"?yield F6():X==="number"?yield y0():X==="bigint"?yield Q8():X==="string"?yield zZ():yield(()=>{let z=X.split("|").map((W)=>c(W.trim()));return z.length===0?y():z.length===1?z[0]:HZ(z)})()}function*i1(Z){if(Z[1]!=="{"){let X=c("$"),z=R5(Z.slice(1));return yield*[X,...z]}for(let X=2;X<Z.length;X++)if(Z[X]==="}"){let z=n1(Z.slice(2,X)),W=R5(Z.slice(X+1));return yield*[...z,...W]}yield c(Z)}function*R5(Z){for(let X=0;X<Z.length;X++)if(Z[X]==="$"){let z=c(Z.slice(0,X)),W=i1(Z.slice(X));return yield*[z,...W]}yield c(Z)}function sX(Z){return[...R5(Z)]}class aX extends A0{}function o1(Z){return Z.replace(/[.*+?^\${}()|[\\]\\\\]/g,"\\\\$&")}function rX(Z,X){return f0(Z)?Z.pattern.slice(1,Z.pattern.length-1):v(Z)?\`(\${Z.anyOf.map((z)=>rX(z,X)).join("|")})\`:XZ(Z)?\`\${X}\${L6}\`:ZZ(Z)?\`\${X}\${L6}\`:uZ(Z)?\`\${X}\${L6}\`:GZ(Z)?\`\${X}\${gX}\`:w0(Z)?\`\${X}\${o1(Z.const.toString())}\`:UZ(Z)?\`\${X}\${xX}\`:(()=>{throw new aX(\`Unexpected Kind '\${Z[I]}'\`)})()}function S5(Z){return\`^\${Z.map((X)=>rX(X,"")).join("")}$\`}function nZ(Z){let z=O6(Z).map((W)=>c(W));return HZ(z)}function N6(Z,X){let z=a(Z)?S5(sX(Z)):S5(Z);return R({[I]:"TemplateLiteral",type:"string",pattern:z},X)}function s1(Z){return O6(Z).map((z)=>z.toString())}function a1(Z){let X=[];for(let z of Z)X.push(...C0(z));return X}function r1(Z){return[Z.toString()]}function C0(Z){return[...new Set(f0(Z)?s1(Z):v(Z)?a1(Z.anyOf):w0(Z)?r1(Z.const):XZ(Z)?["[number]"]:ZZ(Z)?["[number]"]:[])]}function t1(Z,X,z){let W={};for(let Y of Object.getOwnPropertyNames(X))W[Y]=RZ(Z,C0(X[Y]),z);return W}function e1(Z,X,z){return t1(Z,X.properties,z)}function tX(Z,X,z){let W=e1(Z,X,z);return m(W)}function Z2(Z,X){return Z.map((z)=>X2(z,X))}function ZW(Z){return Z.filter((X)=>!OZ(X))}function XW(Z,X){return K6(ZW(Z2(Z,X)))}function zW(Z){return Z.some((X)=>OZ(X))?[]:Z}function $W(Z,X){return HZ(zW(Z2(Z,X)))}function QW(Z,X){return X in Z?Z[X]:X==="[number]"?HZ(Z):y()}function WW(Z,X){return X==="[number]"?Z:y()}function HW(Z,X){return X in Z?Z[X]:y()}function X2(Z,X){return z0(Z)?XW(Z.allOf,X):v(Z)?$W(Z.anyOf,X):b0(Z)?QW(Z.items??[],X):a0(Z)?WW(Z.items,X):Y0(Z)?HW(Z.properties,X):y()}function C5(Z,X){return X.map((z)=>X2(Z,z))}function eX(Z,X){return HZ(C5(Z,X))}function RZ(Z,X,z){if(W0(Z)||W0(X)){if(!x0(Z)||!x0(X))throw new A0("Index types using Ref parameters require both Type and Key to be of TSchema");return t("Index",[Z,X])}if(Z0(X))return tX(Z,X,z);if(k0(X))return z2(Z,X,z);return R(x0(X)?eX(Z,C0(X)):eX(Z,X),z)}function JW(Z,X,z){return{[X]:RZ(Z,[X],e(z))}}function YW(Z,X,z){return X.reduce((W,Y)=>{return{...W,...JW(Z,Y,z)}},{})}function VW(Z,X,z){return YW(Z,X.keys,z)}function z2(Z,X,z){let W=VW(Z,X,z);return m(W)}function W8(Z,X){return R({[I]:"Iterator",type:"Iterator",items:Z},X)}function _W(Z){return globalThis.Object.keys(Z).filter((X)=>!S0(Z[X]))}function BW(Z,X){let z=_W(Z),W=z.length>0?{[I]:"Object",type:"object",required:z,properties:Z}:{[I]:"Object",type:"object",properties:Z};return R(W,X)}var o=BW;function j6(Z,X){return R({[I]:"Promise",type:"Promise",item:Z},X)}function UW(Z){return R($0(Z,[s0]))}function GW(Z){return R({...Z,[s0]:"Readonly"})}function qW(Z,X){return X===!1?UW(Z):GW(Z)}function E0(Z,X){let z=X??!0;return Z0(Z)?$2(Z,z):qW(Z,z)}function MW(Z,X){let z={};for(let W of globalThis.Object.getOwnPropertyNames(Z))z[W]=E0(Z[W],X);return z}function AW(Z,X){return MW(Z.properties,X)}function $2(Z,X){let z=AW(Z,X);return m(z)}function m0(Z,X){return R(Z.length>0?{[I]:"Tuple",type:"array",items:Z,additionalItems:!1,minItems:Z.length,maxItems:Z.length}:{[I]:"Tuple",type:"array",minItems:Z.length,maxItems:Z.length},X)}function Q2(Z,X){return Z in X?u0(Z,X[Z]):m(X)}function DW(Z){return{[Z]:c(Z)}}function LW(Z){let X={};for(let z of Z)X[z]=c(z);return X}function OW(Z,X){return vX(X,Z)?DW(Z):LW(X)}function FW(Z,X){let z=OW(Z,X);return Q2(Z,z)}function m8(Z,X){return X.map((z)=>u0(Z,z))}function NW(Z,X){let z={};for(let W of globalThis.Object.getOwnPropertyNames(X))z[W]=u0(Z,X[W]);return z}function u0(Z,X){let z={...X};return S0(X)?O0(u0(Z,$0(X,[D0]))):tZ(X)?E0(u0(Z,$0(X,[s0]))):Z0(X)?Q2(Z,X.properties):k0(X)?FW(Z,X.keys):t0(X)?X8(m8(Z,X.parameters),u0(Z,X.returns),z):e0(X)?WZ(m8(Z,X.parameters),u0(Z,X.returns),z):mZ(X)?Z8(u0(Z,X.items),z):cZ(X)?W8(u0(Z,X.items),z):z0(X)?F0(m8(Z,X.allOf),z):v(X)?d(m8(Z,X.anyOf),z):b0(X)?m0(m8(Z,X.items??[]),z):Y0(X)?o(NW(Z,X.properties),z):a0(X)?eZ(u0(Z,X.items),z):dZ(X)?j6(u0(Z,X.item),z):X}function KW(Z,X){let z={};for(let W of Z)z[W]=u0(W,X);return z}function W2(Z,X,z){let W=x0(Z)?C0(Z):Z,Y=X({[I]:"MappedKey",keys:W}),q=KW(W,Y);return o(q,z)}function jW(Z){return R($0(Z,[D0]))}function RW(Z){return R({...Z,[D0]:"Optional"})}function SW(Z,X){return X===!1?jW(Z):RW(Z)}function O0(Z,X){let z=X??!0;return Z0(Z)?H2(Z,z):SW(Z,z)}function CW(Z,X){let z={};for(let W of globalThis.Object.getOwnPropertyNames(Z))z[W]=O0(Z[W],X);return z}function EW(Z,X){return CW(Z.properties,X)}function H2(Z,X){let z=EW(Z,X);return m(z)}function u8(Z,X={}){let z=Z.every((Y)=>Y0(Y)),W=x0(X.unevaluatedProperties)?{unevaluatedProperties:X.unevaluatedProperties}:{};return R(X.unevaluatedProperties===!1||x0(X.unevaluatedProperties)||z?{...W,[I]:"Intersect",type:"object",allOf:Z}:{...W,[I]:"Intersect",allOf:Z},X)}function IW(Z){return Z.every((X)=>S0(X))}function TW(Z){return $0(Z,[D0])}function J2(Z){return Z.map((X)=>S0(X)?TW(X):X)}function PW(Z,X){return IW(Z)?O0(u8(J2(Z),X)):u8(J2(Z),X)}function K6(Z,X={}){if(Z.length===1)return R(Z[0],X);if(Z.length===0)return y(X);if(Z.some((z)=>FZ(z)))throw Error("Cannot intersect transform types");return PW(Z,X)}function F0(Z,X){if(Z.length===1)return R(Z[0],X);if(Z.length===0)return y(X);if(Z.some((z)=>FZ(z)))throw Error("Cannot intersect transform types");return u8(Z,X)}function JZ(...Z){let[X,z]=typeof Z[0]==="string"?[Z[0],Z[1]]:[Z[0].$id,Z[1]];if(typeof X!=="string")throw new A0("Ref: $ref must be a string");return R({[I]:"Ref",$ref:X},z)}function wW(Z,X){return t("Awaited",[t(Z,X)])}function kW(Z){return t("Awaited",[JZ(Z)])}function fW(Z){return F0(Y2(Z))}function bW(Z){return d(Y2(Z))}function xW(Z){return H8(Z)}function Y2(Z){return Z.map((X)=>H8(X))}function H8(Z,X){return R(r0(Z)?wW(Z.target,Z.parameters):z0(Z)?fW(Z.allOf):v(Z)?bW(Z.anyOf):dZ(Z)?xW(Z.item):W0(Z)?kW(Z.$ref):Z,X)}function V2(Z){let X=[];for(let z of Z)X.push(c8(z));return X}function gW(Z){let X=V2(Z);return uX(X)}function hW(Z){let X=V2(Z);return mX(X)}function vW(Z){return Z.map((X,z)=>z.toString())}function yW(Z){return["[number]"]}function mW(Z){return globalThis.Object.getOwnPropertyNames(Z)}function uW(Z){if(!cW)return[];return globalThis.Object.getOwnPropertyNames(Z).map((z)=>{return z[0]==="^"&&z[z.length-1]==="$"?z.slice(1,z.length-1):z})}function c8(Z){return z0(Z)?gW(Z.allOf):v(Z)?hW(Z.anyOf):b0(Z)?vW(Z.items??[]):a0(Z)?yW(Z.items):Y0(Z)?mW(Z.properties):pZ(Z)?uW(Z.patternProperties):[]}var cW=!1;function dW(Z,X){return t("KeyOf",[t(Z,X)])}function pW(Z){return t("KeyOf",[JZ(Z)])}function lW(Z,X){let z=c8(Z),W=nW(z),Y=HZ(W);return R(Y,X)}function nW(Z){return Z.map((X)=>X==="[number]"?y0():c(X))}function J8(Z,X){return r0(Z)?dW(Z.target,Z.parameters):W0(Z)?pW(Z.$ref):Z0(Z)?_2(Z,X):lW(Z,X)}function iW(Z,X){let z={};for(let W of globalThis.Object.getOwnPropertyNames(Z))z[W]=J8(Z[W],e(X));return z}function oW(Z,X){return iW(Z.properties,X)}function _2(Z,X){let z=oW(Z,X);return m(z)}function sW(Z){let X=[];for(let z of Z)X.push(...c8(z));return yX(X)}function aW(Z){return Z.filter((X)=>!OZ(X))}function rW(Z,X){let z=[];for(let W of Z)z.push(...C5(W,[X]));return aW(z)}function tW(Z,X){let z={};for(let W of X)z[W]=K6(rW(Z,W));return z}function B2(Z,X){let z=sW(Z),W=tW(Z,z);return o(W,X)}function R6(Z){return R({[I]:"Date",type:"Date"},Z)}function S6(Z){return R({[I]:"Null",type:"null"},Z)}function C6(Z){return R({[I]:"Symbol",type:"symbol"},Z)}function E6(Z){return R({[I]:"Undefined",type:"undefined"},Z)}function I6(Z){return R({[I]:"Uint8Array",type:"Uint8Array"},Z)}function SZ(Z){return R({[I]:"Unknown"},Z)}function eW(Z){return Z.map((X)=>E5(X,!1))}function Z4(Z){let X={};for(let z of globalThis.Object.getOwnPropertyNames(Z))X[z]=E0(E5(Z[z],!1));return X}function T6(Z,X){return X===!0?Z:E0(Z)}function E5(Z,X){return B5(Z)?T6(jZ(),X):G5(Z)?T6(jZ(),X):H0(Z)?E0(m0(eW(Z))):BZ(Z)?I6():yZ(Z)?R6():n(Z)?T6(o(Z4(Z)),X):U5(Z)?T6(WZ([],SZ()),X):J0(Z)?E6():q5(Z)?S6():M5(Z)?C6():T8(Z)?Q8():P0(Z)?c(Z):_Z(Z)?c(Z):a(Z)?c(Z):o({})}function U2(Z,X){return R(E5(Z,!0),X)}function G2(Z,X){return t0(Z)?m0(Z.parameters,X):y(X)}function q2(Z,X){if(J0(Z))throw Error("Enum undefined or empty");let z=globalThis.Object.getOwnPropertyNames(Z).filter((q)=>isNaN(q)).map((q)=>Z[q]),Y=[...new Set(z)].map((q)=>c(q));return d(Y,{...X,[v0]:"Enum"})}class O2 extends A0{}var S;(function(Z){Z[Z.Union=0]="Union",Z[Z.True=1]="True",Z[Z.False=2]="False"})(S||(S={}));function c0(Z){return Z===S.False?Z:S.True}function Y8(Z){throw new O2(Z)}function _0(Z){return O.IsNever(Z)||O.IsIntersect(Z)||O.IsUnion(Z)||O.IsUnknown(Z)||O.IsAny(Z)}function B0(Z,X){return O.IsNever(X)?K2(Z,X):O.IsIntersect(X)?P6(Z,X):O.IsUnion(X)?k5(Z,X):O.IsUnknown(X)?C2(Z,X):O.IsAny(X)?w5(Z,X):Y8("StructuralRight")}function w5(Z,X){return S.True}function X4(Z,X){return O.IsIntersect(X)?P6(Z,X):O.IsUnion(X)&&X.anyOf.some((z)=>O.IsAny(z)||O.IsUnknown(z))?S.True:O.IsUnion(X)?S.Union:O.IsUnknown(X)?S.True:O.IsAny(X)?S.True:S.Union}function z4(Z,X){return O.IsUnknown(Z)?S.False:O.IsAny(Z)?S.Union:O.IsNever(Z)?S.True:S.False}function $4(Z,X){return O.IsObject(X)&&w6(X)?S.True:_0(X)?B0(Z,X):!O.IsArray(X)?S.False:c0(s(Z.items,X.items))}function Q4(Z,X){return _0(X)?B0(Z,X):!O.IsAsyncIterator(X)?S.False:c0(s(Z.items,X.items))}function W4(Z,X){return _0(X)?B0(Z,X):O.IsObject(X)?N0(Z,X):O.IsRecord(X)?d0(Z,X):O.IsBigInt(X)?S.True:S.False}function F2(Z,X){return O.IsLiteralBoolean(Z)?S.True:O.IsBoolean(Z)?S.True:S.False}function H4(Z,X){return _0(X)?B0(Z,X):O.IsObject(X)?N0(Z,X):O.IsRecord(X)?d0(Z,X):O.IsBoolean(X)?S.True:S.False}function J4(Z,X){return _0(X)?B0(Z,X):O.IsObject(X)?N0(Z,X):!O.IsConstructor(X)?S.False:Z.parameters.length>X.parameters.length?S.False:!Z.parameters.every((z,W)=>c0(s(X.parameters[W],z))===S.True)?S.False:c0(s(Z.returns,X.returns))}function Y4(Z,X){return _0(X)?B0(Z,X):O.IsObject(X)?N0(Z,X):O.IsRecord(X)?d0(Z,X):O.IsDate(X)?S.True:S.False}function V4(Z,X){return _0(X)?B0(Z,X):O.IsObject(X)?N0(Z,X):!O.IsFunction(X)?S.False:Z.parameters.length>X.parameters.length?S.False:!Z.parameters.every((z,W)=>c0(s(X.parameters[W],z))===S.True)?S.False:c0(s(Z.returns,X.returns))}function N2(Z,X){return O.IsLiteral(Z)&&L0.IsNumber(Z.const)?S.True:O.IsNumber(Z)||O.IsInteger(Z)?S.True:S.False}function _4(Z,X){return O.IsInteger(X)||O.IsNumber(X)?S.True:_0(X)?B0(Z,X):O.IsObject(X)?N0(Z,X):O.IsRecord(X)?d0(Z,X):S.False}function P6(Z,X){return X.allOf.every((z)=>s(Z,z)===S.True)?S.True:S.False}function B4(Z,X){return Z.allOf.some((z)=>s(z,X)===S.True)?S.True:S.False}function U4(Z,X){return _0(X)?B0(Z,X):!O.IsIterator(X)?S.False:c0(s(Z.items,X.items))}function G4(Z,X){return O.IsLiteral(X)&&X.const===Z.const?S.True:_0(X)?B0(Z,X):O.IsObject(X)?N0(Z,X):O.IsRecord(X)?d0(Z,X):O.IsString(X)?S2(Z,X):O.IsNumber(X)?j2(Z,X):O.IsInteger(X)?N2(Z,X):O.IsBoolean(X)?F2(Z,X):S.False}function K2(Z,X){return S.False}function q4(Z,X){return S.True}function M2(Z){let[X,z]=[Z,0];while(!0){if(!O.IsNot(X))break;X=X.not,z+=1}return z%2===0?X:SZ()}function M4(Z,X){return O.IsNot(Z)?s(M2(Z),X):O.IsNot(X)?s(Z,M2(X)):Y8("Invalid fallthrough for Not")}function A4(Z,X){return _0(X)?B0(Z,X):O.IsObject(X)?N0(Z,X):O.IsRecord(X)?d0(Z,X):O.IsNull(X)?S.True:S.False}function j2(Z,X){return O.IsLiteralNumber(Z)?S.True:O.IsNumber(Z)||O.IsInteger(Z)?S.True:S.False}function D4(Z,X){return _0(X)?B0(Z,X):O.IsObject(X)?N0(Z,X):O.IsRecord(X)?d0(Z,X):O.IsInteger(X)||O.IsNumber(X)?S.True:S.False}function I0(Z,X){return Object.getOwnPropertyNames(Z.properties).length===X}function A2(Z){return w6(Z)}function D2(Z){return I0(Z,0)||I0(Z,1)&&"description"in Z.properties&&O.IsUnion(Z.properties.description)&&Z.properties.description.anyOf.length===2&&(O.IsString(Z.properties.description.anyOf[0])&&O.IsUndefined(Z.properties.description.anyOf[1])||O.IsString(Z.properties.description.anyOf[1])&&O.IsUndefined(Z.properties.description.anyOf[0]))}function I5(Z){return I0(Z,0)}function L2(Z){return I0(Z,0)}function L4(Z){return I0(Z,0)}function O4(Z){return I0(Z,0)}function F4(Z){return w6(Z)}function N4(Z){let X=y0();return I0(Z,0)||I0(Z,1)&&"length"in Z.properties&&c0(s(Z.properties.length,X))===S.True}function K4(Z){return I0(Z,0)}function w6(Z){let X=y0();return I0(Z,0)||I0(Z,1)&&"length"in Z.properties&&c0(s(Z.properties.length,X))===S.True}function j4(Z){let X=WZ([jZ()],jZ());return I0(Z,0)||I0(Z,1)&&"then"in Z.properties&&c0(s(Z.properties.then,X))===S.True}function R2(Z,X){return s(Z,X)===S.False?S.False:O.IsOptional(Z)&&!O.IsOptional(X)?S.False:S.True}function N0(Z,X){return O.IsUnknown(Z)?S.False:O.IsAny(Z)?S.Union:O.IsNever(Z)||O.IsLiteralString(Z)&&A2(X)||O.IsLiteralNumber(Z)&&I5(X)||O.IsLiteralBoolean(Z)&&L2(X)||O.IsSymbol(Z)&&D2(X)||O.IsBigInt(Z)&&L4(X)||O.IsString(Z)&&A2(X)||O.IsSymbol(Z)&&D2(X)||O.IsNumber(Z)&&I5(X)||O.IsInteger(Z)&&I5(X)||O.IsBoolean(Z)&&L2(X)||O.IsUint8Array(Z)&&F4(X)||O.IsDate(Z)&&O4(X)||O.IsConstructor(Z)&&K4(X)||O.IsFunction(Z)&&N4(X)?S.True:O.IsRecord(Z)&&O.IsString(T5(Z))?(()=>{return X[v0]==="Record"?S.True:S.False})():O.IsRecord(Z)&&O.IsNumber(T5(Z))?(()=>{return I0(X,0)?S.True:S.False})():S.False}function R4(Z,X){return _0(X)?B0(Z,X):O.IsRecord(X)?d0(Z,X):!O.IsObject(X)?S.False:(()=>{for(let z of Object.getOwnPropertyNames(X.properties)){if(!(z in Z.properties)&&!O.IsOptional(X.properties[z]))return S.False;if(O.IsOptional(X.properties[z]))return S.True;if(R2(Z.properties[z],X.properties[z])===S.False)return S.False}return S.True})()}function S4(Z,X){return _0(X)?B0(Z,X):O.IsObject(X)&&j4(X)?S.True:!O.IsPromise(X)?S.False:c0(s(Z.item,X.item))}function T5(Z){return NZ in Z.patternProperties?y0():(KZ in Z.patternProperties)?zZ():Y8("Unknown record key pattern")}function P5(Z){return NZ in Z.patternProperties?Z.patternProperties[NZ]:(KZ in Z.patternProperties)?Z.patternProperties[KZ]:Y8("Unable to get record value schema")}function d0(Z,X){let[z,W]=[T5(X),P5(X)];return O.IsLiteralString(Z)&&O.IsNumber(z)&&c0(s(Z,W))===S.True?S.True:O.IsUint8Array(Z)&&O.IsNumber(z)?s(Z,W):O.IsString(Z)&&O.IsNumber(z)?s(Z,W):O.IsArray(Z)&&O.IsNumber(z)?s(Z,W):O.IsObject(Z)?(()=>{for(let Y of Object.getOwnPropertyNames(Z.properties))if(R2(W,Z.properties[Y])===S.False)return S.False;return S.True})():S.False}function C4(Z,X){return _0(X)?B0(Z,X):O.IsObject(X)?N0(Z,X):!O.IsRecord(X)?S.False:s(P5(Z),P5(X))}function E4(Z,X){let z=O.IsRegExp(Z)?zZ():Z,W=O.IsRegExp(X)?zZ():X;return s(z,W)}function S2(Z,X){return O.IsLiteral(Z)&&L0.IsString(Z.const)?S.True:O.IsString(Z)?S.True:S.False}function I4(Z,X){return _0(X)?B0(Z,X):O.IsObject(X)?N0(Z,X):O.IsRecord(X)?d0(Z,X):O.IsString(X)?S.True:S.False}function T4(Z,X){return _0(X)?B0(Z,X):O.IsObject(X)?N0(Z,X):O.IsRecord(X)?d0(Z,X):O.IsSymbol(X)?S.True:S.False}function P4(Z,X){return O.IsTemplateLiteral(Z)?s(nZ(Z),X):O.IsTemplateLiteral(X)?s(Z,nZ(X)):Y8("Invalid fallthrough for TemplateLiteral")}function w4(Z,X){return O.IsArray(X)&&Z.items!==void 0&&Z.items.every((z)=>s(z,X.items)===S.True)}function k4(Z,X){return O.IsNever(Z)?S.True:O.IsUnknown(Z)?S.False:O.IsAny(Z)?S.Union:S.False}function f4(Z,X){return _0(X)?B0(Z,X):O.IsObject(X)&&w6(X)?S.True:O.IsArray(X)&&w4(Z,X)?S.True:!O.IsTuple(X)?S.False:L0.IsUndefined(Z.items)&&!L0.IsUndefined(X.items)||!L0.IsUndefined(Z.items)&&L0.IsUndefined(X.items)?S.False:L0.IsUndefined(Z.items)&&!L0.IsUndefined(X.items)?S.True:Z.items.every((z,W)=>s(z,X.items[W])===S.True)?S.True:S.False}function b4(Z,X){return _0(X)?B0(Z,X):O.IsObject(X)?N0(Z,X):O.IsRecord(X)?d0(Z,X):O.IsUint8Array(X)?S.True:S.False}function x4(Z,X){return _0(X)?B0(Z,X):O.IsObject(X)?N0(Z,X):O.IsRecord(X)?d0(Z,X):O.IsVoid(X)?v4(Z,X):O.IsUndefined(X)?S.True:S.False}function k5(Z,X){return X.anyOf.some((z)=>s(Z,z)===S.True)?S.True:S.False}function g4(Z,X){return Z.anyOf.every((z)=>s(z,X)===S.True)?S.True:S.False}function C2(Z,X){return S.True}function h4(Z,X){return O.IsNever(X)?K2(Z,X):O.IsIntersect(X)?P6(Z,X):O.IsUnion(X)?k5(Z,X):O.IsAny(X)?w5(Z,X):O.IsString(X)?S2(Z,X):O.IsNumber(X)?j2(Z,X):O.IsInteger(X)?N2(Z,X):O.IsBoolean(X)?F2(Z,X):O.IsArray(X)?z4(Z,X):O.IsTuple(X)?k4(Z,X):O.IsObject(X)?N0(Z,X):O.IsUnknown(X)?S.True:S.False}function v4(Z,X){return O.IsUndefined(Z)?S.True:O.IsUndefined(Z)?S.True:S.False}function y4(Z,X){return O.IsIntersect(X)?P6(Z,X):O.IsUnion(X)?k5(Z,X):O.IsUnknown(X)?C2(Z,X):O.IsAny(X)?w5(Z,X):O.IsObject(X)?N0(Z,X):O.IsVoid(X)?S.True:S.False}function s(Z,X){return O.IsTemplateLiteral(Z)||O.IsTemplateLiteral(X)?P4(Z,X):O.IsRegExp(Z)||O.IsRegExp(X)?E4(Z,X):O.IsNot(Z)||O.IsNot(X)?M4(Z,X):O.IsAny(Z)?X4(Z,X):O.IsArray(Z)?$4(Z,X):O.IsBigInt(Z)?W4(Z,X):O.IsBoolean(Z)?H4(Z,X):O.IsAsyncIterator(Z)?Q4(Z,X):O.IsConstructor(Z)?J4(Z,X):O.IsDate(Z)?Y4(Z,X):O.IsFunction(Z)?V4(Z,X):O.IsInteger(Z)?_4(Z,X):O.IsIntersect(Z)?B4(Z,X):O.IsIterator(Z)?U4(Z,X):O.IsLiteral(Z)?G4(Z,X):O.IsNever(Z)?q4(Z,X):O.IsNull(Z)?A4(Z,X):O.IsNumber(Z)?D4(Z,X):O.IsObject(Z)?R4(Z,X):O.IsRecord(Z)?C4(Z,X):O.IsString(Z)?I4(Z,X):O.IsSymbol(Z)?T4(Z,X):O.IsTuple(Z)?f4(Z,X):O.IsPromise(Z)?S4(Z,X):O.IsUint8Array(Z)?b4(Z,X):O.IsUndefined(Z)?x4(Z,X):O.IsUnion(Z)?g4(Z,X):O.IsUnknown(Z)?h4(Z,X):O.IsVoid(Z)?y4(Z,X):Y8(\`Unknown left type operand '\${Z[I]}'\`)}function CZ(Z,X){return s(Z,X)}function m4(Z,X,z,W,Y){let q={};for(let B of globalThis.Object.getOwnPropertyNames(Z))q[B]=V8(Z[B],X,z,W,e(Y));return q}function u4(Z,X,z,W,Y){return m4(Z.properties,X,z,W,Y)}function E2(Z,X,z,W,Y){let q=u4(Z,X,z,W,Y);return m(q)}function c4(Z,X,z,W){let Y=CZ(Z,X);return Y===S.Union?d([z,W]):Y===S.True?z:W}function V8(Z,X,z,W,Y){return Z0(Z)?E2(Z,X,z,W,Y):k0(Z)?R(I2(Z,X,z,W,Y)):R(c4(Z,X,z,W),Y)}function d4(Z,X,z,W,Y){return{[Z]:V8(c(Z),X,z,W,e(Y))}}function p4(Z,X,z,W,Y){return Z.reduce((q,B)=>{return{...q,...d4(B,X,z,W,Y)}},{})}function l4(Z,X,z,W,Y){return p4(Z.keys,X,z,W,Y)}function I2(Z,X,z,W,Y){let q=l4(Z,X,z,W,Y);return m(q)}function T2(Z,X){return _8(nZ(Z),X)}function n4(Z,X){let z=Z.filter((W)=>CZ(W,X)===S.False);return z.length===1?z[0]:d(z)}function _8(Z,X,z={}){if(f0(Z))return R(T2(Z,X),z);if(Z0(Z))return R(P2(Z,X),z);return R(v(Z)?n4(Z.anyOf,X):CZ(Z,X)!==S.False?y():Z,z)}function i4(Z,X){let z={};for(let W of globalThis.Object.getOwnPropertyNames(Z))z[W]=_8(Z[W],X);return z}function o4(Z,X){return i4(Z.properties,X)}function P2(Z,X){let z=o4(Z,X);return m(z)}function w2(Z,X){return B8(nZ(Z),X)}function s4(Z,X){let z=Z.filter((W)=>CZ(W,X)!==S.False);return z.length===1?z[0]:d(z)}function B8(Z,X,z){if(f0(Z))return R(w2(Z,X),z);if(Z0(Z))return R(k2(Z,X),z);return R(v(Z)?s4(Z.anyOf,X):CZ(Z,X)!==S.False?Z:y(),z)}function a4(Z,X){let z={};for(let W of globalThis.Object.getOwnPropertyNames(Z))z[W]=B8(Z[W],X);return z}function r4(Z,X){return a4(Z.properties,X)}function k2(Z,X){let z=r4(Z,X);return m(z)}function f2(Z,X){return t0(Z)?R(Z.returns,X):y(X)}function k6(Z){return E0(O0(Z))}function iZ(Z,X,z){return R({[I]:"Record",type:"object",patternProperties:{[Z]:X}},z)}function f5(Z,X,z){let W={};for(let Y of Z)W[Y]=X;return o(W,{...z,[v0]:"Record"})}function t4(Z,X,z){return nX(Z)?f5(C0(Z),X,z):iZ(Z.pattern,X,z)}function e4(Z,X,z){return f5(C0(d(Z)),X,z)}function ZH(Z,X,z){return f5([Z.toString()],X,z)}function XH(Z,X,z){return iZ(Z.source,X,z)}function zH(Z,X,z){let W=J0(Z.pattern)?KZ:Z.pattern;return iZ(W,X,z)}function $H(Z,X,z){return iZ(KZ,X,z)}function QH(Z,X,z){return iZ(hX,X,z)}function WH(Z,X,z){return o({true:X,false:X},z)}function HH(Z,X,z){return iZ(NZ,X,z)}function JH(Z,X,z){return iZ(NZ,X,z)}function f6(Z,X,z={}){return v(Z)?e4(Z.anyOf,X,z):f0(Z)?t4(Z,X,z):w0(Z)?ZH(Z.const,X,z):UZ(Z)?WH(Z,X,z):ZZ(Z)?HH(Z,X,z):XZ(Z)?JH(Z,X,z):L5(Z)?XH(Z,X,z):GZ(Z)?zH(Z,X,z):A5(Z)?$H(Z,X,z):OZ(Z)?QH(Z,X,z):y(z)}function b6(Z){return globalThis.Object.getOwnPropertyNames(Z.patternProperties)[0]}function b2(Z){let X=b6(Z);return X===KZ?zZ():X===NZ?y0():zZ({pattern:X})}function x6(Z){return Z.patternProperties[b6(Z)]}function YH(Z,X){return X.parameters=d8(Z,X.parameters),X.returns=$Z(Z,X.returns),X}function VH(Z,X){return X.parameters=d8(Z,X.parameters),X.returns=$Z(Z,X.returns),X}function _H(Z,X){return X.allOf=d8(Z,X.allOf),X}function BH(Z,X){return X.anyOf=d8(Z,X.anyOf),X}function UH(Z,X){if(J0(X.items))return X;return X.items=d8(Z,X.items),X}function GH(Z,X){return X.items=$Z(Z,X.items),X}function qH(Z,X){return X.items=$Z(Z,X.items),X}function MH(Z,X){return X.items=$Z(Z,X.items),X}function AH(Z,X){return X.item=$Z(Z,X.item),X}function DH(Z,X){let z=NH(Z,X.properties);return{...X,...o(z)}}function LH(Z,X){let z=$Z(Z,b2(X)),W=$Z(Z,x6(X)),Y=f6(z,W);return{...X,...Y}}function OH(Z,X){return X.index in Z?Z[X.index]:SZ()}function FH(Z,X){let z=tZ(X),W=S0(X),Y=$Z(Z,X);return z&&W?k6(Y):z&&!W?E0(Y):!z&&W?O0(Y):Y}function NH(Z,X){return globalThis.Object.getOwnPropertyNames(X).reduce((z,W)=>{return{...z,[W]:FH(Z,X[W])}},{})}function d8(Z,X){return X.map((z)=>$Z(Z,z))}function $Z(Z,X){return t0(X)?YH(Z,X):e0(X)?VH(Z,X):z0(X)?_H(Z,X):v(X)?BH(Z,X):b0(X)?UH(Z,X):a0(X)?GH(Z,X):mZ(X)?qH(Z,X):cZ(X)?MH(Z,X):dZ(X)?AH(Z,X):Y0(X)?DH(Z,X):pZ(X)?LH(Z,X):D5(X)?OH(Z,X):X}function x2(Z,X){return $Z(X,rZ(Z))}function g2(Z){return R({[I]:"Integer",type:"integer"},Z)}function KH(Z,X,z){return{[Z]:QZ(c(Z),X,e(z))}}function jH(Z,X,z){return Z.reduce((Y,q)=>{return{...Y,...KH(q,X,z)}},{})}function RH(Z,X,z){return jH(Z.keys,X,z)}function h2(Z,X,z){let W=RH(Z,X,z);return m(W)}function SH(Z){let[X,z]=[Z.slice(0,1),Z.slice(1)];return[X.toLowerCase(),z].join("")}function CH(Z){let[X,z]=[Z.slice(0,1),Z.slice(1)];return[X.toUpperCase(),z].join("")}function EH(Z){return Z.toUpperCase()}function IH(Z){return Z.toLowerCase()}function TH(Z,X,z){let W=$8(Z.pattern);if(!lZ(W))return{...Z,pattern:v2(Z.pattern,X)};let B=[...y8(W)].map((H)=>c(H)),U=y2(B,X),G=d(U);return N6([G],z)}function v2(Z,X){return typeof Z==="string"?X==="Uncapitalize"?SH(Z):X==="Capitalize"?CH(Z):X==="Uppercase"?EH(Z):X==="Lowercase"?IH(Z):Z:Z.toString()}function y2(Z,X){return Z.map((z)=>QZ(z,X))}function QZ(Z,X,z={}){return k0(Z)?h2(Z,X,z):f0(Z)?TH(Z,X,z):v(Z)?d(y2(Z.anyOf,X),z):w0(Z)?c(v2(Z.const,X),z):R(Z,z)}function m2(Z,X={}){return QZ(Z,"Capitalize",X)}function u2(Z,X={}){return QZ(Z,"Lowercase",X)}function c2(Z,X={}){return QZ(Z,"Uncapitalize",X)}function d2(Z,X={}){return QZ(Z,"Uppercase",X)}function PH(Z,X,z){let W={};for(let Y of globalThis.Object.getOwnPropertyNames(Z))W[Y]=EZ(Z[Y],X,e(z));return W}function wH(Z,X,z){return PH(Z.properties,X,z)}function p2(Z,X,z){let W=wH(Z,X,z);return m(W)}function kH(Z,X){return Z.map((z)=>b5(z,X))}function fH(Z,X){return Z.map((z)=>b5(z,X))}function bH(Z,X){let{[X]:z,...W}=Z;return W}function xH(Z,X){return X.reduce((z,W)=>bH(z,W),Z)}function gH(Z,X,z){let W=$0(Z,[V0,"$id","required","properties"]),Y=xH(z,X);return o(Y,W)}function hH(Z){let X=Z.reduce((z,W)=>A6(W)?[...z,c(W)]:z,[]);return d(X)}function b5(Z,X){return z0(Z)?F0(kH(Z.allOf,X)):v(Z)?d(fH(Z.anyOf,X)):Y0(Z)?gH(Z,X,Z.properties):o({})}function EZ(Z,X,z){let W=H0(X)?hH(X):X,Y=x0(X)?C0(X):X,q=W0(Z),B=W0(X);return Z0(Z)?p2(Z,Y,z):k0(X)?l2(Z,X,z):q&&B?t("Omit",[Z,W],z):!q&&B?t("Omit",[Z,W],z):q&&!B?t("Omit",[Z,W],z):R({...b5(Z,Y),...z})}function vH(Z,X,z){return{[X]:EZ(Z,[X],e(z))}}function yH(Z,X,z){return X.reduce((W,Y)=>{return{...W,...vH(Z,Y,z)}},{})}function mH(Z,X,z){return yH(Z,X.keys,z)}function l2(Z,X,z){let W=mH(Z,X,z);return m(W)}function uH(Z,X,z){let W={};for(let Y of globalThis.Object.getOwnPropertyNames(Z))W[Y]=IZ(Z[Y],X,e(z));return W}function cH(Z,X,z){return uH(Z.properties,X,z)}function n2(Z,X,z){let W=cH(Z,X,z);return m(W)}function dH(Z,X){return Z.map((z)=>x5(z,X))}function pH(Z,X){return Z.map((z)=>x5(z,X))}function lH(Z,X){let z={};for(let W of X)if(W in Z)z[W]=Z[W];return z}function nH(Z,X,z){let W=$0(Z,[V0,"$id","required","properties"]),Y=lH(z,X);return o(Y,W)}function iH(Z){let X=Z.reduce((z,W)=>A6(W)?[...z,c(W)]:z,[]);return d(X)}function x5(Z,X){return z0(Z)?F0(dH(Z.allOf,X)):v(Z)?d(pH(Z.anyOf,X)):Y0(Z)?nH(Z,X,Z.properties):o({})}function IZ(Z,X,z){let W=H0(X)?iH(X):X,Y=x0(X)?C0(X):X,q=W0(Z),B=W0(X);return Z0(Z)?n2(Z,Y,z):k0(X)?i2(Z,X,z):q&&B?t("Pick",[Z,W],z):!q&&B?t("Pick",[Z,W],z):q&&!B?t("Pick",[Z,W],z):R({...x5(Z,Y),...z})}function oH(Z,X,z){return{[X]:IZ(Z,[X],e(z))}}function sH(Z,X,z){return X.reduce((W,Y)=>{return{...W,...oH(Z,Y,z)}},{})}function aH(Z,X,z){return sH(Z,X.keys,z)}function i2(Z,X,z){let W=aH(Z,X,z);return m(W)}function rH(Z,X){return t("Partial",[t(Z,X)])}function tH(Z){return t("Partial",[JZ(Z)])}function eH(Z){let X={};for(let z of globalThis.Object.getOwnPropertyNames(Z))X[z]=O0(Z[z]);return X}function ZJ(Z,X){let z=$0(Z,[V0,"$id","required","properties"]),W=eH(X);return o(W,z)}function o2(Z){return Z.map((X)=>s2(X))}function s2(Z){return r0(Z)?rH(Z.target,Z.parameters):W0(Z)?tH(Z.$ref):z0(Z)?F0(o2(Z.allOf)):v(Z)?d(o2(Z.anyOf)):Y0(Z)?ZJ(Z,Z.properties):uZ(Z)?Z:UZ(Z)?Z:ZZ(Z)?Z:w0(Z)?Z:k8(Z)?Z:XZ(Z)?Z:GZ(Z)?Z:f8(Z)?Z:b8(Z)?Z:o({})}function U8(Z,X){if(Z0(Z))return a2(Z,X);else return R({...s2(Z),...X})}function XJ(Z,X){let z={};for(let W of globalThis.Object.getOwnPropertyNames(Z))z[W]=U8(Z[W],e(X));return z}function zJ(Z,X){return XJ(Z.properties,X)}function a2(Z,X){let z=zJ(Z,X);return m(z)}function $J(Z,X){return t("Required",[t(Z,X)])}function QJ(Z){return t("Required",[JZ(Z)])}function WJ(Z){let X={};for(let z of globalThis.Object.getOwnPropertyNames(Z))X[z]=$0(Z[z],[D0]);return X}function HJ(Z,X){let z=$0(Z,[V0,"$id","required","properties"]),W=WJ(X);return o(W,z)}function r2(Z){return Z.map((X)=>t2(X))}function t2(Z){return r0(Z)?$J(Z.target,Z.parameters):W0(Z)?QJ(Z.$ref):z0(Z)?F0(r2(Z.allOf)):v(Z)?d(r2(Z.anyOf)):Y0(Z)?HJ(Z,Z.properties):uZ(Z)?Z:UZ(Z)?Z:ZZ(Z)?Z:w0(Z)?Z:k8(Z)?Z:XZ(Z)?Z:GZ(Z)?Z:f8(Z)?Z:b8(Z)?Z:o({})}function G8(Z,X){if(Z0(Z))return e2(Z,X);else return R({...t2(Z),...X})}function JJ(Z,X){let z={};for(let W of globalThis.Object.getOwnPropertyNames(Z))z[W]=G8(Z[W],X);return z}function YJ(Z,X){return JJ(Z.properties,X)}function e2(Z,X){let z=YJ(Z,X);return m(z)}function VJ(Z,X){return X.map((z)=>{return W0(z)?g5(Z,z.$ref):g0(Z,z)})}function g5(Z,X){return X in Z?W0(Z[X])?g5(Z,Z[X].$ref):g0(Z,Z[X]):y()}function _J(Z){return H8(Z[0])}function BJ(Z){return RZ(Z[0],Z[1])}function UJ(Z){return J8(Z[0])}function GJ(Z){return U8(Z[0])}function qJ(Z){return EZ(Z[0],Z[1])}function MJ(Z){return IZ(Z[0],Z[1])}function AJ(Z){return G8(Z[0])}function DJ(Z,X,z){let W=VJ(Z,z);return X==="Awaited"?_J(W):X==="Index"?BJ(W):X==="KeyOf"?UJ(W):X==="Partial"?GJ(W):X==="Omit"?qJ(W):X==="Pick"?MJ(W):X==="Required"?AJ(W):y()}function LJ(Z,X){return eZ(g0(Z,X))}function OJ(Z,X){return Z8(g0(Z,X))}function FJ(Z,X,z){return X8(p8(Z,X),g0(Z,z))}function NJ(Z,X,z){return WZ(p8(Z,X),g0(Z,z))}function KJ(Z,X){return F0(p8(Z,X))}function jJ(Z,X){return W8(g0(Z,X))}function RJ(Z,X){return o(globalThis.Object.keys(X).reduce((z,W)=>{return{...z,[W]:g0(Z,X[W])}},{}))}function SJ(Z,X){let[z,W]=[g0(Z,x6(X)),b6(X)],Y=rZ(X);return Y.patternProperties[W]=z,Y}function CJ(Z,X){return W0(X)?{...g5(Z,X.$ref),[V0]:X[V0]}:X}function EJ(Z,X){return m0(p8(Z,X))}function IJ(Z,X){return d(p8(Z,X))}function p8(Z,X){return X.map((z)=>g0(Z,z))}function g0(Z,X){return S0(X)?R(g0(Z,$0(X,[D0])),X):tZ(X)?R(g0(Z,$0(X,[s0])),X):FZ(X)?R(CJ(Z,X),X):a0(X)?R(LJ(Z,X.items),X):mZ(X)?R(OJ(Z,X.items),X):r0(X)?R(DJ(Z,X.target,X.parameters)):t0(X)?R(FJ(Z,X.parameters,X.returns),X):e0(X)?R(NJ(Z,X.parameters,X.returns),X):z0(X)?R(KJ(Z,X.allOf),X):cZ(X)?R(jJ(Z,X.items),X):Y0(X)?R(RJ(Z,X.properties),X):pZ(X)?R(SJ(Z,X)):b0(X)?R(EJ(Z,X.items||[]),X):v(X)?R(IJ(Z,X.anyOf),X):X}function TJ(Z,X){return X in Z?g0(Z,Z[X]):y()}function Z9(Z){return globalThis.Object.getOwnPropertyNames(Z).reduce((X,z)=>{return{...X,[z]:TJ(Z,z)}},{})}class X9{constructor(Z){let X=Z9(Z),z=this.WithIdentifiers(X);this.$defs=z}Import(Z,X){let z={...this.$defs,[Z]:R(this.$defs[Z],X)};return R({[I]:"Import",$defs:z,$ref:Z})}WithIdentifiers(Z){return globalThis.Object.getOwnPropertyNames(Z).reduce((X,z)=>{return{...X,[z]:{...Z[z],$id:z}}},{})}}function z9(Z){return new X9(Z)}function $9(Z,X){return R({[I]:"Not",not:Z},X)}function Q9(Z,X){return e0(Z)?m0(Z.parameters,X):y()}var PJ=0;function W9(Z,X={}){if(J0(X.$id))X.$id=\`T\${PJ++}\`;let z=rZ(Z({[I]:"This",$ref:\`\${X.$id}\`}));return z.$id=X.$id,R({[v0]:"Recursive",...z},X)}function H9(Z,X){let z=a(Z)?new globalThis.RegExp(Z):Z;return R({[I]:"RegExp",type:"RegExp",source:z.source,flags:z.flags},X)}function wJ(Z){return z0(Z)?Z.allOf:v(Z)?Z.anyOf:b0(Z)?Z.items??[]:[]}function J9(Z){return wJ(Z)}function Y9(Z,X){return e0(Z)?R(Z.returns,X):y(X)}class V9{constructor(Z){this.schema=Z}Decode(Z){return new _9(this.schema,Z)}}class _9{constructor(Z,X){this.schema=Z,this.decode=X}EncodeTransform(Z,X){let Y={Encode:(q)=>X[V0].Encode(Z(q)),Decode:(q)=>this.decode(X[V0].Decode(q))};return{...X,[V0]:Y}}EncodeSchema(Z,X){let z={Decode:this.decode,Encode:Z};return{...X,[V0]:z}}Encode(Z){return FZ(this.schema)?this.EncodeTransform(Z,this.schema):this.EncodeSchema(Z,this.schema)}}function B9(Z){return new V9(Z)}function U9(Z={}){return R({[I]:Z[I]??"Unsafe"},Z)}function G9(Z){return R({[I]:"Void",type:"void"},Z)}var h5={};m6(h5,{Void:()=>G9,Uppercase:()=>d2,Unsafe:()=>U9,Unknown:()=>SZ,Union:()=>d,Undefined:()=>E6,Uncapitalize:()=>c2,Uint8Array:()=>I6,Tuple:()=>m0,Transform:()=>B9,TemplateLiteral:()=>N6,Symbol:()=>C6,String:()=>zZ,ReturnType:()=>Y9,Rest:()=>J9,Required:()=>G8,RegExp:()=>H9,Ref:()=>JZ,Recursive:()=>W9,Record:()=>f6,ReadonlyOptional:()=>k6,Readonly:()=>E0,Promise:()=>j6,Pick:()=>IZ,Partial:()=>U8,Parameters:()=>Q9,Optional:()=>O0,Omit:()=>EZ,Object:()=>o,Number:()=>y0,Null:()=>S6,Not:()=>$9,Never:()=>y,Module:()=>z9,Mapped:()=>W2,Lowercase:()=>u2,Literal:()=>c,KeyOf:()=>J8,Iterator:()=>W8,Intersect:()=>F0,Integer:()=>g2,Instantiate:()=>x2,InstanceType:()=>f2,Index:()=>RZ,Function:()=>WZ,Extract:()=>B8,Extends:()=>V8,Exclude:()=>_8,Enum:()=>q2,Date:()=>R6,ConstructorParameters:()=>G2,Constructor:()=>X8,Const:()=>U2,Composite:()=>B2,Capitalize:()=>m2,Boolean:()=>F6,BigInt:()=>Q8,Awaited:()=>H8,AsyncIterator:()=>Z8,Array:()=>eZ,Argument:()=>cX,Any:()=>jZ});var b=h5;var q9="http://127.0.0.1:3850",q8="pi",TZ="plugin",p0=5000,l8=1e4,M9=5000,g6="signet-pi-hidden-recall",h6="signet-pi-session-context";function A9(Z){return J5(Z,{logPrefix:"signet-pi",actorName:"pi-extension",runtimePath:TZ,defaultTimeout:p0})}var kJ=new Set([g6,h6]),D9={harness:q8,runtimePath:TZ,writeTimeout:l8,promptSubmitTimeout:M9,excludedCustomTypes:kJ,sessionStartTimeout:()=>p0,staticFallback:Y5};function L9(Z,X){return{role:"custom",customType:Z,display:!1,content:\`<signet-memory source="auto-recall">
24316
24316
  \${_5(X)}
24317
- </signet-memory>\`,timestamp:Date.now()}}class O9 extends U6{consumeHiddenInjectMessages(Z){if(!Z)return[];let X=[],z=p(this.pendingSessionContext.get(Z));if(z)X.push(D9(h6,z));this.pendingSessionContext.delete(Z);let W=this.consumePendingRecall(Z);if(W)X.push(D9(g6,W));return X}}function F9(){return new O9}function gJ(){let Z=xJ(P7(),"extensions","signet.json");if(!fJ(Z))return null;try{let X=bJ(Z,"utf-8"),z=JSON.parse(X);if(typeof z!=="object"||z===null)return null;return z}catch{return null}}function hJ(){let Z=gJ(),X=S8("SIGNET_ENABLED"),z=Z?.enabled;return{enabled:X!==void 0?X!=="false":z!==void 0?z:!0}}var vJ=hJ(),wZ={lastRecall:null,memoryCount:0};function yJ(){return o0("SIGNET_API_KEY")??o0("SIGNET_TOKEN")}function n8(Z={}){let X=yJ();return X?{...Z,Authorization:\`Bearer \${X}\`}:Z}async function PZ(Z){try{return(await fetch(\`\${Z}/health\`,{method:"GET",headers:n8({Accept:"application/json"}),signal:AbortSignal.timeout(p0)})).ok}catch{return!1}}async function N9(Z,X,z={}){let W=await fetch(\`\${Z}/api/memory/recall\`,{method:"POST",headers:n8({"Content-Type":"application/json"}),body:JSON.stringify($5(X,{...z})),signal:AbortSignal.timeout(z.aggregate?Math.max(p0*6,30000):p0)});if(!W.ok){let Y=await W.text();throw Error(\`Recall failed: \${Y}\`)}return await W.json()}async function K9(Z,X,z={}){let{critical:W=!1,tags:Y=[],agentId:q}=z,B=await fetch(\`\${Z}/api/hooks/remember\`,{method:"POST",headers:n8({"Content-Type":"application/json"}),body:JSON.stringify(N7(X,{harness:q8,pinned:W,tags:Y,agentId:q,source:"pi-extension",runtimePath:TZ})),signal:AbortSignal.timeout(l8)});if(!B.ok){let U=await B.text();throw Error(\`Remember failed: \${U}\`)}}async function mJ(Z,X,z={}){let{limit:W,agentId:Y,sessionKey:q,includeRecalled:B,project:U}=z,G=await fetch(\`\${Z}/api/memory/recall\`,{method:"POST",headers:n8({"Content-Type":"application/json"}),body:JSON.stringify({...$5(X,{limit:W,agentId:Y,sessionKey:q,includeRecalled:B,project:U}),sourceOnly:!0}),signal:AbortSignal.timeout(p0)});if(!G.ok){let H=await G.text();throw Error(\`Source search failed: \${H}\`)}return await G.json()}async function uJ(Z,X,z={}){let W=await fetch(\`\${Z}/api/sessions/search\`,{method:"POST",headers:n8({"Content-Type":"application/json"}),body:JSON.stringify({query:X,sessionKey:z.sessionKey,currentSessionKey:z.currentSessionKey,agentId:z.agentId,project:z.project,limit:z.limit}),signal:AbortSignal.timeout(p0)});if(!W.ok){let Y=await W.text();throw Error(\`Session search failed: \${Y}\`)}return await W.json()}function v6(Z){let X=wZ.lastRecall?\`signet:\${wZ.memoryCount} memories\`:"signet:ready";Z.ui.setStatus("signet",Z.ui.theme.fg("accent",X))}function cJ(Z,X,z){Z.on("session_start",async(W,Y)=>{if(await PZ(z))Y.ui.notify("SignetAI memory connected","info"),v6(Y);else Y.ui.notify("SignetAI daemon not running. Memory features disabled.","warning"),Y.ui.notify("Install: curl -fsSL https://signetai.sh/install.sh | bash && signet setup","info");await DZ(X,Y)}),Z.on("session_before_switch",async()=>{await E8(X,{},"session_switch")}),Z.on("session_before_fork",async()=>{await E8(X,{},"session_fork")}),Z.on("session_switch",async(W,Y)=>{await DZ(X,Y)}),Z.on("session_fork",async(W,Y)=>{await DZ(X,Y)}),Z.on("session_shutdown",async(W,Y)=>{Y.ui.setStatus("signet",void 0),await _6(X,Y,"session_shutdown")})}function dJ(Z,X){Z.on("input",async(z,W)=>{let Y=T0(W);X.state.clearPendingRecall(Y.sessionId),await I8(X,W,z.text)}),Z.on("before_agent_start",async(z,W)=>{await aZ(X,W);let Y=T0(W);if(!Y.sessionId)return;if(X.state.hasPendingRecall(Y.sessionId))return;await I8(X,W,z.prompt)})}function pJ(Z,X){Z.on("context",async(z,W)=>{let Y=T0(W),q=X.state.consumeHiddenInjectMessages(Y.sessionId);if(q.length===0)return;return{messages:[...z.messages,...q]}})}function lJ(Z,X){Z.on("session_before_compact",async(z,W)=>{await aZ(X,W);let Y=T0(W);await X.client.post("/api/hooks/pre-compaction",{harness:q8,sessionKey:Y.sessionId,messageCount:Array.isArray(z.preparation?.messagesToSummarize)?z.preparation.messagesToSummarize.length:void 0,runtimePath:TZ},p0);return}),Z.on("session_compact",async(z,W)=>{let Y=p(z.compactionEntry?.summary);if(!Y)return;let q=T0(W);await X.client.post("/api/hooks/compaction-complete",{harness:q8,summary:Y,project:q.project,sessionKey:q.sessionId,agentId:X.agentId,runtimePath:TZ},l8)})}function nJ(Z){let X=Z.trim(),z=!1,W=[];if(X.startsWith("critical:"))z=!0,X=X.slice(9).trim();let Y=X.match(/^\\[([^\\]]+)\\]:\\s*/);if(Y)W.push(...Y[1].split(",").map((q)=>q.trim())),X=X.slice(Y[0].length);return{content:X,critical:z,tags:W}}function iJ(Z,X,z){Z.registerCommand("recall",{description:"Search SignetAI memories",handler:async(W,Y)=>{if(!W?.trim()){Y.ui.notify("Usage: /recall <query>","warning");return}if(!await PZ(X)){Y.ui.notify("Signet daemon not running. Run: signet daemon start","error");return}Y.ui.notify(\`Recalling: "\${W}"...\`,"info");try{let B=await N9(X,W,{agentId:z}),U=R8(B);if(U.rows.length===0){Y.ui.notify("No relevant memories found","info");return}wZ.lastRecall=new Date().toISOString(),wZ.memoryCount=U.rows.length,v6(Y),Y.ui.notify(J6(B),"success")}catch(B){let U=B instanceof Error?B.message:String(B);Y.ui.notify(\`Recall failed: \${U}\`,"error")}}}),Z.registerCommand("remember",{description:"Save a memory to SignetAI",handler:async(W,Y)=>{if(!W?.trim()){Y.ui.notify("Usage: /remember <content>","warning");return}if(!await PZ(X)){Y.ui.notify("Signet daemon not running. Run: signet daemon start","error");return}let{content:B,critical:U,tags:G}=nJ(W);try{await K9(X,B,{critical:U,tags:G,agentId:z});let H=U?" (pinned)":"";Y.ui.notify(\`Memory saved\${H}: "\${B.substring(0,50)}..."\`,"success")}catch(H){let _=H instanceof Error?H.message:String(H);Y.ui.notify(\`Remember failed: \${_}\`,"error")}}}),Z.registerCommand("signet-status",{description:"Check SignetAI daemon status",handler:async(W,Y)=>{let q=await PZ(X),B=Y.sessionManager.getSessionId();if(q){let U=[\`Signet daemon is running on \${X}\`];if(B)U.push(\`Session: \${B}\`);Y.ui.notify(U.join(\`
24317
+ </signet-memory>\`,timestamp:Date.now()}}class O9 extends U6{consumeHiddenInjectMessages(Z){if(!Z)return[];let X=[],z=p(this.pendingSessionContext.get(Z));if(z)X.push(L9(h6,z));this.pendingSessionContext.delete(Z);let W=this.consumePendingRecall(Z);if(W)X.push(L9(g6,W));return X}}function F9(){return new O9}function gJ(){let Z=xJ(P7(),"extensions","signet.json");if(!fJ(Z))return null;try{let X=bJ(Z,"utf-8"),z=JSON.parse(X);if(typeof z!=="object"||z===null)return null;return z}catch{return null}}function hJ(){let Z=gJ(),X=S8("SIGNET_ENABLED"),z=Z?.enabled;return{enabled:X!==void 0?X!=="false":z!==void 0?z:!0}}var vJ=hJ(),wZ={lastRecall:null,memoryCount:0};function yJ(){return o0("SIGNET_API_KEY")??o0("SIGNET_TOKEN")}function n8(Z={}){let X=yJ();return X?{...Z,Authorization:\`Bearer \${X}\`}:Z}async function PZ(Z){try{return(await fetch(\`\${Z}/health\`,{method:"GET",headers:n8({Accept:"application/json"}),signal:AbortSignal.timeout(p0)})).ok}catch{return!1}}async function N9(Z,X,z={}){let W=await fetch(\`\${Z}/api/memory/recall\`,{method:"POST",headers:n8({"Content-Type":"application/json"}),body:JSON.stringify($5(X,{...z})),signal:AbortSignal.timeout(z.aggregate?Math.max(p0*6,30000):p0)});if(!W.ok){let Y=await W.text();throw Error(\`Recall failed: \${Y}\`)}return await W.json()}async function K9(Z,X,z={}){let{critical:W=!1,tags:Y=[],agentId:q}=z,B=await fetch(\`\${Z}/api/hooks/remember\`,{method:"POST",headers:n8({"Content-Type":"application/json"}),body:JSON.stringify(N7(X,{harness:q8,pinned:W,tags:Y,agentId:q,source:"pi-extension",runtimePath:TZ})),signal:AbortSignal.timeout(l8)});if(!B.ok){let U=await B.text();throw Error(\`Remember failed: \${U}\`)}}async function mJ(Z,X,z={}){let{limit:W,agentId:Y,sessionKey:q,includeRecalled:B,project:U}=z,G=await fetch(\`\${Z}/api/memory/recall\`,{method:"POST",headers:n8({"Content-Type":"application/json"}),body:JSON.stringify({...$5(X,{limit:W,agentId:Y,sessionKey:q,includeRecalled:B,project:U}),sourceOnly:!0}),signal:AbortSignal.timeout(p0)});if(!G.ok){let H=await G.text();throw Error(\`Source search failed: \${H}\`)}return await G.json()}async function uJ(Z,X,z={}){let W=await fetch(\`\${Z}/api/sessions/search\`,{method:"POST",headers:n8({"Content-Type":"application/json"}),body:JSON.stringify({query:X,sessionKey:z.sessionKey,currentSessionKey:z.currentSessionKey,agentId:z.agentId,project:z.project,limit:z.limit}),signal:AbortSignal.timeout(p0)});if(!W.ok){let Y=await W.text();throw Error(\`Session search failed: \${Y}\`)}return await W.json()}function v6(Z){let X=wZ.lastRecall?\`signet:\${wZ.memoryCount} memories\`:"signet:ready";Z.ui.setStatus("signet",Z.ui.theme.fg("accent",X))}function cJ(Z,X,z){Z.on("session_start",async(W,Y)=>{if(await PZ(z))Y.ui.notify("SignetAI memory connected","info"),v6(Y);else Y.ui.notify("SignetAI daemon not running. Memory features disabled.","warning"),Y.ui.notify("Install: curl -fsSL https://signetai.sh/install.sh | bash && signet setup","info");await LZ(X,Y)}),Z.on("session_before_switch",async()=>{await E8(X,{},"session_switch")}),Z.on("session_before_fork",async()=>{await E8(X,{},"session_fork")}),Z.on("session_switch",async(W,Y)=>{await LZ(X,Y)}),Z.on("session_fork",async(W,Y)=>{await LZ(X,Y)}),Z.on("session_shutdown",async(W,Y)=>{Y.ui.setStatus("signet",void 0),await _6(X,Y,"session_shutdown")})}function dJ(Z,X){Z.on("input",async(z,W)=>{let Y=T0(W);X.state.clearPendingRecall(Y.sessionId),await I8(X,W,z.text)}),Z.on("before_agent_start",async(z,W)=>{await aZ(X,W);let Y=T0(W);if(!Y.sessionId)return;if(X.state.hasPendingRecall(Y.sessionId))return;await I8(X,W,z.prompt)})}function pJ(Z,X){Z.on("context",async(z,W)=>{let Y=T0(W),q=X.state.consumeHiddenInjectMessages(Y.sessionId);if(q.length===0)return;return{messages:[...z.messages,...q]}})}function lJ(Z,X){Z.on("session_before_compact",async(z,W)=>{await aZ(X,W);let Y=T0(W);await X.client.post("/api/hooks/pre-compaction",{harness:q8,sessionKey:Y.sessionId,messageCount:Array.isArray(z.preparation?.messagesToSummarize)?z.preparation.messagesToSummarize.length:void 0,runtimePath:TZ},p0);return}),Z.on("session_compact",async(z,W)=>{let Y=p(z.compactionEntry?.summary);if(!Y)return;let q=T0(W);await X.client.post("/api/hooks/compaction-complete",{harness:q8,summary:Y,project:q.project,sessionKey:q.sessionId,agentId:X.agentId,runtimePath:TZ},l8)})}function nJ(Z){let X=Z.trim(),z=!1,W=[];if(X.startsWith("critical:"))z=!0,X=X.slice(9).trim();let Y=X.match(/^\\[([^\\]]+)\\]:\\s*/);if(Y)W.push(...Y[1].split(",").map((q)=>q.trim())),X=X.slice(Y[0].length);return{content:X,critical:z,tags:W}}function iJ(Z,X,z){Z.registerCommand("recall",{description:"Search SignetAI memories",handler:async(W,Y)=>{if(!W?.trim()){Y.ui.notify("Usage: /recall <query>","warning");return}if(!await PZ(X)){Y.ui.notify("Signet daemon not running. Run: signet daemon start","error");return}Y.ui.notify(\`Recalling: "\${W}"...\`,"info");try{let B=await N9(X,W,{agentId:z}),U=R8(B);if(U.rows.length===0){Y.ui.notify("No relevant memories found","info");return}wZ.lastRecall=new Date().toISOString(),wZ.memoryCount=U.rows.length,v6(Y),Y.ui.notify(J6(B),"success")}catch(B){let U=B instanceof Error?B.message:String(B);Y.ui.notify(\`Recall failed: \${U}\`,"error")}}}),Z.registerCommand("remember",{description:"Save a memory to SignetAI",handler:async(W,Y)=>{if(!W?.trim()){Y.ui.notify("Usage: /remember <content>","warning");return}if(!await PZ(X)){Y.ui.notify("Signet daemon not running. Run: signet daemon start","error");return}let{content:B,critical:U,tags:G}=nJ(W);try{await K9(X,B,{critical:U,tags:G,agentId:z});let H=U?" (pinned)":"";Y.ui.notify(\`Memory saved\${H}: "\${B.substring(0,50)}..."\`,"success")}catch(H){let _=H instanceof Error?H.message:String(H);Y.ui.notify(\`Remember failed: \${_}\`,"error")}}}),Z.registerCommand("signet-status",{description:"Check SignetAI daemon status",handler:async(W,Y)=>{let q=await PZ(X),B=Y.sessionManager.getSessionId();if(q){let U=[\`Signet daemon is running on \${X}\`];if(B)U.push(\`Session: \${B}\`);Y.ui.notify(U.join(\`
24318
24318
  \`),"success");try{let G=await fetch(\`\${X}/api/memory/stats\`,{signal:AbortSignal.timeout(p0)});if(G.ok){let H=await G.json();Y.ui.notify(\`Memory stats: \${JSON.stringify(H)}\`,"info")}}catch{}}else Y.ui.notify(\`Signet daemon not responding.
24319
24319
  Install: curl -fsSL https://signetai.sh/install.sh | bash && signet setup
24320
- Start: signet daemon start\`,"error")}}),Z.registerTool({name:"signet_recall",label:"Signet Recall",description:"Search SignetAI persistent memory for relevant context from previous sessions. Use aggregate=true for multi-query synthesis that consolidates scattered memories into a single summary.",promptSnippet:"Search past memories when user asks about previous decisions, preferences, or project context",promptGuidelines:["Use aggregate=true when the user asks a broad question that likely spans many memories (e.g. 'who is X', 'what happened with Y', 'summarize the history of Z')","Use aggregate=false (default) for targeted lookups of specific facts or single memories","Aggregate recall takes longer (3-5s) but produces higher-quality synthesized answers for complex queries"],parameters:b.Object({query:b.String({description:"Search query to find relevant memories"}),limit:b.Optional(b.Number({description:"Maximum number of memories to return (default: 10)",default:10})),sessionKey:b.Optional(b.String({description:"Session key for per-context recall dedupe"})),includeRecalled:b.Optional(b.Boolean({description:"Include rows already recalled in this context",default:!1})),scope:b.Optional(b.Union([b.Literal("global"),b.Literal("agent"),b.Literal("session")],{description:"Recall scope constraint"})),aggregate:b.Optional(b.Boolean({description:"Enable aggregate recall: runs multiple follow-up queries and synthesizes a consolidated answer. Use for broad questions spanning many memories. (default: false)",default:!1})),aggregateBudget:b.Optional(b.String({description:"Aggregate synthesis budget: 'small', 'medium', or 'large'. Controls depth of multi-query recall and synthesis. (default: medium)"}))}),async execute(W,Y,q,B,U){if(!await PZ(X))return{content:[{type:"text",text:"Signet daemon not running. Memories unavailable."}],details:{error:"daemon_offline"}};try{let H=String(Y.query||""),_=typeof Y.limit==="number"?Y.limit:void 0,$=typeof Y.sessionKey==="string"?Y.sessionKey:void 0,Q=typeof Y.scope==="string"&&["global","agent","session"].includes(Y.scope)?Y.scope:void 0,J=Y.aggregate===!0,V=typeof Y.aggregateBudget==="string"&&["small","medium","large"].includes(Y.aggregateBudget)?Y.aggregateBudget:void 0,M=await N9(X,H,{limit:_,agentId:z,sessionKey:$,includeRecalled:Y.includeRecalled===!0,scope:Q,aggregate:J,aggregateBudget:V}),A=R8(M);if(J&&M.aggregate){let L=M.results??A.rows;if(L.length===0)return{content:[{type:"text",text:"No relevant memories found for this query."}],details:{memoriesFound:0}};wZ.lastRecall=new Date().toISOString(),wZ.memoryCount=L.length,v6(U);let D=M.aggregate.partial===!0,F=[D?\`[Aggregate Recall degraded] Query: \${H}\`:\`[Aggregate Recall] Query: \${H}\`];if(D&&typeof M.aggregate.message==="string")F.push(M.aggregate.message);for(let j of L)if(typeof j.content==="string")F.push(j.content);return{content:[{type:"text",text:F.join(\`
24320
+ Start: signet daemon start\`,"error")}}),Z.registerTool({name:"signet_recall",label:"Signet Recall",description:"Search SignetAI persistent memory for relevant context from previous sessions. Use aggregate=true for multi-query synthesis that consolidates scattered memories into a single summary.",promptSnippet:"Search past memories when user asks about previous decisions, preferences, or project context",promptGuidelines:["Use aggregate=true when the user asks a broad question that likely spans many memories (e.g. 'who is X', 'what happened with Y', 'summarize the history of Z')","Use aggregate=false (default) for targeted lookups of specific facts or single memories","Aggregate recall takes longer (3-5s) but produces higher-quality synthesized answers for complex queries"],parameters:b.Object({query:b.String({description:"Search query to find relevant memories"}),limit:b.Optional(b.Number({description:"Maximum number of memories to return (default: 10)",default:10})),sessionKey:b.Optional(b.String({description:"Session key for per-context recall dedupe"})),includeRecalled:b.Optional(b.Boolean({description:"Include rows already recalled in this context",default:!1})),scope:b.Optional(b.Union([b.Literal("global"),b.Literal("agent"),b.Literal("session")],{description:"Recall scope constraint"})),aggregate:b.Optional(b.Boolean({description:"Enable aggregate recall: runs multiple follow-up queries and synthesizes a consolidated answer. Use for broad questions spanning many memories. (default: false)",default:!1})),aggregateBudget:b.Optional(b.String({description:"Aggregate synthesis budget: 'small', 'medium', or 'large'. Controls depth of multi-query recall and synthesis. (default: medium)"}))}),async execute(W,Y,q,B,U){if(!await PZ(X))return{content:[{type:"text",text:"Signet daemon not running. Memories unavailable."}],details:{error:"daemon_offline"}};try{let H=String(Y.query||""),_=typeof Y.limit==="number"?Y.limit:void 0,$=typeof Y.sessionKey==="string"?Y.sessionKey:void 0,Q=typeof Y.scope==="string"&&["global","agent","session"].includes(Y.scope)?Y.scope:void 0,J=Y.aggregate===!0,V=typeof Y.aggregateBudget==="string"&&["small","medium","large"].includes(Y.aggregateBudget)?Y.aggregateBudget:void 0,M=await N9(X,H,{limit:_,agentId:z,sessionKey:$,includeRecalled:Y.includeRecalled===!0,scope:Q,aggregate:J,aggregateBudget:V}),A=R8(M);if(J&&M.aggregate){let D=M.results??A.rows;if(D.length===0)return{content:[{type:"text",text:"No relevant memories found for this query."}],details:{memoriesFound:0}};wZ.lastRecall=new Date().toISOString(),wZ.memoryCount=D.length,v6(U);let L=M.aggregate.partial===!0,F=[L?\`[Aggregate Recall degraded] Query: \${H}\`:\`[Aggregate Recall] Query: \${H}\`];if(L&&typeof M.aggregate.message==="string")F.push(M.aggregate.message);for(let j of D)if(typeof j.content==="string")F.push(j.content);return{content:[{type:"text",text:F.join(\`
24321
24321
 
24322
- \`)}],details:{memoriesFound:L.length,memories:L,aggregate:M.aggregate,meta:A.meta}}}if(A.rows.length===0)return{content:[{type:"text",text:"No relevant memories found for this query."}],details:{memoriesFound:0}};return wZ.lastRecall=new Date().toISOString(),wZ.memoryCount=A.rows.length,v6(U),{content:[{type:"text",text:J6(M)}],details:{memoriesFound:A.rows.length,memories:A.rows,meta:A.meta}}}catch(H){let _=H instanceof Error?H.message:String(H);return{content:[{type:"text",text:\`Error recalling memories: \${_}\`}],details:{error:_},isError:!0}}}}),Z.registerTool({name:"signet_source_search",label:"Signet Source Search",description:"Search Signet source-backed artifacts such as Codex native memory, Obsidian, imported docs, and transcripts.",promptSnippet:"Search source-backed artifacts when the answer should come from imported files, notes, docs, transcripts, or other provenance-backed sources rather than ordinary saved memories",promptGuidelines:["Use this when the user asks about source-backed documents, notes, imported files, or provenance-specific context","Keep source search separate from ordinary memory recall; prefer signet_recall for preferences, decisions, and remembered facts"],parameters:b.Object({query:b.String({description:"Natural-language source search query"}),limit:b.Optional(b.Number({description:"Maximum number of source results to return (default: 10)",default:10})),project:b.Optional(b.String({description:"Optional project path filter"})),includeRecalled:b.Optional(b.Boolean({description:"Include rows already recalled in this context",default:!1}))}),async execute(W,Y,q,B,U){if(!await PZ(X))return{content:[{type:"text",text:"Signet daemon not running. Source search unavailable."}],details:{error:"daemon_offline"}};try{let H=T0(U),_=String(Y.query||""),$=typeof Y.limit==="number"?Y.limit:10,Q=typeof Y.project==="string"?Y.project:void 0,J=await mJ(X,_,{limit:$,agentId:z,sessionKey:p(H.sessionId),includeRecalled:Y.includeRecalled===!0,project:Q}),V=R8(J);if(V.rows.length===0)return{content:[{type:"text",text:"No relevant source artifacts found for this query."}],details:{sourcesFound:0}};return{content:[{type:"text",text:J6(J)}],details:{sourcesFound:V.rows.length,sources:V.rows,meta:V.meta}}}catch(H){let _=H instanceof Error?H.message:String(H);return{content:[{type:"text",text:\`Error searching sources: \${_}\`}],details:{error:_},isError:!0}}}}),Z.registerTool({name:"signet_session_search",label:"Signet Session Search",description:"Search active or completed Signet session transcripts. This is transcript-only and separate from memory recall.",promptSnippet:"Search Signet session transcripts when prior conversation evidence matters; keep transcript lookup separate from memory recall",promptGuidelines:["Use this when the user asks what happened in a prior session, wants transcript evidence, or needs exact conversational context","Prefer signet_recall for durable remembered facts and signet_source_search for source-backed artifacts"],parameters:b.Object({query:b.String({description:"Natural language or keyword query"}),sessionKey:b.Optional(b.String({description:"Specific transcript session key to search"})),currentSessionKey:b.Optional(b.String({description:"Current session key; sub-agent lineage may resolve this to the parent session"})),agentId:b.Optional(b.String({description:"Agent scope; defaults to the configured SIGNET_AGENT_ID when set"})),project:b.Optional(b.String({description:"Optional project path filter"})),limit:b.Optional(b.Number({description:"Max results to return (default 10, max 20)",default:10}))}),async execute(W,Y,q,B,U){if(!await PZ(X))return{content:[{type:"text",text:"Signet daemon not running. Session search unavailable."}],details:{error:"daemon_offline"}};try{let H=String(Y.query||""),_=await uJ(X,H,{sessionKey:typeof Y.sessionKey==="string"?Y.sessionKey:void 0,currentSessionKey:typeof Y.currentSessionKey==="string"?Y.currentSessionKey:void 0,agentId:typeof Y.agentId==="string"?Y.agentId:z,project:typeof Y.project==="string"?Y.project:void 0,limit:typeof Y.limit==="number"?Y.limit:void 0});return{content:[{type:"text",text:JSON.stringify(_,null,2)}],details:{result:_}}}catch(H){let _=H instanceof Error?H.message:String(H);return{content:[{type:"text",text:\`Error searching sessions: \${_}\`}],details:{error:_},isError:!0}}}}),Z.registerTool({name:"signet_remember",label:"Signet Remember",description:"Save important information to SignetAI persistent memory for future sessions",promptSnippet:"Save critical decisions, user preferences, or key facts that should persist across sessions",promptGuidelines:["Use this tool when the user explicitly asks to remember something","Save key decisions made during the conversation that would be useful context later","Store user preferences about coding style, tools, or workflows","Mark critical information with critical=true to prevent decay"],parameters:b.Object({content:b.String({description:"The content to remember"}),critical:b.Optional(b.Boolean({description:"If true, memory will never decay and is always prioritized",default:!1})),tags:b.Optional(b.Array(b.String(),{description:"Tags to categorize this memory for better search"}))}),async execute(W,Y,q,B,U){if(!await PZ(X))return{content:[{type:"text",text:"Signet daemon not running. Cannot save memory."}],details:{error:"daemon_offline"}};try{let H=String(Y.content||""),_=Boolean(Y.critical),$=Array.isArray(Y.tags)?Y.tags.filter((J)=>typeof J==="string"):[];return await K9(X,H,{critical:_,tags:$,agentId:z}),{content:[{type:"text",text:\`Memory saved\${_?" (pinned/critical)":""} successfully.\`}],details:{saved:!0,content:H}}}catch(H){let _=H instanceof Error?H.message:String(H);return{content:[{type:"text",text:\`Error saving memory: \${_}\`}],details:{error:_},isError:!0}}}})}var oJ=(Z)=>{if(!vJ.enabled)return;let X=o0("SIGNET_DAEMON_URL")??q9,z=o0("SIGNET_AGENT_ID");if(S8("SIGNET_BYPASS")!=="1"){let W={agentId:z,client:A9(X),state:F9(),config:L9};cJ(Z,W,X),dJ(Z,W),pJ(Z,W),lJ(Z,W)}iJ(Z,X,z)},sD=oJ;export{mJ as searchSourceArtifacts,uJ as searchSessions,K9 as rememberContent,N9 as recallMemories,nJ as parseRememberArgs,hJ as loadConfig,sD as default};
24322
+ \`)}],details:{memoriesFound:D.length,memories:D,aggregate:M.aggregate,meta:A.meta}}}if(A.rows.length===0)return{content:[{type:"text",text:"No relevant memories found for this query."}],details:{memoriesFound:0}};return wZ.lastRecall=new Date().toISOString(),wZ.memoryCount=A.rows.length,v6(U),{content:[{type:"text",text:J6(M)}],details:{memoriesFound:A.rows.length,memories:A.rows,meta:A.meta}}}catch(H){let _=H instanceof Error?H.message:String(H);return{content:[{type:"text",text:\`Error recalling memories: \${_}\`}],details:{error:_},isError:!0}}}}),Z.registerTool({name:"signet_source_search",label:"Signet Source Search",description:"Search Signet source-backed artifacts such as Codex native memory, Obsidian, imported docs, and transcripts.",promptSnippet:"Search source-backed artifacts when the answer should come from imported files, notes, docs, transcripts, or other provenance-backed sources rather than ordinary saved memories",promptGuidelines:["Use this when the user asks about source-backed documents, notes, imported files, or provenance-specific context","Keep source search separate from ordinary memory recall; prefer signet_recall for preferences, decisions, and remembered facts"],parameters:b.Object({query:b.String({description:"Natural-language source search query"}),limit:b.Optional(b.Number({description:"Maximum number of source results to return (default: 10)",default:10})),project:b.Optional(b.String({description:"Optional project path filter"})),includeRecalled:b.Optional(b.Boolean({description:"Include rows already recalled in this context",default:!1}))}),async execute(W,Y,q,B,U){if(!await PZ(X))return{content:[{type:"text",text:"Signet daemon not running. Source search unavailable."}],details:{error:"daemon_offline"}};try{let H=T0(U),_=String(Y.query||""),$=typeof Y.limit==="number"?Y.limit:10,Q=typeof Y.project==="string"?Y.project:void 0,J=await mJ(X,_,{limit:$,agentId:z,sessionKey:p(H.sessionId),includeRecalled:Y.includeRecalled===!0,project:Q}),V=R8(J);if(V.rows.length===0)return{content:[{type:"text",text:"No relevant source artifacts found for this query."}],details:{sourcesFound:0}};return{content:[{type:"text",text:J6(J)}],details:{sourcesFound:V.rows.length,sources:V.rows,meta:V.meta}}}catch(H){let _=H instanceof Error?H.message:String(H);return{content:[{type:"text",text:\`Error searching sources: \${_}\`}],details:{error:_},isError:!0}}}}),Z.registerTool({name:"signet_session_search",label:"Signet Session Search",description:"Search active or completed Signet session transcripts. This is transcript-only and separate from memory recall.",promptSnippet:"Search Signet session transcripts when prior conversation evidence matters; keep transcript lookup separate from memory recall",promptGuidelines:["Use this when the user asks what happened in a prior session, wants transcript evidence, or needs exact conversational context","Prefer signet_recall for durable remembered facts and signet_source_search for source-backed artifacts"],parameters:b.Object({query:b.String({description:"Natural language or keyword query"}),sessionKey:b.Optional(b.String({description:"Specific transcript session key to search"})),currentSessionKey:b.Optional(b.String({description:"Current session key; sub-agent lineage may resolve this to the parent session"})),agentId:b.Optional(b.String({description:"Agent scope; defaults to the configured SIGNET_AGENT_ID when set"})),project:b.Optional(b.String({description:"Optional project path filter"})),limit:b.Optional(b.Number({description:"Max results to return (default 10, max 20)",default:10}))}),async execute(W,Y,q,B,U){if(!await PZ(X))return{content:[{type:"text",text:"Signet daemon not running. Session search unavailable."}],details:{error:"daemon_offline"}};try{let H=String(Y.query||""),_=await uJ(X,H,{sessionKey:typeof Y.sessionKey==="string"?Y.sessionKey:void 0,currentSessionKey:typeof Y.currentSessionKey==="string"?Y.currentSessionKey:void 0,agentId:typeof Y.agentId==="string"?Y.agentId:z,project:typeof Y.project==="string"?Y.project:void 0,limit:typeof Y.limit==="number"?Y.limit:void 0});return{content:[{type:"text",text:JSON.stringify(_,null,2)}],details:{result:_}}}catch(H){let _=H instanceof Error?H.message:String(H);return{content:[{type:"text",text:\`Error searching sessions: \${_}\`}],details:{error:_},isError:!0}}}}),Z.registerTool({name:"signet_remember",label:"Signet Remember",description:"Save important information to SignetAI persistent memory for future sessions",promptSnippet:"Save critical decisions, user preferences, or key facts that should persist across sessions",promptGuidelines:["Use this tool when the user explicitly asks to remember something","Save key decisions made during the conversation that would be useful context later","Store user preferences about coding style, tools, or workflows","Mark critical information with critical=true to prevent decay"],parameters:b.Object({content:b.String({description:"The content to remember"}),critical:b.Optional(b.Boolean({description:"If true, memory will never decay and is always prioritized",default:!1})),tags:b.Optional(b.Array(b.String(),{description:"Tags to categorize this memory for better search"}))}),async execute(W,Y,q,B,U){if(!await PZ(X))return{content:[{type:"text",text:"Signet daemon not running. Cannot save memory."}],details:{error:"daemon_offline"}};try{let H=String(Y.content||""),_=Boolean(Y.critical),$=Array.isArray(Y.tags)?Y.tags.filter((J)=>typeof J==="string"):[];return await K9(X,H,{critical:_,tags:$,agentId:z}),{content:[{type:"text",text:\`Memory saved\${_?" (pinned/critical)":""} successfully.\`}],details:{saved:!0,content:H}}}catch(H){let _=H instanceof Error?H.message:String(H);return{content:[{type:"text",text:\`Error saving memory: \${_}\`}],details:{error:_},isError:!0}}}})}var oJ=(Z)=>{if(!vJ.enabled)return;let X=o0("SIGNET_DAEMON_URL")??q9,z=o0("SIGNET_AGENT_ID");if(S8("SIGNET_BYPASS")!=="1"){let W={agentId:z,client:A9(X),state:F9(),config:D9};cJ(Z,W,X),dJ(Z,W),pJ(Z,W),lJ(Z,W)}iJ(Z,X,z)},sL=oJ;export{mJ as searchSourceArtifacts,uJ as searchSessions,K9 as rememberContent,N9 as recallMemories,nJ as parseRememberArgs,hJ as loadConfig,sL as default};
24323
24323
  `;
24324
24324
 
24325
24325
  // src/index.ts