woml-cli 1.0.7 → 1.0.8

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.
@@ -1,21 +1,23 @@
1
1
  #!/usr/bin/env bun
2
2
  // @bun
3
- var zn=Object.create;var{getPrototypeOf:Qn,defineProperty:xo,getOwnPropertyNames:Gn}=Object;var Hn=Object.prototype.hasOwnProperty;function Dn(t){return this[t]}var vn,Kn,Un=(t,i,o)=>{var r=t!=null&&typeof t==="object";if(r){var $=i?vn??=new WeakMap:Kn??=new WeakMap,l=$.get(t);if(l)return l}o=t!=null?zn(Qn(t)):{};let f=i||!t||!t.__esModule?xo(o,"default",{value:t,enumerable:!0}):o;for(let s of Gn(t))if(!Hn.call(f,s))xo(f,s,{get:Dn.bind(t,s),enumerable:!0});if(r)$.set(t,f);return f};var M=(t,i)=>()=>(i||t((i={exports:{}}).exports,i),i.exports);var Qt=M((rr)=>{Object.defineProperty(rr,"__esModule",{value:!0});rr.regexpCode=rr.getEsmExportName=rr.getProperty=rr.safeStringify=rr.stringify=rr.strConcat=rr.addCodeArg=rr.str=rr._=rr.nil=rr._Code=rr.Name=rr.IDENTIFIER=rr._CodeOrName=void 0;class oi{}rr._CodeOrName=oi;rr.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class Tt extends oi{constructor(t){super();if(!rr.IDENTIFIER.test(t))throw Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}rr.Name=Tt;class k extends oi{constructor(t){super();this._items=typeof t==="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let t=this._items[0];return t===""||t==='""'}get str(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce((i,o)=>`${i}${o}`,"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce((i,o)=>{if(o instanceof Tt)i[o.str]=(i[o.str]||0)+1;return i},{})}}rr._Code=k;rr.nil=new k("");function ir(t,...i){let o=[t[0]],r=0;while(r<i.length)Ci(o,i[r]),o.push(t[++r]);return new k(o)}rr._=ir;var ki=new k("+");function or(t,...i){let o=[zt(t[0])],r=0;while(r<i.length)o.push(ki),Ci(o,i[r]),o.push(ki,zt(t[++r]));return En(o),new k(o)}rr.str=or;function Ci(t,i){if(i instanceof k)t.push(...i._items);else if(i instanceof Tt)t.push(i);else t.push(kn(i))}rr.addCodeArg=Ci;function En(t){let i=1;while(i<t.length-1){if(t[i]===ki){let o=Rn(t[i-1],t[i+1]);if(o!==void 0){t.splice(i-1,3,o);continue}t[i++]="+"}i++}}function Rn(t,i){if(i==='""')return t;if(t==='""')return i;if(typeof t=="string"){if(i instanceof Tt||t[t.length-1]!=='"')return;if(typeof i!="string")return`${t.slice(0,-1)}${i}"`;if(i[0]==='"')return t.slice(0,-1)+i.slice(1);return}if(typeof i=="string"&&i[0]==='"'&&!(t instanceof Tt))return`"${t}${i.slice(1)}`;return}function Sn(t,i){return i.emptyStr()?t:t.emptyStr()?i:or`${t}${i}`}rr.strConcat=Sn;function kn(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:zt(Array.isArray(t)?t.join(","):t)}function Cn(t){return new k(zt(t))}rr.stringify=Cn;function zt(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}rr.safeStringify=zt;function hn(t){return typeof t=="string"&&rr.IDENTIFIER.test(t)?new k(`.${t}`):ir`[${t}]`}rr.getProperty=hn;function gn(t){if(typeof t=="string"&&rr.IDENTIFIER.test(t))return new k(`${t}`);throw Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}rr.getEsmExportName=gn;function mn(t){return new k(t.toString())}rr.regexpCode=mn});var xi=M((sr)=>{Object.defineProperty(sr,"__esModule",{value:!0});sr.ValueScope=sr.ValueScopeName=sr.Scope=sr.varKinds=sr.UsedValueState=void 0;var v=Qt();class lr extends Error{constructor(t){super(`CodeGen: "code" for ${t} not defined`);this.value=t.value}}var $i;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})($i||(sr.UsedValueState=$i={}));sr.varKinds={const:new v.Name("const"),let:new v.Name("let"),var:new v.Name("var")};class gi{constructor({prefixes:t,parent:i}={}){this._names={},this._prefixes=t,this._parent=i}toName(t){return t instanceof v.Name?t:this.name(t)}name(t){return new v.Name(this._newName(t))}_newName(t){let i=this._names[t]||this._nameGroup(t);return`${t}${i.index++}`}_nameGroup(t){var i,o;if(((o=(i=this._parent)===null||i===void 0?void 0:i._prefixes)===null||o===void 0?void 0:o.has(t))||this._prefixes&&!this._prefixes.has(t))throw Error(`CodeGen: prefix "${t}" is not allowed in this scope`);return this._names[t]={prefix:t,index:0}}}sr.Scope=gi;class mi extends v.Name{constructor(t,i){super(i);this.prefix=t}setValue(t,{property:i,itemIndex:o}){this.value=t,this.scopePath=v._`.${new v.Name(i)}[${o}]`}}sr.ValueScopeName=mi;var bb=v._`\n`;class fr extends gi{constructor(t){super(t);this._values={},this._scope=t.scope,this.opts={...t,_n:t.lines?bb:v.nil}}get(){return this._scope}name(t){return new mi(t,this._newName(t))}value(t,i){var o;if(i.ref===void 0)throw Error("CodeGen: ref must be passed in value");let r=this.toName(t),{prefix:$}=r,l=(o=i.key)!==null&&o!==void 0?o:i.ref,f=this._values[$];if(f){let b=f.get(l);if(b)return b}else f=this._values[$]=new Map;f.set(l,r);let s=this._scope[$]||(this._scope[$]=[]),n=s.length;return s[n]=i.ref,r.setValue(i,{property:$,itemIndex:n}),r}getValue(t,i){let o=this._values[t];if(!o)return;return o.get(i)}scopeRefs(t,i=this._values){return this._reduceValues(i,(o)=>{if(o.scopePath===void 0)throw Error(`CodeGen: name "${o}" has no value`);return v._`${t}${o.scopePath}`})}scopeCode(t=this._values,i,o){return this._reduceValues(t,(r)=>{if(r.value===void 0)throw Error(`CodeGen: name "${r}" has no value`);return r.value.code},i,o)}_reduceValues(t,i,o={},r){let $=v.nil;for(let l in t){let f=t[l];if(!f)continue;let s=o[l]=o[l]||new Map;f.forEach((n)=>{if(s.has(n))return;s.set(n,$i.Started);let b=i(n);if(b){let u=this.opts.es5?sr.varKinds.var:sr.varKinds.const;$=v._`${$}${u} ${n} = ${b};${this.opts._n}`}else if(b=r===null||r===void 0?void 0:r(n))$=v._`${$}${b}${this.opts._n}`;else throw new lr(n);s.set(n,$i.Completed)})}return $}}sr.ValueScope=fr});var O=M((K)=>{Object.defineProperty(K,"__esModule",{value:!0});K.or=K.and=K.not=K.CodeGen=K.operators=K.varKinds=K.ValueScopeName=K.ValueScope=K.Scope=K.Name=K.regexpCode=K.stringify=K.getProperty=K.nil=K.strConcat=K.str=K._=void 0;var F=Qt(),C=xi(),lt=Qt();Object.defineProperty(K,"_",{enumerable:!0,get:function(){return lt._}});Object.defineProperty(K,"str",{enumerable:!0,get:function(){return lt.str}});Object.defineProperty(K,"strConcat",{enumerable:!0,get:function(){return lt.strConcat}});Object.defineProperty(K,"nil",{enumerable:!0,get:function(){return lt.nil}});Object.defineProperty(K,"getProperty",{enumerable:!0,get:function(){return lt.getProperty}});Object.defineProperty(K,"stringify",{enumerable:!0,get:function(){return lt.stringify}});Object.defineProperty(K,"regexpCode",{enumerable:!0,get:function(){return lt.regexpCode}});Object.defineProperty(K,"Name",{enumerable:!0,get:function(){return lt.Name}});var ui=xi();Object.defineProperty(K,"Scope",{enumerable:!0,get:function(){return ui.Scope}});Object.defineProperty(K,"ValueScope",{enumerable:!0,get:function(){return ui.ValueScope}});Object.defineProperty(K,"ValueScopeName",{enumerable:!0,get:function(){return ui.ValueScopeName}});Object.defineProperty(K,"varKinds",{enumerable:!0,get:function(){return ui.varKinds}});K.operators={GT:new F._Code(">"),GTE:new F._Code(">="),LT:new F._Code("<"),LTE:new F._Code("<="),EQ:new F._Code("==="),NEQ:new F._Code("!=="),NOT:new F._Code("!"),OR:new F._Code("||"),AND:new F._Code("&&"),ADD:new F._Code("+")};class ft{optimizeNodes(){return this}optimizeNames(t,i){return this}}class br extends ft{constructor(t,i,o){super();this.varKind=t,this.name=i,this.rhs=o}render({es5:t,_n:i}){let o=t?C.varKinds.var:this.varKind,r=this.rhs===void 0?"":` = ${this.rhs}`;return`${o} ${this.name}${r};`+i}optimizeNames(t,i){if(!t[this.name.str])return;if(this.rhs)this.rhs=Wt(this.rhs,t,i);return this}get names(){return this.rhs instanceof F._CodeOrName?this.rhs.names:{}}}class to extends ft{constructor(t,i,o){super();this.lhs=t,this.rhs=i,this.sideEffects=o}render({_n:t}){return`${this.lhs} = ${this.rhs};`+t}optimizeNames(t,i){if(this.lhs instanceof F.Name&&!t[this.lhs.str]&&!this.sideEffects)return;return this.rhs=Wt(this.rhs,t,i),this}get names(){let t=this.lhs instanceof F.Name?{}:{...this.lhs.names};return bi(t,this.rhs)}}class ur extends to{constructor(t,i,o,r){super(t,o,r);this.op=i}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}}class Ir extends ft{constructor(t){super();this.label=t,this.names={}}render({_n:t}){return`${this.label}:`+t}}class yr extends ft{constructor(t){super();this.label=t,this.names={}}render({_n:t}){return`break${this.label?` ${this.label}`:""};`+t}}class er extends ft{constructor(t){super();this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}}class Mr extends ft{constructor(t){super();this.code=t}render({_n:t}){return`${this.code};`+t}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(t,i){return this.code=Wt(this.code,t,i),this}get names(){return this.code instanceof F._CodeOrName?this.code.names:{}}}class Ii extends ft{constructor(t=[]){super();this.nodes=t}render(t){return this.nodes.reduce((i,o)=>i+o.render(t),"")}optimizeNodes(){let{nodes:t}=this,i=t.length;while(i--){let o=t[i].optimizeNodes();if(Array.isArray(o))t.splice(i,1,...o);else if(o)t[i]=o;else t.splice(i,1)}return t.length>0?this:void 0}optimizeNames(t,i){let{nodes:o}=this,r=o.length;while(r--){let $=o[r];if($.optimizeNames(t,i))continue;eb(t,$.names),o.splice(r,1)}return o.length>0?this:void 0}get names(){return this.nodes.reduce((t,i)=>et(t,i.names),{})}}class st extends Ii{render(t){return"{"+t._n+super.render(t)+"}"+t._n}}class dr extends Ii{}class Gt extends st{}Gt.kind="else";class ot extends st{constructor(t,i){super(i);this.condition=t}render(t){let i=`if(${this.condition})`+super.render(t);if(this.else)i+="else "+this.else.render(t);return i}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let i=this.else;if(i){let o=i.optimizeNodes();i=this.else=Array.isArray(o)?new Gt(o):o}if(i){if(t===!1)return i instanceof ot?i:i.nodes;if(this.nodes.length)return this;return new ot(qr(t),i instanceof ot?[i]:i.nodes)}if(t===!1||!this.nodes.length)return;return this}optimizeNames(t,i){var o;if(this.else=(o=this.else)===null||o===void 0?void 0:o.optimizeNames(t,i),!(super.optimizeNames(t,i)||this.else))return;return this.condition=Wt(this.condition,t,i),this}get names(){let t=super.names;if(bi(t,this.condition),this.else)et(t,this.else.names);return t}}ot.kind="if";class Ot extends st{}Ot.kind="for";class Vr extends Ot{constructor(t){super();this.iteration=t}render(t){return`for(${this.iteration})`+super.render(t)}optimizeNames(t,i){if(!super.optimizeNames(t,i))return;return this.iteration=Wt(this.iteration,t,i),this}get names(){return et(super.names,this.iteration.names)}}class cr extends Ot{constructor(t,i,o,r){super();this.varKind=t,this.name=i,this.from=o,this.to=r}render(t){let i=t.es5?C.varKinds.var:this.varKind,{name:o,from:r,to:$}=this;return`for(${i} ${o}=${r}; ${o}<${$}; ${o}++)`+super.render(t)}get names(){let t=bi(super.names,this.from);return bi(t,this.to)}}class ai extends Ot{constructor(t,i,o,r){super();this.loop=t,this.varKind=i,this.name=o,this.iterable=r}render(t){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(t)}optimizeNames(t,i){if(!super.optimizeNames(t,i))return;return this.iterable=Wt(this.iterable,t,i),this}get names(){return et(super.names,this.iterable.names)}}class li extends st{constructor(t,i,o){super();this.name=t,this.args=i,this.async=o}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}}li.kind="func";class fi extends Ii{render(t){return"return "+super.render(t)}}fi.kind="return";class pr extends st{render(t){let i="try"+super.render(t);if(this.catch)i+=this.catch.render(t);if(this.finally)i+=this.finally.render(t);return i}optimizeNodes(){var t,i;return super.optimizeNodes(),(t=this.catch)===null||t===void 0||t.optimizeNodes(),(i=this.finally)===null||i===void 0||i.optimizeNodes(),this}optimizeNames(t,i){var o,r;return super.optimizeNames(t,i),(o=this.catch)===null||o===void 0||o.optimizeNames(t,i),(r=this.finally)===null||r===void 0||r.optimizeNames(t,i),this}get names(){let t=super.names;if(this.catch)et(t,this.catch.names);if(this.finally)et(t,this.finally.names);return t}}class si extends st{constructor(t){super();this.error=t}render(t){return`catch(${this.error})`+super.render(t)}}si.kind="catch";class ni extends st{render(t){return"finally"+super.render(t)}}ni.kind="finally";class Lr{constructor(t,i={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...i,_n:i.lines?`
4
- `:""},this._extScope=t,this._scope=new C.Scope({parent:t}),this._nodes=[new dr]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,i){let o=this._extScope.value(t,i);return(this._values[o.prefix]||(this._values[o.prefix]=new Set)).add(o),o}getScopeValue(t,i){return this._extScope.getValue(t,i)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,i,o,r){let $=this._scope.toName(i);if(o!==void 0&&r)this._constants[$.str]=o;return this._leafNode(new br(t,$,o)),$}const(t,i,o){return this._def(C.varKinds.const,t,i,o)}let(t,i,o){return this._def(C.varKinds.let,t,i,o)}var(t,i,o){return this._def(C.varKinds.var,t,i,o)}assign(t,i,o){return this._leafNode(new to(t,i,o))}add(t,i){return this._leafNode(new ur(t,K.operators.ADD,i))}code(t){if(typeof t=="function")t();else if(t!==F.nil)this._leafNode(new Mr(t));return this}object(...t){let i=["{"];for(let[o,r]of t){if(i.length>1)i.push(",");if(i.push(o),o!==r||this.opts.es5)i.push(":"),(0,F.addCodeArg)(i,r)}return i.push("}"),new F._Code(i)}if(t,i,o){if(this._blockNode(new ot(t)),i&&o)this.code(i).else().code(o).endIf();else if(i)this.code(i).endIf();else if(o)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(t){return this._elseNode(new ot(t))}else(){return this._elseNode(new Gt)}endIf(){return this._endBlockNode(ot,Gt)}_for(t,i){if(this._blockNode(t),i)this.code(i).endFor();return this}for(t,i){return this._for(new Vr(t),i)}forRange(t,i,o,r,$=this.opts.es5?C.varKinds.var:C.varKinds.let){let l=this._scope.toName(t);return this._for(new cr($,l,i,o),()=>r(l))}forOf(t,i,o,r=C.varKinds.const){let $=this._scope.toName(t);if(this.opts.es5){let l=i instanceof F.Name?i:this.var("_arr",i);return this.forRange("_i",0,F._`${l}.length`,(f)=>{this.var($,F._`${l}[${f}]`),o($)})}return this._for(new ai("of",r,$,i),()=>o($))}forIn(t,i,o,r=this.opts.es5?C.varKinds.var:C.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,F._`Object.keys(${i})`,o);let $=this._scope.toName(t);return this._for(new ai("in",r,$,i),()=>o($))}endFor(){return this._endBlockNode(Ot)}label(t){return this._leafNode(new Ir(t))}break(t){return this._leafNode(new yr(t))}return(t){let i=new fi;if(this._blockNode(i),this.code(t),i.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(fi)}try(t,i,o){if(!i&&!o)throw Error('CodeGen: "try" without "catch" and "finally"');let r=new pr;if(this._blockNode(r),this.code(t),i){let $=this.name("e");this._currNode=r.catch=new si($),i($)}if(o)this._currNode=r.finally=new ni,this.code(o);return this._endBlockNode(si,ni)}throw(t){return this._leafNode(new er(t))}block(t,i){if(this._blockStarts.push(this._nodes.length),t)this.code(t).endBlock(i);return this}endBlock(t){let i=this._blockStarts.pop();if(i===void 0)throw Error("CodeGen: not in self-balancing block");let o=this._nodes.length-i;if(o<0||t!==void 0&&o!==t)throw Error(`CodeGen: wrong number of nodes: ${o} vs ${t} expected`);return this._nodes.length=i,this}func(t,i=F.nil,o,r){if(this._blockNode(new li(t,i,o)),r)this.code(r).endFunc();return this}endFunc(){return this._endBlockNode(li)}optimize(t=1){while(t-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(t){return this._currNode.nodes.push(t),this}_blockNode(t){this._currNode.nodes.push(t),this._nodes.push(t)}_endBlockNode(t,i){let o=this._currNode;if(o instanceof t||i&&o instanceof i)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${i?`${t.kind}/${i.kind}`:t.kind}"`)}_elseNode(t){let i=this._currNode;if(!(i instanceof ot))throw Error('CodeGen: "else" without "if"');return this._currNode=i.else=t,this}get _root(){return this._nodes[0]}get _currNode(){let t=this._nodes;return t[t.length-1]}set _currNode(t){let i=this._nodes;i[i.length-1]=t}}K.CodeGen=Lr;function et(t,i){for(let o in i)t[o]=(t[o]||0)+(i[o]||0);return t}function bi(t,i){return i instanceof F._CodeOrName?et(t,i.names):t}function Wt(t,i,o){if(t instanceof F.Name)return r(t);if(!$(t))return t;return new F._Code(t._items.reduce((l,f)=>{if(f instanceof F.Name)f=r(f);if(f instanceof F._Code)l.push(...f._items);else l.push(f);return l},[]));function r(l){let f=o[l.str];if(f===void 0||i[l.str]!==1)return l;return delete i[l.str],f}function $(l){return l instanceof F._Code&&l._items.some((f)=>f instanceof F.Name&&i[f.str]===1&&o[f.str]!==void 0)}}function eb(t,i){for(let o in i)t[o]=(t[o]||0)-(i[o]||0)}function qr(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:F._`!${_i(t)}`}K.not=qr;var Mb=Tr(K.operators.AND);function db(...t){return t.reduce(Mb)}K.and=db;var Vb=Tr(K.operators.OR);function cb(...t){return t.reduce(Vb)}K.or=cb;function Tr(t){return(i,o)=>i===F.nil?o:o===F.nil?i:F._`${_i(i)} ${t} ${_i(o)}`}function _i(t){return t instanceof F.Name?t:F._`(${t})`}});var j=M((Xr)=>{Object.defineProperty(Xr,"__esModule",{value:!0});Xr.checkStrictMode=Xr.getErrorPath=Xr.Type=Xr.useFunc=Xr.setEvaluated=Xr.evaluatedPropsToName=Xr.mergeEvaluated=Xr.eachItem=Xr.unescapeJsonPointer=Xr.escapeJsonPointer=Xr.escapeFragment=Xr.unescapeFragment=Xr.schemaRefOrVal=Xr.schemaHasRulesButRef=Xr.schemaHasRules=Xr.checkUnknownRules=Xr.alwaysValidSchema=Xr.toHash=void 0;var J=O(),Tb=Qt();function Ob(t){let i={};for(let o of t)i[o]=!0;return i}Xr.toHash=Ob;function Wb(t,i){if(typeof i=="boolean")return i;if(Object.keys(i).length===0)return!0;return wr(t,i),!Fr(i,t.self.RULES.all)}Xr.alwaysValidSchema=Wb;function wr(t,i=t.schema){let{opts:o,self:r}=t;if(!o.strictSchema)return;if(typeof i==="boolean")return;let $=r.RULES.keywords;for(let l in i)if(!$[l])Jr(t,`unknown keyword: "${l}"`)}Xr.checkUnknownRules=wr;function Fr(t,i){if(typeof t=="boolean")return!t;for(let o in t)if(i[o])return!0;return!1}Xr.schemaHasRules=Fr;function jb(t,i){if(typeof t=="boolean")return!t;for(let o in t)if(o!=="$ref"&&i.all[o])return!0;return!1}Xr.schemaHasRulesButRef=jb;function wb({topSchemaRef:t,schemaPath:i},o,r,$){if(!$){if(typeof o=="number"||typeof o=="boolean")return o;if(typeof o=="string")return J._`${o}`}return J._`${t}${i}${(0,J.getProperty)(r)}`}Xr.schemaRefOrVal=wb;function Fb(t){return Zr(decodeURIComponent(t))}Xr.unescapeFragment=Fb;function Zb(t){return encodeURIComponent(oo(t))}Xr.escapeFragment=Zb;function oo(t){if(typeof t=="number")return`${t}`;return t.replace(/~/g,"~0").replace(/\//g,"~1")}Xr.escapeJsonPointer=oo;function Zr(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}Xr.unescapeJsonPointer=Zr;function Bb(t,i){if(Array.isArray(t))for(let o of t)i(o);else i(t)}Xr.eachItem=Bb;function Wr({mergeNames:t,mergeToName:i,mergeValues:o,resultToName:r}){return($,l,f,s)=>{let n=f===void 0?l:f instanceof J.Name?(l instanceof J.Name?t($,l,f):i($,l,f),f):l instanceof J.Name?(i($,f,l),l):o(l,f);return s===J.Name&&!(n instanceof J.Name)?r($,n):n}}Xr.mergeEvaluated={props:Wr({mergeNames:(t,i,o)=>t.if(J._`${o} !== true && ${i} !== undefined`,()=>{t.if(J._`${i} === true`,()=>t.assign(o,!0),()=>t.assign(o,J._`${o} || {}`).code(J._`Object.assign(${o}, ${i})`))}),mergeToName:(t,i,o)=>t.if(J._`${o} !== true`,()=>{if(i===!0)t.assign(o,!0);else t.assign(o,J._`${o} || {}`),ro(t,o,i)}),mergeValues:(t,i)=>t===!0?!0:{...t,...i},resultToName:Br}),items:Wr({mergeNames:(t,i,o)=>t.if(J._`${o} !== true && ${i} !== undefined`,()=>t.assign(o,J._`${i} === true ? true : ${o} > ${i} ? ${o} : ${i}`)),mergeToName:(t,i,o)=>t.if(J._`${o} !== true`,()=>t.assign(o,i===!0?!0:J._`${o} > ${i} ? ${o} : ${i}`)),mergeValues:(t,i)=>t===!0?!0:Math.max(t,i),resultToName:(t,i)=>t.var("items",i)})};function Br(t,i){if(i===!0)return t.var("props",!0);let o=t.var("props",J._`{}`);if(i!==void 0)ro(t,o,i);return o}Xr.evaluatedPropsToName=Br;function ro(t,i,o){Object.keys(o).forEach((r)=>t.assign(J._`${i}${(0,J.getProperty)(r)}`,!0))}Xr.setEvaluated=ro;var jr={};function Jb(t,i){return t.scopeValue("func",{ref:i,code:jr[i.code]||(jr[i.code]=new Tb._Code(i.code))})}Xr.useFunc=Jb;var io;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(io||(Xr.Type=io={}));function Xb(t,i,o){if(t instanceof J.Name){let r=i===io.Num;return o?r?J._`"[" + ${t} + "]"`:J._`"['" + ${t} + "']"`:r?J._`"/" + ${t}`:J._`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return o?(0,J.getProperty)(t).toString():"/"+oo(t)}Xr.getErrorPath=Xb;function Jr(t,i,o=t.opts.strictSchema){if(!o)return;if(i=`strict mode: ${i}`,o===!0)throw Error(i);t.self.logger.warn(i)}Xr.checkStrictMode=Jr});var P=M((Ar)=>{Object.defineProperty(Ar,"__esModule",{value:!0});var Q=O(),hb={data:new Q.Name("data"),valCxt:new Q.Name("valCxt"),instancePath:new Q.Name("instancePath"),parentData:new Q.Name("parentData"),parentDataProperty:new Q.Name("parentDataProperty"),rootData:new Q.Name("rootData"),dynamicAnchors:new Q.Name("dynamicAnchors"),vErrors:new Q.Name("vErrors"),errors:new Q.Name("errors"),this:new Q.Name("this"),self:new Q.Name("self"),scope:new Q.Name("scope"),json:new Q.Name("json"),jsonPos:new Q.Name("jsonPos"),jsonLen:new Q.Name("jsonLen"),jsonPart:new Q.Name("jsonPart")};Ar.default=hb});var Ht=M((Hr)=>{Object.defineProperty(Hr,"__esModule",{value:!0});Hr.extendErrors=Hr.resetErrorsCount=Hr.reportExtraError=Hr.reportError=Hr.keyword$DataError=Hr.keywordError=void 0;var B=O(),ei=j(),G=P();Hr.keywordError={message:({keyword:t})=>B.str`must pass "${t}" keyword validation`};Hr.keyword$DataError={message:({keyword:t,schemaType:i})=>i?B.str`"${t}" keyword must be ${i} ($data)`:B.str`"${t}" keyword is invalid ($data)`};function mb(t,i=Hr.keywordError,o,r){let{it:$}=t,{gen:l,compositeRule:f,allErrors:s}=$,n=Gr(t,i,o);if(r!==null&&r!==void 0?r:f||s)zr(l,n);else Qr($,B._`[${n}]`)}Hr.reportError=mb;function xb(t,i=Hr.keywordError,o){let{it:r}=t,{gen:$,compositeRule:l,allErrors:f}=r,s=Gr(t,i,o);if(zr($,s),!(l||f))Qr(r,G.default.vErrors)}Hr.reportExtraError=xb;function ab(t,i){t.assign(G.default.errors,i),t.if(B._`${G.default.vErrors} !== null`,()=>t.if(i,()=>t.assign(B._`${G.default.vErrors}.length`,i),()=>t.assign(G.default.vErrors,null)))}Hr.resetErrorsCount=ab;function _b({gen:t,keyword:i,schemaValue:o,data:r,errsCount:$,it:l}){if($===void 0)throw Error("ajv implementation error");let f=t.name("err");t.forRange("i",$,G.default.errors,(s)=>{if(t.const(f,B._`${G.default.vErrors}[${s}]`),t.if(B._`${f}.instancePath === undefined`,()=>t.assign(B._`${f}.instancePath`,(0,B.strConcat)(G.default.instancePath,l.errorPath))),t.assign(B._`${f}.schemaPath`,B.str`${l.errSchemaPath}/${i}`),l.opts.verbose)t.assign(B._`${f}.schema`,o),t.assign(B._`${f}.data`,r)})}Hr.extendErrors=_b;function zr(t,i){let o=t.const("err",i);t.if(B._`${G.default.vErrors} === null`,()=>t.assign(G.default.vErrors,B._`[${o}]`),B._`${G.default.vErrors}.push(${o})`),t.code(B._`${G.default.errors}++`)}function Qr(t,i){let{gen:o,validateName:r,schemaEnv:$}=t;if($.$async)o.throw(B._`new ${t.ValidationError}(${i})`);else o.assign(B._`${r}.errors`,i),o.return(!1)}var Mt={keyword:new B.Name("keyword"),schemaPath:new B.Name("schemaPath"),params:new B.Name("params"),propertyName:new B.Name("propertyName"),message:new B.Name("message"),schema:new B.Name("schema"),parentSchema:new B.Name("parentSchema")};function Gr(t,i,o){let{createErrors:r}=t.it;if(r===!1)return B._`{}`;return tu(t,i,o)}function tu(t,i,o={}){let{gen:r,it:$}=t,l=[iu($,o),ou(t,o)];return ru(t,i,l),r.object(...l)}function iu({errorPath:t},{instancePath:i}){let o=i?B.str`${t}${(0,ei.getErrorPath)(i,ei.Type.Str)}`:t;return[G.default.instancePath,(0,B.strConcat)(G.default.instancePath,o)]}function ou({keyword:t,it:{errSchemaPath:i}},{schemaPath:o,parentSchema:r}){let $=r?i:B.str`${i}/${t}`;if(o)$=B.str`${$}${(0,ei.getErrorPath)(o,ei.Type.Str)}`;return[Mt.schemaPath,$]}function ru(t,{params:i,message:o},r){let{keyword:$,data:l,schemaValue:f,it:s}=t,{opts:n,propertyName:b,topSchemaRef:u,schemaPath:I}=s;if(r.push([Mt.keyword,$],[Mt.params,typeof i=="function"?i(t):i||B._`{}`]),n.messages)r.push([Mt.message,typeof o=="function"?o(t):o]);if(n.verbose)r.push([Mt.schema,f],[Mt.parentSchema,B._`${u}${I}`],[G.default.data,l]);if(b)r.push([Mt.propertyName,b])}});var Nr=M((Kr)=>{Object.defineProperty(Kr,"__esModule",{value:!0});Kr.boolOrEmptySchema=Kr.topBoolOrEmptySchema=void 0;var nu=Ht(),bu=O(),uu=P(),Iu={message:"boolean schema is false"};function yu(t){let{gen:i,schema:o,validateName:r}=t;if(o===!1)vr(t,!1);else if(typeof o=="object"&&o.$async===!0)i.return(uu.default.data);else i.assign(bu._`${r}.errors`,null),i.return(!0)}Kr.topBoolOrEmptySchema=yu;function eu(t,i){let{gen:o,schema:r}=t;if(r===!1)o.var(i,!1),vr(t);else o.var(i,!0)}Kr.boolOrEmptySchema=eu;function vr(t,i){let{gen:o,data:r}=t,$={gen:o,keyword:"false schema",data:r,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,nu.reportError)($,Iu,void 0,i)}});var lo=M((Pr)=>{Object.defineProperty(Pr,"__esModule",{value:!0});Pr.getRules=Pr.isJSONType=void 0;var du=["string","number","integer","boolean","null","object","array"],Vu=new Set(du);function cu(t){return typeof t=="string"&&Vu.has(t)}Pr.isJSONType=cu;function pu(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}Pr.getRules=pu});var fo=M((kr)=>{Object.defineProperty(kr,"__esModule",{value:!0});kr.shouldUseRule=kr.shouldUseGroup=kr.schemaHasRulesForType=void 0;function qu({schema:t,self:i},o){let r=i.RULES.types[o];return r&&r!==!0&&Rr(t,r)}kr.schemaHasRulesForType=qu;function Rr(t,i){return i.rules.some((o)=>Sr(t,o))}kr.shouldUseGroup=Rr;function Sr(t,i){var o;return t[i.keyword]!==void 0||((o=i.definition.implements)===null||o===void 0?void 0:o.some((r)=>t[r]!==void 0))}kr.shouldUseRule=Sr});var Dt=M((xr)=>{Object.defineProperty(xr,"__esModule",{value:!0});xr.reportTypeError=xr.checkDataTypes=xr.checkDataType=xr.coerceAndCheckDataType=xr.getJSONTypes=xr.getSchemaTypes=xr.DataType=void 0;var Wu=lo(),ju=fo(),wu=Ht(),W=O(),hr=j(),jt;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(jt||(xr.DataType=jt={}));function Fu(t){let i=gr(t.type);if(i.includes("null")){if(t.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!i.length&&t.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(t.nullable===!0)i.push("null")}return i}xr.getSchemaTypes=Fu;function gr(t){let i=Array.isArray(t)?t:t?[t]:[];if(i.every(Wu.isJSONType))return i;throw Error("type must be JSONType or JSONType[]: "+i.join(","))}xr.getJSONTypes=gr;function Zu(t,i){let{gen:o,data:r,opts:$}=t,l=Bu(i,$.coerceTypes),f=i.length>0&&!(l.length===0&&i.length===1&&(0,ju.schemaHasRulesForType)(t,i[0]));if(f){let s=no(i,r,$.strictNumbers,jt.Wrong);o.if(s,()=>{if(l.length)Ju(t,i,l);else bo(t)})}return f}xr.coerceAndCheckDataType=Zu;var mr=new Set(["string","number","integer","boolean","null"]);function Bu(t,i){return i?t.filter((o)=>mr.has(o)||i==="array"&&o==="array"):[]}function Ju(t,i,o){let{gen:r,data:$,opts:l}=t,f=r.let("dataType",W._`typeof ${$}`),s=r.let("coerced",W._`undefined`);if(l.coerceTypes==="array")r.if(W._`${f} == 'object' && Array.isArray(${$}) && ${$}.length == 1`,()=>r.assign($,W._`${$}[0]`).assign(f,W._`typeof ${$}`).if(no(i,$,l.strictNumbers),()=>r.assign(s,$)));r.if(W._`${s} !== undefined`);for(let b of o)if(mr.has(b)||b==="array"&&l.coerceTypes==="array")n(b);r.else(),bo(t),r.endIf(),r.if(W._`${s} !== undefined`,()=>{r.assign($,s),Xu(t,s)});function n(b){switch(b){case"string":r.elseIf(W._`${f} == "number" || ${f} == "boolean"`).assign(s,W._`"" + ${$}`).elseIf(W._`${$} === null`).assign(s,W._`""`);return;case"number":r.elseIf(W._`${f} == "boolean" || ${$} === null
5
- || (${f} == "string" && ${$} && ${$} == +${$})`).assign(s,W._`+${$}`);return;case"integer":r.elseIf(W._`${f} === "boolean" || ${$} === null
6
- || (${f} === "string" && ${$} && ${$} == +${$} && !(${$} % 1))`).assign(s,W._`+${$}`);return;case"boolean":r.elseIf(W._`${$} === "false" || ${$} === 0 || ${$} === null`).assign(s,!1).elseIf(W._`${$} === "true" || ${$} === 1`).assign(s,!0);return;case"null":r.elseIf(W._`${$} === "" || ${$} === 0 || ${$} === false`),r.assign(s,null);return;case"array":r.elseIf(W._`${f} === "string" || ${f} === "number"
7
- || ${f} === "boolean" || ${$} === null`).assign(s,W._`[${$}]`)}}}function Xu({gen:t,parentData:i,parentDataProperty:o},r){t.if(W._`${i} !== undefined`,()=>t.assign(W._`${i}[${o}]`,r))}function so(t,i,o,r=jt.Correct){let $=r===jt.Correct?W.operators.EQ:W.operators.NEQ,l;switch(t){case"null":return W._`${i} ${$} null`;case"array":l=W._`Array.isArray(${i})`;break;case"object":l=W._`${i} && typeof ${i} == "object" && !Array.isArray(${i})`;break;case"integer":l=f(W._`!(${i} % 1) && !isNaN(${i})`);break;case"number":l=f();break;default:return W._`typeof ${i} ${$} ${t}`}return r===jt.Correct?l:(0,W.not)(l);function f(s=W.nil){return(0,W.and)(W._`typeof ${i} == "number"`,s,o?W._`isFinite(${i})`:W.nil)}}xr.checkDataType=so;function no(t,i,o,r){if(t.length===1)return so(t[0],i,o,r);let $,l=(0,hr.toHash)(t);if(l.array&&l.object){let f=W._`typeof ${i} != "object"`;$=l.null?f:W._`!${i} || ${f}`,delete l.null,delete l.array,delete l.object}else $=W.nil;if(l.number)delete l.integer;for(let f in l)$=(0,W.and)($,so(f,i,o,r));return $}xr.checkDataTypes=no;var Yu={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:i})=>typeof t=="string"?W._`{type: ${t}}`:W._`{type: ${i}}`};function bo(t){let i=Au(t);(0,wu.reportError)(i,Yu)}xr.reportTypeError=bo;function Au(t){let{gen:i,data:o,schema:r}=t,$=(0,hr.schemaRefOrVal)(t,r,"type");return{gen:i,keyword:"type",data:o,schema:r.type,schemaCode:$,schemaValue:$,parentSchema:r,params:{},it:t}}});var o$=M((t$)=>{Object.defineProperty(t$,"__esModule",{value:!0});t$.assignDefaults=void 0;var wt=O(),Ku=j();function Uu(t,i){let{properties:o,items:r}=t.schema;if(i==="object"&&o)for(let $ in o)_r(t,$,o[$].default);else if(i==="array"&&Array.isArray(r))r.forEach(($,l)=>_r(t,l,$.default))}t$.assignDefaults=Uu;function _r(t,i,o){let{gen:r,compositeRule:$,data:l,opts:f}=t;if(o===void 0)return;let s=wt._`${l}${(0,wt.getProperty)(i)}`;if($){(0,Ku.checkStrictMode)(t,`default is ignored for: ${s}`);return}let n=wt._`${s} === undefined`;if(f.useDefaults==="empty")n=wt._`${n} || ${s} === null || ${s} === ""`;r.if(n,wt._`${s} = ${(0,wt.stringify)(o)}`)}});var E=M((l$)=>{Object.defineProperty(l$,"__esModule",{value:!0});l$.validateUnion=l$.validateArray=l$.usePattern=l$.callValidateCode=l$.schemaProperties=l$.allSchemaProperties=l$.noPropertyInData=l$.propertyInData=l$.isOwnProperty=l$.hasPropFunc=l$.reportMissingProp=l$.checkMissingProp=l$.checkReportMissingProp=void 0;var Y=O(),uo=j(),nt=P(),Nu=j();function Pu(t,i){let{gen:o,data:r,it:$}=t;o.if(yo(o,r,i,$.opts.ownProperties),()=>{t.setParams({missingProperty:Y._`${i}`},!0),t.error()})}l$.checkReportMissingProp=Pu;function Eu({gen:t,data:i,it:{opts:o}},r,$){return(0,Y.or)(...r.map((l)=>(0,Y.and)(yo(t,i,l,o.ownProperties),Y._`${$} = ${l}`)))}l$.checkMissingProp=Eu;function Ru(t,i){t.setParams({missingProperty:i},!0),t.error()}l$.reportMissingProp=Ru;function r$(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:Y._`Object.prototype.hasOwnProperty`})}l$.hasPropFunc=r$;function Io(t,i,o){return Y._`${r$(t)}.call(${i}, ${o})`}l$.isOwnProperty=Io;function Su(t,i,o,r){let $=Y._`${i}${(0,Y.getProperty)(o)} !== undefined`;return r?Y._`${$} && ${Io(t,i,o)}`:$}l$.propertyInData=Su;function yo(t,i,o,r){let $=Y._`${i}${(0,Y.getProperty)(o)} === undefined`;return r?(0,Y.or)($,(0,Y.not)(Io(t,i,o))):$}l$.noPropertyInData=yo;function $$(t){return t?Object.keys(t).filter((i)=>i!=="__proto__"):[]}l$.allSchemaProperties=$$;function ku(t,i){return $$(i).filter((o)=>!(0,uo.alwaysValidSchema)(t,i[o]))}l$.schemaProperties=ku;function Cu({schemaCode:t,data:i,it:{gen:o,topSchemaRef:r,schemaPath:$,errorPath:l},it:f},s,n,b){let u=b?Y._`${t}, ${i}, ${r}${$}`:i,I=[[nt.default.instancePath,(0,Y.strConcat)(nt.default.instancePath,l)],[nt.default.parentData,f.parentData],[nt.default.parentDataProperty,f.parentDataProperty],[nt.default.rootData,nt.default.rootData]];if(f.opts.dynamicRef)I.push([nt.default.dynamicAnchors,nt.default.dynamicAnchors]);let V=Y._`${u}, ${o.object(...I)}`;return n!==Y.nil?Y._`${s}.call(${n}, ${V})`:Y._`${s}(${V})`}l$.callValidateCode=Cu;var hu=Y._`new RegExp`;function gu({gen:t,it:{opts:i}},o){let r=i.unicodeRegExp?"u":"",{regExp:$}=i.code,l=$(o,r);return t.scopeValue("pattern",{key:l.toString(),ref:l,code:Y._`${$.code==="new RegExp"?hu:(0,Nu.useFunc)(t,$)}(${o}, ${r})`})}l$.usePattern=gu;function mu(t){let{gen:i,data:o,keyword:r,it:$}=t,l=i.name("valid");if($.allErrors){let s=i.let("valid",!0);return f(()=>i.assign(s,!1)),s}return i.var(l,!0),f(()=>i.break()),l;function f(s){let n=i.const("len",Y._`${o}.length`);i.forRange("i",0,n,(b)=>{t.subschema({keyword:r,dataProp:b,dataPropType:uo.Type.Num},l),i.if((0,Y.not)(l),s)})}}l$.validateArray=mu;function xu(t){let{gen:i,schema:o,keyword:r,it:$}=t;if(!Array.isArray(o))throw Error("ajv implementation error");if(o.some((n)=>(0,uo.alwaysValidSchema)($,n))&&!$.opts.unevaluated)return;let f=i.let("valid",!1),s=i.name("_valid");i.block(()=>o.forEach((n,b)=>{let u=t.subschema({keyword:r,schemaProp:b,compositeRule:!0},s);if(i.assign(f,Y._`${f} || ${s}`),!t.mergeValidEvaluated(u,s))i.if((0,Y.not)(f))})),t.result(f,()=>t.reset(),()=>t.error(!0))}l$.validateUnion=xu});var I$=M((b$)=>{Object.defineProperty(b$,"__esModule",{value:!0});b$.validateKeywordUsage=b$.validSchemaType=b$.funcKeywordCode=b$.macroKeywordCode=void 0;var H=O(),dt=P(),uI=E(),II=Ht();function yI(t,i){let{gen:o,keyword:r,schema:$,parentSchema:l,it:f}=t,s=i.macro.call(f.self,$,l,f),n=n$(o,r,s);if(f.opts.validateSchema!==!1)f.self.validateSchema(s,!0);let b=o.name("valid");t.subschema({schema:s,schemaPath:H.nil,errSchemaPath:`${f.errSchemaPath}/${r}`,topSchemaRef:n,compositeRule:!0},b),t.pass(b,()=>t.error(!0))}b$.macroKeywordCode=yI;function eI(t,i){var o;let{gen:r,keyword:$,schema:l,parentSchema:f,$data:s,it:n}=t;dI(n,i);let b=!s&&i.compile?i.compile.call(n.self,l,f,n):i.validate,u=n$(r,$,b),I=r.let("valid");t.block$data(I,V),t.ok((o=i.valid)!==null&&o!==void 0?o:I);function V(){if(i.errors===!1){if(e(),i.modifying)s$(t);c(()=>t.error())}else{let p=i.async?d():y();if(i.modifying)s$(t);c(()=>MI(t,p))}}function d(){let p=r.let("ruleErrs",null);return r.try(()=>e(H._`await `),(Z)=>r.assign(I,!1).if(H._`${Z} instanceof ${n.ValidationError}`,()=>r.assign(p,H._`${Z}.errors`),()=>r.throw(Z))),p}function y(){let p=H._`${u}.errors`;return r.assign(p,null),e(H.nil),p}function e(p=i.async?H._`await `:H.nil){let Z=n.opts.passContext?dt.default.this:dt.default.self,w=!(("compile"in i)&&!s||i.schema===!1);r.assign(I,H._`${p}${(0,uI.callValidateCode)(t,u,Z,w)}`,i.modifying)}function c(p){var Z;r.if((0,H.not)((Z=i.valid)!==null&&Z!==void 0?Z:I),p)}}b$.funcKeywordCode=eI;function s$(t){let{gen:i,data:o,it:r}=t;i.if(r.parentData,()=>i.assign(o,H._`${r.parentData}[${r.parentDataProperty}]`))}function MI(t,i){let{gen:o}=t;o.if(H._`Array.isArray(${i})`,()=>{o.assign(dt.default.vErrors,H._`${dt.default.vErrors} === null ? ${i} : ${dt.default.vErrors}.concat(${i})`).assign(dt.default.errors,H._`${dt.default.vErrors}.length`),(0,II.extendErrors)(t)},()=>t.error())}function dI({schemaEnv:t},i){if(i.async&&!t.$async)throw Error("async keyword in sync schema")}function n$(t,i,o){if(o===void 0)throw Error(`keyword "${i}" failed to compile`);return t.scopeValue("keyword",typeof o=="function"?{ref:o}:{ref:o,code:(0,H.stringify)(o)})}function VI(t,i,o=!1){return!i.length||i.some((r)=>r==="array"?Array.isArray(t):r==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==r||o&&typeof t>"u")}b$.validSchemaType=VI;function cI({schema:t,opts:i,self:o,errSchemaPath:r},$,l){if(Array.isArray($.keyword)?!$.keyword.includes(l):$.keyword!==l)throw Error("ajv implementation error");let f=$.dependencies;if(f===null||f===void 0?void 0:f.some((s)=>!Object.prototype.hasOwnProperty.call(t,s)))throw Error(`parent schema must have dependencies of ${l}: ${f.join(",")}`);if($.validateSchema){if(!$.validateSchema(t[l])){let n=`keyword "${l}" value is invalid at path "${r}": `+o.errorsText($.validateSchema.errors);if(i.validateSchema==="log")o.logger.error(n);else throw Error(n)}}}b$.validateKeywordUsage=cI});var d$=M((e$)=>{Object.defineProperty(e$,"__esModule",{value:!0});e$.extendSubschemaMode=e$.extendSubschemaData=e$.getSubschema=void 0;var _=O(),y$=j();function TI(t,{keyword:i,schemaProp:o,schema:r,schemaPath:$,errSchemaPath:l,topSchemaRef:f}){if(i!==void 0&&r!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(i!==void 0){let s=t.schema[i];return o===void 0?{schema:s,schemaPath:_._`${t.schemaPath}${(0,_.getProperty)(i)}`,errSchemaPath:`${t.errSchemaPath}/${i}`}:{schema:s[o],schemaPath:_._`${t.schemaPath}${(0,_.getProperty)(i)}${(0,_.getProperty)(o)}`,errSchemaPath:`${t.errSchemaPath}/${i}/${(0,y$.escapeFragment)(o)}`}}if(r!==void 0){if($===void 0||l===void 0||f===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:r,schemaPath:$,topSchemaRef:f,errSchemaPath:l}}throw Error('either "keyword" or "schema" must be passed')}e$.getSubschema=TI;function OI(t,i,{dataProp:o,dataPropType:r,data:$,dataTypes:l,propertyName:f}){if($!==void 0&&o!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:s}=i;if(o!==void 0){let{errorPath:b,dataPathArr:u,opts:I}=i,V=s.let("data",_._`${i.data}${(0,_.getProperty)(o)}`,!0);n(V),t.errorPath=_.str`${b}${(0,y$.getErrorPath)(o,r,I.jsPropertySyntax)}`,t.parentDataProperty=_._`${o}`,t.dataPathArr=[...u,t.parentDataProperty]}if($!==void 0){let b=$ instanceof _.Name?$:s.let("data",$,!0);if(n(b),f!==void 0)t.propertyName=f}if(l)t.dataTypes=l;function n(b){t.data=b,t.dataLevel=i.dataLevel+1,t.dataTypes=[],i.definedProperties=new Set,t.parentData=i.data,t.dataNames=[...i.dataNames,b]}}e$.extendSubschemaData=OI;function WI(t,{jtdDiscriminator:i,jtdMetadata:o,compositeRule:r,createErrors:$,allErrors:l}){if(r!==void 0)t.compositeRule=r;if($!==void 0)t.createErrors=$;if(l!==void 0)t.allErrors=l;t.jtdDiscriminator=i,t.jtdMetadata=o}e$.extendSubschemaMode=WI});var eo=M((yV,V$)=>{V$.exports=function t(i,o){if(i===o)return!0;if(i&&o&&typeof i=="object"&&typeof o=="object"){if(i.constructor!==o.constructor)return!1;var r,$,l;if(Array.isArray(i)){if(r=i.length,r!=o.length)return!1;for($=r;$--!==0;)if(!t(i[$],o[$]))return!1;return!0}if(i.constructor===RegExp)return i.source===o.source&&i.flags===o.flags;if(i.valueOf!==Object.prototype.valueOf)return i.valueOf()===o.valueOf();if(i.toString!==Object.prototype.toString)return i.toString()===o.toString();if(l=Object.keys(i),r=l.length,r!==Object.keys(o).length)return!1;for($=r;$--!==0;)if(!Object.prototype.hasOwnProperty.call(o,l[$]))return!1;for($=r;$--!==0;){var f=l[$];if(!t(i[f],o[f]))return!1}return!0}return i!==i&&o!==o}});var p$=M((eV,c$)=>{var bt=c$.exports=function(t,i,o){if(typeof i=="function")o=i,i={};o=i.cb||o;var r=typeof o=="function"?o:o.pre||function(){},$=o.post||function(){};Mi(i,r,$,t,"",t)};bt.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};bt.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};bt.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};bt.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Mi(t,i,o,r,$,l,f,s,n,b){if(r&&typeof r=="object"&&!Array.isArray(r)){i(r,$,l,f,s,n,b);for(var u in r){var I=r[u];if(Array.isArray(I)){if(u in bt.arrayKeywords)for(var V=0;V<I.length;V++)Mi(t,i,o,I[V],$+"/"+u+"/"+V,l,$,u,r,V)}else if(u in bt.propsKeywords){if(I&&typeof I=="object")for(var d in I)Mi(t,i,o,I[d],$+"/"+u+"/"+FI(d),l,$,u,r,d)}else if(u in bt.keywords||t.allKeys&&!(u in bt.skipKeywords))Mi(t,i,o,I,$+"/"+u,l,$,u,r)}o(r,$,l,f,s,n,b)}}function FI(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var vt=M((O$)=>{Object.defineProperty(O$,"__esModule",{value:!0});O$.getSchemaRefs=O$.resolveUrl=O$.normalizeId=O$._getFullPath=O$.getFullPath=O$.inlineRef=void 0;var ZI=j(),BI=eo(),JI=p$(),XI=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function YI(t,i=!0){if(typeof t=="boolean")return!0;if(i===!0)return!Mo(t);if(!i)return!1;return L$(t)<=i}O$.inlineRef=YI;var AI=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Mo(t){for(let i in t){if(AI.has(i))return!0;let o=t[i];if(Array.isArray(o)&&o.some(Mo))return!0;if(typeof o=="object"&&Mo(o))return!0}return!1}function L$(t){let i=0;for(let o in t){if(o==="$ref")return 1/0;if(i++,XI.has(o))continue;if(typeof t[o]=="object")(0,ZI.eachItem)(t[o],(r)=>i+=L$(r));if(i===1/0)return 1/0}return i}function q$(t,i="",o){if(o!==!1)i=Ft(i);let r=t.parse(i);return T$(t,r)}O$.getFullPath=q$;function T$(t,i){return t.serialize(i).split("#")[0]+"#"}O$._getFullPath=T$;var zI=/#\/?$/;function Ft(t){return t?t.replace(zI,""):""}O$.normalizeId=Ft;function QI(t,i,o){return o=Ft(o),t.resolve(i,o)}O$.resolveUrl=QI;var GI=/^[a-z_][-a-z0-9._]*$/i;function HI(t,i){if(typeof t=="boolean")return{};let{schemaId:o,uriResolver:r}=this.opts,$=Ft(t[o]||i),l={"":$},f=q$(r,$,!1),s={},n=new Set;return JI(t,{allKeys:!0},(I,V,d,y)=>{if(y===void 0)return;let e=f+V,c=l[y];if(typeof I[o]=="string")c=p.call(this,I[o]);Z.call(this,I.$anchor),Z.call(this,I.$dynamicAnchor),l[V]=c;function p(w){let X=this.opts.uriResolver.resolve;if(w=Ft(c?X(c,w):w),n.has(w))throw u(w);n.add(w);let T=this.refs[w];if(typeof T=="string")T=this.refs[T];if(typeof T=="object")b(I,T.schema,w);else if(w!==Ft(e))if(w[0]==="#")b(I,s[w],w),s[w]=I;else this.refs[w]=e;return w}function Z(w){if(typeof w=="string"){if(!GI.test(w))throw Error(`invalid anchor "${w}"`);p.call(this,`#${w}`)}}}),s;function b(I,V,d){if(V!==void 0&&!BI(I,V))throw u(d)}function u(I){return Error(`reference "${I}" resolves to more than one schema`)}}O$.getSchemaRefs=HI});var Nt=M((v$)=>{Object.defineProperty(v$,"__esModule",{value:!0});v$.getData=v$.KeywordCxt=v$.validateFunctionCode=void 0;var B$=Nr(),j$=Dt(),co=fo(),di=Dt(),PI=o$(),Ut=I$(),Vo=d$(),L=O(),q=P(),EI=vt(),rt=j(),Kt=Ht();function RI(t){if(Y$(t)){if(A$(t),X$(t)){CI(t);return}}J$(t,()=>(0,B$.topBoolOrEmptySchema)(t))}v$.validateFunctionCode=RI;function J$({gen:t,validateName:i,schema:o,schemaEnv:r,opts:$},l){if($.code.es5)t.func(i,L._`${q.default.data}, ${q.default.valCxt}`,r.$async,()=>{t.code(L._`"use strict"; ${w$(o,$)}`),kI(t,$),t.code(l)});else t.func(i,L._`${q.default.data}, ${SI($)}`,r.$async,()=>t.code(w$(o,$)).code(l))}function SI(t){return L._`{${q.default.instancePath}="", ${q.default.parentData}, ${q.default.parentDataProperty}, ${q.default.rootData}=${q.default.data}${t.dynamicRef?L._`, ${q.default.dynamicAnchors}={}`:L.nil}}={}`}function kI(t,i){t.if(q.default.valCxt,()=>{if(t.var(q.default.instancePath,L._`${q.default.valCxt}.${q.default.instancePath}`),t.var(q.default.parentData,L._`${q.default.valCxt}.${q.default.parentData}`),t.var(q.default.parentDataProperty,L._`${q.default.valCxt}.${q.default.parentDataProperty}`),t.var(q.default.rootData,L._`${q.default.valCxt}.${q.default.rootData}`),i.dynamicRef)t.var(q.default.dynamicAnchors,L._`${q.default.valCxt}.${q.default.dynamicAnchors}`)},()=>{if(t.var(q.default.instancePath,L._`""`),t.var(q.default.parentData,L._`undefined`),t.var(q.default.parentDataProperty,L._`undefined`),t.var(q.default.rootData,q.default.data),i.dynamicRef)t.var(q.default.dynamicAnchors,L._`{}`)})}function CI(t){let{schema:i,opts:o,gen:r}=t;J$(t,()=>{if(o.$comment&&i.$comment)Q$(t);if(aI(t),r.let(q.default.vErrors,null),r.let(q.default.errors,0),o.unevaluated)hI(t);z$(t),iy(t)});return}function hI(t){let{gen:i,validateName:o}=t;t.evaluated=i.const("evaluated",L._`${o}.evaluated`),i.if(L._`${t.evaluated}.dynamicProps`,()=>i.assign(L._`${t.evaluated}.props`,L._`undefined`)),i.if(L._`${t.evaluated}.dynamicItems`,()=>i.assign(L._`${t.evaluated}.items`,L._`undefined`))}function w$(t,i){let o=typeof t=="object"&&t[i.schemaId];return o&&(i.code.source||i.code.process)?L._`/*# sourceURL=${o} */`:L.nil}function gI(t,i){if(Y$(t)){if(A$(t),X$(t)){mI(t,i);return}}(0,B$.boolOrEmptySchema)(t,i)}function X$({schema:t,self:i}){if(typeof t=="boolean")return!t;for(let o in t)if(i.RULES.all[o])return!0;return!1}function Y$(t){return typeof t.schema!="boolean"}function mI(t,i){let{schema:o,gen:r,opts:$}=t;if($.$comment&&o.$comment)Q$(t);_I(t),ty(t);let l=r.const("_errs",q.default.errors);z$(t,l),r.var(i,L._`${l} === ${q.default.errors}`)}function A$(t){(0,rt.checkUnknownRules)(t),xI(t)}function z$(t,i){if(t.opts.jtd)return F$(t,[],!1,i);let o=(0,j$.getSchemaTypes)(t.schema),r=(0,j$.coerceAndCheckDataType)(t,o);F$(t,o,!r,i)}function xI(t){let{schema:i,errSchemaPath:o,opts:r,self:$}=t;if(i.$ref&&r.ignoreKeywordsWithRef&&(0,rt.schemaHasRulesButRef)(i,$.RULES))$.logger.warn(`$ref: keywords ignored in schema at path "${o}"`)}function aI(t){let{schema:i,opts:o}=t;if(i.default!==void 0&&o.useDefaults&&o.strictSchema)(0,rt.checkStrictMode)(t,"default is ignored in the schema root")}function _I(t){let i=t.schema[t.opts.schemaId];if(i)t.baseId=(0,EI.resolveUrl)(t.opts.uriResolver,t.baseId,i)}function ty(t){if(t.schema.$async&&!t.schemaEnv.$async)throw Error("async schema in sync schema")}function Q$({gen:t,schemaEnv:i,schema:o,errSchemaPath:r,opts:$}){let l=o.$comment;if($.$comment===!0)t.code(L._`${q.default.self}.logger.log(${l})`);else if(typeof $.$comment=="function"){let f=L.str`${r}/$comment`,s=t.scopeValue("root",{ref:i.root});t.code(L._`${q.default.self}.opts.$comment(${l}, ${f}, ${s}.schema)`)}}function iy(t){let{gen:i,schemaEnv:o,validateName:r,ValidationError:$,opts:l}=t;if(o.$async)i.if(L._`${q.default.errors} === 0`,()=>i.return(q.default.data),()=>i.throw(L._`new ${$}(${q.default.vErrors})`));else{if(i.assign(L._`${r}.errors`,q.default.vErrors),l.unevaluated)oy(t);i.return(L._`${q.default.errors} === 0`)}}function oy({gen:t,evaluated:i,props:o,items:r}){if(o instanceof L.Name)t.assign(L._`${i}.props`,o);if(r instanceof L.Name)t.assign(L._`${i}.items`,r)}function F$(t,i,o,r){let{gen:$,schema:l,data:f,allErrors:s,opts:n,self:b}=t,{RULES:u}=b;if(l.$ref&&(n.ignoreKeywordsWithRef||!(0,rt.schemaHasRulesButRef)(l,u))){$.block(()=>H$(t,"$ref",u.all.$ref.definition));return}if(!n.jtd)ry(t,i);$.block(()=>{for(let V of u.rules)I(V);I(u.post)});function I(V){if(!(0,co.shouldUseGroup)(l,V))return;if(V.type){if($.if((0,di.checkDataType)(V.type,f,n.strictNumbers)),Z$(t,V),i.length===1&&i[0]===V.type&&o)$.else(),(0,di.reportTypeError)(t);$.endIf()}else Z$(t,V);if(!s)$.if(L._`${q.default.errors} === ${r||0}`)}}function Z$(t,i){let{gen:o,schema:r,opts:{useDefaults:$}}=t;if($)(0,PI.assignDefaults)(t,i.type);o.block(()=>{for(let l of i.rules)if((0,co.shouldUseRule)(r,l))H$(t,l.keyword,l.definition,i.type)})}function ry(t,i){if(t.schemaEnv.meta||!t.opts.strictTypes)return;if($y(t,i),!t.opts.allowUnionTypes)ly(t,i);fy(t,t.dataTypes)}function $y(t,i){if(!i.length)return;if(!t.dataTypes.length){t.dataTypes=i;return}i.forEach((o)=>{if(!G$(t.dataTypes,o))po(t,`type "${o}" not allowed by context "${t.dataTypes.join(",")}"`)}),ny(t,i)}function ly(t,i){if(i.length>1&&!(i.length===2&&i.includes("null")))po(t,"use allowUnionTypes to allow union type keyword")}function fy(t,i){let o=t.self.RULES.all;for(let r in o){let $=o[r];if(typeof $=="object"&&(0,co.shouldUseRule)(t.schema,$)){let{type:l}=$.definition;if(l.length&&!l.some((f)=>sy(i,f)))po(t,`missing type "${l.join(",")}" for keyword "${r}"`)}}}function sy(t,i){return t.includes(i)||i==="number"&&t.includes("integer")}function G$(t,i){return t.includes(i)||i==="integer"&&t.includes("number")}function ny(t,i){let o=[];for(let r of t.dataTypes)if(G$(i,r))o.push(r);else if(i.includes("integer")&&r==="number")o.push("integer");t.dataTypes=o}function po(t,i){let o=t.schemaEnv.baseId+t.errSchemaPath;i+=` at "${o}" (strictTypes)`,(0,rt.checkStrictMode)(t,i,t.opts.strictTypes)}class Lo{constructor(t,i,o){if((0,Ut.validateKeywordUsage)(t,i,o),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=o,this.data=t.data,this.schema=t.schema[o],this.$data=i.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,rt.schemaRefOrVal)(t,this.schema,o,this.$data),this.schemaType=i.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=i,this.$data)this.schemaCode=t.gen.const("vSchema",D$(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,Ut.validSchemaType)(this.schema,i.schemaType,i.allowUndefined))throw Error(`${o} value must be ${JSON.stringify(i.schemaType)}`);if("code"in i?i.trackErrors:i.errors!==!1)this.errsCount=t.gen.const("_errs",q.default.errors)}result(t,i,o){this.failResult((0,L.not)(t),i,o)}failResult(t,i,o){if(this.gen.if(t),o)o();else this.error();if(i){if(this.gen.else(),i(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(t,i){this.failResult((0,L.not)(t),void 0,i)}fail(t){if(t===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(t),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);let{schemaCode:i}=this;this.fail(L._`${i} !== undefined && (${(0,L.or)(this.invalid$data(),t)})`)}error(t,i,o){if(i){this.setParams(i),this._error(t,o),this.setParams({});return}this._error(t,o)}_error(t,i){(t?Kt.reportExtraError:Kt.reportError)(this,this.def.error,i)}$dataError(){(0,Kt.reportError)(this,this.def.$dataError||Kt.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,Kt.resetErrorsCount)(this.gen,this.errsCount)}ok(t){if(!this.allErrors)this.gen.if(t)}setParams(t,i){if(i)Object.assign(this.params,t);else this.params=t}block$data(t,i,o=L.nil){this.gen.block(()=>{this.check$data(t,o),i()})}check$data(t=L.nil,i=L.nil){if(!this.$data)return;let{gen:o,schemaCode:r,schemaType:$,def:l}=this;if(o.if((0,L.or)(L._`${r} === undefined`,i)),t!==L.nil)o.assign(t,!0);if($.length||l.validateSchema){if(o.elseIf(this.invalid$data()),this.$dataError(),t!==L.nil)o.assign(t,!1)}o.else()}invalid$data(){let{gen:t,schemaCode:i,schemaType:o,def:r,it:$}=this;return(0,L.or)(l(),f());function l(){if(o.length){if(!(i instanceof L.Name))throw Error("ajv implementation error");let s=Array.isArray(o)?o:[o];return L._`${(0,di.checkDataTypes)(s,i,$.opts.strictNumbers,di.DataType.Wrong)}`}return L.nil}function f(){if(r.validateSchema){let s=t.scopeValue("validate$data",{ref:r.validateSchema});return L._`!${s}(${i})`}return L.nil}}subschema(t,i){let o=(0,Vo.getSubschema)(this.it,t);(0,Vo.extendSubschemaData)(o,this.it,t),(0,Vo.extendSubschemaMode)(o,t);let r={...this.it,...o,items:void 0,props:void 0};return gI(r,i),r}mergeEvaluated(t,i){let{it:o,gen:r}=this;if(!o.opts.unevaluated)return;if(o.props!==!0&&t.props!==void 0)o.props=rt.mergeEvaluated.props(r,t.props,o.props,i);if(o.items!==!0&&t.items!==void 0)o.items=rt.mergeEvaluated.items(r,t.items,o.items,i)}mergeValidEvaluated(t,i){let{it:o,gen:r}=this;if(o.opts.unevaluated&&(o.props!==!0||o.items!==!0))return r.if(i,()=>this.mergeEvaluated(t,L.Name)),!0}}v$.KeywordCxt=Lo;function H$(t,i,o,r){let $=new Lo(t,o,i);if("code"in o)o.code($,r);else if($.$data&&o.validate)(0,Ut.funcKeywordCode)($,o);else if("macro"in o)(0,Ut.macroKeywordCode)($,o);else if(o.compile||o.validate)(0,Ut.funcKeywordCode)($,o)}var by=/^\/(?:[^~]|~0|~1)*$/,uy=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function D$(t,{dataLevel:i,dataNames:o,dataPathArr:r}){let $,l;if(t==="")return q.default.rootData;if(t[0]==="/"){if(!by.test(t))throw Error(`Invalid JSON-pointer: ${t}`);$=t,l=q.default.rootData}else{let b=uy.exec(t);if(!b)throw Error(`Invalid JSON-pointer: ${t}`);let u=+b[1];if($=b[2],$==="#"){if(u>=i)throw Error(n("property/index",u));return r[i-u]}if(u>i)throw Error(n("data",u));if(l=o[i-u],!$)return l}let f=l,s=$.split("/");for(let b of s)if(b)l=L._`${l}${(0,L.getProperty)((0,rt.unescapeJsonPointer)(b))}`,f=L._`${f} && ${l}`;return f;function n(b,u){return`Cannot access ${b} ${u} levels up, current level is ${i}`}}v$.getData=D$});var Vi=M((N$)=>{Object.defineProperty(N$,"__esModule",{value:!0});class U$ extends Error{constructor(t){super("validation failed");this.errors=t,this.ajv=this.validation=!0}}N$.default=U$});var Pt=M((E$)=>{Object.defineProperty(E$,"__esModule",{value:!0});var qo=vt();class P$ extends Error{constructor(t,i,o,r){super(r||`can't resolve reference ${o} from id ${i}`);this.missingRef=(0,qo.resolveUrl)(t,i,o),this.missingSchema=(0,qo.normalizeId)((0,qo.getFullPath)(t,this.missingRef))}}E$.default=P$});var Rt=M((k$)=>{Object.defineProperty(k$,"__esModule",{value:!0});k$.resolveSchema=k$.getCompilingSchema=k$.resolveRef=k$.compileSchema=k$.SchemaEnv=void 0;var h=O(),dy=Vi(),Vt=P(),g=vt(),R$=j(),Vy=Nt();class Et{constructor(t){var i;this.refs={},this.dynamicAnchors={};let o;if(typeof t.schema=="object")o=t.schema;this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(i=t.baseId)!==null&&i!==void 0?i:(0,g.normalizeId)(o===null||o===void 0?void 0:o[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=o===null||o===void 0?void 0:o.$async,this.refs={}}}k$.SchemaEnv=Et;function Oo(t){let i=S$.call(this,t);if(i)return i;let o=(0,g.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:r,lines:$}=this.opts.code,{ownProperties:l}=this.opts,f=new h.CodeGen(this.scope,{es5:r,lines:$,ownProperties:l}),s;if(t.$async)s=f.scopeValue("Error",{ref:dy.default,code:h._`require("ajv/dist/runtime/validation_error").default`});let n=f.scopeName("validate");t.validateName=n;let b={gen:f,allErrors:this.opts.allErrors,data:Vt.default.data,parentData:Vt.default.parentData,parentDataProperty:Vt.default.parentDataProperty,dataNames:[Vt.default.data],dataPathArr:[h.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:f.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,h.stringify)(t.schema)}:{ref:t.schema}),validateName:n,ValidationError:s,schema:t.schema,schemaEnv:t,rootId:o,baseId:t.baseId||o,schemaPath:h.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:h._`""`,opts:this.opts,self:this},u;try{this._compilations.add(t),(0,Vy.validateFunctionCode)(b),f.optimize(this.opts.code.optimize);let I=f.toString();if(u=`${f.scopeRefs(Vt.default.scope)}return ${I}`,this.opts.code.process)u=this.opts.code.process(u,t);let d=Function(`${Vt.default.self}`,`${Vt.default.scope}`,u)(this,this.scope.get());if(this.scope.value(n,{ref:d}),d.errors=null,d.schema=t.schema,d.schemaEnv=t,t.$async)d.$async=!0;if(this.opts.code.source===!0)d.source={validateName:n,validateCode:I,scopeValues:f._values};if(this.opts.unevaluated){let{props:y,items:e}=b;if(d.evaluated={props:y instanceof h.Name?void 0:y,items:e instanceof h.Name?void 0:e,dynamicProps:y instanceof h.Name,dynamicItems:e instanceof h.Name},d.source)d.source.evaluated=(0,h.stringify)(d.evaluated)}return t.validate=d,t}catch(I){if(delete t.validate,delete t.validateName,u)this.logger.error("Error compiling schema, function code:",u);throw I}finally{this._compilations.delete(t)}}k$.compileSchema=Oo;function cy(t,i,o){var r;o=(0,g.resolveUrl)(this.opts.uriResolver,i,o);let $=t.refs[o];if($)return $;let l=qy.call(this,t,o);if(l===void 0){let f=(r=t.localRefs)===null||r===void 0?void 0:r[o],{schemaId:s}=this.opts;if(f)l=new Et({schema:f,schemaId:s,root:t,baseId:i})}if(l===void 0)return;return t.refs[o]=py.call(this,l)}k$.resolveRef=cy;function py(t){if((0,g.inlineRef)(t.schema,this.opts.inlineRefs))return t.schema;return t.validate?t:Oo.call(this,t)}function S$(t){for(let i of this._compilations)if(Ly(i,t))return i}k$.getCompilingSchema=S$;function Ly(t,i){return t.schema===i.schema&&t.root===i.root&&t.baseId===i.baseId}function qy(t,i){let o;while(typeof(o=this.refs[i])=="string")i=o;return o||this.schemas[i]||ci.call(this,t,i)}function ci(t,i){let o=this.opts.uriResolver.parse(i),r=(0,g._getFullPath)(this.opts.uriResolver,o),$=(0,g.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&r===$)return To.call(this,o,t);let l=(0,g.normalizeId)(r),f=this.refs[l]||this.schemas[l];if(typeof f=="string"){let s=ci.call(this,t,f);if(typeof(s===null||s===void 0?void 0:s.schema)!=="object")return;return To.call(this,o,s)}if(typeof(f===null||f===void 0?void 0:f.schema)!=="object")return;if(!f.validate)Oo.call(this,f);if(l===(0,g.normalizeId)(i)){let{schema:s}=f,{schemaId:n}=this.opts,b=s[n];if(b)$=(0,g.resolveUrl)(this.opts.uriResolver,$,b);return new Et({schema:s,schemaId:n,root:t,baseId:$})}return To.call(this,o,f)}k$.resolveSchema=ci;var Ty=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function To(t,{baseId:i,schema:o,root:r}){var $;if((($=t.fragment)===null||$===void 0?void 0:$[0])!=="/")return;for(let s of t.fragment.slice(1).split("/")){if(typeof o==="boolean")return;let n=o[(0,R$.unescapeFragment)(s)];if(n===void 0)return;o=n;let b=typeof o==="object"&&o[this.opts.schemaId];if(!Ty.has(s)&&b)i=(0,g.resolveUrl)(this.opts.uriResolver,i,b)}let l;if(typeof o!="boolean"&&o.$ref&&!(0,R$.schemaHasRulesButRef)(o,this.RULES)){let s=(0,g.resolveUrl)(this.opts.uriResolver,i,o.$ref);l=ci.call(this,r,s)}let{schemaId:f}=this.opts;if(l=l||new Et({schema:o,schemaId:f,root:r,baseId:i}),l.schema!==l.root.schema)return l;return}});var h$=M((LV,Fy)=>{Fy.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var wo=M((qV,tl)=>{var Zy=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),m$=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),Wo=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),x$=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),By=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function jo(t){let i="",o=0,r=0;for(r=0;r<t.length;r++){if(o=t[r].charCodeAt(0),o===48)continue;if(!(o>=48&&o<=57||o>=65&&o<=70||o>=97&&o<=102))return"";i+=t[r];break}for(r+=1;r<t.length;r++){if(o=t[r].charCodeAt(0),!(o>=48&&o<=57||o>=65&&o<=70||o>=97&&o<=102))return"";i+=t[r]}return i}var Jy=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function g$(t){return t.length=0,!0}function Xy(t,i,o){if(t.length){let r=jo(t);if(r!=="")i.push(r);else return o.error=!0,!1;t.length=0}return!0}function Yy(t){let i=0,o={error:!1,address:"",zone:""},r=[],$=[],l=!1,f=!1,s=Xy;for(let n=0;n<t.length;n++){let b=t[n];if(b==="["||b==="]")continue;if(b===":"){if(l===!0)f=!0;if(!s($,r,o))break;if(++i>7){o.error=!0;break}if(n>0&&t[n-1]===":")l=!0;r.push(":");continue}else if(b==="%"){if(!s($,r,o))break;s=g$}else{$.push(b);continue}}if($.length)if(s===g$)o.zone=$.join("");else if(f)r.push($.join(""));else r.push(jo($));return o.address=r.join(""),o}function a$(t){if(Ay(t,":")<2)return{host:t,isIPV6:!1};let i=Yy(t);if(!i.error){let{address:o,address:r}=i;if(i.zone)o+="%"+i.zone,r+="%25"+i.zone;return{host:o,isIPV6:!0,escapedHost:r}}else return{host:t,isIPV6:!1}}function Ay(t,i){let o=0;for(let r=0;r<t.length;r++)if(t[r]===i)o++;return o}function zy(t){let i=t,o=[],r=-1,$=0;while($=i.length){if($===1)if(i===".")break;else if(i==="/"){o.push("/");break}else{o.push(i);break}else if($===2){if(i[0]==="."){if(i[1]===".")break;else if(i[1]==="/"){i=i.slice(2);continue}}else if(i[0]==="/"){if(i[1]==="."||i[1]==="/"){o.push("/");break}}}else if($===3){if(i==="/.."){if(o.length!==0)o.pop();o.push("/");break}}if(i[0]==="."){if(i[1]==="."){if(i[2]==="/"){i=i.slice(3);continue}}else if(i[1]==="/"){i=i.slice(2);continue}}else if(i[0]==="/"){if(i[1]==="."){if(i[2]==="/"){i=i.slice(2);continue}else if(i[2]==="."){if(i[3]==="/"){if(i=i.slice(3),o.length!==0)o.pop();continue}}}}if((r=i.indexOf("/",1))===-1){o.push(i);break}else o.push(i.slice(0,r)),i=i.slice(r)}return o.join("")}var Qy={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},Gy=/[@/?#:]/g,Hy=/[@/?#]/g;function _$(t,i){let o=i?Hy:Gy;return o.lastIndex=0,t.replace(o,(r)=>Qy[r])}function Dy(t,i=!1){if(t.indexOf("%")===-1)return t;let o="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let $=t.slice(r+1,r+3);if(Wo($)){let l=$.toUpperCase(),f=String.fromCharCode(parseInt(l,16));if(i&&x$(f))o+=f;else o+="%"+l;r+=2;continue}}o+=t[r]}return o}function vy(t){let i="";for(let o=0;o<t.length;o++){if(t[o]==="%"&&o+2<t.length){let r=t.slice(o+1,o+3);if(Wo(r)){let $=r.toUpperCase(),l=String.fromCharCode(parseInt($,16));if(l!=="."&&x$(l))i+=l;else i+="%"+$;o+=2;continue}}if(By(t[o]))i+=t[o];else i+=escape(t[o])}return i}function Ky(t){let i="";for(let o=0;o<t.length;o++){if(t[o]==="%"&&o+2<t.length){let r=t.slice(o+1,o+3);if(Wo(r)){i+="%"+r.toUpperCase(),o+=2;continue}}i+=escape(t[o])}return i}function Uy(t){let i=[];if(t.userinfo!==void 0)i.push(t.userinfo),i.push("@");if(t.host!==void 0){let o=unescape(t.host);if(!m$(o)){let r=a$(o);if(r.isIPV6===!0)o=`[${r.escapedHost}]`;else o=_$(o,!1)}i.push(o)}if(typeof t.port==="number"||typeof t.port==="string")i.push(":"),i.push(String(t.port));return i.length?i.join(""):void 0}tl.exports={nonSimpleDomain:Jy,recomposeAuthority:Uy,reescapeHostDelimiters:_$,normalizePercentEncoding:Dy,normalizePathEncoding:vy,escapePreservingEscapes:Ky,removeDotSegments:zy,isIPv4:m$,isUUID:Zy,normalizeIPv6:a$,stringArrayToHexStripped:jo}});var ll=M((TV,$l)=>{var{isUUID:Ny}=wo(),Py=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,Ey=["http","https","ws","wss","urn","urn:uuid"];function Ry(t){return Ey.indexOf(t)!==-1}function Fo(t){if(t.secure===!0)return!0;else if(t.secure===!1)return!1;else if(t.scheme)return t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S");else return!1}function il(t){if(!t.host)t.error=t.error||"HTTP URIs must have a host.";return t}function ol(t){let i=String(t.scheme).toLowerCase()==="https";if(t.port===(i?443:80)||t.port==="")t.port=void 0;if(!t.path)t.path="/";return t}function Sy(t){return t.secure=Fo(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function ky(t){if(t.port===(Fo(t)?443:80)||t.port==="")t.port=void 0;if(typeof t.secure==="boolean")t.scheme=t.secure?"wss":"ws",t.secure=void 0;if(t.resourceName){let[i,o]=t.resourceName.split("?");t.path=i&&i!=="/"?i:void 0,t.query=o,t.resourceName=void 0}return t.fragment=void 0,t}function Cy(t,i){if(!t.path)return t.error="URN can not be parsed",t;let o=t.path.match(Py);if(o){let r=i.scheme||t.scheme||"urn";t.nid=o[1].toLowerCase(),t.nss=o[2];let $=`${r}:${i.nid||t.nid}`,l=Zo($);if(t.path=void 0,l)t=l.parse(t,i)}else t.error=t.error||"URN can not be parsed.";return t}function hy(t,i){if(t.nid===void 0)throw Error("URN without nid cannot be serialized");let o=i.scheme||t.scheme||"urn",r=t.nid.toLowerCase(),$=`${o}:${i.nid||r}`,l=Zo($);if(l)t=l.serialize(t,i);let f=t,s=t.nss;return f.path=`${r||i.nid}:${s}`,i.skipEscape=!0,f}function gy(t,i){let o=t;if(o.uuid=o.nss,o.nss=void 0,!i.tolerant&&(!o.uuid||!Ny(o.uuid)))o.error=o.error||"UUID is not valid.";return o}function my(t){let i=t;return i.nss=(t.uuid||"").toLowerCase(),i}var rl={scheme:"http",domainHost:!0,parse:il,serialize:ol},xy={scheme:"https",domainHost:rl.domainHost,parse:il,serialize:ol},pi={scheme:"ws",domainHost:!0,parse:Sy,serialize:ky},ay={scheme:"wss",domainHost:pi.domainHost,parse:pi.parse,serialize:pi.serialize},_y={scheme:"urn",parse:Cy,serialize:hy,skipNormalize:!0},t0={scheme:"urn:uuid",parse:gy,serialize:my,skipNormalize:!0},Li={http:rl,https:xy,ws:pi,wss:ay,urn:_y,"urn:uuid":t0};Object.setPrototypeOf(Li,null);function Zo(t){return t&&(Li[t]||Li[t.toLowerCase()])||void 0}$l.exports={wsIsSecure:Fo,SCHEMES:Li,isValidSchemeName:Ry,getSchemeHandler:Zo}});var ul=M((OV,Oi)=>{var{normalizeIPv6:i0,removeDotSegments:St,recomposeAuthority:o0,normalizePercentEncoding:r0,normalizePathEncoding:$0,escapePreservingEscapes:l0,reescapeHostDelimiters:f0,isIPv4:s0,nonSimpleDomain:n0}=wo(),{SCHEMES:b0,getSchemeHandler:sl}=ll();function u0(t,i){if(typeof t==="string")t=c0(t,i);else if(typeof t==="object")t=Ti(ct(t,i),i);return t}function I0(t,i,o){let r=o?Object.assign({scheme:"null"},o):{scheme:"null"},{parsed:$,malformedAuthorityOrPort:l}=qi(t,r),{parsed:f,malformedAuthorityOrPort:s}=qi(i,r);if(l||s)throw Error($.error||f.error||"URI is malformed.");let n=nl($,f,r,!0);return r.skipEscape=!0,ct(n,r)}function nl(t,i,o,r){let $={};if(!r)t=Ti(ct(t,o),o),i=Ti(ct(i,o),o);if(o=o||{},!o.tolerant&&i.scheme)$.scheme=i.scheme,$.userinfo=i.userinfo,$.host=i.host,$.port=i.port,$.path=St(i.path||""),$.query=i.query;else{if(i.userinfo!==void 0||i.host!==void 0||i.port!==void 0)$.userinfo=i.userinfo,$.host=i.host,$.port=i.port,$.path=St(i.path||""),$.query=i.query;else{if(!i.path)if($.path=t.path,i.query!==void 0)$.query=i.query;else $.query=t.query;else{if(i.path[0]==="/")$.path=St(i.path);else{if((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path)$.path="/"+i.path;else if(!t.path)$.path=i.path;else $.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+i.path;$.path=St($.path)}$.query=i.query}$.userinfo=t.userinfo,$.host=t.host,$.port=t.port}$.scheme=t.scheme}return $.fragment=i.fragment,$}function y0(t,i,o){let r=fl(t,o),$=fl(i,o);return r!==void 0&&$!==void 0&&r.toLowerCase()===$.toLowerCase()}function ct(t,i){let o={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},r=Object.assign({},i),$=[],l=sl(r.scheme||o.scheme);if(l&&l.serialize)l.serialize(o,r);if(o.path!==void 0)if(!r.skipEscape){if(o.path=l0(o.path),o.scheme!==void 0)o.path=o.path.split("%3A").join(":")}else o.path=r0(o.path);if(r.reference!=="suffix"&&o.scheme)$.push(o.scheme,":");let f=o0(o);if(f!==void 0){if(r.reference!=="suffix")$.push("//");if($.push(f),o.path&&o.path[0]!=="/")$.push("/")}if(o.path!==void 0){let s=o.path;if(!r.absolutePath&&(!l||!l.absolutePath))s=St(s);if(f===void 0&&s[0]==="/"&&s[1]==="/")s="/%2F"+s.slice(2);$.push(s)}if(o.query!==void 0)$.push("?",o.query);if(o.fragment!==void 0)$.push("#",o.fragment);return $.join("")}var e0=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,M0=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,d0=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function V0(t,i){if(i[2]!==void 0&&t.path&&t.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof t.port==="number"&&(t.port<0||t.port>65535))return"URI port is malformed.";return}function qi(t,i){let o=Object.assign({},i),r={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},$=!1,l=!1;if(o.reference==="suffix")if(o.scheme)t=o.scheme+":"+t;else t="//"+t;let f=t.match(M0);if(f!==null&&f[1].indexOf("\\")!==-1)r.error="URI authority must not contain a literal backslash.",$=!0;let s=t.match(d0);if(s!==null){let b=s[1],u=b.replace(/[\t\n\r]/g,"");if(u.length>=2){if(u.slice(0,2)!=="//")r.error=r.error||"URI authority must not contain a literal backslash.",$=!0;else if(b.length!==u.length)r.error=r.error||"URI authority introducer must not contain whitespace.",$=!0}}let n=t.match(e0);if(n){if(r.scheme=n[1],r.userinfo=n[3],r.host=n[4],r.port=parseInt(n[5],10),r.path=n[6]||"",r.query=n[7],r.fragment=n[8],isNaN(r.port))r.port=n[5];let b=V0(r,n);if(b!==void 0)r.error=r.error||b,$=!0;if(r.host)if(s0(r.host)===!1){let V=i0(r.host);r.host=V.host.toLowerCase(),l=V.isIPV6}else l=!0;if(r.scheme===void 0&&r.userinfo===void 0&&r.host===void 0&&r.port===void 0&&r.query===void 0&&!r.path)r.reference="same-document";else if(r.scheme===void 0)r.reference="relative";else if(r.fragment===void 0)r.reference="absolute";else r.reference="uri";if(o.reference&&o.reference!=="suffix"&&o.reference!==r.reference)r.error=r.error||"URI is not a "+o.reference+" reference.";let u=sl(o.scheme||r.scheme);if(!o.unicodeSupport&&(!u||!u.unicodeSupport)){if(r.host&&(o.domainHost||u&&u.domainHost)&&l===!1&&n0(r.host))try{r.host=new URL("http://"+r.host).hostname}catch(I){r.error=r.error||"Host's domain name can not be converted to ASCII: "+I}}if(!u||u&&!u.skipNormalize){if(t.indexOf("%")!==-1){if(r.scheme!==void 0)r.scheme=unescape(r.scheme);if(r.host!==void 0)r.host=f0(unescape(r.host),l)}if(r.path)r.path=$0(r.path);if(r.fragment)try{r.fragment=encodeURI(decodeURIComponent(r.fragment))}catch{r.error=r.error||"URI malformed"}}if(u&&u.parse)u.parse(r,o)}else r.error=r.error||"URI can not be parsed.";return{parsed:r,malformedAuthorityOrPort:$}}function Ti(t,i){return qi(t,i).parsed}function c0(t,i){return bl(t,i).normalized}function bl(t,i){let{parsed:o,malformedAuthorityOrPort:r}=qi(t,i);return{normalized:r?t:ct(o,i),malformedAuthorityOrPort:r}}function fl(t,i){if(typeof t==="string"){let{normalized:o,malformedAuthorityOrPort:r}=bl(t,i);return r?void 0:o}if(typeof t==="object")return ct(t,i)}var Bo={SCHEMES:b0,normalize:u0,resolve:I0,resolveComponent:nl,equal:y0,serialize:ct,parse:Ti};Oi.exports=Bo;Oi.exports.default=Bo;Oi.exports.fastUri=Bo});var el=M((yl)=>{Object.defineProperty(yl,"__esModule",{value:!0});var Il=ul();Il.code='require("ajv/dist/runtime/uri").default';yl.default=Il});var Tl=M(($t)=>{Object.defineProperty($t,"__esModule",{value:!0});$t.CodeGen=$t.Name=$t.nil=$t.stringify=$t.str=$t._=$t.KeywordCxt=void 0;var L0=Nt();Object.defineProperty($t,"KeywordCxt",{enumerable:!0,get:function(){return L0.KeywordCxt}});var Zt=O();Object.defineProperty($t,"_",{enumerable:!0,get:function(){return Zt._}});Object.defineProperty($t,"str",{enumerable:!0,get:function(){return Zt.str}});Object.defineProperty($t,"stringify",{enumerable:!0,get:function(){return Zt.stringify}});Object.defineProperty($t,"nil",{enumerable:!0,get:function(){return Zt.nil}});Object.defineProperty($t,"Name",{enumerable:!0,get:function(){return Zt.Name}});Object.defineProperty($t,"CodeGen",{enumerable:!0,get:function(){return Zt.CodeGen}});var q0=Vi(),pl=Pt(),T0=lo(),kt=Rt(),O0=O(),Ct=vt(),Wi=Dt(),Xo=j(),Ml=h$(),W0=el(),Ll=(t,i)=>new RegExp(t,i);Ll.code="new RegExp";var j0=["removeAdditional","useDefaults","coerceTypes"],w0=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),F0={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},Z0={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},dl=200;function B0(t){var i,o,r,$,l,f,s,n,b,u,I,V,d,y,e,c,p,Z,w,X,T,x,it,Ui,Ni;let At=t.strict,Pi=(i=t.code)===null||i===void 0?void 0:i.optimize,go=Pi===!0||Pi===void 0?1:Pi||0,mo=(r=(o=t.code)===null||o===void 0?void 0:o.regExp)!==null&&r!==void 0?r:Ll,An=($=t.uriResolver)!==null&&$!==void 0?$:W0.default;return{strictSchema:(f=(l=t.strictSchema)!==null&&l!==void 0?l:At)!==null&&f!==void 0?f:!0,strictNumbers:(n=(s=t.strictNumbers)!==null&&s!==void 0?s:At)!==null&&n!==void 0?n:!0,strictTypes:(u=(b=t.strictTypes)!==null&&b!==void 0?b:At)!==null&&u!==void 0?u:"log",strictTuples:(V=(I=t.strictTuples)!==null&&I!==void 0?I:At)!==null&&V!==void 0?V:"log",strictRequired:(y=(d=t.strictRequired)!==null&&d!==void 0?d:At)!==null&&y!==void 0?y:!1,code:t.code?{...t.code,optimize:go,regExp:mo}:{optimize:go,regExp:mo},loopRequired:(e=t.loopRequired)!==null&&e!==void 0?e:dl,loopEnum:(c=t.loopEnum)!==null&&c!==void 0?c:dl,meta:(p=t.meta)!==null&&p!==void 0?p:!0,messages:(Z=t.messages)!==null&&Z!==void 0?Z:!0,inlineRefs:(w=t.inlineRefs)!==null&&w!==void 0?w:!0,schemaId:(X=t.schemaId)!==null&&X!==void 0?X:"$id",addUsedSchema:(T=t.addUsedSchema)!==null&&T!==void 0?T:!0,validateSchema:(x=t.validateSchema)!==null&&x!==void 0?x:!0,validateFormats:(it=t.validateFormats)!==null&&it!==void 0?it:!0,unicodeRegExp:(Ui=t.unicodeRegExp)!==null&&Ui!==void 0?Ui:!0,int32range:(Ni=t.int32range)!==null&&Ni!==void 0?Ni:!0,uriResolver:An}}class ji{constructor(t={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...B0(t)};let{es5:i,lines:o}=this.opts.code;this.scope=new O0.ValueScope({scope:{},prefixes:w0,es5:i,lines:o}),this.logger=Q0(t.logger);let r=t.validateFormats;if(t.validateFormats=!1,this.RULES=(0,T0.getRules)(),Vl.call(this,F0,t,"NOT SUPPORTED"),Vl.call(this,Z0,t,"DEPRECATED","warn"),this._metaOpts=A0.call(this),t.formats)X0.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords)Y0.call(this,t.keywords);if(typeof t.meta=="object")this.addMetaSchema(t.meta);J0.call(this),t.validateFormats=r}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:i,schemaId:o}=this.opts,r=Ml;if(o==="id")r={...Ml},r.id=r.$id,delete r.$id;if(i&&t)this.addMetaSchema(r,r[o],!1)}defaultMeta(){let{meta:t,schemaId:i}=this.opts;return this.opts.defaultMeta=typeof t=="object"?t[i]||t:void 0}validate(t,i){let o;if(typeof t=="string"){if(o=this.getSchema(t),!o)throw Error(`no schema with key or ref "${t}"`)}else o=this.compile(t);let r=o(i);if(!("$async"in o))this.errors=o.errors;return r}compile(t,i){let o=this._addSchema(t,i);return o.validate||this._compileSchemaEnv(o)}compileAsync(t,i){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:o}=this.opts;return r.call(this,t,i);async function r(b,u){await $.call(this,b.$schema);let I=this._addSchema(b,u);return I.validate||l.call(this,I)}async function $(b){if(b&&!this.getSchema(b))await r.call(this,{$ref:b},!0)}async function l(b){try{return this._compileSchemaEnv(b)}catch(u){if(!(u instanceof pl.default))throw u;return f.call(this,u),await s.call(this,u.missingSchema),l.call(this,b)}}function f({missingSchema:b,missingRef:u}){if(this.refs[b])throw Error(`AnySchema ${b} is loaded but ${u} cannot be resolved`)}async function s(b){let u=await n.call(this,b);if(!this.refs[b])await $.call(this,u.$schema);if(!this.refs[b])this.addSchema(u,b,i)}async function n(b){let u=this._loading[b];if(u)return u;try{return await(this._loading[b]=o(b))}finally{delete this._loading[b]}}}addSchema(t,i,o,r=this.opts.validateSchema){if(Array.isArray(t)){for(let l of t)this.addSchema(l,void 0,o,r);return this}let $;if(typeof t==="object"){let{schemaId:l}=this.opts;if($=t[l],$!==void 0&&typeof $!="string")throw Error(`schema ${l} must be string`)}return i=(0,Ct.normalizeId)(i||$),this._checkUnique(i),this.schemas[i]=this._addSchema(t,o,i,r,!0),this}addMetaSchema(t,i,o=this.opts.validateSchema){return this.addSchema(t,i,!0,o),this}validateSchema(t,i){if(typeof t=="boolean")return!0;let o;if(o=t.$schema,o!==void 0&&typeof o!="string")throw Error("$schema must be a string");if(o=o||this.opts.defaultMeta||this.defaultMeta(),!o)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let r=this.validate(o,t);if(!r&&i){let $="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error($);else throw Error($)}return r}getSchema(t){let i;while(typeof(i=cl.call(this,t))=="string")t=i;if(i===void 0){let{schemaId:o}=this.opts,r=new kt.SchemaEnv({schema:{},schemaId:o});if(i=kt.resolveSchema.call(this,r,t),!i)return;this.refs[t]=i}return i.validate||this._compileSchemaEnv(i)}removeSchema(t){if(t instanceof RegExp)return this._removeAllSchemas(this.schemas,t),this._removeAllSchemas(this.refs,t),this;switch(typeof t){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let i=cl.call(this,t);if(typeof i=="object")this._cache.delete(i.schema);return delete this.schemas[t],delete this.refs[t],this}case"object":{let i=t;this._cache.delete(i);let o=t[this.opts.schemaId];if(o)o=(0,Ct.normalizeId)(o),delete this.schemas[o],delete this.refs[o];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(let i of t)this.addKeyword(i);return this}addKeyword(t,i){let o;if(typeof t=="string"){if(o=t,typeof i=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),i.keyword=o}else if(typeof t=="object"&&i===void 0){if(i=t,o=i.keyword,Array.isArray(o)&&!o.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(H0.call(this,o,i),!i)return(0,Xo.eachItem)(o,($)=>Jo.call(this,$)),this;v0.call(this,i);let r={...i,type:(0,Wi.getJSONTypes)(i.type),schemaType:(0,Wi.getJSONTypes)(i.schemaType)};return(0,Xo.eachItem)(o,r.type.length===0?($)=>Jo.call(this,$,r):($)=>r.type.forEach((l)=>Jo.call(this,$,r,l))),this}getKeyword(t){let i=this.RULES.all[t];return typeof i=="object"?i.definition:!!i}removeKeyword(t){let{RULES:i}=this;delete i.keywords[t],delete i.all[t];for(let o of i.rules){let r=o.rules.findIndex(($)=>$.keyword===t);if(r>=0)o.rules.splice(r,1)}return this}addFormat(t,i){if(typeof i=="string")i=new RegExp(i);return this.formats[t]=i,this}errorsText(t=this.errors,{separator:i=", ",dataVar:o="data"}={}){if(!t||t.length===0)return"No errors";return t.map((r)=>`${o}${r.instancePath} ${r.message}`).reduce((r,$)=>r+i+$)}$dataMetaSchema(t,i){let o=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(let r of i){let $=r.split("/").slice(1),l=t;for(let f of $)l=l[f];for(let f in o){let s=o[f];if(typeof s!="object")continue;let{$data:n}=s.definition,b=l[f];if(n&&b)l[f]=ql(b)}}return t}_removeAllSchemas(t,i){for(let o in t){let r=t[o];if(!i||i.test(o)){if(typeof r=="string")delete t[o];else if(r&&!r.meta)this._cache.delete(r.schema),delete t[o]}}}_addSchema(t,i,o,r=this.opts.validateSchema,$=this.opts.addUsedSchema){let l,{schemaId:f}=this.opts;if(typeof t=="object")l=t[f];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof t!="boolean")throw Error("schema must be object or boolean");let s=this._cache.get(t);if(s!==void 0)return s;o=(0,Ct.normalizeId)(l||o);let n=Ct.getSchemaRefs.call(this,t,o);if(s=new kt.SchemaEnv({schema:t,schemaId:f,meta:i,baseId:o,localRefs:n}),this._cache.set(s.schema,s),$&&!o.startsWith("#")){if(o)this._checkUnique(o);this.refs[o]=s}if(r)this.validateSchema(t,!0);return s}_checkUnique(t){if(this.schemas[t]||this.refs[t])throw Error(`schema with key or id "${t}" already exists`)}_compileSchemaEnv(t){if(t.meta)this._compileMetaSchema(t);else kt.compileSchema.call(this,t);if(!t.validate)throw Error("ajv implementation error");return t.validate}_compileMetaSchema(t){let i=this.opts;this.opts=this._metaOpts;try{kt.compileSchema.call(this,t)}finally{this.opts=i}}}ji.ValidationError=q0.default;ji.MissingRefError=pl.default;$t.default=ji;function Vl(t,i,o,r="error"){for(let $ in t){let l=$;if(l in i)this.logger[r](`${o}: option ${$}. ${t[l]}`)}}function cl(t){return t=(0,Ct.normalizeId)(t),this.schemas[t]||this.refs[t]}function J0(){let t=this.opts.schemas;if(!t)return;if(Array.isArray(t))this.addSchema(t);else for(let i in t)this.addSchema(t[i],i)}function X0(){for(let t in this.opts.formats){let i=this.opts.formats[t];if(i)this.addFormat(t,i)}}function Y0(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let i in t){let o=t[i];if(!o.keyword)o.keyword=i;this.addKeyword(o)}}function A0(){let t={...this.opts};for(let i of j0)delete t[i];return t}var z0={log(){},warn(){},error(){}};function Q0(t){if(t===!1)return z0;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw Error("logger must implement log, warn and error methods")}var G0=/^[a-z_$][a-z0-9_$:-]*$/i;function H0(t,i){let{RULES:o}=this;if((0,Xo.eachItem)(t,(r)=>{if(o.keywords[r])throw Error(`Keyword ${r} is already defined`);if(!G0.test(r))throw Error(`Keyword ${r} has invalid name`)}),!i)return;if(i.$data&&!(("code"in i)||("validate"in i)))throw Error('$data keyword must have "code" or "validate" function')}function Jo(t,i,o){var r;let $=i===null||i===void 0?void 0:i.post;if(o&&$)throw Error('keyword with "post" flag cannot have "type"');let{RULES:l}=this,f=$?l.post:l.rules.find(({type:n})=>n===o);if(!f)f={type:o,rules:[]},l.rules.push(f);if(l.keywords[t]=!0,!i)return;let s={keyword:t,definition:{...i,type:(0,Wi.getJSONTypes)(i.type),schemaType:(0,Wi.getJSONTypes)(i.schemaType)}};if(i.before)D0.call(this,f,s,i.before);else f.rules.push(s);l.all[t]=s,(r=i.implements)===null||r===void 0||r.forEach((n)=>this.addKeyword(n))}function D0(t,i,o){let r=t.rules.findIndex(($)=>$.keyword===o);if(r>=0)t.rules.splice(r,0,i);else t.rules.push(i),this.logger.warn(`rule ${o} is not defined`)}function v0(t){let{metaSchema:i}=t;if(i===void 0)return;if(t.$data&&this.opts.$data)i=ql(i);t.validateSchema=this.compile(i,!0)}var K0={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function ql(t){return{anyOf:[t,K0]}}});var Wl=M((Ol)=>{Object.defineProperty(Ol,"__esModule",{value:!0});var P0={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Ol.default=P0});var Zi=M((Zl)=>{Object.defineProperty(Zl,"__esModule",{value:!0});Zl.callRef=Zl.getValidate=void 0;var R0=Pt(),jl=E(),U=O(),Bt=P(),wl=Rt(),wi=j(),S0={keyword:"$ref",schemaType:"string",code(t){let{gen:i,schema:o,it:r}=t,{baseId:$,schemaEnv:l,validateName:f,opts:s,self:n}=r,{root:b}=l;if((o==="#"||o==="#/")&&$===b.baseId)return I();let u=wl.resolveRef.call(n,b,$,o);if(u===void 0)throw new R0.default(r.opts.uriResolver,$,o);if(u instanceof wl.SchemaEnv)return V(u);return d(u);function I(){if(l===b)return Fi(t,f,l,l.$async);let y=i.scopeValue("root",{ref:b});return Fi(t,U._`${y}.validate`,b,b.$async)}function V(y){let e=Fl(t,y);Fi(t,e,y,y.$async)}function d(y){let e=i.scopeValue("schema",s.code.source===!0?{ref:y,code:(0,U.stringify)(y)}:{ref:y}),c=i.name("valid"),p=t.subschema({schema:y,dataTypes:[],schemaPath:U.nil,topSchemaRef:e,errSchemaPath:o},c);t.mergeEvaluated(p),t.ok(c)}}};function Fl(t,i){let{gen:o}=t;return i.validate?o.scopeValue("validate",{ref:i.validate}):U._`${o.scopeValue("wrapper",{ref:i})}.validate`}Zl.getValidate=Fl;function Fi(t,i,o,r){let{gen:$,it:l}=t,{allErrors:f,schemaEnv:s,opts:n}=l,b=n.passContext?Bt.default.this:U.nil;if(r)u();else I();function u(){if(!s.$async)throw Error("async schema referenced by sync schema");let y=$.let("valid");$.try(()=>{if($.code(U._`await ${(0,jl.callValidateCode)(t,i,b)}`),d(i),!f)$.assign(y,!0)},(e)=>{if($.if(U._`!(${e} instanceof ${l.ValidationError})`,()=>$.throw(e)),V(e),!f)$.assign(y,!1)}),t.ok(y)}function I(){t.result((0,jl.callValidateCode)(t,i,b),()=>d(i),()=>V(i))}function V(y){let e=U._`${y}.errors`;$.assign(Bt.default.vErrors,U._`${Bt.default.vErrors} === null ? ${e} : ${Bt.default.vErrors}.concat(${e})`),$.assign(Bt.default.errors,U._`${Bt.default.vErrors}.length`)}function d(y){var e;if(!l.opts.unevaluated)return;let c=(e=o===null||o===void 0?void 0:o.validate)===null||e===void 0?void 0:e.evaluated;if(l.props!==!0)if(c&&!c.dynamicProps){if(c.props!==void 0)l.props=wi.mergeEvaluated.props($,c.props,l.props)}else{let p=$.var("props",U._`${y}.evaluated.props`);l.props=wi.mergeEvaluated.props($,p,l.props,U.Name)}if(l.items!==!0)if(c&&!c.dynamicItems){if(c.items!==void 0)l.items=wi.mergeEvaluated.items($,c.items,l.items)}else{let p=$.var("items",U._`${y}.evaluated.items`);l.items=wi.mergeEvaluated.items($,p,l.items,U.Name)}}}Zl.callRef=Fi;Zl.default=S0});var Xl=M((Jl)=>{Object.defineProperty(Jl,"__esModule",{value:!0});var h0=Wl(),g0=Zi(),m0=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",h0.default,g0.default];Jl.default=m0});var Al=M((Yl)=>{Object.defineProperty(Yl,"__esModule",{value:!0});var Bi=O(),ut=Bi.operators,Ji={maximum:{okStr:"<=",ok:ut.LTE,fail:ut.GT},minimum:{okStr:">=",ok:ut.GTE,fail:ut.LT},exclusiveMaximum:{okStr:"<",ok:ut.LT,fail:ut.GTE},exclusiveMinimum:{okStr:">",ok:ut.GT,fail:ut.LTE}},a0={message:({keyword:t,schemaCode:i})=>Bi.str`must be ${Ji[t].okStr} ${i}`,params:({keyword:t,schemaCode:i})=>Bi._`{comparison: ${Ji[t].okStr}, limit: ${i}}`},_0={keyword:Object.keys(Ji),type:"number",schemaType:"number",$data:!0,error:a0,code(t){let{keyword:i,data:o,schemaCode:r}=t;t.fail$data(Bi._`${o} ${Ji[i].fail} ${r} || isNaN(${o})`)}};Yl.default=_0});var Ql=M((zl)=>{Object.defineProperty(zl,"__esModule",{value:!0});var ht=O(),i1={message:({schemaCode:t})=>ht.str`must be multiple of ${t}`,params:({schemaCode:t})=>ht._`{multipleOf: ${t}}`},o1={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:i1,code(t){let{gen:i,data:o,schemaCode:r,it:$}=t,l=$.opts.multipleOfPrecision,f=i.let("res"),s=l?ht._`Math.abs(Math.round(${f}) - ${f}) > 1e-${l}`:ht._`${f} !== parseInt(${f})`;t.fail$data(ht._`(${r} === 0 || (${f} = ${o}/${r}, ${s}))`)}};zl.default=o1});var Dl=M((Hl)=>{Object.defineProperty(Hl,"__esModule",{value:!0});function Gl(t){let i=t.length,o=0,r=0,$;while(r<i)if(o++,$=t.charCodeAt(r++),$>=55296&&$<=56319&&r<i){if($=t.charCodeAt(r),($&64512)===56320)r++}return o}Hl.default=Gl;Gl.code='require("ajv/dist/runtime/ucs2length").default'});var Kl=M((vl)=>{Object.defineProperty(vl,"__esModule",{value:!0});var pt=O(),l1=j(),f1=Dl(),s1={message({keyword:t,schemaCode:i}){let o=t==="maxLength"?"more":"fewer";return pt.str`must NOT have ${o} than ${i} characters`},params:({schemaCode:t})=>pt._`{limit: ${t}}`},n1={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:s1,code(t){let{keyword:i,data:o,schemaCode:r,it:$}=t,l=i==="maxLength"?pt.operators.GT:pt.operators.LT,f=$.opts.unicode===!1?pt._`${o}.length`:pt._`${(0,l1.useFunc)(t.gen,f1.default)}(${o})`;t.fail$data(pt._`${f} ${l} ${r}`)}};vl.default=n1});var Nl=M((Ul)=>{Object.defineProperty(Ul,"__esModule",{value:!0});var u1=E(),I1=j(),Jt=O(),y1={message:({schemaCode:t})=>Jt.str`must match pattern "${t}"`,params:({schemaCode:t})=>Jt._`{pattern: ${t}}`},e1={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:y1,code(t){let{gen:i,data:o,$data:r,schema:$,schemaCode:l,it:f}=t,s=f.opts.unicodeRegExp?"u":"";if(r){let{regExp:n}=f.opts.code,b=n.code==="new RegExp"?Jt._`new RegExp`:(0,I1.useFunc)(i,n),u=i.let("valid");i.try(()=>i.assign(u,Jt._`${b}(${l}, ${s}).test(${o})`),()=>i.assign(u,!1)),t.fail$data(Jt._`!${u}`)}else{let n=(0,u1.usePattern)(t,$);t.fail$data(Jt._`!${n}.test(${o})`)}}};Ul.default=e1});var El=M((Pl)=>{Object.defineProperty(Pl,"__esModule",{value:!0});var gt=O(),d1={message({keyword:t,schemaCode:i}){let o=t==="maxProperties"?"more":"fewer";return gt.str`must NOT have ${o} than ${i} properties`},params:({schemaCode:t})=>gt._`{limit: ${t}}`},V1={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:d1,code(t){let{keyword:i,data:o,schemaCode:r}=t,$=i==="maxProperties"?gt.operators.GT:gt.operators.LT;t.fail$data(gt._`Object.keys(${o}).length ${$} ${r}`)}};Pl.default=V1});var Sl=M((Rl)=>{Object.defineProperty(Rl,"__esModule",{value:!0});var mt=E(),xt=O(),p1=j(),L1={message:({params:{missingProperty:t}})=>xt.str`must have required property '${t}'`,params:({params:{missingProperty:t}})=>xt._`{missingProperty: ${t}}`},q1={keyword:"required",type:"object",schemaType:"array",$data:!0,error:L1,code(t){let{gen:i,schema:o,schemaCode:r,data:$,$data:l,it:f}=t,{opts:s}=f;if(!l&&o.length===0)return;let n=o.length>=s.loopRequired;if(f.allErrors)b();else u();if(s.strictRequired){let d=t.parentSchema.properties,{definedProperties:y}=t.it;for(let e of o)if((d===null||d===void 0?void 0:d[e])===void 0&&!y.has(e)){let c=f.schemaEnv.baseId+f.errSchemaPath,p=`required property "${e}" is not defined at "${c}" (strictRequired)`;(0,p1.checkStrictMode)(f,p,f.opts.strictRequired)}}function b(){if(n||l)t.block$data(xt.nil,I);else for(let d of o)(0,mt.checkReportMissingProp)(t,d)}function u(){let d=i.let("missing");if(n||l){let y=i.let("valid",!0);t.block$data(y,()=>V(d,y)),t.ok(y)}else i.if((0,mt.checkMissingProp)(t,o,d)),(0,mt.reportMissingProp)(t,d),i.else()}function I(){i.forOf("prop",r,(d)=>{t.setParams({missingProperty:d}),i.if((0,mt.noPropertyInData)(i,$,d,s.ownProperties),()=>t.error())})}function V(d,y){t.setParams({missingProperty:d}),i.forOf(d,r,()=>{i.assign(y,(0,mt.propertyInData)(i,$,d,s.ownProperties)),i.if((0,xt.not)(y),()=>{t.error(),i.break()})},xt.nil)}}};Rl.default=q1});var Cl=M((kl)=>{Object.defineProperty(kl,"__esModule",{value:!0});var at=O(),O1={message({keyword:t,schemaCode:i}){let o=t==="maxItems"?"more":"fewer";return at.str`must NOT have ${o} than ${i} items`},params:({schemaCode:t})=>at._`{limit: ${t}}`},W1={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:O1,code(t){let{keyword:i,data:o,schemaCode:r}=t,$=i==="maxItems"?at.operators.GT:at.operators.LT;t.fail$data(at._`${o}.length ${$} ${r}`)}};kl.default=W1});var Xi=M((gl)=>{Object.defineProperty(gl,"__esModule",{value:!0});var hl=eo();hl.code='require("ajv/dist/runtime/equal").default';gl.default=hl});var xl=M((ml)=>{Object.defineProperty(ml,"__esModule",{value:!0});var Yo=Dt(),z=O(),F1=j(),Z1=Xi(),B1={message:({params:{i:t,j:i}})=>z.str`must NOT have duplicate items (items ## ${i} and ${t} are identical)`,params:({params:{i:t,j:i}})=>z._`{i: ${t}, j: ${i}}`},J1={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:B1,code(t){let{gen:i,data:o,$data:r,schema:$,parentSchema:l,schemaCode:f,it:s}=t;if(!r&&!$)return;let n=i.let("valid"),b=l.items?(0,Yo.getSchemaTypes)(l.items):[];t.block$data(n,u,z._`${f} === false`),t.ok(n);function u(){let y=i.let("i",z._`${o}.length`),e=i.let("j");t.setParams({i:y,j:e}),i.assign(n,!0),i.if(z._`${y} > 1`,()=>(I()?V:d)(y,e))}function I(){return b.length>0&&!b.some((y)=>y==="object"||y==="array")}function V(y,e){let c=i.name("item"),p=(0,Yo.checkDataTypes)(b,c,s.opts.strictNumbers,Yo.DataType.Wrong),Z=i.const("indices",z._`{}`);i.for(z._`;${y}--;`,()=>{if(i.let(c,z._`${o}[${y}]`),i.if(p,z._`continue`),b.length>1)i.if(z._`typeof ${c} == "string"`,z._`${c} += "_"`);i.if(z._`typeof ${Z}[${c}] == "number"`,()=>{i.assign(e,z._`${Z}[${c}]`),t.error(),i.assign(n,!1).break()}).code(z._`${Z}[${c}] = ${y}`)})}function d(y,e){let c=(0,F1.useFunc)(i,Z1.default),p=i.name("outer");i.label(p).for(z._`;${y}--;`,()=>i.for(z._`${e} = ${y}; ${e}--;`,()=>i.if(z._`${c}(${o}[${y}], ${o}[${e}])`,()=>{t.error(),i.assign(n,!1).break(p)})))}}};ml.default=J1});var _l=M((al)=>{Object.defineProperty(al,"__esModule",{value:!0});var Ao=O(),Y1=j(),A1=Xi(),z1={message:"must be equal to constant",params:({schemaCode:t})=>Ao._`{allowedValue: ${t}}`},Q1={keyword:"const",$data:!0,error:z1,code(t){let{gen:i,data:o,$data:r,schemaCode:$,schema:l}=t;if(r||l&&typeof l=="object")t.fail$data(Ao._`!${(0,Y1.useFunc)(i,A1.default)}(${o}, ${$})`);else t.fail(Ao._`${l} !== ${o}`)}};al.default=Q1});var of=M((tf)=>{Object.defineProperty(tf,"__esModule",{value:!0});var _t=O(),H1=j(),D1=Xi(),v1={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>_t._`{allowedValues: ${t}}`},K1={keyword:"enum",schemaType:"array",$data:!0,error:v1,code(t){let{gen:i,data:o,$data:r,schema:$,schemaCode:l,it:f}=t;if(!r&&$.length===0)throw Error("enum must have non-empty array");let s=$.length>=f.opts.loopEnum,n,b=()=>n!==null&&n!==void 0?n:n=(0,H1.useFunc)(i,D1.default),u;if(s||r)u=i.let("valid"),t.block$data(u,I);else{if(!Array.isArray($))throw Error("ajv implementation error");let d=i.const("vSchema",l);u=(0,_t.or)(...$.map((y,e)=>V(d,e)))}t.pass(u);function I(){i.assign(u,!1),i.forOf("v",l,(d)=>i.if(_t._`${b()}(${o}, ${d})`,()=>i.assign(u,!0).break()))}function V(d,y){let e=$[y];return typeof e==="object"&&e!==null?_t._`${b()}(${o}, ${d}[${y}])`:_t._`${o} === ${e}`}}};tf.default=K1});var $f=M((rf)=>{Object.defineProperty(rf,"__esModule",{value:!0});var N1=Al(),P1=Ql(),E1=Kl(),R1=Nl(),S1=El(),k1=Sl(),C1=Cl(),h1=xl(),g1=_l(),m1=of(),x1=[N1.default,P1.default,E1.default,R1.default,S1.default,k1.default,C1.default,h1.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},g1.default,m1.default];rf.default=x1});var Qo=M((ff)=>{Object.defineProperty(ff,"__esModule",{value:!0});ff.validateAdditionalItems=void 0;var Lt=O(),zo=j(),_1={message:({params:{len:t}})=>Lt.str`must NOT have more than ${t} items`,params:({params:{len:t}})=>Lt._`{limit: ${t}}`},te={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:_1,code(t){let{parentSchema:i,it:o}=t,{items:r}=i;if(!Array.isArray(r)){(0,zo.checkStrictMode)(o,'"additionalItems" is ignored when "items" is not an array of schemas');return}lf(t,r)}};function lf(t,i){let{gen:o,schema:r,data:$,keyword:l,it:f}=t;f.items=!0;let s=o.const("len",Lt._`${$}.length`);if(r===!1)t.setParams({len:i.length}),t.pass(Lt._`${s} <= ${i.length}`);else if(typeof r=="object"&&!(0,zo.alwaysValidSchema)(f,r)){let b=o.var("valid",Lt._`${s} <= ${i.length}`);o.if((0,Lt.not)(b),()=>n(b)),t.ok(b)}function n(b){o.forRange("i",i.length,s,(u)=>{if(t.subschema({keyword:l,dataProp:u,dataPropType:zo.Type.Num},b),!f.allErrors)o.if((0,Lt.not)(b),()=>o.break())})}}ff.validateAdditionalItems=lf;ff.default=te});var Go=M((uf)=>{Object.defineProperty(uf,"__esModule",{value:!0});uf.validateTuple=void 0;var nf=O(),Yi=j(),oe=E(),re={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:i,it:o}=t;if(Array.isArray(i))return bf(t,"additionalItems",i);if(o.items=!0,(0,Yi.alwaysValidSchema)(o,i))return;t.ok((0,oe.validateArray)(t))}};function bf(t,i,o=t.schema){let{gen:r,parentSchema:$,data:l,keyword:f,it:s}=t;if(u($),s.opts.unevaluated&&o.length&&s.items!==!0)s.items=Yi.mergeEvaluated.items(r,o.length,s.items);let n=r.name("valid"),b=r.const("len",nf._`${l}.length`);o.forEach((I,V)=>{if((0,Yi.alwaysValidSchema)(s,I))return;r.if(nf._`${b} > ${V}`,()=>t.subschema({keyword:f,schemaProp:V,dataProp:V},n)),t.ok(n)});function u(I){let{opts:V,errSchemaPath:d}=s,y=o.length,e=y===I.minItems&&(y===I.maxItems||I[i]===!1);if(V.strictTuples&&!e){let c=`"${f}" is ${y}-tuple, but minItems or maxItems/${i} are not specified or different at path "${d}"`;(0,Yi.checkStrictMode)(s,c,V.strictTuples)}}}uf.validateTuple=bf;uf.default=re});var ef=M((yf)=>{Object.defineProperty(yf,"__esModule",{value:!0});var le=Go(),fe={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(t)=>(0,le.validateTuple)(t,"items")};yf.default=fe});var Vf=M((df)=>{Object.defineProperty(df,"__esModule",{value:!0});var Mf=O(),ne=j(),be=E(),ue=Qo(),Ie={message:({params:{len:t}})=>Mf.str`must NOT have more than ${t} items`,params:({params:{len:t}})=>Mf._`{limit: ${t}}`},ye={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:Ie,code(t){let{schema:i,parentSchema:o,it:r}=t,{prefixItems:$}=o;if(r.items=!0,(0,ne.alwaysValidSchema)(r,i))return;if($)(0,ue.validateAdditionalItems)(t,$);else t.ok((0,be.validateArray)(t))}};df.default=ye});var pf=M((cf)=>{Object.defineProperty(cf,"__esModule",{value:!0});var R=O(),Ai=j(),Me={message:({params:{min:t,max:i}})=>i===void 0?R.str`must contain at least ${t} valid item(s)`:R.str`must contain at least ${t} and no more than ${i} valid item(s)`,params:({params:{min:t,max:i}})=>i===void 0?R._`{minContains: ${t}}`:R._`{minContains: ${t}, maxContains: ${i}}`},de={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:Me,code(t){let{gen:i,schema:o,parentSchema:r,data:$,it:l}=t,f,s,{minContains:n,maxContains:b}=r;if(l.opts.next)f=n===void 0?1:n,s=b;else f=1;let u=i.const("len",R._`${$}.length`);if(t.setParams({min:f,max:s}),s===void 0&&f===0){(0,Ai.checkStrictMode)(l,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(s!==void 0&&f>s){(0,Ai.checkStrictMode)(l,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,Ai.alwaysValidSchema)(l,o)){let e=R._`${u} >= ${f}`;if(s!==void 0)e=R._`${e} && ${u} <= ${s}`;t.pass(e);return}l.items=!0;let I=i.name("valid");if(s===void 0&&f===1)d(I,()=>i.if(I,()=>i.break()));else if(f===0){if(i.let(I,!0),s!==void 0)i.if(R._`${$}.length > 0`,V)}else i.let(I,!1),V();t.result(I,()=>t.reset());function V(){let e=i.name("_valid"),c=i.let("count",0);d(e,()=>i.if(e,()=>y(c)))}function d(e,c){i.forRange("i",0,u,(p)=>{t.subschema({keyword:"contains",dataProp:p,dataPropType:Ai.Type.Num,compositeRule:!0},e),c()})}function y(e){if(i.code(R._`${e}++`),s===void 0)i.if(R._`${e} >= ${f}`,()=>i.assign(I,!0).break());else if(i.if(R._`${e} > ${s}`,()=>i.assign(I,!1).break()),f===1)i.assign(I,!0);else i.if(R._`${e} >= ${f}`,()=>i.assign(I,!0))}}};cf.default=de});var zi=M((Tf)=>{Object.defineProperty(Tf,"__esModule",{value:!0});Tf.validateSchemaDeps=Tf.validatePropertyDeps=Tf.error=void 0;var Ho=O(),ce=j(),ti=E();Tf.error={message:({params:{property:t,depsCount:i,deps:o}})=>{let r=i===1?"property":"properties";return Ho.str`must have ${r} ${o} when property ${t} is present`},params:({params:{property:t,depsCount:i,deps:o,missingProperty:r}})=>Ho._`{property: ${t},
3
+ var Ns=Object.create;var{getPrototypeOf:Es,defineProperty:nr,getOwnPropertyNames:Rs}=Object;var Ss=Object.prototype.hasOwnProperty;function ks(t){return this[t]}var Cs,hs,gs=(t,i,o)=>{var r=t!=null&&typeof t==="object";if(r){var l=i?Cs??=new WeakMap:hs??=new WeakMap,f=l.get(t);if(f)return f}o=t!=null?Ns(Es(t)):{};let n=i||!t||!t.__esModule?nr(o,"default",{value:t,enumerable:!0}):o;for(let $ of Rs(t))if(!Ss.call(n,$))nr(n,$,{get:ks.bind(t,$),enumerable:!0});if(r)l.set(t,n);return n};var c=(t,i)=>()=>(i||t((i={exports:{}}).exports,i),i.exports);var Ut=c((dr)=>{Object.defineProperty(dr,"__esModule",{value:!0});dr.regexpCode=dr.getEsmExportName=dr.getProperty=dr.safeStringify=dr.stringify=dr.strConcat=dr.addCodeArg=dr.str=dr._=dr.nil=dr._Code=dr.Name=dr.IDENTIFIER=dr._CodeOrName=void 0;class ei{}dr._CodeOrName=ei;dr.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class jt extends ei{constructor(t){super();if(!dr.IDENTIFIER.test(t))throw Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}dr.Name=jt;class C extends ei{constructor(t){super();this._items=typeof t==="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let t=this._items[0];return t===""||t==='""'}get str(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce((i,o)=>`${i}${o}`,"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce((i,o)=>{if(o instanceof jt)i[o.str]=(i[o.str]||0)+1;return i},{})}}dr._Code=C;dr.nil=new C("");function br(t,...i){let o=[t[0]],r=0;while(r<i.length)to(o,i[r]),o.push(t[++r]);return new C(o)}dr._=br;var _i=new C("+");function yr(t,...i){let o=[Kt(t[0])],r=0;while(r<i.length)o.push(_i),to(o,i[r]),o.push(_i,Kt(t[++r]));return ne(o),new C(o)}dr.str=yr;function to(t,i){if(i instanceof C)t.push(...i._items);else if(i instanceof jt)t.push(i);else t.push(ee(i))}dr.addCodeArg=to;function ne(t){let i=1;while(i<t.length-1){if(t[i]===_i){let o=$e(t[i-1],t[i+1]);if(o!==void 0){t.splice(i-1,3,o);continue}t[i++]="+"}i++}}function $e(t,i){if(i==='""')return t;if(t==='""')return i;if(typeof t=="string"){if(i instanceof jt||t[t.length-1]!=='"')return;if(typeof i!="string")return`${t.slice(0,-1)}${i}"`;if(i[0]==='"')return t.slice(0,-1)+i.slice(1);return}if(typeof i=="string"&&i[0]==='"'&&!(t instanceof jt))return`"${t}${i.slice(1)}`;return}function se(t,i){return i.emptyStr()?t:t.emptyStr()?i:yr`${t}${i}`}dr.strConcat=se;function ee(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Kt(Array.isArray(t)?t.join(","):t)}function ue(t){return new C(Kt(t))}dr.stringify=ue;function Kt(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}dr.safeStringify=Kt;function be(t){return typeof t=="string"&&dr.IDENTIFIER.test(t)?new C(`.${t}`):br`[${t}]`}dr.getProperty=be;function ye(t){if(typeof t=="string"&&dr.IDENTIFIER.test(t))return new C(`${t}`);throw Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}dr.getEsmExportName=ye;function de(t){return new C(t.toString())}dr.regexpCode=de});var lo=c((Mr)=>{Object.defineProperty(Mr,"__esModule",{value:!0});Mr.ValueScope=Mr.ValueScopeName=Mr.Scope=Mr.varKinds=Mr.UsedValueState=void 0;var P=Ut();class cr extends Error{constructor(t){super(`CodeGen: "code" for ${t} not defined`);this.value=t.value}}var bi;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(bi||(Mr.UsedValueState=bi={}));Mr.varKinds={const:new P.Name("const"),let:new P.Name("let"),var:new P.Name("var")};class oo{constructor({prefixes:t,parent:i}={}){this._names={},this._prefixes=t,this._parent=i}toName(t){return t instanceof P.Name?t:this.name(t)}name(t){return new P.Name(this._newName(t))}_newName(t){let i=this._names[t]||this._nameGroup(t);return`${t}${i.index++}`}_nameGroup(t){var i,o;if(((o=(i=this._parent)===null||i===void 0?void 0:i._prefixes)===null||o===void 0?void 0:o.has(t))||this._prefixes&&!this._prefixes.has(t))throw Error(`CodeGen: prefix "${t}" is not allowed in this scope`);return this._names[t]={prefix:t,index:0}}}Mr.Scope=oo;class ro extends P.Name{constructor(t,i){super(i);this.prefix=t}setValue(t,{property:i,itemIndex:o}){this.value=t,this.scopePath=P._`.${new P.Name(i)}[${o}]`}}Mr.ValueScopeName=ro;var Fe=P._`\n`;class pr extends oo{constructor(t){super(t);this._values={},this._scope=t.scope,this.opts={...t,_n:t.lines?Fe:P.nil}}get(){return this._scope}name(t){return new ro(t,this._newName(t))}value(t,i){var o;if(i.ref===void 0)throw Error("CodeGen: ref must be passed in value");let r=this.toName(t),{prefix:l}=r,f=(o=i.key)!==null&&o!==void 0?o:i.ref,n=this._values[l];if(n){let e=n.get(f);if(e)return e}else n=this._values[l]=new Map;n.set(f,r);let $=this._scope[l]||(this._scope[l]=[]),s=$.length;return $[s]=i.ref,r.setValue(i,{property:l,itemIndex:s}),r}getValue(t,i){let o=this._values[t];if(!o)return;return o.get(i)}scopeRefs(t,i=this._values){return this._reduceValues(i,(o)=>{if(o.scopePath===void 0)throw Error(`CodeGen: name "${o}" has no value`);return P._`${t}${o.scopePath}`})}scopeCode(t=this._values,i,o){return this._reduceValues(t,(r)=>{if(r.value===void 0)throw Error(`CodeGen: name "${r}" has no value`);return r.value.code},i,o)}_reduceValues(t,i,o={},r){let l=P.nil;for(let f in t){let n=t[f];if(!n)continue;let $=o[f]=o[f]||new Map;n.forEach((s)=>{if($.has(s))return;$.set(s,bi.Started);let e=i(s);if(e){let u=this.opts.es5?Mr.varKinds.var:Mr.varKinds.const;l=P._`${l}${u} ${s} = ${e};${this.opts._n}`}else if(e=r===null||r===void 0?void 0:r(s))l=P._`${l}${e}${this.opts._n}`;else throw new cr(s);$.set(s,bi.Completed)})}return l}}Mr.ValueScope=pr});var w=c((K)=>{Object.defineProperty(K,"__esModule",{value:!0});K.or=K.and=K.not=K.CodeGen=K.operators=K.varKinds=K.ValueScopeName=K.ValueScope=K.Scope=K.Name=K.regexpCode=K.stringify=K.getProperty=K.nil=K.strConcat=K.str=K._=void 0;var F=Ut(),h=lo(),$t=Ut();Object.defineProperty(K,"_",{enumerable:!0,get:function(){return $t._}});Object.defineProperty(K,"str",{enumerable:!0,get:function(){return $t.str}});Object.defineProperty(K,"strConcat",{enumerable:!0,get:function(){return $t.strConcat}});Object.defineProperty(K,"nil",{enumerable:!0,get:function(){return $t.nil}});Object.defineProperty(K,"getProperty",{enumerable:!0,get:function(){return $t.getProperty}});Object.defineProperty(K,"stringify",{enumerable:!0,get:function(){return $t.stringify}});Object.defineProperty(K,"regexpCode",{enumerable:!0,get:function(){return $t.regexpCode}});Object.defineProperty(K,"Name",{enumerable:!0,get:function(){return $t.Name}});var Mi=lo();Object.defineProperty(K,"Scope",{enumerable:!0,get:function(){return Mi.Scope}});Object.defineProperty(K,"ValueScope",{enumerable:!0,get:function(){return Mi.ValueScope}});Object.defineProperty(K,"ValueScopeName",{enumerable:!0,get:function(){return Mi.ValueScopeName}});Object.defineProperty(K,"varKinds",{enumerable:!0,get:function(){return Mi.varKinds}});K.operators={GT:new F._Code(">"),GTE:new F._Code(">="),LT:new F._Code("<"),LTE:new F._Code("<="),EQ:new F._Code("==="),NEQ:new F._Code("!=="),NOT:new F._Code("!"),OR:new F._Code("||"),AND:new F._Code("&&"),ADD:new F._Code("+")};class st{optimizeNodes(){return this}optimizeNames(t,i){return this}}class Lr extends st{constructor(t,i,o){super();this.varKind=t,this.name=i,this.rhs=o}render({es5:t,_n:i}){let o=t?h.varKinds.var:this.varKind,r=this.rhs===void 0?"":` = ${this.rhs}`;return`${o} ${this.name}${r};`+i}optimizeNames(t,i){if(!t[this.name.str])return;if(this.rhs)this.rhs=Zt(this.rhs,t,i);return this}get names(){return this.rhs instanceof F._CodeOrName?this.rhs.names:{}}}class $o extends st{constructor(t,i,o){super();this.lhs=t,this.rhs=i,this.sideEffects=o}render({_n:t}){return`${this.lhs} = ${this.rhs};`+t}optimizeNames(t,i){if(this.lhs instanceof F.Name&&!t[this.lhs.str]&&!this.sideEffects)return;return this.rhs=Zt(this.rhs,t,i),this}get names(){let t=this.lhs instanceof F.Name?{}:{...this.lhs.names};return pi(t,this.rhs)}}class Or extends $o{constructor(t,i,o,r){super(t,o,r);this.op=i}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}}class Tr extends st{constructor(t){super();this.label=t,this.names={}}render({_n:t}){return`${this.label}:`+t}}class wr extends st{constructor(t){super();this.label=t,this.names={}}render({_n:t}){return`break${this.label?` ${this.label}`:""};`+t}}class Wr extends st{constructor(t){super();this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}}class qr extends st{constructor(t){super();this.code=t}render({_n:t}){return`${this.code};`+t}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(t,i){return this.code=Zt(this.code,t,i),this}get names(){return this.code instanceof F._CodeOrName?this.code.names:{}}}class Vi extends st{constructor(t=[]){super();this.nodes=t}render(t){return this.nodes.reduce((i,o)=>i+o.render(t),"")}optimizeNodes(){let{nodes:t}=this,i=t.length;while(i--){let o=t[i].optimizeNodes();if(Array.isArray(o))t.splice(i,1,...o);else if(o)t[i]=o;else t.splice(i,1)}return t.length>0?this:void 0}optimizeNames(t,i){let{nodes:o}=this,r=o.length;while(r--){let l=o[r];if(l.optimizeNames(t,i))continue;Ae(t,l.names),o.splice(r,1)}return o.length>0?this:void 0}get names(){return this.nodes.reduce((t,i)=>pt(t,i.names),{})}}class et extends Vi{render(t){return"{"+t._n+super.render(t)+"}"+t._n}}class jr extends Vi{}class Nt extends et{}Nt.kind="else";class lt extends et{constructor(t,i){super(i);this.condition=t}render(t){let i=`if(${this.condition})`+super.render(t);if(this.else)i+="else "+this.else.render(t);return i}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let i=this.else;if(i){let o=i.optimizeNodes();i=this.else=Array.isArray(o)?new Nt(o):o}if(i){if(t===!1)return i instanceof lt?i:i.nodes;if(this.nodes.length)return this;return new lt(Ar(t),i instanceof lt?[i]:i.nodes)}if(t===!1||!this.nodes.length)return;return this}optimizeNames(t,i){var o;if(this.else=(o=this.else)===null||o===void 0?void 0:o.optimizeNames(t,i),!(super.optimizeNames(t,i)||this.else))return;return this.condition=Zt(this.condition,t,i),this}get names(){let t=super.names;if(pi(t,this.condition),this.else)pt(t,this.else.names);return t}}lt.kind="if";class Ft extends et{}Ft.kind="for";class Fr extends Ft{constructor(t){super();this.iteration=t}render(t){return`for(${this.iteration})`+super.render(t)}optimizeNames(t,i){if(!super.optimizeNames(t,i))return;return this.iteration=Zt(this.iteration,t,i),this}get names(){return pt(super.names,this.iteration.names)}}class Zr extends Ft{constructor(t,i,o,r){super();this.varKind=t,this.name=i,this.from=o,this.to=r}render(t){let i=t.es5?h.varKinds.var:this.varKind,{name:o,from:r,to:l}=this;return`for(${i} ${o}=${r}; ${o}<${l}; ${o}++)`+super.render(t)}get names(){let t=pi(super.names,this.from);return pi(t,this.to)}}class fo extends Ft{constructor(t,i,o,r){super();this.loop=t,this.varKind=i,this.name=o,this.iterable=r}render(t){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(t)}optimizeNames(t,i){if(!super.optimizeNames(t,i))return;return this.iterable=Zt(this.iterable,t,i),this}get names(){return pt(super.names,this.iterable.names)}}class yi extends et{constructor(t,i,o){super();this.name=t,this.args=i,this.async=o}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}}yi.kind="func";class di extends Vi{render(t){return"return "+super.render(t)}}di.kind="return";class Br extends et{render(t){let i="try"+super.render(t);if(this.catch)i+=this.catch.render(t);if(this.finally)i+=this.finally.render(t);return i}optimizeNodes(){var t,i;return super.optimizeNodes(),(t=this.catch)===null||t===void 0||t.optimizeNodes(),(i=this.finally)===null||i===void 0||i.optimizeNodes(),this}optimizeNames(t,i){var o,r;return super.optimizeNames(t,i),(o=this.catch)===null||o===void 0||o.optimizeNames(t,i),(r=this.finally)===null||r===void 0||r.optimizeNames(t,i),this}get names(){let t=super.names;if(this.catch)pt(t,this.catch.names);if(this.finally)pt(t,this.finally.names);return t}}class Ii extends et{constructor(t){super();this.error=t}render(t){return`catch(${this.error})`+super.render(t)}}Ii.kind="catch";class ci extends et{render(t){return"finally"+super.render(t)}}ci.kind="finally";class Jr{constructor(t,i={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...i,_n:i.lines?`
4
+ `:""},this._extScope=t,this._scope=new h.Scope({parent:t}),this._nodes=[new jr]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,i){let o=this._extScope.value(t,i);return(this._values[o.prefix]||(this._values[o.prefix]=new Set)).add(o),o}getScopeValue(t,i){return this._extScope.getValue(t,i)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,i,o,r){let l=this._scope.toName(i);if(o!==void 0&&r)this._constants[l.str]=o;return this._leafNode(new Lr(t,l,o)),l}const(t,i,o){return this._def(h.varKinds.const,t,i,o)}let(t,i,o){return this._def(h.varKinds.let,t,i,o)}var(t,i,o){return this._def(h.varKinds.var,t,i,o)}assign(t,i,o){return this._leafNode(new $o(t,i,o))}add(t,i){return this._leafNode(new Or(t,K.operators.ADD,i))}code(t){if(typeof t=="function")t();else if(t!==F.nil)this._leafNode(new qr(t));return this}object(...t){let i=["{"];for(let[o,r]of t){if(i.length>1)i.push(",");if(i.push(o),o!==r||this.opts.es5)i.push(":"),(0,F.addCodeArg)(i,r)}return i.push("}"),new F._Code(i)}if(t,i,o){if(this._blockNode(new lt(t)),i&&o)this.code(i).else().code(o).endIf();else if(i)this.code(i).endIf();else if(o)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(t){return this._elseNode(new lt(t))}else(){return this._elseNode(new Nt)}endIf(){return this._endBlockNode(lt,Nt)}_for(t,i){if(this._blockNode(t),i)this.code(i).endFor();return this}for(t,i){return this._for(new Fr(t),i)}forRange(t,i,o,r,l=this.opts.es5?h.varKinds.var:h.varKinds.let){let f=this._scope.toName(t);return this._for(new Zr(l,f,i,o),()=>r(f))}forOf(t,i,o,r=h.varKinds.const){let l=this._scope.toName(t);if(this.opts.es5){let f=i instanceof F.Name?i:this.var("_arr",i);return this.forRange("_i",0,F._`${f}.length`,(n)=>{this.var(l,F._`${f}[${n}]`),o(l)})}return this._for(new fo("of",r,l,i),()=>o(l))}forIn(t,i,o,r=this.opts.es5?h.varKinds.var:h.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,F._`Object.keys(${i})`,o);let l=this._scope.toName(t);return this._for(new fo("in",r,l,i),()=>o(l))}endFor(){return this._endBlockNode(Ft)}label(t){return this._leafNode(new Tr(t))}break(t){return this._leafNode(new wr(t))}return(t){let i=new di;if(this._blockNode(i),this.code(t),i.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(di)}try(t,i,o){if(!i&&!o)throw Error('CodeGen: "try" without "catch" and "finally"');let r=new Br;if(this._blockNode(r),this.code(t),i){let l=this.name("e");this._currNode=r.catch=new Ii(l),i(l)}if(o)this._currNode=r.finally=new ci,this.code(o);return this._endBlockNode(Ii,ci)}throw(t){return this._leafNode(new Wr(t))}block(t,i){if(this._blockStarts.push(this._nodes.length),t)this.code(t).endBlock(i);return this}endBlock(t){let i=this._blockStarts.pop();if(i===void 0)throw Error("CodeGen: not in self-balancing block");let o=this._nodes.length-i;if(o<0||t!==void 0&&o!==t)throw Error(`CodeGen: wrong number of nodes: ${o} vs ${t} expected`);return this._nodes.length=i,this}func(t,i=F.nil,o,r){if(this._blockNode(new yi(t,i,o)),r)this.code(r).endFunc();return this}endFunc(){return this._endBlockNode(yi)}optimize(t=1){while(t-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(t){return this._currNode.nodes.push(t),this}_blockNode(t){this._currNode.nodes.push(t),this._nodes.push(t)}_endBlockNode(t,i){let o=this._currNode;if(o instanceof t||i&&o instanceof i)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${i?`${t.kind}/${i.kind}`:t.kind}"`)}_elseNode(t){let i=this._currNode;if(!(i instanceof lt))throw Error('CodeGen: "else" without "if"');return this._currNode=i.else=t,this}get _root(){return this._nodes[0]}get _currNode(){let t=this._nodes;return t[t.length-1]}set _currNode(t){let i=this._nodes;i[i.length-1]=t}}K.CodeGen=Jr;function pt(t,i){for(let o in i)t[o]=(t[o]||0)+(i[o]||0);return t}function pi(t,i){return i instanceof F._CodeOrName?pt(t,i.names):t}function Zt(t,i,o){if(t instanceof F.Name)return r(t);if(!l(t))return t;return new F._Code(t._items.reduce((f,n)=>{if(n instanceof F.Name)n=r(n);if(n instanceof F._Code)f.push(...n._items);else f.push(n);return f},[]));function r(f){let n=o[f.str];if(n===void 0||i[f.str]!==1)return f;return delete i[f.str],n}function l(f){return f instanceof F._Code&&f._items.some((n)=>n instanceof F.Name&&i[n.str]===1&&o[n.str]!==void 0)}}function Ae(t,i){for(let o in i)t[o]=(t[o]||0)-(i[o]||0)}function Ar(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:F._`!${no(t)}`}K.not=Ar;var Xe=Xr(K.operators.AND);function Ye(...t){return t.reduce(Xe)}K.and=Ye;var ze=Xr(K.operators.OR);function Qe(...t){return t.reduce(ze)}K.or=Qe;function Xr(t){return(i,o)=>i===F.nil?o:o===F.nil?i:F._`${no(i)} ${t} ${no(o)}`}function no(t){return t instanceof F.Name?t:F._`(${t})`}});var q=c((Kr)=>{Object.defineProperty(Kr,"__esModule",{value:!0});Kr.checkStrictMode=Kr.getErrorPath=Kr.Type=Kr.useFunc=Kr.setEvaluated=Kr.evaluatedPropsToName=Kr.mergeEvaluated=Kr.eachItem=Kr.unescapeJsonPointer=Kr.escapeJsonPointer=Kr.escapeFragment=Kr.unescapeFragment=Kr.schemaRefOrVal=Kr.schemaHasRulesButRef=Kr.schemaHasRules=Kr.checkUnknownRules=Kr.alwaysValidSchema=Kr.toHash=void 0;var J=w(),De=Ut();function Pe(t){let i={};for(let o of t)i[o]=!0;return i}Kr.toHash=Pe;function Ke(t,i){if(typeof i=="boolean")return i;if(Object.keys(i).length===0)return!0;return Gr(t,i),!vr(i,t.self.RULES.all)}Kr.alwaysValidSchema=Ke;function Gr(t,i=t.schema){let{opts:o,self:r}=t;if(!o.strictSchema)return;if(typeof i==="boolean")return;let l=r.RULES.keywords;for(let f in i)if(!l[f])Pr(t,`unknown keyword: "${f}"`)}Kr.checkUnknownRules=Gr;function vr(t,i){if(typeof t=="boolean")return!t;for(let o in t)if(i[o])return!0;return!1}Kr.schemaHasRules=vr;function Ue(t,i){if(typeof t=="boolean")return!t;for(let o in t)if(o!=="$ref"&&i.all[o])return!0;return!1}Kr.schemaHasRulesButRef=Ue;function Ne({topSchemaRef:t,schemaPath:i},o,r,l){if(!l){if(typeof o=="number"||typeof o=="boolean")return o;if(typeof o=="string")return J._`${o}`}return J._`${t}${i}${(0,J.getProperty)(r)}`}Kr.schemaRefOrVal=Ne;function Ee(t){return Hr(decodeURIComponent(t))}Kr.unescapeFragment=Ee;function Re(t){return encodeURIComponent(eo(t))}Kr.escapeFragment=Re;function eo(t){if(typeof t=="number")return`${t}`;return t.replace(/~/g,"~0").replace(/\//g,"~1")}Kr.escapeJsonPointer=eo;function Hr(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}Kr.unescapeJsonPointer=Hr;function Se(t,i){if(Array.isArray(t))for(let o of t)i(o);else i(t)}Kr.eachItem=Se;function zr({mergeNames:t,mergeToName:i,mergeValues:o,resultToName:r}){return(l,f,n,$)=>{let s=n===void 0?f:n instanceof J.Name?(f instanceof J.Name?t(l,f,n):i(l,f,n),n):f instanceof J.Name?(i(l,n,f),f):o(f,n);return $===J.Name&&!(s instanceof J.Name)?r(l,s):s}}Kr.mergeEvaluated={props:zr({mergeNames:(t,i,o)=>t.if(J._`${o} !== true && ${i} !== undefined`,()=>{t.if(J._`${i} === true`,()=>t.assign(o,!0),()=>t.assign(o,J._`${o} || {}`).code(J._`Object.assign(${o}, ${i})`))}),mergeToName:(t,i,o)=>t.if(J._`${o} !== true`,()=>{if(i===!0)t.assign(o,!0);else t.assign(o,J._`${o} || {}`),uo(t,o,i)}),mergeValues:(t,i)=>t===!0?!0:{...t,...i},resultToName:Dr}),items:zr({mergeNames:(t,i,o)=>t.if(J._`${o} !== true && ${i} !== undefined`,()=>t.assign(o,J._`${i} === true ? true : ${o} > ${i} ? ${o} : ${i}`)),mergeToName:(t,i,o)=>t.if(J._`${o} !== true`,()=>t.assign(o,i===!0?!0:J._`${o} > ${i} ? ${o} : ${i}`)),mergeValues:(t,i)=>t===!0?!0:Math.max(t,i),resultToName:(t,i)=>t.var("items",i)})};function Dr(t,i){if(i===!0)return t.var("props",!0);let o=t.var("props",J._`{}`);if(i!==void 0)uo(t,o,i);return o}Kr.evaluatedPropsToName=Dr;function uo(t,i,o){Object.keys(o).forEach((r)=>t.assign(J._`${i}${(0,J.getProperty)(r)}`,!0))}Kr.setEvaluated=uo;var Qr={};function ke(t,i){return t.scopeValue("func",{ref:i,code:Qr[i.code]||(Qr[i.code]=new De._Code(i.code))})}Kr.useFunc=ke;var so;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(so||(Kr.Type=so={}));function Ce(t,i,o){if(t instanceof J.Name){let r=i===so.Num;return o?r?J._`"[" + ${t} + "]"`:J._`"['" + ${t} + "']"`:r?J._`"/" + ${t}`:J._`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return o?(0,J.getProperty)(t).toString():"/"+eo(t)}Kr.getErrorPath=Ce;function Pr(t,i,o=t.opts.strictSchema){if(!o)return;if(i=`strict mode: ${i}`,o===!0)throw Error(i);t.self.logger.warn(i)}Kr.checkStrictMode=Pr});var E=c((Nr)=>{Object.defineProperty(Nr,"__esModule",{value:!0});var G=w(),bu={data:new G.Name("data"),valCxt:new G.Name("valCxt"),instancePath:new G.Name("instancePath"),parentData:new G.Name("parentData"),parentDataProperty:new G.Name("parentDataProperty"),rootData:new G.Name("rootData"),dynamicAnchors:new G.Name("dynamicAnchors"),vErrors:new G.Name("vErrors"),errors:new G.Name("errors"),this:new G.Name("this"),self:new G.Name("self"),scope:new G.Name("scope"),json:new G.Name("json"),jsonPos:new G.Name("jsonPos"),jsonLen:new G.Name("jsonLen"),jsonPart:new G.Name("jsonPart")};Nr.default=bu});var Et=c((kr)=>{Object.defineProperty(kr,"__esModule",{value:!0});kr.extendErrors=kr.resetErrorsCount=kr.reportExtraError=kr.reportError=kr.keyword$DataError=kr.keywordError=void 0;var B=w(),Oi=q(),v=E();kr.keywordError={message:({keyword:t})=>B.str`must pass "${t}" keyword validation`};kr.keyword$DataError={message:({keyword:t,schemaType:i})=>i?B.str`"${t}" keyword must be ${i} ($data)`:B.str`"${t}" keyword is invalid ($data)`};function du(t,i=kr.keywordError,o,r){let{it:l}=t,{gen:f,compositeRule:n,allErrors:$}=l,s=Sr(t,i,o);if(r!==null&&r!==void 0?r:n||$)Er(f,s);else Rr(l,B._`[${s}]`)}kr.reportError=du;function Iu(t,i=kr.keywordError,o){let{it:r}=t,{gen:l,compositeRule:f,allErrors:n}=r,$=Sr(t,i,o);if(Er(l,$),!(f||n))Rr(r,v.default.vErrors)}kr.reportExtraError=Iu;function cu(t,i){t.assign(v.default.errors,i),t.if(B._`${v.default.vErrors} !== null`,()=>t.if(i,()=>t.assign(B._`${v.default.vErrors}.length`,i),()=>t.assign(v.default.vErrors,null)))}kr.resetErrorsCount=cu;function pu({gen:t,keyword:i,schemaValue:o,data:r,errsCount:l,it:f}){if(l===void 0)throw Error("ajv implementation error");let n=t.name("err");t.forRange("i",l,v.default.errors,($)=>{if(t.const(n,B._`${v.default.vErrors}[${$}]`),t.if(B._`${n}.instancePath === undefined`,()=>t.assign(B._`${n}.instancePath`,(0,B.strConcat)(v.default.instancePath,f.errorPath))),t.assign(B._`${n}.schemaPath`,B.str`${f.errSchemaPath}/${i}`),f.opts.verbose)t.assign(B._`${n}.schema`,o),t.assign(B._`${n}.data`,r)})}kr.extendErrors=pu;function Er(t,i){let o=t.const("err",i);t.if(B._`${v.default.vErrors} === null`,()=>t.assign(v.default.vErrors,B._`[${o}]`),B._`${v.default.vErrors}.push(${o})`),t.code(B._`${v.default.errors}++`)}function Rr(t,i){let{gen:o,validateName:r,schemaEnv:l}=t;if(l.$async)o.throw(B._`new ${t.ValidationError}(${i})`);else o.assign(B._`${r}.errors`,i),o.return(!1)}var Mt={keyword:new B.Name("keyword"),schemaPath:new B.Name("schemaPath"),params:new B.Name("params"),propertyName:new B.Name("propertyName"),message:new B.Name("message"),schema:new B.Name("schema"),parentSchema:new B.Name("parentSchema")};function Sr(t,i,o){let{createErrors:r}=t.it;if(r===!1)return B._`{}`;return Mu(t,i,o)}function Mu(t,i,o={}){let{gen:r,it:l}=t,f=[Vu(l,o),Lu(t,o)];return Ou(t,i,f),r.object(...f)}function Vu({errorPath:t},{instancePath:i}){let o=i?B.str`${t}${(0,Oi.getErrorPath)(i,Oi.Type.Str)}`:t;return[v.default.instancePath,(0,B.strConcat)(v.default.instancePath,o)]}function Lu({keyword:t,it:{errSchemaPath:i}},{schemaPath:o,parentSchema:r}){let l=r?i:B.str`${i}/${t}`;if(o)l=B.str`${l}${(0,Oi.getErrorPath)(o,Oi.Type.Str)}`;return[Mt.schemaPath,l]}function Ou(t,{params:i,message:o},r){let{keyword:l,data:f,schemaValue:n,it:$}=t,{opts:s,propertyName:e,topSchemaRef:u,schemaPath:b}=$;if(r.push([Mt.keyword,l],[Mt.params,typeof i=="function"?i(t):i||B._`{}`]),s.messages)r.push([Mt.message,typeof o=="function"?o(t):o]);if(s.verbose)r.push([Mt.schema,n],[Mt.parentSchema,B._`${u}${b}`],[v.default.data,f]);if(e)r.push([Mt.propertyName,e])}});var mr=c((gr)=>{Object.defineProperty(gr,"__esModule",{value:!0});gr.boolOrEmptySchema=gr.topBoolOrEmptySchema=void 0;var ju=Et(),Fu=w(),Zu=E(),Bu={message:"boolean schema is false"};function Ju(t){let{gen:i,schema:o,validateName:r}=t;if(o===!1)hr(t,!1);else if(typeof o=="object"&&o.$async===!0)i.return(Zu.default.data);else i.assign(Fu._`${r}.errors`,null),i.return(!0)}gr.topBoolOrEmptySchema=Ju;function Au(t,i){let{gen:o,schema:r}=t;if(r===!1)o.var(i,!1),hr(t);else o.var(i,!0)}gr.boolOrEmptySchema=Au;function hr(t,i){let{gen:o,data:r}=t,l={gen:o,keyword:"false schema",data:r,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,ju.reportError)(l,Bu,void 0,i)}});var yo=c((xr)=>{Object.defineProperty(xr,"__esModule",{value:!0});xr.getRules=xr.isJSONType=void 0;var Yu=["string","number","integer","boolean","null","object","array"],zu=new Set(Yu);function Qu(t){return typeof t=="string"&&zu.has(t)}xr.isJSONType=Qu;function Gu(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}xr.getRules=Gu});var Io=c((ol)=>{Object.defineProperty(ol,"__esModule",{value:!0});ol.shouldUseRule=ol.shouldUseGroup=ol.schemaHasRulesForType=void 0;function Hu({schema:t,self:i},o){let r=i.RULES.types[o];return r&&r!==!0&&tl(t,r)}ol.schemaHasRulesForType=Hu;function tl(t,i){return i.rules.some((o)=>il(t,o))}ol.shouldUseGroup=tl;function il(t,i){var o;return t[i.keyword]!==void 0||((o=i.definition.implements)===null||o===void 0?void 0:o.some((r)=>t[r]!==void 0))}ol.shouldUseRule=il});var Rt=c(($l)=>{Object.defineProperty($l,"__esModule",{value:!0});$l.reportTypeError=$l.checkDataTypes=$l.checkDataType=$l.coerceAndCheckDataType=$l.getJSONTypes=$l.getSchemaTypes=$l.DataType=void 0;var Ku=yo(),Uu=Io(),Nu=Et(),W=w(),ll=q(),Bt;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(Bt||($l.DataType=Bt={}));function Eu(t){let i=fl(t.type);if(i.includes("null")){if(t.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!i.length&&t.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(t.nullable===!0)i.push("null")}return i}$l.getSchemaTypes=Eu;function fl(t){let i=Array.isArray(t)?t:t?[t]:[];if(i.every(Ku.isJSONType))return i;throw Error("type must be JSONType or JSONType[]: "+i.join(","))}$l.getJSONTypes=fl;function Ru(t,i){let{gen:o,data:r,opts:l}=t,f=Su(i,l.coerceTypes),n=i.length>0&&!(f.length===0&&i.length===1&&(0,Uu.schemaHasRulesForType)(t,i[0]));if(n){let $=po(i,r,l.strictNumbers,Bt.Wrong);o.if($,()=>{if(f.length)ku(t,i,f);else Mo(t)})}return n}$l.coerceAndCheckDataType=Ru;var nl=new Set(["string","number","integer","boolean","null"]);function Su(t,i){return i?t.filter((o)=>nl.has(o)||i==="array"&&o==="array"):[]}function ku(t,i,o){let{gen:r,data:l,opts:f}=t,n=r.let("dataType",W._`typeof ${l}`),$=r.let("coerced",W._`undefined`);if(f.coerceTypes==="array")r.if(W._`${n} == 'object' && Array.isArray(${l}) && ${l}.length == 1`,()=>r.assign(l,W._`${l}[0]`).assign(n,W._`typeof ${l}`).if(po(i,l,f.strictNumbers),()=>r.assign($,l)));r.if(W._`${$} !== undefined`);for(let e of o)if(nl.has(e)||e==="array"&&f.coerceTypes==="array")s(e);r.else(),Mo(t),r.endIf(),r.if(W._`${$} !== undefined`,()=>{r.assign(l,$),Cu(t,$)});function s(e){switch(e){case"string":r.elseIf(W._`${n} == "number" || ${n} == "boolean"`).assign($,W._`"" + ${l}`).elseIf(W._`${l} === null`).assign($,W._`""`);return;case"number":r.elseIf(W._`${n} == "boolean" || ${l} === null
5
+ || (${n} == "string" && ${l} && ${l} == +${l})`).assign($,W._`+${l}`);return;case"integer":r.elseIf(W._`${n} === "boolean" || ${l} === null
6
+ || (${n} === "string" && ${l} && ${l} == +${l} && !(${l} % 1))`).assign($,W._`+${l}`);return;case"boolean":r.elseIf(W._`${l} === "false" || ${l} === 0 || ${l} === null`).assign($,!1).elseIf(W._`${l} === "true" || ${l} === 1`).assign($,!0);return;case"null":r.elseIf(W._`${l} === "" || ${l} === 0 || ${l} === false`),r.assign($,null);return;case"array":r.elseIf(W._`${n} === "string" || ${n} === "number"
7
+ || ${n} === "boolean" || ${l} === null`).assign($,W._`[${l}]`)}}}function Cu({gen:t,parentData:i,parentDataProperty:o},r){t.if(W._`${i} !== undefined`,()=>t.assign(W._`${i}[${o}]`,r))}function co(t,i,o,r=Bt.Correct){let l=r===Bt.Correct?W.operators.EQ:W.operators.NEQ,f;switch(t){case"null":return W._`${i} ${l} null`;case"array":f=W._`Array.isArray(${i})`;break;case"object":f=W._`${i} && typeof ${i} == "object" && !Array.isArray(${i})`;break;case"integer":f=n(W._`!(${i} % 1) && !isNaN(${i})`);break;case"number":f=n();break;default:return W._`typeof ${i} ${l} ${t}`}return r===Bt.Correct?f:(0,W.not)(f);function n($=W.nil){return(0,W.and)(W._`typeof ${i} == "number"`,$,o?W._`isFinite(${i})`:W.nil)}}$l.checkDataType=co;function po(t,i,o,r){if(t.length===1)return co(t[0],i,o,r);let l,f=(0,ll.toHash)(t);if(f.array&&f.object){let n=W._`typeof ${i} != "object"`;l=f.null?n:W._`!${i} || ${n}`,delete f.null,delete f.array,delete f.object}else l=W.nil;if(f.number)delete f.integer;for(let n in f)l=(0,W.and)(l,co(n,i,o,r));return l}$l.checkDataTypes=po;var hu={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:i})=>typeof t=="string"?W._`{type: ${t}}`:W._`{type: ${i}}`};function Mo(t){let i=gu(t);(0,Nu.reportError)(i,hu)}$l.reportTypeError=Mo;function gu(t){let{gen:i,data:o,schema:r}=t,l=(0,ll.schemaRefOrVal)(t,r,"type");return{gen:i,keyword:"type",data:o,schema:r.type,schemaCode:l,schemaValue:l,parentSchema:r,params:{},it:t}}});var yl=c((ul)=>{Object.defineProperty(ul,"__esModule",{value:!0});ul.assignDefaults=void 0;var Jt=w(),ob=q();function rb(t,i){let{properties:o,items:r}=t.schema;if(i==="object"&&o)for(let l in o)el(t,l,o[l].default);else if(i==="array"&&Array.isArray(r))r.forEach((l,f)=>el(t,f,l.default))}ul.assignDefaults=rb;function el(t,i,o){let{gen:r,compositeRule:l,data:f,opts:n}=t;if(o===void 0)return;let $=Jt._`${f}${(0,Jt.getProperty)(i)}`;if(l){(0,ob.checkStrictMode)(t,`default is ignored for: ${$}`);return}let s=Jt._`${$} === undefined`;if(n.useDefaults==="empty")s=Jt._`${s} || ${$} === null || ${$} === ""`;r.if(s,Jt._`${$} = ${(0,Jt.stringify)(o)}`)}});var R=c((cl)=>{Object.defineProperty(cl,"__esModule",{value:!0});cl.validateUnion=cl.validateArray=cl.usePattern=cl.callValidateCode=cl.schemaProperties=cl.allSchemaProperties=cl.noPropertyInData=cl.propertyInData=cl.isOwnProperty=cl.hasPropFunc=cl.reportMissingProp=cl.checkMissingProp=cl.checkReportMissingProp=void 0;var X=w(),Vo=q(),ut=E(),lb=q();function fb(t,i){let{gen:o,data:r,it:l}=t;o.if(Oo(o,r,i,l.opts.ownProperties),()=>{t.setParams({missingProperty:X._`${i}`},!0),t.error()})}cl.checkReportMissingProp=fb;function nb({gen:t,data:i,it:{opts:o}},r,l){return(0,X.or)(...r.map((f)=>(0,X.and)(Oo(t,i,f,o.ownProperties),X._`${l} = ${f}`)))}cl.checkMissingProp=nb;function $b(t,i){t.setParams({missingProperty:i},!0),t.error()}cl.reportMissingProp=$b;function dl(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:X._`Object.prototype.hasOwnProperty`})}cl.hasPropFunc=dl;function Lo(t,i,o){return X._`${dl(t)}.call(${i}, ${o})`}cl.isOwnProperty=Lo;function sb(t,i,o,r){let l=X._`${i}${(0,X.getProperty)(o)} !== undefined`;return r?X._`${l} && ${Lo(t,i,o)}`:l}cl.propertyInData=sb;function Oo(t,i,o,r){let l=X._`${i}${(0,X.getProperty)(o)} === undefined`;return r?(0,X.or)(l,(0,X.not)(Lo(t,i,o))):l}cl.noPropertyInData=Oo;function Il(t){return t?Object.keys(t).filter((i)=>i!=="__proto__"):[]}cl.allSchemaProperties=Il;function eb(t,i){return Il(i).filter((o)=>!(0,Vo.alwaysValidSchema)(t,i[o]))}cl.schemaProperties=eb;function ub({schemaCode:t,data:i,it:{gen:o,topSchemaRef:r,schemaPath:l,errorPath:f},it:n},$,s,e){let u=e?X._`${t}, ${i}, ${r}${l}`:i,b=[[ut.default.instancePath,(0,X.strConcat)(ut.default.instancePath,f)],[ut.default.parentData,n.parentData],[ut.default.parentDataProperty,n.parentDataProperty],[ut.default.rootData,ut.default.rootData]];if(n.opts.dynamicRef)b.push([ut.default.dynamicAnchors,ut.default.dynamicAnchors]);let I=X._`${u}, ${o.object(...b)}`;return s!==X.nil?X._`${$}.call(${s}, ${I})`:X._`${$}(${I})`}cl.callValidateCode=ub;var bb=X._`new RegExp`;function yb({gen:t,it:{opts:i}},o){let r=i.unicodeRegExp?"u":"",{regExp:l}=i.code,f=l(o,r);return t.scopeValue("pattern",{key:f.toString(),ref:f,code:X._`${l.code==="new RegExp"?bb:(0,lb.useFunc)(t,l)}(${o}, ${r})`})}cl.usePattern=yb;function db(t){let{gen:i,data:o,keyword:r,it:l}=t,f=i.name("valid");if(l.allErrors){let $=i.let("valid",!0);return n(()=>i.assign($,!1)),$}return i.var(f,!0),n(()=>i.break()),f;function n($){let s=i.const("len",X._`${o}.length`);i.forRange("i",0,s,(e)=>{t.subschema({keyword:r,dataProp:e,dataPropType:Vo.Type.Num},f),i.if((0,X.not)(f),$)})}}cl.validateArray=db;function Ib(t){let{gen:i,schema:o,keyword:r,it:l}=t;if(!Array.isArray(o))throw Error("ajv implementation error");if(o.some((s)=>(0,Vo.alwaysValidSchema)(l,s))&&!l.opts.unevaluated)return;let n=i.let("valid",!1),$=i.name("_valid");i.block(()=>o.forEach((s,e)=>{let u=t.subschema({keyword:r,schemaProp:e,compositeRule:!0},$);if(i.assign(n,X._`${n} || ${$}`),!t.mergeValidEvaluated(u,$))i.if((0,X.not)(n))})),t.result(n,()=>t.reset(),()=>t.error(!0))}cl.validateUnion=Ib});var Tl=c((Ll)=>{Object.defineProperty(Ll,"__esModule",{value:!0});Ll.validateKeywordUsage=Ll.validSchemaType=Ll.funcKeywordCode=Ll.macroKeywordCode=void 0;var H=w(),Vt=E(),Zb=R(),Bb=Et();function Jb(t,i){let{gen:o,keyword:r,schema:l,parentSchema:f,it:n}=t,$=i.macro.call(n.self,l,f,n),s=Vl(o,r,$);if(n.opts.validateSchema!==!1)n.self.validateSchema($,!0);let e=o.name("valid");t.subschema({schema:$,schemaPath:H.nil,errSchemaPath:`${n.errSchemaPath}/${r}`,topSchemaRef:s,compositeRule:!0},e),t.pass(e,()=>t.error(!0))}Ll.macroKeywordCode=Jb;function Ab(t,i){var o;let{gen:r,keyword:l,schema:f,parentSchema:n,$data:$,it:s}=t;Yb(s,i);let e=!$&&i.compile?i.compile.call(s.self,f,n,s):i.validate,u=Vl(r,l,e),b=r.let("valid");t.block$data(b,I),t.ok((o=i.valid)!==null&&o!==void 0?o:b);function I(){if(i.errors===!1){if(d(),i.modifying)Ml(t);M(()=>t.error())}else{let V=i.async?p():y();if(i.modifying)Ml(t);M(()=>Xb(t,V))}}function p(){let V=r.let("ruleErrs",null);return r.try(()=>d(H._`await `),(Z)=>r.assign(b,!1).if(H._`${Z} instanceof ${s.ValidationError}`,()=>r.assign(V,H._`${Z}.errors`),()=>r.throw(Z))),V}function y(){let V=H._`${u}.errors`;return r.assign(V,null),d(H.nil),V}function d(V=i.async?H._`await `:H.nil){let Z=s.opts.passContext?Vt.default.this:Vt.default.self,j=!(("compile"in i)&&!$||i.schema===!1);r.assign(b,H._`${V}${(0,Zb.callValidateCode)(t,u,Z,j)}`,i.modifying)}function M(V){var Z;r.if((0,H.not)((Z=i.valid)!==null&&Z!==void 0?Z:b),V)}}Ll.funcKeywordCode=Ab;function Ml(t){let{gen:i,data:o,it:r}=t;i.if(r.parentData,()=>i.assign(o,H._`${r.parentData}[${r.parentDataProperty}]`))}function Xb(t,i){let{gen:o}=t;o.if(H._`Array.isArray(${i})`,()=>{o.assign(Vt.default.vErrors,H._`${Vt.default.vErrors} === null ? ${i} : ${Vt.default.vErrors}.concat(${i})`).assign(Vt.default.errors,H._`${Vt.default.vErrors}.length`),(0,Bb.extendErrors)(t)},()=>t.error())}function Yb({schemaEnv:t},i){if(i.async&&!t.$async)throw Error("async keyword in sync schema")}function Vl(t,i,o){if(o===void 0)throw Error(`keyword "${i}" failed to compile`);return t.scopeValue("keyword",typeof o=="function"?{ref:o}:{ref:o,code:(0,H.stringify)(o)})}function zb(t,i,o=!1){return!i.length||i.some((r)=>r==="array"?Array.isArray(t):r==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==r||o&&typeof t>"u")}Ll.validSchemaType=zb;function Qb({schema:t,opts:i,self:o,errSchemaPath:r},l,f){if(Array.isArray(l.keyword)?!l.keyword.includes(f):l.keyword!==f)throw Error("ajv implementation error");let n=l.dependencies;if(n===null||n===void 0?void 0:n.some(($)=>!Object.prototype.hasOwnProperty.call(t,$)))throw Error(`parent schema must have dependencies of ${f}: ${n.join(",")}`);if(l.validateSchema){if(!l.validateSchema(t[f])){let s=`keyword "${f}" value is invalid at path "${r}": `+o.errorsText(l.validateSchema.errors);if(i.validateSchema==="log")o.logger.error(s);else throw Error(s)}}}Ll.validateKeywordUsage=Qb});var jl=c((Wl)=>{Object.defineProperty(Wl,"__esModule",{value:!0});Wl.extendSubschemaMode=Wl.extendSubschemaData=Wl.getSubschema=void 0;var it=w(),wl=q();function Db(t,{keyword:i,schemaProp:o,schema:r,schemaPath:l,errSchemaPath:f,topSchemaRef:n}){if(i!==void 0&&r!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(i!==void 0){let $=t.schema[i];return o===void 0?{schema:$,schemaPath:it._`${t.schemaPath}${(0,it.getProperty)(i)}`,errSchemaPath:`${t.errSchemaPath}/${i}`}:{schema:$[o],schemaPath:it._`${t.schemaPath}${(0,it.getProperty)(i)}${(0,it.getProperty)(o)}`,errSchemaPath:`${t.errSchemaPath}/${i}/${(0,wl.escapeFragment)(o)}`}}if(r!==void 0){if(l===void 0||f===void 0||n===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:r,schemaPath:l,topSchemaRef:n,errSchemaPath:f}}throw Error('either "keyword" or "schema" must be passed')}Wl.getSubschema=Db;function Pb(t,i,{dataProp:o,dataPropType:r,data:l,dataTypes:f,propertyName:n}){if(l!==void 0&&o!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:$}=i;if(o!==void 0){let{errorPath:e,dataPathArr:u,opts:b}=i,I=$.let("data",it._`${i.data}${(0,it.getProperty)(o)}`,!0);s(I),t.errorPath=it.str`${e}${(0,wl.getErrorPath)(o,r,b.jsPropertySyntax)}`,t.parentDataProperty=it._`${o}`,t.dataPathArr=[...u,t.parentDataProperty]}if(l!==void 0){let e=l instanceof it.Name?l:$.let("data",l,!0);if(s(e),n!==void 0)t.propertyName=n}if(f)t.dataTypes=f;function s(e){t.data=e,t.dataLevel=i.dataLevel+1,t.dataTypes=[],i.definedProperties=new Set,t.parentData=i.data,t.dataNames=[...i.dataNames,e]}}Wl.extendSubschemaData=Pb;function Kb(t,{jtdDiscriminator:i,jtdMetadata:o,compositeRule:r,createErrors:l,allErrors:f}){if(r!==void 0)t.compositeRule=r;if(l!==void 0)t.createErrors=l;if(f!==void 0)t.allErrors=f;t.jtdDiscriminator=i,t.jtdMetadata=o}Wl.extendSubschemaMode=Kb});var To=c((QM,Fl)=>{Fl.exports=function t(i,o){if(i===o)return!0;if(i&&o&&typeof i=="object"&&typeof o=="object"){if(i.constructor!==o.constructor)return!1;var r,l,f;if(Array.isArray(i)){if(r=i.length,r!=o.length)return!1;for(l=r;l--!==0;)if(!t(i[l],o[l]))return!1;return!0}if(i.constructor===RegExp)return i.source===o.source&&i.flags===o.flags;if(i.valueOf!==Object.prototype.valueOf)return i.valueOf()===o.valueOf();if(i.toString!==Object.prototype.toString)return i.toString()===o.toString();if(f=Object.keys(i),r=f.length,r!==Object.keys(o).length)return!1;for(l=r;l--!==0;)if(!Object.prototype.hasOwnProperty.call(o,f[l]))return!1;for(l=r;l--!==0;){var n=f[l];if(!t(i[n],o[n]))return!1}return!0}return i!==i&&o!==o}});var Bl=c((GM,Zl)=>{var bt=Zl.exports=function(t,i,o){if(typeof i=="function")o=i,i={};o=i.cb||o;var r=typeof o=="function"?o:o.pre||function(){},l=o.post||function(){};Ti(i,r,l,t,"",t)};bt.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};bt.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};bt.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};bt.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Ti(t,i,o,r,l,f,n,$,s,e){if(r&&typeof r=="object"&&!Array.isArray(r)){i(r,l,f,n,$,s,e);for(var u in r){var b=r[u];if(Array.isArray(b)){if(u in bt.arrayKeywords)for(var I=0;I<b.length;I++)Ti(t,i,o,b[I],l+"/"+u+"/"+I,f,l,u,r,I)}else if(u in bt.propsKeywords){if(b&&typeof b=="object")for(var p in b)Ti(t,i,o,b[p],l+"/"+u+"/"+Eb(p),f,l,u,r,p)}else if(u in bt.keywords||t.allKeys&&!(u in bt.skipKeywords))Ti(t,i,o,b,l+"/"+u,f,l,u,r)}o(r,l,f,n,$,s,e)}}function Eb(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var St=c((Yl)=>{Object.defineProperty(Yl,"__esModule",{value:!0});Yl.getSchemaRefs=Yl.resolveUrl=Yl.normalizeId=Yl._getFullPath=Yl.getFullPath=Yl.inlineRef=void 0;var Rb=q(),Sb=To(),kb=Bl(),Cb=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function hb(t,i=!0){if(typeof t=="boolean")return!0;if(i===!0)return!wo(t);if(!i)return!1;return Jl(t)<=i}Yl.inlineRef=hb;var gb=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function wo(t){for(let i in t){if(gb.has(i))return!0;let o=t[i];if(Array.isArray(o)&&o.some(wo))return!0;if(typeof o=="object"&&wo(o))return!0}return!1}function Jl(t){let i=0;for(let o in t){if(o==="$ref")return 1/0;if(i++,Cb.has(o))continue;if(typeof t[o]=="object")(0,Rb.eachItem)(t[o],(r)=>i+=Jl(r));if(i===1/0)return 1/0}return i}function Al(t,i="",o){if(o!==!1)i=At(i);let r=t.parse(i);return Xl(t,r)}Yl.getFullPath=Al;function Xl(t,i){return t.serialize(i).split("#")[0]+"#"}Yl._getFullPath=Xl;var ab=/#\/?$/;function At(t){return t?t.replace(ab,""):""}Yl.normalizeId=At;function mb(t,i,o){return o=At(o),t.resolve(i,o)}Yl.resolveUrl=mb;var xb=/^[a-z_][-a-z0-9._]*$/i;function _b(t,i){if(typeof t=="boolean")return{};let{schemaId:o,uriResolver:r}=this.opts,l=At(t[o]||i),f={"":l},n=Al(r,l,!1),$={},s=new Set;return kb(t,{allKeys:!0},(b,I,p,y)=>{if(y===void 0)return;let d=n+I,M=f[y];if(typeof b[o]=="string")M=V.call(this,b[o]);Z.call(this,b.$anchor),Z.call(this,b.$dynamicAnchor),f[I]=M;function V(j){let A=this.opts.uriResolver.resolve;if(j=At(M?A(M,j):j),s.has(j))throw u(j);s.add(j);let T=this.refs[j];if(typeof T=="string")T=this.refs[T];if(typeof T=="object")e(b,T.schema,j);else if(j!==At(d))if(j[0]==="#")e(b,$[j],j),$[j]=b;else this.refs[j]=d;return j}function Z(j){if(typeof j=="string"){if(!xb.test(j))throw Error(`invalid anchor "${j}"`);V.call(this,`#${j}`)}}}),$;function e(b,I,p){if(I!==void 0&&!Sb(b,I))throw u(p)}function u(b){return Error(`reference "${b}" resolves to more than one schema`)}}Yl.getSchemaRefs=_b});var ht=c((hl)=>{Object.defineProperty(hl,"__esModule",{value:!0});hl.getData=hl.KeywordCxt=hl.validateFunctionCode=void 0;var Dl=mr(),Ql=Rt(),qo=Io(),wi=Rt(),fy=yl(),Ct=Tl(),Wo=jl(),L=w(),O=E(),ny=St(),ft=q(),kt=Et();function $y(t){if(Ul(t)){if(Nl(t),Kl(t)){uy(t);return}}Pl(t,()=>(0,Dl.topBoolOrEmptySchema)(t))}hl.validateFunctionCode=$y;function Pl({gen:t,validateName:i,schema:o,schemaEnv:r,opts:l},f){if(l.code.es5)t.func(i,L._`${O.default.data}, ${O.default.valCxt}`,r.$async,()=>{t.code(L._`"use strict"; ${Gl(o,l)}`),ey(t,l),t.code(f)});else t.func(i,L._`${O.default.data}, ${sy(l)}`,r.$async,()=>t.code(Gl(o,l)).code(f))}function sy(t){return L._`{${O.default.instancePath}="", ${O.default.parentData}, ${O.default.parentDataProperty}, ${O.default.rootData}=${O.default.data}${t.dynamicRef?L._`, ${O.default.dynamicAnchors}={}`:L.nil}}={}`}function ey(t,i){t.if(O.default.valCxt,()=>{if(t.var(O.default.instancePath,L._`${O.default.valCxt}.${O.default.instancePath}`),t.var(O.default.parentData,L._`${O.default.valCxt}.${O.default.parentData}`),t.var(O.default.parentDataProperty,L._`${O.default.valCxt}.${O.default.parentDataProperty}`),t.var(O.default.rootData,L._`${O.default.valCxt}.${O.default.rootData}`),i.dynamicRef)t.var(O.default.dynamicAnchors,L._`${O.default.valCxt}.${O.default.dynamicAnchors}`)},()=>{if(t.var(O.default.instancePath,L._`""`),t.var(O.default.parentData,L._`undefined`),t.var(O.default.parentDataProperty,L._`undefined`),t.var(O.default.rootData,O.default.data),i.dynamicRef)t.var(O.default.dynamicAnchors,L._`{}`)})}function uy(t){let{schema:i,opts:o,gen:r}=t;Pl(t,()=>{if(o.$comment&&i.$comment)Rl(t);if(cy(t),r.let(O.default.vErrors,null),r.let(O.default.errors,0),o.unevaluated)by(t);El(t),Vy(t)});return}function by(t){let{gen:i,validateName:o}=t;t.evaluated=i.const("evaluated",L._`${o}.evaluated`),i.if(L._`${t.evaluated}.dynamicProps`,()=>i.assign(L._`${t.evaluated}.props`,L._`undefined`)),i.if(L._`${t.evaluated}.dynamicItems`,()=>i.assign(L._`${t.evaluated}.items`,L._`undefined`))}function Gl(t,i){let o=typeof t=="object"&&t[i.schemaId];return o&&(i.code.source||i.code.process)?L._`/*# sourceURL=${o} */`:L.nil}function yy(t,i){if(Ul(t)){if(Nl(t),Kl(t)){dy(t,i);return}}(0,Dl.boolOrEmptySchema)(t,i)}function Kl({schema:t,self:i}){if(typeof t=="boolean")return!t;for(let o in t)if(i.RULES.all[o])return!0;return!1}function Ul(t){return typeof t.schema!="boolean"}function dy(t,i){let{schema:o,gen:r,opts:l}=t;if(l.$comment&&o.$comment)Rl(t);py(t),My(t);let f=r.const("_errs",O.default.errors);El(t,f),r.var(i,L._`${f} === ${O.default.errors}`)}function Nl(t){(0,ft.checkUnknownRules)(t),Iy(t)}function El(t,i){if(t.opts.jtd)return vl(t,[],!1,i);let o=(0,Ql.getSchemaTypes)(t.schema),r=(0,Ql.coerceAndCheckDataType)(t,o);vl(t,o,!r,i)}function Iy(t){let{schema:i,errSchemaPath:o,opts:r,self:l}=t;if(i.$ref&&r.ignoreKeywordsWithRef&&(0,ft.schemaHasRulesButRef)(i,l.RULES))l.logger.warn(`$ref: keywords ignored in schema at path "${o}"`)}function cy(t){let{schema:i,opts:o}=t;if(i.default!==void 0&&o.useDefaults&&o.strictSchema)(0,ft.checkStrictMode)(t,"default is ignored in the schema root")}function py(t){let i=t.schema[t.opts.schemaId];if(i)t.baseId=(0,ny.resolveUrl)(t.opts.uriResolver,t.baseId,i)}function My(t){if(t.schema.$async&&!t.schemaEnv.$async)throw Error("async schema in sync schema")}function Rl({gen:t,schemaEnv:i,schema:o,errSchemaPath:r,opts:l}){let f=o.$comment;if(l.$comment===!0)t.code(L._`${O.default.self}.logger.log(${f})`);else if(typeof l.$comment=="function"){let n=L.str`${r}/$comment`,$=t.scopeValue("root",{ref:i.root});t.code(L._`${O.default.self}.opts.$comment(${f}, ${n}, ${$}.schema)`)}}function Vy(t){let{gen:i,schemaEnv:o,validateName:r,ValidationError:l,opts:f}=t;if(o.$async)i.if(L._`${O.default.errors} === 0`,()=>i.return(O.default.data),()=>i.throw(L._`new ${l}(${O.default.vErrors})`));else{if(i.assign(L._`${r}.errors`,O.default.vErrors),f.unevaluated)Ly(t);i.return(L._`${O.default.errors} === 0`)}}function Ly({gen:t,evaluated:i,props:o,items:r}){if(o instanceof L.Name)t.assign(L._`${i}.props`,o);if(r instanceof L.Name)t.assign(L._`${i}.items`,r)}function vl(t,i,o,r){let{gen:l,schema:f,data:n,allErrors:$,opts:s,self:e}=t,{RULES:u}=e;if(f.$ref&&(s.ignoreKeywordsWithRef||!(0,ft.schemaHasRulesButRef)(f,u))){l.block(()=>kl(t,"$ref",u.all.$ref.definition));return}if(!s.jtd)Oy(t,i);l.block(()=>{for(let I of u.rules)b(I);b(u.post)});function b(I){if(!(0,qo.shouldUseGroup)(f,I))return;if(I.type){if(l.if((0,wi.checkDataType)(I.type,n,s.strictNumbers)),Hl(t,I),i.length===1&&i[0]===I.type&&o)l.else(),(0,wi.reportTypeError)(t);l.endIf()}else Hl(t,I);if(!$)l.if(L._`${O.default.errors} === ${r||0}`)}}function Hl(t,i){let{gen:o,schema:r,opts:{useDefaults:l}}=t;if(l)(0,fy.assignDefaults)(t,i.type);o.block(()=>{for(let f of i.rules)if((0,qo.shouldUseRule)(r,f))kl(t,f.keyword,f.definition,i.type)})}function Oy(t,i){if(t.schemaEnv.meta||!t.opts.strictTypes)return;if(Ty(t,i),!t.opts.allowUnionTypes)wy(t,i);Wy(t,t.dataTypes)}function Ty(t,i){if(!i.length)return;if(!t.dataTypes.length){t.dataTypes=i;return}i.forEach((o)=>{if(!Sl(t.dataTypes,o))jo(t,`type "${o}" not allowed by context "${t.dataTypes.join(",")}"`)}),jy(t,i)}function wy(t,i){if(i.length>1&&!(i.length===2&&i.includes("null")))jo(t,"use allowUnionTypes to allow union type keyword")}function Wy(t,i){let o=t.self.RULES.all;for(let r in o){let l=o[r];if(typeof l=="object"&&(0,qo.shouldUseRule)(t.schema,l)){let{type:f}=l.definition;if(f.length&&!f.some((n)=>qy(i,n)))jo(t,`missing type "${f.join(",")}" for keyword "${r}"`)}}}function qy(t,i){return t.includes(i)||i==="number"&&t.includes("integer")}function Sl(t,i){return t.includes(i)||i==="integer"&&t.includes("number")}function jy(t,i){let o=[];for(let r of t.dataTypes)if(Sl(i,r))o.push(r);else if(i.includes("integer")&&r==="number")o.push("integer");t.dataTypes=o}function jo(t,i){let o=t.schemaEnv.baseId+t.errSchemaPath;i+=` at "${o}" (strictTypes)`,(0,ft.checkStrictMode)(t,i,t.opts.strictTypes)}class Fo{constructor(t,i,o){if((0,Ct.validateKeywordUsage)(t,i,o),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=o,this.data=t.data,this.schema=t.schema[o],this.$data=i.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,ft.schemaRefOrVal)(t,this.schema,o,this.$data),this.schemaType=i.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=i,this.$data)this.schemaCode=t.gen.const("vSchema",Cl(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,Ct.validSchemaType)(this.schema,i.schemaType,i.allowUndefined))throw Error(`${o} value must be ${JSON.stringify(i.schemaType)}`);if("code"in i?i.trackErrors:i.errors!==!1)this.errsCount=t.gen.const("_errs",O.default.errors)}result(t,i,o){this.failResult((0,L.not)(t),i,o)}failResult(t,i,o){if(this.gen.if(t),o)o();else this.error();if(i){if(this.gen.else(),i(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(t,i){this.failResult((0,L.not)(t),void 0,i)}fail(t){if(t===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(t),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);let{schemaCode:i}=this;this.fail(L._`${i} !== undefined && (${(0,L.or)(this.invalid$data(),t)})`)}error(t,i,o){if(i){this.setParams(i),this._error(t,o),this.setParams({});return}this._error(t,o)}_error(t,i){(t?kt.reportExtraError:kt.reportError)(this,this.def.error,i)}$dataError(){(0,kt.reportError)(this,this.def.$dataError||kt.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,kt.resetErrorsCount)(this.gen,this.errsCount)}ok(t){if(!this.allErrors)this.gen.if(t)}setParams(t,i){if(i)Object.assign(this.params,t);else this.params=t}block$data(t,i,o=L.nil){this.gen.block(()=>{this.check$data(t,o),i()})}check$data(t=L.nil,i=L.nil){if(!this.$data)return;let{gen:o,schemaCode:r,schemaType:l,def:f}=this;if(o.if((0,L.or)(L._`${r} === undefined`,i)),t!==L.nil)o.assign(t,!0);if(l.length||f.validateSchema){if(o.elseIf(this.invalid$data()),this.$dataError(),t!==L.nil)o.assign(t,!1)}o.else()}invalid$data(){let{gen:t,schemaCode:i,schemaType:o,def:r,it:l}=this;return(0,L.or)(f(),n());function f(){if(o.length){if(!(i instanceof L.Name))throw Error("ajv implementation error");let $=Array.isArray(o)?o:[o];return L._`${(0,wi.checkDataTypes)($,i,l.opts.strictNumbers,wi.DataType.Wrong)}`}return L.nil}function n(){if(r.validateSchema){let $=t.scopeValue("validate$data",{ref:r.validateSchema});return L._`!${$}(${i})`}return L.nil}}subschema(t,i){let o=(0,Wo.getSubschema)(this.it,t);(0,Wo.extendSubschemaData)(o,this.it,t),(0,Wo.extendSubschemaMode)(o,t);let r={...this.it,...o,items:void 0,props:void 0};return yy(r,i),r}mergeEvaluated(t,i){let{it:o,gen:r}=this;if(!o.opts.unevaluated)return;if(o.props!==!0&&t.props!==void 0)o.props=ft.mergeEvaluated.props(r,t.props,o.props,i);if(o.items!==!0&&t.items!==void 0)o.items=ft.mergeEvaluated.items(r,t.items,o.items,i)}mergeValidEvaluated(t,i){let{it:o,gen:r}=this;if(o.opts.unevaluated&&(o.props!==!0||o.items!==!0))return r.if(i,()=>this.mergeEvaluated(t,L.Name)),!0}}hl.KeywordCxt=Fo;function kl(t,i,o,r){let l=new Fo(t,o,i);if("code"in o)o.code(l,r);else if(l.$data&&o.validate)(0,Ct.funcKeywordCode)(l,o);else if("macro"in o)(0,Ct.macroKeywordCode)(l,o);else if(o.compile||o.validate)(0,Ct.funcKeywordCode)(l,o)}var Fy=/^\/(?:[^~]|~0|~1)*$/,Zy=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Cl(t,{dataLevel:i,dataNames:o,dataPathArr:r}){let l,f;if(t==="")return O.default.rootData;if(t[0]==="/"){if(!Fy.test(t))throw Error(`Invalid JSON-pointer: ${t}`);l=t,f=O.default.rootData}else{let e=Zy.exec(t);if(!e)throw Error(`Invalid JSON-pointer: ${t}`);let u=+e[1];if(l=e[2],l==="#"){if(u>=i)throw Error(s("property/index",u));return r[i-u]}if(u>i)throw Error(s("data",u));if(f=o[i-u],!l)return f}let n=f,$=l.split("/");for(let e of $)if(e)f=L._`${f}${(0,L.getProperty)((0,ft.unescapeJsonPointer)(e))}`,n=L._`${n} && ${f}`;return n;function s(e,u){return`Cannot access ${e} ${u} levels up, current level is ${i}`}}hl.getData=Cl});var Wi=c((ml)=>{Object.defineProperty(ml,"__esModule",{value:!0});class al extends Error{constructor(t){super("validation failed");this.errors=t,this.ajv=this.validation=!0}}ml.default=al});var gt=c((_l)=>{Object.defineProperty(_l,"__esModule",{value:!0});var Zo=St();class xl extends Error{constructor(t,i,o,r){super(r||`can't resolve reference ${o} from id ${i}`);this.missingRef=(0,Zo.resolveUrl)(t,i,o),this.missingSchema=(0,Zo.normalizeId)((0,Zo.getFullPath)(t,this.missingRef))}}_l.default=xl});var mt=c((rf)=>{Object.defineProperty(rf,"__esModule",{value:!0});rf.resolveSchema=rf.getCompilingSchema=rf.resolveRef=rf.compileSchema=rf.SchemaEnv=void 0;var g=w(),Yy=Wi(),Lt=E(),a=St(),tf=q(),zy=ht();class at{constructor(t){var i;this.refs={},this.dynamicAnchors={};let o;if(typeof t.schema=="object")o=t.schema;this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(i=t.baseId)!==null&&i!==void 0?i:(0,a.normalizeId)(o===null||o===void 0?void 0:o[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=o===null||o===void 0?void 0:o.$async,this.refs={}}}rf.SchemaEnv=at;function Jo(t){let i=of.call(this,t);if(i)return i;let o=(0,a.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:r,lines:l}=this.opts.code,{ownProperties:f}=this.opts,n=new g.CodeGen(this.scope,{es5:r,lines:l,ownProperties:f}),$;if(t.$async)$=n.scopeValue("Error",{ref:Yy.default,code:g._`require("ajv/dist/runtime/validation_error").default`});let s=n.scopeName("validate");t.validateName=s;let e={gen:n,allErrors:this.opts.allErrors,data:Lt.default.data,parentData:Lt.default.parentData,parentDataProperty:Lt.default.parentDataProperty,dataNames:[Lt.default.data],dataPathArr:[g.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:n.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,g.stringify)(t.schema)}:{ref:t.schema}),validateName:s,ValidationError:$,schema:t.schema,schemaEnv:t,rootId:o,baseId:t.baseId||o,schemaPath:g.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:g._`""`,opts:this.opts,self:this},u;try{this._compilations.add(t),(0,zy.validateFunctionCode)(e),n.optimize(this.opts.code.optimize);let b=n.toString();if(u=`${n.scopeRefs(Lt.default.scope)}return ${b}`,this.opts.code.process)u=this.opts.code.process(u,t);let p=Function(`${Lt.default.self}`,`${Lt.default.scope}`,u)(this,this.scope.get());if(this.scope.value(s,{ref:p}),p.errors=null,p.schema=t.schema,p.schemaEnv=t,t.$async)p.$async=!0;if(this.opts.code.source===!0)p.source={validateName:s,validateCode:b,scopeValues:n._values};if(this.opts.unevaluated){let{props:y,items:d}=e;if(p.evaluated={props:y instanceof g.Name?void 0:y,items:d instanceof g.Name?void 0:d,dynamicProps:y instanceof g.Name,dynamicItems:d instanceof g.Name},p.source)p.source.evaluated=(0,g.stringify)(p.evaluated)}return t.validate=p,t}catch(b){if(delete t.validate,delete t.validateName,u)this.logger.error("Error compiling schema, function code:",u);throw b}finally{this._compilations.delete(t)}}rf.compileSchema=Jo;function Qy(t,i,o){var r;o=(0,a.resolveUrl)(this.opts.uriResolver,i,o);let l=t.refs[o];if(l)return l;let f=Hy.call(this,t,o);if(f===void 0){let n=(r=t.localRefs)===null||r===void 0?void 0:r[o],{schemaId:$}=this.opts;if(n)f=new at({schema:n,schemaId:$,root:t,baseId:i})}if(f===void 0)return;return t.refs[o]=Gy.call(this,f)}rf.resolveRef=Qy;function Gy(t){if((0,a.inlineRef)(t.schema,this.opts.inlineRefs))return t.schema;return t.validate?t:Jo.call(this,t)}function of(t){for(let i of this._compilations)if(vy(i,t))return i}rf.getCompilingSchema=of;function vy(t,i){return t.schema===i.schema&&t.root===i.root&&t.baseId===i.baseId}function Hy(t,i){let o;while(typeof(o=this.refs[i])=="string")i=o;return o||this.schemas[i]||qi.call(this,t,i)}function qi(t,i){let o=this.opts.uriResolver.parse(i),r=(0,a._getFullPath)(this.opts.uriResolver,o),l=(0,a.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&r===l)return Bo.call(this,o,t);let f=(0,a.normalizeId)(r),n=this.refs[f]||this.schemas[f];if(typeof n=="string"){let $=qi.call(this,t,n);if(typeof($===null||$===void 0?void 0:$.schema)!=="object")return;return Bo.call(this,o,$)}if(typeof(n===null||n===void 0?void 0:n.schema)!=="object")return;if(!n.validate)Jo.call(this,n);if(f===(0,a.normalizeId)(i)){let{schema:$}=n,{schemaId:s}=this.opts,e=$[s];if(e)l=(0,a.resolveUrl)(this.opts.uriResolver,l,e);return new at({schema:$,schemaId:s,root:t,baseId:l})}return Bo.call(this,o,n)}rf.resolveSchema=qi;var Dy=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Bo(t,{baseId:i,schema:o,root:r}){var l;if(((l=t.fragment)===null||l===void 0?void 0:l[0])!=="/")return;for(let $ of t.fragment.slice(1).split("/")){if(typeof o==="boolean")return;let s=o[(0,tf.unescapeFragment)($)];if(s===void 0)return;o=s;let e=typeof o==="object"&&o[this.opts.schemaId];if(!Dy.has($)&&e)i=(0,a.resolveUrl)(this.opts.uriResolver,i,e)}let f;if(typeof o!="boolean"&&o.$ref&&!(0,tf.schemaHasRulesButRef)(o,this.RULES)){let $=(0,a.resolveUrl)(this.opts.uriResolver,i,o.$ref);f=qi.call(this,r,$)}let{schemaId:n}=this.opts;if(f=f||new at({schema:o,schemaId:n,root:r,baseId:i}),f.schema!==f.root.schema)return f;return}});var ff=c((UM,Ey)=>{Ey.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var Yo=c((NM,bf)=>{var Ry=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),$f=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),Ao=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),sf=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),Sy=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function Xo(t){let i="",o=0,r=0;for(r=0;r<t.length;r++){if(o=t[r].charCodeAt(0),o===48)continue;if(!(o>=48&&o<=57||o>=65&&o<=70||o>=97&&o<=102))return"";i+=t[r];break}for(r+=1;r<t.length;r++){if(o=t[r].charCodeAt(0),!(o>=48&&o<=57||o>=65&&o<=70||o>=97&&o<=102))return"";i+=t[r]}return i}var ky=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function nf(t){return t.length=0,!0}function Cy(t,i,o){if(t.length){let r=Xo(t);if(r!=="")i.push(r);else return o.error=!0,!1;t.length=0}return!0}function hy(t){let i=0,o={error:!1,address:"",zone:""},r=[],l=[],f=!1,n=!1,$=Cy;for(let s=0;s<t.length;s++){let e=t[s];if(e==="["||e==="]")continue;if(e===":"){if(f===!0)n=!0;if(!$(l,r,o))break;if(++i>7){o.error=!0;break}if(s>0&&t[s-1]===":")f=!0;r.push(":");continue}else if(e==="%"){if(!$(l,r,o))break;$=nf}else{l.push(e);continue}}if(l.length)if($===nf)o.zone=l.join("");else if(n)r.push(l.join(""));else r.push(Xo(l));return o.address=r.join(""),o}function ef(t){if(gy(t,":")<2)return{host:t,isIPV6:!1};let i=hy(t);if(!i.error){let{address:o,address:r}=i;if(i.zone)o+="%"+i.zone,r+="%25"+i.zone;return{host:o,isIPV6:!0,escapedHost:r}}else return{host:t,isIPV6:!1}}function gy(t,i){let o=0;for(let r=0;r<t.length;r++)if(t[r]===i)o++;return o}function ay(t){let i=t,o=[],r=-1,l=0;while(l=i.length){if(l===1)if(i===".")break;else if(i==="/"){o.push("/");break}else{o.push(i);break}else if(l===2){if(i[0]==="."){if(i[1]===".")break;else if(i[1]==="/"){i=i.slice(2);continue}}else if(i[0]==="/"){if(i[1]==="."||i[1]==="/"){o.push("/");break}}}else if(l===3){if(i==="/.."){if(o.length!==0)o.pop();o.push("/");break}}if(i[0]==="."){if(i[1]==="."){if(i[2]==="/"){i=i.slice(3);continue}}else if(i[1]==="/"){i=i.slice(2);continue}}else if(i[0]==="/"){if(i[1]==="."){if(i[2]==="/"){i=i.slice(2);continue}else if(i[2]==="."){if(i[3]==="/"){if(i=i.slice(3),o.length!==0)o.pop();continue}}}}if((r=i.indexOf("/",1))===-1){o.push(i);break}else o.push(i.slice(0,r)),i=i.slice(r)}return o.join("")}var my={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},xy=/[@/?#:]/g,_y=/[@/?#]/g;function uf(t,i){let o=i?_y:xy;return o.lastIndex=0,t.replace(o,(r)=>my[r])}function td(t,i=!1){if(t.indexOf("%")===-1)return t;let o="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let l=t.slice(r+1,r+3);if(Ao(l)){let f=l.toUpperCase(),n=String.fromCharCode(parseInt(f,16));if(i&&sf(n))o+=n;else o+="%"+f;r+=2;continue}}o+=t[r]}return o}function id(t){let i="";for(let o=0;o<t.length;o++){if(t[o]==="%"&&o+2<t.length){let r=t.slice(o+1,o+3);if(Ao(r)){let l=r.toUpperCase(),f=String.fromCharCode(parseInt(l,16));if(f!=="."&&sf(f))i+=f;else i+="%"+l;o+=2;continue}}if(Sy(t[o]))i+=t[o];else i+=escape(t[o])}return i}function od(t){let i="";for(let o=0;o<t.length;o++){if(t[o]==="%"&&o+2<t.length){let r=t.slice(o+1,o+3);if(Ao(r)){i+="%"+r.toUpperCase(),o+=2;continue}}i+=escape(t[o])}return i}function rd(t){let i=[];if(t.userinfo!==void 0)i.push(t.userinfo),i.push("@");if(t.host!==void 0){let o=unescape(t.host);if(!$f(o)){let r=ef(o);if(r.isIPV6===!0)o=`[${r.escapedHost}]`;else o=uf(o,!1)}i.push(o)}if(typeof t.port==="number"||typeof t.port==="string")i.push(":"),i.push(String(t.port));return i.length?i.join(""):void 0}bf.exports={nonSimpleDomain:ky,recomposeAuthority:rd,reescapeHostDelimiters:uf,normalizePercentEncoding:td,normalizePathEncoding:id,escapePreservingEscapes:od,removeDotSegments:ay,isIPv4:$f,isUUID:Ry,normalizeIPv6:ef,stringArrayToHexStripped:Xo}});var pf=c((EM,cf)=>{var{isUUID:ld}=Yo(),fd=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,nd=["http","https","ws","wss","urn","urn:uuid"];function $d(t){return nd.indexOf(t)!==-1}function zo(t){if(t.secure===!0)return!0;else if(t.secure===!1)return!1;else if(t.scheme)return t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S");else return!1}function yf(t){if(!t.host)t.error=t.error||"HTTP URIs must have a host.";return t}function df(t){let i=String(t.scheme).toLowerCase()==="https";if(t.port===(i?443:80)||t.port==="")t.port=void 0;if(!t.path)t.path="/";return t}function sd(t){return t.secure=zo(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function ed(t){if(t.port===(zo(t)?443:80)||t.port==="")t.port=void 0;if(typeof t.secure==="boolean")t.scheme=t.secure?"wss":"ws",t.secure=void 0;if(t.resourceName){let[i,o]=t.resourceName.split("?");t.path=i&&i!=="/"?i:void 0,t.query=o,t.resourceName=void 0}return t.fragment=void 0,t}function ud(t,i){if(!t.path)return t.error="URN can not be parsed",t;let o=t.path.match(fd);if(o){let r=i.scheme||t.scheme||"urn";t.nid=o[1].toLowerCase(),t.nss=o[2];let l=`${r}:${i.nid||t.nid}`,f=Qo(l);if(t.path=void 0,f)t=f.parse(t,i)}else t.error=t.error||"URN can not be parsed.";return t}function bd(t,i){if(t.nid===void 0)throw Error("URN without nid cannot be serialized");let o=i.scheme||t.scheme||"urn",r=t.nid.toLowerCase(),l=`${o}:${i.nid||r}`,f=Qo(l);if(f)t=f.serialize(t,i);let n=t,$=t.nss;return n.path=`${r||i.nid}:${$}`,i.skipEscape=!0,n}function yd(t,i){let o=t;if(o.uuid=o.nss,o.nss=void 0,!i.tolerant&&(!o.uuid||!ld(o.uuid)))o.error=o.error||"UUID is not valid.";return o}function dd(t){let i=t;return i.nss=(t.uuid||"").toLowerCase(),i}var If={scheme:"http",domainHost:!0,parse:yf,serialize:df},Id={scheme:"https",domainHost:If.domainHost,parse:yf,serialize:df},ji={scheme:"ws",domainHost:!0,parse:sd,serialize:ed},cd={scheme:"wss",domainHost:ji.domainHost,parse:ji.parse,serialize:ji.serialize},pd={scheme:"urn",parse:ud,serialize:bd,skipNormalize:!0},Md={scheme:"urn:uuid",parse:yd,serialize:dd,skipNormalize:!0},Fi={http:If,https:Id,ws:ji,wss:cd,urn:pd,"urn:uuid":Md};Object.setPrototypeOf(Fi,null);function Qo(t){return t&&(Fi[t]||Fi[t.toLowerCase()])||void 0}cf.exports={wsIsSecure:zo,SCHEMES:Fi,isValidSchemeName:$d,getSchemeHandler:Qo}});var Tf=c((RM,Ji)=>{var{normalizeIPv6:Vd,removeDotSegments:xt,recomposeAuthority:Ld,normalizePercentEncoding:Od,normalizePathEncoding:Td,escapePreservingEscapes:wd,reescapeHostDelimiters:Wd,isIPv4:qd,nonSimpleDomain:jd}=Yo(),{SCHEMES:Fd,getSchemeHandler:Vf}=pf();function Zd(t,i){if(typeof t==="string")t=Qd(t,i);else if(typeof t==="object")t=Bi(Ot(t,i),i);return t}function Bd(t,i,o){let r=o?Object.assign({scheme:"null"},o):{scheme:"null"},{parsed:l,malformedAuthorityOrPort:f}=Zi(t,r),{parsed:n,malformedAuthorityOrPort:$}=Zi(i,r);if(f||$)throw Error(l.error||n.error||"URI is malformed.");let s=Lf(l,n,r,!0);return r.skipEscape=!0,Ot(s,r)}function Lf(t,i,o,r){let l={};if(!r)t=Bi(Ot(t,o),o),i=Bi(Ot(i,o),o);if(o=o||{},!o.tolerant&&i.scheme)l.scheme=i.scheme,l.userinfo=i.userinfo,l.host=i.host,l.port=i.port,l.path=xt(i.path||""),l.query=i.query;else{if(i.userinfo!==void 0||i.host!==void 0||i.port!==void 0)l.userinfo=i.userinfo,l.host=i.host,l.port=i.port,l.path=xt(i.path||""),l.query=i.query;else{if(!i.path)if(l.path=t.path,i.query!==void 0)l.query=i.query;else l.query=t.query;else{if(i.path[0]==="/")l.path=xt(i.path);else{if((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path)l.path="/"+i.path;else if(!t.path)l.path=i.path;else l.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+i.path;l.path=xt(l.path)}l.query=i.query}l.userinfo=t.userinfo,l.host=t.host,l.port=t.port}l.scheme=t.scheme}return l.fragment=i.fragment,l}function Jd(t,i,o){let r=Mf(t,o),l=Mf(i,o);return r!==void 0&&l!==void 0&&r.toLowerCase()===l.toLowerCase()}function Ot(t,i){let o={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},r=Object.assign({},i),l=[],f=Vf(r.scheme||o.scheme);if(f&&f.serialize)f.serialize(o,r);if(o.path!==void 0)if(!r.skipEscape){if(o.path=wd(o.path),o.scheme!==void 0)o.path=o.path.split("%3A").join(":")}else o.path=Od(o.path);if(r.reference!=="suffix"&&o.scheme)l.push(o.scheme,":");let n=Ld(o);if(n!==void 0){if(r.reference!=="suffix")l.push("//");if(l.push(n),o.path&&o.path[0]!=="/")l.push("/")}if(o.path!==void 0){let $=o.path;if(!r.absolutePath&&(!f||!f.absolutePath))$=xt($);if(n===void 0&&$[0]==="/"&&$[1]==="/")$="/%2F"+$.slice(2);l.push($)}if(o.query!==void 0)l.push("?",o.query);if(o.fragment!==void 0)l.push("#",o.fragment);return l.join("")}var Ad=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,Xd=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,Yd=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function zd(t,i){if(i[2]!==void 0&&t.path&&t.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof t.port==="number"&&(t.port<0||t.port>65535))return"URI port is malformed.";return}function Zi(t,i){let o=Object.assign({},i),r={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},l=!1,f=!1;if(o.reference==="suffix")if(o.scheme)t=o.scheme+":"+t;else t="//"+t;let n=t.match(Xd);if(n!==null&&n[1].indexOf("\\")!==-1)r.error="URI authority must not contain a literal backslash.",l=!0;let $=t.match(Yd);if($!==null){let e=$[1],u=e.replace(/[\t\n\r]/g,"");if(u.length>=2){if(u.slice(0,2)!=="//")r.error=r.error||"URI authority must not contain a literal backslash.",l=!0;else if(e.length!==u.length)r.error=r.error||"URI authority introducer must not contain whitespace.",l=!0}}let s=t.match(Ad);if(s){if(r.scheme=s[1],r.userinfo=s[3],r.host=s[4],r.port=parseInt(s[5],10),r.path=s[6]||"",r.query=s[7],r.fragment=s[8],isNaN(r.port))r.port=s[5];let e=zd(r,s);if(e!==void 0)r.error=r.error||e,l=!0;if(r.host)if(qd(r.host)===!1){let I=Vd(r.host);r.host=I.host.toLowerCase(),f=I.isIPV6}else f=!0;if(r.scheme===void 0&&r.userinfo===void 0&&r.host===void 0&&r.port===void 0&&r.query===void 0&&!r.path)r.reference="same-document";else if(r.scheme===void 0)r.reference="relative";else if(r.fragment===void 0)r.reference="absolute";else r.reference="uri";if(o.reference&&o.reference!=="suffix"&&o.reference!==r.reference)r.error=r.error||"URI is not a "+o.reference+" reference.";let u=Vf(o.scheme||r.scheme);if(!o.unicodeSupport&&(!u||!u.unicodeSupport)){if(r.host&&(o.domainHost||u&&u.domainHost)&&f===!1&&jd(r.host))try{r.host=new URL("http://"+r.host).hostname}catch(b){r.error=r.error||"Host's domain name can not be converted to ASCII: "+b}}if(!u||u&&!u.skipNormalize){if(t.indexOf("%")!==-1){if(r.scheme!==void 0)r.scheme=unescape(r.scheme);if(r.host!==void 0)r.host=Wd(unescape(r.host),f)}if(r.path)r.path=Td(r.path);if(r.fragment)try{r.fragment=encodeURI(decodeURIComponent(r.fragment))}catch{r.error=r.error||"URI malformed"}}if(u&&u.parse)u.parse(r,o)}else r.error=r.error||"URI can not be parsed.";return{parsed:r,malformedAuthorityOrPort:l}}function Bi(t,i){return Zi(t,i).parsed}function Qd(t,i){return Of(t,i).normalized}function Of(t,i){let{parsed:o,malformedAuthorityOrPort:r}=Zi(t,i);return{normalized:r?t:Ot(o,i),malformedAuthorityOrPort:r}}function Mf(t,i){if(typeof t==="string"){let{normalized:o,malformedAuthorityOrPort:r}=Of(t,i);return r?void 0:o}if(typeof t==="object")return Ot(t,i)}var Go={SCHEMES:Fd,normalize:Zd,resolve:Bd,resolveComponent:Lf,equal:Jd,serialize:Ot,parse:Bi};Ji.exports=Go;Ji.exports.default=Go;Ji.exports.fastUri=Go});var qf=c((Wf)=>{Object.defineProperty(Wf,"__esModule",{value:!0});var wf=Tf();wf.code='require("ajv/dist/runtime/uri").default';Wf.default=wf});var Yf=c((nt)=>{Object.defineProperty(nt,"__esModule",{value:!0});nt.CodeGen=nt.Name=nt.nil=nt.stringify=nt.str=nt._=nt.KeywordCxt=void 0;var vd=ht();Object.defineProperty(nt,"KeywordCxt",{enumerable:!0,get:function(){return vd.KeywordCxt}});var Xt=w();Object.defineProperty(nt,"_",{enumerable:!0,get:function(){return Xt._}});Object.defineProperty(nt,"str",{enumerable:!0,get:function(){return Xt.str}});Object.defineProperty(nt,"stringify",{enumerable:!0,get:function(){return Xt.stringify}});Object.defineProperty(nt,"nil",{enumerable:!0,get:function(){return Xt.nil}});Object.defineProperty(nt,"Name",{enumerable:!0,get:function(){return Xt.Name}});Object.defineProperty(nt,"CodeGen",{enumerable:!0,get:function(){return Xt.CodeGen}});var Hd=Wi(),Jf=gt(),Dd=yo(),_t=mt(),Pd=w(),ti=St(),Ai=Rt(),Ho=q(),jf=ff(),Kd=qf(),Af=(t,i)=>new RegExp(t,i);Af.code="new RegExp";var Ud=["removeAdditional","useDefaults","coerceTypes"],Nd=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),Ed={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},Rd={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Ff=200;function Sd(t){var i,o,r,l,f,n,$,s,e,u,b,I,p,y,d,M,V,Z,j,A,T,x,rt,Ci,hi;let Ht=t.strict,gi=(i=t.code)===null||i===void 0?void 0:i.optimize,lr=gi===!0||gi===void 0?1:gi||0,fr=(r=(o=t.code)===null||o===void 0?void 0:o.regExp)!==null&&r!==void 0?r:Af,Us=(l=t.uriResolver)!==null&&l!==void 0?l:Kd.default;return{strictSchema:(n=(f=t.strictSchema)!==null&&f!==void 0?f:Ht)!==null&&n!==void 0?n:!0,strictNumbers:(s=($=t.strictNumbers)!==null&&$!==void 0?$:Ht)!==null&&s!==void 0?s:!0,strictTypes:(u=(e=t.strictTypes)!==null&&e!==void 0?e:Ht)!==null&&u!==void 0?u:"log",strictTuples:(I=(b=t.strictTuples)!==null&&b!==void 0?b:Ht)!==null&&I!==void 0?I:"log",strictRequired:(y=(p=t.strictRequired)!==null&&p!==void 0?p:Ht)!==null&&y!==void 0?y:!1,code:t.code?{...t.code,optimize:lr,regExp:fr}:{optimize:lr,regExp:fr},loopRequired:(d=t.loopRequired)!==null&&d!==void 0?d:Ff,loopEnum:(M=t.loopEnum)!==null&&M!==void 0?M:Ff,meta:(V=t.meta)!==null&&V!==void 0?V:!0,messages:(Z=t.messages)!==null&&Z!==void 0?Z:!0,inlineRefs:(j=t.inlineRefs)!==null&&j!==void 0?j:!0,schemaId:(A=t.schemaId)!==null&&A!==void 0?A:"$id",addUsedSchema:(T=t.addUsedSchema)!==null&&T!==void 0?T:!0,validateSchema:(x=t.validateSchema)!==null&&x!==void 0?x:!0,validateFormats:(rt=t.validateFormats)!==null&&rt!==void 0?rt:!0,unicodeRegExp:(Ci=t.unicodeRegExp)!==null&&Ci!==void 0?Ci:!0,int32range:(hi=t.int32range)!==null&&hi!==void 0?hi:!0,uriResolver:Us}}class Xi{constructor(t={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...Sd(t)};let{es5:i,lines:o}=this.opts.code;this.scope=new Pd.ValueScope({scope:{},prefixes:Nd,es5:i,lines:o}),this.logger=md(t.logger);let r=t.validateFormats;if(t.validateFormats=!1,this.RULES=(0,Dd.getRules)(),Zf.call(this,Ed,t,"NOT SUPPORTED"),Zf.call(this,Rd,t,"DEPRECATED","warn"),this._metaOpts=gd.call(this),t.formats)Cd.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords)hd.call(this,t.keywords);if(typeof t.meta=="object")this.addMetaSchema(t.meta);kd.call(this),t.validateFormats=r}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:i,schemaId:o}=this.opts,r=jf;if(o==="id")r={...jf},r.id=r.$id,delete r.$id;if(i&&t)this.addMetaSchema(r,r[o],!1)}defaultMeta(){let{meta:t,schemaId:i}=this.opts;return this.opts.defaultMeta=typeof t=="object"?t[i]||t:void 0}validate(t,i){let o;if(typeof t=="string"){if(o=this.getSchema(t),!o)throw Error(`no schema with key or ref "${t}"`)}else o=this.compile(t);let r=o(i);if(!("$async"in o))this.errors=o.errors;return r}compile(t,i){let o=this._addSchema(t,i);return o.validate||this._compileSchemaEnv(o)}compileAsync(t,i){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:o}=this.opts;return r.call(this,t,i);async function r(e,u){await l.call(this,e.$schema);let b=this._addSchema(e,u);return b.validate||f.call(this,b)}async function l(e){if(e&&!this.getSchema(e))await r.call(this,{$ref:e},!0)}async function f(e){try{return this._compileSchemaEnv(e)}catch(u){if(!(u instanceof Jf.default))throw u;return n.call(this,u),await $.call(this,u.missingSchema),f.call(this,e)}}function n({missingSchema:e,missingRef:u}){if(this.refs[e])throw Error(`AnySchema ${e} is loaded but ${u} cannot be resolved`)}async function $(e){let u=await s.call(this,e);if(!this.refs[e])await l.call(this,u.$schema);if(!this.refs[e])this.addSchema(u,e,i)}async function s(e){let u=this._loading[e];if(u)return u;try{return await(this._loading[e]=o(e))}finally{delete this._loading[e]}}}addSchema(t,i,o,r=this.opts.validateSchema){if(Array.isArray(t)){for(let f of t)this.addSchema(f,void 0,o,r);return this}let l;if(typeof t==="object"){let{schemaId:f}=this.opts;if(l=t[f],l!==void 0&&typeof l!="string")throw Error(`schema ${f} must be string`)}return i=(0,ti.normalizeId)(i||l),this._checkUnique(i),this.schemas[i]=this._addSchema(t,o,i,r,!0),this}addMetaSchema(t,i,o=this.opts.validateSchema){return this.addSchema(t,i,!0,o),this}validateSchema(t,i){if(typeof t=="boolean")return!0;let o;if(o=t.$schema,o!==void 0&&typeof o!="string")throw Error("$schema must be a string");if(o=o||this.opts.defaultMeta||this.defaultMeta(),!o)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let r=this.validate(o,t);if(!r&&i){let l="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(l);else throw Error(l)}return r}getSchema(t){let i;while(typeof(i=Bf.call(this,t))=="string")t=i;if(i===void 0){let{schemaId:o}=this.opts,r=new _t.SchemaEnv({schema:{},schemaId:o});if(i=_t.resolveSchema.call(this,r,t),!i)return;this.refs[t]=i}return i.validate||this._compileSchemaEnv(i)}removeSchema(t){if(t instanceof RegExp)return this._removeAllSchemas(this.schemas,t),this._removeAllSchemas(this.refs,t),this;switch(typeof t){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let i=Bf.call(this,t);if(typeof i=="object")this._cache.delete(i.schema);return delete this.schemas[t],delete this.refs[t],this}case"object":{let i=t;this._cache.delete(i);let o=t[this.opts.schemaId];if(o)o=(0,ti.normalizeId)(o),delete this.schemas[o],delete this.refs[o];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(let i of t)this.addKeyword(i);return this}addKeyword(t,i){let o;if(typeof t=="string"){if(o=t,typeof i=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),i.keyword=o}else if(typeof t=="object"&&i===void 0){if(i=t,o=i.keyword,Array.isArray(o)&&!o.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(_d.call(this,o,i),!i)return(0,Ho.eachItem)(o,(l)=>vo.call(this,l)),this;iI.call(this,i);let r={...i,type:(0,Ai.getJSONTypes)(i.type),schemaType:(0,Ai.getJSONTypes)(i.schemaType)};return(0,Ho.eachItem)(o,r.type.length===0?(l)=>vo.call(this,l,r):(l)=>r.type.forEach((f)=>vo.call(this,l,r,f))),this}getKeyword(t){let i=this.RULES.all[t];return typeof i=="object"?i.definition:!!i}removeKeyword(t){let{RULES:i}=this;delete i.keywords[t],delete i.all[t];for(let o of i.rules){let r=o.rules.findIndex((l)=>l.keyword===t);if(r>=0)o.rules.splice(r,1)}return this}addFormat(t,i){if(typeof i=="string")i=new RegExp(i);return this.formats[t]=i,this}errorsText(t=this.errors,{separator:i=", ",dataVar:o="data"}={}){if(!t||t.length===0)return"No errors";return t.map((r)=>`${o}${r.instancePath} ${r.message}`).reduce((r,l)=>r+i+l)}$dataMetaSchema(t,i){let o=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(let r of i){let l=r.split("/").slice(1),f=t;for(let n of l)f=f[n];for(let n in o){let $=o[n];if(typeof $!="object")continue;let{$data:s}=$.definition,e=f[n];if(s&&e)f[n]=Xf(e)}}return t}_removeAllSchemas(t,i){for(let o in t){let r=t[o];if(!i||i.test(o)){if(typeof r=="string")delete t[o];else if(r&&!r.meta)this._cache.delete(r.schema),delete t[o]}}}_addSchema(t,i,o,r=this.opts.validateSchema,l=this.opts.addUsedSchema){let f,{schemaId:n}=this.opts;if(typeof t=="object")f=t[n];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof t!="boolean")throw Error("schema must be object or boolean");let $=this._cache.get(t);if($!==void 0)return $;o=(0,ti.normalizeId)(f||o);let s=ti.getSchemaRefs.call(this,t,o);if($=new _t.SchemaEnv({schema:t,schemaId:n,meta:i,baseId:o,localRefs:s}),this._cache.set($.schema,$),l&&!o.startsWith("#")){if(o)this._checkUnique(o);this.refs[o]=$}if(r)this.validateSchema(t,!0);return $}_checkUnique(t){if(this.schemas[t]||this.refs[t])throw Error(`schema with key or id "${t}" already exists`)}_compileSchemaEnv(t){if(t.meta)this._compileMetaSchema(t);else _t.compileSchema.call(this,t);if(!t.validate)throw Error("ajv implementation error");return t.validate}_compileMetaSchema(t){let i=this.opts;this.opts=this._metaOpts;try{_t.compileSchema.call(this,t)}finally{this.opts=i}}}Xi.ValidationError=Hd.default;Xi.MissingRefError=Jf.default;nt.default=Xi;function Zf(t,i,o,r="error"){for(let l in t){let f=l;if(f in i)this.logger[r](`${o}: option ${l}. ${t[f]}`)}}function Bf(t){return t=(0,ti.normalizeId)(t),this.schemas[t]||this.refs[t]}function kd(){let t=this.opts.schemas;if(!t)return;if(Array.isArray(t))this.addSchema(t);else for(let i in t)this.addSchema(t[i],i)}function Cd(){for(let t in this.opts.formats){let i=this.opts.formats[t];if(i)this.addFormat(t,i)}}function hd(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let i in t){let o=t[i];if(!o.keyword)o.keyword=i;this.addKeyword(o)}}function gd(){let t={...this.opts};for(let i of Ud)delete t[i];return t}var ad={log(){},warn(){},error(){}};function md(t){if(t===!1)return ad;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw Error("logger must implement log, warn and error methods")}var xd=/^[a-z_$][a-z0-9_$:-]*$/i;function _d(t,i){let{RULES:o}=this;if((0,Ho.eachItem)(t,(r)=>{if(o.keywords[r])throw Error(`Keyword ${r} is already defined`);if(!xd.test(r))throw Error(`Keyword ${r} has invalid name`)}),!i)return;if(i.$data&&!(("code"in i)||("validate"in i)))throw Error('$data keyword must have "code" or "validate" function')}function vo(t,i,o){var r;let l=i===null||i===void 0?void 0:i.post;if(o&&l)throw Error('keyword with "post" flag cannot have "type"');let{RULES:f}=this,n=l?f.post:f.rules.find(({type:s})=>s===o);if(!n)n={type:o,rules:[]},f.rules.push(n);if(f.keywords[t]=!0,!i)return;let $={keyword:t,definition:{...i,type:(0,Ai.getJSONTypes)(i.type),schemaType:(0,Ai.getJSONTypes)(i.schemaType)}};if(i.before)tI.call(this,n,$,i.before);else n.rules.push($);f.all[t]=$,(r=i.implements)===null||r===void 0||r.forEach((s)=>this.addKeyword(s))}function tI(t,i,o){let r=t.rules.findIndex((l)=>l.keyword===o);if(r>=0)t.rules.splice(r,0,i);else t.rules.push(i),this.logger.warn(`rule ${o} is not defined`)}function iI(t){let{metaSchema:i}=t;if(i===void 0)return;if(t.$data&&this.opts.$data)i=Xf(i);t.validateSchema=this.compile(i,!0)}var oI={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Xf(t){return{anyOf:[t,oI]}}});var Qf=c((zf)=>{Object.defineProperty(zf,"__esModule",{value:!0});var fI={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};zf.default=fI});var Qi=c((Df)=>{Object.defineProperty(Df,"__esModule",{value:!0});Df.callRef=Df.getValidate=void 0;var $I=gt(),Gf=R(),U=w(),Yt=E(),vf=mt(),Yi=q(),sI={keyword:"$ref",schemaType:"string",code(t){let{gen:i,schema:o,it:r}=t,{baseId:l,schemaEnv:f,validateName:n,opts:$,self:s}=r,{root:e}=f;if((o==="#"||o==="#/")&&l===e.baseId)return b();let u=vf.resolveRef.call(s,e,l,o);if(u===void 0)throw new $I.default(r.opts.uriResolver,l,o);if(u instanceof vf.SchemaEnv)return I(u);return p(u);function b(){if(f===e)return zi(t,n,f,f.$async);let y=i.scopeValue("root",{ref:e});return zi(t,U._`${y}.validate`,e,e.$async)}function I(y){let d=Hf(t,y);zi(t,d,y,y.$async)}function p(y){let d=i.scopeValue("schema",$.code.source===!0?{ref:y,code:(0,U.stringify)(y)}:{ref:y}),M=i.name("valid"),V=t.subschema({schema:y,dataTypes:[],schemaPath:U.nil,topSchemaRef:d,errSchemaPath:o},M);t.mergeEvaluated(V),t.ok(M)}}};function Hf(t,i){let{gen:o}=t;return i.validate?o.scopeValue("validate",{ref:i.validate}):U._`${o.scopeValue("wrapper",{ref:i})}.validate`}Df.getValidate=Hf;function zi(t,i,o,r){let{gen:l,it:f}=t,{allErrors:n,schemaEnv:$,opts:s}=f,e=s.passContext?Yt.default.this:U.nil;if(r)u();else b();function u(){if(!$.$async)throw Error("async schema referenced by sync schema");let y=l.let("valid");l.try(()=>{if(l.code(U._`await ${(0,Gf.callValidateCode)(t,i,e)}`),p(i),!n)l.assign(y,!0)},(d)=>{if(l.if(U._`!(${d} instanceof ${f.ValidationError})`,()=>l.throw(d)),I(d),!n)l.assign(y,!1)}),t.ok(y)}function b(){t.result((0,Gf.callValidateCode)(t,i,e),()=>p(i),()=>I(i))}function I(y){let d=U._`${y}.errors`;l.assign(Yt.default.vErrors,U._`${Yt.default.vErrors} === null ? ${d} : ${Yt.default.vErrors}.concat(${d})`),l.assign(Yt.default.errors,U._`${Yt.default.vErrors}.length`)}function p(y){var d;if(!f.opts.unevaluated)return;let M=(d=o===null||o===void 0?void 0:o.validate)===null||d===void 0?void 0:d.evaluated;if(f.props!==!0)if(M&&!M.dynamicProps){if(M.props!==void 0)f.props=Yi.mergeEvaluated.props(l,M.props,f.props)}else{let V=l.var("props",U._`${y}.evaluated.props`);f.props=Yi.mergeEvaluated.props(l,V,f.props,U.Name)}if(f.items!==!0)if(M&&!M.dynamicItems){if(M.items!==void 0)f.items=Yi.mergeEvaluated.items(l,M.items,f.items)}else{let V=l.var("items",U._`${y}.evaluated.items`);f.items=Yi.mergeEvaluated.items(l,V,f.items,U.Name)}}}Df.callRef=zi;Df.default=sI});var Uf=c((Kf)=>{Object.defineProperty(Kf,"__esModule",{value:!0});var bI=Qf(),yI=Qi(),dI=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",bI.default,yI.default];Kf.default=dI});var Ef=c((Nf)=>{Object.defineProperty(Nf,"__esModule",{value:!0});var Gi=w(),yt=Gi.operators,vi={maximum:{okStr:"<=",ok:yt.LTE,fail:yt.GT},minimum:{okStr:">=",ok:yt.GTE,fail:yt.LT},exclusiveMaximum:{okStr:"<",ok:yt.LT,fail:yt.GTE},exclusiveMinimum:{okStr:">",ok:yt.GT,fail:yt.LTE}},cI={message:({keyword:t,schemaCode:i})=>Gi.str`must be ${vi[t].okStr} ${i}`,params:({keyword:t,schemaCode:i})=>Gi._`{comparison: ${vi[t].okStr}, limit: ${i}}`},pI={keyword:Object.keys(vi),type:"number",schemaType:"number",$data:!0,error:cI,code(t){let{keyword:i,data:o,schemaCode:r}=t;t.fail$data(Gi._`${o} ${vi[i].fail} ${r} || isNaN(${o})`)}};Nf.default=pI});var Sf=c((Rf)=>{Object.defineProperty(Rf,"__esModule",{value:!0});var ii=w(),VI={message:({schemaCode:t})=>ii.str`must be multiple of ${t}`,params:({schemaCode:t})=>ii._`{multipleOf: ${t}}`},LI={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:VI,code(t){let{gen:i,data:o,schemaCode:r,it:l}=t,f=l.opts.multipleOfPrecision,n=i.let("res"),$=f?ii._`Math.abs(Math.round(${n}) - ${n}) > 1e-${f}`:ii._`${n} !== parseInt(${n})`;t.fail$data(ii._`(${r} === 0 || (${n} = ${o}/${r}, ${$}))`)}};Rf.default=LI});var hf=c((Cf)=>{Object.defineProperty(Cf,"__esModule",{value:!0});function kf(t){let i=t.length,o=0,r=0,l;while(r<i)if(o++,l=t.charCodeAt(r++),l>=55296&&l<=56319&&r<i){if(l=t.charCodeAt(r),(l&64512)===56320)r++}return o}Cf.default=kf;kf.code='require("ajv/dist/runtime/ucs2length").default'});var af=c((gf)=>{Object.defineProperty(gf,"__esModule",{value:!0});var Tt=w(),wI=q(),WI=hf(),qI={message({keyword:t,schemaCode:i}){let o=t==="maxLength"?"more":"fewer";return Tt.str`must NOT have ${o} than ${i} characters`},params:({schemaCode:t})=>Tt._`{limit: ${t}}`},jI={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:qI,code(t){let{keyword:i,data:o,schemaCode:r,it:l}=t,f=i==="maxLength"?Tt.operators.GT:Tt.operators.LT,n=l.opts.unicode===!1?Tt._`${o}.length`:Tt._`${(0,wI.useFunc)(t.gen,WI.default)}(${o})`;t.fail$data(Tt._`${n} ${f} ${r}`)}};gf.default=jI});var xf=c((mf)=>{Object.defineProperty(mf,"__esModule",{value:!0});var ZI=R(),BI=q(),zt=w(),JI={message:({schemaCode:t})=>zt.str`must match pattern "${t}"`,params:({schemaCode:t})=>zt._`{pattern: ${t}}`},AI={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:JI,code(t){let{gen:i,data:o,$data:r,schema:l,schemaCode:f,it:n}=t,$=n.opts.unicodeRegExp?"u":"";if(r){let{regExp:s}=n.opts.code,e=s.code==="new RegExp"?zt._`new RegExp`:(0,BI.useFunc)(i,s),u=i.let("valid");i.try(()=>i.assign(u,zt._`${e}(${f}, ${$}).test(${o})`),()=>i.assign(u,!1)),t.fail$data(zt._`!${u}`)}else{let s=(0,ZI.usePattern)(t,l);t.fail$data(zt._`!${s}.test(${o})`)}}};mf.default=AI});var tn=c((_f)=>{Object.defineProperty(_f,"__esModule",{value:!0});var oi=w(),YI={message({keyword:t,schemaCode:i}){let o=t==="maxProperties"?"more":"fewer";return oi.str`must NOT have ${o} than ${i} properties`},params:({schemaCode:t})=>oi._`{limit: ${t}}`},zI={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:YI,code(t){let{keyword:i,data:o,schemaCode:r}=t,l=i==="maxProperties"?oi.operators.GT:oi.operators.LT;t.fail$data(oi._`Object.keys(${o}).length ${l} ${r}`)}};_f.default=zI});var rn=c((on)=>{Object.defineProperty(on,"__esModule",{value:!0});var ri=R(),li=w(),GI=q(),vI={message:({params:{missingProperty:t}})=>li.str`must have required property '${t}'`,params:({params:{missingProperty:t}})=>li._`{missingProperty: ${t}}`},HI={keyword:"required",type:"object",schemaType:"array",$data:!0,error:vI,code(t){let{gen:i,schema:o,schemaCode:r,data:l,$data:f,it:n}=t,{opts:$}=n;if(!f&&o.length===0)return;let s=o.length>=$.loopRequired;if(n.allErrors)e();else u();if($.strictRequired){let p=t.parentSchema.properties,{definedProperties:y}=t.it;for(let d of o)if((p===null||p===void 0?void 0:p[d])===void 0&&!y.has(d)){let M=n.schemaEnv.baseId+n.errSchemaPath,V=`required property "${d}" is not defined at "${M}" (strictRequired)`;(0,GI.checkStrictMode)(n,V,n.opts.strictRequired)}}function e(){if(s||f)t.block$data(li.nil,b);else for(let p of o)(0,ri.checkReportMissingProp)(t,p)}function u(){let p=i.let("missing");if(s||f){let y=i.let("valid",!0);t.block$data(y,()=>I(p,y)),t.ok(y)}else i.if((0,ri.checkMissingProp)(t,o,p)),(0,ri.reportMissingProp)(t,p),i.else()}function b(){i.forOf("prop",r,(p)=>{t.setParams({missingProperty:p}),i.if((0,ri.noPropertyInData)(i,l,p,$.ownProperties),()=>t.error())})}function I(p,y){t.setParams({missingProperty:p}),i.forOf(p,r,()=>{i.assign(y,(0,ri.propertyInData)(i,l,p,$.ownProperties)),i.if((0,li.not)(y),()=>{t.error(),i.break()})},li.nil)}}};on.default=HI});var fn=c((ln)=>{Object.defineProperty(ln,"__esModule",{value:!0});var fi=w(),PI={message({keyword:t,schemaCode:i}){let o=t==="maxItems"?"more":"fewer";return fi.str`must NOT have ${o} than ${i} items`},params:({schemaCode:t})=>fi._`{limit: ${t}}`},KI={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:PI,code(t){let{keyword:i,data:o,schemaCode:r}=t,l=i==="maxItems"?fi.operators.GT:fi.operators.LT;t.fail$data(fi._`${o}.length ${l} ${r}`)}};ln.default=KI});var Hi=c(($n)=>{Object.defineProperty($n,"__esModule",{value:!0});var nn=To();nn.code='require("ajv/dist/runtime/equal").default';$n.default=nn});var en=c((sn)=>{Object.defineProperty(sn,"__esModule",{value:!0});var Do=Rt(),Q=w(),EI=q(),RI=Hi(),SI={message:({params:{i:t,j:i}})=>Q.str`must NOT have duplicate items (items ## ${i} and ${t} are identical)`,params:({params:{i:t,j:i}})=>Q._`{i: ${t}, j: ${i}}`},kI={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:SI,code(t){let{gen:i,data:o,$data:r,schema:l,parentSchema:f,schemaCode:n,it:$}=t;if(!r&&!l)return;let s=i.let("valid"),e=f.items?(0,Do.getSchemaTypes)(f.items):[];t.block$data(s,u,Q._`${n} === false`),t.ok(s);function u(){let y=i.let("i",Q._`${o}.length`),d=i.let("j");t.setParams({i:y,j:d}),i.assign(s,!0),i.if(Q._`${y} > 1`,()=>(b()?I:p)(y,d))}function b(){return e.length>0&&!e.some((y)=>y==="object"||y==="array")}function I(y,d){let M=i.name("item"),V=(0,Do.checkDataTypes)(e,M,$.opts.strictNumbers,Do.DataType.Wrong),Z=i.const("indices",Q._`{}`);i.for(Q._`;${y}--;`,()=>{if(i.let(M,Q._`${o}[${y}]`),i.if(V,Q._`continue`),e.length>1)i.if(Q._`typeof ${M} == "string"`,Q._`${M} += "_"`);i.if(Q._`typeof ${Z}[${M}] == "number"`,()=>{i.assign(d,Q._`${Z}[${M}]`),t.error(),i.assign(s,!1).break()}).code(Q._`${Z}[${M}] = ${y}`)})}function p(y,d){let M=(0,EI.useFunc)(i,RI.default),V=i.name("outer");i.label(V).for(Q._`;${y}--;`,()=>i.for(Q._`${d} = ${y}; ${d}--;`,()=>i.if(Q._`${M}(${o}[${y}], ${o}[${d}])`,()=>{t.error(),i.assign(s,!1).break(V)})))}}};sn.default=kI});var bn=c((un)=>{Object.defineProperty(un,"__esModule",{value:!0});var Po=w(),hI=q(),gI=Hi(),aI={message:"must be equal to constant",params:({schemaCode:t})=>Po._`{allowedValue: ${t}}`},mI={keyword:"const",$data:!0,error:aI,code(t){let{gen:i,data:o,$data:r,schemaCode:l,schema:f}=t;if(r||f&&typeof f=="object")t.fail$data(Po._`!${(0,hI.useFunc)(i,gI.default)}(${o}, ${l})`);else t.fail(Po._`${f} !== ${o}`)}};un.default=mI});var dn=c((yn)=>{Object.defineProperty(yn,"__esModule",{value:!0});var ni=w(),_I=q(),tc=Hi(),ic={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>ni._`{allowedValues: ${t}}`},oc={keyword:"enum",schemaType:"array",$data:!0,error:ic,code(t){let{gen:i,data:o,$data:r,schema:l,schemaCode:f,it:n}=t;if(!r&&l.length===0)throw Error("enum must have non-empty array");let $=l.length>=n.opts.loopEnum,s,e=()=>s!==null&&s!==void 0?s:s=(0,_I.useFunc)(i,tc.default),u;if($||r)u=i.let("valid"),t.block$data(u,b);else{if(!Array.isArray(l))throw Error("ajv implementation error");let p=i.const("vSchema",f);u=(0,ni.or)(...l.map((y,d)=>I(p,d)))}t.pass(u);function b(){i.assign(u,!1),i.forOf("v",f,(p)=>i.if(ni._`${e()}(${o}, ${p})`,()=>i.assign(u,!0).break()))}function I(p,y){let d=l[y];return typeof d==="object"&&d!==null?ni._`${e()}(${o}, ${p}[${y}])`:ni._`${o} === ${d}`}}};yn.default=oc});var cn=c((In)=>{Object.defineProperty(In,"__esModule",{value:!0});var lc=Ef(),fc=Sf(),nc=af(),$c=xf(),sc=tn(),ec=rn(),uc=fn(),bc=en(),yc=bn(),dc=dn(),Ic=[lc.default,fc.default,nc.default,$c.default,sc.default,ec.default,uc.default,bc.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},yc.default,dc.default];In.default=Ic});var Uo=c((Mn)=>{Object.defineProperty(Mn,"__esModule",{value:!0});Mn.validateAdditionalItems=void 0;var wt=w(),Ko=q(),pc={message:({params:{len:t}})=>wt.str`must NOT have more than ${t} items`,params:({params:{len:t}})=>wt._`{limit: ${t}}`},Mc={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:pc,code(t){let{parentSchema:i,it:o}=t,{items:r}=i;if(!Array.isArray(r)){(0,Ko.checkStrictMode)(o,'"additionalItems" is ignored when "items" is not an array of schemas');return}pn(t,r)}};function pn(t,i){let{gen:o,schema:r,data:l,keyword:f,it:n}=t;n.items=!0;let $=o.const("len",wt._`${l}.length`);if(r===!1)t.setParams({len:i.length}),t.pass(wt._`${$} <= ${i.length}`);else if(typeof r=="object"&&!(0,Ko.alwaysValidSchema)(n,r)){let e=o.var("valid",wt._`${$} <= ${i.length}`);o.if((0,wt.not)(e),()=>s(e)),t.ok(e)}function s(e){o.forRange("i",i.length,$,(u)=>{if(t.subschema({keyword:f,dataProp:u,dataPropType:Ko.Type.Num},e),!n.allErrors)o.if((0,wt.not)(e),()=>o.break())})}}Mn.validateAdditionalItems=pn;Mn.default=Mc});var No=c((Tn)=>{Object.defineProperty(Tn,"__esModule",{value:!0});Tn.validateTuple=void 0;var Ln=w(),Di=q(),Lc=R(),Oc={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:i,it:o}=t;if(Array.isArray(i))return On(t,"additionalItems",i);if(o.items=!0,(0,Di.alwaysValidSchema)(o,i))return;t.ok((0,Lc.validateArray)(t))}};function On(t,i,o=t.schema){let{gen:r,parentSchema:l,data:f,keyword:n,it:$}=t;if(u(l),$.opts.unevaluated&&o.length&&$.items!==!0)$.items=Di.mergeEvaluated.items(r,o.length,$.items);let s=r.name("valid"),e=r.const("len",Ln._`${f}.length`);o.forEach((b,I)=>{if((0,Di.alwaysValidSchema)($,b))return;r.if(Ln._`${e} > ${I}`,()=>t.subschema({keyword:n,schemaProp:I,dataProp:I},s)),t.ok(s)});function u(b){let{opts:I,errSchemaPath:p}=$,y=o.length,d=y===b.minItems&&(y===b.maxItems||b[i]===!1);if(I.strictTuples&&!d){let M=`"${n}" is ${y}-tuple, but minItems or maxItems/${i} are not specified or different at path "${p}"`;(0,Di.checkStrictMode)($,M,I.strictTuples)}}}Tn.validateTuple=On;Tn.default=Oc});var qn=c((Wn)=>{Object.defineProperty(Wn,"__esModule",{value:!0});var wc=No(),Wc={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(t)=>(0,wc.validateTuple)(t,"items")};Wn.default=Wc});var Zn=c((Fn)=>{Object.defineProperty(Fn,"__esModule",{value:!0});var jn=w(),jc=q(),Fc=R(),Zc=Uo(),Bc={message:({params:{len:t}})=>jn.str`must NOT have more than ${t} items`,params:({params:{len:t}})=>jn._`{limit: ${t}}`},Jc={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:Bc,code(t){let{schema:i,parentSchema:o,it:r}=t,{prefixItems:l}=o;if(r.items=!0,(0,jc.alwaysValidSchema)(r,i))return;if(l)(0,Zc.validateAdditionalItems)(t,l);else t.ok((0,Fc.validateArray)(t))}};Fn.default=Jc});var Jn=c((Bn)=>{Object.defineProperty(Bn,"__esModule",{value:!0});var S=w(),Pi=q(),Xc={message:({params:{min:t,max:i}})=>i===void 0?S.str`must contain at least ${t} valid item(s)`:S.str`must contain at least ${t} and no more than ${i} valid item(s)`,params:({params:{min:t,max:i}})=>i===void 0?S._`{minContains: ${t}}`:S._`{minContains: ${t}, maxContains: ${i}}`},Yc={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:Xc,code(t){let{gen:i,schema:o,parentSchema:r,data:l,it:f}=t,n,$,{minContains:s,maxContains:e}=r;if(f.opts.next)n=s===void 0?1:s,$=e;else n=1;let u=i.const("len",S._`${l}.length`);if(t.setParams({min:n,max:$}),$===void 0&&n===0){(0,Pi.checkStrictMode)(f,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if($!==void 0&&n>$){(0,Pi.checkStrictMode)(f,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,Pi.alwaysValidSchema)(f,o)){let d=S._`${u} >= ${n}`;if($!==void 0)d=S._`${d} && ${u} <= ${$}`;t.pass(d);return}f.items=!0;let b=i.name("valid");if($===void 0&&n===1)p(b,()=>i.if(b,()=>i.break()));else if(n===0){if(i.let(b,!0),$!==void 0)i.if(S._`${l}.length > 0`,I)}else i.let(b,!1),I();t.result(b,()=>t.reset());function I(){let d=i.name("_valid"),M=i.let("count",0);p(d,()=>i.if(d,()=>y(M)))}function p(d,M){i.forRange("i",0,u,(V)=>{t.subschema({keyword:"contains",dataProp:V,dataPropType:Pi.Type.Num,compositeRule:!0},d),M()})}function y(d){if(i.code(S._`${d}++`),$===void 0)i.if(S._`${d} >= ${n}`,()=>i.assign(b,!0).break());else if(i.if(S._`${d} > ${$}`,()=>i.assign(b,!1).break()),n===1)i.assign(b,!0);else i.if(S._`${d} >= ${n}`,()=>i.assign(b,!0))}}};Bn.default=Yc});var Ki=c((Yn)=>{Object.defineProperty(Yn,"__esModule",{value:!0});Yn.validateSchemaDeps=Yn.validatePropertyDeps=Yn.error=void 0;var Eo=w(),Qc=q(),$i=R();Yn.error={message:({params:{property:t,depsCount:i,deps:o}})=>{let r=i===1?"property":"properties";return Eo.str`must have ${r} ${o} when property ${t} is present`},params:({params:{property:t,depsCount:i,deps:o,missingProperty:r}})=>Eo._`{property: ${t},
8
8
  missingProperty: ${r},
9
9
  depsCount: ${i},
10
- deps: ${o}}`};var pe={keyword:"dependencies",type:"object",schemaType:"object",error:Tf.error,code(t){let[i,o]=Le(t);Lf(t,i),qf(t,o)}};function Le({schema:t}){let i={},o={};for(let r in t){if(r==="__proto__")continue;let $=Array.isArray(t[r])?i:o;$[r]=t[r]}return[i,o]}function Lf(t,i=t.schema){let{gen:o,data:r,it:$}=t;if(Object.keys(i).length===0)return;let l=o.let("missing");for(let f in i){let s=i[f];if(s.length===0)continue;let n=(0,ti.propertyInData)(o,r,f,$.opts.ownProperties);if(t.setParams({property:f,depsCount:s.length,deps:s.join(", ")}),$.allErrors)o.if(n,()=>{for(let b of s)(0,ti.checkReportMissingProp)(t,b)});else o.if(Ho._`${n} && (${(0,ti.checkMissingProp)(t,s,l)})`),(0,ti.reportMissingProp)(t,l),o.else()}}Tf.validatePropertyDeps=Lf;function qf(t,i=t.schema){let{gen:o,data:r,keyword:$,it:l}=t,f=o.name("valid");for(let s in i){if((0,ce.alwaysValidSchema)(l,i[s]))continue;o.if((0,ti.propertyInData)(o,r,s,l.opts.ownProperties),()=>{let n=t.subschema({keyword:$,schemaProp:s},f);t.mergeValidEvaluated(n,f)},()=>o.var(f,!0)),t.ok(f)}}Tf.validateSchemaDeps=qf;Tf.default=pe});var Ff=M((wf)=>{Object.defineProperty(wf,"__esModule",{value:!0});var jf=O(),Oe=j(),We={message:"property name must be valid",params:({params:t})=>jf._`{propertyName: ${t.propertyName}}`},je={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:We,code(t){let{gen:i,schema:o,data:r,it:$}=t;if((0,Oe.alwaysValidSchema)($,o))return;let l=i.name("valid");i.forIn("key",r,(f)=>{t.setParams({propertyName:f}),t.subschema({keyword:"propertyNames",data:f,dataTypes:["string"],propertyName:f,compositeRule:!0},l),i.if((0,jf.not)(l),()=>{if(t.error(!0),!$.allErrors)i.break()})}),t.ok(l)}};wf.default=je});var Do=M((Zf)=>{Object.defineProperty(Zf,"__esModule",{value:!0});var Qi=E(),m=O(),Fe=P(),Gi=j(),Ze={message:"must NOT have additional properties",params:({params:t})=>m._`{additionalProperty: ${t.additionalProperty}}`},Be={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Ze,code(t){let{gen:i,schema:o,parentSchema:r,data:$,errsCount:l,it:f}=t;if(!l)throw Error("ajv implementation error");let{allErrors:s,opts:n}=f;if(f.props=!0,n.removeAdditional!=="all"&&(0,Gi.alwaysValidSchema)(f,o))return;let b=(0,Qi.allSchemaProperties)(r.properties),u=(0,Qi.allSchemaProperties)(r.patternProperties);I(),t.ok(m._`${l} === ${Fe.default.errors}`);function I(){i.forIn("key",$,(c)=>{if(!b.length&&!u.length)y(c);else i.if(V(c),()=>y(c))})}function V(c){let p;if(b.length>8){let Z=(0,Gi.schemaRefOrVal)(f,r.properties,"properties");p=(0,Qi.isOwnProperty)(i,Z,c)}else if(b.length)p=(0,m.or)(...b.map((Z)=>m._`${c} === ${Z}`));else p=m.nil;if(u.length)p=(0,m.or)(p,...u.map((Z)=>m._`${(0,Qi.usePattern)(t,Z)}.test(${c})`));return(0,m.not)(p)}function d(c){i.code(m._`delete ${$}[${c}]`)}function y(c){if(n.removeAdditional==="all"||n.removeAdditional&&o===!1){d(c);return}if(o===!1){if(t.setParams({additionalProperty:c}),t.error(),!s)i.break();return}if(typeof o=="object"&&!(0,Gi.alwaysValidSchema)(f,o)){let p=i.name("valid");if(n.removeAdditional==="failing")e(c,p,!1),i.if((0,m.not)(p),()=>{t.reset(),d(c)});else if(e(c,p),!s)i.if((0,m.not)(p),()=>i.break())}}function e(c,p,Z){let w={keyword:"additionalProperties",dataProp:c,dataPropType:Gi.Type.Str};if(Z===!1)Object.assign(w,{compositeRule:!0,createErrors:!1,allErrors:!1});t.subschema(w,p)}}};Zf.default=Be});var Yf=M((Xf)=>{Object.defineProperty(Xf,"__esModule",{value:!0});var Xe=Nt(),Bf=E(),vo=j(),Jf=Do(),Ye={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:i,schema:o,parentSchema:r,data:$,it:l}=t;if(l.opts.removeAdditional==="all"&&r.additionalProperties===void 0)Jf.default.code(new Xe.KeywordCxt(l,Jf.default,"additionalProperties"));let f=(0,Bf.allSchemaProperties)(o);for(let I of f)l.definedProperties.add(I);if(l.opts.unevaluated&&f.length&&l.props!==!0)l.props=vo.mergeEvaluated.props(i,(0,vo.toHash)(f),l.props);let s=f.filter((I)=>!(0,vo.alwaysValidSchema)(l,o[I]));if(s.length===0)return;let n=i.name("valid");for(let I of s){if(b(I))u(I);else{if(i.if((0,Bf.propertyInData)(i,$,I,l.opts.ownProperties)),u(I),!l.allErrors)i.else().var(n,!0);i.endIf()}t.it.definedProperties.add(I),t.ok(n)}function b(I){return l.opts.useDefaults&&!l.compositeRule&&o[I].default!==void 0}function u(I){t.subschema({keyword:"properties",schemaProp:I,dataProp:I},n)}}};Xf.default=Ye});var Hf=M((Gf)=>{Object.defineProperty(Gf,"__esModule",{value:!0});var Af=E(),Hi=O(),zf=j(),Qf=j(),ze={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:i,schema:o,data:r,parentSchema:$,it:l}=t,{opts:f}=l,s=(0,Af.allSchemaProperties)(o),n=s.filter((e)=>(0,zf.alwaysValidSchema)(l,o[e]));if(s.length===0||n.length===s.length&&(!l.opts.unevaluated||l.props===!0))return;let b=f.strictSchema&&!f.allowMatchingProperties&&$.properties,u=i.name("valid");if(l.props!==!0&&!(l.props instanceof Hi.Name))l.props=(0,Qf.evaluatedPropsToName)(i,l.props);let{props:I}=l;V();function V(){for(let e of s){if(b)d(e);if(l.allErrors)y(e);else i.var(u,!0),y(e),i.if(u)}}function d(e){for(let c in b)if(new RegExp(e).test(c))(0,zf.checkStrictMode)(l,`property ${c} matches pattern ${e} (use allowMatchingProperties)`)}function y(e){i.forIn("key",r,(c)=>{i.if(Hi._`${(0,Af.usePattern)(t,e)}.test(${c})`,()=>{let p=n.includes(e);if(!p)t.subschema({keyword:"patternProperties",schemaProp:e,dataProp:c,dataPropType:Qf.Type.Str},u);if(l.opts.unevaluated&&I!==!0)i.assign(Hi._`${I}[${c}]`,!0);else if(!p&&!l.allErrors)i.if((0,Hi.not)(u),()=>i.break())})})}}};Gf.default=ze});var vf=M((Df)=>{Object.defineProperty(Df,"__esModule",{value:!0});var Ge=j(),He={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:i,schema:o,it:r}=t;if((0,Ge.alwaysValidSchema)(r,o)){t.fail();return}let $=i.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},$),t.failResult($,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};Df.default=He});var Uf=M((Kf)=>{Object.defineProperty(Kf,"__esModule",{value:!0});var ve=E(),Ke={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:ve.validateUnion,error:{message:"must match a schema in anyOf"}};Kf.default=Ke});var Pf=M((Nf)=>{Object.defineProperty(Nf,"__esModule",{value:!0});var Di=O(),Ne=j(),Pe={message:"must match exactly one schema in oneOf",params:({params:t})=>Di._`{passingSchemas: ${t.passing}}`},Ee={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Pe,code(t){let{gen:i,schema:o,parentSchema:r,it:$}=t;if(!Array.isArray(o))throw Error("ajv implementation error");if($.opts.discriminator&&r.discriminator)return;let l=o,f=i.let("valid",!1),s=i.let("passing",null),n=i.name("_valid");t.setParams({passing:s}),i.block(b),t.result(f,()=>t.reset(),()=>t.error(!0));function b(){l.forEach((u,I)=>{let V;if((0,Ne.alwaysValidSchema)($,u))i.var(n,!0);else V=t.subschema({keyword:"oneOf",schemaProp:I,compositeRule:!0},n);if(I>0)i.if(Di._`${n} && ${f}`).assign(f,!1).assign(s,Di._`[${s}, ${I}]`).else();i.if(n,()=>{if(i.assign(f,!0),i.assign(s,I),V)t.mergeEvaluated(V,Di.Name)})})}}};Nf.default=Ee});var Rf=M((Ef)=>{Object.defineProperty(Ef,"__esModule",{value:!0});var Se=j(),ke={keyword:"allOf",schemaType:"array",code(t){let{gen:i,schema:o,it:r}=t;if(!Array.isArray(o))throw Error("ajv implementation error");let $=i.name("valid");o.forEach((l,f)=>{if((0,Se.alwaysValidSchema)(r,l))return;let s=t.subschema({keyword:"allOf",schemaProp:f},$);t.ok($),t.mergeEvaluated(s)})}};Ef.default=ke});var hf=M((Cf)=>{Object.defineProperty(Cf,"__esModule",{value:!0});var vi=O(),kf=j(),he={message:({params:t})=>vi.str`must match "${t.ifClause}" schema`,params:({params:t})=>vi._`{failingKeyword: ${t.ifClause}}`},ge={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:he,code(t){let{gen:i,parentSchema:o,it:r}=t;if(o.then===void 0&&o.else===void 0)(0,kf.checkStrictMode)(r,'"if" without "then" and "else" is ignored');let $=Sf(r,"then"),l=Sf(r,"else");if(!$&&!l)return;let f=i.let("valid",!0),s=i.name("_valid");if(n(),t.reset(),$&&l){let u=i.let("ifClause");t.setParams({ifClause:u}),i.if(s,b("then",u),b("else",u))}else if($)i.if(s,b("then"));else i.if((0,vi.not)(s),b("else"));t.pass(f,()=>t.error(!0));function n(){let u=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},s);t.mergeEvaluated(u)}function b(u,I){return()=>{let V=t.subschema({keyword:u},s);if(i.assign(f,s),t.mergeValidEvaluated(V,f),I)i.assign(I,vi._`${u}`);else t.setParams({ifClause:u})}}}};function Sf(t,i){let o=t.schema[i];return o!==void 0&&!(0,kf.alwaysValidSchema)(t,o)}Cf.default=ge});var mf=M((gf)=>{Object.defineProperty(gf,"__esModule",{value:!0});var xe=j(),ae={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:i,it:o}){if(i.if===void 0)(0,xe.checkStrictMode)(o,`"${t}" without "if" is ignored`)}};gf.default=ae});var af=M((xf)=>{Object.defineProperty(xf,"__esModule",{value:!0});var tM=Qo(),iM=ef(),oM=Go(),rM=Vf(),$M=pf(),lM=zi(),fM=Ff(),sM=Do(),nM=Yf(),bM=Hf(),uM=vf(),IM=Uf(),yM=Pf(),eM=Rf(),MM=hf(),dM=mf();function VM(t=!1){let i=[uM.default,IM.default,yM.default,eM.default,MM.default,dM.default,fM.default,sM.default,lM.default,nM.default,bM.default];if(t)i.push(iM.default,rM.default);else i.push(tM.default,oM.default);return i.push($M.default),i}xf.default=VM});var Uo=M((is)=>{Object.defineProperty(is,"__esModule",{value:!0});is.dynamicAnchor=void 0;var Ko=O(),pM=P(),_f=Rt(),LM=Zi(),qM={keyword:"$dynamicAnchor",schemaType:"string",code:(t)=>ts(t,t.schema)};function ts(t,i){let{gen:o,it:r}=t;r.schemaEnv.root.dynamicAnchors[i]=!0;let $=Ko._`${pM.default.dynamicAnchors}${(0,Ko.getProperty)(i)}`,l=r.errSchemaPath==="#"?r.validateName:TM(t);o.if(Ko._`!${$}`,()=>o.assign($,l))}is.dynamicAnchor=ts;function TM(t){let{schemaEnv:i,schema:o,self:r}=t.it,{root:$,baseId:l,localRefs:f,meta:s}=i.root,{schemaId:n}=r.opts,b=new _f.SchemaEnv({schema:o,schemaId:n,root:$,baseId:l,localRefs:f,meta:s});return _f.compileSchema.call(r,b),(0,LM.getValidate)(t,b)}is.default=qM});var No=M((fs)=>{Object.defineProperty(fs,"__esModule",{value:!0});fs.dynamicRef=void 0;var rs=O(),WM=P(),$s=Zi(),jM={keyword:"$dynamicRef",schemaType:"string",code:(t)=>ls(t,t.schema)};function ls(t,i){let{gen:o,keyword:r,it:$}=t;if(i[0]!=="#")throw Error(`"${r}" only supports hash fragment reference`);let l=i.slice(1);if($.allErrors)f();else{let n=o.let("valid",!1);f(n),t.ok(n)}function f(n){if($.schemaEnv.root.dynamicAnchors[l]){let b=o.let("_v",rs._`${WM.default.dynamicAnchors}${(0,rs.getProperty)(l)}`);o.if(b,s(b,n),s($.validateName,n))}else s($.validateName,n)()}function s(n,b){return b?()=>o.block(()=>{(0,$s.callRef)(t,n),o.let(b,!0)}):()=>(0,$s.callRef)(t,n)}}fs.dynamicRef=ls;fs.default=jM});var bs=M((ns)=>{Object.defineProperty(ns,"__esModule",{value:!0});var FM=Uo(),ZM=j(),BM={keyword:"$recursiveAnchor",schemaType:"boolean",code(t){if(t.schema)(0,FM.dynamicAnchor)(t,"");else(0,ZM.checkStrictMode)(t.it,"$recursiveAnchor: false is ignored")}};ns.default=BM});var Is=M((us)=>{Object.defineProperty(us,"__esModule",{value:!0});var XM=No(),YM={keyword:"$recursiveRef",schemaType:"string",code:(t)=>(0,XM.dynamicRef)(t,t.schema)};us.default=YM});var es=M((ys)=>{Object.defineProperty(ys,"__esModule",{value:!0});var zM=Uo(),QM=No(),GM=bs(),HM=Is(),DM=[zM.default,QM.default,GM.default,HM.default];ys.default=DM});var Vs=M((ds)=>{Object.defineProperty(ds,"__esModule",{value:!0});var Ms=zi(),KM={keyword:"dependentRequired",type:"object",schemaType:"object",error:Ms.error,code:(t)=>(0,Ms.validatePropertyDeps)(t)};ds.default=KM});var ps=M((cs)=>{Object.defineProperty(cs,"__esModule",{value:!0});var NM=zi(),PM={keyword:"dependentSchemas",type:"object",schemaType:"object",code:(t)=>(0,NM.validateSchemaDeps)(t)};cs.default=PM});var qs=M((Ls)=>{Object.defineProperty(Ls,"__esModule",{value:!0});var RM=j(),SM={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:t,parentSchema:i,it:o}){if(i.contains===void 0)(0,RM.checkStrictMode)(o,`"${t}" without "contains" is ignored`)}};Ls.default=SM});var Os=M((Ts)=>{Object.defineProperty(Ts,"__esModule",{value:!0});var CM=Vs(),hM=ps(),gM=qs(),mM=[CM.default,hM.default,gM.default];Ts.default=mM});var ws=M((js)=>{Object.defineProperty(js,"__esModule",{value:!0});var It=O(),Ws=j(),aM=P(),_M={message:"must NOT have unevaluated properties",params:({params:t})=>It._`{unevaluatedProperty: ${t.unevaluatedProperty}}`},td={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:_M,code(t){let{gen:i,schema:o,data:r,errsCount:$,it:l}=t;if(!$)throw Error("ajv implementation error");let{allErrors:f,props:s}=l;if(s instanceof It.Name)i.if(It._`${s} !== true`,()=>i.forIn("key",r,(I)=>i.if(b(s,I),()=>n(I))));else if(s!==!0)i.forIn("key",r,(I)=>s===void 0?n(I):i.if(u(s,I),()=>n(I)));l.props=!0,t.ok(It._`${$} === ${aM.default.errors}`);function n(I){if(o===!1){if(t.setParams({unevaluatedProperty:I}),t.error(),!f)i.break();return}if(!(0,Ws.alwaysValidSchema)(l,o)){let V=i.name("valid");if(t.subschema({keyword:"unevaluatedProperties",dataProp:I,dataPropType:Ws.Type.Str},V),!f)i.if((0,It.not)(V),()=>i.break())}}function b(I,V){return It._`!${I} || !${I}[${V}]`}function u(I,V){let d=[];for(let y in I)if(I[y]===!0)d.push(It._`${V} !== ${y}`);return(0,It.and)(...d)}}};js.default=td});var Bs=M((Zs)=>{Object.defineProperty(Zs,"__esModule",{value:!0});var qt=O(),Fs=j(),od={message:({params:{len:t}})=>qt.str`must NOT have more than ${t} items`,params:({params:{len:t}})=>qt._`{limit: ${t}}`},rd={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:od,code(t){let{gen:i,schema:o,data:r,it:$}=t,l=$.items||0;if(l===!0)return;let f=i.const("len",qt._`${r}.length`);if(o===!1)t.setParams({len:l}),t.fail(qt._`${f} > ${l}`);else if(typeof o=="object"&&!(0,Fs.alwaysValidSchema)($,o)){let n=i.var("valid",qt._`${f} <= ${l}`);i.if((0,qt.not)(n),()=>s(n,l)),t.ok(n)}$.items=!0;function s(n,b){i.forRange("i",b,f,(u)=>{if(t.subschema({keyword:"unevaluatedItems",dataProp:u,dataPropType:Fs.Type.Num},n),!$.allErrors)i.if((0,qt.not)(n),()=>i.break())})}}};Zs.default=rd});var Xs=M((Js)=>{Object.defineProperty(Js,"__esModule",{value:!0});var ld=ws(),fd=Bs(),sd=[ld.default,fd.default];Js.default=sd});var As=M((Ys)=>{Object.defineProperty(Ys,"__esModule",{value:!0});var A=O(),bd={message:({schemaCode:t})=>A.str`must match format "${t}"`,params:({schemaCode:t})=>A._`{format: ${t}}`},ud={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:bd,code(t,i){let{gen:o,data:r,$data:$,schema:l,schemaCode:f,it:s}=t,{opts:n,errSchemaPath:b,schemaEnv:u,self:I}=s;if(!n.validateFormats)return;if($)V();else d();function V(){let y=o.scopeValue("formats",{ref:I.formats,code:n.code.formats}),e=o.const("fDef",A._`${y}[${f}]`),c=o.let("fType"),p=o.let("format");o.if(A._`typeof ${e} == "object" && !(${e} instanceof RegExp)`,()=>o.assign(c,A._`${e}.type || "string"`).assign(p,A._`${e}.validate`),()=>o.assign(c,A._`"string"`).assign(p,e)),t.fail$data((0,A.or)(Z(),w()));function Z(){if(n.strictSchema===!1)return A.nil;return A._`${f} && !${p}`}function w(){let X=u.$async?A._`(${e}.async ? await ${p}(${r}) : ${p}(${r}))`:A._`${p}(${r})`,T=A._`(typeof ${p} == "function" ? ${X} : ${p}.test(${r}))`;return A._`${p} && ${p} !== true && ${c} === ${i} && !${T}`}}function d(){let y=I.formats[l];if(!y){Z();return}if(y===!0)return;let[e,c,p]=w(y);if(e===i)t.pass(X());function Z(){if(n.strictSchema===!1){I.logger.warn(T());return}throw Error(T());function T(){return`unknown format "${l}" ignored in schema at path "${b}"`}}function w(T){let x=T instanceof RegExp?(0,A.regexpCode)(T):n.code.formats?A._`${n.code.formats}${(0,A.getProperty)(l)}`:void 0,it=o.scopeValue("formats",{key:l,ref:T,code:x});if(typeof T=="object"&&!(T instanceof RegExp))return[T.type||"string",T.validate,A._`${it}.validate`];return["string",T,it]}function X(){if(typeof y=="object"&&!(y instanceof RegExp)&&y.async){if(!u.$async)throw Error("async format in sync schema");return A._`await ${p}(${r})`}return typeof c=="function"?A._`${p}(${r})`:A._`${p}.test(${r})`}}}};Ys.default=ud});var Qs=M((zs)=>{Object.defineProperty(zs,"__esModule",{value:!0});var yd=As(),ed=[yd.default];zs.default=ed});var Ds=M((Gs)=>{Object.defineProperty(Gs,"__esModule",{value:!0});Gs.contentVocabulary=Gs.metadataVocabulary=void 0;Gs.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Gs.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var Us=M((Ks)=>{Object.defineProperty(Ks,"__esModule",{value:!0});var Vd=Xl(),cd=$f(),pd=af(),Ld=es(),qd=Os(),Td=Xs(),Od=Qs(),vs=Ds(),Wd=[Ld.default,Vd.default,cd.default,(0,pd.default)(!0),Od.default,vs.metadataVocabulary,vs.contentVocabulary,qd.default,Td.default];Ks.default=Wd});var Rs=M((Ps)=>{Object.defineProperty(Ps,"__esModule",{value:!0});Ps.DiscrError=void 0;var Ns;(function(t){t.Tag="tag",t.Mapping="mapping"})(Ns||(Ps.DiscrError=Ns={}))});var Cs=M((ks)=>{Object.defineProperty(ks,"__esModule",{value:!0});var Xt=O(),Po=Rs(),Ss=Rt(),wd=Pt(),Fd=j(),Zd={message:({params:{discrError:t,tagName:i}})=>t===Po.DiscrError.Tag?`tag "${i}" must be string`:`value of tag "${i}" must be in oneOf`,params:({params:{discrError:t,tag:i,tagName:o}})=>Xt._`{error: ${t}, tag: ${o}, tagValue: ${i}}`},Bd={keyword:"discriminator",type:"object",schemaType:"object",error:Zd,code(t){let{gen:i,data:o,schema:r,parentSchema:$,it:l}=t,{oneOf:f}=$;if(!l.opts.discriminator)throw Error("discriminator: requires discriminator option");let s=r.propertyName;if(typeof s!="string")throw Error("discriminator: requires propertyName");if(r.mapping)throw Error("discriminator: mapping is not supported");if(!f)throw Error("discriminator: requires oneOf keyword");let n=i.let("valid",!1),b=i.const("tag",Xt._`${o}${(0,Xt.getProperty)(s)}`);i.if(Xt._`typeof ${b} == "string"`,()=>u(),()=>t.error(!1,{discrError:Po.DiscrError.Tag,tag:b,tagName:s})),t.ok(n);function u(){let d=V();i.if(!1);for(let y in d)i.elseIf(Xt._`${b} === ${y}`),i.assign(n,I(d[y]));i.else(),t.error(!1,{discrError:Po.DiscrError.Mapping,tag:b,tagName:s}),i.endIf()}function I(d){let y=i.name("valid"),e=t.subschema({keyword:"oneOf",schemaProp:d},y);return t.mergeEvaluated(e,Xt.Name),y}function V(){var d;let y={},e=p($),c=!0;for(let X=0;X<f.length;X++){let T=f[X];if((T===null||T===void 0?void 0:T.$ref)&&!(0,Fd.schemaHasRulesButRef)(T,l.self.RULES)){let it=T.$ref;if(T=Ss.resolveRef.call(l.self,l.schemaEnv.root,l.baseId,it),T instanceof Ss.SchemaEnv)T=T.schema;if(T===void 0)throw new wd.default(l.opts.uriResolver,l.baseId,it)}let x=(d=T===null||T===void 0?void 0:T.properties)===null||d===void 0?void 0:d[s];if(typeof x!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${s}"`);c=c&&(e||p(T)),Z(x,X)}if(!c)throw Error(`discriminator: "${s}" must be required`);return y;function p({required:X}){return Array.isArray(X)&&X.includes(s)}function Z(X,T){if(X.const)w(X.const,T);else if(X.enum)for(let x of X.enum)w(x,T);else throw Error(`discriminator: "properties/${s}" must have "const" or "enum"`)}function w(X,T){if(typeof X!="string"||X in y)throw Error(`discriminator: "${s}" values must be unique strings`);y[X]=T}}}};ks.default=Bd});var hs=M((B8,Xd)=>{Xd.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}});var gs=M((J8,Yd)=>{Yd.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}});var ms=M((X8,Ad)=>{Ad.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}});var xs=M((Y8,zd)=>{zd.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}});var as=M((A8,Qd)=>{Qd.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}});var _s=M((z8,Gd)=>{Gd.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}});var tn=M((Q8,Hd)=>{Hd.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}});var on=M((G8,Dd)=>{Dd.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}});var $n=M((rn)=>{Object.defineProperty(rn,"__esModule",{value:!0});var vd=hs(),Kd=gs(),Ud=ms(),Nd=xs(),Pd=as(),Ed=_s(),Rd=tn(),Sd=on(),kd=["/properties"];function Cd(t){return[vd,Kd,Ud,Nd,Pd,i(this,Ed),Rd,i(this,Sd)].forEach((o)=>this.addMetaSchema(o,void 0,!1)),this;function i(o,r){return t?o.$dataMetaSchema(r,kd):r}}rn.default=Cd});var ln=M((N,Ro)=>{Object.defineProperty(N,"__esModule",{value:!0});N.MissingRefError=N.ValidationError=N.CodeGen=N.Name=N.nil=N.stringify=N.str=N._=N.KeywordCxt=N.Ajv2020=void 0;var gd=Tl(),md=Us(),xd=Cs(),ad=$n(),Eo="https://json-schema.org/draft/2020-12/schema";class ii extends gd.default{constructor(t={}){super({...t,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),md.default.forEach((t)=>this.addVocabulary(t)),this.opts.discriminator)this.addKeyword(xd.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:t,meta:i}=this.opts;if(!i)return;ad.default.call(this,t),this.refs["http://json-schema.org/schema"]=Eo}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Eo)?Eo:void 0)}}N.Ajv2020=ii;Ro.exports=N=ii;Ro.exports.Ajv2020=ii;Object.defineProperty(N,"__esModule",{value:!0});N.default=ii;var _d=Nt();Object.defineProperty(N,"KeywordCxt",{enumerable:!0,get:function(){return _d.KeywordCxt}});var Yt=O();Object.defineProperty(N,"_",{enumerable:!0,get:function(){return Yt._}});Object.defineProperty(N,"str",{enumerable:!0,get:function(){return Yt.str}});Object.defineProperty(N,"stringify",{enumerable:!0,get:function(){return Yt.stringify}});Object.defineProperty(N,"nil",{enumerable:!0,get:function(){return Yt.nil}});Object.defineProperty(N,"Name",{enumerable:!0,get:function(){return Yt.Name}});Object.defineProperty(N,"CodeGen",{enumerable:!0,get:function(){return Yt.CodeGen}});var t6=Vi();Object.defineProperty(N,"ValidationError",{enumerable:!0,get:function(){return t6.default}});var i6=Pt();Object.defineProperty(N,"MissingRefError",{enumerable:!0,get:function(){return i6.default}})});import{randomUUID as A6}from"crypto";var ao=Buffer.from(`\r
10
+ deps: ${o}}`};var Gc={keyword:"dependencies",type:"object",schemaType:"object",error:Yn.error,code(t){let[i,o]=vc(t);An(t,i),Xn(t,o)}};function vc({schema:t}){let i={},o={};for(let r in t){if(r==="__proto__")continue;let l=Array.isArray(t[r])?i:o;l[r]=t[r]}return[i,o]}function An(t,i=t.schema){let{gen:o,data:r,it:l}=t;if(Object.keys(i).length===0)return;let f=o.let("missing");for(let n in i){let $=i[n];if($.length===0)continue;let s=(0,$i.propertyInData)(o,r,n,l.opts.ownProperties);if(t.setParams({property:n,depsCount:$.length,deps:$.join(", ")}),l.allErrors)o.if(s,()=>{for(let e of $)(0,$i.checkReportMissingProp)(t,e)});else o.if(Eo._`${s} && (${(0,$i.checkMissingProp)(t,$,f)})`),(0,$i.reportMissingProp)(t,f),o.else()}}Yn.validatePropertyDeps=An;function Xn(t,i=t.schema){let{gen:o,data:r,keyword:l,it:f}=t,n=o.name("valid");for(let $ in i){if((0,Qc.alwaysValidSchema)(f,i[$]))continue;o.if((0,$i.propertyInData)(o,r,$,f.opts.ownProperties),()=>{let s=t.subschema({keyword:l,schemaProp:$},n);t.mergeValidEvaluated(s,n)},()=>o.var(n,!0)),t.ok(n)}}Yn.validateSchemaDeps=Xn;Yn.default=Gc});var Hn=c((vn)=>{Object.defineProperty(vn,"__esModule",{value:!0});var Gn=w(),Pc=q(),Kc={message:"property name must be valid",params:({params:t})=>Gn._`{propertyName: ${t.propertyName}}`},Uc={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Kc,code(t){let{gen:i,schema:o,data:r,it:l}=t;if((0,Pc.alwaysValidSchema)(l,o))return;let f=i.name("valid");i.forIn("key",r,(n)=>{t.setParams({propertyName:n}),t.subschema({keyword:"propertyNames",data:n,dataTypes:["string"],propertyName:n,compositeRule:!0},f),i.if((0,Gn.not)(f),()=>{if(t.error(!0),!l.allErrors)i.break()})}),t.ok(f)}};vn.default=Uc});var Ro=c((Dn)=>{Object.defineProperty(Dn,"__esModule",{value:!0});var Ui=R(),m=w(),Ec=E(),Ni=q(),Rc={message:"must NOT have additional properties",params:({params:t})=>m._`{additionalProperty: ${t.additionalProperty}}`},Sc={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Rc,code(t){let{gen:i,schema:o,parentSchema:r,data:l,errsCount:f,it:n}=t;if(!f)throw Error("ajv implementation error");let{allErrors:$,opts:s}=n;if(n.props=!0,s.removeAdditional!=="all"&&(0,Ni.alwaysValidSchema)(n,o))return;let e=(0,Ui.allSchemaProperties)(r.properties),u=(0,Ui.allSchemaProperties)(r.patternProperties);b(),t.ok(m._`${f} === ${Ec.default.errors}`);function b(){i.forIn("key",l,(M)=>{if(!e.length&&!u.length)y(M);else i.if(I(M),()=>y(M))})}function I(M){let V;if(e.length>8){let Z=(0,Ni.schemaRefOrVal)(n,r.properties,"properties");V=(0,Ui.isOwnProperty)(i,Z,M)}else if(e.length)V=(0,m.or)(...e.map((Z)=>m._`${M} === ${Z}`));else V=m.nil;if(u.length)V=(0,m.or)(V,...u.map((Z)=>m._`${(0,Ui.usePattern)(t,Z)}.test(${M})`));return(0,m.not)(V)}function p(M){i.code(m._`delete ${l}[${M}]`)}function y(M){if(s.removeAdditional==="all"||s.removeAdditional&&o===!1){p(M);return}if(o===!1){if(t.setParams({additionalProperty:M}),t.error(),!$)i.break();return}if(typeof o=="object"&&!(0,Ni.alwaysValidSchema)(n,o)){let V=i.name("valid");if(s.removeAdditional==="failing")d(M,V,!1),i.if((0,m.not)(V),()=>{t.reset(),p(M)});else if(d(M,V),!$)i.if((0,m.not)(V),()=>i.break())}}function d(M,V,Z){let j={keyword:"additionalProperties",dataProp:M,dataPropType:Ni.Type.Str};if(Z===!1)Object.assign(j,{compositeRule:!0,createErrors:!1,allErrors:!1});t.subschema(j,V)}}};Dn.default=Sc});var Nn=c((Un)=>{Object.defineProperty(Un,"__esModule",{value:!0});var Cc=ht(),Pn=R(),So=q(),Kn=Ro(),hc={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:i,schema:o,parentSchema:r,data:l,it:f}=t;if(f.opts.removeAdditional==="all"&&r.additionalProperties===void 0)Kn.default.code(new Cc.KeywordCxt(f,Kn.default,"additionalProperties"));let n=(0,Pn.allSchemaProperties)(o);for(let b of n)f.definedProperties.add(b);if(f.opts.unevaluated&&n.length&&f.props!==!0)f.props=So.mergeEvaluated.props(i,(0,So.toHash)(n),f.props);let $=n.filter((b)=>!(0,So.alwaysValidSchema)(f,o[b]));if($.length===0)return;let s=i.name("valid");for(let b of $){if(e(b))u(b);else{if(i.if((0,Pn.propertyInData)(i,l,b,f.opts.ownProperties)),u(b),!f.allErrors)i.else().var(s,!0);i.endIf()}t.it.definedProperties.add(b),t.ok(s)}function e(b){return f.opts.useDefaults&&!f.compositeRule&&o[b].default!==void 0}function u(b){t.subschema({keyword:"properties",schemaProp:b,dataProp:b},s)}}};Un.default=hc});var Cn=c((kn)=>{Object.defineProperty(kn,"__esModule",{value:!0});var En=R(),Ei=w(),Rn=q(),Sn=q(),ac={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:i,schema:o,data:r,parentSchema:l,it:f}=t,{opts:n}=f,$=(0,En.allSchemaProperties)(o),s=$.filter((d)=>(0,Rn.alwaysValidSchema)(f,o[d]));if($.length===0||s.length===$.length&&(!f.opts.unevaluated||f.props===!0))return;let e=n.strictSchema&&!n.allowMatchingProperties&&l.properties,u=i.name("valid");if(f.props!==!0&&!(f.props instanceof Ei.Name))f.props=(0,Sn.evaluatedPropsToName)(i,f.props);let{props:b}=f;I();function I(){for(let d of $){if(e)p(d);if(f.allErrors)y(d);else i.var(u,!0),y(d),i.if(u)}}function p(d){for(let M in e)if(new RegExp(d).test(M))(0,Rn.checkStrictMode)(f,`property ${M} matches pattern ${d} (use allowMatchingProperties)`)}function y(d){i.forIn("key",r,(M)=>{i.if(Ei._`${(0,En.usePattern)(t,d)}.test(${M})`,()=>{let V=s.includes(d);if(!V)t.subschema({keyword:"patternProperties",schemaProp:d,dataProp:M,dataPropType:Sn.Type.Str},u);if(f.opts.unevaluated&&b!==!0)i.assign(Ei._`${b}[${M}]`,!0);else if(!V&&!f.allErrors)i.if((0,Ei.not)(u),()=>i.break())})})}}};kn.default=ac});var gn=c((hn)=>{Object.defineProperty(hn,"__esModule",{value:!0});var xc=q(),_c={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:i,schema:o,it:r}=t;if((0,xc.alwaysValidSchema)(r,o)){t.fail();return}let l=i.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},l),t.failResult(l,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};hn.default=_c});var mn=c((an)=>{Object.defineProperty(an,"__esModule",{value:!0});var i0=R(),o0={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:i0.validateUnion,error:{message:"must match a schema in anyOf"}};an.default=o0});var _n=c((xn)=>{Object.defineProperty(xn,"__esModule",{value:!0});var Ri=w(),l0=q(),f0={message:"must match exactly one schema in oneOf",params:({params:t})=>Ri._`{passingSchemas: ${t.passing}}`},n0={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:f0,code(t){let{gen:i,schema:o,parentSchema:r,it:l}=t;if(!Array.isArray(o))throw Error("ajv implementation error");if(l.opts.discriminator&&r.discriminator)return;let f=o,n=i.let("valid",!1),$=i.let("passing",null),s=i.name("_valid");t.setParams({passing:$}),i.block(e),t.result(n,()=>t.reset(),()=>t.error(!0));function e(){f.forEach((u,b)=>{let I;if((0,l0.alwaysValidSchema)(l,u))i.var(s,!0);else I=t.subschema({keyword:"oneOf",schemaProp:b,compositeRule:!0},s);if(b>0)i.if(Ri._`${s} && ${n}`).assign(n,!1).assign($,Ri._`[${$}, ${b}]`).else();i.if(s,()=>{if(i.assign(n,!0),i.assign($,b),I)t.mergeEvaluated(I,Ri.Name)})})}}};xn.default=n0});var i$=c((t$)=>{Object.defineProperty(t$,"__esModule",{value:!0});var s0=q(),e0={keyword:"allOf",schemaType:"array",code(t){let{gen:i,schema:o,it:r}=t;if(!Array.isArray(o))throw Error("ajv implementation error");let l=i.name("valid");o.forEach((f,n)=>{if((0,s0.alwaysValidSchema)(r,f))return;let $=t.subschema({keyword:"allOf",schemaProp:n},l);t.ok(l),t.mergeEvaluated($)})}};t$.default=e0});var f$=c((l$)=>{Object.defineProperty(l$,"__esModule",{value:!0});var Si=w(),r$=q(),b0={message:({params:t})=>Si.str`must match "${t.ifClause}" schema`,params:({params:t})=>Si._`{failingKeyword: ${t.ifClause}}`},y0={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:b0,code(t){let{gen:i,parentSchema:o,it:r}=t;if(o.then===void 0&&o.else===void 0)(0,r$.checkStrictMode)(r,'"if" without "then" and "else" is ignored');let l=o$(r,"then"),f=o$(r,"else");if(!l&&!f)return;let n=i.let("valid",!0),$=i.name("_valid");if(s(),t.reset(),l&&f){let u=i.let("ifClause");t.setParams({ifClause:u}),i.if($,e("then",u),e("else",u))}else if(l)i.if($,e("then"));else i.if((0,Si.not)($),e("else"));t.pass(n,()=>t.error(!0));function s(){let u=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},$);t.mergeEvaluated(u)}function e(u,b){return()=>{let I=t.subschema({keyword:u},$);if(i.assign(n,$),t.mergeValidEvaluated(I,n),b)i.assign(b,Si._`${u}`);else t.setParams({ifClause:u})}}}};function o$(t,i){let o=t.schema[i];return o!==void 0&&!(0,r$.alwaysValidSchema)(t,o)}l$.default=y0});var $$=c((n$)=>{Object.defineProperty(n$,"__esModule",{value:!0});var I0=q(),c0={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:i,it:o}){if(i.if===void 0)(0,I0.checkStrictMode)(o,`"${t}" without "if" is ignored`)}};n$.default=c0});var e$=c((s$)=>{Object.defineProperty(s$,"__esModule",{value:!0});var M0=Uo(),V0=qn(),L0=No(),O0=Zn(),T0=Jn(),w0=Ki(),W0=Hn(),q0=Ro(),j0=Nn(),F0=Cn(),Z0=gn(),B0=mn(),J0=_n(),A0=i$(),X0=f$(),Y0=$$();function z0(t=!1){let i=[Z0.default,B0.default,J0.default,A0.default,X0.default,Y0.default,W0.default,q0.default,w0.default,j0.default,F0.default];if(t)i.push(V0.default,O0.default);else i.push(M0.default,L0.default);return i.push(T0.default),i}s$.default=z0});var Co=c((y$)=>{Object.defineProperty(y$,"__esModule",{value:!0});y$.dynamicAnchor=void 0;var ko=w(),G0=E(),u$=mt(),v0=Qi(),H0={keyword:"$dynamicAnchor",schemaType:"string",code:(t)=>b$(t,t.schema)};function b$(t,i){let{gen:o,it:r}=t;r.schemaEnv.root.dynamicAnchors[i]=!0;let l=ko._`${G0.default.dynamicAnchors}${(0,ko.getProperty)(i)}`,f=r.errSchemaPath==="#"?r.validateName:D0(t);o.if(ko._`!${l}`,()=>o.assign(l,f))}y$.dynamicAnchor=b$;function D0(t){let{schemaEnv:i,schema:o,self:r}=t.it,{root:l,baseId:f,localRefs:n,meta:$}=i.root,{schemaId:s}=r.opts,e=new u$.SchemaEnv({schema:o,schemaId:s,root:l,baseId:f,localRefs:n,meta:$});return u$.compileSchema.call(r,e),(0,v0.getValidate)(t,e)}y$.default=H0});var ho=c((M$)=>{Object.defineProperty(M$,"__esModule",{value:!0});M$.dynamicRef=void 0;var I$=w(),K0=E(),c$=Qi(),U0={keyword:"$dynamicRef",schemaType:"string",code:(t)=>p$(t,t.schema)};function p$(t,i){let{gen:o,keyword:r,it:l}=t;if(i[0]!=="#")throw Error(`"${r}" only supports hash fragment reference`);let f=i.slice(1);if(l.allErrors)n();else{let s=o.let("valid",!1);n(s),t.ok(s)}function n(s){if(l.schemaEnv.root.dynamicAnchors[f]){let e=o.let("_v",I$._`${K0.default.dynamicAnchors}${(0,I$.getProperty)(f)}`);o.if(e,$(e,s),$(l.validateName,s))}else $(l.validateName,s)()}function $(s,e){return e?()=>o.block(()=>{(0,c$.callRef)(t,s),o.let(e,!0)}):()=>(0,c$.callRef)(t,s)}}M$.dynamicRef=p$;M$.default=U0});var O$=c((L$)=>{Object.defineProperty(L$,"__esModule",{value:!0});var E0=Co(),R0=q(),S0={keyword:"$recursiveAnchor",schemaType:"boolean",code(t){if(t.schema)(0,E0.dynamicAnchor)(t,"");else(0,R0.checkStrictMode)(t.it,"$recursiveAnchor: false is ignored")}};L$.default=S0});var w$=c((T$)=>{Object.defineProperty(T$,"__esModule",{value:!0});var C0=ho(),h0={keyword:"$recursiveRef",schemaType:"string",code:(t)=>(0,C0.dynamicRef)(t,t.schema)};T$.default=h0});var q$=c((W$)=>{Object.defineProperty(W$,"__esModule",{value:!0});var a0=Co(),m0=ho(),x0=O$(),_0=w$(),tp=[a0.default,m0.default,x0.default,_0.default];W$.default=tp});var Z$=c((F$)=>{Object.defineProperty(F$,"__esModule",{value:!0});var j$=Ki(),op={keyword:"dependentRequired",type:"object",schemaType:"object",error:j$.error,code:(t)=>(0,j$.validatePropertyDeps)(t)};F$.default=op});var J$=c((B$)=>{Object.defineProperty(B$,"__esModule",{value:!0});var lp=Ki(),fp={keyword:"dependentSchemas",type:"object",schemaType:"object",code:(t)=>(0,lp.validateSchemaDeps)(t)};B$.default=fp});var X$=c((A$)=>{Object.defineProperty(A$,"__esModule",{value:!0});var $p=q(),sp={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:t,parentSchema:i,it:o}){if(i.contains===void 0)(0,$p.checkStrictMode)(o,`"${t}" without "contains" is ignored`)}};A$.default=sp});var z$=c((Y$)=>{Object.defineProperty(Y$,"__esModule",{value:!0});var up=Z$(),bp=J$(),yp=X$(),dp=[up.default,bp.default,yp.default];Y$.default=dp});var v$=c((G$)=>{Object.defineProperty(G$,"__esModule",{value:!0});var dt=w(),Q$=q(),cp=E(),pp={message:"must NOT have unevaluated properties",params:({params:t})=>dt._`{unevaluatedProperty: ${t.unevaluatedProperty}}`},Mp={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:pp,code(t){let{gen:i,schema:o,data:r,errsCount:l,it:f}=t;if(!l)throw Error("ajv implementation error");let{allErrors:n,props:$}=f;if($ instanceof dt.Name)i.if(dt._`${$} !== true`,()=>i.forIn("key",r,(b)=>i.if(e($,b),()=>s(b))));else if($!==!0)i.forIn("key",r,(b)=>$===void 0?s(b):i.if(u($,b),()=>s(b)));f.props=!0,t.ok(dt._`${l} === ${cp.default.errors}`);function s(b){if(o===!1){if(t.setParams({unevaluatedProperty:b}),t.error(),!n)i.break();return}if(!(0,Q$.alwaysValidSchema)(f,o)){let I=i.name("valid");if(t.subschema({keyword:"unevaluatedProperties",dataProp:b,dataPropType:Q$.Type.Str},I),!n)i.if((0,dt.not)(I),()=>i.break())}}function e(b,I){return dt._`!${b} || !${b}[${I}]`}function u(b,I){let p=[];for(let y in b)if(b[y]===!0)p.push(dt._`${I} !== ${y}`);return(0,dt.and)(...p)}}};G$.default=Mp});var P$=c((D$)=>{Object.defineProperty(D$,"__esModule",{value:!0});var Wt=w(),H$=q(),Lp={message:({params:{len:t}})=>Wt.str`must NOT have more than ${t} items`,params:({params:{len:t}})=>Wt._`{limit: ${t}}`},Op={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:Lp,code(t){let{gen:i,schema:o,data:r,it:l}=t,f=l.items||0;if(f===!0)return;let n=i.const("len",Wt._`${r}.length`);if(o===!1)t.setParams({len:f}),t.fail(Wt._`${n} > ${f}`);else if(typeof o=="object"&&!(0,H$.alwaysValidSchema)(l,o)){let s=i.var("valid",Wt._`${n} <= ${f}`);i.if((0,Wt.not)(s),()=>$(s,f)),t.ok(s)}l.items=!0;function $(s,e){i.forRange("i",e,n,(u)=>{if(t.subschema({keyword:"unevaluatedItems",dataProp:u,dataPropType:H$.Type.Num},s),!l.allErrors)i.if((0,Wt.not)(s),()=>i.break())})}}};D$.default=Op});var U$=c((K$)=>{Object.defineProperty(K$,"__esModule",{value:!0});var wp=v$(),Wp=P$(),qp=[wp.default,Wp.default];K$.default=qp});var E$=c((N$)=>{Object.defineProperty(N$,"__esModule",{value:!0});var z=w(),Fp={message:({schemaCode:t})=>z.str`must match format "${t}"`,params:({schemaCode:t})=>z._`{format: ${t}}`},Zp={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:Fp,code(t,i){let{gen:o,data:r,$data:l,schema:f,schemaCode:n,it:$}=t,{opts:s,errSchemaPath:e,schemaEnv:u,self:b}=$;if(!s.validateFormats)return;if(l)I();else p();function I(){let y=o.scopeValue("formats",{ref:b.formats,code:s.code.formats}),d=o.const("fDef",z._`${y}[${n}]`),M=o.let("fType"),V=o.let("format");o.if(z._`typeof ${d} == "object" && !(${d} instanceof RegExp)`,()=>o.assign(M,z._`${d}.type || "string"`).assign(V,z._`${d}.validate`),()=>o.assign(M,z._`"string"`).assign(V,d)),t.fail$data((0,z.or)(Z(),j()));function Z(){if(s.strictSchema===!1)return z.nil;return z._`${n} && !${V}`}function j(){let A=u.$async?z._`(${d}.async ? await ${V}(${r}) : ${V}(${r}))`:z._`${V}(${r})`,T=z._`(typeof ${V} == "function" ? ${A} : ${V}.test(${r}))`;return z._`${V} && ${V} !== true && ${M} === ${i} && !${T}`}}function p(){let y=b.formats[f];if(!y){Z();return}if(y===!0)return;let[d,M,V]=j(y);if(d===i)t.pass(A());function Z(){if(s.strictSchema===!1){b.logger.warn(T());return}throw Error(T());function T(){return`unknown format "${f}" ignored in schema at path "${e}"`}}function j(T){let x=T instanceof RegExp?(0,z.regexpCode)(T):s.code.formats?z._`${s.code.formats}${(0,z.getProperty)(f)}`:void 0,rt=o.scopeValue("formats",{key:f,ref:T,code:x});if(typeof T=="object"&&!(T instanceof RegExp))return[T.type||"string",T.validate,z._`${rt}.validate`];return["string",T,rt]}function A(){if(typeof y=="object"&&!(y instanceof RegExp)&&y.async){if(!u.$async)throw Error("async format in sync schema");return z._`await ${V}(${r})`}return typeof M=="function"?z._`${V}(${r})`:z._`${V}.test(${r})`}}}};N$.default=Zp});var S$=c((R$)=>{Object.defineProperty(R$,"__esModule",{value:!0});var Jp=E$(),Ap=[Jp.default];R$.default=Ap});var h$=c((k$)=>{Object.defineProperty(k$,"__esModule",{value:!0});k$.contentVocabulary=k$.metadataVocabulary=void 0;k$.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];k$.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var m$=c((a$)=>{Object.defineProperty(a$,"__esModule",{value:!0});var zp=Uf(),Qp=cn(),Gp=e$(),vp=q$(),Hp=z$(),Dp=U$(),Pp=S$(),g$=h$(),Kp=[vp.default,zp.default,Qp.default,(0,Gp.default)(!0),Pp.default,g$.metadataVocabulary,g$.contentVocabulary,Hp.default,Dp.default];a$.default=Kp});var is=c((_$)=>{Object.defineProperty(_$,"__esModule",{value:!0});_$.DiscrError=void 0;var x$;(function(t){t.Tag="tag",t.Mapping="mapping"})(x$||(_$.DiscrError=x$={}))});var ls=c((rs)=>{Object.defineProperty(rs,"__esModule",{value:!0});var Qt=w(),go=is(),os=mt(),Np=gt(),Ep=q(),Rp={message:({params:{discrError:t,tagName:i}})=>t===go.DiscrError.Tag?`tag "${i}" must be string`:`value of tag "${i}" must be in oneOf`,params:({params:{discrError:t,tag:i,tagName:o}})=>Qt._`{error: ${t}, tag: ${o}, tagValue: ${i}}`},Sp={keyword:"discriminator",type:"object",schemaType:"object",error:Rp,code(t){let{gen:i,data:o,schema:r,parentSchema:l,it:f}=t,{oneOf:n}=l;if(!f.opts.discriminator)throw Error("discriminator: requires discriminator option");let $=r.propertyName;if(typeof $!="string")throw Error("discriminator: requires propertyName");if(r.mapping)throw Error("discriminator: mapping is not supported");if(!n)throw Error("discriminator: requires oneOf keyword");let s=i.let("valid",!1),e=i.const("tag",Qt._`${o}${(0,Qt.getProperty)($)}`);i.if(Qt._`typeof ${e} == "string"`,()=>u(),()=>t.error(!1,{discrError:go.DiscrError.Tag,tag:e,tagName:$})),t.ok(s);function u(){let p=I();i.if(!1);for(let y in p)i.elseIf(Qt._`${e} === ${y}`),i.assign(s,b(p[y]));i.else(),t.error(!1,{discrError:go.DiscrError.Mapping,tag:e,tagName:$}),i.endIf()}function b(p){let y=i.name("valid"),d=t.subschema({keyword:"oneOf",schemaProp:p},y);return t.mergeEvaluated(d,Qt.Name),y}function I(){var p;let y={},d=V(l),M=!0;for(let A=0;A<n.length;A++){let T=n[A];if((T===null||T===void 0?void 0:T.$ref)&&!(0,Ep.schemaHasRulesButRef)(T,f.self.RULES)){let rt=T.$ref;if(T=os.resolveRef.call(f.self,f.schemaEnv.root,f.baseId,rt),T instanceof os.SchemaEnv)T=T.schema;if(T===void 0)throw new Np.default(f.opts.uriResolver,f.baseId,rt)}let x=(p=T===null||T===void 0?void 0:T.properties)===null||p===void 0?void 0:p[$];if(typeof x!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${$}"`);M=M&&(d||V(T)),Z(x,A)}if(!M)throw Error(`discriminator: "${$}" must be required`);return y;function V({required:A}){return Array.isArray(A)&&A.includes($)}function Z(A,T){if(A.const)j(A.const,T);else if(A.enum)for(let x of A.enum)j(x,T);else throw Error(`discriminator: "properties/${$}" must have "const" or "enum"`)}function j(A,T){if(typeof A!="string"||A in y)throw Error(`discriminator: "${$}" values must be unique strings`);y[A]=T}}}};rs.default=Sp});var fs=c((aV,Cp)=>{Cp.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}});var ns=c((mV,hp)=>{hp.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}});var $s=c((xV,gp)=>{gp.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}});var ss=c((_V,ap)=>{ap.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}});var es=c((tL,mp)=>{mp.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}});var us=c((iL,xp)=>{xp.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}});var bs=c((oL,_p)=>{_p.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}});var ys=c((rL,t1)=>{t1.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}});var Is=c((ds)=>{Object.defineProperty(ds,"__esModule",{value:!0});var i1=fs(),o1=ns(),r1=$s(),l1=ss(),f1=es(),n1=us(),$1=bs(),s1=ys(),e1=["/properties"];function u1(t){return[i1,o1,r1,l1,f1,i(this,n1),$1,i(this,s1)].forEach((o)=>this.addMetaSchema(o,void 0,!1)),this;function i(o,r){return t?o.$dataMetaSchema(r,e1):r}}ds.default=u1});var cs=c((N,mo)=>{Object.defineProperty(N,"__esModule",{value:!0});N.MissingRefError=N.ValidationError=N.CodeGen=N.Name=N.nil=N.stringify=N.str=N._=N.KeywordCxt=N.Ajv2020=void 0;var y1=Yf(),d1=m$(),I1=ls(),c1=Is(),ao="https://json-schema.org/draft/2020-12/schema";class si extends y1.default{constructor(t={}){super({...t,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),d1.default.forEach((t)=>this.addVocabulary(t)),this.opts.discriminator)this.addKeyword(I1.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:t,meta:i}=this.opts;if(!i)return;c1.default.call(this,t),this.refs["http://json-schema.org/schema"]=ao}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(ao)?ao:void 0)}}N.Ajv2020=si;mo.exports=N=si;mo.exports.Ajv2020=si;Object.defineProperty(N,"__esModule",{value:!0});N.default=si;var p1=ht();Object.defineProperty(N,"KeywordCxt",{enumerable:!0,get:function(){return p1.KeywordCxt}});var Gt=w();Object.defineProperty(N,"_",{enumerable:!0,get:function(){return Gt._}});Object.defineProperty(N,"str",{enumerable:!0,get:function(){return Gt.str}});Object.defineProperty(N,"stringify",{enumerable:!0,get:function(){return Gt.stringify}});Object.defineProperty(N,"nil",{enumerable:!0,get:function(){return Gt.nil}});Object.defineProperty(N,"Name",{enumerable:!0,get:function(){return Gt.Name}});Object.defineProperty(N,"CodeGen",{enumerable:!0,get:function(){return Gt.CodeGen}});var M1=Wi();Object.defineProperty(N,"ValidationError",{enumerable:!0,get:function(){return M1.default}});var V1=gt();Object.defineProperty(N,"MissingRefError",{enumerable:!0,get:function(){return V1.default}})});import{randomUUID as a1}from"crypto";import{randomUUID as as}from"crypto";import{appendFile as ms,mkdir as xs}from"fs/promises";import{dirname as _s,resolve as te}from"path";var ie=performance.now(),oe=new Set(["cli","native","rust","host","worker"]);function re(){if(process.env.WOML_PROFILE!=="1")return;let t=process.env.WOML_PROFILE_OUTPUT;if(t===void 0||t.length===0)return;let i=process.env.WOML_PROFILE_PROCESS,o=oe.has(i)?i:"cli",r=process.env.WOML_PROFILE_TRACE_ID,l=r!==void 0&&/^[A-Za-z0-9_.:-]{1,128}$/u.test(r)?r:`trace_${as().replaceAll("-","")}`;return{outputPath:te(t),traceId:l,process:o,spans:[],nextSpan:1,writtenSpans:0}}var Y=re();function $r(t){let i=Object.fromEntries(Object.entries(t).filter(([o,r])=>/^[a-z][a-z0-9_]*$/u.test(o)&&Number.isSafeInteger(r)&&r>=0));return Object.keys(i).length===0?void 0:i}function Dt(t,i,o,r,l){if(Y===void 0)return;let f=$r(l?.counts??{}),n=$r(l?.bytes??{});Y.spans.push({profile:"woml.performance-span/v1",traceId:Y.traceId,spanId:`span_${process.pid}_${Y.nextSpan++}`,process:Y.process,layer:t,name:i,startOffsetMs:o,durationMs:Math.max(0,performance.now()-o),status:r,...l?.identity.runId===void 0?{}:{runId:l.identity.runId},...l?.identity.invocationId===void 0?{}:{invocationId:l.identity.invocationId},...f===void 0?{}:{counts:f},...n===void 0?{}:{bytes:n}})}if(Y!==void 0){Dt(Y.process==="host"?"host":Y.process==="worker"?"worker":"cli",`${Y.process}.process_to_profiler`,0,"succeeded");let t=Y.spans[0];Y.spans[0]={...t,durationMs:ie}}function _(t,i,o){if(Y===void 0)return o();let r={counts:{},bytes:{},identity:{}},l=performance.now();try{let f=o(r);return Dt(t,i,l,"succeeded",r),f}catch(f){throw Dt(t,i,l,"failed",r),f}}async function qt(t,i,o){if(Y===void 0)return await o();let r={counts:{},bytes:{},identity:{}},l=performance.now();try{let f=await o(r);return Dt(t,i,l,"succeeded",r),f}catch(f){throw Dt(t,i,l,"failed",r),f}}async function Pt(){if(Y===void 0||Y.writtenSpans>=Y.spans.length)return;let t=Y.spans.slice(Y.writtenSpans);await xs(_s(Y.outputPath),{recursive:!0}),await ms(Y.outputPath,`${t.map((i)=>JSON.stringify(i)).join(`
11
+ `)}
12
+ `,{encoding:"utf8",mode:384}),Y.writtenSpans+=t.length}var sr=Buffer.from(`\r
11
13
  \r
12
- `,"ascii");var Nn=new TextDecoder("utf-8",{fatal:!0});class a extends Error{constructor(t){super(t);this.name="FrameProtocolError"}}function Pn(t){let i;try{i=JSON.stringify(t)}catch{throw new a("Outbound protocol message is not JSON serializable.")}if(i===void 0)throw new a("Outbound protocol message is not a JSON value.");let o=Buffer.from(i,"utf8"),r=Buffer.from(`Content-Length: ${o.byteLength}\r
14
+ `,"ascii");var le=new TextDecoder("utf-8",{fatal:!0});class tt extends Error{constructor(t){super(t);this.name="FrameProtocolError"}}function fe(t){let i;try{i=JSON.stringify(t)}catch{throw new tt("Outbound protocol message is not JSON serializable.")}if(i===void 0)throw new tt("Outbound protocol message is not a JSON value.");let o=Buffer.from(i,"utf8"),r=Buffer.from(`Content-Length: ${o.byteLength}\r
13
15
  \r
14
- `,"ascii");return Buffer.concat([r,o])}class Ei{#o;#t=Buffer.alloc(0);constructor(t={}){this.#o=t.maxFrameBytes}push(t){if(t.byteLength>0)this.#t=Buffer.concat([this.#t,t]);let i=[];while(!0){let o=this.#t.indexOf(ao);if(o<0){if(this.#t.byteLength>128)throw new a("Protocol frame header exceeds 128 bytes.");break}if(o>128)throw new a("Protocol frame header exceeds 128 bytes.");let r=this.#t.subarray(0,o).toString("ascii"),$=/^Content-Length: ([0-9]+)$/.exec(r);if($===null)throw new a("Protocol frame has an invalid Content-Length header.");let l=Number($[1]);if(!Number.isSafeInteger(l))throw new a("Protocol Content-Length is not a safe integer.");if(this.#o!==void 0&&l>this.#o)throw new a(`Protocol frame declares ${l} bytes, exceeding the configured limit.`);let f=o+ao.byteLength,s=f+l;if(this.#t.byteLength<s)break;try{let n=Nn.decode(this.#t.subarray(f,s));i.push(JSON.parse(n))}catch{throw new a("Protocol frame body is not valid UTF-8 JSON.")}this.#t=this.#t.subarray(s)}return i}finish(){if(this.#t.byteLength!==0)throw new a("Protocol stream ended with an incomplete frame.")}}class Ri{#o;#t=Promise.resolve();constructor(t){this.#o=t}send(t){let i=Pn(t),o=this.#t.then(async()=>{await this.#o(i)});return this.#t=o.catch(()=>{}),o}async drain(){await this.#t}}function Si(t,i,o){if(t===null||typeof t==="string"||typeof t==="boolean")return;if(typeof t==="number")return Number.isFinite(t)?void 0:{path:i,reason:"numbers must be finite"};if(typeof t!=="object")return{path:i,reason:`${typeof t} is not a JSON value`};if(o.has(t))return{path:i,reason:"circular references are not JSON values"};o.add(t);try{if(Array.isArray(t)){let $=new Set(["length"]);for(let l=0;l<t.length;l+=1){if($.add(String(l)),!Object.prototype.hasOwnProperty.call(t,l))return{path:`${i}[${l}]`,reason:"array holes are not JSON values"};let f=Si(t[l],`${i}[${l}]`,o);if(f!==void 0)return f}for(let l of Reflect.ownKeys(t))if(typeof l!=="string"||!$.has(l))return{path:i,reason:"arrays must not contain custom properties"};return}let r=Object.getPrototypeOf(t);if(r!==Object.prototype&&r!==null)return{path:i,reason:"objects must be plain JSON objects"};for(let $ of Reflect.ownKeys(t)){if(typeof $!=="string")return{path:i,reason:"symbol keys are not JSON object keys"};let l=Object.getOwnPropertyDescriptor(t,$);if(l===void 0||l.enumerable!==!0||"get"in l||"set"in l)return{path:`${i}.${$}`,reason:"JSON fields must be enumerable data properties"};let f=Si(l.value,`${i}.${$}`,o);if(f!==void 0)return f}return}finally{o.delete(t)}}function tr(t){return Si(t,"$",new Set)}function _o(t){if(typeof t!=="object"||t===null)return t;if(Array.isArray(t))for(let i of t)_o(i);else for(let i of Object.values(t))_o(i);return Object.isFrozen(t)?t:Object.freeze(t)}var Tn=Un(ln(),1);var fn={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/attempt-failure/v1",title:"WOML Attempt Failure v1",description:"Canonical failure taxonomy shared by the script-host protocol and durable run events.","x-status":"frozen-for-rust-hello-slice",$ref:"#/$defs/attemptFailure",$defs:{attemptFailure:{oneOf:[{$ref:"#/$defs/scriptThrew"},{$ref:"#/$defs/scriptTimedOut"},{$ref:"#/$defs/invalidScriptResult"},{$ref:"#/$defs/contextTooLarge"},{$ref:"#/$defs/resultTooLarge"},{$ref:"#/$defs/workerCrashed"},{$ref:"#/$defs/hostCrashed"},{$ref:"#/$defs/interrupted"}]},hostReportedFailure:{oneOf:[{$ref:"#/$defs/scriptThrew"},{$ref:"#/$defs/scriptTimedOut"},{$ref:"#/$defs/invalidScriptResult"},{$ref:"#/$defs/contextTooLarge"},{$ref:"#/$defs/resultTooLarge"},{$ref:"#/$defs/workerCrashed"}]},failureKind:{enum:["script_threw","script_timed_out","invalid_script_result","context_too_large","result_too_large","worker_crashed","host_crashed","interrupted"]},scriptThrew:{$ref:"#/$defs/simpleFailureScriptThrew"},scriptTimedOut:{$ref:"#/$defs/simpleFailureScriptTimedOut"},invalidScriptResult:{$ref:"#/$defs/simpleFailureInvalidScriptResult"},workerCrashed:{$ref:"#/$defs/simpleFailureWorkerCrashed"},hostCrashed:{$ref:"#/$defs/simpleFailureHostCrashed"},interrupted:{$ref:"#/$defs/simpleFailureInterrupted"},simpleFailureScriptThrew:{type:"object",additionalProperties:!1,required:["kind","code","message"],properties:{kind:{const:"script_threw"},code:{const:"WOML_SCRIPT_THROWN"},message:{$ref:"#/$defs/message"}}},simpleFailureScriptTimedOut:{type:"object",additionalProperties:!1,required:["kind","code","message"],properties:{kind:{const:"script_timed_out"},code:{const:"WOML_SCRIPT_TIMEOUT"},message:{$ref:"#/$defs/message"}}},simpleFailureInvalidScriptResult:{type:"object",additionalProperties:!1,required:["kind","code","message"],properties:{kind:{const:"invalid_script_result"},code:{const:"WOML_SCRIPT_NON_JSON_RESULT"},message:{$ref:"#/$defs/message"}}},simpleFailureWorkerCrashed:{type:"object",additionalProperties:!1,required:["kind","code","message"],properties:{kind:{const:"worker_crashed"},code:{const:"WOML_SCRIPT_WORKER_CRASHED"},message:{$ref:"#/$defs/message"}}},simpleFailureHostCrashed:{type:"object",additionalProperties:!1,required:["kind","code","message"],properties:{kind:{const:"host_crashed"},code:{const:"WOML_SCRIPT_HOST_CRASHED"},message:{$ref:"#/$defs/message"}}},simpleFailureInterrupted:{type:"object",additionalProperties:!1,required:["kind","code","message"],properties:{kind:{const:"interrupted"},code:{const:"WOML_STEP_INTERRUPTED"},message:{$ref:"#/$defs/message"}}},contextTooLarge:{type:"object",additionalProperties:!1,required:["kind","code","message"],properties:{kind:{const:"context_too_large"},code:{const:"WOML_SCRIPT_CONTEXT_TOO_LARGE"},message:{$ref:"#/$defs/message"},details:{$ref:"#/$defs/sizeDetails"}}},resultTooLarge:{type:"object",additionalProperties:!1,required:["kind","code","message"],properties:{kind:{const:"result_too_large"},code:{const:"WOML_SCRIPT_RESULT_TOO_LARGE"},message:{$ref:"#/$defs/message"},details:{$ref:"#/$defs/sizeDetails"}}},sizeDetails:{type:"object",additionalProperties:!1,minProperties:1,properties:{actualBytes:{type:"integer",minimum:0},limitBytes:{type:"integer",minimum:0}}},message:{type:"string",minLength:1}}};var sn={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/attempt-failure/v2",title:"WOML Attempt Failure v2",description:"Attempt failure taxonomy for parallel execution. Version 2 preserves every v1 failure and adds engine-requested invocation cancellation.","x-status":"parallel-profile-frozen","x-previousVersion":"https://cronflow.dev/schemas/attempt-failure/v1",$ref:"#/$defs/attemptFailure",$defs:{attemptFailure:{oneOf:[{$ref:"https://cronflow.dev/schemas/attempt-failure/v1#/$defs/attemptFailure"},{$ref:"#/$defs/invocationCancelled"}]},hostReportedFailure:{oneOf:[{$ref:"https://cronflow.dev/schemas/attempt-failure/v1#/$defs/hostReportedFailure"},{$ref:"#/$defs/invocationCancelled"}]},invocationCancelled:{type:"object",additionalProperties:!1,required:["kind","code","message"],properties:{kind:{const:"invocation_cancelled"},code:{const:"WOML_SCRIPT_CANCELLED"},message:{type:"string",minLength:1}}}}};var nn={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/attempt-failure/v3",title:"WOML Attempt Failure v3",description:"Attempt failure taxonomy preserving an uncaught managed-capability failure without flattening it into script_threw.","x-status":"services-capabilities-contract-frozen","x-previousVersion":"https://cronflow.dev/schemas/attempt-failure/v2",$ref:"#/$defs/attemptFailure",$defs:{attemptFailure:{oneOf:[{$ref:"https://cronflow.dev/schemas/attempt-failure/v2#/$defs/attemptFailure"},{$ref:"#/$defs/serviceFailed"}]},hostReportedFailure:{oneOf:[{$ref:"https://cronflow.dev/schemas/attempt-failure/v2#/$defs/hostReportedFailure"},{$ref:"#/$defs/serviceFailed"}]},serviceFailed:{type:"object",additionalProperties:!1,required:["kind","code","message","capability","operation","callId","retryable","ambiguous","cause"],properties:{kind:{const:"service_failed"},code:{type:"string",pattern:"^[A-Z][A-Z0-9_]*$",maxLength:128},message:{type:"string",minLength:1,maxLength:2048},capability:{type:"string",pattern:"^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*$",maxLength:128},operation:{type:"string",pattern:"^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*$",maxLength:128},callId:{type:"string",minLength:1,maxLength:256},retryable:{type:"boolean"},ambiguous:{type:"boolean"},cause:{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/failure"}}}}};var bn={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/capability-call/v1",title:"WOML Capability Call v1",description:"Generic, asynchronous, invocation-scoped call and result contract for Rust-managed services.","x-status":"services-capabilities-contract-frozen","x-correlation":"Every reply correlates by invocationId and callId; replies may arrive out of order.","x-idempotency":"operationKey is sha256(UTF8('woml.capability-operation\\0v1\\0' + stepIdempotencyKey + '\\0' + operationName)). automatic identity is limited to one effectful call per capability operation per step attempt; authors must supply a stable name when multiple effectful calls can occur.","x-defaultLimits":{inputBytes:1048576,resultBytes:4194304,frameBytes:8388608,timeoutMs:30000,inFlightPerInvocation:32,inFlightGlobal:256},oneOf:[{$ref:"#/$defs/request"},{$ref:"#/$defs/succeeded"},{$ref:"#/$defs/failed"},{$ref:"#/$defs/cancelled"}],$defs:{id:{type:"string",minLength:1,maxLength:256},name:{type:"string",pattern:"^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*$",maxLength:128},digest:{type:"string",pattern:"^sha256:[a-f0-9]{64}$"},base:{type:"object",properties:{contract:{const:"woml.capability-call"},contractVersion:{const:1},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"}}},request:{type:"object",additionalProperties:!1,required:["contract","contractVersion","messageType","invocationId","callId","runId","nodeId","attemptNumber","capability","operation","inputContractVersion","resultContractVersion","identity","limits","input"],properties:{contract:{const:"woml.capability-call"},contractVersion:{const:1},messageType:{const:"request"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},runId:{$ref:"#/$defs/id"},nodeId:{$ref:"#/$defs/id"},attemptNumber:{type:"integer",minimum:1,maximum:10},capability:{$ref:"#/$defs/name"},operation:{$ref:"#/$defs/name"},inputContractVersion:{type:"integer",minimum:1},resultContractVersion:{type:"integer",minimum:1},identity:{$ref:"#/$defs/identity"},limits:{$ref:"#/$defs/limits"},input:{}}},identity:{type:"object",additionalProperties:!1,required:["mode","stepIdempotencyKey","operationName","operationKey"],properties:{mode:{enum:["automatic","named"]},stepIdempotencyKey:{$ref:"#/$defs/digest"},operationName:{type:"string",minLength:1,maxLength:256},operationKey:{$ref:"#/$defs/digest"},providerIdempotencyKey:{type:"string",minLength:1,maxLength:256}}},limits:{type:"object",additionalProperties:!1,required:["inputBytes","resultBytes","timeoutMs"],properties:{inputBytes:{type:"integer",minimum:1,maximum:8388608},resultBytes:{type:"integer",minimum:1,maximum:8388608},timeoutMs:{type:"integer",minimum:1,maximum:86400000}}},resultBase:{type:"object",properties:{contract:{const:"woml.capability-call"},contractVersion:{const:1},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},durationMs:{type:"number",minimum:0}}},succeeded:{type:"object",additionalProperties:!1,required:["contract","contractVersion","messageType","invocationId","callId","outcome","resultContractVersion","resultBytes","durationMs","result"],properties:{contract:{const:"woml.capability-call"},contractVersion:{const:1},messageType:{const:"result"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},outcome:{const:"succeeded"},resultContractVersion:{type:"integer",minimum:1},resultBytes:{type:"integer",minimum:0,maximum:8388608},durationMs:{type:"number",minimum:0},result:{}}},failed:{type:"object",additionalProperties:!1,required:["contract","contractVersion","messageType","invocationId","callId","outcome","durationMs","error"],properties:{contract:{const:"woml.capability-call"},contractVersion:{const:1},messageType:{const:"result"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},outcome:{const:"failed"},durationMs:{type:"number",minimum:0},error:{$ref:"#/$defs/failure"}}},cancelled:{type:"object",additionalProperties:!1,required:["contract","contractVersion","messageType","invocationId","callId","outcome","durationMs","error"],properties:{contract:{const:"woml.capability-call"},contractVersion:{const:1},messageType:{const:"result"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},outcome:{const:"cancelled"},durationMs:{type:"number",minimum:0},error:{$ref:"#/$defs/failure"}}},failure:{type:"object",additionalProperties:!1,required:["kind","code","message","retryable","ambiguous"],properties:{kind:{enum:["invalid_input","invalid_result","unsupported_capability","unsupported_operation","unsupported_version","input_too_large","result_too_large","frame_too_large","timed_out","cancelled","handler_crashed","worker_crashed","host_crashed","transport_failed","service_rejected","interrupted","ambiguous"]},code:{type:"string",pattern:"^[A-Z][A-Z0-9_]*$",maxLength:128},message:{type:"string",minLength:1,maxLength:2048},retryable:{type:"boolean"},ambiguous:{type:"boolean"},details:{$ref:"#/$defs/safeMetadata"}}},safeMetadata:{type:"object",maxProperties:32,propertyNames:{pattern:"^(?!(?:authorization|cookie|set-cookie|token|secret|password|body|query|url|headers|input|output|data|value)$)[A-Za-z][A-Za-z0-9_.-]{0,63}$"},additionalProperties:{type:["string","number","boolean","null"]}}}};var un={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/native-fetch-observation/v1",title:"WOML Native Fetch Observation v1",description:"Redacted observation messages around Bun's unchanged native Fetch implementation.","x-status":"services-capabilities-contract-frozen","x-redaction":"No URL query, credentials, headers, request body, or response body may cross this boundary.",oneOf:[{$ref:"#/$defs/started"},{$ref:"#/$defs/completed"},{$ref:"#/$defs/failed"}],$defs:{id:{type:"string",minLength:1,maxLength:256},method:{type:"string",pattern:"^[A-Z]+$",maxLength:32},origin:{type:"string",pattern:"^https?://(?![^/?#]*@)[^/?#]+$",maxLength:2048},path:{type:"string",pattern:"^/[^?#]*$",maxLength:2048},started:{type:"object",additionalProperties:!1,required:["contract","contractVersion","observationType","invocationId","requestId","method","origin","path","startedAt"],properties:{contract:{const:"woml.native-fetch-observation"},contractVersion:{const:1},observationType:{const:"started"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},method:{$ref:"#/$defs/method"},origin:{$ref:"#/$defs/origin"},path:{$ref:"#/$defs/path"},requestBodyBytes:{type:["integer","null"],minimum:0},startedAt:{type:"string",format:"date-time"}}},completed:{type:"object",additionalProperties:!1,required:["contract","contractVersion","observationType","invocationId","requestId","status","durationMs","completedAt"],properties:{contract:{const:"woml.native-fetch-observation"},contractVersion:{const:1},observationType:{const:"completed"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},status:{type:"integer",minimum:100,maximum:599},responseBodyBytes:{type:["integer","null"],minimum:0},durationMs:{type:"number",minimum:0},completedAt:{type:"string",format:"date-time"}}},failed:{type:"object",additionalProperties:!1,required:["contract","contractVersion","observationType","invocationId","requestId","durationMs","failedAt","error"],properties:{contract:{const:"woml.native-fetch-observation"},contractVersion:{const:1},observationType:{const:"failed"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},durationMs:{type:"number",minimum:0},failedAt:{type:"string",format:"date-time"},error:{type:"object",additionalProperties:!1,required:["kind","code","message"],properties:{kind:{enum:["tracking_failed","fetch_rejected","timed_out","cancelled","worker_crashed","host_crashed"]},code:{type:"string",pattern:"^[A-Z][A-Z0-9_]*$"},message:{type:"string",minLength:1,maxLength:2048}}}}}}};var In={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/script-host-protocol/v1",title:"WOML Script Host Protocol v1",description:"Versioned messages exchanged between the Rust core and the long-lived Bun script host.","x-status":"frozen-for-rust-hello-slice","x-transport":"Content-Length-framed UTF-8 JSON over child stdin/stdout","x-multiplexing":"Multiple execute messages may be in flight and completed responses may arrive out of order; invocationId is the sole correlation key.",oneOf:[{$ref:"#/$defs/readyMessage"},{$ref:"#/$defs/executeMessage"},{$ref:"#/$defs/successMessage"},{$ref:"#/$defs/failureMessage"}],$defs:{nonEmptyId:{type:"string",minLength:1,maxLength:256},readyMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","hostInstanceId"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:1},messageType:{const:"ready"},hostInstanceId:{$ref:"#/$defs/nonEmptyId"}}},executeMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","runId","nodeId","attempt","handler","timeoutMs","source","context"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:1},messageType:{const:"execute"},invocationId:{$ref:"#/$defs/nonEmptyId"},runId:{$ref:"#/$defs/nonEmptyId"},nodeId:{$ref:"#/$defs/nonEmptyId"},attempt:{type:"integer",minimum:1},handler:{const:"runtime.script"},timeoutMs:{type:"integer",minimum:1},source:{type:"string"},context:{$ref:"#/$defs/context"}}},successMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:1},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/nonEmptyId"},outcome:{$ref:"#/$defs/successOutcome"},durationMs:{type:"number",minimum:0}}},failureMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:1},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/nonEmptyId"},outcome:{$ref:"#/$defs/failureOutcome"},durationMs:{type:"number",minimum:0}}},context:{type:"object",additionalProperties:!1,required:["trigger","steps"],properties:{trigger:{type:"object"},steps:{type:"object",additionalProperties:!0}}},successOutcome:{type:"object",additionalProperties:!1,required:["kind","value"],properties:{kind:{const:"success"},value:{}}},failureOutcome:{type:"object",additionalProperties:!1,required:["kind","error"],properties:{kind:{const:"failure"},error:{$ref:"https://cronflow.dev/schemas/attempt-failure/v1#/$defs/hostReportedFailure"}}}}};var yn={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/script-host-protocol/v2",title:"WOML Script Host Protocol v2",description:"Asynchronous Content-Length-framed Rust/Bun protocol with per-invocation cancellation for parallel fail-fast.","x-status":"parallel-profile-frozen","x-previousVersion":"https://cronflow.dev/schemas/script-host-protocol/v1","x-multiplexing":"Multiple execute and cancel messages may be in flight; terminal completed responses may arrive out of order and correlate only by invocationId.",oneOf:[{$ref:"#/$defs/readyMessage"},{$ref:"#/$defs/executeMessage"},{$ref:"#/$defs/cancelMessage"},{$ref:"#/$defs/successMessage"},{$ref:"#/$defs/failureMessage"}],$defs:{nonEmptyId:{type:"string",minLength:1,maxLength:256},readyMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","hostInstanceId"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:2},messageType:{const:"ready"},hostInstanceId:{$ref:"#/$defs/nonEmptyId"}}},executeMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","runId","nodeId","attempt","handler","timeoutMs","source","context"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:2},messageType:{const:"execute"},invocationId:{$ref:"#/$defs/nonEmptyId"},runId:{$ref:"#/$defs/nonEmptyId"},nodeId:{$ref:"#/$defs/nonEmptyId"},attempt:{type:"integer",minimum:1},handler:{const:"runtime.script"},timeoutMs:{type:"integer",minimum:1},source:{type:"string"},context:{$ref:"#/$defs/context"}}},cancelMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","reason"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:2},messageType:{const:"cancel"},invocationId:{$ref:"#/$defs/nonEmptyId"},reason:{const:"parallel_fail_fast"}}},successMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:2},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/nonEmptyId"},outcome:{$ref:"#/$defs/successOutcome"},durationMs:{type:"number",minimum:0}}},failureMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:2},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/nonEmptyId"},outcome:{$ref:"#/$defs/failureOutcome"},durationMs:{type:"number",minimum:0}}},context:{type:"object",additionalProperties:!1,required:["trigger","steps"],properties:{trigger:{type:"object"},steps:{type:"object",additionalProperties:!0}}},successOutcome:{type:"object",additionalProperties:!1,required:["kind","value"],properties:{kind:{const:"success"},value:{}}},failureOutcome:{type:"object",additionalProperties:!1,required:["kind","error"],properties:{kind:{const:"failure"},error:{$ref:"https://cronflow.dev/schemas/attempt-failure/v2#/$defs/hostReportedFailure"}}}}};var en={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/script-host-protocol/v3",title:"WOML Script Host Protocol v3",description:"Asynchronous Content-Length-framed Rust/Bun protocol adding immutable attempt metadata and a stable effect key.","x-status":"retry-profile-frozen","x-previousVersion":"https://cronflow.dev/schemas/script-host-protocol/v2","x-multiplexing":"Multiple execute and cancel messages may be in flight; terminal completed responses may arrive out of order and correlate only by invocationId.",oneOf:[{$ref:"#/$defs/readyMessage"},{$ref:"#/$defs/executeMessage"},{$ref:"#/$defs/cancelMessage"},{$ref:"#/$defs/successMessage"},{$ref:"#/$defs/failureMessage"}],$defs:{nonEmptyId:{type:"string",minLength:1,maxLength:256},envelope:{type:"object",properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:3}}},readyMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","hostInstanceId"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:3},messageType:{const:"ready"},hostInstanceId:{$ref:"#/$defs/nonEmptyId"}}},executeMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","runId","nodeId","attempt","handler","timeoutMs","source","context"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:3},messageType:{const:"execute"},invocationId:{$ref:"#/$defs/nonEmptyId"},runId:{$ref:"#/$defs/nonEmptyId"},nodeId:{$ref:"#/$defs/nonEmptyId"},attempt:{$ref:"#/$defs/attempt"},handler:{const:"runtime.script"},timeoutMs:{type:"integer",minimum:1},source:{type:"string"},context:{$ref:"#/$defs/context"}}},attempt:{type:"object",additionalProperties:!1,required:["number","maxAttempts","idempotencyKey"],properties:{number:{type:"integer",minimum:1,maximum:10},maxAttempts:{type:"integer",minimum:1,maximum:10},idempotencyKey:{type:"string",pattern:"^sha256:[a-f0-9]{64}$"}}},cancelMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","reason"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:3},messageType:{const:"cancel"},invocationId:{$ref:"#/$defs/nonEmptyId"},reason:{const:"parallel_fail_fast"}}},successMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:3},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/nonEmptyId"},outcome:{$ref:"#/$defs/successOutcome"},durationMs:{type:"number",minimum:0}}},failureMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:3},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/nonEmptyId"},outcome:{$ref:"#/$defs/failureOutcome"},durationMs:{type:"number",minimum:0}}},context:{type:"object",additionalProperties:!1,required:["trigger","steps"],properties:{trigger:{type:"object"},steps:{type:"object",additionalProperties:!0}}},successOutcome:{type:"object",additionalProperties:!1,required:["kind","value"],properties:{kind:{const:"success"},value:{}}},failureOutcome:{type:"object",additionalProperties:!1,required:["kind","error"],properties:{kind:{const:"failure"},error:{$ref:"https://cronflow.dev/schemas/attempt-failure/v2#/$defs/hostReportedFailure"}}}}};var Mn={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/script-host-protocol/v4",title:"WOML Script Host Protocol v4",description:"Full-duplex Content-Length-framed Rust/Bun protocol adding Script Bindings v1, managed capability calls, and tracked native Fetch.","x-status":"services-capabilities-contract-frozen","x-previousVersion":"https://cronflow.dev/schemas/script-host-protocol/v3","x-multiplexing":"Multiple execute messages and multiple nested calls per invocation may be in flight. Every response correlates by invocationId and callId/requestId and may arrive out of order.","x-framing":{format:"Content-Length: <UTF-8 byte length>\\r\\n\\r\\n<JSON bytes>",maximumFrameBytes:8388608},oneOf:[{$ref:"#/$defs/ready"},{$ref:"#/$defs/execute"},{$ref:"#/$defs/cancel"},{$ref:"#/$defs/completedSuccess"},{$ref:"#/$defs/completedFailure"},{$ref:"#/$defs/capabilityCall"},{$ref:"#/$defs/capabilityResult"},{$ref:"#/$defs/fetchObservation"},{$ref:"#/$defs/fetchObservationAck"}],$defs:{id:{type:"string",minLength:1,maxLength:256},ready:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","hostInstanceId"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:4},messageType:{const:"ready"},hostInstanceId:{$ref:"#/$defs/id"}}},execute:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","runId","nodeId","attempt","handler","timeoutMs","source","context","bindings"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:4},messageType:{const:"execute"},invocationId:{$ref:"#/$defs/id"},runId:{$ref:"#/$defs/id"},nodeId:{$ref:"#/$defs/id"},attempt:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/attempt"},handler:{const:"runtime.script"},timeoutMs:{type:"integer",minimum:1,maximum:86400000},source:{type:"string"},context:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/context"},bindings:{$ref:"#/$defs/bindings"}}},bindings:{type:"object",additionalProperties:!1,required:["bindingVersion","servicesVersion","secrets"],properties:{bindingVersion:{const:1},servicesVersion:{const:1},secrets:{type:"object",maxProperties:64,propertyNames:{pattern:"^[A-Z][A-Z0-9_]*$",maxLength:128},additionalProperties:{type:"string",maxLength:65536}}}},cancel:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","reason"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:4},messageType:{const:"cancel"},invocationId:{$ref:"#/$defs/id"},reason:{enum:["parallel_fail_fast","step_timed_out","run_cancelled","host_shutdown"]}}},completedSuccess:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:4},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/id"},outcome:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/successOutcome"},durationMs:{type:"number",minimum:0}}},completedFailure:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:4},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/id"},outcome:{$ref:"#/$defs/failureOutcome"},durationMs:{type:"number",minimum:0}}},capabilityCall:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","callId","call"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:4},messageType:{const:"capability_call"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},call:{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/request"}}},capabilityResult:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","callId","result"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:4},messageType:{const:"capability_result"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},result:{oneOf:[{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/succeeded"},{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/failed"},{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/cancelled"}]}}},fetchObservation:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","requestId","observation"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:4},messageType:{const:"fetch_observation"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},observation:{$ref:"https://cronflow.dev/schemas/native-fetch-observation/v1"}}},failureOutcome:{type:"object",additionalProperties:!1,required:["kind","error"],properties:{kind:{const:"failure"},error:{$ref:"https://cronflow.dev/schemas/attempt-failure/v3#/$defs/hostReportedFailure"}}},fetchObservationAck:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","requestId","accepted"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:4},messageType:{const:"fetch_observation_ack"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},accepted:{type:"boolean"},error:{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/failure"}},allOf:[{if:{properties:{accepted:{const:!1}},required:["accepted"]},then:{required:["error"]}},{if:{properties:{accepted:{const:!0}},required:["accepted"]},then:{not:{required:["error"]}}}]}}};var dn={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/script-host-protocol/v5",title:"WOML Script Host Protocol v5",description:"Full-duplex Rust/Bun protocol adding content-addressed local-module registration and per-invocation module bindings.","x-status":"module-system-ms3-frozen","x-previousVersion":"https://cronflow.dev/schemas/script-host-protocol/v4","x-framing":{format:"Content-Length: <UTF-8 byte length>\\r\\n\\r\\n<JSON bytes>",maximumFrameBytes:8388608},oneOf:[{$ref:"#/$defs/ready"},{$ref:"#/$defs/registerModule"},{$ref:"#/$defs/moduleRegistered"},{$ref:"#/$defs/execute"},{$ref:"#/$defs/cancel"},{$ref:"#/$defs/completedSuccess"},{$ref:"#/$defs/completedFailure"},{$ref:"#/$defs/capabilityCall"},{$ref:"#/$defs/capabilityResult"},{$ref:"#/$defs/fetchObservation"},{$ref:"#/$defs/fetchObservationAck"}],$defs:{id:{type:"string",minLength:1,maxLength:256},sha256:{type:"string",pattern:"^sha256:[0-9a-f]{64}$"},envelope:{type:"object",properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:5}},required:["protocol","protocolVersion"]},ready:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","hostInstanceId"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:5},messageType:{const:"ready"},hostInstanceId:{$ref:"#/$defs/id"}}},registerModule:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","bundleDigest","bundle"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:5},messageType:{const:"register_module"},bundleDigest:{$ref:"#/$defs/sha256"},bundle:{type:"string",maxLength:4194304}}},moduleRegistered:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","bundleDigest","accepted"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:5},messageType:{const:"module_registered"},bundleDigest:{$ref:"#/$defs/sha256"},accepted:{type:"boolean"},code:{const:"WOML_MODULE_DIGEST_MISMATCH"},message:{type:"string",minLength:1,maxLength:512}},allOf:[{if:{properties:{accepted:{const:!1}},required:["accepted"]},then:{required:["code","message"]}},{if:{properties:{accepted:{const:!0}},required:["accepted"]},then:{not:{anyOf:[{required:["code"]},{required:["message"]}]}}}]},moduleBinding:{type:"object",additionalProperties:!1,required:["name","bundleDigest","exports"],properties:{name:{type:"string",pattern:"^[a-z][A-Za-z0-9]*$",maxLength:128},bundleDigest:{$ref:"#/$defs/sha256"},exports:{type:"array",minItems:1,uniqueItems:!0,items:{type:"string",pattern:"^[A-Za-z_$][A-Za-z0-9_$]*$"}}}},bindings:{type:"object",additionalProperties:!1,required:["bindingVersion","servicesVersion","secrets"],properties:{bindingVersion:{const:1},servicesVersion:{const:1},secrets:{type:"object",maxProperties:64,propertyNames:{pattern:"^[A-Z][A-Z0-9_]*$",maxLength:128},additionalProperties:{type:"string",maxLength:65536}}}},execute:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","runId","nodeId","attempt","handler","timeoutMs","source","context","bindings","modules"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:5},messageType:{const:"execute"},invocationId:{$ref:"#/$defs/id"},runId:{$ref:"#/$defs/id"},nodeId:{$ref:"#/$defs/id"},attempt:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/attempt"},handler:{const:"runtime.script"},timeoutMs:{type:"integer",minimum:1,maximum:86400000},source:{type:"string"},context:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/context"},bindings:{$ref:"#/$defs/bindings"},modules:{type:"array",maxItems:64,items:{$ref:"#/$defs/moduleBinding"}}}},cancel:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","reason"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:5},messageType:{const:"cancel"},invocationId:{$ref:"#/$defs/id"},reason:{enum:["parallel_fail_fast","step_timed_out","run_cancelled","host_shutdown"]}}},completedSuccess:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:5},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/id"},outcome:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/successOutcome"},durationMs:{type:"number",minimum:0}}},completedFailure:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:5},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/id"},outcome:{$ref:"#/$defs/failureOutcome"},durationMs:{type:"number",minimum:0}}},failureOutcome:{type:"object",additionalProperties:!1,required:["kind","error"],properties:{kind:{const:"failure"},error:{$ref:"https://cronflow.dev/schemas/attempt-failure/v3#/$defs/hostReportedFailure"}}},capabilityCall:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","callId","call"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:5},messageType:{const:"capability_call"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},call:{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/request"}}},capabilityResult:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","callId","result"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:5},messageType:{const:"capability_result"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},result:{oneOf:[{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/succeeded"},{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/failed"},{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/cancelled"}]}}},fetchObservation:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","requestId","observation"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:5},messageType:{const:"fetch_observation"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},observation:{$ref:"https://cronflow.dev/schemas/native-fetch-observation/v1"}}},fetchObservationAck:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","requestId","accepted"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:5},messageType:{const:"fetch_observation_ack"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},accepted:{type:"boolean"},error:{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/failure"}},allOf:[{if:{properties:{accepted:{const:!1}},required:["accepted"]},then:{required:["error"]}},{if:{properties:{accepted:{const:!0}},required:["accepted"]},then:{not:{required:["error"]}}}]}}};var Vn={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/script-host-protocol/v6",title:"WOML Script Host Protocol v6",description:"Full-duplex Rust/Bun protocol adding recoverable source maps, bounded immutable caching, and source-mapped module diagnostics.","x-status":"module-system-ms4-frozen","x-previousVersion":"https://cronflow.dev/schemas/script-host-protocol/v5","x-framing":{format:"Content-Length: <UTF-8 byte length>\\r\\n\\r\\n<JSON bytes>",maximumFrameBytes:8388608},oneOf:[{$ref:"#/$defs/ready"},{$ref:"#/$defs/registerModule"},{$ref:"#/$defs/moduleRegistered"},{$ref:"#/$defs/execute"},{$ref:"#/$defs/cancel"},{$ref:"#/$defs/completedSuccess"},{$ref:"#/$defs/completedFailure"},{$ref:"#/$defs/capabilityCall"},{$ref:"#/$defs/capabilityResult"},{$ref:"#/$defs/fetchObservation"},{$ref:"#/$defs/fetchObservationAck"}],$defs:{id:{type:"string",minLength:1,maxLength:256},sha256:{type:"string",pattern:"^sha256:[0-9a-f]{64}$"},envelope:{type:"object",properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:6}},required:["protocol","protocolVersion"]},ready:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","hostInstanceId"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:6},messageType:{const:"ready"},hostInstanceId:{$ref:"#/$defs/id"}}},registerModule:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","bundleDigest","bundle","sourceMapDigest","sourceMap"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:6},messageType:{const:"register_module"},bundleDigest:{$ref:"#/$defs/sha256"},bundle:{type:"string",maxLength:3145728},sourceMapDigest:{$ref:"#/$defs/sha256"},sourceMap:{type:"string",maxLength:3145728}}},moduleRegistered:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","bundleDigest","sourceMapDigest","accepted"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:6},messageType:{const:"module_registered"},bundleDigest:{$ref:"#/$defs/sha256"},sourceMapDigest:{$ref:"#/$defs/sha256"},accepted:{type:"boolean"},code:{enum:["WOML_MODULE_DIGEST_MISMATCH","WOML_MODULE_CACHE_LIMIT_EXCEEDED"]},message:{type:"string",minLength:1,maxLength:512}},allOf:[{if:{properties:{accepted:{const:!1}},required:["accepted"]},then:{required:["code","message"]}},{if:{properties:{accepted:{const:!0}},required:["accepted"]},then:{not:{anyOf:[{required:["code"]},{required:["message"]}]}}}]},moduleBinding:{type:"object",additionalProperties:!1,required:["name","bundleDigest","exports"],properties:{name:{type:"string",pattern:"^[a-z][A-Za-z0-9]*$",maxLength:128},bundleDigest:{$ref:"#/$defs/sha256"},exports:{type:"array",minItems:1,uniqueItems:!0,items:{type:"string",pattern:"^[A-Za-z_$][A-Za-z0-9_$]*$"}}}},bindings:{type:"object",additionalProperties:!1,required:["bindingVersion","servicesVersion","secrets"],properties:{bindingVersion:{const:1},servicesVersion:{const:1},secrets:{type:"object",maxProperties:64,propertyNames:{pattern:"^[A-Z][A-Z0-9_]*$",maxLength:128},additionalProperties:{type:"string",maxLength:65536}}}},execute:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","runId","nodeId","attempt","handler","timeoutMs","source","context","bindings","modules"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:6},messageType:{const:"execute"},invocationId:{$ref:"#/$defs/id"},runId:{$ref:"#/$defs/id"},nodeId:{$ref:"#/$defs/id"},attempt:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/attempt"},handler:{const:"runtime.script"},timeoutMs:{type:"integer",minimum:1,maximum:86400000},source:{type:"string"},context:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/context"},bindings:{$ref:"#/$defs/bindings"},modules:{type:"array",maxItems:64,items:{$ref:"#/$defs/moduleBinding"}}}},cancel:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","reason"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:6},messageType:{const:"cancel"},invocationId:{$ref:"#/$defs/id"},reason:{enum:["parallel_fail_fast","step_timed_out","run_cancelled","host_shutdown"]}}},completedSuccess:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:6},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/id"},outcome:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/successOutcome"},durationMs:{type:"number",minimum:0}}},completedFailure:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:6},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/id"},outcome:{$ref:"#/$defs/failureOutcome"},durationMs:{type:"number",minimum:0}}},failureOutcome:{type:"object",additionalProperties:!1,required:["kind","error"],properties:{kind:{const:"failure"},error:{$ref:"https://cronflow.dev/schemas/attempt-failure/v3#/$defs/hostReportedFailure"}}},capabilityCall:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","callId","call"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:6},messageType:{const:"capability_call"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},call:{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/request"}}},capabilityResult:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","callId","result"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:6},messageType:{const:"capability_result"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},result:{oneOf:[{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/succeeded"},{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/failed"},{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/cancelled"}]}}},fetchObservation:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","requestId","observation"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:6},messageType:{const:"fetch_observation"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},observation:{$ref:"https://cronflow.dev/schemas/native-fetch-observation/v1"}}},fetchObservationAck:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","requestId","accepted"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:6},messageType:{const:"fetch_observation_ack"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},accepted:{type:"boolean"},error:{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/failure"}},allOf:[{if:{properties:{accepted:{const:!1}},required:["accepted"]},then:{required:["error"]}},{if:{properties:{accepted:{const:!0}},required:["accepted"]},then:{not:{required:["error"]}}}]}}};var cn={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/script-host-protocol/v7",title:"WOML Script Host Protocol v7",description:"Full-duplex Rust/Bun protocol adding isolated lifecycle-script execution and the frozen Lifecycle Binding v1.","x-status":"lifecycle-engine-controls-lec3","x-previousVersion":"https://cronflow.dev/schemas/script-host-protocol/v6","x-framing":{format:"Content-Length: <UTF-8 byte length>\\r\\n\\r\\n<JSON bytes>",maximumFrameBytes:8388608},oneOf:[{$ref:"#/$defs/ready"},{$ref:"#/$defs/registerModule"},{$ref:"#/$defs/moduleRegistered"},{$ref:"#/$defs/execute"},{$ref:"#/$defs/cancel"},{$ref:"#/$defs/completedSuccess"},{$ref:"#/$defs/completedFailure"},{$ref:"#/$defs/capabilityCall"},{$ref:"#/$defs/capabilityResult"},{$ref:"#/$defs/fetchObservation"},{$ref:"#/$defs/fetchObservationAck"}],$defs:{id:{type:"string",minLength:1,maxLength:256},sha256:{type:"string",pattern:"^sha256:[0-9a-f]{64}$"},envelope:{type:"object",properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:7}},required:["protocol","protocolVersion"]},ready:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","hostInstanceId"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:7},messageType:{const:"ready"},hostInstanceId:{$ref:"#/$defs/id"}}},registerModule:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","bundleDigest","bundle","sourceMapDigest","sourceMap"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:7},messageType:{const:"register_module"},bundleDigest:{$ref:"#/$defs/sha256"},bundle:{type:"string",maxLength:3145728},sourceMapDigest:{$ref:"#/$defs/sha256"},sourceMap:{type:"string",maxLength:3145728}}},moduleRegistered:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","bundleDigest","sourceMapDigest","accepted"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:7},messageType:{const:"module_registered"},bundleDigest:{$ref:"#/$defs/sha256"},sourceMapDigest:{$ref:"#/$defs/sha256"},accepted:{type:"boolean"},code:{enum:["WOML_MODULE_DIGEST_MISMATCH","WOML_MODULE_CACHE_LIMIT_EXCEEDED"]},message:{type:"string",minLength:1,maxLength:512}},allOf:[{if:{properties:{accepted:{const:!1}},required:["accepted"]},then:{required:["code","message"]}},{if:{properties:{accepted:{const:!0}},required:["accepted"]},then:{not:{anyOf:[{required:["code"]},{required:["message"]}]}}}]},moduleBinding:{type:"object",additionalProperties:!1,required:["name","bundleDigest","exports"],properties:{name:{type:"string",pattern:"^[a-z][A-Za-z0-9]*$",maxLength:128},bundleDigest:{$ref:"#/$defs/sha256"},exports:{type:"array",minItems:1,uniqueItems:!0,items:{type:"string",pattern:"^[A-Za-z_$][A-Za-z0-9_$]*$"}}}},bindings:{type:"object",additionalProperties:!1,required:["bindingVersion","servicesVersion","secrets"],properties:{bindingVersion:{const:1},servicesVersion:{const:1},secrets:{type:"object",maxProperties:64,propertyNames:{pattern:"^[A-Z][A-Z0-9_]*$",maxLength:128},additionalProperties:{type:"string",maxLength:65536}}}},execute:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","runId","nodeId","attempt","mode","handler","timeoutMs","source","context","bindings","modules"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:7},messageType:{const:"execute"},invocationId:{$ref:"#/$defs/id"},runId:{$ref:"#/$defs/id"},nodeId:{$ref:"#/$defs/id"},attempt:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/attempt"},mode:{enum:["step","lifecycle"]},handler:{enum:["runtime.script","runtime.lifecycle-script"]},timeoutMs:{type:"integer",minimum:1,maximum:86400000},source:{type:"string"},context:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/context"},bindings:{$ref:"#/$defs/bindings"},lifecycle:{$ref:"https://woml.dev/schemas/lifecycle-binding/v1"},modules:{type:"array",maxItems:64,items:{$ref:"#/$defs/moduleBinding"}}},allOf:[{if:{properties:{mode:{const:"lifecycle"}},required:["mode"]},then:{required:["lifecycle"],properties:{handler:{const:"runtime.lifecycle-script"}}}},{if:{properties:{mode:{const:"step"}},required:["mode"]},then:{not:{required:["lifecycle"]},properties:{handler:{const:"runtime.script"}}}}]},cancel:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","reason"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:7},messageType:{const:"cancel"},invocationId:{$ref:"#/$defs/id"},reason:{enum:["parallel_fail_fast","step_timed_out","run_cancelled","host_shutdown"]}}},completedSuccess:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:7},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/id"},outcome:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/successOutcome"},durationMs:{type:"number",minimum:0}}},completedFailure:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:7},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/id"},outcome:{$ref:"#/$defs/failureOutcome"},durationMs:{type:"number",minimum:0}}},failureOutcome:{type:"object",additionalProperties:!1,required:["kind","error"],properties:{kind:{const:"failure"},error:{$ref:"https://cronflow.dev/schemas/attempt-failure/v3#/$defs/hostReportedFailure"}}},capabilityCall:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","callId","call"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:7},messageType:{const:"capability_call"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},call:{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/request"}}},capabilityResult:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","callId","result"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:7},messageType:{const:"capability_result"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},result:{oneOf:[{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/succeeded"},{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/failed"},{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/cancelled"}]}}},fetchObservation:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","requestId","observation"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:7},messageType:{const:"fetch_observation"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},observation:{$ref:"https://cronflow.dev/schemas/native-fetch-observation/v1"}}},fetchObservationAck:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","requestId","accepted"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:7},messageType:{const:"fetch_observation_ack"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},accepted:{type:"boolean"},error:{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/failure"}},allOf:[{if:{properties:{accepted:{const:!1}},required:["accepted"]},then:{required:["error"]}},{if:{properties:{accepted:{const:!0}},required:["accepted"]},then:{not:{required:["error"]}}}]}}};var pn={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/script-host-protocol/v8",title:"WOML Script Host Protocol v8",description:"Protocol v7 plus isolated reusable-step and reusable-lifecycle bindings.","x-status":"switch-custom-definitions-scp4","x-previousVersion":"https://cronflow.dev/schemas/script-host-protocol/v7","x-framing":{format:`Content-Length: <UTF-8 byte length>\r
16
+ `,"ascii");return Buffer.concat([r,o])}class ai{#o;#t=Buffer.alloc(0);constructor(t={}){this.#o=t.maxFrameBytes}push(t){if(t.byteLength>0)this.#t=Buffer.concat([this.#t,t]);let i=[];while(!0){let o=this.#t.indexOf(sr);if(o<0){if(this.#t.byteLength>128)throw new tt("Protocol frame header exceeds 128 bytes.");break}if(o>128)throw new tt("Protocol frame header exceeds 128 bytes.");let r=this.#t.subarray(0,o).toString("ascii"),l=/^Content-Length: ([0-9]+)$/.exec(r);if(l===null)throw new tt("Protocol frame has an invalid Content-Length header.");let f=Number(l[1]);if(!Number.isSafeInteger(f))throw new tt("Protocol Content-Length is not a safe integer.");if(this.#o!==void 0&&f>this.#o)throw new tt(`Protocol frame declares ${f} bytes, exceeding the configured limit.`);let n=o+sr.byteLength,$=n+f;if(this.#t.byteLength<$)break;try{let s=le.decode(this.#t.subarray(n,$));i.push(JSON.parse(s))}catch{throw new tt("Protocol frame body is not valid UTF-8 JSON.")}this.#t=this.#t.subarray($)}return i}finish(){if(this.#t.byteLength!==0)throw new tt("Protocol stream ended with an incomplete frame.")}}class mi{#o;#t=Promise.resolve();constructor(t){this.#o=t}send(t){let i=fe(t),o=this.#t.then(async()=>{await this.#o(i)});return this.#t=o.catch(()=>{}),o}async drain(){await this.#t}}function xi(t,i,o){if(t===null||typeof t==="string"||typeof t==="boolean")return;if(typeof t==="number")return Number.isFinite(t)?void 0:{path:i,reason:"numbers must be finite"};if(typeof t!=="object")return{path:i,reason:`${typeof t} is not a JSON value`};if(o.has(t))return{path:i,reason:"circular references are not JSON values"};o.add(t);try{if(Array.isArray(t)){let l=new Set(["length"]);for(let f=0;f<t.length;f+=1){if(l.add(String(f)),!Object.prototype.hasOwnProperty.call(t,f))return{path:`${i}[${f}]`,reason:"array holes are not JSON values"};let n=xi(t[f],`${i}[${f}]`,o);if(n!==void 0)return n}for(let f of Reflect.ownKeys(t))if(typeof f!=="string"||!l.has(f))return{path:i,reason:"arrays must not contain custom properties"};return}let r=Object.getPrototypeOf(t);if(r!==Object.prototype&&r!==null)return{path:i,reason:"objects must be plain JSON objects"};for(let l of Reflect.ownKeys(t)){if(typeof l!=="string")return{path:i,reason:"symbol keys are not JSON object keys"};let f=Object.getOwnPropertyDescriptor(t,l);if(f===void 0||f.enumerable!==!0||"get"in f||"set"in f)return{path:`${i}.${l}`,reason:"JSON fields must be enumerable data properties"};let n=xi(f.value,`${i}.${l}`,o);if(n!==void 0)return n}return}finally{o.delete(t)}}function ur(t){return xi(t,"$",new Set)}function er(t){if(typeof t!=="object"||t===null)return t;if(Array.isArray(t))for(let i of t)er(i);else for(let i of Object.values(t))er(i);return Object.isFrozen(t)?t:Object.freeze(t)}var Xs=gs(cs(),1);var ps={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/attempt-failure/v1",title:"WOML Attempt Failure v1",description:"Canonical failure taxonomy shared by the script-host protocol and durable run events.","x-status":"frozen-for-rust-hello-slice",$ref:"#/$defs/attemptFailure",$defs:{attemptFailure:{oneOf:[{$ref:"#/$defs/scriptThrew"},{$ref:"#/$defs/scriptTimedOut"},{$ref:"#/$defs/invalidScriptResult"},{$ref:"#/$defs/contextTooLarge"},{$ref:"#/$defs/resultTooLarge"},{$ref:"#/$defs/workerCrashed"},{$ref:"#/$defs/hostCrashed"},{$ref:"#/$defs/interrupted"}]},hostReportedFailure:{oneOf:[{$ref:"#/$defs/scriptThrew"},{$ref:"#/$defs/scriptTimedOut"},{$ref:"#/$defs/invalidScriptResult"},{$ref:"#/$defs/contextTooLarge"},{$ref:"#/$defs/resultTooLarge"},{$ref:"#/$defs/workerCrashed"}]},failureKind:{enum:["script_threw","script_timed_out","invalid_script_result","context_too_large","result_too_large","worker_crashed","host_crashed","interrupted"]},scriptThrew:{$ref:"#/$defs/simpleFailureScriptThrew"},scriptTimedOut:{$ref:"#/$defs/simpleFailureScriptTimedOut"},invalidScriptResult:{$ref:"#/$defs/simpleFailureInvalidScriptResult"},workerCrashed:{$ref:"#/$defs/simpleFailureWorkerCrashed"},hostCrashed:{$ref:"#/$defs/simpleFailureHostCrashed"},interrupted:{$ref:"#/$defs/simpleFailureInterrupted"},simpleFailureScriptThrew:{type:"object",additionalProperties:!1,required:["kind","code","message"],properties:{kind:{const:"script_threw"},code:{const:"WOML_SCRIPT_THROWN"},message:{$ref:"#/$defs/message"}}},simpleFailureScriptTimedOut:{type:"object",additionalProperties:!1,required:["kind","code","message"],properties:{kind:{const:"script_timed_out"},code:{const:"WOML_SCRIPT_TIMEOUT"},message:{$ref:"#/$defs/message"}}},simpleFailureInvalidScriptResult:{type:"object",additionalProperties:!1,required:["kind","code","message"],properties:{kind:{const:"invalid_script_result"},code:{const:"WOML_SCRIPT_NON_JSON_RESULT"},message:{$ref:"#/$defs/message"}}},simpleFailureWorkerCrashed:{type:"object",additionalProperties:!1,required:["kind","code","message"],properties:{kind:{const:"worker_crashed"},code:{const:"WOML_SCRIPT_WORKER_CRASHED"},message:{$ref:"#/$defs/message"}}},simpleFailureHostCrashed:{type:"object",additionalProperties:!1,required:["kind","code","message"],properties:{kind:{const:"host_crashed"},code:{const:"WOML_SCRIPT_HOST_CRASHED"},message:{$ref:"#/$defs/message"}}},simpleFailureInterrupted:{type:"object",additionalProperties:!1,required:["kind","code","message"],properties:{kind:{const:"interrupted"},code:{const:"WOML_STEP_INTERRUPTED"},message:{$ref:"#/$defs/message"}}},contextTooLarge:{type:"object",additionalProperties:!1,required:["kind","code","message"],properties:{kind:{const:"context_too_large"},code:{const:"WOML_SCRIPT_CONTEXT_TOO_LARGE"},message:{$ref:"#/$defs/message"},details:{$ref:"#/$defs/sizeDetails"}}},resultTooLarge:{type:"object",additionalProperties:!1,required:["kind","code","message"],properties:{kind:{const:"result_too_large"},code:{const:"WOML_SCRIPT_RESULT_TOO_LARGE"},message:{$ref:"#/$defs/message"},details:{$ref:"#/$defs/sizeDetails"}}},sizeDetails:{type:"object",additionalProperties:!1,minProperties:1,properties:{actualBytes:{type:"integer",minimum:0},limitBytes:{type:"integer",minimum:0}}},message:{type:"string",minLength:1}}};var Ms={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/attempt-failure/v2",title:"WOML Attempt Failure v2",description:"Attempt failure taxonomy for parallel execution. Version 2 preserves every v1 failure and adds engine-requested invocation cancellation.","x-status":"parallel-profile-frozen","x-previousVersion":"https://cronflow.dev/schemas/attempt-failure/v1",$ref:"#/$defs/attemptFailure",$defs:{attemptFailure:{oneOf:[{$ref:"https://cronflow.dev/schemas/attempt-failure/v1#/$defs/attemptFailure"},{$ref:"#/$defs/invocationCancelled"}]},hostReportedFailure:{oneOf:[{$ref:"https://cronflow.dev/schemas/attempt-failure/v1#/$defs/hostReportedFailure"},{$ref:"#/$defs/invocationCancelled"}]},invocationCancelled:{type:"object",additionalProperties:!1,required:["kind","code","message"],properties:{kind:{const:"invocation_cancelled"},code:{const:"WOML_SCRIPT_CANCELLED"},message:{type:"string",minLength:1}}}}};var Vs={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/attempt-failure/v3",title:"WOML Attempt Failure v3",description:"Attempt failure taxonomy preserving an uncaught managed-capability failure without flattening it into script_threw.","x-status":"services-capabilities-contract-frozen","x-previousVersion":"https://cronflow.dev/schemas/attempt-failure/v2",$ref:"#/$defs/attemptFailure",$defs:{attemptFailure:{oneOf:[{$ref:"https://cronflow.dev/schemas/attempt-failure/v2#/$defs/attemptFailure"},{$ref:"#/$defs/serviceFailed"}]},hostReportedFailure:{oneOf:[{$ref:"https://cronflow.dev/schemas/attempt-failure/v2#/$defs/hostReportedFailure"},{$ref:"#/$defs/serviceFailed"}]},serviceFailed:{type:"object",additionalProperties:!1,required:["kind","code","message","capability","operation","callId","retryable","ambiguous","cause"],properties:{kind:{const:"service_failed"},code:{type:"string",pattern:"^[A-Z][A-Z0-9_]*$",maxLength:128},message:{type:"string",minLength:1,maxLength:2048},capability:{type:"string",pattern:"^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*$",maxLength:128},operation:{type:"string",pattern:"^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*$",maxLength:128},callId:{type:"string",minLength:1,maxLength:256},retryable:{type:"boolean"},ambiguous:{type:"boolean"},cause:{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/failure"}}}}};var Ls={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/capability-call/v1",title:"WOML Capability Call v1",description:"Generic, asynchronous, invocation-scoped call and result contract for Rust-managed services.","x-status":"services-capabilities-contract-frozen","x-correlation":"Every reply correlates by invocationId and callId; replies may arrive out of order.","x-idempotency":"operationKey is sha256(UTF8('woml.capability-operation\\0v1\\0' + stepIdempotencyKey + '\\0' + operationName)). automatic identity is limited to one effectful call per capability operation per step attempt; authors must supply a stable name when multiple effectful calls can occur.","x-defaultLimits":{inputBytes:1048576,resultBytes:4194304,frameBytes:8388608,timeoutMs:30000,inFlightPerInvocation:32,inFlightGlobal:256},oneOf:[{$ref:"#/$defs/request"},{$ref:"#/$defs/succeeded"},{$ref:"#/$defs/failed"},{$ref:"#/$defs/cancelled"}],$defs:{id:{type:"string",minLength:1,maxLength:256},name:{type:"string",pattern:"^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*$",maxLength:128},digest:{type:"string",pattern:"^sha256:[a-f0-9]{64}$"},base:{type:"object",properties:{contract:{const:"woml.capability-call"},contractVersion:{const:1},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"}}},request:{type:"object",additionalProperties:!1,required:["contract","contractVersion","messageType","invocationId","callId","runId","nodeId","attemptNumber","capability","operation","inputContractVersion","resultContractVersion","identity","limits","input"],properties:{contract:{const:"woml.capability-call"},contractVersion:{const:1},messageType:{const:"request"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},runId:{$ref:"#/$defs/id"},nodeId:{$ref:"#/$defs/id"},attemptNumber:{type:"integer",minimum:1,maximum:10},capability:{$ref:"#/$defs/name"},operation:{$ref:"#/$defs/name"},inputContractVersion:{type:"integer",minimum:1},resultContractVersion:{type:"integer",minimum:1},identity:{$ref:"#/$defs/identity"},limits:{$ref:"#/$defs/limits"},input:{}}},identity:{type:"object",additionalProperties:!1,required:["mode","stepIdempotencyKey","operationName","operationKey"],properties:{mode:{enum:["automatic","named"]},stepIdempotencyKey:{$ref:"#/$defs/digest"},operationName:{type:"string",minLength:1,maxLength:256},operationKey:{$ref:"#/$defs/digest"},providerIdempotencyKey:{type:"string",minLength:1,maxLength:256}}},limits:{type:"object",additionalProperties:!1,required:["inputBytes","resultBytes","timeoutMs"],properties:{inputBytes:{type:"integer",minimum:1,maximum:8388608},resultBytes:{type:"integer",minimum:1,maximum:8388608},timeoutMs:{type:"integer",minimum:1,maximum:86400000}}},resultBase:{type:"object",properties:{contract:{const:"woml.capability-call"},contractVersion:{const:1},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},durationMs:{type:"number",minimum:0}}},succeeded:{type:"object",additionalProperties:!1,required:["contract","contractVersion","messageType","invocationId","callId","outcome","resultContractVersion","resultBytes","durationMs","result"],properties:{contract:{const:"woml.capability-call"},contractVersion:{const:1},messageType:{const:"result"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},outcome:{const:"succeeded"},resultContractVersion:{type:"integer",minimum:1},resultBytes:{type:"integer",minimum:0,maximum:8388608},durationMs:{type:"number",minimum:0},result:{}}},failed:{type:"object",additionalProperties:!1,required:["contract","contractVersion","messageType","invocationId","callId","outcome","durationMs","error"],properties:{contract:{const:"woml.capability-call"},contractVersion:{const:1},messageType:{const:"result"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},outcome:{const:"failed"},durationMs:{type:"number",minimum:0},error:{$ref:"#/$defs/failure"}}},cancelled:{type:"object",additionalProperties:!1,required:["contract","contractVersion","messageType","invocationId","callId","outcome","durationMs","error"],properties:{contract:{const:"woml.capability-call"},contractVersion:{const:1},messageType:{const:"result"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},outcome:{const:"cancelled"},durationMs:{type:"number",minimum:0},error:{$ref:"#/$defs/failure"}}},failure:{type:"object",additionalProperties:!1,required:["kind","code","message","retryable","ambiguous"],properties:{kind:{enum:["invalid_input","invalid_result","unsupported_capability","unsupported_operation","unsupported_version","input_too_large","result_too_large","frame_too_large","timed_out","cancelled","handler_crashed","worker_crashed","host_crashed","transport_failed","service_rejected","interrupted","ambiguous"]},code:{type:"string",pattern:"^[A-Z][A-Z0-9_]*$",maxLength:128},message:{type:"string",minLength:1,maxLength:2048},retryable:{type:"boolean"},ambiguous:{type:"boolean"},details:{$ref:"#/$defs/safeMetadata"}}},safeMetadata:{type:"object",maxProperties:32,propertyNames:{pattern:"^(?!(?:authorization|cookie|set-cookie|token|secret|password|body|query|url|headers|input|output|data|value)$)[A-Za-z][A-Za-z0-9_.-]{0,63}$"},additionalProperties:{type:["string","number","boolean","null"]}}}};var Os={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/native-fetch-observation/v1",title:"WOML Native Fetch Observation v1",description:"Redacted observation messages around Bun's unchanged native Fetch implementation.","x-status":"services-capabilities-contract-frozen","x-redaction":"No URL query, credentials, headers, request body, or response body may cross this boundary.",oneOf:[{$ref:"#/$defs/started"},{$ref:"#/$defs/completed"},{$ref:"#/$defs/failed"}],$defs:{id:{type:"string",minLength:1,maxLength:256},method:{type:"string",pattern:"^[A-Z]+$",maxLength:32},origin:{type:"string",pattern:"^https?://(?![^/?#]*@)[^/?#]+$",maxLength:2048},path:{type:"string",pattern:"^/[^?#]*$",maxLength:2048},started:{type:"object",additionalProperties:!1,required:["contract","contractVersion","observationType","invocationId","requestId","method","origin","path","startedAt"],properties:{contract:{const:"woml.native-fetch-observation"},contractVersion:{const:1},observationType:{const:"started"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},method:{$ref:"#/$defs/method"},origin:{$ref:"#/$defs/origin"},path:{$ref:"#/$defs/path"},requestBodyBytes:{type:["integer","null"],minimum:0},startedAt:{type:"string",format:"date-time"}}},completed:{type:"object",additionalProperties:!1,required:["contract","contractVersion","observationType","invocationId","requestId","status","durationMs","completedAt"],properties:{contract:{const:"woml.native-fetch-observation"},contractVersion:{const:1},observationType:{const:"completed"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},status:{type:"integer",minimum:100,maximum:599},responseBodyBytes:{type:["integer","null"],minimum:0},durationMs:{type:"number",minimum:0},completedAt:{type:"string",format:"date-time"}}},failed:{type:"object",additionalProperties:!1,required:["contract","contractVersion","observationType","invocationId","requestId","durationMs","failedAt","error"],properties:{contract:{const:"woml.native-fetch-observation"},contractVersion:{const:1},observationType:{const:"failed"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},durationMs:{type:"number",minimum:0},failedAt:{type:"string",format:"date-time"},error:{type:"object",additionalProperties:!1,required:["kind","code","message"],properties:{kind:{enum:["tracking_failed","fetch_rejected","timed_out","cancelled","worker_crashed","host_crashed"]},code:{type:"string",pattern:"^[A-Z][A-Z0-9_]*$"},message:{type:"string",minLength:1,maxLength:2048}}}}}}};var Ts={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/script-host-protocol/v1",title:"WOML Script Host Protocol v1",description:"Versioned messages exchanged between the Rust core and the long-lived Bun script host.","x-status":"frozen-for-rust-hello-slice","x-transport":"Content-Length-framed UTF-8 JSON over child stdin/stdout","x-multiplexing":"Multiple execute messages may be in flight and completed responses may arrive out of order; invocationId is the sole correlation key.",oneOf:[{$ref:"#/$defs/readyMessage"},{$ref:"#/$defs/executeMessage"},{$ref:"#/$defs/successMessage"},{$ref:"#/$defs/failureMessage"}],$defs:{nonEmptyId:{type:"string",minLength:1,maxLength:256},readyMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","hostInstanceId"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:1},messageType:{const:"ready"},hostInstanceId:{$ref:"#/$defs/nonEmptyId"}}},executeMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","runId","nodeId","attempt","handler","timeoutMs","source","context"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:1},messageType:{const:"execute"},invocationId:{$ref:"#/$defs/nonEmptyId"},runId:{$ref:"#/$defs/nonEmptyId"},nodeId:{$ref:"#/$defs/nonEmptyId"},attempt:{type:"integer",minimum:1},handler:{const:"runtime.script"},timeoutMs:{type:"integer",minimum:1},source:{type:"string"},context:{$ref:"#/$defs/context"}}},successMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:1},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/nonEmptyId"},outcome:{$ref:"#/$defs/successOutcome"},durationMs:{type:"number",minimum:0}}},failureMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:1},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/nonEmptyId"},outcome:{$ref:"#/$defs/failureOutcome"},durationMs:{type:"number",minimum:0}}},context:{type:"object",additionalProperties:!1,required:["trigger","steps"],properties:{trigger:{type:"object"},steps:{type:"object",additionalProperties:!0}}},successOutcome:{type:"object",additionalProperties:!1,required:["kind","value"],properties:{kind:{const:"success"},value:{}}},failureOutcome:{type:"object",additionalProperties:!1,required:["kind","error"],properties:{kind:{const:"failure"},error:{$ref:"https://cronflow.dev/schemas/attempt-failure/v1#/$defs/hostReportedFailure"}}}}};var ws={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/script-host-protocol/v2",title:"WOML Script Host Protocol v2",description:"Asynchronous Content-Length-framed Rust/Bun protocol with per-invocation cancellation for parallel fail-fast.","x-status":"parallel-profile-frozen","x-previousVersion":"https://cronflow.dev/schemas/script-host-protocol/v1","x-multiplexing":"Multiple execute and cancel messages may be in flight; terminal completed responses may arrive out of order and correlate only by invocationId.",oneOf:[{$ref:"#/$defs/readyMessage"},{$ref:"#/$defs/executeMessage"},{$ref:"#/$defs/cancelMessage"},{$ref:"#/$defs/successMessage"},{$ref:"#/$defs/failureMessage"}],$defs:{nonEmptyId:{type:"string",minLength:1,maxLength:256},readyMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","hostInstanceId"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:2},messageType:{const:"ready"},hostInstanceId:{$ref:"#/$defs/nonEmptyId"}}},executeMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","runId","nodeId","attempt","handler","timeoutMs","source","context"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:2},messageType:{const:"execute"},invocationId:{$ref:"#/$defs/nonEmptyId"},runId:{$ref:"#/$defs/nonEmptyId"},nodeId:{$ref:"#/$defs/nonEmptyId"},attempt:{type:"integer",minimum:1},handler:{const:"runtime.script"},timeoutMs:{type:"integer",minimum:1},source:{type:"string"},context:{$ref:"#/$defs/context"}}},cancelMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","reason"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:2},messageType:{const:"cancel"},invocationId:{$ref:"#/$defs/nonEmptyId"},reason:{const:"parallel_fail_fast"}}},successMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:2},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/nonEmptyId"},outcome:{$ref:"#/$defs/successOutcome"},durationMs:{type:"number",minimum:0}}},failureMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:2},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/nonEmptyId"},outcome:{$ref:"#/$defs/failureOutcome"},durationMs:{type:"number",minimum:0}}},context:{type:"object",additionalProperties:!1,required:["trigger","steps"],properties:{trigger:{type:"object"},steps:{type:"object",additionalProperties:!0}}},successOutcome:{type:"object",additionalProperties:!1,required:["kind","value"],properties:{kind:{const:"success"},value:{}}},failureOutcome:{type:"object",additionalProperties:!1,required:["kind","error"],properties:{kind:{const:"failure"},error:{$ref:"https://cronflow.dev/schemas/attempt-failure/v2#/$defs/hostReportedFailure"}}}}};var Ws={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/script-host-protocol/v3",title:"WOML Script Host Protocol v3",description:"Asynchronous Content-Length-framed Rust/Bun protocol adding immutable attempt metadata and a stable effect key.","x-status":"retry-profile-frozen","x-previousVersion":"https://cronflow.dev/schemas/script-host-protocol/v2","x-multiplexing":"Multiple execute and cancel messages may be in flight; terminal completed responses may arrive out of order and correlate only by invocationId.",oneOf:[{$ref:"#/$defs/readyMessage"},{$ref:"#/$defs/executeMessage"},{$ref:"#/$defs/cancelMessage"},{$ref:"#/$defs/successMessage"},{$ref:"#/$defs/failureMessage"}],$defs:{nonEmptyId:{type:"string",minLength:1,maxLength:256},envelope:{type:"object",properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:3}}},readyMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","hostInstanceId"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:3},messageType:{const:"ready"},hostInstanceId:{$ref:"#/$defs/nonEmptyId"}}},executeMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","runId","nodeId","attempt","handler","timeoutMs","source","context"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:3},messageType:{const:"execute"},invocationId:{$ref:"#/$defs/nonEmptyId"},runId:{$ref:"#/$defs/nonEmptyId"},nodeId:{$ref:"#/$defs/nonEmptyId"},attempt:{$ref:"#/$defs/attempt"},handler:{const:"runtime.script"},timeoutMs:{type:"integer",minimum:1},source:{type:"string"},context:{$ref:"#/$defs/context"}}},attempt:{type:"object",additionalProperties:!1,required:["number","maxAttempts","idempotencyKey"],properties:{number:{type:"integer",minimum:1,maximum:10},maxAttempts:{type:"integer",minimum:1,maximum:10},idempotencyKey:{type:"string",pattern:"^sha256:[a-f0-9]{64}$"}}},cancelMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","reason"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:3},messageType:{const:"cancel"},invocationId:{$ref:"#/$defs/nonEmptyId"},reason:{const:"parallel_fail_fast"}}},successMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:3},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/nonEmptyId"},outcome:{$ref:"#/$defs/successOutcome"},durationMs:{type:"number",minimum:0}}},failureMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:3},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/nonEmptyId"},outcome:{$ref:"#/$defs/failureOutcome"},durationMs:{type:"number",minimum:0}}},context:{type:"object",additionalProperties:!1,required:["trigger","steps"],properties:{trigger:{type:"object"},steps:{type:"object",additionalProperties:!0}}},successOutcome:{type:"object",additionalProperties:!1,required:["kind","value"],properties:{kind:{const:"success"},value:{}}},failureOutcome:{type:"object",additionalProperties:!1,required:["kind","error"],properties:{kind:{const:"failure"},error:{$ref:"https://cronflow.dev/schemas/attempt-failure/v2#/$defs/hostReportedFailure"}}}}};var qs={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/script-host-protocol/v4",title:"WOML Script Host Protocol v4",description:"Full-duplex Content-Length-framed Rust/Bun protocol adding Script Bindings v1, managed capability calls, and tracked native Fetch.","x-status":"services-capabilities-contract-frozen","x-previousVersion":"https://cronflow.dev/schemas/script-host-protocol/v3","x-multiplexing":"Multiple execute messages and multiple nested calls per invocation may be in flight. Every response correlates by invocationId and callId/requestId and may arrive out of order.","x-framing":{format:"Content-Length: <UTF-8 byte length>\\r\\n\\r\\n<JSON bytes>",maximumFrameBytes:8388608},oneOf:[{$ref:"#/$defs/ready"},{$ref:"#/$defs/execute"},{$ref:"#/$defs/cancel"},{$ref:"#/$defs/completedSuccess"},{$ref:"#/$defs/completedFailure"},{$ref:"#/$defs/capabilityCall"},{$ref:"#/$defs/capabilityResult"},{$ref:"#/$defs/fetchObservation"},{$ref:"#/$defs/fetchObservationAck"}],$defs:{id:{type:"string",minLength:1,maxLength:256},ready:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","hostInstanceId"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:4},messageType:{const:"ready"},hostInstanceId:{$ref:"#/$defs/id"}}},execute:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","runId","nodeId","attempt","handler","timeoutMs","source","context","bindings"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:4},messageType:{const:"execute"},invocationId:{$ref:"#/$defs/id"},runId:{$ref:"#/$defs/id"},nodeId:{$ref:"#/$defs/id"},attempt:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/attempt"},handler:{const:"runtime.script"},timeoutMs:{type:"integer",minimum:1,maximum:86400000},source:{type:"string"},context:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/context"},bindings:{$ref:"#/$defs/bindings"}}},bindings:{type:"object",additionalProperties:!1,required:["bindingVersion","servicesVersion","secrets"],properties:{bindingVersion:{const:1},servicesVersion:{const:1},secrets:{type:"object",maxProperties:64,propertyNames:{pattern:"^[A-Z][A-Z0-9_]*$",maxLength:128},additionalProperties:{type:"string",maxLength:65536}}}},cancel:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","reason"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:4},messageType:{const:"cancel"},invocationId:{$ref:"#/$defs/id"},reason:{enum:["parallel_fail_fast","step_timed_out","run_cancelled","host_shutdown"]}}},completedSuccess:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:4},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/id"},outcome:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/successOutcome"},durationMs:{type:"number",minimum:0}}},completedFailure:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:4},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/id"},outcome:{$ref:"#/$defs/failureOutcome"},durationMs:{type:"number",minimum:0}}},capabilityCall:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","callId","call"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:4},messageType:{const:"capability_call"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},call:{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/request"}}},capabilityResult:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","callId","result"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:4},messageType:{const:"capability_result"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},result:{oneOf:[{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/succeeded"},{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/failed"},{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/cancelled"}]}}},fetchObservation:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","requestId","observation"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:4},messageType:{const:"fetch_observation"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},observation:{$ref:"https://cronflow.dev/schemas/native-fetch-observation/v1"}}},failureOutcome:{type:"object",additionalProperties:!1,required:["kind","error"],properties:{kind:{const:"failure"},error:{$ref:"https://cronflow.dev/schemas/attempt-failure/v3#/$defs/hostReportedFailure"}}},fetchObservationAck:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","requestId","accepted"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:4},messageType:{const:"fetch_observation_ack"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},accepted:{type:"boolean"},error:{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/failure"}},allOf:[{if:{properties:{accepted:{const:!1}},required:["accepted"]},then:{required:["error"]}},{if:{properties:{accepted:{const:!0}},required:["accepted"]},then:{not:{required:["error"]}}}]}}};var js={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/script-host-protocol/v5",title:"WOML Script Host Protocol v5",description:"Full-duplex Rust/Bun protocol adding content-addressed local-module registration and per-invocation module bindings.","x-status":"module-system-ms3-frozen","x-previousVersion":"https://cronflow.dev/schemas/script-host-protocol/v4","x-framing":{format:"Content-Length: <UTF-8 byte length>\\r\\n\\r\\n<JSON bytes>",maximumFrameBytes:8388608},oneOf:[{$ref:"#/$defs/ready"},{$ref:"#/$defs/registerModule"},{$ref:"#/$defs/moduleRegistered"},{$ref:"#/$defs/execute"},{$ref:"#/$defs/cancel"},{$ref:"#/$defs/completedSuccess"},{$ref:"#/$defs/completedFailure"},{$ref:"#/$defs/capabilityCall"},{$ref:"#/$defs/capabilityResult"},{$ref:"#/$defs/fetchObservation"},{$ref:"#/$defs/fetchObservationAck"}],$defs:{id:{type:"string",minLength:1,maxLength:256},sha256:{type:"string",pattern:"^sha256:[0-9a-f]{64}$"},envelope:{type:"object",properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:5}},required:["protocol","protocolVersion"]},ready:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","hostInstanceId"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:5},messageType:{const:"ready"},hostInstanceId:{$ref:"#/$defs/id"}}},registerModule:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","bundleDigest","bundle"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:5},messageType:{const:"register_module"},bundleDigest:{$ref:"#/$defs/sha256"},bundle:{type:"string",maxLength:4194304}}},moduleRegistered:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","bundleDigest","accepted"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:5},messageType:{const:"module_registered"},bundleDigest:{$ref:"#/$defs/sha256"},accepted:{type:"boolean"},code:{const:"WOML_MODULE_DIGEST_MISMATCH"},message:{type:"string",minLength:1,maxLength:512}},allOf:[{if:{properties:{accepted:{const:!1}},required:["accepted"]},then:{required:["code","message"]}},{if:{properties:{accepted:{const:!0}},required:["accepted"]},then:{not:{anyOf:[{required:["code"]},{required:["message"]}]}}}]},moduleBinding:{type:"object",additionalProperties:!1,required:["name","bundleDigest","exports"],properties:{name:{type:"string",pattern:"^[a-z][A-Za-z0-9]*$",maxLength:128},bundleDigest:{$ref:"#/$defs/sha256"},exports:{type:"array",minItems:1,uniqueItems:!0,items:{type:"string",pattern:"^[A-Za-z_$][A-Za-z0-9_$]*$"}}}},bindings:{type:"object",additionalProperties:!1,required:["bindingVersion","servicesVersion","secrets"],properties:{bindingVersion:{const:1},servicesVersion:{const:1},secrets:{type:"object",maxProperties:64,propertyNames:{pattern:"^[A-Z][A-Z0-9_]*$",maxLength:128},additionalProperties:{type:"string",maxLength:65536}}}},execute:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","runId","nodeId","attempt","handler","timeoutMs","source","context","bindings","modules"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:5},messageType:{const:"execute"},invocationId:{$ref:"#/$defs/id"},runId:{$ref:"#/$defs/id"},nodeId:{$ref:"#/$defs/id"},attempt:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/attempt"},handler:{const:"runtime.script"},timeoutMs:{type:"integer",minimum:1,maximum:86400000},source:{type:"string"},context:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/context"},bindings:{$ref:"#/$defs/bindings"},modules:{type:"array",maxItems:64,items:{$ref:"#/$defs/moduleBinding"}}}},cancel:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","reason"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:5},messageType:{const:"cancel"},invocationId:{$ref:"#/$defs/id"},reason:{enum:["parallel_fail_fast","step_timed_out","run_cancelled","host_shutdown"]}}},completedSuccess:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:5},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/id"},outcome:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/successOutcome"},durationMs:{type:"number",minimum:0}}},completedFailure:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:5},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/id"},outcome:{$ref:"#/$defs/failureOutcome"},durationMs:{type:"number",minimum:0}}},failureOutcome:{type:"object",additionalProperties:!1,required:["kind","error"],properties:{kind:{const:"failure"},error:{$ref:"https://cronflow.dev/schemas/attempt-failure/v3#/$defs/hostReportedFailure"}}},capabilityCall:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","callId","call"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:5},messageType:{const:"capability_call"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},call:{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/request"}}},capabilityResult:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","callId","result"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:5},messageType:{const:"capability_result"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},result:{oneOf:[{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/succeeded"},{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/failed"},{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/cancelled"}]}}},fetchObservation:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","requestId","observation"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:5},messageType:{const:"fetch_observation"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},observation:{$ref:"https://cronflow.dev/schemas/native-fetch-observation/v1"}}},fetchObservationAck:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","requestId","accepted"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:5},messageType:{const:"fetch_observation_ack"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},accepted:{type:"boolean"},error:{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/failure"}},allOf:[{if:{properties:{accepted:{const:!1}},required:["accepted"]},then:{required:["error"]}},{if:{properties:{accepted:{const:!0}},required:["accepted"]},then:{not:{required:["error"]}}}]}}};var Fs={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/script-host-protocol/v6",title:"WOML Script Host Protocol v6",description:"Full-duplex Rust/Bun protocol adding recoverable source maps, bounded immutable caching, and source-mapped module diagnostics.","x-status":"module-system-ms4-frozen","x-previousVersion":"https://cronflow.dev/schemas/script-host-protocol/v5","x-framing":{format:"Content-Length: <UTF-8 byte length>\\r\\n\\r\\n<JSON bytes>",maximumFrameBytes:8388608},oneOf:[{$ref:"#/$defs/ready"},{$ref:"#/$defs/registerModule"},{$ref:"#/$defs/moduleRegistered"},{$ref:"#/$defs/execute"},{$ref:"#/$defs/cancel"},{$ref:"#/$defs/completedSuccess"},{$ref:"#/$defs/completedFailure"},{$ref:"#/$defs/capabilityCall"},{$ref:"#/$defs/capabilityResult"},{$ref:"#/$defs/fetchObservation"},{$ref:"#/$defs/fetchObservationAck"}],$defs:{id:{type:"string",minLength:1,maxLength:256},sha256:{type:"string",pattern:"^sha256:[0-9a-f]{64}$"},envelope:{type:"object",properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:6}},required:["protocol","protocolVersion"]},ready:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","hostInstanceId"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:6},messageType:{const:"ready"},hostInstanceId:{$ref:"#/$defs/id"}}},registerModule:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","bundleDigest","bundle","sourceMapDigest","sourceMap"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:6},messageType:{const:"register_module"},bundleDigest:{$ref:"#/$defs/sha256"},bundle:{type:"string",maxLength:3145728},sourceMapDigest:{$ref:"#/$defs/sha256"},sourceMap:{type:"string",maxLength:3145728}}},moduleRegistered:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","bundleDigest","sourceMapDigest","accepted"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:6},messageType:{const:"module_registered"},bundleDigest:{$ref:"#/$defs/sha256"},sourceMapDigest:{$ref:"#/$defs/sha256"},accepted:{type:"boolean"},code:{enum:["WOML_MODULE_DIGEST_MISMATCH","WOML_MODULE_CACHE_LIMIT_EXCEEDED"]},message:{type:"string",minLength:1,maxLength:512}},allOf:[{if:{properties:{accepted:{const:!1}},required:["accepted"]},then:{required:["code","message"]}},{if:{properties:{accepted:{const:!0}},required:["accepted"]},then:{not:{anyOf:[{required:["code"]},{required:["message"]}]}}}]},moduleBinding:{type:"object",additionalProperties:!1,required:["name","bundleDigest","exports"],properties:{name:{type:"string",pattern:"^[a-z][A-Za-z0-9]*$",maxLength:128},bundleDigest:{$ref:"#/$defs/sha256"},exports:{type:"array",minItems:1,uniqueItems:!0,items:{type:"string",pattern:"^[A-Za-z_$][A-Za-z0-9_$]*$"}}}},bindings:{type:"object",additionalProperties:!1,required:["bindingVersion","servicesVersion","secrets"],properties:{bindingVersion:{const:1},servicesVersion:{const:1},secrets:{type:"object",maxProperties:64,propertyNames:{pattern:"^[A-Z][A-Z0-9_]*$",maxLength:128},additionalProperties:{type:"string",maxLength:65536}}}},execute:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","runId","nodeId","attempt","handler","timeoutMs","source","context","bindings","modules"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:6},messageType:{const:"execute"},invocationId:{$ref:"#/$defs/id"},runId:{$ref:"#/$defs/id"},nodeId:{$ref:"#/$defs/id"},attempt:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/attempt"},handler:{const:"runtime.script"},timeoutMs:{type:"integer",minimum:1,maximum:86400000},source:{type:"string"},context:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/context"},bindings:{$ref:"#/$defs/bindings"},modules:{type:"array",maxItems:64,items:{$ref:"#/$defs/moduleBinding"}}}},cancel:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","reason"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:6},messageType:{const:"cancel"},invocationId:{$ref:"#/$defs/id"},reason:{enum:["parallel_fail_fast","step_timed_out","run_cancelled","host_shutdown"]}}},completedSuccess:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:6},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/id"},outcome:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/successOutcome"},durationMs:{type:"number",minimum:0}}},completedFailure:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:6},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/id"},outcome:{$ref:"#/$defs/failureOutcome"},durationMs:{type:"number",minimum:0}}},failureOutcome:{type:"object",additionalProperties:!1,required:["kind","error"],properties:{kind:{const:"failure"},error:{$ref:"https://cronflow.dev/schemas/attempt-failure/v3#/$defs/hostReportedFailure"}}},capabilityCall:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","callId","call"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:6},messageType:{const:"capability_call"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},call:{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/request"}}},capabilityResult:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","callId","result"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:6},messageType:{const:"capability_result"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},result:{oneOf:[{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/succeeded"},{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/failed"},{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/cancelled"}]}}},fetchObservation:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","requestId","observation"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:6},messageType:{const:"fetch_observation"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},observation:{$ref:"https://cronflow.dev/schemas/native-fetch-observation/v1"}}},fetchObservationAck:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","requestId","accepted"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:6},messageType:{const:"fetch_observation_ack"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},accepted:{type:"boolean"},error:{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/failure"}},allOf:[{if:{properties:{accepted:{const:!1}},required:["accepted"]},then:{required:["error"]}},{if:{properties:{accepted:{const:!0}},required:["accepted"]},then:{not:{required:["error"]}}}]}}};var Zs={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/script-host-protocol/v7",title:"WOML Script Host Protocol v7",description:"Full-duplex Rust/Bun protocol adding isolated lifecycle-script execution and the frozen Lifecycle Binding v1.","x-status":"lifecycle-engine-controls-lec3","x-previousVersion":"https://cronflow.dev/schemas/script-host-protocol/v6","x-framing":{format:"Content-Length: <UTF-8 byte length>\\r\\n\\r\\n<JSON bytes>",maximumFrameBytes:8388608},oneOf:[{$ref:"#/$defs/ready"},{$ref:"#/$defs/registerModule"},{$ref:"#/$defs/moduleRegistered"},{$ref:"#/$defs/execute"},{$ref:"#/$defs/cancel"},{$ref:"#/$defs/completedSuccess"},{$ref:"#/$defs/completedFailure"},{$ref:"#/$defs/capabilityCall"},{$ref:"#/$defs/capabilityResult"},{$ref:"#/$defs/fetchObservation"},{$ref:"#/$defs/fetchObservationAck"}],$defs:{id:{type:"string",minLength:1,maxLength:256},sha256:{type:"string",pattern:"^sha256:[0-9a-f]{64}$"},envelope:{type:"object",properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:7}},required:["protocol","protocolVersion"]},ready:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","hostInstanceId"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:7},messageType:{const:"ready"},hostInstanceId:{$ref:"#/$defs/id"}}},registerModule:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","bundleDigest","bundle","sourceMapDigest","sourceMap"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:7},messageType:{const:"register_module"},bundleDigest:{$ref:"#/$defs/sha256"},bundle:{type:"string",maxLength:3145728},sourceMapDigest:{$ref:"#/$defs/sha256"},sourceMap:{type:"string",maxLength:3145728}}},moduleRegistered:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","bundleDigest","sourceMapDigest","accepted"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:7},messageType:{const:"module_registered"},bundleDigest:{$ref:"#/$defs/sha256"},sourceMapDigest:{$ref:"#/$defs/sha256"},accepted:{type:"boolean"},code:{enum:["WOML_MODULE_DIGEST_MISMATCH","WOML_MODULE_CACHE_LIMIT_EXCEEDED"]},message:{type:"string",minLength:1,maxLength:512}},allOf:[{if:{properties:{accepted:{const:!1}},required:["accepted"]},then:{required:["code","message"]}},{if:{properties:{accepted:{const:!0}},required:["accepted"]},then:{not:{anyOf:[{required:["code"]},{required:["message"]}]}}}]},moduleBinding:{type:"object",additionalProperties:!1,required:["name","bundleDigest","exports"],properties:{name:{type:"string",pattern:"^[a-z][A-Za-z0-9]*$",maxLength:128},bundleDigest:{$ref:"#/$defs/sha256"},exports:{type:"array",minItems:1,uniqueItems:!0,items:{type:"string",pattern:"^[A-Za-z_$][A-Za-z0-9_$]*$"}}}},bindings:{type:"object",additionalProperties:!1,required:["bindingVersion","servicesVersion","secrets"],properties:{bindingVersion:{const:1},servicesVersion:{const:1},secrets:{type:"object",maxProperties:64,propertyNames:{pattern:"^[A-Z][A-Z0-9_]*$",maxLength:128},additionalProperties:{type:"string",maxLength:65536}}}},execute:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","runId","nodeId","attempt","mode","handler","timeoutMs","source","context","bindings","modules"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:7},messageType:{const:"execute"},invocationId:{$ref:"#/$defs/id"},runId:{$ref:"#/$defs/id"},nodeId:{$ref:"#/$defs/id"},attempt:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/attempt"},mode:{enum:["step","lifecycle"]},handler:{enum:["runtime.script","runtime.lifecycle-script"]},timeoutMs:{type:"integer",minimum:1,maximum:86400000},source:{type:"string"},context:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/context"},bindings:{$ref:"#/$defs/bindings"},lifecycle:{$ref:"https://woml.dev/schemas/lifecycle-binding/v1"},modules:{type:"array",maxItems:64,items:{$ref:"#/$defs/moduleBinding"}}},allOf:[{if:{properties:{mode:{const:"lifecycle"}},required:["mode"]},then:{required:["lifecycle"],properties:{handler:{const:"runtime.lifecycle-script"}}}},{if:{properties:{mode:{const:"step"}},required:["mode"]},then:{not:{required:["lifecycle"]},properties:{handler:{const:"runtime.script"}}}}]},cancel:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","reason"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:7},messageType:{const:"cancel"},invocationId:{$ref:"#/$defs/id"},reason:{enum:["parallel_fail_fast","step_timed_out","run_cancelled","host_shutdown"]}}},completedSuccess:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:7},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/id"},outcome:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/successOutcome"},durationMs:{type:"number",minimum:0}}},completedFailure:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:7},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/id"},outcome:{$ref:"#/$defs/failureOutcome"},durationMs:{type:"number",minimum:0}}},failureOutcome:{type:"object",additionalProperties:!1,required:["kind","error"],properties:{kind:{const:"failure"},error:{$ref:"https://cronflow.dev/schemas/attempt-failure/v3#/$defs/hostReportedFailure"}}},capabilityCall:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","callId","call"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:7},messageType:{const:"capability_call"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},call:{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/request"}}},capabilityResult:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","callId","result"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:7},messageType:{const:"capability_result"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},result:{oneOf:[{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/succeeded"},{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/failed"},{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/cancelled"}]}}},fetchObservation:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","requestId","observation"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:7},messageType:{const:"fetch_observation"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},observation:{$ref:"https://cronflow.dev/schemas/native-fetch-observation/v1"}}},fetchObservationAck:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","requestId","accepted"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:7},messageType:{const:"fetch_observation_ack"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},accepted:{type:"boolean"},error:{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/failure"}},allOf:[{if:{properties:{accepted:{const:!1}},required:["accepted"]},then:{required:["error"]}},{if:{properties:{accepted:{const:!0}},required:["accepted"]},then:{not:{required:["error"]}}}]}}};var Bs={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/script-host-protocol/v8",title:"WOML Script Host Protocol v8",description:"Protocol v7 plus isolated reusable-step and reusable-lifecycle bindings.","x-status":"switch-custom-definitions-scp4","x-previousVersion":"https://cronflow.dev/schemas/script-host-protocol/v7","x-framing":{format:`Content-Length: <UTF-8 byte length>\r
15
17
  \r
16
- <JSON bytes>`,maximumFrameBytes:8388608},oneOf:[{$ref:"#/$defs/ready"},{$ref:"#/$defs/registerModule"},{$ref:"#/$defs/moduleRegistered"},{$ref:"#/$defs/execute"},{$ref:"#/$defs/cancel"},{$ref:"#/$defs/completed"},{$ref:"#/$defs/capabilityCall"},{$ref:"#/$defs/capabilityResult"},{$ref:"#/$defs/fetchObservation"},{$ref:"#/$defs/fetchObservationAck"}],$defs:{id:{type:"string",minLength:1,maxLength:256},sha256:{type:"string",pattern:"^sha256:[0-9a-f]{64}$"},base:{type:"object",required:["protocol","protocolVersion","messageType"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:8},messageType:{type:"string"}}},ready:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","hostInstanceId"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:8},messageType:{const:"ready"},hostInstanceId:{$ref:"#/$defs/id"}}},registerModule:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","bundleDigest","bundle","sourceMapDigest","sourceMap"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:8},messageType:{const:"register_module"},bundleDigest:{$ref:"#/$defs/sha256"},bundle:{type:"string",maxLength:3145728},sourceMapDigest:{$ref:"#/$defs/sha256"},sourceMap:{type:"string",maxLength:3145728}}},moduleRegistered:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","bundleDigest","sourceMapDigest","accepted"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:8},messageType:{const:"module_registered"},bundleDigest:{$ref:"#/$defs/sha256"},sourceMapDigest:{$ref:"#/$defs/sha256"},accepted:{type:"boolean"},code:{type:"string"},message:{type:"string"}}},moduleBinding:{type:"object",additionalProperties:!1,required:["name","bundleDigest","exports"],properties:{name:{type:"string",pattern:"^[a-z][A-Za-z0-9]*$",maxLength:128},bundleDigest:{$ref:"#/$defs/sha256"},exports:{type:"array",minItems:1,uniqueItems:!0,items:{type:"string",pattern:"^[A-Za-z_$][A-Za-z0-9_$]*$"}}}},reusableDefinition:{type:"object",additionalProperties:!1,required:["kind","alias","digest","source"],properties:{kind:{enum:["step","notification-provider"]},alias:{$ref:"#/$defs/id"},digest:{$ref:"#/$defs/sha256"},source:{type:"string",minLength:1,maxLength:4096}}},reusable:{type:"object",additionalProperties:!1,required:["profile","invocationId","definition","props"],properties:{profile:{const:"woml.reusable-script-binding/v3"},invocationId:{$ref:"#/$defs/id"},definition:{$ref:"#/$defs/reusableDefinition"},props:{type:"object",maxProperties:64}}},reusableLifecycle:{type:"object",additionalProperties:!1,required:["hook","outcome"],properties:{hook:{enum:["on-success","on-error","on-complete"]},outcome:{enum:["succeeded","failed","cancelled"]},result:!0,error:{type:"object",additionalProperties:!1,required:["code","message"],properties:{code:{type:"string",minLength:1},message:{type:"string",minLength:1}}}}},execute:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","runId","nodeId","attempt","mode","handler","timeoutMs","source","context","bindings","modules"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:8},messageType:{const:"execute"},invocationId:{$ref:"#/$defs/id"},runId:{$ref:"#/$defs/id"},nodeId:{$ref:"#/$defs/id"},attempt:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/attempt"},mode:{enum:["step","lifecycle"]},handler:{enum:["runtime.script","runtime.lifecycle-script"]},timeoutMs:{type:"integer",minimum:1,maximum:86400000},source:{type:"string"},context:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/context"},bindings:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v7#/$defs/bindings"},modules:{type:"array",maxItems:64,items:{$ref:"#/$defs/moduleBinding"}},lifecycle:{$ref:"https://woml.dev/schemas/lifecycle-binding/v1"},reusable:{$ref:"#/$defs/reusable"},reusableLifecycle:{$ref:"#/$defs/reusableLifecycle"}},allOf:[{if:{required:["reusableLifecycle"]},then:{required:["reusable"],properties:{mode:{const:"lifecycle"},handler:{const:"runtime.lifecycle-script"}}}},{if:{required:["reusable"],not:{required:["reusableLifecycle"]}},then:{properties:{mode:{const:"step"},handler:{const:"runtime.script"}}}}]},cancel:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","reason"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:8},messageType:{const:"cancel"},invocationId:{$ref:"#/$defs/id"},reason:{enum:["parallel_fail_fast","step_timed_out","run_cancelled","host_shutdown"]}}},completed:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:8},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/id"},outcome:{type:"object"},durationMs:{type:"number",minimum:0}}},capabilityCall:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","callId","call"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:8},messageType:{const:"capability_call"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},call:{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/request"}}},capabilityResult:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","callId","result"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:8},messageType:{const:"capability_result"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},result:{type:"object"}}},fetchObservation:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","requestId","observation"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:8},messageType:{const:"fetch_observation"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},observation:{$ref:"https://cronflow.dev/schemas/native-fetch-observation/v1"}}},fetchObservationAck:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","requestId","accepted"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:8},messageType:{const:"fetch_observation_ack"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},accepted:{type:"boolean"},error:{type:"object"}}}}};var Ln={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://woml.dev/schemas/script-host-protocol/v9",title:"WOML For-Each Script Host Protocol v9",description:"Protocol v8 plus bounded iteration-local context for loop-body and matching lifecycle invocations.","x-status":"for-each-fe0-frozen","x-previousVersion":"https://cronflow.dev/schemas/script-host-protocol/v8","x-framing":{format:`Content-Length: <UTF-8 byte length>\r
18
+ <JSON bytes>`,maximumFrameBytes:8388608},oneOf:[{$ref:"#/$defs/ready"},{$ref:"#/$defs/registerModule"},{$ref:"#/$defs/moduleRegistered"},{$ref:"#/$defs/execute"},{$ref:"#/$defs/cancel"},{$ref:"#/$defs/completed"},{$ref:"#/$defs/capabilityCall"},{$ref:"#/$defs/capabilityResult"},{$ref:"#/$defs/fetchObservation"},{$ref:"#/$defs/fetchObservationAck"}],$defs:{id:{type:"string",minLength:1,maxLength:256},sha256:{type:"string",pattern:"^sha256:[0-9a-f]{64}$"},base:{type:"object",required:["protocol","protocolVersion","messageType"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:8},messageType:{type:"string"}}},ready:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","hostInstanceId"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:8},messageType:{const:"ready"},hostInstanceId:{$ref:"#/$defs/id"}}},registerModule:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","bundleDigest","bundle","sourceMapDigest","sourceMap"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:8},messageType:{const:"register_module"},bundleDigest:{$ref:"#/$defs/sha256"},bundle:{type:"string",maxLength:3145728},sourceMapDigest:{$ref:"#/$defs/sha256"},sourceMap:{type:"string",maxLength:3145728}}},moduleRegistered:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","bundleDigest","sourceMapDigest","accepted"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:8},messageType:{const:"module_registered"},bundleDigest:{$ref:"#/$defs/sha256"},sourceMapDigest:{$ref:"#/$defs/sha256"},accepted:{type:"boolean"},code:{type:"string"},message:{type:"string"}}},moduleBinding:{type:"object",additionalProperties:!1,required:["name","bundleDigest","exports"],properties:{name:{type:"string",pattern:"^[a-z][A-Za-z0-9]*$",maxLength:128},bundleDigest:{$ref:"#/$defs/sha256"},exports:{type:"array",minItems:1,uniqueItems:!0,items:{type:"string",pattern:"^[A-Za-z_$][A-Za-z0-9_$]*$"}}}},reusableDefinition:{type:"object",additionalProperties:!1,required:["kind","alias","digest","source"],properties:{kind:{enum:["step","notification-provider"]},alias:{$ref:"#/$defs/id"},digest:{$ref:"#/$defs/sha256"},source:{type:"string",minLength:1,maxLength:4096}}},reusable:{type:"object",additionalProperties:!1,required:["profile","invocationId","definition","props"],properties:{profile:{const:"woml.reusable-script-binding/v3"},invocationId:{$ref:"#/$defs/id"},definition:{$ref:"#/$defs/reusableDefinition"},props:{type:"object",maxProperties:64}}},reusableLifecycle:{type:"object",additionalProperties:!1,required:["hook","outcome"],properties:{hook:{enum:["on-success","on-error","on-complete"]},outcome:{enum:["succeeded","failed","cancelled"]},result:!0,error:{type:"object",additionalProperties:!1,required:["code","message"],properties:{code:{type:"string",minLength:1},message:{type:"string",minLength:1}}}}},execute:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","runId","nodeId","attempt","mode","handler","timeoutMs","source","context","bindings","modules"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:8},messageType:{const:"execute"},invocationId:{$ref:"#/$defs/id"},runId:{$ref:"#/$defs/id"},nodeId:{$ref:"#/$defs/id"},attempt:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/attempt"},mode:{enum:["step","lifecycle"]},handler:{enum:["runtime.script","runtime.lifecycle-script"]},timeoutMs:{type:"integer",minimum:1,maximum:86400000},source:{type:"string"},context:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/context"},bindings:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v7#/$defs/bindings"},modules:{type:"array",maxItems:64,items:{$ref:"#/$defs/moduleBinding"}},lifecycle:{$ref:"https://woml.dev/schemas/lifecycle-binding/v1"},reusable:{$ref:"#/$defs/reusable"},reusableLifecycle:{$ref:"#/$defs/reusableLifecycle"}},allOf:[{if:{required:["reusableLifecycle"]},then:{required:["reusable"],properties:{mode:{const:"lifecycle"},handler:{const:"runtime.lifecycle-script"}}}},{if:{required:["reusable"],not:{required:["reusableLifecycle"]}},then:{properties:{mode:{const:"step"},handler:{const:"runtime.script"}}}}]},cancel:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","reason"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:8},messageType:{const:"cancel"},invocationId:{$ref:"#/$defs/id"},reason:{enum:["parallel_fail_fast","step_timed_out","run_cancelled","host_shutdown"]}}},completed:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:8},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/id"},outcome:{type:"object"},durationMs:{type:"number",minimum:0}}},capabilityCall:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","callId","call"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:8},messageType:{const:"capability_call"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},call:{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/request"}}},capabilityResult:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","callId","result"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:8},messageType:{const:"capability_result"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},result:{type:"object"}}},fetchObservation:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","requestId","observation"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:8},messageType:{const:"fetch_observation"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},observation:{$ref:"https://cronflow.dev/schemas/native-fetch-observation/v1"}}},fetchObservationAck:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","requestId","accepted"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:8},messageType:{const:"fetch_observation_ack"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},accepted:{type:"boolean"},error:{type:"object"}}}}};var Js={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://woml.dev/schemas/script-host-protocol/v9",title:"WOML For-Each Script Host Protocol v9",description:"Protocol v8 plus bounded iteration-local context for loop-body and matching lifecycle invocations.","x-status":"for-each-fe0-frozen","x-previousVersion":"https://cronflow.dev/schemas/script-host-protocol/v8","x-framing":{format:`Content-Length: <UTF-8 byte length>\r
17
19
  \r
18
- <JSON bytes>`,maximumFrameBytes:8388608},"x-multiplexing":"Execute messages remain asynchronous; completed responses correlate only by invocationId and may arrive out of order.","x-iterationRule":"context.item and context.iteration are both required for a loop-owned invocation and both forbidden for a root invocation.",oneOf:[{$ref:"#/$defs/ready"},{$ref:"#/$defs/registerModule"},{$ref:"#/$defs/moduleRegistered"},{$ref:"#/$defs/execute"},{$ref:"#/$defs/cancel"},{$ref:"#/$defs/completed"},{$ref:"#/$defs/capabilityCall"},{$ref:"#/$defs/capabilityResult"},{$ref:"#/$defs/fetchObservation"},{$ref:"#/$defs/fetchObservationAck"}],$defs:{id:{type:"string",minLength:1,maxLength:256},sha256:{type:"string",pattern:"^sha256:[0-9a-f]{64}$"},ready:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","hostInstanceId"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:9},messageType:{const:"ready"},hostInstanceId:{$ref:"#/$defs/id"}}},registerModule:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","bundleDigest","bundle","sourceMapDigest","sourceMap"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:9},messageType:{const:"register_module"},bundleDigest:{$ref:"#/$defs/sha256"},bundle:{type:"string",maxLength:3145728},sourceMapDigest:{$ref:"#/$defs/sha256"},sourceMap:{type:"string",maxLength:3145728}}},moduleRegistered:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","bundleDigest","sourceMapDigest","accepted"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:9},messageType:{const:"module_registered"},bundleDigest:{$ref:"#/$defs/sha256"},sourceMapDigest:{$ref:"#/$defs/sha256"},accepted:{type:"boolean"},code:{type:"string"},message:{type:"string"}}},moduleBinding:{type:"object",additionalProperties:!1,required:["name","bundleDigest","exports"],properties:{name:{type:"string",pattern:"^[a-z][A-Za-z0-9]*$",maxLength:128},bundleDigest:{$ref:"#/$defs/sha256"},exports:{type:"array",minItems:1,uniqueItems:!0,items:{type:"string",pattern:"^[A-Za-z_$][A-Za-z0-9_$]*$"}}}},reusableDefinition:{type:"object",additionalProperties:!1,required:["kind","alias","digest","source"],properties:{kind:{enum:["step","notification-provider"]},alias:{$ref:"#/$defs/id"},digest:{$ref:"#/$defs/sha256"},source:{type:"string",minLength:1,maxLength:4096}}},reusable:{type:"object",additionalProperties:!1,required:["profile","invocationId","definition","props"],properties:{profile:{const:"woml.reusable-script-binding/v3"},invocationId:{$ref:"#/$defs/id"},definition:{$ref:"#/$defs/reusableDefinition"},props:{type:"object",maxProperties:64}}},reusableLifecycle:{type:"object",additionalProperties:!1,required:["hook","outcome"],properties:{hook:{enum:["on-success","on-error","on-complete"]},outcome:{enum:["succeeded","failed","cancelled"]},result:!0,error:{type:"object",additionalProperties:!1,required:["code","message"],properties:{code:{type:"string",minLength:1},message:{type:"string",minLength:1}}}}},iteration:{type:"object",additionalProperties:!1,required:["index","total"],properties:{index:{type:"integer",minimum:0,maximum:9999},total:{type:"integer",minimum:1,maximum:1e4}}},context:{type:"object",additionalProperties:!1,required:["trigger","steps"],properties:{trigger:{type:"object"},steps:{type:"object",additionalProperties:!0},item:!0,iteration:{$ref:"#/$defs/iteration"}},oneOf:[{required:["item","iteration"]},{not:{anyOf:[{required:["item"]},{required:["iteration"]}]}}]},execute:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","runId","nodeId","attempt","mode","handler","timeoutMs","source","context","bindings","modules"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:9},messageType:{const:"execute"},invocationId:{$ref:"#/$defs/id"},runId:{$ref:"#/$defs/id"},nodeId:{$ref:"#/$defs/id"},attempt:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/attempt"},mode:{enum:["step","lifecycle"]},handler:{enum:["runtime.script","runtime.lifecycle-script"]},timeoutMs:{type:"integer",minimum:1,maximum:86400000},source:{type:"string"},context:{$ref:"#/$defs/context"},bindings:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v7#/$defs/bindings"},modules:{type:"array",maxItems:64,items:{$ref:"#/$defs/moduleBinding"}},lifecycle:{$ref:"https://woml.dev/schemas/lifecycle-binding/v1"},reusable:{$ref:"#/$defs/reusable"},reusableLifecycle:{$ref:"#/$defs/reusableLifecycle"}},allOf:[{if:{required:["reusableLifecycle"]},then:{required:["reusable"],properties:{mode:{const:"lifecycle"},handler:{const:"runtime.lifecycle-script"}}}},{if:{required:["reusable"],not:{required:["reusableLifecycle"]}},then:{properties:{mode:{const:"step"},handler:{const:"runtime.script"}}}}]},cancel:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","reason"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:9},messageType:{const:"cancel"},invocationId:{$ref:"#/$defs/id"},reason:{enum:["parallel_fail_fast","step_timed_out","run_cancelled","host_shutdown"]}}},completed:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:9},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/id"},outcome:{type:"object"},durationMs:{type:"number",minimum:0}}},capabilityCall:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","callId","call"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:9},messageType:{const:"capability_call"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},call:{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/request"}}},capabilityResult:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","callId","result"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:9},messageType:{const:"capability_result"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},result:{type:"object"}}},fetchObservation:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","requestId","observation"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:9},messageType:{const:"fetch_observation"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},observation:{$ref:"https://cronflow.dev/schemas/native-fetch-observation/v1"}}},fetchObservationAck:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","requestId","accepted"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:9},messageType:{const:"fetch_observation_ack"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},accepted:{type:"boolean"},error:{type:"object"}}}}};var qn={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://woml.dev/schemas/lifecycle-binding/v1",title:"WOML Lifecycle Runtime Binding v1","x-status":"lifecycle-engine-controls-lec0-frozen","x-forbiddenFields":["secrets","stack","eventId","invocationId","operationKey","idempotencyKey","context.run"],type:"object",additionalProperties:!1,required:["event","workflow"],properties:{event:{enum:["run_start","step_start","step_success","step_failure","step_complete","run_success","run_failure","run_cancel","run_complete"]},workflow:{$ref:"#/$defs/workflow"},step:{$ref:"#/$defs/step"},failure:{$ref:"#/$defs/failure"}},$defs:{workflow:{type:"object",additionalProperties:!1,required:["id"],properties:{id:{type:"string",minLength:1,maxLength:256},outcome:{enum:["succeeded","failed","cancelled"]}}},step:{type:"object",additionalProperties:!1,required:["id","attempts"],properties:{id:{type:"string",pattern:"^[a-z][A-Za-z0-9]*$"},outcome:{enum:["succeeded","failed","cancelled"]},attempts:{type:"integer",minimum:0,maximum:10}}},failure:{type:"object",additionalProperties:!1,required:["code","message"],properties:{code:{type:"string",pattern:"^WOML_[A-Z0-9_]+$",maxLength:128},message:{type:"string",minLength:1,maxLength:1024}}}}};var D=new Tn.default({allErrors:!0,strict:!1,logger:!1});D.addSchema(fn);D.addSchema(sn);D.addSchema(nn);D.addSchema(bn);D.addSchema(un);D.addSchema(qn);var L6=D.compile(In),q6=D.compile(yn),T6=D.compile(en),O6=D.compile(Mn),W6=D.compile(dn),j6=D.compile(Vn),Ki=D.compile(cn),On=D.compile(pn),Wn=D.compile(Ln);function tt(t,i,o=[]){let r=new Set([...i,...o]);return i.every(($)=>Object.hasOwn(t,$))&&Object.keys(t).every(($)=>r.has($))}function jn(t){if(typeof t!=="object"||t===null||Array.isArray(t))return!1;let i=t,o=i.definition,r=i.props;return tt(i,["profile","invocationId","definition","props"])&&i.profile==="woml.reusable-script-binding/v3"&&typeof i.invocationId==="string"&&i.invocationId.length>=1&&i.invocationId.length<=256&&typeof o==="object"&&o!==null&&!Array.isArray(o)&&tt(o,["kind","alias","digest","source"])&&(o.kind==="step"||o.kind==="notification-provider")&&typeof o.alias==="string"&&/^sha256:[0-9a-f]{64}$/.test(String(o.digest))&&typeof o.source==="string"&&typeof r==="object"&&r!==null&&!Array.isArray(r)&&Object.keys(r).length<=64&&Buffer.byteLength(JSON.stringify(r),"utf8")<=1048576}function wn(t){if(typeof t!=="object"||t===null||Array.isArray(t))return!1;let i=t;return tt(i,["hook","outcome"],["result","error"])&&(i.hook==="on-success"||i.hook==="on-error"||i.hook==="on-complete")&&(i.outcome==="succeeded"||i.outcome==="failed"||i.outcome==="cancelled")&&(i.error===void 0||typeof i.error==="object"&&i.error!==null&&!Array.isArray(i.error)&&tt(i.error,["code","message"])&&typeof i.error.code==="string"&&typeof i.error.message==="string")}function Fn(t,i){let{attempt:o,context:r,bindings:$,modules:l}=t;return tt(t,["protocol","protocolVersion","messageType","invocationId","runId","nodeId","attempt","mode","handler","timeoutMs","source","context","bindings","modules"],["lifecycle","reusable","reusableLifecycle"])&&t.protocol==="woml.script-host"&&t.protocolVersion===i&&t.messageType==="execute"&&[t.invocationId,t.runId,t.nodeId].every((f)=>typeof f==="string"&&f.length>0&&f.length<=256)&&typeof o==="object"&&o!==null&&!Array.isArray(o)&&tt(o,["number","maxAttempts","idempotencyKey"])&&Number.isInteger(o.number)&&Number(o.number)>=1&&Number.isInteger(o.maxAttempts)&&Number(o.maxAttempts)>=1&&/^sha256:[0-9a-f]{64}$/.test(String(o.idempotencyKey))&&(t.mode==="step"&&t.handler==="runtime.script"||t.mode==="lifecycle"&&t.handler==="runtime.lifecycle-script")&&Number.isInteger(t.timeoutMs)&&Number(t.timeoutMs)>=1&&Number(t.timeoutMs)<=86400000&&typeof t.source==="string"&&typeof r==="object"&&r!==null&&!Array.isArray(r)&&tt(r,["trigger","steps"],i===9?["item","iteration"]:[])&&typeof r.trigger==="object"&&r.trigger!==null&&typeof r.steps==="object"&&r.steps!==null&&typeof $==="object"&&$!==null&&!Array.isArray($)&&tt($,["bindingVersion","servicesVersion","secrets"])&&$.bindingVersion===1&&$.servicesVersion===1&&typeof $.secrets==="object"&&$.secrets!==null&&Array.isArray(l)&&l.length<=64&&l.every((f)=>{if(typeof f!=="object"||f===null||Array.isArray(f))return!1;let s=f;return tt(s,["name","bundleDigest","exports"])&&typeof s.name==="string"&&/^[a-z][A-Za-z0-9]*$/.test(s.name)&&/^sha256:[0-9a-f]{64}$/.test(String(s.bundleDigest))&&Array.isArray(s.exports)&&s.exports.length>0&&s.exports.every((n)=>typeof n==="string")})}function w6(t){let i=t.context,o=Object.hasOwn(i,"item"),r=Object.hasOwn(i,"iteration");if(o!==r)return!1;if(!r)return!0;let $=i.iteration;if(typeof $!=="object"||$===null||Array.isArray($))return!1;let l=$;return tt(l,["index","total"])&&Number.isInteger(l.index)&&Number.isInteger(l.total)&&Number(l.total)>=1&&Number(l.total)<=1e4&&Number(l.index)>=0&&Number(l.index)<Number(l.total)}function Zn(t){if(typeof t!=="object"||t===null||Array.isArray(t))return!1;let i=t;if(i.protocolVersion!==8)return!1;if(!On(t))return!1;if(i.messageType==="execute"){if(!Fn(i,8))return!1;if(i.reusable===void 0)return i.reusableLifecycle===void 0;if(!jn(i.reusable))return!1;if(i.reusableLifecycle===void 0)return i.mode==="step";return i.mode==="lifecycle"&&wn(i.reusableLifecycle)}let o={...i,protocolVersion:7};if(delete o.reusable,delete o.reusableLifecycle,!Ki(o))return!1;return i.reusable===void 0&&i.reusableLifecycle===void 0}function F6(t){if(typeof t!=="object"||t===null||Array.isArray(t))return!1;let i=t;if(i.protocolVersion!==9||!Wn(t))return!1;if(i.messageType==="execute"){if(!Fn(i,9)||!w6(i))return!1;if(i.reusable===void 0)return i.reusableLifecycle===void 0;if(!jn(i.reusable))return!1;if(i.reusableLifecycle===void 0)return i.mode==="step";return i.mode==="lifecycle"&&wn(i.reusableLifecycle)}let o={...i,protocolVersion:8};return Zn(o)}class S extends Error{constructor(t){super(t);this.name="MessageProtocolError"}}function Z6(t){if((t.protocolVersion===3||t.protocolVersion===4||t.protocolVersion===5||t.protocolVersion===6||t.protocolVersion===7||t.protocolVersion===8||t.protocolVersion===9)&&t.attempt.number>t.attempt.maxAttempts)throw new S(`Script-host protocol v${t.protocolVersion} attempt.number must not exceed attempt.maxAttempts.`)}function B6(t){if(t===void 0||t===null||t.length===0)return"unknown schema violation";return t.slice(0,5).map((i)=>`${i.instancePath||"/"} ${i.message??i.keyword}`).join("; ")}function Bn(t,i){let o=i===9?Ki:i===8?Ki:i===7?Ki:i===6?j6:i===5?W6:i===4?O6:i===3?T6:i===2?q6:L6,r=i===9?F6(t):Zn(t);if(!(i>=8?r:o(t)))throw new S(`Message does not match script-host protocol v${i}: ${B6(i>=8?i===9?Wn.errors:On.errors:o.errors)}.`);if(typeof t!=="object"||t===null||!("protocolVersion"in t)||t.protocolVersion!==i||!("messageType"in t)||t.messageType!=="execute"&&t.messageType!=="register_module"&&t.messageType!=="cancel"&&t.messageType!=="capability_result"&&t.messageType!=="fetch_observation_ack")throw new S(`The Bun script host received an unsupported protocol-v${i} message direction.`);if(t.messageType==="execute")Z6(t)}var Jn=3145728,J6=33554432,X6=64;function So(t,i){let o={protocol:"woml.script-host",messageType:"module_registered",bundleDigest:t.bundleDigest,...i};return t.protocolVersion===6||t.protocolVersion===7||t.protocolVersion===8||t.protocolVersion===9?{...o,protocolVersion:t.protocolVersion,sourceMapDigest:t.sourceMapDigest}:{...o,protocolVersion:5}}function Yn(t){return Math.max(0,performance.now()-t)}function yt(t,i,o){return{protocol:"woml.script-host",protocolVersion:t.protocolVersion,messageType:"completed",invocationId:t.invocationId,outcome:{kind:"failure",error:o},durationMs:Yn(i)}}function Y6(t,i,o){return{protocol:"woml.script-host",protocolVersion:t.protocolVersion,messageType:"completed",invocationId:t.invocationId,outcome:{kind:"success",value:o},durationMs:Yn(i)}}function Xn(t){return Buffer.byteLength(JSON.stringify(t),"utf8")}class Co{#o;#t;#i;#e;#b=new Map;#$=new Map;#u=new Map;#l=new Map;#f=new Set;#r=new Map;#s=new Map;#n=new Set;#I=new Map;#y=0;#M=!1;constructor(t){this.#o=t.workerUrl,this.#t=t.limits??{},this.#i=t.send,this.#e=t.protocolVersion??3}accept(t){if(this.#M)throw new S("The script host is shutting down.");if(Bn(t,this.#e),t.messageType==="register_module"){this.#d(t);return}if(t.messageType==="cancel"){this.#V(t);return}if(t.messageType==="capability_result"){this.#c(t);return}if(t.messageType==="fetch_observation_ack"){this.#p(t);return}if(this.#b.has(t.invocationId))throw new S(`Invocation ID "${t.invocationId}" is already active.`);let i=this.#L(t).finally(()=>{this.#b.delete(t.invocationId),this.#u.delete(t.invocationId)});this.#b.set(t.invocationId,i)}#d(t){let i=`sha256:${new Bun.CryptoHasher("sha256").update(t.bundle).digest("hex")}`,o=t.protocolVersion===6||t.protocolVersion===7||t.protocolVersion===8||t.protocolVersion===9?`sha256:${new Bun.CryptoHasher("sha256").update(t.sourceMap).digest("hex")}`:void 0;if(i!==t.bundleDigest||(t.protocolVersion===6||t.protocolVersion===7||t.protocolVersion===8||t.protocolVersion===9)&&o!==t.sourceMapDigest){this.#i(So(t,{accepted:!1,code:"WOML_MODULE_DIGEST_MISMATCH",message:"The registered module bundle does not match its SHA-256 identity."}));return}let $=this.#I.get(t.bundleDigest);if($!==void 0&&($.bundle!==t.bundle||(t.protocolVersion===6||t.protocolVersion===7||t.protocolVersion===8||t.protocolVersion===9)&&($.sourceMap!==t.sourceMap||$.sourceMapDigest!==t.sourceMapDigest)))throw new S("One module digest was registered with different immutable bytes.");let l=Buffer.byteLength(t.bundle,"utf8")+(t.protocolVersion===6||t.protocolVersion===7||t.protocolVersion===8||t.protocolVersion===9?Buffer.byteLength(t.sourceMap,"utf8"):0),f=Buffer.byteLength(t.bundle,"utf8")>Jn||(t.protocolVersion===6||t.protocolVersion===7||t.protocolVersion===8||t.protocolVersion===9)&&Buffer.byteLength(t.sourceMap,"utf8")>Jn;if($===void 0&&(f||this.#I.size>=X6||this.#y+l>J6)){this.#i(So(t,{accepted:!1,code:"WOML_MODULE_CACHE_LIMIT_EXCEEDED",message:"The immutable module cache limit was exceeded."}));return}if($===void 0)this.#I.set(t.bundleDigest,{bundle:t.bundle,...t.protocolVersion===6||t.protocolVersion===7||t.protocolVersion===8||t.protocolVersion===9?{sourceMap:t.sourceMap,sourceMapDigest:t.sourceMapDigest}:{},bytes:l}),this.#y+=l;this.#i(So(t,{accepted:!0}))}async drain(){while(this.#b.size>0)await Promise.all([...this.#b.values()])}abort(){this.#M=!0;for(let t of this.#$.values())t.terminate();this.#$.clear(),this.#u.clear(),this.#l.clear(),this.#f.clear(),this.#r.clear(),this.#s.clear(),this.#n.clear(),this.#I.clear(),this.#y=0}#V(t){this.#u.get(t.invocationId)?.(t.reason)}#c(t){if(t.invocationId!==t.result.invocationId||t.callId!==t.result.callId)throw new S("Capability result wrapper IDs do not match its result payload.");let i=this.#$.get(t.invocationId),o=this.#l.get(t.invocationId);if(i===void 0||o===void 0||!o.delete(t.callId)){let r=`${t.invocationId}\x00${t.callId}`;if(this.#f.delete(r))return;throw new S(`Capability result references unknown call ID "${t.callId}".`)}i.postMessage({messageType:"capability_result",callId:t.callId,result:t.result})}#p(t){let i=this.#$.get(t.invocationId),o=this.#r.get(t.invocationId),r=o?.get(t.requestId);if(i===void 0||o===void 0||r===void 0){let l=`${t.invocationId}\x00${t.requestId}`;if(this.#n.delete(l))return;throw new S(`Native Fetch acknowledgement references unknown request ID "${t.requestId}".`)}o.delete(t.requestId);let $=this.#s.get(t.invocationId);if(t.accepted&&r==="started")$.add(t.requestId);if(!t.accepted||r==="terminal")$.delete(t.requestId);i.postMessage({messageType:"fetch_observation_ack",requestId:t.requestId,ack:t})}async#L(t){let i=performance.now(),o=Xn(t.context);if(this.#t.maxContextBytes!==void 0&&o>this.#t.maxContextBytes){await this.#i(yt(t,i,{kind:"context_too_large",code:"WOML_SCRIPT_CONTEXT_TOO_LARGE",message:"Invocation context exceeds the configured byte limit.",details:{actualBytes:o,limitBytes:this.#t.maxContextBytes}}));return}let r=await this.#q(t);if(r.kind==="timeout"){await this.#i(yt(t,i,{kind:"script_timed_out",code:"WOML_SCRIPT_TIMEOUT",message:"Script exceeded its execution deadline."}));return}if(r.kind==="cancelled"){await this.#i(yt(t,i,{kind:"invocation_cancelled",code:"WOML_SCRIPT_CANCELLED",message:r.reason==="parallel_fail_fast"?"Invocation was cancelled by parallel fail-fast.":r.reason==="run_cancelled"?"Invocation was cancelled because its run was cancelled.":r.reason==="step_timed_out"?"Invocation was cancelled because its step timed out.":"Invocation was cancelled because the script host is shutting down."}));return}if(r.kind==="crashed"){await this.#i(yt(t,i,{kind:"worker_crashed",code:"WOML_SCRIPT_WORKER_CRASHED",message:r.message}));return}let $=r.response;if(!$.ok){await this.#i(yt(t,i,{...$.error.kind==="service"&&$.error.capability!==void 0&&$.error.operation!==void 0&&$.error.callId!==void 0&&$.error.cause!==void 0?{kind:"service_failed",code:$.error.cause.code,message:$.error.message,capability:$.error.capability,operation:$.error.operation,callId:$.error.callId,retryable:$.error.cause.retryable,ambiguous:$.error.cause.ambiguous,cause:$.error.cause}:{kind:$.error.kind==="non-json"?"invalid_script_result":"script_threw",code:$.error.kind==="non-json"?"WOML_SCRIPT_NON_JSON_RESULT":"WOML_SCRIPT_THROWN",message:$.error.moduleFrame===void 0?$.error.message:`${$.error.message} (${$.error.moduleFrame})`}}));return}let l=tr($.result);if(l!==void 0){await this.#i(yt(t,i,{kind:"invalid_script_result",code:"WOML_SCRIPT_NON_JSON_RESULT",message:`${l.path}: ${l.reason}`}));return}if((t.protocolVersion===4||t.protocolVersion===5||t.protocolVersion===6||t.protocolVersion===7||t.protocolVersion===8||t.protocolVersion===9)&&ko($.result,Object.values(t.bindings.secrets))){await this.#i(yt(t,i,{kind:"invalid_script_result",code:"WOML_SCRIPT_NON_JSON_RESULT",message:"Script results must not contain a resolved secret value."}));return}let f=Xn($.result);if(this.#t.maxResultBytes!==void 0&&f>this.#t.maxResultBytes){await this.#i(yt(t,i,{kind:"result_too_large",code:"WOML_SCRIPT_RESULT_TOO_LARGE",message:"Script result exceeds the configured byte limit.",details:{actualBytes:f,limitBytes:this.#t.maxResultBytes}}));return}await this.#i(Y6(t,i,$.result))}#q(t){let i;try{i=new Worker(this.#o,{type:"module",ref:!0,smol:!0,env:{}})}catch{return Promise.resolve({kind:"crashed",message:"The isolated script Worker could not be started."})}return this.#$.set(t.invocationId,i),new Promise((o)=>{let r=!1,$=(f)=>{if(r)return;r=!0,clearTimeout(l),this.#$.delete(t.invocationId),this.#u.delete(t.invocationId);for(let s of this.#l.get(t.invocationId)??[])this.#f.add(`${t.invocationId}\x00${s}`);for(let s of this.#r.get(t.invocationId)?.keys()??[])this.#n.add(`${t.invocationId}\x00${s}`);while(this.#f.size>4096){let s=this.#f.values().next().value;if(s===void 0)break;this.#f.delete(s)}while(this.#n.size>4096){let s=this.#n.values().next().value;if(s===void 0)break;this.#n.delete(s)}this.#l.delete(t.invocationId),this.#r.delete(t.invocationId),this.#s.delete(t.invocationId),i.terminate(),o(f)},l=setTimeout(()=>$({kind:"timeout"}),t.timeoutMs);this.#u.set(t.invocationId,(f)=>{$({kind:"cancelled",reason:f})}),this.#l.set(t.invocationId,new Set),this.#r.set(t.invocationId,new Map),this.#s.set(t.invocationId,new Set),i.onmessage=(f)=>{let s=f.data;if(s.messageType==="completed"){if((this.#r.get(t.invocationId)?.size??0)>0||(this.#s.get(t.invocationId)?.size??0)>0){$({kind:"crashed",message:"The isolated script Worker completed with an unclosed native Fetch observation."});return}$({kind:"response",response:s.response});return}if(s.messageType==="fetch_observation"){let u=s.observation;if(t.protocolVersion!==4&&t.protocolVersion!==5&&t.protocolVersion!==6&&t.protocolVersion!==7&&t.protocolVersion!==8&&t.protocolVersion!==9||u.invocationId!==t.invocationId){$({kind:"crashed",message:"The isolated script Worker emitted an invalid native Fetch observation."});return}let I=this.#r.get(t.invocationId),V=this.#s.get(t.invocationId),d=u.observationType==="started"?"started":"terminal";if(I.has(u.requestId)||(d==="started"?V.has(u.requestId):!V.has(u.requestId))){$({kind:"crashed",message:"The isolated script Worker violated the native Fetch observation lifecycle."});return}I.set(u.requestId,d),this.#i({protocol:"woml.script-host",protocolVersion:t.protocolVersion,messageType:"fetch_observation",invocationId:t.invocationId,requestId:u.requestId,observation:u}).catch(()=>{$({kind:"crashed",message:"The native Fetch observation could not be sent to Rust."})});return}let n=s.call;if(t.protocolVersion!==4&&t.protocolVersion!==5&&t.protocolVersion!==6&&t.protocolVersion!==7&&t.protocolVersion!==8&&t.protocolVersion!==9||n.invocationId!==t.invocationId||n.runId!==t.runId||n.nodeId!==t.nodeId||n.attemptNumber!==t.attempt.number){$({kind:"crashed",message:"The isolated script Worker emitted an invalid capability call."});return}let b=this.#l.get(t.invocationId);if(b===void 0||b.has(n.callId)){$({kind:"crashed",message:"The isolated script Worker reused a capability call ID."});return}b.add(n.callId),this.#i({protocol:"woml.script-host",protocolVersion:t.protocolVersion,messageType:"capability_call",invocationId:t.invocationId,callId:n.callId,call:n}).catch(()=>{$({kind:"crashed",message:"The capability call could not be sent to Rust."})})},i.onerror=(f)=>{f.preventDefault(),$({kind:"crashed",message:f.message||"The isolated script Worker crashed."})},i.onmessageerror=()=>{$({kind:"crashed",message:"The isolated script Worker returned an unreadable message."})},i.addEventListener("close",()=>{$({kind:"crashed",message:"The isolated script Worker exited without a result."})});try{let f=t.protocolVersion===3||t.protocolVersion===4||t.protocolVersion===5||t.protocolVersion===6||t.protocolVersion===7||t.protocolVersion===8||t.protocolVersion===9?t.attempt:void 0;i.postMessage({messageType:"execute",request:{invocationId:t.invocationId,runId:t.runId,nodeId:t.nodeId,timeoutMs:t.timeoutMs,source:t.source,context:t.context,...t.protocolVersion===7||t.protocolVersion===8||t.protocolVersion===9?{mode:t.mode,...t.mode==="lifecycle"?{lifecycle:t.lifecycle}:{}}:{},...(t.protocolVersion===8||t.protocolVersion===9)&&t.reusable!==void 0?{reusable:t.reusable,...t.reusableLifecycle===void 0?{}:{reusableLifecycle:t.reusableLifecycle}}:{},attempt:f,...t.protocolVersion===4||t.protocolVersion===5||t.protocolVersion===6||t.protocolVersion===7||t.protocolVersion===8||t.protocolVersion===9?{bindings:t.bindings}:{},...t.protocolVersion===5||t.protocolVersion===6||t.protocolVersion===7||t.protocolVersion===8||t.protocolVersion===9?{modules:t.modules.map((s)=>{let n=this.#I.get(s.bundleDigest);if(n===void 0)throw new S(`Module bundle ${s.bundleDigest} was not registered.`);return{...s,bundle:n.bundle,...t.protocolVersion===6||t.protocolVersion===7||t.protocolVersion===8||t.protocolVersion===9?{sourceMap:n.sourceMap,sourceMapDigest:n.sourceMapDigest}:{}}})}:{}}})}catch{$({kind:"crashed",message:"The invocation could not be delivered to its script Worker."})}})}}function ko(t,i){let o=i.filter((r)=>r.length>0);if(o.length===0)return!1;if(typeof t==="string")return o.some((r)=>t.includes(r));if(Array.isArray(t))return t.some((r)=>ko(r,o));if(t!==null&&typeof t==="object")return Object.values(t).some((r)=>ko(r,o));return!1}function ho(t){let i=process.env[t];if(i===void 0||i==="")return;let o=Number(i);if(!Number.isSafeInteger(o)||o<1)throw Error(`${t} must be a positive safe integer when provided.`);return o}function z6(){return{maxContextBytes:ho("WOML_SCRIPT_HOST_MAX_CONTEXT_BYTES"),maxResultBytes:ho("WOML_SCRIPT_HOST_MAX_RESULT_BYTES"),maxFrameBytes:ho("WOML_SCRIPT_HOST_MAX_FRAME_BYTES")}}function Q6(){let t=process.env.WOML_SCRIPT_HOST_PROTOCOL_VERSION??"3";if(t==="1"||t==="2"||t==="3"||t==="4"||t==="5"||t==="6"||t==="7"||t==="8"||t==="9")return Number(t);throw Error("WOML_SCRIPT_HOST_PROTOCOL_VERSION must be 1, 2, 3, 4, 5, 6, 7, 8, or 9.")}async function G6(t){await new Promise((i,o)=>{process.stdout.write(t,(r)=>{if(r===null||r===void 0)i();else o(r)})})}async function H6(){let t=z6(),i=Q6(),o=new Ei({maxFrameBytes:t.maxFrameBytes}),r=new Ri(G6),$=import.meta.url.endsWith(".ts")?"./script-host-worker.ts":"./script-host-worker.js",l=new Co({workerUrl:new URL($,import.meta.url),limits:t,protocolVersion:i,send:(s)=>r.send(s)}),f={protocol:"woml.script-host",protocolVersion:i,messageType:"ready",hostInstanceId:`host_${A6()}`};try{await r.send(f);let s=Bun.stdin.stream().getReader();while(!0){let{done:n,value:b}=await s.read();if(n)break;for(let u of o.push(b))l.accept(u)}o.finish(),await l.drain(),await r.drain()}catch(s){l.abort();let n=s instanceof Error?`${s.name}: ${s.message}`:String(s);process.stderr.write(`WOML script host failed: ${n}
19
- `),process.exitCode=1}}if(import.meta.main)await H6();export{H6 as runScriptHost};
20
+ <JSON bytes>`,maximumFrameBytes:8388608},"x-multiplexing":"Execute messages remain asynchronous; completed responses correlate only by invocationId and may arrive out of order.","x-iterationRule":"context.item and context.iteration are both required for a loop-owned invocation and both forbidden for a root invocation.",oneOf:[{$ref:"#/$defs/ready"},{$ref:"#/$defs/registerModule"},{$ref:"#/$defs/moduleRegistered"},{$ref:"#/$defs/execute"},{$ref:"#/$defs/cancel"},{$ref:"#/$defs/completed"},{$ref:"#/$defs/capabilityCall"},{$ref:"#/$defs/capabilityResult"},{$ref:"#/$defs/fetchObservation"},{$ref:"#/$defs/fetchObservationAck"}],$defs:{id:{type:"string",minLength:1,maxLength:256},sha256:{type:"string",pattern:"^sha256:[0-9a-f]{64}$"},ready:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","hostInstanceId"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:9},messageType:{const:"ready"},hostInstanceId:{$ref:"#/$defs/id"}}},registerModule:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","bundleDigest","bundle","sourceMapDigest","sourceMap"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:9},messageType:{const:"register_module"},bundleDigest:{$ref:"#/$defs/sha256"},bundle:{type:"string",maxLength:3145728},sourceMapDigest:{$ref:"#/$defs/sha256"},sourceMap:{type:"string",maxLength:3145728}}},moduleRegistered:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","bundleDigest","sourceMapDigest","accepted"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:9},messageType:{const:"module_registered"},bundleDigest:{$ref:"#/$defs/sha256"},sourceMapDigest:{$ref:"#/$defs/sha256"},accepted:{type:"boolean"},code:{type:"string"},message:{type:"string"}}},moduleBinding:{type:"object",additionalProperties:!1,required:["name","bundleDigest","exports"],properties:{name:{type:"string",pattern:"^[a-z][A-Za-z0-9]*$",maxLength:128},bundleDigest:{$ref:"#/$defs/sha256"},exports:{type:"array",minItems:1,uniqueItems:!0,items:{type:"string",pattern:"^[A-Za-z_$][A-Za-z0-9_$]*$"}}}},reusableDefinition:{type:"object",additionalProperties:!1,required:["kind","alias","digest","source"],properties:{kind:{enum:["step","notification-provider"]},alias:{$ref:"#/$defs/id"},digest:{$ref:"#/$defs/sha256"},source:{type:"string",minLength:1,maxLength:4096}}},reusable:{type:"object",additionalProperties:!1,required:["profile","invocationId","definition","props"],properties:{profile:{const:"woml.reusable-script-binding/v3"},invocationId:{$ref:"#/$defs/id"},definition:{$ref:"#/$defs/reusableDefinition"},props:{type:"object",maxProperties:64}}},reusableLifecycle:{type:"object",additionalProperties:!1,required:["hook","outcome"],properties:{hook:{enum:["on-success","on-error","on-complete"]},outcome:{enum:["succeeded","failed","cancelled"]},result:!0,error:{type:"object",additionalProperties:!1,required:["code","message"],properties:{code:{type:"string",minLength:1},message:{type:"string",minLength:1}}}}},iteration:{type:"object",additionalProperties:!1,required:["index","total"],properties:{index:{type:"integer",minimum:0,maximum:9999},total:{type:"integer",minimum:1,maximum:1e4}}},context:{type:"object",additionalProperties:!1,required:["trigger","steps"],properties:{trigger:{type:"object"},steps:{type:"object",additionalProperties:!0},item:!0,iteration:{$ref:"#/$defs/iteration"}},oneOf:[{required:["item","iteration"]},{not:{anyOf:[{required:["item"]},{required:["iteration"]}]}}]},execute:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","runId","nodeId","attempt","mode","handler","timeoutMs","source","context","bindings","modules"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:9},messageType:{const:"execute"},invocationId:{$ref:"#/$defs/id"},runId:{$ref:"#/$defs/id"},nodeId:{$ref:"#/$defs/id"},attempt:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/attempt"},mode:{enum:["step","lifecycle"]},handler:{enum:["runtime.script","runtime.lifecycle-script"]},timeoutMs:{type:"integer",minimum:1,maximum:86400000},source:{type:"string"},context:{$ref:"#/$defs/context"},bindings:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v7#/$defs/bindings"},modules:{type:"array",maxItems:64,items:{$ref:"#/$defs/moduleBinding"}},lifecycle:{$ref:"https://woml.dev/schemas/lifecycle-binding/v1"},reusable:{$ref:"#/$defs/reusable"},reusableLifecycle:{$ref:"#/$defs/reusableLifecycle"}},allOf:[{if:{required:["reusableLifecycle"]},then:{required:["reusable"],properties:{mode:{const:"lifecycle"},handler:{const:"runtime.lifecycle-script"}}}},{if:{required:["reusable"],not:{required:["reusableLifecycle"]}},then:{properties:{mode:{const:"step"},handler:{const:"runtime.script"}}}}]},cancel:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","reason"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:9},messageType:{const:"cancel"},invocationId:{$ref:"#/$defs/id"},reason:{enum:["parallel_fail_fast","step_timed_out","run_cancelled","host_shutdown"]}}},completed:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:9},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/id"},outcome:{type:"object"},durationMs:{type:"number",minimum:0}}},capabilityCall:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","callId","call"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:9},messageType:{const:"capability_call"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},call:{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/request"}}},capabilityResult:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","callId","result"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:9},messageType:{const:"capability_result"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},result:{type:"object"}}},fetchObservation:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","requestId","observation"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:9},messageType:{const:"fetch_observation"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},observation:{$ref:"https://cronflow.dev/schemas/native-fetch-observation/v1"}}},fetchObservationAck:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","requestId","accepted"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:9},messageType:{const:"fetch_observation_ack"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},accepted:{type:"boolean"},error:{type:"object"}}}}};var As={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://woml.dev/schemas/lifecycle-binding/v1",title:"WOML Lifecycle Runtime Binding v1","x-status":"lifecycle-engine-controls-lec0-frozen","x-forbiddenFields":["secrets","stack","eventId","invocationId","operationKey","idempotencyKey","context.run"],type:"object",additionalProperties:!1,required:["event","workflow"],properties:{event:{enum:["run_start","step_start","step_success","step_failure","step_complete","run_success","run_failure","run_cancel","run_complete"]},workflow:{$ref:"#/$defs/workflow"},step:{$ref:"#/$defs/step"},failure:{$ref:"#/$defs/failure"}},$defs:{workflow:{type:"object",additionalProperties:!1,required:["id"],properties:{id:{type:"string",minLength:1,maxLength:256},outcome:{enum:["succeeded","failed","cancelled"]}}},step:{type:"object",additionalProperties:!1,required:["id","attempts"],properties:{id:{type:"string",pattern:"^[a-z][A-Za-z0-9]*$"},outcome:{enum:["succeeded","failed","cancelled"]},attempts:{type:"integer",minimum:0,maximum:10}}},failure:{type:"object",additionalProperties:!1,required:["code","message"],properties:{code:{type:"string",pattern:"^WOML_[A-Z0-9_]+$",maxLength:128},message:{type:"string",minLength:1,maxLength:1024}}}}};var D=new Xs.default({allErrors:!0,strict:!1,logger:!1});D.addSchema(ps);D.addSchema(Ms);D.addSchema(Vs);D.addSchema(Ls);D.addSchema(Os);D.addSchema(As);var v1=D.compile(Ts),H1=D.compile(ws),D1=D.compile(Ws),P1=D.compile(qs),K1=D.compile(js),U1=D.compile(Fs),ki=D.compile(Zs),Ys=D.compile(Bs),zs=D.compile(Js);function ot(t,i,o=[]){let r=new Set([...i,...o]);return i.every((l)=>Object.hasOwn(t,l))&&Object.keys(t).every((l)=>r.has(l))}function Qs(t){if(typeof t!=="object"||t===null||Array.isArray(t))return!1;let i=t,o=i.definition,r=i.props;return ot(i,["profile","invocationId","definition","props"])&&i.profile==="woml.reusable-script-binding/v3"&&typeof i.invocationId==="string"&&i.invocationId.length>=1&&i.invocationId.length<=256&&typeof o==="object"&&o!==null&&!Array.isArray(o)&&ot(o,["kind","alias","digest","source"])&&(o.kind==="step"||o.kind==="notification-provider")&&typeof o.alias==="string"&&/^sha256:[0-9a-f]{64}$/.test(String(o.digest))&&typeof o.source==="string"&&typeof r==="object"&&r!==null&&!Array.isArray(r)&&Object.keys(r).length<=64&&Buffer.byteLength(JSON.stringify(r),"utf8")<=1048576}function Gs(t){if(typeof t!=="object"||t===null||Array.isArray(t))return!1;let i=t;return ot(i,["hook","outcome"],["result","error"])&&(i.hook==="on-success"||i.hook==="on-error"||i.hook==="on-complete")&&(i.outcome==="succeeded"||i.outcome==="failed"||i.outcome==="cancelled")&&(i.error===void 0||typeof i.error==="object"&&i.error!==null&&!Array.isArray(i.error)&&ot(i.error,["code","message"])&&typeof i.error.code==="string"&&typeof i.error.message==="string")}function vs(t,i){let{attempt:o,context:r,bindings:l,modules:f}=t;return ot(t,["protocol","protocolVersion","messageType","invocationId","runId","nodeId","attempt","mode","handler","timeoutMs","source","context","bindings","modules"],["lifecycle","reusable","reusableLifecycle"])&&t.protocol==="woml.script-host"&&t.protocolVersion===i&&t.messageType==="execute"&&[t.invocationId,t.runId,t.nodeId].every((n)=>typeof n==="string"&&n.length>0&&n.length<=256)&&typeof o==="object"&&o!==null&&!Array.isArray(o)&&ot(o,["number","maxAttempts","idempotencyKey"])&&Number.isInteger(o.number)&&Number(o.number)>=1&&Number.isInteger(o.maxAttempts)&&Number(o.maxAttempts)>=1&&/^sha256:[0-9a-f]{64}$/.test(String(o.idempotencyKey))&&(t.mode==="step"&&t.handler==="runtime.script"||t.mode==="lifecycle"&&t.handler==="runtime.lifecycle-script")&&Number.isInteger(t.timeoutMs)&&Number(t.timeoutMs)>=1&&Number(t.timeoutMs)<=86400000&&typeof t.source==="string"&&typeof r==="object"&&r!==null&&!Array.isArray(r)&&ot(r,["trigger","steps"],i===9?["item","iteration"]:[])&&typeof r.trigger==="object"&&r.trigger!==null&&typeof r.steps==="object"&&r.steps!==null&&typeof l==="object"&&l!==null&&!Array.isArray(l)&&ot(l,["bindingVersion","servicesVersion","secrets"])&&l.bindingVersion===1&&l.servicesVersion===1&&typeof l.secrets==="object"&&l.secrets!==null&&Array.isArray(f)&&f.length<=64&&f.every((n)=>{if(typeof n!=="object"||n===null||Array.isArray(n))return!1;let $=n;return ot($,["name","bundleDigest","exports"])&&typeof $.name==="string"&&/^[a-z][A-Za-z0-9]*$/.test($.name)&&/^sha256:[0-9a-f]{64}$/.test(String($.bundleDigest))&&Array.isArray($.exports)&&$.exports.length>0&&$.exports.every((s)=>typeof s==="string")})}function N1(t){let i=t.context,o=Object.hasOwn(i,"item"),r=Object.hasOwn(i,"iteration");if(o!==r)return!1;if(!r)return!0;let l=i.iteration;if(typeof l!=="object"||l===null||Array.isArray(l))return!1;let f=l;return ot(f,["index","total"])&&Number.isInteger(f.index)&&Number.isInteger(f.total)&&Number(f.total)>=1&&Number(f.total)<=1e4&&Number(f.index)>=0&&Number(f.index)<Number(f.total)}function Hs(t){if(typeof t!=="object"||t===null||Array.isArray(t))return!1;let i=t;if(i.protocolVersion!==8)return!1;if(!Ys(t))return!1;if(i.messageType==="execute"){if(!vs(i,8))return!1;if(i.reusable===void 0)return i.reusableLifecycle===void 0;if(!Qs(i.reusable))return!1;if(i.reusableLifecycle===void 0)return i.mode==="step";return i.mode==="lifecycle"&&Gs(i.reusableLifecycle)}let o={...i,protocolVersion:7};if(delete o.reusable,delete o.reusableLifecycle,!ki(o))return!1;return i.reusable===void 0&&i.reusableLifecycle===void 0}function E1(t){if(typeof t!=="object"||t===null||Array.isArray(t))return!1;let i=t;if(i.protocolVersion!==9||!zs(t))return!1;if(i.messageType==="execute"){if(!vs(i,9)||!N1(i))return!1;if(i.reusable===void 0)return i.reusableLifecycle===void 0;if(!Qs(i.reusable))return!1;if(i.reusableLifecycle===void 0)return i.mode==="step";return i.mode==="lifecycle"&&Gs(i.reusableLifecycle)}let o={...i,protocolVersion:8};return Hs(o)}class k extends Error{constructor(t){super(t);this.name="MessageProtocolError"}}function R1(t){if((t.protocolVersion===3||t.protocolVersion===4||t.protocolVersion===5||t.protocolVersion===6||t.protocolVersion===7||t.protocolVersion===8||t.protocolVersion===9)&&t.attempt.number>t.attempt.maxAttempts)throw new k(`Script-host protocol v${t.protocolVersion} attempt.number must not exceed attempt.maxAttempts.`)}function S1(t){if(t===void 0||t===null||t.length===0)return"unknown schema violation";return t.slice(0,5).map((i)=>`${i.instancePath||"/"} ${i.message??i.keyword}`).join("; ")}function Ds(t,i){let o=i===9?ki:i===8?ki:i===7?ki:i===6?U1:i===5?K1:i===4?P1:i===3?D1:i===2?H1:v1,r=i===9?E1(t):Hs(t);if(!(i>=8?r:o(t)))throw new k(`Message does not match script-host protocol v${i}: ${S1(i>=8?i===9?zs.errors:Ys.errors:o.errors)}.`);if(typeof t!=="object"||t===null||!("protocolVersion"in t)||t.protocolVersion!==i||!("messageType"in t)||t.messageType!=="execute"&&t.messageType!=="register_module"&&t.messageType!=="cancel"&&t.messageType!=="capability_result"&&t.messageType!=="fetch_observation_ack")throw new k(`The Bun script host received an unsupported protocol-v${i} message direction.`);if(t.messageType==="execute")R1(t)}var Ps=3145728,k1=33554432,C1=64;function xo(t,i){let o={protocol:"woml.script-host",messageType:"module_registered",bundleDigest:t.bundleDigest,...i};return t.protocolVersion===6||t.protocolVersion===7||t.protocolVersion===8||t.protocolVersion===9?{...o,protocolVersion:t.protocolVersion,sourceMapDigest:t.sourceMapDigest}:{...o,protocolVersion:5}}function Ks(t){return Math.max(0,performance.now()-t)}function It(t,i,o){return{protocol:"woml.script-host",protocolVersion:t.protocolVersion,messageType:"completed",invocationId:t.invocationId,outcome:{kind:"failure",error:o},durationMs:Ks(i)}}function h1(t,i,o){return{protocol:"woml.script-host",protocolVersion:t.protocolVersion,messageType:"completed",invocationId:t.invocationId,outcome:{kind:"success",value:o},durationMs:Ks(i)}}function vt(t){return Buffer.byteLength(JSON.stringify(t),"utf8")}function _o(t){return"modules"in t?t.modules.length:0}function ct(t,i){if(t===void 0)return;t.identity.invocationId=i.invocationId,t.identity.runId=i.runId}function g1(){if(process.env.WOML_PROFILE!=="1")return{};let t=process.env.WOML_PROFILE_OUTPUT,i=process.env.WOML_PROFILE_TRACE_ID;if(t===void 0||i===void 0)return{};return{WOML_PROFILE:"1",WOML_PROFILE_OUTPUT:t,WOML_PROFILE_TRACE_ID:i,WOML_PROFILE_PROCESS:"worker"}}class ir{#o;#t;#i;#d;#e=new Map;#l=new Map;#u=new Map;#f=new Map;#n=new Set;#r=new Map;#$=new Map;#s=new Set;#b=new Map;#y=0;#I=!1;constructor(t){this.#o=t.workerUrl,this.#t=t.limits??{},this.#i=t.send,this.#d=t.protocolVersion??3}accept(t){if(this.#I)throw new k("The script host is shutting down.");if(Ds(t,this.#d),t.messageType==="register_module"){this.#c(t);return}if(t.messageType==="cancel"){this.#p(t);return}if(t.messageType==="capability_result"){this.#M(t);return}if(t.messageType==="fetch_observation_ack"){this.#V(t);return}if(this.#e.has(t.invocationId))throw new k(`Invocation ID "${t.invocationId}" is already active.`);let i=this.#L(t).finally(()=>{this.#e.delete(t.invocationId),this.#u.delete(t.invocationId)});this.#e.set(t.invocationId,i)}#c(t){let i=`sha256:${new Bun.CryptoHasher("sha256").update(t.bundle).digest("hex")}`,o=t.protocolVersion===6||t.protocolVersion===7||t.protocolVersion===8||t.protocolVersion===9?`sha256:${new Bun.CryptoHasher("sha256").update(t.sourceMap).digest("hex")}`:void 0;if(i!==t.bundleDigest||(t.protocolVersion===6||t.protocolVersion===7||t.protocolVersion===8||t.protocolVersion===9)&&o!==t.sourceMapDigest){this.#i(xo(t,{accepted:!1,code:"WOML_MODULE_DIGEST_MISMATCH",message:"The registered module bundle does not match its SHA-256 identity."}));return}let l=this.#b.get(t.bundleDigest);if(l!==void 0&&(l.bundle!==t.bundle||(t.protocolVersion===6||t.protocolVersion===7||t.protocolVersion===8||t.protocolVersion===9)&&(l.sourceMap!==t.sourceMap||l.sourceMapDigest!==t.sourceMapDigest)))throw new k("One module digest was registered with different immutable bytes.");let f=Buffer.byteLength(t.bundle,"utf8")+(t.protocolVersion===6||t.protocolVersion===7||t.protocolVersion===8||t.protocolVersion===9?Buffer.byteLength(t.sourceMap,"utf8"):0),n=Buffer.byteLength(t.bundle,"utf8")>Ps||(t.protocolVersion===6||t.protocolVersion===7||t.protocolVersion===8||t.protocolVersion===9)&&Buffer.byteLength(t.sourceMap,"utf8")>Ps;if(l===void 0&&(n||this.#b.size>=C1||this.#y+f>k1)){this.#i(xo(t,{accepted:!1,code:"WOML_MODULE_CACHE_LIMIT_EXCEEDED",message:"The immutable module cache limit was exceeded."}));return}if(l===void 0)this.#b.set(t.bundleDigest,{bundle:t.bundle,...t.protocolVersion===6||t.protocolVersion===7||t.protocolVersion===8||t.protocolVersion===9?{sourceMap:t.sourceMap,sourceMapDigest:t.sourceMapDigest}:{},bytes:f}),this.#y+=f;this.#i(xo(t,{accepted:!0}))}async drain(){while(this.#e.size>0)await Promise.all([...this.#e.values()])}abort(){this.#I=!0;for(let t of this.#l.values())t.terminate();this.#l.clear(),this.#u.clear(),this.#f.clear(),this.#n.clear(),this.#r.clear(),this.#$.clear(),this.#s.clear(),this.#b.clear(),this.#y=0}#p(t){this.#u.get(t.invocationId)?.(t.reason)}#M(t){if(t.invocationId!==t.result.invocationId||t.callId!==t.result.callId)throw new k("Capability result wrapper IDs do not match its result payload.");let i=this.#l.get(t.invocationId),o=this.#f.get(t.invocationId);if(i===void 0||o===void 0||!o.delete(t.callId)){let r=`${t.invocationId}\x00${t.callId}`;if(this.#n.delete(r))return;throw new k(`Capability result references unknown call ID "${t.callId}".`)}i.postMessage({messageType:"capability_result",callId:t.callId,result:t.result})}#V(t){let i=this.#l.get(t.invocationId),o=this.#r.get(t.invocationId),r=o?.get(t.requestId);if(i===void 0||o===void 0||r===void 0){let f=`${t.invocationId}\x00${t.requestId}`;if(this.#s.delete(f))return;throw new k(`Native Fetch acknowledgement references unknown request ID "${t.requestId}".`)}o.delete(t.requestId);let l=this.#$.get(t.invocationId);if(t.accepted&&r==="started")l.add(t.requestId);if(!t.accepted||r==="terminal")l.delete(t.requestId);i.postMessage({messageType:"fetch_observation_ack",requestId:t.requestId,ack:t})}async#L(t){try{await qt("host","host.execute_invocation",async(i)=>{if(ct(i,t),i!==void 0)i.bytes.context=vt(t.context),i.bytes.source=Buffer.byteLength(t.source,"utf8"),i.counts.modules=_o(t);await this.#O(t)})}finally{await Pt()}}async#O(t){let i=performance.now(),o=_("host","host.measure_context",(e)=>{ct(e,t);let u=vt(t.context);if(e!==void 0)e.bytes.context=u;return u});if(this.#t.maxContextBytes!==void 0&&o>this.#t.maxContextBytes){await this.#i(It(t,i,{kind:"context_too_large",code:"WOML_SCRIPT_CONTEXT_TOO_LARGE",message:"Invocation context exceeds the configured byte limit.",details:{actualBytes:o,limitBytes:this.#t.maxContextBytes}}));return}let r=await this.#T(t);if(r.kind==="timeout"){await this.#i(It(t,i,{kind:"script_timed_out",code:"WOML_SCRIPT_TIMEOUT",message:"Script exceeded its execution deadline."}));return}if(r.kind==="cancelled"){await this.#i(It(t,i,{kind:"invocation_cancelled",code:"WOML_SCRIPT_CANCELLED",message:r.reason==="parallel_fail_fast"?"Invocation was cancelled by parallel fail-fast.":r.reason==="run_cancelled"?"Invocation was cancelled because its run was cancelled.":r.reason==="step_timed_out"?"Invocation was cancelled because its step timed out.":"Invocation was cancelled because the script host is shutting down."}));return}if(r.kind==="crashed"){await this.#i(It(t,i,{kind:"worker_crashed",code:"WOML_SCRIPT_WORKER_CRASHED",message:r.message}));return}let l=r.response;if(!l.ok){await this.#i(It(t,i,{...l.error.kind==="service"&&l.error.capability!==void 0&&l.error.operation!==void 0&&l.error.callId!==void 0&&l.error.cause!==void 0?{kind:"service_failed",code:l.error.cause.code,message:l.error.message,capability:l.error.capability,operation:l.error.operation,callId:l.error.callId,retryable:l.error.cause.retryable,ambiguous:l.error.cause.ambiguous,cause:l.error.cause}:{kind:l.error.kind==="non-json"?"invalid_script_result":"script_threw",code:l.error.kind==="non-json"?"WOML_SCRIPT_NON_JSON_RESULT":"WOML_SCRIPT_THROWN",message:l.error.moduleFrame===void 0?l.error.message:`${l.error.message} (${l.error.moduleFrame})`}}));return}let f=_("host","host.validate_result",(e)=>{ct(e,t);let u=ur(l.result),b=(t.protocolVersion===4||t.protocolVersion===5||t.protocolVersion===6||t.protocolVersion===7||t.protocolVersion===8||t.protocolVersion===9)&&tr(l.result,Object.values(t.bindings.secrets)),I=vt(l.result);if(e!==void 0)e.bytes.result=I;return{violation:u,includesSecret:b,resultBytes:I}}),{violation:n,includesSecret:$,resultBytes:s}=f;if(n!==void 0){await this.#i(It(t,i,{kind:"invalid_script_result",code:"WOML_SCRIPT_NON_JSON_RESULT",message:`${n.path}: ${n.reason}`}));return}if((t.protocolVersion===4||t.protocolVersion===5||t.protocolVersion===6||t.protocolVersion===7||t.protocolVersion===8||t.protocolVersion===9)&&$){await this.#i(It(t,i,{kind:"invalid_script_result",code:"WOML_SCRIPT_NON_JSON_RESULT",message:"Script results must not contain a resolved secret value."}));return}if(this.#t.maxResultBytes!==void 0&&s>this.#t.maxResultBytes){await this.#i(It(t,i,{kind:"result_too_large",code:"WOML_SCRIPT_RESULT_TOO_LARGE",message:"Script result exceeds the configured byte limit.",details:{actualBytes:s,limitBytes:this.#t.maxResultBytes}}));return}await this.#i(h1(t,i,l.result))}#T(t){return qt("host","host.invoke_worker",async(i)=>{if(ct(i,t),i!==void 0)i.bytes.context=vt(t.context),i.bytes.source=Buffer.byteLength(t.source,"utf8"),i.counts.modules=_o(t);return await this.#w(t)})}#w(t){let i;try{i=_("host","host.create_worker",(o)=>{return ct(o,t),new Worker(this.#o,{type:"module",ref:!0,smol:!0,env:g1()})})}catch{return Promise.resolve({kind:"crashed",message:"The isolated script Worker could not be started."})}return this.#l.set(t.invocationId,i),new Promise((o)=>{let r=!1,l=(n)=>{if(r)return;r=!0,clearTimeout(f),this.#l.delete(t.invocationId),this.#u.delete(t.invocationId);for(let $ of this.#f.get(t.invocationId)??[])this.#n.add(`${t.invocationId}\x00${$}`);for(let $ of this.#r.get(t.invocationId)?.keys()??[])this.#s.add(`${t.invocationId}\x00${$}`);while(this.#n.size>4096){let $=this.#n.values().next().value;if($===void 0)break;this.#n.delete($)}while(this.#s.size>4096){let $=this.#s.values().next().value;if($===void 0)break;this.#s.delete($)}this.#f.delete(t.invocationId),this.#r.delete(t.invocationId),this.#$.delete(t.invocationId),_("host","host.terminate_worker",($)=>{ct($,t),i.terminate()}),o(n)},f=setTimeout(()=>l({kind:"timeout"}),t.timeoutMs);this.#u.set(t.invocationId,(n)=>{l({kind:"cancelled",reason:n})}),this.#f.set(t.invocationId,new Set),this.#r.set(t.invocationId,new Map),this.#$.set(t.invocationId,new Set),i.onmessage=(n)=>{let $=n.data;if(_("host",$.messageType==="completed"?"host.receive_worker_result":"host.receive_worker_message",(u)=>{if(ct(u,t),u!==void 0)u.bytes.message=vt($)}),$.messageType==="completed"){if((this.#r.get(t.invocationId)?.size??0)>0||(this.#$.get(t.invocationId)?.size??0)>0){l({kind:"crashed",message:"The isolated script Worker completed with an unclosed native Fetch observation."});return}l({kind:"response",response:$.response});return}if($.messageType==="fetch_observation"){let u=$.observation;if(t.protocolVersion!==4&&t.protocolVersion!==5&&t.protocolVersion!==6&&t.protocolVersion!==7&&t.protocolVersion!==8&&t.protocolVersion!==9||u.invocationId!==t.invocationId){l({kind:"crashed",message:"The isolated script Worker emitted an invalid native Fetch observation."});return}let b=this.#r.get(t.invocationId),I=this.#$.get(t.invocationId),p=u.observationType==="started"?"started":"terminal";if(b.has(u.requestId)||(p==="started"?I.has(u.requestId):!I.has(u.requestId))){l({kind:"crashed",message:"The isolated script Worker violated the native Fetch observation lifecycle."});return}b.set(u.requestId,p),this.#i({protocol:"woml.script-host",protocolVersion:t.protocolVersion,messageType:"fetch_observation",invocationId:t.invocationId,requestId:u.requestId,observation:u}).catch(()=>{l({kind:"crashed",message:"The native Fetch observation could not be sent to Rust."})});return}let s=$.call;if(t.protocolVersion!==4&&t.protocolVersion!==5&&t.protocolVersion!==6&&t.protocolVersion!==7&&t.protocolVersion!==8&&t.protocolVersion!==9||s.invocationId!==t.invocationId||s.runId!==t.runId||s.nodeId!==t.nodeId||s.attemptNumber!==t.attempt.number){l({kind:"crashed",message:"The isolated script Worker emitted an invalid capability call."});return}let e=this.#f.get(t.invocationId);if(e===void 0||e.has(s.callId)){l({kind:"crashed",message:"The isolated script Worker reused a capability call ID."});return}e.add(s.callId),this.#i({protocol:"woml.script-host",protocolVersion:t.protocolVersion,messageType:"capability_call",invocationId:t.invocationId,callId:s.callId,call:s}).catch(()=>{l({kind:"crashed",message:"The capability call could not be sent to Rust."})})},i.onerror=(n)=>{n.preventDefault(),l({kind:"crashed",message:n.message||"The isolated script Worker crashed."})},i.onmessageerror=()=>{l({kind:"crashed",message:"The isolated script Worker returned an unreadable message."})},i.addEventListener("close",()=>{l({kind:"crashed",message:"The isolated script Worker exited without a result."})});try{let n=t.protocolVersion===3||t.protocolVersion===4||t.protocolVersion===5||t.protocolVersion===6||t.protocolVersion===7||t.protocolVersion===8||t.protocolVersion===9?t.attempt:void 0;_("host","host.post_worker_request",($)=>{if(ct($,t),$!==void 0)$.bytes.context=vt(t.context),$.bytes.source=Buffer.byteLength(t.source,"utf8"),$.counts.modules=_o(t);i.postMessage({messageType:"execute",request:{invocationId:t.invocationId,runId:t.runId,nodeId:t.nodeId,timeoutMs:t.timeoutMs,source:t.source,context:t.context,...t.protocolVersion===7||t.protocolVersion===8||t.protocolVersion===9?{mode:t.mode,...t.mode==="lifecycle"?{lifecycle:t.lifecycle}:{}}:{},...(t.protocolVersion===8||t.protocolVersion===9)&&t.reusable!==void 0?{reusable:t.reusable,...t.reusableLifecycle===void 0?{}:{reusableLifecycle:t.reusableLifecycle}}:{},attempt:n,...t.protocolVersion===4||t.protocolVersion===5||t.protocolVersion===6||t.protocolVersion===7||t.protocolVersion===8||t.protocolVersion===9?{bindings:t.bindings}:{},...t.protocolVersion===5||t.protocolVersion===6||t.protocolVersion===7||t.protocolVersion===8||t.protocolVersion===9?{modules:t.modules.map((s)=>{let e=this.#b.get(s.bundleDigest);if(e===void 0)throw new k(`Module bundle ${s.bundleDigest} was not registered.`);return{...s,bundle:e.bundle,...t.protocolVersion===6||t.protocolVersion===7||t.protocolVersion===8||t.protocolVersion===9?{sourceMap:e.sourceMap,sourceMapDigest:e.sourceMapDigest}:{}}})}:{}}})})}catch{l({kind:"crashed",message:"The invocation could not be delivered to its script Worker."})}})}}function tr(t,i){let o=i.filter((r)=>r.length>0);if(o.length===0)return!1;if(typeof t==="string")return o.some((r)=>t.includes(r));if(Array.isArray(t))return t.some((r)=>tr(r,o));if(t!==null&&typeof t==="object")return Object.values(t).some((r)=>tr(r,o));return!1}function or(t){let i=process.env[t];if(i===void 0||i==="")return;let o=Number(i);if(!Number.isSafeInteger(o)||o<1)throw Error(`${t} must be a positive safe integer when provided.`);return o}function m1(){return{maxContextBytes:or("WOML_SCRIPT_HOST_MAX_CONTEXT_BYTES"),maxResultBytes:or("WOML_SCRIPT_HOST_MAX_RESULT_BYTES"),maxFrameBytes:or("WOML_SCRIPT_HOST_MAX_FRAME_BYTES")}}function x1(){let t=process.env.WOML_SCRIPT_HOST_PROTOCOL_VERSION??"3";if(t==="1"||t==="2"||t==="3"||t==="4"||t==="5"||t==="6"||t==="7"||t==="8"||t==="9")return Number(t);throw Error("WOML_SCRIPT_HOST_PROTOCOL_VERSION must be 1, 2, 3, 4, 5, 6, 7, 8, or 9.")}async function _1(t){await new Promise((i,o)=>{process.stdout.write(t,(r)=>{if(r===null||r===void 0)i();else o(r)})})}function rr(t,i){if(t===void 0)return;let o=i;if(typeof o.invocationId==="string")t.identity.invocationId=o.invocationId;if(typeof o.runId==="string")t.identity.runId=o.runId;t.bytes.message=Buffer.byteLength(JSON.stringify(i))}async function tM(){let t=m1(),i=x1(),o=new ai({maxFrameBytes:t.maxFrameBytes}),r=new mi(_1),l=import.meta.url.endsWith(".ts")?"./script-host-worker.ts":"./script-host-worker.js",f=new ir({workerUrl:new URL(l,import.meta.url),limits:t,protocolVersion:i,send:($)=>qt("host","host.write_frame",async(s)=>{rr(s,$),await r.send($)})}),n={protocol:"woml.script-host",protocolVersion:i,messageType:"ready",hostInstanceId:`host_${a1()}`};try{await qt("host","host.ready",async(s)=>{rr(s,n),await r.send(n)});let $=Bun.stdin.stream().getReader();while(!0){let{done:s,value:e}=await $.read();if(s)break;let u=_("host","host.decode_frames",(b)=>{let I=o.push(e);if(b!==void 0)b.bytes.input=e.byteLength,b.counts.messages=I.length;return I});for(let b of u)_("host","host.accept_message",(I)=>{rr(I,b),f.accept(b)})}o.finish(),await f.drain(),await r.drain(),await Pt()}catch($){f.abort(),await Pt();let s=$ instanceof Error?`${$.name}: ${$.message}`:String($);process.stderr.write(`WOML script host failed: ${s}
21
+ `),process.exitCode=1}}if(import.meta.main)await tM();export{tM as runScriptHost};
20
22
 
21
- //# debugId=5FD5C02652D77EEE64756E2164756E21
23
+ //# debugId=14301F4F309544C964756E2164756E21