@anthropic-ai/claude-agent-sdk 0.2.111 → 0.2.112

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/browser-sdk.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // (c) Anthropic PBC. All rights reserved. Use is subject to the Legal Agreements outlined here: https://code.claude.com/docs/en/legal-and-compliance.
2
2
 
3
- // Version: 0.2.111
3
+ // Version: 0.2.112
4
4
  var uB=Object.create;var{getPrototypeOf:lB,defineProperty:NY,getOwnPropertyNames:mB}=Object;var cB=Object.prototype.hasOwnProperty;function iB($){return this[$]}var nB,pB,yU=($,X,J)=>{var Y=$!=null&&typeof $==="object";if(Y){var z=X?nB??=new WeakMap:pB??=new WeakMap,W=z.get($);if(W)return W}J=$!=null?uB(lB($)):{};let Q=X||!$||!$.__esModule?NY(J,"default",{value:$,enumerable:!0}):J;for(let G of mB($))if(!cB.call(Q,G))NY(Q,G,{get:iB.bind($,G),enumerable:!0});if(Y)z.set($,Q);return Q};var k=($,X)=>()=>(X||$((X={exports:{}}).exports,X),X.exports);var dB=($)=>$;function rB($,X){this[$]=dB.bind(null,X)}var T6=($,X)=>{for(var J in X)NY($,J,{get:X[J],enumerable:!0,configurable:!0,set:rB.bind(X,J)})};var oB=Symbol.dispose||Symbol.for("Symbol.dispose"),tB=Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose"),D$=($,X,J)=>{if(X!=null){if(typeof X!=="object"&&typeof X!=="function")throw TypeError('Object expected to be assigned to "using" declaration');var Y;if(J)Y=X[tB];if(Y===void 0)Y=X[oB];if(typeof Y!=="function")throw TypeError("Object not disposable");$.push([J,Y,X])}else if(J)$.push([J]);return X},B$=($,X,J)=>{var Y=typeof SuppressedError==="function"?SuppressedError:function(Q,G,U,w){return w=Error(U),w.name="SuppressedError",w.error=Q,w.suppressed=G,w},z=(Q)=>X=J?new Y(Q,X,"An error was suppressed during disposal"):(J=!0,Q),W=(Q)=>{while(Q=$.pop())try{var G=Q[1]&&Q[1].call(Q[2]);if(Q[0])return Promise.resolve(G).then(W,(U)=>(z(U),W()))}catch(U){z(U)}if(J)throw X};return W()};var hJ=k((rH)=>{Object.defineProperty(rH,"__esModule",{value:!0});rH.regexpCode=rH.getEsmExportName=rH.getProperty=rH.safeStringify=rH.stringify=rH.strConcat=rH.addCodeArg=rH.str=rH._=rH.nil=rH._Code=rH.Name=rH.IDENTIFIER=rH._CodeOrName=void 0;class S7{}rH._CodeOrName=S7;rH.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class W0 extends S7{constructor($){super();if(!rH.IDENTIFIER.test($))throw Error("CodeGen: name must be a valid identifier");this.str=$}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}rH.Name=W0;class M4 extends S7{constructor($){super();this._items=typeof $==="string"?[$]:$}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let $=this._items[0];return $===""||$==='""'}get str(){var $;return($=this._str)!==null&&$!==void 0?$:this._str=this._items.reduce((X,J)=>`${X}${J}`,"")}get names(){var $;return($=this._names)!==null&&$!==void 0?$:this._names=this._items.reduce((X,J)=>{if(J instanceof W0)X[J.str]=(X[J.str]||0)+1;return X},{})}}rH._Code=M4;rH.nil=new M4("");function pH($,...X){let J=[$[0]],Y=0;while(Y<X.length)EG(J,X[Y]),J.push($[++Y]);return new M4(J)}rH._=pH;var SG=new M4("+");function dH($,...X){let J=[yJ($[0])],Y=0;while(Y<X.length)J.push(SG),EG(J,X[Y]),J.push(SG,yJ($[++Y]));return TM(J),new M4(J)}rH.str=dH;function EG($,X){if(X instanceof M4)$.push(...X._items);else if(X instanceof W0)$.push(X);else $.push(yM(X))}rH.addCodeArg=EG;function TM($){let X=1;while(X<$.length-1){if($[X]===SG){let J=fM($[X-1],$[X+1]);if(J!==void 0){$.splice(X-1,3,J);continue}$[X++]="+"}X++}}function fM($,X){if(X==='""')return $;if($==='""')return X;if(typeof $=="string"){if(X instanceof W0||$[$.length-1]!=='"')return;if(typeof X!="string")return`${$.slice(0,-1)}${X}"`;if(X[0]==='"')return $.slice(0,-1)+X.slice(1);return}if(typeof X=="string"&&X[0]==='"'&&!($ instanceof W0))return`"${$}${X.slice(1)}`;return}function gM($,X){return X.emptyStr()?$:$.emptyStr()?X:dH`${$}${X}`}rH.strConcat=gM;function yM($){return typeof $=="number"||typeof $=="boolean"||$===null?$:yJ(Array.isArray($)?$.join(","):$)}function hM($){return new M4(yJ($))}rH.stringify=hM;function yJ($){return JSON.stringify($).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}rH.safeStringify=yJ;function uM($){return typeof $=="string"&&rH.IDENTIFIER.test($)?new M4(`.${$}`):pH`[${$}]`}rH.getProperty=uM;function lM($){if(typeof $=="string"&&rH.IDENTIFIER.test($))return new M4(`${$}`);throw Error(`CodeGen: invalid export name: ${$}, use explicit $id name mapping`)}rH.getEsmExportName=lM;function mM($){return new M4($.toString())}rH.regexpCode=mM});var CG=k((sH)=>{Object.defineProperty(sH,"__esModule",{value:!0});sH.ValueScope=sH.ValueScopeName=sH.Scope=sH.varKinds=sH.UsedValueState=void 0;var o$=hJ();class tH extends Error{constructor($){super(`CodeGen: "code" for ${$} not defined`);this.value=$.value}}var R7;(function($){$[$.Started=0]="Started",$[$.Completed=1]="Completed"})(R7||(sH.UsedValueState=R7={}));sH.varKinds={const:new o$.Name("const"),let:new o$.Name("let"),var:new o$.Name("var")};class vG{constructor({prefixes:$,parent:X}={}){this._names={},this._prefixes=$,this._parent=X}toName($){return $ instanceof o$.Name?$:this.name($)}name($){return new o$.Name(this._newName($))}_newName($){let X=this._names[$]||this._nameGroup($);return`${$}${X.index++}`}_nameGroup($){var X,J;if(((J=(X=this._parent)===null||X===void 0?void 0:X._prefixes)===null||J===void 0?void 0:J.has($))||this._prefixes&&!this._prefixes.has($))throw Error(`CodeGen: prefix "${$}" is not allowed in this scope`);return this._names[$]={prefix:$,index:0}}}sH.Scope=vG;class ZG extends o$.Name{constructor($,X){super(X);this.prefix=$}setValue($,{property:X,itemIndex:J}){this.value=$,this.scopePath=o$._`.${new o$.Name(X)}[${J}]`}}sH.ValueScopeName=ZG;var X2=o$._`\n`;class aH extends vG{constructor($){super($);this._values={},this._scope=$.scope,this.opts={...$,_n:$.lines?X2:o$.nil}}get(){return this._scope}name($){return new ZG($,this._newName($))}value($,X){var J;if(X.ref===void 0)throw Error("CodeGen: ref must be passed in value");let Y=this.toName($),{prefix:z}=Y,W=(J=X.key)!==null&&J!==void 0?J:X.ref,Q=this._values[z];if(Q){let w=Q.get(W);if(w)return w}else Q=this._values[z]=new Map;Q.set(W,Y);let G=this._scope[z]||(this._scope[z]=[]),U=G.length;return G[U]=X.ref,Y.setValue(X,{property:z,itemIndex:U}),Y}getValue($,X){let J=this._values[$];if(!J)return;return J.get(X)}scopeRefs($,X=this._values){return this._reduceValues(X,(J)=>{if(J.scopePath===void 0)throw Error(`CodeGen: name "${J}" has no value`);return o$._`${$}${J.scopePath}`})}scopeCode($=this._values,X,J){return this._reduceValues($,(Y)=>{if(Y.value===void 0)throw Error(`CodeGen: name "${Y}" has no value`);return Y.value.code},X,J)}_reduceValues($,X,J={},Y){let z=o$.nil;for(let W in $){let Q=$[W];if(!Q)continue;let G=J[W]=J[W]||new Map;Q.forEach((U)=>{if(G.has(U))return;G.set(U,R7.Started);let w=X(U);if(w){let N=this.opts.es5?sH.varKinds.var:sH.varKinds.const;z=o$._`${z}${N} ${U} = ${w};${this.opts._n}`}else if(w=Y===null||Y===void 0?void 0:Y(U))z=o$._`${z}${w}${this.opts._n}`;else throw new tH(U);G.set(U,R7.Completed)})}return z}}sH.ValueScope=aH});var t=k((t$)=>{Object.defineProperty(t$,"__esModule",{value:!0});t$.or=t$.and=t$.not=t$.CodeGen=t$.operators=t$.varKinds=t$.ValueScopeName=t$.ValueScope=t$.Scope=t$.Name=t$.regexpCode=t$.stringify=t$.getProperty=t$.nil=t$.strConcat=t$.str=t$._=void 0;var J$=hJ(),P4=CG(),E6=hJ();Object.defineProperty(t$,"_",{enumerable:!0,get:function(){return E6._}});Object.defineProperty(t$,"str",{enumerable:!0,get:function(){return E6.str}});Object.defineProperty(t$,"strConcat",{enumerable:!0,get:function(){return E6.strConcat}});Object.defineProperty(t$,"nil",{enumerable:!0,get:function(){return E6.nil}});Object.defineProperty(t$,"getProperty",{enumerable:!0,get:function(){return E6.getProperty}});Object.defineProperty(t$,"stringify",{enumerable:!0,get:function(){return E6.stringify}});Object.defineProperty(t$,"regexpCode",{enumerable:!0,get:function(){return E6.regexpCode}});Object.defineProperty(t$,"Name",{enumerable:!0,get:function(){return E6.Name}});var x7=CG();Object.defineProperty(t$,"Scope",{enumerable:!0,get:function(){return x7.Scope}});Object.defineProperty(t$,"ValueScope",{enumerable:!0,get:function(){return x7.ValueScope}});Object.defineProperty(t$,"ValueScopeName",{enumerable:!0,get:function(){return x7.ValueScopeName}});Object.defineProperty(t$,"varKinds",{enumerable:!0,get:function(){return x7.varKinds}});t$.operators={GT:new J$._Code(">"),GTE:new J$._Code(">="),LT:new J$._Code("<"),LTE:new J$._Code("<="),EQ:new J$._Code("==="),NEQ:new J$._Code("!=="),NOT:new J$._Code("!"),OR:new J$._Code("||"),AND:new J$._Code("&&"),ADD:new J$._Code("+")};class R6{optimizeNodes(){return this}optimizeNames($,X){return this}}class $K extends R6{constructor($,X,J){super();this.varKind=$,this.name=X,this.rhs=J}render({es5:$,_n:X}){let J=$?P4.varKinds.var:this.varKind,Y=this.rhs===void 0?"":` = ${this.rhs}`;return`${J} ${this.name}${Y};`+X}optimizeNames($,X){if(!$[this.name.str])return;if(this.rhs)this.rhs=G0(this.rhs,$,X);return this}get names(){return this.rhs instanceof J$._CodeOrName?this.rhs.names:{}}}class xG extends R6{constructor($,X,J){super();this.lhs=$,this.rhs=X,this.sideEffects=J}render({_n:$}){return`${this.lhs} = ${this.rhs};`+$}optimizeNames($,X){if(this.lhs instanceof J$.Name&&!$[this.lhs.str]&&!this.sideEffects)return;return this.rhs=G0(this.rhs,$,X),this}get names(){let $=this.lhs instanceof J$.Name?{}:{...this.lhs.names};return _7($,this.rhs)}}class XK extends xG{constructor($,X,J,Y){super($,J,Y);this.op=X}render({_n:$}){return`${this.lhs} ${this.op}= ${this.rhs};`+$}}class JK extends R6{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`${this.label}:`+$}}class zK extends R6{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`break${this.label?` ${this.label}`:""};`+$}}class YK extends R6{constructor($){super();this.error=$}render({_n:$}){return`throw ${this.error};`+$}get names(){return this.error.names}}class WK extends R6{constructor($){super();this.code=$}render({_n:$}){return`${this.code};`+$}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames($,X){return this.code=G0(this.code,$,X),this}get names(){return this.code instanceof J$._CodeOrName?this.code.names:{}}}class T7 extends R6{constructor($=[]){super();this.nodes=$}render($){return this.nodes.reduce((X,J)=>X+J.render($),"")}optimizeNodes(){let{nodes:$}=this,X=$.length;while(X--){let J=$[X].optimizeNodes();if(Array.isArray(J))$.splice(X,1,...J);else if(J)$[X]=J;else $.splice(X,1)}return $.length>0?this:void 0}optimizeNames($,X){let{nodes:J}=this,Y=J.length;while(Y--){let z=J[Y];if(z.optimizeNames($,X))continue;W2($,z.names),J.splice(Y,1)}return J.length>0?this:void 0}get names(){return this.nodes.reduce(($,X)=>Y1($,X.names),{})}}class v6 extends T7{render($){return"{"+$._n+super.render($)+"}"+$._n}}class QK extends T7{}class uJ extends v6{}uJ.kind="else";class $6 extends v6{constructor($,X){super(X);this.condition=$}render($){let X=`if(${this.condition})`+super.render($);if(this.else)X+="else "+this.else.render($);return X}optimizeNodes(){super.optimizeNodes();let $=this.condition;if($===!0)return this.nodes;let X=this.else;if(X){let J=X.optimizeNodes();X=this.else=Array.isArray(J)?new uJ(J):J}if(X){if($===!1)return X instanceof $6?X:X.nodes;if(this.nodes.length)return this;return new $6(HK($),X instanceof $6?[X]:X.nodes)}if($===!1||!this.nodes.length)return;return this}optimizeNames($,X){var J;if(this.else=(J=this.else)===null||J===void 0?void 0:J.optimizeNames($,X),!(super.optimizeNames($,X)||this.else))return;return this.condition=G0(this.condition,$,X),this}get names(){let $=super.names;if(_7($,this.condition),this.else)Y1($,this.else.names);return $}}$6.kind="if";class Q0 extends v6{}Q0.kind="for";class GK extends Q0{constructor($){super();this.iteration=$}render($){return`for(${this.iteration})`+super.render($)}optimizeNames($,X){if(!super.optimizeNames($,X))return;return this.iteration=G0(this.iteration,$,X),this}get names(){return Y1(super.names,this.iteration.names)}}class UK extends Q0{constructor($,X,J,Y){super();this.varKind=$,this.name=X,this.from=J,this.to=Y}render($){let X=$.es5?P4.varKinds.var:this.varKind,{name:J,from:Y,to:z}=this;return`for(${X} ${J}=${Y}; ${J}<${z}; ${J}++)`+super.render($)}get names(){let $=_7(super.names,this.from);return _7($,this.to)}}class kG extends Q0{constructor($,X,J,Y){super();this.loop=$,this.varKind=X,this.name=J,this.iterable=Y}render($){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render($)}optimizeNames($,X){if(!super.optimizeNames($,X))return;return this.iterable=G0(this.iterable,$,X),this}get names(){return Y1(super.names,this.iterable.names)}}class v7 extends v6{constructor($,X,J){super();this.name=$,this.args=X,this.async=J}render($){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render($)}}v7.kind="func";class Z7 extends T7{render($){return"return "+super.render($)}}Z7.kind="return";class wK extends v6{render($){let X="try"+super.render($);if(this.catch)X+=this.catch.render($);if(this.finally)X+=this.finally.render($);return X}optimizeNodes(){var $,X;return super.optimizeNodes(),($=this.catch)===null||$===void 0||$.optimizeNodes(),(X=this.finally)===null||X===void 0||X.optimizeNodes(),this}optimizeNames($,X){var J,Y;return super.optimizeNames($,X),(J=this.catch)===null||J===void 0||J.optimizeNames($,X),(Y=this.finally)===null||Y===void 0||Y.optimizeNames($,X),this}get names(){let $=super.names;if(this.catch)Y1($,this.catch.names);if(this.finally)Y1($,this.finally.names);return $}}class C7 extends v6{constructor($){super();this.error=$}render($){return`catch(${this.error})`+super.render($)}}C7.kind="catch";class k7 extends v6{render($){return"finally"+super.render($)}}k7.kind="finally";class NK{constructor($,X={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...X,_n:X.lines?`
