@anthropic-ai/claude-agent-sdk 0.3.146 → 0.3.148

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.3.146
3
+ // Version: 0.3.148
4
4
  var eD=Object.create;var{getPrototypeOf:$q,defineProperty:hQ,getOwnPropertyNames:Xq}=Object;var Jq=Object.prototype.hasOwnProperty;function zq($){return this[$]}var Qq,Yq,ZU=($,X,J)=>{var Q=$!=null&&typeof $==="object";if(Q){var z=X?Qq??=new WeakMap:Yq??=new WeakMap,Y=z.get($);if(Y)return Y}J=$!=null?eD($q($)):{};let W=X||!$||!$.__esModule?hQ(J,"default",{value:$,enumerable:!0}):J;for(let G of Xq($))if(!Jq.call(W,G))hQ(W,G,{get:zq.bind($,G),enumerable:!0});if(Q)z.set($,W);return W};var x=($,X)=>()=>(X||$((X={exports:{}}).exports,X),X.exports);var Wq=($)=>$;function Gq($,X){this[$]=Wq.bind(null,X)}var B6=($,X)=>{for(var J in X)hQ($,J,{get:X[J],enumerable:!0,configurable:!0,set:Gq.bind(X,J)})};var Uq=($,X)=>()=>($&&(X=$($=0)),X);var n6=(($)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy($,{get:(X,J)=>(typeof require<"u"?require:X)[J]}):$)(function($){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+$+'" is not supported')}),wq=Symbol.dispose||Symbol.for("Symbol.dispose"),Kq=Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose"),F$=($,X,J)=>{if(X!=null){if(typeof X!=="object"&&typeof X!=="function")throw TypeError('Object expected to be assigned to "using" declaration');var Q;if(J)Q=X[Kq];if(Q===void 0)Q=X[wq];if(typeof Q!=="function")throw TypeError("Object not disposable");$.push([J,Q,X])}else if(J)$.push([J]);return X},M$=($,X,J)=>{var Q=typeof SuppressedError==="function"?SuppressedError:function(W,G,U,w){return w=Error(U),w.name="SuppressedError",w.error=W,w.suppressed=G,w},z=(W)=>X=J?new Q(W,X,"An error was suppressed during disposal"):(J=!0,W),Y=(W)=>{while(W=$.pop())try{var G=W[1]&&W[1].call(W[2]);if(W[0])return Promise.resolve(G).then(Y,(U)=>(z(U),Y()))}catch(U){z(U)}if(J)throw X};return Y()};var o6={};B6(o6,{sep:()=>dQ,resolve:()=>k1,relative:()=>Uw,posix:()=>Ow,parse:()=>Vw,normalize:()=>iQ,join:()=>u4,isAbsolute:()=>nQ,format:()=>Nw,extname:()=>Kw,dirname:()=>r6,delimiter:()=>Hw,default:()=>_L,basename:()=>pQ,_makeLong:()=>ww});function h4($){if(typeof $!=="string")throw TypeError("Path must be a string. Received "+JSON.stringify($))}function Gw($,X){var J="",Q=0,z=-1,Y=0,W;for(var G=0;G<=$.length;++G){if(G<$.length)W=$.charCodeAt(G);else if(W===47)break;else W=47;if(W===47){if(z===G-1||Y===1);else if(z!==G-1&&Y===2){if(J.length<2||Q!==2||J.charCodeAt(J.length-1)!==46||J.charCodeAt(J.length-2)!==46){if(J.length>2){var U=J.lastIndexOf("/");if(U!==J.length-1){if(U===-1)J="",Q=0;else J=J.slice(0,U),Q=J.length-1-J.lastIndexOf("/");z=G,Y=0;continue}}else if(J.length===2||J.length===1){J="",Q=0,z=G,Y=0;continue}}if(X){if(J.length>0)J+="/..";else J="..";Q=2}}else{if(J.length>0)J+="/"+$.slice(z+1,G);else J=$.slice(z+1,G);Q=G-z-1}z=G,Y=0}else if(W===46&&Y!==-1)++Y;else Y=-1}return J}function kL($,X){var J=X.dir||X.root,Q=X.base||(X.name||"")+(X.ext||"");if(!J)return Q;if(J===X.root)return J+Q;return J+$+Q}function k1(){var $="",X=!1,J;for(var Q=arguments.length-1;Q>=-1&&!X;Q--){var z;if(Q>=0)z=arguments[Q];else{if(J===void 0)J=process.cwd();z=J}if(h4(z),z.length===0)continue;$=z+"/"+$,X=z.charCodeAt(0)===47}if($=Gw($,!X),X)if($.length>0)return"/"+$;else return"/";else if($.length>0)return $;else return"."}function iQ($){if(h4($),$.length===0)return".";var X=$.charCodeAt(0)===47,J=$.charCodeAt($.length-1)===47;if($=Gw($,!X),$.length===0&&!X)$=".";if($.length>0&&J)$+="/";if(X)return"/"+$;return $}function nQ($){return h4($),$.length>0&&$.charCodeAt(0)===47}function u4(){if(arguments.length===0)return".";var $;for(var X=0;X<arguments.length;++X){var J=arguments[X];if(h4(J),J.length>0)if($===void 0)$=J;else $+="/"+J}if($===void 0)return".";return iQ($)}function Uw($,X){if(h4($),h4(X),$===X)return"";if($=k1($),X=k1(X),$===X)return"";var J=1;for(;J<$.length;++J)if($.charCodeAt(J)!==47)break;var Q=$.length,z=Q-J,Y=1;for(;Y<X.length;++Y)if(X.charCodeAt(Y)!==47)break;var W=X.length,G=W-Y,U=z<G?z:G,w=-1,K=0;for(;K<=U;++K){if(K===U){if(G>U){if(X.charCodeAt(Y+K)===47)return X.slice(Y+K+1);else if(K===0)return X.slice(Y+K)}else if(z>U){if($.charCodeAt(J+K)===47)w=K;else if(K===0)w=0}break}var N=$.charCodeAt(J+K),H=X.charCodeAt(Y+K);if(N!==H)break;else if(N===47)w=K}var V="";for(K=J+w+1;K<=Q;++K)if(K===Q||$.charCodeAt(K)===47)if(V.length===0)V+="..";else V+="/..";if(V.length>0)return V+X.slice(Y+w);else{if(Y+=w,X.charCodeAt(Y)===47)++Y;return X.slice(Y)}}function ww($){return $}function r6($){if(h4($),$.length===0)return".";var X=$.charCodeAt(0),J=X===47,Q=-1,z=!0;for(var Y=$.length-1;Y>=1;--Y)if(X=$.charCodeAt(Y),X===47){if(!z){Q=Y;break}}else z=!1;if(Q===-1)return J?"/":".";if(J&&Q===1)return"//";return $.slice(0,Q)}function pQ($,X){if(X!==void 0&&typeof X!=="string")throw TypeError('"ext" argument must be a string');h4($);var J=0,Q=-1,z=!0,Y;if(X!==void 0&&X.length>0&&X.length<=$.length){if(X.length===$.length&&X===$)return"";var W=X.length-1,G=-1;for(Y=$.length-1;Y>=0;--Y){var U=$.charCodeAt(Y);if(U===47){if(!z){J=Y+1;break}}else{if(G===-1)z=!1,G=Y+1;if(W>=0)if(U===X.charCodeAt(W)){if(--W===-1)Q=Y}else W=-1,Q=G}}if(J===Q)Q=G;else if(Q===-1)Q=$.length;return $.slice(J,Q)}else{for(Y=$.length-1;Y>=0;--Y)if($.charCodeAt(Y)===47){if(!z){J=Y+1;break}}else if(Q===-1)z=!1,Q=Y+1;if(Q===-1)return"";return $.slice(J,Q)}}function Kw($){h4($);var X=-1,J=0,Q=-1,z=!0,Y=0;for(var W=$.length-1;W>=0;--W){var G=$.charCodeAt(W);if(G===47){if(!z){J=W+1;break}continue}if(Q===-1)z=!1,Q=W+1;if(G===46){if(X===-1)X=W;else if(Y!==1)Y=1}else if(X!==-1)Y=-1}if(X===-1||Q===-1||Y===0||Y===1&&X===Q-1&&X===J+1)return"";return $.slice(X,Q)}function Nw($){if($===null||typeof $!=="object")throw TypeError('The "pathObject" argument must be of type Object. Received type '+typeof $);return kL("/",$)}function Vw($){h4($);var X={root:"",dir:"",base:"",ext:"",name:""};if($.length===0)return X;var J=$.charCodeAt(0),Q=J===47,z;if(Q)X.root="/",z=1;else z=0;var Y=-1,W=0,G=-1,U=!0,w=$.length-1,K=0;for(;w>=z;--w){if(J=$.charCodeAt(w),J===47){if(!U){W=w+1;break}continue}if(G===-1)U=!1,G=w+1;if(J===46){if(Y===-1)Y=w;else if(K!==1)K=1}else if(Y!==-1)K=-1}if(Y===-1||G===-1||K===0||K===1&&Y===G-1&&Y===W+1){if(G!==-1)if(W===0&&Q)X.base=X.name=$.slice(1,G);else X.base=X.name=$.slice(W,G)}else{if(W===0&&Q)X.name=$.slice(1,Y),X.base=$.slice(1,G);else X.name=$.slice(W,Y),X.base=$.slice(W,G);X.ext=$.slice(Y,G)}if(W>0)X.dir=$.slice(0,W-1);else if(Q)X.dir="/";return X}var dQ="/",Hw=":",Ow,_L;var P4=Uq(()=>{Ow=(($)=>($.posix=$,$))({resolve:k1,normalize:iQ,isAbsolute:nQ,join:u4,relative:Uw,_makeLong:ww,dirname:r6,basename:pQ,extname:Kw,format:Nw,parse:Vw,sep:dQ,delimiter:Hw,win32:null,posix:null}),_L=Ow});var w8=x((GH)=>{Object.defineProperty(GH,"__esModule",{value:!0});GH.regexpCode=GH.getEsmExportName=GH.getProperty=GH.safeStringify=GH.stringify=GH.strConcat=GH.addCodeArg=GH.str=GH._=GH.nil=GH._Code=GH.Name=GH.IDENTIFIER=GH._CodeOrName=void 0;class XQ{}GH._CodeOrName=XQ;GH.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class P0 extends XQ{constructor($){super();if(!GH.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}}}GH.Name=P0;class _4 extends XQ{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 P0)X[J.str]=(X[J.str]||0)+1;return X},{})}}GH._Code=_4;GH.nil=new _4("");function YH($,...X){let J=[$[0]],Q=0;while(Q<X.length)BG(J,X[Q]),J.push($[++Q]);return new _4(J)}GH._=YH;var OG=new _4("+");function WH($,...X){let J=[U8($[0])],Q=0;while(Q<X.length)J.push(OG),BG(J,X[Q]),J.push(OG,U8($[++Q]));return IP(J),new _4(J)}GH.str=WH;function BG($,X){if(X instanceof _4)$.push(...X._items);else if(X instanceof P0)$.push(X);else $.push(PP(X))}GH.addCodeArg=BG;function IP($){let X=1;while(X<$.length-1){if($[X]===OG){let J=AP($[X-1],$[X+1]);if(J!==void 0){$.splice(X-1,3,J);continue}$[X++]="+"}X++}}function AP($,X){if(X==='""')return $;if($==='""')return X;if(typeof $=="string"){if(X instanceof P0||$[$.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 P0))return`"${$}${X.slice(1)}`;return}function bP($,X){return X.emptyStr()?$:$.emptyStr()?X:WH`${$}${X}`}GH.strConcat=bP;function PP($){return typeof $=="number"||typeof $=="boolean"||$===null?$:U8(Array.isArray($)?$.join(","):$)}function ZP($){return new _4(U8($))}GH.stringify=ZP;function U8($){return JSON.stringify($).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}GH.safeStringify=U8;function SP($){return typeof $=="string"&&GH.IDENTIFIER.test($)?new _4(`.${$}`):YH`[${$}]`}GH.getProperty=SP;function RP($){if(typeof $=="string"&&GH.IDENTIFIER.test($))return new _4(`${$}`);throw Error(`CodeGen: invalid export name: ${$}, use explicit $id name mapping`)}GH.getEsmExportName=RP;function EP($){return new _4($.toString())}GH.regexpCode=EP});var LG=x((NH)=>{Object.defineProperty(NH,"__esModule",{value:!0});NH.ValueScope=NH.ValueScopeName=NH.Scope=NH.varKinds=NH.UsedValueState=void 0;var X4=w8();class wH extends Error{constructor($){super(`CodeGen: "code" for ${$} not defined`);this.value=$.value}}var zQ;(function($){$[$.Started=0]="Started",$[$.Completed=1]="Completed"})(zQ||(NH.UsedValueState=zQ={}));NH.varKinds={const:new X4.Name("const"),let:new X4.Name("let"),var:new X4.Name("var")};class DG{constructor({prefixes:$,parent:X}={}){this._names={},this._prefixes=$,this._parent=X}toName($){return $ instanceof X4.Name?$:this.name($)}name($){return new X4.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}}}NH.Scope=DG;class qG extends X4.Name{constructor($,X){super(X);this.prefix=$}setValue($,{property:X,itemIndex:J}){this.value=$,this.scopePath=X4._`.${new X4.Name(X)}[${J}]`}}NH.ValueScopeName=qG;var mP=X4._`\n`;class KH extends DG{constructor($){super($);this._values={},this._scope=$.scope,this.opts={...$,_n:$.lines?mP:X4.nil}}get(){return this._scope}name($){return new qG($,this._newName($))}value($,X){var J;if(X.ref===void 0)throw Error("CodeGen: ref must be passed in value");let Q=this.toName($),{prefix:z}=Q,Y=(J=X.key)!==null&&J!==void 0?J:X.ref,W=this._values[z];if(W){let w=W.get(Y);if(w)return w}else W=this._values[z]=new Map;W.set(Y,Q);let G=this._scope[z]||(this._scope[z]=[]),U=G.length;return G[U]=X.ref,Q.setValue(X,{property:z,itemIndex:U}),Q}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 X4._`${$}${J.scopePath}`})}scopeCode($=this._values,X,J){return this._reduceValues($,(Q)=>{if(Q.value===void 0)throw Error(`CodeGen: name "${Q}" has no value`);return Q.value.code},X,J)}_reduceValues($,X,J={},Q){let z=X4.nil;for(let Y in $){let W=$[Y];if(!W)continue;let G=J[Y]=J[Y]||new Map;W.forEach((U)=>{if(G.has(U))return;G.set(U,zQ.Started);let w=X(U);if(w){let K=this.opts.es5?NH.varKinds.var:NH.varKinds.const;z=X4._`${z}${K} ${U} = ${w};${this.opts._n}`}else if(w=Q===null||Q===void 0?void 0:Q(U))z=X4._`${z}${w}${this.opts._n}`;else throw new wH(U);G.set(U,zQ.Completed)})}return z}}NH.ValueScope=KH});var s=x((J4)=>{Object.defineProperty(J4,"__esModule",{value:!0});J4.or=J4.and=J4.not=J4.CodeGen=J4.operators=J4.varKinds=J4.ValueScopeName=J4.ValueScope=J4.Scope=J4.Name=J4.regexpCode=J4.stringify=J4.getProperty=J4.nil=J4.strConcat=J4.str=J4._=void 0;var Q$=w8(),x4=LG(),g6=w8();Object.defineProperty(J4,"_",{enumerable:!0,get:function(){return g6._}});Object.defineProperty(J4,"str",{enumerable:!0,get:function(){return g6.str}});Object.defineProperty(J4,"strConcat",{enumerable:!0,get:function(){return g6.strConcat}});Object.defineProperty(J4,"nil",{enumerable:!0,get:function(){return g6.nil}});Object.defineProperty(J4,"getProperty",{enumerable:!0,get:function(){return g6.getProperty}});Object.defineProperty(J4,"stringify",{enumerable:!0,get:function(){return g6.stringify}});Object.defineProperty(J4,"regexpCode",{enumerable:!0,get:function(){return g6.regexpCode}});Object.defineProperty(J4,"Name",{enumerable:!0,get:function(){return g6.Name}});var wQ=LG();Object.defineProperty(J4,"Scope",{enumerable:!0,get:function(){return wQ.Scope}});Object.defineProperty(J4,"ValueScope",{enumerable:!0,get:function(){return wQ.ValueScope}});Object.defineProperty(J4,"ValueScopeName",{enumerable:!0,get:function(){return wQ.ValueScopeName}});Object.defineProperty(J4,"varKinds",{enumerable:!0,get:function(){return wQ.varKinds}});J4.operators={GT:new Q$._Code(">"),GTE:new Q$._Code(">="),LT:new Q$._Code("<"),LTE:new Q$._Code("<="),EQ:new Q$._Code("==="),NEQ:new Q$._Code("!=="),NOT:new Q$._Code("!"),OR:new Q$._Code("||"),AND:new Q$._Code("&&"),ADD:new Q$._Code("+")};class y6{optimizeNodes(){return this}optimizeNames($,X){return this}}class HH extends y6{constructor($,X,J){super();this.varKind=$,this.name=X,this.rhs=J}render({es5:$,_n:X}){let J=$?x4.varKinds.var:this.varKind,Q=this.rhs===void 0?"":` = ${this.rhs}`;return`${J} ${this.name}${Q};`+X}optimizeNames($,X){if(!$[this.name.str])return;if(this.rhs)this.rhs=S0(this.rhs,$,X);return this}get names(){return this.rhs instanceof Q$._CodeOrName?this.rhs.names:{}}}class IG extends y6{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 Q$.Name&&!$[this.lhs.str]&&!this.sideEffects)return;return this.rhs=S0(this.rhs,$,X),this}get names(){let $=this.lhs instanceof Q$.Name?{}:{...this.lhs.names};return UQ($,this.rhs)}}class OH extends IG{constructor($,X,J,Q){super($,J,Q);this.op=X}render({_n:$}){return`${this.lhs} ${this.op}= ${this.rhs};`+$}}class BH extends y6{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`${this.label}:`+$}}class jH extends y6{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`break${this.label?` ${this.label}`:""};`+$}}class DH extends y6{constructor($){super();this.error=$}render({_n:$}){return`throw ${this.error};`+$}get names(){return this.error.names}}class qH extends y6{constructor($){super();this.code=$}render({_n:$}){return`${this.code};`+$}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames($,X){return this.code=S0(this.code,$,X),this}get names(){return this.code instanceof Q$._CodeOrName?this.code.names:{}}}class KQ extends y6{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,Q=J.length;while(Q--){let z=J[Q];if(z.optimizeNames($,X))continue;pP($,z.names),J.splice(Q,1)}return J.length>0?this:void 0}get names(){return this.nodes.reduce(($,X)=>F1($,X.names),{})}}class h6 extends KQ{render($){return"{"+$._n+super.render($)+"}"+$._n}}class LH extends KQ{}class K8 extends h6{}K8.kind="else";class K6 extends h6{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 K8(J):J}if(X){if($===!1)return X instanceof K6?X:X.nodes;if(this.nodes.length)return this;return new K6(bH($),X instanceof K6?[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=S0(this.condition,$,X),this}get names(){let $=super.names;if(UQ($,this.condition),this.else)F1($,this.else.names);return $}}K6.kind="if";class Z0 extends h6{}Z0.kind="for";class FH extends Z0{constructor($){super();this.iteration=$}render($){return`for(${this.iteration})`+super.render($)}optimizeNames($,X){if(!super.optimizeNames($,X))return;return this.iteration=S0(this.iteration,$,X),this}get names(){return F1(super.names,this.iteration.names)}}class MH extends Z0{constructor($,X,J,Q){super();this.varKind=$,this.name=X,this.from=J,this.to=Q}render($){let X=$.es5?x4.varKinds.var:this.varKind,{name:J,from:Q,to:z}=this;return`for(${X} ${J}=${Q}; ${J}<${z}; ${J}++)`+super.render($)}get names(){let $=UQ(super.names,this.from);return UQ($,this.to)}}class FG extends Z0{constructor($,X,J,Q){super();this.loop=$,this.varKind=X,this.name=J,this.iterable=Q}render($){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render($)}optimizeNames($,X){if(!super.optimizeNames($,X))return;return this.iterable=S0(this.iterable,$,X),this}get names(){return F1(super.names,this.iterable.names)}}class QQ extends h6{constructor($,X,J){super();this.name=$,this.args=X,this.async=J}render($){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render($)}}QQ.kind="func";class YQ extends KQ{render($){return"return "+super.render($)}}YQ.kind="return";class IH extends h6{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,Q;return super.optimizeNames($,X),(J=this.catch)===null||J===void 0||J.optimizeNames($,X),(Q=this.finally)===null||Q===void 0||Q.optimizeNames($,X),this}get names(){let $=super.names;if(this.catch)F1($,this.catch.names);if(this.finally)F1($,this.finally.names);return $}}class WQ extends h6{constructor($){super();this.error=$}render($){return`catch(${this.error})`+super.render($)}}WQ.kind="catch";class GQ extends h6{render($){return"finally"+super.render($)}}GQ.kind="finally";class AH{constructor($,X={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...X,_n:X.lines?`