5
5
  `:""},this._extScope=$,this._scope=new P4.Scope({parent:$}),this._nodes=[new QK]}toString(){return this._root.render(this.opts)}name($){return this._scope.name($)}scopeName($){return this._extScope.name($)}scopeValue($,X){let J=this._extScope.value($,X);return(this._values[J.prefix]||(this._values[J.prefix]=new Set)).add(J),J}getScopeValue($,X){return this._extScope.getValue($,X)}scopeRefs($){return this._extScope.scopeRefs($,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def($,X,J,Y){let z=this._scope.toName(X);if(J!==void 0&&Y)this._constants[z.str]=J;return this._leafNode(new $K($,z,J)),z}const($,X,J){return this._def(P4.varKinds.const,$,X,J)}let($,X,J){return this._def(P4.varKinds.let,$,X,J)}var($,X,J){return this._def(P4.varKinds.var,$,X,J)}assign($,X,J){return this._leafNode(new xG($,X,J))}add($,X){return this._leafNode(new XK($,t$.operators.ADD,X))}code($){if(typeof $=="function")$();else if($!==J$.nil)this._leafNode(new WK($));return this}object(...$){let X=["{"];for(let[J,Y]of $){if(X.length>1)X.push(",");if(X.push(J),J!==Y||this.opts.es5)X.push(":"),(0,J$.addCodeArg)(X,Y)}return X.push("}"),new J$._Code(X)}if($,X,J){if(this._blockNode(new $6($)),X&&J)this.code(X).else().code(J).endIf();else if(X)this.code(X).endIf();else if(J)throw Error('CodeGen: "else" body without "then" body');return this}elseIf($){return this._elseNode(new $6($))}else(){return this._elseNode(new uJ)}endIf(){return this._endBlockNode($6,uJ)}_for($,X){if(this._blockNode($),X)this.code(X).endFor();return this}for($,X){return this._for(new GK($),X)}forRange($,X,J,Y,z=this.opts.es5?P4.varKinds.var:P4.varKinds.let){let W=this._scope.toName($);return this._for(new UK(z,W,X,J),()=>Y(W))}forOf($,X,J,Y=P4.varKinds.const){let z=this._scope.toName($);if(this.opts.es5){let W=X instanceof J$.Name?X:this.var("_arr",X);return this.forRange("_i",0,J$._`${W}.length`,(Q)=>{this.var(z,J$._`${W}[${Q}]`),J(z)})}return this._for(new kG("of",Y,z,X),()=>J(z))}forIn($,X,J,Y=this.opts.es5?P4.varKinds.var:P4.varKinds.const){if(this.opts.ownProperties)return this.forOf($,J$._`Object.keys(${X})`,J);let z=this._scope.toName($);return this._for(new kG("in",Y,z,X),()=>J(z))}endFor(){return this._endBlockNode(Q0)}label($){return this._leafNode(new JK($))}break($){return this._leafNode(new zK($))}return($){let X=new Z7;if(this._blockNode(X),this.code($),X.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(Z7)}try($,X,J){if(!X&&!J)throw Error('CodeGen: "try" without "catch" and "finally"');let Y=new wK;if(this._blockNode(Y),this.code($),X){let z=this.name("e");this._currNode=Y.catch=new C7(z),X(z)}if(J)this._currNode=Y.finally=new k7,this.code(J);return this._endBlockNode(C7,k7)}throw($){return this._leafNode(new YK($))}block($,X){if(this._blockStarts.push(this._nodes.length),$)this.code($).endBlock(X);return this}endBlock($){let X=this._blockStarts.pop();if(X===void 0)throw Error("CodeGen: not in self-balancing block");let J=this._nodes.length-X;if(J<0||$!==void 0&&J!==$)throw Error(`CodeGen: wrong number of nodes: ${J} vs ${$} expected`);return this._nodes.length=X,this}func($,X=J$.nil,J,Y){if(this._blockNode(new v7($,X,J)),Y)this.code(Y).endFunc();return this}endFunc(){return this._endBlockNode(v7)}optimize($=1){while($-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode($){return this._currNode.nodes.push($),this}_blockNode($){this._currNode.nodes.push($),this._nodes.push($)}_endBlockNode($,X){let J=this._currNode;if(J instanceof $||X&&J instanceof X)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${X?`${$.kind}/${X.kind}`:$.kind}"`)}_elseNode($){let X=this._currNode;if(!(X instanceof $6))throw Error('CodeGen: "else" without "if"');return this._currNode=X.else=$,this}get _root(){return this._nodes[0]}get _currNode(){let $=this._nodes;return $[$.length-1]}set _currNode($){let X=this._nodes;X[X.length-1]=$}}t$.CodeGen=NK;function Y1($,X){for(let J in X)$[J]=($[J]||0)+(X[J]||0);return $}function _7($,X){return X instanceof J$._CodeOrName?Y1($,X.names):$}function G0($,X,J){if($ instanceof J$.Name)return Y($);if(!z($))return $;return new J$._Code($._items.reduce((W,Q)=>{if(Q instanceof J$.Name)Q=Y(Q);if(Q instanceof J$._Code)W.push(...Q._items);else W.push(Q);return W},[]));function Y(W){let Q=J[W.str];if(Q===void 0||X[W.str]!==1)return W;return delete X[W.str],Q}function z(W){return W instanceof J$._Code&&W._items.some((Q)=>Q instanceof J$.Name&&X[Q.str]===1&&J[Q.str]!==void 0)}}function W2($,X){for(let J in X)$[J]=($[J]||0)-(X[J]||0)}function HK($){return typeof $=="boolean"||typeof $=="number"||$===null?!$:J$._`!${_G($)}`}t$.not=HK;var Q2=KK(t$.operators.AND);function G2(...$){return $.reduce(Q2)}t$.and=G2;var U2=KK(t$.operators.OR);function w2(...$){return $.reduce(U2)}t$.or=w2;function KK($){return(X,J)=>X===J$.nil?J:J===J$.nil?X:J$._`${_G(X)} ${$} ${_G(J)}`}function _G($){return $ instanceof J$.Name?$:J$._`(${$})`}});var z$=k((IK)=>{Object.defineProperty(IK,"__esModule",{value:!0});IK.checkStrictMode=IK.getErrorPath=IK.Type=IK.useFunc=IK.setEvaluated=IK.evaluatedPropsToName=IK.mergeEvaluated=IK.eachItem=IK.unescapeJsonPointer=IK.escapeJsonPointer=IK.escapeFragment=IK.unescapeFragment=IK.schemaRefOrVal=IK.schemaHasRulesButRef=IK.schemaHasRules=IK.checkUnknownRules=IK.alwaysValidSchema=IK.toHash=void 0;var N$=t(),V2=hJ();function O2($){let X={};for(let J of $)X[J]=!0;return X}IK.toHash=O2;function D2($,X){if(typeof X=="boolean")return X;if(Object.keys(X).length===0)return!0;return BK($,X),!jK(X,$.self.RULES.all)}IK.alwaysValidSchema=D2;function BK($,X=$.schema){let{opts:J,self:Y}=$;if(!J.strictSchema)return;if(typeof X==="boolean")return;let z=Y.RULES.keywords;for(let W in X)if(!z[W])FK($,`unknown keyword: "${W}"`)}IK.checkUnknownRules=BK;function jK($,X){if(typeof $=="boolean")return!$;for(let J in $)if(X[J])return!0;return!1}IK.schemaHasRules=jK;function B2($,X){if(typeof $=="boolean")return!$;for(let J in $)if(J!=="$ref"&&X.all[J])return!0;return!1}IK.schemaHasRulesButRef=B2;function j2({topSchemaRef:$,schemaPath:X},J,Y,z){if(!z){if(typeof J=="number"||typeof J=="boolean")return J;if(typeof J=="string")return N$._`${J}`}return N$._`${$}${X}${(0,N$.getProperty)(Y)}`}IK.schemaRefOrVal=j2;function q2($){return qK(decodeURIComponent($))}IK.unescapeFragment=q2;function L2($){return encodeURIComponent(fG($))}IK.escapeFragment=L2;function fG($){if(typeof $=="number")return`${$}`;return $.replace(/~/g,"~0").replace(/\//g,"~1")}IK.escapeJsonPointer=fG;function qK($){return $.replace(/~1/g,"/").replace(/~0/g,"~")}IK.unescapeJsonPointer=qK;function F2($,X){if(Array.isArray($))for(let J of $)X(J);else X($)}IK.eachItem=F2;function OK({mergeNames:$,mergeToName:X,mergeValues:J,resultToName:Y}){return(z,W,Q,G)=>{let U=Q===void 0?W:Q instanceof N$.Name?(W instanceof N$.Name?$(z,W,Q):X(z,W,Q),Q):W instanceof N$.Name?(X(z,Q,W),W):J(W,Q);return G===N$.Name&&!(U instanceof N$.Name)?Y(z,U):U}}IK.mergeEvaluated={props:OK({mergeNames:($,X,J)=>$.if(N$._`${J} !== true && ${X} !== undefined`,()=>{$.if(N$._`${X} === true`,()=>$.assign(J,!0),()=>$.assign(J,N$._`${J} || {}`).code(N$._`Object.assign(${J}, ${X})`))}),mergeToName:($,X,J)=>$.if(N$._`${J} !== true`,()=>{if(X===!0)$.assign(J,!0);else $.assign(J,N$._`${J} || {}`),gG($,J,X)}),mergeValues:($,X)=>$===!0?!0:{...$,...X},resultToName:LK}),items:OK({mergeNames:($,X,J)=>$.if(N$._`${J} !== true && ${X} !== undefined`,()=>$.assign(J,N$._`${X} === true ? true : ${J} > ${X} ? ${J} : ${X}`)),mergeToName:($,X,J)=>$.if(N$._`${J} !== true`,()=>$.assign(J,X===!0?!0:N$._`${J} > ${X} ? ${J} : ${X}`)),mergeValues:($,X)=>$===!0?!0:Math.max($,X),resultToName:($,X)=>$.var("items",X)})};function LK($,X){if(X===!0)return $.var("props",!0);let J=$.var("props",N$._`{}`);if(X!==void 0)gG($,J,X);return J}IK.evaluatedPropsToName=LK;function gG($,X,J){Object.keys(J).forEach((Y)=>$.assign(N$._`${X}${(0,N$.getProperty)(Y)}`,!0))}IK.setEvaluated=gG;var DK={};function I2($,X){return $.scopeValue("func",{ref:X,code:DK[X.code]||(DK[X.code]=new V2._Code(X.code))})}IK.useFunc=I2;var TG;(function($){$[$.Num=0]="Num",$[$.Str=1]="Str"})(TG||(IK.Type=TG={}));function b2($,X,J){if($ instanceof N$.Name){let Y=X===TG.Num;return J?Y?N$._`"[" + ${$} + "]"`:N$._`"['" + ${$} + "']"`:Y?N$._`"/" + ${$}`:N$._`"/" + ${$}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return J?(0,N$.getProperty)($).toString():"/"+fG($)}IK.getErrorPath=b2;function FK($,X,J=$.opts.strictSchema){if(!J)return;if(X=`strict mode: ${X}`,J===!0)throw Error(X);$.self.logger.warn(X)}IK.checkStrictMode=FK});var X6=k((AK)=>{Object.defineProperty(AK,"__esModule",{value:!0});var u$=t(),u2={data:new u$.Name("data"),valCxt:new u$.Name("valCxt"),instancePath:new u$.Name("instancePath"),parentData:new u$.Name("parentData"),parentDataProperty:new u$.Name("parentDataProperty"),rootData:new u$.Name("rootData"),dynamicAnchors:new u$.Name("dynamicAnchors"),vErrors:new u$.Name("vErrors"),errors:new u$.Name("errors"),this:new u$.Name("this"),self:new u$.Name("self"),scope:new u$.Name("scope"),json:new u$.Name("json"),jsonPos:new u$.Name("jsonPos"),jsonLen:new u$.Name("jsonLen"),jsonPart:new u$.Name("jsonPart")};AK.default=u2});var lJ=k((EK)=>{Object.defineProperty(EK,"__esModule",{value:!0});EK.extendErrors=EK.resetErrorsCount=EK.reportExtraError=EK.reportError=EK.keyword$DataError=EK.keywordError=void 0;var Y$=t(),g7=z$(),i$=X6();EK.keywordError={message:({keyword:$})=>Y$.str`must pass "${$}" keyword validation`};EK.keyword$DataError={message:({keyword:$,schemaType:X})=>X?Y$.str`"${$}" keyword must be ${X} ($data)`:Y$.str`"${$}" keyword is invalid ($data)`};function m2($,X=EK.keywordError,J,Y){let{it:z}=$,{gen:W,compositeRule:Q,allErrors:G}=z,U=SK($,X,J);if(Y!==null&&Y!==void 0?Y:Q||G)MK(W,U);else PK(z,Y$._`[${U}]`)}EK.reportError=m2;function c2($,X=EK.keywordError,J){let{it:Y}=$,{gen:z,compositeRule:W,allErrors:Q}=Y,G=SK($,X,J);if(MK(z,G),!(W||Q))PK(Y,i$.default.vErrors)}EK.reportExtraError=c2;function i2($,X){$.assign(i$.default.errors,X),$.if(Y$._`${i$.default.vErrors} !== null`,()=>$.if(X,()=>$.assign(Y$._`${i$.default.vErrors}.length`,X),()=>$.assign(i$.default.vErrors,null)))}EK.resetErrorsCount=i2;function n2({gen:$,keyword:X,schemaValue:J,data:Y,errsCount:z,it:W}){if(z===void 0)throw Error("ajv implementation error");let Q=$.name("err");$.forRange("i",z,i$.default.errors,(G)=>{if($.const(Q,Y$._`${i$.default.vErrors}[${G}]`),$.if(Y$._`${Q}.instancePath === undefined`,()=>$.assign(Y$._`${Q}.instancePath`,(0,Y$.strConcat)(i$.default.instancePath,W.errorPath))),$.assign(Y$._`${Q}.schemaPath`,Y$.str`${W.errSchemaPath}/${X}`),W.opts.verbose)$.assign(Y$._`${Q}.schema`,J),$.assign(Y$._`${Q}.data`,Y)})}EK.extendErrors=n2;function MK($,X){let J=$.const("err",X);$.if(Y$._`${i$.default.vErrors} === null`,()=>$.assign(i$.default.vErrors,Y$._`[${J}]`),Y$._`${i$.default.vErrors}.push(${J})`),$.code(Y$._`${i$.default.errors}++`)}function PK($,X){let{gen:J,validateName:Y,schemaEnv:z}=$;if(z.$async)J.throw(Y$._`new ${$.ValidationError}(${X})`);else J.assign(Y$._`${Y}.errors`,X),J.return(!1)}var W1={keyword:new Y$.Name("keyword"),schemaPath:new Y$.Name("schemaPath"),params:new Y$.Name("params"),propertyName:new Y$.Name("propertyName"),message:new Y$.Name("message"),schema:new Y$.Name("schema"),parentSchema:new Y$.Name("parentSchema")};function SK($,X,J){let{createErrors:Y}=$.it;if(Y===!1)return Y$._`{}`;return p2($,X,J)}function p2($,X,J={}){let{gen:Y,it:z}=$,W=[d2(z,J),r2($,J)];return o2($,X,W),Y.object(...W)}function d2({errorPath:$},{instancePath:X}){let J=X?Y$.str`${$}${(0,g7.getErrorPath)(X,g7.Type.Str)}`:$;return[i$.default.instancePath,(0,Y$.strConcat)(i$.default.instancePath,J)]}function r2({keyword:$,it:{errSchemaPath:X}},{schemaPath:J,parentSchema:Y}){let z=Y?X:Y$.str`${X}/${$}`;if(J)z=Y$.str`${z}${(0,g7.getErrorPath)(J,g7.Type.Str)}`;return[W1.schemaPath,z]}function o2($,{params:X,message:J},Y){let{keyword:z,data:W,schemaValue:Q,it:G}=$,{opts:U,propertyName:w,topSchemaRef:N,schemaPath:K}=G;if(Y.push([W1.keyword,z],[W1.params,typeof X=="function"?X($):X||Y$._`{}`]),U.messages)Y.push([W1.message,typeof J=="function"?J($):J]);if(U.verbose)Y.push([W1.schema,Q],[W1.parentSchema,Y$._`${N}${K}`],[i$.default.data,W]);if(w)Y.push([W1.propertyName,w])}});var kK=k((ZK)=>{Object.defineProperty(ZK,"__esModule",{value:!0});ZK.boolOrEmptySchema=ZK.topBoolOrEmptySchema=void 0;var $P=lJ(),XP=t(),JP=X6(),zP={message:"boolean schema is false"};function YP($){let{gen:X,schema:J,validateName:Y}=$;if(J===!1)vK($,!1);else if(typeof J=="object"&&J.$async===!0)X.return(JP.default.data);else X.assign(XP._`${Y}.errors`,null),X.return(!0)}ZK.topBoolOrEmptySchema=YP;function WP($,X){let{gen:J,schema:Y}=$;if(Y===!1)J.var(X,!1),vK($);else J.var(X,!0)}ZK.boolOrEmptySchema=WP;function vK($,X){let{gen:J,data:Y}=$,z={gen:J,keyword:"false schema",data:Y,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:$};(0,$P.reportError)(z,zP,void 0,X)}});var hG=k((_K)=>{Object.defineProperty(_K,"__esModule",{value:!0});_K.getRules=_K.isJSONType=void 0;var GP=["string","number","integer","boolean","null","object","array"],UP=new Set(GP);function wP($){return typeof $=="string"&&UP.has($)}_K.isJSONType=wP;function NP(){let $={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...$,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},$.number,$.string,$.array,$.object],post:{rules:[]},all:{},keywords:{}}}_K.getRules=NP});var uG=k((gK)=>{Object.defineProperty(gK,"__esModule",{value:!0});gK.shouldUseRule=gK.shouldUseGroup=gK.schemaHasRulesForType=void 0;function KP({schema:$,self:X},J){let Y=X.RULES.types[J];return Y&&Y!==!0&&TK($,Y)}gK.schemaHasRulesForType=KP;function TK($,X){return X.rules.some((J)=>fK($,J))}gK.shouldUseGroup=TK;function fK($,X){var J;return $[X.keyword]!==void 0||((J=X.definition.implements)===null||J===void 0?void 0:J.some((Y)=>$[Y]!==void 0))}gK.shouldUseRule=fK});var mJ=k((mK)=>{Object.defineProperty(mK,"__esModule",{value:!0});mK.reportTypeError=mK.checkDataTypes=mK.checkDataType=mK.coerceAndCheckDataType=mK.getJSONTypes=mK.getSchemaTypes=mK.DataType=void 0;var DP=hG(),BP=uG(),jP=lJ(),o=t(),hK=z$(),U0;(function($){$[$.Correct=0]="Correct",$[$.Wrong=1]="Wrong"})(U0||(mK.DataType=U0={}));function qP($){let X=uK($.type);if(X.includes("null")){if($.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!X.length&&$.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if($.nullable===!0)X.push("null")}return X}mK.getSchemaTypes=qP;function uK($){let X=Array.isArray($)?$:$?[$]:[];if(X.every(DP.isJSONType))return X;throw Error("type must be JSONType or JSONType[]: "+X.join(","))}mK.getJSONTypes=uK;function LP($,X){let{gen:J,data:Y,opts:z}=$,W=FP(X,z.coerceTypes),Q=X.length>0&&!(W.length===0&&X.length===1&&(0,BP.schemaHasRulesForType)($,X[0]));if(Q){let G=mG(X,Y,z.strictNumbers,U0.Wrong);J.if(G,()=>{if(W.length)IP($,X,W);else cG($)})}return Q}mK.coerceAndCheckDataType=LP;var lK=new Set(["string","number","integer","boolean","null"]);function FP($,X){return X?$.filter((J)=>lK.has(J)||X==="array"&&J==="array"):[]}function IP($,X,J){let{gen:Y,data:z,opts:W}=$,Q=Y.let("dataType",o._`typeof ${z}`),G=Y.let("coerced",o._`undefined`);if(W.coerceTypes==="array")Y.if(o._`${Q} == 'object' && Array.isArray(${z}) && ${z}.length == 1`,()=>Y.assign(z,o._`${z}[0]`).assign(Q,o._`typeof ${z}`).if(mG(X,z,W.strictNumbers),()=>Y.assign(G,z)));Y.if(o._`${G} !== undefined`);for(let w of J)if(lK.has(w)||w==="array"&&W.coerceTypes==="array")U(w);Y.else(),cG($),Y.endIf(),Y.if(o._`${G} !== undefined`,()=>{Y.assign(z,G),bP($,G)});function U(w){switch(w){case"string":Y.elseIf(o._`${Q} == "number" || ${Q} == "boolean"`).assign(G,o._`"" + ${z}`).elseIf(o._`${z} === null`).assign(G,o._`""`);return;case"number":Y.elseIf(o._`${Q} == "boolean" || ${z} === null
6
6
  || (${Q} == "string" && ${z} && ${z} == +${z})`).assign(G,o._`+${z}`);return;case"integer":Y.elseIf(o._`${Q} === "boolean" || ${z} === null