5
5
  `:""},this._extScope=$,this._scope=new x4.Scope({parent:$}),this._nodes=[new LH]}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,Q){let z=this._scope.toName(X);if(J!==void 0&&Q)this._constants[z.str]=J;return this._leafNode(new HH($,z,J)),z}const($,X,J){return this._def(x4.varKinds.const,$,X,J)}let($,X,J){return this._def(x4.varKinds.let,$,X,J)}var($,X,J){return this._def(x4.varKinds.var,$,X,J)}assign($,X,J){return this._leafNode(new IG($,X,J))}add($,X){return this._leafNode(new OH($,J4.operators.ADD,X))}code($){if(typeof $=="function")$();else if($!==Q$.nil)this._leafNode(new qH($));return this}object(...$){let X=["{"];for(let[J,Q]of $){if(X.length>1)X.push(",");if(X.push(J),J!==Q||this.opts.es5)X.push(":"),(0,Q$.addCodeArg)(X,Q)}return X.push("}"),new Q$._Code(X)}if($,X,J){if(this._blockNode(new K6($)),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 K6($))}else(){return this._elseNode(new K8)}endIf(){return this._endBlockNode(K6,K8)}_for($,X){if(this._blockNode($),X)this.code(X).endFor();return this}for($,X){return this._for(new FH($),X)}forRange($,X,J,Q,z=this.opts.es5?x4.varKinds.var:x4.varKinds.let){let Y=this._scope.toName($);return this._for(new MH(z,Y,X,J),()=>Q(Y))}forOf($,X,J,Q=x4.varKinds.const){let z=this._scope.toName($);if(this.opts.es5){let Y=X instanceof Q$.Name?X:this.var("_arr",X);return this.forRange("_i",0,Q$._`${Y}.length`,(W)=>{this.var(z,Q$._`${Y}[${W}]`),J(z)})}return this._for(new FG("of",Q,z,X),()=>J(z))}forIn($,X,J,Q=this.opts.es5?x4.varKinds.var:x4.varKinds.const){if(this.opts.ownProperties)return this.forOf($,Q$._`Object.keys(${X})`,J);let z=this._scope.toName($);return this._for(new FG("in",Q,z,X),()=>J(z))}endFor(){return this._endBlockNode(Z0)}label($){return this._leafNode(new BH($))}break($){return this._leafNode(new jH($))}return($){let X=new YQ;if(this._blockNode(X),this.code($),X.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(YQ)}try($,X,J){if(!X&&!J)throw Error('CodeGen: "try" without "catch" and "finally"');let Q=new IH;if(this._blockNode(Q),this.code($),X){let z=this.name("e");this._currNode=Q.catch=new WQ(z),X(z)}if(J)this._currNode=Q.finally=new GQ,this.code(J);return this._endBlockNode(WQ,GQ)}throw($){return this._leafNode(new DH($))}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=Q$.nil,J,Q){if(this._blockNode(new QQ($,X,J)),Q)this.code(Q).endFunc();return this}endFunc(){return this._endBlockNode(QQ)}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 K6))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]=$}}J4.CodeGen=AH;function F1($,X){for(let J in X)$[J]=($[J]||0)+(X[J]||0);return $}function UQ($,X){return X instanceof Q$._CodeOrName?F1($,X.names):$}function S0($,X,J){if($ instanceof Q$.Name)return Q($);if(!z($))return $;return new Q$._Code($._items.reduce((Y,W)=>{if(W instanceof Q$.Name)W=Q(W);if(W instanceof Q$._Code)Y.push(...W._items);else Y.push(W);return Y},[]));function Q(Y){let W=J[Y.str];if(W===void 0||X[Y.str]!==1)return Y;return delete X[Y.str],W}function z(Y){return Y instanceof Q$._Code&&Y._items.some((W)=>W instanceof Q$.Name&&X[W.str]===1&&J[W.str]!==void 0)}}function pP($,X){for(let J in X)$[J]=($[J]||0)-(X[J]||0)}function bH($){return typeof $=="boolean"||typeof $=="number"||$===null?!$:Q$._`!${MG($)}`}J4.not=bH;var dP=PH(J4.operators.AND);function rP(...$){return $.reduce(dP)}J4.and=rP;var oP=PH(J4.operators.OR);function tP(...$){return $.reduce(oP)}J4.or=tP;function PH($){return(X,J)=>X===Q$.nil?J:J===Q$.nil?X:Q$._`${MG(X)} ${$} ${MG(J)}`}function MG($){return $ instanceof Q$.Name?$:Q$._`(${$})`}});var Y$=x((xH)=>{Object.defineProperty(xH,"__esModule",{value:!0});xH.checkStrictMode=xH.getErrorPath=xH.Type=xH.useFunc=xH.setEvaluated=xH.evaluatedPropsToName=xH.mergeEvaluated=xH.eachItem=xH.unescapeJsonPointer=xH.escapeJsonPointer=xH.escapeFragment=xH.unescapeFragment=xH.schemaRefOrVal=xH.schemaHasRulesButRef=xH.schemaHasRules=xH.checkUnknownRules=xH.alwaysValidSchema=xH.toHash=void 0;var B$=s(),$Z=w8();function XZ($){let X={};for(let J of $)X[J]=!0;return X}xH.toHash=XZ;function JZ($,X){if(typeof X=="boolean")return X;if(Object.keys(X).length===0)return!0;return EH($,X),!vH(X,$.self.RULES.all)}xH.alwaysValidSchema=JZ;function EH($,X=$.schema){let{opts:J,self:Q}=$;if(!J.strictSchema)return;if(typeof X==="boolean")return;let z=Q.RULES.keywords;for(let Y in X)if(!z[Y])_H($,`unknown keyword: "${Y}"`)}xH.checkUnknownRules=EH;function vH($,X){if(typeof $=="boolean")return!$;for(let J in $)if(X[J])return!0;return!1}xH.schemaHasRules=vH;function zZ($,X){if(typeof $=="boolean")return!$;for(let J in $)if(J!=="$ref"&&X.all[J])return!0;return!1}xH.schemaHasRulesButRef=zZ;function QZ({topSchemaRef:$,schemaPath:X},J,Q,z){if(!z){if(typeof J=="number"||typeof J=="boolean")return J;if(typeof J=="string")return B$._`${J}`}return B$._`${$}${X}${(0,B$.getProperty)(Q)}`}xH.schemaRefOrVal=QZ;function YZ($){return CH(decodeURIComponent($))}xH.unescapeFragment=YZ;function WZ($){return encodeURIComponent(bG($))}xH.escapeFragment=WZ;function bG($){if(typeof $=="number")return`${$}`;return $.replace(/~/g,"~0").replace(/\//g,"~1")}xH.escapeJsonPointer=bG;function CH($){return $.replace(/~1/g,"/").replace(/~0/g,"~")}xH.unescapeJsonPointer=CH;function GZ($,X){if(Array.isArray($))for(let J of $)X(J);else X($)}xH.eachItem=GZ;function SH({mergeNames:$,mergeToName:X,mergeValues:J,resultToName:Q}){return(z,Y,W,G)=>{let U=W===void 0?Y:W instanceof B$.Name?(Y instanceof B$.Name?$(z,Y,W):X(z,Y,W),W):Y instanceof B$.Name?(X(z,W,Y),Y):J(Y,W);return G===B$.Name&&!(U instanceof B$.Name)?Q(z,U):U}}xH.mergeEvaluated={props:SH({mergeNames:($,X,J)=>$.if(B$._`${J} !== true && ${X} !== undefined`,()=>{$.if(B$._`${X} === true`,()=>$.assign(J,!0),()=>$.assign(J,B$._`${J} || {}`).code(B$._`Object.assign(${J}, ${X})`))}),mergeToName:($,X,J)=>$.if(B$._`${J} !== true`,()=>{if(X===!0)$.assign(J,!0);else $.assign(J,B$._`${J} || {}`),PG($,J,X)}),mergeValues:($,X)=>$===!0?!0:{...$,...X},resultToName:kH}),items:SH({mergeNames:($,X,J)=>$.if(B$._`${J} !== true && ${X} !== undefined`,()=>$.assign(J,B$._`${X} === true ? true : ${J} > ${X} ? ${J} : ${X}`)),mergeToName:($,X,J)=>$.if(B$._`${J} !== true`,()=>$.assign(J,X===!0?!0:B$._`${J} > ${X} ? ${J} : ${X}`)),mergeValues:($,X)=>$===!0?!0:Math.max($,X),resultToName:($,X)=>$.var("items",X)})};function kH($,X){if(X===!0)return $.var("props",!0);let J=$.var("props",B$._`{}`);if(X!==void 0)PG($,J,X);return J}xH.evaluatedPropsToName=kH;function PG($,X,J){Object.keys(J).forEach((Q)=>$.assign(B$._`${X}${(0,B$.getProperty)(Q)}`,!0))}xH.setEvaluated=PG;var RH={};function UZ($,X){return $.scopeValue("func",{ref:X,code:RH[X.code]||(RH[X.code]=new $Z._Code(X.code))})}xH.useFunc=UZ;var AG;(function($){$[$.Num=0]="Num",$[$.Str=1]="Str"})(AG||(xH.Type=AG={}));function wZ($,X,J){if($ instanceof B$.Name){let Q=X===AG.Num;return J?Q?B$._`"[" + ${$} + "]"`:B$._`"['" + ${$} + "']"`:Q?B$._`"/" + ${$}`:B$._`"/" + ${$}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return J?(0,B$.getProperty)($).toString():"/"+bG($)}xH.getErrorPath=wZ;function _H($,X,J=$.opts.strictSchema){if(!J)return;if(X=`strict mode: ${X}`,J===!0)throw Error(X);$.self.logger.warn(X)}xH.checkStrictMode=_H});var N6=x((fH)=>{Object.defineProperty(fH,"__esModule",{value:!0});var i$=s(),SZ={data:new i$.Name("data"),valCxt:new i$.Name("valCxt"),instancePath:new i$.Name("instancePath"),parentData:new i$.Name("parentData"),parentDataProperty:new i$.Name("parentDataProperty"),rootData:new i$.Name("rootData"),dynamicAnchors:new i$.Name("dynamicAnchors"),vErrors:new i$.Name("vErrors"),errors:new i$.Name("errors"),this:new i$.Name("this"),self:new i$.Name("self"),scope:new i$.Name("scope"),json:new i$.Name("json"),jsonPos:new i$.Name("jsonPos"),jsonLen:new i$.Name("jsonLen"),jsonPart:new i$.Name("jsonPart")};fH.default=SZ});var N8=x((uH)=>{Object.defineProperty(uH,"__esModule",{value:!0});uH.extendErrors=uH.resetErrorsCount=uH.reportExtraError=uH.reportError=uH.keyword$DataError=uH.keywordError=void 0;var W$=s(),VQ=Y$(),r$=N6();uH.keywordError={message:({keyword:$})=>W$.str`must pass "${$}" keyword validation`};uH.keyword$DataError={message:({keyword:$,schemaType:X})=>X?W$.str`"${$}" keyword must be ${X} ($data)`:W$.str`"${$}" keyword is invalid ($data)`};function EZ($,X=uH.keywordError,J,Q){let{it:z}=$,{gen:Y,compositeRule:W,allErrors:G}=z,U=hH($,X,J);if(Q!==null&&Q!==void 0?Q:W||G)gH(Y,U);else yH(z,W$._`[${U}]`)}uH.reportError=EZ;function vZ($,X=uH.keywordError,J){let{it:Q}=$,{gen:z,compositeRule:Y,allErrors:W}=Q,G=hH($,X,J);if(gH(z,G),!(Y||W))yH(Q,r$.default.vErrors)}uH.reportExtraError=vZ;function CZ($,X){$.assign(r$.default.errors,X),$.if(W$._`${r$.default.vErrors} !== null`,()=>$.if(X,()=>$.assign(W$._`${r$.default.vErrors}.length`,X),()=>$.assign(r$.default.vErrors,null)))}uH.resetErrorsCount=CZ;function kZ({gen:$,keyword:X,schemaValue:J,data:Q,errsCount:z,it:Y}){if(z===void 0)throw Error("ajv implementation error");let W=$.name("err");$.forRange("i",z,r$.default.errors,(G)=>{if($.const(W,W$._`${r$.default.vErrors}[${G}]`),$.if(W$._`${W}.instancePath === undefined`,()=>$.assign(W$._`${W}.instancePath`,(0,W$.strConcat)(r$.default.instancePath,Y.errorPath))),$.assign(W$._`${W}.schemaPath`,W$.str`${Y.errSchemaPath}/${X}`),Y.opts.verbose)$.assign(W$._`${W}.schema`,J),$.assign(W$._`${W}.data`,Q)})}uH.extendErrors=kZ;function gH($,X){let J=$.const("err",X);$.if(W$._`${r$.default.vErrors} === null`,()=>$.assign(r$.default.vErrors,W$._`[${J}]`),W$._`${r$.default.vErrors}.push(${J})`),$.code(W$._`${r$.default.errors}++`)}function yH($,X){let{gen:J,validateName:Q,schemaEnv:z}=$;if(z.$async)J.throw(W$._`new ${$.ValidationError}(${X})`);else J.assign(W$._`${Q}.errors`,X),J.return(!1)}var M1={keyword:new W$.Name("keyword"),schemaPath:new W$.Name("schemaPath"),params:new W$.Name("params"),propertyName:new W$.Name("propertyName"),message:new W$.Name("message"),schema:new W$.Name("schema"),parentSchema:new W$.Name("parentSchema")};function hH($,X,J){let{createErrors:Q}=$.it;if(Q===!1)return W$._`{}`;return _Z($,X,J)}function _Z($,X,J={}){let{gen:Q,it:z}=$,Y=[xZ(z,J),TZ($,J)];return fZ($,X,Y),Q.object(...Y)}function xZ({errorPath:$},{instancePath:X}){let J=X?W$.str`${$}${(0,VQ.getErrorPath)(X,VQ.Type.Str)}`:$;return[r$.default.instancePath,(0,W$.strConcat)(r$.default.instancePath,J)]}function TZ({keyword:$,it:{errSchemaPath:X}},{schemaPath:J,parentSchema:Q}){let z=Q?X:W$.str`${X}/${$}`;if(J)z=W$.str`${z}${(0,VQ.getErrorPath)(J,VQ.Type.Str)}`;return[M1.schemaPath,z]}function fZ($,{params:X,message:J},Q){let{keyword:z,data:Y,schemaValue:W,it:G}=$,{opts:U,propertyName:w,topSchemaRef:K,schemaPath:N}=G;if(Q.push([M1.keyword,z],[M1.params,typeof X=="function"?X($):X||W$._`{}`]),U.messages)Q.push([M1.message,typeof J=="function"?J($):J]);if(U.verbose)Q.push([M1.schema,W],[M1.parentSchema,W$._`${K}${N}`],[r$.default.data,Y]);if(w)Q.push([M1.propertyName,w])}});var nH=x((cH)=>{Object.defineProperty(cH,"__esModule",{value:!0});cH.boolOrEmptySchema=cH.topBoolOrEmptySchema=void 0;var lZ=N8(),mZ=s(),cZ=N6(),iZ={message:"boolean schema is false"};function nZ($){let{gen:X,schema:J,validateName:Q}=$;if(J===!1)mH($,!1);else if(typeof J=="object"&&J.$async===!0)X.return(cZ.default.data);else X.assign(mZ._`${Q}.errors`,null),X.return(!0)}cH.topBoolOrEmptySchema=nZ;function pZ($,X){let{gen:J,schema:Q}=$;if(Q===!1)J.var(X,!1),mH($);else J.var(X,!0)}cH.boolOrEmptySchema=pZ;function mH($,X){let{gen:J,data:Q}=$,z={gen:J,keyword:"false schema",data:Q,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:$};(0,lZ.reportError)(z,iZ,void 0,X)}});var SG=x((pH)=>{Object.defineProperty(pH,"__esModule",{value:!0});pH.getRules=pH.isJSONType=void 0;var rZ=["string","number","integer","boolean","null","object","array"],oZ=new Set(rZ);function tZ($){return typeof $=="string"&&oZ.has($)}pH.isJSONType=tZ;function aZ(){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:{}}}pH.getRules=aZ});var RG=x((tH)=>{Object.defineProperty(tH,"__esModule",{value:!0});tH.shouldUseRule=tH.shouldUseGroup=tH.schemaHasRulesForType=void 0;function eZ({schema:$,self:X},J){let Q=X.RULES.types[J];return Q&&Q!==!0&&rH($,Q)}tH.schemaHasRulesForType=eZ;function rH($,X){return X.rules.some((J)=>oH($,J))}tH.shouldUseGroup=rH;function oH($,X){var J;return $[X.keyword]!==void 0||((J=X.definition.implements)===null||J===void 0?void 0:J.some((Q)=>$[Q]!==void 0))}tH.shouldUseRule=oH});var V8=x((XO)=>{Object.defineProperty(XO,"__esModule",{value:!0});XO.reportTypeError=XO.checkDataTypes=XO.checkDataType=XO.coerceAndCheckDataType=XO.getJSONTypes=XO.getSchemaTypes=XO.DataType=void 0;var JS=SG(),zS=RG(),QS=N8(),a=s(),sH=Y$(),R0;(function($){$[$.Correct=0]="Correct",$[$.Wrong=1]="Wrong"})(R0||(XO.DataType=R0={}));function YS($){let X=eH($.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}XO.getSchemaTypes=YS;function eH($){let X=Array.isArray($)?$:$?[$]:[];if(X.every(JS.isJSONType))return X;throw Error("type must be JSONType or JSONType[]: "+X.join(","))}XO.getJSONTypes=eH;function WS($,X){let{gen:J,data:Q,opts:z}=$,Y=GS(X,z.coerceTypes),W=X.length>0&&!(Y.length===0&&X.length===1&&(0,zS.schemaHasRulesForType)($,X[0]));if(W){let G=vG(X,Q,z.strictNumbers,R0.Wrong);J.if(G,()=>{if(Y.length)US($,X,Y);else CG($)})}return W}XO.coerceAndCheckDataType=WS;var $O=new Set(["string","number","integer","boolean","null"]);function GS($,X){return X?$.filter((J)=>$O.has(J)||X==="array"&&J==="array"):[]}function US($,X,J){let{gen:Q,data:z,opts:Y}=$,W=Q.let("dataType",a._`typeof ${z}`),G=Q.let("coerced",a._`undefined`);if(Y.coerceTypes==="array")Q.if(a._`${W} == 'object' && Array.isArray(${z}) && ${z}.length == 1`,()=>Q.assign(z,a._`${z}[0]`).assign(W,a._`typeof ${z}`).if(vG(X,z,Y.strictNumbers),()=>Q.assign(G,z)));Q.if(a._`${G} !== undefined`);for(let w of J)if($O.has(w)||w==="array"&&Y.coerceTypes==="array")U(w);Q.else(),CG($),Q.endIf(),Q.if(a._`${G} !== undefined`,()=>{Q.assign(z,G),wS($,G)});function U(w){switch(w){case"string":Q.elseIf(a._`${W} == "number" || ${W} == "boolean"`).assign(G,a._`"" + ${z}`).elseIf(a._`${z} === null`).assign(G,a._`""`);return;case"number":Q.elseIf(a._`${W} == "boolean" || ${z} === null
6
6
  || (${W} == "string" && ${z} && ${z} == +${z})`).assign(G,a._`+${z}`);return;case"integer":Q.elseIf(a._`${W} === "boolean" || ${z} === null
@@ -8,7 +8,7 @@ var eD=Object.create;var{getPrototypeOf:$q,defineProperty:hQ,getOwnPropertyNames
8
8
  || ${W} === "boolean" || ${z} === null`).assign(G,a._`[${z}]`)}}}function wS({gen:$,parentData:X,parentDataProperty:J},Q){$.if(a._`${X} !== undefined`,()=>$.assign(a._`${X}[${J}]`,Q))}function EG($,X,J,Q=R0.Correct){let z=Q===R0.Correct?a.operators.EQ:a.operators.NEQ,Y;switch($){case"null":return a._`${X} ${z} null`;case"array":Y=a._`Array.isArray(${X})`;break;case"object":Y=a._`${X} && typeof ${X} == "object" && !Array.isArray(${X})`;break;case"integer":Y=W(a._`!(${X} % 1) && !isNaN(${X})`);break;case"number":Y=W();break;default:return a._`typeof ${X} ${z} ${$}`}return Q===R0.Correct?Y:(0,a.not)(Y);function W(G=a.nil){return(0,a.and)(a._`typeof ${X} == "number"`,G,J?a._`isFinite(${X})`:a.nil)}}XO.checkDataType=EG;function vG($,X,J,Q){if($.length===1)return EG($[0],X,J,Q);let z,Y=(0,sH.toHash)($);if(Y.array&&Y.object){let W=a._`typeof ${X} != "object"`;z=Y.null?W:a._`!${X} || ${W}`,delete Y.null,delete Y.array,delete Y.object}else z=a.nil;if(Y.number)delete Y.integer;for(let W in Y)z=(0,a.and)(z,EG(W,X,J,Q));return z}XO.checkDataTypes=vG;var KS={message:({schema:$})=>`must be ${$}`,params:({schema:$,schemaValue:X})=>typeof $=="string"?a._`{type: ${$}}`:a._`{type: ${X}}`};function CG($){let X=NS($);(0,QS.reportError)(X,KS)}XO.reportTypeError=CG;function NS($){let{gen:X,data:J,schema:Q}=$,z=(0,sH.schemaRefOrVal)($,Q,"type");return{gen:X,keyword:"type",data:J,schema:Q.type,schemaCode:z,schemaValue:z,parentSchema:Q,params:{},it:$}}});var WO=x((QO)=>{Object.defineProperty(QO,"__esModule",{value:!0});QO.assignDefaults=void 0;var E0=s(),qS=Y$();function LS($,X){let{properties:J,items:Q}=$.schema;if(X==="object"&&J)for(let z in J)zO($,z,J[z].default);else if(X==="array"&&Array.isArray(Q))Q.forEach((z,Y)=>zO($,Y,z.default))}QO.assignDefaults=LS;function zO($,X,J){let{gen:Q,compositeRule:z,data:Y,opts:W}=$;if(J===void 0)return;let G=E0._`${Y}${(0,E0.getProperty)(X)}`;if(z){(0,qS.checkStrictMode)($,`default is ignored for: ${G}`);return}let U=E0._`${G} === undefined`;if(W.useDefaults==="empty")U=E0._`${U} || ${G} === null || ${G} === ""`;Q.if(U,E0._`${G} = ${(0,E0.stringify)(J)}`)}});var A4=x((wO)=>{Object.defineProperty(wO,"__esModule",{value:!0});wO.validateUnion=wO.validateArray=wO.usePattern=wO.callValidateCode=wO.schemaProperties=wO.allSchemaProperties=wO.noPropertyInData=wO.propertyInData=wO.isOwnProperty=wO.hasPropFunc=wO.reportMissingProp=wO.checkMissingProp=wO.checkReportMissingProp=void 0;var L$=s(),kG=Y$(),u6=N6(),FS=Y$();function MS($,X){let{gen:J,data:Q,it:z}=$;J.if(xG(J,Q,X,z.opts.ownProperties),()=>{$.setParams({missingProperty:L$._`${X}`},!0),$.error()})}wO.checkReportMissingProp=MS;function IS({gen:$,data:X,it:{opts:J}},Q,z){return(0,L$.or)(...Q.map((Y)=>(0,L$.and)(xG($,X,Y,J.ownProperties),L$._`${z} = ${Y}`)))}wO.checkMissingProp=IS;function AS($,X){$.setParams({missingProperty:X},!0),$.error()}wO.reportMissingProp=AS;function GO($){return $.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:L$._`Object.prototype.hasOwnProperty`})}wO.hasPropFunc=GO;function _G($,X,J){return L$._`${GO($)}.call(${X}, ${J})`}wO.isOwnProperty=_G;function bS($,X,J,Q){let z=L$._`${X}${(0,L$.getProperty)(J)} !== undefined`;return Q?L$._`${z} && ${_G($,X,J)}`:z}wO.propertyInData=bS;function xG($,X,J,Q){let z=L$._`${X}${(0,L$.getProperty)(J)} === undefined`;return Q?(0,L$.or)(z,(0,L$.not)(_G($,X,J))):z}wO.noPropertyInData=xG;function UO($){return $?Object.keys($).filter((X)=>X!=="__proto__"):[]}wO.allSchemaProperties=UO;function PS($,X){return UO(X).filter((J)=>!(0,kG.alwaysValidSchema)($,X[J]))}wO.schemaProperties=PS;function ZS({schemaCode:$,data:X,it:{gen:J,topSchemaRef:Q,schemaPath:z,errorPath:Y},it:W},G,U,w){let K=w?L$._`${$}, ${X}, ${Q}${z}`:X,N=[[u6.default.instancePath,(0,L$.strConcat)(u6.default.instancePath,Y)],[u6.default.parentData,W.parentData],[u6.default.parentDataProperty,W.parentDataProperty],[u6.default.rootData,u6.default.rootData]];if(W.opts.dynamicRef)N.push([u6.default.dynamicAnchors,u6.default.dynamicAnchors]);let H=L$._`${K}, ${J.object(...N)}`;return U!==L$.nil?L$._`${G}.call(${U}, ${H})`:L$._`${G}(${H})`}wO.callValidateCode=ZS;var SS=L$._`new RegExp`;function RS({gen:$,it:{opts:X}},J){let Q=X.unicodeRegExp?"u":"",{regExp:z}=X.code,Y=z(J,Q);return $.scopeValue("pattern",{key:Y.toString(),ref:Y,code:L$._`${z.code==="new RegExp"?SS:(0,FS.useFunc)($,z)}(${J}, ${Q})`})}wO.usePattern=RS;function ES($){let{gen:X,data:J,keyword:Q,it:z}=$,Y=X.name("valid");if(z.allErrors){let G=X.let("valid",!0);return W(()=>X.assign(G,!1)),G}return X.var(Y,!0),W(()=>X.break()),Y;function W(G){let U=X.const("len",L$._`${J}.length`);X.forRange("i",0,U,(w)=>{$.subschema({keyword:Q,dataProp:w,dataPropType:kG.Type.Num},Y),X.if((0,L$.not)(Y),G)})}}wO.validateArray=ES;function vS($){let{gen:X,schema:J,keyword:Q,it:z}=$;if(!Array.isArray(J))throw Error("ajv implementation error");if(J.some((U)=>(0,kG.alwaysValidSchema)(z,U))&&!z.opts.unevaluated)return;let W=X.let("valid",!1),G=X.name("_valid");X.block(()=>J.forEach((U,w)=>{let K=$.subschema({keyword:Q,schemaProp:w,compositeRule:!0},G);if(X.assign(W,L$._`${W} || ${G}`),!$.mergeValidEvaluated(K,G))X.if((0,L$.not)(W))})),$.result(W,()=>$.reset(),()=>$.error(!0))}wO.validateUnion=vS});var BO=x((HO)=>{Object.defineProperty(HO,"__esModule",{value:!0});HO.validateKeywordUsage=HO.validSchemaType=HO.funcKeywordCode=HO.macroKeywordCode=void 0;var o$=s(),I1=N6(),cS=A4(),iS=N8();function nS($,X){let{gen:J,keyword:Q,schema:z,parentSchema:Y,it:W}=$,G=X.macro.call(W.self,z,Y,W),U=VO(J,Q,G);if(W.opts.validateSchema!==!1)W.self.validateSchema(G,!0);let w=J.name("valid");$.subschema({schema:G,schemaPath:o$.nil,errSchemaPath:`${W.errSchemaPath}/${Q}`,topSchemaRef:U,compositeRule:!0},w),$.pass(w,()=>$.error(!0))}HO.macroKeywordCode=nS;function pS($,X){var J;let{gen:Q,keyword:z,schema:Y,parentSchema:W,$data:G,it:U}=$;rS(U,X);let w=!G&&X.compile?X.compile.call(U.self,Y,W,U):X.validate,K=VO(Q,z,w),N=Q.let("valid");$.block$data(N,H),$.ok((J=X.valid)!==null&&J!==void 0?J:N);function H(){if(X.errors===!1){if(B(),X.modifying)NO($);L(()=>$.error())}else{let F=X.async?V():O();if(X.modifying)NO($);L(()=>dS($,F))}}function V(){let F=Q.let("ruleErrs",null);return Q.try(()=>B(o$._`await `),(Z)=>Q.assign(N,!1).if(o$._`${Z} instanceof ${U.ValidationError}`,()=>Q.assign(F,o$._`${Z}.errors`),()=>Q.throw(Z))),F}function O(){let F=o$._`${K}.errors`;return Q.assign(F,null),B(o$.nil),F}function B(F=X.async?o$._`await `:o$.nil){let Z=U.opts.passContext?I1.default.this:I1.default.self,C=!(("compile"in X)&&!G||X.schema===!1);Q.assign(N,o$._`${F}${(0,cS.callValidateCode)($,K,Z,C)}`,X.modifying)}function L(F){var Z;Q.if((0,o$.not)((Z=X.valid)!==null&&Z!==void 0?Z:N),F)}}HO.funcKeywordCode=pS;function NO($){let{gen:X,data:J,it:Q}=$;X.if(Q.parentData,()=>X.assign(J,o$._`${Q.parentData}[${Q.parentDataProperty}]`))}function dS($,X){let{gen:J}=$;J.if(o$._`Array.isArray(${X})`,()=>{J.assign(I1.default.vErrors,o$._`${I1.default.vErrors} === null ? ${X} : ${I1.default.vErrors}.concat(${X})`).assign(I1.default.errors,o$._`${I1.default.vErrors}.length`),(0,iS.extendErrors)($)},()=>$.error())}function rS({schemaEnv:$},X){if(X.async&&!$.$async)throw Error("async keyword in sync schema")}function VO($,X,J){if(J===void 0)throw Error(`keyword "${X}" failed to compile`);return $.scopeValue("keyword",typeof J=="function"?{ref:J}:{ref:J,code:(0,o$.stringify)(J)})}function oS($,X,J=!1){return!X.length||X.some((Q)=>Q==="array"?Array.isArray($):Q==="object"?$&&typeof $=="object"&&!Array.isArray($):typeof $==Q||J&&typeof $>"u")}HO.validSchemaType=oS;function tS({schema:$,opts:X,self:J,errSchemaPath:Q},z,Y){if(Array.isArray(z.keyword)?!z.keyword.includes(Y):z.keyword!==Y)throw Error("ajv implementation error");let W=z.dependencies;if(W===null||W===void 0?void 0:W.some((G)=>!Object.prototype.hasOwnProperty.call($,G)))throw Error(`parent schema must have dependencies of ${Y}: ${W.join(",")}`);if(z.validateSchema){if(!z.validateSchema($[Y])){let U=`keyword "${Y}" value is invalid at path "${Q}": `+J.errorsText(z.validateSchema.errors);if(X.validateSchema==="log")J.logger.error(U);else throw Error(U)}}}HO.validateKeywordUsage=tS});var LO=x((DO)=>{Object.defineProperty(DO,"__esModule",{value:!0});DO.extendSubschemaMode=DO.extendSubschemaData=DO.getSubschema=void 0;var i4=s(),jO=Y$();function $R($,{keyword:X,schemaProp:J,schema:Q,schemaPath:z,errSchemaPath:Y,topSchemaRef:W}){if(X!==void 0&&Q!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(X!==void 0){let G=$.schema[X];return J===void 0?{schema:G,schemaPath:i4._`${$.schemaPath}${(0,i4.getProperty)(X)}`,errSchemaPath:`${$.errSchemaPath}/${X}`}:{schema:G[J],schemaPath:i4._`${$.schemaPath}${(0,i4.getProperty)(X)}${(0,i4.getProperty)(J)}`,errSchemaPath:`${$.errSchemaPath}/${X}/${(0,jO.escapeFragment)(J)}`}}if(Q!==void 0){if(z===void 0||Y===void 0||W===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:Q,schemaPath:z,topSchemaRef:W,errSchemaPath:Y}}throw Error('either "keyword" or "schema" must be passed')}DO.getSubschema=$R;function XR($,X,{dataProp:J,dataPropType:Q,data:z,dataTypes:Y,propertyName:W}){if(z!==void 0&&J!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:G}=X;if(J!==void 0){let{errorPath:w,dataPathArr:K,opts:N}=X,H=G.let("data",i4._`${X.data}${(0,i4.getProperty)(J)}`,!0);U(H),$.errorPath=i4.str`${w}${(0,jO.getErrorPath)(J,Q,N.jsPropertySyntax)}`,$.parentDataProperty=i4._`${J}`,$.dataPathArr=[...K,$.parentDataProperty]}if(z!==void 0){let w=z instanceof i4.Name?z:G.let("data",z,!0);if(U(w),W!==void 0)$.propertyName=W}if(Y)$.dataTypes=Y;function U(w){$.data=w,$.dataLevel=X.dataLevel+1,$.dataTypes=[],X.definedProperties=new Set,$.parentData=X.data,$.dataNames=[...X.dataNames,w]}}DO.extendSubschemaData=XR;function JR($,{jtdDiscriminator:X,jtdMetadata:J,compositeRule:Q,createErrors:z,allErrors:Y}){if(Q!==void 0)$.compositeRule=Q;if(z!==void 0)$.createErrors=z;if(Y!==void 0)$.allErrors=Y;$.jtdDiscriminator=X,$.jtdMetadata=J}DO.extendSubschemaMode=JR});var TG=x((Et,FO)=>{FO.exports=function $(X,J){if(X===J)return!0;if(X&&J&&typeof X=="object"&&typeof J=="object"){if(X.constructor!==J.constructor)return!1;var Q,z,Y;if(Array.isArray(X)){if(Q=X.length,Q!=J.length)return!1;for(z=Q;z--!==0;)if(!$(X[z],J[z]))return!1;return!0}if(X.constructor===RegExp)return X.source===J.source&&X.flags===J.flags;if(X.valueOf!==Object.prototype.valueOf)return X.valueOf()===J.valueOf();if(X.toString!==Object.prototype.toString)return X.toString()===J.toString();if(Y=Object.keys(X),Q=Y.length,Q!==Object.keys(J).length)return!1;for(z=Q;z--!==0;)if(!Object.prototype.hasOwnProperty.call(J,Y[z]))return!1;for(z=Q;z--!==0;){var W=Y[z];if(!$(X[W],J[W]))return!1}return!0}return X!==X&&J!==J}});var IO=x((vt,MO)=>{var l6=MO.exports=function($,X,J){if(typeof X=="function")J=X,X={};J=X.cb||J;var Q=typeof J=="function"?J:J.pre||function(){},z=J.post||function(){};HQ(X,Q,z,$,"",$)};l6.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};l6.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};l6.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};l6.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 HQ($,X,J,Q,z,Y,W,G,U,w){if(Q&&typeof Q=="object"&&!Array.isArray(Q)){X(Q,z,Y,W,G,U,w);for(var K in Q){var N=Q[K];if(Array.isArray(N)){if(K in l6.arrayKeywords)for(var H=0;H<N.length;H++)HQ($,X,J,N[H],z+"/"+K+"/"+H,Y,z,K,Q,H)}else if(K in l6.propsKeywords){if(N&&typeof N=="object")for(var V in N)HQ($,X,J,N[V],z+"/"+K+"/"+YR(V),Y,z,K,Q,V)}else if(K in l6.keywords||$.allKeys&&!(K in l6.skipKeywords))HQ($,X,J,N,z+"/"+K,Y,z,K,Q)}J(Q,z,Y,W,G,U,w)}}function YR($){return $.replace(/~/g,"~0").replace(/\//g,"~1")}});var H8=x((ZO)=>{Object.defineProperty(ZO,"__esModule",{value:!0});ZO.getSchemaRefs=ZO.resolveUrl=ZO.normalizeId=ZO._getFullPath=ZO.getFullPath=ZO.inlineRef=void 0;var WR=Y$(),GR=TG(),UR=IO(),wR=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function KR($,X=!0){if(typeof $=="boolean")return!0;if(X===!0)return!fG($);if(!X)return!1;return AO($)<=X}ZO.inlineRef=KR;var NR=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function fG($){for(let X in $){if(NR.has(X))return!0;let J=$[X];if(Array.isArray(J)&&J.some(fG))return!0;if(typeof J=="object"&&fG(J))return!0}return!1}function AO($){let X=0;for(let J in $){if(J==="$ref")return 1/0;if(X++,wR.has(J))continue;if(typeof $[J]=="object")(0,WR.eachItem)($[J],(Q)=>X+=AO(Q));if(X===1/0)return 1/0}return X}function bO($,X="",J){if(J!==!1)X=v0(X);let Q=$.parse(X);return PO($,Q)}ZO.getFullPath=bO;function PO($,X){return $.serialize(X).split("#")[0]+"#"}ZO._getFullPath=PO;var VR=/#\/?$/;function v0($){return $?$.replace(VR,""):""}ZO.normalizeId=v0;function HR($,X,J){return J=v0(J),$.resolve(X,J)}ZO.resolveUrl=HR;var OR=/^[a-z_][-a-z0-9._]*$/i;function BR($,X){if(typeof $=="boolean")return{};let{schemaId:J,uriResolver:Q}=this.opts,z=v0($[J]||X),Y={"":z},W=bO(Q,z,!1),G={},U=new Set;return UR($,{allKeys:!0},(N,H,V,O)=>{if(O===void 0)return;let B=W+H,L=Y[O];if(typeof N[J]=="string")L=F.call(this,N[J]);Z.call(this,N.$anchor),Z.call(this,N.$dynamicAnchor),Y[H]=L;function F(C){let m=this.opts.uriResolver.resolve;if(C=v0(L?m(L,C):C),U.has(C))throw K(C);U.add(C);let c=this.refs[C];if(typeof c=="string")c=this.refs[c];if(typeof c=="object")w(N,c.schema,C);else if(C!==v0(B))if(C[0]==="#")w(N,G[C],C),G[C]=N;else this.refs[C]=B;return C}function Z(C){if(typeof C=="string"){if(!OR.test(C))throw Error(`invalid anchor "${C}"`);F.call(this,`#${C}`)}}}),G;function w(N,H,V){if(H!==void 0&&!GR(N,H))throw K(V)}function K(N){return Error(`reference "${N}" resolves to more than one schema`)}}ZO.getSchemaRefs=BR});var j8=x((mO)=>{Object.defineProperty(mO,"__esModule",{value:!0});mO.getData=mO.KeywordCxt=mO.validateFunctionCode=void 0;var kO=nH(),RO=V8(),yG=RG(),OQ=V8(),MR=WO(),B8=BO(),gG=LO(),u=s(),r=N6(),IR=H8(),V6=Y$(),O8=N8();function AR($){if(TO($)){if(fO($),xO($)){ZR($);return}}_O($,()=>(0,kO.topBoolOrEmptySchema)($))}mO.validateFunctionCode=AR;function _O({gen:$,validateName:X,schema:J,schemaEnv:Q,opts:z},Y){if(z.code.es5)$.func(X,u._`${r.default.data}, ${r.default.valCxt}`,Q.$async,()=>{$.code(u._`"use strict"; ${EO(J,z)}`),PR($,z),$.code(Y)});else $.func(X,u._`${r.default.data}, ${bR(z)}`,Q.$async,()=>$.code(EO(J,z)).code(Y))}function bR($){return u._`{${r.default.instancePath}="", ${r.default.parentData}, ${r.default.parentDataProperty}, ${r.default.rootData}=${r.default.data}${$.dynamicRef?u._`, ${r.default.dynamicAnchors}={}`:u.nil}}={}`}function PR($,X){$.if(r.default.valCxt,()=>{if($.var(r.default.instancePath,u._`${r.default.valCxt}.${r.default.instancePath}`),$.var(r.default.parentData,u._`${r.default.valCxt}.${r.default.parentData}`),$.var(r.default.parentDataProperty,u._`${r.default.valCxt}.${r.default.parentDataProperty}`),$.var(r.default.rootData,u._`${r.default.valCxt}.${r.default.rootData}`),X.dynamicRef)$.var(r.default.dynamicAnchors,u._`${r.default.valCxt}.${r.default.dynamicAnchors}`)},()=>{if($.var(r.default.instancePath,u._`""`),$.var(r.default.parentData,u._`undefined`),$.var(r.default.parentDataProperty,u._`undefined`),$.var(r.default.rootData,r.default.data),X.dynamicRef)$.var(r.default.dynamicAnchors,u._`{}`)})}function ZR($){let{schema:X,opts:J,gen:Q}=$;_O($,()=>{if(J.$comment&&X.$comment)yO($);if(CR($),Q.let(r.default.vErrors,null),Q.let(r.default.errors,0),J.unevaluated)SR($);gO($),xR($)});return}function SR($){let{gen:X,validateName:J}=$;$.evaluated=X.const("evaluated",u._`${J}.evaluated`),X.if(u._`${$.evaluated}.dynamicProps`,()=>X.assign(u._`${$.evaluated}.props`,u._`undefined`)),X.if(u._`${$.evaluated}.dynamicItems`,()=>X.assign(u._`${$.evaluated}.items`,u._`undefined`))}function EO($,X){let J=typeof $=="object"&&$[X.schemaId];return J&&(X.code.source||X.code.process)?u._`/*# sourceURL=${J} */`:u.nil}function RR($,X){if(TO($)){if(fO($),xO($)){ER($,X);return}}(0,kO.boolOrEmptySchema)($,X)}function xO({schema:$,self:X}){if(typeof $=="boolean")return!$;for(let J in $)if(X.RULES.all[J])return!0;return!1}function TO($){return typeof $.schema!="boolean"}function ER($,X){let{schema:J,gen:Q,opts:z}=$;if(z.$comment&&J.$comment)yO($);kR($),_R($);let Y=Q.const("_errs",r.default.errors);gO($,Y),Q.var(X,u._`${Y} === ${r.default.errors}`)}function fO($){(0,V6.checkUnknownRules)($),vR($)}function gO($,X){if($.opts.jtd)return vO($,[],!1,X);let J=(0,RO.getSchemaTypes)($.schema),Q=(0,RO.coerceAndCheckDataType)($,J);vO($,J,!Q,X)}function vR($){let{schema:X,errSchemaPath:J,opts:Q,self:z}=$;if(X.$ref&&Q.ignoreKeywordsWithRef&&(0,V6.schemaHasRulesButRef)(X,z.RULES))z.logger.warn(`$ref: keywords ignored in schema at path "${J}"`)}function CR($){let{schema:X,opts:J}=$;if(X.default!==void 0&&J.useDefaults&&J.strictSchema)(0,V6.checkStrictMode)($,"default is ignored in the schema root")}function kR($){let X=$.schema[$.opts.schemaId];if(X)$.baseId=(0,IR.resolveUrl)($.opts.uriResolver,$.baseId,X)}function _R($){if($.schema.$async&&!$.schemaEnv.$async)throw Error("async schema in sync schema")}function yO({gen:$,schemaEnv:X,schema:J,errSchemaPath:Q,opts:z}){let Y=J.$comment;if(z.$comment===!0)$.code(u._`${r.default.self}.logger.log(${Y})`);else if(typeof z.$comment=="function"){let W=u.str`${Q}/$comment`,G=$.scopeValue("root",{ref:X.root});$.code(u._`${r.default.self}.opts.$comment(${Y}, ${W}, ${G}.schema)`)}}function xR($){let{gen:X,schemaEnv:J,validateName:Q,ValidationError:z,opts:Y}=$;if(J.$async)X.if(u._`${r.default.errors} === 0`,()=>X.return(r.default.data),()=>X.throw(u._`new ${z}(${r.default.vErrors})`));else{if(X.assign(u._`${Q}.errors`,r.default.vErrors),Y.unevaluated)TR($);X.return(u._`${r.default.errors} === 0`)}}function TR({gen:$,evaluated:X,props:J,items:Q}){if(J instanceof u.Name)$.assign(u._`${X}.props`,J);if(Q instanceof u.Name)$.assign(u._`${X}.items`,Q)}function vO($,X,J,Q){let{gen:z,schema:Y,data:W,allErrors:G,opts:U,self:w}=$,{RULES:K}=w;if(Y.$ref&&(U.ignoreKeywordsWithRef||!(0,V6.schemaHasRulesButRef)(Y,K))){z.block(()=>uO($,"$ref",K.all.$ref.definition));return}if(!U.jtd)fR($,X);z.block(()=>{for(let H of K.rules)N(H);N(K.post)});function N(H){if(!(0,yG.shouldUseGroup)(Y,H))return;if(H.type){if(z.if((0,OQ.checkDataType)(H.type,W,U.strictNumbers)),CO($,H),X.length===1&&X[0]===H.type&&J)z.else(),(0,OQ.reportTypeError)($);z.endIf()}else CO($,H);if(!G)z.if(u._`${r.default.errors} === ${Q||0}`)}}function CO($,X){let{gen:J,schema:Q,opts:{useDefaults:z}}=$;if(z)(0,MR.assignDefaults)($,X.type);J.block(()=>{for(let Y of X.rules)if((0,yG.shouldUseRule)(Q,Y))uO($,Y.keyword,Y.definition,X.type)})}function fR($,X){if($.schemaEnv.meta||!$.opts.strictTypes)return;if(gR($,X),!$.opts.allowUnionTypes)yR($,X);hR($,$.dataTypes)}function gR($,X){if(!X.length)return;if(!$.dataTypes.length){$.dataTypes=X;return}X.forEach((J)=>{if(!hO($.dataTypes,J))hG($,`type "${J}" not allowed by context "${$.dataTypes.join(",")}"`)}),lR($,X)}function yR($,X){if(X.length>1&&!(X.length===2&&X.includes("null")))hG($,"use allowUnionTypes to allow union type keyword")}function hR($,X){let J=$.self.RULES.all;for(let Q in J){let z=J[Q];if(typeof z=="object"&&(0,yG.shouldUseRule)($.schema,z)){let{type:Y}=z.definition;if(Y.length&&!Y.some((W)=>uR(X,W)))hG($,`missing type "${Y.join(",")}" for keyword "${Q}"`)}}}function uR($,X){return $.includes(X)||X==="number"&&$.includes("integer")}function hO($,X){return $.includes(X)||X==="integer"&&$.includes("number")}function lR($,X){let J=[];for(let Q of $.dataTypes)if(hO(X,Q))J.push(Q);else if(X.includes("integer")&&Q==="number")J.push("integer");$.dataTypes=J}function hG($,X){let J=$.schemaEnv.baseId+$.errSchemaPath;X+=` at "${J}" (strictTypes)`,(0,V6.checkStrictMode)($,X,$.opts.strictTypes)}class uG{constructor($,X,J){if((0,B8.validateKeywordUsage)($,X,J),this.gen=$.gen,this.allErrors=$.allErrors,this.keyword=J,this.data=$.data,this.schema=$.schema[J],this.$data=X.$data&&$.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,V6.schemaRefOrVal)($,this.schema,J,this.$data),this.schemaType=X.schemaType,this.parentSchema=$.schema,this.params={},this.it=$,this.def=X,this.$data)this.schemaCode=$.gen.const("vSchema",lO(this.$data,$));else if(this.schemaCode=this.schemaValue,!(0,B8.validSchemaType)(this.schema,X.schemaType,X.allowUndefined))throw Error(`${J} value must be ${JSON.stringify(X.schemaType)}`);if("code"in X?X.trackErrors:X.errors!==!1)this.errsCount=$.gen.const("_errs",r.default.errors)}result($,X,J){this.failResult((0,u.not)($),X,J)}failResult($,X,J){if(this.gen.if($),J)J();else this.error();if(X){if(this.gen.else(),X(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass($,X){this.failResult((0,u.not)($),void 0,X)}fail($){if($===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if($),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data($){if(!this.$data)return this.fail($);let{schemaCode:X}=this;this.fail(u._`${X} !== undefined && (${(0,u.or)(this.invalid$data(),$)})`)}error($,X,J){if(X){this.setParams(X),this._error($,J),this.setParams({});return}this._error($,J)}_error($,X){($?O8.reportExtraError:O8.reportError)(this,this.def.error,X)}$dataError(){(0,O8.reportError)(this,this.def.$dataError||O8.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,O8.resetErrorsCount)(this.gen,this.errsCount)}ok($){if(!this.allErrors)this.gen.if($)}setParams($,X){if(X)Object.assign(this.params,$);else this.params=$}block$data($,X,J=u.nil){this.gen.block(()=>{this.check$data($,J),X()})}check$data($=u.nil,X=u.nil){if(!this.$data)return;let{gen:J,schemaCode:Q,schemaType:z,def:Y}=this;if(J.if((0,u.or)(u._`${Q} === undefined`,X)),$!==u.nil)J.assign($,!0);if(z.length||Y.validateSchema){if(J.elseIf(this.invalid$data()),this.$dataError(),$!==u.nil)J.assign($,!1)}J.else()}invalid$data(){let{gen:$,schemaCode:X,schemaType:J,def:Q,it:z}=this;return(0,u.or)(Y(),W());function Y(){if(J.length){if(!(X instanceof u.Name))throw Error("ajv implementation error");let G=Array.isArray(J)?J:[J];return u._`${(0,OQ.checkDataTypes)(G,X,z.opts.strictNumbers,OQ.DataType.Wrong)}`}return u.nil}function W(){if(Q.validateSchema){let G=$.scopeValue("validate$data",{ref:Q.validateSchema});return u._`!${G}(${X})`}return u.nil}}subschema($,X){let J=(0,gG.getSubschema)(this.it,$);(0,gG.extendSubschemaData)(J,this.it,$),(0,gG.extendSubschemaMode)(J,$);let Q={...this.it,...J,items:void 0,props:void 0};return RR(Q,X),Q}mergeEvaluated($,X){let{it:J,gen:Q}=this;if(!J.opts.unevaluated)return;if(J.props!==!0&&$.props!==void 0)J.props=V6.mergeEvaluated.props(Q,$.props,J.props,X);if(J.items!==!0&&$.items!==void 0)J.items=V6.mergeEvaluated.items(Q,$.items,J.items,X)}mergeValidEvaluated($,X){let{it:J,gen:Q}=this;if(J.opts.unevaluated&&(J.props!==!0||J.items!==!0))return Q.if(X,()=>this.mergeEvaluated($,u.Name)),!0}}mO.KeywordCxt=uG;function uO($,X,J,Q){let z=new uG($,J,X);if("code"in J)J.code(z,Q);else if(z.$data&&J.validate)(0,B8.funcKeywordCode)(z,J);else if("macro"in J)(0,B8.macroKeywordCode)(z,J);else if(J.compile||J.validate)(0,B8.funcKeywordCode)(z,J)}var mR=/^\/(?:[^~]|~0|~1)*$/,cR=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function lO($,{dataLevel:X,dataNames:J,dataPathArr:Q}){let z,Y;if($==="")return r.default.rootData;if($[0]==="/"){if(!mR.test($))throw Error(`Invalid JSON-pointer: ${$}`);z=$,Y=r.default.rootData}else{let w=cR.exec($);if(!w)throw Error(`Invalid JSON-pointer: ${$}`);let K=+w[1];if(z=w[2],z==="#"){if(K>=X)throw Error(U("property/index",K));return Q[X-K]}if(K>X)throw Error(U("data",K));if(Y=J[X-K],!z)return Y}let W=Y,G=z.split("/");for(let w of G)if(w)Y=u._`${Y}${(0,u.getProperty)((0,V6.unescapeJsonPointer)(w))}`,W=u._`${W} && ${Y}`;return W;function U(w,K){return`Cannot access ${w} ${K} levels up, current level is ${X}`}}mO.getData=lO});var BQ=x((nO)=>{Object.defineProperty(nO,"__esModule",{value:!0});class iO extends Error{constructor($){super("validation failed");this.errors=$,this.ajv=this.validation=!0}}nO.default=iO});var D8=x((dO)=>{Object.defineProperty(dO,"__esModule",{value:!0});var lG=H8();class pO extends Error{constructor($,X,J,Q){super(Q||`can't resolve reference ${J} from id ${X}`);this.missingRef=(0,lG.resolveUrl)($,X,J),this.missingSchema=(0,lG.normalizeId)((0,lG.getFullPath)($,this.missingRef))}}dO.default=pO});var DQ=x((tO)=>{Object.defineProperty(tO,"__esModule",{value:!0});tO.resolveSchema=tO.getCompilingSchema=tO.resolveRef=tO.compileSchema=tO.SchemaEnv=void 0;var T4=s(),rR=BQ(),A1=N6(),f4=H8(),rO=Y$(),oR=j8();class q8{constructor($){var X;this.refs={},this.dynamicAnchors={};let J;if(typeof $.schema=="object")J=$.schema;this.schema=$.schema,this.schemaId=$.schemaId,this.root=$.root||this,this.baseId=(X=$.baseId)!==null&&X!==void 0?X:(0,f4.normalizeId)(J===null||J===void 0?void 0:J[$.schemaId||"$id"]),this.schemaPath=$.schemaPath,this.localRefs=$.localRefs,this.meta=$.meta,this.$async=J===null||J===void 0?void 0:J.$async,this.refs={}}}tO.SchemaEnv=q8;function cG($){let X=oO.call(this,$);if(X)return X;let J=(0,f4.getFullPath)(this.opts.uriResolver,$.root.baseId),{es5:Q,lines:z}=this.opts.code,{ownProperties:Y}=this.opts,W=new T4.CodeGen(this.scope,{es5:Q,lines:z,ownProperties:Y}),G;if($.$async)G=W.scopeValue("Error",{ref:rR.default,code:T4._`require("ajv/dist/runtime/validation_error").default`});let U=W.scopeName("validate");$.validateName=U;let w={gen:W,allErrors:this.opts.allErrors,data:A1.default.data,parentData:A1.default.parentData,parentDataProperty:A1.default.parentDataProperty,dataNames:[A1.default.data],dataPathArr:[T4.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:W.scopeValue("schema",this.opts.code.source===!0?{ref:$.schema,code:(0,T4.stringify)($.schema)}:{ref:$.schema}),validateName:U,ValidationError:G,schema:$.schema,schemaEnv:$,rootId:J,baseId:$.baseId||J,schemaPath:T4.nil,errSchemaPath:$.schemaPath||(this.opts.jtd?"":"#"),errorPath:T4._`""`,opts:this.opts,self:this},K;try{this._compilations.add($),(0,oR.validateFunctionCode)(w),W.optimize(this.opts.code.optimize);let N=W.toString();if(K=`${W.scopeRefs(A1.default.scope)}return ${N}`,this.opts.code.process)K=this.opts.code.process(K,$);let V=Function(`${A1.default.self}`,`${A1.default.scope}`,K)(this,this.scope.get());if(this.scope.value(U,{ref:V}),V.errors=null,V.schema=$.schema,V.schemaEnv=$,$.$async)V.$async=!0;if(this.opts.code.source===!0)V.source={validateName:U,validateCode:N,scopeValues:W._values};if(this.opts.unevaluated){let{props:O,items:B}=w;if(V.evaluated={props:O instanceof T4.Name?void 0:O,items:B instanceof T4.Name?void 0:B,dynamicProps:O instanceof T4.Name,dynamicItems:B instanceof T4.Name},V.source)V.source.evaluated=(0,T4.stringify)(V.evaluated)}return $.validate=V,$}catch(N){if(delete $.validate,delete $.validateName,K)this.logger.error("Error compiling schema, function code:",K);throw N}finally{this._compilations.delete($)}}tO.compileSchema=cG;function tR($,X,J){var Q;J=(0,f4.resolveUrl)(this.opts.uriResolver,X,J);let z=$.refs[J];if(z)return z;let Y=eR.call(this,$,J);if(Y===void 0){let W=(Q=$.localRefs)===null||Q===void 0?void 0:Q[J],{schemaId:G}=this.opts;if(W)Y=new q8({schema:W,schemaId:G,root:$,baseId:X})}if(Y===void 0)return;return $.refs[J]=aR.call(this,Y)}tO.resolveRef=tR;function aR($){if((0,f4.inlineRef)($.schema,this.opts.inlineRefs))return $.schema;return $.validate?$:cG.call(this,$)}function oO($){for(let X of this._compilations)if(sR(X,$))return X}tO.getCompilingSchema=oO;function sR($,X){return $.schema===X.schema&&$.root===X.root&&$.baseId===X.baseId}function eR($,X){let J;while(typeof(J=this.refs[X])=="string")X=J;return J||this.schemas[X]||jQ.call(this,$,X)}function jQ($,X){let J=this.opts.uriResolver.parse(X),Q=(0,f4._getFullPath)(this.opts.uriResolver,J),z=(0,f4.getFullPath)(this.opts.uriResolver,$.baseId,void 0);if(Object.keys($.schema).length>0&&Q===z)return mG.call(this,J,$);let Y=(0,f4.normalizeId)(Q),W=this.refs[Y]||this.schemas[Y];if(typeof W=="string"){let G=jQ.call(this,$,W);if(typeof(G===null||G===void 0?void 0:G.schema)!=="object")return;return mG.call(this,J,G)}if(typeof(W===null||W===void 0?void 0:W.schema)!=="object")return;if(!W.validate)cG.call(this,W);if(Y===(0,f4.normalizeId)(X)){let{schema:G}=W,{schemaId:U}=this.opts,w=G[U];if(w)z=(0,f4.resolveUrl)(this.opts.uriResolver,z,w);return new q8({schema:G,schemaId:U,root:$,baseId:z})}return mG.call(this,J,W)}tO.resolveSchema=jQ;var $E=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function mG($,{baseId:X,schema:J,root:Q}){var z;if(((z=$.fragment)===null||z===void 0?void 0:z[0])!=="/")return;for(let G of $.fragment.slice(1).split("/")){if(typeof J==="boolean")return;let U=J[(0,rO.unescapeFragment)(G)];if(U===void 0)return;J=U;let w=typeof J==="object"&&J[this.opts.schemaId];if(!$E.has(G)&&w)X=(0,f4.resolveUrl)(this.opts.uriResolver,X,w)}let Y;if(typeof J!="boolean"&&J.$ref&&!(0,rO.schemaHasRulesButRef)(J,this.RULES)){let G=(0,f4.resolveUrl)(this.opts.uriResolver,X,J.$ref);Y=jQ.call(this,Q,G)}let{schemaId:W}=this.opts;if(Y=Y||new q8({schema:J,schemaId:W,root:Q,baseId:X}),Y.schema!==Y.root.schema)return Y;return}});var sO=x((ft,YE)=>{YE.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 $B=x((gt,eO)=>{var WE={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};eO.exports={HEX:WE}});var UB=x((yt,GB)=>{var{HEX:GE}=$B(),UE=/^(?:(?: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;function QB($){if(WB($,".")<3)return{host:$,isIPV4:!1};let X=$.match(UE)||[],[J]=X;if(J)return{host:KE(J,"."),isIPV4:!0};else return{host:$,isIPV4:!1}}function iG($,X=!1){let J="",Q=!0;for(let z of $){if(GE[z]===void 0)return;if(z!=="0"&&Q===!0)Q=!1;if(!Q)J+=z}if(X&&J.length===0)J="0";return J}function wE($){let X=0,J={error:!1,address:"",zone:""},Q=[],z=[],Y=!1,W=!1,G=!1;function U(){if(z.length){if(Y===!1){let w=iG(z);if(w!==void 0)Q.push(w);else return J.error=!0,!1}z.length=0}return!0}for(let w=0;w<$.length;w++){let K=$[w];if(K==="["||K==="]")continue;if(K===":"){if(W===!0)G=!0;if(!U())break;if(X++,Q.push(":"),X>7){J.error=!0;break}if(w-1>=0&&$[w-1]===":")W=!0;continue}else if(K==="%"){if(!U())break;Y=!0}else{z.push(K);continue}}if(z.length)if(Y)J.zone=z.join("");else if(G)Q.push(z.join(""));else Q.push(iG(z));return J.address=Q.join(""),J}function YB($){if(WB($,":")<2)return{host:$,isIPV6:!1};let X=wE($);if(!X.error){let{address:J,address:Q}=X;if(X.zone)J+="%"+X.zone,Q+="%25"+X.zone;return{host:J,escapedHost:Q,isIPV6:!0}}else return{host:$,isIPV6:!1}}function KE($,X){let J="",Q=!0,z=$.length;for(let Y=0;Y<z;Y++){let W=$[Y];if(W==="0"&&Q){if(Y+1<=z&&$[Y+1]===X||Y+1===z)J+=W,Q=!1}else{if(W===X)Q=!0;else Q=!1;J+=W}}return J}function WB($,X){let J=0;for(let Q=0;Q<$.length;Q++)if($[Q]===X)J++;return J}var XB=/^\.\.?\//u,JB=/^\/\.(?:\/|$)/u,zB=/^\/\.\.(?:\/|$)/u,NE=/^\/?(?:.|\n)*?(?=\/|$)/u;function VE($){let X=[];while($.length)if($.match(XB))$=$.replace(XB,"");else if($.match(JB))$=$.replace(JB,"/");else if($.match(zB))$=$.replace(zB,"/"),X.pop();else if($==="."||$==="..")$="";else{let J=$.match(NE);if(J){let Q=J[0];$=$.slice(Q.length),X.push(Q)}else throw Error("Unexpected dot segment condition")}return X.join("")}function HE($,X){let J=X!==!0?escape:unescape;if($.scheme!==void 0)$.scheme=J($.scheme);if($.userinfo!==void 0)$.userinfo=J($.userinfo);if($.host!==void 0)$.host=J($.host);if($.path!==void 0)$.path=J($.path);if($.query!==void 0)$.query=J($.query);if($.fragment!==void 0)$.fragment=J($.fragment);return $}function OE($){let X=[];if($.userinfo!==void 0)X.push($.userinfo),X.push("@");if($.host!==void 0){let J=unescape($.host),Q=QB(J);if(Q.isIPV4)J=Q.host;else{let z=YB(Q.host);if(z.isIPV6===!0)J=`[${z.escapedHost}]`;else J=$.host}X.push(J)}if(typeof $.port==="number"||typeof $.port==="string")X.push(":"),X.push(String($.port));return X.length?X.join(""):void 0}GB.exports={recomposeAuthority:OE,normalizeComponentEncoding:HE,removeDotSegments:VE,normalizeIPv4:QB,normalizeIPv6:YB,stringArrayToHexStripped:iG}});var OB=x((ht,HB)=>{var BE=/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu,jE=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function wB($){return typeof $.secure==="boolean"?$.secure:String($.scheme).toLowerCase()==="wss"}function KB($){if(!$.host)$.error=$.error||"HTTP URIs must have a host.";return $}function NB($){let X=String($.scheme).toLowerCase()==="https";if($.port===(X?443:80)||$.port==="")$.port=void 0;if(!$.path)$.path="/";return $}function DE($){return $.secure=wB($),$.resourceName=($.path||"/")+($.query?"?"+$.query:""),$.path=void 0,$.query=void 0,$}function qE($){if($.port===(wB($)?443:80)||$.port==="")$.port=void 0;if(typeof $.secure==="boolean")$.scheme=$.secure?"wss":"ws",$.secure=void 0;if($.resourceName){let[X,J]=$.resourceName.split("?");$.path=X&&X!=="/"?X:void 0,$.query=J,$.resourceName=void 0}return $.fragment=void 0,$}function LE($,X){if(!$.path)return $.error="URN can not be parsed",$;let J=$.path.match(jE);if(J){let Q=X.scheme||$.scheme||"urn";$.nid=J[1].toLowerCase(),$.nss=J[2];let z=`${Q}:${X.nid||$.nid}`,Y=nG[z];if($.path=void 0,Y)$=Y.parse($,X)}else $.error=$.error||"URN can not be parsed.";return $}function FE($,X){let J=X.scheme||$.scheme||"urn",Q=$.nid.toLowerCase(),z=`${J}:${X.nid||Q}`,Y=nG[z];if(Y)$=Y.serialize($,X);let W=$,G=$.nss;return W.path=`${Q||X.nid}:${G}`,X.skipEscape=!0,W}function ME($,X){let J=$;if(J.uuid=J.nss,J.nss=void 0,!X.tolerant&&(!J.uuid||!BE.test(J.uuid)))J.error=J.error||"UUID is not valid.";return J}function IE($){let X=$;return X.nss=($.uuid||"").toLowerCase(),X}var VB={scheme:"http",domainHost:!0,parse:KB,serialize:NB},AE={scheme:"https",domainHost:VB.domainHost,parse:KB,serialize:NB},qQ={scheme:"ws",domainHost:!0,parse:DE,serialize:qE},bE={scheme:"wss",domainHost:qQ.domainHost,parse:qQ.parse,serialize:qQ.serialize},PE={scheme:"urn",parse:LE,serialize:FE,skipNormalize:!0},ZE={scheme:"urn:uuid",parse:ME,serialize:IE,skipNormalize:!0},nG={http:VB,https:AE,ws:qQ,wss:bE,urn:PE,"urn:uuid":ZE};HB.exports=nG});var jB=x((ut,FQ)=>{var{normalizeIPv6:SE,normalizeIPv4:RE,removeDotSegments:L8,recomposeAuthority:EE,normalizeComponentEncoding:LQ}=UB(),pG=OB();function vE($,X){if(typeof $==="string")$=n4(H6($,X),X);else if(typeof $==="object")$=H6(n4($,X),X);return $}function CE($,X,J){let Q=Object.assign({scheme:"null"},J),z=BB(H6($,Q),H6(X,Q),Q,!0);return n4(z,{...Q,skipEscape:!0})}function BB($,X,J,Q){let z={};if(!Q)$=H6(n4($,J),J),X=H6(n4(X,J),J);if(J=J||{},!J.tolerant&&X.scheme)z.scheme=X.scheme,z.userinfo=X.userinfo,z.host=X.host,z.port=X.port,z.path=L8(X.path||""),z.query=X.query;else{if(X.userinfo!==void 0||X.host!==void 0||X.port!==void 0)z.userinfo=X.userinfo,z.host=X.host,z.port=X.port,z.path=L8(X.path||""),z.query=X.query;else{if(!X.path)if(z.path=$.path,X.query!==void 0)z.query=X.query;else z.query=$.query;else{if(X.path.charAt(0)==="/")z.path=L8(X.path);else{if(($.userinfo!==void 0||$.host!==void 0||$.port!==void 0)&&!$.path)z.path="/"+X.path;else if(!$.path)z.path=X.path;else z.path=$.path.slice(0,$.path.lastIndexOf("/")+1)+X.path;z.path=L8(z.path)}z.query=X.query}z.userinfo=$.userinfo,z.host=$.host,z.port=$.port}z.scheme=$.scheme}return z.fragment=X.fragment,z}function kE($,X,J){if(typeof $==="string")$=unescape($),$=n4(LQ(H6($,J),!0),{...J,skipEscape:!0});else if(typeof $==="object")$=n4(LQ($,!0),{...J,skipEscape:!0});if(typeof X==="string")X=unescape(X),X=n4(LQ(H6(X,J),!0),{...J,skipEscape:!0});else if(typeof X==="object")X=n4(LQ(X,!0),{...J,skipEscape:!0});return $.toLowerCase()===X.toLowerCase()}function n4($,X){let J={host:$.host,scheme:$.scheme,userinfo:$.userinfo,port:$.port,path:$.path,query:$.query,nid:$.nid,nss:$.nss,uuid:$.uuid,fragment:$.fragment,reference:$.reference,resourceName:$.resourceName,secure:$.secure,error:""},Q=Object.assign({},X),z=[],Y=pG[(Q.scheme||J.scheme||"").toLowerCase()];if(Y&&Y.serialize)Y.serialize(J,Q);if(J.path!==void 0)if(!Q.skipEscape){if(J.path=escape(J.path),J.scheme!==void 0)J.path=J.path.split("%3A").join(":")}else J.path=unescape(J.path);if(Q.reference!=="suffix"&&J.scheme)z.push(J.scheme,":");let W=EE(J);if(W!==void 0){if(Q.reference!=="suffix")z.push("//");if(z.push(W),J.path&&J.path.charAt(0)!=="/")z.push("/")}if(J.path!==void 0){let G=J.path;if(!Q.absolutePath&&(!Y||!Y.absolutePath))G=L8(G);if(W===void 0)G=G.replace(/^\/\//u,"/%2F");z.push(G)}if(J.query!==void 0)z.push("?",J.query);if(J.fragment!==void 0)z.push("#",J.fragment);return z.join("")}var _E=Array.from({length:127},($,X)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(X)));function xE($){let X=0;for(let J=0,Q=$.length;J<Q;++J)if(X=$.charCodeAt(J),X>126||_E[X])return!0;return!1}var TE=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function H6($,X){let J=Object.assign({},X),Q={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},z=$.indexOf("%")!==-1,Y=!1;if(J.reference==="suffix")$=(J.scheme?J.scheme+":":"")+"//"+$;let W=$.match(TE);if(W){if(Q.scheme=W[1],Q.userinfo=W[3],Q.host=W[4],Q.port=parseInt(W[5],10),Q.path=W[6]||"",Q.query=W[7],Q.fragment=W[8],isNaN(Q.port))Q.port=W[5];if(Q.host){let U=RE(Q.host);if(U.isIPV4===!1){let w=SE(U.host);Q.host=w.host.toLowerCase(),Y=w.isIPV6}else Q.host=U.host,Y=!0}if(Q.scheme===void 0&&Q.userinfo===void 0&&Q.host===void 0&&Q.port===void 0&&Q.query===void 0&&!Q.path)Q.reference="same-document";else if(Q.scheme===void 0)Q.reference="relative";else if(Q.fragment===void 0)Q.reference="absolute";else Q.reference="uri";if(J.reference&&J.reference!=="suffix"&&J.reference!==Q.reference)Q.error=Q.error||"URI is not a "+J.reference+" reference.";let G=pG[(J.scheme||Q.scheme||"").toLowerCase()];if(!J.unicodeSupport&&(!G||!G.unicodeSupport)){if(Q.host&&(J.domainHost||G&&G.domainHost)&&Y===!1&&xE(Q.host))try{Q.host=URL.domainToASCII(Q.host.toLowerCase())}catch(U){Q.error=Q.error||"Host's domain name can not be converted to ASCII: "+U}}if(!G||G&&!G.skipNormalize){if(z&&Q.scheme!==void 0)Q.scheme=unescape(Q.scheme);if(z&&Q.host!==void 0)Q.host=unescape(Q.host);if(Q.path)Q.path=escape(unescape(Q.path));if(Q.fragment)Q.fragment=encodeURI(decodeURIComponent(Q.fragment))}if(G&&G.parse)G.parse(Q,J)}else Q.error=Q.error||"URI can not be parsed.";return Q}var dG={SCHEMES:pG,normalize:vE,resolve:CE,resolveComponents:BB,equal:kE,serialize:n4,parse:H6};FQ.exports=dG;FQ.exports.default=dG;FQ.exports.fastUri=dG});var LB=x((qB)=>{Object.defineProperty(qB,"__esModule",{value:!0});var DB=jB();DB.code='require("ajv/dist/runtime/uri").default';qB.default=DB});var SB=x((O6)=>{Object.defineProperty(O6,"__esModule",{value:!0});O6.CodeGen=O6.Name=O6.nil=O6.stringify=O6.str=O6._=O6.KeywordCxt=void 0;var gE=j8();Object.defineProperty(O6,"KeywordCxt",{enumerable:!0,get:function(){return gE.KeywordCxt}});var C0=s();Object.defineProperty(O6,"_",{enumerable:!0,get:function(){return C0._}});Object.defineProperty(O6,"str",{enumerable:!0,get:function(){return C0.str}});Object.defineProperty(O6,"stringify",{enumerable:!0,get:function(){return C0.stringify}});Object.defineProperty(O6,"nil",{enumerable:!0,get:function(){return C0.nil}});Object.defineProperty(O6,"Name",{enumerable:!0,get:function(){return C0.Name}});Object.defineProperty(O6,"CodeGen",{enumerable:!0,get:function(){return C0.CodeGen}});var yE=BQ(),bB=D8(),hE=SG(),F8=DQ(),uE=s(),M8=H8(),MQ=V8(),oG=Y$(),FB=sO(),lE=LB(),PB=($,X)=>new RegExp($,X);PB.code="new RegExp";var mE=["removeAdditional","useDefaults","coerceTypes"],cE=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),iE={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."},nE={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},MB=200;function pE($){var X,J,Q,z,Y,W,G,U,w,K,N,H,V,O,B,L,F,Z,C,m,c,v$,H4,Z1,gQ;let g0=$.strict,yQ=(X=$.code)===null||X===void 0?void 0:X.optimize,bU=yQ===!0||yQ===void 0?1:yQ||0,PU=(Q=(J=$.code)===null||J===void 0?void 0:J.regExp)!==null&&Q!==void 0?Q:PB,sD=(z=$.uriResolver)!==null&&z!==void 0?z:lE.default;return{strictSchema:(W=(Y=$.strictSchema)!==null&&Y!==void 0?Y:g0)!==null&&W!==void 0?W:!0,strictNumbers:(U=(G=$.strictNumbers)!==null&&G!==void 0?G:g0)!==null&&U!==void 0?U:!0,strictTypes:(K=(w=$.strictTypes)!==null&&w!==void 0?w:g0)!==null&&K!==void 0?K:"log",strictTuples:(H=(N=$.strictTuples)!==null&&N!==void 0?N:g0)!==null&&H!==void 0?H:"log",strictRequired:(O=(V=$.strictRequired)!==null&&V!==void 0?V:g0)!==null&&O!==void 0?O:!1,code:$.code?{...$.code,optimize:bU,regExp:PU}:{optimize:bU,regExp:PU},loopRequired:(B=$.loopRequired)!==null&&B!==void 0?B:MB,loopEnum:(L=$.loopEnum)!==null&&L!==void 0?L:MB,meta:(F=$.meta)!==null&&F!==void 0?F:!0,messages:(Z=$.messages)!==null&&Z!==void 0?Z:!0,inlineRefs:(C=$.inlineRefs)!==null&&C!==void 0?C:!0,schemaId:(m=$.schemaId)!==null&&m!==void 0?m:"$id",addUsedSchema:(c=$.addUsedSchema)!==null&&c!==void 0?c:!0,validateSchema:(v$=$.validateSchema)!==null&&v$!==void 0?v$:!0,validateFormats:(H4=$.validateFormats)!==null&&H4!==void 0?H4:!0,unicodeRegExp:(Z1=$.unicodeRegExp)!==null&&Z1!==void 0?Z1:!0,int32range:(gQ=$.int32range)!==null&&gQ!==void 0?gQ:!0,uriResolver:sD}}class IQ{constructor($={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,$=this.opts={...$,...pE($)};let{es5:X,lines:J}=this.opts.code;this.scope=new uE.ValueScope({scope:{},prefixes:cE,es5:X,lines:J}),this.logger=sE($.logger);let Q=$.validateFormats;if($.validateFormats=!1,this.RULES=(0,hE.getRules)(),IB.call(this,iE,$,"NOT SUPPORTED"),IB.call(this,nE,$,"DEPRECATED","warn"),this._metaOpts=tE.call(this),$.formats)rE.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),$.keywords)oE.call(this,$.keywords);if(typeof $.meta=="object")this.addMetaSchema($.meta);dE.call(this),$.validateFormats=Q}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:$,meta:X,schemaId:J}=this.opts,Q=FB;if(J==="id")Q={...FB},Q.id=Q.$id,delete Q.$id;if(X&&$)this.addMetaSchema(Q,Q[J],!1)}defaultMeta(){let{meta:$,schemaId:X}=this.opts;return this.opts.defaultMeta=typeof $=="object"?$[X]||$:void 0}validate($,X){let J;if(typeof $=="string"){if(J=this.getSchema($),!J)throw Error(`no schema with key or ref "${$}"`)}else J=this.compile($);let Q=J(X);if(!("$async"in J))this.errors=J.errors;return Q}compile($,X){let J=this._addSchema($,X);return J.validate||this._compileSchemaEnv(J)}compileAsync($,X){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:J}=this.opts;return Q.call(this,$,X);async function Q(w,K){await z.call(this,w.$schema);let N=this._addSchema(w,K);return N.validate||Y.call(this,N)}async function z(w){if(w&&!this.getSchema(w))await Q.call(this,{$ref:w},!0)}async function Y(w){try{return this._compileSchemaEnv(w)}catch(K){if(!(K instanceof bB.default))throw K;return W.call(this,K),await G.call(this,K.missingSchema),Y.call(this,w)}}function W({missingSchema:w,missingRef:K}){if(this.refs[w])throw Error(`AnySchema ${w} is loaded but ${K} cannot be resolved`)}async function G(w){let K=await U.call(this,w);if(!this.refs[w])await z.call(this,K.$schema);if(!this.refs[w])this.addSchema(K,w,X)}async function U(w){let K=this._loading[w];if(K)return K;try{return await(this._loading[w]=J(w))}finally{delete this._loading[w]}}}addSchema($,X,J,Q=this.opts.validateSchema){if(Array.isArray($)){for(let Y of $)this.addSchema(Y,void 0,J,Q);return this}let z;if(typeof $==="object"){let{schemaId:Y}=this.opts;if(z=$[Y],z!==void 0&&typeof z!="string")throw Error(`schema ${Y} must be string`)}return X=(0,M8.normalizeId)(X||z),this._checkUnique(X),this.schemas[X]=this._addSchema($,J,X,Q,!0),this}addMetaSchema($,X,J=this.opts.validateSchema){return this.addSchema($,X,!0,J),this}validateSchema($,X){if(typeof $=="boolean")return!0;let J;if(J=$.$schema,J!==void 0&&typeof J!="string")throw Error("$schema must be a string");if(J=J||this.opts.defaultMeta||this.defaultMeta(),!J)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let Q=this.validate(J,$);if(!Q&&X){let z="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(z);else throw Error(z)}return Q}getSchema($){let X;while(typeof(X=AB.call(this,$))=="string")$=X;if(X===void 0){let{schemaId:J}=this.opts,Q=new F8.SchemaEnv({schema:{},schemaId:J});if(X=F8.resolveSchema.call(this,Q,$),!X)return;this.refs[$]=X}return X.validate||this._compileSchemaEnv(X)}removeSchema($){if($ instanceof RegExp)return this._removeAllSchemas(this.schemas,$),this._removeAllSchemas(this.refs,$),this;switch(typeof $){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let X=AB.call(this,$);if(typeof X=="object")this._cache.delete(X.schema);return delete this.schemas[$],delete this.refs[$],this}case"object":{let X=$;this._cache.delete(X);let J=$[this.opts.schemaId];if(J)J=(0,M8.normalizeId)(J),delete this.schemas[J],delete this.refs[J];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary($){for(let X of $)this.addKeyword(X);return this}addKeyword($,X){let J;if(typeof $=="string"){if(J=$,typeof X=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),X.keyword=J}else if(typeof $=="object"&&X===void 0){if(X=$,J=X.keyword,Array.isArray(J)&&!J.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if($v.call(this,J,X),!X)return(0,oG.eachItem)(J,(z)=>rG.call(this,z)),this;Jv.call(this,X);let Q={...X,type:(0,MQ.getJSONTypes)(X.type),schemaType:(0,MQ.getJSONTypes)(X.schemaType)};return(0,oG.eachItem)(J,Q.type.length===0?(z)=>rG.call(this,z,Q):(z)=>Q.type.forEach((Y)=>rG.call(this,z,Q,Y))),this}getKeyword($){let X=this.RULES.all[$];return typeof X=="object"?X.definition:!!X}removeKeyword($){let{RULES:X}=this;delete X.keywords[$],delete X.all[$];for(let J of X.rules){let Q=J.rules.findIndex((z)=>z.keyword===$);if(Q>=0)J.rules.splice(Q,1)}return this}addFormat($,X){if(typeof X=="string")X=new RegExp(X);return this.formats[$]=X,this}errorsText($=this.errors,{separator:X=", ",dataVar:J="data"}={}){if(!$||$.length===0)return"No errors";return $.map((Q)=>`${J}${Q.instancePath} ${Q.message}`).reduce((Q,z)=>Q+X+z)}$dataMetaSchema($,X){let J=this.RULES.all;$=JSON.parse(JSON.stringify($));for(let Q of X){let z=Q.split("/").slice(1),Y=$;for(let W of z)Y=Y[W];for(let W in J){let G=J[W];if(typeof G!="object")continue;let{$data:U}=G.definition,w=Y[W];if(U&&w)Y[W]=ZB(w)}}return $}_removeAllSchemas($,X){for(let J in $){let Q=$[J];if(!X||X.test(J)){if(typeof Q=="string")delete $[J];else if(Q&&!Q.meta)this._cache.delete(Q.schema),delete $[J]}}}_addSchema($,X,J,Q=this.opts.validateSchema,z=this.opts.addUsedSchema){let Y,{schemaId:W}=this.opts;if(typeof $=="object")Y=$[W];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof $!="boolean")throw Error("schema must be object or boolean");let G=this._cache.get($);if(G!==void 0)return G;J=(0,M8.normalizeId)(Y||J);let U=M8.getSchemaRefs.call(this,$,J);if(G=new F8.SchemaEnv({schema:$,schemaId:W,meta:X,baseId:J,localRefs:U}),this._cache.set(G.schema,G),z&&!J.startsWith("#")){if(J)this._checkUnique(J);this.refs[J]=G}if(Q)this.validateSchema($,!0);return G}_checkUnique($){if(this.schemas[$]||this.refs[$])throw Error(`schema with key or id "${$}" already exists`)}_compileSchemaEnv($){if($.meta)this._compileMetaSchema($);else F8.compileSchema.call(this,$);if(!$.validate)throw Error("ajv implementation error");return $.validate}_compileMetaSchema($){let X=this.opts;this.opts=this._metaOpts;try{F8.compileSchema.call(this,$)}finally{this.opts=X}}}IQ.ValidationError=yE.default;IQ.MissingRefError=bB.default;O6.default=IQ;function IB($,X,J,Q="error"){for(let z in $){let Y=z;if(Y in X)this.logger[Q](`${J}: option ${z}. ${$[Y]}`)}}function AB($){return $=(0,M8.normalizeId)($),this.schemas[$]||this.refs[$]}function dE(){let $=this.opts.schemas;if(!$)return;if(Array.isArray($))this.addSchema($);else for(let X in $)this.addSchema($[X],X)}function rE(){for(let $ in this.opts.formats){let X=this.opts.formats[$];if(X)this.addFormat($,X)}}function oE($){if(Array.isArray($)){this.addVocabulary($);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let X in $){let J=$[X];if(!J.keyword)J.keyword=X;this.addKeyword(J)}}function tE(){let $={...this.opts};for(let X of mE)delete $[X];return $}var aE={log(){},warn(){},error(){}};function sE($){if($===!1)return aE;if($===void 0)return console;if($.log&&$.warn&&$.error)return $;throw Error("logger must implement log, warn and error methods")}var eE=/^[a-z_$][a-z0-9_$:-]*$/i;function $v($,X){let{RULES:J}=this;if((0,oG.eachItem)($,(Q)=>{if(J.keywords[Q])throw Error(`Keyword ${Q} is already defined`);if(!eE.test(Q))throw Error(`Keyword ${Q} has invalid name`)}),!X)return;if(X.$data&&!(("code"in X)||("validate"in X)))throw Error('$data keyword must have "code" or "validate" function')}function rG($,X,J){var Q;let z=X===null||X===void 0?void 0:X.post;if(J&&z)throw Error('keyword with "post" flag cannot have "type"');let{RULES:Y}=this,W=z?Y.post:Y.rules.find(({type:U})=>U===J);if(!W)W={type:J,rules:[]},Y.rules.push(W);if(Y.keywords[$]=!0,!X)return;let G={keyword:$,definition:{...X,type:(0,MQ.getJSONTypes)(X.type),schemaType:(0,MQ.getJSONTypes)(X.schemaType)}};if(X.before)Xv.call(this,W,G,X.before);else W.rules.push(G);Y.all[$]=G,(Q=X.implements)===null||Q===void 0||Q.forEach((U)=>this.addKeyword(U))}function Xv($,X,J){let Q=$.rules.findIndex((z)=>z.keyword===J);if(Q>=0)$.rules.splice(Q,0,X);else $.rules.push(X),this.logger.warn(`rule ${J} is not defined`)}function Jv($){let{metaSchema:X}=$;if(X===void 0)return;if($.$data&&this.opts.$data)X=ZB(X);$.validateSchema=this.compile(X,!0)}var zv={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function ZB($){return{anyOf:[$,zv]}}});var EB=x((RB)=>{Object.defineProperty(RB,"__esModule",{value:!0});var Wv={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};RB.default=Wv});var TB=x((_B)=>{Object.defineProperty(_B,"__esModule",{value:!0});_B.callRef=_B.getValidate=void 0;var Uv=D8(),vB=A4(),z4=s(),k0=N6(),CB=DQ(),AQ=Y$(),wv={keyword:"$ref",schemaType:"string",code($){let{gen:X,schema:J,it:Q}=$,{baseId:z,schemaEnv:Y,validateName:W,opts:G,self:U}=Q,{root:w}=Y;if((J==="#"||J==="#/")&&z===w.baseId)return N();let K=CB.resolveRef.call(U,w,z,J);if(K===void 0)throw new Uv.default(Q.opts.uriResolver,z,J);if(K instanceof CB.SchemaEnv)return H(K);return V(K);function N(){if(Y===w)return bQ($,W,Y,Y.$async);let O=X.scopeValue("root",{ref:w});return bQ($,z4._`${O}.validate`,w,w.$async)}function H(O){let B=kB($,O);bQ($,B,O,O.$async)}function V(O){let B=X.scopeValue("schema",G.code.source===!0?{ref:O,code:(0,z4.stringify)(O)}:{ref:O}),L=X.name("valid"),F=$.subschema({schema:O,dataTypes:[],schemaPath:z4.nil,topSchemaRef:B,errSchemaPath:J},L);$.mergeEvaluated(F),$.ok(L)}}};function kB($,X){let{gen:J}=$;return X.validate?J.scopeValue("validate",{ref:X.validate}):z4._`${J.scopeValue("wrapper",{ref:X})}.validate`}_B.getValidate=kB;function bQ($,X,J,Q){let{gen:z,it:Y}=$,{allErrors:W,schemaEnv:G,opts:U}=Y,w=U.passContext?k0.default.this:z4.nil;if(Q)K();else N();function K(){if(!G.$async)throw Error("async schema referenced by sync schema");let O=z.let("valid");z.try(()=>{if(z.code(z4._`await ${(0,vB.callValidateCode)($,X,w)}`),V(X),!W)z.assign(O,!0)},(B)=>{if(z.if(z4._`!(${B} instanceof ${Y.ValidationError})`,()=>z.throw(B)),H(B),!W)z.assign(O,!1)}),$.ok(O)}function N(){$.result((0,vB.callValidateCode)($,X,w),()=>V(X),()=>H(X))}function H(O){let B=z4._`${O}.errors`;z.assign(k0.default.vErrors,z4._`${k0.default.vErrors} === null ? ${B} : ${k0.default.vErrors}.concat(${B})`),z.assign(k0.default.errors,z4._`${k0.default.vErrors}.length`)}function V(O){var B;if(!Y.opts.unevaluated)return;let L=(B=J===null||J===void 0?void 0:J.validate)===null||B===void 0?void 0:B.evaluated;if(Y.props!==!0)if(L&&!L.dynamicProps){if(L.props!==void 0)Y.props=AQ.mergeEvaluated.props(z,L.props,Y.props)}else{let F=z.var("props",z4._`${O}.evaluated.props`);Y.props=AQ.mergeEvaluated.props(z,F,Y.props,z4.Name)}if(Y.items!==!0)if(L&&!L.dynamicItems){if(L.items!==void 0)Y.items=AQ.mergeEvaluated.items(z,L.items,Y.items)}else{let F=z.var("items",z4._`${O}.evaluated.items`);Y.items=AQ.mergeEvaluated.items(z,F,Y.items,z4.Name)}}}_B.callRef=bQ;_B.default=wv});var gB=x((fB)=>{Object.defineProperty(fB,"__esModule",{value:!0});var Vv=EB(),Hv=TB(),Ov=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Vv.default,Hv.default];fB.default=Ov});var hB=x((yB)=>{Object.defineProperty(yB,"__esModule",{value:!0});var PQ=s(),m6=PQ.operators,ZQ={maximum:{okStr:"<=",ok:m6.LTE,fail:m6.GT},minimum:{okStr:">=",ok:m6.GTE,fail:m6.LT},exclusiveMaximum:{okStr:"<",ok:m6.LT,fail:m6.GTE},exclusiveMinimum:{okStr:">",ok:m6.GT,fail:m6.LTE}},jv={message:({keyword:$,schemaCode:X})=>PQ.str`must be ${ZQ[$].okStr} ${X}`,params:({keyword:$,schemaCode:X})=>PQ._`{comparison: ${ZQ[$].okStr}, limit: ${X}}`},Dv={keyword:Object.keys(ZQ),type:"number",schemaType:"number",$data:!0,error:jv,code($){let{keyword:X,data:J,schemaCode:Q}=$;$.fail$data(PQ._`${J} ${ZQ[X].fail} ${Q} || isNaN(${J})`)}};yB.default=Dv});var lB=x((uB)=>{Object.defineProperty(uB,"__esModule",{value:!0});var I8=s(),Lv={message:({schemaCode:$})=>I8.str`must be multiple of ${$}`,params:({schemaCode:$})=>I8._`{multipleOf: ${$}}`},Fv={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:Lv,code($){let{gen:X,data:J,schemaCode:Q,it:z}=$,Y=z.opts.multipleOfPrecision,W=X.let("res"),G=Y?I8._`Math.abs(Math.round(${W}) - ${W}) > 1e-${Y}`:I8._`${W} !== parseInt(${W})`;$.fail$data(I8._`(${Q} === 0 || (${W} = ${J}/${Q}, ${G}))`)}};uB.default=Fv});var iB=x((cB)=>{Object.defineProperty(cB,"__esModule",{value:!0});function mB($){let X=$.length,J=0,Q=0,z;while(Q<X)if(J++,z=$.charCodeAt(Q++),z>=55296&&z<=56319&&Q<X){if(z=$.charCodeAt(Q),(z&64512)===56320)Q++}return J}cB.default=mB;mB.code='require("ajv/dist/runtime/ucs2length").default'});var pB=x((nB)=>{Object.defineProperty(nB,"__esModule",{value:!0});var b1=s(),Av=Y$(),bv=iB(),Pv={message({keyword:$,schemaCode:X}){let J=$==="maxLength"?"more":"fewer";return b1.str`must NOT have ${J} than ${X} characters`},params:({schemaCode:$})=>b1._`{limit: ${$}}`},Zv={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Pv,code($){let{keyword:X,data:J,schemaCode:Q,it:z}=$,Y=X==="maxLength"?b1.operators.GT:b1.operators.LT,W=z.opts.unicode===!1?b1._`${J}.length`:b1._`${(0,Av.useFunc)($.gen,bv.default)}(${J})`;$.fail$data(b1._`${W} ${Y} ${Q}`)}};nB.default=Zv});var rB=x((dB)=>{Object.defineProperty(dB,"__esModule",{value:!0});var Rv=A4(),Ev=Y$(),_0=s(),vv={message:({schemaCode:$})=>_0.str`must match pattern "${$}"`,params:({schemaCode:$})=>_0._`{pattern: ${$}}`},Cv={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:vv,code($){let{gen:X,data:J,$data:Q,schema:z,schemaCode:Y,it:W}=$,G=W.opts.unicodeRegExp?"u":"";if(Q){let{regExp:U}=W.opts.code,w=U.code==="new RegExp"?_0._`new RegExp`:(0,Ev.useFunc)(X,U),K=X.let("valid");X.try(()=>X.assign(K,_0._`${w}(${Y}, ${G}).test(${J})`),()=>X.assign(K,!1)),$.fail$data(_0._`!${K}`)}else{let U=(0,Rv.usePattern)($,z);$.fail$data(_0._`!${U}.test(${J})`)}}};dB.default=Cv});var tB=x((oB)=>{Object.defineProperty(oB,"__esModule",{value:!0});var A8=s(),_v={message({keyword:$,schemaCode:X}){let J=$==="maxProperties"?"more":"fewer";return A8.str`must NOT have ${J} than ${X} properties`},params:({schemaCode:$})=>A8._`{limit: ${$}}`},xv={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:_v,code($){let{keyword:X,data:J,schemaCode:Q}=$,z=X==="maxProperties"?A8.operators.GT:A8.operators.LT;$.fail$data(A8._`Object.keys(${J}).length ${z} ${Q}`)}};oB.default=xv});var sB=x((aB)=>{Object.defineProperty(aB,"__esModule",{value:!0});var b8=A4(),P8=s(),fv=Y$(),gv={message:({params:{missingProperty:$}})=>P8.str`must have required property '${$}'`,params:({params:{missingProperty:$}})=>P8._`{missingProperty: ${$}}`},yv={keyword:"required",type:"object",schemaType:"array",$data:!0,error:gv,code($){let{gen:X,schema:J,schemaCode:Q,data:z,$data:Y,it:W}=$,{opts:G}=W;if(!Y&&J.length===0)return;let U=J.length>=G.loopRequired;if(W.allErrors)w();else K();if(G.strictRequired){let V=$.parentSchema.properties,{definedProperties:O}=$.it;for(let B of J)if((V===null||V===void 0?void 0:V[B])===void 0&&!O.has(B)){let L=W.schemaEnv.baseId+W.errSchemaPath,F=`required property "${B}" is not defined at "${L}" (strictRequired)`;(0,fv.checkStrictMode)(W,F,W.opts.strictRequired)}}function w(){if(U||Y)$.block$data(P8.nil,N);else for(let V of J)(0,b8.checkReportMissingProp)($,V)}function K(){let V=X.let("missing");if(U||Y){let O=X.let("valid",!0);$.block$data(O,()=>H(V,O)),$.ok(O)}else X.if((0,b8.checkMissingProp)($,J,V)),(0,b8.reportMissingProp)($,V),X.else()}function N(){X.forOf("prop",Q,(V)=>{$.setParams({missingProperty:V}),X.if((0,b8.noPropertyInData)(X,z,V,G.ownProperties),()=>$.error())})}function H(V,O){$.setParams({missingProperty:V}),X.forOf(V,Q,()=>{X.assign(O,(0,b8.propertyInData)(X,z,V,G.ownProperties)),X.if((0,P8.not)(O),()=>{$.error(),X.break()})},P8.nil)}}};aB.default=yv});var $j=x((eB)=>{Object.defineProperty(eB,"__esModule",{value:!0});var Z8=s(),uv={message({keyword:$,schemaCode:X}){let J=$==="maxItems"?"more":"fewer";return Z8.str`must NOT have ${J} than ${X} items`},params:({schemaCode:$})=>Z8._`{limit: ${$}}`},lv={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:uv,code($){let{keyword:X,data:J,schemaCode:Q}=$,z=X==="maxItems"?Z8.operators.GT:Z8.operators.LT;$.fail$data(Z8._`${J}.length ${z} ${Q}`)}};eB.default=lv});var SQ=x((Jj)=>{Object.defineProperty(Jj,"__esModule",{value:!0});var Xj=TG();Xj.code='require("ajv/dist/runtime/equal").default';Jj.default=Xj});var Qj=x((zj)=>{Object.defineProperty(zj,"__esModule",{value:!0});var tG=V8(),h$=s(),iv=Y$(),nv=SQ(),pv={message:({params:{i:$,j:X}})=>h$.str`must NOT have duplicate items (items ## ${X} and ${$} are identical)`,params:({params:{i:$,j:X}})=>h$._`{i: ${$}, j: ${X}}`},dv={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:pv,code($){let{gen:X,data:J,$data:Q,schema:z,parentSchema:Y,schemaCode:W,it:G}=$;if(!Q&&!z)return;let U=X.let("valid"),w=Y.items?(0,tG.getSchemaTypes)(Y.items):[];$.block$data(U,K,h$._`${W} === false`),$.ok(U);function K(){let O=X.let("i",h$._`${J}.length`),B=X.let("j");$.setParams({i:O,j:B}),X.assign(U,!0),X.if(h$._`${O} > 1`,()=>(N()?H:V)(O,B))}function N(){return w.length>0&&!w.some((O)=>O==="object"||O==="array")}function H(O,B){let L=X.name("item"),F=(0,tG.checkDataTypes)(w,L,G.opts.strictNumbers,tG.DataType.Wrong),Z=X.const("indices",h$._`{}`);X.for(h$._`;${O}--;`,()=>{if(X.let(L,h$._`${J}[${O}]`),X.if(F,h$._`continue`),w.length>1)X.if(h$._`typeof ${L} == "string"`,h$._`${L} += "_"`);X.if(h$._`typeof ${Z}[${L}] == "number"`,()=>{X.assign(B,h$._`${Z}[${L}]`),$.error(),X.assign(U,!1).break()}).code(h$._`${Z}[${L}] = ${O}`)})}function V(O,B){let L=(0,iv.useFunc)(X,nv.default),F=X.name("outer");X.label(F).for(h$._`;${O}--;`,()=>X.for(h$._`${B} = ${O}; ${B}--;`,()=>X.if(h$._`${L}(${J}[${O}], ${J}[${B}])`,()=>{$.error(),X.assign(U,!1).break(F)})))}}};zj.default=dv});var Wj=x((Yj)=>{Object.defineProperty(Yj,"__esModule",{value:!0});var aG=s(),ov=Y$(),tv=SQ(),av={message:"must be equal to constant",params:({schemaCode:$})=>aG._`{allowedValue: ${$}}`},sv={keyword:"const",$data:!0,error:av,code($){let{gen:X,data:J,$data:Q,schemaCode:z,schema:Y}=$;if(Q||Y&&typeof Y=="object")$.fail$data(aG._`!${(0,ov.useFunc)(X,tv.default)}(${J}, ${z})`);else $.fail(aG._`${Y} !== ${J}`)}};Yj.default=sv});var Uj=x((Gj)=>{Object.defineProperty(Gj,"__esModule",{value:!0});var S8=s(),$C=Y$(),XC=SQ(),JC={message:"must be equal to one of the allowed values",params:({schemaCode:$})=>S8._`{allowedValues: ${$}}`},zC={keyword:"enum",schemaType:"array",$data:!0,error:JC,code($){let{gen:X,data:J,$data:Q,schema:z,schemaCode:Y,it:W}=$;if(!Q&&z.length===0)throw Error("enum must have non-empty array");let G=z.length>=W.opts.loopEnum,U,w=()=>U!==null&&U!==void 0?U:U=(0,$C.useFunc)(X,XC.default),K;if(G||Q)K=X.let("valid"),$.block$data(K,N);else{if(!Array.isArray(z))throw Error("ajv implementation error");let V=X.const("vSchema",Y);K=(0,S8.or)(...z.map((O,B)=>H(V,B)))}$.pass(K);function N(){X.assign(K,!1),X.forOf("v",Y,(V)=>X.if(S8._`${w()}(${J}, ${V})`,()=>X.assign(K,!0).break()))}function H(V,O){let B=z[O];return typeof B==="object"&&B!==null?S8._`${w()}(${J}, ${V}[${O}])`:S8._`${J} === ${B}`}}};Gj.default=zC});var Kj=x((wj)=>{Object.defineProperty(wj,"__esModule",{value:!0});var YC=hB(),WC=lB(),GC=pB(),UC=rB(),wC=tB(),KC=sB(),NC=$j(),VC=Qj(),HC=Wj(),OC=Uj(),BC=[YC.default,WC.default,GC.default,UC.default,wC.default,KC.default,NC.default,VC.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},HC.default,OC.default];wj.default=BC});var eG=x((Vj)=>{Object.defineProperty(Vj,"__esModule",{value:!0});Vj.validateAdditionalItems=void 0;var P1=s(),sG=Y$(),DC={message:({params:{len:$}})=>P1.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>P1._`{limit: ${$}}`},qC={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:DC,code($){let{parentSchema:X,it:J}=$,{items:Q}=X;if(!Array.isArray(Q)){(0,sG.checkStrictMode)(J,'"additionalItems" is ignored when "items" is not an array of schemas');return}Nj($,Q)}};function Nj($,X){let{gen:J,schema:Q,data:z,keyword:Y,it:W}=$;W.items=!0;let G=J.const("len",P1._`${z}.length`);if(Q===!1)$.setParams({len:X.length}),$.pass(P1._`${G} <= ${X.length}`);else if(typeof Q=="object"&&!(0,sG.alwaysValidSchema)(W,Q)){let w=J.var("valid",P1._`${G} <= ${X.length}`);J.if((0,P1.not)(w),()=>U(w)),$.ok(w)}function U(w){J.forRange("i",X.length,G,(K)=>{if($.subschema({keyword:Y,dataProp:K,dataPropType:sG.Type.Num},w),!W.allErrors)J.if((0,P1.not)(w),()=>J.break())})}}Vj.validateAdditionalItems=Nj;Vj.default=qC});var $U=x((jj)=>{Object.defineProperty(jj,"__esModule",{value:!0});jj.validateTuple=void 0;var Oj=s(),RQ=Y$(),FC=A4(),MC={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code($){let{schema:X,it:J}=$;if(Array.isArray(X))return Bj($,"additionalItems",X);if(J.items=!0,(0,RQ.alwaysValidSchema)(J,X))return;$.ok((0,FC.validateArray)($))}};function Bj($,X,J=$.schema){let{gen:Q,parentSchema:z,data:Y,keyword:W,it:G}=$;if(K(z),G.opts.unevaluated&&J.length&&G.items!==!0)G.items=RQ.mergeEvaluated.items(Q,J.length,G.items);let U=Q.name("valid"),w=Q.const("len",Oj._`${Y}.length`);J.forEach((N,H)=>{if((0,RQ.alwaysValidSchema)(G,N))return;Q.if(Oj._`${w} > ${H}`,()=>$.subschema({keyword:W,schemaProp:H,dataProp:H},U)),$.ok(U)});function K(N){let{opts:H,errSchemaPath:V}=G,O=J.length,B=O===N.minItems&&(O===N.maxItems||N[X]===!1);if(H.strictTuples&&!B){let L=`"${W}" is ${O}-tuple, but minItems or maxItems/${X} are not specified or different at path "${V}"`;(0,RQ.checkStrictMode)(G,L,H.strictTuples)}}}jj.validateTuple=Bj;jj.default=MC});var Lj=x((qj)=>{Object.defineProperty(qj,"__esModule",{value:!0});var AC=$U(),bC={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:($)=>(0,AC.validateTuple)($,"items")};qj.default=bC});var Ij=x((Mj)=>{Object.defineProperty(Mj,"__esModule",{value:!0});var Fj=s(),ZC=Y$(),SC=A4(),RC=eG(),EC={message:({params:{len:$}})=>Fj.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>Fj._`{limit: ${$}}`},vC={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:EC,code($){let{schema:X,parentSchema:J,it:Q}=$,{prefixItems:z}=J;if(Q.items=!0,(0,ZC.alwaysValidSchema)(Q,X))return;if(z)(0,RC.validateAdditionalItems)($,z);else $.ok((0,SC.validateArray)($))}};Mj.default=vC});var bj=x((Aj)=>{Object.defineProperty(Aj,"__esModule",{value:!0});var b4=s(),EQ=Y$(),kC={message:({params:{min:$,max:X}})=>X===void 0?b4.str`must contain at least ${$} valid item(s)`:b4.str`must contain at least ${$} and no more than ${X} valid item(s)`,params:({params:{min:$,max:X}})=>X===void 0?b4._`{minContains: ${$}}`:b4._`{minContains: ${$}, maxContains: ${X}}`},_C={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:kC,code($){let{gen:X,schema:J,parentSchema:Q,data:z,it:Y}=$,W,G,{minContains:U,maxContains:w}=Q;if(Y.opts.next)W=U===void 0?1:U,G=w;else W=1;let K=X.const("len",b4._`${z}.length`);if($.setParams({min:W,max:G}),G===void 0&&W===0){(0,EQ.checkStrictMode)(Y,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(G!==void 0&&W>G){(0,EQ.checkStrictMode)(Y,'"minContains" > "maxContains" is always invalid'),$.fail();return}if((0,EQ.alwaysValidSchema)(Y,J)){let B=b4._`${K} >= ${W}`;if(G!==void 0)B=b4._`${B} && ${K} <= ${G}`;$.pass(B);return}Y.items=!0;let N=X.name("valid");if(G===void 0&&W===1)V(N,()=>X.if(N,()=>X.break()));else if(W===0){if(X.let(N,!0),G!==void 0)X.if(b4._`${z}.length > 0`,H)}else X.let(N,!1),H();$.result(N,()=>$.reset());function H(){let B=X.name("_valid"),L=X.let("count",0);V(B,()=>X.if(B,()=>O(L)))}function V(B,L){X.forRange("i",0,K,(F)=>{$.subschema({keyword:"contains",dataProp:F,dataPropType:EQ.Type.Num,compositeRule:!0},B),L()})}function O(B){if(X.code(b4._`${B}++`),G===void 0)X.if(b4._`${B} >= ${W}`,()=>X.assign(N,!0).break());else if(X.if(b4._`${B} > ${G}`,()=>X.assign(N,!1).break()),W===1)X.assign(N,!0);else X.if(b4._`${B} >= ${W}`,()=>X.assign(N,!0))}}};Aj.default=_C});var vj=x((Sj)=>{Object.defineProperty(Sj,"__esModule",{value:!0});Sj.validateSchemaDeps=Sj.validatePropertyDeps=Sj.error=void 0;var XU=s(),TC=Y$(),R8=A4();Sj.error={message:({params:{property:$,depsCount:X,deps:J}})=>{let Q=X===1?"property":"properties";return XU.str`must have ${Q} ${J} when property ${$} is present`},params:({params:{property:$,depsCount:X,deps:J,missingProperty:Q}})=>XU._`{property: ${$},
9
9
  missingProperty: ${Q},
10
10
  depsCount: ${X},
11
- deps: ${J}}`};var fC={keyword:"dependencies",type:"object",schemaType:"object",error:Sj.error,code($){let[X,J]=gC($);Pj($,X),Zj($,J)}};function gC({schema:$}){let X={},J={};for(let Q in $){if(Q==="__proto__")continue;let z=Array.isArray($[Q])?X:J;z[Q]=$[Q]}return[X,J]}function Pj($,X=$.schema){let{gen:J,data:Q,it:z}=$;if(Object.keys(X).length===0)return;let Y=J.let("missing");for(let W in X){let G=X[W];if(G.length===0)continue;let U=(0,R8.propertyInData)(J,Q,W,z.opts.ownProperties);if($.setParams({property:W,depsCount:G.length,deps:G.join(", ")}),z.allErrors)J.if(U,()=>{for(let w of G)(0,R8.checkReportMissingProp)($,w)});else J.if(XU._`${U} && (${(0,R8.checkMissingProp)($,G,Y)})`),(0,R8.reportMissingProp)($,Y),J.else()}}Sj.validatePropertyDeps=Pj;function Zj($,X=$.schema){let{gen:J,data:Q,keyword:z,it:Y}=$,W=J.name("valid");for(let G in X){if((0,TC.alwaysValidSchema)(Y,X[G]))continue;J.if((0,R8.propertyInData)(J,Q,G,Y.opts.ownProperties),()=>{let U=$.subschema({keyword:z,schemaProp:G},W);$.mergeValidEvaluated(U,W)},()=>J.var(W,!0)),$.ok(W)}}Sj.validateSchemaDeps=Zj;Sj.default=fC});var _j=x((kj)=>{Object.defineProperty(kj,"__esModule",{value:!0});var Cj=s(),uC=Y$(),lC={message:"property name must be valid",params:({params:$})=>Cj._`{propertyName: ${$.propertyName}}`},mC={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:lC,code($){let{gen:X,schema:J,data:Q,it:z}=$;if((0,uC.alwaysValidSchema)(z,J))return;let Y=X.name("valid");X.forIn("key",Q,(W)=>{$.setParams({propertyName:W}),$.subschema({keyword:"propertyNames",data:W,dataTypes:["string"],propertyName:W,compositeRule:!0},Y),X.if((0,Cj.not)(Y),()=>{if($.error(!0),!z.allErrors)X.break()})}),$.ok(Y)}};kj.default=mC});var JU=x((xj)=>{Object.defineProperty(xj,"__esModule",{value:!0});var vQ=A4(),g4=s(),iC=N6(),CQ=Y$(),nC={message:"must NOT have additional properties",params:({params:$})=>g4._`{additionalProperty: ${$.additionalProperty}}`},pC={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:nC,code($){let{gen:X,schema:J,parentSchema:Q,data:z,errsCount:Y,it:W}=$;if(!Y)throw Error("ajv implementation error");let{allErrors:G,opts:U}=W;if(W.props=!0,U.removeAdditional!=="all"&&(0,CQ.alwaysValidSchema)(W,J))return;let w=(0,vQ.allSchemaProperties)(Q.properties),K=(0,vQ.allSchemaProperties)(Q.patternProperties);N(),$.ok(g4._`${Y} === ${iC.default.errors}`);function N(){X.forIn("key",z,(L)=>{if(!w.length&&!K.length)O(L);else X.if(H(L),()=>O(L))})}function H(L){let F;if(w.length>8){let Z=(0,CQ.schemaRefOrVal)(W,Q.properties,"properties");F=(0,vQ.isOwnProperty)(X,Z,L)}else if(w.length)F=(0,g4.or)(...w.map((Z)=>g4._`${L} === ${Z}`));else F=g4.nil;if(K.length)F=(0,g4.or)(F,...K.map((Z)=>g4._`${(0,vQ.usePattern)($,Z)}.test(${L})`));return(0,g4.not)(F)}function V(L){X.code(g4._`delete ${z}[${L}]`)}function O(L){if(U.removeAdditional==="all"||U.removeAdditional&&J===!1){V(L);return}if(J===!1){if($.setParams({additionalProperty:L}),$.error(),!G)X.break();return}if(typeof J=="object"&&!(0,CQ.alwaysValidSchema)(W,J)){let F=X.name("valid");if(U.removeAdditional==="failing")B(L,F,!1),X.if((0,g4.not)(F),()=>{$.reset(),V(L)});else if(B(L,F),!G)X.if((0,g4.not)(F),()=>X.break())}}function B(L,F,Z){let C={keyword:"additionalProperties",dataProp:L,dataPropType:CQ.Type.Str};if(Z===!1)Object.assign(C,{compositeRule:!0,createErrors:!1,allErrors:!1});$.subschema(C,F)}}};xj.default=pC});var yj=x((gj)=>{Object.defineProperty(gj,"__esModule",{value:!0});var rC=j8(),Tj=A4(),zU=Y$(),fj=JU(),oC={keyword:"properties",type:"object",schemaType:"object",code($){let{gen:X,schema:J,parentSchema:Q,data:z,it:Y}=$;if(Y.opts.removeAdditional==="all"&&Q.additionalProperties===void 0)fj.default.code(new rC.KeywordCxt(Y,fj.default,"additionalProperties"));let W=(0,Tj.allSchemaProperties)(J);for(let N of W)Y.definedProperties.add(N);if(Y.opts.unevaluated&&W.length&&Y.props!==!0)Y.props=zU.mergeEvaluated.props(X,(0,zU.toHash)(W),Y.props);let G=W.filter((N)=>!(0,zU.alwaysValidSchema)(Y,J[N]));if(G.length===0)return;let U=X.name("valid");for(let N of G){if(w(N))K(N);else{if(X.if((0,Tj.propertyInData)(X,z,N,Y.opts.ownProperties)),K(N),!Y.allErrors)X.else().var(U,!0);X.endIf()}$.it.definedProperties.add(N),$.ok(U)}function w(N){return Y.opts.useDefaults&&!Y.compositeRule&&J[N].default!==void 0}function K(N){$.subschema({keyword:"properties",schemaProp:N,dataProp:N},U)}}};gj.default=oC});var cj=x((mj)=>{Object.defineProperty(mj,"__esModule",{value:!0});var hj=A4(),kQ=s(),uj=Y$(),lj=Y$(),aC={keyword:"patternProperties",type:"object",schemaType:"object",code($){let{gen:X,schema:J,data:Q,parentSchema:z,it:Y}=$,{opts:W}=Y,G=(0,hj.allSchemaProperties)(J),U=G.filter((B)=>(0,uj.alwaysValidSchema)(Y,J[B]));if(G.length===0||U.length===G.length&&(!Y.opts.unevaluated||Y.props===!0))return;let w=W.strictSchema&&!W.allowMatchingProperties&&z.properties,K=X.name("valid");if(Y.props!==!0&&!(Y.props instanceof kQ.Name))Y.props=(0,lj.evaluatedPropsToName)(X,Y.props);let{props:N}=Y;H();function H(){for(let B of G){if(w)V(B);if(Y.allErrors)O(B);else X.var(K,!0),O(B),X.if(K)}}function V(B){for(let L in w)if(new RegExp(B).test(L))(0,uj.checkStrictMode)(Y,`property ${L} matches pattern ${B} (use allowMatchingProperties)`)}function O(B){X.forIn("key",Q,(L)=>{X.if(kQ._`${(0,hj.usePattern)($,B)}.test(${L})`,()=>{let F=U.includes(B);if(!F)$.subschema({keyword:"patternProperties",schemaProp:B,dataProp:L,dataPropType:lj.Type.Str},K);if(Y.opts.unevaluated&&N!==!0)X.assign(kQ._`${N}[${L}]`,!0);else if(!F&&!Y.allErrors)X.if((0,kQ.not)(K),()=>X.break())})})}}};mj.default=aC});var nj=x((ij)=>{Object.defineProperty(ij,"__esModule",{value:!0});var eC=Y$(),$k={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code($){let{gen:X,schema:J,it:Q}=$;if((0,eC.alwaysValidSchema)(Q,J)){$.fail();return}let z=X.name("valid");$.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},z),$.failResult(z,()=>$.reset(),()=>$.error())},error:{message:"must NOT be valid"}};ij.default=$k});var dj=x((pj)=>{Object.defineProperty(pj,"__esModule",{value:!0});var Jk=A4(),zk={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Jk.validateUnion,error:{message:"must match a schema in anyOf"}};pj.default=zk});var oj=x((rj)=>{Object.defineProperty(rj,"__esModule",{value:!0});var _Q=s(),Yk=Y$(),Wk={message:"must match exactly one schema in oneOf",params:({params:$})=>_Q._`{passingSchemas: ${$.passing}}`},Gk={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Wk,code($){let{gen:X,schema:J,parentSchema:Q,it:z}=$;if(!Array.isArray(J))throw Error("ajv implementation error");if(z.opts.discriminator&&Q.discriminator)return;let Y=J,W=X.let("valid",!1),G=X.let("passing",null),U=X.name("_valid");$.setParams({passing:G}),X.block(w),$.result(W,()=>$.reset(),()=>$.error(!0));function w(){Y.forEach((K,N)=>{let H;if((0,Yk.alwaysValidSchema)(z,K))X.var(U,!0);else H=$.subschema({keyword:"oneOf",schemaProp:N,compositeRule:!0},U);if(N>0)X.if(_Q._`${U} && ${W}`).assign(W,!1).assign(G,_Q._`[${G}, ${N}]`).else();X.if(U,()=>{if(X.assign(W,!0),X.assign(G,N),H)$.mergeEvaluated(H,_Q.Name)})})}}};rj.default=Gk});var aj=x((tj)=>{Object.defineProperty(tj,"__esModule",{value:!0});var wk=Y$(),Kk={keyword:"allOf",schemaType:"array",code($){let{gen:X,schema:J,it:Q}=$;if(!Array.isArray(J))throw Error("ajv implementation error");let z=X.name("valid");J.forEach((Y,W)=>{if((0,wk.alwaysValidSchema)(Q,Y))return;let G=$.subschema({keyword:"allOf",schemaProp:W},z);$.ok(z),$.mergeEvaluated(G)})}};tj.default=Kk});var XD=x(($D)=>{Object.defineProperty($D,"__esModule",{value:!0});var xQ=s(),ej=Y$(),Vk={message:({params:$})=>xQ.str`must match "${$.ifClause}" schema`,params:({params:$})=>xQ._`{failingKeyword: ${$.ifClause}}`},Hk={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Vk,code($){let{gen:X,parentSchema:J,it:Q}=$;if(J.then===void 0&&J.else===void 0)(0,ej.checkStrictMode)(Q,'"if" without "then" and "else" is ignored');let z=sj(Q,"then"),Y=sj(Q,"else");if(!z&&!Y)return;let W=X.let("valid",!0),G=X.name("_valid");if(U(),$.reset(),z&&Y){let K=X.let("ifClause");$.setParams({ifClause:K}),X.if(G,w("then",K),w("else",K))}else if(z)X.if(G,w("then"));else X.if((0,xQ.not)(G),w("else"));$.pass(W,()=>$.error(!0));function U(){let K=$.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},G);$.mergeEvaluated(K)}function w(K,N){return()=>{let H=$.subschema({keyword:K},G);if(X.assign(W,G),$.mergeValidEvaluated(H,W),N)X.assign(N,xQ._`${K}`);else $.setParams({ifClause:K})}}}};function sj($,X){let J=$.schema[X];return J!==void 0&&!(0,ej.alwaysValidSchema)($,J)}$D.default=Hk});var zD=x((JD)=>{Object.defineProperty(JD,"__esModule",{value:!0});var Bk=Y$(),jk={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:$,parentSchema:X,it:J}){if(X.if===void 0)(0,Bk.checkStrictMode)(J,`"${$}" without "if" is ignored`)}};JD.default=jk});var YD=x((QD)=>{Object.defineProperty(QD,"__esModule",{value:!0});var qk=eG(),Lk=Lj(),Fk=$U(),Mk=Ij(),Ik=bj(),Ak=vj(),bk=_j(),Pk=JU(),Zk=yj(),Sk=cj(),Rk=nj(),Ek=dj(),vk=oj(),Ck=aj(),kk=XD(),_k=zD();function xk($=!1){let X=[Rk.default,Ek.default,vk.default,Ck.default,kk.default,_k.default,bk.default,Pk.default,Ak.default,Zk.default,Sk.default];if($)X.push(Lk.default,Mk.default);else X.push(qk.default,Fk.default);return X.push(Ik.default),X}QD.default=xk});var GD=x((WD)=>{Object.defineProperty(WD,"__esModule",{value:!0});var E$=s(),fk={message:({schemaCode:$})=>E$.str`must match format "${$}"`,params:({schemaCode:$})=>E$._`{format: ${$}}`},gk={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:fk,code($,X){let{gen:J,data:Q,$data:z,schema:Y,schemaCode:W,it:G}=$,{opts:U,errSchemaPath:w,schemaEnv:K,self:N}=G;if(!U.validateFormats)return;if(z)H();else V();function H(){let O=J.scopeValue("formats",{ref:N.formats,code:U.code.formats}),B=J.const("fDef",E$._`${O}[${W}]`),L=J.let("fType"),F=J.let("format");J.if(E$._`typeof ${B} == "object" && !(${B} instanceof RegExp)`,()=>J.assign(L,E$._`${B}.type || "string"`).assign(F,E$._`${B}.validate`),()=>J.assign(L,E$._`"string"`).assign(F,B)),$.fail$data((0,E$.or)(Z(),C()));function Z(){if(U.strictSchema===!1)return E$.nil;return E$._`${W} && !${F}`}function C(){let m=K.$async?E$._`(${B}.async ? await ${F}(${Q}) : ${F}(${Q}))`:E$._`${F}(${Q})`,c=E$._`(typeof ${F} == "function" ? ${m} : ${F}.test(${Q}))`;return E$._`${F} && ${F} !== true && ${L} === ${X} && !${c}`}}function V(){let O=N.formats[Y];if(!O){Z();return}if(O===!0)return;let[B,L,F]=C(O);if(B===X)$.pass(m());function Z(){if(U.strictSchema===!1){N.logger.warn(c());return}throw Error(c());function c(){return`unknown format "${Y}" ignored in schema at path "${w}"`}}function C(c){let v$=c instanceof RegExp?(0,E$.regexpCode)(c):U.code.formats?E$._`${U.code.formats}${(0,E$.getProperty)(Y)}`:void 0,H4=J.scopeValue("formats",{key:Y,ref:c,code:v$});if(typeof c=="object"&&!(c instanceof RegExp))return[c.type||"string",c.validate,E$._`${H4}.validate`];return["string",c,H4]}function m(){if(typeof O=="object"&&!(O instanceof RegExp)&&O.async){if(!K.$async)throw Error("async format in sync schema");return E$._`await ${F}(${Q})`}return typeof L=="function"?E$._`${F}(${Q})`:E$._`${F}.test(${Q})`}}}};WD.default=gk});var wD=x((UD)=>{Object.defineProperty(UD,"__esModule",{value:!0});var hk=GD(),uk=[hk.default];UD.default=uk});var VD=x((KD)=>{Object.defineProperty(KD,"__esModule",{value:!0});KD.contentVocabulary=KD.metadataVocabulary=void 0;KD.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];KD.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var BD=x((OD)=>{Object.defineProperty(OD,"__esModule",{value:!0});var ck=gB(),ik=Kj(),nk=YD(),pk=wD(),HD=VD(),dk=[ck.default,ik.default,(0,nk.default)(),pk.default,HD.metadataVocabulary,HD.contentVocabulary];OD.default=dk});var LD=x((DD)=>{Object.defineProperty(DD,"__esModule",{value:!0});DD.DiscrError=void 0;var jD;(function($){$.Tag="tag",$.Mapping="mapping"})(jD||(DD.DiscrError=jD={}))});var ID=x((MD)=>{Object.defineProperty(MD,"__esModule",{value:!0});var x0=s(),QU=LD(),FD=DQ(),ok=D8(),tk=Y$(),ak={message:({params:{discrError:$,tagName:X}})=>$===QU.DiscrError.Tag?`tag "${X}" must be string`:`value of tag "${X}" must be in oneOf`,params:({params:{discrError:$,tag:X,tagName:J}})=>x0._`{error: ${$}, tag: ${J}, tagValue: ${X}}`},sk={keyword:"discriminator",type:"object",schemaType:"object",error:ak,code($){let{gen:X,data:J,schema:Q,parentSchema:z,it:Y}=$,{oneOf:W}=z;if(!Y.opts.discriminator)throw Error("discriminator: requires discriminator option");let G=Q.propertyName;if(typeof G!="string")throw Error("discriminator: requires propertyName");if(Q.mapping)throw Error("discriminator: mapping is not supported");if(!W)throw Error("discriminator: requires oneOf keyword");let U=X.let("valid",!1),w=X.const("tag",x0._`${J}${(0,x0.getProperty)(G)}`);X.if(x0._`typeof ${w} == "string"`,()=>K(),()=>$.error(!1,{discrError:QU.DiscrError.Tag,tag:w,tagName:G})),$.ok(U);function K(){let V=H();X.if(!1);for(let O in V)X.elseIf(x0._`${w} === ${O}`),X.assign(U,N(V[O]));X.else(),$.error(!1,{discrError:QU.DiscrError.Mapping,tag:w,tagName:G}),X.endIf()}function N(V){let O=X.name("valid"),B=$.subschema({keyword:"oneOf",schemaProp:V},O);return $.mergeEvaluated(B,x0.Name),O}function H(){var V;let O={},B=F(z),L=!0;for(let m=0;m<W.length;m++){let c=W[m];if((c===null||c===void 0?void 0:c.$ref)&&!(0,tk.schemaHasRulesButRef)(c,Y.self.RULES)){let H4=c.$ref;if(c=FD.resolveRef.call(Y.self,Y.schemaEnv.root,Y.baseId,H4),c instanceof FD.SchemaEnv)c=c.schema;if(c===void 0)throw new ok.default(Y.opts.uriResolver,Y.baseId,H4)}let v$=(V=c===null||c===void 0?void 0:c.properties)===null||V===void 0?void 0:V[G];if(typeof v$!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${G}"`);L=L&&(B||F(c)),Z(v$,m)}if(!L)throw Error(`discriminator: "${G}" must be required`);return O;function F({required:m}){return Array.isArray(m)&&m.includes(G)}function Z(m,c){if(m.const)C(m.const,c);else if(m.enum)for(let v$ of m.enum)C(v$,c);else throw Error(`discriminator: "properties/${G}" must have "const" or "enum"`)}function C(m,c){if(typeof m!="string"||m in O)throw Error(`discriminator: "${G}" values must be unique strings`);O[m]=c}}}};MD.default=sk});var AD=x((xa,$_)=>{$_.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var WU=x((Q4,YU)=>{Object.defineProperty(Q4,"__esModule",{value:!0});Q4.MissingRefError=Q4.ValidationError=Q4.CodeGen=Q4.Name=Q4.nil=Q4.stringify=Q4.str=Q4._=Q4.KeywordCxt=Q4.Ajv=void 0;var X_=SB(),J_=BD(),z_=ID(),bD=AD(),Q_=["/properties"],TQ="http://json-schema.org/draft-07/schema";class E8 extends X_.default{_addVocabularies(){if(super._addVocabularies(),J_.default.forEach(($)=>this.addVocabulary($)),this.opts.discriminator)this.addKeyword(z_.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let $=this.opts.$data?this.$dataMetaSchema(bD,Q_):bD;this.addMetaSchema($,TQ,!1),this.refs["http://json-schema.org/schema"]=TQ}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(TQ)?TQ:void 0)}}Q4.Ajv=E8;YU.exports=Q4=E8;YU.exports.Ajv=E8;Object.defineProperty(Q4,"__esModule",{value:!0});Q4.default=E8;var Y_=j8();Object.defineProperty(Q4,"KeywordCxt",{enumerable:!0,get:function(){return Y_.KeywordCxt}});var T0=s();Object.defineProperty(Q4,"_",{enumerable:!0,get:function(){return T0._}});Object.defineProperty(Q4,"str",{enumerable:!0,get:function(){return T0.str}});Object.defineProperty(Q4,"stringify",{enumerable:!0,get:function(){return T0.stringify}});Object.defineProperty(Q4,"nil",{enumerable:!0,get:function(){return T0.nil}});Object.defineProperty(Q4,"Name",{enumerable:!0,get:function(){return T0.Name}});Object.defineProperty(Q4,"CodeGen",{enumerable:!0,get:function(){return T0.CodeGen}});var W_=BQ();Object.defineProperty(Q4,"ValidationError",{enumerable:!0,get:function(){return W_.default}});var G_=D8();Object.defineProperty(Q4,"MissingRefError",{enumerable:!0,get:function(){return G_.default}})});var xD=x((kD)=>{Object.defineProperty(kD,"__esModule",{value:!0});kD.formatNames=kD.fastFormats=kD.fullFormats=void 0;function p4($,X){return{validate:$,compare:X}}kD.fullFormats={date:p4(RD,KU),time:p4(UU(!0),NU),"date-time":p4(PD(!0),vD),"iso-time":p4(UU(),ED),"iso-date-time":p4(PD(),CD),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:B_,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:I_,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:j_,int32:{type:"number",validate:L_},int64:{type:"number",validate:F_},float:{type:"number",validate:SD},double:{type:"number",validate:SD},password:!0,binary:!0};kD.fastFormats={...kD.fullFormats,date:p4(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,KU),time:p4(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,NU),"date-time":p4(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,vD),"iso-time":p4(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,ED),"iso-date-time":p4(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,CD),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};kD.formatNames=Object.keys(kD.fullFormats);function K_($){return $%4===0&&($%100!==0||$%400===0)}var N_=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,V_=[0,31,28,31,30,31,30,31,31,30,31,30,31];function RD($){let X=N_.exec($);if(!X)return!1;let J=+X[1],Q=+X[2],z=+X[3];return Q>=1&&Q<=12&&z>=1&&z<=(Q===2&&K_(J)?29:V_[Q])}function KU($,X){if(!($&&X))return;if($>X)return 1;if($<X)return-1;return 0}var GU=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function UU($){return function(J){let Q=GU.exec(J);if(!Q)return!1;let z=+Q[1],Y=+Q[2],W=+Q[3],G=Q[4],U=Q[5]==="-"?-1:1,w=+(Q[6]||0),K=+(Q[7]||0);if(w>23||K>59||$&&!G)return!1;if(z<=23&&Y<=59&&W<60)return!0;let N=Y-K*U,H=z-w*U-(N<0?1:0);return(H===23||H===-1)&&(N===59||N===-1)&&W<61}}function NU($,X){if(!($&&X))return;let J=new Date("2020-01-01T"+$).valueOf(),Q=new Date("2020-01-01T"+X).valueOf();if(!(J&&Q))return;return J-Q}function ED($,X){if(!($&&X))return;let J=GU.exec($),Q=GU.exec(X);if(!(J&&Q))return;if($=J[1]+J[2]+J[3],X=Q[1]+Q[2]+Q[3],$>X)return 1;if($<X)return-1;return 0}var wU=/t|\s/i;function PD($){let X=UU($);return function(Q){let z=Q.split(wU);return z.length===2&&RD(z[0])&&X(z[1])}}function vD($,X){if(!($&&X))return;let J=new Date($).valueOf(),Q=new Date(X).valueOf();if(!(J&&Q))return;return J-Q}function CD($,X){if(!($&&X))return;let[J,Q]=$.split(wU),[z,Y]=X.split(wU),W=KU(J,z);if(W===void 0)return;return W||NU(Q,Y)}var H_=/\/|:/,O_=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function B_($){return H_.test($)&&O_.test($)}var ZD=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function j_($){return ZD.lastIndex=0,ZD.test($)}var D_=-2147483648,q_=2147483647;function L_($){return Number.isInteger($)&&$<=q_&&$>=D_}function F_($){return Number.isInteger($)}function SD(){return!0}var M_=/[^\\]\\Z/;function I_($){if(M_.test($))return!1;try{return new RegExp($),!0}catch(X){return!1}}});var fD=x((TD)=>{Object.defineProperty(TD,"__esModule",{value:!0});TD.formatLimitDefinition=void 0;var b_=WU(),y4=s(),c6=y4.operators,fQ={formatMaximum:{okStr:"<=",ok:c6.LTE,fail:c6.GT},formatMinimum:{okStr:">=",ok:c6.GTE,fail:c6.LT},formatExclusiveMaximum:{okStr:"<",ok:c6.LT,fail:c6.GTE},formatExclusiveMinimum:{okStr:">",ok:c6.GT,fail:c6.LTE}},P_={message:({keyword:$,schemaCode:X})=>y4.str`should be ${fQ[$].okStr} ${X}`,params:({keyword:$,schemaCode:X})=>y4._`{comparison: ${fQ[$].okStr}, limit: ${X}}`};TD.formatLimitDefinition={keyword:Object.keys(fQ),type:"string",schemaType:"string",$data:!0,error:P_,code($){let{gen:X,data:J,schemaCode:Q,keyword:z,it:Y}=$,{opts:W,self:G}=Y;if(!W.validateFormats)return;let U=new b_.KeywordCxt(Y,G.RULES.all.format.definition,"format");if(U.$data)w();else K();function w(){let H=X.scopeValue("formats",{ref:G.formats,code:W.code.formats}),V=X.const("fmt",y4._`${H}[${U.schemaCode}]`);$.fail$data((0,y4.or)(y4._`typeof ${V} != "object"`,y4._`${V} instanceof RegExp`,y4._`typeof ${V}.compare != "function"`,N(V)))}function K(){let H=U.schema,V=G.formats[H];if(!V||V===!0)return;if(typeof V!="object"||V instanceof RegExp||typeof V.compare!="function")throw Error(`"${z}": format "${H}" does not define "compare" function`);let O=X.scopeValue("formats",{key:H,ref:V,code:W.code.formats?y4._`${W.code.formats}${(0,y4.getProperty)(H)}`:void 0});$.fail$data(N(O))}function N(H){return y4._`${H}.compare(${J}, ${Q}) ${fQ[z].fail} 0`}},dependencies:["format"]};var Z_=($)=>{return $.addKeyword(TD.formatLimitDefinition),$};TD.default=Z_});var uD=x((v8,hD)=>{Object.defineProperty(v8,"__esModule",{value:!0});var f0=xD(),R_=fD(),OU=s(),gD=new OU.Name("fullFormats"),E_=new OU.Name("fastFormats"),BU=($,X={keywords:!0})=>{if(Array.isArray(X))return yD($,X,f0.fullFormats,gD),$;let[J,Q]=X.mode==="fast"?[f0.fastFormats,E_]:[f0.fullFormats,gD],z=X.formats||f0.formatNames;if(yD($,z,J,Q),X.keywords)(0,R_.default)($);return $};BU.get=($,X="full")=>{let Q=(X==="fast"?f0.fastFormats:f0.fullFormats)[$];if(!Q)throw Error(`Unknown format "${$}"`);return Q};function yD($,X,J,Q){var z,Y;(z=(Y=$.opts.code).formats)!==null&&z!==void 0||(Y.formats=OU._`require("ajv-formats/dist/formats").${Q}`);for(let W of X)$.addFormat(W,J[W])}hD.exports=v8=BU;Object.defineProperty(v8,"__esModule",{value:!0});v8.default=BU});class p6 extends Error{}var{closeSync:um,writeFileSync:lm,fsyncSync:mm,openSync:cm}=(()=>({}));function Vq(){this.__data__=[],this.size=0}var SU=Vq;function Hq($,X){return $===X||$!==$&&X!==X}var RU=Hq;function Oq($,X){var J=$.length;while(J--)if(RU($[J][0],X))return J;return-1}var j6=Oq;var Bq=Array.prototype,jq=Bq.splice;function Dq($){var X=this.__data__,J=j6(X,$);if(J<0)return!1;var Q=X.length-1;if(J==Q)X.pop();else jq.call(X,J,1);return--this.size,!0}var EU=Dq;function qq($){var X=this.__data__,J=j6(X,$);return J<0?void 0:X[J][1]}var vU=qq;function Lq($){return j6(this.__data__,$)>-1}var CU=Lq;function Fq($,X){var J=this.__data__,Q=j6(J,$);if(Q<0)++this.size,J.push([$,X]);else J[Q][1]=X;return this}var kU=Fq;function S1($){var X=-1,J=$==null?0:$.length;this.clear();while(++X<J){var Q=$[X];this.set(Q[0],Q[1])}}S1.prototype.clear=SU;S1.prototype.delete=EU;S1.prototype.get=vU;S1.prototype.has=CU;S1.prototype.set=kU;var _U=S1;var Mq=typeof global=="object"&&global&&global.Object===Object&&global,xU=Mq;var Iq=typeof self=="object"&&self&&self.Object===Object&&self,Aq=xU||Iq||Function("return this")(),R1=Aq;var bq=R1.Symbol,E1=bq;var TU=Object.prototype,Pq=TU.hasOwnProperty,Zq=TU.toString,y0=E1?E1.toStringTag:void 0;function Sq($){var X=Pq.call($,y0),J=$[y0];try{$[y0]=void 0;var Q=!0}catch(Y){}var z=Zq.call($);if(Q)if(X)$[y0]=J;else delete $[y0];return z}var fU=Sq;var Rq=Object.prototype,Eq=Rq.toString;function vq($){return Eq.call($)}var gU=vq;var Cq="[object Null]",kq="[object Undefined]",yU=E1?E1.toStringTag:void 0;function _q($){if($==null)return $===void 0?kq:Cq;return yU&&yU in Object($)?fU($):gU($)}var hU=_q;function xq($){var X=typeof $;return $!=null&&(X=="object"||X=="function")}var k8=xq;var Tq="[object AsyncFunction]",fq="[object Function]",gq="[object GeneratorFunction]",yq="[object Proxy]";function hq($){if(!k8($))return!1;var X=hU($);return X==fq||X==gq||X==Tq||X==yq}var uU=hq;var uq=R1["__core-js_shared__"],_8=uq;var lU=function(){var $=/[^.]+$/.exec(_8&&_8.keys&&_8.keys.IE_PROTO||"");return $?"Symbol(src)_1."+$:""}();function lq($){return!!lU&&lU in $}var mU=lq;var mq=Function.prototype,cq=mq.toString;function iq($){if($!=null){try{return cq.call($)}catch(X){}try{return $+""}catch(X){}}return""}var cU=iq;var nq=/[\\^$.*+?()[\]{}|]/g,pq=/^\[object .+?Constructor\]$/,dq=Function.prototype,rq=Object.prototype,oq=dq.toString,tq=rq.hasOwnProperty,aq=RegExp("^"+oq.call(tq).replace(nq,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function sq($){if(!k8($)||mU($))return!1;var X=uU($)?aq:pq;return X.test(cU($))}var iU=sq;function eq($,X){return $==null?void 0:$[X]}var nU=eq;function $L($,X){var J=nU($,X);return iU(J)?J:void 0}var x8=$L;var XL=x8(R1,"Map"),pU=XL;var JL=x8(Object,"create"),d4=JL;function zL(){this.__data__=d4?d4(null):{},this.size=0}var dU=zL;function QL($){var X=this.has($)&&delete this.__data__[$];return this.size-=X?1:0,X}var rU=QL;var YL="__lodash_hash_undefined__",WL=Object.prototype,GL=WL.hasOwnProperty;function UL($){var X=this.__data__;if(d4){var J=X[$];return J===YL?void 0:J}return GL.call(X,$)?X[$]:void 0}var oU=UL;var wL=Object.prototype,KL=wL.hasOwnProperty;function NL($){var X=this.__data__;return d4?X[$]!==void 0:KL.call(X,$)}var tU=NL;var VL="__lodash_hash_undefined__";function HL($,X){var J=this.__data__;return this.size+=this.has($)?0:1,J[$]=d4&&X===void 0?VL:X,this}var aU=HL;function v1($){var X=-1,J=$==null?0:$.length;this.clear();while(++X<J){var Q=$[X];this.set(Q[0],Q[1])}}v1.prototype.clear=dU;v1.prototype.delete=rU;v1.prototype.get=oU;v1.prototype.has=tU;v1.prototype.set=aU;var uQ=v1;function OL(){this.size=0,this.__data__={hash:new uQ,map:new(pU||_U),string:new uQ}}var sU=OL;function BL($){var X=typeof $;return X=="string"||X=="number"||X=="symbol"||X=="boolean"?$!=="__proto__":$===null}var eU=BL;function jL($,X){var J=$.__data__;return eU(X)?J[typeof X=="string"?"string":"hash"]:J.map}var D6=jL;function DL($){var X=D6(this,$).delete($);return this.size-=X?1:0,X}var $w=DL;function qL($){return D6(this,$).get($)}var Xw=qL;function LL($){return D6(this,$).has($)}var Jw=LL;function FL($,X){var J=D6(this,$),Q=J.size;return J.set($,X),this.size+=J.size==Q?0:1,this}var zw=FL;function C1($){var X=-1,J=$==null?0:$.length;this.clear();while(++X<J){var Q=$[X];this.set(Q[0],Q[1])}}C1.prototype.clear=sU;C1.prototype.delete=$w;C1.prototype.get=Xw;C1.prototype.has=Jw;C1.prototype.set=zw;var lQ=C1;var{realpathSync:Ww}=(()=>({}));var ML="Expected a function";function mQ($,X){if(typeof $!="function"||X!=null&&typeof X!="function")throw TypeError(ML);var J=function(){var Q=arguments,z=X?X.apply(this,Q):Q[0],Y=J.cache;if(Y.has(z))return Y.get(z);var W=$.apply(this,Q);return J.cache=Y.set(z,W)||Y,W};return J.cache=new(mQ.Cache||lQ),J}mQ.Cache=lQ;var O4=mQ;var Qw=function(){return"/"};var h0=()=>globalThis.crypto.randomUUID();function d6($){if(!$)return!1;if(typeof $==="boolean")return $;let X=String($).toLowerCase().trim();return["1","true","yes","on"].includes(X)}function q6(){let $=new Set;return{subscribe(X){return $.add(X),()=>{$.delete(X)}},emit(...X){let J;for(let Q of $)try{Q(...X)}catch(z){(J??=[]).push(z)}if(J)throw J.length===1?J[0]:AggregateError(J,"Signal listener(s) threw")},clear(){$.clear()}}}function Yw(){return{sent:new Set,rejected:new Set}}var AL={renderTarget:"ink",workspace:"local",canDrive:!0,transcriptSource:"local-jsonl",remote:null};function bL(){let $="";if(typeof process<"u"&&typeof process.cwd==="function"&&typeof Ww==="function"){let J=Qw();try{$=Ww(J).normalize("NFC")}catch{$=J.normalize("NFC")}}return{originalCwd:$,projectRoot:$,totalCostUSD:0,totalAPIDuration:0,totalAPIDurationWithoutRetries:0,totalToolDuration:0,startTime:Date.now(),lastInteractionTime:Date.now(),totalLinesAdded:0,totalLinesRemoved:0,hasUnknownModelCost:!1,cwd:$,modelUsage:{},mainLoopModelOverride:void 0,replConfigArgv:[],initialMainLoopModel:void 0,modelStrings:null,isInteractive:!1,attacherCaps:null,hasStreamingInput:!1,modelOverrideOptOutForSession:!1,kairosActive:!1,rendererMode:void 0,strictToolResultPairing:!1,memoryToggledOff:!1,teamMemoryServerStatus:void 0,sdkAgentProgressSummariesEnabled:!1,userMsgOptIn:!1,clientType:"cli",sessionSource:void 0,sessionStartType:"fresh",questionPreviewFormat:void 0,sessionIngressToken:void 0,oauthTokenFromFd:void 0,oauthScopesFromFd:void 0,apiKeyFromFd:void 0,gatewayAuth:null,gatewayRefreshInFlight:null,flagSettingsPath:void 0,flagSettingsInline:null,parentManagedSettings:null,allowedSettingSources:["userSettings","projectSettings","localSettings","flagSettings","policySettings"],meter:null,sessionCounter:null,locCounter:null,prCounter:null,commitCounter:null,costCounter:null,tokenCounter:null,codeEditToolDecisionCounter:null,activeTimeCounter:null,statsStore:null,sessionId:h0(),parentSessionId:void 0,loggerProvider:null,eventLogger:null,meterProvider:null,tracerProvider:null,cachedTelemetryResource:null,agentColorMap:new Map,agentColorIndex:0,lastAPIRequest:null,lastCancelledAPIMessageId:null,lastAPIRequestMessages:null,lastClassifierRequests:null,cachedClaudeMdContent:null,inMemoryErrorLog:[],inlinePlugins:[],inlinePluginUrls:[],chromeFlagOverride:void 0,useCoworkPlugins:!1,sessionBypassPermissionsMode:!1,scheduledTasksEnabled:!1,sessionPrResolved:!1,sessionCronTasks:[],loopChainStartedAt:Object.create(null),sessionCreatedTeams:new Set,sessionTrustAccepted:!1,sessionPersistenceDisabled:!1,hasExitedPlanMode:!1,needsPlanModeExitAttachment:!1,needsAutoModeExitAttachment:!1,lspRecommendationShownThisSession:!1,initJsonSchema:null,registeredHooks:null,planSlugCache:new Map,teleportedSessionInfo:null,invokedSkills:new Map,slowOperations:[],sdkBetas:void 0,sdkOAuthTokenRefreshCallback:null,hostAuthTokenRefreshCallback:null,mainThreadAgentType:void 0,mainThreadAgentHooks:void 0,sessionSkillAllowlist:void 0,caps:AL,replBridgeActive:!1,directConnectServerUrl:void 0,mcpConnectNonBlocking:!1,activeRoutine:void 0,systemPromptSectionCache:new Map,lastEmittedDate:null,additionalDirectoriesForClaudeMd:[],allowedChannels:[],activeInputs:new Map,hasDevChannels:!1,sessionProjectDir:null,promptCache1hAllowlist:null,stickyBetas:Yw(),thinkingTypeOverrides:new Map,inferenceProfileBackingModels:new Map,promptId:null,promptIndex:0,lastMainRequestId:void 0,lastMainThreadCacheTtlMs:null,lastApiCompletionTimestamp:null,pendingPostCompaction:!1}}var PL=bL(),ZL=()=>{return};function cQ(){return ZL()?.sessionId??PL.sessionId}var SL=q6(),wf=SL.subscribe;var RL=q6(),Kf=RL.subscribe;var EL=q6(),Nf=EL.subscribe;var vL=q6();var Vf=vL.subscribe;var CL=q6();var Hf=CL.subscribe;var{appendFile:xK,mkdir:JM,rename:TK,stat:zM,symlink:QM,unlink:_Y}=(()=>({}));P4();function Bw({writeFn:$,flushIntervalMs:X=1000,maxBufferSize:J=100,maxBufferBytes:Q=1/0,immediateMode:z=!1}){let Y=[],W=0,G=null,U=null;function w(){if(G)clearTimeout(G),G=null}function K(O){try{$(O)}catch{}}function N(){if(U)K(U.join("")),U=null;if(Y.length===0)return;K(Y.join("")),Y=[],W=0,w()}function H(){if(!G)G=setTimeout(N,X)}function V(){if(U){U.push(...Y),Y=[],W=0,w();return}let O=Y;Y=[],W=0,w(),U=O,setImmediate(()=>{let B=U;if(U=null,B)K(B.join(""))})}return{write(O){if(z){K(O);return}if(Y.push(O),W+=O.length,H(),Y.length>=J||W>=Q)V()},flush:N,dispose(){N()}}}function xL($){if(typeof $==="function")return $;if(Symbol.asyncDispose in $)return()=>$[Symbol.asyncDispose]();return()=>$[Symbol.dispose]()}class jw{#$=new Set;register($){let X=xL($);this.#$.add(X);let J=()=>{this.#$.delete(X)};return Object.assign(J,{[Symbol.dispose]:J})}async drain(){let $=Array.from(this.#$);this.#$.clear(),await Promise.all($.map(async(X)=>X()))}async[Symbol.asyncDispose](){await this.drain()}get sizeForTesting(){return this.#$.size}}var TL=new jw;function Dw($){return TL.register($)}var qw=O4(($)=>{if(!$||$.trim()==="")return null;let X=$.split(",").map((Y)=>Y.trim()).filter(Boolean);if(X.length===0)return null;let J=X.some((Y)=>Y.startsWith("!")),Q=X.some((Y)=>!Y.startsWith("!"));if(J&&Q)return null;let z=X.map((Y)=>Y.replace(/^!/,"").toLowerCase());return{include:J?[]:z,exclude:J?z:[],isExclusive:J}});function fL($){let X=[],J=$.match(/^MCP server ["']([^"']+)["']/);if(J&&J[1])X.push("mcp"),X.push(J[1].toLowerCase());else{let Y=$.match(/^([^:[]+):/);if(Y&&Y[1])X.push(Y[1].trim().toLowerCase())}let Q=$.match(/^\[([^\]]+)]/);if(Q&&Q[1])X.push(Q[1].trim().toLowerCase());if($.toLowerCase().includes("1p event:"))X.push("1p");let z=$.match(/:\s*([^:]+?)(?:\s+(?:type|mode|status|event))?:/);if(z&&z[1]){let Y=z[1].trim().toLowerCase();if(Y.length<30&&!Y.includes(" "))X.push(Y)}return Array.from(new Set(X))}function gL($,X){if(!X)return!0;if($.length===0)return!1;if(X.isExclusive)return!$.some((J)=>X.exclude.includes(J));else return $.some((J)=>X.include.includes(J))}function Lw($,X){if(!X)return!0;let J=fL($);return gL(J,X)}var rQ=function(){return"/"};P4();var Fw=O4(()=>{return(process.env.CLAUDE_CONFIG_DIR??u4(rQ(),".claude")).normalize("NFC")},()=>process.env.CLAUDE_CONFIG_DIR);var bf=O4(()=>d6(process.env.CLAUDE_CODE_SUPERVISED));function k($,X,J,Q,z){if(Q==="m")throw TypeError("Private method is not writable");if(Q==="a"&&!z)throw TypeError("Private accessor was defined without a setter");if(typeof X==="function"?$!==X||!z:!X.has($))throw TypeError("Cannot write private member to an object whose class did not declare it");return Q==="a"?z.call($,J):z?z.value=J:X.set($,J),J}function D($,X,J,Q){if(J==="a"&&!Q)throw TypeError("Private accessor was defined without a getter");if(typeof X==="function"?$!==X||!Q:!X.has($))throw TypeError("Cannot read private member from an object whose class did not declare it");return J==="m"?Q:J==="a"?Q.call($):Q?Q.value:X.get($)}var oQ=function(){let{crypto:$}=globalThis;if($?.randomUUID)return oQ=$.randomUUID.bind($),$.randomUUID();let X=new Uint8Array(1),J=$?()=>$.getRandomValues(X)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(Q)=>(+Q^J()&15>>+Q/4).toString(16))};function r4($){return typeof $==="object"&&$!==null&&(("name"in $)&&$.name==="AbortError"||("message"in $)&&String($.message).includes("FetchRequestCanceledException"))}var u0=($)=>{if($ instanceof Error)return $;if(typeof $==="object"&&$!==null){try{if(Object.prototype.toString.call($)==="[object Error]"){let X=Error($.message,$.cause?{cause:$.cause}:{});if($.stack)X.stack=$.stack;if($.cause&&!X.cause)X.cause=$.cause;if($.name)X.name=$.name;return X}}catch{}try{return Error(JSON.stringify($))}catch{}}return Error($)};class T extends Error{}class k$ extends T{constructor($,X,J,Q,z){super(`${k$.makeMessage($,X,J)}`);this.status=$,this.headers=Q,this.requestID=Q?.get("request-id"),this.error=X,this.type=z??null}static makeMessage($,X,J){let Q=X?.message?typeof X.message==="string"?X.message:JSON.stringify(X.message):X?JSON.stringify(X):J;if($&&Q)return`${$} ${Q}`;if($)return`${$} status code (no body)`;if(Q)return Q;return"(no status code or body)"}static generate($,X,J,Q){if(!$||!Q)return new t6({message:J,cause:u0(X)});let z=X,Y=z?.error?.type;if($===400)return new m0($,z,J,Q,Y);if($===401)return new c0($,z,J,Q,Y);if($===403)return new i0($,z,J,Q,Y);if($===404)return new n0($,z,J,Q,Y);if($===409)return new p0($,z,J,Q,Y);if($===422)return new d0($,z,J,Q,Y);if($===429)return new r0($,z,J,Q,Y);if($>=500)return new o0($,z,J,Q,Y);return new k$($,z,J,Q,Y)}}class f$ extends k${constructor({message:$}={}){super(void 0,void 0,$||"Request was aborted.",void 0)}}class t6 extends k${constructor({message:$,cause:X}){super(void 0,void 0,$||"Connection error.",void 0);if(X)this.cause=X}}class l0 extends t6{constructor({message:$}={}){super({message:$??"Request timed out."})}}class m0 extends k${}class c0 extends k${}class i0 extends k${}class n0 extends k${}class p0 extends k${}class d0 extends k${}class r0 extends k${}class o0 extends k${}var hL=/^[a-z][a-z0-9+.-]*:/i,Mw=($)=>{return hL.test($)},tQ=($)=>(tQ=Array.isArray,tQ($)),aQ=tQ;function T8($){if(typeof $!=="object")return{};return $??{}}function sQ($){if(!$)return!0;for(let X in $)return!1;return!0}function Iw($,X){return Object.prototype.hasOwnProperty.call($,X)}var Aw=($,X)=>{if(typeof X!=="number"||!Number.isInteger(X))throw new T(`${$} must be an integer`);if(X<0)throw new T(`${$} must be a positive integer`);return X};var f8=($)=>{try{return JSON.parse($)}catch(X){return}};var bw=($)=>new Promise((X)=>setTimeout(X,$));var B4="0.94.0";var Rw=()=>{return typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u"};function uL(){if(typeof Deno<"u"&&Deno.build!=null)return"deno";if(typeof EdgeRuntime<"u")return"edge";if(Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]")return"node";return"unknown"}var lL=()=>{let $=uL();if($==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":B4,"X-Stainless-OS":Zw(Deno.build.os),"X-Stainless-Arch":Pw(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version==="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":B4,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if($==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":B4,"X-Stainless-OS":Zw(globalThis.process.platform??"unknown"),"X-Stainless-Arch":Pw(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let X=mL();if(X)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":B4,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${X.browser}`,"X-Stainless-Runtime-Version":X.version};return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":B4,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function mL(){if(typeof navigator>"u"||!navigator)return null;let $=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:X,pattern:J}of $){let Q=J.exec(navigator.userAgent);if(Q){let z=Q[1]||0,Y=Q[2]||0,W=Q[3]||0;return{browser:X,version:`${z}.${Y}.${W}`}}}return null}var Pw=($)=>{if($==="x32")return"x32";if($==="x86_64"||$==="x64")return"x64";if($==="arm")return"arm";if($==="aarch64"||$==="arm64")return"arm64";if($)return`other:${$}`;return"unknown"},Zw=($)=>{if($=$.toLowerCase(),$.includes("ios"))return"iOS";if($==="android")return"Android";if($==="darwin")return"MacOS";if($==="win32")return"Windows";if($==="freebsd")return"FreeBSD";if($==="openbsd")return"OpenBSD";if($==="linux")return"Linux";if($)return`Other:${$}`;return"Unknown"},Sw,t0=()=>{return Sw??(Sw=lL())};function Ew(){if(typeof fetch<"u")return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function eQ(...$){let X=globalThis.ReadableStream;if(typeof X>"u")throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new X(...$)}function g8($){let X=Symbol.asyncIterator in $?$[Symbol.asyncIterator]():$[Symbol.iterator]();return eQ({start(){},async pull(J){let{done:Q,value:z}=await X.next();if(Q)J.close();else J.enqueue(z)},async cancel(){await X.return?.()}})}function a0($){if($[Symbol.asyncIterator])return $;let X=$.getReader();return{async next(){try{let J=await X.read();if(J?.done)X.releaseLock();return J}catch(J){throw X.releaseLock(),J}},async return(){let J=X.cancel();return X.releaseLock(),await J,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function vw($){if($===null||typeof $!=="object")return;if($[Symbol.asyncIterator]){await $[Symbol.asyncIterator]().return?.();return}let X=$.getReader(),J=X.cancel();X.releaseLock(),await J}var Cw=({headers:$,body:X})=>{return{bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(X)}};function kw($){return Object.entries($).filter(([X,J])=>typeof J<"u").map(([X,J])=>{if(typeof J==="string"||typeof J==="number"||typeof J==="boolean")return`${encodeURIComponent(X)}=${encodeURIComponent(J)}`;if(J===null)return`${encodeURIComponent(X)}=`;throw new T(`Cannot stringify type ${typeof J}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}var xw="urn:ietf:params:oauth:grant-type:jwt-bearer",Tw="refresh_token",y8="/v1/oauth/token",a6="oauth-2025-04-20",fw="oidc-federation-2026-04-01",gw=120,_1=30,yw=5,_w=1048576;function h8($){if(!$)return;let X;try{X=new URL($)}catch(Q){throw new K$(`Invalid token endpoint base URL "${$}": ${Q}`)}if(X.protocol==="https:")return;let J=X.hostname.toLowerCase().replace(/^\[|\]$/g,"");if(X.protocol==="http:"&&(J==="localhost"||J==="127.0.0.1"||J==="::1"))return;throw new K$(`Refusing to send credential over non-https token endpoint "${$}"`)}async function u8($,X){let J=await pL($),Q;try{Q=JSON.parse(J)}catch{throw new K$(`Token endpoint returned non-JSON response (status ${$.status})`,$.status,t$(J),X)}if(!Q.access_token)throw new K$(`Token endpoint response missing access_token: ${JSON.stringify(t$(Q))}`,$.status,t$(Q),X);if(Q.token_type&&Q.token_type.toLowerCase()!=="bearer")throw new K$(`Token endpoint response: unsupported token_type "${Q.token_type}" (want Bearer)`,$.status,t$(Q),X);return Q}var $Y=2000,nL=new Set(["error","error_description","error_uri"]);function t$($){if($==null)return $;if(typeof $==="string"){let X;try{X=JSON.parse($)}catch{if($.length<=$Y)return $;return $.slice(0,$Y)+`... <${$.length-$Y} more chars>`}return JSON.stringify(t$(X))}if(typeof $==="object"&&!Array.isArray($)){let X={};for(let[J,Q]of Object.entries($))if(nL.has(J))X[J]=Q;return X}return null}async function l8($,X=(J)=>console.warn(`anthropic-sdk: ${J}`)){if(typeof process>"u"||process.platform==="win32")return;let J=await import("node:fs"),Q=$,z;try{Q=await J.promises.realpath($),z=await J.promises.stat(Q)}catch{return}let Y=z.mode&511;if(Y&18)throw new K$(`Credentials file at ${Q} is group/world-writable (mode 0o${Y.toString(8)}); this allows other local users to plant tokens. Run \`chmod 600 ${Q}\`.`);if(Y&36)throw new K$(`Credentials file at ${Q} is group/world-readable (mode 0o${Y.toString(8)}); run \`chmod 600 ${Q}\` before retrying.`);if(typeof process.getuid==="function"&&z.uid!==process.getuid())X(`credentials file at ${Q} is owned by uid ${z.uid} (current process uid ${process.getuid()}); verify this is intentional.`)}async function m8($,X){let J=await import("node:fs"),z=(await Promise.resolve().then(() => (P4(),o6))).dirname($);await J.promises.mkdir(z,{recursive:!0,mode:448});let Y=`${$}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;try{let W=await J.promises.open(Y,"w",384);try{await W.writeFile(JSON.stringify(X,null,2)),await W.sync()}finally{await W.close()}await J.promises.rename(Y,$)}catch(W){throw await J.promises.unlink(Y).catch(()=>{}),W}try{let W=await J.promises.open(z,"r");try{await W.sync()}finally{await W.close()}}catch{}}async function pL($){if(!$.body)return"";let X=$.body.getReader(),J=[],Q=0;for(;;){let{done:Y,value:W}=await X.read();if(Y)break;if(Q+W.length>_w){let G=_w-Q;if(G>0)J.push(W.subarray(0,G));await X.cancel();break}J.push(W),Q+=W.length}let z;if(J.length===1)z=J[0];else{z=new Uint8Array(J.reduce((W,G)=>W+G.length,0));let Y=0;for(let W of J)z.set(W,Y),Y+=W.length}return new TextDecoder("utf-8").decode(z)}class K$ extends T{constructor($,X=null,J=null,Q=null){super($);this.statusCode=X,this.body=J,this.requestId=Q}}function Z4(){return Math.floor(Date.now()/1000)}class XY{constructor($,X){this.cached=null,this.pendingRefresh=null,this.nextForce=!1,this.lastAdvisoryError=0,this.provider=$,this.onAdvisoryRefreshError=X}async getToken(){let $=this.nextForce;this.nextForce=!1;let X=this.cached;if($||X==null)return(await this.refresh($)).token;if(X.expiresAt==null)return X.token;let J=X.expiresAt-Z4();if(J>gw)return X.token;if(J>_1)return this.backgroundRefresh(),X.token;return(await this.refresh()).token}invalidate(){this.cached=null,this.nextForce=!0}refresh($=!1){if(this.pendingRefresh&&!$)return this.pendingRefresh;return this.doRefresh($)}backgroundRefresh(){if(this.pendingRefresh)return;if(Z4()-this.lastAdvisoryError<yw)return;this.doRefresh().catch(($)=>{this.lastAdvisoryError=Z4(),this.onAdvisoryRefreshError?.($)})}doRefresh($=!1){return this.pendingRefresh=this.provider($?{forceRefresh:!0}:void 0).then((X)=>{return this.cached=X,this.pendingRefresh=null,X},(X)=>{throw this.pendingRefresh=null,X}),this.pendingRefresh}}var w$=($)=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[$]?.trim()||void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.($)?.trim()||void 0;return};function lw($){let X=0;for(let z of $)X+=z.length;let J=new Uint8Array(X),Q=0;for(let z of $)J.set(z,Q),Q+=z.length;return J}var hw;function x1($){let X;return(hw??(X=new globalThis.TextEncoder,hw=X.encode.bind(X)))($)}var uw;function JY($){let X;return(uw??(X=new globalThis.TextDecoder,uw=X.decode.bind(X)))($)}var i8={off:0,error:200,warn:300,info:400,debug:500},zY=($,X,J)=>{if(!$)return;if(Iw(i8,$))return $;S$(J).warn(`${X} was set to ${JSON.stringify($)}, expected one of ${JSON.stringify(Object.keys(i8))}`);return};function s0(){}function c8($,X,J){if(!X||i8[$]>i8[J])return s0;else return X[$].bind(X)}var dL={error:s0,warn:s0,info:s0,debug:s0},mw=new WeakMap;function S$($){let X=$.logger,J=$.logLevel??"off";if(!X)return dL;let Q=mw.get(X);if(Q&&Q[0]===J)return Q[1];let z={error:c8("error",X,J),warn:c8("warn",X,J),info:c8("info",X,J),debug:c8("debug",X,J)};return mw.set(X,[J,z]),z}var o4=($)=>{if($.options)$.options={...$.options},delete $.options.headers;if($.headers)$.headers=Object.fromEntries(($.headers instanceof Headers?[...$.headers]:Object.entries($.headers)).map(([X,J])=>[X,X.toLowerCase()==="x-api-key"||X.toLowerCase()==="authorization"||X.toLowerCase()==="cookie"||X.toLowerCase()==="set-cookie"?"***":J]));if("retryOfRequestLogID"in $){if($.retryOfRequestLogID)$.retryOf=$.retryOfRequestLogID;delete $.retryOfRequestLogID}return $};var n8="1.0",rL=/^[A-Za-z0-9_.-]+$/;function cw($){if(!$)throw Error("profile name is empty");if($==="."||$==="..")throw Error(`profile name "${$}" is not allowed`);if($.includes("/")||$.includes("\\"))throw Error(`profile name "${$}" must not contain path separators`);if(!rL.test($))throw Error(`profile name "${$}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}var iw=async($)=>{var X,J;let Q=await QY();if(Q===null)return null;let z=$??await pw();if(z===null)return null;cw(z);let Y=await import("node:fs"),G=(await Promise.resolve().then(() => (P4(),o6))).join(Q,"configs",`${z}.json`),U;try{U=await Y.promises.readFile(G,"utf-8")}catch(N){if(N?.code!=="ENOENT")throw Error(`failed to read config file ${G}: ${N}`);U=null}if(U===null){let N=w$("ANTHROPIC_ORGANIZATION_ID"),H=w$("ANTHROPIC_IDENTITY_TOKEN_FILE"),V=w$("ANTHROPIC_FEDERATION_RULE_ID");if(V&&N)return{fromFile:!1,config:{organization_id:N,workspace_id:w$("ANTHROPIC_WORKSPACE_ID"),base_url:w$("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:V,service_account_id:w$("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:H?{source:"file",path:H}:void 0,scope:w$("ANTHROPIC_SCOPE")}}};return null}let w;try{w=JSON.parse(U)}catch(N){throw Error(`failed to parse config file ${G}: ${N}`)}if(!w.authentication)throw Error(`config file ${G} is missing "authentication"`);let K=w.authentication.type;if(K!=="oidc_federation"&&K!=="user_oauth")throw Error(`authentication.type "${K}" is not a known authentication type`);if(w.organization_id??(w.organization_id=w$("ANTHROPIC_ORGANIZATION_ID")),w.workspace_id??(w.workspace_id=w$("ANTHROPIC_WORKSPACE_ID")),w.base_url??(w.base_url=w$("ANTHROPIC_BASE_URL")),(X=w.authentication).scope??(X.scope=w$("ANTHROPIC_SCOPE")),w.authentication.type==="oidc_federation"){if(!w.authentication.identity_token){let N=w$("ANTHROPIC_IDENTITY_TOKEN_FILE");if(N)w.authentication.identity_token={source:"file",path:N}}if(!w.authentication.federation_rule_id)w.authentication.federation_rule_id=w$("ANTHROPIC_FEDERATION_RULE_ID")??"";(J=w.authentication).service_account_id??(J.service_account_id=w$("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:w,fromFile:!0}};var nw=async($,X)=>{if($?.authentication.credentials_path)return $.authentication.credentials_path;let J=await QY();if(!J)return null;let Q=X??await pw();if(!Q)return null;return cw(Q),(await Promise.resolve().then(() => (P4(),o6))).join(J,"credentials",`${Q}.json`)},QY=async()=>{if(!oL())return null;let $=await Promise.resolve().then(() => (P4(),o6)),X=w$("ANTHROPIC_CONFIG_DIR");if(X)return X;if(t0()["X-Stainless-OS"]==="Windows"){let Y=w$("APPDATA");if(Y)return $.join(Y,"Anthropic");let W=w$("USERPROFILE");if(W)return $.join(W,"AppData","Roaming","Anthropic");return null}let Q=w$("XDG_CONFIG_HOME");if(Q)return $.join(Q,"anthropic");let z=w$("HOME");if(z)return $.join(z,".config","anthropic");return null},oL=()=>{let $=t0()["X-Stainless-Runtime"];return $==="node"||$==="deno"},pw=async()=>{let $=await QY();if(!$)return null;let X=w$("ANTHROPIC_PROFILE");if(X)return X;let J=await import("node:fs"),z=(await Promise.resolve().then(() => (P4(),o6))).join($,"active_config");try{return(await J.promises.readFile(z,"utf-8")).trim()||"default"}catch(Y){if(Y?.code!=="ENOENT")throw Error(`failed to read ${z}: ${Y}`);return"default"}};function YY($){if(!$)throw new T("Identity token file path is empty");return async()=>{let X=await import("node:fs"),J;try{J=await X.promises.readFile($,"utf-8")}catch(z){throw new T(`Failed to read identity token file at ${$}: ${z}`)}let Q=J.trim();if(!Q)throw new T(`Identity token file at ${$} is empty`);return Q}}function dw($){if(!$)throw new T("Identity token value is empty");return()=>$}function rw($){return async()=>{h8($.baseURL);let X=await $.identityTokenProvider();if(X.length>16384)throw new K$(`Identity token is ${Math.ceil(X.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let J={grant_type:xw,assertion:X,federation_rule_id:$.federationRuleId,organization_id:$.organizationId};if($.serviceAccountId)J.service_account_id=$.serviceAccountId;if($.workspaceId)J.workspace_id=$.workspaceId;let Q=`${$.baseURL}${y8}`,z;try{z=await $.fetch(Q,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${a6},${fw}`,"User-Agent":$.userAgent||`anthropic-sdk-typescript/${B4} oidcFederationProvider`},body:JSON.stringify(J)})}catch(U){throw new K$(`Failed to reach token endpoint ${Q}: ${U}`)}let Y=z.headers.get("Request-Id");if(!z.ok){let U=await z.text().catch(()=>""),w=t$(U),K="";if(z.status===401)K=` Ensure your federation rule matches your identity token. ${$.workspaceId?"":"If your federation rule is scoped to multiple workspaces, set the ANTHROPIC_WORKSPACE_ID environment variable, the 'workspace_id' config key, or the `workspaceId` option. "}View your authentication events in the Workload identity page of Claude Console for more details.`;throw new K$(`Token exchange failed with status ${z.status}${Y?` (request-id ${Y})`:""}: ${w}${K}`,z.status,w,Y)}let W=await u8(z,Y),G=Number(W.expires_in);if(!Number.isFinite(G))throw new K$(`Token endpoint response missing required fields: ${JSON.stringify(t$(W))}`,z.status,t$(W),Y);return{token:W.access_token,expiresAt:Z4()+G}}}function ow($){return async(X)=>{let J=await import("node:fs");await l8($.credentialsPath,$.onSafetyWarning);let Q;try{Q=await J.promises.readFile($.credentialsPath,"utf-8")}catch(L){throw new K$(`Credentials file not found at ${$.credentialsPath}: ${L}`)}let z;try{z=JSON.parse(Q)}catch(L){throw new K$(`Credentials file at ${$.credentialsPath} is not valid JSON: ${L}`)}let Y=z.access_token;if(!Y)throw new K$(`Credentials file at ${$.credentialsPath} must include 'access_token'`);let W=z.expires_at;if(!X?.forceRefresh&&(W==null||Z4()<W-_1))return{token:Y,expiresAt:W??null};let G=z.refresh_token;if(!$.clientId||!G)throw new K$(`Access token at ${$.credentialsPath} has expired and no refresh is available (client_id ${$.clientId?"set":"empty"}, refresh_token ${G?"set":"empty"})`);h8($.baseURL);let U={grant_type:Tw,refresh_token:G,client_id:$.clientId},w=`${$.baseURL}${y8}`,K;try{K=await $.fetch(w,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":a6,"User-Agent":$.userAgent||`anthropic-sdk-typescript/${B4} userOAuthProvider`},body:JSON.stringify(U)})}catch(L){throw new K$(`User OAuth refresh failed to reach token endpoint: ${L}`)}let N=K.headers.get("Request-Id");if(!K.ok){let L=await K.text().catch(()=>"");throw new K$(`User OAuth refresh failed (HTTP ${K.status}): ${t$(L)}`,K.status,t$(L),N)}let H=await u8(K,N),V=Number(H.expires_in);if(!Number.isFinite(V))throw new K$(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(t$(H))}`,K.status,t$(H),N);let O=Z4()+V,B=H.refresh_token||G;return await m8($.credentialsPath,{...z,version:n8,type:"oauth_token",access_token:H.access_token,expires_at:O,refresh_token:B}),{token:H.access_token,expiresAt:O}}}function WY($,X){let J=$.authentication.credentials_path??null,Q=($.base_url||X.baseURL).replace(/\/+$/,""),z=tL($,J,Q,X),Y={};if($.workspace_id&&$.authentication.type==="user_oauth")Y["anthropic-workspace-id"]=$.workspace_id;return{provider:z,extraHeaders:Y,baseURL:$.base_url||void 0}}async function tw($,X){let J=await iw(X);if(!J)return null;let{config:Q,fromFile:z}=J,Y=Q.authentication.credentials_path||!z?Q:{...Q,authentication:{...Q.authentication,credentials_path:await nw(Q,X)??void 0}};return WY(Y,$)}function tL($,X,J,Q){switch($.authentication.type){case"oidc_federation":{let z=$.authentication,Y=aL(z);if(!Y)throw new K$("oidc_federation config requires an identity token (set authentication.identity_token, ANTHROPIC_IDENTITY_TOKEN_FILE, or ANTHROPIC_IDENTITY_TOKEN)");if(!z.federation_rule_id)throw new K$("oidc_federation config requires 'federation_rule_id'. Set it in authentication.federation_rule_id in your profile, or via ANTHROPIC_FEDERATION_RULE_ID (profile takes precedence).");if(!$.organization_id)throw new K$("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let W=rw({identityTokenProvider:Y,federationRuleId:z.federation_rule_id,organizationId:$.organization_id,serviceAccountId:z.service_account_id,workspaceId:$.workspace_id,baseURL:J,fetch:Q.fetch,userAgent:Q.userAgent});if(X)return sL(W,X,Q.onCacheWriteError,Q.onSafetyWarning);return W}case"user_oauth":{if(!X)throw new K$("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to <config_dir>/credentials/<profile>.json)");return ow({credentialsPath:X,clientId:$.authentication.client_id,baseURL:J,fetch:Q.fetch,userAgent:Q.userAgent,onSafetyWarning:Q.onSafetyWarning})}default:{let z=$.authentication.type;throw new K$(`authentication.type "${z}" is not a known authentication type`)}}}function aL($){if($.identity_token){let Q=$.identity_token.source;if(Q!=="file")throw new K$(`identity_token.source "${Q}" is not supported by this SDK version (only "file")`);if(!$.identity_token.path)throw new K$('identity_token.source "file" requires a non-empty path');return YY($.identity_token.path)}let X=w$("ANTHROPIC_IDENTITY_TOKEN_FILE");if(X)return YY(X);let J=w$("ANTHROPIC_IDENTITY_TOKEN");if(J)return dw(J);return null}function sL($,X,J,Q){return async(z)=>{let Y=await import("node:fs");await l8(X,Q);let W;try{let U=await Y.promises.readFile(X,"utf-8");W=JSON.parse(U);let w=W?.access_token;if(w&&!z?.forceRefresh){let K=W?.expires_at;if(K==null||Z4()<K-_1)return{token:w,expiresAt:K??null}}}catch(U){if(U?.code!=="ENOENT"&&!(U instanceof SyntaxError))J?.(U)}let G=await $(z);try{await m8(X,{...W??{},version:n8,type:"oauth_token",access_token:G.token,expires_at:G.expiresAt})}catch(U){J?.(U)}return G}}var Y4,W4;class L6{constructor(){Y4.set(this,void 0),W4.set(this,void 0),k(this,Y4,new Uint8Array,"f"),k(this,W4,null,"f")}decode($){if($==null)return[];let X=$ instanceof ArrayBuffer?new Uint8Array($):typeof $==="string"?x1($):$;k(this,Y4,lw([D(this,Y4,"f"),X]),"f");let J=[],Q;while((Q=eL(D(this,Y4,"f"),D(this,W4,"f")))!=null){if(Q.carriage&&D(this,W4,"f")==null){k(this,W4,Q.index,"f");continue}if(D(this,W4,"f")!=null&&(Q.index!==D(this,W4,"f")+1||Q.carriage)){J.push(JY(D(this,Y4,"f").subarray(0,D(this,W4,"f")-1))),k(this,Y4,D(this,Y4,"f").subarray(D(this,W4,"f")),"f"),k(this,W4,null,"f");continue}let z=D(this,W4,"f")!==null?Q.preceding-1:Q.preceding,Y=JY(D(this,Y4,"f").subarray(0,z));J.push(Y),k(this,Y4,D(this,Y4,"f").subarray(Q.index),"f"),k(this,W4,null,"f")}return J}flush(){if(!D(this,Y4,"f").length)return[];return this.decode(`
11
+ deps: ${J}}`};var fC={keyword:"dependencies",type:"object",schemaType:"object",error:Sj.error,code($){let[X,J]=gC($);Pj($,X),Zj($,J)}};function gC({schema:$}){let X={},J={};for(let Q in $){if(Q==="__proto__")continue;let z=Array.isArray($[Q])?X:J;z[Q]=$[Q]}return[X,J]}function Pj($,X=$.schema){let{gen:J,data:Q,it:z}=$;if(Object.keys(X).length===0)return;let Y=J.let("missing");for(let W in X){let G=X[W];if(G.length===0)continue;let U=(0,R8.propertyInData)(J,Q,W,z.opts.ownProperties);if($.setParams({property:W,depsCount:G.length,deps:G.join(", ")}),z.allErrors)J.if(U,()=>{for(let w of G)(0,R8.checkReportMissingProp)($,w)});else J.if(XU._`${U} && (${(0,R8.checkMissingProp)($,G,Y)})`),(0,R8.reportMissingProp)($,Y),J.else()}}Sj.validatePropertyDeps=Pj;function Zj($,X=$.schema){let{gen:J,data:Q,keyword:z,it:Y}=$,W=J.name("valid");for(let G in X){if((0,TC.alwaysValidSchema)(Y,X[G]))continue;J.if((0,R8.propertyInData)(J,Q,G,Y.opts.ownProperties),()=>{let U=$.subschema({keyword:z,schemaProp:G},W);$.mergeValidEvaluated(U,W)},()=>J.var(W,!0)),$.ok(W)}}Sj.validateSchemaDeps=Zj;Sj.default=fC});var _j=x((kj)=>{Object.defineProperty(kj,"__esModule",{value:!0});var Cj=s(),uC=Y$(),lC={message:"property name must be valid",params:({params:$})=>Cj._`{propertyName: ${$.propertyName}}`},mC={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:lC,code($){let{gen:X,schema:J,data:Q,it:z}=$;if((0,uC.alwaysValidSchema)(z,J))return;let Y=X.name("valid");X.forIn("key",Q,(W)=>{$.setParams({propertyName:W}),$.subschema({keyword:"propertyNames",data:W,dataTypes:["string"],propertyName:W,compositeRule:!0},Y),X.if((0,Cj.not)(Y),()=>{if($.error(!0),!z.allErrors)X.break()})}),$.ok(Y)}};kj.default=mC});var JU=x((xj)=>{Object.defineProperty(xj,"__esModule",{value:!0});var vQ=A4(),g4=s(),iC=N6(),CQ=Y$(),nC={message:"must NOT have additional properties",params:({params:$})=>g4._`{additionalProperty: ${$.additionalProperty}}`},pC={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:nC,code($){let{gen:X,schema:J,parentSchema:Q,data:z,errsCount:Y,it:W}=$;if(!Y)throw Error("ajv implementation error");let{allErrors:G,opts:U}=W;if(W.props=!0,U.removeAdditional!=="all"&&(0,CQ.alwaysValidSchema)(W,J))return;let w=(0,vQ.allSchemaProperties)(Q.properties),K=(0,vQ.allSchemaProperties)(Q.patternProperties);N(),$.ok(g4._`${Y} === ${iC.default.errors}`);function N(){X.forIn("key",z,(L)=>{if(!w.length&&!K.length)O(L);else X.if(H(L),()=>O(L))})}function H(L){let F;if(w.length>8){let Z=(0,CQ.schemaRefOrVal)(W,Q.properties,"properties");F=(0,vQ.isOwnProperty)(X,Z,L)}else if(w.length)F=(0,g4.or)(...w.map((Z)=>g4._`${L} === ${Z}`));else F=g4.nil;if(K.length)F=(0,g4.or)(F,...K.map((Z)=>g4._`${(0,vQ.usePattern)($,Z)}.test(${L})`));return(0,g4.not)(F)}function V(L){X.code(g4._`delete ${z}[${L}]`)}function O(L){if(U.removeAdditional==="all"||U.removeAdditional&&J===!1){V(L);return}if(J===!1){if($.setParams({additionalProperty:L}),$.error(),!G)X.break();return}if(typeof J=="object"&&!(0,CQ.alwaysValidSchema)(W,J)){let F=X.name("valid");if(U.removeAdditional==="failing")B(L,F,!1),X.if((0,g4.not)(F),()=>{$.reset(),V(L)});else if(B(L,F),!G)X.if((0,g4.not)(F),()=>X.break())}}function B(L,F,Z){let C={keyword:"additionalProperties",dataProp:L,dataPropType:CQ.Type.Str};if(Z===!1)Object.assign(C,{compositeRule:!0,createErrors:!1,allErrors:!1});$.subschema(C,F)}}};xj.default=pC});var yj=x((gj)=>{Object.defineProperty(gj,"__esModule",{value:!0});var rC=j8(),Tj=A4(),zU=Y$(),fj=JU(),oC={keyword:"properties",type:"object",schemaType:"object",code($){let{gen:X,schema:J,parentSchema:Q,data:z,it:Y}=$;if(Y.opts.removeAdditional==="all"&&Q.additionalProperties===void 0)fj.default.code(new rC.KeywordCxt(Y,fj.default,"additionalProperties"));let W=(0,Tj.allSchemaProperties)(J);for(let N of W)Y.definedProperties.add(N);if(Y.opts.unevaluated&&W.length&&Y.props!==!0)Y.props=zU.mergeEvaluated.props(X,(0,zU.toHash)(W),Y.props);let G=W.filter((N)=>!(0,zU.alwaysValidSchema)(Y,J[N]));if(G.length===0)return;let U=X.name("valid");for(let N of G){if(w(N))K(N);else{if(X.if((0,Tj.propertyInData)(X,z,N,Y.opts.ownProperties)),K(N),!Y.allErrors)X.else().var(U,!0);X.endIf()}$.it.definedProperties.add(N),$.ok(U)}function w(N){return Y.opts.useDefaults&&!Y.compositeRule&&J[N].default!==void 0}function K(N){$.subschema({keyword:"properties",schemaProp:N,dataProp:N},U)}}};gj.default=oC});var cj=x((mj)=>{Object.defineProperty(mj,"__esModule",{value:!0});var hj=A4(),kQ=s(),uj=Y$(),lj=Y$(),aC={keyword:"patternProperties",type:"object",schemaType:"object",code($){let{gen:X,schema:J,data:Q,parentSchema:z,it:Y}=$,{opts:W}=Y,G=(0,hj.allSchemaProperties)(J),U=G.filter((B)=>(0,uj.alwaysValidSchema)(Y,J[B]));if(G.length===0||U.length===G.length&&(!Y.opts.unevaluated||Y.props===!0))return;let w=W.strictSchema&&!W.allowMatchingProperties&&z.properties,K=X.name("valid");if(Y.props!==!0&&!(Y.props instanceof kQ.Name))Y.props=(0,lj.evaluatedPropsToName)(X,Y.props);let{props:N}=Y;H();function H(){for(let B of G){if(w)V(B);if(Y.allErrors)O(B);else X.var(K,!0),O(B),X.if(K)}}function V(B){for(let L in w)if(new RegExp(B).test(L))(0,uj.checkStrictMode)(Y,`property ${L} matches pattern ${B} (use allowMatchingProperties)`)}function O(B){X.forIn("key",Q,(L)=>{X.if(kQ._`${(0,hj.usePattern)($,B)}.test(${L})`,()=>{let F=U.includes(B);if(!F)$.subschema({keyword:"patternProperties",schemaProp:B,dataProp:L,dataPropType:lj.Type.Str},K);if(Y.opts.unevaluated&&N!==!0)X.assign(kQ._`${N}[${L}]`,!0);else if(!F&&!Y.allErrors)X.if((0,kQ.not)(K),()=>X.break())})})}}};mj.default=aC});var nj=x((ij)=>{Object.defineProperty(ij,"__esModule",{value:!0});var eC=Y$(),$k={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code($){let{gen:X,schema:J,it:Q}=$;if((0,eC.alwaysValidSchema)(Q,J)){$.fail();return}let z=X.name("valid");$.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},z),$.failResult(z,()=>$.reset(),()=>$.error())},error:{message:"must NOT be valid"}};ij.default=$k});var dj=x((pj)=>{Object.defineProperty(pj,"__esModule",{value:!0});var Jk=A4(),zk={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Jk.validateUnion,error:{message:"must match a schema in anyOf"}};pj.default=zk});var oj=x((rj)=>{Object.defineProperty(rj,"__esModule",{value:!0});var _Q=s(),Yk=Y$(),Wk={message:"must match exactly one schema in oneOf",params:({params:$})=>_Q._`{passingSchemas: ${$.passing}}`},Gk={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Wk,code($){let{gen:X,schema:J,parentSchema:Q,it:z}=$;if(!Array.isArray(J))throw Error("ajv implementation error");if(z.opts.discriminator&&Q.discriminator)return;let Y=J,W=X.let("valid",!1),G=X.let("passing",null),U=X.name("_valid");$.setParams({passing:G}),X.block(w),$.result(W,()=>$.reset(),()=>$.error(!0));function w(){Y.forEach((K,N)=>{let H;if((0,Yk.alwaysValidSchema)(z,K))X.var(U,!0);else H=$.subschema({keyword:"oneOf",schemaProp:N,compositeRule:!0},U);if(N>0)X.if(_Q._`${U} && ${W}`).assign(W,!1).assign(G,_Q._`[${G}, ${N}]`).else();X.if(U,()=>{if(X.assign(W,!0),X.assign(G,N),H)$.mergeEvaluated(H,_Q.Name)})})}}};rj.default=Gk});var aj=x((tj)=>{Object.defineProperty(tj,"__esModule",{value:!0});var wk=Y$(),Kk={keyword:"allOf",schemaType:"array",code($){let{gen:X,schema:J,it:Q}=$;if(!Array.isArray(J))throw Error("ajv implementation error");let z=X.name("valid");J.forEach((Y,W)=>{if((0,wk.alwaysValidSchema)(Q,Y))return;let G=$.subschema({keyword:"allOf",schemaProp:W},z);$.ok(z),$.mergeEvaluated(G)})}};tj.default=Kk});var XD=x(($D)=>{Object.defineProperty($D,"__esModule",{value:!0});var xQ=s(),ej=Y$(),Vk={message:({params:$})=>xQ.str`must match "${$.ifClause}" schema`,params:({params:$})=>xQ._`{failingKeyword: ${$.ifClause}}`},Hk={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Vk,code($){let{gen:X,parentSchema:J,it:Q}=$;if(J.then===void 0&&J.else===void 0)(0,ej.checkStrictMode)(Q,'"if" without "then" and "else" is ignored');let z=sj(Q,"then"),Y=sj(Q,"else");if(!z&&!Y)return;let W=X.let("valid",!0),G=X.name("_valid");if(U(),$.reset(),z&&Y){let K=X.let("ifClause");$.setParams({ifClause:K}),X.if(G,w("then",K),w("else",K))}else if(z)X.if(G,w("then"));else X.if((0,xQ.not)(G),w("else"));$.pass(W,()=>$.error(!0));function U(){let K=$.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},G);$.mergeEvaluated(K)}function w(K,N){return()=>{let H=$.subschema({keyword:K},G);if(X.assign(W,G),$.mergeValidEvaluated(H,W),N)X.assign(N,xQ._`${K}`);else $.setParams({ifClause:K})}}}};function sj($,X){let J=$.schema[X];return J!==void 0&&!(0,ej.alwaysValidSchema)($,J)}$D.default=Hk});var zD=x((JD)=>{Object.defineProperty(JD,"__esModule",{value:!0});var Bk=Y$(),jk={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:$,parentSchema:X,it:J}){if(X.if===void 0)(0,Bk.checkStrictMode)(J,`"${$}" without "if" is ignored`)}};JD.default=jk});var YD=x((QD)=>{Object.defineProperty(QD,"__esModule",{value:!0});var qk=eG(),Lk=Lj(),Fk=$U(),Mk=Ij(),Ik=bj(),Ak=vj(),bk=_j(),Pk=JU(),Zk=yj(),Sk=cj(),Rk=nj(),Ek=dj(),vk=oj(),Ck=aj(),kk=XD(),_k=zD();function xk($=!1){let X=[Rk.default,Ek.default,vk.default,Ck.default,kk.default,_k.default,bk.default,Pk.default,Ak.default,Zk.default,Sk.default];if($)X.push(Lk.default,Mk.default);else X.push(qk.default,Fk.default);return X.push(Ik.default),X}QD.default=xk});var GD=x((WD)=>{Object.defineProperty(WD,"__esModule",{value:!0});var E$=s(),fk={message:({schemaCode:$})=>E$.str`must match format "${$}"`,params:({schemaCode:$})=>E$._`{format: ${$}}`},gk={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:fk,code($,X){let{gen:J,data:Q,$data:z,schema:Y,schemaCode:W,it:G}=$,{opts:U,errSchemaPath:w,schemaEnv:K,self:N}=G;if(!U.validateFormats)return;if(z)H();else V();function H(){let O=J.scopeValue("formats",{ref:N.formats,code:U.code.formats}),B=J.const("fDef",E$._`${O}[${W}]`),L=J.let("fType"),F=J.let("format");J.if(E$._`typeof ${B} == "object" && !(${B} instanceof RegExp)`,()=>J.assign(L,E$._`${B}.type || "string"`).assign(F,E$._`${B}.validate`),()=>J.assign(L,E$._`"string"`).assign(F,B)),$.fail$data((0,E$.or)(Z(),C()));function Z(){if(U.strictSchema===!1)return E$.nil;return E$._`${W} && !${F}`}function C(){let m=K.$async?E$._`(${B}.async ? await ${F}(${Q}) : ${F}(${Q}))`:E$._`${F}(${Q})`,c=E$._`(typeof ${F} == "function" ? ${m} : ${F}.test(${Q}))`;return E$._`${F} && ${F} !== true && ${L} === ${X} && !${c}`}}function V(){let O=N.formats[Y];if(!O){Z();return}if(O===!0)return;let[B,L,F]=C(O);if(B===X)$.pass(m());function Z(){if(U.strictSchema===!1){N.logger.warn(c());return}throw Error(c());function c(){return`unknown format "${Y}" ignored in schema at path "${w}"`}}function C(c){let v$=c instanceof RegExp?(0,E$.regexpCode)(c):U.code.formats?E$._`${U.code.formats}${(0,E$.getProperty)(Y)}`:void 0,H4=J.scopeValue("formats",{key:Y,ref:c,code:v$});if(typeof c=="object"&&!(c instanceof RegExp))return[c.type||"string",c.validate,E$._`${H4}.validate`];return["string",c,H4]}function m(){if(typeof O=="object"&&!(O instanceof RegExp)&&O.async){if(!K.$async)throw Error("async format in sync schema");return E$._`await ${F}(${Q})`}return typeof L=="function"?E$._`${F}(${Q})`:E$._`${F}.test(${Q})`}}}};WD.default=gk});var wD=x((UD)=>{Object.defineProperty(UD,"__esModule",{value:!0});var hk=GD(),uk=[hk.default];UD.default=uk});var VD=x((KD)=>{Object.defineProperty(KD,"__esModule",{value:!0});KD.contentVocabulary=KD.metadataVocabulary=void 0;KD.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];KD.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var BD=x((OD)=>{Object.defineProperty(OD,"__esModule",{value:!0});var ck=gB(),ik=Kj(),nk=YD(),pk=wD(),HD=VD(),dk=[ck.default,ik.default,(0,nk.default)(),pk.default,HD.metadataVocabulary,HD.contentVocabulary];OD.default=dk});var LD=x((DD)=>{Object.defineProperty(DD,"__esModule",{value:!0});DD.DiscrError=void 0;var jD;(function($){$.Tag="tag",$.Mapping="mapping"})(jD||(DD.DiscrError=jD={}))});var ID=x((MD)=>{Object.defineProperty(MD,"__esModule",{value:!0});var x0=s(),QU=LD(),FD=DQ(),ok=D8(),tk=Y$(),ak={message:({params:{discrError:$,tagName:X}})=>$===QU.DiscrError.Tag?`tag "${X}" must be string`:`value of tag "${X}" must be in oneOf`,params:({params:{discrError:$,tag:X,tagName:J}})=>x0._`{error: ${$}, tag: ${J}, tagValue: ${X}}`},sk={keyword:"discriminator",type:"object",schemaType:"object",error:ak,code($){let{gen:X,data:J,schema:Q,parentSchema:z,it:Y}=$,{oneOf:W}=z;if(!Y.opts.discriminator)throw Error("discriminator: requires discriminator option");let G=Q.propertyName;if(typeof G!="string")throw Error("discriminator: requires propertyName");if(Q.mapping)throw Error("discriminator: mapping is not supported");if(!W)throw Error("discriminator: requires oneOf keyword");let U=X.let("valid",!1),w=X.const("tag",x0._`${J}${(0,x0.getProperty)(G)}`);X.if(x0._`typeof ${w} == "string"`,()=>K(),()=>$.error(!1,{discrError:QU.DiscrError.Tag,tag:w,tagName:G})),$.ok(U);function K(){let V=H();X.if(!1);for(let O in V)X.elseIf(x0._`${w} === ${O}`),X.assign(U,N(V[O]));X.else(),$.error(!1,{discrError:QU.DiscrError.Mapping,tag:w,tagName:G}),X.endIf()}function N(V){let O=X.name("valid"),B=$.subschema({keyword:"oneOf",schemaProp:V},O);return $.mergeEvaluated(B,x0.Name),O}function H(){var V;let O={},B=F(z),L=!0;for(let m=0;m<W.length;m++){let c=W[m];if((c===null||c===void 0?void 0:c.$ref)&&!(0,tk.schemaHasRulesButRef)(c,Y.self.RULES)){let H4=c.$ref;if(c=FD.resolveRef.call(Y.self,Y.schemaEnv.root,Y.baseId,H4),c instanceof FD.SchemaEnv)c=c.schema;if(c===void 0)throw new ok.default(Y.opts.uriResolver,Y.baseId,H4)}let v$=(V=c===null||c===void 0?void 0:c.properties)===null||V===void 0?void 0:V[G];if(typeof v$!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${G}"`);L=L&&(B||F(c)),Z(v$,m)}if(!L)throw Error(`discriminator: "${G}" must be required`);return O;function F({required:m}){return Array.isArray(m)&&m.includes(G)}function Z(m,c){if(m.const)C(m.const,c);else if(m.enum)for(let v$ of m.enum)C(v$,c);else throw Error(`discriminator: "properties/${G}" must have "const" or "enum"`)}function C(m,c){if(typeof m!="string"||m in O)throw Error(`discriminator: "${G}" values must be unique strings`);O[m]=c}}}};MD.default=sk});var AD=x((xa,$_)=>{$_.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var WU=x((Q4,YU)=>{Object.defineProperty(Q4,"__esModule",{value:!0});Q4.MissingRefError=Q4.ValidationError=Q4.CodeGen=Q4.Name=Q4.nil=Q4.stringify=Q4.str=Q4._=Q4.KeywordCxt=Q4.Ajv=void 0;var X_=SB(),J_=BD(),z_=ID(),bD=AD(),Q_=["/properties"],TQ="http://json-schema.org/draft-07/schema";class E8 extends X_.default{_addVocabularies(){if(super._addVocabularies(),J_.default.forEach(($)=>this.addVocabulary($)),this.opts.discriminator)this.addKeyword(z_.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let $=this.opts.$data?this.$dataMetaSchema(bD,Q_):bD;this.addMetaSchema($,TQ,!1),this.refs["http://json-schema.org/schema"]=TQ}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(TQ)?TQ:void 0)}}Q4.Ajv=E8;YU.exports=Q4=E8;YU.exports.Ajv=E8;Object.defineProperty(Q4,"__esModule",{value:!0});Q4.default=E8;var Y_=j8();Object.defineProperty(Q4,"KeywordCxt",{enumerable:!0,get:function(){return Y_.KeywordCxt}});var T0=s();Object.defineProperty(Q4,"_",{enumerable:!0,get:function(){return T0._}});Object.defineProperty(Q4,"str",{enumerable:!0,get:function(){return T0.str}});Object.defineProperty(Q4,"stringify",{enumerable:!0,get:function(){return T0.stringify}});Object.defineProperty(Q4,"nil",{enumerable:!0,get:function(){return T0.nil}});Object.defineProperty(Q4,"Name",{enumerable:!0,get:function(){return T0.Name}});Object.defineProperty(Q4,"CodeGen",{enumerable:!0,get:function(){return T0.CodeGen}});var W_=BQ();Object.defineProperty(Q4,"ValidationError",{enumerable:!0,get:function(){return W_.default}});var G_=D8();Object.defineProperty(Q4,"MissingRefError",{enumerable:!0,get:function(){return G_.default}})});var xD=x((kD)=>{Object.defineProperty(kD,"__esModule",{value:!0});kD.formatNames=kD.fastFormats=kD.fullFormats=void 0;function p4($,X){return{validate:$,compare:X}}kD.fullFormats={date:p4(RD,KU),time:p4(UU(!0),NU),"date-time":p4(PD(!0),vD),"iso-time":p4(UU(),ED),"iso-date-time":p4(PD(),CD),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:B_,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:I_,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:j_,int32:{type:"number",validate:L_},int64:{type:"number",validate:F_},float:{type:"number",validate:SD},double:{type:"number",validate:SD},password:!0,binary:!0};kD.fastFormats={...kD.fullFormats,date:p4(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,KU),time:p4(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,NU),"date-time":p4(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,vD),"iso-time":p4(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,ED),"iso-date-time":p4(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,CD),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};kD.formatNames=Object.keys(kD.fullFormats);function K_($){return $%4===0&&($%100!==0||$%400===0)}var N_=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,V_=[0,31,28,31,30,31,30,31,31,30,31,30,31];function RD($){let X=N_.exec($);if(!X)return!1;let J=+X[1],Q=+X[2],z=+X[3];return Q>=1&&Q<=12&&z>=1&&z<=(Q===2&&K_(J)?29:V_[Q])}function KU($,X){if(!($&&X))return;if($>X)return 1;if($<X)return-1;return 0}var GU=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function UU($){return function(J){let Q=GU.exec(J);if(!Q)return!1;let z=+Q[1],Y=+Q[2],W=+Q[3],G=Q[4],U=Q[5]==="-"?-1:1,w=+(Q[6]||0),K=+(Q[7]||0);if(w>23||K>59||$&&!G)return!1;if(z<=23&&Y<=59&&W<60)return!0;let N=Y-K*U,H=z-w*U-(N<0?1:0);return(H===23||H===-1)&&(N===59||N===-1)&&W<61}}function NU($,X){if(!($&&X))return;let J=new Date("2020-01-01T"+$).valueOf(),Q=new Date("2020-01-01T"+X).valueOf();if(!(J&&Q))return;return J-Q}function ED($,X){if(!($&&X))return;let J=GU.exec($),Q=GU.exec(X);if(!(J&&Q))return;if($=J[1]+J[2]+J[3],X=Q[1]+Q[2]+Q[3],$>X)return 1;if($<X)return-1;return 0}var wU=/t|\s/i;function PD($){let X=UU($);return function(Q){let z=Q.split(wU);return z.length===2&&RD(z[0])&&X(z[1])}}function vD($,X){if(!($&&X))return;let J=new Date($).valueOf(),Q=new Date(X).valueOf();if(!(J&&Q))return;return J-Q}function CD($,X){if(!($&&X))return;let[J,Q]=$.split(wU),[z,Y]=X.split(wU),W=KU(J,z);if(W===void 0)return;return W||NU(Q,Y)}var H_=/\/|:/,O_=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function B_($){return H_.test($)&&O_.test($)}var ZD=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function j_($){return ZD.lastIndex=0,ZD.test($)}var D_=-2147483648,q_=2147483647;function L_($){return Number.isInteger($)&&$<=q_&&$>=D_}function F_($){return Number.isInteger($)}function SD(){return!0}var M_=/[^\\]\\Z/;function I_($){if(M_.test($))return!1;try{return new RegExp($),!0}catch(X){return!1}}});var fD=x((TD)=>{Object.defineProperty(TD,"__esModule",{value:!0});TD.formatLimitDefinition=void 0;var b_=WU(),y4=s(),c6=y4.operators,fQ={formatMaximum:{okStr:"<=",ok:c6.LTE,fail:c6.GT},formatMinimum:{okStr:">=",ok:c6.GTE,fail:c6.LT},formatExclusiveMaximum:{okStr:"<",ok:c6.LT,fail:c6.GTE},formatExclusiveMinimum:{okStr:">",ok:c6.GT,fail:c6.LTE}},P_={message:({keyword:$,schemaCode:X})=>y4.str`should be ${fQ[$].okStr} ${X}`,params:({keyword:$,schemaCode:X})=>y4._`{comparison: ${fQ[$].okStr}, limit: ${X}}`};TD.formatLimitDefinition={keyword:Object.keys(fQ),type:"string",schemaType:"string",$data:!0,error:P_,code($){let{gen:X,data:J,schemaCode:Q,keyword:z,it:Y}=$,{opts:W,self:G}=Y;if(!W.validateFormats)return;let U=new b_.KeywordCxt(Y,G.RULES.all.format.definition,"format");if(U.$data)w();else K();function w(){let H=X.scopeValue("formats",{ref:G.formats,code:W.code.formats}),V=X.const("fmt",y4._`${H}[${U.schemaCode}]`);$.fail$data((0,y4.or)(y4._`typeof ${V} != "object"`,y4._`${V} instanceof RegExp`,y4._`typeof ${V}.compare != "function"`,N(V)))}function K(){let H=U.schema,V=G.formats[H];if(!V||V===!0)return;if(typeof V!="object"||V instanceof RegExp||typeof V.compare!="function")throw Error(`"${z}": format "${H}" does not define "compare" function`);let O=X.scopeValue("formats",{key:H,ref:V,code:W.code.formats?y4._`${W.code.formats}${(0,y4.getProperty)(H)}`:void 0});$.fail$data(N(O))}function N(H){return y4._`${H}.compare(${J}, ${Q}) ${fQ[z].fail} 0`}},dependencies:["format"]};var Z_=($)=>{return $.addKeyword(TD.formatLimitDefinition),$};TD.default=Z_});var uD=x((v8,hD)=>{Object.defineProperty(v8,"__esModule",{value:!0});var f0=xD(),R_=fD(),OU=s(),gD=new OU.Name("fullFormats"),E_=new OU.Name("fastFormats"),BU=($,X={keywords:!0})=>{if(Array.isArray(X))return yD($,X,f0.fullFormats,gD),$;let[J,Q]=X.mode==="fast"?[f0.fastFormats,E_]:[f0.fullFormats,gD],z=X.formats||f0.formatNames;if(yD($,z,J,Q),X.keywords)(0,R_.default)($);return $};BU.get=($,X="full")=>{let Q=(X==="fast"?f0.fastFormats:f0.fullFormats)[$];if(!Q)throw Error(`Unknown format "${$}"`);return Q};function yD($,X,J,Q){var z,Y;(z=(Y=$.opts.code).formats)!==null&&z!==void 0||(Y.formats=OU._`require("ajv-formats/dist/formats").${Q}`);for(let W of X)$.addFormat(W,J[W])}hD.exports=v8=BU;Object.defineProperty(v8,"__esModule",{value:!0});v8.default=BU});class p6 extends Error{}var{closeSync:um,writeFileSync:lm,fsyncSync:mm,openSync:cm}=(()=>({}));function Vq(){this.__data__=[],this.size=0}var SU=Vq;function Hq($,X){return $===X||$!==$&&X!==X}var RU=Hq;function Oq($,X){var J=$.length;while(J--)if(RU($[J][0],X))return J;return-1}var j6=Oq;var Bq=Array.prototype,jq=Bq.splice;function Dq($){var X=this.__data__,J=j6(X,$);if(J<0)return!1;var Q=X.length-1;if(J==Q)X.pop();else jq.call(X,J,1);return--this.size,!0}var EU=Dq;function qq($){var X=this.__data__,J=j6(X,$);return J<0?void 0:X[J][1]}var vU=qq;function Lq($){return j6(this.__data__,$)>-1}var CU=Lq;function Fq($,X){var J=this.__data__,Q=j6(J,$);if(Q<0)++this.size,J.push([$,X]);else J[Q][1]=X;return this}var kU=Fq;function S1($){var X=-1,J=$==null?0:$.length;this.clear();while(++X<J){var Q=$[X];this.set(Q[0],Q[1])}}S1.prototype.clear=SU;S1.prototype.delete=EU;S1.prototype.get=vU;S1.prototype.has=CU;S1.prototype.set=kU;var _U=S1;var Mq=typeof global=="object"&&global&&global.Object===Object&&global,xU=Mq;var Iq=typeof self=="object"&&self&&self.Object===Object&&self,Aq=xU||Iq||Function("return this")(),R1=Aq;var bq=R1.Symbol,E1=bq;var TU=Object.prototype,Pq=TU.hasOwnProperty,Zq=TU.toString,y0=E1?E1.toStringTag:void 0;function Sq($){var X=Pq.call($,y0),J=$[y0];try{$[y0]=void 0;var Q=!0}catch(Y){}var z=Zq.call($);if(Q)if(X)$[y0]=J;else delete $[y0];return z}var fU=Sq;var Rq=Object.prototype,Eq=Rq.toString;function vq($){return Eq.call($)}var gU=vq;var Cq="[object Null]",kq="[object Undefined]",yU=E1?E1.toStringTag:void 0;function _q($){if($==null)return $===void 0?kq:Cq;return yU&&yU in Object($)?fU($):gU($)}var hU=_q;function xq($){var X=typeof $;return $!=null&&(X=="object"||X=="function")}var k8=xq;var Tq="[object AsyncFunction]",fq="[object Function]",gq="[object GeneratorFunction]",yq="[object Proxy]";function hq($){if(!k8($))return!1;var X=hU($);return X==fq||X==gq||X==Tq||X==yq}var uU=hq;var uq=R1["__core-js_shared__"],_8=uq;var lU=function(){var $=/[^.]+$/.exec(_8&&_8.keys&&_8.keys.IE_PROTO||"");return $?"Symbol(src)_1."+$:""}();function lq($){return!!lU&&lU in $}var mU=lq;var mq=Function.prototype,cq=mq.toString;function iq($){if($!=null){try{return cq.call($)}catch(X){}try{return $+""}catch(X){}}return""}var cU=iq;var nq=/[\\^$.*+?()[\]{}|]/g,pq=/^\[object .+?Constructor\]$/,dq=Function.prototype,rq=Object.prototype,oq=dq.toString,tq=rq.hasOwnProperty,aq=RegExp("^"+oq.call(tq).replace(nq,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function sq($){if(!k8($)||mU($))return!1;var X=uU($)?aq:pq;return X.test(cU($))}var iU=sq;function eq($,X){return $==null?void 0:$[X]}var nU=eq;function $L($,X){var J=nU($,X);return iU(J)?J:void 0}var x8=$L;var XL=x8(R1,"Map"),pU=XL;var JL=x8(Object,"create"),d4=JL;function zL(){this.__data__=d4?d4(null):{},this.size=0}var dU=zL;function QL($){var X=this.has($)&&delete this.__data__[$];return this.size-=X?1:0,X}var rU=QL;var YL="__lodash_hash_undefined__",WL=Object.prototype,GL=WL.hasOwnProperty;function UL($){var X=this.__data__;if(d4){var J=X[$];return J===YL?void 0:J}return GL.call(X,$)?X[$]:void 0}var oU=UL;var wL=Object.prototype,KL=wL.hasOwnProperty;function NL($){var X=this.__data__;return d4?X[$]!==void 0:KL.call(X,$)}var tU=NL;var VL="__lodash_hash_undefined__";function HL($,X){var J=this.__data__;return this.size+=this.has($)?0:1,J[$]=d4&&X===void 0?VL:X,this}var aU=HL;function v1($){var X=-1,J=$==null?0:$.length;this.clear();while(++X<J){var Q=$[X];this.set(Q[0],Q[1])}}v1.prototype.clear=dU;v1.prototype.delete=rU;v1.prototype.get=oU;v1.prototype.has=tU;v1.prototype.set=aU;var uQ=v1;function OL(){this.size=0,this.__data__={hash:new uQ,map:new(pU||_U),string:new uQ}}var sU=OL;function BL($){var X=typeof $;return X=="string"||X=="number"||X=="symbol"||X=="boolean"?$!=="__proto__":$===null}var eU=BL;function jL($,X){var J=$.__data__;return eU(X)?J[typeof X=="string"?"string":"hash"]:J.map}var D6=jL;function DL($){var X=D6(this,$).delete($);return this.size-=X?1:0,X}var $w=DL;function qL($){return D6(this,$).get($)}var Xw=qL;function LL($){return D6(this,$).has($)}var Jw=LL;function FL($,X){var J=D6(this,$),Q=J.size;return J.set($,X),this.size+=J.size==Q?0:1,this}var zw=FL;function C1($){var X=-1,J=$==null?0:$.length;this.clear();while(++X<J){var Q=$[X];this.set(Q[0],Q[1])}}C1.prototype.clear=sU;C1.prototype.delete=$w;C1.prototype.get=Xw;C1.prototype.has=Jw;C1.prototype.set=zw;var lQ=C1;var{realpathSync:Ww}=(()=>({}));var ML="Expected a function";function mQ($,X){if(typeof $!="function"||X!=null&&typeof X!="function")throw TypeError(ML);var J=function(){var Q=arguments,z=X?X.apply(this,Q):Q[0],Y=J.cache;if(Y.has(z))return Y.get(z);var W=$.apply(this,Q);return J.cache=Y.set(z,W)||Y,W};return J.cache=new(mQ.Cache||lQ),J}mQ.Cache=lQ;var O4=mQ;var Qw=function(){return"/"};var h0=()=>globalThis.crypto.randomUUID();function d6($){if(!$)return!1;if(typeof $==="boolean")return $;let X=String($).toLowerCase().trim();return["1","true","yes","on"].includes(X)}function q6(){let $=new Set;return{subscribe(X){return $.add(X),()=>{$.delete(X)}},emit(...X){let J;for(let Q of $)try{Q(...X)}catch(z){(J??=[]).push(z)}if(J)throw J.length===1?J[0]:AggregateError(J,"Signal listener(s) threw")},clear(){$.clear()}}}function Yw(){return{sent:new Set,rejected:new Set}}var AL={renderTarget:"ink",workspace:"local",canDrive:!0,transcriptSource:"local-jsonl",remote:null};function bL(){let $="";if(typeof process<"u"&&typeof process.cwd==="function"&&typeof Ww==="function"){let J=Qw();try{$=Ww(J).normalize("NFC")}catch{$=J.normalize("NFC")}}return{originalCwd:$,projectRoot:$,totalCostUSD:0,totalAPIDuration:0,totalAPIDurationWithoutRetries:0,totalToolDuration:0,startTime:Date.now(),lastInteractionTime:Date.now(),totalLinesAdded:0,totalLinesRemoved:0,hasUnknownModelCost:!1,cwd:$,modelUsage:{},mainLoopModelOverride:void 0,replConfigArgv:[],initialMainLoopModel:void 0,modelStrings:null,isInteractive:!1,attacherCaps:null,hasStreamingInput:!1,modelOverrideOptOutForSession:!1,kairosActive:!1,rendererMode:void 0,strictToolResultPairing:!1,memoryToggledOff:!1,teamMemoryServerStatus:void 0,sdkAgentProgressSummariesEnabled:!1,userMsgOptIn:!1,clientType:"cli",sessionSource:void 0,sessionStartType:"fresh",questionPreviewFormat:void 0,sessionIngressToken:void 0,oauthTokenFromFd:void 0,oauthScopesFromFd:void 0,apiKeyFromFd:void 0,gatewayAuth:null,gatewayRefreshInFlight:null,flagSettingsPath:void 0,flagSettingsInline:null,parentManagedSettings:null,allowedSettingSources:["userSettings","projectSettings","localSettings","flagSettings","policySettings"],meter:null,sessionCounter:null,locCounter:null,prCounter:null,commitCounter:null,costCounter:null,tokenCounter:null,codeEditToolDecisionCounter:null,activeTimeCounter:null,statsStore:null,sessionId:h0(),parentSessionId:void 0,loggerProvider:null,eventLogger:null,meterProvider:null,tracerProvider:null,cachedTelemetryResource:null,agentColorMap:new Map,agentColorIndex:0,lastAPIRequest:null,lastCancelledAPIMessageId:null,lastAPIRequestMessages:null,lastClassifierRequests:null,cachedClaudeMdContent:null,inMemoryErrorLog:[],inlinePlugins:[],inlinePluginUrls:[],chromeFlagOverride:void 0,useCoworkPlugins:!1,sessionBypassPermissionsMode:!1,scheduledTasksEnabled:!1,sessionPrResolved:!1,sessionCronTasks:[],loopChainStartedAt:Object.create(null),sessionCreatedTeams:new Set,sessionTrustAccepted:!1,sessionPersistenceDisabled:!1,hasExitedPlanMode:!1,needsPlanModeExitAttachment:!1,needsAutoModeExitAttachment:!1,lspRecommendationShownThisSession:!1,initJsonSchema:null,registeredHooks:null,planSlugCache:new Map,teleportedSessionInfo:null,invokedSkills:new Map,slowOperations:[],sdkBetas:void 0,sdkOAuthTokenRefreshCallback:null,hostAuthTokenRefreshCallback:null,mainThreadAgentType:void 0,mainThreadAgentHooks:void 0,sessionSkillAllowlist:void 0,caps:AL,replBridgeActive:!1,directConnectServerUrl:void 0,mcpConnectNonBlocking:!1,strictMcpConfig:!1,activeRoutine:void 0,systemPromptSectionCache:new Map,lastEmittedDate:null,additionalDirectoriesForClaudeMd:[],allowedChannels:[],activeInputs:new Map,hasDevChannels:!1,sessionProjectDir:null,promptCache1hAllowlist:null,stickyBetas:Yw(),thinkingTypeOverrides:new Map,inferenceProfileBackingModels:new Map,promptId:null,promptIndex:0,lastMainRequestId:void 0,lastMainThreadCacheTtlMs:null,lastApiCompletionTimestamp:null,pendingPostCompaction:!1}}var PL=bL(),ZL=()=>{return};function cQ(){return ZL()?.sessionId??PL.sessionId}var SL=q6(),wf=SL.subscribe;var RL=q6(),Kf=RL.subscribe;var EL=q6(),Nf=EL.subscribe;var vL=q6();var Vf=vL.subscribe;var CL=q6();var Hf=CL.subscribe;var{appendFile:xK,mkdir:JM,rename:TK,stat:zM,symlink:QM,unlink:_Y}=(()=>({}));P4();function Bw({writeFn:$,flushIntervalMs:X=1000,maxBufferSize:J=100,maxBufferBytes:Q=1/0,immediateMode:z=!1}){let Y=[],W=0,G=null,U=null;function w(){if(G)clearTimeout(G),G=null}function K(O){try{$(O)}catch{}}function N(){if(U)K(U.join("")),U=null;if(Y.length===0)return;K(Y.join("")),Y=[],W=0,w()}function H(){if(!G)G=setTimeout(N,X)}function V(){if(U){U.push(...Y),Y=[],W=0,w();return}let O=Y;Y=[],W=0,w(),U=O,setImmediate(()=>{let B=U;if(U=null,B)K(B.join(""))})}return{write(O){if(z){K(O);return}if(Y.push(O),W+=O.length,H(),Y.length>=J||W>=Q)V()},flush:N,dispose(){N()}}}function xL($){if(typeof $==="function")return $;if(Symbol.asyncDispose in $)return()=>$[Symbol.asyncDispose]();return()=>$[Symbol.dispose]()}class jw{#$=new Set;register($){let X=xL($);this.#$.add(X);let J=()=>{this.#$.delete(X)};return Object.assign(J,{[Symbol.dispose]:J})}async drain(){let $=Array.from(this.#$);this.#$.clear(),await Promise.all($.map(async(X)=>X()))}async[Symbol.asyncDispose](){await this.drain()}get sizeForTesting(){return this.#$.size}}var TL=new jw;function Dw($){return TL.register($)}var qw=O4(($)=>{if(!$||$.trim()==="")return null;let X=$.split(",").map((Y)=>Y.trim()).filter(Boolean);if(X.length===0)return null;let J=X.some((Y)=>Y.startsWith("!")),Q=X.some((Y)=>!Y.startsWith("!"));if(J&&Q)return null;let z=X.map((Y)=>Y.replace(/^!/,"").toLowerCase());return{include:J?[]:z,exclude:J?z:[],isExclusive:J}});function fL($){let X=[],J=$.match(/^MCP server ["']([^"']+)["']/);if(J&&J[1])X.push("mcp"),X.push(J[1].toLowerCase());else{let Y=$.match(/^([^:[]+):/);if(Y&&Y[1])X.push(Y[1].trim().toLowerCase())}let Q=$.match(/^\[([^\]]+)]/);if(Q&&Q[1])X.push(Q[1].trim().toLowerCase());if($.toLowerCase().includes("1p event:"))X.push("1p");let z=$.match(/:\s*([^:]+?)(?:\s+(?:type|mode|status|event))?:/);if(z&&z[1]){let Y=z[1].trim().toLowerCase();if(Y.length<30&&!Y.includes(" "))X.push(Y)}return Array.from(new Set(X))}function gL($,X){if(!X)return!0;if($.length===0)return!1;if(X.isExclusive)return!$.some((J)=>X.exclude.includes(J));else return $.some((J)=>X.include.includes(J))}function Lw($,X){if(!X)return!0;let J=fL($);return gL(J,X)}var rQ=function(){return"/"};P4();var Fw=O4(()=>{return(process.env.CLAUDE_CONFIG_DIR??u4(rQ(),".claude")).normalize("NFC")},()=>process.env.CLAUDE_CONFIG_DIR);var bf=O4(()=>d6(process.env.CLAUDE_CODE_SUPERVISED));function k($,X,J,Q,z){if(Q==="m")throw TypeError("Private method is not writable");if(Q==="a"&&!z)throw TypeError("Private accessor was defined without a setter");if(typeof X==="function"?$!==X||!z:!X.has($))throw TypeError("Cannot write private member to an object whose class did not declare it");return Q==="a"?z.call($,J):z?z.value=J:X.set($,J),J}function D($,X,J,Q){if(J==="a"&&!Q)throw TypeError("Private accessor was defined without a getter");if(typeof X==="function"?$!==X||!Q:!X.has($))throw TypeError("Cannot read private member from an object whose class did not declare it");return J==="m"?Q:J==="a"?Q.call($):Q?Q.value:X.get($)}var oQ=function(){let{crypto:$}=globalThis;if($?.randomUUID)return oQ=$.randomUUID.bind($),$.randomUUID();let X=new Uint8Array(1),J=$?()=>$.getRandomValues(X)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(Q)=>(+Q^J()&15>>+Q/4).toString(16))};function r4($){return typeof $==="object"&&$!==null&&(("name"in $)&&$.name==="AbortError"||("message"in $)&&String($.message).includes("FetchRequestCanceledException"))}var u0=($)=>{if($ instanceof Error)return $;if(typeof $==="object"&&$!==null){try{if(Object.prototype.toString.call($)==="[object Error]"){let X=Error($.message,$.cause?{cause:$.cause}:{});if($.stack)X.stack=$.stack;if($.cause&&!X.cause)X.cause=$.cause;if($.name)X.name=$.name;return X}}catch{}try{return Error(JSON.stringify($))}catch{}}return Error($)};class T extends Error{}class k$ extends T{constructor($,X,J,Q,z){super(`${k$.makeMessage($,X,J)}`);this.status=$,this.headers=Q,this.requestID=Q?.get("request-id"),this.error=X,this.type=z??null}static makeMessage($,X,J){let Q=X?.message?typeof X.message==="string"?X.message:JSON.stringify(X.message):X?JSON.stringify(X):J;if($&&Q)return`${$} ${Q}`;if($)return`${$} status code (no body)`;if(Q)return Q;return"(no status code or body)"}static generate($,X,J,Q){if(!$||!Q)return new t6({message:J,cause:u0(X)});let z=X,Y=z?.error?.type;if($===400)return new m0($,z,J,Q,Y);if($===401)return new c0($,z,J,Q,Y);if($===403)return new i0($,z,J,Q,Y);if($===404)return new n0($,z,J,Q,Y);if($===409)return new p0($,z,J,Q,Y);if($===422)return new d0($,z,J,Q,Y);if($===429)return new r0($,z,J,Q,Y);if($>=500)return new o0($,z,J,Q,Y);return new k$($,z,J,Q,Y)}}class f$ extends k${constructor({message:$}={}){super(void 0,void 0,$||"Request was aborted.",void 0)}}class t6 extends k${constructor({message:$,cause:X}){super(void 0,void 0,$||"Connection error.",void 0);if(X)this.cause=X}}class l0 extends t6{constructor({message:$}={}){super({message:$??"Request timed out."})}}class m0 extends k${}class c0 extends k${}class i0 extends k${}class n0 extends k${}class p0 extends k${}class d0 extends k${}class r0 extends k${}class o0 extends k${}var hL=/^[a-z][a-z0-9+.-]*:/i,Mw=($)=>{return hL.test($)},tQ=($)=>(tQ=Array.isArray,tQ($)),aQ=tQ;function T8($){if(typeof $!=="object")return{};return $??{}}function sQ($){if(!$)return!0;for(let X in $)return!1;return!0}function Iw($,X){return Object.prototype.hasOwnProperty.call($,X)}var Aw=($,X)=>{if(typeof X!=="number"||!Number.isInteger(X))throw new T(`${$} must be an integer`);if(X<0)throw new T(`${$} must be a positive integer`);return X};var f8=($)=>{try{return JSON.parse($)}catch(X){return}};var bw=($)=>new Promise((X)=>setTimeout(X,$));var B4="0.94.0";var Rw=()=>{return typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u"};function uL(){if(typeof Deno<"u"&&Deno.build!=null)return"deno";if(typeof EdgeRuntime<"u")return"edge";if(Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]")return"node";return"unknown"}var lL=()=>{let $=uL();if($==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":B4,"X-Stainless-OS":Zw(Deno.build.os),"X-Stainless-Arch":Pw(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version==="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":B4,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if($==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":B4,"X-Stainless-OS":Zw(globalThis.process.platform??"unknown"),"X-Stainless-Arch":Pw(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let X=mL();if(X)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":B4,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${X.browser}`,"X-Stainless-Runtime-Version":X.version};return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":B4,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function mL(){if(typeof navigator>"u"||!navigator)return null;let $=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:X,pattern:J}of $){let Q=J.exec(navigator.userAgent);if(Q){let z=Q[1]||0,Y=Q[2]||0,W=Q[3]||0;return{browser:X,version:`${z}.${Y}.${W}`}}}return null}var Pw=($)=>{if($==="x32")return"x32";if($==="x86_64"||$==="x64")return"x64";if($==="arm")return"arm";if($==="aarch64"||$==="arm64")return"arm64";if($)return`other:${$}`;return"unknown"},Zw=($)=>{if($=$.toLowerCase(),$.includes("ios"))return"iOS";if($==="android")return"Android";if($==="darwin")return"MacOS";if($==="win32")return"Windows";if($==="freebsd")return"FreeBSD";if($==="openbsd")return"OpenBSD";if($==="linux")return"Linux";if($)return`Other:${$}`;return"Unknown"},Sw,t0=()=>{return Sw??(Sw=lL())};function Ew(){if(typeof fetch<"u")return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function eQ(...$){let X=globalThis.ReadableStream;if(typeof X>"u")throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new X(...$)}function g8($){let X=Symbol.asyncIterator in $?$[Symbol.asyncIterator]():$[Symbol.iterator]();return eQ({start(){},async pull(J){let{done:Q,value:z}=await X.next();if(Q)J.close();else J.enqueue(z)},async cancel(){await X.return?.()}})}function a0($){if($[Symbol.asyncIterator])return $;let X=$.getReader();return{async next(){try{let J=await X.read();if(J?.done)X.releaseLock();return J}catch(J){throw X.releaseLock(),J}},async return(){let J=X.cancel();return X.releaseLock(),await J,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function vw($){if($===null||typeof $!=="object")return;if($[Symbol.asyncIterator]){await $[Symbol.asyncIterator]().return?.();return}let X=$.getReader(),J=X.cancel();X.releaseLock(),await J}var Cw=({headers:$,body:X})=>{return{bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(X)}};function kw($){return Object.entries($).filter(([X,J])=>typeof J<"u").map(([X,J])=>{if(typeof J==="string"||typeof J==="number"||typeof J==="boolean")return`${encodeURIComponent(X)}=${encodeURIComponent(J)}`;if(J===null)return`${encodeURIComponent(X)}=`;throw new T(`Cannot stringify type ${typeof J}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}var xw="urn:ietf:params:oauth:grant-type:jwt-bearer",Tw="refresh_token",y8="/v1/oauth/token",a6="oauth-2025-04-20",fw="oidc-federation-2026-04-01",gw=120,_1=30,yw=5,_w=1048576;function h8($){if(!$)return;let X;try{X=new URL($)}catch(Q){throw new K$(`Invalid token endpoint base URL "${$}": ${Q}`)}if(X.protocol==="https:")return;let J=X.hostname.toLowerCase().replace(/^\[|\]$/g,"");if(X.protocol==="http:"&&(J==="localhost"||J==="127.0.0.1"||J==="::1"))return;throw new K$(`Refusing to send credential over non-https token endpoint "${$}"`)}async function u8($,X){let J=await pL($),Q;try{Q=JSON.parse(J)}catch{throw new K$(`Token endpoint returned non-JSON response (status ${$.status})`,$.status,t$(J),X)}if(!Q.access_token)throw new K$(`Token endpoint response missing access_token: ${JSON.stringify(t$(Q))}`,$.status,t$(Q),X);if(Q.token_type&&Q.token_type.toLowerCase()!=="bearer")throw new K$(`Token endpoint response: unsupported token_type "${Q.token_type}" (want Bearer)`,$.status,t$(Q),X);return Q}var $Y=2000,nL=new Set(["error","error_description","error_uri"]);function t$($){if($==null)return $;if(typeof $==="string"){let X;try{X=JSON.parse($)}catch{if($.length<=$Y)return $;return $.slice(0,$Y)+`... <${$.length-$Y} more chars>`}return JSON.stringify(t$(X))}if(typeof $==="object"&&!Array.isArray($)){let X={};for(let[J,Q]of Object.entries($))if(nL.has(J))X[J]=Q;return X}return null}async function l8($,X=(J)=>console.warn(`anthropic-sdk: ${J}`)){if(typeof process>"u"||process.platform==="win32")return;let J=await import("node:fs"),Q=$,z;try{Q=await J.promises.realpath($),z=await J.promises.stat(Q)}catch{return}let Y=z.mode&511;if(Y&18)throw new K$(`Credentials file at ${Q} is group/world-writable (mode 0o${Y.toString(8)}); this allows other local users to plant tokens. Run \`chmod 600 ${Q}\`.`);if(Y&36)throw new K$(`Credentials file at ${Q} is group/world-readable (mode 0o${Y.toString(8)}); run \`chmod 600 ${Q}\` before retrying.`);if(typeof process.getuid==="function"&&z.uid!==process.getuid())X(`credentials file at ${Q} is owned by uid ${z.uid} (current process uid ${process.getuid()}); verify this is intentional.`)}async function m8($,X){let J=await import("node:fs"),z=(await Promise.resolve().then(() => (P4(),o6))).dirname($);await J.promises.mkdir(z,{recursive:!0,mode:448});let Y=`${$}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;try{let W=await J.promises.open(Y,"w",384);try{await W.writeFile(JSON.stringify(X,null,2)),await W.sync()}finally{await W.close()}await J.promises.rename(Y,$)}catch(W){throw await J.promises.unlink(Y).catch(()=>{}),W}try{let W=await J.promises.open(z,"r");try{await W.sync()}finally{await W.close()}}catch{}}async function pL($){if(!$.body)return"";let X=$.body.getReader(),J=[],Q=0;for(;;){let{done:Y,value:W}=await X.read();if(Y)break;if(Q+W.length>_w){let G=_w-Q;if(G>0)J.push(W.subarray(0,G));await X.cancel();break}J.push(W),Q+=W.length}let z;if(J.length===1)z=J[0];else{z=new Uint8Array(J.reduce((W,G)=>W+G.length,0));let Y=0;for(let W of J)z.set(W,Y),Y+=W.length}return new TextDecoder("utf-8").decode(z)}class K$ extends T{constructor($,X=null,J=null,Q=null){super($);this.statusCode=X,this.body=J,this.requestId=Q}}function Z4(){return Math.floor(Date.now()/1000)}class XY{constructor($,X){this.cached=null,this.pendingRefresh=null,this.nextForce=!1,this.lastAdvisoryError=0,this.provider=$,this.onAdvisoryRefreshError=X}async getToken(){let $=this.nextForce;this.nextForce=!1;let X=this.cached;if($||X==null)return(await this.refresh($)).token;if(X.expiresAt==null)return X.token;let J=X.expiresAt-Z4();if(J>gw)return X.token;if(J>_1)return this.backgroundRefresh(),X.token;return(await this.refresh()).token}invalidate(){this.cached=null,this.nextForce=!0}refresh($=!1){if(this.pendingRefresh&&!$)return this.pendingRefresh;return this.doRefresh($)}backgroundRefresh(){if(this.pendingRefresh)return;if(Z4()-this.lastAdvisoryError<yw)return;this.doRefresh().catch(($)=>{this.lastAdvisoryError=Z4(),this.onAdvisoryRefreshError?.($)})}doRefresh($=!1){return this.pendingRefresh=this.provider($?{forceRefresh:!0}:void 0).then((X)=>{return this.cached=X,this.pendingRefresh=null,X},(X)=>{throw this.pendingRefresh=null,X}),this.pendingRefresh}}var w$=($)=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[$]?.trim()||void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.($)?.trim()||void 0;return};function lw($){let X=0;for(let z of $)X+=z.length;let J=new Uint8Array(X),Q=0;for(let z of $)J.set(z,Q),Q+=z.length;return J}var hw;function x1($){let X;return(hw??(X=new globalThis.TextEncoder,hw=X.encode.bind(X)))($)}var uw;function JY($){let X;return(uw??(X=new globalThis.TextDecoder,uw=X.decode.bind(X)))($)}var i8={off:0,error:200,warn:300,info:400,debug:500},zY=($,X,J)=>{if(!$)return;if(Iw(i8,$))return $;S$(J).warn(`${X} was set to ${JSON.stringify($)}, expected one of ${JSON.stringify(Object.keys(i8))}`);return};function s0(){}function c8($,X,J){if(!X||i8[$]>i8[J])return s0;else return X[$].bind(X)}var dL={error:s0,warn:s0,info:s0,debug:s0},mw=new WeakMap;function S$($){let X=$.logger,J=$.logLevel??"off";if(!X)return dL;let Q=mw.get(X);if(Q&&Q[0]===J)return Q[1];let z={error:c8("error",X,J),warn:c8("warn",X,J),info:c8("info",X,J),debug:c8("debug",X,J)};return mw.set(X,[J,z]),z}var o4=($)=>{if($.options)$.options={...$.options},delete $.options.headers;if($.headers)$.headers=Object.fromEntries(($.headers instanceof Headers?[...$.headers]:Object.entries($.headers)).map(([X,J])=>[X,X.toLowerCase()==="x-api-key"||X.toLowerCase()==="authorization"||X.toLowerCase()==="cookie"||X.toLowerCase()==="set-cookie"?"***":J]));if("retryOfRequestLogID"in $){if($.retryOfRequestLogID)$.retryOf=$.retryOfRequestLogID;delete $.retryOfRequestLogID}return $};var n8="1.0",rL=/^[A-Za-z0-9_.-]+$/;function cw($){if(!$)throw Error("profile name is empty");if($==="."||$==="..")throw Error(`profile name "${$}" is not allowed`);if($.includes("/")||$.includes("\\"))throw Error(`profile name "${$}" must not contain path separators`);if(!rL.test($))throw Error(`profile name "${$}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}var iw=async($)=>{var X,J;let Q=await QY();if(Q===null)return null;let z=$??await pw();if(z===null)return null;cw(z);let Y=await import("node:fs"),G=(await Promise.resolve().then(() => (P4(),o6))).join(Q,"configs",`${z}.json`),U;try{U=await Y.promises.readFile(G,"utf-8")}catch(N){if(N?.code!=="ENOENT")throw Error(`failed to read config file ${G}: ${N}`);U=null}if(U===null){let N=w$("ANTHROPIC_ORGANIZATION_ID"),H=w$("ANTHROPIC_IDENTITY_TOKEN_FILE"),V=w$("ANTHROPIC_FEDERATION_RULE_ID");if(V&&N)return{fromFile:!1,config:{organization_id:N,workspace_id:w$("ANTHROPIC_WORKSPACE_ID"),base_url:w$("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:V,service_account_id:w$("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:H?{source:"file",path:H}:void 0,scope:w$("ANTHROPIC_SCOPE")}}};return null}let w;try{w=JSON.parse(U)}catch(N){throw Error(`failed to parse config file ${G}: ${N}`)}if(!w.authentication)throw Error(`config file ${G} is missing "authentication"`);let K=w.authentication.type;if(K!=="oidc_federation"&&K!=="user_oauth")throw Error(`authentication.type "${K}" is not a known authentication type`);if(w.organization_id??(w.organization_id=w$("ANTHROPIC_ORGANIZATION_ID")),w.workspace_id??(w.workspace_id=w$("ANTHROPIC_WORKSPACE_ID")),w.base_url??(w.base_url=w$("ANTHROPIC_BASE_URL")),(X=w.authentication).scope??(X.scope=w$("ANTHROPIC_SCOPE")),w.authentication.type==="oidc_federation"){if(!w.authentication.identity_token){let N=w$("ANTHROPIC_IDENTITY_TOKEN_FILE");if(N)w.authentication.identity_token={source:"file",path:N}}if(!w.authentication.federation_rule_id)w.authentication.federation_rule_id=w$("ANTHROPIC_FEDERATION_RULE_ID")??"";(J=w.authentication).service_account_id??(J.service_account_id=w$("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:w,fromFile:!0}};var nw=async($,X)=>{if($?.authentication.credentials_path)return $.authentication.credentials_path;let J=await QY();if(!J)return null;let Q=X??await pw();if(!Q)return null;return cw(Q),(await Promise.resolve().then(() => (P4(),o6))).join(J,"credentials",`${Q}.json`)},QY=async()=>{if(!oL())return null;let $=await Promise.resolve().then(() => (P4(),o6)),X=w$("ANTHROPIC_CONFIG_DIR");if(X)return X;if(t0()["X-Stainless-OS"]==="Windows"){let Y=w$("APPDATA");if(Y)return $.join(Y,"Anthropic");let W=w$("USERPROFILE");if(W)return $.join(W,"AppData","Roaming","Anthropic");return null}let Q=w$("XDG_CONFIG_HOME");if(Q)return $.join(Q,"anthropic");let z=w$("HOME");if(z)return $.join(z,".config","anthropic");return null},oL=()=>{let $=t0()["X-Stainless-Runtime"];return $==="node"||$==="deno"},pw=async()=>{let $=await QY();if(!$)return null;let X=w$("ANTHROPIC_PROFILE");if(X)return X;let J=await import("node:fs"),z=(await Promise.resolve().then(() => (P4(),o6))).join($,"active_config");try{return(await J.promises.readFile(z,"utf-8")).trim()||"default"}catch(Y){if(Y?.code!=="ENOENT")throw Error(`failed to read ${z}: ${Y}`);return"default"}};function YY($){if(!$)throw new T("Identity token file path is empty");return async()=>{let X=await import("node:fs"),J;try{J=await X.promises.readFile($,"utf-8")}catch(z){throw new T(`Failed to read identity token file at ${$}: ${z}`)}let Q=J.trim();if(!Q)throw new T(`Identity token file at ${$} is empty`);return Q}}function dw($){if(!$)throw new T("Identity token value is empty");return()=>$}function rw($){return async()=>{h8($.baseURL);let X=await $.identityTokenProvider();if(X.length>16384)throw new K$(`Identity token is ${Math.ceil(X.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let J={grant_type:xw,assertion:X,federation_rule_id:$.federationRuleId,organization_id:$.organizationId};if($.serviceAccountId)J.service_account_id=$.serviceAccountId;if($.workspaceId)J.workspace_id=$.workspaceId;let Q=`${$.baseURL}${y8}`,z;try{z=await $.fetch(Q,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${a6},${fw}`,"User-Agent":$.userAgent||`anthropic-sdk-typescript/${B4} oidcFederationProvider`},body:JSON.stringify(J)})}catch(U){throw new K$(`Failed to reach token endpoint ${Q}: ${U}`)}let Y=z.headers.get("Request-Id");if(!z.ok){let U=await z.text().catch(()=>""),w=t$(U),K="";if(z.status===401)K=` Ensure your federation rule matches your identity token. ${$.workspaceId?"":"If your federation rule is scoped to multiple workspaces, set the ANTHROPIC_WORKSPACE_ID environment variable, the 'workspace_id' config key, or the `workspaceId` option. "}View your authentication events in the Workload identity page of Claude Console for more details.`;throw new K$(`Token exchange failed with status ${z.status}${Y?` (request-id ${Y})`:""}: ${w}${K}`,z.status,w,Y)}let W=await u8(z,Y),G=Number(W.expires_in);if(!Number.isFinite(G))throw new K$(`Token endpoint response missing required fields: ${JSON.stringify(t$(W))}`,z.status,t$(W),Y);return{token:W.access_token,expiresAt:Z4()+G}}}function ow($){return async(X)=>{let J=await import("node:fs");await l8($.credentialsPath,$.onSafetyWarning);let Q;try{Q=await J.promises.readFile($.credentialsPath,"utf-8")}catch(L){throw new K$(`Credentials file not found at ${$.credentialsPath}: ${L}`)}let z;try{z=JSON.parse(Q)}catch(L){throw new K$(`Credentials file at ${$.credentialsPath} is not valid JSON: ${L}`)}let Y=z.access_token;if(!Y)throw new K$(`Credentials file at ${$.credentialsPath} must include 'access_token'`);let W=z.expires_at;if(!X?.forceRefresh&&(W==null||Z4()<W-_1))return{token:Y,expiresAt:W??null};let G=z.refresh_token;if(!$.clientId||!G)throw new K$(`Access token at ${$.credentialsPath} has expired and no refresh is available (client_id ${$.clientId?"set":"empty"}, refresh_token ${G?"set":"empty"})`);h8($.baseURL);let U={grant_type:Tw,refresh_token:G,client_id:$.clientId},w=`${$.baseURL}${y8}`,K;try{K=await $.fetch(w,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":a6,"User-Agent":$.userAgent||`anthropic-sdk-typescript/${B4} userOAuthProvider`},body:JSON.stringify(U)})}catch(L){throw new K$(`User OAuth refresh failed to reach token endpoint: ${L}`)}let N=K.headers.get("Request-Id");if(!K.ok){let L=await K.text().catch(()=>"");throw new K$(`User OAuth refresh failed (HTTP ${K.status}): ${t$(L)}`,K.status,t$(L),N)}let H=await u8(K,N),V=Number(H.expires_in);if(!Number.isFinite(V))throw new K$(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(t$(H))}`,K.status,t$(H),N);let O=Z4()+V,B=H.refresh_token||G;return await m8($.credentialsPath,{...z,version:n8,type:"oauth_token",access_token:H.access_token,expires_at:O,refresh_token:B}),{token:H.access_token,expiresAt:O}}}function WY($,X){let J=$.authentication.credentials_path??null,Q=($.base_url||X.baseURL).replace(/\/+$/,""),z=tL($,J,Q,X),Y={};if($.workspace_id&&$.authentication.type==="user_oauth")Y["anthropic-workspace-id"]=$.workspace_id;return{provider:z,extraHeaders:Y,baseURL:$.base_url||void 0}}async function tw($,X){let J=await iw(X);if(!J)return null;let{config:Q,fromFile:z}=J,Y=Q.authentication.credentials_path||!z?Q:{...Q,authentication:{...Q.authentication,credentials_path:await nw(Q,X)??void 0}};return WY(Y,$)}function tL($,X,J,Q){switch($.authentication.type){case"oidc_federation":{let z=$.authentication,Y=aL(z);if(!Y)throw new K$("oidc_federation config requires an identity token (set authentication.identity_token, ANTHROPIC_IDENTITY_TOKEN_FILE, or ANTHROPIC_IDENTITY_TOKEN)");if(!z.federation_rule_id)throw new K$("oidc_federation config requires 'federation_rule_id'. Set it in authentication.federation_rule_id in your profile, or via ANTHROPIC_FEDERATION_RULE_ID (profile takes precedence).");if(!$.organization_id)throw new K$("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let W=rw({identityTokenProvider:Y,federationRuleId:z.federation_rule_id,organizationId:$.organization_id,serviceAccountId:z.service_account_id,workspaceId:$.workspace_id,baseURL:J,fetch:Q.fetch,userAgent:Q.userAgent});if(X)return sL(W,X,Q.onCacheWriteError,Q.onSafetyWarning);return W}case"user_oauth":{if(!X)throw new K$("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to <config_dir>/credentials/<profile>.json)");return ow({credentialsPath:X,clientId:$.authentication.client_id,baseURL:J,fetch:Q.fetch,userAgent:Q.userAgent,onSafetyWarning:Q.onSafetyWarning})}default:{let z=$.authentication.type;throw new K$(`authentication.type "${z}" is not a known authentication type`)}}}function aL($){if($.identity_token){let Q=$.identity_token.source;if(Q!=="file")throw new K$(`identity_token.source "${Q}" is not supported by this SDK version (only "file")`);if(!$.identity_token.path)throw new K$('identity_token.source "file" requires a non-empty path');return YY($.identity_token.path)}let X=w$("ANTHROPIC_IDENTITY_TOKEN_FILE");if(X)return YY(X);let J=w$("ANTHROPIC_IDENTITY_TOKEN");if(J)return dw(J);return null}function sL($,X,J,Q){return async(z)=>{let Y=await import("node:fs");await l8(X,Q);let W;try{let U=await Y.promises.readFile(X,"utf-8");W=JSON.parse(U);let w=W?.access_token;if(w&&!z?.forceRefresh){let K=W?.expires_at;if(K==null||Z4()<K-_1)return{token:w,expiresAt:K??null}}}catch(U){if(U?.code!=="ENOENT"&&!(U instanceof SyntaxError))J?.(U)}let G=await $(z);try{await m8(X,{...W??{},version:n8,type:"oauth_token",access_token:G.token,expires_at:G.expiresAt})}catch(U){J?.(U)}return G}}var Y4,W4;class L6{constructor(){Y4.set(this,void 0),W4.set(this,void 0),k(this,Y4,new Uint8Array,"f"),k(this,W4,null,"f")}decode($){if($==null)return[];let X=$ instanceof ArrayBuffer?new Uint8Array($):typeof $==="string"?x1($):$;k(this,Y4,lw([D(this,Y4,"f"),X]),"f");let J=[],Q;while((Q=eL(D(this,Y4,"f"),D(this,W4,"f")))!=null){if(Q.carriage&&D(this,W4,"f")==null){k(this,W4,Q.index,"f");continue}if(D(this,W4,"f")!=null&&(Q.index!==D(this,W4,"f")+1||Q.carriage)){J.push(JY(D(this,Y4,"f").subarray(0,D(this,W4,"f")-1))),k(this,Y4,D(this,Y4,"f").subarray(D(this,W4,"f")),"f"),k(this,W4,null,"f");continue}let z=D(this,W4,"f")!==null?Q.preceding-1:Q.preceding,Y=JY(D(this,Y4,"f").subarray(0,z));J.push(Y),k(this,Y4,D(this,Y4,"f").subarray(Q.index),"f"),k(this,W4,null,"f")}return J}flush(){if(!D(this,Y4,"f").length)return[];return this.decode(`
12
12
  `)}}Y4=new WeakMap,W4=new WeakMap;L6.NEWLINE_CHARS=new Set([`
13
13
  `,"\r"]);L6.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function eL($,X){for(let z=X??0;z<$.length;z++){if($[z]===10)return{preceding:z,index:z+1,carriage:!1};if($[z]===13)return{preceding:z,index:z+1,carriage:!0}}return null}function aw($){for(let Q=0;Q<$.length-1;Q++){if($[Q]===10&&$[Q+1]===10)return Q+2;if($[Q]===13&&$[Q+1]===13)return Q+2;if($[Q]===13&&$[Q+1]===10&&Q+3<$.length&&$[Q+2]===13&&$[Q+3]===10)return Q+4}return-1}var e0;class G4{constructor($,X,J){this.iterator=$,e0.set(this,void 0),this.controller=X,k(this,e0,J,"f")}static fromSSEResponse($,X,J){let Q=!1,z=J?S$(J):console;async function*Y(){if(Q)throw new T("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");Q=!0;let W=!1;try{for await(let G of $F($,X)){if(G.event==="completion")try{yield JSON.parse(G.data)}catch(U){throw z.error("Could not parse message into JSON:",G.data),z.error("From chunk:",G.raw),U}if(G.event==="message_start"||G.event==="message_delta"||G.event==="message_stop"||G.event==="content_block_start"||G.event==="content_block_delta"||G.event==="content_block_stop"||G.event==="message"||G.event==="user.message"||G.event==="user.interrupt"||G.event==="user.tool_confirmation"||G.event==="user.custom_tool_result"||G.event==="agent.message"||G.event==="agent.thinking"||G.event==="agent.tool_use"||G.event==="agent.tool_result"||G.event==="agent.mcp_tool_use"||G.event==="agent.mcp_tool_result"||G.event==="agent.custom_tool_use"||G.event==="agent.thread_context_compacted"||G.event==="session.status_running"||G.event==="session.status_idle"||G.event==="session.status_rescheduled"||G.event==="session.status_terminated"||G.event==="session.error"||G.event==="session.deleted"||G.event==="span.model_request_start"||G.event==="span.model_request_end")try{yield JSON.parse(G.data)}catch(U){throw z.error("Could not parse message into JSON:",G.data),z.error("From chunk:",G.raw),U}if(G.event==="ping")continue;if(G.event==="error"){let U=f8(G.data)??G.data,w=U?.error?.type;throw new k$(void 0,U,void 0,$.headers,w)}}W=!0}catch(G){if(r4(G))return;throw G}finally{if(!W)X.abort()}}return new G4(Y,X,J)}static fromReadableStream($,X,J){let Q=!1;async function*z(){let W=new L6,G=a0($);for await(let U of G)for(let w of W.decode(U))yield w;for(let U of W.flush())yield U}async function*Y(){if(Q)throw new T("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");Q=!0;let W=!1;try{for await(let G of z()){if(W)continue;if(G)yield JSON.parse(G)}W=!0}catch(G){if(r4(G))return;throw G}finally{if(!W)X.abort()}}return new G4(Y,X,J)}[(e0=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let $=[],X=[],J=this.iterator(),Q=(z)=>{return{next:()=>{if(z.length===0){let Y=J.next();$.push(Y),X.push(Y)}return z.shift()}}};return[new G4(()=>Q($),this.controller,D(this,e0,"f")),new G4(()=>Q(X),this.controller,D(this,e0,"f"))]}toReadableStream(){let $=this,X;return eQ({async start(){X=$[Symbol.asyncIterator]()},async pull(J){try{let{value:Q,done:z}=await X.next();if(z)return J.close();let Y=x1(JSON.stringify(Q)+`
14
14
  `);J.enqueue(Y)}catch(Q){J.error(Q)}},async cancel(){await X.return?.()}})}}async function*$F($,X){if(!$.body){if(X.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative")throw new T("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api");throw new T("Attempted to iterate over a response with no body")}let J=new sw,Q=new L6,z=a0($.body);for await(let Y of XF(z))for(let W of Q.decode(Y)){let G=J.decode(W);if(G)yield G}for(let Y of Q.flush()){let W=J.decode(Y);if(W)yield W}}async function*XF($){let X=new Uint8Array;for await(let J of $){if(J==null)continue;let Q=J instanceof ArrayBuffer?new Uint8Array(J):typeof J==="string"?x1(J):J,z=new Uint8Array(X.length+Q.length);z.set(X),z.set(Q,X.length),X=z;let Y;while((Y=aw(X))!==-1)yield X.slice(0,Y),X=X.slice(Y)}if(X.length>0)yield X}class sw{constructor(){this.event=null,this.data=[],this.chunks=[]}decode($){if($.endsWith("\r"))$=$.substring(0,$.length-1);if(!$){if(!this.event&&!this.data.length)return null;let z={event:this.event,data:this.data.join(`